diff --git a/.gitignore b/.gitignore index c9c9ce23..87ef6bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -104,10 +104,12 @@ typings/ .serverless packages/*/.nsi.json - +package-lock.json packages/*/node_modules/ */**/package-lock.json dist.zip sherlock.json +examples/* +TODO # End of https://www.gitignore.io/api/node,macos \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/README.md b/README.md index 0748cc49..c7365ff6 100644 --- a/README.md +++ b/README.md @@ -149,4 +149,4 @@ Your PRs and stars are always welcome :). Checkout the [Contributing](https://gi ## License -MIT +MIT \ No newline at end of file diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 00000000..16ad2401 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,12 @@ +image: node:10.16.3 + +pipelines: + pull-requests: + '**': + - step: + script: + - apt-get update + - apt-get install zip + - npm install --unsafe-perm + - npm run test + - npm run autotest:prod diff --git a/checklist.txt b/checklist.txt new file mode 100644 index 00000000..ea1de6bf --- /dev/null +++ b/checklist.txt @@ -0,0 +1,22 @@ +Checklist to release a new version to NPM: + * Make sure DataModel has been released first + * Clone Muze repository from Github if needed + * Checkout develop branch and make sure develop branch is up-to-date with remote + * If git flow is not initialized yet, Run: git flow init + * Create a new release branch, Run: git flow release start + * Delete all existing npm dependencies, Run: rm -rf node_modules package-lock.json packages/*/node_modules packages/*/package-lock.json + * Make sure DataModel's latest version is configured in packages/muze-utils/package.json + * Install dependencies again, Run: npm install + * Update LICENSE file if needed + * Update README.md file if needed + * Create a release-ready build, Run: node scripts/make-release-build.js + * Now release files would be created in release folder and ready to release + * Test the release/dist/* files if needed + * Now commit all the changes including release folder (so that other person can release from different system) with this message: "Make a build and bump version" + * Then finish the release, Run: git flow release finish [-s] and enter release notes + * Push all changes and tags to remote, Run: git push origin master && git push origin develop && git push origin --tags + * Edit the title of the released tag in Github + * When everything is fine, it's ready to release + * Checkout master branch + * Change current directory, Run: cd release + * Now if everything is fine, release it to npm, Run: npm publish \ No newline at end of file diff --git a/dist/muze.css b/dist/muze.css index 395d455d..48a75f3e 100644 --- a/dist/muze.css +++ b/dist/muze.css @@ -1 +1 @@ -.muze-selection-box-group{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-tooltip-box{opacity:.9;border:1px solid hsla(0,0%,59.2%,.19);background:#fbfbfb;-webkit-box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);font-size:12px;color:#5f5f5f;-webkit-border-radius:1px;border-radius:1px;padding-top:4px;display:inline-block;pointer-events:none;z-index:9999999999;text-align:left}.muze-tooltip-row{padding-bottom:2px;padding-top:2px;overflow:auto}.muze-tooltip-selected-row{background-color:#ebebeb}.muze-tooltip-row:last-child{padding-bottom:4px}.muze-tooltip-value{color:#5f5f5f;float:right;margin-left:10px}.muze-tooltip-connectors path{stroke-width:2px;stroke:#c7c7be;stroke-linejoin:round;stroke-linecap:round}.muze-tooltip-arrow-bottom{border-top:10px solid #fbfbfb;border-left:5px solid transparent;border-right:5px solid transparent;right:0}.muze-tooltip-arrow-right{border-left:10px solid #fbfbfb;right:-10px}.muze-tooltip-arrow-left,.muze-tooltip-arrow-right{border-top:5px solid transparent;border-bottom:5px solid transparent}.muze-tooltip-arrow-left{border-right:10px solid #fbfbfb;right:0;left:-10px}.muze-tooltip-arrow-top{border-bottom:10px solid #fbfbfb;border-left:5px solid transparent;border-right:5px solid transparent;right:0}.muze-tooltip-background-arrow-top{border-bottom:12px solid hsla(0,0%,59.2%,.19);top:0}.muze-tooltip-background-arrow-bottom,.muze-tooltip-background-arrow-top{border-left:6px solid transparent;border-right:6px solid transparent;right:0}.muze-tooltip-background-arrow-bottom{border-top:12px solid hsla(0,0%,59.2%,.19);top:102%}.muze-tooltip-background-arrow-right{border-left:12px solid hsla(0,0%,59.2%,.19);border-top:6px solid transparent;border-bottom:6px solid transparent;right:-12px}.muze-tooltip-background-arrow-left{border-right:12px solid hsla(0,0%,59.2%,.19);border-top:6px solid transparent;border-bottom:6px solid transparent;right:0;left:-12px}.muze-tooltip-content-container{float:none!important}.muze-tooltip-html-container{margin-left:10px;margin-right:10px}.muze-tooltip-content svg{margin-left:10px;margin-right:5px}.muze-tooltip-content-container-selectionSummary .muze-tooltip-content{margin-left:3px;margin-right:3px}.muze-tooltip-value{margin-right:24px;margin-left:24px}.muze-tooltip-first{font-weight:600;font-size:15px;margin-left:15px}.muze-tooltip-table-tbody td{padding:3px}.muze-tooltip-table-row-0{font-weight:700}.muze-tooltip-content-container{border-bottom:1px solid #e9e9e9}.muze-tooltip-content-parent-container :last-child{border-bottom:none}.muze-crossband{stroke-opacity:0;fill:grey;fill-opacity:.2}.muze-crossline{stroke:#979797;stroke-dasharray:5,7;fill:#979797;opacity:.65}.muze-anchors-group{pointer-events:none}.muze-simple-axis text{text-align:center;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-ticks{font-style:"normal";fill:#858585}.muze-tick-lines,.muze-ticks{font-size:12px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-tick-lines{stroke:#efefef}.muze-axis-name{font-size:14px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;fill:#5f5f5f}.muze-axis-name.hidden{display:none}.muze-fadeout-interaction{stroke-opacity:.3}.muze-layer-line{stroke-linejoin:round;stroke-width:2px;stroke:#086bb6}.muze-layer-area{stroke-linejoin:round;fill:#086bb6;fill-opacity:.7}.muze-layer-arc-highlight{fill:#7f7f7f!important}.muze-layer-arc-fadeout{fill-opacity:.3!important}.muze-layer-arc-selected{fill:#e6e6e6!important}.muze-layer-arc{fill:#086bb6}.muze-layer-text text{font-size:12px;fill:#000}.muze-layer-text rect{fill:#7f7f7f;fill-opacity:.3}.muze-layer-text-highlight{fill-opacity:1}.muze-layer-text-fadeout{fill-opacity:.3!important}.muze-layer-text-selected{fill:#000!important}.muze-layer-point{fill-opacity:.5;stroke-opacity:.5;fill:#086bb6;stroke:#086bb6}.muze-layer-point-highlight{stroke-width:2px!important;fill-opacity:0;stroke-opacity:1}.muze-layer-point-fadeout{fill-opacity:.3!important;fill:#7f7f7f!important;stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-point-selected{fill:#000!important}.muze-layer-bar,.muze-layer-bar-highlight{fill-opacity:1}.muze-layer-bar-fadeout{fill-opacity:.2!important}.muze-layer-bar-selected{fill:#4682b4!important}.muze-layer-tick{stroke-opacity:.7;stroke:#f44336}.muze-layer-tick-highlight{stroke-opacity:1}.muze-layer-tick-fadeout{stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-tick-selected{stroke:#000!important}.muze-visual-unit{background:transparent}.muze-axis-zero-line{stroke-width:1px}.muze-grid-band-x-0,.muze-grid-band-y-0{fill-opacity:0}.muze-unit{-webkit-touch-callout:none;-webkit-user-select:none}.muze-legend-box,.muze-legend-item-info,.muze-legend-title{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-legend-box{line-height:10px!important;height:100px;display:inline-block}.muze-legend-title{display:table;-webkit-box-align:center;-webkit-align-items:center;align-items:center;float:left;text-align:left;font-size:14px;height:30px;fill:#5f5f5f;font-weight:600}.muze-legend-title-text{display:table-cell;vertical-align:middle}.muze-legend-overflow{text-align:center}.muze-legend-icon,.muze-legend-icon-svg{cursor:pointer}.muze-overflow-y{overflow-y:scroll}.muze-overflow-x{overflow-x:scroll}.muze-legend-fadeout{fill-opacity:.3;opacity:.3}.muze-legend-brighten{fill-opacity:1}.muze-legend-item-info{float:left;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;cursor:pointer;font-size:12px}.muze-legend-item-info.center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.muze-legend-item-info.start{-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.muze-legend-item-info.end{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.muze-legend-selection-box{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-text-cell{font-size:14px;text-align:center;color:#5f5f5f;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap;-webkit-transform-origin:0 0;transform-origin:0 0}.muze-header-cell{font-size:16px}.muze-header-cell,.muze-subheader-cell{text-align:center;color:#858585;font-weight:800;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap}.muze-subheader-cell{font-size:15px}.muze-scroll-bar{background:#f8f8f8;position:relative;font-size:10px}.muze-scroll-arrow{float:left;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background:#a2a2a2;color:#fff}.muze-scroll-arrow-left{height:100%;width:20px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-right{height:100%;width:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.muze-scroll-arrow-right,.muze-scroll-arrow-top{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.muze-scroll-arrow-top{width:100%;height:20px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-bottom{width:100%;height:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.muze-scroll-rect{float:left;position:relative}.muze-scroll-mover{position:absolute;-webkit-border-radius:3px;background:#a2a2a2;cursor:-webkit-grab;border-radius:3px}.muze-scroll-mover:active{cursor:-webkit-grabbing}.muze-scroll-arrow-chevron{position:relative;text-align:center;padding:1px;margin-bottom:0}.muze-scroll-arrow-chevron:after,.muze-scroll-arrow-chevron:before{content:"";position:absolute;background:#fff}#muze-scroll-arrow-chevron-bottom,#muze-scroll-arrow-chevron-top{height:1px;width:6px}#muze-scroll-arrow-chevron-left,#muze-scroll-arrow-chevron-right{width:1px;height:6px}#muze-scroll-arrow-chevron-bottom:before{top:0;left:0;height:100%;width:51%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-bottom:after{right:0;width:50%}#muze-scroll-arrow-chevron-bottom:after,#muze-scroll-arrow-chevron-top:before{top:0;height:100%;-webkit-transform:skew(0deg,-35deg);transform:skew(0deg,-35deg)}#muze-scroll-arrow-chevron-top:before{left:0;width:51%}#muze-scroll-arrow-chevron-top:after{top:0;right:0;height:100%;width:50%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-right:before{top:0;left:0;height:51%;width:100%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-right:after{bottom:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}#muze-scroll-arrow-chevron-left:before{bottom:0;left:0;width:100%;height:51%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-left:after{top:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkido18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7qsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7jsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7rsDJB9cme_xc.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7ksDJB9cme_xc.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7osDJB9cme_xc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7psDJB9cme_xc.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDJB9cme.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklyds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.muze-group-container,.muze-subtitle-cell,.muze-title-cell{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-group-container{font-size:14px;-webkit-tap-highlight-color:rgba(0,0,0,0);line-height:1.42857143;color:#333;background-color:transparent;margin:0}.muze-group-container *,.muze-group-container :after,.muze-group-container :before{-webkit-box-sizing:border-box;box-sizing:border-box}.muze-group-container .muze-table-arrow{margin:5px;width:0;height:0;position:absolute;opacity:.5;z-index:10;cursor:pointer}.muze-group-container .muze-table-arrow:hover{opacity:1}.muze-group-container .muze-table-arrow-right{left:100%;border-left:15px solid #4682b4}.muze-group-container .muze-table-arrow-left,.muze-group-container .muze-table-arrow-right{top:-webkit-calc(50% - 25px);top:calc(50% - 25px);border-top:20px solid transparent;border-bottom:20px solid transparent}.muze-group-container .muze-table-arrow-left{right:100%;border-right:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom{top:100%;border-top:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom,.muze-group-container .muze-table-arrow-top{left:-webkit-calc(50% - 25px);left:calc(50% - 25px);border-left:20px solid transparent;border-right:20px solid transparent}.muze-group-container .muze-table-arrow-top{bottom:100%;border-bottom:15px solid #4682b4}.muze-group-container .table-row-nested{visibility:hidden;border-top:none}.muze-group-container svg{display:block;width:inherit;height:inherit;float:left;vertical-align:top}.muze-group-container .axisName.hidden{opacity:0}.muze-group-container .axisName{opacity:1}.muze-group-container .grid-td svg{max-width:100%;max-height:100%}.muze-group-container .domain{opacity:0}.muze-board{float:left}.muze-layout-container{float:left;position:relative}.muze-board-legend,.muze-legend-section{text-align:center;float:left}.muze-legend-horizontal-section{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.muze-legend-components{text-align:center;float:left}.muze-grid-layout,.muze-grid-layout-container,.muze-grid-layout-row{float:left;position:relative}.muze-grid-table{background-color:transparent;border-spacing:0;table-layout:fixed}.muze-grid-td,.muze-grid-th{padding:0}.muze-table-header{width:inherit;height:inherit}.muze-grid-layout,.muze-layout-grid-container{float:left;position:relative}.muze-grid div{float:left}.muze-grid div,.muze-grid table{border-collapse:collapse}.muze-title-cell{font-size:24px;font-weight:700;color:#5f5f5f}.muze-grid-headers{font-size:14px;font-weight:700}.muze-subtitle-cell{font-size:16px;font-weight:400;color:#b1b1b1}.domain{opacity:0}.muze-group-container,.muze-layout-container,.muze-legend-container{float:left}.muze-message-container{background-color:#f1f1f1;display:table;border:1px solid #c3c9d0}.muze-message-container-child{vertical-align:middle;text-align:center;font-size:18px;color:#8c8d8e;display:table-cell}.hidden{display:none} \ No newline at end of file +.muze-simple-axis text{text-align:center;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-ticks{font-style:"normal";fill:#858585}.muze-tick-lines,.muze-ticks{font-size:12px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-tick-lines{stroke:#efefef}.muze-axis-name{font-size:14px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;fill:#5f5f5f}.muze-axis-name.hidden{display:none}.muze-fadeout-interaction{stroke-opacity:.3}.muze-layer-line{stroke-linejoin:round;stroke-width:2px;stroke:#1f77b4}.muze-layer-area{stroke-linejoin:round}.muze-layer-arc-highlight{fill:#7f7f7f!important}.muze-layer-arc-fadeout{fill-opacity:.3!important}.muze-layer-arc-selected{fill:#e6e6e6!important}.muze-layer-arc{fill:#1f77b4}.muze-layer-text text{font-size:12px;fill:#000}.muze-layer-text rect{fill:#7f7f7f;fill-opacity:.3}.muze-layer-text-highlight{fill-opacity:1}.muze-layer-text-fadeout{fill-opacity:.3!important}.muze-layer-text-selected{fill:#000!important}.muze-layer-point{fill-opacity:.5}.muze-layer-bar{fill-opacity:1;stroke:none;stroke-width:0}.muze-layer-bar-highlight{fill-opacity:1}.muze-layer-bar-fadeout{fill-opacity:.2!important}.muze-layer-bar-selected{fill:#4682b4!important}.muze-layer-tick{stroke-opacity:.7;stroke:#f44336}.muze-layer-tick-highlight{stroke-opacity:1}.muze-layer-tick-fadeout{stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-tick-selected{stroke:#000!important}.muze-selection-box-group{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-tooltip-box{opacity:1;border:1px solid hsla(0,0%,59.2%,.19);background:#fbfbfb;-webkit-box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);font-size:12px;color:#5f5f5f;-webkit-border-radius:1px;border-radius:1px;padding-top:4px;display:inline-block;pointer-events:none;z-index:9999999999;text-align:left}.muze-tooltip-row{padding-bottom:2px;padding-top:2px;overflow:auto}.muze-tooltip-parent-container{pointer-events:none;z-index:9999999999}.muze-tooltip-stacked-row{color:#828282;margin-left:10px;font-size:12px;font-weight:600;line-height:"15px"}.muze-tooltip-stacked-row-key{margin-left:10px}.muze-tooltip-stacked-row-value{margin-left:2px}.muze-tooltip-stacked-percentage{font-size:10px;color:#828282;margin-left:-20px;margin-right:20px;float:right;line-height:17px}.muze-tooltip-selected-row{background-color:#ebebeb}.muze-tooltip-row:last-child{padding-bottom:4px}.muze-tooltip-value{color:#5f5f5f;float:right;margin-left:10px}.muze-tooltip-connectors path{stroke-width:2px;stroke:#c7c7be;stroke-linejoin:round;stroke-linecap:round}.muze-tooltip-html-container{margin-left:10px;margin-right:10px}.muze-tooltip-content svg{margin-left:10px;margin-right:5px}.muze-tooltip-value{margin-right:24px;margin-left:24px}.muze-tooltip-first{font-weight:600;font-size:15px;margin-left:15px}.muze-tooltip-table-tbody td{padding:3px}.muze-tooltip-table-row-0{font-weight:700}.muze-tooltip-content-parent-container :last-child{border-bottom:none}.muze-tooltip-content-parent-container{display:inline-block}.muze-tooltip-content-container-highlightSummary{border-right:1px solid #e9e9e9}.muze-tooltip-content-container-selectionSummary-crosstab{display:inline-block}.muze-tooltip-content-container-selectionSummary-default{border-bottom:1px solid #e9e9e9}.muze-tooltip-content-container-highlightSummary-crosstab{float:left}.muze-tooltip-content-container-selectionSummary .muze-tooltip-content{margin-left:3px;margin-right:3px}.muze-crossband{stroke-opacity:0;fill:grey;fill-opacity:.2}.muze-crossline{stroke:#979797;stroke-dasharray:5,7;fill:#979797;opacity:.65}.muze-anchors-group{pointer-events:none}.muze-anchors-group-lower .muze-layer-point,.muze-anchors-group-upper .muze-layer-point,.muze-anchors-group .muze-layer-point,.muze-brush-anchors-lower .muze-layer-point,.muze-brush-anchors-upper .muze-layer-point,.muze-persistent-anchors-lower .muze-layer-point,.muze-persistent-anchors-upper .muze-layer-point,.muze-persistent-anchors .muze-layer-point{fill-opacity:1}.muze-axis-ticks-highlight{font-weight:700;fill:#595959}.muze-axis-ticks-unhighlight{font-weight:400;fill:#858585}.muze-visual-unit{background:transparent}.muze-axis-zero-line{stroke-width:1px}.muze-grid-band-x-0,.muze-grid-band-y-0{fill-opacity:0}.muze-unit{-webkit-touch-callout:none;-webkit-user-select:none}.muze-legend-box,.muze-legend-item-info,.muze-legend-title{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-legend-box{line-height:10px!important;height:100px;display:inline-block}.muze-legend-title{display:table;-webkit-box-align:center;-webkit-align-items:center;align-items:center;float:left;text-align:left;font-size:14px;height:30px;fill:#5f5f5f;font-weight:600}.muze-legend-title-text{display:table-cell;vertical-align:middle}.muze-legend-overflow{text-align:center}.muze-legend-icon,.muze-legend-icon-svg{cursor:pointer}.muze-overflow-y{overflow-y:scroll}.muze-overflow-x{overflow-x:scroll}.muze-legend-fadeout{fill-opacity:.3}.muze-legend-fadeout path{stroke-width:1px;fill-opacity:0}.muze-legend-brighten{fill-opacity:1}.muze-legend-item-info{float:left;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;cursor:pointer;font-size:12px}.muze-legend-item-info.center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.muze-legend-item-info.start{-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.muze-legend-item-info.end{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.muze-legend-selection-box{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-legend-marker{stroke:#e2e2e2;stroke-width:1px;fill:#797474}.muze-legend-marker-show{display:block}.muze-legend-marker-hide{display:none}.muze-legend-marker-text-container{position:relative}.muze-legend-marker-text{position:absolute}.muze-legend-marker-text div{text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff;pointer-events:none}.muze-text-cell{font-size:12px;color:#5f5f5f;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:15px;white-space:nowrap;-webkit-transform-origin:0 0;transform-origin:0 0}.muze-header-cell{font-size:16px}.muze-header-cell,.muze-subheader-cell{text-align:center;color:#858585;font-weight:800;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap}.muze-subheader-cell{font-size:15px}.muze-scroll-bar{background:#f8f8f8;position:relative;font-size:10px}.muze-scroll-arrow{float:left;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background:#a2a2a2;color:#fff}.muze-scroll-arrow-left{height:100%;width:20px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-right{height:100%;width:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.muze-scroll-arrow-right,.muze-scroll-arrow-top{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.muze-scroll-arrow-top{width:100%;height:20px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-bottom{width:100%;height:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.muze-scroll-rect{float:left;position:relative}.muze-scroll-mover{position:absolute;-webkit-border-radius:3px;background:#a2a2a2;cursor:-webkit-grab;border-radius:3px}.muze-scroll-mover:active{cursor:-webkit-grabbing}.muze-scroll-arrow-chevron{position:relative;text-align:center;padding:1px;margin-bottom:0}.muze-scroll-arrow-chevron:after,.muze-scroll-arrow-chevron:before{content:"";position:absolute;background:#fff}#muze-scroll-arrow-chevron-bottom,#muze-scroll-arrow-chevron-top{height:1px;width:6px}#muze-scroll-arrow-chevron-left,#muze-scroll-arrow-chevron-right{width:1px;height:6px}#muze-scroll-arrow-chevron-bottom:before{top:0;left:0;height:100%;width:51%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-bottom:after{right:0;width:50%}#muze-scroll-arrow-chevron-bottom:after,#muze-scroll-arrow-chevron-top:before{top:0;height:100%;-webkit-transform:skew(0deg,-35deg);transform:skew(0deg,-35deg)}#muze-scroll-arrow-chevron-top:before{left:0;width:51%}#muze-scroll-arrow-chevron-top:after{top:0;right:0;height:100%;width:50%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-right:before{top:0;left:0;height:51%;width:100%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-right:after{bottom:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}#muze-scroll-arrow-chevron-left:before{bottom:0;left:0;width:100%;height:51%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-left:after{top:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}.muze-grid-normal{border-color:#ebebeb}.muze-grid-normal .muze-axis-name{font-size:12px;line-height:15px}.muze-grid-dark{border-color:#cbcbcb}.muze-grid-dark .muze-axis-name{font-size:12px;line-height:15px}.muze-grid-dark-bottom{border-bottom-color:#cbcbcb}.muze-grid-darker-top{border-top-color:#979797}.muze-grid-dark-top{border-top-color:#cbcbcb}.muze-grid-dark-right{border-right-color:#cbcbcb}.muze-grid-darker-bottom{border-bottom-color:#979797}.muze-grid-dark-left{border-left-color:#cbcbcb}.muze-grid-none-left{border-left-color:transparent}.muze-grid-none-right{border-right-color:transparent}.muze-grid-none-top{border-top-color:transparent}.muze-grid-none-bottom{border-bottom-color:transparent}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkido18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7qsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7jsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7rsDJB9cme_xc.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7ksDJB9cme_xc.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7osDJB9cme_xc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7psDJB9cme_xc.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDJB9cme.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklyds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.muze-group-container,.muze-subtitle-cell,.muze-title-cell{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-group-container{font-size:12px;line-height:15px;-webkit-tap-highlight-color:rgba(0,0,0,0);line-height:1.42857143;color:#5f5f5f;background-color:transparent;margin:0}.muze-group-container *,.muze-group-container :after,.muze-group-container :before{-webkit-box-sizing:border-box;box-sizing:border-box}.muze-group-container .muze-table-arrow{margin:5px;width:0;height:0;position:absolute;opacity:.5;z-index:10;cursor:pointer}.muze-group-container .muze-table-arrow:hover{opacity:1}.muze-group-container .muze-table-arrow-right{left:100%;border-left:15px solid #4682b4}.muze-group-container .muze-table-arrow-left,.muze-group-container .muze-table-arrow-right{top:-webkit-calc(50% - 25px);top:calc(50% - 25px);border-top:20px solid transparent;border-bottom:20px solid transparent}.muze-group-container .muze-table-arrow-left{right:100%;border-right:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom{top:100%;border-top:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom,.muze-group-container .muze-table-arrow-top{left:-webkit-calc(50% - 25px);left:calc(50% - 25px);border-left:20px solid transparent;border-right:20px solid transparent}.muze-group-container .muze-table-arrow-top{bottom:100%;border-bottom:15px solid #4682b4}.muze-group-container .table-row-nested{visibility:hidden;border-top:none}.muze-group-container svg{display:block;width:inherit;height:inherit;float:left;vertical-align:top}.muze-group-container .axisName.hidden{opacity:0}.muze-group-container .axisName{opacity:1}.muze-group-container .grid-td svg{max-width:100%;max-height:100%}.muze-group-container .domain{opacity:0}.muze-board{float:left}.muze-layout-container{float:left;position:relative}.muze-board-legend,.muze-legend-section{text-align:center;float:left}.muze-legend-horizontal-section{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.muze-legend-components{text-align:center;float:left}.muze-grid-layout,.muze-grid-layout-container,.muze-grid-layout-row{float:left;position:relative}.muze-grid-table{background-color:transparent;border-spacing:0;table-layout:fixed}.muze-grid-td,.muze-grid-th{padding:0}.muze-table-header{width:inherit;height:inherit}.muze-grid-layout,.muze-layout-grid-container{float:left;position:relative}.muze-grid-top{position:relative;top:100%;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.muze-grid div{float:left}.muze-grid div,.muze-grid table{border-collapse:collapse}.muze-title-cell{font-size:24px;font-weight:700;color:#5f5f5f}.muze-grid-headers{font-size:12px}.muze-subtitle-cell{font-size:16px;font-weight:400;color:#b1b1b1}.domain{opacity:0}.muze-group-container,.muze-layout-container,.muze-legend-container{float:left}.muze-message-container{background-color:#f1f1f1;display:table;border:1px solid #c3c9d0}.muze-message-container-child{display:table-cell;vertical-align:middle}.muze-message-container-child-img{text-align:center}.muze-message-container-child-img svg{display:unset;float:unset}.muze-message-container-child-message{color:#4f708c;text-align:center;font-weight:600}.hidden{display:none} \ No newline at end of file diff --git a/dist/muze.js b/dist/muze.js index 620b574a..7267db07 100644 --- a/dist/muze.js +++ b/dist/muze.js @@ -1,2 +1,2 @@ -!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("muze",[],factory):"object"==typeof exports?exports.muze=factory():root.muze=factory()}(window,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=7)}([function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"name":"datamodel","description":"Relational algebra compliant in-memory tabular data store","homepage":"https://github.com/chartshq/datamodel","version":"2.2.3","license":"MIT","main":"dist/datamodel.js","keywords":["datamodel","data","relational","algebra","model","muze","fusioncharts","table","tabular","operation"],"author":"Muzejs.org (https://muzejs.org/)","repository":{"type":"git","url":"https://github.com/chartshq/datamodel.git"},"contributors":[{"name":"Akash Goswami","email":"akashgoswami90s@gmail.com"},{"name":"Subhash Haldar"},{"name":"Rousan Ali","email":"rousanali786@gmail.com","url":"https://rousan.io"},{"name":"Ujjal Kumar Dutta","email":"duttaujjalkumar@live.com"},{"name":"Ranajit Banerjee","email":"ranajit.113124@gmail.com"},{"name":"Adarsh Lilha","email":"adarshlilha@gmail.com"}],"dependencies":{"d3-dsv":"^1.0.8"},"devDependencies":{"babel-cli":"6.26.0","babel-core":"^6.26.3","babel-eslint":"6.1.2","babel-loader":"^7.1.4","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-flow":"^6.23.0","chai":"3.5.0","cross-env":"^5.0.5","eslint":"3.19.0","eslint-config-airbnb":"15.1.0","eslint-plugin-import":"2.7.0","eslint-plugin-jsx-a11y":"5.1.1","eslint-plugin-react":"7.3.0","istanbul-instrumenter-loader":"^3.0.0","jsdoc":"3.5.5","json2yaml":"^1.1.0","karma":"1.7.1","karma-chai":"0.1.0","karma-chrome-launcher":"2.1.1","karma-coverage-istanbul-reporter":"^1.3.0","karma-mocha":"1.3.0","karma-spec-reporter":"0.0.31","karma-webpack":"2.0.3","marked":"^0.5.0","mocha":"3.4.2","mocha-webpack":"0.7.0","transform-runtime":"0.0.0","webpack":"^4.12.0","webpack-cli":"^3.0.7","webpack-dev-server":"^3.1.4"},"scripts":{"test":"npm run lint && npm run ut","ut":"karma start karma.conf.js","utd":"karma start --single-run false --browsers Chrome karma.conf.js ","build":"npm run build:prod","build:dev":"webpack --mode development","build:prod":"webpack --mode production","start":"webpack-dev-server --config webpack.config.dev.js --mode development --open","lint":"eslint ./src","lint-errors":"eslint --quiet ./src","docs":"rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json"}}')},function(e,t,n){var r=n(2);e.exports=r.default?r.default:r},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"DataFormat",function(){return o}),n.d(r,"DimensionSubtype",function(){return u}),n.d(r,"MeasureSubtype",function(){return c}),n.d(r,"FieldType",function(){return f}),n.d(r,"FilteringMode",function(){return l}),n.d(r,"GROUP_BY_FUNCTIONS",function(){return s});var a={};n.r(a),n.d(a,"DSVArr",function(){return rt}),n.d(a,"DSVStr",function(){return mt}),n.d(a,"FlatJSON",function(){return yt}),n.d(a,"Auto",function(){return bt});var i={};n.r(i),n.d(i,"sum",function(){return un}),n.d(i,"avg",function(){return cn}),n.d(i,"min",function(){return fn}),n.d(i,"max",function(){return ln}),n.d(i,"first",function(){return sn}),n.d(i,"last",function(){return dn}),n.d(i,"count",function(){return pn}),n.d(i,"sd",function(){return hn});var o={FLAT_JSON:"FlatJSON",DSV_STR:"DSVStr",DSV_ARR:"DSVArr",AUTO:"Auto"},u={CATEGORICAL:"categorical",TEMPORAL:"temporal",GEO:"geo",BINNED:"binned"},c={CONTINUOUS:"continuous"},f={MEASURE:"measure",DIMENSION:"dimension"},l={NORMAL:"normal",INVERSE:"inverse",ALL:"all"},s={SUM:"sum",AVG:"avg",MIN:"min",MAX:"max",FIRST:"first",LAST:"last",COUNT:"count",STD:"std"};function d(e){return e instanceof Date?e:new Date(e)}function p(e){return e<10?"0"+e:e}function h(e){this.format=e,this.dtParams=void 0,this.nativeDate=void 0}RegExp.escape=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},h.TOKEN_PREFIX="%",h.DATETIME_PARAM_SEQUENCE={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6},h.defaultNumberParser=function(e){return function(t){var n;return isFinite(n=parseInt(t,10))?n:e}},h.defaultRangeParser=function(e,t){return function(n){var r,a=void 0;if(!n)return t;var i=n.toLowerCase();for(a=0,r=e.length;aa.getFullYear()&&(t=""+(i-1)+r),d(t).getFullYear()},formatter:function formatter(e){var t=d(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:"Y",index:0,extract:function extract(){return"(\\d{4})"},parser:h.defaultNumberParser(),formatter:function formatter(e){return d(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function t(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[i+1],-1!==r.indexOf(o)&&a.push({index:i,token:o});return a},h.formatAs=function(e,t){var n,r=d(e),a=h.findTokens(t),i=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=a.length;l=0;d--)(f=i[d].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(d=0;d0&&e.split(",").forEach(function(e){var n=e.split("-"),r=+n[0],a=+(n[1]||n[0]);if(a>=r)for(var i=r;i<=a;i+=1)t(i)})}var R=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U.CROSS,i=[],o=[],u=n||H,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,d=c.name+"."+f.name,p=Y(c,f);if(l===s)throw new Error("DataModels must have different alias names");return c.fields.forEach(function(e){var t=_({},e.schema());-1===p.indexOf(t.name)||r||(t.name=c.name+"."+t.name),i.push(t)}),f.fields.forEach(function(e){var t=_({},e.schema());-1!==p.indexOf(t.name)?r||(t.name=f.name+"."+t.name,i.push(t)):i.push(t)}),T(e._rowDiffset,function(n){var d=!1,h=void 0;T(t._rowDiffset,function(v){var m=[],y={};y[l]={},y[s]={},c.fields.forEach(function(e){m.push(e.partialField.data[n]),y[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}}),f.fields.forEach(function(e){-1!==p.indexOf(e.schema().name)&&r||m.push(e.partialField.data[v]),y[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}});var g=At(y[l]),b=At(y[s]);if(u(g,b,function(){return e.detachedRoot()},function(){return t.detachedRoot()},{})){var w={};m.forEach(function(e,t){w[i[t].name]=e}),d&&U.CROSS!==a?o[h]=w:(o.push(w),d=!0,h=n)}else if((a===U.LEFTOUTER||a===U.RIGHTOUTER)&&!d){var O={},_=c.fields.length-1;m.forEach(function(e,t){O[i[t].name]=t<=_?e:null}),d=!0,h=n,o.push(O)}})}),new on(o,i,{name:d})}function J(e,t){var n=""+e,r=""+t;return nr?1:0}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J;return e.length>1&&function e(t,n,r,a){if(r===n)return t;var i=n+Math.floor((r-n)/2);return e(t,n,i,a),e(t,i+1,r,a),function(e,t,n,r,a){for(var i=e,o=[],u=t;u<=r;u+=1)o[u]=i[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(i[l]=o[f],f+=1):f>r?(i[l]=o[c],c+=1):a(o[c],o[f])<=0?(i[l]=o[c],c+=1):(i[l]=o[f],f+=1)}(t,n,i,r,a),t}(e,0,e.length-1,t),e}var K=function K(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function W(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=""+e)==(t=""+t)?0:e>t?-1:1}}return n}(e.type,n)}function q(e,t){var n=new Map,r=[];return e.forEach(function(e){var a=e[t];n.has(a)?r[n.get(a)][1].push(e):(r.push([a,[e]]),n.set(a,r.length-1))}),r}function Z(e,t,n){var r={label:e[0]};return t.reduce(function(t,r,a){return t[r]=e[1].map(function(e){return e[n[a].index]}),t},r),r}function $(e,t,n){for(var r=void 0,a=void 0,i=void 0,o=n.length-1;o>=0;o--)r=n[o][0],a=n[o][1],(i=Ht(t,r))&&("function"==typeof a?z(e,function(e,t){return a(e[i.index],t[i.index])}):E(a)?function(){var n=q(e,i.index),r=a[a.length-1],o=a.slice(0,a.length-1),u=o.map(function(e){return Ht(t,e)});n.forEach(function(e){e.push(Z(e,o,u))}),z(n,function(e,t){var n=e[2],a=t[2];return r(n,a)}),e.length=0,n.forEach(function(t){e.push.apply(e,W(t[1]))})}():function(){var t=X(i,a);z(e,function(e,n){return t(e[i.index],n[i.index])})}())}var Q,ee=function e(t,n,r,a){if(0===t.length)return n;var i=t[0],o=new Map;n.reduce(function(e,t){var n=t[i.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e},o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var d=l.value,p=K(d,2),h=p[0],v=p[1],m=e(t.slice(1),v,r,a);o.set(h,m),Array.isArray(m)&&$(m,r,a)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function ne(e,t,n,r,a){var i={schema:[],data:[],uids:[]},o=(a=Object.assign({},{addUid:!1,columnWise:!1},a)).addUid,u=r&&r.length>0,c=[];if(n.split(",").forEach(function(t){for(var n=0;nn&&(n=a))}),[t,n]}}]),t}(),He=function(){function e(e,t){for(var n=0;n=i?c=!0:(r=e.charCodeAt(o++))===ut?f=!0:r===ct&&(f=!0,e.charCodeAt(o)===ut&&++o),e.slice(a+1,t-1).replace(/""/g,'"')}for(;o9999?"+"+st(t,6):st(t,4))+"-"+st(e.getUTCMonth()+1,2)+"-"+st(e.getUTCDate(),2)+(i?"T"+st(n,2)+":"+st(r,2)+":"+st(a,2)+"."+st(i,3)+"Z":a?"T"+st(n,2)+":"+st(r,2)+":"+st(a,2)+"Z":r||n?"T"+st(n,2)+":"+st(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function parse(e,t){var n,a,i=r(e,function(e,r){if(n)return n(e,r-1);a=e,n=t?function(e,t){var n=ft(e);return function(r,a){return t(n(r),a,e)}}(e,t):ft(e)});return i.columns=a||[],i},parseRows:r,format:function format(t,n){return null==n&&(n=lt(t)),[n.map(o).join(e)].concat(a(t,n)).join("\n")},formatBody:function formatBody(e,t){return null==t&&(t=lt(e)),a(e,t).join("\n")},formatRows:function formatRows(e){return e.map(i).join("\n")}}},ht=pt(","),vt=(ht.parse,ht.parseRows,ht.format,ht.formatBody,ht.formatRows,pt("\t"));vt.parse,vt.parseRows,vt.format,vt.formatBody,vt.formatRows;var gt,mt=function mt(e,t,n){n=Object.assign({},{firstRowHeader:!0,fieldSeparator:","},n);var r=pt(n.fieldSeparator);return rt(r.parseRows(e),t,n)},yt=function yt(e,t){if(!Array.isArray(t))throw new Error("Schema missing or is in an unsupported format");var n={},r=0,a=void 0,i=[],o=v(i),u=t.map(function(e){return e.name});return e.forEach(function(e){var t=[];u.forEach(function(i){i in n?a=n[i]:(n[i]=r++,a=r-1),t[a]=e[i]}),o.apply(void 0,t)}),[Object.keys(n),i]},bt=function bt(e,t,n){var r={FlatJSON:yt,DSVStr:mt,DSVArr:rt},a=D(e);if(!a)throw new Error("Couldn't detect the data format");return r[a](e,t,n)},wt=function wt(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,_t(a))):e._derivation.push({op:t,meta:r,criteria:a})})(t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},arguments[4]),function Dt(e,t){var n;(n=t._ancestorDerivation).push.apply(n,_t(e._ancestorDerivation).concat(_t(e._derivation)))}(e,t)},Nt=(Ot(gt={},l.NORMAL,{diffIndex:["rowDiffset"],calcDiff:[!0,!1]}),Ot(gt,l.INVERSE,{diffIndex:["rejectRowDiffset"],calcDiff:[!1,!0]}),Ot(gt,l.ALL,{diffIndex:["rowDiffset","rejectRowDiffset"],calcDiff:[!0,!0]}),gt),kt=function kt(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split("-")[0]+"-"+t}else e.push(""+t)},Tt=function Tt(e,t,n){var r=[],a=[],i=wt(Nt[n].calcDiff,2),o=i[0],u=i[1];return T(e,function(e){var n=t(e);n&&o&&kt(r,e,-1),!n&&u&&kt(a,e,-1)}),{rowDiffset:r.join(","),rejectRowDiffset:a.join(",")}},Ct=function Ct(e,t,n,r,a){var i={},o=function o(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e.getPartialFieldspace().fields,l=f.map(function(e){return e.formattedData()}),s=f.map(function(e){return e.data()});return a(c,function(e){return t(Et(f,l,s,e),e,o,i)},u)},It=function It(e,t,n){for(var r=n(e,t,0),a=1,i=e.length;a2&&void 0!==arguments[2]?arguments[2]:{},r=[],a=n.operation||"and",i=n.filterByMeasure||!1,o=function Mt(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map(function(e){return e.name()}).join(","),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t}(e),u=o.getFieldsConfig();return r=t.length?t.map(function(e){return n=void 0,r=(t=e).getData(),a=t.getFieldsConfig(),o=Object.keys(t.getFieldspace().getDimension()).filter(function(e){return e in u}),c=o.length,f=o.map(function(e){return a[e].index}),l=Object.keys(t.getFieldspace().getMeasure()).filter(function(e){return e in u}),s=t.getFieldspace().fieldsObj(),d=r.data,p=l.reduce(function(e,t){return e[t]=s[t].domain(),e},{}),h={},n=function n(e,t,_n){return t[e[_n]]},c&&d.forEach(function(e){var t=It(f,e,n);h[t]=1}),n=function n(e,t,_n2){return t[e[_n2]].internalValue},d.length?function(e){var t=!c||h[It(o,e,n)];return i?l.every(function(t){return e[t].internalValue>=p[t][0]&&e[t].internalValue<=p[t][1]})&&t:t}:function(){return!1};var t,n,r,a,o,c,f,l,s,d,p,h}):[function(){return!1}],"and"===a?o.select(function(e){return r.every(function(t){return t(e)})},{saveChild:!1}):o.select(function(e){return r.some(function(t){return t(e)})},{saveChild:!1})},xt=function xt(e,t,n,r,a){e._rowDiffset=t,e.__calculateFieldspace().calculateFieldsConfig(),Ft(n,e,L.SELECT,{config:r},a)},Lt=function Lt(e,t,n,r){var a=e.clone(n.saveChild),i=t;return n.mode===l.INVERSE&&(i=r.filter(function(e){return-1===t.indexOf(e)})),a._colIdentifier=i.join(","),a.__calculateFieldspace().calculateFieldsConfig(),Ft(e,a,L.PROJECT,{projField:t,config:n,actualProjField:i},null),a},Vt=function Vt(e){if((e=_({},e)).type||(e.type=f.DIMENSION),!e.subtype)switch(e.type){case f.MEASURE:e.subtype=c.CONTINUOUS;break;default:case f.DIMENSION:e.subtype=u.CATEGORICAL}return e},Bt=function Bt(e){return e.map(function(e){return function(e){var t=[c.CONTINUOUS],n=[u.CATEGORICAL,u.BINNED,u.TEMPORAL,u.GEO],r=e.type,a=e.subtype,i=e.name;switch(r){case f.DIMENSION:if(-1===n.indexOf(a))throw new Error("DataModel doesn't support dimension field subtype "+a+" used for "+i+" field");break;case f.MEASURE:if(-1===t.indexOf(a))throw new Error("DataModel doesn't support measure field subtype "+a+" used for "+i+" field");break;default:throw new Error("DataModel doesn't support field type "+r+" used for "+i+" field")}}(e=Vt(e)),e})},Yt=function Yt(e,t,n,r){n=Bt(n),r=Object.assign(Object.assign({},nt),r);var i=a[r.dataFormat];if(!i||"function"!=typeof i)throw new Error("No converter function found for "+r.dataFormat+" format");var u=i(t,n,r),c=wt(u,2),f=c[0],l=c[1];!function(e,t){n.forEach(function(e){var n=e.as;if(n){var r=t.indexOf(e.name);t[r]=n,e.name=n,delete e.as}})}(0,f);var s=tt(l,n,f),d=F.createNamespace(s,r.name);e._partialFieldspace=d,e._rowDiffset=l.length&&l[0].length?"0-"+(l[0].length-1):"";var p=[],h=d.fields,v=h.map(function(e){return e.data()}),m=h.map(function(e){return e.formattedData()});return T(e._rowDiffset,function(e){p[e]=Et(h,m,v,e)}),d._cachedValueObjects=p,e._colIdentifier=n.map(function(e){return e.name}).join(),e._dataFormat=r.dataFormat===o.AUTO?D(t):r.dataFormat,e},Ht=function Ht(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=a.nonTraversingModel,o=a.excludeModels||[];t!==i&&((!o.length||-1===o.indexOf(t))&&t.handlePropagation(n,r),t._children.forEach(function(t){var i=Gt(n,t);e(t,i,r,a)}))},Xt=function Xt(e,t,n,r){var a=void 0,i=void 0,o=n.propagationNameSpace,u=n.propagateToSource,c=n.sourceId,f=r.propagateInterpolatedValues,l=[];if(null===e&&!0!==r.persistent)l=[{criteria:[]}],a=[];else{var s,d=Object.values(o.mutableActions);!1!==u&&(d=d.filter(function(e){return e.config.sourceId!==c}));var p=d.filter(function(e){return(r.filterFn||function(){return!0})(e,r)}).map(function(e){return e.config.criteria}),h=[];if(!1!==u){var v=Object.values(o.mutableActions);v.forEach(function(e){var t=e.config;!1===t.applyOnSource&&t.action===r.action&&t.sourceId!==c&&(h.push(e.model),(a=v.filter(function(t){return t!==e}).map(function(e){return e.config.criteria})).length&&l.push({criteria:a,models:e.model,path:function Wt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t}(e.model)}))})}a=(s=[]).concat.apply(s,[].concat(_t(p),[e])).filter(function(e){return null!==e}),l.push({criteria:a,excludeModels:[].concat(h,_t(r.excludeModels||[]))})}var m=t.model,y=Object.assign({sourceIdentifiers:e,propagationSourceId:c},r),g=t.groupByModel;f&&g&&(i=Pt(g,a,{filterByMeasure:f}),Jt(g,i,y)),l.forEach(function(e){var t=Pt(m,e.criteria),n=e.path;if(n){var r=function(e,t){for(var n=0,r=t.length;n1?(a=e.clone(r.saveChild),xt(a,u[c[1]],e,n,t),[o,a]):o}(this,e,t,{saveChild:t.saveChild})}},{key:"isEmpty",value:function value(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:"clone",value:function value(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:"project",value:function value(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),a=Object.keys(r),i=t.mode,o=$t(e,a,r);return i===l.ALL?[Lt(this,o,{mode:l.NORMAL,saveChild:t.saveChild},a),Lt(this,o,{mode:l.INVERSE,saveChild:t.saveChild},a)]:Lt(this,o,t,a)}},{key:"getFieldsConfig",value:function value(){return this._fieldConfig}},{key:"calculateFieldsConfig",value:function value(){return this._fieldConfig=this._fieldspace.fields.reduce(function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e},{}),this}},{key:"dispose",value:function value(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach(function(e){e._parent=null}),this._children=[]}},{key:"removeChild",value:function value(e){var t=this._children.findIndex(function(t){return t===e});-1===t||this._children.splice(t,1)}},{key:"setParent",value:function value(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:"getParent",value:function value(){return this._parent}},{key:"getChildren",value:function value(){return this._children}},{key:"getDerivations",value:function value(){return this._derivation}},{key:"getAncestorDerivations",value:function value(){return this._ancestorDerivation}}]),e}(),nn=function nn(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},rn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=""+e.join(),i=function Ae(e,t,n,r){var a=function(e,t){var n=[],r=e.getFieldspace().getDimension();return Object.entries(r).forEach(function(e){var r=Ee(e,1)[0];t&&t.length?-1!==t.indexOf(r)&&n.push(r):n.push(r)}),n}(e,t),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),a=_e.defaultReducer();return Object.keys(r).forEach(function(e){"string"!=typeof t[e]&&(t[e]=r[e].defAggFn());var i=_e.resolve(t[e]);i?n[e]=i:(n[e]=a,t[e]=ge)}),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],d=[],p={},h=[],v=void 0;Object.entries(u).forEach(function(e){var t=Ee(e,2),n=t[0],r=t[1];if(-1!==a.indexOf(n)||i[n])switch(d.push(_({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}});var m=0;T(e._rowDiffset,function(e){var t="";l.forEach(function(n){t=t+"-"+u[n].partialField.data[e]}),void 0===p[t]?(p[t]=m,h.push({}),l.forEach(function(t){h[m][t]=u[t].partialField.data[e]}),s.forEach(function(t){h[m][t]=[u[t].partialField.data[e]]}),m+=1):s.forEach(function(n){h[p[t]][n].push(u[n].partialField.data[e])})});var y={},g=function g(){return e.detachedRoot()};return h.forEach(function(e){var t=e;s.forEach(function(n){t[n]=i[n](e[n],g,y)})}),r?(r.__calculateFieldspace(),v=r):v=new yn(h,d,{name:c}),v}.apply(void 0,[this,e,t]);return Ft(this,i,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:_e.defaultReducer()},t),n.saveChild?i.setParent(this):i.setParent(null),i}},{key:"sort",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:"row",sort:e}),a=[n.schema.map(function(e){return e.name})].concat(n.data),i=new this.constructor(a,n.schema,{dataFormat:"DSVArr"});return Ft(this,i,L.SORT,t,e),t.saveChild?i.setParent(this):i.setParent(null),i}},{key:"serialize",value:function value(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:","},t);var n=this.getFieldspace().fields,r=n.map(function(e){return e.formattedData()}),a=r[0].length,i=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(i=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach(function(t,n){t[e.name()]=new k(a[n],i[n],e)});return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:"calculateVariable",value:function value(e,t,n){var r=this;e=Vt(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var a=this.getFieldsConfig(),i=t.slice(0,t.length-1),o=t[t.length-1];if(a[e.name]&&!n.replaceVar)throw new Error(e.name+" field already exists in datamodel");var u=i.map(function(e){var t=a[e];if(!t)throw new Error(e+" is not a valid column name.");return t.index}),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map(function(e){return f[e]}),s={},d=function d(){return r.detachedRoot()},p=[];T(c._rowDiffset,function(e){var t=l.map(function(t){return t.partialField.data[e]});p[e]=o.apply(void 0,an(t).concat([e,d,s]))});var h=tt([p],[e],[e.name]),v=nn(h,1)[0];return c.addField(v),Ft(this,c,L.CAL_VAR,{config:e,fields:i},o),c}},{key:"propagate",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.isMutableAction,i=t.sourceId,o=t.payload,u=function Kt(e){for(;e._parent;)e=e._parent;return e}(this),c=u._propagationNameSpace,l={groupByModel:function zt(e){for(;e._parent&&e._derivation.find(function(e){return e.op!==L.GROUPBY});)e=e._parent;return e}(this),model:u};return n&&function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,a=t.isMutableAction,i=t.criteria,o=t.action+"-"+t.sourceId;r=a?e.mutableActions:e.immutableActions,null===i?delete r[o]:r[o]={model:n,config:t}}(c,t,this),Xt(e,l,{propagationNameSpace:c,sourceId:i},Object.assign({payload:o},t)),a&&function qt(e,t,n){var r=e.immutableActions;for(var a in r){var i=r[a].config,o=n.config.sourceId,u=!n.propConfig.filterImmutableAction||n.propConfig.filterImmutableAction(i,n.config);if(i.sourceId!==o&&u){var c=i.criteria;Xt(c,t,{propagationNameSpace:e,propagateToSource:!1,sourceId:o},i)}}}(c,l,{config:t,propConfig:r}),this}},{key:"on",value:function value(e,t){switch(e){case"propagation":this._onPropagation.push(t)}return this}},{key:"unsubscribe",value:function value(e){switch(e){case"propagation":this._onPropagation=[]}return this}},{key:"handlePropagation",value:function value(e,t){var n=this;this._onPropagation.forEach(function(r){return r.call(n,e,t)})}},{key:"bin",value:function value(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error("Field "+e+" doesn't exist");var r=t.name||e+"_binned";if(n[r])throw new Error("Field "+r+" already exists");var a=function(e,t,n){var r=n.buckets,a=n.binsCount,i=n.binSize,o=n.start,u=n.end,f=function I(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.domain(),2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var d=[],p=0;p=(i=e[a=n+Math.floor((r-n)/2)]).start&&t=i.end?n=a+1:t2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],a=r.saveChild,i=e.getFieldspace().fieldsObj(),o=Ct(e.clone(a),n,r,e,function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},a=this.getFieldsConfig(),i=Object.keys(a),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach(function(e,n){o[n]=$t([].concat(an(e),an(t)),i,a)}),function Ut(e,t,n,r){return t.map(function(t){return Lt(e,t,n,r)})}(this,o,n,i)}}],[{key:"configureInvalidAwareTypes",value:function value(e){return M.invalidAwareVals(e)}},{key:"Reducers",get:function get(){return _e}}]),t}(),un=ye.sum,cn=ye.avg,fn=ye.min,ln=ye.max,sn=ye.first,dn=ye.last,pn=ye.count,hn=ye.std,vn={compose:function compose(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,a=void 0,i=[];return t.forEach(function(e){r=e(r),i.push.apply(i,function B(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t/gi),smartlabel},SmartLabelManager.store={},SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(!this._init)return!1;var size,csArr,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,container=this._container,style=this.style||{},cache=this._advancedCache||(this._advancedCache={}),advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]),cacheName=text+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||""),cacheInitName=text+"init"+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||"");return htmlSplCharSpace[text]&&(text=htmlSplCharSpace[text]),calculateDifference?void 0===(asymmetricDifference=cache[cacheInitName])&&(container.innerHTML=text.repeat?text.repeat(length):Array(length+1).join(text),tw=container.offsetWidth,container.innerHTML=text,twi=container.offsetWidth,asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1),advancedCacheKey.push(cacheInitName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()]):asymmetricDifference=0,(cachedStyle=cache[cacheName])?(csArr=cachedStyle.split(","),{width:parseFloat(csArr[0],10),height:parseFloat(csArr[1],10)}):(container.innerHTML=text,size={height:container.offsetHeight,width:container.offsetWidth+asymmetricDifference},cache[cacheName]=size.width+","+size.height,advancedCacheKey.push(cacheName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()],size)},SmartLabelManager.prototype._getWidthFn=function(){var contObj=this._containerObj,container=this._container,svgText=contObj.svgText;return svgText?function(str){var bbox,width;return svgText.textContent=str,(width=(bbox=svgText.getBBox()).width-SVG_BBOX_CORRECTION)<1&&(width=bbox.width),width}:function(str){return container.innerHTML=str,container.offsetWidth}},SmartLabelManager.prototype.setStyle=function(style){return this._init?style!==this.style||this._styleNotSet?(style||(style=this.style),slLib.setLineHeight(style),this.style=style,this._containerObj=sCont=this._containerManager.get(style),this._containerObj?(this._container=sCont.node,this._context=sCont.context,this._cache=sCont.charCache,this._lineHeight=sCont.lineHeight,this._styleNotSet=!1):this._styleNotSet=!0,this):void 0:this;var sCont},SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){return this._init?(this._showNoEllipses=!useEllipses,this):this},SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init)return!1;void 0===text||null===text?text="":"string"!=typeof text&&(text=text.toString());var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=!1,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],i=0,ellipsesStr=this._showNoEllipses?"":"...",lineHeight=this._lineHeight,context=this._context,container=this._container,sCont=this._containerObj,ellipsesWidth=sCont.ellipsesWidth,dotWidth=sCont.dotWidth,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,fastTrim=function fastTrim(str){for(var ws=/\s/,i=(str=str.replace(/^\s\s*/,"")).length;ws.test(str.charAt(i-=1)););return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:!1};if(getWidth=this._getWidthFn(),maxHeight===lineHeight&&(maxHeight*=1.2),container){if(!documentSupport.isBrowserLess){if((hasHTMLTag=slLib.xmlTagRegEx.test(text))?(container.innerHTML=text,smartLabel.oriTextWidth=oriWidth=container.offsetWidth,smartLabel.oriTextHeight=oriHeight=container.offsetHeight):(tmpText=text.replace(slLib.ltgtRegex,function(match){return"<"===match?"<":">"}),getOriSizeImproveObj=this.getOriSize(tmpText,!0),smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width,smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height),oriHeight<=maxHeight&&oriWidth<=maxWidth)return smartLabel.width=smartLabel.oriTextWidth=oriWidth,smartLabel.height=smartLabel.oriTextHeight=oriHeight,smartLabel;if(lineHeight>maxHeight)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=0,smartLabel.height=smartLabel.oriTextHeight=0,smartLabel}if(text=fastTrim(text).replace(/(\s+)/g," "),maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth,!hasHTMLTag){if(len=(oriTextArr=text.split("")).length,trimStr="",tempArr=[],tempChar=oriTextArr[0],this._cache[tempChar]?minWidth=this._cache[tempChar].width:(minWidth=getWidth(tempChar),this._cache[tempChar]={width:minWidth}),maxWidthWithEll>minWidth)i=(tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")).length;else{if(minWidth>maxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;ellipsesStr&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr=""))}if(strWidth=getWidth(tempArr.join("")),strHeight=this._lineHeight,noWrap){for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth))return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=getWidth(smartLabel.text),smartLabel.height=this._lineHeight,smartLabel;return smartLabel.text=tempArr.join(""),smartLabel.width=strWidth,smartLabel.height=this._lineHeight,smartLabel}for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth)){if(lastSpace=text.substr(0,tempArr.length).lastIndexOf(" "),lastDash=text.substr(0,tempArr.length).lastIndexOf("-"),lastSpace>lastIndexBroken?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastSpace,1,"
"),lastIndexBroken=lastSpace,newCharIndex=lastSpace+1):lastDash>lastIndexBroken?(lastDash===tempArr.length-1?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"
-")):(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"-
")),lastIndexBroken=lastDash,newCharIndex=lastDash+1):(tempArr.splice(tempArr.length-1,1,"
"+oriTextArr[i]),lastLineBreak=tempArr.length-2,strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join("")),lastIndexBroken=lastLineBreak,newCharIndex=i),(strHeight+=this._lineHeight)>maxHeight)return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=maxWidth,smartLabel.height=strHeight-this._lineHeight,smartLabel;maxStrWidth=max(maxStrWidth,strWidth),trimStr=null,nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this),strWidth=getWidth(text.substr(newCharIndex,nearestChar||1)),tempArr.length)/g,'$1'),container.innerHTML=text,x=0,y=(spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString)).length;xmaxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;if(minWidth>maxWidthWithEll&&!this._showNoEllipses&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr="")),initialLeft=characterArr[0].elem.offsetLeft,initialTop=characterArr[0].elem.offsetTop,noWrap)for(;imaxWidthWithEll&&(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),container.offsetWidth>maxWidth&&(removeFromIndex=i,i=len));else for(;imaxWidthWithEll?(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),elemRightMostPoint>maxWidth&&(lastSpace=characterArr[i].spaceIdx,lastDash=characterArr[i].dashIdx,lastSpace>lastIndexBroken?(characterArr[lastSpace].elem.innerHTML="
",lastIndexBroken=lastSpace):lastDash>lastIndexBroken?(characterArr[lastDash].elem.innerHTML=lastDash===i?"
-":"-
",lastIndexBroken=lastDash):elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem),elem.offsetHeight+elem.offsetTop>maxHeight?(lastBR?lastBR.parentNode.removeChild(lastBR):lastIndexBroken===lastDash?characterArr[lastDash].elem.innerHTML="-":characterArr[lastSpace].elem.innerHTML=" ",removeFromIndex=i,i=len):removeFromIndexForEllipses=null)):elemLowestPoint>maxHeight&&(removeFromIndex=i,i=len);if(removeFromIndex=removeFromIndexForEllipses;i-=1)(elem=characterArr[i].elem).parentNode.removeChild(elem);for(;i>=0;i-=1)elem=characterArr[i].elem,slLib.classNameBrReg.test(elem.className)?elem.parentNode.removeChild(elem):i=0}return smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&\;/g,"&"),smartLabel.isTruncated&&(smartLabel.text+=ellipsesStr,smartLabel.tooltext=toolText),smartLabel.height=container.offsetHeight,smartLabel.width=container.offsetWidth,smartLabel}return smartLabel.error=new Error("Body Tag Missing!"),smartLabel},SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag){if(!this._init)return!1;var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,indiSizeStore={};if(!detailedCalculationFlag)return this._calCharDimWithCache(text);for(i=0,l=(textArr=text.split("")).length;i]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1$2',spanRemovalRegx:new RegExp("\\]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),ltgtRegex:/<|>/g,brReplaceRegex://gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;return doc.getElementsByClassName?(childRetriverFn="getElementsByClassName",childRetriverString=classNameWithTag,noClassTesting=!0):(childRetriverFn="getElementsByTagName",childRetriverString="span",noClassTesting=!1),{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild)return containerParent.appendChild(container=doc.createElement("DIV")),container.className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),container}else if((body=doc.getElementsByTagName("body")[0])&&body.appendChild)return(container=doc.createElement("DIV")).className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),1,body.appendChild(container),container},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length)return 0;var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;if(difference=maxWidth,charLen=ceil(maxWidth/avgWidth),oriWidthtext.length&&(difference=maxWidth-oriWidth,charLen=text.length);difference>0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}for(;difference<0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}return charLen},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize=styleObj.fontSize||"12px";return styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||1.2*parseInt(fSize,10)+"px",styleObj}}}};exports.default=lib,module.exports=exports.default},function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function value(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"next",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"lock",value:function value(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function value(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:"prop",value:function value(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function value(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i5?maxContainers:5)<20?maxContainers:20,this.maxContainers=maxContainers,this.first=null,this.last=null,this.containers={},this.length=0,this.rootNode=parentContainer,isBrowserLess&&((svg=doc.createElementNS("http://www.w3.org/2000/svg","svg")).setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"),svg.setAttributeNS("http://www.w3.org/2000/svg","height","0"),svg.setAttributeNS("http://www.w3.org/2000/svg","width","0"),this.svgRoot=svg,this.rootNode.appendChild(svg))}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle)void 0!==style[key]&&(keyStr+=slLib.supportedStyle[key]+":"+style[key]+";");if(!keyStr)return!1;if(containerObj=containers[keyStr])this.first!==containerObj&&(containerObj.prev&&(containerObj.prev.next=containerObj.next),containerObj.next&&(containerObj.next.prev=containerObj.prev),containerObj.next=this.first,containerObj.next.prev=containerObj,this.last===containerObj&&(this.last=containerObj.prev),containerObj.prev=null,this.first=containerObj);else{if(len>=max)for(diff=len-max+1;diff--;)this.removeContainer(this.last);containerObj=this.addContainer(keyStr)}return containerObj},ContainerManager.prototype.addContainer=function(keyStr){var node,container;return this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}},container.next=this.first,container.next&&(container.next.prev=container),this.first=container,this.last||(this.last=container),this.length+=1,node=container.node=doc.createElement("div"),this.rootNode.appendChild(node),documentSupport.isIE&&!documentSupport.hasSVG?node.style.setAttribute("cssText",keyStr):node.setAttribute("style",keyStr),node.setAttribute("aria-hidden","true"),node.setAttribute("role","presentation"),node.style.display="inline-block",node.innerHTML=slLib.testStrAvg,container.lineHeight=node.offsetHeight,container.avgCharWidth=node.offsetWidth/3,documentSupport.isBrowserLess?((node=container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("style",keyStr),this.svgRoot.appendChild(node),node.textContent=slLib.testStrAvg,container.lineHeight=node.getBBox().height,container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3,node.textContent="...",container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION,node.textContent=".",container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION):(node.innerHTML="...",container.ellipsesWidth=node.offsetWidth,node.innerHTML=".",container.dotWidth=node.offsetWidth,node.innerHTML=""),container},ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;keyStr&&this.length&&cObj&&(this.length-=1,cObj.prev&&(cObj.prev.next=cObj.next),cObj.next&&(cObj.next.prev=cObj.prev),this.first===cObj&&(this.first=cObj.next),this.last===cObj&&(this.last=cObj.prev),cObj.node.parentNode.removeChild(cObj.node),delete this.containers[keyStr])},ContainerManager.prototype.dispose=function(){var key,containers=this.containers;for(key in this.maxContainers=null,containers)this.removeContainer(containers[key]);this.rootNode.parentNode.removeChild(this.rootNode),this.rootNode=null,this.first=null,this.last=null},module.exports=ContainerManager},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var scales_namespaceObject={};__webpack_require__.r(scales_namespaceObject),__webpack_require__.d(scales_namespaceObject,"scaleLinear",function(){return linear_linear}),__webpack_require__.d(scales_namespaceObject,"scaleThreshold",function(){return threshold_threshold}),__webpack_require__.d(scales_namespaceObject,"scaleLog",function(){return log}),__webpack_require__.d(scales_namespaceObject,"scalePow",function(){return pow}),__webpack_require__.d(scales_namespaceObject,"scaleIdentity",function(){return identity_identity}),__webpack_require__.d(scales_namespaceObject,"scaleOrdinal",function(){return ordinal}),__webpack_require__.d(scales_namespaceObject,"scaleSequential",function(){return sequential}),__webpack_require__.d(scales_namespaceObject,"scaleQuantize",function(){return quantize_quantize}),__webpack_require__.d(scales_namespaceObject,"scaleQuantile",function(){return quantile_quantile}),__webpack_require__.d(scales_namespaceObject,"schemeCategory10",function(){return category10}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20",function(){return category20}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20b",function(){return category20b}),__webpack_require__.d(scales_namespaceObject,"scaleBand",function(){return band}),__webpack_require__.d(scales_namespaceObject,"scaleTime",function(){return src_time});var color_schemes_namespaceObject={};__webpack_require__.r(color_schemes_namespaceObject),__webpack_require__.d(color_schemes_namespaceObject,"schemeDark2",function(){return Dark2}),__webpack_require__.d(color_schemes_namespaceObject,"schemePaired",function(){return Paired}),__webpack_require__.d(color_schemes_namespaceObject,"schemeAccent",function(){return Accent}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel1",function(){return Pastel1}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel2",function(){return Pastel2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet1",function(){return Set1}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet2",function(){return Set2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet3",function(){return Set3}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBlues",function(){return Blues_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBrBG",function(){return BrBG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePRGn",function(){return PRGn_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePiYG",function(){return PiYG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBrBG",function(){return BrBG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePRGn",function(){return PRGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePiYG",function(){return PiYG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuOr",function(){return PuOr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdBu",function(){return RdBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdGy",function(){return RdGy}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlBu",function(){return RdYlBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlGn",function(){return RdYlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateSpectral",function(){return Spectral}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBlues",function(){return Blues}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreens",function(){return Greens}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreys",function(){return Greys}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOranges",function(){return Oranges}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePurples",function(){return Purples}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateReds",function(){return Reds}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateViridis",function(){return sequential_multi_viridis}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateInferno",function(){return viridis_inferno}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateMagma",function(){return viridis_magma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePlasma",function(){return viridis_plasma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateWarm",function(){return rainbow_warm}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCool",function(){return rainbow_cool}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCubehelixDefault",function(){return sequential_multi_cubehelix}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuGn",function(){return BuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuPu",function(){return BuPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGnBu",function(){return GnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOrRd",function(){return OrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBuGn",function(){return PuBuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBu",function(){return PuBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuRd",function(){return PuRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdPu",function(){return RdPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGnBu",function(){return YlGnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGn",function(){return YlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrBr",function(){return YlOrBr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrRd",function(){return YlOrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRainbow",function(){return sequential_multi_rainbow});var namespace_namespaceObject={};__webpack_require__.r(namespace_namespaceObject),__webpack_require__.d(namespace_namespaceObject,"UNIT_GLOBAL_NAMESPACE",function(){return UNIT_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"UNIT_LOCAL_NAMESPACE",function(){return UNIT_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_LOCAL_NAMESPACE",function(){return LAYER_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_GLOBAL_NAMESPACE",function(){return LAYER_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_GLOBAL_NAMESPACE",function(){return GROUP_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_LOCAL_NAMESPACE",function(){return GROUP_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_LOCAL_NAMESPACE",function(){return CANVAS_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_GLOBAL_NAMESPACE",function(){return CANVAS_GLOBAL_NAMESPACE});var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,"DRAG",function(){return DRAG}),__webpack_require__.d(actions_namespaceObject,"HOVER",function(){return HOVER}),__webpack_require__.d(actions_namespaceObject,"SELECTIONDRAG",function(){return SELECTIONDRAG}),__webpack_require__.d(actions_namespaceObject,"CLICK",function(){return CLICK}),__webpack_require__.d(actions_namespaceObject,"LONGTOUCH",function(){return LONGTOUCH}),__webpack_require__.d(actions_namespaceObject,"TOUCHDRAG",function(){return TOUCHDRAG}),__webpack_require__.d(actions_namespaceObject,"ALL_ACTIONS",function(){return ALL_ACTIONS});var enums_selection_namespaceObject={};__webpack_require__.r(enums_selection_namespaceObject),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_ENTRY",function(){return SELECTION_NEW_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_EXIT",function(){return SELECTION_NEW_EXIT}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NULL",function(){return SELECTION_NULL}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_ENTRY",function(){return SELECTION_OLD_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_EXIT",function(){return SELECTION_OLD_EXIT});var behaviours_namespaceObject={};__webpack_require__.r(behaviours_namespaceObject),__webpack_require__.d(behaviours_namespaceObject,"BRUSH",function(){return BRUSH}),__webpack_require__.d(behaviours_namespaceObject,"HIGHLIGHT",function(){return HIGHLIGHT}),__webpack_require__.d(behaviours_namespaceObject,"TOOLTIP",function(){return behaviours_TOOLTIP}),__webpack_require__.d(behaviours_namespaceObject,"FILTER",function(){return FILTER}),__webpack_require__.d(behaviours_namespaceObject,"SELECT",function(){return SELECT});var behavioural_namespaceObject={};__webpack_require__.r(behavioural_namespaceObject),__webpack_require__.d(behavioural_namespaceObject,"HighlightBeahviour",function(){return highlight_HighlightBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"BrushBehaviour",function(){return brush_BrushBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"FilterBehaviour",function(){return filter_FilterBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"SelectBehaviour",function(){return select_SelectBehaviour});var side_effects_namespaceObject={};__webpack_require__.r(side_effects_namespaceObject),__webpack_require__.d(side_effects_namespaceObject,"ANCHORS",function(){return side_effects_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"BRUSH_ANCHORS",function(){return side_effects_BRUSH_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"PERSISTENT_ANCHORS",function(){return side_effects_PERSISTENT_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"FILTER",function(){return side_effects_FILTER}),__webpack_require__.d(side_effects_namespaceObject,"HIGHLIGHTER",function(){return side_effects_HIGHLIGHTER}),__webpack_require__.d(side_effects_namespaceObject,"CROSSLINE",function(){return CROSSLINE}),__webpack_require__.d(side_effects_namespaceObject,"TOOLTIP",function(){return side_effects_TOOLTIP});var src_side_effects_namespaceObject={};__webpack_require__.r(src_side_effects_namespaceObject),__webpack_require__.d(src_side_effects_namespaceObject,"SelectionBox",function(){return selection_box}),__webpack_require__.d(src_side_effects_namespaceObject,"Tooltip",function(){return side_effects_tooltip_Tooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"Crossline",function(){return crossline_Crossline}),__webpack_require__.d(src_side_effects_namespaceObject,"PlotHighlighter",function(){return plot_highlighter_PlotHighlighter}),__webpack_require__.d(src_side_effects_namespaceObject,"FilterEffect",function(){return FilterEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"PersistentAnchors",function(){return persistent_anchors_PersistentAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"BrushAnchors",function(){return brush_anchors_BrushAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"AnchorEffect",function(){return anchors_AnchorEffect});var axis_orientation_namespaceObject={};__webpack_require__.r(axis_orientation_namespaceObject),__webpack_require__.d(axis_orientation_namespaceObject,"BOTTOM",function(){return axis_orientation_BOTTOM}),__webpack_require__.d(axis_orientation_namespaceObject,"TOP",function(){return axis_orientation_TOP}),__webpack_require__.d(axis_orientation_namespaceObject,"LEFT",function(){return axis_orientation_LEFT}),__webpack_require__.d(axis_orientation_namespaceObject,"RIGHT",function(){return axis_orientation_RIGHT}),__webpack_require__.d(axis_orientation_namespaceObject,"axisOrientationMap",function(){return axisOrientationMap});var scale_type_namespaceObject={};__webpack_require__.r(scale_type_namespaceObject),__webpack_require__.d(scale_type_namespaceObject,"LINEAR",function(){return LINEAR}),__webpack_require__.d(scale_type_namespaceObject,"BAND",function(){return BAND}),__webpack_require__.d(scale_type_namespaceObject,"TIME",function(){return TIME}),__webpack_require__.d(scale_type_namespaceObject,"COLOR",function(){return scale_type_COLOR}),__webpack_require__.d(scale_type_namespaceObject,"ORDINAL",function(){return ORDINAL}),__webpack_require__.d(scale_type_namespaceObject,"QUANTIZE",function(){return QUANTIZE}),__webpack_require__.d(scale_type_namespaceObject,"QUANTILE",function(){return QUANTILE}),__webpack_require__.d(scale_type_namespaceObject,"LOG",function(){return LOG}),__webpack_require__.d(scale_type_namespaceObject,"POW",function(){return POW}),__webpack_require__.d(scale_type_namespaceObject,"IDENTITY",function(){return scale_type_IDENTITY}),__webpack_require__.d(scale_type_namespaceObject,"SEQUENTIAL",function(){return SEQUENTIAL}),__webpack_require__.d(scale_type_namespaceObject,"THRESHOLD",function(){return THRESHOLD});var layer_types_namespaceObject={};__webpack_require__.r(layer_types_namespaceObject),__webpack_require__.d(layer_types_namespaceObject,"AREA_LAYER",function(){return layer_types_AREA_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"ARC_LAYER",function(){return layer_types_ARC_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"LINE_LAYER",function(){return layer_types_LINE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TEXT_LAYER",function(){return layer_types_TEXT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"POINT_LAYER",function(){return layer_types_POINT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BAR_LAYER",function(){return layer_types_BAR_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TICK_LAYER",function(){return layer_types_TICK_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"SIMPLE_LAYER",function(){return layer_types_SIMPLE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BASE_LAYER",function(){return layer_types_BASE_LAYER});var firebolt_behavioural_namespaceObject={};__webpack_require__.r(firebolt_behavioural_namespaceObject),__webpack_require__.d(firebolt_behavioural_namespaceObject,"SelectBehaviour",function(){return behavioural_select_SelectBehaviour});var firebolt_side_effects_namespaceObject={};__webpack_require__.r(firebolt_side_effects_namespaceObject),__webpack_require__.d(firebolt_side_effects_namespaceObject,"SelectionBox",function(){return side_effects_selection_box}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendHighlighter",function(){return legend_highlighter_LegendHighlighter});var operators_namespaceObject={};__webpack_require__.r(operators_namespaceObject),__webpack_require__.d(operators_namespaceObject,"share",function(){return operators_share}),__webpack_require__.d(operators_namespaceObject,"html",function(){return operators_html});var dist_datamodel=__webpack_require__(0),datamodel_default=__webpack_require__.n(dist_datamodel),ascending=function(a,b){return ab?1:a>=b?0:NaN},bisector=function(compare){return 1===compare.length&&(compare=function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}(compare)),{left:function left(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)<0?lo=mid+1:hi=mid}return lo},right:function right(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)>0?hi=mid:lo=mid+1}return lo}}};var ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right,bisect=(ascendingBisect.left,bisectRight);var number=function(x){return null===x?NaN:+x},array_array=Array.prototype,src_range=(array_array.slice,array_array.map,function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;for(var i=-1,n=0|Math.max(0,Math.ceil((stop-start)/step)),range=new Array(n);++i0)return[start];if((reverse=stop0)for(start=Math.ceil(start/step),stop=Math.floor(stop/step),ticks=new Array(n=Math.ceil(stop-start+1));++i=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;return error>=e10?step1*=10:error>=e5?step1*=5:error>=e2&&(step1*=2),stop=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values);return value0+(+valueof(values[i0+1],i0+1,values)-value0)*(i-i0)}};function map_Map(){}function map_map(object,f){var map=new map_Map;if(object instanceof map_Map)object.each(function(value,key){map.set(key,value)});else if(Array.isArray(object)){var o,i=-1,n=object.length;if(null==f)for(;++i=keys.length)return null!=_sortValues&&array.sort(_sortValues),null!=_rollup?_rollup(array):array;for(var keyValue,value,values,i=-1,n=array.length,key=keys[depth++],valuesByKey=src_map(),result=createResult();++ikeys.length)return map;var array,sortKey=_sortKeys[depth-1];return null!=_rollup&&depth>=keys.length?array=map.entries():(array=[],map.each(function(v,k){array.push({key:k,values:_entries(v,depth)})})),null!=sortKey?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}(apply(array,0,createMap,setMap),0)},key:function key(d){return keys.push(d),nest},sortKeys:function sortKeys(order){return _sortKeys[keys.length-1]=order,nest},sortValues:function sortValues(order){return _sortValues=order,nest},rollup:function rollup(f){return _rollup=f,nest}}};function createObject(){return{}}function setObject(object,key,value){object[key]=value}function createMap(){return src_map()}function setMap(map,key,value){map.set(key,value)}function set_Set(){}var proto=src_map.prototype;function set_set(object,f){var set=new set_Set;if(object instanceof set_Set)object.each(function(value){set.add(value)});else if(object){var i=-1,n=object.length;if(null==f)for(;++i1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo)),hiIndex=getClosestIndexOf(values,hi),b=lo===hi?a:Math.max(a,hiIndex-1),reverse&&(t=a,a=n-b,b=n-t),a>b?void 0:domain().slice(a,b+1)},scale.invert=function(r0,r1){var a,t,lo=+r0,hi=arguments.length>1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo,"left")),domain()[reverse?n-a:a]},rescale()}function getClosestIndexOf(arr,value,side){for(var highVal,mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1:high}var define=function(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype,prototype.constructor=constructor};function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var reI="\\s*([+-]?\\d+)\\s*",reN="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",reP="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",reHex3=/^#([0-9a-f]{3})$/,reHex6=/^#([0-9a-f]{6})$/,reRgbInteger=new RegExp("^rgb\\("+[reI,reI,reI]+"\\)$"),reRgbPercent=new RegExp("^rgb\\("+[reP,reP,reP]+"\\)$"),reRgbaInteger=new RegExp("^rgba\\("+[reI,reI,reI,reN]+"\\)$"),reRgbaPercent=new RegExp("^rgba\\("+[reP,reP,reP,reN]+"\\)$"),reHslPercent=new RegExp("^hsl\\("+[reN,reP,reP]+"\\)$"),reHslaPercent=new RegExp("^hsla\\("+[reN,reP,reP,reN]+"\\)$"),named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(format){var m;return format=(format+"").trim().toLowerCase(),(m=reHex3.exec(format))?new Rgb((m=parseInt(m[1],16))>>8&15|m>>4&240,m>>4&15|240&m,(15&m)<<4|15&m,1):(m=reHex6.exec(format))?rgbn(parseInt(m[1],16)):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(255*m[1]/100,255*m[2]/100,255*m[3]/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(255*m[1]/100,255*m[2]/100,255*m[3]/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):"transparent"===format?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,255&n,1)}function rgba(r,g,b,a){return a<=0&&(r=g=b=NaN),new Rgb(r,g,b,a)}function rgbConvert(o){return o instanceof Color||(o=color_color(o)),o?new Rgb((o=o.rgb()).r,o.g,o.b,o.opacity):new Rgb}function color_rgb(r,g,b,opacity){return 1===arguments.length?rgbConvert(r):new Rgb(r,g,b,null==opacity?1:opacity)}function Rgb(r,g,b,opacity){this.r=+r,this.g=+g,this.b=+b,this.opacity=+opacity}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function hex(value){return((value=Math.max(0,Math.min(255,Math.round(value)||0)))<16?"0":"")+value.toString(16)}function hsla(h,s,l,a){return a<=0?h=s=l=NaN:l<=0||l>=1?h=s=NaN:s<=0&&(h=NaN),new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color_color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;var r=(o=o.rgb()).r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;return s?(h=r===max?(g-b)/s+6*(g0&&l<1?0:h,new Hsl(h,s,l,o.opacity)}function hsl(h,s,l,opacity){return 1===arguments.length?hslConvert(h):new Hsl(h,s,l,null==opacity?1:opacity)}function Hsl(h,s,l,opacity){this.h=+h,this.s=+s,this.l=+l,this.opacity=+opacity}function hsl2rgb(h,m1,m2){return 255*(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)}define(Color,color_color,{copy:function copy(channels){return Object.assign(new this.constructor,this,channels)},displayable:function displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,color_rgb,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb:function rgb(){return this},displayable:function displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb:function rgb(){var h=this.h%360+360*(this.h<0),s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},displayable:function displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function formatHsl(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var deg2rad=Math.PI/180,rad2deg=180/Math.PI,Xn=.96422,Yn=1,Zn=.82521,lab_t0=4/29,lab_t1=6/29,t2=3*lab_t1*lab_t1,t3=lab_t1*lab_t1*lab_t1;function labConvert(o){if(o instanceof Lab)return new Lab(o.l,o.a,o.b,o.opacity);if(o instanceof Hcl)return hcl2lab(o);o instanceof Rgb||(o=rgbConvert(o));var x,z,r=rgb2lrgb(o.r),g=rgb2lrgb(o.g),b=rgb2lrgb(o.b),y=xyz2lab((.2225045*r+.7168786*g+.0606169*b)/Yn);return r===g&&g===b?x=z=y:(x=xyz2lab((.4360747*r+.3850649*g+.1430804*b)/Xn),z=xyz2lab((.0139322*r+.0971045*g+.7141733*b)/Zn)),new Lab(116*y-16,500*(x-y),200*(y-z),o.opacity)}function lab(l,a,b,opacity){return 1===arguments.length?labConvert(l):new Lab(l,a,b,null==opacity?1:opacity)}function Lab(l,a,b,opacity){this.l=+l,this.a=+a,this.b=+b,this.opacity=+opacity}function xyz2lab(t){return t>t3?Math.pow(t,1/3):t/t2+lab_t0}function lab2xyz(t){return t>lab_t1?t*t*t:t2*(t-lab_t0)}function lrgb2rgb(x){return 255*(x<=.0031308?12.92*x:1.055*Math.pow(x,1/2.4)-.055)}function rgb2lrgb(x){return(x/=255)<=.04045?x/12.92:Math.pow((x+.055)/1.055,2.4)}function hclConvert(o){if(o instanceof Hcl)return new Hcl(o.h,o.c,o.l,o.opacity);if(o instanceof Lab||(o=labConvert(o)),0===o.a&&0===o.b)return new Hcl(NaN,0180||d<-180?d-360*Math.round(d/360):d):src_constant(isNaN(a)?b:a)}function gamma(y){return 1==(y=+y)?nogamma:function(a,b){return b-a?function exponential(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y)}}(a,b,y):src_constant(isNaN(a)?b:a)}}function nogamma(a,b){var d=b-a;return d?linear(a,d):src_constant(isNaN(a)?b:a)}var src_rgb=function rgbGamma(y){var color=gamma(y);function rgb(start,end){var r=color((start=color_rgb(start)).r,(end=color_rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.r=r(t),start.g=g(t),start.b=b(t),start.opacity=opacity(t),start+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(spline){return function(colors){var i,color,n=colors.length,r=new Array(n),g=new Array(n),b=new Array(n);for(i=0;i=1?(t=1,n-1):Math.floor(t*n),v1=values[i],v2=values[i+1],v0=i>0?values[i-1]:2*v1-v2,v3=ibi&&(bs=b.slice(bi,bs),s[i]?s[i]+=bs:s[++i]=bs),(am=am[0])===(bm=bm[0])?s[i]?s[i]+=bm:s[++i]=bm:(s[++i]=null,q.push({i:i,x:src_number(am,bm)})),bi=reB.lastIndex;return bi180?b+=360:b-a>180&&(a+=360),q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:src_number(a,b)})):b&&s.push(pop(s)+"rotate("+b+degParen)}(a.rotate,b.rotate,s,q),function skewX(a,b,s,q){a!==b?q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:src_number(a,b)}):b&&s.push(pop(s)+"skewX("+b+degParen)}(a.skewX,b.skewX,s,q),function scale(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:src_number(xa,xb)},{i:i-2,x:src_number(ya,yb)})}else 1===xb&&1===yb||s.push(pop(s)+"scale("+xb+","+yb+")")}(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q),a=b=null,function(t){for(var o,i=-1,n=q.length;++i2?polymap:bimap,output=input=null,scale}function scale(x){return(output||(output=piecewise(domain,range,clamp?function deinterpolateClamp(deinterpolate){return function(a,b){var d=deinterpolate(a=+a,b=+b);return function(x){return x<=a?0:x>=b?1:d(x)}}}(deinterpolate):deinterpolate,interpolate)))(+x)}return scale.invert=function(y){return(input||(input=piecewise(range,domain,deinterpolateLinear,clamp?function reinterpolateClamp(reinterpolate){return function(a,b){var r=reinterpolate(a=+a,b=+b);return function(t){return t<=0?a:t>=1?b:r(t)}}}(reinterpolate):reinterpolate)))(+y)},scale.domain=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),rescale()):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),rescale()):range.slice()},scale.rangeRound=function(_){return range=array_slice.call(_),interpolate=src_round,rescale()},scale.clamp=function(_){return arguments.length?(clamp=!!_,rescale()):clamp},scale.interpolate=function(_){return arguments.length?(interpolate=_,rescale()):interpolate},rescale()}var formatDecimal=function(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]},src_exponent=function(x){return(x=formatDecimal(Math.abs(x)))?x[1]:NaN},re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]})}function FormatSpecifier(specifier){this.fill=void 0===specifier.fill?" ":specifier.fill+"",this.align=void 0===specifier.align?">":specifier.align+"",this.sign=void 0===specifier.sign?"-":specifier.sign+"",this.symbol=void 0===specifier.symbol?"":specifier.symbol+"",this.zero=!!specifier.zero,this.width=void 0===specifier.width?void 0:+specifier.width,this.comma=!!specifier.comma,this.precision=void 0===specifier.precision?void 0:+specifier.precision,this.trim=!!specifier.trim,this.type=void 0===specifier.type?"":specifier.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var prefixExponent,defaultLocale_locale,defaultLocale_format,defaultLocale_formatPrefix,formatTrim=function(s){out:for(var i1,n=s.length,i=1,i0=-1;i0){if(!+s[i])break out;i0=0}}return i0>0?s.slice(0,i0)+s.slice(i1+1):s},formatRounded=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")},formatTypes={"%":function _(x,p){return(100*x).toFixed(p)},b:function b(x){return Math.round(x).toString(2)},c:function c(x){return x+""},d:function d(x){return Math.round(x).toString(10)},e:function e(x,p){return x.toExponential(p)},f:function f(x,p){return x.toFixed(p)},g:function g(x,p){return x.toPrecision(p)},o:function o(x){return Math.round(x).toString(8)},p:function p(x,_p){return formatRounded(100*x,_p)},r:formatRounded,s:function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=3*Math.max(-8,Math.min(8,Math.floor(exponent/3))))+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]},X:function X(x){return Math.round(x).toString(16).toUpperCase()},x:function x(_x){return Math.round(_x).toString(16)}},src_identity=function(x){return x},locale_map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],src_locale=function(locale){var group=void 0===locale.grouping||void 0===locale.thousands?src_identity:function(grouping,thousands){return function(value,width){for(var i=value.length,t=[],j=0,g=grouping[0],length=0;i>0&&g>0&&(length+g+1>width&&(g=Math.max(1,width-length)),t.push(value.substring(i-=g,i+g)),!((length+=g+1)>width));)g=grouping[j=(j+1)%grouping.length];return t.reverse().join(thousands)}}(locale_map.call(locale.grouping,Number),locale.thousands+""),currencyPrefix=void 0===locale.currency?"":locale.currency[0]+"",currencySuffix=void 0===locale.currency?"":locale.currency[1]+"",decimal=void 0===locale.decimal?".":locale.decimal+"",numerals=void 0===locale.numerals?src_identity:function(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}}(locale_map.call(locale.numerals,String)),percent=void 0===locale.percent?"%":locale.percent+"",minus=void 0===locale.minus?"-":locale.minus+"",nan=void 0===locale.nan?"NaN":locale.nan+"";function newFormat(specifier){var fill=(specifier=formatSpecifier(specifier)).fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;"n"===type?(comma=!0,type="g"):formatTypes[type]||(void 0===precision&&(precision=12),trim=!0,type="g"),(zero||"0"===fill&&"="===align)&&(zero=!0,fill="0",align="=");var prefix="$"===symbol?currencyPrefix:"#"===symbol&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix="$"===symbol?currencySuffix:/[%p]/.test(type)?percent:"",formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);function format(value){var i,n,c,valuePrefix=prefix,valueSuffix=suffix;if("c"===type)valueSuffix=formatType(value)+valueSuffix,value="";else{var valueNegative=(value=+value)<0;if(value=isNaN(value)?nan:formatType(Math.abs(value),precision),trim&&(value=formatTrim(value)),valueNegative&&0==+value&&(valueNegative=!1),valuePrefix=(valueNegative?"("===sign?sign:minus:"-"===sign||"("===sign?"":sign)+valuePrefix,valueSuffix=("s"===type?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&"("===sign?")":""),maybeSuffix)for(i=-1,n=value.length;++i(c=value.charCodeAt(i))||c>57){valueSuffix=(46===c?decimal+value.slice(i+1):value.slice(i))+valueSuffix,value=value.slice(0,i);break}}comma&&!zero&&(value=group(value,1/0));var length=valuePrefix.length+value.length+valueSuffix.length,padding=length>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix}return numerals(value)}return precision=void 0===precision?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision)),format.toString=function(){return specifier+""},format}return{format:newFormat,formatPrefix:function formatPrefix(specifier,value){var f=newFormat(((specifier=formatSpecifier(specifier)).type="f",specifier)),e=3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3))),k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}}};!function defaultLocale(definition){return defaultLocale_locale=src_locale(definition),defaultLocale_format=defaultLocale_locale.format,defaultLocale_formatPrefix=defaultLocale_locale.formatPrefix,defaultLocale_locale}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var src_tickFormat=function(domain,count,specifier){var precision,start=domain[0],stop=domain[domain.length-1],step=tickStep(start,stop,null==count?10:count);switch((specifier=formatSpecifier(null==specifier?",f":specifier)).type){case"s":var value=Math.max(Math.abs(start),Math.abs(stop));return null!=specifier.precision||isNaN(precision=function(step,value){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3)))-src_exponent(Math.abs(step)))}(step,value))||(specifier.precision=precision),defaultLocale_formatPrefix(specifier,value);case"":case"e":case"g":case"p":case"r":null!=specifier.precision||isNaN(precision=function(step,max){return step=Math.abs(step),max=Math.abs(max)-step,Math.max(0,src_exponent(max)-src_exponent(step))+1}(step,Math.max(Math.abs(start),Math.abs(stop))))||(specifier.precision=precision-("e"===specifier.type));break;case"f":case"%":null!=specifier.precision||isNaN(precision=function(step){return Math.max(0,-src_exponent(Math.abs(step)))}(step))||(specifier.precision=precision-2*("%"===specifier.type))}return defaultLocale_format(specifier)};function linearish(scale){var domain=scale.domain;return scale.ticks=function(count){var d=domain();return src_ticks(d[0],d[d.length-1],null==count?10:count)},scale.tickFormat=function(count,specifier){return src_tickFormat(domain(),count,specifier)},scale.nice=function(count){null==count&&(count=10);var step,d=domain(),i0=0,i1=d.length-1,start=d[i0],stop=d[i1];return stop0?step=tickIncrement(start=Math.floor(start/step)*step,stop=Math.ceil(stop/step)*step,count):step<0&&(step=tickIncrement(start=Math.ceil(start*step)/step,stop=Math.floor(stop*step)/step,count)),step>0?(d[i0]=Math.floor(start/step)*step,d[i1]=Math.ceil(stop/step)*step,domain(d)):step<0&&(d[i0]=Math.ceil(start*step)/step,d[i1]=Math.floor(stop*step)/step,domain(d)),scale},scale}function linear_linear(){var scale=continuous(deinterpolateLinear,src_number);return scale.copy=function(){return copy(scale,linear_linear())},linearish(scale)}function identity_identity(){var domain=[0,1];function scale(x){return+x}return scale.invert=scale,scale.domain=scale.range=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),scale):domain.slice()},scale.copy=function(){return identity_identity().domain(domain)},linearish(scale)}var nice=function(domain,interval){var t,i0=0,i1=(domain=domain.slice()).length-1,x0=domain[i0],x1=domain[i1];return x10){for(;iv)break;z.push(t)}}else for(;i=1;--k)if(!((t=p*k)v)break;z.push(t)}}else z=src_ticks(i,j,Math.min(j-i,n)).map(pows);return r?z.reverse():z},scale.tickFormat=function(count,specifier){if(null==specifier&&(specifier=10===base?".0e":","),"function"!=typeof specifier&&(specifier=defaultLocale_format(specifier)),count===1/0)return specifier;null==count&&(count=10);var k=Math.max(1,base*count/scale.ticks().length);return function(d){var i=d/pows(Math.round(logs(d)));return i*base0?thresholds[i-1]:domain[0],i=n?[domain[n-1],x1]:[domain[i-1],domain[i]]},scale.copy=function(){return quantize_quantize().domain([x0,x1]).range(range)},linearish(scale)}function threshold_threshold(){var domain=[.5],range=[0,1],n=1;function scale(x){if(x<=x)return range[bisect(domain,x,0,n)]}return scale.domain=function(_){return arguments.length?(domain=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):range.slice()},scale.invertExtent=function(y){var i=range.indexOf(y);return[domain[i-1],domain[i]]},scale.copy=function(){return threshold_threshold().domain(domain).range(range)},scale}var interval_t0=new Date,interval_t1=new Date;function newInterval(floori,offseti,count,field){function interval(date){return floori(date=new Date(+date)),date}return interval.floor=interval,interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),floori(date),date},interval.round=function(date){var d0=interval(date),d1=interval.ceil(date);return date-d00))return range;do{range.push(previous=new Date(+start)),offseti(start,step),floori(start)}while(previous=date)for(;floori(date),!test(date);)date.setTime(date-1)},function(date,step){if(date>=date)if(step<0)for(;++step<=0;)for(;offseti(date,-1),!test(date););else for(;--step>=0;)for(;offseti(date,1),!test(date););})},count&&(interval.count=function(start,end){return interval_t0.setTime(+start),interval_t1.setTime(+end),floori(interval_t0),floori(interval_t1),Math.floor(count(interval_t0,interval_t1))},interval.every=function(step){return step=Math.floor(step),isFinite(step)&&step>0?step>1?interval.filter(field?function(d){return field(d)%step==0}:function(d){return interval.count(0,d)%step==0}):interval:null}),interval}var millisecond_millisecond=newInterval(function(){},function(date,step){date.setTime(+date+step)},function(start,end){return end-start});millisecond_millisecond.every=function(k){return k=Math.floor(k),isFinite(k)&&k>0?k>1?newInterval(function(date){date.setTime(Math.floor(date/k)*k)},function(date,step){date.setTime(+date+step*k)},function(start,end){return(end-start)/k}):millisecond_millisecond:null};var src_millisecond=millisecond_millisecond,durationMinute=(millisecond_millisecond.range,6e4),durationWeek=6048e5,second_second=newInterval(function(date){date.setTime(date-date.getMilliseconds())},function(date,step){date.setTime(+date+1e3*step)},function(start,end){return(end-start)/1e3},function(date){return date.getUTCSeconds()}),src_second=second_second,minute_minute=(second_second.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds())},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getMinutes()})),src_minute=minute_minute,hour_hour=(minute_minute.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds()-date.getMinutes()*durationMinute)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getHours()})),src_hour=hour_hour,day_day=(hour_hour.range,newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/864e5},function(date){return date.getDate()-1})),src_day=day_day;day_day.range;function weekday(i){return newInterval(function(date){date.setDate(date.getDate()-(date.getDay()+7-i)%7),date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+7*step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6),month_month=(sunday.range,monday.range,tuesday.range,wednesday.range,thursday.range,friday.range,saturday.range,newInterval(function(date){date.setDate(1),date.setHours(0,0,0,0)},function(date,step){date.setMonth(date.getMonth()+step)},function(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())},function(date){return date.getMonth()})),src_month=month_month,year_year=(month_month.range,newInterval(function(date){date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()},function(date){return date.getFullYear()}));year_year.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setFullYear(Math.floor(date.getFullYear()/k)*k),date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step*k)}):null};var src_year=year_year,utcMinute=(year_year.range,newInterval(function(date){date.setUTCSeconds(0,0)},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getUTCMinutes()})),utcHour=(utcMinute.range,newInterval(function(date){date.setUTCMinutes(0,0,0)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getUTCHours()})),utcDay=(utcHour.range,newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5},function(date){return date.getUTCDate()-1})),src_utcDay=utcDay;utcDay.range;function utcWeekday(i){return newInterval(function(date){date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+7*step)},function(start,end){return(end-start)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6),utcMonth=(utcSunday.range,utcMonday.range,utcTuesday.range,utcWednesday.range,utcThursday.range,utcFriday.range,utcSaturday.range,newInterval(function(date){date.setUTCDate(1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCMonth(date.getUTCMonth()+step)},function(start,end){return end.getUTCMonth()-start.getUTCMonth()+12*(end.getUTCFullYear()-start.getUTCFullYear())},function(date){return date.getUTCMonth()})),utcYear=(utcMonth.range,newInterval(function(date){date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()},function(date){return date.getUTCFullYear()}));utcYear.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setUTCFullYear(Math.floor(date.getUTCFullYear()/k)*k),date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step*k)}):null};var src_utcYear=utcYear;utcYear.range;function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);return date.setFullYear(d.y),date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));return date.setUTCFullYear(d.y),date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newYear(y){return{y:y,m:0,d:1,H:0,M:0,S:0,L:0}}var src_defaultLocale_locale,timeFormat,utcFormat,utcParse,pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function locale_pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i,i+6));return n?(d.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseMicroseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+6));return n?(d.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function parseUnixTimestamp(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=+n[0],i+n[0].length):-1}function parseUnixTimestampSeconds(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=1e3*+n[0],i+n[0].length):-1}function formatDayOfMonth(d,p){return locale_pad(d.getDate(),p,2)}function formatHour24(d,p){return locale_pad(d.getHours(),p,2)}function formatHour12(d,p){return locale_pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return locale_pad(1+src_day.count(src_year(d),d),p,3)}function formatMilliseconds(d,p){return locale_pad(d.getMilliseconds(),p,3)}function formatMicroseconds(d,p){return formatMilliseconds(d,p)+"000"}function formatMonthNumber(d,p){return locale_pad(d.getMonth()+1,p,2)}function formatMinutes(d,p){return locale_pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return locale_pad(d.getSeconds(),p,2)}function formatWeekdayNumberMonday(d){var day=d.getDay();return 0===day?7:day}function formatWeekNumberSunday(d,p){return locale_pad(sunday.count(src_year(d),d),p,2)}function formatWeekNumberISO(d,p){var day=d.getDay();return d=day>=4||0===day?thursday(d):thursday.ceil(d),locale_pad(thursday.count(src_year(d),d)+(4===src_year(d).getDay()),p,2)}function formatWeekdayNumberSunday(d){return d.getDay()}function formatWeekNumberMonday(d,p){return locale_pad(monday.count(src_year(d),d),p,2)}function locale_formatYear(d,p){return locale_pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return locale_pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+locale_pad(z/60|0,"0",2)+locale_pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return locale_pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return locale_pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return locale_pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return locale_pad(1+src_utcDay.count(src_utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return locale_pad(d.getUTCMilliseconds(),p,3)}function formatUTCMicroseconds(d,p){return formatUTCMilliseconds(d,p)+"000"}function formatUTCMonthNumber(d,p){return locale_pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return locale_pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return locale_pad(d.getUTCSeconds(),p,2)}function formatUTCWeekdayNumberMonday(d){var dow=d.getUTCDay();return 0===dow?7:dow}function formatUTCWeekNumberSunday(d,p){return locale_pad(utcSunday.count(src_utcYear(d),d),p,2)}function formatUTCWeekNumberISO(d,p){var day=d.getUTCDay();return d=day>=4||0===day?utcThursday(d):utcThursday.ceil(d),locale_pad(utcThursday.count(src_utcYear(d),d)+(4===src_utcYear(d).getUTCDay()),p,2)}function formatUTCWeekdayNumberSunday(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return locale_pad(utcMonday.count(src_utcYear(d),d),p,2)}function formatUTCYear(d,p){return locale_pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return locale_pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(d){return+d}function formatUnixTimestampSeconds(d){return Math.floor(+d/1e3)}!function defaultLocale_defaultLocale(definition){return src_defaultLocale_locale=function formatLocale(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_weekdays=locale.days,locale_shortWeekdays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths,periodRe=formatRe(locale_periods),periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths),formats={a:function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]},A:function formatWeekday(d){return locale_weekdays[d.getDay()]},b:function formatShortMonth(d){return locale_shortMonths[d.getMonth()]},B:function formatMonth(d){return locale_months[d.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},utcFormats={a:function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]},A:function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]},b:function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]},B:function formatUTCMonth(d){return locale_months[d.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},parses={a:function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},A:function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},b:function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup[n[0].toLowerCase()],i+n[0].length):-1},B:function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup[n[0].toLowerCase()],i+n[0].length):-1},c:function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(d,string,i){var n=periodRe.exec(string.slice(i));return n?(d.p=periodLookup[n[0].toLowerCase()],i+n[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)},X:function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(specifier,formats){return function(date){var c,pad,format,string=[],i=-1,j=0,n=specifier.length;for(date instanceof Date||(date=new Date(+date));++i53)return null;"w"in d||(d.w=1),"Z"in d?(week=(day=(week=utcDate(newYear(d.y))).getUTCDay())>4||0===day?utcMonday.ceil(week):utcMonday(week),week=src_utcDay.offset(week,7*(d.V-1)),d.y=week.getUTCFullYear(),d.m=week.getUTCMonth(),d.d=week.getUTCDate()+(d.w+6)%7):(week=(day=(week=newDate(newYear(d.y))).getDay())>4||0===day?monday.ceil(week):monday(week),week=src_day.offset(week,7*(d.V-1)),d.y=week.getFullYear(),d.m=week.getMonth(),d.d=week.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),day="Z"in d?utcDate(newYear(d.y)).getUTCDay():newDate(newYear(d.y)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(day+5)%7:d.w+7*d.U-(day+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,utcDate(d)):newDate(d)}}function parseSpecifier(d,specifier,string,j){for(var c,parse,i=0,n=specifier.length,m=string.length;i=m)return-1;if(37===(c=specifier.charCodeAt(i++))){if(c=specifier.charAt(i++),!(parse=parses[c in pads?specifier.charAt(i++):c])||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++))return-1}return j}return formats.x=newFormat(locale_date,formats),formats.X=newFormat(locale_time,formats),formats.c=newFormat(locale_dateTime,formats),utcFormats.x=newFormat(locale_date,utcFormats),utcFormats.X=newFormat(locale_time,utcFormats),utcFormats.c=newFormat(locale_dateTime,utcFormats),{format:function format(specifier){var f=newFormat(specifier+="",formats);return f.toString=function(){return specifier},f},parse:function parse(specifier){var p=newParse(specifier+="",localDate);return p.toString=function(){return specifier},p},utcFormat:function utcFormat(specifier){var f=newFormat(specifier+="",utcFormats);return f.toString=function(){return specifier},f},utcParse:function utcParse(specifier){var p=newParse(specifier,utcDate);return p.toString=function(){return specifier},p}}}(definition),timeFormat=src_defaultLocale_locale.format,src_defaultLocale_locale.parse,utcFormat=src_defaultLocale_locale.utcFormat,utcParse=src_defaultLocale_locale.utcParse,src_defaultLocale_locale}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||utcParse("%Y-%m-%dT%H:%M:%S.%LZ");var time_durationSecond=1e3,time_durationMinute=60*time_durationSecond,time_durationHour=60*time_durationMinute,time_durationDay=24*time_durationHour,time_durationWeek=7*time_durationDay,durationMonth=30*time_durationDay,durationYear=365*time_durationDay;function time_date(t){return new Date(t)}function time_number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(year,month,week,day,hour,minute,second,millisecond,format){var scale=continuous(deinterpolateLinear,src_number),invert=scale.invert,domain=scale.domain,formatMillisecond=format(".%L"),formatSecond=format(":%S"),formatMinute=format("%I:%M"),formatHour=format("%I %p"),formatDay=format("%a %d"),formatWeek=format("%b %d"),formatMonth=format("%B"),formatYear=format("%Y"),tickIntervals=[[second,1,time_durationSecond],[second,5,5*time_durationSecond],[second,15,15*time_durationSecond],[second,30,30*time_durationSecond],[minute,1,time_durationMinute],[minute,5,5*time_durationMinute],[minute,15,15*time_durationMinute],[minute,30,30*time_durationMinute],[hour,1,time_durationHour],[hour,3,3*time_durationHour],[hour,6,6*time_durationHour],[hour,12,12*time_durationHour],[day,1,time_durationDay],[day,2,2*time_durationDay],[week,1,time_durationWeek],[month,1,durationMonth],[month,3,3*durationMonth],[year,1,durationYear]];function tickFormat(date){return(second(date)1)&&(t-=Math.floor(t));var ts=Math.abs(t-.5);return rainbow_c.h=360*t-100,rainbow_c.s=1.5-1.5*ts,rainbow_c.l=.8-.9*ts,rainbow_c+""},sequential_multi_cubehelix=cubehelixLong(cubehelix_cubehelix(300,.5,0),cubehelix_cubehelix(-240,.5,1)),BuGn=src_ramp(new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(d3_scale_chromatic_src_colors)),BuPu=src_ramp(new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(d3_scale_chromatic_src_colors)),GnBu=src_ramp(new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(d3_scale_chromatic_src_colors)),OrRd=src_ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(d3_scale_chromatic_src_colors)),PuBuGn=src_ramp(new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(d3_scale_chromatic_src_colors)),PuBu=src_ramp(new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(d3_scale_chromatic_src_colors)),PuRd=src_ramp(new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(d3_scale_chromatic_src_colors)),RdPu=src_ramp(new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(d3_scale_chromatic_src_colors)),YlGnBu=src_ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(d3_scale_chromatic_src_colors)),YlGn=src_ramp(new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(d3_scale_chromatic_src_colors)),YlOrBr=src_ramp(new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(d3_scale_chromatic_src_colors)),YlOrRd=src_ramp(new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(d3_scale_chromatic_src_colors)),UNIT_GLOBAL_NAMESPACE="app.units",UNIT_LOCAL_NAMESPACE="local.units",LAYER_LOCAL_NAMESPACE="local.layers",LAYER_GLOBAL_NAMESPACE="app.layers",GROUP_GLOBAL_NAMESPACE="app.group",GROUP_LOCAL_NAMESPACE="local.group",CANVAS_LOCAL_NAMESPACE="local.canvas",CANVAS_GLOBAL_NAMESPACE="app.canvas",reserved_fields={ROW_ID:"__id__"},common_props={ACTION_INF:"actionInf",ON_LAYER_DRAW:"onLayerDraw",MATRIX_CREATED:"matrixCreated"},COORD_TYPES_POLAR="polar",COORD_TYPES_CARTESIAN="cartesian",DATA_TYPE_FUNCTION="function",DATA_TYPE_STRING="string",src_array_slice=Array.prototype.slice,d3_axis_src_identity=function(x){return x},axis_top=1,axis_right=2,axis_bottom=3,axis_left=4,epsilon=1e-6;function translateX(x){return"translate("+(x+.5)+",0)"}function translateY(y){return"translate(0,"+(y+.5)+")"}function entering(){return!this.__axis}function axis_axis(orient,scale){var tickArguments=[],tickValues=null,tickFormat=null,tickTransform=null,tickSizeInner=6,tickSizeOuter=6,tickPadding=3,k=orient===axis_top||orient===axis_left?-1:1,x=orient===axis_left||orient===axis_right?"x":"y",transform=orient===axis_top||orient===axis_bottom?translateX:translateY;function axis(context){var values=null==tickValues?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():tickValues,format=null==tickFormat?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):d3_axis_src_identity:tickFormat,spacing=Math.max(tickSizeInner,0)+tickPadding,range=scale.range(),range0=+range[0]+.5,range1=+range[range.length-1]+.5,position=(scale.bandwidth?function axis_center(scale){var offset=Math.max(0,scale.bandwidth()-1)/2;return scale.round()&&(offset=Math.round(offset)),function(d){return+scale(d)+offset}}:function axis_number(scale){return function(d){return+scale(d)}})(scale.copy()),selection=context.selection?context.selection():context,path=selection.selectAll(".domain").data([null]),tick=selection.selectAll(".tick").data(values,scale).order(),tickExit=tick.exit(),tickEnter=tick.enter().append("g").attr("class","tick"),line=tick.select("line"),text=tick.select("text");path=path.merge(path.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),tick=tick.merge(tickEnter),line=line.merge(tickEnter.append("line").attr("stroke","#000").attr(x+"2",k*tickSizeInner)),text=text.merge(tickEnter.append("text").attr("fill","#000").attr(x,k*spacing).attr("dy",orient===axis_top?"0em":orient===axis_bottom?"0.71em":"0.32em")).style("transform",tickTransform),context!==selection&&(path=path.transition(context),tick=tick.transition(context),line=line.transition(context),text=text.transition(context),tickExit=tickExit.transition(context).attr("opacity",epsilon).attr("transform",function(d){return isFinite(d=position(d))?transform(d):this.getAttribute("transform")}),tickEnter.attr("opacity",epsilon).attr("transform",function(d){var p=this.parentNode.__axis;return transform(p&&isFinite(p=p(d))?p:position(d))})),tickExit.remove(),path.attr("d",orient===axis_left||orient==axis_right?"M"+k*tickSizeOuter+","+range0+"H0.5V"+range1+"H"+k*tickSizeOuter:"M"+range0+","+k*tickSizeOuter+"V0.5H"+range1+"V"+k*tickSizeOuter),tick.attr("opacity",1).attr("transform",function(d){return transform(position(d))}),line.attr(x+"2",k*tickSizeInner),text.attr(x,k*spacing).text(format),selection.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",orient===axis_right?"start":orient===axis_left?"end":"middle"),selection.each(function(){this.__axis=position})}return axis.scale=function(_){return arguments.length?(scale=_,axis):scale},axis.tickTransform=function(_){return arguments.length?(tickTransform=_,axis):tickTransform},axis.ticks=function(){return tickArguments=src_array_slice.call(arguments),axis},axis.tickArguments=function(_){return arguments.length?(tickArguments=null==_?[]:src_array_slice.call(_),axis):tickArguments.slice()},axis.tickValues=function(_){return arguments.length?(tickValues=null==_?null:src_array_slice.call(_),axis):tickValues&&tickValues.slice()},axis.tickFormat=function(_){return arguments.length?(tickFormat=_,axis):tickFormat},axis.tickSize=function(_){return arguments.length?(tickSizeInner=tickSizeOuter=+_,axis):tickSizeInner},axis.tickSizeInner=function(_){return arguments.length?(tickSizeInner=+_,axis):tickSizeInner},axis.tickSizeOuter=function(_){return arguments.length?(tickSizeOuter=+_,axis):tickSizeOuter},axis.tickPadding=function(_){return arguments.length?(tickPadding=+_,axis):tickPadding},axis}var pi=Math.PI,tau=2*pi,tauEpsilon=tau-1e-6;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function moveTo(x,y){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)},closePath:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function lineTo(x,y){this._+="L"+(this._x1=+x)+","+(this._y1=+y)},quadraticCurveTo:function quadraticCurveTo(x1,y1,x,y){this._+="Q"+ +x1+","+ +y1+","+(this._x1=+x)+","+(this._y1=+y)},bezierCurveTo:function bezierCurveTo(x1,y1,x2,y2,x,y){this._+="C"+ +x1+","+ +y1+","+ +x2+","+ +y2+","+(this._x1=+x)+","+(this._y1=+y)},arcTo:function arcTo(x1,y1,x2,y2,r){x1=+x1,y1=+y1,x2=+x2,y2=+y2,r=+r;var x0=this._x1,y0=this._y1,x21=x2-x1,y21=y2-y1,x01=x0-x1,y01=y0-y1,l01_2=x01*x01+y01*y01;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=x1)+","+(this._y1=y1);else if(l01_2>1e-6)if(Math.abs(y01*x21-y21*x01)>1e-6&&r){var x20=x2-x0,y20=y2-y0,l21_2=x21*x21+y21*y21,l20_2=x20*x20+y20*y20,l21=Math.sqrt(l21_2),l01=Math.sqrt(l01_2),l=r*Math.tan((pi-Math.acos((l21_2+l01_2-l20_2)/(2*l21*l01)))/2),t01=l/l01,t21=l/l21;Math.abs(t01-1)>1e-6&&(this._+="L"+(x1+t01*x01)+","+(y1+t01*y01)),this._+="A"+r+","+r+",0,0,"+ +(y01*x20>x01*y20)+","+(this._x1=x1+t21*x21)+","+(this._y1=y1+t21*y21)}else this._+="L"+(this._x1=x1)+","+(this._y1=y1);else;},arc:function arc(x,y,r,a0,a1,ccw){x=+x,y=+y,ccw=!!ccw;var dx=(r=+r)*Math.cos(a0),dy=r*Math.sin(a0),x0=x+dx,y0=y+dy,cw=1^ccw,da=ccw?a0-a1:a1-a0;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+x0+","+y0:(Math.abs(this._x1-x0)>1e-6||Math.abs(this._y1-y0)>1e-6)&&(this._+="L"+x0+","+y0),r&&(da<0&&(da=da%tau+tau),da>tauEpsilon?this._+="A"+r+","+r+",0,1,"+cw+","+(x-dx)+","+(y-dy)+"A"+r+","+r+",0,1,"+cw+","+(this._x1=x0)+","+(this._y1=y0):da>1e-6&&(this._+="A"+r+","+r+",0,"+ +(da>=pi)+","+cw+","+(this._x1=x+r*Math.cos(a1))+","+(this._y1=y+r*Math.sin(a1))))},rect:function rect(x,y,w,h){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)+"h"+ +w+"v"+ +h+"h"+-w+"Z"},toString:function toString(){return this._}};var src_path=path_path,d3_shape_src_constant=function(x){return function constant(){return x}},abs=Math.abs,atan2=Math.atan2,cos=Math.cos,math_max=Math.max,math_min=Math.min,sin=Math.sin,math_sqrt=Math.sqrt,math_epsilon=1e-12,math_pi=Math.PI,halfPi=math_pi/2,math_tau=2*math_pi;function asin(x){return x>=1?halfPi:x<=-1?-halfPi:Math.asin(x)}function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/math_sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*math_sqrt(math_max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function Linear(context){this._context=context}Linear.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:this._context.lineTo(x,y)}}};var curve_linear=function(context){return new Linear(context)};function point_x(p){return p[0]}function point_y(p){return p[1]}var src_line=function(){var x=point_x,y=point_y,defined=d3_shape_src_constant(!0),context=null,curve=curve_linear,output=null;function line(data){var i,d,buffer,n=data.length,defined0=!1;for(null==context&&(output=curve(buffer=src_path())),i=0;i<=n;++i)!(i=j;--k)output.point(x0z[k],y0z[k]);output.lineEnd(),output.areaEnd()}defined0&&(x0z[i]=+x0(d,i,data),y0z[i]=+y0(d,i,data),output.point(x1?+x1(d,i,data):x0z[i],y1?+y1(d,i,data):y0z[i]))}if(buffer)return output=null,buffer+""||null}function arealine(){return src_line().defined(defined).curve(curve).context(context)}return area.x=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),x1=null,area):x0},area.x0=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),area):x0},area.x1=function(_){return arguments.length?(x1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):x1},area.y=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),y1=null,area):y0},area.y0=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),area):y0},area.y1=function(_){return arguments.length?(y1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):y1},area.lineX0=area.lineY0=function(){return arealine().x(x0).y(y0)},area.lineY1=function(){return arealine().x(x0).y(y1)},area.lineX1=function(){return arealine().x(x1).y(y0)},area.defined=function(_){return arguments.length?(defined="function"==typeof _?_:d3_shape_src_constant(!!_),area):defined},area.curve=function(_){return arguments.length?(curve=_,null!=context&&(output=curve(context)),area):curve},area.context=function(_){return arguments.length?(null==_?context=output=null:output=curve(context=_),area):context},area},src_descending=function(a,b){return ba?1:b>=a?0:NaN},d3_shape_src_identity=function(d){return d};curveRadial(curve_linear);function Radial(curve){this._curve=curve}function curveRadial(curve){function radial(context){return new Radial(curve(context))}return radial._curve=curve,radial}Radial.prototype={areaStart:function areaStart(){this._curve.areaStart()},areaEnd:function areaEnd(){this._curve.areaEnd()},lineStart:function lineStart(){this._curve.lineStart()},lineEnd:function lineEnd(){this._curve.lineEnd()},point:function point(a,r){this._curve.point(r*Math.sin(a),r*-Math.cos(a))}};var d3_shape_src_array_slice=Array.prototype.slice;var symbol_circle={draw:function draw(context,size){var r=Math.sqrt(size/math_pi);context.moveTo(r,0),context.arc(0,0,r,0,math_tau)}},symbol_cross={draw:function draw(context,size){var r=Math.sqrt(size/5)/2;context.moveTo(-3*r,-r),context.lineTo(-r,-r),context.lineTo(-r,-3*r),context.lineTo(r,-3*r),context.lineTo(r,-r),context.lineTo(3*r,-r),context.lineTo(3*r,r),context.lineTo(r,r),context.lineTo(r,3*r),context.lineTo(-r,3*r),context.lineTo(-r,r),context.lineTo(-3*r,r),context.closePath()}},tan30=Math.sqrt(1/3),tan30_2=2*tan30,diamond={draw:function draw(context,size){var y=Math.sqrt(size/tan30_2),x=y*tan30;context.moveTo(0,-y),context.lineTo(x,0),context.lineTo(0,y),context.lineTo(-x,0),context.closePath()}},kr=Math.sin(math_pi/10)/Math.sin(7*math_pi/10),kx=Math.sin(math_tau/10)*kr,ky=-Math.cos(math_tau/10)*kr,star={draw:function draw(context,size){var r=Math.sqrt(.8908130915292852*size),x=kx*r,y=ky*r;context.moveTo(0,-r),context.lineTo(x,y);for(var i=1;i<5;++i){var a=math_tau*i/5,c=Math.cos(a),s=Math.sin(a);context.lineTo(s*r,-c*r),context.lineTo(c*x-s*y,s*x+c*y)}context.closePath()}},square={draw:function draw(context,size){var w=Math.sqrt(size),x=-w/2;context.rect(x,x,w,w)}},sqrt3=Math.sqrt(3),triangle={draw:function draw(context,size){var y=-Math.sqrt(size/(3*sqrt3));context.moveTo(0,2*y),context.lineTo(-sqrt3*y,-y),context.lineTo(sqrt3*y,-y),context.closePath()}},wye_s=Math.sqrt(3)/2,wye_k=1/Math.sqrt(12),wye_a=3*(wye_k/2+1),wye={draw:function draw(context,size){var r=Math.sqrt(size/wye_a),x0=r/2,y0=r*wye_k,x1=x0,y1=r*wye_k+r,x2=-x1,y2=y1;context.moveTo(x0,y0),context.lineTo(x1,y1),context.lineTo(x2,y2),context.lineTo(-.5*x0-wye_s*y0,wye_s*x0+-.5*y0),context.lineTo(-.5*x1-wye_s*y1,wye_s*x1+-.5*y1),context.lineTo(-.5*x2-wye_s*y2,wye_s*x2+-.5*y2),context.lineTo(-.5*x0+wye_s*y0,-.5*y0-wye_s*x0),context.lineTo(-.5*x1+wye_s*y1,-.5*y1-wye_s*x1),context.lineTo(-.5*x2+wye_s*y2,-.5*y2-wye_s*x2),context.closePath()}},noop=function(){};function _point(that,x,y){that._context.bezierCurveTo((2*that._x0+that._x1)/3,(2*that._y0+that._y1)/3,(that._x0+2*that._x1)/3,(that._y0+2*that._y1)/3,(that._x0+4*that._x1+x)/6,(that._y0+4*that._y1+y)/6)}function Basis(context){this._context=context}Basis.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 3:_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function BasisClosed(context){this._context=context}BasisClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._x2=x,this._y2=y;break;case 1:this._point=2,this._x3=x,this._y3=y;break;case 2:this._point=3,this._x4=x,this._y4=y,this._context.moveTo((this._x0+4*this._x1+x)/6,(this._y0+4*this._y1+y)/6);break;default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function BasisOpen(context){this._context=context}BasisOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var x0=(this._x0+4*this._x1+x)/6,y0=(this._y0+4*this._y1+y)/6;this._line?this._context.lineTo(x0,y0):this._context.moveTo(x0,y0);break;case 3:this._point=4;default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function Bundle(context,beta){this._basis=new Basis(context),this._beta=beta}Bundle.prototype={lineStart:function lineStart(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function lineEnd(){var x=this._x,y=this._y,j=x.length-1;if(j>0)for(var t,x0=x[0],y0=y[0],dx=x[j]-x0,dy=y[j]-y0,i=-1;++i<=j;)t=i/j,this._basis.point(this._beta*x[i]+(1-this._beta)*(x0+t*dx),this._beta*y[i]+(1-this._beta)*(y0+t*dy));this._x=this._y=null,this._basis.lineEnd()},point:function point(x,y){this._x.push(+x),this._y.push(+y)}};(function custom(beta){function bundle(context){return 1===beta?new Basis(context):new Bundle(context,beta)}return bundle.beta=function(beta){return custom(+beta)},bundle})(.85);function cardinal_point(that,x,y){that._context.bezierCurveTo(that._x1+that._k*(that._x2-that._x0),that._y1+that._k*(that._y2-that._y0),that._x2+that._k*(that._x1-x),that._y2+that._k*(that._y1-y),that._x2,that._y2)}function Cardinal(context,tension){this._context=context,this._k=(1-tension)/6}Cardinal.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2,this._x1=x,this._y1=y;break;case 2:this._point=3;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new Cardinal(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CardinalClosed(context,tension){this._context=context,this._k=(1-tension)/6}CardinalClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._x3=x,this._y3=y;break;case 1:this._point=2,this._context.moveTo(this._x4=x,this._y4=y);break;case 2:this._point=3,this._x5=x,this._y5=y;break;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new CardinalClosed(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CardinalOpen(context,tension){this._context=context,this._k=(1-tension)/6}CardinalOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new CardinalOpen(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function catmullRom_point(that,x,y){var x1=that._x1,y1=that._y1,x2=that._x2,y2=that._y2;if(that._l01_a>math_epsilon){var a=2*that._l01_2a+3*that._l01_a*that._l12_a+that._l12_2a,n=3*that._l01_a*(that._l01_a+that._l12_a);x1=(x1*a-that._x0*that._l12_2a+that._x2*that._l01_2a)/n,y1=(y1*a-that._y0*that._l12_2a+that._y2*that._l01_2a)/n}if(that._l23_a>math_epsilon){var b=2*that._l23_2a+3*that._l23_a*that._l12_a+that._l12_2a,m=3*that._l23_a*(that._l23_a+that._l12_a);x2=(x2*b+that._x1*that._l23_2a-x*that._l12_2a)/m,y2=(y2*b+that._y1*that._l23_2a-y*that._l12_2a)/m}that._context.bezierCurveTo(x1,y1,x2,y2,that._x2,that._y2)}function CatmullRom(context,alpha){this._context=context,this._alpha=alpha}CatmullRom.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};var curve_catmullRom=function custom(alpha){function catmullRom(context){return alpha?new CatmullRom(context,alpha):new Cardinal(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom}(.5);function CatmullRomClosed(context,alpha){this._context=context,this._alpha=alpha}CatmullRomClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=x,this._y3=y;break;case 1:this._point=2,this._context.moveTo(this._x4=x,this._y4=y);break;case 2:this._point=3,this._x5=x,this._y5=y;break;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(alpha){function catmullRom(context){return alpha?new CatmullRomClosed(context,alpha):new CardinalClosed(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom})(.5);function CatmullRomOpen(context,alpha){this._context=context,this._alpha=alpha}CatmullRomOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(alpha){function catmullRom(context){return alpha?new CatmullRomOpen(context,alpha):new CardinalOpen(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom})(.5);function LinearClosed(context){this._context=context}LinearClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){this._point&&this._context.closePath()},point:function point(x,y){x=+x,y=+y,this._point?this._context.lineTo(x,y):(this._point=1,this._context.moveTo(x,y))}};function monotone_sign(x){return x<0?-1:1}function slope3(that,x2,y2){var h0=that._x1-that._x0,h1=x2-that._x1,s0=(that._y1-that._y0)/(h0||h1<0&&-0),s1=(y2-that._y1)/(h1||h0<0&&-0),p=(s0*h1+s1*h0)/(h0+h1);return(monotone_sign(s0)+monotone_sign(s1))*Math.min(Math.abs(s0),Math.abs(s1),.5*Math.abs(p))||0}function slope2(that,t){var h=that._x1-that._x0;return h?(3*(that._y1-that._y0)/h-t)/2:t}function monotone_point(that,t0,t1){var x0=that._x0,y0=that._y0,x1=that._x1,y1=that._y1,dx=(x1-x0)/3;that._context.bezierCurveTo(x0+dx,y0+dx*t0,x1-dx,y1-dx*t1,x1,y1)}function MonotoneX(context){this._context=context}function MonotoneY(context){this._context=new ReflectContext(context)}function ReflectContext(context){this._context=context}function Natural(context){this._context=context}function controlPoints(x){var i,m,n=x.length-1,a=new Array(n),b=new Array(n),r=new Array(n);for(a[0]=0,b[0]=2,r[0]=x[0]+2*x[1],i=1;i=0;--i)a[i]=(r[i]-a[i+1])/b[i];for(b[n-1]=(x[n]+a[n-1])/2,i=0;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,y),this._context.lineTo(x,y);else{var x1=this._x*(1-this._t)+x*this._t;this._context.lineTo(x1,this._y),this._context.lineTo(x1,y)}}this._x=x,this._y=y}};var curve_step=function(context){return new Step(context,.5)};function stepBefore(context){return new Step(context,0)}function stepAfter(context){return new Step(context,1)}var none=function(series,order){if((n=series.length)>1)for(var j,s0,n,i=1,s1=series[order[0]],m=s1.length;i=0;)o[n]=n;return o};function stackValue(d,key){return d[key]}var order_ascending=function(series){var sums=series.map(ascending_sum);return order_none(series).sort(function(a,b){return sums[a]-sums[b]})};function ascending_sum(series){for(var v,s=0,i=-1,n=series.length;++i0)){if(r/=dx,dx<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=x1-ax,dx||!(r<0)){if(r/=dx,dx<0){if(r>t1)return;r>t0&&(t0=r)}else if(dx>0){if(r0)){if(r/=dy,dy<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=y1-ay,dy||!(r<0)){if(r/=dy,dy<0){if(r>t1)return;r>t0&&(t0=r)}else if(dy>0){if(r0||t1<1)||(t0>0&&(edge[0]=[ax+t0*dx,ay+t0*dy]),t1<1&&(edge[1]=[ax+t1*dx,ay+t1*dy]),!0)}}}}}function connectEdge(edge,x0,y0,x1,y1){var v1=edge[1];if(v1)return!0;var fm,fb,v0=edge[0],left=edge.left,right=edge.right,lx=left[0],ly=left[1],rx=right[0],ry=right[1],fx=(lx+rx)/2,fy=(ly+ry)/2;if(ry===ly){if(fx=x1)return;if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[fx,y0];v1=[fx,y1]}else{if(v0){if(v0[1]1)if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[(y0-fb)/fm,y0];v1=[(y1-fb)/fm,y1]}else{if(v0){if(v0[1]=x1)return}else v0=[x0,fm*x0+fb];v1=[x1,fm*x1+fb]}else{if(v0){if(v0[0]=-Diagram_epsilon2)){var ha=ax*ax+ay*ay,hc=cx*cx+cy*cy,x=(cy*ha-ay*hc)/d,y=(ax*hc-cx*ha)/d,circle=circlePool.pop()||new function Circle(){RedBlackNode(this),this.x=this.y=this.arc=this.site=this.cy=null};circle.arc=arc,circle.site=cSite,circle.x=x+bx,circle.y=(circle.cy=y+by)+Math.sqrt(x*x+y*y),arc.circle=circle;for(var before=null,node=circles._;node;)if(circle.yDiagram_epsilon)node=node.L;else{if(!((dxr=x-rightBreakPoint(node,directrix))>Diagram_epsilon)){dxl>-Diagram_epsilon?(lArc=node.P,rArc=node):dxr>-Diagram_epsilon?(lArc=node,rArc=node.N):lArc=rArc=node;break}if(!node.R){lArc=node;break}node=node.R}!function createCell(site){return Diagram_cells[site.index]={site:site,halfedges:[]}}(site);var newArc=createBeach(site);if(beaches.insert(lArc,newArc),lArc||rArc){if(lArc===rArc)return detachCircle(lArc),rArc=createBeach(lArc.site),beaches.insert(newArc,rArc),newArc.edge=rArc.edge=createEdge(lArc.site,newArc.site),attachCircle(lArc),void attachCircle(rArc);if(rArc){detachCircle(lArc),detachCircle(rArc);var lSite=lArc.site,ax=lSite[0],ay=lSite[1],bx=site[0]-ax,by=site[1]-ay,rSite=rArc.site,cx=rSite[0]-ax,cy=rSite[1]-ay,d=2*(bx*cy-by*cx),hb=bx*bx+by*by,hc=cx*cx+cy*cy,vertex=[(cy*hb-by*hc)/d+ax,(bx*hc-cx*hb)/d+ay];setEdgeEnd(rArc.edge,lSite,rSite,vertex),newArc.edge=createEdge(lSite,site,null,vertex),rArc.edge=createEdge(site,rSite,null,vertex),attachCircle(lArc),attachCircle(rArc)}else newArc.edge=createEdge(lArc.site,newArc.site)}}function leftBreakPoint(arc,directrix){var site=arc.site,rfocx=site[0],rfocy=site[1],pby2=rfocy-directrix;if(!pby2)return rfocx;var lArc=arc.P;if(!lArc)return-1/0;var lfocx=(site=lArc.site)[0],lfocy=site[1],plby2=lfocy-directrix;if(!plby2)return lfocx;var hl=lfocx-rfocx,aby2=1/pby2-1/plby2,b=hl/plby2;return aby2?(-b+Math.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx:(rfocx+lfocx)/2}function rightBreakPoint(arc,directrix){var rArc=arc.N;if(rArc)return leftBreakPoint(rArc,directrix);var site=arc.site;return site[1]===directrix?site[0]:1/0}var beaches,Diagram_cells,circles,Diagram_edges,Diagram_epsilon=1e-6,Diagram_epsilon2=1e-12;function triangleArea(a,b,c){return(a[0]-c[0])*(b[1]-a[1])-(a[0]-b[0])*(c[1]-a[1])}function lexicographic(a,b){return b[1]-a[1]||b[0]-a[0]}function Diagram(sites,extent){var x,y,circle,site=sites.sort(lexicographic).pop();for(Diagram_edges=[],Diagram_cells=new Array(sites.length),beaches=new src_RedBlackTree,circles=new src_RedBlackTree;;)if(circle=firstCircle,site&&(!circle||site[1]Diagram_epsilon||Math.abs(edge[0][1]-edge[1][1])>Diagram_epsilon)||delete Diagram_edges[i]}(x0,y0,x1,y1),function clipCells(x0,y0,x1,y1){var iCell,cell,site,iHalfedge,halfedges,nHalfedges,start,startX,startY,end,endX,endY,nCells=Diagram_cells.length,cover=!0;for(iCell=0;iCellDiagram_epsilon||Math.abs(endY-startY)>Diagram_epsilon)&&(halfedges.splice(iHalfedge,0,Diagram_edges.push(createBorderEdge(site,end,Math.abs(endX-x0)Diagram_epsilon?[x0,Math.abs(startX-x0)Diagram_epsilon?[Math.abs(startY-y1)Diagram_epsilon?[x1,Math.abs(startX-x1)Diagram_epsilon?[Math.abs(startY-y0)=n)return null;var dx=x-cell.site[0],dy=y-cell.site[1],d2=dx*dx+dy*dy;do{cell=that.cells[i0=i1],i1=null,cell.halfedges.forEach(function(e){var edge=that.edges[e],v=edge.left;if(v!==cell.site&&v||(v=edge.right)){var vx=x-v[0],vy=y-v[1],v2=vx*vx+vy*vy;v20?0:domain[0],domain[1]=domain[1]>0?domain[1]:0),domain},unionDomain=function unionDomain(domains,fieldType){var _ref2,domain=[];(domains=domains.filter(function(dom){return dom&&dom.length})).length&&(domain=fieldType===CATEGORICAL?(_ref2=[]).concat.apply(_ref2,common_utils_toConsumableArray(domains)):[Math.min.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[0]}))),Math.max.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[1]})))]);return domain},symbolFns={circle:symbol_circle,cross:symbol_cross,diamond:diamond,square:square,star:star,wye:wye,triangle:triangle},easeFns={cubic:cubicInOut,bounce:bounceOut,linear:function src_linear_linear(t){return+t},elastic:elasticOut,back:backInOut,poly:polyInOut,circle:function circleInOut(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}},common_utils_getClosestIndexOf=function getClosestIndexOf(arr,value,side){for(var mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1},getNearestValue=function getNearestValue(data,key){var filterData=data.filter(function(d){return"number"==typeof d});return filterData[common_utils_getClosestIndexOf(filterData,key)]},getWindow=function getWindow(){return window},getQualifiedClassName=(requestAnimationFrame,cancelAnimationFrame,function getQualifiedClassName(cls,id,prefix){return cls=cls.replace(/^\.*/,""),["".concat(prefix,"-").concat(cls),"".concat(prefix,"-").concat(cls,"-").concat(id)]}),defaultValue=function defaultValue(param,value){return void 0===param||"object"===common_utils_typeof(param)&&!param?value:param},objectIterator=function objectIterator(obj,fn){for(var key in obj)Object.hasOwnProperty.call(obj,key)&&fn(key,obj)},common_utils_Voronoi=function(){function Voronoi(){var data=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function common_utils_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Voronoi),this._voronoi=src_voronoi().x(function(d){return d.x}).y(function(d){return d.y}),this.data(data)}return function common_utils_createClass(Constructor,protoProps,staticProps){return protoProps&&common_utils_defineProperties(Constructor.prototype,protoProps),staticProps&&common_utils_defineProperties(Constructor,staticProps),Constructor}(Voronoi,[{key:"data",value:function data(_data){return _data&&(this._voronoiFn=this._voronoi(_data)),this}},{key:"find",value:function find(x,y,radius){return this._voronoiFn.find(x,y,radius)}}]),Voronoi}(),getObjProp=function getObjProp(obj){if(void 0===obj||null===obj)return obj;for(var retObj=obj,_len=arguments.length,fields=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)fields[_key-1]=arguments[_key];for(var i=0,len=fields.length;i=0;i--)if(arr1[i]!==arr2[i])return!1;return!0}(oldVal,newVal):"Object"===type?Object.is(oldVal,newVal):oldVal===newVal}},ERROR_MSG={INTERFACE_IMPL:"Method not implemented"},mergeRecursive=function mergeRecursive(source,sink){for(var prop in sink)isSimpleObject(source[prop])&&isSimpleObject(sink[prop])?mergeRecursive(source[prop],sink[prop]):sink[prop]instanceof Object&&sink[prop].constructor===Object?(source[prop]={},mergeRecursive(source[prop],sink[prop])):source[prop]=sink[prop];return source},common_utils_createSelection=function createSelection(sel,appendObj,data,idFn){var selection=sel||function dataSelect(idFn){return new DataSystem_selection(idFn)}(idFn),mergedSelection=(selection=selection.data(data)).enter().append(appendObj).merge(selection),exitSelection=selection.exit();return exitSelection.getObjects().forEach(function(inst){return inst.remove()}),exitSelection.remove(),mergedSelection},common_utils_interpolator=function interpolator(){return src_value},common_utils_numberInterpolator=function numberInterpolator(){return src_number},common_utils_piecewiseInterpolator=function piecewiseInterpolator(){return piecewise_piecewise};var rgbToHsv=function rgbToHsv(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r=+r,g=+g,b=+b,a=+a,r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;if(max===min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(g=range[0]&&val<=range[1]})},{saveChild:!1,mode:mode})},common_utils_getDataModelFromIdentifiers=function getDataModelFromIdentifiers(dataModel,identifiers,mode){var filteredDataModel;if(identifiers instanceof Array){var fieldsConfig=dataModel.getFieldsConfig(),dataArr=identifiers.slice(1,identifiers.length);if(identifiers instanceof Function)filteredDataModel=identifiers(dataModel,{},!1);else if(identifiers instanceof Array&&identifiers[0].length){var filteredSchema=identifiers[0].filter(function(d){return d in fieldsConfig});filteredDataModel=dataModel.select(function(fields){var include=!0;return filteredSchema.forEach(function(propField,idx){var value=fields[propField].internalValue,index=dataArr.findIndex(function(d){return d[idx]===value});include=include&&-1!==index}),include},{saveChild:!1,mode:mode})}else filteredDataModel=dataModel.select(function(){return!1},{saveChild:!1,mode:mode})}else filteredDataModel=getDataModelFromRange(dataModel,identifiers,mode);return filteredDataModel},isValidValue=function isValidValue(value){return!isNaN(value)&&value!==-1/0&&value!==1/0},toArray=function toArray(arr){return arr instanceof Array?arr:[arr]},common_utils_getSymbol=function getSymbol(type){return function(){var type=d3_shape_src_constant(symbol_circle),size=d3_shape_src_constant(64),context=null;function symbol(){var buffer;if(context||(context=buffer=src_path()),type.apply(this,arguments).draw(context,+size.apply(this,arguments)),buffer)return context=null,buffer+""||null}return symbol.type=function(_){return arguments.length?(type="function"==typeof _?_:d3_shape_src_constant(_),symbol):type},symbol.size=function(_){return arguments.length?(size="function"==typeof _?_:d3_shape_src_constant(+_),symbol):size},symbol.context=function(_){return arguments.length?(context=null==_?null:_,symbol):context},symbol}().type(symbolFns[type])},stackOrders=(_defineProperty(_stackOrders={},"none",order_none),_defineProperty(_stackOrders,"ascending",order_ascending),_defineProperty(_stackOrders,"descending",function(series){return order_ascending(series).reverse()}),_stackOrders),stackOffsets=(_defineProperty(_stackOffsets={},"diverging",function(series,order){if((n=series.length)>0)for(var i,d,dy,yp,yn,n,j=0,m=series[order[0]].length;j=0?(d[0]=yp,d[1]=yp+=dy):dy<0?(d[1]=yn,d[0]=yn+=dy):d[0]=yp}),_defineProperty(_stackOffsets,"none",none),_defineProperty(_stackOffsets,"expand",function(series,order){if((n=series.length)>0){for(var i,n,y,j=0,m=series[0].length;j0&&(m=(s0=series[order[0]]).length)>0){for(var s0,m,n,y=0,j=1;j0&&(sum+=v);for(null!=sortValues?index.sort(function(i,j){return sortValues(arcs[i],arcs[j])}):null!=sort&&index.sort(function(i,j){return sort(data[i],data[j])}),i=0,k=sum?(da-n*pa)/sum:0;i0?v*k:0)+pa,arcs[j]={data:data[j],index:i,value:v,startAngle:a0,endAngle:a1,padAngle:p};return arcs}return pie.value=function(_){return arguments.length?(value="function"==typeof _?_:d3_shape_src_constant(+_),pie):value},pie.sortValues=function(_){return arguments.length?(sortValues=_,sort=null,pie):sortValues},pie.sort=function(_){return arguments.length?(sort=_,sortValues=null,pie):sort},pie.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):startAngle},pie.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):endAngle},pie.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):padAngle},pie},arc:function(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=d3_shape_src_constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null;function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=src_path()),r1math_epsilon)if(da>math_tau-math_epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>math_epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>math_epsilon&&(padRadius?+padRadius.apply(this,arguments):math_sqrt(r0*r0+r1*r1)),rc=math_min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>math_epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>math_epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>math_epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>math_epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da1?0:x<-1?math_pi:Math.acos(x)}((ax*bx+ay*by)/(math_sqrt(ax*ax+ay*ay)*math_sqrt(bx*bx+by*by)))/2),lc=math_sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=math_min(rc,(r0-lc)/(kc-1)),rc1=math_min(rc,(r1-lc)/(kc+1))}}da1>math_epsilon?rc1>math_epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1math_epsilon&&da0>math_epsilon?rc0>math_epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc01?_len3-1:0),_key3=1;_key3<_len3;_key3++)measureFieldNames[_key3-1]=arguments[_key3];var filteredReducers={};if(dataModel instanceof datamodel_default.a){var derivations=[].concat(common_utils_toConsumableArray(dataModel.getDerivations().reverse()),common_utils_toConsumableArray(dataModel.getAncestorDerivations().reverse())),nearestReducers=defaultValue(getObjProp(derivations.find(function(derv){return derv.op===dist_datamodel.DM_DERIVATIVES.GROUPBY}),"criteria"),{}),measures=dataModel.getFieldspace().getMeasure();(measureFieldNames=measureFieldNames.length?measureFieldNames:Object.keys(measures)).forEach(function(measureName){if(nearestReducers[measureName])filteredReducers[measureName]=nearestReducers[measureName];else{var measureField=measures[measureName];measureField&&(filteredReducers[measureName]=measureField.defAggFn())}})}return filteredReducers},retrieveFieldDisplayName=function retrieveFieldDisplayName(dm,fieldName){return dm.getFieldspace().fieldsObj()[fieldName].displayName()},sortOrderMap=(_defineProperty(_sortOrderMap={},"asc",function(firstVal,secondVal){return firstVal.localeCompare(secondVal)}),_defineProperty(_sortOrderMap,"desc",function(firstVal,secondVal){return secondVal.localeCompare(firstVal)}),_sortOrderMap),common_utils_intersect=function intersect(arr1,arr2){var _accessors=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors[0],fn2=_accessors[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return set.has(fn1(value))})},xhtml="http://www.w3.org/1999/xhtml",src_namespaces={svg:"http://www.w3.org/2000/svg",xhtml:xhtml,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},src_namespace=function(name){var prefix=name+="",i=prefix.indexOf(":");return i>=0&&"xmlns"!==(prefix=name.slice(0,i))&&(name=name.slice(i+1)),src_namespaces.hasOwnProperty(prefix)?{space:src_namespaces[prefix],local:name}:name};var creator=function(name){var fullname=src_namespace(name);return(fullname.local?function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local)}}:function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name)}})(fullname)};function selector_none(){}var src_selector=function(selector){return null==selector?selector_none:function(){return this.querySelector(selector)}};function selectorAll_empty(){return[]}var selectorAll=function(selector){return null==selector?selectorAll_empty:function(){return this.querySelectorAll(selector)}},matcher=function(selector){return function(){return this.matches(selector)}},sparse=function(update){return new Array(update.length)};function EnterNode(parent,datum){this.ownerDocument=parent.ownerDocument,this.namespaceURI=parent.namespaceURI,this._next=null,this._parent=parent,this.__data__=datum}EnterNode.prototype={constructor:EnterNode,appendChild:function appendChild(child){return this._parent.insertBefore(child,this._next)},insertBefore:function insertBefore(child,next){return this._parent.insertBefore(child,next)},querySelector:function querySelector(selector){return this._parent.querySelector(selector)},querySelectorAll:function querySelectorAll(selector){return this._parent.querySelectorAll(selector)}};var keyPrefix="$";function bindIndex(parent,group,enter,update,exit,data){for(var node,i=0,groupLength=group.length,dataLength=data.length;ib?1:a>=b?0:NaN}var src_window=function(node){return node.ownerDocument&&node.ownerDocument.defaultView||node.document&&node||node.defaultView};function styleValue(node,name){return node.style.getPropertyValue(name)||src_window(node).getComputedStyle(node,null).getPropertyValue(name)}function classArray(string){return string.trim().split(/^|\s+/)}function classList(node){return node.classList||new ClassList(node)}function ClassList(node){this._node=node,this._names=classArray(node.getAttribute("class")||"")}function classedAdd(node,names){for(var list=classList(node),i=-1,n=names.length;++i=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function contains(name){return this._names.indexOf(name)>=0}};function textRemove(){this.textContent=""}function htmlRemove(){this.innerHTML=""}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function constantNull(){return null}function remove_remove(){var parent=this.parentNode;parent&&parent.removeChild(this)}function selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var filterEvents={},on_event=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(filterEvents={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(listener,index,group){return listener=contextListener(listener,index,group),function(event){var related=event.relatedTarget;related&&(related===this||8&related.compareDocumentPosition(this))||listener.call(this,event)}}function contextListener(listener,index,group){return function(event1){var event0=on_event;on_event=event1;try{listener.call(this,this.__data__,index,group)}finally{on_event=event0}}}function onRemove(typename){return function(){var on=this.__on;if(on){for(var o,j=0,i=-1,m=on.length;j=i1&&(i1=i0+1);!(next=updateGroup[i1])&&++i1=0;)(node=group[i])&&(next&&4^node.compareDocumentPosition(next)&&next.parentNode.insertBefore(node,next),next=node);return this},sort:function(compare){function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b}compare||(compare=sort_ascending);for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;j1?this.each((null==value?function styleRemove(name){return function(){this.style.removeProperty(name)}}:"function"==typeof value?function styleFunction(name,value,priority){return function(){var v=value.apply(this,arguments);null==v?this.style.removeProperty(name):this.style.setProperty(name,v,priority)}}:function styleConstant(name,value,priority){return function(){this.style.setProperty(name,value,priority)}})(name,value,null==priority?"":priority)):styleValue(this.node(),name)},property:function(name,value){return arguments.length>1?this.each((null==value?function propertyRemove(name){return function(){delete this[name]}}:"function"==typeof value?function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);null==v?delete this[name]:this[name]=v}}:function propertyConstant(name,value){return function(){this[name]=value}})(name,value)):this.node()[name]},classed:function(name,value){var names=classArray(name+"");if(arguments.length<2){for(var list=classList(this.node()),i=-1,n=names.length;++i=0&&(name=t.slice(i+1),t=t.slice(0,i)),{type:t,name:name}})}(typename+""),n=typenames.length;if(!(arguments.length<2)){for(on=value?onAdd:onRemove,null==capture&&(capture=!1),i=0;i=0&&(name=t.slice(i+1),t=t.slice(0,i)),t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:name}})}(typename+"",_),i=-1,n=T.length;if(!(arguments.length<2)){if(null!=callback&&"function"!=typeof callback)throw new Error("invalid callback: "+callback);for(;++i0)for(var n,t,args=new Array(n),i=0;iclickDistance2}gestures.mouse("drag")}function mouseupped(){src_select(on_event.view).on("mousemove.drag mouseup.drag",null),function yesdrag(view,noclick){var root=view.document.documentElement,selection=src_select(view).on("dragstart.drag",null);noclick&&(selection.on("click.drag",noevent,!0),setTimeout(function(){selection.on("click.drag",null)},0)),"onselectstart"in root?selection.on("selectstart.drag",null):(root.style.MozUserSelect=root.__noselect,delete root.__noselect)}(on_event.view,mousemoving),noevent(),gestures.mouse("end")}function touchstarted(){if(filter.apply(this,arguments)){var i,gesture,touches=on_event.changedTouches,c=container.apply(this,arguments),n=touches.length;for(i=0;i=0&&t._call.call(null,e),t=t._next;--timer_frame}()}finally{timer_frame=0,function nap(){var t0,t2,t1=taskHead,time=1/0;for(;t1;)t1._call?(time>t1._time&&(time=t1._time),t0=t1,t1=t1._next):(t2=t1._next,t1._next=null,t1=t0?t0._next=t2:taskHead=t2);taskTail=t0,sleep(time)}(),clockNow=0}}function poke(){var now=clock.now(),delay=now-clockLast;delay>pokeDelay&&(clockSkew-=delay,clockLast=now)}function sleep(time){timer_frame||(timeout&&(timeout=clearTimeout(timeout)),time-clockNow>24?(time<1/0&&(timeout=setTimeout(wake,time-clock.now()-clockSkew)),timer_interval&&(timer_interval=clearInterval(timer_interval))):(timer_interval||(clockLast=clock.now(),timer_interval=setInterval(poke,pokeDelay)),timer_frame=1,setFrame(wake)))}Timer.prototype=timer_timer.prototype={constructor:Timer,restart:function restart(callback,delay,time){if("function"!=typeof callback)throw new TypeError("callback is not a function");time=(null==time?now():+time)+(null==delay?0:+delay),this._next||taskTail===this||(taskTail?taskTail._next=this:taskHead=this,taskTail=this),this._call=callback,this._time=time,sleep()},stop:function stop(){this._call&&(this._call=null,this._time=1/0,sleep())}};var src_timeout=function(callback,delay,time){var t=new Timer;return delay=null==delay?0:+delay,t.restart(function(elapsed){t.stop(),callback(elapsed+delay)},delay,time),t},emptyOn=src_dispatch("start","end","cancel","interrupt"),emptyTween=[],CREATED=0,SCHEDULED=1,STARTING=2,STARTED=3,RUNNING=4,ENDING=5,ENDED=6,transition_schedule=function(node,name,id,index,group,timing){var schedules=node.__transition;if(schedules){if(id in schedules)return}else node.__transition={};!function schedule_create(node,id,self){var tween,schedules=node.__transition;function start(elapsed){var i,j,n,o;if(self.state!==SCHEDULED)return stop();for(i in schedules)if((o=schedules[i]).name===self.name){if(o.state===STARTED)return src_timeout(start);o.state===RUNNING?(o.state=ENDED,o.timer.stop(),o.on.call("interrupt",node,node.__data__,o.index,o.group),delete schedules[i]):+iCREATED)throw new Error("too late; already scheduled");return schedule}function schedule_set(node,id){var schedule=schedule_get(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule}function schedule_get(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule}function tweenValue(transition,name,value){var id=transition._id;return transition.each(function(){var schedule=schedule_set(this,id);(schedule.value||(schedule.value={}))[name]=value.apply(this,arguments)}),function(node){return schedule_get(node,id).value[name]}}var transition_interpolate=function(a,b){var c;return("number"==typeof b?src_number:b instanceof color_color?src_rgb:(c=color_color(b))?(b=c,src_rgb):src_string)(a,b)};var transition_selection_Selection=src_selection.prototype.constructor;function style_styleRemove(name){return function(){this.style.removeProperty(name)}}var transition_id=0;function Transition(groups,parents,name,id){this._groups=groups,this._parents=parents,this._name=name,this._id=id}function newId(){return++transition_id}var selection_prototype=src_selection.prototype;Transition.prototype=function src_transition_transition(name){return src_selection().transition(name)}.prototype={constructor:Transition,select:function(select){var name=this._name,id=this._id;"function"!=typeof select&&(select=src_selector(select));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j=0&&(t=t.slice(0,i)),!t||"start"===t})}(name)?init:schedule_set;return function(){var schedule=sit(this,id),on=schedule.on;on!==on0&&(on1=(on0=on).copy()).on(name,listener),schedule.on=on1}}(id,name,listener))},attr:function(name,value){var fullname=src_namespace(name),i="transform"===fullname?interpolateTransformSvg:transition_interpolate;return this.attrTween(name,"function"==typeof value?(fullname.local?function attr_attrFunctionNS(fullname,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttributeNS(fullname.space,fullname.local))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttribute(name))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttribute(name)}})(fullname,i,tweenValue(this,"attr."+name,value)):null==value?(fullname.local?function attr_attrRemoveNS(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrRemove(name){return function(){this.removeAttribute(name)}})(fullname):(fullname.local?function attr_attrConstantNS(fullname,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttributeNS(fullname.space,fullname.local);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}:function attr_attrConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttribute(name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}})(fullname,i,value))},attrTween:function(name,value){var key="attr."+name;if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;var fullname=src_namespace(name);return this.tween(key,(fullname.local?function attrTweenNS(fullname,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolateNS(fullname,i){return function(t){this.setAttributeNS(fullname.space,fullname.local,i(t))}}(fullname,i)),t0}return tween._value=value,tween}:function attrTween(name,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolate(name,i){return function(t){this.setAttribute(name,i(t))}}(name,i)),t0}return tween._value=value,tween})(fullname,value))},style:function(name,value,priority){var i="transform"==(name+="")?interpolateTransformCss:transition_interpolate;return null==value?this.styleTween(name,function styleNull(name,interpolate){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),string1=(this.style.removeProperty(name),styleValue(this,name));return string0===string1?null:string0===string00&&string1===string10?interpolate0:interpolate0=interpolate(string00=string0,string10=string1)}}(name,i)).on("end.style."+name,style_styleRemove(name)):"function"==typeof value?this.styleTween(name,function style_styleFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),value1=value(this),string1=value1+"";return null==value1&&(this.style.removeProperty(name),string1=value1=styleValue(this,name)),string0===string1?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1))}}(name,i,tweenValue(this,"style."+name,value))).each(function styleMaybeRemove(id,name){var on0,on1,listener0,remove,key="style."+name,event="end."+key;return function(){var schedule=schedule_set(this,id),on=schedule.on,listener=null==schedule.value[key]?remove||(remove=style_styleRemove(name)):void 0;on===on0&&listener0===listener||(on1=(on0=on).copy()).on(event,listener0=listener),schedule.on=on1}}(this._id,name)):this.styleTween(name,function style_styleConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=styleValue(this,name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}(name,i,value),priority).on("end.style."+name,null)},styleTween:function(name,value,priority){var key="style."+(name+="");if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function styleTween(name,value,priority){var t,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t=(i0=i)&&function styleInterpolate(name,i,priority){return function(t){this.style.setProperty(name,i(t),priority)}}(name,i,priority)),t}return tween._value=value,tween}(name,value,null==priority?"":priority))},text:function(value){return this.tween("text","function"==typeof value?function text_textFunction(value){return function(){var value1=value(this);this.textContent=null==value1?"":value1}}(tweenValue(this,"text",value)):function text_textConstant(value){return function(){this.textContent=value}}(null==value?"":value+""))},remove:function(){return this.on("end.remove",function removeFunction(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;parent&&parent.removeChild(this)}}(this._id))},tween:function(name,value){var id=this._id;if(name+="",arguments.length<2){for(var t,tween=schedule_get(this.node(),id).tween,i=0,n=tween.length;iSTARTING&&schedule.state4&&void 0!==arguments[4]?arguments[4]:{},keyFn=arguments.length>5?arguments[5]:void 0;(parent instanceof HTMLElement||parent instanceof SVGElement)&&(parent=renderer_utils_selectElement(parent));var filter,selectorVal=selector?selector[0]:null,selectorType=null,actualSelector=null,element=null,enterSel=null,mergeSel=null;selectorVal?"#"===selectorVal?(selectorType="id",actualSelector=selector):(selectorType="class",actualSelector="."===selector[0]?selector:".".concat(selector)):(actualSelector=elemType,filter=!0),element=parent.selectAll(actualSelector),filter&&(element=element.filter(function(){return this.parentNode===parent.node()})),enterSel=(element=element.data(data,keyFn)).enter().append(elemType||"div"),callbacks.enter&&enterSel.each(function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];callbacks.enter.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),mergeSel=enterSel.merge(element),callbacks.update&&mergeSel.each(function(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];callbacks.update.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),"class"===selectorType?mergeSel.classed("."===selectorVal?selector.substring(1,selector.length):selector,!0):"id"===selectorType&&mergeSel.attr("id",selector.substring(1,selector.length));var exitSel=element.exit();return callbacks.exit?exitSel.each(function(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];callbacks.exit.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}):exitSel.remove(),mergeSel},applyStyle=function applyStyle(elem,styleObj){return Object.entries(styleObj).forEach(function(d){elem.style(d[0],d[1])},void 0),elem},setElementAttrs=function setElementAttrs(element,attrs){for(var key in attrs)({}).hasOwnProperty.call(attrs,key)&&element.attr(key,attrs[key])},renderer_utils_setAttrs=function setAttrs(element,attrs,className){return element instanceof src_selection||(element=renderer_utils_selectElement(element)),void 0!==className?element.selectAll(".".concat(className)).each(function(){setElementAttrs(src_select(this),attrs)}):setElementAttrs(element,attrs),element},renderer_utils_setStyles=function setStyles(element,styles){for(var key in element instanceof src_selection||(element=renderer_utils_selectElement(element)),styles)({}).hasOwnProperty.call(styles,key)&&element.style(key,styles[key]);return element},renderer_utils_createElements=function createElements(params){var data,sel,container=src_select(params.container);"number"==typeof(data=params.data)&&(data=Array(data).fill().map(function(d,i){return i})),sel=container.selectAll(params.selector).data(data),(sel=container.selectAll(params.selector).filter(function(){return this.parentNode===container.node()}).data(params.data)).enter().append(params.append).merge(sel).each(function(d,i){params.each(d,src_select(this),i)}).attr("class",params.className||""),sel.exit().remove()},renderer_utils_getClientPoint=function getClientPoint(){var pos=src_point.apply(void 0,arguments);return{x:pos[0],y:pos[1]}},renderer_utils_getEvent=function getEvent(){return on_event},renderer_utils_getD3Drag=function getD3Drag(){return src_drag},renderer_utils_getSmartComputedStyle=function getSmartComputedStyle(group,css){var textEl,mandatoryStyle={"fill-opacity":0},className="string"==typeof css?css:css instanceof Array?css.join(" "):void 0;textEl=group.node()instanceof HTMLElement?group.append("div").html("W"):group.append("text").text("W"),className?textEl.attr("class",className):"object"===renderer_utils_typeof(css)&&(delete css["fill-opacity"],mergeRecursive(mandatoryStyle,css)),textEl.style(mandatoryStyle);var computedStyle=window.getComputedStyle(textEl.node()),styleForSmartLabel={fontSize:computedStyle.fontSize,fontFamily:computedStyle.fontFamily,fontWeight:computedStyle.fontWeight,fontStyle:computedStyle.fontStyle};return textEl.remove(),styleForSmartLabel},hasTouch=function hasTouch(){return"ontouchstart"in document.documentElement},hyperdis=__webpack_require__(5),hyperdis_default=__webpack_require__.n(hyperdis);function store_slicedToArray(arr,i){return function store_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function store_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function store_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function store_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:function(){return{}};return props.forEach(function(prop){obj[prop]||(obj[prop]=val()),obj=obj[prop]}),obj},fetchPropValues=function fetchPropValues(propNames,params,deps){return params.map(function(param,i){var prop=propNames[i];return param.map(function(val){return void 0===val||null===val?val:val[deps[prop]]})})},setContexts=function setContexts(contexts,propObj,contextMap){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=propObj.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;contexts[key]={context:contextMap[key],deps:propObj.get(key).depProps}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return contexts},store_registerListener=function registerListener(context,type){for(var _len=arguments.length,options=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)options[_key-2]=arguments[_key];var propList=options[0],callBack=options[1],instantCall=options[2],_options$=options[3],namespaceInf=void 0===_options$?{}:_options$,props=propList;Array.isArray(propList)||(props=[propList]);var ns=namespaceInf.namespace,callbackFn=function(propNames,namespaceVal){return function(){var commits=context._savedCommits,propListenerMap=context._propListenerMap;if(!propNames.some(function(prop){return getObjProp(propListenerMap,prop,"disabled")})){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(namespaceVal){var listenersObj=context._registeredListeners[namespaceVal],contextMap=context._contextMap[namespaceVal],contextsObj={};for(var key in propNames.forEach(function(prop){var commitsObj=defaultValue(getObjProp(commits,prop,type),{}),listeners=listenersObj[prop].subNamespaces,propDeps=propListenerMap[prop][type];for(var nm in commitsObj){var fnInf=defaultValue(propDeps[nm],{fns:0}),fns=fnInf.fns;fns>0&&(setContexts(contextsObj,listeners[nm],contextMap),fns--),fns<=0&&delete commitsObj[nm],fnInf.fns=fns}}),contextsObj){var obj=contextsObj[key];callBack.apply(void 0,[obj.context].concat(store_toConsumableArray(fetchPropValues(propNames,params,obj.deps))))}}else callBack.apply(void 0,params)}}}(props,ns),fn=context.model[type](props,callbackFn,instantCall);ns&&function registerPropInMaps(store,props,namespaceInf,type){var registeredListeners=store._registeredListeners,propListenerMap=store._propListenerMap,subNamespace=namespaceInf.subNamespace,ns=namespaceInf.namespace;initProp(registeredListeners,[ns]),props.forEach(function(prop){var subNamespaces=defaultValue(getObjProp(registeredListeners,ns,prop,"subNamespace"),[]),fns=defaultValue(getObjProp(propListenerMap,prop,type,"fns"),0);fns++,subNamespace&&subNamespaces.push(subNamespace),registeredListeners[ns][prop]={subNamespace:subNamespaces,allProps:props,subNamespaces:{}},initProp(propListenerMap,[prop,type]),propListenerMap[prop][type]={fns:fns,_fnCount:fns}})}(context,props,namespaceInf,type),function addListenerToNamespace(namespaceInf,fn,context){var key=namespaceInf.key,namespace=namespaceInf.id,listeners=context._listeners;if(namespace){!listeners.get(namespace)&&listeners.set(namespace,new Map);var namespaceListeners=listeners.get(namespace);key||(key=namespaceListeners.size),namespaceListeners.set(key,fn)}else key=key||listeners.size,listeners.set(key,fn)}(namespaceInf,fn,context)},store_createMap=function createMap(){return new Map},listenerTypes=["next","on"],removePropValue=function removePropValue(context,map,propInf){var sns=propInf.subNamespace,prop=propInf.prop,propObj=propInf.propListenerMap[prop];if(listenerTypes.forEach(function(type){type in propObj&&delete propObj[type][sns]}),map.has(sns)){var value=context.get(prop);value instanceof Object&&sns in value&&delete value[sns],map.delete(sns)}},store_Store=function(){function Store(config){!function store_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Store),this.model=hyperdis_default.a.create(config),this._listeners=new Map,this._registeredListeners={},this._contextMap={},this._commits={},this._savedCommits={},this._queuedProps={},this._propListenerMap={},this._locked=!1}return function store_createClass(Constructor,protoProps,staticProps){return protoProps&&store_defineProperties(Constructor.prototype,protoProps),staticProps&&store_defineProperties(Constructor,staticProps),Constructor}(Store,[{key:"lockModel",value:function lockModel(){return this.model.lock(),this._locked=!0,this}},{key:"unlockModel",value:function unlockModel(){return this._locked=!1,this.model.unlock(),this}},{key:"serialize",value:function serialize(){return this.model.serialize()}},{key:"lockCommits",value:function lockCommits(props){var _this=this;return props.forEach(function(prop){_this._commits[prop]={locked:!0,queue:[]}}),this}},{key:"unlockCommits",value:function unlockCommits(props){var _this2=this,commitsObj=this._commits;return this.lockModel(),props.forEach(function(prop){commitsObj[prop].locked=!1;var queuedProps={},queue=commitsObj[prop].queue;queue.forEach(function(params){var _params=store_slicedToArray(params,3),propName=_params[0],value=_params[1],namespace=_params[2];if(namespace){var propObj=initProp(queuedProps,[propName,namespace]);Object.assign(propObj,value)}}),queue.forEach(function(params){var _params2=store_slicedToArray(params,3),propName=_params2[0],value=_params2[1],namespace=_params2[2];_this2.commit(propName,propName in queuedProps?queuedProps[propName][namespace]:value,namespace)}),delete commitsObj[prop]}),this.unlockModel(),this}},{key:"addSubNamespace",value:function addSubNamespace(sns,namespace,context){var listeners=this._registeredListeners[namespace],propListenerMap=this._propListenerMap;initProp(this._contextMap,[namespace]),this._contextMap[namespace][sns]=context;var _loop=function _loop(key){var obj=listeners[key],propObj=propListenerMap[key],propFns=listenerTypes.reduce(function(acc,type){var val=defaultValue(getObjProp(propObj,type,"fns"),0);return val&&(acc[type]=val),acc},{}),allProps=obj.allProps,subNamespaces=obj.subNamespaces,subNamespace=obj.subNamespace;(subNamespace.length?subNamespace:[sns]).forEach(function(ns){var nsObj=ns instanceof Function?ns(context):ns,names=function retrieveNamespaces(names,key){return names instanceof Object?[names[key]]:names instanceof Array?names:[names]}(nsObj,key),depProps=allProps.reduce(function(acc,prop){return acc[prop]=ns instanceof Function?nsObj[prop]:ns,acc},{});names.forEach(function(nm){for(var type in initProp(subNamespaces,[nm],store_createMap).set(sns,{depProps:depProps}),propFns){initProp(propObj,[type,nm]);var fns=propFns[type];propObj[type][nm]={fns:fns,_fnCount:fns}}})})};for(var key in listeners)_loop(key);return this}},{key:"commit",value:function commit(propName,value,namespace){var disableListener=arguments.length>3&&void 0!==arguments[3]&&arguments[3],sanitizedVal=value,commits=this._commits,savedCommits=this._savedCommits,locked=getObjProp(commits,propName,"locked"),propListenerMap=this._propListenerMap[propName]||{};if(propListenerMap.disabled=disableListener,locked)return commits[propName].queue.push([propName,value,namespace]),this;if(namespace){if(this._locked){var queuedProps=initProp(this._queuedProps,[propName]);queuedProps[namespace]=value,sanitizedVal=queuedProps}else(sanitizedVal=defaultValue(this.get(propName),{}))[namespace]=value;listenerTypes.forEach(function(type){initProp(savedCommits,[propName,type]),savedCommits[propName][type][namespace]=!0,getObjProp(propListenerMap,type,namespace)&&(propListenerMap[type][namespace].fns=propListenerMap[type][namespace]._fnCount)})}return this.model.prop(propName,sanitizedVal),this}},{key:"registerChangeListener",value:function registerChangeListener(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];return store_registerListener.apply(void 0,[this,"next"].concat(params)),this}},{key:"registerImmediateListener",value:function registerImmediateListener(){for(var _len4=arguments.length,params=new Array(_len4),_key4=0;_key4<_len4;_key4++)params[_key4]=arguments[_key4];store_registerListener.apply(void 0,[this,"on"].concat(params))}},{key:"get",value:function get(propName,subNamespace){var value=this.model.prop(propName);return subNamespace?value&&value[subNamespace]:value}},{key:"computed",value:function computed(propName,callBack){return this.model.calculatedProp(propName,callBack)}},{key:"append",value:function append(){var _this$model;return(_this$model=this.model).append.apply(_this$model,arguments),this}},{key:"unsubscribeAll",value:function unsubscribeAll(){return Object.values(this._listeners).forEach(function(fn){return fn()}),this}},{key:"unsubscribe",value:function unsubscribe(){var namespaceInf=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},id=namespaceInf.id,key=namespaceInf.key,listenersMap=this._listeners,listeners=listenersMap.get(id);if(key){var fn=listenersMap.get(key);fn&&fn()}else{var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=listeners.values()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){(0,_step2.value)()}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}listenersMap.set(id,[])}return this}},{key:"removeSubNamespace",value:function removeSubNamespace(subNamespace,namespace){var listenerMap=this._registeredListeners,contextMap=this._contextMap,propListenerMap=this._propListenerMap,listenersObj=listenerMap[namespace];for(var prop in listenersObj){var subNamespaces=listenersObj[prop].subNamespaces,propInf={subNamespace:subNamespace,prop:prop,propListenerMap:propListenerMap};if(subNamespaces[subNamespace])removePropValue(this,subNamespaces[subNamespace],propInf),delete subNamespaces[subNamespace];else for(var ns in subNamespaces){var snsMap=subNamespaces[ns];removePropValue(this,snsMap,propInf),snsMap.size||delete subNamespaces[ns]}}return delete contextMap[namespace][subNamespace],this}}]),Store}(),store_transactor=function transactor(holder,options,model){var conf,namespaceInf=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},store=model instanceof store_Store?model:new store_Store({}),stateProps={},namespace=namespaceInf.namespace,subNamespace=namespaceInf.subNamespace;for(var prop in options)if({}.hasOwnProperty.call(options,prop)){conf=options[prop];var nameSpaceProp=namespace?"".concat(namespace,".").concat(prop):prop;if(subNamespace){var value=defaultValue(store.get(nameSpaceProp),{});value[subNamespace]=conf.value,stateProps[nameSpaceProp]=value}else stateProps[prop]=conf.value;holder[prop]=function(context,meta,nsProp){return function(){for(var _len5=arguments.length,params=new Array(_len5),_key5=0;_key5<_len5;_key5++)params[_key5]=arguments[_key5];if(params.length){var _ref$takesMultiplePar=(meta||{}).takesMultipleParams,takesMultipleParams=void 0!==_ref$takesMultiplePar&&_ref$takesMultiplePar,val=takesMultipleParams?params:params[0];if(meta){var values,prevVal=context.get(nsProp,subNamespace),sanitization=meta.sanitization,typeCheck=meta.typeCheck,typeExpected=meta.typeExpected;if("function"==typeof sanitization&&(val=sanitization(val,prevVal,holder)),"function"==typeof typeCheck)typeCheck(val)&&(values=val);else"string"==typeof typeCheck&&"constructor"===typeCheck?val&&val.constructor.name===typeExpected&&(values=val):values=val;var preset=meta.preset,oldValues=toArray(context.get(nsProp,subNamespace));preset&&preset(values,holder),takesMultipleParams&&oldValues.forEach(function(value,i){void 0===values[i]&&(values[i]=value)}),values&&context.commit(nsProp,values,subNamespace)}else context.commit(nsProp,val,subNamespace);return holder}return context.get(nsProp,subNamespace)}}(store,conf.meta,nameSpaceProp,Array.isArray(conf.value))}if(subNamespace)for(var key in stateProps)store.commit(key,stateProps[key][subNamespace],subNamespace);else void 0===namespace?store.append(stateProps):store.append(namespace,stateProps);return[holder,store]},SmartlabelManager=__webpack_require__(3),SmartlabelManager_default=__webpack_require__.n(SmartlabelManager),events=["initialized","beforeupdate","updated","beforedraw","drawn","beforeremove","removed","animationend"],EVENT_LIST=[];["canvas","unit","layer","axis","facet-headers","legend","caption"].forEach(function(composition){events.forEach(function(event){EVENT_LIST.push("".concat(composition,".").concat(event))})});var event_list=EVENT_LIST;function lifecycle_manager_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this._lifeCycles=lifeCycles,this._releasePromisesFromCache()}},{key:"_resetTargetPromise",value:function _resetTargetPromise(eventName){var _this4=this;setTimeout(function(){_this4._notifiers[eventName]=lifecycle_manager_resolver,_this4._promises.set(eventName,_this4._makeNotifierPromise(eventName))},0)}}]),LifeCycleManager}(),src_InvalidAwareTypes=datamodel_default.a.InvalidAwareTypes,DRAG="drag",HOVER="hover",SELECTIONDRAG="selectiondrag",CLICK="click",LONGTOUCH="longtouch",TOUCHDRAG="touchdrag",ALL_ACTIONS="*",SELECTION_NEW_ENTRY=1,SELECTION_NEW_EXIT=-1,SELECTION_NULL=0,SELECTION_OLD_ENTRY=2,SELECTION_OLD_EXIT=-2;function selection_set_defineProperties(target,props){for(var i=0;i0?(set[key]===SELECTION_OLD_ENTRY&&retObj.entrySet[0].push(key),set[key]===SELECTION_NEW_ENTRY&&retObj.entrySet[1].push(key)):set[key]<0&&(set[key]===SELECTION_OLD_EXIT&&retObj.exitSet[0].push(key),set[key]===SELECTION_NEW_EXIT&&retObj.exitSet[1].push(key)),retObj.completeSet.push(key);return["entrySet","exitSet"].forEach(function(type){retObj[type]=retObj[type].map(function(e){return e.map(Number)})}),retObj.completeSet=retObj.completeSet.map(Number),retObj}},{key:"reset",value:function reset(ids){var set=this._set;if(ids)ids.forEach(function(i){set[i]=SELECTION_NULL});else{var lockedSel=this._lockedSelection;for(var key in set)key in lockedSel||(set[key]=SELECTION_NULL)}return this._resetted=!0,this}},{key:"getEntrySet",value:function getEntrySet(){var set=this._set,addSet=[];for(var key in set)set[key]===SELECTION_NEW_ENTRY&&addSet.push(key);return addSet}},{key:"getExistingEntrySet",value:function getExistingEntrySet(addSet){var set=this._set;return addSet.filter(function(d){return set[d]===SELECTION_NEW_ENTRY||set[d]===SELECTION_OLD_ENTRY})}},{key:"getExistingExitSet",value:function getExistingExitSet(removeSet){var set=this._set;return removeSet.filter(function(d){return set[d]===SELECTION_NEW_EXIT||set[d]===SELECTION_OLD_EXIT})}},{key:"getOldEntry",value:function getOldEntry(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_ENTRY&&updateSet.push(key);return updateSet}},{key:"getOldExit",value:function getOldExit(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_EXIT&&updateSet.push(key);return updateSet}},{key:"getExitSet",value:function getExitSet(){var set=this._set,removeSet=[];for(var key in set)set[key]===SELECTION_NEW_EXIT&&removeSet.push(key);return removeSet}},{key:"getCompleteSet",value:function getCompleteSet(){var set=this._set,completeSet=[];for(var key in set)completeSet.push(key);return completeSet}},{key:"getCompleteSetCount",value:function getCompleteSetCount(){return this._completeSetCount}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"toggle",value:function toggle(){var set=this._set;for(var key in set)set[key]===SELECTION_NEW_ENTRY?set[key]=SELECTION_NEW_EXIT:set[key]===SELECTION_NEW_EXIT?set[key]=SELECTION_NEW_ENTRY:set[key]===SELECTION_OLD_ENTRY?set[key]=SELECTION_OLD_EXIT:set[key]=SELECTION_OLD_ENTRY;return this}}]),SelectionSet}();function helper_toConsumableArray(arr){return function helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i3&&void 0!==arguments[3]?arguments[3]:{},sideEffectStore=this.sideEffects(),sideEffect=sideEffectStore[name],disable=!1;options.filter&&options.filter(sideEffect)&&(disable=!0),!disable&&sideEffectStore[name].apply(selectionSet,payload,options)}},{key:"registerPropagationBehaviourMap",value:function registerPropagationBehaviourMap(map){return this._propagationBehaviourMap=Object.assign(this._propagationBehaviourMap,map||{}),this}},{key:"dispatchBehaviour",value:function dispatchBehaviour(behaviour,payload){var propagationInfo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},propagate=void 0===propagationInfo.propagate||propagationInfo.propagate,action=this._actions.behavioural[behaviour],sideEffects=function getSideEffects(behaviour,behaviourEffectMap){var sideEffects=[];for(var key in behaviourEffectMap){var behaviours=key.split(",");behaviours.some(function(d){return d===behaviour})&&sideEffects.push({effects:behaviourEffectMap[key],behaviours:behaviours})}return sideEffects}(behaviour,this._behaviourEffectMap);if(this._propagationInf=propagationInfo,action){var selectionSet=action.dispatch(payload),propagationSelectionSet=this.getPropagationSelectionSet(selectionSet);this._entryExitSet[behaviour]=propagationSelectionSet;var shouldApplySideEffects=this.shouldApplySideEffects(propagate);if(propagate&&this.propagate(behaviour,payload,selectionSet.find(function(d){return d.sourceSelectionSet}),sideEffects),shouldApplySideEffects){var applicableSideEffects=this.getApplicableSideEffects(sideEffects,payload,propagationInfo);this.applySideEffects(applicableSideEffects,propagationSelectionSet,payload)}}return this}},{key:"getPropagationSelectionSet",value:function getPropagationSelectionSet(selectionSet){return selectionSet.find(function(d){return!d.sourceSelectionSet})}},{key:"shouldApplySideEffects",value:function shouldApplySideEffects(){return!0}},{key:"changeBehaviourStateOnPropagation",value:function changeBehaviourStateOnPropagation(behaviour,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",behaviourConditions=this._sourceBehaviours[behaviour]||(this._sourceBehaviours[behaviour]={});return value instanceof Function?behaviourConditions[key]=value:behaviourConditions[key]=function(){return value},this}},{key:"changeSideEffectStateOnPropagation",value:function changeSideEffectStateOnPropagation(sideEffect,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",sideEffectConditions=this._sourceSideEffects[sideEffect]||(this._sourceSideEffects[sideEffect]={});value instanceof Function?sideEffectConditions[key]=value:sideEffectConditions[key]=function(){return value}}},{key:"removeSideEffectPolicy",value:function removeSideEffectPolicy(sideEffect,key){return delete this._sourceSideEffects[sideEffect][key],this}},{key:"removeBehaviourPolicy",value:function removeBehaviourPolicy(behaviour,key){return delete this._sourceBehaviours[behaviour][key],this}},{key:"propagate",value:function propagate(){return this}},{key:"sideEffects",value:function sideEffects(){return arguments.length?(this._sideEffects=arguments.length<=0?void 0:arguments[0],this):this._sideEffects}},{key:"enableSideEffects",value:function enableSideEffects(fn){return changeSideEffectAvailability(this,fn,!0),this}},{key:"disableSideEffects",value:function disableSideEffects(fn){return changeSideEffectAvailability(this,fn,!1),this}},{key:"dissociateBehaviour",value:function dissociateBehaviour(behaviour,physicalAction){var actionBehaviourMap=this._actionBehaviourMap;for(var key in actionBehaviourMap)if(key===physicalAction){var behaviourMap=actionBehaviourMap[key];behaviourMap.behaviours=behaviourMap.behaviours.filter(function(d){return d!==behaviour}),this.mapActionsAndBehaviour(key)}return this}},{key:"dissociateSideEffect",value:function dissociateSideEffect(sideEffect,behaviour){var behaviourEffectMap=this._behaviourEffectMap;return behaviourEffectMap[behaviour]=behaviourEffectMap[behaviour].filter(function(d){return(d.name||d)!==sideEffect}),this}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects){return sideEffects}},{key:"attachPropagationListener",value:function attachPropagationListener(dataModel){return dataModel.unsubscribe("propagation"),dataModel.on("propagation",this.onDataModelPropagation()),this}},{key:"onDataModelPropagation",value:function onDataModelPropagation(){var _this2=this;return function(propValue){var payload=propValue.payload,action=payload.action;_this2.dispatchBehaviour(action,payload,{propagate:!1})}}},{key:"createSelectionSet",value:function createSelectionSet(uniqueIds,behaviouralActions){var behaviours=behaviouralActions||this._actions.behavioural,selectionSet=this._selectionSet,volatileSelectionSet=this._volatileSelectionSet;for(var key in behaviours)({}).hasOwnProperty.call(behaviours,key)&&(selectionSet[key]=new src_selection_set(uniqueIds),volatileSelectionSet[key]=new src_selection_set(uniqueIds,!0),this._entryExitSet[key]=null);return this._volatileSelectionSet=volatileSelectionSet,this.selectionSet(selectionSet),this}},{key:"selectionSet",value:function selectionSet(){return arguments.length?(this._selectionSet=arguments.length<=0?void 0:arguments[0],this):this._selectionSet}},{key:"initializeSideEffects",value:function initializeSideEffects(){var sideEffectDefinitions=this._sideEffectDefinitions;return this.sideEffects(function initializeSideEffects(context,sideEffects){var sideEffectsMap=context._sideEffects;return(sideEffects=sideEffects instanceof Array?sideEffects:Object.values(sideEffects)).forEach(function(SideEffect){var formalName=SideEffect.formalName(),sideEffectInstance=sideEffectsMap[formalName];sideEffectsMap[formalName]=sideEffectInstance||new SideEffect(context)}),sideEffectsMap}(this,sideEffectDefinitions)),this}},{key:"registerPhysicalActions",value:function registerPhysicalActions(actions){var initedActions=function initializePhysicalActions(context,actions){var physicalActions={};for(var name in actions)({}).hasOwnProperty.call(name,actions)||(physicalActions[name]=actions[name](context));return physicalActions}(this,actions);return Object.assign(this._actions.physical,initedActions),this}},{key:"propagateWith",value:function propagateWith(action,fields){var append=arguments.length>2&&void 0!==arguments[2]&&arguments[2],behaviouralActions=this._actions.behavioural;if(action===ALL_ACTIONS)for(var key in behaviouralActions)this._propagationFields[key]={fields:fields,append:append};else this._propagationFields[action]={fields:fields,append:append};return this}},{key:"mapActionsAndBehaviour",value:function mapActionsAndBehaviour(phyAction){var initedPhysicalActions=this._actions.physical,map=this._actionBehaviourMap;for(var action in map)if(!{}.hasOwnProperty.call(action,map)&&action===(phyAction||action)){var target=void 0,mapObj=map[action];target=mapObj.target;var touch=mapObj.touch;target||(target=this.context.getDefaultTargetContainer()),(hasTouch()?!0===touch||void 0===touch:!touch)&&this.bindActionWithBehaviour(initedPhysicalActions[action],target,mapObj.behaviours)}return this}},{key:"registerPhysicalBehaviouralMap",value:function registerPhysicalBehaviouralMap(map){return this._actionBehaviourMap=mergeRecursive(this._actionBehaviourMap,map),this}},{key:"bindActionWithBehaviour",value:function bindActionWithBehaviour(action,targets,behaviourList){var _this3=this;return"string"==typeof targets&&(targets=[targets]),targets.forEach(function(target){var mount=_this3.context.mount(),nodes=target.node instanceof Function?target:renderer_utils_selectElement(mount).selectAll(target);nodes.empty()||(nodes instanceof Array?nodes.forEach(function(node){action(renderer_utils_selectElement(node),behaviourList)}):action(nodes,behaviourList))}),this}},{key:"getPropagationInf",value:function getPropagationInf(){return this._propagationInf}},{key:"getAddSetFromCriteria",value:function getAddSetFromCriteria(criteria){var propagationInf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=this.context,filteredDataModel=propagationInf.data?propagationInf.data:context.getDataModelFromIdentifiers(criteria,"all");return{model:filteredDataModel,uids:null===criteria?null:propagationInf.data?propagationInf.entryRowIds:filteredDataModel[0].getUids()}}},{key:"getSelectionSets",value:function getSelectionSets(action){var sourceId=this.context.id(),propagationSource=(this._propagationInf||{}).sourceId,applicableSelectionSets=[];return propagationSource!==sourceId&&(applicableSelectionSets=[this._volatileSelectionSet[action]]),propagationSource&&applicableSelectionSets.push(this.selectionSet()[action]),applicableSelectionSets}},{key:"getFullData",value:function getFullData(){return this.context.data()}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"getEntryExitSet",value:function getEntryExitSet(behaviour){return this._entryExitSet[behaviour]}}]),Firebolt}();function generic_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},sourceIdentifiers=propagationInf.sourceIdentifiers;return sourceIdentifiers?sourceIdentifiers.getSchema().map(function(d){return d.name}):criteria instanceof Array?criteria[0]:Object.keys(criteria||{})}(propagationInf,payload.criteria),sourceSelectionSet:!0===selectionSet._volatile}}},{key:"enable",value:function enable(){this._enabled=!0}},{key:"disable",value:function disable(){this._enabled=!1}},{key:"isEnabled",value:function isEnabled(){return this._enabled}}],[{key:"mutates",value:function mutates(){return!1}}]),GenericBehaviour}();function volatile_typeof(obj){return(volatile_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function volatile_defineProperties(target,props){for(var i=0;iydom[0]?ydom:xdom,max=min===ydom?xdom:ydom;min[1]100&&Math.abs(startPos.x-endPos.x)<=5)){endPos.x=Math.max(0,Math.min(endPos.x,drawingInf.width)),endPos.y=Math.max(0,Math.min(endPos.y,drawingInf.height));var payload=drag_action_config(firebolt.context.getSourceInfo(),{startPos:startPos,endPos:endPos,snap:!0},firebolt.context.data().getFieldsConfig());payload.dragEnd=!0,behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)})}}))},physical_hover=function hover(firebolt){return function(targetEl,behaviours){var dispatchBehaviour=function dispatchBehaviour(args){var event=renderer_utils_getEvent(),context=firebolt.context,mode=context.config().interaction.tooltip.mode,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{getAllPoints:"consolidated"===mode||"fragmented"===mode,data:args,event:event}),payload={criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos,mode:mode};behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()};targetEl.on("mouseover",dispatchBehaviour).on("mousemove",dispatchBehaviour).on("mouseout",function(){behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,{criteria:null})})})}},helpers_generatePayloadFromEvent=function generatePayloadFromEvent(args,event,firebolt){var context=firebolt.context,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event.touches?event.touches[0]:event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{data:args,event:event});return{criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos}},physical_click=function click(firebolt){return function(targetEl,behaviours){targetEl.on("click",function dispatchBehaviour(args){var event=renderer_utils_getEvent(),payload=helpers_generatePayloadFromEvent(args,event,firebolt);behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()})}};function physical_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var physicalActions=(physical_defineProperty(_physicalActions={},DRAG,function drag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt)}}),physical_defineProperty(_physicalActions,HOVER,physical_hover),physical_defineProperty(_physicalActions,CLICK,physical_click),physical_defineProperty(_physicalActions,LONGTOUCH,function longtouch(firebolt){return function(targetEl,behaviours){var event,touchEnd;touchEnd=!1,event=renderer_utils_getEvent(),targetEl.on("touchstart",function(args){event=renderer_utils_getEvent(),touchEnd=!1,setTimeout(function(){touchEnd?behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,{criteria:null})}):function dispatchBehaviour(args){var payload=helpers_generatePayloadFromEvent(args,event,firebolt);behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()}(args)},100)}).on("touchend",function(){touchEnd=!0})}}),physical_defineProperty(_physicalActions,TOUCHDRAG,function touchdrag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt,!0)}}),_physicalActions),side_effects_ANCHORS="anchors",side_effects_TOOLTIP="tooltip",side_effects_BRUSH_ANCHORS="brush-anchors",side_effects_PERSISTENT_ANCHORS="persistent-anchors",side_effects_FILTER="filter",side_effects_HIGHLIGHTER="highlighter",CROSSLINE="crossline",PROPS={valueParser:{defaultValue:function defaultValue(val){return val}}};function generic_sideeffect_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];var interactionType=arguments.length>2?arguments[2]:void 0,apply=arguments.length>3?arguments[3]:void 0;return this.firebolt.context.layers().forEach(function(layer){return!1!==layer.config().interactive&&layer.applyInteractionStyle(interactionType,set.uids,apply)}),this}}]),SurrogateSideEffect}();function spawnable_typeof(obj){return(spawnable_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function spawnable_defineProperties(target,props){for(var i=0;i=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(context.getSourceInfo(),{startPos:{x:x,y:y},endPos:{x:x2,y:y2}},context.data().getFieldsConfig());onDrag(payload)}}).on("end",function(){var width=drawingInf.width,height=drawingInf.height,x=Math.min(width-subject.width,Math.max(subject.x,0)),y=Math.min(height-subject.height,Math.max(subject.y,0)),y2=y+subject.height,x2=x+subject.width;if(x>=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(context.getSourceInfo(),{startPos:{x:x,y:y},endPos:{x:x2,y:y2},snap:!0},context.data().getFieldsConfig());payload.dragEnd=!0,onDrag(payload)}}))}}(firebolt)(renderer_utils_selectElement(this),["brush"],sideEffect)}).merge(selection).each(function(attrs){var element=renderer_utils_selectElement(this);for(var key in transition&&(element=element.transition().duration(transition.duration)),attrs)({}).hasOwnProperty.call(attrs,key)&&isValidValue(attrs[key])&&element.attr(key,attrs[key])}),boxClassName=getQualifiedClassName(boxConf.defClassName,this._id,classPrefix);return selectionBox.classed(boxClassName.join(" "),!0),selectionBox.classed(boxConf.className,!0),this}},{key:"hide",value:function hide(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!1)}},{key:"show",value:function show(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!0)}}],[{key:"defaultConfig",value:function defaultConfig(){return{defClassName:"selection-box-group",className:"",classPrefix:"muze",box:{defClassName:"selection-box",className:""},transition:{duration:200}}}},{key:"formalName",value:function formalName(){return"selectionBox"}}]),SelectionBox}(),INITIAL_STYLE={position:"absolute",width:0,height:0},default_config_defaultConfig={classPrefix:"muze",defClassName:"tooltip-box",connectorClassName:"tooltip-connectors",className:"",row:{margin:0},content:{spacing:5,iconContainerSize:10,iconScale:1,iconShape:"circle",iconColor:"#ff0000",rowMargin:"4px 0 4px 0",margin:10,separator:":",className:"tooltip-content-container",parentClassName:"tooltip-content-parent-container"},arrow:{size:10,disabled:!1,defClassName:"tooltip-arrow",className:"",color:"rgba(195,195,195,0.85)"}},helper_getArrowPos=function getArrowPos(orient,dim,measurement,config){var arrowPos,x=measurement.x,y=measurement.y,boxHeight=measurement.boxHeight,boxWidth=measurement.boxWidth,arrowWidth=config.arrow.disabled?0:config.arrow.size;if("left"===orient||"right"===orient){var start=0,diff=boxHeight/2,plotBottom=dim.y+dim.height,boxBottom=y+boxHeight;dim.y>y?(start=dim.y-y,diff=(plotBottom>=boxBottom?boxBottom-dim.y:dim.height)/2):boxBottom>plotBottom&&(diff=Math.abs(y-(dim.y+dim.height))/2),arrowPos=start+diff-arrowWidth/2}else{var _start=0,_diff=boxWidth/2,plotRight=dim.x+dim.width,boxRight=x+boxWidth;dim.x>x?(_start=dim.x-x,_diff=(plotRight>=boxRight?boxRight-dim.x:dim.width)/2):boxRight>plotRight&&(_diff=Math.abs(x-(dim.x+dim.width))/2),arrowPos=_start+_diff-arrowWidth/2}return arrowPos},helper_placeArrow=function placeArrow(context,position,arrowPos){var tooltipArrow=context._tooltipArrow,tooltipBackground=context._tooltipBackground,config=context._config,classPrefix=config.classPrefix,arrowConf=config.arrow,className=getQualifiedClassName(arrowConf.defClassName,context._id,config.classPrefix);tooltipArrow.style("display","block"),tooltipArrow.attr("class","".concat(className.join(" "))),"left"===position||"right"===position?(tooltipArrow.style("top","".concat(arrowPos,"px")),tooltipArrow.style("left",""),tooltipBackground.style("top","".concat(arrowPos,"px")),tooltipBackground.style("left","")):("bottom"===position?tooltipArrow.style("top","100%"):tooltipArrow.style("top","-".concat(arrowConf.size,"px")),tooltipArrow.style("left","".concat(arrowPos,"px")),"bottom"===position?tooltipBackground.style("top","100%"):tooltipBackground.style("top","-".concat(arrowConf.size+3,"px")),tooltipBackground.style("left","".concat(arrowPos,"px"))),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow"),!0),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow-").concat(context._arrowOrientation),!1),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow-").concat(position),!0),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow"),!0),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow-").concat(context._arrowOrientation),!1),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow-").concat(position),!0)};__webpack_require__(10);function content_defineProperties(target,props){for(var i=0;i0?(this._config=mergeRecursive(this._config,arguments.length<=0?void 0:arguments[0]),this):this._config}},{key:"update",value:function update(item){return this._model=item.model,this._formatter=item.formatter,this}},{key:"context",value:function context(ctx){return this._context=ctx,this}},{key:"render",value:function render(mount){var data,config=this._config,iconContainerSize=config.iconContainerSize,formatter=this._formatter,rowMargin=config.rowMargin,model=this._model,classPrefix=config.classPrefix;if(this._mount=mount,(data=model instanceof Array?model:formatter(this._model,this.config(),this._context))instanceof Function){makeElement(mount,"div",[1],"".concat(classPrefix,"-tooltip-html-container")).html(data())}else{var content=data,displayFormat="default";isSimpleObject(data)&&(content=data.content,displayFormat=data.displayFormat);var body=makeElement(mount,"div",[displayFormat],"".concat(classPrefix,"-tooltip-content"),{},function(d){return d});if("table"===displayFormat){var table=makeElement(body,"table",[1],"".concat(classPrefix,"-tooltip-table")),tbody=makeElement(table,"tbody",[1],"".concat(classPrefix,"-tooltip-table-tbody")),rows=makeElement(tbody,"tr",content,"".concat(classPrefix,"-tooltip-table-row"));rows.each(function(d,i){renderer_utils_selectElement(this).classed("".concat(classPrefix,"-tooltip-table-row-").concat(i),!0)}),makeElement(rows,"td",function(d){return d},"".concat(classPrefix,"-tooltip-table-cell")).each(function(d){renderer_utils_selectElement(this).html(d)})}else{var _rows=makeElement(body,"div",content,"",{update:function update(elem,elemData){return elem.attr("class",elemData.className)}}),_cells=makeElement(_rows,"span",function(d){return d.data},"".concat(classPrefix,"-tooltip-content"));_cells.attr("class","".concat(classPrefix,"-tooltip-content")),renderer_utils_setStyles(_rows,{margin:rowMargin}),renderer_utils_setStyles(_cells,{display:"inline-block"}),_cells.each(function(d){var el=renderer_utils_selectElement(this);if(el.html(""),d instanceof Object)if("icon"===d.type){var svg=makeElement(el,"svg",[1]),path=makeElement(svg,"path",[1]),shape=d.shape instanceof Function?d.shape:common_utils_getSymbol(d.shape);renderer_utils_setAttrs(svg,{x:0,y:0,width:iconContainerSize,height:iconContainerSize}),renderer_utils_setAttrs(path,{d:shape.size(d.size)(),transform:"translate(".concat(iconContainerSize/2,", ").concat(iconContainerSize/2,")")}),renderer_utils_setStyles(path,{fill:d.color}),renderer_utils_setStyles(svg,{width:"".concat(iconContainerSize,"px"),height:"".concat(iconContainerSize,"px")})}else el.html(d.value),d.className&&el.classed(d.className,!0),renderer_utils_setStyles(el,d.style);else el.html(d)})}}return this}},{key:"clear",value:function clear(){return this._model=null,this}}],[{key:"defaultConfig",value:function defaultConfig(){var config=default_config_defaultConfig.content;return config.classPrefix=default_config_defaultConfig.classPrefix,config}}]),Content}();function tooltip_defineProperties(target,props){for(var i=0;i0){var defConf=mergeRecursive({},this.constructor.defaultConfig());return this._config=mergeRecursive(defConf,arguments.length<=0?void 0:arguments[0]),this}return this._config}},{key:"addClass",value:function addClass(className){return this._tooltipContainer.classed(className,!0),this}},{key:"context",value:function context(){return arguments.length?(this._context=arguments.length<=0?void 0:arguments[0],this):this._context}},{key:"content",value:function content(name,data){var contentConfig=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},config=this.config(),classPrefix=config.classPrefix,contentClass=config.content.className,formatter=config.formatter,className=contentConfig.className||"".concat(classPrefix,"-").concat(contentClass,"-").concat(name),content=this._contents[name]=this._contents[name]||new content_Content,container=makeElement(this._contentContainer,"div",[contentConfig.order],className);container.attr("class","".concat(classPrefix,"-").concat(contentClass," ").concat(className)),function reorderContainers(parentContainer,className){parentContainer.selectAll(className).sort(function(a,b){return a-b})}(this._contentContainer,".".concat(classPrefix,"-").concat(contentClass));var contentConf=config.content;return contentConfig.classPrefix=this._config.classPrefix,content.config(contentConf),null===data?(content.clear(),container.remove(),delete this._contents[name]):(content.update({model:data,formatter:contentConfig.formatter||formatter}),content.context(this._context),content.render(container)),Object.keys(this._contents).length||this.hide(),this}},{key:"getContents",value:function getContents(){return Object.values(this._contents)}},{key:"position",value:function position(x,y){var conf=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Object.keys(this._contents).length)return this.hide(),this;this.show();var target=this._target,repositionArrow=conf.repositionArrow;if(target&&repositionArrow){var node=this._tooltipContainer.node(),config=this._config,arrowDisabled=config.arrow.disabled,arrowWidth=arrowDisabled?0:config.arrow.size,arrowOrient=this._arrowOrientation,outsidePlot="left"===arrowOrient||"right"===arrowOrient?y+node.offsetHeight-arrowWidthtarget.y+target.height:x+node.offsetWidth-arrowWidthtarget.x+target.width;if(!arrowDisabled)if(outsidePlot){var path;this._tooltipArrow.style("display","none"),this._tooltipBackground.style("display","none"),this._tooltipConnectorContainer.style("display","block");var connector=this._tooltipConnectorContainer.selectAll("path").data([1]),enter=connector.enter().append("path");"left"===arrowOrient?path="M ".concat(x," ").concat(y+node.offsetHeight/2," L ").concat(target.x+target.width)+" ".concat(target.y+target.height/2):"right"===arrowOrient?path="M ".concat(x+node.offsetWidth," ").concat(y+node.offsetHeight/2)+" L ".concat(target.x," ").concat(target.y+target.height/2):"bottom"===arrowOrient&&(path="M ".concat(x+node.offsetWidth/2," ").concat(y+node.offsetHeight)+" L ".concat(target.x+target.width/2," ").concat(target.y)),enter.merge(connector).attr("d",path).style("display","block")}else{var arrowPos=helper_getArrowPos(arrowOrient,target,{x:x,y:y,boxHeight:node.offsetHeight,boxWidth:node.offsetWidth},this._config);helper_placeArrow(this,this._arrowOrientation,arrowPos),this._tooltipConnectorContainer.style("display","none")}}var offset=this._offset||{x:0,y:0};return this._tooltipContainer.style("left","".concat(offset.x+x,"px")).style("top","".concat(offset.y+y,"px")),this}},{key:"positionRelativeTo",value:function positionRelativeTo(dim){var obj,_this=this,tooltipConf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},orientation=tooltipConf.orientation;if(this.show(),!dim)return this.hide(),this;var extent=this._extent,node=this._tooltipContainer.node();this._tooltipContainer.style("top","0px").style("left","0px");var offsetWidth=node.offsetWidth+2,offsetHeight=node.offsetHeight+2,config=this._config,offset=this._offset,arrowDisabled=config.arrow.disabled,arrowSize=arrowDisabled?0:config.arrow.size,draw=void 0===tooltipConf.draw||tooltipConf.draw,topSpace=dim.y,dimX=dim.x+dim.width+offset.x,rightSpace=extent.width-dimX,leftSpace=dim.x+offset.x-extent.x,positionTop=topSpace>offsetHeight+arrowSize,positionRight=rightSpace>=offsetWidth+arrowSize,positionLeft=leftSpace>=offsetWidth+arrowSize;return this._target=dim,orientation||(orientation=positionTop?"vertical":positionRight||positionLeft?"horizontal":"vertical"),"horizontal"===orientation?obj=function positionHorizontal(){var position,x=dim.x+dim.width,y=dim.y;return positionRight?(position="left",x+=arrowSize):positionLeft?(x=dim.x-offsetWidth,position="right",x-=arrowSize):(position="left",x+=arrowSize),dim.height1;hasMultipleMeasures&&content.push({data:[icon,formattedRetinalValue]});var isSelected=target[1][target[0].indexOf(retField)]===retinalFieldValue;measuresArr.forEach(function(measure){var measureIndex=fieldsConfig[measure].index,_fieldInf$measure=fieldInf[measure],dName=_fieldInf$measure.displayName,value=(0,_fieldInf$measure.fn)(valueArr[measureIndex]),keyValue=getKeyValue({field:hasMultipleMeasures?"".concat(dName).concat(separator):formattedRetinalValue,value:value,classPrefix:classPrefix,margin:hasMultipleMeasures?margin:void 0,isSelected:isSelected});hasMultipleMeasures||(keyValue.data=[icon].concat(strategies_toConsumableArray(keyValue.data))),content.push(keyValue)})}};for(var retField in retinalFields)_loop(retField)},strategies_buildTooltipData=function buildTooltipData(dataModel){var nestedDataObj,displayFormat,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=arguments.length>2?arguments[2]:void 0,fieldValues=[],_dataModel$getData=dataModel.getData(),data=_dataModel$getData.data,schema=_dataModel$getData.schema,fieldspace=dataModel.getFieldspace(),fieldsConfig=dataModel.getFieldsConfig(),_context$firebolt$con=context.firebolt.context.retinalFields(),color=_context$firebolt$con.color,shape=_context$firebolt$con.shape,size=_context$firebolt$con.size,detailFields=context.detailFields||[],dimensions=schema.filter(function(d){return d.type===dist_datamodel.FieldType.DIMENSION}),measures=schema.filter(function(d){return d.type===dist_datamodel.FieldType.MEASURE}),containsDetailField=!!common_utils_intersect(schema,detailFields).length,dataLen=data.length,dimensionMeasureMap=context.dimensionMeasureMap,axes=context.axes,fieldInf=function getFieldInf(schema,dataModel,context){var valueParser=context.valueParser,timeDiffs=context.timeDiffs,fieldsObj=dataModel.getFieldspace().fieldsObj(),defFormatter=strategies_formatters(null,null,valueParser)[dist_datamodel.DimensionSubtype.CATEGORICAL];return schema.reduce(function(inf,field){var subtype=field.subtype,name=field.name,type=field.type,interval=subtype===dist_datamodel.DimensionSubtype.TEMPORAL?timeDiffs[name]:0,nf=type===dist_datamodel.FieldType.MEASURE?fieldsObj[name].numberFormat():function(val){return val};return inf[name]={fn:defaultValue(strategies_formatters(nf,interval,valueParser)[subtype],defFormatter),displayName:"".concat(retrieveFieldDisplayName(dataModel,name))},inf},{})}(schema,dataModel,context);if(dataLen>1&&containsDetailField)fieldValues=function getTabularData(dataObj,fieldInf){var rows=[],data=dataObj.data,schema=dataObj.schema;return rows.push(schema.map(function(d){return fieldInf[d.name].displayName})),data.forEach(function(d){var row=[];schema.forEach(function(fieldObj,i){var value=fieldInf[fieldObj.name].fn(d[i]);row.push(value)}),rows.push(row)}),rows}({data:data,schema:schema,fieldspace:fieldspace},fieldInf),displayFormat="table";else{var retinalFields=[color.field,shape.field,size.field].reduce(function(acc,field){return field&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION&&(acc[field]=1),acc},{}),indices=dimensions.filter(function(field){return!retinalFields[field.name]}).map(function(dim){return fieldsConfig[dim.name].index}),allMeasures=strategies_toConsumableArray(_construct(Set,strategies_toConsumableArray(Object.values(dimensionMeasureMap)))),filteredMeasures=dataLen>1?measures.filter(function(d){return-1===allMeasures.indexOf(d.name)}):measures;!function generateTooltipContent(nestedData){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,content=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],classPrefix=config.classPrefix,separator=config.separator,i=0,len=nestedData.length;i1;content.push(getKeyValue({field:"".concat(displayName).concat(separator),value:formattedValue,classPrefix:classPrefix,margin:margin,isSelected:void 0,removeKey:removeKey}))}if(values[0]&&values[0].key)generateTooltipContent(values,index+1,content);else for(var _loop2=function _loop2(j,len2){var valueArr=values[j];generateRetinalFieldsValues(valueArr,retinalFields,content,{fieldInf:fieldInf,axes:axes,config:config,fieldsConfig:fieldsConfig,dimensionMeasureMap:dimensionMeasureMap,dataLen:dataLen,target:context.payload.target}),filteredMeasures.forEach(function(measure){var name=measure.name,_fieldInf$name=fieldInf[name],displayName=_fieldInf$name.displayName,fn=_fieldInf$name.fn;content.push(getKeyValue({field:"".concat(displayName).concat(separator),value:fn(valueArr[fieldsConfig[name].index]),classPrefix:classPrefix,margin:10}))})},j=0,len2=values.length;j2&&void 0!==arguments[2]?arguments[2]:{},totalHeight=0,totalWidth=0,dataModel=selectionSet.mergedEnter.model,context=this.firebolt.context,drawingInf=this.drawingContext();if(dataModel.isEmpty()||null===payload.criteria)return this.hide(options,null),this;var tooltips=this._tooltips,config=this.config(),boundBox={width:drawingInf.width,height:drawingInf.height},showInPosition=payload.showInPosition,pad=config.padding,dataModels=[],fragmented="fragmented"===config.mode,sourceInf=context.getSourceInfo(),fields=sourceInf.fields,showVertically=!!(!!fields.x[0]&&fields.x[0].type()===dist_datamodel.FieldType.DIMENSION),tooltipPos=payload.position,boxes=[],enter={},uids=dataModel.getData().uids;fragmented?dataModels.push.apply(dataModels,tooltip_toConsumableArray(uids.map(function(d){return dataModel.select(function(fieldsArr,i){return i===d},{saveChild:!1})}))):dataModels.push(dataModel);var target=payload.target,targetFields=[];if(target){targetFields=target[0]||[];for(var sourceFields=payload.sourceFields,indices=[],i=0,len=targetFields.length;idrawingInf.height:totalWidth>drawingInf.width)break;boxes.push({x:position.x,y:position.y,width:tooltipBoundBox.width,height:tooltipBoundBox.height,tooltip:tooltipInst})}}for(var key in tooltips)if(!enter[key]){var tooltip=tooltips[key];tooltip.content(payload.action,null),tooltip.getContents().length||(tooltip.remove(),delete tooltips[key])}return fragmented&&(!function spaceOutBoxes(boxes,extent,showVertically){var y,height,x,width,i,len=boxes.length,spaceOutIfOverlap=function spaceOutIfOverlap(firstBox,secondBox,opposite){x=firstBox.x,width=firstBox.width,y=firstBox.y,height=firstBox.height;var bottom=y+height,right=x+width;showVertically?(opposite?ysecondBox.y)&&(secondBox.y=opposite?firstBox.y-secondBox.height-5:bottom+5):(opposite?xsecondBox.x)&&(secondBox.x=opposite?firstBox.x-secondBox.width-5:right+5)};for(boxes.sort(function(a,b){return showVertically?a.y-b.y:a.x-b.x}),i=0,i=0;iextent.height||boxes[i].x+boxes[i].width>extent.width)for(showVertically?boxes[i].y-=boxes[i].height+boxes[i].y-extent.height:boxes[i].x-=boxes[i].width+boxes[i].x-extent.width,i=len-1;i>0;i--)spaceOutIfOverlap(boxes[i],boxes[i-1],!0)}(boxes,boundBox,showVertically),boxes.forEach(function(box){return box.tooltip.position(box.x,box.y,{repositionArrow:!0})})),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var strategy=options.strategy||this._strategy;tooltips[key].content(strategy,null),tooltips[key].hide()}}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:5,offset:{x:0,y:0},highlightSummary:{dataTransform:function dataTransform(dt,fields){return fields?dt.project(fields,{saveChild:!1}):dt}},selectionSummary:{dataTransform:function dataTransform(dt,fields){var fieldspace=dt.getFieldspace(),dimensions=Object.keys(fieldspace.getDimension()),measures=Object.keys(fieldspace.getMeasure()),projectedFields=defaultValue(fields,measures.length?[measures[0]]:[]);return dt.project([].concat(tooltip_toConsumableArray(dimensions),tooltip_toConsumableArray(projectedFields)),{saveChild:!1})}}}}},{key:"formalName",value:function formalName(){return side_effects_TOOLTIP}}]),Tooltip}();__webpack_require__(12);function crossline_typeof(obj){return(crossline_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function crossline_toConsumableArray(arr){return function crossline_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{};return(0,this._strategies[options.strategy||this._strategy])(selectionSet,this,options.strategy||this._strategy),this}}],[{key:"formalName",value:function formalName(){return side_effects_HIGHLIGHTER}},{key:"target",value:function target(){return"visual-unit"}}]),PlotHighlighter}();function side_effects_filter_typeof(obj){return(side_effects_filter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function side_effects_filter_defineProperties(target,props){for(var i=0;i67.5&&rotationNormalizer<=90||(yShift+=2*height),xShift=width,xShift=90===rotation?height:270===rotation?-height:0,orientation===axis_orientation_TOP?(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift+xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(-xShift+tickSize,"\n ").concat(-yShift-tickSize,") rotate(").concat(rotation,")"))):(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift-xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(xShift-tickSize,"\n ").concat(yShift+tickSize,") rotate(").concat(rotation,")"))),renderer_utils_selectElement(this).transition().duration(1e3).text(datum)}),tickText},axis_renderer_changeTickOrientation=function changeTickOrientation(selectContainer,axisInstance,tickSize){var _smartTicks=axisInstance._smartTicks,config=axisInstance.config(),renderConfig=axisInstance.renderConfig(),labelManager=axisInstance.dependencies().labelManager,orientation=config.orientation,classPrefix=config.classPrefix,labels=renderConfig.labels,rotation=labels.rotation,isSmartTicks=labels.smartTicks,tickText=selectContainer.selectAll(".tick text");if(tickText.selectAll("tspan").remove(),!rotation||"top"!==orientation&&"bottom"!==orientation)if(rotation||isSmartTicks){if(tickText.text(""),"top"===orientation||"bottom"===orientation)tickText.attr("y",0).attr("x",0).attr("transform","").text(""),makeElement(tickText,"tspan",function(d,i){return _smartTicks[i]?_smartTicks[i].lines:[]},"".concat(classPrefix,"-smart-text")).attr("dy","0").style("opacity","0").transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).attr("dy",function(d,i){return"bottom"===orientation||0!==i?_smartTicks[0].oriTextHeight:-_smartTicks[0].oriTextHeight*(_smartTicks[0].lines.length-1)-tickSize}).style("opacity",1).text(function(e){return e}).attr("x",0);else makeElement(tickText,"tspan",function(d,i){return _smartTicks[i].lines},"".concat(classPrefix,"-smart-text")).text(function(e){return e})}else tickText.attr("transform","");else axis_renderer_rotateAxis(axisInstance,tickText,labelManager);return tickText},axis_renderer_setFixedBaseline=function setFixedBaseline(axisInstance){var fixedBaseline=axisInstance.config().fixedBaseline,showInnerTicks=axisInstance.renderConfig().showInnerTicks,domain=axisInstance.domain();fixedBaseline&&domain.length&&showInnerTicks&&axisInstance.setFixedBaseline()},axis_renderer_setAxisNamePos=function setAxisNamePos(textNode,orientation,measures){var axisNameHeight=measures.axisNameHeight,availableSpace=measures.availableSpace;switch(orientation){case axis_orientation_LEFT:textNode.attr("transform","translate(".concat(-(availableSpace.width-axisNameHeight),",").concat(availableSpace.height/2,")rotate(-90)"));break;case axis_orientation_RIGHT:textNode.attr("transform","translate(".concat(availableSpace.width-axisNameHeight,",").concat(availableSpace.height/2,")rotate(90)"));break;case axis_orientation_TOP:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(-availableSpace.height+axisNameHeight,")"));break;case axis_orientation_BOTTOM:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(availableSpace.height-axisNameHeight/2,")"))}return textNode};var _rangeAdjustmentMap,longestWord={month:"September",quarter:"October",halfYearly:"July",year:9999,day:"September",hour:"24 AM",mintues:"60:60",seconds:":60",week:"Wed 31"},skip_ticks_tickIntervals=[[1,1,"milliseconds",src_millisecond.every(1),"seconds"],[1,1e3,"seconds",src_second.every(1),"seconds"],[5,5e3,"five seconds",src_second.every(5),"seconds"],[10,1e4,"ten seconds",src_second.every(10),"seconds"],[15,15e3,"fifteen seconds",src_second.every(15),"seconds"],[30,3e4,"thirty seconds",src_second.every(30),"seconds"],[1,6e4,"minute",src_minute.every(1),"minutes"],[5,3e5,"five minutes",src_minute.every(5),"minutes"],[10,6e5,"ten minutes",src_minute.every(10),"minutes"],[15,9e5,"fifteen minutes",src_minute.every(15),"minutes"],[30,18e5,"thirty minutes",src_minute.every(30),"minutes"],[1,36e5,"hour",src_hour.every(1),"hour"],[3,108e5,"three hours",src_hour.every(3),"hour"],[6,216e5,"six hours",src_hour.every(6),"hour"],[12,432e5,"twelve hours",src_hour.every(12),"hour"],[1,864e5,"daily",src_day.every(1),"day"],[1,6048e5,"weekly",sunday.every(1),"week"],[1,2592e6,"monthly",src_month.every(1),"week"],[3,7776e6,"quaterly",src_month.every(3),"quarter"],[6,15552e6,"half yearly",src_month.every(6),"halfYearly"],[1,31536e6,"yearly",src_year.every(1),"year"],[2,63072e6,"2 year",src_year.every(2),"year"],[3,94608e6,"3 year",src_year.every(3),"year"],[5,15768e7,"5 year",src_year.every(5),"year"],[10,31536e7,"decade",src_year.every(10),"year"],[100,31536e8,"century",src_year.every(100),"year"],[1e3,31536e9,"millenium",src_year.every(1e3),"year"]],getTickIntervalFnBasedOnNumberOfTicks=function getTickIntervalFnBasedOnNumberOfTicks(interval,count,context){for(var possibleTickLevelIndex=skip_ticks_tickIntervals.length-1,maxPossibleTicks=1,tickIntervalLevelInfo=null,i=skip_ticks_tickIntervals.length-1;i>=0;i--){var tickIntervalInfo=skip_ticks_tickIntervals[i],numOfPossibleTicks=Math.floor(interval/tickIntervalInfo[1]);numOfPossibleTicks<=count&&(possibleTickLevelIndex=i,maxPossibleTicks=numOfPossibleTicks)}return tickIntervalLevelInfo=skip_ticks_tickIntervals[possibleTickLevelIndex],function getActualTickInterval(context,noOfTicks){var minWidthBetweenTicks=context._minTickDistance.width,width=context.availableSpace().width;return Math.floor((width-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)}(context,maxPossibleTicks)=numOfTicksAccordingToMinDiff&&(actualNumberOfTicks=numOfTicksAccordingToMinDiff),getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval,actualNumberOfTicks,context)}(context,maxTicks));context.renderConfig({tickValues:ticks})},adjustHorizontalRange=function adjustHorizontalRange(range,diff){return range[0]+=diff,range[1]-=diff,range},adjustVerticalRange=function adjustVerticalRange(range,diff){return range[0]-=diff,range[1]+=diff,range},rangeAdjustmentMap=(space_setter_defineProperty(_rangeAdjustmentMap={},axis_orientation_TOP,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_BOTTOM,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_LEFT,adjustVerticalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_RIGHT,adjustVerticalRange),_rangeAdjustmentMap),setAxisRange=function setAxisRange(context,type,rangeBounds,offset){context.range(rangeBounds),offset&&context.renderConfig(space_setter_defineProperty({},"".concat(type,"Offset"),offset))},getAdjustedRange=function getAdjustedRange(minDiff,range,domain,config){var orientation=config.orientation,adjustRange=config.adjustRange,diff=function getAxisOffset(timeDiff,range,domain){var avWidth=Math.abs(range[1]-range[0]),bars=avWidth/(avWidth/(domain[1]-domain[0])*timeDiff);return(avWidth-avWidth/(bars+1)*bars)/2}(minDiff,range,domain);return adjustRange?rangeAdjustmentMap[orientation](range,diff):range},space_setter_spaceSetter=function spaceSetter(context,spaceConfig){var _ref,tickInterval,heightForTicks,config=context.config(),_context$availableSpa2=context.availableSpace(),availWidth=_context$availableSpa2.width,availHeight=_context$availableSpa2.height,padding=_context$availableSpa2.padding,top=padding.top,left=padding.left,bottom=padding.bottom,right=padding.right,isOffset=spaceConfig.isOffset,_context$renderConfig2=context.renderConfig(),showAxisName=_context$renderConfig2.showAxisName,labels=_context$renderConfig2.labels,rotation=labels.rotation,fixedBaseline=config.fixedBaseline,axisNamePadding=config.axisNamePadding,tickValues=config.tickValues,_context$getAxisDimen=context.getAxisDimensions(),tickDimensions=_context$getAxisDimen.tickDimensions,allTickDimensions=_context$getAxisDimen.allTickDimensions,axisNameDimensions=_context$getAxisDimen.axisNameDimensions,tickSize=_context$getAxisDimen.tickSize,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width,namePadding=showAxisName?axisNamePadding:0,labelConfig={smartTicks:!0,rotation:labels.rotation},minTickDistance=context._minTickDistance,minTickSpace=context._minTickSpace,minDiff=context._minDiff,domain=context.domain(),axisNameHeight=axisNameDimensions.height,minWidthBetweenTicks=minTickDistance.width,minTickWidth=Math.min(minTickSpace.width,tickDimWidth),minTickHeight=Math.min(minTickSpace.height,tickDimHeight);return space_setter_defineProperty(_ref={},TIME,{x:function x(){!tickValues&&context.applyTickSkipping();var noOfTicks=context.getTickValues().length;heightForTicks=availHeight-axisNameHeight-tickSize-namePadding,(tickInterval=(availWidth-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)axisNameHeight?(labelConfig.rotation=null,context.renderConfig({showInnerTicks:!0,showAxisName:!0})):(labelConfig.rotation=-90,context.renderConfig({showInnerTicks:!0,showAxisName:!1}))),availHeight0&&void 0!==arguments[0]?arguments[0]:0,width=arguments.length>1?arguments[1]:void 0,height=arguments.length>2?arguments[2]:void 0,rotatedHeight=height,rotatedWidth=width;if(rotation){var angle=(rotation||0)*Math.PI/180;rotatedWidth=Math.abs(height*Math.sin(angle))+Math.abs(width*Math.cos(angle)),rotatedHeight=Math.abs(width*Math.sin(angle))+Math.abs(height*Math.cos(angle))}return{width:rotatedWidth,height:rotatedHeight}},helper_setOffset=function setOffset(context){var x=0,y=0,logicalSpace=context.logicalSpace(),config=context.config(),orientation=config.orientation,xOffset=config.xOffset,yOffset=config.yOffset;orientation===axis_orientation_LEFT&&(x=void 0===xOffset?logicalSpace.width:xOffset),orientation===axis_orientation_TOP&&(y=void 0===yOffset?logicalSpace.height:yOffset),context.renderConfig({xOffset:x,yOffset:y})},getAxisComponentDimensions=function getAxisComponentDimensions(context){var axisTicks,largestTick="",largestTickDimensions={width:0,height:0},smartTick={},allTickDimensions=[],scale=context.scale(),_context$renderConfig=context.renderConfig(),tickValues=_context$renderConfig.tickValues,showAxisName=_context$renderConfig.showAxisName,name=context.config().name,labelManager=context.dependencies().labelManager,labelFunc=scale.ticks||scale.quantile||scale.domain;return labelManager.setStyle(context._tickLabelStyle),axisTicks=(axisTicks=tickValues||labelFunc()).map(function(originalLabel,i){var label=context.getFormattedText(originalLabel,i,axisTicks),tickDimensions=labelManager.getOriSize(label);return allTickDimensions.push(tickDimensions),tickDimensions.width>largestTickDimensions.width&&(largestTick=label,smartTick=context.smartTicks()?context.smartTicks()[i]:{},largestTickDimensions=tickDimensions,smartTick=smartTick||tickDimensions),label}),labelManager.setStyle(context._axisNameStyle),{axisNameDimensions:showAxisName?labelManager.getOriSize(name):{width:0,height:0},largestTick:largestTick,largestTickDimensions:largestTickDimensions,allTickDimensions:allTickDimensions,axisTicks:axisTicks,smartTick:smartTick,tickSize:context.getTickSize()}},getHorizontalAxisSpace=function getHorizontalAxisSpace(context,axisDimensions,range){var width,height,domain=context.domain(),minTickDistance=context._minTickDistance.width,tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config2=context.config(),axisNamePadding=_context$config2.axisNamePadding,tickValues=_context$config2.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width;if(width=range&&range.length?range[1]-range[0]:3*(tickDimWidth+minTickDistance),height=0,tickValues){var minTickDiff=context.getMinTickDifference(),_ref=[Math.min.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain))),Math.max.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain)))];width=(_ref[1]-_ref[0])/Math.abs(minTickDiff)*(tickDimWidth+context._minTickDistance.width)}return height=range&&range.length?tickDimHeight:Math.max(tickDimWidth,tickDimHeight),{width:width,height:height+=(showAxisName?axisDimHeight+axisNamePadding:0)+tickSize}},getVerticalAxisSpace=function getVerticalAxisSpace(context,axisDimensions){var height,width,domain=context.domain(),tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config3=context.config(),axisNamePadding=_context$config3.axisNamePadding,tickValues=_context$config3.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height;if(height=0,width=tickDimensions.width,tickValues){var minTickDiff=context.getMinTickDifference(),_ref2=[Math.min.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain))),Math.max.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain)))];height=(_ref2[1]-_ref2[0])/Math.abs(minTickDiff)*tickDimHeight}return{height:height,width:width+=(showAxisName?axisDimHeight:0)+tickSize+axisNamePadding}},helper_calculateBandSpace=function calculateBandSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,show=context.renderConfig().show,largestTickDimensions=axisDimensions.largestTickDimensions,axisTicks=axisDimensions.axisTicks,allTickDimensions=axisDimensions.allTickDimensions,largestDimHeight=largestTickDimensions.height,minTickWidth=context._minTickDistance.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa=getHorizontalAxisSpace(context,axisDimensions,range),_width=_getHorizontalAxisSpa.width,_height=_getHorizontalAxisSpa.height;return range&&range.length||(_width=allTickDimensions.reduce(function(t,n){return t+Math.min(n.width,n.height)+minTickWidth},0)),!1===show&&(_height=0,_width=0),{width:_width,height:_height}}var _getVerticalAxisSpace=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace.width,height=_getVerticalAxisSpace.height;return height&&0!==height||(height=axisTicks.length*(largestDimHeight+context._minTickDistance.height)),!1===show&&(width=0),{width:width,height:height}},helper_getValidDomain=function getValidDomain(context,domain){var userDom=context.config().domain;return userDom&&(domain=userDom),defaultValue(domain,[])},setContinousAxisDomain=function setContinousAxisDomain(context,domain){var nice=context.config().nice,scale=context.scale.bind(context);scale().domain(domain),nice&&scale().nice(),context._domain=scale().domain()},props_PROPS={availableSpace:{},axisDimensions:{},axisComponentDimensions:{},config:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._config||{}),mockedOldConfig=mergeRecursive({},oldConfig);(value=mergeRecursive(mockedOldConfig,value)).axisNamePadding=Math.max(value.axisNamePadding,0);var shouldAxesScaleUpdate=function hasAxesConfigChanged(){var obj=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},obj1=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},properties=arguments.length>2?arguments[2]:void 0;return!(!Object.keys(obj).length||!Object.keys(obj1).length)&&properties.some(function(key){return obj[key]!==obj1[key]})}(value,oldConfig,["interpolator","exponent","base","orientation"]),tickFormatter=context.sanitizeTickFormatter(value);return shouldAxesScaleUpdate&&(context._scale=context.createScale(value),context._axis=context.createAxis(value)),context._tickFormatter=function(ticks){return tickFormatter(ticks)},context.resetRenderConfig(value),value}},renderConfig:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._renderConfig||{});return value=mergeRecursive(oldConfig,value)}},logicalSpace:{},mount:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.logicalSpace(null),value}},smartTicks:{},tickSize:{},maxTickSpaces:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._maxTickSpaces||{});return value=mergeRecursive(oldConfig,value)}},valueParser:{defaultValue:function defaultValue(val){return val}}};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function simple_axis_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function simple_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,height=arguments.length>1?arguments[1]:void 0,padding=arguments.length>2?arguments[2]:void 0,isOffset=arguments.length>3?arguments[3]:void 0,labelConfig={},orientation=this.config().orientation;this.availableSpace({width:width,height:height,padding:padding});var type=this.constructor.type();return labelConfig=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?space_setter_spaceSetter(this,{isOffset:isOffset})[type].x():space_setter_spaceSetter(this,{isOffset:isOffset})[type].y(),this.renderConfig({labels:labelConfig}),this.setTickConfig(),this.setSmartAxisName(),this}},{key:"setSmartAxisName",value:function setSmartAxisName(){var _this$config2=this.config(),orientation=_this$config2.orientation,name=_this$config2.name,dimType=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?"width":"height",widthDim=this.availableSpace()[dimType],labelManager=this.dependencies().labelManager;return labelManager.setStyle(this._axisNameStyle),this.renderConfig({smartAxisName:function getSmartAxisName(name,width,labelManager){var oriSize=labelManager.getOriSize(name);return labelManager.useEllipsesOnOverflow(!0),labelManager.getSmartText(name,width,oriSize.height,!0)}(name,widthDim,labelManager)}),this}},{key:"setTickConfig",value:function setTickConfig(){return this}},{key:"getScaleValue",value:function getScaleValue(domainVal){if(null!==domainVal&&void 0!==domainVal)return this.scale()(domainVal)}},{key:"getTickSize",value:function getTickSize(){return this.axis().tickSize()}},{key:"getAxisDimensions",value:function getAxisDimensions(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return this.axisDimensions(function computeAxisDimensions(context){var tickDimensions={},labels=context.renderConfig().labels,smartTicks=labels.smartTicks,rotation=labels.rotation,_getAxisComponentDime=getAxisComponentDimensions(context),largestTickDimensions=_getAxisComponentDime.largestTickDimensions,axisTicks=_getAxisComponentDime.axisTicks,smartTick=_getAxisComponentDime.smartTick,axisNameDimensions=_getAxisComponentDime.axisNameDimensions,allTickDimensions=_getAxisComponentDime.allTickDimensions,tickSize=_getAxisComponentDime.tickSize,labelHeight=largestTickDimensions.height,labelWidth=largestTickDimensions.width;return 0===context.domain().length?null:(tickDimensions=getRotatedSpaces(rotation,(tickDimensions=smartTicks?smartTick:{width:labelWidth,height:labelHeight}).width,tickDimensions.height),0===tickSize&&(tickDimensions={width:0,height:0}),{allTickDimensions:allTickDimensions,tickSize:tickSize,tickDimensions:tickDimensions,axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks})}.apply(void 0,[this].concat(params))),this.axisDimensions()}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()||this.logicalSpace(function calculateContinousSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,_context$renderConfig6=context.renderConfig(),show=_context$renderConfig6.show,showAxisName=_context$renderConfig6.showAxisName,axisNameDimensions=axisDimensions.axisNameDimensions;if(!1===show)return{width:0,height:0};var axisNameWidth=axisNameDimensions.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa2=getHorizontalAxisSpace(context,axisDimensions,range),_width2=_getHorizontalAxisSpa2.width,_height2=_getHorizontalAxisSpa2.height;return{width:Math.max(_width2,axisNameWidth),height:_height2}}var _getVerticalAxisSpace2=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace2.width,height=_getVerticalAxisSpace2.height;return{width:width,height:Math.max(height,showAxisName?axisNameWidth:0)}}(this)),helper_setOffset(this),this.logicalSpace()}},{key:"invert",value:function invert(value){return this.scale().invert(value)}},{key:"getNearestRange",value:function getNearestRange(v1,v2){return[v1,v2]}},{key:"invertExtent",value:function invertExtent(v1,v2){return[this.invert(v1),this.invert(v2)]}},{key:"getMinTickDifference",value:function getMinTickDifference(){return this.domain()}},{key:"getFormattedTickValues",value:function getFormattedTickValues(tickValues){return tickValues}},{key:"getUnitWidth",value:function getUnitWidth(){return 0}},{key:"serialize",value:function serialize(){return{name:this.name,type:this.type,range:this.range(),config:this.config()}}},{key:"render",value:function render(){return this.mount()&&(this.setTickConfig(),function renderAxis(axisInstance){var config=axisInstance.config(),renderConfig=axisInstance.renderConfig(),labelManager=axisInstance.dependencies().labelManager,mount=axisInstance.mount(),range=axisInstance.range(),axis=axisInstance.axis(),scale=axisInstance.scale(),tickLabelStyle=axisInstance._tickLabelStyle,axisTickFormatter=axisInstance._tickFormatter,orientation=config.orientation,axisNamePadding=config.axisNamePadding,className=config.className,id=config.id,classPrefix=config.classPrefix,show=renderConfig.show,xOffset=renderConfig.xOffset,yOffset=renderConfig.yOffset,showAxisName=renderConfig.showAxisName,labels=renderConfig.labels,smartAxisName=renderConfig.smartAxisName;if(show){var tickSize=axisInstance.getTickSize(),selectContainer=makeElement(renderer_utils_selectElement(mount),"g",[axisInstance],"".concat(className),{},function(key){return key.config().id});labelManager.setStyle(tickLabelStyle);var labelFunc=scale.ticks||scale.quantile||scale.domain,ticks=axis.tickValues()||labelFunc();axis.tickFormat(axisTickFormatter(ticks));var availableSpace=Math.abs(range[0]-range[1]),labelProps=axisInstance.axisComponentDimensions().largestTickDimensions;selectContainer.attr("transform","translate(".concat(xOffset,",").concat(yOffset,")")),axis_renderer_setFixedBaseline(axisInstance),!1===labels.smartTicks||0===tickSize?selectContainer.transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).call(axis):selectContainer.call(axis),selectContainer.selectAll(".tick").classed("".concat(classPrefix,"-ticks"),!0),selectContainer.selectAll(".tick line").classed("".concat(classPrefix,"-tick-lines"),!0),selectContainer.selectAll(".tick text").classed("".concat(classPrefix,"-ticks"),!0).classed("".concat(classPrefix,"-ticks-").concat(id),!0),axis_renderer_changeTickOrientation(selectContainer,axisInstance,tickSize);var textNode=makeElement(selectContainer,"text",[smartAxisName],"".concat(classPrefix,"-axis-name")).attr("text-anchor","middle").classed("".concat(classPrefix,"-axis-name-").concat(id),!0).text(function(d){return d.text});textNode.classed(HIDDEN,!showAxisName);var labelOffset=availableSpace/2,measures={labelProps:labelProps,tickSize:tickSize,axisNamePadding:axisNamePadding,axisNameHeight:smartAxisName.height,yOffset:yOffset,xOffset:xOffset,labelOffset:labelOffset,availableSpace:axisInstance.availableSpace()};axis_renderer_setAxisNamePos(textNode,orientation,measures)}}(this)),this}},{key:"remove",value:function remove(){return renderer_utils_selectElement(this.mount()).remove(),this}},{key:"unsubscribe",value:function unsubscribe(){return this}},{key:"isReverse",value:function isReverse(){var range=this.range();return range[0]>range[1]}},{key:"getPixelToValueRatio",value:function getPixelToValueRatio(){var scale=this.scale(),range=scale.range(),domain=scale.domain();return Math.abs(range[1]-range[0])/(domain[1]-domain[0])}},{key:"animationDone",value:function animationDone(){return Promise.all(this._animationDonePromises)}},{key:"registerAnimationDoneHook",value:function registerAnimationDoneHook(){var resolveFn,promise=new Promise(function(resolve){resolveFn=resolve});return this._animationDonePromises.push(promise),function(){resolveFn()}}},{key:"id",get:function get(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return cartesian_axis_default_config_defaultConfig}}]),SimpleAxis}();function linear_defineProperties(target,props){for(var i=0;iavailableSpace&&(numberOfValues=Math.floor(availableSpace/(labelDim+minTickDistance))),numberOfTicks=numberOfTicks||numberOfValues,numberOfValues=Math.min(numberOfTicks,Math.max(2,numberOfValues)),(tickValues=axis.scale().ticks(numberOfValues)).length>numberOfValues&&(tickValues=tickValues.filter(function(e,i){return i%2==0})),2===numberOfValues&&(tickValues=[(tickValues=axis.scale().ticks(10))[0],tickValues[tickValues.length-1]]),tickValues}(availableSpace,labelProps[orientation===axis_orientation_BOTTOM||orientation===axis_orientation_TOP?"width":"height"],axis,this)}},{key:"getMinTickDifference",value:function getMinTickDifference(){return getSmallestDiff(this.renderConfig().tickValues)}},{key:"setFixedBaseline",value:function setFixedBaseline(tickText){var orientation=this.config().orientation,rotation=this.renderConfig().labels.rotation,axis=this.axis(),ticks=axis.tickValues(),smartTicks=this.smartTicks();if(smartTicks&&smartTicks.length){var _this$smartTicks$=this.smartTicks()[0],width=_this$smartTicks$.width,height=_this$smartTicks$.height;axis.tickTransform(function(d){if(d===ticks[0]){if(orientation===axis_orientation_LEFT||orientation===axis_orientation_RIGHT)return"translate(0, -".concat(height/3,"px)");if((orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM)&&!rotation)return"translate(".concat(width/2,"px, ",0,"px)")}return""})}return tickText}}],[{key:"type",value:function type(){return LINEAR}}]),ContinousAxis}();function band_axis_typeof(obj){return(band_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function band_axis_defineProperties(target,props){for(var i=0;irange[1],extent=this.invertExtent(v1,v2);return[scale(reverse?extent[extent.length-1]:extent[0]),scale(reverse?extent[0]:extent[extent.length-1])+scale.bandwidth()]}}],[{key:"type",value:function type(){return BAND}}]),BandAxis}();function time_axis_typeof(obj){return(time_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function time_axis_defineProperties(target,props){for(var i=0;i1?config.range:[DEFAULT_GRADIENT_COLOR].concat(props_toConsumableArray(config.range)));var oldConfig=mergeRecursive(defCon,context.config()),newConfig=mergeRecursive(oldConfig,config);return newConfig.range instanceof Array&&(newConfig.range=newConfig.range.map(function(e,i){return props_getActualHslColor(e,palette[i])}),newConfig.stops=config.stops||newConfig.range.length),newConfig.value=props_getActualHslColor(newConfig.value,newConfig.value),newConfig}},domain:{},scale:{},uniqueValues:{}},helper_treatNullMeasures=function treatNullMeasures(domainVal,scaledVal,minDomainScaledVal){return domainVal instanceof src_InvalidAwareTypes?minDomainScaledVal:scaledVal},helper_resolveAxisConfig=function resolveAxisConfig(propVal,defaultVal,context){switch(getObjProp(propVal,"constructor")){case Function:return propVal(defaultVal,context);case Array:return propVal;default:return defaultVal}};function color_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function color_strategy_toConsumableArray(arr){return function color_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iMath.min(range.length,18))for(var interpolator=common_utils_piecewiseInterpolator()(function hslInterpolator(){return hslLong}(),range.map(function(e){return props_getHslString(e)})),i=0;i0&&void 0!==arguments[0]?arguments[0]:[];if(domain.length){var scale=this.scale(),range=scale.range?scale.range():null,scaleInfo=this._colorStrategy.domainRange()(domain,this.config().stops,range);this.domain(scaleInfo.domain),scaleInfo.range&&this.scale().range(scaleInfo.range),this.uniqueValues(scaleInfo.uniqueVals),this.scale().domain(scaleInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),config:this.config()}}},{key:"transformColor",value:function transformColor(color,transformationArr){var h=360*color[0],s=100*color[1],l=100*color[2],a=Math.min(defaultValue(color[3],0),1),newH=h+transformationArr[0],newS=s+transformationArr[1],newL=l+transformationArr[2],newA=Math.min(a+transformationArr[3]||0,1);return{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH/360,newS/100,newL/100,newA]}}},{key:"id",value:function id(){return this._id}},{key:"getHslArray",value:function getHslArray(color){return props_getActualHslColor(color)}}],[{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIG}},{key:"type",value:function type(){return"color"}}]),ColorAxis}(),defaults_DEFAULT_CONFIG={value:36,range:[36,1e3]};function size_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function size_strategy_toConsumableArray(arr){return function size_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&void 0!==arguments[0]?arguments[0]:0,value=this.config().value,scale=this.scale(),domain=this.domain()||[1,1];return scale&&domain[0]!==domain[1]?this._sizeStrategy.range(domainVal,scale,this.domain(),this.uniqueValues()):value}},{key:"updateDomain",value:function updateDomain(domain){if(domain){var domainInfo=(0,this._sizeStrategy.domain)(domain,this.config().intervals);this.domain(domainInfo.domain),this.uniqueValues(domainInfo.uniqueVals),this.scale().domain(domainInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.range(),config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"size"}}]),SizeAxis}(),shape_axis_defaults_DEFAULT_CONFIG={generator:null,value:"circle",range:["circle","diamond","star","cross","square","wye","triangle"]},shape_axis_props_PROPS={config:{},domain:{},scale:{},uniqueValues:{},generator:{}};function shape_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];return domain.length&&(this.uniqueValues(domain),this.domain(domain),this.scale().domain(domain),this.config().generator&&(this._generatedShapes=function shapeGenerator(domain,generatorFn){var generatedShapes={};return domain.forEach(function(value){generatedShapes[value]=generatorFn(value)}),generatedShapes}(domain,this.config().generator))),this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.config().range,config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return shape_axis_defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"shape"}}]),ShapeAxis}(),polar_axis_props_PROPS={config:{sanitization:function sanitization(context,config){return mergeRecursive(context.config(),config)},preset:function preset(context,config){var range=config.range,domain=config.domain;range&&context.range(range),domain&&context.domain(domain)}},domain:{},range:{}};function angle_axis_slicedToArray(arr,i){return function angle_axis_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function angle_axis_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function angle_axis_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function angle_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function angle_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AngleAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._range=[0,360],this._angleFn=angle_axis_pie().value(function(d){return"string"==typeof d?1:d}).sortValues(null),this._angleValues={}}return function angle_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&angle_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&angle_axis_defineProperties(Constructor,staticProps),Constructor}(AngleAxis,[{key:"createScale",value:function createScale(strategy){var range=this.config().range;return scale_creator_createScale({type:strategy.scale,range:range})}},{key:"getScaleValue",value:function getScaleValue(domainVal){return this._angleValues[domainVal]}},{key:"padAngle",value:function padAngle(angle){this._angleFn=this._angleFn.padAngle(angle)}},{key:"domain",value:function domain(){for(var _len=arguments.length,domainVal=new Array(_len),_key=0;_key<_len;_key++)domainVal[_key]=arguments[_key];if(domainVal.length){var customDomain=this.config().domain,domain=domainVal[0].length?domainVal[0]:DEFAULT_ANGLE_DOMAIN;return this._domain=helper_resolveAxisConfig(customDomain,domain,this),createAngleValues(this),this}return this._domain}},{key:"range",value:function range(){if(arguments.length){var customRange=this.config().range;this._range=helper_resolveAxisConfig(customRange,arguments.length<=0?void 0:arguments[0],this);var domain=this.domain(),_this$_range=angle_axis_slicedToArray(this._range,2),startAngle=_this$_range[0],endAngle=_this$_range[1];return this._angleFn.startAngle(startAngle/180*Math.PI).endAngle(Math.PI*endAngle/180),domain&&domain.length&&createAngleValues(this),this}return this._range}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),AngleAxis}(),X="x",Y="y",MEASURE="measure",ROWS="rows",COLUMNS="columns",COL="col",ROW="row",enums_constants_COLOR="color",enums_constants_SHAPE="shape",enums_constants_SIZE="size",enums_constants_LINEAR="linear",constants_LEFT="left",constants_RIGHT="right",CELL="cell",X_AXES="xAxes",Y_AXES="yAxes",ENTRY_CELLS="entryCell",EXIT_CELLS="exitCell",enums_constants_RADIUS="radius",enums_constants_ANGLE="angle",ANGLE0="angle0",PRIMARY="Primary",SECONDARY="Secondary";function radius_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function radius_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RadiusAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._range=[],this._radiusFactor=1,this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._scale=this.createScale({scale:enums_constants_LINEAR})}return function radius_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&radius_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&radius_axis_defineProperties(Constructor,staticProps),Constructor}(RadiusAxis,[{key:"config",value:function config(){if(arguments.length){var config=mergeRecursive(this.config(),arguments.length<=0?void 0:arguments[0]);return this._config=config,this}return this._config}},{key:"createScale",value:function createScale(strategy){return scale_creator_createScale({type:strategy.scale,range:this.range()})}},{key:"domain",value:function domain(){if(arguments.length){var customDomain=this.config().domain,domain=helper_resolveAxisConfig(customDomain,arguments.length<=0?void 0:arguments[0],this);domain=sanitizeDomainWhenEqual(domain),this._scale.domain(domain),this._domain=domain,adjustDomain(this)}return this._domain}},{key:"getInnerRadius",value:function getInnerRadius(domainVal){return void 0===domainVal?this.range()[0]:this._scale(domainVal)}},{key:"getOuterRadius",value:function getOuterRadius(domainVal){return void 0===domainVal?this.range()[1]:this._scale(domainVal)*this._radiusFactor}},{key:"range",value:function range(){for(var _len=arguments.length,_range=new Array(_len),_key=0;_key<_len;_key++)_range[_key]=arguments[_key];if(_range.length){var _this$config2=this.config(),padding=_this$config2.padding,customRange=_this$config2.range,sanitizedRange=_range[0].map(function(v,i){return v+(i?-padding[i]:padding[i])}),rangeVal=helper_resolveAxisConfig(customRange,sanitizedRange,this);this._range=rangeVal,this._scale.range(rangeVal),adjustDomain(this)}return this._range}},{key:"setRadiusFactor",value:function setRadiusFactor(val){return this._radiusFactor=val,this}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:[0,1],minOuterRadius:10}}}]),RadiusAxis}();function data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DATA_TYPES_MEASURE="measure",DATA_TYPES_TEMPORAL="temporal",group_transform=(data_type_scale_map_defineProperty(_dataTypeScaleMap={},"dimension",BAND),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_MEASURE,LINEAR),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_TEMPORAL,TIME),function(schema,data,config){var groupBy=config.groupBy instanceof Array?config.groupBy:[config.groupBy],groupByIndices=groupBy.map(function(fieldName){return schema.findIndex(function(d){return d.name===fieldName})});if(void 0!==groupByIndices.find(function(d){return-1===d}))throw new Error("Groupby field ".concat(groupBy," not found in schema"));var groupedData=common_utils_nestCollection({keys:groupByIndices,data:data});return groupedData.forEach(function(d){var key=d.key;src_InvalidAwareTypes.isInvalid(key)&&(d.key=src_InvalidAwareTypes.getInvalidType(key))}),groupedData});var _transformMap;function transform_factory_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var transformMap=(transform_factory_defineProperty(_transformMap={},"identity",function identityTransform(schema,data,config){return data}),transform_factory_defineProperty(_transformMap,"group",group_transform),transform_factory_defineProperty(_transformMap,"stack",function(schema,data,config){var uniqueField=config.uniqueField,valueField=config.value,groupBy=config.groupBy,sort=config.sort||"descending",normalizedData=function normalizeData(data,schema,valueField,uniqueField,groupBy){var groupedData=group_transform(schema,data,{groupBy:uniqueField}),uniqueFieldIndex=schema.findIndex(function(d){return d.name===uniqueField}),valueFieldIndex=schema.findIndex(function(d){return d.name===valueField}),seriesKeyIndex=schema.findIndex(function(d){return d.name===groupBy}),seriesKeys=data.map(function(d){return d[seriesKeyIndex]}).filter(function(item,pos,arr){return arr.indexOf(item)===pos}).sort(),fieldNames=schema.reduce(function(acc,obj,i){return acc[i]=obj.name,acc},{});return{data:groupedData.map(function(arr){var tuples={},rowObj=arr.values.reduce(function(acc,row){return acc=row.reduce(function(obj,value,i){return i===seriesKeyIndex?(obj[value]=row[valueFieldIndex],tuples[value]=row):i!==valueFieldIndex&&(obj[fieldNames[i]]=value),obj},acc)},{});return rowObj._tuple=tuples,seriesKeys.forEach(function(seriesKey){if(void 0===rowObj[seriesKey]){rowObj[seriesKey]=0;var newArr=new Array(arr.values[0].length);newArr[uniqueFieldIndex]=arr.key,newArr[seriesKeyIndex]=seriesKey,rowObj._tuple[seriesKey]=newArr}}),rowObj}),keys:seriesKeys}}(data,schema,valueField,uniqueField,groupBy),keys=normalizedData.keys,map={},orderBy=config.orderBy,orderIndex=schema.findIndex(function(d){return d.name===orderBy}),groupByIndex=schema.findIndex(function(d){return d.name===groupBy});-1!==orderIndex&&(keys.forEach(function(key){var name=data.find(function(d){return d[groupByIndex]===key});map[key]=name[orderIndex]}),normalizedData.keys.sort(function(a,b){return map[a].localeCompare(map[b])}));var stackData=common_utils_stack({keys:normalizedData.keys,offset:config.offset||"diverging",order:sort,data:normalizedData.data});return stackData.forEach(function(seriesData){seriesData.forEach(function(dataObj){dataObj.data=dataObj.data._tuple[seriesData.key]})}),stackData}),_transformMap);var _encodingFieldInfRetr,_dataNormalizers,_domainCalculator,transform_factory=function transformFactory(type){var transform=transformMap[type];if("function"!=typeof transform)throw new Error("Invalid transform type supplied.");return transform};function helpers_toConsumableArray(arr){return function helpers_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=d[0]?(y=x0=d[1],x=y0=d[0]):(y=x0=d[0],x=y0=d[1]),(pointObj=xFieldType===dist_datamodel.FieldType.MEASURE?{x:x,x0:x0,y:tuple[yFieldIndex],y0:tuple[yFieldIndex]}:{x:tuple[xFieldIndex],x0:tuple[xFieldIndex],y:y,y0:y0}).source=tuple,pointObj.rowId=tuple[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=tuple[encodingFieldInf["".concat(enc,"FieldIndex")]]})):((pointObj={x:d[xFieldIndex],y:d[yFieldIndex],x0:d[x0FieldIndex],y0:d[y0FieldIndex]}).source=d,pointObj.rowId=d[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=d[encodingFieldInf["".concat(enc,"FieldIndex")]]}));return pointObj})}).filter(function(d){return d.length})}),_dataNormalizers),domainCalculator=(helpers_defineProperty(_domainCalculator={},POLAR,function(data,layerInst){var config=layerInst.config(),sort=config.sort,angleValues=data[0],radius0Field=getObjProp(config.encoding.radius0,"field");return sort&&(angleValues=angleValues.sort(function(a,b){return"asc"===sort?a.radius-b.radius:b.radius-a.radius})),{radius:getDomainFromData(data,[ENCODING.RADIUS,radius0Field?ENCODING.RADIUS0:ENCODING.RADIUS]),angle:angleValues.map(function(d){return d.angle}),angle0:angleValues.map(function(d){return d.angle0})}}),helpers_defineProperty(_domainCalculator,helpers_CARTESIAN,function(data,layerInst){var transformType=layerInst.transformType(),encodingFieldInf=layerInst.encodingFieldsInf(),xFieldSubType=encodingFieldInf.xFieldSubType,yFieldSubType=encodingFieldInf.yFieldSubType,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,x0Field=encodingFieldInf.x0Field,y0Field=encodingFieldInf.y0Field,domains={},yEnc=ENCODING.Y,xEnc=ENCODING.X;return xField&&(domains.x=getDomainFromData(data,x0Field||"stack"===transformType?[xEnc,ENCODING.X0]:[xEnc,xEnc],xFieldSubType)),yField&&(domains.y=getDomainFromData(data,y0Field||"stack"===transformType?[ENCODING.Y0,ENCODING.Y]:[yEnc,yEnc],yFieldSubType)),domains}),_domainCalculator),attachDataToVoronoi=function attachDataToVoronoi(voronoi,points){var _ref3;voronoi.data((_ref3=[]).concat.apply(_ref3,helpers_toConsumableArray(points)).filter(function(d){return void 0!==d.rowId}).map(function(d){var point=d.update;return{x:point.x,y:point.y,data:d}}))},helpers_updateStyle=function updateStyle(target,styles,remove){for(var key in styles)({}).hasOwnProperty.call(styles,key)&&target.style(key,remove?null:styles[key])},positionPoints=function positionPoints(context,points){var positioner=context.encodingTransform();return positioner?positioner(points,context,{smartLabel:context._dependencies.smartLabel}):points},helpers_getPlotMeasurement=function getPlotMeasurement(context,dimensionalValues){var fieldInfo=context.encodingFieldsInf(),axes=context.axes(),transformType=context.transformType(),config=context.config(),bandScale=context._bandScale;return["x","y"].map(function(type){var span=0,groupSpan=0,padding=0,offsetValues=[];if(fieldInfo["".concat(type,"FieldType")]===dist_datamodel.FieldType.DIMENSION){var actualGroupWidth,timeDiff=fieldInfo["".concat(type,"FieldSubType")]===dist_datamodel.DimensionSubtype.TEMPORAL?context.dataProps().timeDiffs[type]:0,axis=axes[type],pad=config["pad".concat(type.toUpperCase())],innerPadding=config.innerPadding,keys=dimensionalValues,scale=axis.scale();groupSpan=function getGroupSpan(axis,minDiff){var width=axis.getUnitWidth(),scale=axis.scale(),range=scale.range(),domain=scale.domain();return width||Math.abs(range[1]-range[0])/Math.abs(domain[1]-domain[0])*minDiff}(axis,timeDiff);var isAxisBandScale=axis.constructor.type()===helpers_BAND,axisPadding=axis.config().padding;if("group"===transformType){var groupPadding=isAxisBandScale?0:axisPadding*groupSpan/2;bandScale.range([groupPadding,groupSpan-groupPadding]).domain(keys).paddingInner(innerPadding),span=bandScale.bandwidth(),actualGroupWidth=groupSpan-(isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(key){return bandScale(key)-(isAxisBandScale?0:groupSpan/2)})}else if(void 0!==pad){var offset;if(isAxisBandScale){var step=scale.step();offset=scale.padding()*step,span=scale.bandwidth()+offset}else span=groupSpan;offsetValues=keys.map(function(){return isAxisBandScale?-offset/2:-span/2})}else actualGroupWidth=span=groupSpan-(padding=isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(){return isAxisBandScale?0:-span/2});groupSpan=actualGroupWidth,padding=isAxisBandScale?axisPadding*axis.scale().step():axisPadding*groupSpan}return{span:span,offsetValues:offsetValues,groupSpan:groupSpan,padding:padding}})},helpers_resolveInvalidTransformType=function resolveInvalidTransformType(context){return function transformResolverPredicates(encodingFieldInf,context,groupByField){var fieldsConfig=context.data().getFieldsConfig(),xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,dimensionField=["xField","yField"].find(function(type){return encodingFieldInf["".concat(type,"Type")]===dist_datamodel.FieldType.DIMENSION});return[!xField,!yField,!groupByField,getObjProp(fieldsConfig[groupByField],"def","type")===dist_datamodel.FieldType.MEASURE,xFieldType===dist_datamodel.FieldType.DIMENSION&&yFieldType===dist_datamodel.FieldType.DIMENSION,dimensionField&&encodingFieldInf[dimensionField]===groupByField]}(context.encodingFieldsInf(),context,context.config().transform.groupBy).some(function(value){return value})?"identity":null},helpers_getValidTransformForAggFn=function getValidTransformForAggFn(context){var resolvedInvalidTransformType=helpers_resolveInvalidTransformType(context);if(resolvedInvalidTransformType)return resolvedInvalidTransformType;var _context$encodingFiel=context.encodingFieldsInf(),xField=_context$encodingFiel.xField,yField=_context$encodingFiel.yField,xFieldType=_context$encodingFiel.xFieldType,yFieldType=_context$encodingFiel.yFieldType,groupByField=context.config().transform.groupBy,isCustomTransformTypeProvided=!!getObjProp(context._customConfig,"transform","type"),transformType=context.config().transform.type;if(!isCustomTransformTypeProvided&&groupByField&&xFieldType!==yFieldType){var measureField=xFieldType===dist_datamodel.FieldType.MEASURE?xField:yField;transformType="sum"===common_utils_retrieveNearestGroupByReducers(context.data(),measureField)[measureField]?"stack":"group"}return transformType},helpers_resolveEncodingValues=function resolveEncodingValues(data,i,dataArr,layerInst){var transformedValues={},values=data.values,encoding=layerInst.config().encoding;for(var key in values){var value=getObjProp(encoding[key],"value");value instanceof Function?transformedValues[key]=value(values,i,dataArr,layerInst):transformedValues[key]=values[key]}return transformedValues},getColorMetaInf=function getColorMetaInf(colorInf,colorAxis){return{originalColor:Object.keys(colorInf).reduce(function(acc,key){return colorInf[key]&&(acc[key]=colorAxis.getHslArray(colorInf[key])),acc},{}),stateColor:{},colorTransform:{}}},getCoordValue=function getCoordValue(radius,trig,angle,offset){return radius*Math[trig](angle)+offset},coordValueGetter=function coordValueGetter(radius,angle,xOffset,yOffset){return{x:getCoordValue(radius,"cos",angle,xOffset),y:getCoordValue(radius,"sin",angle,yOffset)}},toCartesianCoordinates=function toCartesianCoordinates(points,measurement){for(var rangePlot=arguments.length>2&&void 0!==arguments[2]&&arguments[2],xOffset=measurement.width/2,yOffset=measurement.height/2,i=0,len=points.length;i3&&void 0!==arguments[3]?arguments[3]:{};return function base_layer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseLayer),_this=function base_layer_possibleConstructorReturn(self,call){return!call||"object"!==base_layer_typeof(call)&&"function"!=typeof call?base_layer_assertThisInitialized(self):call}(this,base_layer_getPrototypeOf(BaseLayer).call(this)),generateGetterSetters(base_layer_assertThisInitialized(_this),props_props),_this.axes(axes),_this.alias(_this.constructor.formalName()+getUniqueId()),_this.dependencies(dependencies),_this._points=[],_this._cachedData=[],_this._id=getUniqueId(),_this._measurement={},_this._animationDonePromises=[],_this._graphicElems={},_this._customConfig=null,_this}return function base_layer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&base_layer_setPrototypeOf(subClass,superClass)}(BaseLayer,simple_layer_SimpleLayer),function base_layer_createClass(Constructor,protoProps,staticProps){return protoProps&&base_layer_defineProperties(Constructor.prototype,protoProps),staticProps&&base_layer_defineProperties(Constructor,staticProps),Constructor}(BaseLayer,[{key:"store",value:function store(){if(arguments.length){var store=this._store=arguments.length<=0?void 0:arguments[0],namespace=this.metaInf().namespace;return store.addSubNamespace(namespace,BaseLayer.formalName(),this),store_transactor(this,localOptions,store,{subNamespace:namespace,namespace:"".concat(namespace_namespaceObject.LAYER_LOCAL_NAMESPACE)}),this}return this._store}},{key:"domain",value:function domain(){var prop="".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".").concat("domain"),store=this.store();if(arguments.length){var _this$metaInf2=this.metaInf(),parentNamespace=_this$metaInf2.parentNamespace,namespace=_this$metaInf2.namespace,domain=defaultValue(store.get(prop,parentNamespace),{});return domain[namespace]=arguments.length<=0?void 0:arguments[0],this.store().commit(prop,domain,parentNamespace),this}return this.store().get(prop,this.metaInf().namespace)}},{key:"encodingFieldsInf",value:function encodingFieldsInf(){return arguments.length?(this._encodingFieldsInf=arguments.length<=0?void 0:arguments[0],this):this._encodingFieldsInf}},{key:"encodingTransform",value:function encodingTransform(){return arguments.length?(this._encodingTransform=arguments.length<=0?void 0:arguments[0],this):this._encodingTransform}},{key:"alias",value:function alias(){return arguments.length?(this._alias=arguments.length<=0?void 0:arguments[0],this):this._alias||this.constructor.formalName()}},{key:"dependencies",value:function dependencies(){return arguments.length?(this._dependencies=arguments.length<=0?void 0:arguments[0],this):this._dependencies}},{key:"enableCaching",value:function enableCaching(){return this._cacheEnabled=!0,this}},{key:"clearCaching",value:function clearCaching(){return this._cacheEnabled=!1,this.data(this._cachedData[0])}},{key:"serialize",value:function serialize(){return this.config()}},{key:"id",value:function id(){return this._id}},{key:"getTransformedData",value:function getTransformedData(dataModel,config,transformType,encodingFieldsInf){return function transformData(dataModel,config,transformType,encodingFieldInf){var data=dataModel.getData({withUid:!0}),schema=data.schema,transform=config.transform,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,uniqueField=xFieldType===dist_datamodel.FieldType.MEASURE?yField:xField;return transform_factory(transformType)(schema,data.data,{groupBy:transform.groupBy,uniqueField:uniqueField,sort:transform.sort||"none",offset:transform.offset,orderBy:transform.orderBy,value:yFieldType===dist_datamodel.FieldType.MEASURE?yField:xField},data.uids)}(dataModel,config,transformType,encodingFieldsInf)}},{key:"calculateDomainFromData",value:function calculateDomainFromData(data){var domains={};return this.data().isEmpty()||(domains=domainCalculator[this.coord()](data,this)),domains}},{key:"getDataDomain",value:function getDataDomain(encodingType){var _this$metaInf3=this.metaInf(),parentNamespace=_this$metaInf3.parentNamespace,namespace=_this$metaInf3.namespace,domains=getObjProp(this.store().get("".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".").concat("domain"),parentNamespace),namespace);return void 0!==encodingType?domains[encodingType]||[]:domains}},{key:"getNormalizedData",value:function getNormalizedData(transformedData){return function getNormalizedData(transformedData,context){var transformType=context.transformType(),transformedDataArr="identity"===transformType?[transformedData]:transformedData,encodingFieldInf=context.encodingFieldsInf(),fieldsConfig=context.data().getFieldsConfig();return dataNormalizers[context.coord()](transformedDataArr,encodingFieldInf,fieldsConfig,transformType)}(transformedData,this)}},{key:"getNearestPoint",value:function getNearestPoint(){return null}},{key:"applyInteractionStyle",value:function applyInteractionStyle(interactionType,selectionSet,apply,styles){var interactionStyles=(this.config().interaction||{})[interactionType];(interactionStyles=styles||interactionStyles)&&helpers_applyInteractionStyle(this,selectionSet,interactionStyles,{apply:apply,interactionType:interactionType})}},{key:"disableUpdate",value:function disableUpdate(){return this._updateLock=!0,this}},{key:"enableUpdate",value:function enableUpdate(){return this._updateLock=!1,this}},{key:"resolveTransformType",value:function resolveTransformType(){this._transformType=function getValidTransform(context){return helpers_resolveInvalidTransformType(context)||context.config().transform.type}(this)}},{key:"transformType",value:function transformType(){return this._transformType}},{key:"render",value:function render(){return this}},{key:"elemType",value:function elemType(){return"g"}},{key:"remove",value:function remove(){var _this$metaInf4=this.metaInf(),namespace=_this$metaInf4.namespace,parentNamespace=_this$metaInf4.parentNamespace,store=this.store();store.removeSubNamespace(namespace,BaseLayer.formalName());var unitDom=store.get("".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".domain"))[parentNamespace];return unitDom&&delete unitDom[namespace],renderer_utils_selectElement(this.mount()).remove(),this}},{key:"cachePoint",value:function cachePoint(key,data){if(null===key)return this;var pointMap=this._pointMap;return!pointMap[key]&&(pointMap[key]=[]),pointMap[key].push(data),this}},{key:"dataProps",value:function dataProps(){return arguments.length?(this._dataProps=arguments.length<=0?void 0:arguments[0],this):this._dataProps}},{key:"getIdentifiersFromData",value:function getIdentifiersFromData(data){var schema=this.data().getSchema(),fieldsConfig=this.data().getFieldsConfig(),identifiers=[[],[]],_this$encodingFieldsI=this.encodingFieldsInf(),xFieldType=_this$encodingFieldsI.xFieldType,yFieldType=_this$encodingFieldsI.yFieldType,xField=_this$encodingFieldsI.xField,yField=_this$encodingFieldsI.yField,_map2=base_layer_slicedToArray([xFieldType,yFieldType].map(function(type){return type===dist_datamodel.FieldType.MEASURE}),2),xMeasure=_map2[0],yMeasure=_map2[1];if(schema.forEach(function(d,i){var name=d.name;fieldsConfig[name].def.type===dist_datamodel.FieldType.DIMENSION&&(identifiers[0].push(name),identifiers[1].push(data[i]))}),xMeasure&&yMeasure){var _identifiers$,_identifiers$2,xMeasureIndex=fieldsConfig[xField].index,yMeasureIndex=fieldsConfig[yField].index;(_identifiers$=identifiers[0]).push.apply(_identifiers$,[xField,yField]),(_identifiers$2=identifiers[1]).push.apply(_identifiers$2,[data[xMeasureIndex],data[yMeasureIndex]])}return identifiers}},{key:"hasPlotSpan",value:function hasPlotSpan(){return!1}},{key:"getPlotSpan",value:function getPlotSpan(){return{x:0,y:0}}},{key:"getPlotPadding",value:function getPlotPadding(){return{x:0,y:0}}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){var _ref,fieldNames,values,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},getAllAttrs=config.getAllAttrs,getBBox=config.getBBox;if(!this.data())return[];if(identifiers instanceof datamodel_default.a){var dataObj=identifiers.getData();fieldNames=dataObj.schema.map(function(d){return d.name}),values=dataObj.data}else fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length);var points=this._points,fieldsConfig=this.data().getFieldsConfig(),filteredPoints=(_ref=[]).concat.apply(_ref,base_layer_toConsumableArray(points)).filter(function(point){var source=point.source,rowId=point.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})});return getAllAttrs?filteredPoints:filteredPoints.map(function(d){var obj=clone(d);if(getBBox){var update=obj.update||obj;if(void 0!==obj.size){var sizeVal=2*Math.sqrt(obj.size/Math.PI);update.width=sizeVal,update.height=sizeVal,update.x-=sizeVal/2,update.y-=sizeVal/2}else void 0===update.width&&(update.width=2),void 0===update.height&&(update.height=2)}return obj.update||obj}).sort(function(a,b){return a.y-b.y})}},{key:"getTransformedDataFromIdentifiers",value:function getTransformedDataFromIdentifiers(identifiers){var measureIndex,enc,_identifiers$getData=identifiers.getData(),identifierData=_identifiers$getData.data,identifierSchema=_identifiers$getData.schema,normalizedData=this._normalizedData,fieldsConfig=this.data().getFieldsConfig(),_this$encodingFieldsI2=this.encodingFieldsInf(),yField=_this$encodingFieldsI2.yField,xField=_this$encodingFieldsI2.xField,yFieldType=_this$encodingFieldsI2.yFieldType;_this$encodingFieldsI2.xFieldType===dist_datamodel.FieldType.MEASURE?(measureIndex=fieldsConfig[xField].index,enc="x"):yFieldType===dist_datamodel.FieldType.MEASURE&&(measureIndex=fieldsConfig[yField].index,enc="y");var transformedData=[];return normalizedData.forEach(function(dataArr){dataArr.forEach(function(dataObj){var tupleArr=dataObj.source;if(identifierSchema.every(function(obj,i){return-1!==identifierData.findIndex(function(d){return tupleArr[fieldsConfig[obj.name].index]===d[i]})})){var transformedVal=dataObj[enc],row=dataObj.source,tuple={};for(var key in fieldsConfig){var index=fieldsConfig[key].index;tuple[key]=row[index],index===measureIndex&&(tuple[key]=transformedVal)}transformedData.push(tuple)}})}),[transformedData,this.data().getSchema()]}},{key:"getPlotElementsFromSet",value:function getPlotElementsFromSet(set){for(var graphicElems=this._graphicElems,elems=[],i=0,len=set.length;i2&&void 0!==arguments[2]?arguments[2]:{},dataPoint=renderer_utils_selectElement(config.event.target).data()[0];if(isSimpleObject(dataPoint)){var source=dataPoint.source,rowId=dataPoint.rowId;return{id:this.getIdentifiersFromData(source,rowId),layerId:this.id()}}return null}},{key:"translatePoints",value:function translatePoints(data){var _this2=this,_this$axes=this.axes(),angle=_this$axes.angle,colorAxis=_this$axes.color,radiusAxis=_this$axes.radius,pieIndex={},prevData=this._points[0]||[],points=[],angleV={};return this._prevPieData={},prevData.forEach(function(e,index){_this2._prevPieData[e.rowId]=[e,index],pieIndex[e.index]=e}),data.forEach(function(d,i){var angles=angle.getScaleValue(d.angle);if(angles){!angleV[d.angle]&&(angleV[d.angle]=0);var _angles=angles[angleV[d.angle]++],startAngle=_angles.startAngle,endAngle=_angles.endAngle,uid=d.rowId,resolvedEncodings=helpers_resolveEncodingValues({values:{radius:radiusAxis.getOuterRadius(d.radius),radius0:radiusAxis.getInnerRadius(d.radius0),color:colorAxis.getColor(d.color),angle0:startAngle,angle:endAngle,startAngle:startAngle,endAngle:endAngle,startAngle0:startAngle,endAngle0:endAngle},data:d},i,data,_this2),color=resolvedEncodings.color;points.push({source:d.source,index:i,enter:{},update:{angle0:resolvedEncodings.angle0,angle:resolvedEncodings.angle,radius0:resolvedEncodings.radius0,radius:resolvedEncodings.radius},color:color,meta:getColorMetaInf({fill:color},colorAxis),rowId:uid,_previousInfo:_this2._prevPieData[uid]?_this2._prevPieData[uid][0]:function getPreviousPoint(prevData,currIndex,context){var prevArc=prevData[currIndex-1],nextArc=prevData[currIndex],_context$axes$angle$r2=arc_helper_slicedToArray(context.axes().angle.range(),2),startAngle=_context$axes$angle$r2[0],endAngle=_context$axes$angle$r2[1];return prevArc&&nextArc?{update:{angle0:getObjProp(prevArc,"update","angle"),angle:getObjProp(nextArc,"update","angle0")}}:nextArc?{update:{angle0:(startAngle-90)*Math.PI*2/360,angle:(startAngle-90)*Math.PI*2/360}}:{update:{angle0:(endAngle-90)*Math.PI*2/360,angle:(endAngle-90)*Math.PI*2/360}}}(pieIndex,i,_this2)})}}),points}},{key:"render",value:function render(container){var _this3=this,measurement=this.measurement(),_this$config=this.config(),classPrefix=_this$config.classPrefix,defClassName=_this$config.defClassName,cornerRadius=_this$config.cornerRadius,padAngle=_this$config.padAngle,padRadius=_this$config.padRadius,transition=_this$config.transition,qualClassName=getQualifiedClassName(defClassName,this.id(),classPrefix),path=this._arcFn=arc_arc().cornerRadius(cornerRadius).startAngle(function(d){return d.update.angle0+Math.PI/2}).endAngle(function(d){return d.update.angle+Math.PI/2}).padAngle(padAngle).padRadius(padRadius).outerRadius(function(d){return d.update.radius}).innerRadius(function(d){return d.update.radius0});this._points=this._normalizedData.map(function(arr){return _this3.translatePoints(arr)});var graphicElems=this._graphicElems={},g=makeElement(renderer_utils_selectElement(container),"g",this._points,"".concat(qualClassName[0],"-group")).classed("".concat(qualClassName[1],"-group"),!0).attr("transform","translate(".concat(measurement.width/2,",\n ").concat(measurement.height/2,")")),consecutiveExits=[],exitCounter=0;return makeElement(g,"g",function(d){return d},"".concat(qualClassName[0]),{update:function tween(elem){makeElement(elem,"path",function(d){return[d]},"".concat(qualClassName[0],"-path")).style("fill",function(d){return d.color}).each(function(d){graphicElems[d.rowId]=renderer_utils_selectElement(this)}).transition().duration(transition.duration).on("end",_this3.registerAnimationDoneHook()).attrTween("d",function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return function tweenPie(path,b){var datum=b[0];return function(t){return path(common_utils_interpolator()(datum._previousInfo,datum)(t))}}(path,params)}).attr("class",function(d,i){var individualClass=getIndividualClassName(d,i,_this3._points,_this3);return"".concat(qualClassName[0],"-path ").concat(qualClassName[1],"-path-").concat(d.index,"\n ").concat(individualClass)})},exit:function tweenExit(elem,d){var exitArr=consecutiveExits[exitCounter],oldExitCounter=exitCounter;exitArr?exitArr[exitArr.length-1].datum.index===d.index-1?exitArr.push({elem:elem,datum:d}):exitCounter++:exitArr=[{elem:elem,datum:d}],consecutiveExits[oldExitCounter]=exitArr}}).attr("class",function(d,i){return"".concat(qualClassName[0]," ").concat(qualClassName[1],"-").concat(i)}),function tweenExitPie(consecutiveExits,transition,path){consecutiveExits.length>0&&consecutiveExits.forEach(function(consecutiveExitArr){var startAngle=consecutiveExitArr[0].datum.update.angle0,endAngle=consecutiveExitArr[consecutiveExitArr.length-1].datum.update.angle,mid=2*Math.PI*startAngle/(2*Math.PI+startAngle-endAngle);consecutiveExitArr.forEach(function(e){var elem=e.elem,datum=e.datum;elem.each(function(){var gElem=renderer_utils_selectElement(this);gElem.selectAll("path").transition().duration(transition.duration).attrTween("d",function(){return function(t){return path(common_utils_interpolator()(datum,{update:{angle0:mid,angle:mid,radius:datum.radius,radius0:datum.radius0}})(t))}}).remove(),gElem.remove()})})})}(consecutiveExits,transition,path),this}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){if(!this.data())return[];var fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length),pieSlices=renderer_utils_selectElement(this.mount()).selectAll("path").data(),fieldsConfig=this.data().getFieldsConfig(),pieSliceInf=pieSlices.filter(function(tData){var source=tData.source,rowId=tData.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})})[0];if(pieSliceInf){var measurement=this.measurement(),centroid=this._arcFn.centroid(pieSliceInf);return[{x:centroid[0]+measurement.width/2,y:centroid[1]+measurement.height/2,width:2,height:2}]}return[]}}],[{key:"defaultConfig",value:function defaultConfig(){return arc_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"arc"}}]),ArcLayer}(),text_renderer=function drawText(container,data,config,layerInst){var selection=renderer_utils_selectElement(container).selectAll("g").data(data),smartLabel=layerInst._dependencies.smartLabel,graphicElems=layerInst._graphicElems,selectionMerge=selection.enter().append("g").each(function(dataObj){renderer_utils_setAttrs(this,dataObj.enter)}).merge(selection),style=renderer_utils_getSmartComputedStyle(renderer_utils_selectElement(container),config.className),fontSize=parseInt(style.fontSize,10);return smartLabel.setStyle(style),selectionMerge.each(function(dataObj){var element=renderer_utils_selectElement(this);graphicElems[dataObj.rowId]=element;var backgroundVal,update=dataObj.update,text=dataObj.text,color=dataObj.color,textanchor=dataObj.textanchor,textStyle=dataObj.style,background=dataObj.background;if(backgroundVal=background.value){var diff,backgroundPadding=background.padding,_smartLabel$getOriSiz=smartLabel.getOriSize(dataObj.text),width=_smartLabel$getOriSiz.width,height=_smartLabel$getOriSiz.height,backgroundEl=makeElement(element,"rect",[1]);diff="end"===textanchor?width:"start"===textanchor?0:width/2,renderer_utils_setAttrs(backgroundEl.node(),{x:update.x-diff-backgroundPadding/2,y:update.y-fontSize-backgroundPadding/2,width:width+backgroundPadding,height:height+backgroundPadding}),background&&renderer_utils_setStyles(backgroundEl,{background:backgroundVal})}var textEl=makeElement(element,"text",function(d){return[d]}).text(text),textNode=textEl.node();textStyle&&renderer_utils_setStyles(textNode,textStyle),color&&renderer_utils_setStyles(textNode,{fill:color}),dataObj.className&&textEl.classed(dataObj.className,!0),renderer_utils_setAttrs(textNode,update),textEl.attr("text-anchor",textanchor),textEl.attr("alignment-baseline",dataObj["alignment-baseline"]),textEl.attr("transform","rotate(".concat(dataObj.rotation," ").concat(update.x," ").concat(update.y,")"))}),selection.exit().remove(),selection},text_default_config_defaultConfig={defClassName:"layer-text",classPrefix:"muze",className:"",transform:{type:"identity"},interaction:{highlight:[{type:"fill",intensity:[0,0,-15,0]}],fade:[{type:"fill",intensity:[0,0,15,0]}],focus:[{type:"fill",intensity:[0,0,15,0]}]},transition:{effect:"cubic",duration:1e3},encoding:{color:{},size:{},radius:{},angle:{},text:{value:"",formatter:function formatter(val,i,data,context){return context.valueParser()(val)},background:{padding:10}},rotation:{value:0},"alignment-baseline":{value:"middle"}},states:{highlight:{className:"".concat("muze","-layer-text-highlight")},fadeout:{className:"".concat("muze","-layer-text-fadeout")},selected:{className:"".concat("muze","-layer-text-selected")}}};__webpack_require__(18);function text_typeof(obj){return(text_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function text_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var _this=this,config=this.config(),normalizedData=this._normalizedData,className=config.className,qualifiedClassName=getQualifiedClassName(config.defClassName,this.id(),config.classPrefix);return renderer_utils_selectElement(container).classed("".concat(qualifiedClassName.join(" ")," ").concat(className),!0),this._graphicElems={},renderer_utils_createElements({data:normalizedData,append:"g",selector:"g",container:container,each:function each(dataArr,group){var node=group.node(),points=_this.translatePoints(dataArr,{},_this);renderer_utils_setStyles(node,{"text-anchor":"middle"}),text_renderer(node,points,{className:qualifiedClassName[0]},_this)}}),this}}],[{key:"defaultConfig",value:function defaultConfig(){return text_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"text"}}]),TextLayer}(),point_renderer=function drawSymbols(params){var layer=params.layer,container=params.container,points=params.points,transition=params.transition,className=params.className,duration=transition.duration,effect=transition.effect,disabled=transition.disabled,mount=renderer_utils_selectElement(container),graphicElems=layer._graphicElems;return mount.attr("class",className),makeElement(mount,"g",points,null,{enter:function enter(group,d){var enter=d.enter;group.attr("transform","translate(".concat(enter.x,",").concat(enter.y,")"))},update:function update(group,d){!function createShape(d,groupElement){var shape=d.shape,size=d.size,update=d.update;if(shape instanceof Promise)shape.then(function(res){d.shape=res,createShape(d,groupElement)});else if(shape instanceof Element){var newShape=shape.cloneNode(!0);if("img"===newShape.nodeName.toLowerCase()){var src=newShape.src||newShape.href;(newShape=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("href",src)}var shapeElement=renderer_utils_selectElement(newShape);"path"===newShape.nodeName||"image"===newShape.nodeName?shapeElement.attr("transform","scale(".concat(size/100,")")):(shapeElement.attr("height",size),shapeElement.attr("width",size)),shapeElement.attr("x",-size/2),shapeElement.attr("y",-size/2),makeElement(groupElement,function(){return newShape},[1])}else if("string"==typeof shape){var pathStr;pathStr=function checkPath(str){return!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(str)&&/[\dz]$/i.test(str)&&str.length>4)}(shape)?shape:common_utils_getSymbol(shape).size(size)(update),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}else d.shape="circle",createShape(d,groupElement)}(d,group),graphicElems[d.rowId]=group;var update=d.update,style=d.style;objectIterator(style,function(key){return group.style(key,style[key])}),group.attr("class",className),group.classed(d.className,!0),disabled||(group=group.transition().duration(transition.duration).on("end",layer.registerAnimationDoneHook())),group.attr("transform","translate(".concat(update.x,",").concat(update.y,")"))},exit:function exit(exitGroup){disabled?exitGroup.remove():exitGroup.transition().ease(easeFns[effect]).duration(duration).on("end",function(){return exitGroup.remove()}).style("fill-opacity",0).style("stroke-opacity",0)}},params.keyFn)},point_default_config_defaultConfig={defClassName:"layer-point",className:"",classPrefix:"muze",defColorStyle:"stroke",interaction:{highlight:[{type:"stroke",intensity:[0,0,0,1]}],fade:[{type:"fill",intensity:[0,0,20,0]}],focus:[{type:"fill",intensity:[0,0,20,0]}]},innerPadding:.1,nearestPointThreshold:10,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},encoding:{size:{value:30},color:{},stroke:{value:"hsla(0,0%,0%,0)"},fill:{},shape:{value:"circle"},x:{},y:{},strokeOpacity:{value:.5},fillOpacity:{value:.5}},shapes:["circle","cross","diamond","square","star","wye","triangle"],sizes:[20,30,40,50,60,70]};__webpack_require__(19);function point_typeof(obj){return(point_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function point_toConsumableArray(arr){return function point_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},points=[],encoding=this.config().encoding,axes=this.axes(),x=encoding.x,y=encoding.y,xField=x.field,yField=y.field,sizeAxis=axes.size,shapeAxis=axes.shape,fieldsConfig=this.data().getFieldsConfig(),isXDim=fieldsConfig[xField]&&fieldsConfig[xField].def.type===dist_datamodel.FieldType.DIMENSION,isYDim=fieldsConfig[yField]&&fieldsConfig[yField].def.type===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=this.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,stroke=encoding.stroke.value,_loop=function _loop(i,len){var d=data[i],size=sizeAxis.getSize(d.size),shape=shapeAxis.getShape(d.shape),_map2=point_slicedToArray([ENCODING.X,ENCODING.Y].map(function(type){var value=null===d[type]?void 0:d[type],measure=type===ENCODING.X?measurement.width:measurement.height;return encoding[type].field?axes[type].getScaleValue(value):measure/2}),2),xPx=_map2[0],yPx=_map2[1];xPx+=offsetX,yPx+=offsetY;var color=colorAxis.getColor(d.color),resolvedEncodings=helpers_resolveEncodingValues({values:{x:xPx,y:yPx,color:color,shape:shape,size:size,data:d},data:d},i,data,_this2),style={fill:color=resolvedEncodings.color,stroke:stroke},pos={x:resolvedEncodings.x,y:resolvedEncodings.y};if(!isNaN(xPx)&&!isNaN(yPx)){var point={enter:pos,update:pos,shape:resolvedEncodings.shape,size:Math.abs(resolvedEncodings.size),meta:getColorMetaInf(style,colorAxis),style:style,source:d.source,rowId:d.rowId};point.className=getIndividualClassName(d,i,data,_this2),points.push(point),_this2.cachePoint(d[key],point)}},i=0,len=data.length;i=update.x&&x<=update.width+update.x&&y>=update.y&&y<=update.height+update.y){pointFound=point;break}pointFound=null}var values=pointFound&&pointFound.source;return values&&(identifiers=this.getIdentifiersFromData(values,pointFound.rowId)),pointFound?{dimensions:[pointFound.update],id:identifiers,layerId:this.id()}:pointFound}},{key:"getPlotSpan",value:function getPlotSpan(){return this._plotSpan}},{key:"hasPlotSpan",value:function hasPlotSpan(){return!0}}],[{key:"formalName",value:function formalName(){return"bar"}},{key:"defaultConfig",value:function defaultConfig(){return bar_default_config_defaultConfig}},{key:"defaultPolicy",value:function defaultPolicy(conf,userConf){var config=base_layer_BaseLayer.defaultPolicy(conf,userConf),colorField=config.encoding.color.field,transform=config.transform;return colorField&&(transform.groupBy=colorField),config}}]),BarLayer}(),tick_default_config_defaultConfig={defClassName:"layer-tick",className:"",classPrefix:"muze",interaction:{highlight:[{type:"stroke",intensity:[0,0,-15,0]}],fade:[{type:"stroke",intensity:[0,0,15,0]}],focus:[{type:"stroke",intensity:[0,0,15,0]}]},innerPadding:.1,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},interpolate:"linear",encoding:{color:{},x:{},y:{},x0:{},y0:{},radius:{},radius0:{},angle:{},angle0:{},strokeOpacity:{value:.5},fillOpacity:{value:.5}},states:{highlight:{className:"".concat("muze","-layer-tick-highlight")},fadeout:{className:"".concat("muze","-layer-tick-fadeout")},selected:{className:"".concat("muze","-layer-tick-selected")}}},tick_renderer_line=Symbols.line,tick_renderer=function(params){var points=params.points,container=params.container,keyFn=params.keyFn,className=params.className,interpolate=params.interpolate,layer=params.layer,mount=renderer_utils_selectElement(container),ticks=mount.selectAll("path").data(points,keyFn),ticksEnter=ticks.enter().append("path"),graphicElems=layer._graphicElems;return mount.attr("class",className||""),ticksEnter.each(function(d){var selection=renderer_utils_selectElement(this),enter=d.enter||{};Object.entries(enter).forEach(function(attr){return!isNaN(attr[1])&&selection.attr(attr[0],attr[1])})}),ticks.exit().remove(),ticks.merge(ticksEnter).each(function(d){var selection=renderer_utils_selectElement(this);graphicElems[d.rowId]=selection;var update=d.update,updateStyle=d.style||{},x0=void 0!==update.x0?update.x0:update.x,y0=void 0!==update.y0?update.y0:update.y,curveInterpolatorFn=pathInterpolators[interpolate],linepath=tick_renderer_line().curve(curveInterpolatorFn).x(function(e){return e[0]}).y(function(e){return e[1]});d.className&&selection.classed(d.className,!0),selection.attr("d",linepath([[update.x,update.y],[x0,y0]])),Object.entries(updateStyle).forEach(function(styleObj){return selection.style(styleObj[0],styleObj[1])})})};__webpack_require__(21);function tick_typeof(obj){return(tick_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tick_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];for(var layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],radiusAxis=axes.radius,angleAxis=axes.angle,angle0Axis=axes.angle0,measurement=layerInst.measurement(),colorAxis=axes.color,angleV={},angle0V={},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],_getAxesScales=helpers_getAxesScales(axes),xAxis=_getAxesScales.xAxis,yAxis=_getAxesScales.yAxis,_layerInst$encodingFi=layerInst.encodingFieldsInf(),xField=_layerInst$encodingFi.xField,yField=_layerInst$encodingFi.yField,x0Field=_layerInst$encodingFi.x0Field,y0Field=_layerInst$encodingFi.y0Field,xFieldType=_layerInst$encodingFi.xFieldType,yFieldType=_layerInst$encodingFi.yFieldType,isXDim=xFieldType===dist_datamodel.FieldType.DIMENSION,isYDim=yFieldType===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_config$span=config.span,xSpan=_config$span.x,ySpan=_config$span.y,i=0,len=data.length;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];var layerRegistry=factoryObj._layerRegistry,instances=(layerDef=layerDef instanceof Array?layerDef:[layerDef]).map(function(layerObj){var layerConstructor=layerRegistry[layerObj.mark];return layerConstructor.create.apply(layerConstructor,params)});return 1===instances.length?instances[0]:instances},getLayerClass:function getLayerClass(mark){return factoryObj._layerRegistry[mark]},composeLayers:function composeLayers(layerType,layerDefs){compositeLayers[layerType]=layerDefs},sanitizeLayerConfig:function sanitizeLayerConfig(layerDef){var newConf=mergeRecursive({},layerDef);return sanitizeEncoding(newConf.encoding),newConf}};return factoryObj}();function defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _CONFIG$ROWS$COLUMNS$,DEFAULT_LAYERS=(defaults_defineProperty(_DEFAULT_LAYERS={},layer_types_AREA_LAYER,area_AreaLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_ARC_LAYER,arc_ArcLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_LINE_LAYER,line_LineLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TEXT_LAYER,text_TextLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_POINT_LAYER,point_PointLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TICK_LAYER,tick_TickLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BAR_LAYER,bar_BarLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BASE_LAYER,base_layer_BaseLayer),_DEFAULT_LAYERS),muze_package=__webpack_require__(6);function visual_group_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var local_options=(visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$={},"config",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,ROWS,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,COLUMNS,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_COLOR,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_SHAPE,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_SIZE,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"detail",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"layers",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"transform",{}),_CONFIG$ROWS$COLUMNS$);function simple_group_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{},innerRadius=config.innerRadius,outerRadius=config.outerRadius;return[innerRadius||0,outerRadius||Math.min(height,width)/2]}(context.width(),context.height()))})},helper_isXandYMeasures=function isXandYMeasures(context){var _context$fields=context.fields(),_map2=src_helper_slicedToArray([_context$fields.x,_context$fields.y].map(function(fields){return fields.every(function(field){return field.type()===dist_datamodel.FieldType.MEASURE})}),2),xMeasures=_map2[0],yMeasures=_map2[1];return xMeasures&&yMeasures},getKey=function getKey(arr,row){for(var key=row[arr[0]],i=1,len=arr.length;i=0?axisInf[key]:axisArr.length-1;axes[key]&&(axesObj[key]=defaultValue(axes[key][axisIndex]))}}),Object.keys(axesObj).length&&layer.axes(axesObj)})}(axesVal,layers,layerAxisIndexVal),context._lifeCycleManager.notify({client:layers,action:"updated",formalName:"layer"}))}}];function src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var src_props_PROPS=(src_props_defineProperty(_PROPS={},"facetByFields",{}),src_props_defineProperty(_PROPS,"retinalFields",{}),src_props_defineProperty(_PROPS,"parentAlias",{}),src_props_defineProperty(_PROPS,"cachedData",{}),src_props_defineProperty(_PROPS,"detailFields",{}),src_props_defineProperty(_PROPS,"axes",{defaultValue:{x:[],y:[]}}),src_props_defineProperty(_PROPS,"fields",{defaultValue:{x:[],y:[]},sanitization:function sanitization(context,value){return mergeRecursive({x:[],y:[]},value)}}),src_props_defineProperty(_PROPS,"metaInf",{}),src_props_defineProperty(_PROPS,"registry",{}),src_props_defineProperty(_PROPS,"parentContainerInf",{}),src_props_defineProperty(_PROPS,"valueParser",{defaultValue:function defaultValue(val){return val}}),src_props_defineProperty(_PROPS,"coord",{}),_PROPS);function payload_generator_toConsumableArray(arr){return function payload_generator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{},payload=config.payload,selectionSet=config.selectionSet,propagationFieldInf=config.propagationFields[action]||{},propagationFields=propagationFieldInf.fields||[],append=propagationFieldInf.append,criteria=payload.criteria,context=instance.context,dataModel=context.cachedData()[0],sourceId=context.id(),sideEfffects=instance.sideEffects(),behaviourEffectMap=instance._behaviourEffectMap,mergedModel=selectionSet.mergedEnter.model,fieldsConfig=dataModel.getFieldsConfig();payload.sourceUnit=sourceId,payload.action=action,payload.sourceCanvas=context.parentAlias();var propagationBehaviour=instance._propagationBehaviourMap[action]||action,propFields=[];null===criteria?propagationData=null:isSimpleObject(criteria)?(propFields=Object.keys(criteria||{}),propagationData=mergedModel?mergedModel.project(propFields):null):(propFields=criteria[0],propagationData=mergedModel?mergedModel.project(propFields):null);var facetByFields=context.facetByFields();if(null!==propagationData&&propagationFields.length){var fields=propagationData.getData().schema.map(function(d){return d.name});propagationData=function getModelWithFacetData(dm,data){var dataObj=dm.getData(),schema1=dataObj.schema,data1=dataObj.data,jsonData=[],derivedSchema=data[0].map(function(d){return{name:"".concat(d),type:dist_datamodel.FieldType.DIMENSION,subtype:d.subtype()}}),dataAtFirstPos=data[1];return data1.forEach(function(d){var tuple={};schema1.forEach(function(obj,i){tuple[obj.name]=d[i]}),derivedSchema.forEach(function(obj,i){tuple[obj.name]=dataAtFirstPos[i]}),jsonData.push(tuple)}),new datamodel_default.a(jsonData,[].concat(data_propagator_toConsumableArray(schema1),data_propagator_toConsumableArray(derivedSchema)))}(propagationData,facetByFields),propFields=append?[].concat(data_propagator_toConsumableArray(fields),data_propagator_toConsumableArray(propagationFields)):propagationFields,propagationData=propagationData.project(propFields)}var propagateInterpolatedValues=!1;propFields.length&&propFields.every(function(field){return fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.MEASURE})&&(propagateInterpolatedValues=!0);var groupId=context.parentAlias();payload.action=action;var behaviourInstance=instance._actions.behavioural[propagationBehaviour],isMutableAction=!!behaviourInstance&&behaviourInstance.constructor.mutates(),filterFn=function filterFn(entry,propagationConf){var effects=behaviourEffectMap[entry.config.action],mutates=!entry.config.groupId||effects.some(function(d){return sideEfffects[d.name||d].constructor.mutates()});return entry.config.groupId!==propagationConf.groupId&&mutates},sourceBehaviour=instance._actions.behavioural[action],mutates=!!sourceBehaviour&&sourceBehaviour.constructor.mutates(),propConfig={payload:payload,action:action,criteria:propagationData,isMutableAction:mutates,propagateInterpolatedValues:propagateInterpolatedValues,groupId:groupId,sourceId:mutates?groupId:sourceId,filterFn:filterFn,enabled:function enabled(propConf,firebolt){return action===propagationBehaviour||propConf.payload.sourceCanvas===firebolt.context.parentAlias()}};dataModel.propagate(propagationData,propConfig,!0),action!==propagationBehaviour&&(propConfig={payload:payload,sourceId:isMutableAction?groupId:sourceId,criteria:propagationData,isMutableAction:isMutableAction,propagateInterpolatedValues:propagateInterpolatedValues,action:propagationBehaviour,groupId:groupId,applyOnSource:action===propagationBehaviour,enabled:function enabled(propConf,firebolt){return propConf.payload.sourceCanvas!==firebolt.context.parentAlias()},filterFn:filterFn},dataModel.propagate(propagationData,propConfig,!0,{filterImmutableAction:function filterImmutableAction(actionInf,propInf){return actionInf.groupId!==propInf.groupId}}))};function src_firebolt_typeof(obj){return(src_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function src_firebolt_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},points=[],parsedIdentifiers=identifiers;if(null===identifiers)return[];var layers=this.layers(),len=layers.length;isSimpleObject(identifiers)&&(parsedIdentifiers=[Object.keys(identifiers)],parsedIdentifiers=[].concat(visual_unit_toConsumableArray(parsedIdentifiers),visual_unit_toConsumableArray(function transposeArray(arr){return arr[0].map(function(col,i){return arr.map(function(row){return row[i]})})}(Object.values(identifiers)))));for(var i=0;i0&&(dimensionArr[0]=[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),dimensionArr[1]=[]),{fields:dimensionArr.map(function(list,i){return 1===i?measureArr[i].concat(dimensionArr[i]):dimensionArr[i].concat(measureArr[i])}),dimensions:[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),measures:[].concat(field_sanitizer_toConsumableArray(measureArr[0]),field_sanitizer_toConsumableArray(measureArr[1])),temporal:[].concat(field_sanitizer_toConsumableArray(temporalArr[0]),field_sanitizer_toConsumableArray(temporalArr[1])),categorical:[].concat(field_sanitizer_toConsumableArray(categoricalArr[0]),field_sanitizer_toConsumableArray(categoricalArr[1]))}}(norFields,fields)}),2),rowsInfo=_map2[0],columnsInfo=_map2[1],rows=rowsInfo.fields,rowDimensions=rowsInfo.dimensions,rowMeasures=rowsInfo.measures,rowTemporalFields=rowsInfo.temporal,rowCategoricalFields=rowsInfo.categorical,columns=columnsInfo.fields,columnDimensions=columnsInfo.dimensions,columnMeasures=columnsInfo.measures;return{rows:rows,rowDimensions:rowDimensions,rowMeasures:rowMeasures,rowTemporalFields:rowTemporalFields,rowCategoricalFields:rowCategoricalFields,columns:columns,columnTemporalFields:columnsInfo.temporal,columnCategoricalFields:columnsInfo.categorical,columnDimensions:columnDimensions,columnMeasures:columnMeasures}};function visual_encoder_slicedToArray(arr,i){return function visual_encoder_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function visual_encoder_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function visual_encoder_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function visual_encoder_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},fields=arguments.length>1?arguments[1]:void 0,_getHeaderAxisFrom2=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(ROW,fields.rows,axisFrom),2),rowHeader=_getHeaderAxisFrom2[0],rowAxis=_getHeaderAxisFrom2[1],_getHeaderAxisFrom4=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom("column",fields.columns,axisFrom),2),colHeader=_getHeaderAxisFrom4[0],colAxis=_getHeaderAxisFrom4[1];return this.axisFrom({row:rowAxis,column:colAxis}),this.headerFrom({row:rowHeader,column:colHeader}),this}}]),VisualEncoder}(),scaleMaps={linear:continous_axis_ContinousAxis,band:band_axis_BandAxis,temporal:time_axis_TimeAxis,size:size_axis_SizeAxis,color:color_axis_ColorAxis,shape:shape_axis_ShapeAxis},data_type_scale_map_dataTypeScaleMap={dimension:scale_type_namespaceObject.BAND,categorical:scale_type_namespaceObject.BAND,temporal:scale_type_namespaceObject.TIME,measure:scale_type_namespaceObject.LINEAR,continuous:scale_type_namespaceObject.LINEAR};function encoder_helper_toConsumableArray(arr){return function encoder_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1?axesCreators.position="both":axesCreators.position=_this.axisFrom()[type],geomCellAxes[axis]=encoder_helper_generateAxisFromMap(axis,axisFields[i],axesCreators,{groupAxes:axis===X?xAxes:yAxes,valueParser:resolver.valueParser()},indices,facetFields)}),geomCell.axes(geomCellAxes),geomCellAxes}},{key:"unionUnitDomains",value:function unionUnitDomains(context){for(var store=context.store(),resolver=context.resolver(),units=resolver.units(),domains={0:{},1:{}},config=context.config(),fieldsObj={0:{},1:{}},_loop=function _loop(rIdx,len){for(var unitsArr=units[rIdx],_loop2=function _loop2(cIdx,len2){var unit=unitsArr[cIdx],axisFields=unit.fields(),encodingDomains=unit.getDataDomain();["x","y"].forEach(function(axisType,axisTypeIndex){axisFields[axisType].forEach(function(field,axisIndex){var key=axisTypeIndex?"".concat(rIdx,"0").concat(axisIndex):"0".concat(cIdx).concat(axisIndex),dom=encodingDomains[axisType],typeOfField=field.subtype();fieldsObj[axisTypeIndex][key]=field,dom&&0!==Object.keys(dom).length&&(domains[axisTypeIndex][key]=unionDomain([domains[axisTypeIndex]&&domains[axisTypeIndex][key]||[],dom["".concat(field)]],typeOfField))})})},cIdx=0,len2=unitsArr.length;cIdx1&&typeOfAxis===scale_type_namespaceObject.LINEAR&&axes[0].config().alignZeroLine)axes.forEach(function(axis,i){key=axisType?"".concat(idx,"0").concat(i):"0".concat(idx).concat(i),domain=domains[axisType][key],min[i]=domain[0],max[i]=domain[1]}),adjustedDomain=function getAdjustedDomain(max,min){var y1ratio=max[0]/(max[0]-min[0]),y2ratio=max[1]/(max[1]-min[1]),allSameSign=!1;return min[0]>0&&min[1]>0&&min[1]>0&&max[1]>0&&(allSameSign=!0,min[0]=0,min[1]=0),min[0]<0&&min[1]<0&&min[1]<0&&max[1]<0&&(allSameSign=!0,max[0]=0,max[1]=0),allSameSign||y1ratio===y2ratio||(y1ratiocounter)for(var _i=counter;_i-1&&(projections=[[_facet,_facet]],primaryFacets.splice(_existIndex,1)),secondaryFacets.splice(0,1)}else{var axisFromIndex=primaryFacets.length-1,facet=primaryFacets[axisFromIndex];projections=[[facet]];var existIndex=getIndex(secondaryFacets,facet);existIndex>-1&&(projections=[[facet,facet]],secondaryFacets.splice(existIndex,1)),primaryFacets.splice(axisFromIndex,1)}return{facets:facets=(facets=[].concat(primaryFacets,secondaryFacets)).filter(function(el,index,self){return index===self.findIndex(function(t){return t.toString()===el.toString()})}),projections:projections}}},{key:"fieldSanitizer",value:function fieldSanitizer(datamodel,config){return cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"fieldSanitizer",this).call(this,datamodel,config)}},{key:"getRetinalFieldsDomain",value:function getRetinalFieldsDomain(dataModels,encoding){var groupedModel=dataModels.groupedModel,domains={};for(var key in encoding)if({}.hasOwnProperty.call(encoding,key)){var encodingObj=encoding[key],field=encodingObj.field;if(!encodingObj.domain&&field){var domain=retriveDomainFromData(groupedModel,field);domains[field]=domain}}return domains}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer,i){var def=src_layer_factory.sanitizeLayerConfig(layer);def.order=i,serializedLayers.push(def)}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),layerConfig.push(config)}),layerConfig}},{key:"getLayerConfig",value:function getLayerConfig(fields,userLayerConfig,retinalConfig){var layerConfig=[],columnFields=fields.columnFields,rowFields=fields.rowFields;return columnFields.forEach(function(colField){var colFieldName=colField.toString();rowFields.forEach(function(rowField){var configs=[],rowFieldName=rowField.toString(),encoding={x:{field:colFieldName},y:{field:rowFieldName}},rowFieldType=rowField.subtype(),mark=function getDefaultMark(colFieldType,rowFieldType){return"categorical"===colFieldType||"categorical"===rowFieldType?"bar":"temporal"===colFieldType||"temporal"===rowFieldType?"line":"point"}(colField.subtype(),rowFieldType),defConfigs=[{mark:mark,def:{mark:mark,encoding:encoding}}],layerConfigs=function getLayerConfFromFields(colFields,rowFields,userLayerConfig){return userLayerConfig.filter(function(conf){var _ref,_ref2,_ref3,userConf=conf instanceof Array?conf:[conf],encodingArr=(_ref=[]).concat.apply(_ref,encoder_helper_toConsumableArray(userConf.map(function(d){return d.encoding}).filter(function(d){return void 0!==d})));if(!encodingArr.length)return!0;var xFields=(_ref2=[]).concat.apply(_ref2,encoder_helper_toConsumableArray(encodingArr.map(function(d){return[d.x&&d.x.field,d.x0&&d.x0.field]}))).filter(function(d){return void 0!==d&&null!==d}),yFields=(_ref3=[]).concat.apply(_ref3,encoder_helper_toConsumableArray(encodingArr.map(function(d){return[d.y&&d.y.field,d.y0&&d.y0.field]}))).filter(function(d){return void 0!==d&&null!==d});if(!xFields.length&&!yFields.length)return!0;var colFieldExist=!!xFields.length&&xFields.every(function(d){return-1!==colFields.indexOf(d)}),rowFieldExist=!!yFields.length&&yFields.every(function(d){return-1!==rowFields.indexOf(d)});return xFields.length&&yFields.length?colFieldExist&&rowFieldExist:colFieldExist||rowFieldExist})}(colField.getMembers(),rowField.getMembers(),userLayerConfig||[]);configs=layerConfigs.length?layerConfigs.map(function(layerConf){var mergedLayerConf=mergeRecursive(mergeRecursive({},defConfigs[0].def),layerConf),serializedLayerConfig=src_layer_factory.getSerializedConf(mergedLayerConf.mark,mergedLayerConf);return{mark:mergedLayerConf.mark,order:mergedLayerConf.order,def:serializedLayerConfig}}):defConfigs,layerConfig.push.apply(layerConfig,cartesian_encoder_toConsumableArray(configs))})}),this.sanitizeLayerConfig(retinalConfig,layerConfig)}}],[{key:"type",value:function type(){return cartesian_encoder_CARTESIAN}}]),CartesianEncoder}();function polar_encoder_typeof(obj){return(polar_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function polar_encoder_toConsumableArray(arr){return function polar_encoder_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);icounter)for(var _i=counter;_i0&&(config=mergeRecursive(config,userLayerConfig[0])),layerConfig.push(config)}),0===layerConfig.length&&(layerConfig=userLayerConfig);var sanitizedConfig=this.sanitizeLayerConfig(retinalConfig,layerConfig);return this.layers(sanitizedConfig),sanitizedConfig}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer){var def=src_layer_factory.getSerializedConf(layer.mark,layer);serializedLayers.push({mark:layer.mark,def:def})}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),def.forEach(function(conf){var encoding=conf.encoding||(conf.encoding={});!encoding.angle&&(encoding.angle={});var angleField=getObjProp(encoding.angle,"field"),angle0Field=getObjProp(encoding.angle0,"field");angleField||Object.assign(encoding.angle,{field:encodingConfigs.color&&encodingConfigs.color.field}),angle0Field||(!encoding.angle0&&(encoding.angle0={}),Object.assign(encoding.angle0,{field:encoding.angle.field}))}),layerConfig.push(config)}),layerConfig}}],[{key:"type",value:function type(){return polar_encoder_POLAR}}]),PolarEncoder}();function retinal_encoder_typeof(obj){return(retinal_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function retinal_encoder_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},axisType=axesCreators.axisType,fieldsConfig=axesCreators.fieldsConfig,field=fieldProps.field,axis=[],Cls=scaleMaps[axisType];return fieldProps.type=fieldProps.type?fieldProps.type:group_utils_getAxisType(fieldsConfig,field||null),axis.push(new Cls(fieldProps)),axis}({axisType:axisType,fieldsConfig:fieldsConfig},config[axisType])}),newAxes}},{key:"setCommonDomain",value:function setCommonDomain(context){var domains=context.domains,axes=context.axes,encoding=context.encoding;return Object.entries(encoding).forEach(function(enc){if(enc[1]&&enc[1].field){var encType=enc[0],field=enc[1].field;field&&axes[encType].forEach(function(axis){var domain=domains[field];!enc[1].domain&&axis.updateDomain(domain)})}}),axes}}],[{key:"type",value:function type(){return"retinal"}}]),RetinalEncoder}(),group_utils_this=void 0;function group_utils_slicedToArray(arr,i){return function group_utils_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function group_utils_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function group_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function group_utils_toConsumableArray(arr){return function group_utils_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return"".concat(axisName,"-axis-").concat(params.join("-"))},group_utils_headerCreator=function headerCreator(fields,fieldHeaders,TextCell,_ref2){var classPrefix=_ref2.classPrefix,labelManager=_ref2.labelManager;return fields.length>0?fields[0].map(function(cell,i){return new TextCell({type:"header",className:"".concat(classPrefix,"-grid-headers")},{labelManager:labelManager}).source(function getHeaderText(headers,index,rowLength){var header="";if(index===rowLength-1&&headers.length>rowLength){for(var i=index;i1||right.length>1)&&(borders.top=!0,borders.bottom=!0),borders}(leftRows,rightRows),showColBorders=function getColumnsBorders(top,bottom){var borders={left:!1,right:!1};return(top.length||bottom.length)&&(top[0]&&top[0].length>1||bottom[0]&&bottom[0].length>1)&&(borders.left=!0,borders.right=!0),borders}(topColumns,bottomColumns),showValueBorders=function getValueBorders(rows,columns){var borders={top:!0,left:!0,bottom:!0,right:!0},borderTypeRow=[constants_LEFT,constants_RIGHT],borderTypeCol=["top","bottom"];return rows.forEach(function(e,i){e[0]&&e[0].length?borders[borderTypeRow[i]]=!0:borders[borderTypeRow[i]]=!1}),columns.forEach(function(e,i){e.length?borders[borderTypeCol[i]]=!0:borders[borderTypeCol[i]]=!1}),borders}([leftRows,rightRows],[topColumns,bottomColumns]),valueMatrix.length>1&&(showValueBorders.top=!0,showValueBorders.bottom=!0),valueMatrix.length&&valueMatrix[0].length>1&&(showValueBorders.left=!0,showValueBorders.right=!0),{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}},group_utils_sortFacetFields=function sortFacetFields(facets,keys,config){var schema=[],facetNames=[],sortInfo=[],sortConfig=config.sort;return facets.forEach(function(facet){var name="".concat(facet);facetNames.push(name);var facetSortConfig=sortConfig[name];facetSortConfig?sortInfo.push([name,facetSortConfig]):sortInfo.push([name,null]),schema.push(facet.getSchemaDef())}),new datamodel_default.a([facetNames].concat(group_utils_toConsumableArray(keys)),schema).getData({sort:sortInfo}).data};function matrix_model_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function matrix_model_objectSpread(target){for(var i=1;i0?formattedColKeys[0].map(function(col,i){return formattedColKeys.map(function(row){return row[i]})}):formattedColKeys}};function cell_creator_slicedToArray(arr,i){return function cell_creator_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function cell_creator_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function cell_creator_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function cell_creator_toConsumableArray(arr){return function cell_creator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?rowProjections.length:1):(keys=columnKeys,length=colProjections.length>0?colProjections.length:1),keys=keys.map(function(arr){return arr.map(function(val){return resolver.valueParser()(val)})}),section.length&&headerFrom===type&&axis&&keys.length){var hContext={axis:axis,length:length,type:type},headers=[];index<2?(hContext.keys=keys,hContext.facet=facet.rows,headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)):(hContext.facet=facet.columns,hContext.keys=keys[0].map(function(key,i){return keys.map(function(e){return e[i]})}),headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)),selectionObj["".concat(type,"Headers")]=headers}else selectionObj["".concat(type,"Headers")]=null}),selectionObj},cell_creator_getAxisFields=function getAxisFields(projections){var fieldHolder=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return projections.reduce(function(acc,item){return[].concat(cell_creator_toConsumableArray(acc),cell_creator_toConsumableArray(item.reduce(function(ac,field){return field instanceof simple_var_SimpleVariable?[].concat(cell_creator_toConsumableArray(ac),[field.oneVar()]):ac},[])))},fieldHolder)},cell_creator_transformDataModel=function transformDataModel(dataModel,config,resolver){var groupedModel,fieldsConfig=dataModel.getFieldsConfig(),resolvedData=resolver.data(),groupBy=config.groupBy,suppliedLayers=config.suppliedLayers,facetsAndProjections=config.facetsAndProjections;if(resolvedData instanceof datamodel_default.a&&resolvedData.dispose(),groupedModel=dataModel.project(dataModel.getSchema().map(function(d){return d.name})),resolver.data(groupedModel),!groupBy.disabled){var allFields=function extractFields(facetsAndProjections,layerFields){var _ref6,fields=Object.values(facetsAndProjections).map(function(arr){var _ref4,_ref5,flattenArray=(_ref4=[]).concat.apply(_ref4,group_utils_toConsumableArray(arr));return(_ref5=[]).concat.apply(_ref5,group_utils_toConsumableArray(flattenArray.map(function(field){return field instanceof variable_Variable?field.getMembers():field})))});return(_ref6=[]).concat.apply(_ref6,group_utils_toConsumableArray(fields).concat(group_utils_toConsumableArray(layerFields)))}(facetsAndProjections,function getFieldsFromSuppliedLayers(suppliedLayerConfig,fieldsConfig){var _ref3,fields=[],encodingArr=suppliedLayerConfig.map(function(conf){return conf.encoding||{}});return fields=(fields=[].concat(group_utils_toConsumableArray(fields),[(_ref3=[]).concat.apply(_ref3,group_utils_toConsumableArray(encodingArr.map(function(enc){return Object.values(enc).map(function(d){return d.field})})))])).filter(function(field){return fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION})}(suppliedLayers,groupedModel.getFieldsConfig())),dimensions=allFields.filter(function(field){return getObjProp(fieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),aggregationFns=groupBy.measures,measureNames=Object.keys(groupedModel.getFieldspace().getMeasure()),nearestAggFns=common_utils_retrieveNearestGroupByReducers.apply(void 0,[groupedModel].concat(cell_creator_toConsumableArray(measureNames))),resolvedAggFns=mergeRecursive(nearestAggFns,aggregationFns);groupedModel=groupedModel.groupBy(dimensions.length?dimensions:[""],resolvedAggFns).project(allFields)}return groupedModel=function sortDmTemporalFields(resolver,datamodel){var axisFields=[],projections=resolver.projections();axisFields=cell_creator_getAxisFields(projections.rowProjections,cell_creator_getAxisFields(projections.colProjections));var fieldConfig=datamodel.getFieldsConfig(),temporalFields=axisFields.reduce(function(acc,field){return"temporal"===fieldConfig[field].def.subtype?[].concat(cell_creator_toConsumableArray(acc),[[field]]):acc},[]);return temporalFields.length?datamodel.sort(temporalFields,{saveChild:!0}):datamodel}(resolver,groupedModel)},cell_creator_computeMatrices=function computeMatrices(context,config){var resolver=context.resolver,datamodel=context.datamodel,componentRegistry=context.componentRegistry,encoders=context.encoders,globalConfig=config.globalConfig,selection=config.selection,transform=config.transform,groupBy=globalConfig.autoGroupBy,labelManager=resolver.dependencies().smartlabel,fieldMap=datamodel.getFieldsConfig(),layerConfig=resolver.layerConfig(),registry=resolver.registry(),normalizedRows=resolver.horizontalAxis().fields,normalizedColumns=resolver.verticalAxis().fields,otherEncodings=resolver.optionalProjections(config,layerConfig),facetsAndProjections=resolver.getAllFields(),matrixGnContext={normalizedColumns:normalizedColumns,normalizedRows:normalizedRows,facetsAndProjections:facetsAndProjections,layers:layerConfig,fieldMap:fieldMap,otherEncodings:otherEncodings,encoders:encoders,facet:globalConfig.facet||{},axisFrom:globalConfig.axisFrom||{},selection:selection,resolver:resolver},cells={GeomCell:resolver.getCellDef(registry.GeomCell),AxisCell:resolver.getCellDef(registry.AxisCell),BlankCell:resolver.getCellDef(registry.BlankCell),TextCell:resolver.getCellDef(registry.TextCell)},isRowSizeEqual=group_utils_isDistributionEqual(normalizedRows),isColumnSizeEqual=group_utils_isDistributionEqual(normalizedColumns);resolver.colCells({}),resolver.rowCells({}),resolver.datamodelTransform(transform||{}),resolver.resetSimpleAxes();var newCacheMap={exitCellMap:resolver.cacheMaps().entryCellMap,entryCellMap:new Map};resolver.cacheMaps(newCacheMap);var valueCellContext={config:globalConfig,suppliedLayers:encoders.simpleEncoder.serializeLayerConfig(resolver.layerConfig()),resolver:resolver,cell:cells.GeomCell,encoder:encoders.simpleEncoder,newCacheMap:newCacheMap,detailFields:config.detail,retinalConfig:{color:config.color,size:config.size,shape:config.shape}},groupedModel=cell_creator_transformDataModel(datamodel,{facetsAndProjections:facetsAndProjections,suppliedLayers:valueCellContext.suppliedLayers,groupBy:groupBy},resolver),cellCreator=resolver.valueCellsCreator(valueCellContext),valueMatrixInfo=getMatrixModel(groupedModel,facetsAndProjections,cellCreator,globalConfig);!function removeExitCells(resolver){var _ref7,exitCells=resolver.cacheMaps().exitCellMap,store=resolver.store(),qualifiedStateProps=(_ref7=[]).concat.apply(_ref7,group_utils_toConsumableArray(visual_unit_VisualUnit.getQualifiedStateProps()).concat(group_utils_toConsumableArray(base_layer_BaseLayer.getQualifiedStateProps())));store.lockCommits(qualifiedStateProps),exitCells.forEach(function(placeholder){placeholder.remove()}),store.unlockCommits(qualifiedStateProps)}(resolver),resolver.cacheMaps().exitCellMap.clear(),resolver.valueMatrix(valueMatrixInfo.matrix);var _mutateAxesFromMap=function mutateAxesFromMap(cacheMaps,axes){var xAxes=null,yAxes=null,xAxesMap=cacheMaps.xAxesMap,yAxesMap=cacheMaps.yAxesMap,xAxisSet=axes.x,yAxisSet=axes.y;return xAxisSet&&xAxisSet.forEach(function(axisId){var xAxis=xAxesMap.get(axisId);(xAxes=xAxes||[]).push(xAxis)}),yAxisSet&&yAxisSet.forEach(function(axisId){var yAxis=yAxesMap.get(axisId);(yAxes=yAxes||[]).push(yAxis)}),{xAxes:xAxes,yAxes:yAxes}}(resolver.cacheMaps(),resolver.axes()),xAxes=_mutateAxesFromMap.xAxes,yAxes=_mutateAxesFromMap.yAxes;resolver.axes({x:xAxes,y:yAxes}),resolver.createUnits(componentRegistry,config);var _generateMatrices=function generateMatrices(context,matrices,cells,labelManager){var unitHeight=context.unitHeight,unitWidth=context.unitWidth,facetsAndProjections=context.facetsAndProjections,normalizedRows=context.normalizedRows,normalizedColumns=context.normalizedColumns,selection=context.selection,axisFrom=context.axisFrom,facet=context.facet,encoders=context.encoders,resolver=context.resolver,selectionObj=cell_creator_generatePlaceholders({fields:{rows:normalizedRows,columns:normalizedColumns},matrices:matrices,facetsAndProjections:facetsAndProjections,selection:selection,axisFrom:axisFrom,facet:facet,encoders:encoders,resolver:resolver},cells,labelManager),columnsPrimary=selectionObj.columnsPrimary,columnsSecondary=selectionObj.columnsSecondary,rowsPrimary=selectionObj.rowsPrimary,rowsSecondary=selectionObj.rowsSecondary,leftHeaders=selectionObj.leftHeaders,topHeaders=selectionObj.topHeaders,bottomHeaders=selectionObj.bottomHeaders,rightHeaders=selectionObj.rightHeaders,_map2=cell_creator_slicedToArray([rowsPrimary,rowsSecondary,columnsPrimary,columnsSecondary].map(function(d){return d?d.getObjects():[]}),4),rowPrime=_map2[0],rowSec=_map2[1],colPrime=_map2[2],colSec=_map2[3],_map4=cell_creator_slicedToArray([leftHeaders,rightHeaders].map(function(e){return e?e.getObjects().map(function(f){return f.getObjects()}):[]}),2),leftFacets=_map4[0],rightFacets=_map4[1],rowPriority=rowSec.length?1:-1;rowPrime.length&&rowPriority++;var colPriority=colSec.length?1:-1;colPrime.length&&colPriority++;var leftMatrix=leftFacets.length?leftFacets.map(function(d,i){return rowPrime[i]=rowPrime[i]?[rowPrime[i]]:[],[].concat(cell_creator_toConsumableArray(d),cell_creator_toConsumableArray(rowPrime[i]))}):rowPrime?rowPrime.map(function(d){return[d]}):[],rightMatrix=rowSec.length?rowSec.map(function(d,i){return[d].concat(cell_creator_toConsumableArray(rightFacets[i]||[]))}):rightFacets.length?rightFacets.map(function(d){return cell_creator_toConsumableArray(d)}):[],topMatrix=[];topHeaders&&topHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){topMatrix[i]=topMatrix[i]||[],topMatrix[i].push(x)})});colPrime.length&&topMatrix.push(colPrime);var bottomMatrix=[];colSec.length&&bottomMatrix.push(colSec);var currentBottomLength=bottomMatrix.length;bottomHeaders&&bottomHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){bottomMatrix[i+currentBottomLength]=bottomMatrix[i+currentBottomLength]||[],bottomMatrix[i+currentBottomLength].push(x)})});if(!leftMatrix.length&&!rightMatrix.length){var cell=new cells.BlankCell;cell.setAvailableSpace(unitWidth,unitHeight),leftMatrix=[[cell]]}if(!(topMatrix.length||bottomMatrix.length&&bottomMatrix[0].length)){var _cell=new cells.BlankCell;_cell.setAvailableSpace(unitWidth,unitHeight),bottomMatrix=[[_cell]]}return{rows:[leftMatrix,rightMatrix],columns:[topMatrix,bottomMatrix],selectionObj:selectionObj,colPriority:colPriority,rowPriority:rowPriority}}(matrixGnContext,{valuesMatrix:valueMatrixInfo,axesMatrix:resolver.axes()},cells,labelManager),rows=_generateMatrices.rows,columns=_generateMatrices.columns,selectionObj=_generateMatrices.selectionObj,rowPriority=_generateMatrices.rowPriority,colPriority=_generateMatrices.colPriority;return resolver.rowMatrix(rows),resolver.columnMatrix(columns),{rows:resolver.rowMatrix(),columns:resolver.columnMatrix(),values:resolver.valueMatrix(),isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,priority:{row:rowPriority,col:colPriority},selection:selectionObj,dataModels:{groupedModel:groupedModel,parentModel:datamodel}}},RESOLVER_PROPS={dependencies:{},units:{},datamodelTransform:{},layerConfig:{},matrixLayers:{},colCells:{},rowCells:{},rowMatrix:{},columnMatrix:{},valueMatrix:{},encoder:{},valueParser:{},data:{}};function matrix_resolver_slicedToArray(arr,i){return function matrix_resolver_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function matrix_resolver_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function matrix_resolver_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function matrix_resolver_toConsumableArray(arr){return function matrix_resolver_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?leftRows[0].map(blankCellCreator):[],right:rightRows.length>0?rightRows[0].map(blankCellCreator):[]},_map2=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return topCols.map(function(col,i){return i===topCols.length-1?headers[type]:footers[type]})}),2),topLeft=_map2[0],topRight=_map2[1];if(0===topCols.length){var _map4=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return bottomCols.map(function(col,i){return 0===i?headers[type]:footers[type]})}),2);bottomLeft=_map4[0],bottomRight=_map4[1]}else bottomLeft=bottomCols.map(function(){return leftRows.length>0?leftRows[0].map(blankCellCreator):[]}),bottomRight=bottomCols.map(function(){return rightRows.length>0?rightRows[0].map(blankCellCreator):[]});return lifeCycleManager.notify({client:[topLeft,topRight,bottomLeft,bottomRight],action:"initialized",formalName:"facet-headers"}),{topLeft:topLeft,topRight:topRight,bottomLeft:bottomLeft,bottomRight:bottomRight}}},{key:"getMatrices",value:function getMatrices(datamodel,config,componentRegistry,encoders){return cell_creator_computeMatrices({datamodel:datamodel,componentRegistry:componentRegistry,encoders:encoders,resolver:this},config)}},{key:"store",value:function store(){return arguments.length?(this._store=arguments.length<=0?void 0:arguments[0],this):this._store}},{key:"clear",value:function clear(){var cacheMaps=this._cacheMaps;for(var key in cacheMaps)cacheMaps[key].clear()}}]),MatrixResolver}();function value_matrix_defineProperties(target,props){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{},context=firebolt.context,type=context.constructor.type(),payload=config.payload,data=context.data(),metaData=context.metaData(),fieldType=metaData.getData().schema[0].type,propPayload={},sourceId=context._id;propPayload.action=action_behaviour_map_propagationBehaviourMap[action]||action,propPayload.sideEffects=propagationSideEffects[action],propPayload.sourceCanvas=context.canvasAlias();var isMutableAction=firebolt._actions.behavioural[propPayload.action].constructor.mutates();if(null===payload.criteria)propagationData=null;else{var entrySet=selectionSet.mergedEnter,values=data.filter(function(d){return-1!==entrySet.uids.indexOf(d.id)}).map(function(d){return d.rawVal});if("step"===type||"discrete"===type&&"measure"===fieldType){var field=Object.keys(payload.criteria||{})[0];propagationData=(values=data.filter(function(d){return-1!==entrySet.uids.indexOf(d.id)}).map(function(d){return d.range})).length?metaData.select(function(fields){for(var check=!1,i=0;i=values[i][0]&&fields[field].internalValue<=values[i][1]);i++);return check},{saveChild:!1}):null}else"gradient"===type?propagationData=getDataModelFromRange(metaData,payload.criteria):values.length?propagationData=function assembleModelFromIdentifiers(model,identifiers){var data,schema=[],fieldMap=model.getFieldsConfig();return identifiers.length?function(){for(var fields=identifiers[0],len=fields.length,i=0;i=drawingInfMeasure+offset?[axisScale.invert(drawingInfMeasure+offset-selectionBoxMeasure),axisScale.invert(drawingInfMeasure+offset)]:subjectStartPoint-offset1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-fadeout"),!0),classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)},brighten:function brighten(set){var config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-brighten"),!0),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-brighten"),!1)}}};function legend_highlighter_typeof(obj){return(legend_highlighter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_highlighter_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};(0,this._strategies[options.strategy||this._strategy])(selectionSet,this)}}],[{key:"formalName",value:function formalName(){return"highlighter"}}]),LegendHighlighter}(),legend_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},data:{},fieldName:{},legendContainer:{},measurement:{sanitization:function sanitization(context,value){var measurement=mergeRecursive(context._measurement,value);return["padding","border","margin"].forEach(function(space){measurement[space]=Math.min(measurement[space]>0?measurement[space]:0,.1*measurement.maxWidth,.1*measurement.maxHeight)}),measurement}},logicalSpace:{},metaData:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.resetLogicalSpace(),context.store().commit("range",value),value}},scale:{},smartTicks:{},store:{},title:{sanitization:function sanitization(context,value){return mergeRecursive(context._title||{},value)}},labelManager:{},minTickDistance:{},valueParser:{defaultValue:function defaultValue(val){return val}}},ALIGN_HORIZONTAL="horizontal",ALIGN_VERTICAL="vertical",DEFAULT_MEASUREMENT={height:30,width:30,maxWidth:1/0,maxHeight:1/0,padding:2,margin:2,border:1},LEGEND_TITLE={text:"",orientation:function orientation(pos){return"left"===pos||"right"===pos?"left":"center"}},legend_defaults_DEFAULT_CONFIG={classPrefix:"muze",borderStyle:"solid",borderColor:"rgba(0,0,0,0)",formatter:{bounds:{lower:"less than",upper:"more than"}},item:{text:{orientation:"right",width:10,formatter:function formatter(val,i,data,context){return context.valueParser()(val)}},icon:{className:"legend-icon",height:20,width:20,color:"rgba(0,0,0,.5)",type:"square"}}},defaults_ICON_MAP=function ICON_MAP(icon){return icon&&"string"==typeof icon?common_utils_getSymbol(icon):icon};function legend_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legend_helper_getScaleInfo=function getScaleInfo(scale){var scaleType=scale.constructor.type();return{scaleType:scaleType,domain:scale.uniqueValues(),steps:scale.config().stops||1,scaleFn:SCALE_FUNCTIONS[scaleType]}},legend_helper_getInterpolatedArrayData=function getInterpolatedArrayData(domainForLegend,scaleParams){var requiredWidth,requiredHeight,upperBound=domainForLegend[domainForLegend.length-1],minTickDiff=Math.ceil(domainForLegend[1]-domainForLegend[0]),maxTickDiff=Math.ceil(upperBound-domainForLegend[0]),alignment=scaleParams.alignment,smartLabelCalc=scaleParams.smartLabel,availableSpace=scaleParams.measures,minimumTickSize=scaleParams.minTickDistance,_smartLabelCalc$getOr=smartLabelCalc.getOriSize(upperBound),tickDimHeight=_smartLabelCalc$getOr.height,tickDimWidth=_smartLabelCalc$getOr.width;return Number.isInteger(upperBound)||(upperBound=upperBound.toFixed(2)),minTickDiff=minTickDiff<1?1:minTickDiff,requiredWidth=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*(tickDimWidth+minimumTickSize.width),requiredWidth-=Math.abs(maxTickDiff),requiredHeight=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*tickDimHeight,requiredHeight-=Math.abs(maxTickDiff),domainForLegend=function getcomputedArray(computationhelper,requiredMeasure,availableMeasure,domainForLegend){var currentTickValue,nextTickValue,upperBound=domainForLegend[domainForLegend.length-1],param=computationhelper.measureParam,smartLabelCalc=computationhelper.smartLabelCalc,pixelPerTick=availableMeasure[param]/upperBound;if(availableMeasure[param]>=requiredMeasure[param])return domainForLegend;currentTickValue=smartLabelCalc.getOriSize(domainForLegend[0])[param];for(var i=1;i0?titleSpace.height+effPadding:0,titleWidth=titleSpace.width+effPadding,labelSpaces=this.getLabelSpaces(effPadding,align),_computeItemSpaces=function computeItemSpaces(config,measures,data){var totalHeight=0,totalWidth=0,maxItemSpaces={width:0,height:0},effPadding=measures.effPadding,titleWidth=measures.titleWidth,labelSpaces=measures.labelSpaces,titleHeight=measures.titleHeight,maxWidth=measures.maxWidth,item=config.item,align=config.align,icon=item.icon,textOrientation=item.text.orientation,itemSpaces=[],iconSpaces=[],maxIconWidth=0;return labelSpaces.forEach(function(labelSpace,i){var itemSpace={width:0,height:0},iconSpace={width:0,height:0},datum=data[i]||{};"left"===textOrientation||"right"===textOrientation?(labelSpace.width+=effPadding,iconSpace.width=(datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),itemSpace.width=labelSpace.width+maxIconWidth,labelSpace.height=Math.max(labelSpace.height,icon.height)+effPadding,iconSpace.height=labelSpace.height,itemSpace.height=labelSpace.height):(labelSpace.width=Math.max(labelSpace.width,datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,iconSpace.width=labelSpace.width,itemSpace.width=labelSpace.width,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),labelSpace.height+=effPadding,iconSpace.height=icon.height+effPadding,itemSpace.height=labelSpace.height+iconSpace.height),"horizontal"===align?totalHeight=Math.max(totalHeight,itemSpace.height):(totalHeight+=itemSpace.height,totalWidth=Math.max(totalWidth,itemSpace.width,titleWidth)),maxItemSpaces={width:Math.max(itemSpace.width,maxItemSpaces.width),height:Math.max(itemSpace.height,maxItemSpaces.height)},itemSpaces.push(itemSpace),iconSpaces.push(iconSpace)}),itemSpaces.forEach(function(itemSpace,i){if("horizontal"===align)itemSpace.height=totalHeight,iconSpaces[i].width=maxIconWidth,"left"===textOrientation||"right"===textOrientation?(labelSpaces[i].height=totalHeight,iconSpaces[i].height=totalHeight,itemSpaces[i].width=labelSpaces[i].width+maxIconWidth):(labelSpaces[i].width=maxIconWidth,itemSpaces[i].width=maxIconWidth,labelSpaces[i].width=maxIconWidth),totalWidth=Math.max(totalWidth+itemSpaces[i].width);else if(itemSpace.width=Math.max(totalWidth,maxWidth),"top"===textOrientation||"bottom"===textOrientation)labelSpaces[i].width=totalWidth,iconSpaces[i].width=totalWidth,maxIconWidth=totalWidth;else{var labelWidth=labelSpaces[i].width,newLabelWidth=maxItemSpaces.width-maxIconWidth;iconSpaces[i].width=maxIconWidth,itemSpaces[i].width=labelSpaces[i].width+maxIconWidth,labelSpaces[i].width=Math.max(labelWidth,newLabelWidth),totalWidth=Math.max(totalWidth,itemSpace.width)}}),totalWidth=Math.ceil(Math.max(totalWidth,titleWidth))+effPadding,totalHeight+=titleHeight+effPadding,{totalHeight:totalHeight=Math.ceil(totalHeight),totalWidth:totalWidth,itemSpaces:itemSpaces,iconSpaces:iconSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth}}(this.config(),{effPadding:effPadding,titleWidth:titleWidth,labelSpaces:labelSpaces,titleHeight:titleHeight,maxWidth:maxWidth,maxHeight:maxHeight},this.data()),totalHeight=_computeItemSpaces.totalHeight,totalWidth=_computeItemSpaces.totalWidth,itemSpaces=_computeItemSpaces.itemSpaces,iconSpaces=_computeItemSpaces.iconSpaces,maxItemSpaces=_computeItemSpaces.maxItemSpaces,maxIconWidth=_computeItemSpaces.maxIconWidth;return this.measurement({width:Math.max(totalWidth,width)+effMargin+effBorder,height:Math.max(totalHeight,height)+effMargin+effBorder,labelSpaces:labelSpaces,iconSpaces:iconSpaces,itemSpaces:itemSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth,titleSpaces:{width:Math.min(maxWidth,this.measurement().width)-effMargin-effBorder,height:titleHeight}}),this}},{key:"getTitleSpace",value:function getTitleSpace(){return this._labelManager.setStyle(renderer_utils_getSmartComputedStyle(renderer_utils_selectElement("body"),"".concat(this.config().classPrefix,"-legend-title"))),this._labelManager.getOriSize(this.title().text?this.title().text:"")}},{key:"renderTitle",value:function renderTitle(container){var _this$measurement2=this.measurement(),titleSpaces=_this$measurement2.titleSpaces,border=_this$measurement2.border,padding=_this$measurement2.padding,width=_this$measurement2.width,maxWidth=_this$measurement2.maxWidth,_this$config3=this.config(),borderStyle=_this$config3.borderStyle,borderColor=_this$config3.borderColor;return function titleCreator(container,title,measurement,config){var titleWidth=Math.min(measurement.maxWidth,measurement.width),titleContainer=makeElement(container,"table",[1],"".concat(config.classPrefix,"-legend-title")).style("width","".concat(titleWidth,"px")).style("height","".concat(measurement.height,"px")).style("border-bottom","".concat(measurement.border,"px ").concat(config.borderStyle," ").concat(config.borderColor)).style("text-align",title.orientation instanceof Function?title.orientation(config.position):title.orientation);return makeElement(titleContainer,"td",[1],"".concat(config.classPrefix,"-legend-title-text")).style("width","".concat(titleWidth,"px")).style("max-width","".concat(titleWidth,"px")).style("height","100%").style("line-height",1).style("padding","".concat(measurement.padding,"px")).text(title.text).style("overflow-x","scroll").node()}(container,this.title(),{height:titleSpaces.height,width:width,maxWidth:maxWidth,border:border,padding:padding,borderStyle:borderStyle,borderColor:borderColor},this.config())}},{key:"render",value:function render(){var marginPosition,firebolt=this.firebolt(),_this$config4=this.config(),classPrefix=_this$config4.classPrefix,borderStyle=_this$config4.borderStyle,borderColor=_this$config4.borderColor,position=_this$config4.position,_this$measurement3=this.measurement(),maxWidth=_this$measurement3.maxWidth,maxHeight=_this$measurement3.maxHeight,width=_this$measurement3.width,height=_this$measurement3.height,margin=_this$measurement3.margin,border=_this$measurement3.border,legendContainer=makeElement(renderer_utils_selectElement(this.mount()),"div",[1],"".concat(classPrefix,"-legend-box"));switch(position){case"top":marginPosition="margin-".concat("bottom");break;case"left":marginPosition="margin-".concat("right");break;case"bottom":marginPosition="margin-".concat("top");break;default:marginPosition="margin-".concat("left")}return legendContainer.classed("".concat(classPrefix,"-legend-box-").concat(this._id),!0),legendContainer.style("float","left"),legendContainer.style("width","".concat(Math.min(maxWidth,width)-2*margin,"px")).style("height","".concat(Math.min(maxHeight,height)-2*margin,"px")).style("".concat(marginPosition),"".concat(margin,"px")).style("border","".concat(border,"px ").concat(borderStyle," ").concat(borderColor)),this.legendContainer(legendContainer.node()),this.renderTitle(legendContainer),firebolt.createSelectionSet(this.data().map(function(d){return d.id})),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){var fieldName=this.fieldName();return"measure"===this.metaData().getData().schema[0].type?function simple_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},fieldName,data.range):[[fieldName],[data.rawVal]]}}],[{key:"create",value:function create(dependencies){return new SimpleLegend(dependencies)}},{key:"defaultConfig",value:function defaultConfig(){return legend_defaults_DEFAULT_CONFIG}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENT}}]),SimpleLegend}();function position_config_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legendOrientation=(position_config_defineProperty(_legendOrientation={},"horizontal",{datasets:function datasets(data){return{row:[1],column:data}},itemContainerMeasures:function itemContainerMeasures(measurement){var itemSpaces=measurement.itemSpaces,width=measurement.width;return{row:{width:"".concat(width,"px"),padding:"".concat(0,"px")},column:{width:function width(d,i){return"".concat(itemSpaces[i].width,"px")},padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces;return{iconHeight:measurement.height,iconWidth:maxItemSpaces.width,stepPadding:{horizontal:!0,vertical:!1}}}}),position_config_defineProperty(_legendOrientation,"vertical",{datasets:function datasets(data){return{row:data,column:function column(d){return[d]}}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var width=measurement.width,padding=config.padding;return{row:{width:"".concat(width,"px"),padding:"".concat(padding,"px")},column:{width:"".concat(width,"px"),padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces,width=measurement.width;return{iconHeight:maxItemSpaces.height,iconWidth:width,stepPadding:{horizontal:!1,vertical:!0}}}}),_legendOrientation),positionConfig=(position_config_defineProperty(_positionConfig={},"left",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"right",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"top",legendOrientation.horizontal),position_config_defineProperty(_positionConfig,"bottom",legendOrientation.horizontal),_positionConfig),alignmentMap=(position_config_defineProperty(_alignmentMap={},"left","end"),position_config_defineProperty(_alignmentMap,"right","start"),position_config_defineProperty(_alignmentMap,"top","center"),position_config_defineProperty(_alignmentMap,"bottom","center"),_alignmentMap),itemStack=(position_config_defineProperty(_itemStack={},"left",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"right",["shape",VALUE]),position_config_defineProperty(_itemStack,"top",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"bottom",["shape",VALUE]),_itemStack),renderer_createLegendSkeleton=function createLegendSkeleton(context,container,classPrefix,data){var gradWidth,gradHeight,maxGradHeight,maxGradWidth,measurement=context.measurement(),margin=measurement.margin,border=measurement.border,titleSpaces=measurement.titleSpaces,width=measurement.width,height=measurement.height,maxWidth=measurement.maxWidth,maxHeight=measurement.maxHeight;gradHeight=height-(titleSpaces.height+2*margin+2*border),gradWidth=width-(2*margin+2*border),maxGradHeight=maxHeight-(titleSpaces.height+2*margin+2*border),maxGradWidth=maxWidth-(2*margin+2*border);var legendBody=makeElement(container,"div",[1],"".concat(classPrefix,"-legend-body"));return legendBody.select(".".concat(classPrefix,"-legend-overflow")).remove(),maxGradWidth&&maxGradWidth4)}(shape)?shape:defaults_ICON_MAP(shape).size(size)(),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}return d[1]="circle",createShape(d,elem,"circle")}(datum,makeElement(svg,"g",[datum[1]],"".concat(classPrefix,"-legend-icon")),datum[3]?"circle":"square",iconWidth,iconHeight).attr("transform","translate(".concat(maxIconWidth/2-padding," ").concat(iconHeight/2,")")).attr("fill",datum[2]||color):makeElement(svg,"rect",[datum[1]],"".concat(classPrefix,"-legend-icon")).attr("x",0).attr("y",0).attr("width",maxIconWidth).attr("height",iconHeight).attr("fill",datum[2]||color)};function discrete_legend_typeof(obj){return(discrete_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function discrete_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function discrete_legend_toConsumableArray(arr){return function discrete_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainForLegend.push(domain[1]),domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b}),domainForLegend=legend_helper_getInterpolatedArrayData(domainForLegend,scaleParams)):domainForLegend=legend_helper_getInterpolatedData(domain,steps-1,scaleParams),(domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=domainForLegend[i];return gradient_legend_defineProperty(_ref={},scaleType,"size"===scaleType?scale[scaleFn](ele)*scale.getScaleFactor():scale[scaleFn](Math.floor(ele))),gradient_legend_defineProperty(_ref,"value",+value.toFixed(2)),gradient_legend_defineProperty(_ref,"id",i),_ref}).filter(function(d){return null!==d.value})}},{key:"getLabelSpaces",value:function getLabelSpaces(effPadding){this.config({item:{text:{orientation:this.config().position}}});var axis=function createAxis(context){var data=context.data(),align=context.config().align,AxisCell=context._cells.AxisCell,newAxis=new continous_axis_ContinousAxis({id:"legend-".concat(context._id),orientation:align===ALIGN_VERTICAL?"right":"bottom",style:context._computedStyle,nice:!1,showAxisName:!1,tickValues:data.map(function(d){return d.value}),fixedBaseline:!1,labels:{rotation:null}},{labelManager:context._labelManager});return newAxis.domain(getGradientDomain(data)),newAxis.range([1,1]),(new AxisCell).source(newAxis).config({margin:{left:0,bottom:0,top:0,right:0}})}(this),axisSpace=axis.getLogicalSpace(),space={width:axisSpace.width-effPadding,height:axisSpace.height-effPadding},axisDomainLength=axis.source().domain().length,labelSpaces=new Array(axisDomainLength).fill(space);return this.axis(axis),labelSpaces}},{key:"getDrawingContext",value:function getDrawingContext(){return{svgContainer:this._legendGradientSvg}}},{key:"render",value:function render(){var firebolt=this.firebolt(),legendContainer=gradient_legend_get(gradient_legend_getPrototypeOf(GradientLegend.prototype),"render",this).call(this,this.mount());return function renderGradient(context,container){var gradHeight,gradWidth,_context$config2=context.config(),align=_context$config2.align,classPrefix=_context$config2.classPrefix,item=_context$config2.item,data=context.data(),_createLegendSkeleton=gradient_helper_createLegendSkeleton(container,classPrefix,data),legendContainer=_createLegendSkeleton.legendContainer,legendGradSvg=_createLegendSkeleton.legendGradSvg,legendGradCont=_createLegendSkeleton.legendGradCont,linearGradient=_createLegendSkeleton.linearGradient,legendRect=_createLegendSkeleton.legendRect,labelDim=context.axis().source().getAxisDimensions().tickDimensions,_context$measurement=context.measurement(),padding=_context$measurement.padding,margin=_context$measurement.margin,border=_context$measurement.border,titleSpaces=_context$measurement.titleSpaces,maxItemSpaces=_context$measurement.maxItemSpaces,maxHeight=_context$measurement.maxHeight,maxWidth=_context$measurement.maxWidth,height=_context$measurement.height,width=_context$measurement.width,gradientDimensions={};gradHeight=Math.floor(Math.min(height,maxHeight)-(titleSpaces.height+2*margin+2*border)),gradWidth=Math.floor(Math.min(width,maxWidth)-(2*margin+2*border)),align===ALIGN_HORIZONTAL?(gradientDimensions.height=item.icon.height,gradientDimensions.width=gradWidth-2*padding-labelDim.width/2,linearGradient.attr("x2","100%").attr("y1","0%"),legendGradCont.attr("transform","translate( ".concat(labelDim.width/2," 0)")),gradient_helper_renderAxis(context,legendContainer,gradHeight-item.icon.height-padding,gradWidth-2*padding-1),applyStyle(legendContainer,{height:"".concat(maxItemSpaces.height+border+padding,"px"),width:"".concat(Math.min(width,maxWidth),"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height),legendRect.attr("width",gradientDimensions.width-labelDim.width/2)):(gradientDimensions.height=gradHeight-2*padding-labelDim.height/2,gradientDimensions.width=item.icon.width,linearGradient.attr("x2","0%").attr("y1","100%"),legendGradCont.attr("transform","translate(0 ".concat(labelDim.height/2,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-2*padding-1,gradWidth-item.icon.width-2*padding),applyStyle(legendContainer,{height:"".concat(Math.min(height,maxHeight),"px"),width:"".concat(maxWidth,"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height-labelDim.height/2),legendRect.attr("width",gradientDimensions.width)),applyStyle(legendGradSvg,{height:"".concat(gradientDimensions.height,"px"),width:"".concat(gradientDimensions.width,"px")}),applyStyle(legendRect,{fill:"url(#linear-gradient)"}),legendGradSvg.attr("height",gradientDimensions.height),legendGradSvg.attr("width",gradientDimensions.width),context.measurement({gradientDimensions:gradientDimensions}),context._legendGradientSvg=legendGradSvg}(this,legendContainer),legendContainer.selectAll("div").style("float","left"),firebolt.mapActionsAndBehaviour(),firebolt.createSelectionSet(this.data().map(function(d){return d.id})),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){return[[this.fieldName()],[data.value]]}}],[{key:"create",value:function create(dependencies){return new GradientLegend(dependencies)}},{key:"type",value:function type(){return"gradient"}}]),GradientLegend}();function step_legend_typeof(obj){return(step_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function step_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function step_legend_toConsumableArray(arr){return function step_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&(domainBounds.upper=["".concat(formatter.bounds.upper," ").concat(steps[steps.length-1])])):domainLeg=legend_helper_getInterpolatedData(domain,steps,scaleParams),domainLeg=(domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=null;return i0&&void 0!==arguments[0]?arguments[0]:{},registrableComponents=this._registrableComponents,mergedPolicy=mergeRecursive(mergeRecursive({},function defaultPolicy(registrableComponents){var aliases=registrableComponents.map(function(comp){return comp.alias()});return{behaviours:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}}}}(registrableComponents)),policy);return registrableComponents.forEach(function(canvas){canvas.firebolt().crossInteractionPolicy(mergedPolicy)}),this}}]),ActionModel}()),TITLE_CONFIG={position:"top",align:"left",padding:4,className:"".concat("muze","-title-container")},SUB_TITLE_CONFIG={position:"top",align:"left",padding:16,maxLines:2,className:"".concat("muze","-subtitle-container")},MESSAGE_CONFIG={className:"".concat("muze","-message-container")};function local_options_typeof(obj){return(local_options_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function local_options_slicedToArray(arr,i){return function local_options_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function local_options_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function local_options_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function canvas_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var local_options_localOptions=(canvas_local_options_defineProperty(_localOptions={},"rows",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"columns",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"color",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"shape",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"size",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"detail",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"layers",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"transform",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object"}}),_localOptions),canvasOptions=(canvas_local_options_defineProperty(_canvasOptions={},"title",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref){var _ref2=local_options_slicedToArray(_ref,2),arg1=_ref2[0],arg2=_ref2[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref3){var _ref4=local_options_slicedToArray(_ref3,2),title=_ref4[0],titleConfig=_ref4[1],t=title;"string"!=typeof title&&title||(t=function t(){return title});var defConfig=mergeRecursive({},TITLE_CONFIG);return[t,mergeRecursive(defConfig,titleConfig)]}}}),canvas_local_options_defineProperty(_canvasOptions,"subtitle",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref5){var _ref6=local_options_slicedToArray(_ref5,2),arg1=_ref6[0],arg2=_ref6[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref7){var _ref8=local_options_slicedToArray(_ref7,2),subtitle=_ref8[0],subtitleConfig=_ref8[1],sub=subtitle;"string"!=typeof subtitle&&subtitle||(sub=function sub(){return subtitle});var defConfig=mergeRecursive({},SUB_TITLE_CONFIG);return[sub,mergeRecursive(defConfig,subtitleConfig)]}}}),_canvasOptions);function layoutComponent_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],isGridComponent=arguments.length>3&&void 0!==arguments[3]&&arguments[3],cut="",componentRatioWidth=1,leftHeight=0,leftWidth=0;if(!component)return{first:definitionModel,second:definitionModel};var _component$getLogical=component.getLogicalSpace(),componentHeight=_component$getLogical.height,componentWidth=_component$getLogical.width,position=component.position();"top"===position||"bottom"===position?(cut="h",componentRatioWidth=componentHeight/definitionModel.remainingHeight(),leftHeight=definitionModel.remainingHeight()-componentHeight,leftWidth=definitionModel.remainingWidth()):(cut="v",componentRatioWidth=componentWidth/definitionModel.remainingWidth(),leftWidth=definitionModel.remainingWidth()-componentWidth,leftHeight=definitionModel.remainingHeight()),leftOvercomponentRationWidth=1-componentRatioWidth,definitionModel.cut(cut);var firstLaneConfig={host:component.name(),cut:null,ratioWeight:componentRatioWidth,preferred:!isGridComponent&&isPreferred,lanes:[]},firstLane=new DefinitionModel(firstLaneConfig);firstLane.remainingHeight(componentHeight),firstLane.remainingWidth(componentWidth);var secondLane=new DefinitionModel({host:null,cut:null,ratioWeight:leftOvercomponentRationWidth,preferred:!isGridComponent&&!isPreferred,lanes:[]});return secondLane.remainingHeight(leftHeight),secondLane.remainingWidth(leftWidth),isPreferred?definitionModel.lanes([firstLane]):"top"===position||"left"===position?definitionModel.lanes([firstLane,secondLane]):definitionModel.lanes([secondLane,firstLane]),{first:firstLane,second:secondLane}}function tree_toConsumableArray(arr){return function tree_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?matrix[0]:matrix[1];return isTransposed?(joinedMatrix=matrix[0].length>0?utils_toConsumableArray(matrix[0]):[],joinedMatrix=matrix[1].length>0?[].concat(utils_toConsumableArray(joinedMatrix),utils_toConsumableArray(matrix[1])):joinedMatrix):joinedMatrix=joinedMatrix.map(function(row,rowIndex){var rowData=[];return matrix[0].length>0&&(rowData=utils_toConsumableArray(matrix[0][rowIndex])),matrix[1].length>0&&(rowData=[].concat(utils_toConsumableArray(rowData),utils_toConsumableArray(matrix[1][rowIndex]))),rowData}),joinedMatrix},utils_computeLogicalSpace=function computeLogicalSpace(){var item=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},config=arguments.length>1?arguments[1]:void 0,maxMeasures=arguments.length>2?arguments[2]:void 0,_config$isTransposed=config.isTransposed,isTransposed=void 0!==_config$isTransposed&&_config$isTransposed,unitMeasures=config.unitMeasures,_getMeasureInfo=function getMeasureInfo(isTransposed){return isTransposed?{firstMeasure:enums_constants_HEIGHT,secondMeasure:"width"}:{firstMeasure:"width",secondMeasure:enums_constants_HEIGHT}}(isTransposed),firstMeasure=_getMeasureInfo.firstMeasure,secondMeasure=_getMeasureInfo.secondMeasure,values=item.values,minMeasures=function getMinMeasures(isTransposed,unitMeasures){return isTransposed?{height:0,width:unitMeasures.width}:{height:unitMeasures.height,width:0}}(isTransposed,unitMeasures);if(values[0].key){var _logicalSpace,logicalSpace=(utils_defineProperty(_logicalSpace={},firstMeasure,0),utils_defineProperty(_logicalSpace,secondMeasure,0),_logicalSpace);return values.forEach(function(valueItem){var space=computeLogicalSpace(valueItem,config,maxMeasures);logicalSpace[firstMeasure]=Math.max(logicalSpace[firstMeasure],space[firstMeasure],minMeasures[firstMeasure]),logicalSpace[secondMeasure]+=+space[secondMeasure]}),item.space=logicalSpace,logicalSpace}return function getLogicalSpace(item,measures,minMeasures){var _ref,maxMeasure=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],firstMeasure=measures.firstMeasure,secondMeasure=measures.secondMeasure,firstMeasureValue=0,secondMeasureValue=0;return item.values.forEach(function(valueArray){var _item$space,fMeasure=0,sMeasure=0;valueArray.forEach(function(placeholder,colIndex){placeholder.setAvailableSpace();var space=placeholder.getLogicalSpace(),minSecondMeasure=placeholder.getMinMeasures(minMeasures[secondMeasure]);sMeasure=Math.max(sMeasure,+space[secondMeasure],minSecondMeasure),maxMeasure[colIndex]=Math.max(maxMeasure[colIndex]||0,space[firstMeasure]),fMeasure+=+maxMeasure[colIndex]}),secondMeasureValue+=sMeasure,firstMeasureValue=Math.max(firstMeasureValue,fMeasure),item.space=(utils_defineProperty(_item$space={},secondMeasure,Math.ceil(secondMeasureValue)),utils_defineProperty(_item$space,firstMeasure,Math.ceil(firstMeasureValue)),_item$space)}),utils_defineProperty(_ref={},secondMeasure,secondMeasureValue),utils_defineProperty(_ref,firstMeasure,firstMeasureValue),_ref}(item,{firstMeasure:firstMeasure,secondMeasure:secondMeasure},minMeasures,maxMeasures)},createMatrixEachLevel=function createMatrixEachLevel(item,isTransposed){if(item.values[0].key){var arr=[];return item.values.forEach(function(child){isTransposed?createMatrixEachLevel(child,isTransposed).forEach(function(e,i){var _arr$i;arr[i]=arr[i]||[],(_arr$i=arr[i]).push.apply(_arr$i,utils_toConsumableArray(e))}):arr.push.apply(arr,utils_toConsumableArray(createMatrixEachLevel(child,isTransposed)))}),item.matrix=arr,arr}return item.matrix=isTransposed?item.values[0].map(function(col,colIndex){return item.values.map(function(row){return row[colIndex]})}):item.values,item.matrix},extraCellsRemover=function extraCellsRemover(arr,beg,end){return arr.slice(beg,-end)},visual_matrix_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},maxMeasures:{},availableSpace:{},logicalSpace:{}},visual_matrix_default_config_defaultConfig={distribution:[],classPrefix:"muze",isDistributionEqual:!0,unitMeasures:{height:100,width:100,border:1},isTransposed:!1,facet:"primary",extraCellLengths:[]};function visual_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function visual_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VisualMatrix),this._lastLevelKey=0,this._primaryMatrix=matrix[0]||[],this._secondaryMatrix=matrix[1]||[],this._maxMeasures=[],this._availableSpace={},generateGetterSetters(this,visual_matrix_props_PROPS);var defCon=Object.assign({},this.constructor.defaultConfig());this.config(mergeRecursive(defCon,config)),this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],this.config())}return function visual_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&visual_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&visual_matrix_defineProperties(Constructor,staticProps),Constructor}(VisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"computeViewableSpaces",value:function computeViewableSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"removeExtraCells",value:function removeExtraCells(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getPriorityDistribution",value:function getPriorityDistribution(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"calculateDepth",value:function calculateDepth(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeSpaces",value:function redistributeSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeViewSpaces",value:function redistributeViewSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getCellDimensions",value:function getCellDimensions(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"primaryMatrix",value:function primaryMatrix(){return arguments.length?this:this._primaryMatrix}},{key:"secondaryMatrix",value:function secondaryMatrix(){return arguments.length?this:this._secondaryMatrix}},{key:"tree",value:function tree(){return arguments.length?this:this._tree}},{key:"createTree",value:function createTree(){var _createTree2=function createTree(context){var matrixTree={},lastLevelKey=0,facet="primary",nestFn=utils_nest(),keys=[],layoutMatrix=context._layoutMatrix,primaryMatrix=context.primaryMatrix(),secondaryMatrix=context.secondaryMatrix(),_context$config=context.config(),isTransposed=_context$config.isTransposed,breakPage=_context$config.breakPage;if(isTransposed){if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var _i2=0;_i20){for(var primaryMatrixLength=primaryMatrix.length,_i3=secondaryMatrix.length-1;_i3>0;_i3--)keys.push(_i3+primaryMatrixLength);keys.push(primaryMatrixLength),"primary"===facet&&(lastLevelKey=primaryMatrixLength)}var newMatrix;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),newMatrix=layoutMatrix[0].map(function(col,colIndex){return layoutMatrix.map(function(row){return row[colIndex]})}),matrixTree=nestFn.entries(newMatrix)}else{if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var i=0;i0){for(var keyLength=primaryMatrix.length>0?primaryMatrix[0].length:0,_i=secondaryMatrix[0].length-1;_i>0;_i--)keys.push(_i+keyLength);keys.push(keyLength),"primary"===facet&&(lastLevelKey=keyLength)}else lastLevelKey=primaryMatrix.length>0?primaryMatrix[0].length-1:0;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),matrixTree=nestFn.entries(layoutMatrix)}return{tree:matrixTree,lastLevelKey:lastLevelKey}}(this),tree=_createTree2.tree,lastLevelKey=_createTree2.lastLevelKey;return this._lastLevelKey=lastLevelKey,tree}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()}},{key:"setAvailableSpace",value:function setAvailableSpace(width,height){this.availableSpace({width:width,height:height});var tree=this.tree(),heightMeasures=this.populateMaxMeasures(enums_constants_HEIGHT,tree),widthMeasures=this.populateMaxMeasures("width",tree),depth=this.calculateDepth(widthMeasures,heightMeasures);return this.viewableMatrix=this.createViewPortMatrix(depth),this.viewableMeasures=this.redistributeSpaces(width,height),this}},{key:"populateMaxMeasures",value:function populateMaxMeasures(type,matrixTree){var _this=this,depth=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,measures=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(measures[depth]=Math.max(measures[depth]||0,matrixTree.space[type]),matrixTree.values){var childDepth=depth+1;matrixTree.values.forEach(function(child){child.space&&(measures=_this.populateMaxMeasures(type,child,childDepth,measures))})}return measures}},{key:"getViewableSpaces",value:function getViewableSpaces(){return this.viewableMeasures}},{key:"getViewableMatrices",value:function getViewableMatrices(){return this.viewableMatrix}},{key:"createViewPortMatrix",value:function createViewPortMatrix(depth){var arr=[];return function createMatrixInstances(){var arr=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],depth=arguments.length>1?arguments[1]:void 0,matrixInfo=arguments.length>2?arguments[2]:void 0,layout=arguments.length>3?arguments[3]:void 0,breakPointer=layout._breakPointer,isTransposed=layout.config().isTransposed,tree=matrixInfo.tree,layoutMatrix=matrixInfo.layoutMatrix;if(0===depth){var brokenMatrix=function breakMatrix(matrix,isTransposed,breakPointer){var primaryMatrix=[],secondaryMatrix=[];return isTransposed?matrix.forEach(function(row,rowIndex){rowIndex>=breakPointer?secondaryMatrix.push(row):primaryMatrix.push(row)}):matrix.forEach(function(row,rowIndex){row.forEach(function(column,columnIndex){columnIndex>=breakPointer?(secondaryMatrix[rowIndex]=secondaryMatrix[rowIndex]||[],secondaryMatrix[rowIndex].push(column)):(primaryMatrix[rowIndex]=primaryMatrix[rowIndex]||[],primaryMatrix[rowIndex].push(column))})}),[primaryMatrix,secondaryMatrix]}(tree.matrix,isTransposed,breakPointer);return arr.push({matrix:tree.matrix,primaryMatrix:brokenMatrix[0],secondaryMatrix:brokenMatrix[1],space:tree.space}),arr}var nextLevel=depth-1;return tree.values.forEach(function(e){createMatrixInstances(arr,nextLevel,{tree:e,layoutMatrix:layoutMatrix},layout)}),arr}(arr,depth,this.removeExtraCells(),this),arr}}],[{key:"defaultConfig",value:function defaultConfig(){return visual_matrix_default_config_defaultConfig}}]),VisualMatrix}();function row_matrix_typeof(obj){return(row_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function row_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function row_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RowVisualMatrix),(_this=row_matrix_possibleConstructorReturn(this,row_matrix_getPrototypeOf(RowVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length>0?matrix[0][0].length:0,_this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],_this.config()),_this._tree={key:ROW_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function row_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&row_matrix_setPrototypeOf(subClass,superClass)}(RowVisualMatrix,visual_matrix_VisualMatrix),function row_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&row_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&row_matrix_defineProperties(Constructor,staticProps),Constructor}(RowVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!1),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),widths=_this2$getCellDimensi.widths,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=[height,height],columnMeasures=widths;return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=extraCellsRemover(tree.matrix,begCellLen,endCellLen),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var remainingAvailWidth,remainingWidth,cWidths=[],conditions=[],maxPrioritySpace=0,matrix=measures.matrix,availableWidth=measures.width,maxWidths=measures.maxMeasures,currentWidth=measures.maxWidth,height=measures.height,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length?this.primaryMatrix()[0].length:0,dist=[];remainingAvailWidth=availableWidth,remainingWidth=currentWidth,(conditions=2===priority?[primaryMatrixLength-1,primaryMatrixLength]:0===priority?[primaryMatrixLength-1]:[primaryMatrixLength]).forEach(function(i){dist[i]=maxWidths[i],maxPrioritySpace+=maxWidths[i],remainingAvailWidth-=dist[i],remainingWidth-=dist[i]}),matrix[0].forEach(function(e,i){-1===conditions.indexOf(i)&&(dist[i]=remainingAvailWidth*(maxWidths[i]/remainingWidth))}),matrix.forEach(function(row){return row.forEach(function(col,cIdx){-1===conditions.indexOf(cIdx)?(col.setAvailableSpace(dist[cIdx],height),cWidths[cIdx]=Math.max(cWidths[cIdx]||0,Math.floor(col.getLogicalSpace().width))):cWidths[cIdx]=0})});var prioritySpace=availableWidth-cWidths.reduce(function(t,n){return t+n});return prioritySpace<0?cWidths=cWidths.map(function(){return 0}):conditions.forEach(function(i){cWidths[i]=Math.floor(prioritySpace*(dist[i]/maxPrioritySpace||1))}),cWidths}},{key:"calculateDepth",value:function calculateDepth(widthMeasures,heightMeasures){var i,height=this.availableSpace().height;for(i=0;i0?logicalWidths:maxMeasures.map(function(){return 0}),rHeights=function getDistributedHeight(context){var heightWithoutGutter,distSum=0,gutterSum=0,isTransposed=context.isTransposed,distribution=context.distribution,availableHeight=context.availableHeight,height=context.height,isDistributionEqual=context.isDistributionEqual,gutter=context.gutter,matrix=context.matrix,cIdx=context.cIdx;distribution&&void 0!==distribution[0]&&(distSum=distribution.reduce(function(t,n){return t+=n})),gutter&&void 0!==gutter[0]&&(gutterSum=gutter.reduce(function(t,n){return t+=n})),heightWithoutGutter=availableHeight-Math.floor(availableHeight*gutterSum);var colLen=matrix.length;return matrix.map(function(row,rIdx){var space=row[cIdx].getLogicalSpace().height,distHeight=space+space/height*(heightWithoutGutter-height);return isTransposed||(distribution.length>0&&colLen===distribution.length?distHeight=heightWithoutGutter*distribution[rIdx]/distSum:(isDistributionEqual||0===context.height)&&(distHeight=heightWithoutGutter/colLen)),Math.floor(distHeight)})}({matrix:matrix,cIdx:this._lastLevelKey,height:mHeight,availableHeight:height,isDistributionEqual:isDistributionEqual,distribution:distribution,isTransposed:isTransposed,gutter:gutter}),maxWidths.length>0&&(cWidths=cWidths.map(function(e,i){return Math.max(e,maxWidths[0][i]||0)})),maxWidths.push(cWidths);for(var x=0;x=breakPointer&&(columnWidths[1][cIdx-breakPointer]=colWidth,widths[1]=(widths[1]||0)+colWidth),cIdx===_this4._lastLevelKey&&(rowHeights[0][rIdx]=colHeight,rowHeights[1][rIdx]=colHeight)})}),{heights:[0,0],widths:widths,rowHeights:rowHeights,columnWidths:columnWidths}}}]),RowVisualMatrix}();function column_matrix_typeof(obj){return(column_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function column_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function column_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ColumnVisualMatrix),(_this=column_matrix_possibleConstructorReturn(this,column_matrix_getPrototypeOf(ColumnVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length,_this._tree={key:COLUMN_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function column_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&column_matrix_setPrototypeOf(subClass,superClass)}(ColumnVisualMatrix,visual_matrix_VisualMatrix),function column_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&column_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&column_matrix_defineProperties(Constructor,staticProps),Constructor}(ColumnVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!0),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height,width=measures.width;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i,height:height},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),heights=_this2$getCellDimensi.heights,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=heights,columnMeasures=[width,width];return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=tree.matrix.map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var height=measures.height,maxHeights=measures.maxHeights,remainingHeight=height,heightDist=[],conditions=[],divider=2,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length;return 2===priority?(conditions=[primaryMatrixLength-1,primaryMatrixLength],divider=2):(conditions=0===priority?[primaryMatrixLength-1]:[primaryMatrixLength],divider=1),maxHeights.forEach(function(heights,index){-1===conditions.indexOf(index)&&(heightDist[index]=heights,remainingHeight-=heights)}),remainingHeight<0?heightDist=heightDist.map(function(){return 0}):conditions.forEach(function(condition){heightDist[condition]=Math.min(maxHeights[condition],remainingHeight/divider)}),heightDist}},{key:"calculateDepth",value:function calculateDepth(widthMeasures){var j,width=this.availableSpace().width;for(j=0;j0)distWidth=availableWidth*distribution[colIndex]/distSum;else if(isDistributionEqual||0===width){var rowLen=row.length;distWidth=availableWidth/rowLen}return Math.floor(distWidth)})}({row:matrix[this._lastLevelKey],width:mWidth,availableWidth:width},this.config());matrix.forEach(function(row,rIdx){return row.forEach(function(col,cIdx){var oldLogicalSpace=col.getLogicalSpace();col.setAvailableSpace(cWidths[cIdx]-borderWidth,oldLogicalSpace.height),rHeights[rIdx]=Math.max(rHeights[rIdx]||0,Math.floor(col.getLogicalSpace().height))})}),maxHeights.length>0&&(rHeights=rHeights.map(function(e,i){return Math.max(e,maxHeights[0][i])})),maxHeights.push(rHeights);for(var x=0;x=breakPointer&&(rowHeights[1][rIdx-breakPointer]=colHeight,heights[1]=(heights[1]||0)+colHeight),rIdx===_this4._lastLevelKey&&(columnWidths[0][cIdx]=colWidth,columnWidths[1][cIdx]=colWidth)})}),{heights:heights,widths:[0,0],rowHeights:rowHeights,columnWidths:columnWidths}}}]),ColumnVisualMatrix}();function layout_helper_toConsumableArray(arr){return function layout_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);imaxMeasure&&layout.scrollInfo(computations_defineProperty({},scrollType,!0)),Math.max(maxMeasure,actualMeasure)}}(layout,paginationDetailsMap[matrixType],relatedMaxMeasure,buffer)},computations_getMatrixHeightDetails=function getMatrixHeightDetails(layout,columnMatrixWidth){var height=layout.measurement().height,buffer=layout.config().buffer,_getHeightRequiredByC=function getHeightRequiredByColMatrix(layout,columnMatrixWidth){var height=layout.measurement().height,columnMatrix=layout.columnMatrix(),maxColumnMatrixHeight=Math.min(columnMatrix.getLogicalSpace().height,height/2);columnMatrix.setAvailableSpace(columnMatrixWidth,maxColumnMatrixHeight);var columnViewSpace=columnMatrix.getViewableSpaces()[layout.config().columnPointer];return{columnMatrixHeight:columnViewSpace.height.primary+columnViewSpace.height.secondary,maxColumnMatrixHeight:maxColumnMatrixHeight}}(layout,columnMatrixWidth),columnMatrixHeight=_getHeightRequiredByC.columnMatrixHeight,maxColumnMatrixHeight=_getHeightRequiredByC.maxColumnMatrixHeight,maxHeightAvailableForRowMatrix=height-Math.min(maxColumnMatrixHeight,columnMatrixHeight);return{columnMatrixHeight:columnMatrixHeight,maxColumnMatrixHeight:maxColumnMatrixHeight,rowMatrixHeight:paginationMeasureGetter(layout,"row",maxHeightAvailableForRowMatrix,buffer),maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix}},bufferCondition={isScroll:!0,pagination:"scroll"},computations_getActualBufferFromConfig=function getActualBufferFromConfig(layout){var buffer=layout.config().buffer,_map2=computations_slicedToArray([enums_constants_HORIZONTAL,enums_constants_VERTICAL].map(function(type){return function getBufferFromCondition(layout,type){var scrollInfo=layout.scrollInfo(),currentBufferType={pagination:layout.config().pagination,isScroll:scrollInfo[type]};return Object.keys(bufferCondition).every(function(e){return bufferCondition[e]===currentBufferType[e]})}(layout,type)?buffer:0}),2);return{horizontalBuffer:_map2[0],verticalBuffer:_map2[1]}},computations_computeLayoutMeasurements=function computeLayoutMeasurements(layout){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_getMatrixWidthDetail=function getMatrixWidthDetails(layout){var rowMatrix=layout.rowMatrix(),width=layout.measurement().width,_layout$config3=layout.config(),border=_layout$config3.border,buffer=_layout$config3.buffer,borderWidth=border.width,rowMatrixWidth=getMatrixMeasurement(rowMatrix,"width"),maxRowMatrixWidth=Math.min(rowMatrixWidth+buffer,width/2),maxWidthAvailableForColumnMatrix=width-maxRowMatrixWidth-borderWidth;return{rowMatrixWidth:rowMatrixWidth,maxRowMatrixWidth:maxRowMatrixWidth,columnMatrixWidth:paginationMeasureGetter(layout,"column",maxWidthAvailableForColumnMatrix,0),maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}}(layout),rowMatrixWidth=_getMatrixWidthDetail.rowMatrixWidth,maxRowMatrixWidth=_getMatrixWidthDetail.maxRowMatrixWidth,maxWidthAvailableForColumnMatrix=_getMatrixWidthDetail.maxWidthAvailableForColumnMatrix,columnMatrixWidth=_getMatrixWidthDetail.columnMatrixWidth,_getMatrixHeightDetai=computations_getMatrixHeightDetails(layout,columnMatrixWidth),columnMatrixHeight=_getMatrixHeightDetai.columnMatrixHeight,rowMatrixHeight=_getMatrixHeightDetai.rowMatrixHeight,maxHeightAvailableForRowMatrix=_getMatrixHeightDetai.maxHeightAvailableForRowMatrix,_getActualBufferFromC=computations_getActualBufferFromConfig(layout),horizontalBuffer=_getActualBufferFromC.horizontalBuffer,verticalBuffer=_getActualBufferFromC.verticalBuffer;rowMatrix.setAvailableSpace(maxRowMatrixWidth-verticalBuffer,rowMatrixHeight-horizontalBuffer);var rowViewableSpaces=rowMatrix.getViewableSpaces(),columnViewableSpaces=columnMatrix.getViewableSpaces();return setViewSpaces(layout,"row",rowViewableSpaces),setViewSpaces(layout,"column",columnViewableSpaces),function setValueMatrixMeasurements(layout,rowViewableSpaces,columnViewableSpaces){var _ref,_ref2,_ref3,_ref4,_ref5,centerMatrix=layout.centerMatrix(),border=layout.config().border,matrices=layout.matrices(),top=matrices.top,bottom=matrices.bottom,borderWidth=border.width,rowHeights=(_ref=[]).concat.apply(_ref,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.rowHeights.primary}))),rowWidthsPrimary=(_ref2=[]).concat.apply(_ref2,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.primary}))),rowWidthsSecondary=(_ref3=[]).concat.apply(_ref3,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.secondary}))),columnWidths=(_ref4=[]).concat.apply(_ref4,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.columnWidths.primary}))),columnHeightsPrimary=columnViewableSpaces[0].rowHeights.primary,columnHeightsSecondary=(_ref5=[]).concat.apply(_ref5,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.rowHeights.secondary})));centerMatrix.forEach(function(matrix,rIdx){matrix.forEach(function(placeholder,cIdx){placeholder.setAvailableSpace(columnWidths[cIdx]-borderWidth,rowHeights[rIdx]-borderWidth)})}),computations_setAvailableSpace(top[0],rowWidthsPrimary,columnHeightsPrimary),computations_setAvailableSpace(top[2],rowWidthsSecondary,columnHeightsPrimary),computations_setAvailableSpace(bottom[0],rowWidthsPrimary,columnHeightsSecondary),computations_setAvailableSpace(bottom[2],rowWidthsSecondary,columnHeightsSecondary)}(layout,rowViewableSpaces,columnViewableSpaces),{rowMatrixHeight:rowMatrixHeight-horizontalBuffer,rowMatrixWidth:rowMatrixWidth-verticalBuffer,maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix-horizontalBuffer,columnMatrixHeight:columnMatrixHeight,columnMatrixWidth:columnMatrixWidth,maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}},measureSum=function measureSum(measureArr){return measureArr.reduce(function(total,measure){return total+measure},0)};function layout_typeof(obj){return(layout_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function layout_defineProperties(target,props){for(var i=0;i0&&(leftMatrix=[].concat(layout_helper_toConsumableArray(topLeft),layout_helper_toConsumableArray(leftRows),layout_helper_toConsumableArray(bottomLeft))),rightRows.length>0&&(rightMatrix=[].concat(layout_helper_toConsumableArray(topRight),layout_helper_toConsumableArray(rightRows),layout_helper_toConsumableArray(bottomRight))),topColumns.length>0&&topColumns[0].length>0&&(topMatrix=topColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(topLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(topRight[i]))})),bottomColumns.length>0&&bottomColumns[0].length>0&&(bottomMatrix=bottomColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(bottomLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(bottomRight[i]))})),context.rowMatrix(new row_matrix_RowVisualMatrix([leftMatrix,rightMatrix],{isDistributionEqual:isRowSizeEqual,distribution:distribution.rows,gutter:gutterSpace.rows,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.row,breakPage:breakPage.rows.map(function(e){return e+Math.max(topLeft.length,topRight.length)}),extraCellLengths:[topLeft.length,bottomLeft.length]})),begColCells=topLeft.length>0?topLeft[0].length:bottomLeft.length>0?bottomLeft[0].length:0,endColCells=topRight.length>0?topRight[0].length:bottomRight.length>0?bottomRight[0].length:0,context.columnMatrix(new column_matrix_ColumnVisualMatrix([topMatrix,bottomMatrix],{isDistributionEqual:isColumnSizeEqual,distribution:distribution.columns,gutter:gutterSpace.columns,isTransposed:!0,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.col,breakPage:breakPage.columns,extraCellLengths:[begColCells,endColCells]})),context.centerMatrix(valueMatrix),matrices}(this,_matrices),this):layout_get(layout_getPrototypeOf(GridLayout.prototype),"matrices",this).call(this,_matrices)}},{key:"triggerReflow",value:function triggerReflow(){this.scrollInfo({horizontal:!1,vertical:!1});var _computeLayoutMeasure=computations_computeLayoutMeasurements(this),maxHeightAvailableForRowMatrix=_computeLayoutMeasure.maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix=_computeLayoutMeasure.maxWidthAvailableForColumnMatrix;return this.setViewInformation(maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix),this}},{key:"gotoPage",value:function gotoPage(type,pageNumber){var pageType=type.toLowerCase(),totalPages=this.viewInfo().viewMatricesInfo["".concat(pageType,"Pages")],pointer=Math.min(Math.max(1,pageNumber),totalPages);return this.config(function layout_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},"".concat(pageType,"Pointer"),pointer-1)),this.setViewInformation(),this.renderGrid(),this}},{key:"pages",value:function pages(type){var viewMatricesInfo=this.viewInfo().viewMatricesInfo,pageType=type.toLowerCase();return{totalPages:viewMatricesInfo["".concat(pageType,"Pages")],currentPage:this.config()["".concat(pageType,"Pointer")]+1}}},{key:"viewInfo",value:function viewInfo(){return arguments.length?(this._viewInfo=arguments.length<=0?void 0:arguments[0],this):this._viewInfo}},{key:"scrollInfo",value:function scrollInfo(){return arguments.length?(this._scrollInfo=mergeRecursive(this._scrollInfo,arguments.length<=0?void 0:arguments[0]),this):this._scrollInfo}},{key:"setViewInformation",value:function setViewInformation(maxRowHeight,maxColWidth){var _this$config2=this.config(),rowPointer=_this$config2.rowPointer,columnPointer=_this$config2.columnPointer,border=_this$config2.border,viewMatricesInfo=function getViewMatrices(layout,rowPointer,columnPointer){for(var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),centerMatrix=layout.centerMatrix(),matrices=layout.matrices(),rowMatrices=rowMatrix.getViewableMatrices(),columnMatrices=columnMatrix.getViewableMatrices(),centralMatrixPointer={row:0,column:0},i=rowPointer-1;i>=0;i--){var length=Math.max(rowMatrices[i].primaryMatrix.length,rowMatrices[i].secondaryMatrix.length);centralMatrixPointer.row+=length}for(var _i=columnPointer-1;_i>=0;_i--){var matrix=columnMatrices[_i],primaryMatrix=matrix.primaryMatrix,secondaryMatrix=matrix.secondaryMatrix,_length=Math.max(primaryMatrix[0]?primaryMatrix[0].length:0,secondaryMatrix[0]?secondaryMatrix[0].length:0);centralMatrixPointer.column+=_length}matrices.top[1]=columnMatrices[columnPointer].primaryMatrix,matrices.bottom[1]=columnMatrices[columnPointer].secondaryMatrix,matrices.center[0]=rowMatrices[rowPointer].primaryMatrix,matrices.center[2]=rowMatrices[rowPointer].secondaryMatrix;var rowMatrixLen=Math.max(matrices.center[0].length,matrices.center[2].length),columnMatrixLen=Math.max(matrices.top[1][0]?matrices.top[1][0].length:0,matrices.bottom[1][0]?matrices.bottom[1][0].length:0);return matrices.center[1]=centerMatrix.slice(centralMatrixPointer.row,centralMatrixPointer.row+rowMatrixLen).map(function(matrix){return matrix.slice(centralMatrixPointer.column,centralMatrixPointer.column+columnMatrixLen)}),{matrices:matrices,rowPages:rowMatrices.length,columnPages:columnMatrices.length}}(this,rowPointer,columnPointer),layoutDimensions=function getViewMeasurements(layout,maxRowHeight,maxColWidth){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_layout$config=layout.config(),columnPointer=_layout$config.columnPointer,rowPointer=_layout$config.rowPointer,rowSpaces=rowMatrix.getViewableSpaces()[rowPointer],colSpaces=columnMatrix.getViewableSpaces()[columnPointer],rowHeights=rowSpaces.rowHeights,rowMatrixWidth=rowSpaces.width,columnWidths=colSpaces.columnWidths,columnMatrixHeight=colSpaces.height,leftWidth=rowMatrixWidth.primary,rightWidth=rowMatrixWidth.secondary,topHeight=columnMatrixHeight.primary,bottomHeight=columnMatrixHeight.secondary,centerHeight=measureSum(rowHeights.primary),centerWidth=measureSum(columnWidths.primary),viewWidth=[leftWidth,Math.min(centerWidth,maxColWidth),rightWidth],viewHeight=[topHeight,Math.min(centerHeight,maxRowHeight),bottomHeight];return{viewWidth:viewWidth,viewHeight:viewHeight,actualCenterMeasures:{height:centerHeight,width:centerWidth},totalMeasures:{width:measureSum(viewWidth),height:measureSum(viewHeight)},unitHeights:rowHeights,unitWidths:columnWidths}}(this,maxRowHeight,maxColWidth);return layoutDimensions.border=border,this.viewInfo({viewMatricesInfo:viewMatricesInfo,layoutDimensions:layoutDimensions}),this}}],[{key:"defaultViewInfo",value:function defaultViewInfo(){return Object.assign({},{layoutDimensions:{border:this.defaultConfig().border,viewHeight:[0,0,0],viewWidth:[0,0,0]},viewMatricesInfo:{columnPages:0,rowPages:0,matrices:{top:[],center:[],bottom:[]}}})}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENTS}},{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIGURATION}},{key:"create",value:function create(){return new GridLayout(null,null,this.defaultMeasurement(),this.defaultConfig())}}]),GridLayout}();function border_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _matrixSpanGeneratorM,_spanApplierMap,borderMap=(border_helper_defineProperty(_borderMap={},"".concat("top","-").concat("left"),null),border_helper_defineProperty(_borderMap,"".concat("top","-").concat("middle"),"column"),border_helper_defineProperty(_borderMap,"".concat("top","-").concat("right"),null),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("left"),"row"),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("middle"),"center"),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("right"),"row"),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("left"),null),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("middle"),"column"),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("right"),null),_borderMap),border_helper_specificBorderApplier=function specificBorderApplier(borderTypes,showBorders,cells,borderInfo){var color=borderInfo.color,width=borderInfo.width,style=borderInfo.style,borderStyle="".concat(width,"px ").concat(style);borderTypes.forEach(function(borderType){!function applySpecificBorder(cells,color,type,style){cells.style("border-".concat(type),"".concat(style," ").concat(color))}(cells,showBorders[borderType]?color:"rgba(0,0,0,0)",borderType,borderStyle)})},border_helper_applyBorders=function applyBorders(cells,border,row,column){var borderApplierFn=function borderApplier(cells,borderInfo){var showRowBorders=borderInfo.showRowBorders,showColBorders=borderInfo.showColBorders,showValueBorders=borderInfo.showValueBorders;return{row:function row(){return border_helper_specificBorderApplier(["top","bottom"],showRowBorders,cells,borderInfo)},column:function column(){return border_helper_specificBorderApplier(["left","right"],showColBorders,cells,borderInfo)},center:function center(){return border_helper_specificBorderApplier(["left","right","top","bottom"],showValueBorders,cells,borderInfo)}}}(cells,border),borderMapVal=borderMap["".concat(ROW_MATRIX_INDEX[VIEW_INDEX[row]],"-").concat(COLUMN_MATRIX_INDEX[column])];borderMapVal&&borderApplierFn[borderMapVal]()};function span_maker_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var orderMaker=function orderMaker(arr){return Array.from(Array(arr.length).keys())},nestByStack=function nestByStack(stack,updateArr){var optionalParams=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},order=optionalParams.order,keyFn=optionalParams.keyFn,arr=updateArr.slice(),currStack=stack.slice(),prevStack=currStack.slice();if(order=order||Array.from(Array(arr.length).keys()),keyFn=keyFn||function(v){return v},0===currStack.length){var _newArr=[];return order.forEach(function(e){_newArr.push(arr[e])}),{prevStack:prevStack,currStack:arr,arr:_newArr}}for(var arrVal="",stackVal="",newArr=[],i=order.length-1;i>=0;i--){var currElemIndex=order[i];if((arrVal+=keyFn(arr[currElemIndex]))===(stackVal+=keyFn(currStack[currElemIndex])))newArr[currElemIndex]=null;else{stackVal="";for(var j=i;j0&&void 0!==arguments[0]?arguments[0]:1,placeholder=arguments.length>1?arguments[1]:void 0,config=arguments.length>2?arguments[2]:void 0,index=arguments.length>3?arguments[3]:void 0,height=placeholder.availHeight(),width=placeholder.availWidth(),borderWidth=config.border.width,unitWidths=config.dimensions.unitWidths,col=index.col;return span_maker_defineProperty(_ref={},"rowSpan",function(){placeholder.setAvailableSpace(width,height*span),1===span&&renderer_utils_selectElement(this).style("height","".concat(height*span+borderWidth,"px"))}),span_maker_defineProperty(_ref,"colSpan",function(){var primaryUnitWidth=unitWidths.primary[col];if(span>1){for(var cumulativeWidth=0,i=col;i0&&void 0!==arguments[0]?arguments[0]:0}},{key:"type",get:function get(){return"simple"}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),SimpleCell}();function enums_defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var visual_cell_src_props_PROPS,enums_defaults_DEFAULT_CONFIG=(enums_defaults_defineProperty(_DEFAULT_CONFIG={},"margin",(enums_defaults_defineProperty(_CONSTANTS$MARGIN={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$MARGIN)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"spaceFixer",2),enums_defaults_defineProperty(_DEFAULT_CONFIG,"isOffset",!1),enums_defaults_defineProperty(_DEFAULT_CONFIG,"verticalAlign",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"textAlign","center"),enums_defaults_defineProperty(_DEFAULT_CONFIG,"show",!0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"maxLines",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"minCharacters",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"rotation",null),_DEFAULT_CONFIG);function visual_cell_src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_PROPS={mount:{},availHeight:{},availWidth:{},config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config,value)}},logicalSpace:{},minSpacing:{},source:{}},packages_visual_cell_src_props_PROPS=(visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS={},GEOM,mergeRecursive({data:{},caption:{},config:{},axes:{},facetByFields:{},fields:{},transform:{},layerDef:{},detailFields:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_TEXT,mergeRecursive({smartText:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_AXIS,DEFAULT_PROPS),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,BLANK,DEFAULT_PROPS),visual_cell_src_props_PROPS);function axis_cell_typeof(obj){return(axis_cell_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function axis_cell_defineProperties(target,props){for(var i=0;i(availWidth||0)&&maxLines&&(space.height=space.oriTextHeight*maxLines),availWidth&&availWidth":">",'"':""","'":"'","/":"/"};return"".concat(str).replace(/[&<>"'/]/g,function(match){return htmlEscapes[match]})}(rawContent()):rawContent()},createHeading=function createHeading(config,type,labelManager,prevCell){return config?function headerCreator(config,cellType,labelManager,prevCell){var margin={},content=config.content,classPrefix=config.classPrefix,maxLines=config.maxLines,cell=prevCell||new src_text_cell({type:"title"===cellType?"header":"text",className:"".concat(classPrefix,"-").concat(cellType,"-cell")},{labelManager:labelManager}).config({maxLines:maxLines}).minSpacing({width:0,height:0});return cell.source(content),cell._minTickDiff={height:0,width:0},margin=config.position===src_constants_TOP?{top:0,bottom:config.padding}:{top:config.padding,bottom:0},cell.config({margin:margin}),{height:cell.getLogicalSpace().height,cell:cell}}(config,type,labelManager,prevCell):""},legend_maker_legendInitializer=function legendInitializer(legendConfig,canvas,measurement,prevLegends){var legends=[],height=measurement.height,width=measurement.width,headerHeight=measurement.headerHeight,position=legendConfig.position,align=legendConfig.align,legendInfo=function legendCreator(canvas){var LegendCls,dataset=[],axes=canvas.getRetinalAxes();return Object.entries(axes).forEach(function(axisInfo){var scale=axisInfo[1][0],scaleType=axisInfo[0],scaleProps=canvas[scaleType]();if(scaleProps.field&&scale){var _scale$config=scale.config(),type=_scale$config.type,step=_scale$config.step,stepMapper="boolean"==typeof step&&step;LegendCls=LEGEND_TYPE_MAP["".concat(type,"-").concat(stepMapper,"-").concat(scaleType)],dataset.push({scale:scale,canvas:canvas,fieldName:scaleProps.field,title:retrieveFieldDisplayName(canvas.data(),scaleProps.field),LegendCls:LegendCls,scaleType:scaleType})}}),dataset}(canvas),invalidValues=canvas.config().invalidValues,parser=getValueParser(invalidValues);return legendInfo.forEach(function(dataInfo,index){var legendMeasures={},LegendCls=dataInfo.LegendCls,scale=dataInfo.scale,fieldName=dataInfo.fieldName,titleText=dataInfo.title,scaleType=dataInfo.scaleType,config=legendConfig[scaleType]||{},title=config.title||{};if(title.text=title.text||titleText,config.show){config.position=position,config.align=align;var legend=getObjProp(prevLegends[scaleType],index);legend||(legend=LegendCls.create({labelManager:canvas._dependencies.smartlabel,cells:{AxisCell:axis_cell,TextCell:src_text_cell}})),legendMeasures.maxHeight="vertical"===align?height-headerHeight:.2*height,legendMeasures.maxWidth="horizontal"===align?width:.2*width,legendMeasures.width=Math.min(legendMeasures.maxWidth,config.width),legendMeasures.height=Math.min(legendMeasures.maxHeight,config.height),[PADDING,BORDER,MARGIN].forEach(function(e){legendMeasures[e]=config[e]});var metaData=legend.metaData();metaData instanceof datamodel_default.a&&metaData.dispose(),legend.scale(scale).valueParser(parser).title(title).fieldName(fieldName).config(config).metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName])).measurement(legendMeasures).canvasAlias(canvas.alias()).setLegendMeasures(),legends.push({canvas:canvas,legend:legend,scaleType:scaleType})}}),legends};function muze_chart_component_typeof(obj){return(muze_chart_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function muze_chart_component_defineProperties(target,props){for(var i=0;icurrHeight?(sections++,currWidth=0,currHeight=legHeight):sections<0&§ions++,sectionComponents[sections]=sectionComponents[sections]||[],currHeight-=Math.min(leg.measurement().height,currHeight),currWidth=Math.max(Math.min(leg.measurement().width,leg.measurement().maxWidth),currWidth),sectionComponents[sections].push({legend:leg,legendHeight:legHeight,legendWidth:currWidth})});var mount=makeElement(legendMount,["div"],sectionComponents,"".concat(classPrefix,"-legend-section"));mount.classed("".concat(classPrefix,"-legend-vertical-section"),!0).style("width",function(d){return"".concat(d[0].legendWidth,"px")}),makeElement(mount,["div"],function(d){return d},"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legendWidth,"px")})}else{var _mount=makeElement(legendMount,"div",[1],"".concat(classPrefix,"-legend-section"));_mount.classed("".concat(classPrefix,"-legend-horizontal-section"),!0),_mount.classed("".concat(classPrefix,"-legend-section-",0),!0).style("width","".concat(legWidth,"px")),makeElement(_mount,"div",this.components,"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legend.measurement().width,"px")})}}},{key:"draw",value:function draw(container){this.renderLegend(container||document.getElementById(this.renderAt()))}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.boundBox(params.config.measurement.legendSpace),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.components=params.component,this.params=params,this.target(params.config.target),this.position(params.config.position);var _defaultAlignmentHelp=function defaultAlignmentHelper(position){var alignment=null,alignWith="".concat(ROW_MATRIX_INDEX[1],"-").concat(COLUMN_MATRIX_INDEX[1]);switch(position){case src_constants_TOP:case src_constants_BOTTOM:alignment=HORIZONTAL_CENTER;break;case src_constants_LEFT:case src_constants_RIGHT:alignment=VERTICAL_CENTER;break;default:alignment=VERTICAL_CENTER}return{alignment:alignment,alignWith:alignWith}}(params.config.position),alignWith=_defaultAlignmentHelp.alignWith,alignment=_defaultAlignmentHelp.alignment;this.className(params.config.className),this.alignWith(params.config.alignWith||alignWith),this.alignment(params.config.alignment||alignment)}}]),LegendComponent}(),helper_d3Drag=(__webpack_require__(25),renderer_utils_getD3Drag()),arrowSizeMap={left:"width",right:"width",top:"height",bottom:"height"},getUnitPositions=function getUnitPositions(unitMeasures,totalLength,viewLength){var currentLen=0;return(unitMeasures.primary&&unitMeasures.primary.length?unitMeasures.primary:unitMeasures.secondary).map(function(e){var unitPosition=100*currentLen/(totalLength-viewLength);return currentLen+=e,unitPosition})},helper_createScrollBarArrow=function createScrollBarArrow(mount,type,config){var classPrefix=config.classPrefix,thickness=config.thickness,arrow=makeElement(mount,"div",[type],"".concat(classPrefix,"-scroll-arrow-").concat(type));return arrow.classed("".concat(classPrefix,"-scroll-arrow"),!0),arrow.style(arrowSizeMap[type],"".concat(thickness,"px")),makeElement(arrow,"div",[1],"".concat(classPrefix,"-scroll-arrow-chevron")).attr("id","".concat(classPrefix,"-scroll-arrow-chevron-").concat(type)),arrow},helper_createScrollBarRect=function createScrollBarRect(mount,config){var classPrefix=config.classPrefix,rect=makeElement(mount,"div",[1],"".concat(classPrefix,"-scroll-rect"));return{rect:rect,mover:makeElement(rect,"div",[1],"".concat(classPrefix,"-scroll-mover"))}},applyScrollMouseDownAction=function applyScrollMouseDownAction(moverRect,scrollMaker,speed){var mover=moverRect.mover,rect=moverRect.rect,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y;scrollMaker.changeMoverPosition({x:x-rectX+speed,y:y-rectY+speed})},helper_registerListenerOnArrow=function registerListenerOnArrow(scrollMaker,moverRect,arrowType,speed){var timer="",arrow=scrollMaker._components[arrowType],isTouchDevice=hasTouch();arrow.on(isTouchDevice?"touchstart":"mousedown",function(){renderer_utils_getEvent().preventDefault(),timer=setInterval(function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)},100)}).on(isTouchDevice?"touchend":"mouseup",function(){renderer_utils_getEvent().preventDefault(),clearInterval(timer)}).on("click",function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)})},helper_registerListeners=function registerListeners(scrollMaker){var moverRect=scrollMaker._components.moverRect,speed=scrollMaker.config().speed;helper_registerListenerOnArrow(scrollMaker,moverRect,"prevArrow",-speed),function applyMoverDrag(scrollMaker,moverRect){var startPos={},moverStartPos=0,rectStartPos=0,endPos={},mover=moverRect.mover,rect=moverRect.rect;mover.call(helper_d3Drag().on("start",function(){var event=renderer_utils_getEvent();moverStartPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect(),startPos={x:event.x,y:event.y}}).on("drag",function(){var event=renderer_utils_getEvent(),window=getWindow(),distanceMoved_x=(endPos={x:event.x,y:event.y}).x-startPos.x,distanceMoved_y=endPos.y-startPos.y,actualPosition={x:moverStartPos.x+distanceMoved_x-rectStartPos.x+window.pageXOffset,y:moverStartPos.y+distanceMoved_y-rectStartPos.y+window.pageYOffset};scrollMaker.changeMoverPosition(actualPosition)}))}(scrollMaker,moverRect),function applyRectClick(scrollMaker,moverRect){moverRect.rect.on("click",function(){var event=renderer_utils_getEvent();scrollMaker.emptyScrollAreaClick(event)})}(scrollMaker,moverRect),helper_registerListenerOnArrow(scrollMaker,moverRect,"nextArrow",speed)},scroll_bar_maker_props_PROPS={config:{sanitization:function sanitization(context,value){return value=mergeRecursive(context._config,value)}},manager:{},unitPositions:{},logicalSpace:{}};function scroll_maker_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=horizontal_scroll_maker_get(horizontal_scroll_maker_getPrototypeOf(HorizontalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,config,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"left",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"right",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitWidths=_this$logicalSpace.unitWidths,scrollBarWithouArrowLength=width-2*height;rect.style("width","".concat(dimensions.width-2*height,"px")),rect.style("height","".concat(100,"%")),mover.style("width","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style("height","".concat(100,"%")),mover.style(src_constants_LEFT,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitWidths,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.xrectStartPos.width?rectStartPos.width-moverPos.width:newPosition.x,mover.style(src_constants_LEFT,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:0,x:moverPos.x-rectStartPos.x-delta}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.width)/100;return this.changeMoverPosition({y:0,x:movement}),this}}],[{key:"type",value:function type(){return"horizontal"}}]),HorizontalScrollMaker}(),vertical:function(_ScrollMaker){function VerticalScrollMaker(){return function vertical_scroll_maker_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VerticalScrollMaker),vertical_scroll_maker_possibleConstructorReturn(this,vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker).apply(this,arguments))}return function vertical_scroll_maker_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&vertical_scroll_maker_setPrototypeOf(subClass,superClass)}(VerticalScrollMaker,scroll_maker_ScrollMaker),function vertical_scroll_maker_createClass(Constructor,protoProps,staticProps){return protoProps&&vertical_scroll_maker_defineProperties(Constructor.prototype,protoProps),staticProps&&vertical_scroll_maker_defineProperties(Constructor,staticProps),Constructor}(VerticalScrollMaker,[{key:"createScroll",value:function createScroll(mountPoint){var dimensions=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=vertical_scroll_maker_get(vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"top",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"bottom",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitHeights=_this$logicalSpace.unitHeights,scrollBarWithouArrowLength=height-2*width;rect.style("height","".concat(scrollBarWithouArrowLength,"px")),rect.style("width","".concat(100,"%")),mover.style("width","".concat(100,"%")),mover.style("height","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style(src_constants_TOP,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitHeights,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.yrectStartPos.height?rectStartPos.height-moverPos.height:newPosition.y,mover.style(src_constants_TOP,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:moverPos.y-rectStartPos.y-delta,x:0}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.height)/100;return this.changeMoverPosition({x:0,y:movement}),this}}],[{key:"type",value:function type(){return"vertical"}}]),VerticalScrollMaker}()},ScrollComponent=function(_MuzeComponent){function ScrollComponent(params){var _this;!function scroll_component_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ScrollComponent);var ScrollMaker=scrollMakerMap[params.config.type];return params.component=new ScrollMaker,params.component.config(params.config.scrollBarComponentConfig),params.component.logicalSpace(params.dimensions),(_this=scroll_component_possibleConstructorReturn(this,scroll_component_getPrototypeOf(ScrollComponent).call(this,params.name,params.component.getLogicalSpace(),0))).setParams(params),_this}return function scroll_component_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&scroll_component_setPrototypeOf(subClass,superClass)}(ScrollComponent,MuzeComponent),function scroll_component_createClass(Constructor,protoProps,staticProps){return protoProps&&scroll_component_defineProperties(Constructor.prototype,protoProps),staticProps&&scroll_component_defineProperties(Constructor,staticProps),Constructor}(ScrollComponent,[{key:"manager",value:function manager(){return arguments.length?(this.component.manager(arguments.length<=0?void 0:arguments[0]),this):this.component.manager()}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){return this.component.scrollDeltaTo(delta),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){return this.component.scrollTo(scrollPercentage),this}},{key:"scrollToUnitIndex",value:function scrollToUnitIndex(unitIndex){var unitPositions=this.component.unitPositions(),sanitizedUnitIndex=Math.min(Math.max(0,unitIndex),unitPositions.length-1);return this.component.scrollTo(unitPositions[sanitizedUnitIndex]),this}},{key:"getScrollPositionsForUnits",value:function getScrollPositionsForUnits(){return this.component.unitPositions()}},{key:"draw",value:function draw(container){return this.component.createScroll(container||document.getElementById(this.renderAt())),this}},{key:"attachScrollAction",value:function attachScrollAction(externalAction){return this.component.attachScrollAction(externalAction),this}},{key:"detachScrollAction",value:function detachScrollAction(){return this.component.detachScrollAction(),this}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.component.config(params.config.scrollBarComponentConfig),this.component.logicalSpace(params.dimensions),this.boundBox(this.component.getLogicalSpace()),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.component=params.component||this.component,this.params=params,this.target(params.config.target),this.position(params.config.position),this.className(params.config.className),this.alignWith(params.config.alignWith),this.alignment(params.config.alignment)}},{key:"remove",value:function remove(){this.component.remove()}}]),ScrollComponent}();function matrix_component_typeof(obj){return(matrix_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function matrix_component_defineProperties(target,props){for(var i=0;iMath.abs(wheelDeltaY)&&scrollBarManager.preventBrowserScroll("horizontal",event).triggerScrollBarAction("horizontal",wheelDeltaX/30),0!==wheelDeltaY&&Math.abs(wheelDeltaX)0?heightAttr:height,minHeight),availableWidthForCanvas=Math.max(widthAttr>0?widthAttr:width,minWidth),_createHeaders=function createHeaders(context,canvasHeight,canvasWidth){var headerHeight=0,headers={},subtitle=context.subtitle(),isSubtitle=title_maker_resolveTitleSubTitleContent(subtitle[0]);return canvasHeight>=200&&canvasWidth>=200&&["title","subtitle"].forEach(function(type){var headerOptions=context[type](),content=title_maker_resolveTitleSubTitleContent(headerOptions[0]);if(content){var config=headerOptions[1];config.width=context.width(),config.height=context.height(),config.classPrefix=context.config().classPrefix,config.content=content,config.padding="title"!==type||isSubtitle.length?config.padding:subtitle[1].padding;var _createHeading=createHeading(config,type,context.dependencies().smartlabel,context["".concat(type,"Cell")]),height=_createHeading.height,cell=_createHeading.cell;headers["".concat(type,"Cell")]=cell,context._composition[type]=cell,headerHeight+=height}}),{headerHeight:headerHeight,headers:headers}}(context,availableHeightForCanvas,availableWidthForCanvas),headers=_createHeaders.headers,headerHeight=_createHeaders.headerHeight,legends=function createLegend(context,headerHeight,height,width){var measurement={height:height,width:width,headerHeight:headerHeight},legend=context.config().legend,show=legend.show,position=legend.position;legend.classPrefix=context.config().classPrefix;var align=position===src_constants_LEFT||position===src_constants_RIGHT?"vertical":"horizontal";return legend.show=show?"vertical"===align&&width>200||"horizontal"===align&&height>200:show,legend.align=align,legend_maker_legendInitializer(legend,context,measurement,context.composition().legend||{})}(context,headerHeight,availableHeightForCanvas,availableWidthForCanvas);context._composition.legend={},legends.forEach(function(e){context._composition.legend[e.scaleType]=e.legend});var legendSpace=function getLegendSpace(legends,legendConfig,availableHeight,availableWidth){var legendSpace={width:0,height:0};return legends.map(function(legendInfo){return legendInfo.legend.measurement()}).forEach(function(space){var height,width;width=Math.min(space.width,space.maxWidth),height=Math.min(space.height,space.maxHeight),"horizontal"===legendConfig.align?legendSpace.width+width>availableWidth?(legendSpace.width=availableWidth,legendSpace.height+=height):(legendSpace.width+=width,legendSpace.height=Math.max(legendSpace.height,height)):legendSpace.height+height>availableHeight?(legendSpace.height=height,legendSpace.width+=width):(legendSpace.height+=height,legendSpace.width=Math.max(legendSpace.width,width))}),"horizontal"===legendConfig.align&&(legendSpace.width=availableWidth),legendSpace}(legends,legend,availableHeightForCanvas,availableWidthForCanvas),legendWidth=legendPosition===src_constants_LEFT||legendPosition===src_constants_RIGHT?legendSpace.width:0,legendHeight=legendPosition===src_constants_TOP||legendPosition===src_constants_BOTTOM?legendSpace.height:0,components={headers:headers,legends:legends,canvases:[context],rows:rows,columns:columns,values:values,cornerMatrices:visGroup.cornerMatrices()},measurement={mountSpace:{height:height,width:width},headerHeight:headerHeight,legendSpace:legendSpace,canvasWidth:availableWidthForCanvas,canvasHeight:availableHeightForCanvas,width:availableWidthForCanvas-legendWidth,height:availableHeightForCanvas-headerHeight-legendHeight,minUnitHeight:context.minUnitHeight(),minUnitWidth:context.minUnitWidth()};return{layoutConfig:layoutConfig=mergeRecursive(layoutConfig,{classPrefix:classPrefix,showHeaders:showHeaders,border:mergeRecursive(visGroup.metaData().border,context.config().border),layoutArrangement:layoutArrangement,legend:legend,buffer:scrollBar.thickness,pagination:pagination,title:titleConfig,subtitle:subtitleConfig,isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,mount:mount,priority:priority}),components:components,measurement:measurement}},componentIndexes={title:0,subtitle:1,legend:2,verticalScrollBar:3,horizontalScrollBar:4,grid:5,message:6},componentNames={0:"title",1:"subtitle",2:"legend",3:"verticalScrollBar",4:"horizontalScrollBar",5:"grid",6:"message"},layout_maker_renderLayout=function renderLayout(canvas,renderDetails){var layoutManager=canvas._layoutManager,gridLayout=canvas.layout(),grid=componentIndexes.grid,compWrappers=component_wrapper_maker_componentWrapperMaker(canvas,gridLayout,renderDetails),componentWrappers=Object.keys(componentIndexes).map(function(e){return compWrappers[e]});componentWrappers[grid]&&function createScrollManager(componentWrappers,canvas){var verticalScrollBar=componentIndexes.verticalScrollBar,grid=componentIndexes.grid,horizontalScrollWrapper=componentWrappers[componentIndexes.horizontalScrollBar],verticalScrollWrapper=componentWrappers[verticalScrollBar],gridWrapper=componentWrappers[grid],scrollBarManager=new ScrollManager,scrollBarComponents={};verticalScrollWrapper&&(scrollBarComponents.vertical=verticalScrollWrapper),horizontalScrollWrapper&&(scrollBarComponents.horizontal=horizontalScrollWrapper),scrollBarManager.scrollBarComponents(scrollBarComponents).attachedComponents({grid:gridWrapper}),canvas.composition().hScrollBar=horizontalScrollWrapper,canvas.composition().vScrollBar=verticalScrollWrapper,[horizontalScrollWrapper,verticalScrollWrapper].forEach(function(wrapper){wrapper&&wrapper.manager(scrollBarManager)}),gridWrapper.scrollBarManager(scrollBarManager)}(componentWrappers,canvas),componentWrappers.forEach(function(componentWrapper,index){if(!componentWrapper){var deleteElementName=componentNames[index];layoutManager.removeComponent(deleteElementName)}}),layoutManager.registerComponents(componentWrappers).compute(),function attachListeners(componentWrappers){componentWrappers.forEach(function(componentWrapper){componentWrapper&&componentWrapper.attachListener()})}(componentWrappers)};function group_firebolt_typeof(obj){return(group_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function group_firebolt_defineProperties(target,props){for(var i=0;ii.getFullYear()&&(t=""+(a-1)+r),p(t).getFullYear()},formatter:function formatter(e){var t=p(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:"Y",index:0,extract:function extract(){return"(\\d{4})"},parser:h.defaultNumberParser(),formatter:function formatter(e){return p(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function t(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[a+1],-1!==r.indexOf(o)&&i.push({index:a,token:o});return i},h.formatAs=function(e,t){var n,r=p(e),i=h.findTokens(t),a=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=i.length;l=0;p--)(f=a[p].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(p=0;p0&&e.split(",").forEach(function(e){var n=e.split("-"),r=+n[0],i=+(n[1]||n[0]);if(i>=r)for(var a=r;a<=i;a+=1)t(a)})}var R=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:V.CROSS,a=[],o=[],u=n||J,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,p=c.name+"."+f.name,d=H(c,f);if(l===s)throw new Error("DataModels must have different alias names");return c.fields.forEach(function(e){var t=O({},e.schema());-1===d.indexOf(t.name)||r||(t.name=c.name+"."+t.name),a.push(t)}),f.fields.forEach(function(e){var t=O({},e.schema());-1!==d.indexOf(t.name)?r||(t.name=f.name+"."+t.name,a.push(t)):a.push(t)}),N(e._rowDiffset,function(n){var p=!1,h=void 0;N(t._rowDiffset,function(v){var y=[],m={};m[l]={},m[s]={},c.fields.forEach(function(e){y.push(e.partialField.data[n]),m[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}}),f.fields.forEach(function(e){-1!==d.indexOf(e.schema().name)&&r||y.push(e.partialField.data[v]),m[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}});var b=Bt(m[l]),g=Bt(m[s]);if(u(b,g,function(){return e.detachedRoot()},function(){return t.detachedRoot()},{})){var _={};y.forEach(function(e,t){_[a[t].name]=e}),p&&V.CROSS!==i?o[h]=_:(o.push(_),p=!0,h=n)}else if((i===V.LEFTOUTER||i===V.RIGHTOUTER)&&!p){var w={},O=c.fields.length-1;y.forEach(function(e,t){w[a[t].name]=t<=O?e:null}),p=!0,h=n,o.push(w)}})}),new Sn(o,a,{name:p})}function z(e,t){var n=""+e,r=""+t;return nr?1:0}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;return e.length>1&&function e(t,n,r,i){if(r===n)return t;var a=n+Math.floor((r-n)/2);return e(t,n,a,i),e(t,a+1,r,i),function(e,t,n,r,i){for(var a=e,o=[],u=t;u<=r;u+=1)o[u]=a[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(a[l]=o[f],f+=1):f>r?(a[l]=o[c],c+=1):i(o[c],o[f])<=0?(a[l]=o[c],c+=1):(a[l]=o[f],f+=1)}(t,n,a,r,i),t}(e,0,e.length-1,t),e}var W=function W(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function X(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=""+e)==(t=""+t)?0:e>t?-1:1}}return n}(e.type,n)}function Z(e,t){var n=new Map,r=[];return e.forEach(function(e){var i=e[t];n.has(i)?r[n.get(i)][1].push(e):(r.push([i,[e]]),n.set(i,r.length-1))}),r}function $(e,t,n){var r={label:e[0]};return t.reduce(function(t,r,i){return t[r]=e[1].map(function(e){return e[n[i].index]}),t},r),r}function Q(e,t,n){for(var r=void 0,i=void 0,a=void 0,o=n.length-1;o>=0;o--)r=n[o][0],i=n[o][1],(a=sn(t,r))&&("function"==typeof i?K(e,function(e,t){return i(e[a.index],t[a.index])}):E(i)?function(){var n=Z(e,a.index),r=i[i.length-1],o=i.slice(0,i.length-1),u=o.map(function(e){return sn(t,e)});n.forEach(function(e){e.push($(e,o,u))}),K(n,function(e,t){var n=e[2],i=t[2];return r(n,i)}),e.length=0,n.forEach(function(t){e.push.apply(e,X(t[1]))})}():function(){var t=q(a,i);K(e,function(e,n){return t(e[a.index],n[a.index])})}())}var ee,te=function e(t,n,r,i){if(0===t.length)return n;var a=t[0],o=new Map;n.reduce(function(e,t){var n=t[a.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e},o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var p=l.value,d=W(p,2),h=d[0],v=d[1],y=e(t.slice(1),v,r,i);o.set(h,y),Array.isArray(y)&&Q(y,r,i)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function re(e,t,n,r,i){var a={schema:[],data:[],uids:[]},o=(i=Object.assign({},{addUid:!1,columnWise:!1},i)).addUid,u=r&&r.length>0,c=[];if(n.split(",").forEach(function(t){for(var n=0;nr&&(r=i))}),[n,r]},Ke=function(){function e(e,t){for(var n=0;n=a?c=!0:(r=e.charCodeAt(o++))===ht?f=!0:r===vt&&(f=!0,e.charCodeAt(o)===ht&&++o),e.slice(i+1,t-1).replace(/""/g,'"')}for(;o9999?"+"+bt(t,6):bt(t,4))+"-"+bt(e.getUTCMonth()+1,2)+"-"+bt(e.getUTCDate(),2)+(a?"T"+bt(n,2)+":"+bt(r,2)+":"+bt(i,2)+"."+bt(a,3)+"Z":i?"T"+bt(n,2)+":"+bt(r,2)+":"+bt(i,2)+"Z":r||n?"T"+bt(n,2)+":"+bt(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function parse(e,t){var n,i,a=r(e,function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=yt(e);return function(r,i){return t(n(r),i,e)}}(e,t):yt(e)});return a.columns=i||[],a},parseRows:r,format:function format(t,n){return null==n&&(n=mt(t)),[n.map(o).join(e)].concat(i(t,n)).join("\n")},formatBody:function formatBody(e,t){return null==t&&(t=mt(e)),i(e,t).join("\n")},formatRows:function formatRows(e){return e.map(a).join("\n")},formatRow:a,formatValue:o}},wt=function wt(e,t,n){if(!Array.isArray(t))throw new Error("Schema missing or is in an unsupported format");var r=t.map(function(e){return e.name});n=Object.assign({},{firstRowHeader:!0},n);var i=[],a=v(i),o=r;n.firstRowHeader&&(o=e.splice(0,1)[0]);var u=o.reduce(function(e,t,n){return Object.assign(e,(a=n,(i=t)in(r={})?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r));var r,i,a},{});return e.forEach(function(e){var t=[];return r.forEach(function(n){var r=u[n];t.push(e[r])}),a.apply(void 0,t)}),[r,i]},Ot=function Ot(e,t,n){n=Object.assign({},{firstRowHeader:!0,fieldSeparator:","},n);var r=_t(n.fieldSeparator);return wt(r.parseRows(e),t,n)},Et=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){return e.store.set(t.type,t)}),this.store}},{key:"register",value:function value(e){return e instanceof lt?(this.store.set(e.type,e),this):null}},{key:"unregister",value:function value(e){return this.store.delete(e.type),this}},{key:"get",value:function value(e){return this.store.has(e)?this.store.get(e):null}}]),e}(),xt=function(){var e=null;return e||new It}(),Ut=function Ut(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,Vt(i))):e._derivation.push({op:t,meta:r,criteria:i})})(t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},arguments[4]),function Jt(e,t){var n;(n=t._ancestorDerivation).push.apply(n,Vt(e._ancestorDerivation).concat(Vt(e._derivation)))}(e,t)},zt=(Lt(Ct={},l.NORMAL,{diffIndex:["rowDiffset"],calcDiff:[!0,!1]}),Lt(Ct,l.INVERSE,{diffIndex:["rejectRowDiffset"],calcDiff:[!1,!0]}),Lt(Ct,l.ALL,{diffIndex:["rowDiffset","rejectRowDiffset"],calcDiff:[!0,!0]}),Ct),Kt=function Kt(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split("-")[0]+"-"+t}else e.push(""+t)},Wt=function Wt(e,t,n){var r=[],i=[],a=Ut(zt[n].calcDiff,2),o=a[0],u=a[1];return N(e,function(e){var n=t(e);n&&o&&Kt(r,e,-1),!n&&u&&Kt(i,e,-1)}),{rowDiffset:r.join(","),rejectRowDiffset:i.join(",")}},qt=function qt(e,t,n,r,i){var a={},o=function o(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e._partialFieldspace._cachedValueObjects;return i(c,function(e){return t(f[e],e,o,a)},u)},Qt=function Qt(e,t,n,r){var i=e[n];return i===U?r:t[i].internalValue},en=function en(e,t){return(t[0]instanceof Array?t:[t]).some(function(t){return e>=t[0]&&e<=t[1]})},tn=(Lt(Mt={},c.CONTINUOUS,en),Lt(Mt,u.TEMPORAL,en),Mt),rn=function rn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=n.operation||"and",a=n.filterByDim,o=void 0===a||a,u=n.filterByMeasure,c=void 0!==u&&u,l=n.clone,p=void 0===l||l?function Zt(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map(function(e){return e.name()}).join(","),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t}(e):e,d=p.getFieldsConfig();return r=t.length?t.map(function(e){return function(e){var t=e.criteria,n=void 0===t?{}:t,r=n.identifiers,i=void 0===r?[[],[]]:r,a=n.range,u=Ut(i,2),l=u[0],s=void 0===l?[]:l,p=u[1],h=void 0===p?[]:p,v=s.reduce(function(e,t,n){return e[t]=n,e},{}),y=(s=s.filter(function(e){return e in d&&d[e].def.type===f.DIMENSION||e===U})).length,m={};if(y)for(var b=function b(e,t){var n=i[e],r=""+s.map(function(e){var t=v[e];return n[t]});m[r]=1},g=1,_=i.length;g<_;g++)b(g);var w=Object.keys(a||{}).filter(function(e){return e in d}),O=h.length||w.length;return c||(w=w.filter(function(e){return d[e].def.type!==f.MEASURE})),o||(w=w.filter(function(e){return d[e].def.type!==f.DIMENSION})),O?function(e,t){var n=!0;return o&&(n=!y||m[function $t(e,t,n,r){for(var i=n(e,t,0,r),a=1,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t}(e.model)}))})}i=(s=[]).concat.apply(s,[].concat(Vt(d.map(c)),[{criteria:e,groupedModel:null!==e&&e.fields.some(function(e){return e.type===f.MEASURE})?dn(n.propagationSource):null}])).filter(function(e){return null!==e}),l.push({criteria:i,excludeModels:[].concat(h,Vt(r.excludeModels||[]))})}var y=t.model,m=Object.assign({sourceIdentifiers:e,propagationSourceId:u},r);l.forEach(function(e){var t=e.criteria,n=rn(y,t,{filterByMeasure:!!t.find(function(e){return e.groupedModel===y})}),r=e.path;if(r){var i=function(e,t){for(var n=0,r=t.length;n2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.excludeModels||[],o=i.criteria;(!a.length||-1===a.indexOf(t))&&t.handlePropagation(n,r),t._children.forEach(function(t){var a=o.filter(function(e){return e.groupedModel===t}),u=pn(n,t);a.length&&(u=rn(u,a,{filterByDim:!1,filterByMeasure:!0,clone:!1})),e(t,u,r,i)})}(y,n,m,{excludeModels:e.excludeModels,criteria:t})})},gn=function gn(e,t,n){var r=e.reduce(function(e,r){return"RegExp"===r.constructor.name?e.push.apply(e,Vt(t.filter(function(e){return-1!==e.search(r)}))):r in n&&e.push(r),e},[]);return Array.from(new Set(r)).map(function(e){return e.trim()})},_n=function _n(e,t){return e.numberFormat?e.numberFormat()(t):t},wn=function(){function e(e,t){for(var n=0;n1?(i=e.clone(r.saveChild),an(i,u[c[1]],e,n,t),[o,i]):o}(this,e,t,{saveChild:t.saveChild})}},{key:"isEmpty",value:function value(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:"clone",value:function value(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:"project",value:function value(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),i=Object.keys(r),a=t.mode,o=gn(e,i,r);return a===l.ALL?[on(this,o,{mode:l.NORMAL,saveChild:t.saveChild},i),on(this,o,{mode:l.INVERSE,saveChild:t.saveChild},i)]:on(this,o,t,i)}},{key:"getFieldsConfig",value:function value(){return this._fieldConfig}},{key:"calculateFieldsConfig",value:function value(){return this._fieldConfig=this._fieldspace.fields.reduce(function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e},{}),this}},{key:"dispose",value:function value(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach(function(e){e._parent=null}),this._children=[]}},{key:"removeChild",value:function value(e){var t=this._children.findIndex(function(t){return t===e});-1===t||this._children.splice(t,1)}},{key:"setParent",value:function value(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:"getParent",value:function value(){return this._parent}},{key:"getChildren",value:function value(){return this._children}},{key:"getDerivations",value:function value(){return this._derivation}},{key:"getAncestorDerivations",value:function value(){return this._ancestorDerivation}}]),e}(),En=function En(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},jn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=""+e.join(),a=function Ae(e,t,n,r){var i=function(e,t){var n=[],r=e.getFieldspace().getDimension();return Object.entries(r).forEach(function(e){var r=je(e,1)[0];t&&t.length?-1!==t.indexOf(r)&&n.push(r):n.push(r)}),n}(e,t),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),i=Ee.defaultReducer();return Object.keys(r).forEach(function(e){"string"!=typeof t[e]&&(t[e]=r[e].defAggFn());var a=Ee.resolve(t[e]);a?n[e]=a:(n[e]=i,t[e]=ge)}),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],p=[],d={},h=[],v=void 0;Object.entries(u).forEach(function(e){var t=je(e,2),n=t[0],r=t[1];if(-1!==i.indexOf(n)||a[n])switch(p.push(O({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}});var y=0;N(e._rowDiffset,function(e){var t="";l.forEach(function(n){t=t+"-"+u[n].partialField.data[e]}),void 0===d[t]?(d[t]=y,h.push({}),l.forEach(function(t){h[y][t]=u[t].partialField.data[e]}),s.forEach(function(t){h[y][t]=[u[t].partialField.data[e]]}),y+=1):s.forEach(function(n){h[d[t]][n].push(u[n].partialField.data[e])})});var m={},b=function b(){return e.detachedRoot()};return h.forEach(function(e){var t=e;s.forEach(function(n){t[n]=a[n](e[n],b,m)})}),r?(r.__calculateFieldspace(),v=r):v=new xn(h,p,{name:c}),v}.apply(void 0,[this,e,t]);return Gt(this,a,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:Ee.defaultReducer()},t),n.saveChild?a.setParent(this):a.setParent(null),a}},{key:"sort",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:"row",sort:e}),i=[n.schema.map(function(e){return e.name})].concat(n.data),a=new this.constructor(i,n.schema,{dataFormat:"DSVArr"});return Gt(this,a,L.SORT,t,e),t.saveChild?a.setParent(this):a.setParent(null),a}},{key:"serialize",value:function value(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:","},t);var n=this.getFieldspace().fields,r=n.map(function(e){return e.formattedData()}),i=r[0].length,a=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(a=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach(function(t,n){t[e.name()]=new F(i[n],a[n],e)});return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:"calculateVariable",value:function value(e,t,n){var r=this;e=cn(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var i=this.getFieldsConfig(),a=t.slice(0,t.length-1),o=t[t.length-1];if(i[e.name]&&!n.replaceVar)throw new Error(e.name+" field already exists in datamodel");var u=a.map(function(e){var t=i[e];if(!t)throw new Error(e+" is not a valid column name.");return t.index}),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map(function(e){return f[e]}),s={},p=function p(){return r.detachedRoot()},d=[];N(c._rowDiffset,function(e){var t=l.map(function(t){return t.partialField.data[e]});d[e]=o.apply(void 0,An(t).concat([e,p,s]))});var h=ut([d],[e],[e.name]),v=En(h,1)[0];return c.addField(v),Gt(this,c,L.CAL_VAR,{config:e,fields:a},o),c}},{key:"propagate",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.isMutableAction,a=t.sourceId,o=t.payload,u=function hn(e){for(;e._parent;)e=e._parent;return e}(this),c=u._propagationNameSpace,l={groupByModel:dn(this),model:u};return n&&function bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,i=t.isMutableAction,a=t.criteria,o=t.action+"-"+t.sourceId;r=i?e.mutableActions:e.immutableActions,null===a?delete r[o]:r[o]={model:n,config:t}}(c,t,this),yn(e,l,{propagationNameSpace:c,sourceId:a,propagationSource:this},Object.assign({payload:o},t)),i&&function mn(e,t,n){var r=e.immutableActions;for(var i in r){var a=r[i],o=a.config,u=n.config.sourceId,c=!n.propConfig.filterImmutableAction||n.propConfig.filterImmutableAction(o,n.config);if(o.sourceId!==u&&c){var f=o.criteria;yn(f,{model:t,groupByModel:dn(a.model)},{propagationNameSpace:e,propagateToSource:!1,sourceId:u,propagationSource:a.model},o)}}}(c,u,{config:t,propConfig:r}),this}},{key:"on",value:function value(e,t){switch(e){case"propagation":this._onPropagation.push(t)}return this}},{key:"unsubscribe",value:function value(e){switch(e){case"propagation":this._onPropagation=[]}return this}},{key:"handlePropagation",value:function value(e,t){var n=this;this._onPropagation.forEach(function(r){return r.call(n,e,t)})}},{key:"bin",value:function value(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error("Field "+e+" doesn't exist");var r=t.name||e+"_binned";if(n[r])throw new Error("Field "+r+" already exists");var i=function(e,t,n){var r=n.buckets,i=n.binsCount,a=n.binSize,o=n.start,u=n.end,f=function M(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.domain(),2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var p=[],d=0;d=(a=e[i=n+Math.floor((r-n)/2)]).start&&t=a.end?n=i+1:t2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],i=r.saveChild,a=e.getFieldspace().fieldsObj(),o=qt(e.clone(i),n,r,e,function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},i=this.getFieldsConfig(),a=Object.keys(i),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach(function(e,n){o[n]=gn([].concat(An(e),An(t)),a,i)}),function un(e,t,n,r){return t.map(function(t){return on(e,t,n,r)})}(this,o,n,a)}}],[{key:"configureInvalidAwareTypes",value:function value(e){return C.invalidAwareVals(e)}},{key:"Reducers",get:function get(){return Ee}},{key:"Converters",get:function get(){return xt}},{key:"FieldTypes",get:function get(){return ot}}]),t}(),kn=be.sum,Dn=be.avg,Tn=be.min,Fn=be.max,Nn=be.first,Rn=be.last,Pn=be.count,Cn=be.std,Mn={compose:function compose(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,i=void 0,a=[];return t.forEach(function(e){r=e(r),a.push.apply(a,function Y(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t/gi),smartlabel},SmartLabelManager.store={},SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(!this._init)return!1;var size,csArr,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,container=this._container,style=this.style||{},cache=this._advancedCache||(this._advancedCache={}),advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]),cacheName=text+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||""),cacheInitName=text+"init"+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||"");return htmlSplCharSpace[text]&&(text=htmlSplCharSpace[text]),calculateDifference?void 0===(asymmetricDifference=cache[cacheInitName])&&(container.innerHTML=text.repeat?text.repeat(length):Array(length+1).join(text),tw=container.offsetWidth,container.innerHTML=text,twi=container.offsetWidth,asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1),advancedCacheKey.push(cacheInitName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()]):asymmetricDifference=0,(cachedStyle=cache[cacheName])?(csArr=cachedStyle.split(","),{width:parseFloat(csArr[0],10),height:parseFloat(csArr[1],10)}):(container.innerHTML=text,size={height:container.offsetHeight,width:container.offsetWidth+asymmetricDifference},cache[cacheName]=size.width+","+size.height,advancedCacheKey.push(cacheName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()],size)},SmartLabelManager.prototype._getWidthFn=function(){var contObj=this._containerObj,container=this._container,svgText=contObj.svgText;return svgText?function(str){var bbox,width;return svgText.textContent=str,(width=(bbox=svgText.getBBox()).width-SVG_BBOX_CORRECTION)<1&&(width=bbox.width),width}:function(str){return container.innerHTML=str,container.offsetWidth}},SmartLabelManager.prototype.setStyle=function(style){return this._init?style!==this.style||this._styleNotSet?(style||(style=this.style),slLib.setLineHeight(style),this.style=style,this._containerObj=sCont=this._containerManager.get(style),this._containerObj?(this._container=sCont.node,this._context=sCont.context,this._cache=sCont.charCache,this._lineHeight=sCont.lineHeight,this._styleNotSet=!1):this._styleNotSet=!0,this):void 0:this;var sCont},SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){return this._init?(this._showNoEllipses=!useEllipses,this):this},SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init)return!1;void 0===text||null===text?text="":"string"!=typeof text&&(text=text.toString());var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=!1,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],i=0,ellipsesStr=this._showNoEllipses?"":"...",lineHeight=this._lineHeight,context=this._context,container=this._container,sCont=this._containerObj,ellipsesWidth=sCont.ellipsesWidth,dotWidth=sCont.dotWidth,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,fastTrim=function fastTrim(str){for(var ws=/\s/,i=(str=str.replace(/^\s\s*/,"")).length;ws.test(str.charAt(i-=1)););return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:!1};if(getWidth=this._getWidthFn(),maxHeight===lineHeight&&(maxHeight*=1.2),container){if(!documentSupport.isBrowserLess){if((hasHTMLTag=slLib.xmlTagRegEx.test(text))?(container.innerHTML=text,smartLabel.oriTextWidth=oriWidth=container.offsetWidth,smartLabel.oriTextHeight=oriHeight=container.offsetHeight):(tmpText=text.replace(slLib.ltgtRegex,function(match){return"<"===match?"<":">"}),getOriSizeImproveObj=this.getOriSize(tmpText,!0),smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width,smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height),oriHeight<=maxHeight&&oriWidth<=maxWidth)return smartLabel.width=smartLabel.oriTextWidth=oriWidth,smartLabel.height=smartLabel.oriTextHeight=oriHeight,smartLabel;if(lineHeight>maxHeight)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=0,smartLabel.height=smartLabel.oriTextHeight=0,smartLabel}if(text=fastTrim(text).replace(/(\s+)/g," "),maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth,!hasHTMLTag){if(len=(oriTextArr=text.split("")).length,trimStr="",tempArr=[],tempChar=oriTextArr[0],this._cache[tempChar]?minWidth=this._cache[tempChar].width:(minWidth=getWidth(tempChar),this._cache[tempChar]={width:minWidth}),maxWidthWithEll>minWidth)i=(tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")).length;else{if(minWidth>maxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;ellipsesStr&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr=""))}if(strWidth=getWidth(tempArr.join("")),strHeight=this._lineHeight,noWrap){for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth))return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=getWidth(smartLabel.text),smartLabel.height=this._lineHeight,smartLabel;return smartLabel.text=tempArr.join(""),smartLabel.width=strWidth,smartLabel.height=this._lineHeight,smartLabel}for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth)){if(lastSpace=text.substr(0,tempArr.length).lastIndexOf(" "),lastDash=text.substr(0,tempArr.length).lastIndexOf("-"),lastSpace>lastIndexBroken?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastSpace,1,"
"),lastIndexBroken=lastSpace,newCharIndex=lastSpace+1):lastDash>lastIndexBroken?(lastDash===tempArr.length-1?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"
-")):(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"-
")),lastIndexBroken=lastDash,newCharIndex=lastDash+1):(tempArr.splice(tempArr.length-1,1,"
"+oriTextArr[i]),lastLineBreak=tempArr.length-2,strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join("")),lastIndexBroken=lastLineBreak,newCharIndex=i),(strHeight+=this._lineHeight)>maxHeight)return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=maxWidth,smartLabel.height=strHeight-this._lineHeight,smartLabel;maxStrWidth=max(maxStrWidth,strWidth),trimStr=null,nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this),strWidth=getWidth(text.substr(newCharIndex,nearestChar||1)),tempArr.length)/g,'$1'),container.innerHTML=text,x=0,y=(spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString)).length;xmaxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;if(minWidth>maxWidthWithEll&&!this._showNoEllipses&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr="")),initialLeft=characterArr[0].elem.offsetLeft,initialTop=characterArr[0].elem.offsetTop,noWrap)for(;imaxWidthWithEll&&(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),container.offsetWidth>maxWidth&&(removeFromIndex=i,i=len));else for(;imaxWidthWithEll?(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),elemRightMostPoint>maxWidth&&(lastSpace=characterArr[i].spaceIdx,lastDash=characterArr[i].dashIdx,lastSpace>lastIndexBroken?(characterArr[lastSpace].elem.innerHTML="
",lastIndexBroken=lastSpace):lastDash>lastIndexBroken?(characterArr[lastDash].elem.innerHTML=lastDash===i?"
-":"-
",lastIndexBroken=lastDash):elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem),elem.offsetHeight+elem.offsetTop>maxHeight?(lastBR?lastBR.parentNode.removeChild(lastBR):lastIndexBroken===lastDash?characterArr[lastDash].elem.innerHTML="-":characterArr[lastSpace].elem.innerHTML=" ",removeFromIndex=i,i=len):removeFromIndexForEllipses=null)):elemLowestPoint>maxHeight&&(removeFromIndex=i,i=len);if(removeFromIndex=removeFromIndexForEllipses;i-=1)(elem=characterArr[i].elem).parentNode.removeChild(elem);for(;i>=0;i-=1)elem=characterArr[i].elem,slLib.classNameBrReg.test(elem.className)?elem.parentNode.removeChild(elem):i=0}return smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&\;/g,"&"),smartLabel.isTruncated&&(smartLabel.text+=ellipsesStr,smartLabel.tooltext=toolText),smartLabel.height=container.offsetHeight,smartLabel.width=container.offsetWidth,smartLabel}return smartLabel.error=new Error("Body Tag Missing!"),smartLabel},SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag){if(!this._init)return!1;var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,indiSizeStore={};if(!detailedCalculationFlag)return this._calCharDimWithCache(text);for(i=0,l=(textArr=text.split("")).length;i]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1$2',spanRemovalRegx:new RegExp("\\]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),ltgtRegex:/<|>/g,brReplaceRegex://gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;return doc.getElementsByClassName?(childRetriverFn="getElementsByClassName",childRetriverString=classNameWithTag,noClassTesting=!0):(childRetriverFn="getElementsByTagName",childRetriverString="span",noClassTesting=!1),{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild)return containerParent.appendChild(container=doc.createElement("DIV")),container.className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),container}else if((body=doc.getElementsByTagName("body")[0])&&body.appendChild)return(container=doc.createElement("DIV")).className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),1,body.appendChild(container),container},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length)return 0;var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;if(difference=maxWidth,charLen=ceil(maxWidth/avgWidth),oriWidthtext.length&&(difference=maxWidth-oriWidth,charLen=text.length);difference>0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}for(;difference<0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}return charLen},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize=styleObj.fontSize||"12px";return styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||1.2*parseInt(fSize,10)+"px",styleObj}}}};exports.default=lib,module.exports=exports.default},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function value(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"next",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"lock",value:function value(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function value(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:"prop",value:function value(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function value(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i5?maxContainers:5)<20?maxContainers:20,this.maxContainers=maxContainers,this.first=null,this.last=null,this.containers={},this.length=0,this.rootNode=parentContainer,isBrowserLess&&((svg=doc.createElementNS("http://www.w3.org/2000/svg","svg")).setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"),svg.setAttributeNS("http://www.w3.org/2000/svg","height","0"),svg.setAttributeNS("http://www.w3.org/2000/svg","width","0"),this.svgRoot=svg,this.rootNode.appendChild(svg))}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle)void 0!==style[key]&&(keyStr+=slLib.supportedStyle[key]+":"+style[key]+";");if(!keyStr)return!1;if(containerObj=containers[keyStr])this.first!==containerObj&&(containerObj.prev&&(containerObj.prev.next=containerObj.next),containerObj.next&&(containerObj.next.prev=containerObj.prev),containerObj.next=this.first,containerObj.next.prev=containerObj,this.last===containerObj&&(this.last=containerObj.prev),containerObj.prev=null,this.first=containerObj);else{if(len>=max)for(diff=len-max+1;diff--;)this.removeContainer(this.last);containerObj=this.addContainer(keyStr)}return containerObj},ContainerManager.prototype.addContainer=function(keyStr){var node,container;return this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}},container.next=this.first,container.next&&(container.next.prev=container),this.first=container,this.last||(this.last=container),this.length+=1,node=container.node=doc.createElement("div"),this.rootNode.appendChild(node),documentSupport.isIE&&!documentSupport.hasSVG?node.style.setAttribute("cssText",keyStr):node.setAttribute("style",keyStr),node.setAttribute("aria-hidden","true"),node.setAttribute("role","presentation"),node.style.display="inline-block",node.innerHTML=slLib.testStrAvg,container.lineHeight=node.offsetHeight,container.avgCharWidth=node.offsetWidth/3,documentSupport.isBrowserLess?((node=container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("style",keyStr),this.svgRoot.appendChild(node),node.textContent=slLib.testStrAvg,container.lineHeight=node.getBBox().height,container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3,node.textContent="...",container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION,node.textContent=".",container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION):(node.innerHTML="...",container.ellipsesWidth=node.offsetWidth,node.innerHTML=".",container.dotWidth=node.offsetWidth,node.innerHTML=""),container},ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;keyStr&&this.length&&cObj&&(this.length-=1,cObj.prev&&(cObj.prev.next=cObj.next),cObj.next&&(cObj.next.prev=cObj.prev),this.first===cObj&&(this.first=cObj.next),this.last===cObj&&(this.last=cObj.prev),cObj.node.parentNode.removeChild(cObj.node),delete this.containers[keyStr])},ContainerManager.prototype.dispose=function(){var key,containers=this.containers;for(key in this.maxContainers=null,containers)this.removeContainer(containers[key]);this.rootNode.parentNode.removeChild(this.rootNode),this.rootNode=null,this.first=null,this.last=null},module.exports=ContainerManager},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var scales_namespaceObject={};__webpack_require__.r(scales_namespaceObject),__webpack_require__.d(scales_namespaceObject,"scaleLinear",function(){return linear_linear}),__webpack_require__.d(scales_namespaceObject,"scaleThreshold",function(){return threshold_threshold}),__webpack_require__.d(scales_namespaceObject,"scaleLog",function(){return log}),__webpack_require__.d(scales_namespaceObject,"scalePow",function(){return pow}),__webpack_require__.d(scales_namespaceObject,"scaleIdentity",function(){return identity_identity}),__webpack_require__.d(scales_namespaceObject,"scaleOrdinal",function(){return ordinal}),__webpack_require__.d(scales_namespaceObject,"scaleSequential",function(){return sequential}),__webpack_require__.d(scales_namespaceObject,"scaleQuantize",function(){return quantize}),__webpack_require__.d(scales_namespaceObject,"scaleQuantile",function(){return quantile_quantile}),__webpack_require__.d(scales_namespaceObject,"schemeCategory10",function(){return category10}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20",function(){return category20}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20b",function(){return category20b}),__webpack_require__.d(scales_namespaceObject,"scaleBand",function(){return band}),__webpack_require__.d(scales_namespaceObject,"scaleTime",function(){return src_time});var color_schemes_namespaceObject={};__webpack_require__.r(color_schemes_namespaceObject),__webpack_require__.d(color_schemes_namespaceObject,"schemeDark2",function(){return Dark2}),__webpack_require__.d(color_schemes_namespaceObject,"schemePaired",function(){return Paired}),__webpack_require__.d(color_schemes_namespaceObject,"schemeAccent",function(){return Accent}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel1",function(){return Pastel1}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel2",function(){return Pastel2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet1",function(){return Set1}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet2",function(){return Set2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet3",function(){return Set3}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBlues",function(){return Blues_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBrBG",function(){return BrBG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePRGn",function(){return PRGn_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePiYG",function(){return PiYG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBrBG",function(){return BrBG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePRGn",function(){return PRGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePiYG",function(){return PiYG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuOr",function(){return PuOr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdBu",function(){return RdBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdGy",function(){return RdGy}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlBu",function(){return RdYlBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlGn",function(){return RdYlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateSpectral",function(){return Spectral}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBlues",function(){return Blues}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreens",function(){return Greens}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreys",function(){return Greys}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOranges",function(){return Oranges}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePurples",function(){return Purples}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateReds",function(){return Reds}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateViridis",function(){return sequential_multi_viridis}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateInferno",function(){return viridis_inferno}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateMagma",function(){return viridis_magma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePlasma",function(){return viridis_plasma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateWarm",function(){return rainbow_warm}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCool",function(){return rainbow_cool}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCubehelixDefault",function(){return sequential_multi_cubehelix}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuGn",function(){return BuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuPu",function(){return BuPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGnBu",function(){return GnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOrRd",function(){return OrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBuGn",function(){return PuBuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBu",function(){return PuBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuRd",function(){return PuRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdPu",function(){return RdPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGnBu",function(){return YlGnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGn",function(){return YlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrBr",function(){return YlOrBr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrRd",function(){return YlOrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRainbow",function(){return sequential_multi_rainbow});var namespace_namespaceObject={};__webpack_require__.r(namespace_namespaceObject),__webpack_require__.d(namespace_namespaceObject,"UNIT_GLOBAL_NAMESPACE",function(){return UNIT_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"UNIT_LOCAL_NAMESPACE",function(){return UNIT_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_LOCAL_NAMESPACE",function(){return LAYER_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_GLOBAL_NAMESPACE",function(){return LAYER_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_GLOBAL_NAMESPACE",function(){return GROUP_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_LOCAL_NAMESPACE",function(){return GROUP_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_LOCAL_NAMESPACE",function(){return CANVAS_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_GLOBAL_NAMESPACE",function(){return CANVAS_GLOBAL_NAMESPACE});var muze_utils_src_namespaceObject={};__webpack_require__.r(muze_utils_src_namespaceObject),__webpack_require__.d(muze_utils_src_namespaceObject,"InvalidAwareTypes",function(){return src_InvalidAwareTypes}),__webpack_require__.d(muze_utils_src_namespaceObject,"DataModel",function(){return datamodel_default.a}),__webpack_require__.d(muze_utils_src_namespaceObject,"ReservedFields",function(){return reserved_fields}),__webpack_require__.d(muze_utils_src_namespaceObject,"CommonProps",function(){return common_props}),__webpack_require__.d(muze_utils_src_namespaceObject,"COORD_TYPES",function(){return COORD_TYPES}),__webpack_require__.d(muze_utils_src_namespaceObject,"STATE_NAMESPACES",function(){return namespace_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"scales",function(){return scales_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"colorSchemes",function(){return color_schemes_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"getNearestValue",function(){return getNearestValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"getValueParser",function(){return getValueParser}),__webpack_require__.d(muze_utils_src_namespaceObject,"transformColor",function(){return common_utils_transformColor}),__webpack_require__.d(muze_utils_src_namespaceObject,"transformColors",function(){return common_utils_transformColors}),__webpack_require__.d(muze_utils_src_namespaceObject,"detectColor",function(){return detectColor}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslToRgb",function(){return hslToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"rgbToHsv",function(){return rgbToHsv}),__webpack_require__.d(muze_utils_src_namespaceObject,"hexToHsv",function(){return hexToHsv}),__webpack_require__.d(muze_utils_src_namespaceObject,"hsvToRgb",function(){return hsvToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslaToRgb",function(){return hslaToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"escapeHTML",function(){return escapeHTML}),__webpack_require__.d(muze_utils_src_namespaceObject,"angleToRadian",function(){return angleToRadian}),__webpack_require__.d(muze_utils_src_namespaceObject,"generateGetterSetters",function(){return generateGetterSetters}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArraySum",function(){return getArraySum}),__webpack_require__.d(muze_utils_src_namespaceObject,"ERROR_MSG",function(){return ERROR_MSG}),__webpack_require__.d(muze_utils_src_namespaceObject,"interpolator",function(){return common_utils_interpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"colorInterpolator",function(){return common_utils_colorInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"numberInterpolator",function(){return common_utils_numberInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"piecewiseInterpolator",function(){return common_utils_piecewiseInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"reqAnimFrame",function(){return reqAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"cancelAnimFrame",function(){return cancelAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"nextAnimFrame",function(){return nextAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMax",function(){return getMax}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMin",function(){return getMin}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDomainFromData",function(){return getDomainFromData}),__webpack_require__.d(muze_utils_src_namespaceObject,"getUniqueId",function(){return getUniqueId}),__webpack_require__.d(muze_utils_src_namespaceObject,"mergeRecursive",function(){return mergeRecursive}),__webpack_require__.d(muze_utils_src_namespaceObject,"unionDomain",function(){return unionDomain}),__webpack_require__.d(muze_utils_src_namespaceObject,"replaceCSSPrefix",function(){return replaceCSSPrefix}),__webpack_require__.d(muze_utils_src_namespaceObject,"symbolFns",function(){return symbolFns}),__webpack_require__.d(muze_utils_src_namespaceObject,"defaultValue",function(){return defaultValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"easeFns",function(){return easeFns}),__webpack_require__.d(muze_utils_src_namespaceObject,"clone",function(){return clone}),__webpack_require__.d(muze_utils_src_namespaceObject,"interpolateArray",function(){return interpolateArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMinPoint",function(){return getMinPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMaxPoint",function(){return getMaxPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"getClosestIndexOf",function(){return common_utils_getClosestIndexOf}),__webpack_require__.d(muze_utils_src_namespaceObject,"registerListeners",function(){return common_utils_registerListeners}),__webpack_require__.d(muze_utils_src_namespaceObject,"Voronoi",function(){return common_utils_Voronoi}),__webpack_require__.d(muze_utils_src_namespaceObject,"checkExistence",function(){return checkExistence}),__webpack_require__.d(muze_utils_src_namespaceObject,"sanitizeIP",function(){return sanitizeIP}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMinDiff",function(){return getMinDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"capitalizeFirst",function(){return capitalizeFirst}),__webpack_require__.d(muze_utils_src_namespaceObject,"getWindow",function(){return getWindow}),__webpack_require__.d(muze_utils_src_namespaceObject,"getQualifiedClassName",function(){return getQualifiedClassName}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDependencyOrder",function(){return getDependencyOrder}),__webpack_require__.d(muze_utils_src_namespaceObject,"objectIterator",function(){return objectIterator}),__webpack_require__.d(muze_utils_src_namespaceObject,"intSanitizer",function(){return intSanitizer}),__webpack_require__.d(muze_utils_src_namespaceObject,"enableChainedTransaction",function(){return enableChainedTransaction}),__webpack_require__.d(muze_utils_src_namespaceObject,"isHTMLElem",function(){return isHTMLElem}),__webpack_require__.d(muze_utils_src_namespaceObject,"isEqual",function(){return common_utils_isEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"isSimpleObject",function(){return isSimpleObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"nextFrame",function(){return nextFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"getObjProp",function(){return getObjProp}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDataModelFromIdentifiers",function(){return common_utils_getDataModelFromIdentifiers}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDataModelFromRange",function(){return getDataModelFromRange}),__webpack_require__.d(muze_utils_src_namespaceObject,"transposeArray",function(){return transposeArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"toArray",function(){return toArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"extendsClass",function(){return extendsClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"concatModels",function(){return common_utils_concatModels}),__webpack_require__.d(muze_utils_src_namespaceObject,"assembleModelFromIdentifiers",function(){return assembleModelFromIdentifiers}),__webpack_require__.d(muze_utils_src_namespaceObject,"isValidValue",function(){return isValidValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"nestCollection",function(){return common_utils_nestCollection}),__webpack_require__.d(muze_utils_src_namespaceObject,"stack",function(){return common_utils_stack}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSymbol",function(){return common_utils_getSymbol}),__webpack_require__.d(muze_utils_src_namespaceObject,"Scales",function(){return Scales}),__webpack_require__.d(muze_utils_src_namespaceObject,"Symbols",function(){return Symbols}),__webpack_require__.d(muze_utils_src_namespaceObject,"pathInterpolators",function(){return pathInterpolators}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslInterpolator",function(){return common_utils_hslInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSmallestDiff",function(){return getSmallestDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"require",function(){return require}),__webpack_require__.d(muze_utils_src_namespaceObject,"formatTemporal",function(){return common_utils_formatTemporal}),__webpack_require__.d(muze_utils_src_namespaceObject,"nearestSortingDetails",function(){return common_utils_nearestSortingDetails}),__webpack_require__.d(muze_utils_src_namespaceObject,"createSelection",function(){return common_utils_createSelection}),__webpack_require__.d(muze_utils_src_namespaceObject,"temporalFields",function(){return common_utils_temporalFields}),__webpack_require__.d(muze_utils_src_namespaceObject,"retrieveNearestGroupByReducers",function(){return common_utils_retrieveNearestGroupByReducers}),__webpack_require__.d(muze_utils_src_namespaceObject,"retrieveFieldDisplayName",function(){return retrieveFieldDisplayName}),__webpack_require__.d(muze_utils_src_namespaceObject,"sanitizeDomainWhenEqual",function(){return sanitizeDomainWhenEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"sortCategoricalField",function(){return sortCategoricalField}),__webpack_require__.d(muze_utils_src_namespaceObject,"intersect",function(){return common_utils_intersect}),__webpack_require__.d(muze_utils_src_namespaceObject,"partition",function(){return partition}),__webpack_require__.d(muze_utils_src_namespaceObject,"mix",function(){return mix}),__webpack_require__.d(muze_utils_src_namespaceObject,"componentRegistry",function(){return common_utils_componentRegistry}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArrayDiff",function(){return getArrayDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"difference",function(){return difference}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArrayIndexMap",function(){return getArrayIndexMap}),__webpack_require__.d(muze_utils_src_namespaceObject,"arraysEqual",function(){return arraysEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"getReadableTicks",function(){return common_utils_getReadableTicks}),__webpack_require__.d(muze_utils_src_namespaceObject,"unique",function(){return unique}),__webpack_require__.d(muze_utils_src_namespaceObject,"dmMultipleSelection",function(){return common_utils_dmMultipleSelection}),__webpack_require__.d(muze_utils_src_namespaceObject,"pointWithinCircle",function(){return pointWithinCircle}),__webpack_require__.d(muze_utils_src_namespaceObject,"selectElement",function(){return renderer_utils_selectElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"makeElement",function(){return makeElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"applyStyle",function(){return renderer_utils_applyStyle}),__webpack_require__.d(muze_utils_src_namespaceObject,"addClass",function(){return renderer_utils_addClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"removeClass",function(){return renderer_utils_removeClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"appendElement",function(){return appendElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"setAttrs",function(){return renderer_utils_setAttrs}),__webpack_require__.d(muze_utils_src_namespaceObject,"setStyles",function(){return renderer_utils_setStyles}),__webpack_require__.d(muze_utils_src_namespaceObject,"createElement",function(){return renderer_utils_createElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"createElements",function(){return renderer_utils_createElements}),__webpack_require__.d(muze_utils_src_namespaceObject,"clipElement",function(){return renderer_utils_clipElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"getElementsByClassName",function(){return renderer_utils_getElementsByClassName}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMousePos",function(){return getMousePos}),__webpack_require__.d(muze_utils_src_namespaceObject,"getEvent",function(){return renderer_utils_getEvent}),__webpack_require__.d(muze_utils_src_namespaceObject,"getD3Drag",function(){return renderer_utils_getD3Drag}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSmartComputedStyle",function(){return renderer_utils_getSmartComputedStyle}),__webpack_require__.d(muze_utils_src_namespaceObject,"getClientPoint",function(){return renderer_utils_getClientPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"hasTouch",function(){return hasTouch}),__webpack_require__.d(muze_utils_src_namespaceObject,"Store",function(){return store_Store}),__webpack_require__.d(muze_utils_src_namespaceObject,"transactor",function(){return store_transactor}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMillisecond",function(){return src_millisecond}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeSecond",function(){return src_second}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMinute",function(){return src_minute}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeHour",function(){return src_hour}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeDay",function(){return src_day}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeWeek",function(){return sunday}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMonth",function(){return src_month}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeYear",function(){return src_year}),__webpack_require__.d(muze_utils_src_namespaceObject,"Smartlabel",function(){return SmartlabelManager_default.a}),__webpack_require__.d(muze_utils_src_namespaceObject,"dataSelect",function(){return dataSelect}),__webpack_require__.d(muze_utils_src_namespaceObject,"LifeCycleManager",function(){return lifecycle_manager}),__webpack_require__.d(muze_utils_src_namespaceObject,"DimensionSubtype",function(){return dist_datamodel.DimensionSubtype}),__webpack_require__.d(muze_utils_src_namespaceObject,"FieldType",function(){return dist_datamodel.FieldType}),__webpack_require__.d(muze_utils_src_namespaceObject,"MeasureSubtype",function(){return dist_datamodel.MeasureSubtype}),__webpack_require__.d(muze_utils_src_namespaceObject,"DateTimeFormatter",function(){return dist_datamodel.DateTimeFormatter}),__webpack_require__.d(muze_utils_src_namespaceObject,"DM_DERIVATIVES",function(){return dist_datamodel.DM_DERIVATIVES}),__webpack_require__.d(muze_utils_src_namespaceObject,"GROUP_BY_FUNCTIONS",function(){return dist_datamodel.GROUP_BY_FUNCTIONS}),__webpack_require__.d(muze_utils_src_namespaceObject,"RTree",function(){return RTree});var enums_constants_namespaceObject={};__webpack_require__.r(enums_constants_namespaceObject),__webpack_require__.d(enums_constants_namespaceObject,"CLASSPREFIX",function(){return CLASSPREFIX}),__webpack_require__.d(enums_constants_namespaceObject,"STACK",function(){return STACK}),__webpack_require__.d(enums_constants_namespaceObject,"GROUP",function(){return GROUP}),__webpack_require__.d(enums_constants_namespaceObject,"IDENTITY",function(){return IDENTITY}),__webpack_require__.d(enums_constants_namespaceObject,"ANGLE",function(){return constants_ANGLE}),__webpack_require__.d(enums_constants_namespaceObject,"RADIUS",function(){return constants_RADIUS}),__webpack_require__.d(enums_constants_namespaceObject,"SIZE",function(){return SIZE}),__webpack_require__.d(enums_constants_namespaceObject,"COLOR",function(){return COLOR}),__webpack_require__.d(enums_constants_namespaceObject,"SHAPE",function(){return SHAPE}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT",function(){return TEXT}),__webpack_require__.d(enums_constants_namespaceObject,"OUTER_RADIUS_VALUE",function(){return OUTER_RADIUS_VALUE}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT_ANCHOR_MIDDLE",function(){return TEXT_ANCHOR_MIDDLE}),__webpack_require__.d(enums_constants_namespaceObject,"ENCODING",function(){return ENCODING}),__webpack_require__.d(enums_constants_namespaceObject,"STROKE_DASHARRAY",function(){return STROKE_DASHARRAY}),__webpack_require__.d(enums_constants_namespaceObject,"ASCENDING",function(){return ASCENDING}),__webpack_require__.d(enums_constants_namespaceObject,"AGG_FN_SUM",function(){return AGG_FN_SUM}),__webpack_require__.d(enums_constants_namespaceObject,"AREA_LAYER",function(){return AREA_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"ARC_LAYER",function(){return ARC_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"LINE_LAYER",function(){return LINE_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT_LAYER",function(){return TEXT_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"POINT_LAYER",function(){return POINT_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"BAR_LAYER",function(){return BAR_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"TICK_LAYER",function(){return TICK_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"SIMPLE_LAYER",function(){return SIMPLE_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"BASE_LAYER",function(){return BASE_LAYER});var props_namespaceObject={};__webpack_require__.r(props_namespaceObject),__webpack_require__.d(props_namespaceObject,"DATA",function(){return DATA}),__webpack_require__.d(props_namespaceObject,"CONFIG",function(){return CONFIG}),__webpack_require__.d(props_namespaceObject,"MEASUREMENT",function(){return MEASUREMENT}),__webpack_require__.d(props_namespaceObject,"DOMAIN",function(){return DOMAIN}),__webpack_require__.d(props_namespaceObject,"MOUNT",function(){return MOUNT});var axis_orientation_namespaceObject={};__webpack_require__.r(axis_orientation_namespaceObject),__webpack_require__.d(axis_orientation_namespaceObject,"BOTTOM",function(){return axis_orientation_BOTTOM}),__webpack_require__.d(axis_orientation_namespaceObject,"TOP",function(){return axis_orientation_TOP}),__webpack_require__.d(axis_orientation_namespaceObject,"LEFT",function(){return axis_orientation_LEFT}),__webpack_require__.d(axis_orientation_namespaceObject,"RIGHT",function(){return axis_orientation_RIGHT}),__webpack_require__.d(axis_orientation_namespaceObject,"axisOrientationMap",function(){return axisOrientationMap});var scale_type_namespaceObject={};__webpack_require__.r(scale_type_namespaceObject),__webpack_require__.d(scale_type_namespaceObject,"LINEAR",function(){return LINEAR}),__webpack_require__.d(scale_type_namespaceObject,"BAND",function(){return BAND}),__webpack_require__.d(scale_type_namespaceObject,"TIME",function(){return TIME}),__webpack_require__.d(scale_type_namespaceObject,"COLOR",function(){return scale_type_COLOR}),__webpack_require__.d(scale_type_namespaceObject,"ORDINAL",function(){return ORDINAL}),__webpack_require__.d(scale_type_namespaceObject,"QUANTIZE",function(){return QUANTIZE}),__webpack_require__.d(scale_type_namespaceObject,"QUANTILE",function(){return QUANTILE}),__webpack_require__.d(scale_type_namespaceObject,"LOG",function(){return LOG}),__webpack_require__.d(scale_type_namespaceObject,"POW",function(){return POW}),__webpack_require__.d(scale_type_namespaceObject,"IDENTITY",function(){return scale_type_IDENTITY}),__webpack_require__.d(scale_type_namespaceObject,"SEQUENTIAL",function(){return SEQUENTIAL}),__webpack_require__.d(scale_type_namespaceObject,"THRESHOLD",function(){return THRESHOLD});var visual_group_src_enums_constants_namespaceObject={};__webpack_require__.r(visual_group_src_enums_constants_namespaceObject),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"X",function(){return X}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"Y",function(){return Y}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"WIDTH",function(){return WIDTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HEIGHT",function(){return HEIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASUREMENT",function(){return constants_MEASUREMENT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CONFIG",function(){return constants_CONFIG}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MIN_UNIT_WIDTH",function(){return MIN_UNIT_WIDTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MIN_UNIT_HEIGHT",function(){return MIN_UNIT_HEIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DIMENSIONS",function(){return DIMENSIONS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASURES",function(){return MEASURES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DIMENSION",function(){return DIMENSION}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASURE",function(){return MEASURE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"PIVOT",function(){return PIVOT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FORMAT",function(){return FORMAT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MOUNT",function(){return constants_MOUNT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HAS_DATA_UPDATED",function(){return HAS_DATA_UPDATED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ROWS",function(){return ROWS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLUMNS",function(){return COLUMNS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DATA",function(){return constants_DATA}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COL",function(){return COL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ROW",function(){return ROW}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLUMN",function(){return COLUMN}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLOR",function(){return enums_constants_COLOR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SHAPE",function(){return enums_constants_SHAPE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SIZE",function(){return enums_constants_SIZE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DETAIL",function(){return DETAIL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LAYERS",function(){return LAYERS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TRANSFORM",function(){return TRANSFORM}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ORDINAL",function(){return enums_constants_ORDINAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LINEAR",function(){return enums_constants_LINEAR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LEFT",function(){return constants_LEFT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RIGHT",function(){return constants_RIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TOP",function(){return enums_constants_TOP}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BOTTOM",function(){return enums_constants_BOTTOM}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RETINAL",function(){return RETINAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CELL",function(){return CELL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"X_AXES",function(){return X_AXES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"Y_AXES",function(){return Y_AXES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ENTRY_CELLS",function(){return ENTRY_CELLS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"INITIALIZED",function(){return INITIALIZED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"EXIT_CELLS",function(){return EXIT_CELLS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"AXIS",function(){return AXIS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"UNIT",function(){return UNIT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"UPDATED",function(){return UPDATED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BEFORE_UPDATE",function(){return BEFORE_UPDATE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"VALUE_MATRIX",function(){return VALUE_MATRIX}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FACET_HEADERS",function(){return FACET_HEADERS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RADIUS",function(){return enums_constants_RADIUS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ANGLE",function(){return enums_constants_ANGLE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ANGLE0",function(){return ANGLE0}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ARC",function(){return ARC}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CATEGORICAL",function(){return constants_CATEGORICAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TEMPORAL",function(){return constants_TEMPORAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BAR",function(){return BAR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LINE",function(){return LINE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"POINT",function(){return POINT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"PRIMARY",function(){return PRIMARY}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SECONDARY",function(){return SECONDARY}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BOTH",function(){return BOTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"INTERACTION",function(){return INTERACTION}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"GRID_LINES",function(){return GRID_LINES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"GRID_BANDS",function(){return GRID_BANDS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HEADER",function(){return HEADER}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FACET",function(){return FACET}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DEFAULT",function(){return DEFAULT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ASCENDING",function(){return constants_ASCENDING}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DESCENDING",function(){return DESCENDING}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DARK",function(){return DARK}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"NONE",function(){return NONE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"NORMAL",function(){return NORMAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DARKER",function(){return DARKER});var helpers_namespaceObject={};__webpack_require__.r(helpers_namespaceObject),__webpack_require__.d(helpers_namespaceObject,"transformColor",function(){return helpers_transformColor}),__webpack_require__.d(helpers_namespaceObject,"applyInteractionStyle",function(){return helpers_applyInteractionStyle}),__webpack_require__.d(helpers_namespaceObject,"retrieveEncodingInf",function(){return helpers_retrieveEncodingInf}),__webpack_require__.d(helpers_namespaceObject,"encodingFieldInfRetriever",function(){return encodingFieldInfRetriever}),__webpack_require__.d(helpers_namespaceObject,"setNullsInStack",function(){return setNullsInStack}),__webpack_require__.d(helpers_namespaceObject,"setNulls",function(){return helpers_setNulls}),__webpack_require__.d(helpers_namespaceObject,"transformData",function(){return helpers_transformData}),__webpack_require__.d(helpers_namespaceObject,"getIndividualClassName",function(){return getIndividualClassName}),__webpack_require__.d(helpers_namespaceObject,"dataNormalizers",function(){return dataNormalizers}),__webpack_require__.d(helpers_namespaceObject,"getNormalizedData",function(){return helpers_getNormalizedData}),__webpack_require__.d(helpers_namespaceObject,"domainCalculator",function(){return domainCalculator}),__webpack_require__.d(helpers_namespaceObject,"attachDataToVoronoi",function(){return helpers_attachDataToVoronoi}),__webpack_require__.d(helpers_namespaceObject,"updateStyle",function(){return helpers_updateStyle}),__webpack_require__.d(helpers_namespaceObject,"animateGroup",function(){return helpers_animateGroup}),__webpack_require__.d(helpers_namespaceObject,"positionPoints",function(){return positionPoints}),__webpack_require__.d(helpers_namespaceObject,"getGroupSpan",function(){return getGroupSpan}),__webpack_require__.d(helpers_namespaceObject,"getPlotMeasurement",function(){return helpers_getPlotMeasurement}),__webpack_require__.d(helpers_namespaceObject,"renderLayer",function(){return helpers_renderLayer}),__webpack_require__.d(helpers_namespaceObject,"resolveInvalidTransformType",function(){return helpers_resolveInvalidTransformType}),__webpack_require__.d(helpers_namespaceObject,"getValidTransform",function(){return getValidTransform}),__webpack_require__.d(helpers_namespaceObject,"getValidTransformForAggFn",function(){return helpers_getValidTransformForAggFn}),__webpack_require__.d(helpers_namespaceObject,"getMarkId",function(){return helpers_getMarkId}),__webpack_require__.d(helpers_namespaceObject,"resolveEncodingValues",function(){return helpers_resolveEncodingValues}),__webpack_require__.d(helpers_namespaceObject,"getColorMetaInf",function(){return getColorMetaInf}),__webpack_require__.d(helpers_namespaceObject,"toCartesianCoordinates",function(){return toCartesianCoordinates}),__webpack_require__.d(helpers_namespaceObject,"sortData",function(){return sortData}),__webpack_require__.d(helpers_namespaceObject,"getBoundBoxes",function(){return helpers_getBoundBoxes}),__webpack_require__.d(helpers_namespaceObject,"getDataFromEvent",function(){return helpers_getDataFromEvent});var point_helper_namespaceObject={};__webpack_require__.r(point_helper_namespaceObject),__webpack_require__.d(point_helper_namespaceObject,"prepareDrawingInf",function(){return helper_prepareDrawingInf}),__webpack_require__.d(point_helper_namespaceObject,"pointTranslators",function(){return helper_pointTranslators}),__webpack_require__.d(point_helper_namespaceObject,"getStrokeWidthByPosition",function(){return getStrokeWidthByPosition});var layer_types_namespaceObject={};__webpack_require__.r(layer_types_namespaceObject),__webpack_require__.d(layer_types_namespaceObject,"AREA_LAYER",function(){return layer_types_AREA_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"ARC_LAYER",function(){return layer_types_ARC_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"LINE_LAYER",function(){return layer_types_LINE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TEXT_LAYER",function(){return layer_types_TEXT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"POINT_LAYER",function(){return layer_types_POINT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BAR_LAYER",function(){return layer_types_BAR_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TICK_LAYER",function(){return layer_types_TICK_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"SIMPLE_LAYER",function(){return layer_types_SIMPLE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BASE_LAYER",function(){return layer_types_BASE_LAYER});var src_enums_namespaceObject={};__webpack_require__.r(src_enums_namespaceObject),__webpack_require__.d(src_enums_namespaceObject,"PROPS",function(){return props_namespaceObject}),__webpack_require__.d(src_enums_namespaceObject,"LAYER_TYPES",function(){return layer_types_namespaceObject}),__webpack_require__.d(src_enums_namespaceObject,"CONSTANTS",function(){return enums_constants_namespaceObject});var visual_unit_src_helper_namespaceObject={};__webpack_require__.r(visual_unit_src_helper_namespaceObject),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getDimensionMeasureMap",function(){return helper_getDimensionMeasureMap}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"transformDataModels",function(){return transformDataModels}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayerFromDef",function(){return helper_getLayerFromDef}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"resolveEncodingTransform",function(){return resolveEncodingTransform}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"sanitizeLayerDef",function(){return helper_sanitizeLayerDef}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"attachDataToLayers",function(){return attachDataToLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"attachAxisToLayers",function(){return helper_attachAxisToLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayerAxisIndex",function(){return helper_getLayerAxisIndex}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"unionDomainFromLayers",function(){return helper_unionDomainFromLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"renderLayers",function(){return helper_renderLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getNearestDimensionalValue",function(){return helper_getNearestDimensionalValue}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayersBy",function(){return getLayersBy}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"removeLayersBy",function(){return removeLayersBy}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createSideEffectGroup",function(){return helper_createSideEffectGroup}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createRenderPromise",function(){return createRenderPromise}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getRadiusRange",function(){return getRadiusRange}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"setAxisRange",function(){return helper_setAxisRange}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"isXandYMeasures",function(){return helper_isXandYMeasures}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getValuesMap",function(){return getValuesMap}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getSelectionRejectionModel",function(){return getSelectionRejectionModel}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createRTree",function(){return helper_createRTree});var reactive_props_namespaceObject={};__webpack_require__.r(reactive_props_namespaceObject),__webpack_require__.d(reactive_props_namespaceObject,"CONFIG",function(){return reactive_props_CONFIG}),__webpack_require__.d(reactive_props_namespaceObject,"DATA",function(){return reactive_props_DATA}),__webpack_require__.d(reactive_props_namespaceObject,"AXES",function(){return AXES}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERDEFS",function(){return LAYERDEFS}),__webpack_require__.d(reactive_props_namespaceObject,"WIDTH",function(){return reactive_props_WIDTH}),__webpack_require__.d(reactive_props_namespaceObject,"HEIGHT",function(){return reactive_props_HEIGHT}),__webpack_require__.d(reactive_props_namespaceObject,"MOUNT",function(){return reactive_props_MOUNT}),__webpack_require__.d(reactive_props_namespaceObject,"TRANSFORM",function(){return reactive_props_TRANSFORM}),__webpack_require__.d(reactive_props_namespaceObject,"TRANSFORMEDDATA",function(){return TRANSFORMEDDATA}),__webpack_require__.d(reactive_props_namespaceObject,"DATADOMAIN",function(){return DATADOMAIN}),__webpack_require__.d(reactive_props_namespaceObject,"FIELDS",function(){return FIELDS}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERAXISINDEX",function(){return LAYERAXISINDEX}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERS",function(){return reactive_props_LAYERS}),__webpack_require__.d(reactive_props_namespaceObject,"DOMAIN",function(){return reactive_props_DOMAIN});var visual_unit_src_enums_constants_namespaceObject={};__webpack_require__.r(visual_unit_src_enums_constants_namespaceObject),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CLASSPREFIX",function(){return enums_constants_CLASSPREFIX}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"IDFIELD",function(){return IDFIELD}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_LINE_PARENT_GROUP_CLASS",function(){return GRID_LINE_PARENT_GROUP_CLASS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_BAND_PARENT_GROUP_CLASS",function(){return GRID_BAND_PARENT_GROUP_CLASS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_PARENT_GROUP",function(){return GRID_PARENT_GROUP}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"BAND",function(){return enums_constants_BAND}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"TICK",function(){return TICK}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_BAND",function(){return GRID_BAND}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_LINE",function(){return GRID_LINE}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CONSOLIDATED",function(){return CONSOLIDATED}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"FRAGMENTED",function(){return FRAGMENTED}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"FACET_BY_FIELDS",function(){return FACET_BY_FIELDS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"RETINAL_FIELDS",function(){return RETINAL_FIELDS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"PARENT_ALIAS",function(){return PARENT_ALIAS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"LAYERS",function(){return constants_LAYERS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CACHED_DATA",function(){return CACHED_DATA}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"STORE",function(){return STORE});var visual_unit_src_enums_namespaceObject={};__webpack_require__.r(visual_unit_src_enums_namespaceObject),__webpack_require__.d(visual_unit_src_enums_namespaceObject,"REACTIVE_PROPS",function(){return reactive_props_namespaceObject}),__webpack_require__.d(visual_unit_src_enums_namespaceObject,"CONSTANTS",function(){return visual_unit_src_enums_constants_namespaceObject});var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,"DRAG",function(){return DRAG}),__webpack_require__.d(actions_namespaceObject,"HOVER",function(){return HOVER}),__webpack_require__.d(actions_namespaceObject,"SELECTIONDRAG",function(){return SELECTIONDRAG}),__webpack_require__.d(actions_namespaceObject,"CLICK",function(){return CLICK}),__webpack_require__.d(actions_namespaceObject,"LONGTOUCH",function(){return LONGTOUCH}),__webpack_require__.d(actions_namespaceObject,"TOUCHDRAG",function(){return TOUCHDRAG}),__webpack_require__.d(actions_namespaceObject,"ALL_ACTIONS",function(){return ALL_ACTIONS});var enums_selection_namespaceObject={};__webpack_require__.r(enums_selection_namespaceObject),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_ENTRY",function(){return SELECTION_NEW_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_EXIT",function(){return SELECTION_NEW_EXIT}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NULL",function(){return SELECTION_NULL}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_ENTRY",function(){return SELECTION_OLD_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_EXIT",function(){return SELECTION_OLD_EXIT});var behaviours_namespaceObject={};__webpack_require__.r(behaviours_namespaceObject),__webpack_require__.d(behaviours_namespaceObject,"BRUSH",function(){return BRUSH}),__webpack_require__.d(behaviours_namespaceObject,"HIGHLIGHT",function(){return HIGHLIGHT}),__webpack_require__.d(behaviours_namespaceObject,"TOOLTIP",function(){return behaviours_TOOLTIP}),__webpack_require__.d(behaviours_namespaceObject,"FILTER",function(){return FILTER}),__webpack_require__.d(behaviours_namespaceObject,"SELECT",function(){return SELECT});var behavioural_namespaceObject={};__webpack_require__.r(behavioural_namespaceObject),__webpack_require__.d(behavioural_namespaceObject,"HighlightBeahviour",function(){return highlight_HighlightBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"BrushBehaviour",function(){return brush_BrushBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"FilterBehaviour",function(){return filter_FilterBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"SelectBehaviour",function(){return select_SelectBehaviour});var side_effects_namespaceObject={};__webpack_require__.r(side_effects_namespaceObject),__webpack_require__.d(side_effects_namespaceObject,"ANCHORS",function(){return side_effects_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"BRUSH_ANCHORS",function(){return side_effects_BRUSH_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"PERSISTENT_ANCHORS",function(){return side_effects_PERSISTENT_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"FILTER",function(){return side_effects_FILTER}),__webpack_require__.d(side_effects_namespaceObject,"HIGHLIGHTER",function(){return side_effects_HIGHLIGHTER}),__webpack_require__.d(side_effects_namespaceObject,"CROSSLINE",function(){return CROSSLINE}),__webpack_require__.d(side_effects_namespaceObject,"TOOLTIP",function(){return side_effects_TOOLTIP}),__webpack_require__.d(side_effects_namespaceObject,"FRAGMENTED_TOOLTIP",function(){return FRAGMENTED_TOOLTIP}),__webpack_require__.d(side_effects_namespaceObject,"AXIS_LABEL_HIGHLIGHTER",function(){return AXIS_LABEL_HIGHLIGHTER});var src_side_effects_namespaceObject={};__webpack_require__.r(src_side_effects_namespaceObject),__webpack_require__.d(src_side_effects_namespaceObject,"SelectionBox",function(){return selection_box}),__webpack_require__.d(src_side_effects_namespaceObject,"Tooltip",function(){return side_effects_tooltip_Tooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"FragmentedTooltip",function(){return fragmented_tooltip_FragmentedTooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"Crossline",function(){return crossline_Crossline}),__webpack_require__.d(src_side_effects_namespaceObject,"PlotHighlighter",function(){return plot_highlighter_PlotHighlighter}),__webpack_require__.d(src_side_effects_namespaceObject,"FilterEffect",function(){return FilterEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"PersistentAnchors",function(){return persistent_anchors_PersistentAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"BrushAnchors",function(){return brush_anchors_BrushAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"AnchorEffect",function(){return anchors_AnchorEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"AxisLabelHighLighter",function(){return axis_labels_highlighter_AxisLabelHighLighter});var group_utils_namespaceObject={};__webpack_require__.r(group_utils_namespaceObject),__webpack_require__.d(group_utils_namespaceObject,"initStore",function(){return group_utils_initStore}),__webpack_require__.d(group_utils_namespaceObject,"isDistributionEqual",function(){return group_utils_isDistributionEqual}),__webpack_require__.d(group_utils_namespaceObject,"initializeCacheMaps",function(){return initializeCacheMaps}),__webpack_require__.d(group_utils_namespaceObject,"getAxisKey",function(){return getAxisKey}),__webpack_require__.d(group_utils_namespaceObject,"getCellKey",function(){return getCellKey}),__webpack_require__.d(group_utils_namespaceObject,"extractUnitConfig",function(){return group_utils_extractUnitConfig}),__webpack_require__.d(group_utils_namespaceObject,"hasOneField",function(){return hasOneField}),__webpack_require__.d(group_utils_namespaceObject,"getHeaderText",function(){return getHeaderText}),__webpack_require__.d(group_utils_namespaceObject,"headerCreator",function(){return group_utils_headerCreator}),__webpack_require__.d(group_utils_namespaceObject,"findInGroup",function(){return group_utils_findInGroup}),__webpack_require__.d(group_utils_namespaceObject,"getAxisType",function(){return group_utils_getAxisType}),__webpack_require__.d(group_utils_namespaceObject,"retriveDomainFromData",function(){return retriveDomainFromData}),__webpack_require__.d(group_utils_namespaceObject,"mutateAxesFromMap",function(){return mutateAxesFromMap}),__webpack_require__.d(group_utils_namespaceObject,"getEncoder",function(){return group_utils_getEncoder}),__webpack_require__.d(group_utils_namespaceObject,"getHeaderAxisFrom",function(){return group_utils_getHeaderAxisFrom}),__webpack_require__.d(group_utils_namespaceObject,"setFacetsAndProjections",function(){return setFacetsAndProjections}),__webpack_require__.d(group_utils_namespaceObject,"getBorders",function(){return getBorders}),__webpack_require__.d(group_utils_namespaceObject,"getFieldsFromSuppliedLayers",function(){return getFieldsFromSuppliedLayers}),__webpack_require__.d(group_utils_namespaceObject,"extractFields",function(){return group_utils_extractFields}),__webpack_require__.d(group_utils_namespaceObject,"sortFacetFields",function(){return group_utils_sortFacetFields}),__webpack_require__.d(group_utils_namespaceObject,"removeExitCells",function(){return group_utils_removeExitCells});var encoder_helper_namespaceObject={};__webpack_require__.r(encoder_helper_namespaceObject),__webpack_require__.d(encoder_helper_namespaceObject,"getAdjustedDomain",function(){return getAdjustedDomain}),__webpack_require__.d(encoder_helper_namespaceObject,"generateAxisFromMap",function(){return encoder_helper_generateAxisFromMap}),__webpack_require__.d(encoder_helper_namespaceObject,"sanitizeIndividualLayerConfig",function(){return encoder_helper_sanitizeIndividualLayerConfig}),__webpack_require__.d(encoder_helper_namespaceObject,"mutateAxesFromMap",function(){return encoder_helper_mutateAxesFromMap}),__webpack_require__.d(encoder_helper_namespaceObject,"getDefaultMark",function(){return encoder_helper_getDefaultMark}),__webpack_require__.d(encoder_helper_namespaceObject,"createRetinalAxis",function(){return encoder_helper_createRetinalAxis}),__webpack_require__.d(encoder_helper_namespaceObject,"getIndex",function(){return getIndex}),__webpack_require__.d(encoder_helper_namespaceObject,"getLayerConfFromFields",function(){return getLayerConfFromFields}),__webpack_require__.d(encoder_helper_namespaceObject,"resolveAxisConfig",function(){return encoder_helper_resolveAxisConfig}),__webpack_require__.d(encoder_helper_namespaceObject,"getSortingConfig",function(){return getSortingConfig});var encoder_namespaceObject={};__webpack_require__.r(encoder_namespaceObject),__webpack_require__.d(encoder_namespaceObject,"VisualEncoder",function(){return visual_encoder_VisualEncoder}),__webpack_require__.d(encoder_namespaceObject,"CartesianEncoder",function(){return cartesian_encoder_CartesianEncoder}),__webpack_require__.d(encoder_namespaceObject,"PolarEncoder",function(){return polar_encoder_PolarEncoder}),__webpack_require__.d(encoder_namespaceObject,"RetinalEncoder",function(){return retinal_encoder_RetinalEncoder});var firebolt_behavioural_namespaceObject={};__webpack_require__.r(firebolt_behavioural_namespaceObject),__webpack_require__.d(firebolt_behavioural_namespaceObject,"SelectBehaviour",function(){return behavioural_select_SelectBehaviour});var firebolt_side_effects_namespaceObject={};__webpack_require__.r(firebolt_side_effects_namespaceObject),__webpack_require__.d(firebolt_side_effects_namespaceObject,"SelectionBox",function(){return side_effects_selection_box}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendHighlighter",function(){return legend_highlighter_LegendHighlighter}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendMarker",function(){return legend_marker_LegendMarker});var operators_namespaceObject={};__webpack_require__.r(operators_namespaceObject),__webpack_require__.d(operators_namespaceObject,"share",function(){return operators_share}),__webpack_require__.d(operators_namespaceObject,"html",function(){return operators_html});var dist_datamodel=__webpack_require__(0),datamodel_default=__webpack_require__.n(dist_datamodel),ascending=function(a,b){return ab?1:a>=b?0:NaN},bisector=function(compare){return 1===compare.length&&(compare=function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}(compare)),{left:function left(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)<0?lo=mid+1:hi=mid}return lo},right:function right(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)>0?hi=mid:lo=mid+1}return lo}}};var ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right,bisect=(ascendingBisect.left,bisectRight);var number=function(x){return null===x?NaN:+x},array_array=Array.prototype,src_range=(array_array.slice,array_array.map,function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;for(var i=-1,n=0|Math.max(0,Math.ceil((stop-start)/step)),range=new Array(n);++i0)return[start];if((reverse=stop0)for(start=Math.ceil(start/step),stop=Math.floor(stop/step),ticks=new Array(n=Math.ceil(stop-start+1));++i=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;return error>=e10?step1*=10:error>=e5?step1*=5:error>=e2&&(step1*=2),stop=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values);return value0+(+valueof(values[i0+1],i0+1,values)-value0)*(i-i0)}};function map_Map(){}function map_map(object,f){var map=new map_Map;if(object instanceof map_Map)object.each(function(value,key){map.set(key,value)});else if(Array.isArray(object)){var o,i=-1,n=object.length;if(null==f)for(;++i=keys.length)return null!=_sortValues&&array.sort(_sortValues),null!=_rollup?_rollup(array):array;for(var keyValue,value,values,i=-1,n=array.length,key=keys[depth++],valuesByKey=src_map(),result=createResult();++ikeys.length)return map;var array,sortKey=_sortKeys[depth-1];return null!=_rollup&&depth>=keys.length?array=map.entries():(array=[],map.each(function(v,k){array.push({key:k,values:_entries(v,depth)})})),null!=sortKey?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}(apply(array,0,createMap,setMap),0)},key:function key(d){return keys.push(d),nest},sortKeys:function sortKeys(order){return _sortKeys[keys.length-1]=order,nest},sortValues:function sortValues(order){return _sortValues=order,nest},rollup:function rollup(f){return _rollup=f,nest}}};function createObject(){return{}}function setObject(object,key,value){object[key]=value}function createMap(){return src_map()}function setMap(map,key,value){map.set(key,value)}function set_Set(){}var proto=src_map.prototype;function set_set(object,f){var set=new set_Set;if(object instanceof set_Set)object.each(function(value){set.add(value)});else if(object){var i=-1,n=object.length;if(null==f)for(;++i1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo)),hiIndex=getClosestIndexOf(values,hi),b=lo===hi?a:Math.max(a,hiIndex-1),reverse&&(t=a,a=n-b,b=n-t),a>b?void 0:domain().slice(a,b+1)},scale.invert=function(r0,r1){var a,t,lo=+r0,hi=arguments.length>1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo,"left")),domain()[reverse?n-a:a]},rescale()}function getClosestIndexOf(arr,value,side){for(var highVal,mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1:high}var src_number=function(a,b){return a=+a,b=+b,function(t){return a*(1-t)+b*t}},define=function(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype,prototype.constructor=constructor};function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var reI="\\s*([+-]?\\d+)\\s*",reN="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",reP="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",reHex=/^#([0-9a-f]{3,8})$/,reRgbInteger=new RegExp("^rgb\\("+[reI,reI,reI]+"\\)$"),reRgbPercent=new RegExp("^rgb\\("+[reP,reP,reP]+"\\)$"),reRgbaInteger=new RegExp("^rgba\\("+[reI,reI,reI,reN]+"\\)$"),reRgbaPercent=new RegExp("^rgba\\("+[reP,reP,reP,reN]+"\\)$"),reHslPercent=new RegExp("^hsl\\("+[reN,reP,reP]+"\\)$"),reHslaPercent=new RegExp("^hsla\\("+[reN,reP,reP,reN]+"\\)$"),named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(format){var m,l;return format=(format+"").trim().toLowerCase(),(m=reHex.exec(format))?(l=m[1].length,m=parseInt(m[1],16),6===l?rgbn(m):3===l?new Rgb(m>>8&15|m>>4&240,m>>4&15|240&m,(15&m)<<4|15&m,1):8===l?new Rgb(m>>24&255,m>>16&255,m>>8&255,(255&m)/255):4===l?new Rgb(m>>12&15|m>>8&240,m>>8&15|m>>4&240,m>>4&15|240&m,((15&m)<<4|15&m)/255):null):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(255*m[1]/100,255*m[2]/100,255*m[3]/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(255*m[1]/100,255*m[2]/100,255*m[3]/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):"transparent"===format?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,255&n,1)}function rgba(r,g,b,a){return a<=0&&(r=g=b=NaN),new Rgb(r,g,b,a)}function rgbConvert(o){return o instanceof Color||(o=color_color(o)),o?new Rgb((o=o.rgb()).r,o.g,o.b,o.opacity):new Rgb}function color_rgb(r,g,b,opacity){return 1===arguments.length?rgbConvert(r):new Rgb(r,g,b,null==opacity?1:opacity)}function Rgb(r,g,b,opacity){this.r=+r,this.g=+g,this.b=+b,this.opacity=+opacity}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function hex(value){return((value=Math.max(0,Math.min(255,Math.round(value)||0)))<16?"0":"")+value.toString(16)}function hsla(h,s,l,a){return a<=0?h=s=l=NaN:l<=0||l>=1?h=s=NaN:s<=0&&(h=NaN),new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color_color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;var r=(o=o.rgb()).r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;return s?(h=r===max?(g-b)/s+6*(g0&&l<1?0:h,new Hsl(h,s,l,o.opacity)}function hsl(h,s,l,opacity){return 1===arguments.length?hslConvert(h):new Hsl(h,s,l,null==opacity?1:opacity)}function Hsl(h,s,l,opacity){this.h=+h,this.s=+s,this.l=+l,this.opacity=+opacity}function hsl2rgb(h,m1,m2){return 255*(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)}function basis(t1,v0,v1,v2,v3){var t2=t1*t1,t3=t2*t1;return((1-3*t1+3*t2-t3)*v0+(4-6*t2+3*t3)*v1+(1+3*t1+3*t2-3*t3)*v2+t3*v3)/6}define(Color,color_color,{copy:function copy(channels){return Object.assign(new this.constructor,this,channels)},displayable:function displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,color_rgb,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb:function rgb(){return this},displayable:function displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb:function rgb(){var h=this.h%360+360*(this.h<0),s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},displayable:function displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function formatHsl(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var src_constant=function(x){return function(){return x}};function linear(a,d){return function(t){return a+t*d}}function color_hue(a,b){var d=b-a;return d?linear(a,d>180||d<-180?d-360*Math.round(d/360):d):src_constant(isNaN(a)?b:a)}function gamma(y){return 1==(y=+y)?nogamma:function(a,b){return b-a?function exponential(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y)}}(a,b,y):src_constant(isNaN(a)?b:a)}}function nogamma(a,b){var d=b-a;return d?linear(a,d):src_constant(isNaN(a)?b:a)}var src_rgb=function rgbGamma(y){var color=gamma(y);function rgb(start,end){var r=color((start=color_rgb(start)).r,(end=color_rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.r=r(t),start.g=g(t),start.b=b(t),start.opacity=opacity(t),start+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(spline){return function(colors){var i,color,n=colors.length,r=new Array(n),g=new Array(n),b=new Array(n);for(i=0;i=1?(t=1,n-1):Math.floor(t*n),v1=values[i],v2=values[i+1],v0=i>0?values[i-1]:2*v1-v2,v3=ibi&&(bs=b.slice(bi,bs),s[i]?s[i]+=bs:s[++i]=bs),(am=am[0])===(bm=bm[0])?s[i]?s[i]+=bm:s[++i]=bm:(s[++i]=null,q.push({i:i,x:src_number(am,bm)})),bi=reB.lastIndex;return bi2?polymap:bimap,output=input=null,scale}function scale(x){return(output||(output=piecewise(domain,range,clamp?function deinterpolateClamp(deinterpolate){return function(a,b){var d=deinterpolate(a=+a,b=+b);return function(x){return x<=a?0:x>=b?1:d(x)}}}(deinterpolate):deinterpolate,interpolate)))(+x)}return scale.invert=function(y){return(input||(input=piecewise(range,domain,deinterpolateLinear,clamp?function reinterpolateClamp(reinterpolate){return function(a,b){var r=reinterpolate(a=+a,b=+b);return function(t){return t<=0?a:t>=1?b:r(t)}}}(reinterpolate):reinterpolate)))(+y)},scale.domain=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),rescale()):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),rescale()):range.slice()},scale.rangeRound=function(_){return range=array_slice.call(_),interpolate=src_round,rescale()},scale.clamp=function(_){return arguments.length?(clamp=!!_,rescale()):clamp},scale.interpolate=function(_){return arguments.length?(interpolate=_,rescale()):interpolate},rescale()}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]})}function FormatSpecifier(specifier){this.fill=void 0===specifier.fill?" ":specifier.fill+"",this.align=void 0===specifier.align?">":specifier.align+"",this.sign=void 0===specifier.sign?"-":specifier.sign+"",this.symbol=void 0===specifier.symbol?"":specifier.symbol+"",this.zero=!!specifier.zero,this.width=void 0===specifier.width?void 0:+specifier.width,this.comma=!!specifier.comma,this.precision=void 0===specifier.precision?void 0:+specifier.precision,this.trim=!!specifier.trim,this.type=void 0===specifier.type?"":specifier.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var prefixExponent,defaultLocale_locale,defaultLocale_format,defaultLocale_formatPrefix,formatDecimal=function(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]},src_exponent=function(x){return(x=formatDecimal(Math.abs(x)))?x[1]:NaN},formatTrim=function(s){out:for(var i1,n=s.length,i=1,i0=-1;i0){if(!+s[i])break out;i0=0}}return i0>0?s.slice(0,i0)+s.slice(i1+1):s},formatRounded=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")},formatTypes={"%":function _(x,p){return(100*x).toFixed(p)},b:function b(x){return Math.round(x).toString(2)},c:function c(x){return x+""},d:function d(x){return Math.round(x).toString(10)},e:function e(x,p){return x.toExponential(p)},f:function f(x,p){return x.toFixed(p)},g:function g(x,p){return x.toPrecision(p)},o:function o(x){return Math.round(x).toString(8)},p:function p(x,_p){return formatRounded(100*x,_p)},r:formatRounded,s:function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=3*Math.max(-8,Math.min(8,Math.floor(exponent/3))))+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]},X:function X(x){return Math.round(x).toString(16).toUpperCase()},x:function x(_x){return Math.round(_x).toString(16)}},src_identity=function(x){return x},locale_map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],src_locale=function(locale){var group=void 0===locale.grouping||void 0===locale.thousands?src_identity:function(grouping,thousands){return function(value,width){for(var i=value.length,t=[],j=0,g=grouping[0],length=0;i>0&&g>0&&(length+g+1>width&&(g=Math.max(1,width-length)),t.push(value.substring(i-=g,i+g)),!((length+=g+1)>width));)g=grouping[j=(j+1)%grouping.length];return t.reverse().join(thousands)}}(locale_map.call(locale.grouping,Number),locale.thousands+""),currencyPrefix=void 0===locale.currency?"":locale.currency[0]+"",currencySuffix=void 0===locale.currency?"":locale.currency[1]+"",decimal=void 0===locale.decimal?".":locale.decimal+"",numerals=void 0===locale.numerals?src_identity:function(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}}(locale_map.call(locale.numerals,String)),percent=void 0===locale.percent?"%":locale.percent+"",minus=void 0===locale.minus?"-":locale.minus+"",nan=void 0===locale.nan?"NaN":locale.nan+"";function newFormat(specifier){var fill=(specifier=formatSpecifier(specifier)).fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;"n"===type?(comma=!0,type="g"):formatTypes[type]||(void 0===precision&&(precision=12),trim=!0,type="g"),(zero||"0"===fill&&"="===align)&&(zero=!0,fill="0",align="=");var prefix="$"===symbol?currencyPrefix:"#"===symbol&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix="$"===symbol?currencySuffix:/[%p]/.test(type)?percent:"",formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);function format(value){var i,n,c,valuePrefix=prefix,valueSuffix=suffix;if("c"===type)valueSuffix=formatType(value)+valueSuffix,value="";else{var valueNegative=(value=+value)<0;if(value=isNaN(value)?nan:formatType(Math.abs(value),precision),trim&&(value=formatTrim(value)),valueNegative&&0==+value&&(valueNegative=!1),valuePrefix=(valueNegative?"("===sign?sign:minus:"-"===sign||"("===sign?"":sign)+valuePrefix,valueSuffix=("s"===type?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&"("===sign?")":""),maybeSuffix)for(i=-1,n=value.length;++i(c=value.charCodeAt(i))||c>57){valueSuffix=(46===c?decimal+value.slice(i+1):value.slice(i))+valueSuffix,value=value.slice(0,i);break}}comma&&!zero&&(value=group(value,1/0));var length=valuePrefix.length+value.length+valueSuffix.length,padding=length>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix}return numerals(value)}return precision=void 0===precision?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision)),format.toString=function(){return specifier+""},format}return{format:newFormat,formatPrefix:function formatPrefix(specifier,value){var f=newFormat(((specifier=formatSpecifier(specifier)).type="f",specifier)),e=3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3))),k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}}};!function defaultLocale(definition){return defaultLocale_locale=src_locale(definition),defaultLocale_format=defaultLocale_locale.format,defaultLocale_formatPrefix=defaultLocale_locale.formatPrefix,defaultLocale_locale}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var src_tickFormat=function(domain,count,specifier){var precision,start=domain[0],stop=domain[domain.length-1],step=tickStep(start,stop,null==count?10:count);switch((specifier=formatSpecifier(null==specifier?",f":specifier)).type){case"s":var value=Math.max(Math.abs(start),Math.abs(stop));return null!=specifier.precision||isNaN(precision=function(step,value){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3)))-src_exponent(Math.abs(step)))}(step,value))||(specifier.precision=precision),defaultLocale_formatPrefix(specifier,value);case"":case"e":case"g":case"p":case"r":null!=specifier.precision||isNaN(precision=function(step,max){return step=Math.abs(step),max=Math.abs(max)-step,Math.max(0,src_exponent(max)-src_exponent(step))+1}(step,Math.max(Math.abs(start),Math.abs(stop))))||(specifier.precision=precision-("e"===specifier.type));break;case"f":case"%":null!=specifier.precision||isNaN(precision=function(step){return Math.max(0,-src_exponent(Math.abs(step)))}(step))||(specifier.precision=precision-2*("%"===specifier.type))}return defaultLocale_format(specifier)};function linearish(scale){var domain=scale.domain;return scale.ticks=function(count){var d=domain();return src_ticks(d[0],d[d.length-1],null==count?10:count)},scale.tickFormat=function(count,specifier){return src_tickFormat(domain(),count,specifier)},scale.nice=function(count){null==count&&(count=10);var step,d=domain(),i0=0,i1=d.length-1,start=d[i0],stop=d[i1];return stop0?step=tickIncrement(start=Math.floor(start/step)*step,stop=Math.ceil(stop/step)*step,count):step<0&&(step=tickIncrement(start=Math.ceil(start*step)/step,stop=Math.floor(stop*step)/step,count)),step>0?(d[i0]=Math.floor(start/step)*step,d[i1]=Math.ceil(stop/step)*step,domain(d)):step<0&&(d[i0]=Math.ceil(start*step)/step,d[i1]=Math.floor(stop*step)/step,domain(d)),scale},scale}function linear_linear(){var scale=continuous(deinterpolateLinear,src_number);return scale.copy=function(){return copy(scale,linear_linear())},linearish(scale)}function identity_identity(){var domain=[0,1];function scale(x){return+x}return scale.invert=scale,scale.domain=scale.range=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),scale):domain.slice()},scale.copy=function(){return identity_identity().domain(domain)},linearish(scale)}var nice=function(domain,interval){var t,i0=0,i1=(domain=domain.slice()).length-1,x0=domain[i0],x1=domain[i1];return x10){for(;iv)break;z.push(t)}}else for(;i=1;--k)if(!((t=p*k)v)break;z.push(t)}}else z=src_ticks(i,j,Math.min(j-i,n)).map(pows);return r?z.reverse():z},scale.tickFormat=function(count,specifier){if(null==specifier&&(specifier=10===base?".0e":","),"function"!=typeof specifier&&(specifier=defaultLocale_format(specifier)),count===1/0)return specifier;null==count&&(count=10);var k=Math.max(1,base*count/scale.ticks().length);return function(d){var i=d/pows(Math.round(logs(d)));return i*base0?thresholds[i-1]:domain[0],i=n?[domain[n-1],x1]:[domain[i-1],domain[i]]},scale.copy=function(){return quantize().domain([x0,x1]).range(range)},linearish(scale)}function threshold_threshold(){var domain=[.5],range=[0,1],n=1;function scale(x){if(x<=x)return range[bisect(domain,x,0,n)]}return scale.domain=function(_){return arguments.length?(domain=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):range.slice()},scale.invertExtent=function(y){var i=range.indexOf(y);return[domain[i-1],domain[i]]},scale.copy=function(){return threshold_threshold().domain(domain).range(range)},scale}var interval_t0=new Date,interval_t1=new Date;function newInterval(floori,offseti,count,field){function interval(date){return floori(date=0===arguments.length?new Date:new Date(+date)),date}return interval.floor=function(date){return floori(date=new Date(+date)),date},interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),floori(date),date},interval.round=function(date){var d0=interval(date),d1=interval.ceil(date);return date-d00))return range;do{range.push(previous=new Date(+start)),offseti(start,step),floori(start)}while(previous=date)for(;floori(date),!test(date);)date.setTime(date-1)},function(date,step){if(date>=date)if(step<0)for(;++step<=0;)for(;offseti(date,-1),!test(date););else for(;--step>=0;)for(;offseti(date,1),!test(date););})},count&&(interval.count=function(start,end){return interval_t0.setTime(+start),interval_t1.setTime(+end),floori(interval_t0),floori(interval_t1),Math.floor(count(interval_t0,interval_t1))},interval.every=function(step){return step=Math.floor(step),isFinite(step)&&step>0?step>1?interval.filter(field?function(d){return field(d)%step==0}:function(d){return interval.count(0,d)%step==0}):interval:null}),interval}var year_year=newInterval(function(date){date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()},function(date){return date.getFullYear()});year_year.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setFullYear(Math.floor(date.getFullYear()/k)*k),date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step*k)}):null};var src_year=year_year,month_month=(year_year.range,newInterval(function(date){date.setDate(1),date.setHours(0,0,0,0)},function(date,step){date.setMonth(date.getMonth()+step)},function(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())},function(date){return date.getMonth()})),src_month=month_month,durationMinute=(month_month.range,6e4),durationWeek=6048e5;function weekday(i){return newInterval(function(date){date.setDate(date.getDate()-(date.getDay()+7-i)%7),date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+7*step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6),day_day=(sunday.range,monday.range,tuesday.range,wednesday.range,thursday.range,friday.range,saturday.range,newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/864e5},function(date){return date.getDate()-1})),src_day=day_day,hour_hour=(day_day.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds()-date.getMinutes()*durationMinute)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getHours()})),src_hour=hour_hour,minute_minute=(hour_hour.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds())},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getMinutes()})),src_minute=minute_minute,second_second=(minute_minute.range,newInterval(function(date){date.setTime(date-date.getMilliseconds())},function(date,step){date.setTime(+date+1e3*step)},function(start,end){return(end-start)/1e3},function(date){return date.getUTCSeconds()})),src_second=second_second,millisecond_millisecond=(second_second.range,newInterval(function(){},function(date,step){date.setTime(+date+step)},function(start,end){return end-start}));millisecond_millisecond.every=function(k){return k=Math.floor(k),isFinite(k)&&k>0?k>1?newInterval(function(date){date.setTime(Math.floor(date/k)*k)},function(date,step){date.setTime(+date+step*k)},function(start,end){return(end-start)/k}):millisecond_millisecond:null};var src_millisecond=millisecond_millisecond;millisecond_millisecond.range;function utcWeekday(i){return newInterval(function(date){date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+7*step)},function(start,end){return(end-start)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6),utcDay=(utcSunday.range,utcMonday.range,utcTuesday.range,utcWednesday.range,utcThursday.range,utcFriday.range,utcSaturday.range,newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5},function(date){return date.getUTCDate()-1})),src_utcDay=utcDay,utcYear=(utcDay.range,newInterval(function(date){date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()},function(date){return date.getUTCFullYear()}));utcYear.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setUTCFullYear(Math.floor(date.getUTCFullYear()/k)*k),date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step*k)}):null};var src_utcYear=utcYear;utcYear.range;function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);return date.setFullYear(d.y),date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));return date.setUTCFullYear(d.y),date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newDate(y,m,d){return{y:y,m:m,d:d,H:0,M:0,S:0,L:0}}var src_defaultLocale_locale,timeFormat,pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function locale_pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i,i+6));return n?(d.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function parseQuarter(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.q=3*n[0]-3,i+n[0].length):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseMicroseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+6));return n?(d.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function parseUnixTimestamp(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=+n[0],i+n[0].length):-1}function parseUnixTimestampSeconds(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.s=+n[0],i+n[0].length):-1}function formatDayOfMonth(d,p){return locale_pad(d.getDate(),p,2)}function formatHour24(d,p){return locale_pad(d.getHours(),p,2)}function formatHour12(d,p){return locale_pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return locale_pad(1+src_day.count(src_year(d),d),p,3)}function formatMilliseconds(d,p){return locale_pad(d.getMilliseconds(),p,3)}function formatMicroseconds(d,p){return formatMilliseconds(d,p)+"000"}function formatMonthNumber(d,p){return locale_pad(d.getMonth()+1,p,2)}function formatMinutes(d,p){return locale_pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return locale_pad(d.getSeconds(),p,2)}function formatWeekdayNumberMonday(d){var day=d.getDay();return 0===day?7:day}function formatWeekNumberSunday(d,p){return locale_pad(sunday.count(src_year(d)-1,d),p,2)}function formatWeekNumberISO(d,p){var day=d.getDay();return d=day>=4||0===day?thursday(d):thursday.ceil(d),locale_pad(thursday.count(src_year(d),d)+(4===src_year(d).getDay()),p,2)}function formatWeekdayNumberSunday(d){return d.getDay()}function formatWeekNumberMonday(d,p){return locale_pad(monday.count(src_year(d)-1,d),p,2)}function locale_formatYear(d,p){return locale_pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return locale_pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+locale_pad(z/60|0,"0",2)+locale_pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return locale_pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return locale_pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return locale_pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return locale_pad(1+src_utcDay.count(src_utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return locale_pad(d.getUTCMilliseconds(),p,3)}function formatUTCMicroseconds(d,p){return formatUTCMilliseconds(d,p)+"000"}function formatUTCMonthNumber(d,p){return locale_pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return locale_pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return locale_pad(d.getUTCSeconds(),p,2)}function formatUTCWeekdayNumberMonday(d){var dow=d.getUTCDay();return 0===dow?7:dow}function formatUTCWeekNumberSunday(d,p){return locale_pad(utcSunday.count(src_utcYear(d)-1,d),p,2)}function formatUTCWeekNumberISO(d,p){var day=d.getUTCDay();return d=day>=4||0===day?utcThursday(d):utcThursday.ceil(d),locale_pad(utcThursday.count(src_utcYear(d),d)+(4===src_utcYear(d).getUTCDay()),p,2)}function formatUTCWeekdayNumberSunday(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return locale_pad(utcMonday.count(src_utcYear(d)-1,d),p,2)}function formatUTCYear(d,p){return locale_pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return locale_pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(d){return+d}function formatUnixTimestampSeconds(d){return Math.floor(+d/1e3)}!function defaultLocale_defaultLocale(definition){return src_defaultLocale_locale=function formatLocale(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_weekdays=locale.days,locale_shortWeekdays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths,periodRe=formatRe(locale_periods),periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths),formats={a:function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]},A:function formatWeekday(d){return locale_weekdays[d.getDay()]},b:function formatShortMonth(d){return locale_shortMonths[d.getMonth()]},B:function formatMonth(d){return locale_months[d.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]},q:function formatQuarter(d){return 1+~~(d.getMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},utcFormats={a:function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]},A:function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]},b:function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]},B:function formatUTCMonth(d){return locale_months[d.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]},q:function formatUTCQuarter(d){return 1+~~(d.getUTCMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},parses={a:function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},A:function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},b:function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup[n[0].toLowerCase()],i+n[0].length):-1},B:function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup[n[0].toLowerCase()],i+n[0].length):-1},c:function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(d,string,i){var n=periodRe.exec(string.slice(i));return n?(d.p=periodLookup[n[0].toLowerCase()],i+n[0].length):-1},q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)},X:function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(specifier,formats){return function(date){var c,pad,format,string=[],i=-1,j=0,n=specifier.length;for(date instanceof Date||(date=new Date(+date));++i53)return null;"w"in d||(d.w=1),"Z"in d?(week=(day=(week=utcDate(newDate(d.y,0,1))).getUTCDay())>4||0===day?utcMonday.ceil(week):utcMonday(week),week=src_utcDay.offset(week,7*(d.V-1)),d.y=week.getUTCFullYear(),d.m=week.getUTCMonth(),d.d=week.getUTCDate()+(d.w+6)%7):(week=(day=(week=localDate(newDate(d.y,0,1))).getDay())>4||0===day?monday.ceil(week):monday(week),week=src_day.offset(week,7*(d.V-1)),d.y=week.getFullYear(),d.m=week.getMonth(),d.d=week.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),day="Z"in d?utcDate(newDate(d.y,0,1)).getUTCDay():localDate(newDate(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(day+5)%7:d.w+7*d.U-(day+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,utcDate(d)):localDate(d)}}function parseSpecifier(d,specifier,string,j){for(var c,parse,i=0,n=specifier.length,m=string.length;i=m)return-1;if(37===(c=specifier.charCodeAt(i++))){if(c=specifier.charAt(i++),!(parse=parses[c in pads?specifier.charAt(i++):c])||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++))return-1}return j}return formats.x=newFormat(locale_date,formats),formats.X=newFormat(locale_time,formats),formats.c=newFormat(locale_dateTime,formats),utcFormats.x=newFormat(locale_date,utcFormats),utcFormats.X=newFormat(locale_time,utcFormats),utcFormats.c=newFormat(locale_dateTime,utcFormats),{format:function format(specifier){var f=newFormat(specifier+="",formats);return f.toString=function(){return specifier},f},parse:function parse(specifier){var p=newParse(specifier+="",!1);return p.toString=function(){return specifier},p},utcFormat:function utcFormat(specifier){var f=newFormat(specifier+="",utcFormats);return f.toString=function(){return specifier},f},utcParse:function utcParse(specifier){var p=newParse(specifier+="",!0);return p.toString=function(){return specifier},p}}}(definition),timeFormat=src_defaultLocale_locale.format,src_defaultLocale_locale.parse,src_defaultLocale_locale.utcFormat,src_defaultLocale_locale.utcParse,src_defaultLocale_locale}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var time_durationSecond=1e3,time_durationMinute=60*time_durationSecond,time_durationHour=60*time_durationMinute,time_durationDay=24*time_durationHour,time_durationWeek=7*time_durationDay,durationMonth=30*time_durationDay,durationYear=365*time_durationDay;function time_date(t){return new Date(t)}function time_number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(year,month,week,day,hour,minute,second,millisecond,format){var scale=continuous(deinterpolateLinear,src_number),invert=scale.invert,domain=scale.domain,formatMillisecond=format(".%L"),formatSecond=format(":%S"),formatMinute=format("%I:%M"),formatHour=format("%I %p"),formatDay=format("%a %d"),formatWeek=format("%b %d"),formatMonth=format("%B"),formatYear=format("%Y"),tickIntervals=[[second,1,time_durationSecond],[second,5,5*time_durationSecond],[second,15,15*time_durationSecond],[second,30,30*time_durationSecond],[minute,1,time_durationMinute],[minute,5,5*time_durationMinute],[minute,15,15*time_durationMinute],[minute,30,30*time_durationMinute],[hour,1,time_durationHour],[hour,3,3*time_durationHour],[hour,6,6*time_durationHour],[hour,12,12*time_durationHour],[day,1,time_durationDay],[day,2,2*time_durationDay],[week,1,time_durationWeek],[month,1,durationMonth],[month,3,3*durationMonth],[year,1,durationYear]];function tickFormat(date){return(second(date)1)&&(t-=Math.floor(t));var ts=Math.abs(t-.5);return rainbow_c.h=360*t-100,rainbow_c.s=1.5-1.5*ts,rainbow_c.l=.8-.9*ts,rainbow_c+""},sequential_multi_cubehelix=cubehelixLong(cubehelix_cubehelix(300,.5,0),cubehelix_cubehelix(-240,.5,1)),BuGn=src_ramp(new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(d3_scale_chromatic_src_colors)),BuPu=src_ramp(new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(d3_scale_chromatic_src_colors)),GnBu=src_ramp(new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(d3_scale_chromatic_src_colors)),OrRd=src_ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(d3_scale_chromatic_src_colors)),PuBuGn=src_ramp(new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(d3_scale_chromatic_src_colors)),PuBu=src_ramp(new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(d3_scale_chromatic_src_colors)),PuRd=src_ramp(new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(d3_scale_chromatic_src_colors)),RdPu=src_ramp(new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(d3_scale_chromatic_src_colors)),YlGnBu=src_ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(d3_scale_chromatic_src_colors)),YlGn=src_ramp(new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(d3_scale_chromatic_src_colors)),YlOrBr=src_ramp(new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(d3_scale_chromatic_src_colors)),YlOrRd=src_ramp(new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(d3_scale_chromatic_src_colors)),UNIT_GLOBAL_NAMESPACE="app.units",UNIT_LOCAL_NAMESPACE="local.units",LAYER_LOCAL_NAMESPACE="local.layers",LAYER_GLOBAL_NAMESPACE="app.layers",GROUP_GLOBAL_NAMESPACE="app.group",GROUP_LOCAL_NAMESPACE="local.group",CANVAS_LOCAL_NAMESPACE="local.canvas",CANVAS_GLOBAL_NAMESPACE="app.canvas",swap=function swap(arr,i,j){var tmp=arr[i];arr[i]=arr[j],arr[j]=tmp},defaultCompare=function defaultCompare(a,b){return a>b?-1:a>b?1:0},quick_select=function quickselect(arr,k,left,right,compare){!function quickselectStep(arr,k,left,right,compare){for(;right>left;){if(right-left>600){var n=right-left+1,m=k-left+1,z=Math.log(n),s=.5*Math.exp(2*z/3),sd=.5*Math.sqrt(z*s*(n-s)/n)*(m-n/2<0?-1:1);quickselectStep(arr,k,Math.max(left,Math.floor(k-m*s/n+sd)),Math.min(right,Math.floor(k+(n-m)*s/n+sd)),compare)}var t=arr[k],i=left,j=right;for(swap(arr,left,k),compare(arr[right],t)>0&&swap(arr,left,right);i0;)j--}0===compare(arr[left],t)?swap(arr,left,j):swap(arr,++j,right),j<=k&&(left=j+1),k<=j&&(right=j-1)}}(arr,k,left||0,right||arr.length-1,compare||defaultCompare)};function _defineProperties(target,props){for(var i=0;i=a.minX&&b.maxY>=a.minY},findItem=function findItem(item,items,equalsFn){if(!equalsFn)return items.indexOf(item);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:9;!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RTree),this._maxEntries=Math.max(4,maxEntries),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(RTree,[{key:"all",value:function all(){return _all(this.data,[])}},{key:"search",value:function search(bbox){var node=this.data,result=[];if(!intersects(bbox,node))return result;for(var toBBox=this.toBBox,nodesToSearch=[];node;){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=node.children[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var child=_step.value,childBBox=node.leaf?toBBox(child):child;intersects(bbox,childBBox)&&(node.leaf?result.push(child):contains(bbox,childBBox)?_all(child,result):nodesToSearch.push(child))}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}node=nodesToSearch.pop()}return result}},{key:"load",value:function load(data){if(!data||!data.length)return this;if(data.length=0&&insertPath[level].children.length>this._maxEntries;)this.split(insertPath,level),level--;this.adjustParentBoxes(bbox,insertPath,level)}},{key:"split",value:function split(insertPath,level){var node=insertPath[level],M=node.children.length,m=this._minEntries;this.chooseSplitAxis(node,m,M);var splitIndex=this.chooseSplitIndex(node,m,M),newNode=createNode(node.children.splice(splitIndex,node.children.length-splitIndex));newNode.height=node.height,newNode.leaf=node.leaf,calcBBox(node,this.toBBox),calcBBox(newNode,this.toBBox),level?insertPath[level-1].children.push(newNode):this.splitRoot(node,newNode)}},{key:"splitRoot",value:function splitRoot(node,newNode){this.data=createNode([node,newNode]),this.data.height=node.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)}},{key:"chooseSplitIndex",value:function chooseSplitIndex(node,m,M){for(var index,minOverlap=1/0,minArea=1/0,i=m;i<=M-m;i++){var bbox1=distBBox(node,0,i,this.toBBox),bbox2=distBBox(node,i,M,this.toBBox),overlap=intersectionArea(bbox1,bbox2),area=bboxArea(bbox1)+bboxArea(bbox2);overlap=m;_i--){var _child=node.children[_i];r_tree_extend(rightBBox,node.leaf?toBBox(_child):_child),margin+=bboxMargin(rightBBox)}return margin}},{key:"adjustParentBoxes",value:function adjustParentBoxes(bbox,path,level){for(var i=level;i>=0;i--)r_tree_extend(path[i],bbox)}},{key:"condense",value:function condense(path){for(var siblings,i=path.length-1;i>=0;i--)0===path[i].children.length?i>0?(siblings=path[i-1].children).splice(siblings.indexOf(path[i]),1):this.clear():calcBBox(path[i],this.toBBox)}}]),RTree}(),reserved_fields={ROW_ID:"__id__",MEASURE_NAMES:"__measure_names__"},common_props={ACTION_INF:"actionInf",ON_LAYER_DRAW:"onLayerDraw",MATRIX_CREATED:"matrixCreated"},COORD_TYPES={POLAR:"polar",CARTESIAN:"cartesian"},DATA_TYPE_FUNCTION="function",DATA_TYPE_STRING="string",src_array_slice=Array.prototype.slice,d3_axis_src_identity=function(x){return x},axis_top=1,axis_right=2,axis_bottom=3,axis_left=4,epsilon=1e-6;function translateX(x){return"translate("+(x+.5)+",0)"}function translateY(y){return"translate(0,"+(y+.5)+")"}function entering(){return!this.__axis}function axis_axis(orient,scale){var tickArguments=[],tickValues=null,tickFormat=null,tickTransform=null,tickSizeInner=6,tickSizeOuter=6,tickPadding=3,k=orient===axis_top||orient===axis_left?-1:1,x=orient===axis_left||orient===axis_right?"x":"y",transform=orient===axis_top||orient===axis_bottom?translateX:translateY;function axis(context){var values=null==tickValues?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():tickValues,format=null==tickFormat?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):d3_axis_src_identity:tickFormat,spacing=Math.max(tickSizeInner,0)+tickPadding,range=scale.range(),range0=+range[0]+.5,range1=+range[range.length-1]+.5,position=(scale.bandwidth?function axis_center(scale){var offset=Math.max(0,scale.bandwidth()-1)/2;return scale.round()&&(offset=Math.round(offset)),function(d){return+scale(d)+offset}}:function axis_number(scale){return function(d){return+scale(d)}})(scale.copy()),selection=context.selection?context.selection():context,path=selection.selectAll(".domain").data([null]),tick=selection.selectAll(".tick").data(values,scale).order(),tickExit=tick.exit(),tickEnter=tick.enter().append("g").attr("class","tick"),line=tick.select("line"),text=tick.select("text");path=path.merge(path.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),tick=tick.merge(tickEnter),line=line.merge(tickEnter.append("line").attr("stroke","#000").attr(x+"2",k*tickSizeInner)),text=text.merge(tickEnter.append("text").attr("fill","#000").attr(x,k*spacing).attr("dy",orient===axis_top?"0em":orient===axis_bottom?"0.71em":"0.32em")).style("transform",tickTransform),context!==selection&&(path=path.transition(context),tick=tick.transition(context),line=line.transition(context),text=text.transition(context),tickExit=tickExit.transition(context).attr("opacity",epsilon).attr("transform",function(d){return isFinite(d=position(d))?transform(d):this.getAttribute("transform")}),tickEnter.attr("opacity",epsilon).attr("transform",function(d){var p=this.parentNode.__axis;return transform(p&&isFinite(p=p(d))?p:position(d))})),tickExit.remove(),path.attr("d",orient===axis_left||orient==axis_right?"M"+k*tickSizeOuter+","+range0+"H0.5V"+range1+"H"+k*tickSizeOuter:"M"+range0+","+k*tickSizeOuter+"V0.5H"+range1+"V"+k*tickSizeOuter),tick.attr("opacity",1).attr("transform",function(d){return transform(position(d))}),line.attr(x+"2",k*tickSizeInner),text.attr(x,k*spacing).text(format),selection.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",orient===axis_right?"start":orient===axis_left?"end":"middle"),selection.each(function(){this.__axis=position})}return axis.scale=function(_){return arguments.length?(scale=_,axis):scale},axis.tickTransform=function(_){return arguments.length?(tickTransform=_,axis):tickTransform},axis.ticks=function(){return tickArguments=src_array_slice.call(arguments),axis},axis.tickArguments=function(_){return arguments.length?(tickArguments=null==_?[]:src_array_slice.call(_),axis):tickArguments.slice()},axis.tickValues=function(_){return arguments.length?(tickValues=null==_?null:src_array_slice.call(_),axis):tickValues&&tickValues.slice()},axis.tickFormat=function(_){return arguments.length?(tickFormat=_,axis):tickFormat},axis.tickSize=function(_){return arguments.length?(tickSizeInner=tickSizeOuter=+_,axis):tickSizeInner},axis.tickSizeInner=function(_){return arguments.length?(tickSizeInner=+_,axis):tickSizeInner},axis.tickSizeOuter=function(_){return arguments.length?(tickSizeOuter=+_,axis):tickSizeOuter},axis.tickPadding=function(_){return arguments.length?(tickPadding=+_,axis):tickPadding},axis}var abs=Math.abs,atan2=Math.atan2,cos=Math.cos,math_max=Math.max,math_min=Math.min,sin=Math.sin,math_sqrt=Math.sqrt,math_epsilon=1e-12,pi=Math.PI,halfPi=pi/2,tau=2*pi;function asin(x){return x>=1?halfPi:x<=-1?-halfPi:Math.asin(x)}var symbol_circle={draw:function draw(context,size){var r=Math.sqrt(size/pi);context.moveTo(r,0),context.arc(0,0,r,0,tau)}},symbol_cross={draw:function draw(context,size){var r=Math.sqrt(size/5)/2;context.moveTo(-3*r,-r),context.lineTo(-r,-r),context.lineTo(-r,-3*r),context.lineTo(r,-3*r),context.lineTo(r,-r),context.lineTo(3*r,-r),context.lineTo(3*r,r),context.lineTo(r,r),context.lineTo(r,3*r),context.lineTo(-r,3*r),context.lineTo(-r,r),context.lineTo(-3*r,r),context.closePath()}},tan30=Math.sqrt(1/3),tan30_2=2*tan30,diamond={draw:function draw(context,size){var y=Math.sqrt(size/tan30_2),x=y*tan30;context.moveTo(0,-y),context.lineTo(x,0),context.lineTo(0,y),context.lineTo(-x,0),context.closePath()}},square={draw:function draw(context,size){var w=Math.sqrt(size),x=-w/2;context.rect(x,x,w,w)}},kr=Math.sin(pi/10)/Math.sin(7*pi/10),kx=Math.sin(tau/10)*kr,ky=-Math.cos(tau/10)*kr,star={draw:function draw(context,size){var r=Math.sqrt(.8908130915292852*size),x=kx*r,y=ky*r;context.moveTo(0,-r),context.lineTo(x,y);for(var i=1;i<5;++i){var a=tau*i/5,c=Math.cos(a),s=Math.sin(a);context.lineTo(s*r,-c*r),context.lineTo(c*x-s*y,s*x+c*y)}context.closePath()}},wye_s=Math.sqrt(3)/2,wye_k=1/Math.sqrt(12),wye_a=3*(wye_k/2+1),wye={draw:function draw(context,size){var r=Math.sqrt(size/wye_a),x0=r/2,y0=r*wye_k,x1=x0,y1=r*wye_k+r,x2=-x1,y2=y1;context.moveTo(x0,y0),context.lineTo(x1,y1),context.lineTo(x2,y2),context.lineTo(-.5*x0-wye_s*y0,wye_s*x0+-.5*y0),context.lineTo(-.5*x1-wye_s*y1,wye_s*x1+-.5*y1),context.lineTo(-.5*x2-wye_s*y2,wye_s*x2+-.5*y2),context.lineTo(-.5*x0+wye_s*y0,-.5*y0-wye_s*x0),context.lineTo(-.5*x1+wye_s*y1,-.5*y1-wye_s*x1),context.lineTo(-.5*x2+wye_s*y2,-.5*y2-wye_s*x2),context.closePath()}},sqrt3=Math.sqrt(3),triangle={draw:function draw(context,size){var y=-Math.sqrt(size/(3*sqrt3));context.moveTo(0,2*y),context.lineTo(-sqrt3*y,-y),context.lineTo(sqrt3*y,-y),context.closePath()}},path_pi=Math.PI,path_tau=2*path_pi,tauEpsilon=path_tau-1e-6;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function moveTo(x,y){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)},closePath:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function lineTo(x,y){this._+="L"+(this._x1=+x)+","+(this._y1=+y)},quadraticCurveTo:function quadraticCurveTo(x1,y1,x,y){this._+="Q"+ +x1+","+ +y1+","+(this._x1=+x)+","+(this._y1=+y)},bezierCurveTo:function bezierCurveTo(x1,y1,x2,y2,x,y){this._+="C"+ +x1+","+ +y1+","+ +x2+","+ +y2+","+(this._x1=+x)+","+(this._y1=+y)},arcTo:function arcTo(x1,y1,x2,y2,r){x1=+x1,y1=+y1,x2=+x2,y2=+y2,r=+r;var x0=this._x1,y0=this._y1,x21=x2-x1,y21=y2-y1,x01=x0-x1,y01=y0-y1,l01_2=x01*x01+y01*y01;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=x1)+","+(this._y1=y1);else if(l01_2>1e-6)if(Math.abs(y01*x21-y21*x01)>1e-6&&r){var x20=x2-x0,y20=y2-y0,l21_2=x21*x21+y21*y21,l20_2=x20*x20+y20*y20,l21=Math.sqrt(l21_2),l01=Math.sqrt(l01_2),l=r*Math.tan((path_pi-Math.acos((l21_2+l01_2-l20_2)/(2*l21*l01)))/2),t01=l/l01,t21=l/l21;Math.abs(t01-1)>1e-6&&(this._+="L"+(x1+t01*x01)+","+(y1+t01*y01)),this._+="A"+r+","+r+",0,0,"+ +(y01*x20>x01*y20)+","+(this._x1=x1+t21*x21)+","+(this._y1=y1+t21*y21)}else this._+="L"+(this._x1=x1)+","+(this._y1=y1);else;},arc:function arc(x,y,r,a0,a1,ccw){x=+x,y=+y,ccw=!!ccw;var dx=(r=+r)*Math.cos(a0),dy=r*Math.sin(a0),x0=x+dx,y0=y+dy,cw=1^ccw,da=ccw?a0-a1:a1-a0;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+x0+","+y0:(Math.abs(this._x1-x0)>1e-6||Math.abs(this._y1-y0)>1e-6)&&(this._+="L"+x0+","+y0),r&&(da<0&&(da=da%path_tau+path_tau),da>tauEpsilon?this._+="A"+r+","+r+",0,1,"+cw+","+(x-dx)+","+(y-dy)+"A"+r+","+r+",0,1,"+cw+","+(this._x1=x0)+","+(this._y1=y0):da>1e-6&&(this._+="A"+r+","+r+",0,"+ +(da>=path_pi)+","+cw+","+(this._x1=x+r*Math.cos(a1))+","+(this._y1=y+r*Math.sin(a1))))},rect:function rect(x,y,w,h){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)+"h"+ +w+"v"+ +h+"h"+-w+"Z"},toString:function toString(){return this._}};var src_path=path_path,d3_shape_src_constant=function(x){return function constant(){return x}},none=function(series){for(var n=series.length,o=new Array(n);--n>=0;)o[n]=n;return o},order_ascending=function(series){var sums=series.map(ascending_sum);return none(series).sort(function(a,b){return sums[a]-sums[b]})};function ascending_sum(series){for(var v,s=0,i=-1,n=series.length;++i1)for(var j,s0,n,i=1,s1=series[order[0]],m=s1.length;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,y),this._context.lineTo(x,y);else{var x1=this._x*(1-this._t)+x*this._t;this._context.lineTo(x1,this._y),this._context.lineTo(x1,y)}}this._x=x,this._y=y}};var curve_step=function(context){return new Step(context,.5)};function stepBefore(context){return new Step(context,0)}function stepAfter(context){return new Step(context,1)}function _point(that,x,y){that._context.bezierCurveTo(that._x1+that._k*(that._x2-that._x0),that._y1+that._k*(that._y2-that._y0),that._x2+that._k*(that._x1-x),that._y2+that._k*(that._y1-y),that._x2,that._y2)}function Cardinal(context,tension){this._context=context,this._k=(1-tension)/6}Cardinal.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2,this._x1=x,this._y1=y;break;case 2:this._point=3;default:_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new Cardinal(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CatmullRom(context,alpha){this._context=context,this._alpha=alpha}CatmullRom.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3;default:!function catmullRom_point(that,x,y){var x1=that._x1,y1=that._y1,x2=that._x2,y2=that._y2;if(that._l01_a>math_epsilon){var a=2*that._l01_2a+3*that._l01_a*that._l12_a+that._l12_2a,n=3*that._l01_a*(that._l01_a+that._l12_a);x1=(x1*a-that._x0*that._l12_2a+that._x2*that._l01_2a)/n,y1=(y1*a-that._y0*that._l12_2a+that._y2*that._l01_2a)/n}if(that._l23_a>math_epsilon){var b=2*that._l23_2a+3*that._l23_a*that._l12_a+that._l12_2a,m=3*that._l23_a*(that._l23_a+that._l12_a);x2=(x2*b+that._x1*that._l23_2a-x*that._l12_2a)/m,y2=(y2*b+that._y1*that._l23_2a-y*that._l12_2a)/m}that._context.bezierCurveTo(x1,y1,x2,y2,that._x2,that._y2)}(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};var curve_catmullRom=function custom(alpha){function catmullRom(context){return alpha?new CatmullRom(context,alpha):new Cardinal(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom}(.5);function point_x(p){return p[0]}function point_y(p){return p[1]}var src_line=function(){var x=point_x,y=point_y,defined=d3_shape_src_constant(!0),context=null,curve=curve_linear,output=null;function line(data){var i,d,buffer,n=data.length,defined0=!1;for(null==context&&(output=curve(buffer=src_path())),i=0;i<=n;++i)!(ia?1:b>=a?0:NaN},d3_shape_src_identity=function(d){return d};function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/math_sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*math_sqrt(math_max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function hsl_hsl(hue){return function(start,end){var h=hue((start=hsl(start)).h,(end=hsl(end)).h),s=nogamma(start.s,end.s),l=nogamma(start.l,end.l),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.h=h(t),start.s=s(t),start.l=l(t),start.opacity=opacity(t),start+""}}}hsl_hsl(color_hue);var hslLong=hsl_hsl(nogamma);function piecewise_piecewise(interpolate,values){for(var i=0,n=values.length-1,v=values[0],I=new Array(n<0?0:n);i0)){if(r/=dx,dx<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=x1-ax,dx||!(r<0)){if(r/=dx,dx<0){if(r>t1)return;r>t0&&(t0=r)}else if(dx>0){if(r0)){if(r/=dy,dy<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=y1-ay,dy||!(r<0)){if(r/=dy,dy<0){if(r>t1)return;r>t0&&(t0=r)}else if(dy>0){if(r0||t1<1)||(t0>0&&(edge[0]=[ax+t0*dx,ay+t0*dy]),t1<1&&(edge[1]=[ax+t1*dx,ay+t1*dy]),!0)}}}}}function connectEdge(edge,x0,y0,x1,y1){var v1=edge[1];if(v1)return!0;var fm,fb,v0=edge[0],left=edge.left,right=edge.right,lx=left[0],ly=left[1],rx=right[0],ry=right[1],fx=(lx+rx)/2,fy=(ly+ry)/2;if(ry===ly){if(fx=x1)return;if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[fx,y0];v1=[fx,y1]}else{if(v0){if(v0[1]1)if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[(y0-fb)/fm,y0];v1=[(y1-fb)/fm,y1]}else{if(v0){if(v0[1]=x1)return}else v0=[x0,fm*x0+fb];v1=[x1,fm*x1+fb]}else{if(v0){if(v0[0]=-epsilon2)){var ha=ax*ax+ay*ay,hc=cx*cx+cy*cy,x=(cy*ha-ay*hc)/d,y=(ax*hc-cx*ha)/d,circle=circlePool.pop()||new function Circle(){RedBlackNode(this),this.x=this.y=this.arc=this.site=this.cy=null};circle.arc=arc,circle.site=cSite,circle.x=x+bx,circle.y=(circle.cy=y+by)+Math.sqrt(x*x+y*y),arc.circle=circle;for(var before=null,node=circles._;node;)if(circle.yDiagram_epsilon)node=node.L;else{if(!((dxr=x-rightBreakPoint(node,directrix))>Diagram_epsilon)){dxl>-Diagram_epsilon?(lArc=node.P,rArc=node):dxr>-Diagram_epsilon?(lArc=node,rArc=node.N):lArc=rArc=node;break}if(!node.R){lArc=node;break}node=node.R}!function createCell(site){return Diagram_cells[site.index]={site:site,halfedges:[]}}(site);var newArc=createBeach(site);if(beaches.insert(lArc,newArc),lArc||rArc){if(lArc===rArc)return detachCircle(lArc),rArc=createBeach(lArc.site),beaches.insert(newArc,rArc),newArc.edge=rArc.edge=createEdge(lArc.site,newArc.site),attachCircle(lArc),void attachCircle(rArc);if(rArc){detachCircle(lArc),detachCircle(rArc);var lSite=lArc.site,ax=lSite[0],ay=lSite[1],bx=site[0]-ax,by=site[1]-ay,rSite=rArc.site,cx=rSite[0]-ax,cy=rSite[1]-ay,d=2*(bx*cy-by*cx),hb=bx*bx+by*by,hc=cx*cx+cy*cy,vertex=[(cy*hb-by*hc)/d+ax,(bx*hc-cx*hb)/d+ay];setEdgeEnd(rArc.edge,lSite,rSite,vertex),newArc.edge=createEdge(lSite,site,null,vertex),rArc.edge=createEdge(site,rSite,null,vertex),attachCircle(lArc),attachCircle(rArc)}else newArc.edge=createEdge(lArc.site,newArc.site)}}function leftBreakPoint(arc,directrix){var site=arc.site,rfocx=site[0],rfocy=site[1],pby2=rfocy-directrix;if(!pby2)return rfocx;var lArc=arc.P;if(!lArc)return-1/0;var lfocx=(site=lArc.site)[0],lfocy=site[1],plby2=lfocy-directrix;if(!plby2)return lfocx;var hl=lfocx-rfocx,aby2=1/pby2-1/plby2,b=hl/plby2;return aby2?(-b+Math.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx:(rfocx+lfocx)/2}function rightBreakPoint(arc,directrix){var rArc=arc.N;if(rArc)return leftBreakPoint(rArc,directrix);var site=arc.site;return site[1]===directrix?site[0]:1/0}var beaches,Diagram_cells,circles,Diagram_edges,Diagram_epsilon=1e-6,epsilon2=1e-12;function triangleArea(a,b,c){return(a[0]-c[0])*(b[1]-a[1])-(a[0]-b[0])*(c[1]-a[1])}function lexicographic(a,b){return b[1]-a[1]||b[0]-a[0]}function Diagram(sites,extent){var x,y,circle,site=sites.sort(lexicographic).pop();for(Diagram_edges=[],Diagram_cells=new Array(sites.length),beaches=new src_RedBlackTree,circles=new src_RedBlackTree;;)if(circle=firstCircle,site&&(!circle||site[1]Diagram_epsilon||Math.abs(edge[0][1]-edge[1][1])>Diagram_epsilon)||delete Diagram_edges[i]}(x0,y0,x1,y1),function clipCells(x0,y0,x1,y1){var iCell,cell,site,iHalfedge,halfedges,nHalfedges,start,startX,startY,end,endX,endY,nCells=Diagram_cells.length,cover=!0;for(iCell=0;iCellDiagram_epsilon||Math.abs(endY-startY)>Diagram_epsilon)&&(halfedges.splice(iHalfedge,0,Diagram_edges.push(createBorderEdge(site,end,Math.abs(endX-x0)Diagram_epsilon?[x0,Math.abs(startX-x0)Diagram_epsilon?[Math.abs(startY-y1)Diagram_epsilon?[x1,Math.abs(startX-x1)Diagram_epsilon?[Math.abs(startY-y0)=n)return null;var dx=x-cell.site[0],dy=y-cell.site[1],d2=dx*dx+dy*dy;do{cell=that.cells[i0=i1],i1=null,cell.halfedges.forEach(function(e){var edge=that.edges[e],v=edge.left;if(v!==cell.site&&v||(v=edge.right)){var vx=x-v[0],vy=y-v[1],v2=vx*vx+vy*vy;v20?0:domain[0],domain[1]=domain[1]>0?domain[1]:0),domain},unionDomain=function unionDomain(domains,fieldType){var _ref2,domain=[];(domains=domains.filter(function(dom){return dom&&dom.length})).length&&(domain=fieldType===CATEGORICAL?(_ref2=[]).concat.apply(_ref2,common_utils_toConsumableArray(domains)):[Math.min.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[0]}))),Math.max.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[1]})))]);return domain},symbolFns={circle:symbol_circle,cross:symbol_cross,diamond:diamond,square:square,star:star,wye:wye,triangle:triangle},easeFns={cubic:cubicInOut,bounce:bounceOut,linear:function src_linear_linear(t){return+t},elastic:elasticOut,back:backInOut,poly:polyInOut,circle:function circleInOut(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}},getExtremePoint=function getExtremePoint(points,compareValue,minOrMax){for(var extremePoint,point,val,len=points.length,minOrMaxVal="max"===minOrMax?-1/0:1/0,i=0;iminOrMaxVal)&&(minOrMaxVal=val,extremePoint=point);return extremePoint},getMinPoint=function getMinPoint(points,compareValue){return getExtremePoint(points,compareValue,"min")},getMaxPoint=function getMaxPoint(points,compareValue){return getExtremePoint(points,compareValue,"max")},common_utils_getClosestIndexOf=function getClosestIndexOf(arr,value,side){for(var mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1},getNearestValue=function getNearestValue(data,key){var filterData=data.filter(function(d){return"number"==typeof d});return filterData[common_utils_getClosestIndexOf(filterData,key)]},getWindow=function getWindow(){return window},reqAnimFrame=requestAnimationFrame,cancelAnimFrame=cancelAnimationFrame,capitalizeFirst=function capitalizeFirst(text){return(text=text.toLowerCase()).replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1)})},unique=function unique(arr){var fn=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(d){return d},vals=arr.reduce(function(acc,v){return acc[fn(v)]=v,acc},{});return Object.values(vals)},getMinDiff=function getMinDiff(arr,index){var diff,uniqueVals;if((uniqueVals=unique(void 0!==index?arr.map(function(d){return d[index]}):arr)).length>1){diff=Math.abs(uniqueVals[1]-uniqueVals[0]);for(var i=2,len=uniqueVals.length;i0&&void 0!==arguments[0]?arguments[0]:[];!function common_utils_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Voronoi),this._voronoi=src_voronoi().x(function(d){return d.x}).y(function(d){return d.y}),this.data(data)}return function common_utils_createClass(Constructor,protoProps,staticProps){return protoProps&&common_utils_defineProperties(Constructor.prototype,protoProps),staticProps&&common_utils_defineProperties(Constructor,staticProps),Constructor}(Voronoi,[{key:"data",value:function data(_data){return _data&&(this._voronoiFn=this._voronoi(_data)),this}},{key:"find",value:function find(x,y,radius){return this._voronoiFn.find(x,y,radius)}}]),Voronoi}(),getObjProp=function getObjProp(obj){if(void 0===obj||null===obj)return obj;for(var retObj=obj,_len=arguments.length,fields=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)fields[_key-1]=arguments[_key];for(var i=0,len=fields.length;i=0;i--)if(arr1[i]!==arr2[i])return!1;return!0},common_utils_isEqual=function isEqual(type){return function(oldVal,newVal){return"Array"===type?!!oldVal&&arraysEqual(oldVal,newVal):"Object"===type?Object.is(oldVal,newVal):oldVal===newVal}},enableChainedTransaction=function enableChainedTransaction(transactionModel,transactionEndpoint,transactionItems){return transactionItems.forEach(function(item){return transactionModel.registerImmediateListener(item,function(_ref3){var newVal=_slicedToArray(_ref3,2)[1];return transactionEndpoint[item](newVal)})})},isHTMLElem=function isHTMLElem(elem){return elem instanceof common_utils_HTMLElement},ERROR_MSG={INTERFACE_IMPL:"Method not implemented"},mergeRecursive=function mergeRecursive(source,sink){for(var prop in sink)isSimpleObject(source[prop])&&isSimpleObject(sink[prop])?mergeRecursive(source[prop],sink[prop]):sink[prop]instanceof Object&&sink[prop].constructor===Object?(source[prop]={},mergeRecursive(source[prop],sink[prop])):source[prop]=sink[prop];return source},common_utils_createSelection=function createSelection(sel,appendObj,data,idFn){var selection=sel||dataSelect(idFn),mergedSelection=(selection=selection.data(data)).enter().append(appendObj).merge(selection),exitSelection=selection.exit();return exitSelection.getObjects().forEach(function(inst){return inst.remove()}),exitSelection.remove(),mergedSelection},interpolateArray=function interpolateArray(data,fitCount){var linearInterpolate=function linearInterpolate(before,after,atPoint){return before+(after-before)*atPoint},newData=[],springFactor=(data.length-1)/(fitCount-1);newData[0]=data[0];for(var i=1;i1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}var hslToRgb=function hslToRgb(h,s,l){var r,g,b,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(0===s)r=g=b=l;else{var q=l<.5?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return[255*r,255*g,255*b,a]},rgbToHsv=function rgbToHsv(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r=+r,g=+g,b=+b,a=+a,r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;if(max===min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(g3&&void 0!==arguments[3]?arguments[3]:1,i=Math.floor(6*h),f=6*h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s);switch(i%6){case 0:r=v,g=t,b=p;break;case 1:r=q,g=v,b=p;break;case 2:r=p,g=v,b=t;break;case 3:r=p,g=q,b=v;break;case 4:r=t,g=p,b=v;break;case 5:r=v,g=p,b=q}return[255*r,255*g,255*b,a]},hexToHsv=function hexToHsv(hex){hex=hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(m,r,g,b){return r+r+g+g+b+b});var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?rgbToHsv(parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)):""},hslaToRgb=function hslaToRgb(h,s,l,a){var _hslToRgb2=_slicedToArray(hslToRgb(h,s,l,a),4);return function RGBAtoRGB(r,g,b,a){var r2=arguments.length>4&&void 0!==arguments[4]?arguments[4]:255,g2=arguments.length>5&&void 0!==arguments[5]?arguments[5]:255,b2=arguments.length>6&&void 0!==arguments[6]?arguments[6]:255,r3=Math.round((1-a)*r2+a*r),g3=Math.round((1-a)*g2+a*g),b3=Math.round((1-a)*b2+a*b);return"rgb(".concat(r3,",").concat(g3,",").concat(b3,")")}(_hslToRgb2[0],_hslToRgb2[1],_hslToRgb2[2],_hslToRgb2[3])},detectColor=function detectColor(col){return/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/.test(col)||/rgba?\(((25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,\s*?){2}(25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,?\s*([01]\.?\d*?)?\)/.test(col)?"rgb":/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(col)||/^hsla\(([\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/.test(col)?"hsl":/^#([0-9a-f]{3}){1,2}$/i.test(col)?"hex":col};var assembleModelFromIdentifiers=function assembleModelFromIdentifiers(model,identifiers){var data,schema=[],fieldMap=model.getFieldsConfig();return identifiers.length?function(){for(var fields=identifiers[0],len=fields.length,i=0;i=range[0]&&fieldValue<=range[1]})},{saveChild:!1,mode:mode})},getArrayIndexMap=function getArrayIndexMap(arr){return arr.reduce(function(acc,value,i){return acc[value]=i,acc},{})},common_utils_getDataModelFromIdentifiers=function getDataModelFromIdentifiers(dataModel,identifiers,mode,hasBarLayer){var filteredDataModel;if(identifiers instanceof Array){var fieldsConfig=dataModel.getFieldsConfig(),dataArr=identifiers.slice(1,identifiers.length);if(identifiers instanceof Function)filteredDataModel=identifiers(dataModel,{},!1);else if(identifiers instanceof Array&&identifiers[0].length){var filteredSchema=identifiers[0].filter(function(d){return d in fieldsConfig||d===reserved_fields.ROW_ID});filteredDataModel=dataModel.select(function(fields,rowId){var include=!0;return filteredSchema.forEach(function(propField,idx){var value=propField===reserved_fields.ROW_ID?rowId:fields[propField].internalValue,index=dataArr.findIndex(function(d){return d[idx]===value});include=include&&-1!==index}),include},{saveChild:!1,mode:mode})}else filteredDataModel=dataModel.select(function(){return!1},{saveChild:!1,mode:mode})}else filteredDataModel=getDataModelFromRange(dataModel,identifiers,mode,hasBarLayer);return filteredDataModel},common_utils_registerListeners=function registerListeners(context,listenerMap){for(var _len2=arguments.length,params=new Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++)params[_key2-2]=arguments[_key2];var propListenerMap=listenerMap.apply(void 0,[context].concat(params));for(var key in propListenerMap)if({}.hasOwnProperty.call(propListenerMap,key)){var namespace=params[1].namespace,ns=null;namespace&&(ns=namespace);var mapObj=propListenerMap[key],propType=mapObj.type,props=mapObj.props,listenerFn=mapObj.listener;context.store()[propType](props,listenerFn,!1,{namespace:ns})}},isValidValue=function isValidValue(value){return!isNaN(value)&&value!==-1/0&&value!==1/0},escapeHTML=function escapeHTML(str){var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"".concat(str).replace(/[&<>"'/]/g,function(match){return htmlEscapes[match]})},transposeArray=function transposeArray(arr){return arr[0].map(function(col,i){return arr.map(function(row){return row[i]})})},toArray=function toArray(arr){return arr instanceof Array?arr:[arr]},extendsClass=function extendsClass(cls,extendsFrom,found){if(!cls)return!1;var prototype=cls.prototype;return found=prototype instanceof extendsFrom||extendsClass(prototype,extendsFrom,found)},common_utils_concatModels=function concatModels(dm1,dm2){for(var dataObj1=dm1.getData(),dataObj2=dm2.getData(),data1=dataObj1.data,data2=dataObj2.data,schema1=dataObj1.schema,schema2=dataObj2.schema,commonTuples={},i=0;i0)for(var i,d,dy,yp,yn,n,j=0,m=series[order[0]].length;j0?(d[0]=yp,d[1]=yp+=dy):dy<0?(d[1]=yn,d[0]=yn+=dy):(d[0]=0,d[1]=dy)}),_defineProperty(_stackOffsets,"none",offset_none),_defineProperty(_stackOffsets,"expand",function(series,order){if((n=series.length)>0){for(var i,n,y,j=0,m=series[0].length;j0&&(m=(s0=series[order[0]]).length)>0){for(var s0,m,n,y=0,j=1;j=j;--k)output.point(x0z[k],y0z[k]);output.lineEnd(),output.areaEnd()}defined0&&(x0z[i]=+x0(d,i,data),y0z[i]=+y0(d,i,data),output.point(x1?+x1(d,i,data):x0z[i],y1?+y1(d,i,data):y0z[i]))}if(buffer)return output=null,buffer+""||null}function arealine(){return src_line().defined(defined).curve(curve).context(context)}return area.x=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),x1=null,area):x0},area.x0=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),area):x0},area.x1=function(_){return arguments.length?(x1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):x1},area.y=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),y1=null,area):y0},area.y0=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),area):y0},area.y1=function(_){return arguments.length?(y1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):y1},area.lineX0=area.lineY0=function(){return arealine().x(x0).y(y0)},area.lineY1=function(){return arealine().x(x0).y(y1)},area.lineX1=function(){return arealine().x(x1).y(y0)},area.defined=function(_){return arguments.length?(defined="function"==typeof _?_:d3_shape_src_constant(!!_),area):defined},area.curve=function(_){return arguments.length?(curve=_,null!=context&&(output=curve(context)),area):curve},area.context=function(_){return arguments.length?(null==_?context=output=null:output=curve(context=_),area):context},area},pie:function(){var value=d3_shape_src_identity,sortValues=src_descending,sort=null,startAngle=d3_shape_src_constant(0),endAngle=d3_shape_src_constant(tau),padAngle=d3_shape_src_constant(0);function pie(data){var i,j,k,a1,v,n=data.length,sum=0,index=new Array(n),arcs=new Array(n),a0=+startAngle.apply(this,arguments),da=Math.min(tau,Math.max(-tau,endAngle.apply(this,arguments)-a0)),p=Math.min(Math.abs(da)/n,padAngle.apply(this,arguments)),pa=p*(da<0?-1:1);for(i=0;i0&&(sum+=v);for(null!=sortValues?index.sort(function(i,j){return sortValues(arcs[i],arcs[j])}):null!=sort&&index.sort(function(i,j){return sort(data[i],data[j])}),i=0,k=sum?(da-n*pa)/sum:0;i0?v*k:0)+pa,arcs[j]={data:data[j],index:i,value:v,startAngle:a0,endAngle:a1,padAngle:p};return arcs}return pie.value=function(_){return arguments.length?(value="function"==typeof _?_:d3_shape_src_constant(+_),pie):value},pie.sortValues=function(_){return arguments.length?(sortValues=_,sort=null,pie):sortValues},pie.sort=function(_){return arguments.length?(sort=_,sortValues=null,pie):sort},pie.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):startAngle},pie.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):endAngle},pie.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):padAngle},pie},arc:function(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=d3_shape_src_constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null;function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=src_path()),r1math_epsilon)if(da>tau-math_epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>math_epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>math_epsilon&&(padRadius?+padRadius.apply(this,arguments):math_sqrt(r0*r0+r1*r1)),rc=math_min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>math_epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>math_epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>math_epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>math_epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da1?0:x<-1?pi:Math.acos(x)}((ax*bx+ay*by)/(math_sqrt(ax*ax+ay*ay)*math_sqrt(bx*bx+by*by)))/2),lc=math_sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=math_min(rc,(r0-lc)/(kc-1)),rc1=math_min(rc,(r1-lc)/(kc+1))}}da1>math_epsilon?rc1>math_epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1math_epsilon&&da0>math_epsilon?rc0>math_epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc01?_len3-1:0),_key3=1;_key3<_len3;_key3++)measureFieldNames[_key3-1]=arguments[_key3];var filteredReducers={};if(dataModel instanceof datamodel_default.a){var derivations=[].concat(common_utils_toConsumableArray(dataModel.getDerivations().reverse()),common_utils_toConsumableArray(dataModel.getAncestorDerivations().reverse())),nearestReducers=defaultValue(getObjProp(derivations.find(function(derv){return derv.op===dist_datamodel.DM_DERIVATIVES.GROUPBY}),"criteria"),{}),measures=dataModel.getFieldspace().getMeasure();(measureFieldNames=measureFieldNames.length?measureFieldNames:Object.keys(measures)).forEach(function(measureName){if(nearestReducers[measureName])filteredReducers[measureName]=nearestReducers[measureName];else{var measureField=measures[measureName];measureField&&(filteredReducers[measureName]=measureField.defAggFn())}})}return filteredReducers},retrieveFieldDisplayName=function retrieveFieldDisplayName(dm,fieldName){return dm.getFieldspace().fieldsObj()[fieldName].displayName()},common_utils_nearestSortingDetails=function nearestSortingDetails(dataModel){var nearestSortDerivation=[].concat(common_utils_toConsumableArray(dataModel.getAncestorDerivations()),common_utils_toConsumableArray(dataModel.getDerivations())).reverse().find(function(derivation){return derivation.op===dist_datamodel.DM_DERIVATIVES.SORT});return nearestSortDerivation?nearestSortDerivation.criteria:null},common_utils_sortingOrder=function sortingOrder(a,b){return a instanceof InvalidAwareTypes||a instanceof InvalidAwareTypes?1:a.localeCompare(b)},sortOrderMap=(_defineProperty(_sortOrderMap={},"asc",function(firstVal,secondVal){return common_utils_sortingOrder(firstVal,secondVal)}),_defineProperty(_sortOrderMap,"desc",function(firstVal,secondVal){return common_utils_sortingOrder(secondVal,firstVal)}),_sortOrderMap),sortCategoricalField=function sortCategoricalField(sortOrder,firstVal,secondVal){var sortOrderType=common_utils_typeof(sortOrder);return sortOrderType===FUNCTION?sortOrder(firstVal,secondVal):sortOrderType===STRING&&sortOrderMap[sortOrder]?sortOrderMap[sortOrder](firstVal,secondVal):null},common_utils_intersect=function intersect(arr1,arr2){var _accessors=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors[0],fn2=_accessors[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return set.has(fn1(value))})},difference=function difference(arr1,arr2){var _accessors2=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors2[0],fn2=_accessors2[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return!set.has(fn1(value))})},partition=function partition(array,filterFn){return array.reduce(function(acc,v,i){return filterFn(v,i,array)?acc[0].push(v):acc[1].push(v),acc},[[],[]])},mix=function mix(superclass){return{with:function _with(){for(var _len4=arguments.length,mixins=new Array(_len4),_key4=0;_key4<_len4;_key4++)mixins[_key4]=arguments[_key4];return mixins.reduce(function(cls,mixin){return mixin(cls)},superclass)}}},common_utils_componentRegistry=function componentRegistry(comps){var reg=Object.assign({},comps),regObj={register:function register(def,customKey){var key=customKey||def.formalName();return reg[key]=def,regObj},get:function get(){return reg}};return regObj},common_utils_getReadableTicks=function getReadableTicks(domain,steps){var orderedDomain=[Math.min.apply(Math,common_utils_toConsumableArray(domain)),Math.max.apply(Math,common_utils_toConsumableArray(domain))];if(steps<3)return orderedDomain;var tempScale=quantize().domain(orderedDomain).nice(),legendTicks=null;return legendTicks=Symbols.axisBottom().scale(tempScale).scale().ticks(steps),Math.max.apply(Math,common_utils_toConsumableArray(legendTicks))orderedDomain[0]&&legendTicks.unshift(orderedDomain[0]),legendTicks},common_utils_transformColor=function transformColor(rgbaValues,_ref7,datum,apply){var _ref7$h=_ref7.h,h=void 0===_ref7$h?0:_ref7$h,_ref7$s=_ref7.s,s=void 0===_ref7$s?0:_ref7$s,_ref7$l=_ref7.l,l=void 0===_ref7$l?0:_ref7$l,a=_ref7.a,_RGBAToHSLA$code=_slicedToArray(function RGBAToHSLA(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r/=255,g/=255,b/=255;var cmin=Math.min(r,g,b),cmax=Math.max(r,g,b),delta=cmax-cmin,h=0,s=0,l=0;return h=0===delta?0:cmax===r?(g-b)/delta%6:cmax===g?(b-r)/delta+2:(r-g)/delta+4,(h=Math.round(60*h))<0&&(h+=360),l=(cmax+cmin)/2,s=+(100*(s=0===delta?0:delta/(1-Math.abs(2*l-1)))).toFixed(1),l=+(100*l).toFixed(1),{color:"hsla(".concat(h,",").concat(s,"%,").concat(l,"%,").concat(a,")"),code:[h,s,l,a]}}.apply(void 0,common_utils_toConsumableArray(rgbaValues)).code,4),origH=_RGBAToHSLA$code[0],origS=_RGBAToHSLA$code[1],origL=_RGBAToHSLA$code[2],origA=_RGBAToHSLA$code[3],sanitizedA=parseFloat(a||origA,10),newH=origH+h,newS=origS+s,newL=origL+l,newA=sanitizedA+1;return apply||(newA=sanitizedA-1),{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH,newS,newL,newA]}},pointWithinCircle=function pointWithinCircle(c,point){var cx=c.x,cy=c.y,r=c.r,x=point.x,y=point.y;return Math.sqrt(Math.pow(cx-x,2)+Math.pow(cy-y,2))<=r},common_utils_dmMultipleSelection=function dmMultipleSelection(targetData,dm){var targetFields=targetData[0],payloadMap=targetData.slice(1,targetData.length).reduce(function(acc,v){return acc[v]=v,acc},{}),measures=Object.keys(dm.getFieldspace().getMeasure());return function filterFn(fields,i){return"".concat(targetFields.map(function(field){var val;if(field===reserved_fields.MEASURE_NAMES)val=measures;else if(field===reserved_fields.ROW_ID)val=i;else{var currentField=fields[field];val=currentField instanceof InvalidAwareTypes?currentField.value():(currentField||{}).internalValue}return val}))in payloadMap}};function selector_none(){}var src_selector=function(selector){return null==selector?selector_none:function(){return this.querySelector(selector)}};function selectorAll_empty(){return[]}var selectorAll=function(selector){return null==selector?selectorAll_empty:function(){return this.querySelectorAll(selector)}},matcher=function(selector){return function(){return this.matches(selector)}},sparse=function(update){return new Array(update.length)};function EnterNode(parent,datum){this.ownerDocument=parent.ownerDocument,this.namespaceURI=parent.namespaceURI,this._next=null,this._parent=parent,this.__data__=datum}EnterNode.prototype={constructor:EnterNode,appendChild:function appendChild(child){return this._parent.insertBefore(child,this._next)},insertBefore:function insertBefore(child,next){return this._parent.insertBefore(child,next)},querySelector:function querySelector(selector){return this._parent.querySelector(selector)},querySelectorAll:function querySelectorAll(selector){return this._parent.querySelectorAll(selector)}};var keyPrefix="$";function bindIndex(parent,group,enter,update,exit,data){for(var node,i=0,groupLength=group.length,dataLength=data.length;ib?1:a>=b?0:NaN}var xhtml="http://www.w3.org/1999/xhtml",src_namespaces={svg:"http://www.w3.org/2000/svg",xhtml:xhtml,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},src_namespace=function(name){var prefix=name+="",i=prefix.indexOf(":");return i>=0&&"xmlns"!==(prefix=name.slice(0,i))&&(name=name.slice(i+1)),src_namespaces.hasOwnProperty(prefix)?{space:src_namespaces[prefix],local:name}:name};var src_window=function(node){return node.ownerDocument&&node.ownerDocument.defaultView||node.document&&node||node.defaultView};function styleValue(node,name){return node.style.getPropertyValue(name)||src_window(node).getComputedStyle(node,null).getPropertyValue(name)}function classArray(string){return string.trim().split(/^|\s+/)}function classList(node){return node.classList||new ClassList(node)}function ClassList(node){this._node=node,this._names=classArray(node.getAttribute("class")||"")}function classedAdd(node,names){for(var list=classList(node),i=-1,n=names.length;++i=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function contains(name){return this._names.indexOf(name)>=0}};function textRemove(){this.textContent=""}function htmlRemove(){this.innerHTML=""}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}var creator=function(name){var fullname=src_namespace(name);return(fullname.local?function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local)}}:function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name)}})(fullname)};function constantNull(){return null}function remove_remove(){var parent=this.parentNode;parent&&parent.removeChild(this)}function selection_cloneShallow(){var clone=this.cloneNode(!1),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}function selection_cloneDeep(){var clone=this.cloneNode(!0),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}var filterEvents={},on_event=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(filterEvents={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(listener,index,group){return listener=contextListener(listener,index,group),function(event){var related=event.relatedTarget;related&&(related===this||8&related.compareDocumentPosition(this))||listener.call(this,event)}}function contextListener(listener,index,group){return function(event1){var event0=on_event;on_event=event1;try{listener.call(this,this.__data__,index,group)}finally{on_event=event0}}}function onRemove(typename){return function(){var on=this.__on;if(on){for(var o,j=0,i=-1,m=on.length;j=i1&&(i1=i0+1);!(next=updateGroup[i1])&&++i1=0;)(node=group[i])&&(next&&4^node.compareDocumentPosition(next)&&next.parentNode.insertBefore(node,next),next=node);return this},sort:function(compare){function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b}compare||(compare=sort_ascending);for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;j1?this.each((null==value?function styleRemove(name){return function(){this.style.removeProperty(name)}}:"function"==typeof value?function styleFunction(name,value,priority){return function(){var v=value.apply(this,arguments);null==v?this.style.removeProperty(name):this.style.setProperty(name,v,priority)}}:function styleConstant(name,value,priority){return function(){this.style.setProperty(name,value,priority)}})(name,value,null==priority?"":priority)):styleValue(this.node(),name)},property:function(name,value){return arguments.length>1?this.each((null==value?function propertyRemove(name){return function(){delete this[name]}}:"function"==typeof value?function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);null==v?delete this[name]:this[name]=v}}:function propertyConstant(name,value){return function(){this[name]=value}})(name,value)):this.node()[name]},classed:function(name,value){var names=classArray(name+"");if(arguments.length<2){for(var list=classList(this.node()),i=-1,n=names.length;++i=0&&(name=t.slice(i+1),t=t.slice(0,i)),{type:t,name:name}})}(typename+""),n=typenames.length;if(!(arguments.length<2)){for(on=value?onAdd:onRemove,null==capture&&(capture=!1),i=0;i=0&&(name=t.slice(i+1),t=t.slice(0,i)),t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:name}})}(typename+"",_),i=-1,n=T.length;if(!(arguments.length<2)){if(null!=callback&&"function"!=typeof callback)throw new Error("invalid callback: "+callback);for(;++i0)for(var n,t,args=new Array(n),i=0;iclickDistance2}gestures.mouse("drag")}function mouseupped(){src_select(on_event.view).on("mousemove.drag mouseup.drag",null),function yesdrag(view,noclick){var root=view.document.documentElement,selection=src_select(view).on("dragstart.drag",null);noclick&&(selection.on("click.drag",noevent,!0),setTimeout(function(){selection.on("click.drag",null)},0)),"onselectstart"in root?selection.on("selectstart.drag",null):(root.style.MozUserSelect=root.__noselect,delete root.__noselect)}(on_event.view,mousemoving),noevent(),gestures.mouse("end")}function touchstarted(){if(filter.apply(this,arguments)){var i,gesture,touches=on_event.changedTouches,c=container.apply(this,arguments),n=touches.length;for(i=0;i=0&&t._call.call(null,e),t=t._next;--timer_frame}()}finally{timer_frame=0,function nap(){var t0,t2,t1=taskHead,time=1/0;for(;t1;)t1._call?(time>t1._time&&(time=t1._time),t0=t1,t1=t1._next):(t2=t1._next,t1._next=null,t1=t0?t0._next=t2:taskHead=t2);taskTail=t0,sleep(time)}(),clockNow=0}}function poke(){var now=clock.now(),delay=now-clockLast;delay>pokeDelay&&(clockSkew-=delay,clockLast=now)}function sleep(time){timer_frame||(timeout&&(timeout=clearTimeout(timeout)),time-clockNow>24?(time<1/0&&(timeout=setTimeout(wake,time-clock.now()-clockSkew)),timer_interval&&(timer_interval=clearInterval(timer_interval))):(timer_interval||(clockLast=clock.now(),timer_interval=setInterval(poke,pokeDelay)),timer_frame=1,setFrame(wake)))}Timer.prototype=timer_timer.prototype={constructor:Timer,restart:function restart(callback,delay,time){if("function"!=typeof callback)throw new TypeError("callback is not a function");time=(null==time?now():+time)+(null==delay?0:+delay),this._next||taskTail===this||(taskTail?taskTail._next=this:taskHead=this,taskTail=this),this._call=callback,this._time=time,sleep()},stop:function stop(){this._call&&(this._call=null,this._time=1/0,sleep())}};var src_timeout=function(callback,delay,time){var t=new Timer;return delay=null==delay?0:+delay,t.restart(function(elapsed){t.stop(),callback(elapsed+delay)},delay,time),t},emptyOn=src_dispatch("start","end","cancel","interrupt"),emptyTween=[],CREATED=0,SCHEDULED=1,STARTING=2,STARTED=3,RUNNING=4,ENDING=5,ENDED=6,transition_schedule=function(node,name,id,index,group,timing){var schedules=node.__transition;if(schedules){if(id in schedules)return}else node.__transition={};!function schedule_create(node,id,self){var tween,schedules=node.__transition;function start(elapsed){var i,j,n,o;if(self.state!==SCHEDULED)return stop();for(i in schedules)if((o=schedules[i]).name===self.name){if(o.state===STARTED)return src_timeout(start);o.state===RUNNING?(o.state=ENDED,o.timer.stop(),o.on.call("interrupt",node,node.__data__,o.index,o.group),delete schedules[i]):+iCREATED)throw new Error("too late; already scheduled");return schedule}function schedule_set(node,id){var schedule=schedule_get(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule}function schedule_get(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule}var cssNode,cssRoot,cssView,svgNode,degrees=180/Math.PI,decompose_identity={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},decompose=function(a,b,c,d,e,f){var scaleX,scaleY,skewX;return(scaleX=Math.sqrt(a*a+b*b))&&(a/=scaleX,b/=scaleX),(skewX=a*c+b*d)&&(c-=a*skewX,d-=b*skewX),(scaleY=Math.sqrt(c*c+d*d))&&(c/=scaleY,d/=scaleY,skewX/=scaleY),a*d180?b+=360:b-a>180&&(a+=360),q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:src_number(a,b)})):b&&s.push(pop(s)+"rotate("+b+degParen)}(a.rotate,b.rotate,s,q),function skewX(a,b,s,q){a!==b?q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:src_number(a,b)}):b&&s.push(pop(s)+"skewX("+b+degParen)}(a.skewX,b.skewX,s,q),function scale(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:src_number(xa,xb)},{i:i-2,x:src_number(ya,yb)})}else 1===xb&&1===yb||s.push(pop(s)+"scale("+xb+","+yb+")")}(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q),a=b=null,function(t){for(var o,i=-1,n=q.length;++i=0&&(t=t.slice(0,i)),!t||"start"===t})}(name)?init:schedule_set;return function(){var schedule=sit(this,id),on=schedule.on;on!==on0&&(on1=(on0=on).copy()).on(name,listener),schedule.on=on1}}(id,name,listener))},attr:function(name,value){var fullname=src_namespace(name),i="transform"===fullname?interpolateTransformSvg:transition_interpolate;return this.attrTween(name,"function"==typeof value?(fullname.local?function attr_attrFunctionNS(fullname,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttributeNS(fullname.space,fullname.local))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttribute(name))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttribute(name)}})(fullname,i,tweenValue(this,"attr."+name,value)):null==value?(fullname.local?function attr_attrRemoveNS(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrRemove(name){return function(){this.removeAttribute(name)}})(fullname):(fullname.local?function attr_attrConstantNS(fullname,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttributeNS(fullname.space,fullname.local);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}:function attr_attrConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttribute(name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}})(fullname,i,value))},attrTween:function(name,value){var key="attr."+name;if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;var fullname=src_namespace(name);return this.tween(key,(fullname.local?function attrTweenNS(fullname,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolateNS(fullname,i){return function(t){this.setAttributeNS(fullname.space,fullname.local,i.call(this,t))}}(fullname,i)),t0}return tween._value=value,tween}:function attrTween(name,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolate(name,i){return function(t){this.setAttribute(name,i.call(this,t))}}(name,i)),t0}return tween._value=value,tween})(fullname,value))},style:function(name,value,priority){var i="transform"==(name+="")?interpolateTransformCss:transition_interpolate;return null==value?this.styleTween(name,function styleNull(name,interpolate){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),string1=(this.style.removeProperty(name),styleValue(this,name));return string0===string1?null:string0===string00&&string1===string10?interpolate0:interpolate0=interpolate(string00=string0,string10=string1)}}(name,i)).on("end.style."+name,style_styleRemove(name)):"function"==typeof value?this.styleTween(name,function style_styleFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),value1=value(this),string1=value1+"";return null==value1&&(this.style.removeProperty(name),string1=value1=styleValue(this,name)),string0===string1?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1))}}(name,i,tweenValue(this,"style."+name,value))).each(function styleMaybeRemove(id,name){var on0,on1,listener0,remove,key="style."+name,event="end."+key;return function(){var schedule=schedule_set(this,id),on=schedule.on,listener=null==schedule.value[key]?remove||(remove=style_styleRemove(name)):void 0;on===on0&&listener0===listener||(on1=(on0=on).copy()).on(event,listener0=listener),schedule.on=on1}}(this._id,name)):this.styleTween(name,function style_styleConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=styleValue(this,name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}(name,i,value),priority).on("end.style."+name,null)},styleTween:function(name,value,priority){var key="style."+(name+="");if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function styleTween(name,value,priority){var t,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t=(i0=i)&&function styleInterpolate(name,i,priority){return function(t){this.style.setProperty(name,i.call(this,t),priority)}}(name,i,priority)),t}return tween._value=value,tween}(name,value,null==priority?"":priority))},text:function(value){return this.tween("text","function"==typeof value?function text_textFunction(value){return function(){var value1=value(this);this.textContent=null==value1?"":value1}}(tweenValue(this,"text",value)):function text_textConstant(value){return function(){this.textContent=value}}(null==value?"":value+""))},textTween:function(value){var key="text";if(arguments.length<1)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function textTween(value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function textInterpolate(i){return function(t){this.textContent=i.call(this,t)}}(i)),t0}return tween._value=value,tween}(value))},remove:function(){return this.on("end.remove",function removeFunction(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;parent&&parent.removeChild(this)}}(this._id))},tween:function(name,value){var id=this._id;if(name+="",arguments.length<2){for(var t,tween=schedule_get(this.node(),id).tween,i=0,n=tween.length;iSTARTING&&schedule.state4&&void 0!==arguments[4]?arguments[4]:{},keyFn=arguments.length>5?arguments[5]:void 0;(parent instanceof HTMLElement||parent instanceof SVGElement)&&(parent=renderer_utils_selectElement(parent));var filter,selectorVal=selector?selector[0]:null,selectorType=null,actualSelector=null,element=null,enterSel=null,mergeSel=null;selectorVal?"#"===selectorVal?(selectorType="id",actualSelector=selector):(selectorType="class",actualSelector="."===selector[0]?selector:".".concat(selector)):(actualSelector=elemType,filter=!0),element=parent.selectAll(actualSelector),filter&&(element=element.filter(function(){return this.parentNode===parent.node()})),enterSel=(element=element.data(data,keyFn)).enter().append(elemType||"div"),callbacks.enter&&enterSel.each(function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];callbacks.enter.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),mergeSel=enterSel.merge(element),callbacks.update&&mergeSel.each(function(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];callbacks.update.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),"class"===selectorType?mergeSel.classed("."===selectorVal?selector.substring(1,selector.length):selector,!0):"id"===selectorType&&mergeSel.attr("id",selector.substring(1,selector.length));var exitSel=element.exit();return callbacks.exit?exitSel.each(function(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];callbacks.exit.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}):exitSel.remove(),mergeSel},renderer_utils_applyStyle=function applyStyle(elem,styleObj){return Object.entries(styleObj).forEach(function(d){elem.style(d[0],d[1])},void 0),elem},appendElement=function appendElement(element1,element2){element1.appendChild(element2)},setElementAttrs=function setElementAttrs(element,attrs){for(var key in attrs)({}).hasOwnProperty.call(attrs,key)&&element.attr(key,attrs[key])},renderer_utils_setAttrs=function setAttrs(element,attrs,className){return element instanceof src_selection||(element=renderer_utils_selectElement(element)),void 0!==className?element.selectAll(".".concat(className)).each(function(){setElementAttrs(src_select(this),attrs)}):setElementAttrs(element,attrs),element},renderer_utils_addClass=function addClass(element,className,selector,filterFn){src_select(element).selectAll(selector).each(function(data){var elem=src_select(this);filterFn?filterFn(data)&&elem.classed(className,!0):elem.classed(className,!0)})},renderer_utils_removeClass=function removeClass(element,className,selector,filterFn){src_select(element).selectAll(selector).each(function(data){var elem=src_select(this);filterFn?filterFn(data)&&elem.classed(className,!1):elem.classed(className,!1)})},renderer_utils_setStyles=function setStyles(element,styles){for(var key in element instanceof src_selection||(element=renderer_utils_selectElement(element)),styles)({}).hasOwnProperty.call(styles,key)&&element.style(key,styles[key]);return element},renderer_utils_createElements=function createElements(params){var data,container=src_select(params.container);"number"==typeof(data=params.data)&&(data=Array(data).fill().map(function(d,i){return i}));var sel=container.selectAll(params.selector).filter(function(){return this.parentNode===container.node()}).data(data);sel.enter().append(params.append).merge(sel).each(function(d,i){params.each(d,src_select(this),i)}).attr("class",params.className||""),sel.exit().remove()},renderer_utils_clipElement=function clipElement(container,measurement,id){var clipPathElement=makeElement(src_select(container),"clipPath",[1],"#".concat(id));makeElement(clipPathElement,"rect",[1]).attr("x",measurement.x).attr("y",measurement.x).attr("width",measurement.width).attr("height",measurement.height),clipPathElement.attr("clip-path","url(#".concat(id,")"))},renderer_utils_getElementsByClassName=function getElementsByClassName(node,className){return src_select(node).selectAll(className).nodes()},getMousePos=function getMousePos(element,event){var boundingClientRect=element.getBoundingClientRect();return{x:event.x-boundingClientRect.x,y:event.y-boundingClientRect.y}},renderer_utils_getClientPoint=function getClientPoint(){var pos=src_point.apply(void 0,arguments);return{x:pos[0],y:pos[1]}},renderer_utils_createElement=function createElement(tag,mount){return src_select(mount).append(tag).node()},renderer_utils_getEvent=function getEvent(){return on_event},renderer_utils_getD3Drag=function getD3Drag(){return src_drag},renderer_utils_getSmartComputedStyle=function getSmartComputedStyle(group,css){var textEl,mandatoryStyle={"fill-opacity":0},className="string"==typeof css?css:css instanceof Array?css.join(" "):void 0;textEl=group.node()instanceof HTMLElement?group.append("div").html("W"):group.append("text").text("W"),className?textEl.attr("class",className):"object"===renderer_utils_typeof(css)&&(delete css["fill-opacity"],mergeRecursive(mandatoryStyle,css)),textEl.style(mandatoryStyle);var computedStyle=window.getComputedStyle(textEl.node()),styleForSmartLabel={fontSize:computedStyle.fontSize,fontFamily:computedStyle.fontFamily,fontWeight:computedStyle.fontWeight,fontStyle:computedStyle.fontStyle};return textEl.remove(),styleForSmartLabel},hasTouch=function hasTouch(){return"ontouchstart"in document.documentElement},hyperdis=__webpack_require__(11),hyperdis_default=__webpack_require__.n(hyperdis);function store_slicedToArray(arr,i){return function store_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function store_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function store_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function store_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:function(){return{}};return props.forEach(function(prop){obj[prop]||(obj[prop]=val()),obj=obj[prop]}),obj},fetchPropValues=function fetchPropValues(propNames,params,deps){return params.map(function(param,i){var prop=propNames[i];return param.map(function(val){return void 0===val||null===val?val:val[deps[prop]]})})},setContexts=function setContexts(contexts,propObj,contextMap){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=propObj.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;contexts[key]={context:contextMap[key],deps:propObj.get(key).depProps}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return contexts},store_registerListener=function registerListener(context,type){for(var _len=arguments.length,options=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)options[_key-2]=arguments[_key];var propList=options[0],callBack=options[1],instantCall=options[2],_options$=options[3],namespaceInf=void 0===_options$?{}:_options$,props=propList;Array.isArray(propList)||(props=[propList]);var ns=namespaceInf.namespace,callbackFn=function(propNames,namespaceVal){return function(){var commits=context._savedCommits,propListenerMap=context._propListenerMap;if(!propNames.some(function(prop){return getObjProp(propListenerMap,prop,"disabled")})){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(namespaceVal){var listenersObj=context._registeredListeners[namespaceVal],contextMap=context._contextMap[namespaceVal],contextsObj={};for(var key in propNames.forEach(function(prop){var commitsObj=defaultValue(getObjProp(commits,prop,type),{}),listeners=listenersObj[prop].subNamespaces,propDeps=propListenerMap[prop][type];for(var nm in commitsObj){var fnInf=defaultValue(propDeps[nm],{fns:0}),fns=fnInf.fns;fns>0&&(setContexts(contextsObj,listeners[nm],contextMap),fns--),fns<=0&&delete commitsObj[nm],fnInf.fns=fns}}),contextsObj){var obj=contextsObj[key];callBack.apply(void 0,[obj.context].concat(store_toConsumableArray(fetchPropValues(propNames,params,obj.deps))))}}else callBack.apply(void 0,params)}}}(props,ns),fn=context.model[type](props,callbackFn,instantCall);ns&&function registerPropInMaps(store,props,namespaceInf,type){var registeredListeners=store._registeredListeners,propListenerMap=store._propListenerMap,subNamespace=namespaceInf.subNamespace,ns=namespaceInf.namespace;initProp(registeredListeners,[ns]),props.forEach(function(prop){var subNamespaces=defaultValue(getObjProp(registeredListeners,ns,prop,"subNamespace"),[]),fns=defaultValue(getObjProp(propListenerMap,prop,type,"fns"),0);fns++,subNamespace&&subNamespaces.push(subNamespace),registeredListeners[ns][prop]={subNamespace:subNamespaces,allProps:props,subNamespaces:{}},initProp(propListenerMap,[prop,type]),propListenerMap[prop][type]={fns:fns,_fnCount:fns}})}(context,props,namespaceInf,type),function addListenerToNamespace(namespaceInf,fn,context){var key=namespaceInf.key,namespace=namespaceInf.id,listeners=context._listeners;if(namespace){!listeners.get(namespace)&&listeners.set(namespace,new Map);var namespaceListeners=listeners.get(namespace);key||(key=namespaceListeners.size),namespaceListeners.set(key,fn)}else key=key||listeners.size,listeners.set(key,fn)}(namespaceInf,fn,context)},store_createMap=function createMap(){return new Map},listenerTypes=["next","on"],removePropValue=function removePropValue(context,map,propInf){var sns=propInf.subNamespace,prop=propInf.prop,propObj=propInf.propListenerMap[prop];if(listenerTypes.forEach(function(type){type in propObj&&delete propObj[type][sns]}),map.has(sns)){var value=context.get(prop);value instanceof Object&&sns in value&&delete value[sns],map.delete(sns)}},store_Store=function(){function Store(config){!function store_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Store),this.model=hyperdis_default.a.create(config),this._listeners=new Map,this._registeredListeners={},this._contextMap={},this._commits={},this._savedCommits={},this._queuedProps={},this._propListenerMap={},this._locked=!1}return function store_createClass(Constructor,protoProps,staticProps){return protoProps&&store_defineProperties(Constructor.prototype,protoProps),staticProps&&store_defineProperties(Constructor,staticProps),Constructor}(Store,[{key:"lockModel",value:function lockModel(){return this.model.lock(),this._locked=!0,this}},{key:"unlockModel",value:function unlockModel(){return this._locked=!1,this.model.unlock(),this}},{key:"serialize",value:function serialize(){return this.model.serialize()}},{key:"lockCommits",value:function lockCommits(props){var _this=this;return props.forEach(function(prop){_this._commits[prop]={locked:!0,queue:[]}}),this}},{key:"unlockCommits",value:function unlockCommits(props){var _this2=this,commitsObj=this._commits;return this.lockModel(),props.forEach(function(prop){commitsObj[prop].locked=!1;var queuedProps={},queue=commitsObj[prop].queue;queue.forEach(function(params){var _params=store_slicedToArray(params,3),propName=_params[0],value=_params[1],namespace=_params[2];if(namespace){var propObj=initProp(queuedProps,[propName,namespace]);Object.assign(propObj,value)}}),queue.forEach(function(params){var _params2=store_slicedToArray(params,3),propName=_params2[0],value=_params2[1],namespace=_params2[2];_this2.commit(propName,propName in queuedProps?queuedProps[propName][namespace]:value,namespace)}),delete commitsObj[prop]}),this.unlockModel(),this}},{key:"addSubNamespace",value:function addSubNamespace(sns,namespace,context){var listeners=this._registeredListeners[namespace],propListenerMap=this._propListenerMap;initProp(this._contextMap,[namespace]),this._contextMap[namespace][sns]=context;var _loop=function _loop(key){var obj=listeners[key],propObj=propListenerMap[key],propFns=listenerTypes.reduce(function(acc,type){var val=defaultValue(getObjProp(propObj,type,"fns"),0);return val&&(acc[type]=val),acc},{}),allProps=obj.allProps,subNamespaces=obj.subNamespaces,subNamespace=obj.subNamespace;(subNamespace.length?subNamespace:[sns]).forEach(function(ns){var nsObj=ns instanceof Function?ns(context):ns,names=function retrieveNamespaces(names,key){return names instanceof Object?[names[key]]:names instanceof Array?names:[names]}(nsObj,key),depProps=allProps.reduce(function(acc,prop){return acc[prop]=ns instanceof Function?nsObj[prop]:ns,acc},{});names.forEach(function(nm){for(var type in initProp(subNamespaces,[nm],store_createMap).set(sns,{depProps:depProps}),propFns){initProp(propObj,[type,nm]);var fns=propFns[type];propObj[type][nm]={fns:fns,_fnCount:fns}}})})};for(var key in listeners)_loop(key);return this}},{key:"commit",value:function commit(propName,value,namespace){var disableListener=arguments.length>3&&void 0!==arguments[3]&&arguments[3],sanitizedVal=value,commits=this._commits,savedCommits=this._savedCommits,locked=getObjProp(commits,propName,"locked"),propListenerMap=this._propListenerMap[propName]||{};if(propListenerMap.disabled=disableListener,locked)return commits[propName].queue.push([propName,value,namespace]),this;if(namespace){if(this._locked){var queuedProps=initProp(this._queuedProps,[propName]);queuedProps[namespace]=value,sanitizedVal=queuedProps}else(sanitizedVal=defaultValue(this.get(propName),{}))[namespace]=value;listenerTypes.forEach(function(type){initProp(savedCommits,[propName,type]),savedCommits[propName][type][namespace]=!0,getObjProp(propListenerMap,type,namespace)&&(propListenerMap[type][namespace].fns=propListenerMap[type][namespace]._fnCount)})}return this.model.prop(propName,sanitizedVal),this}},{key:"registerChangeListener",value:function registerChangeListener(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];return store_registerListener.apply(void 0,[this,"next"].concat(params)),this}},{key:"registerImmediateListener",value:function registerImmediateListener(){for(var _len4=arguments.length,params=new Array(_len4),_key4=0;_key4<_len4;_key4++)params[_key4]=arguments[_key4];store_registerListener.apply(void 0,[this,"on"].concat(params))}},{key:"get",value:function get(propName,subNamespace){var value=this.model.prop(propName);return subNamespace?value&&value[subNamespace]:value}},{key:"computed",value:function computed(propName,callBack){return this.model.calculatedProp(propName,callBack)}},{key:"append",value:function append(){var _this$model;return(_this$model=this.model).append.apply(_this$model,arguments),this}},{key:"unsubscribeAll",value:function unsubscribeAll(){return Object.values(this._listeners).forEach(function(fn){return fn()}),this}},{key:"unsubscribe",value:function unsubscribe(){var namespaceInf=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},id=namespaceInf.id,key=namespaceInf.key,listenersMap=this._listeners,listeners=listenersMap.get(id);if(key){var fn=listenersMap.get(key);fn&&fn()}else{var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=listeners.values()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){(0,_step2.value)()}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}listenersMap.set(id,[])}return this}},{key:"removeSubNamespace",value:function removeSubNamespace(subNamespace,namespace){var listenerMap=this._registeredListeners,contextMap=this._contextMap,propListenerMap=this._propListenerMap,listenersObj=listenerMap[namespace];for(var prop in listenersObj){var subNamespaces=listenersObj[prop].subNamespaces,propInf={subNamespace:subNamespace,prop:prop,propListenerMap:propListenerMap};if(subNamespaces[subNamespace])removePropValue(this,subNamespaces[subNamespace],propInf),delete subNamespaces[subNamespace];else for(var ns in subNamespaces){var snsMap=subNamespaces[ns];removePropValue(this,snsMap,propInf),snsMap.size||delete subNamespaces[ns]}}return delete contextMap[namespace][subNamespace],this}}]),Store}(),store_transactor=function transactor(holder,options,model){var conf,namespaceInf=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},store=model instanceof store_Store?model:new store_Store({}),stateProps={},namespace=namespaceInf.namespace,subNamespace=namespaceInf.subNamespace;for(var prop in options)if({}.hasOwnProperty.call(options,prop)){conf=options[prop];var nameSpaceProp=namespace?"".concat(namespace,".").concat(prop):prop;if(subNamespace){var value=defaultValue(store.get(nameSpaceProp),{});value[subNamespace]=conf.value,stateProps[nameSpaceProp]=value}else stateProps[prop]=conf.value;holder[prop]=function(context,meta,nsProp){return function(){for(var _len5=arguments.length,params=new Array(_len5),_key5=0;_key5<_len5;_key5++)params[_key5]=arguments[_key5];if(params.length){var _ref$takesMultiplePar=(meta||{}).takesMultipleParams,takesMultipleParams=void 0!==_ref$takesMultiplePar&&_ref$takesMultiplePar,val=takesMultipleParams?params:params[0];if(meta){var values,prevVal=context.get(nsProp,subNamespace),sanitization=meta.sanitization,typeCheck=meta.typeCheck,typeExpected=meta.typeExpected;if("function"==typeof sanitization&&(val=sanitization(val,prevVal,holder)),"function"==typeof typeCheck)typeCheck(val)&&(values=val);else"string"==typeof typeCheck&&"constructor"===typeCheck?val&&val.constructor.name===typeExpected&&(values=val):values=val;var preset=meta.preset,oldValues=toArray(context.get(nsProp,subNamespace));preset&&preset(values,holder),takesMultipleParams&&oldValues.forEach(function(value,i){void 0===values[i]&&(values[i]=value)}),values&&context.commit(nsProp,values,subNamespace)}else context.commit(nsProp,val,subNamespace);return holder}return context.get(nsProp,subNamespace)}}(store,conf.meta,nameSpaceProp,Array.isArray(conf.value))}if(subNamespace)for(var key in stateProps)store.commit(key,stateProps[key][subNamespace],subNamespace);else void 0===namespace?store.append(stateProps):store.append(namespace,stateProps);return[holder,store]},SmartlabelManager=__webpack_require__(8),SmartlabelManager_default=__webpack_require__.n(SmartlabelManager),events=["initialized","beforeupdate","updated","beforedraw","drawn","beforeremove","removed","animationend"],EVENT_LIST=[];["canvas","unit","layer","axis","facet-headers","legend","caption"].forEach(function(composition){events.forEach(function(event){EVENT_LIST.push("".concat(composition,".").concat(event))})});var event_list=EVENT_LIST;function lifecycle_manager_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this._lifeCycles=lifeCycles,this._releasePromisesFromCache()}},{key:"_resetTargetPromise",value:function _resetTargetPromise(eventName){var _this4=this;setTimeout(function(){_this4._notifiers[eventName]=lifecycle_manager_resolver,_this4._promises.set(eventName,_this4._makeNotifierPromise(eventName))},0)}}]),LifeCycleManager}(),src_InvalidAwareTypes=datamodel_default.a.InvalidAwareTypes,CLASSPREFIX="muze",STACK="stack",GROUP="group",IDENTITY="identity",constants_ANGLE="angle",constants_RADIUS="radius",SIZE="size",COLOR="color",SHAPE="shape",TEXT="text",OUTER_RADIUS_VALUE="outerRadiusValue",TEXT_ANCHOR_MIDDLE="middle",ENCODING={X:"x",Y:"y",X0:"x0",Y0:"y0",RADIUS:"radius",RADIUS0:"radius0",ANGLE:"angle",ANGLE0:"angle0",COLOR:"color",SHAPE:"shape",SIZE:"size",TEXT:"text"},STROKE_DASHARRAY="stroke-dasharray",ASCENDING="asc",AGG_FN_SUM="sum",AREA_LAYER="area",ARC_LAYER="arc",LINE_LAYER="line",TEXT_LAYER="text",POINT_LAYER="point",BAR_LAYER="bar",TICK_LAYER="tick",SIMPLE_LAYER="simple",BASE_LAYER="base";function simple_layer_defineProperties(target,props){for(var i=0;i67.5&&rotationNormalizer<=90||(yShift+=2*height),xShift=width,xShift=90===rotation?height:270===rotation?-height:0,orientation===axis_orientation_TOP?(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift+xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(-xShift+tickSize,"\n ").concat(-yShift-tickSize,") rotate(").concat(rotation,")"))):(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift-xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(xShift-tickSize,"\n ").concat(yShift+tickSize,") rotate(").concat(rotation,")")))})}(axisInstance,tickText,labelManager);return tickText},axis_renderer_setFixedBaseline=function setFixedBaseline(axisInstance){var fixedBaseline=axisInstance.config().fixedBaseline,showInnerTicks=axisInstance.renderConfig().showInnerTicks,domain=axisInstance.domain();fixedBaseline&&domain.length&&showInnerTicks&&axisInstance.setFixedBaseline()},axis_renderer_setAxisNamePos=function setAxisNamePos(textNode,orientation,measures){var axisNameHeight=measures.axisNameHeight,availableSpace=measures.availableSpace;switch(orientation){case axis_orientation_LEFT:textNode.attr("transform","translate(".concat(-(availableSpace.width-axisNameHeight),",").concat(availableSpace.height/2,")rotate(-90)"));break;case axis_orientation_RIGHT:textNode.attr("transform","translate(".concat(availableSpace.width-axisNameHeight,",").concat(availableSpace.height/2,")rotate(90)"));break;case axis_orientation_TOP:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(-availableSpace.height+axisNameHeight,")"));break;case axis_orientation_BOTTOM:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(availableSpace.height-axisNameHeight/2,")"))}return textNode};var _rangeAdjustmentMap,longestWord={month:"September",quarter:"October",halfYearly:"July",year:9999,day:"September",hour:"24 AM",mintues:"60:60",seconds:":60",week:"Wed 31"},skip_ticks_tickIntervals=[[1,1,"milliseconds",src_millisecond.every(1),"seconds"],[1,1e3,"seconds",src_second.every(1),"seconds"],[5,5e3,"five seconds",src_second.every(5),"seconds"],[10,1e4,"ten seconds",src_second.every(10),"seconds"],[15,15e3,"fifteen seconds",src_second.every(15),"seconds"],[30,3e4,"thirty seconds",src_second.every(30),"seconds"],[1,6e4,"minute",src_minute.every(1),"minutes"],[5,3e5,"five minutes",src_minute.every(5),"minutes"],[10,6e5,"ten minutes",src_minute.every(10),"minutes"],[15,9e5,"fifteen minutes",src_minute.every(15),"minutes"],[30,18e5,"thirty minutes",src_minute.every(30),"minutes"],[1,36e5,"hour",src_hour.every(1),"hour"],[3,108e5,"three hours",src_hour.every(3),"hour"],[6,216e5,"six hours",src_hour.every(6),"hour"],[12,432e5,"twelve hours",src_hour.every(12),"hour"],[1,864e5,"daily",src_day.every(1),"day"],[1,6048e5,"weekly",sunday.every(1),"week"],[1,2592e6,"monthly",src_month.every(1),"week"],[3,7776e6,"quaterly",src_month.every(3),"quarter"],[6,15552e6,"half yearly",src_month.every(6),"halfYearly"],[1,31536e6,"yearly",src_year.every(1),"year"],[2,63072e6,"2 year",src_year.every(2),"year"],[3,94608e6,"3 year",src_year.every(3),"year"],[5,15768e7,"5 year",src_year.every(5),"year"],[10,31536e7,"decade",src_year.every(10),"year"],[100,31536e8,"century",src_year.every(100),"year"],[1e3,31536e9,"millenium",src_year.every(1e3),"year"]],getTickIntervalFnBasedOnNumberOfTicks=function getTickIntervalFnBasedOnNumberOfTicks(interval,count,context){for(var possibleTickLevelIndex=skip_ticks_tickIntervals.length-1,maxPossibleTicks=1,tickIntervalLevelInfo=null,i=skip_ticks_tickIntervals.length-1;i>=0;i--){var tickIntervalInfo=skip_ticks_tickIntervals[i],numOfPossibleTicks=Math.floor(interval/tickIntervalInfo[1]);numOfPossibleTicks<=count&&(possibleTickLevelIndex=i,maxPossibleTicks=numOfPossibleTicks)}return tickIntervalLevelInfo=skip_ticks_tickIntervals[possibleTickLevelIndex],function getActualTickInterval(context,noOfTicks){var minWidthBetweenTicks=context._minTickDistance.width,width=context.availableSpace().width;return Math.floor((width-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)}(context,maxPossibleTicks)=numOfTicksAccordingToMinDiff&&(actualNumberOfTicks=numOfTicksAccordingToMinDiff),getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval,actualNumberOfTicks,context)}(context,maxTicks));context.renderConfig({tickValues:ticks})},adjustHorizontalRange=function adjustHorizontalRange(range,diff){return range[0]+=diff,range[1]-=diff,range},adjustVerticalRange=function adjustVerticalRange(range,diff){return range[0]-=diff,range[1]+=diff,range},rangeAdjustmentMap=(space_setter_defineProperty(_rangeAdjustmentMap={},axis_orientation_TOP,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_BOTTOM,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_LEFT,adjustVerticalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_RIGHT,adjustVerticalRange),_rangeAdjustmentMap),setAxisRange=function setAxisRange(context,type,rangeBounds,offset){context.range(rangeBounds),offset&&context.renderConfig(space_setter_defineProperty({},"".concat(type,"Offset"),offset))},getAdjustedRange=function getAdjustedRange(minDiff,range,domain,config){var orientation=config.orientation,adjustRange=config.adjustRange,diff=function getAxisOffset(timeDiff,range,domain){var avWidth=Math.abs(range[1]-range[0]),bars=avWidth/(avWidth/(domain[1]-domain[0])*timeDiff);return(avWidth-avWidth/(bars+1)*bars)/2}(minDiff,range,domain);return adjustRange?rangeAdjustmentMap[orientation](range,diff):range},space_setter_spaceSetter=function spaceSetter(context,spaceConfig){var _ref,tickInterval,heightForTicks,config=context.config(),_context$availableSpa2=context.availableSpace(),availWidth=_context$availableSpa2.width,availHeight=_context$availableSpa2.height,padding=_context$availableSpa2.padding,top=padding.top,left=padding.left,bottom=padding.bottom,right=padding.right,isOffset=spaceConfig.isOffset,_context$renderConfig2=context.renderConfig(),showAxisName=_context$renderConfig2.showAxisName,labels=_context$renderConfig2.labels,rotation=labels.rotation,fixedBaseline=config.fixedBaseline,axisNamePadding=config.axisNamePadding,tickValues=config.tickValues,_context$getAxisDimen=context.getAxisDimensions(),tickDimensions=_context$getAxisDimen.tickDimensions,allTickDimensions=_context$getAxisDimen.allTickDimensions,axisNameDimensions=_context$getAxisDimen.axisNameDimensions,tickSize=_context$getAxisDimen.tickSize,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width,namePadding=showAxisName?axisNamePadding:0,labelConfig={smartTicks:!0,rotation:labels.rotation},minTickDistance=context._minTickDistance,minTickSpace=context._minTickSpace,minDiff=context._minDiff,domain=context.domain(),axisNameHeight=axisNameDimensions.height,minWidthBetweenTicks=minTickDistance.width,minTickWidth=Math.min(minTickSpace.width,tickDimWidth),minTickHeight=Math.min(minTickSpace.height,tickDimHeight);return space_setter_defineProperty(_ref={},TIME,{x:function x(){!tickValues&&context.applyTickSkipping();var noOfTicks=context.getTickValues().length;heightForTicks=availHeight-axisNameHeight-tickSize-namePadding,(tickInterval=(availWidth-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)axisNameHeight?(labelConfig.rotation=null,context.renderConfig({showInnerTicks:!0,showAxisName:!0})):(labelConfig.rotation=-90,context.renderConfig({showInnerTicks:!0,showAxisName:!1}))),availHeight0&&void 0!==arguments[0]?arguments[0]:0,width=arguments.length>1?arguments[1]:void 0,height=arguments.length>2?arguments[2]:void 0,rotatedHeight=height,rotatedWidth=width;if(rotation){var angle=(rotation||0)*Math.PI/180;rotatedWidth=Math.abs(height*Math.sin(angle))+Math.abs(width*Math.cos(angle)),rotatedHeight=Math.abs(width*Math.sin(angle))+Math.abs(height*Math.cos(angle))}return{width:rotatedWidth,height:rotatedHeight}},helper_setOffset=function setOffset(context){var x=0,y=0,logicalSpace=context.logicalSpace(),config=context.config(),orientation=config.orientation,xOffset=config.xOffset,yOffset=config.yOffset;orientation===axis_orientation_LEFT&&(x=void 0===xOffset?logicalSpace.width:xOffset),orientation===axis_orientation_TOP&&(y=void 0===yOffset?logicalSpace.height:yOffset),context.renderConfig({xOffset:x,yOffset:y})},getAxisComponentDimensions=function getAxisComponentDimensions(context){var axisTicks,largestTick="",largestTickDimensions={width:0,height:0},smartTick={},allTickDimensions=[],scale=context.scale(),_context$renderConfig=context.renderConfig(),tickValues=_context$renderConfig.tickValues,showAxisName=_context$renderConfig.showAxisName,name=context.config().name,labelManager=context.dependencies().labelManager,labelFunc=scale.ticks||scale.quantile||scale.domain;return labelManager.setStyle(context._tickLabelStyle),axisTicks=(axisTicks=tickValues||labelFunc()).map(function(originalLabel,i){var label=context.getFormattedText(originalLabel,i,axisTicks),tickDimensions=labelManager.getOriSize(label);return allTickDimensions.push(tickDimensions),tickDimensions.width>largestTickDimensions.width&&(largestTick=label,smartTick=context.smartTicks()?context.smartTicks()[i]:{},largestTickDimensions=tickDimensions,smartTick=smartTick||tickDimensions),label}),labelManager.setStyle(context._axisNameStyle),{axisNameDimensions:showAxisName?labelManager.getOriSize(name):{width:0,height:0},largestTick:largestTick,largestTickDimensions:largestTickDimensions,allTickDimensions:allTickDimensions,axisTicks:axisTicks,smartTick:smartTick,tickSize:context.getTickSize()}},getHorizontalAxisSpace=function getHorizontalAxisSpace(context,axisDimensions,range){var width,height,domain=context.domain(),minTickDistance=context._minTickDistance.width,tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config2=context.config(),axisNamePadding=_context$config2.axisNamePadding,tickValues=_context$config2.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width;if(width=range&&range.length?range[1]-range[0]:3*(tickDimWidth+minTickDistance),height=0,tickValues){var minTickDiff=context.getMinTickDifference(),_ref=[Math.min.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain))),Math.max.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain)))];width=(_ref[1]-_ref[0])/Math.abs(minTickDiff)*(tickDimWidth+context._minTickDistance.width)}return height=range&&range.length?tickDimHeight:Math.max(tickDimWidth,tickDimHeight),{width:width,height:height+=(showAxisName?axisDimHeight+axisNamePadding:0)+tickSize}},getVerticalAxisSpace=function getVerticalAxisSpace(context,axisDimensions){var height,width,domain=context.domain(),tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config3=context.config(),axisNamePadding=_context$config3.axisNamePadding,tickValues=_context$config3.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height;if(height=0,width=tickDimensions.width,tickValues){var minTickDiff=context.getMinTickDifference(),_ref2=[Math.min.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain))),Math.max.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain)))];height=(_ref2[1]-_ref2[0])/Math.abs(minTickDiff)*tickDimHeight}return{height:height,width:width+=(showAxisName?axisDimHeight:0)+tickSize+(tickValues?axisNamePadding:0)}},helper_calculateBandSpace=function calculateBandSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,show=context.renderConfig().show,largestTickDimensions=axisDimensions.largestTickDimensions,axisTicks=axisDimensions.axisTicks,allTickDimensions=axisDimensions.allTickDimensions,largestDimHeight=largestTickDimensions.height,minTickWidth=context._minTickDistance.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa=getHorizontalAxisSpace(context,axisDimensions,range),_width=_getHorizontalAxisSpa.width,_height=_getHorizontalAxisSpa.height;return range&&range.length||(_width=allTickDimensions.reduce(function(t,n){return t+Math.min(n.width,n.height)+minTickWidth},0)),!1===show&&(_height=0,_width=0),{width:_width,height:_height}}var _getVerticalAxisSpace=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace.width,height=_getVerticalAxisSpace.height;return height&&0!==height||(height=axisTicks.length*(largestDimHeight+context._minTickDistance.height)),!1===show&&(width=0),{width:width,height:height}},helper_getValidDomain=function getValidDomain(context,domain){var userDom=context.config().domain;return userDom&&(domain=userDom),defaultValue(domain,[])},setContinousAxisDomain=function setContinousAxisDomain(context,domain){var nice=context.config().nice,scale=context.scale.bind(context);scale().domain(domain),nice&&scale().nice(),context._domain=scale().domain()},PROPS={availableSpace:{},axisDimensions:{},axisComponentDimensions:{},config:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._config||{}),mockedOldConfig=mergeRecursive({},oldConfig);(value=mergeRecursive(mockedOldConfig,value)).axisNamePadding=Math.max(value.axisNamePadding,0);var shouldAxesScaleUpdate=function hasAxesConfigChanged(){var obj=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},obj1=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},properties=arguments.length>2?arguments[2]:void 0;return!(!Object.keys(obj).length||!Object.keys(obj1).length)&&properties.some(function(key){return obj[key]!==obj1[key]})}(value,oldConfig,["interpolator","exponent","base","orientation"]),tickFormatter=context.sanitizeTickFormatter(value);return shouldAxesScaleUpdate&&(context._scale=context.createScale(value),context._axis=context.createAxis(value)),context._tickFormatter=function(ticks){return tickFormatter(ticks)},context.resetRenderConfig(value),value}},renderConfig:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._renderConfig||{});return value=mergeRecursive(oldConfig,value)}},logicalSpace:{},mount:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.logicalSpace(null),value}},smartTicks:{},tickSize:{},maxTickSpaces:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._maxTickSpaces||{});return value=mergeRecursive(oldConfig,value)}},valueParser:{defaultValue:function defaultValue(val){return val}}};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function simple_axis_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function simple_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,height=arguments.length>1?arguments[1]:void 0,padding=arguments.length>2?arguments[2]:void 0,isOffset=arguments.length>3?arguments[3]:void 0,labelConfig={},orientation=this.config().orientation;this.availableSpace({width:width,height:height,padding:padding});var type=this.constructor.type();return labelConfig=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?space_setter_spaceSetter(this,{isOffset:isOffset})[type].x():space_setter_spaceSetter(this,{isOffset:isOffset})[type].y(),this.renderConfig({labels:labelConfig}),this.setTickConfig(),this.setSmartAxisName(),this}},{key:"setSmartAxisName",value:function setSmartAxisName(){var _this$config2=this.config(),orientation=_this$config2.orientation,name=_this$config2.name,dimType=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?"width":"height",widthDim=this.availableSpace()[dimType],labelManager=this.dependencies().labelManager;return labelManager.setStyle(this._axisNameStyle),this.renderConfig({smartAxisName:function getSmartAxisName(name,width,labelManager){var oriSize=labelManager.getOriSize(name);return labelManager.useEllipsesOnOverflow(!0),labelManager.getSmartText(name,width,oriSize.height,!0)}(name,widthDim,labelManager)}),this}},{key:"setTickConfig",value:function setTickConfig(){return this}},{key:"getScaleValue",value:function getScaleValue(domainVal){if(null!==domainVal&&void 0!==domainVal)return this.scale()(domainVal)}},{key:"getTickSize",value:function getTickSize(){return this.axis().tickSize()}},{key:"getAxisDimensions",value:function getAxisDimensions(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return this.axisDimensions(function computeAxisDimensions(context){var tickDimensions={},labels=context.renderConfig().labels,smartTicks=labels.smartTicks,rotation=labels.rotation,_getAxisComponentDime=getAxisComponentDimensions(context),largestTickDimensions=_getAxisComponentDime.largestTickDimensions,axisTicks=_getAxisComponentDime.axisTicks,smartTick=_getAxisComponentDime.smartTick,axisNameDimensions=_getAxisComponentDime.axisNameDimensions,allTickDimensions=_getAxisComponentDime.allTickDimensions,tickSize=_getAxisComponentDime.tickSize,labelHeight=largestTickDimensions.height,labelWidth=largestTickDimensions.width;return 0===context.domain().length?{allTickDimensions:allTickDimensions,tickSize:0,tickDimensions:{height:0,width:0},axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks}:(tickDimensions=getRotatedSpaces(rotation,(tickDimensions=smartTicks?smartTick:{width:labelWidth,height:labelHeight}).width,tickDimensions.height),0===tickSize&&(tickDimensions={width:0,height:0}),{allTickDimensions:allTickDimensions,tickSize:tickSize,tickDimensions:tickDimensions,axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks})}.apply(void 0,[this].concat(params))),this.axisDimensions()}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()||this.logicalSpace(function calculateContinousSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,_context$renderConfig6=context.renderConfig(),show=_context$renderConfig6.show,showAxisName=_context$renderConfig6.showAxisName,axisNameDimensions=axisDimensions.axisNameDimensions;if(!1===show)return{width:0,height:0};var axisNameWidth=axisNameDimensions.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa2=getHorizontalAxisSpace(context,axisDimensions,range),_width2=_getHorizontalAxisSpa2.width,_height2=_getHorizontalAxisSpa2.height;return{width:Math.max(_width2,axisNameWidth),height:_height2}}var _getVerticalAxisSpace2=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace2.width,height=_getVerticalAxisSpace2.height;return{width:width,height:Math.max(height,showAxisName?axisNameWidth:0)}}(this)),helper_setOffset(this),this.logicalSpace()}},{key:"invert",value:function invert(value){return this.scale().invert(value)}},{key:"getNearestRange",value:function getNearestRange(v1,v2){return[v1,v2]}},{key:"invertExtent",value:function invertExtent(v1,v2){return[this.invert(v1),this.invert(v2)]}},{key:"getMinTickDifference",value:function getMinTickDifference(){return this.domain()}},{key:"getFormattedTickValues",value:function getFormattedTickValues(tickValues){return tickValues}},{key:"getUnitWidth",value:function getUnitWidth(){return 0}},{key:"serialize",value:function serialize(){return{name:this.name,type:this.type,range:this.range(),config:this.config()}}},{key:"render",value:function render(){return this.mount()&&(this.setTickConfig(),function renderAxis(axisInstance){var renderConfig=axisInstance.renderConfig(),config=axisInstance.config(),show=renderConfig.show,xOffset=renderConfig.xOffset,yOffset=renderConfig.yOffset,showAxisName=renderConfig.showAxisName,labels=renderConfig.labels,smartAxisName=renderConfig.smartAxisName,mount=axisInstance.mount(),orientation=config.orientation,axisNamePadding=config.axisNamePadding,className=config.className,id=config.id,classPrefix=config.classPrefix;if(show){var availableSpace,labelProps,tickSize,selectContainer=makeElement(renderer_utils_selectElement(mount),"g",[axisInstance],"".concat(className),{},function(key){return key.config().id});if(selectContainer.attr("transform","translate(".concat(xOffset,",").concat(yOffset,")")),axisInstance.domain().length>0){var labelManager=axisInstance.dependencies().labelManager,range=axisInstance.range(),axis=axisInstance.axis(),scale=axisInstance.scale(),tickLabelStyle=axisInstance._tickLabelStyle,axisTickFormatter=axisInstance._tickFormatter;tickSize=axisInstance.getTickSize(),labelManager.setStyle(tickLabelStyle);var labelFunc=scale.ticks||scale.quantile||scale.domain,ticks=axis.tickValues()||labelFunc();axis.tickFormat(axisTickFormatter(ticks)),availableSpace=Math.abs(range[0]-range[1]),labelProps=axisInstance.axisComponentDimensions().largestTickDimensions,axis_renderer_setFixedBaseline(axisInstance),labels.rotation||!1!==labels.smartTicks?(selectContainer.call(axis),axis_renderer_changeTickOrientation(selectContainer,axisInstance,tickSize)):selectContainer.transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).call(axis),selectContainer.selectAll(".tick").classed("".concat(classPrefix,"-ticks"),!0),selectContainer.selectAll(".tick line").classed("".concat(classPrefix,"-tick-lines"),!0),selectContainer.selectAll(".tick text").classed("".concat(classPrefix,"-ticks"),!0).classed("".concat(classPrefix,"-ticks-").concat(id),!0)}var textNode=makeElement(selectContainer,"text",[smartAxisName],"".concat(classPrefix,"-axis-name")).attr("text-anchor","middle").classed("".concat(classPrefix,"-axis-name-").concat(id),!0).text(function(d){return d.text});textNode.classed(HIDDEN,!showAxisName);var labelOffset=availableSpace/2,measures={labelProps:labelProps,tickSize:tickSize,axisNamePadding:axisNamePadding,axisNameHeight:smartAxisName.height,yOffset:yOffset,xOffset:xOffset,labelOffset:labelOffset,availableSpace:axisInstance.availableSpace()};axis_renderer_setAxisNamePos(textNode,orientation,measures)}}(this)),this}},{key:"remove",value:function remove(){return renderer_utils_selectElement(this.mount()).remove(),this}},{key:"unsubscribe",value:function unsubscribe(){return this}},{key:"isReverse",value:function isReverse(){var range=this.range();return range[0]>range[1]}},{key:"getPixelToValueRatio",value:function getPixelToValueRatio(){var scale=this.scale(),range=scale.range(),domain=scale.domain();return Math.abs(range[1]-range[0])/(domain[1]-domain[0])}},{key:"animationDone",value:function animationDone(){return Promise.all(this._animationDonePromises)}},{key:"registerAnimationDoneHook",value:function registerAnimationDoneHook(){var resolveFn,promise=new Promise(function(resolve){resolveFn=resolve});return this._animationDonePromises.push(promise),function(){resolveFn()}}},{key:"_getRawTickValue",value:function _getRawTickValue(data){return data}},{key:"getTicksBasedOnData",value:function getTicksBasedOnData(tickData){var _this=this,allTicks=renderer_utils_selectElement(this.mount()).selectAll(".tick"),elementToBeModified=null,elementNotToBeModified=null;return tickData&&(elementToBeModified=allTicks.filter(function(tickValue){return tickData===_this._getRawTickValue(tickValue)}),elementNotToBeModified=allTicks.filter(function(tickValue){return!(tickData===_this._getRawTickValue(tickValue))})),{selectionSet:elementToBeModified,rejectionSet:elementNotToBeModified||allTicks}}},{key:"id",get:function get(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return default_config_defaultConfig}}]),SimpleAxis}();function linear_defineProperties(target,props){for(var i=0;iavailableSpace&&(numberOfValues=Math.floor(availableSpace/(labelDim+minTickDistance))),numberOfTicks=numberOfTicks||numberOfValues,numberOfValues=Math.min(numberOfTicks,Math.max(2,numberOfValues)),(tickValues=axis.scale().ticks(numberOfValues)).length>numberOfValues&&(tickValues=tickValues.filter(function(e,i){return i%2==0})),2===numberOfValues&&(tickValues=[(tickValues=axis.scale().ticks(10))[0],tickValues[tickValues.length-1]]),tickValues}(availableSpace,labelProps[orientation===axis_orientation_BOTTOM||orientation===axis_orientation_TOP?"width":"height"],axis,this)}},{key:"getMinTickDifference",value:function getMinTickDifference(){return getSmallestDiff(this.renderConfig().tickValues)}},{key:"setFixedBaseline",value:function setFixedBaseline(tickText){var orientation=this.config().orientation,rotation=this.renderConfig().labels.rotation,axis=this.axis(),ticks=axis.tickValues(),smartTicks=this.smartTicks();if(smartTicks&&smartTicks.length){var _this$smartTicks$=this.smartTicks()[0],width=_this$smartTicks$.width,height=_this$smartTicks$.height;axis.tickTransform(function(d){if(d===ticks[0]){if(orientation===axis_orientation_LEFT||orientation===axis_orientation_RIGHT)return"translate(0, -".concat(height/3,"px)");if((orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM)&&!rotation)return"translate(".concat(width/2,"px, ",0,"px)")}return""})}return tickText}}],[{key:"type",value:function type(){return LINEAR}}]),ContinousAxis}();function band_axis_typeof(obj){return(band_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function band_axis_defineProperties(target,props){for(var i=0;irange[1],extent=this.invertExtent(v1,v2);return[scale(reverse?extent[extent.length-1]:extent[0]),scale(reverse?extent[0]:extent[extent.length-1])+scale.bandwidth()]}}],[{key:"type",value:function type(){return BAND}}]),BandAxis}();function time_axis_typeof(obj){return(time_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function time_axis_defineProperties(target,props){for(var i=0;i1?config.range:[DEFAULT_GRADIENT_COLOR].concat(props_toConsumableArray(config.range)));var oldConfig=mergeRecursive(defCon,context.config()),newConfig=mergeRecursive(oldConfig,config);return newConfig.range instanceof Array&&(newConfig.range=newConfig.range.map(function(e,i){return props_getActualHslColor(e,palette[i])}),newConfig.stops=config.stops?config.stops:config.range&&config.range.length>2?config.range.length:DEFAULT_CONFIG.stops),newConfig.value=props_getActualHslColor(newConfig.value,newConfig.value),newConfig}},domain:{},scale:{},uniqueValues:{}},helper_treatNullMeasures=function treatNullMeasures(domainVal,scaledVal,minDomainScaledVal){return domainVal instanceof src_InvalidAwareTypes?minDomainScaledVal:scaledVal},helper_resolveAxisConfig=function resolveAxisConfig(propVal,defaultVal,context){switch(getObjProp(propVal,"constructor")){case Function:return propVal(defaultVal,context);case Array:return propVal;default:return defaultVal}},sanitiseConfigIntervals=function sanitiseConfigIntervals(intervals){return intervals||5};function color_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function color_strategy_toConsumableArray(arr){return function color_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iMath.min(range.length,18))for(var interpolator=common_utils_piecewiseInterpolator()(common_utils_hslInterpolator(),range.map(function(e){return props_getHslString(e)})),i=0;i0&&void 0!==arguments[0]?arguments[0]:[];if(domain.length){var scale=this.scale(),range=scale.range?scale.range():null,scaleInfo=this._colorStrategy.domainRange()(domain,this.config().stops,range);this.domain(scaleInfo.domain),scaleInfo.range&&this.scale().range(scaleInfo.range),this.uniqueValues(scaleInfo.uniqueVals),this.scale().domain(scaleInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),config:this.config()}}},{key:"transformColor",value:function transformColor(color,transformationArr){var h=360*color[0],s=100*color[1],l=100*color[2],a=Math.min(defaultValue(color[3],0),1),newH=h+transformationArr[0],newS=s+transformationArr[1],newL=l+transformationArr[2],newA=Math.min(a+transformationArr[3]||0,1);return{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH/360,newS/100,newL/100,newA]}}},{key:"id",value:function id(){return this._id}},{key:"getHslArray",value:function getHslArray(color){return props_getActualHslColor(color)}}],[{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIG}},{key:"type",value:function type(){return"color"}}]),ColorAxis}(),defaults_DEFAULT_CONFIG={value:51,range:[51,1e3]};function size_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function size_strategy_toConsumableArray(arr){return function size_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&void 0!==arguments[0]?arguments[0]:0,value=this.config().value,scale=this.scale(),domain=this.domain()||[1,1];return scale&&domain[0]!==domain[1]?this._sizeStrategy.range(domainVal,scale,this.domain(),this.uniqueValues()):value}},{key:"updateDomain",value:function updateDomain(domain){if(domain){var domainInfo=(0,this._sizeStrategy.domain)(domain,this.config().stops);this.domain(domainInfo.domain),this.uniqueValues(domainInfo.uniqueVals),this.scale().domain(domainInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.range(),config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"size"}}]),SizeAxis}(),shape_axis_defaults_DEFAULT_CONFIG={generator:null,value:"circle",range:["circle","diamond","star","cross","square","wye","triangle"]},shape_axis_props_PROPS={config:{},domain:{},scale:{},uniqueValues:{},generator:{}};function shape_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];return domain.length&&(this.uniqueValues(domain),this.domain(domain),this.scale().domain(domain),this.config().generator&&(this._generatedShapes=function shapeGenerator(domain,generatorFn){var generatedShapes={};return domain.forEach(function(value){generatedShapes[value]=generatorFn(value)}),generatedShapes}(domain,this.config().generator))),this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.config().range,config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return shape_axis_defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"shape"}}]),ShapeAxis}(),polar_axis_props_PROPS={config:{sanitization:function sanitization(context,config){return mergeRecursive(context.config(),config)},preset:function preset(context,config){var range=config.range,domain=config.domain;range&&context.range(range),domain&&context.domain(domain)}},domain:{},range:{}};function angle_axis_slicedToArray(arr,i){return function angle_axis_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function angle_axis_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function angle_axis_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function angle_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function angle_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AngleAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._range=[0,360],this._angleFn=angle_axis_pie().value(function(d){return"string"==typeof d?1:d}).sortValues(null),this._angleValues={}}return function angle_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&angle_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&angle_axis_defineProperties(Constructor,staticProps),Constructor}(AngleAxis,[{key:"createScale",value:function createScale(strategy){var range=this.config().range;return scale_creator_createScale({type:strategy.scale,range:range})}},{key:"getScaleValue",value:function getScaleValue(domainVal){return this._angleValues[domainVal]}},{key:"padAngle",value:function padAngle(angle){this._angleFn=this._angleFn.padAngle(angle)}},{key:"domain",value:function domain(){for(var _len=arguments.length,domainVal=new Array(_len),_key=0;_key<_len;_key++)domainVal[_key]=arguments[_key];if(domainVal.length){var customDomain=this.config().domain,domain=domainVal[0].length?domainVal[0]:DEFAULT_ANGLE_DOMAIN;return this._domain=helper_resolveAxisConfig(customDomain,domain,this),createAngleValues(this),this}return this._domain}},{key:"range",value:function range(){if(arguments.length){var customRange=this.config().range;this._range=helper_resolveAxisConfig(customRange,arguments.length<=0?void 0:arguments[0],this);var domain=this.domain(),_this$_range=angle_axis_slicedToArray(this._range,2),startAngle=_this$_range[0],endAngle=_this$_range[1];return this._angleFn.startAngle(startAngle/180*Math.PI).endAngle(Math.PI*endAngle/180),domain&&domain.length&&createAngleValues(this),this}return this._range}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),AngleAxis}(),X="x",Y="y",WIDTH="width",HEIGHT="height",constants_MEASUREMENT="measurement",constants_CONFIG="config",MIN_UNIT_WIDTH="minUnitWidth",MIN_UNIT_HEIGHT="minUnitHeight",DIMENSIONS="dimensions",MEASURES="measures",DIMENSION="dimension",MEASURE="measure",PIVOT="pivot",FORMAT="format",constants_MOUNT="mount",HAS_DATA_UPDATED="hasDataUpdated",ROWS="rows",COLUMNS="columns",constants_DATA="data",COL="col",ROW="row",COLUMN="column",enums_constants_COLOR="color",enums_constants_SHAPE="shape",enums_constants_SIZE="size",DETAIL="detail",LAYERS="layers",TRANSFORM="transform",enums_constants_ORDINAL="ordinal",enums_constants_LINEAR="linear",constants_LEFT="left",constants_RIGHT="right",enums_constants_TOP="top",enums_constants_BOTTOM="bottom",RETINAL="retinal",CELL="cell",X_AXES="xAxes",Y_AXES="yAxes",ENTRY_CELLS="entryCell",INITIALIZED="initialized",EXIT_CELLS="exitCell",AXIS="axis",UNIT="unit",UPDATED="updated",BEFORE_UPDATE="beforeupdate",VALUE_MATRIX="valueMatrix",FACET_HEADERS="facet-headers",enums_constants_RADIUS="radius",enums_constants_ANGLE="angle",ANGLE0="angle0",ARC="arc",constants_CATEGORICAL="categorical",constants_TEMPORAL="temporal",BAR="bar",LINE="line",POINT="point",PRIMARY="Primary",SECONDARY="Secondary",BOTH="both",INTERACTION="interaction",GRID_LINES="gridLines",GRID_BANDS="gridBands",HEADER="header",FACET="facet",DEFAULT="default",constants_ASCENDING="asc",DESCENDING="desc",DARK="dark",NONE="none",NORMAL="normal",DARKER="darker";function radius_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function radius_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RadiusAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._range=[],this._radiusFactor=1,this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._scale=this.createScale({scale:enums_constants_LINEAR})}return function radius_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&radius_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&radius_axis_defineProperties(Constructor,staticProps),Constructor}(RadiusAxis,[{key:"config",value:function config(){if(arguments.length){var config=mergeRecursive(this.config(),arguments.length<=0?void 0:arguments[0]);return this._config=config,this}return this._config}},{key:"createScale",value:function createScale(strategy){return scale_creator_createScale({type:strategy.scale,range:this.range()})}},{key:"domain",value:function domain(){if(arguments.length){var customDomain=this.config().domain,domain=helper_resolveAxisConfig(customDomain,arguments.length<=0?void 0:arguments[0],this);domain=sanitizeDomainWhenEqual(domain),this._scale.domain(domain),this._domain=domain,adjustDomain(this)}return this._domain}},{key:"getInnerRadius",value:function getInnerRadius(domainVal){return void 0===domainVal?this.range()[0]:this._scale(domainVal)}},{key:"getOuterRadius",value:function getOuterRadius(domainVal){return void 0===domainVal?this.range()[1]:this._scale(domainVal)*this._radiusFactor}},{key:"range",value:function range(){for(var _len=arguments.length,_range=new Array(_len),_key=0;_key<_len;_key++)_range[_key]=arguments[_key];if(_range.length){var _this$config2=this.config(),padding=_this$config2.padding,customRange=_this$config2.range,sanitizedRange=_range[0].map(function(v,i){return v+(i?-padding[i]:padding[i])}),rangeVal=helper_resolveAxisConfig(customRange,sanitizedRange,this);this._range=rangeVal,this._scale.range(rangeVal),adjustDomain(this)}return this._range}},{key:"setRadiusFactor",value:function setRadiusFactor(val){return this._radiusFactor=val,this}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:[0,1],minOuterRadius:10}}}]),RadiusAxis}();function data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DATA_TYPES_MEASURE="measure",DATA_TYPES_TEMPORAL="temporal",group_transform=(data_type_scale_map_defineProperty(_dataTypeScaleMap={},"dimension",BAND),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_MEASURE,LINEAR),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_TEMPORAL,TIME),function(schema,data,config){var groupBy=config.groupBy instanceof Array?config.groupBy:[config.groupBy],groupByIndices=groupBy.map(function(fieldName){return schema.findIndex(function(d){return d.name===fieldName})});if(void 0!==groupByIndices.find(function(d){return-1===d}))throw new Error("Groupby field ".concat(groupBy," not found in schema"));var groupedData=common_utils_nestCollection({keys:groupByIndices,data:data});return groupedData.forEach(function(d){var key=d.key;src_InvalidAwareTypes.isInvalid(key)&&(d.key=src_InvalidAwareTypes.getInvalidType(key))}),groupedData});var _transformMap;function transform_factory_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var transformMap=(transform_factory_defineProperty(_transformMap={},"identity",function identityTransform(schema,data,config){return data}),transform_factory_defineProperty(_transformMap,"group",group_transform),transform_factory_defineProperty(_transformMap,"stack",function(schema,data,config){var uniqueField=config.uniqueField,valueField=config.value,groupBy=config.groupBy,sort=config.sort||"descending",normalizedData=function normalizeData(data,schema,valueField,uniqueField,groupBy){var groupedData=group_transform(schema,data,{groupBy:uniqueField}),uniqueFieldIndex=schema.findIndex(function(d){return d.name===uniqueField}),valueFieldIndex=schema.findIndex(function(d){return d.name===valueField}),seriesKeyIndex=schema.findIndex(function(d){return d.name===groupBy}),seriesKeys=data.map(function(d){return d[seriesKeyIndex]}).filter(function(item,pos,arr){return arr.indexOf(item)===pos}).sort(),fieldNames=schema.reduce(function(acc,obj,i){return acc[i]=obj.name,acc},{});return{data:groupedData.map(function(arr){var tuples={},rowObj=arr.values.reduce(function(acc,row){return acc=row.reduce(function(obj,value,i){return i===seriesKeyIndex?(row[valueFieldIndex]instanceof src_InvalidAwareTypes&&(row[valueFieldIndex]=null),obj[value]=row[valueFieldIndex],tuples[value]=row):i!==valueFieldIndex&&(obj[fieldNames[i]]=value),obj},acc)},{});return rowObj._tuple=tuples,seriesKeys.forEach(function(seriesKey){if(void 0===rowObj[seriesKey]){rowObj[seriesKey]=0;var newArr=new Array(arr.values[0].length);newArr[uniqueFieldIndex]=arr.key,newArr[seriesKeyIndex]=seriesKey,rowObj._tuple[seriesKey]=newArr}}),rowObj}),keys:seriesKeys}}(data,schema,valueField,uniqueField,groupBy),keys=normalizedData.keys,map={},orderBy=config.orderBy,orderIndex=schema.findIndex(function(d){return d.name===orderBy}),groupByIndex=schema.findIndex(function(d){return d.name===groupBy});-1!==orderIndex&&(keys.forEach(function(key){var name=data.find(function(d){return d[groupByIndex]===key});map[key]=name[orderIndex]}),normalizedData.keys.sort(function(a,b){return map[a].localeCompare(map[b])}));var stackData=common_utils_stack({keys:normalizedData.keys,offset:config.offset||"diverging",order:sort,data:normalizedData.data});return stackData.forEach(function(seriesData){seriesData.forEach(function(dataObj){dataObj.data=dataObj.data._tuple[seriesData.key]})}),stackData}),_transformMap);var _encodingFieldInfRetr,_dataNormalizers,_domainCalculator,transform_factory=function transformFactory(type){var transform=transformMap[type];if("function"!=typeof transform)throw new Error("Invalid transform type supplied.");return transform};function helpers_toConsumableArray(arr){return function helpers_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=d[0]?(y=x0=d[1],x=y0=d[0]):(y=x0=d[0],x=y0=d[1]),(pointObj=xFieldType===dist_datamodel.FieldType.MEASURE?{x:x,x0:x0,y:tuple[yFieldIndex],y0:tuple[yFieldIndex]}:{x:tuple[xFieldIndex],x0:tuple[xFieldIndex],y:y,y0:y0}).source=tuple,pointObj.rowId=tuple[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=tuple[encodingFieldInf["".concat(enc,"FieldIndex")]]})):((pointObj={x:d[xFieldIndex],y:d[yFieldIndex],x0:d[x0FieldIndex],y0:d[y0FieldIndex]}).source=d,pointObj.rowId=d[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=d[encodingFieldInf["".concat(enc,"FieldIndex")]]}));var source=pointObj.source;return pointObj.dataObj=fieldsArr.reduce(function(acc,name){return acc[name]=source[fieldsConfig[name].index],acc},{}),pointObj})}).filter(function(d){return d.length})}),_dataNormalizers),helpers_getNormalizedData=function getNormalizedData(transformedData,context){var transformType=context.transformType(),transformedDataArr=transformType===IDENTITY?[transformedData]:transformedData,encodingFieldInf=context.encodingFieldsInf(),fieldsConfig=context.data().getFieldsConfig();return dataNormalizers[context.coord()](transformedDataArr,encodingFieldInf,fieldsConfig,transformType)},domainCalculator=(helpers_defineProperty(_domainCalculator={},POLAR,function(data,layerInst){var config=layerInst.config(),sort=config.sort,angleValues=data[0],radius0Field=getObjProp(config.encoding.radius0,"field");return sort&&(angleValues=angleValues.sort(function(a,b){return sort===ASCENDING?a.radius-b.radius:b.radius-a.radius})),{radius:getDomainFromData(data,[ENCODING.RADIUS,radius0Field?ENCODING.RADIUS0:ENCODING.RADIUS]),angle:angleValues.map(function(d){return d.angle}),angle0:angleValues.map(function(d){return d.angle0})}}),helpers_defineProperty(_domainCalculator,helpers_CARTESIAN,function(data,layerInst){var transformType=layerInst.transformType(),encodingFieldInf=layerInst.encodingFieldsInf(),xFieldSubType=encodingFieldInf.xFieldSubType,yFieldSubType=encodingFieldInf.yFieldSubType,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,x0Field=encodingFieldInf.x0Field,y0Field=encodingFieldInf.y0Field,domains={},yEnc=ENCODING.Y,xEnc=ENCODING.X;return xField&&(domains.x=getDomainFromData(data,x0Field||transformType===STACK?[xEnc,ENCODING.X0]:[xEnc,xEnc],xFieldSubType)),yField&&(domains.y=getDomainFromData(data,y0Field||transformType===STACK?[ENCODING.Y0,ENCODING.Y]:[yEnc,yEnc],yFieldSubType)),domains}),_domainCalculator),defFn=function defFn(d){var _d$update=d.update;return{x:_d$update.x,y:_d$update.y}},helpers_attachDataToVoronoi=function attachDataToVoronoi(voronoi,points){var _ref,accessor=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defFn;voronoi.data((_ref=[]).concat.apply(_ref,helpers_toConsumableArray(points)).filter(function(d){return void 0!==d.rowId}).map(function(d){var _accessor=accessor(d);return{x:_accessor.x,y:_accessor.y,data:d}}))},helpers_updateStyle=function updateStyle(target,styles,remove){for(var key in styles)({}).hasOwnProperty.call(styles,key)&&target.style(key,remove?null:styles[key])},helpers_animateGroup=function animateGroup(mount,context){var groupTransition,update,transition=context.transition,groupAnimateStyle=context.groupAnimateStyle,duration=transition.duration,effect=transition.effect,disabled=transition.disabled;groupAnimateStyle&&(renderer_utils_setStyles(mount.node(),groupAnimateStyle.enter),update=groupAnimateStyle.update,groupTransition=disabled?mount:mount.transition().ease(easeFns[effect]).duration(duration).on("end",function(){helpers_updateStyle(renderer_utils_selectElement(this),update,!0)}),helpers_updateStyle(groupTransition,update))},positionPoints=function positionPoints(context,points){var positioner=context.encodingTransform();return positioner?positioner(points,context,{smartLabel:context._dependencies.smartLabel}):points},getGroupSpan=function getGroupSpan(axis,minDiff){var width=axis.getUnitWidth(),scale=axis.scale(),range=scale.range(),domain=scale.domain();return width||Math.abs(range[1]-range[0])/Math.abs(domain[1]-domain[0])*minDiff},helpers_getPlotMeasurement=function getPlotMeasurement(context,dimensionalValues){var fieldInfo=context.encodingFieldsInf(),axes=context.axes(),transformType=context.transformType(),config=context.config(),bandScale=context._bandScale;return["x","y"].map(function(type){var span=0,groupSpan=0,padding=0,offsetValues=[];if(fieldInfo["".concat(type,"FieldType")]===dist_datamodel.FieldType.DIMENSION){var actualGroupWidth,timeDiff=fieldInfo["".concat(type,"FieldSubType")]===dist_datamodel.DimensionSubtype.TEMPORAL?context.dataProps().timeDiffs[type]:0,axis=axes[type],pad=config["pad".concat(type.toUpperCase())],innerPadding=config.innerPadding,keys=dimensionalValues,scale=axis.scale();groupSpan=getGroupSpan(axis,timeDiff);var isAxisBandScale=axis.constructor.type()===helpers_BAND,axisPadding=axis.config().padding;if("group"===transformType){var groupPadding=isAxisBandScale?0:axisPadding*groupSpan/2;bandScale.range([groupPadding,groupSpan-groupPadding]).domain(keys).paddingInner(innerPadding),span=bandScale.bandwidth(),actualGroupWidth=groupSpan-(isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(key){return bandScale(key)-(isAxisBandScale?0:groupSpan/2)})}else if(void 0!==pad){var offset;if(isAxisBandScale){var step=scale.step();offset=scale.padding()*step,span=scale.bandwidth()+offset}else span=groupSpan;offsetValues=keys.map(function(){return isAxisBandScale?-offset/2:-span/2})}else actualGroupWidth=span=groupSpan-(padding=isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(){return isAxisBandScale?0:-span/2});groupSpan=actualGroupWidth,padding=isAxisBandScale?axisPadding*axis.scale().step():axisPadding*groupSpan}return{span:span,offsetValues:offsetValues,groupSpan:groupSpan,padding:padding}})},helpers_renderLayer=function renderLayer(context){var mount=context.mount();mount&&(context.render(mount),context.dependencies().throwback.commit(common_props.ON_LAYER_DRAW,!0,context.metaInf().parentNamespace))},helpers_resolveInvalidTransformType=function resolveInvalidTransformType(context){return function transformResolverPredicates(encodingFieldInf,context,groupByField){var fieldsConfig=context.data().getFieldsConfig(),xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,dimensionField=["xField","yField"].find(function(type){return encodingFieldInf["".concat(type,"Type")]===dist_datamodel.FieldType.DIMENSION});return[!xField,!yField,!groupByField,getObjProp(fieldsConfig[groupByField],"def","type")===dist_datamodel.FieldType.MEASURE,xFieldType===dist_datamodel.FieldType.DIMENSION&&yFieldType===dist_datamodel.FieldType.DIMENSION,dimensionField&&encodingFieldInf[dimensionField]===groupByField]}(context.encodingFieldsInf(),context,context.config().transform.groupBy).some(function(value){return value})?IDENTITY:null},getValidTransform=function getValidTransform(context){return helpers_resolveInvalidTransformType(context)||context.config().transform.type},helpers_getValidTransformForAggFn=function getValidTransformForAggFn(context){var resolvedInvalidTransformType=helpers_resolveInvalidTransformType(context);if(resolvedInvalidTransformType)return resolvedInvalidTransformType;var _context$encodingFiel=context.encodingFieldsInf(),xField=_context$encodingFiel.xField,yField=_context$encodingFiel.yField,xFieldType=_context$encodingFiel.xFieldType,yFieldType=_context$encodingFiel.yFieldType,groupByField=context.config().transform.groupBy,isCustomTransformTypeProvided=!!getObjProp(context._customConfig,"transform","type"),transformType=context.config().transform.type;if(!isCustomTransformTypeProvided&&groupByField&&xFieldType!==yFieldType){var measureField=xFieldType===dist_datamodel.FieldType.MEASURE?xField:yField;transformType=common_utils_retrieveNearestGroupByReducers(context.data(),measureField)[measureField]===AGG_FN_SUM?STACK:GROUP}return transformType},helpers_getMarkId=function getMarkId(source,schema){return source.filter(function(val,i){return schema[i]&&schema[i].type===dist_datamodel.FieldType.DIMENSION}).join()},helpers_resolveEncodingValues=function resolveEncodingValues(data,i,dataArr,layerInst){var transformedValues={},values=data.values,encoding=layerInst.config().encoding;for(var key in values){var value=getObjProp(encoding[key],"value");value instanceof Function?transformedValues[key]=value(values,i,dataArr,layerInst):transformedValues[key]=values[key]}return transformedValues},getColorMetaInf=function getColorMetaInf(initialStyle){var conf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{originalStyle:Object.assign({},{styles:initialStyle},conf),currentState:new Map}},getCoordValue=function getCoordValue(radius,trig,angle,offset){return radius*Math[trig](angle)+offset},coordValueGetter=function coordValueGetter(radius,angle,xOffset,yOffset){return{x:getCoordValue(radius,"cos",angle,xOffset),y:getCoordValue(radius,"sin",angle,yOffset)}},toCartesianCoordinates=function toCartesianCoordinates(points,measurement){for(var rangePlot=arguments.length>2&&void 0!==arguments[2]&&arguments[2],xOffset=measurement.width/2,yOffset=measurement.height/2,i=0,len=points.length;i0&&(interactionType=function getLastItemInMap(map){return Array.from(map)[map.size-1]}(currentState)[0],stylesForCurrentLevel=currentState.get(interactionType)||{}),stylesForCurrentLevel},strokeProps={"stroke-width":1,stroke:1,"stroke-opacity":1},parseStyle=function parseStyle(value,_ref,apply){var datum=_ref.datum,datumStyle=_ref.datumStyle;if("function"==typeof value){if(isNaN(datumStyle))value=value(datumStyle.replace(/[^\d,.]/g,"").split(",").map(function(s){return Number(s)}),datum,apply);else value=value(parseFloat(datumStyle,10),datum,apply);return value}return value},helper_applyStylesOnInteraction=function applyStylesOnInteraction(context,elem,interactionType,conf,options){var datum,mountPoint=options.mountPoint,apply=options.apply,reset=options.reset,d=elem.data()[0],_datum$meta=(datum=Array.isArray(d)?d[0]:Array.isArray(d.data)?d.data[0]:d).meta,currentState=_datum$meta.currentState,originalStyle=_datum$meta.originalStyle,applicableStyles={},styles=conf.style,strokePosition=conf.strokePosition,applicableStrokePos=strokePosition;reset&¤tState.clear();var applyStyle=!0;if(apply){var sanitizedStyles={styles:{},strokePosition:strokePosition};for(var type in styles){var parsedStyleVal=parseStyle(styles[type],{datum:datum,datumStyle:elem.style(type)},apply);sanitizedStyles.styles[type]=parsedStyleVal}currentState.set(interactionType,sanitizedStyles),applicableStyles=sanitizedStyles.styles}else if(currentState.has(interactionType)||reset){currentState.delete(interactionType);var currentStyle=getPreviousStyle(datum.meta,interactionType);applicableStyles=Object.assign({},originalStyle.styles,currentStyle.styles),applicableStrokePos=currentStyle.strokePosition||originalStyle.strokePosition}else applyStyle=!1;var styleKeys=Object.keys(applicableStyles),_partition2=helper_slicedToArray(partition(styleKeys,function(v){return v in strokeProps}),2),strokeStyles=_partition2[0],otherStyles=_partition2[1];applyStyle&&context.applyStyles({strokeStyles:strokeStyles,otherStyles:otherStyles,styleObj:applicableStyles,elem:elem,datum:datum,applicableStrokePos:applicableStrokePos,mountPoint:mountPoint})};function base_mixin_typeof(obj){return(base_mixin_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _construct(Parent,args,Class){return(_construct=function isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&base_mixin_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function base_mixin_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function base_mixin_slicedToArray(arr,i){return function base_mixin_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function base_mixin_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function base_mixin_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function base_mixin_toConsumableArray(arr){return function base_mixin_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},getAllAttrs=config.getAllAttrs,getBBox=config.getBBox;if(!this.data())return[];if(identifiers instanceof datamodel_default.a){var dataObj=identifiers.getData();fieldNames=dataObj.schema.map(function(d){return d.name}),values=dataObj.data}else fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length);var points=this._points,fieldsConfig=this.data().getFieldsConfig(),filteredPoints=(_ref2=[]).concat.apply(_ref2,base_mixin_toConsumableArray(points)).filter(function(point){var source=point.source,rowId=point.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})});return getAllAttrs?filteredPoints:filteredPoints.map(function(d){var obj=clone(d);if(getBBox){var update=obj.update||obj;if(void 0!==obj.size){var sizeVal=2*Math.sqrt(obj.size/Math.PI);update.width=sizeVal,update.height=sizeVal,update.x-=sizeVal/2,update.y-=sizeVal/2}else void 0===update.width&&(update.width=2),void 0===update.height&&(update.height=2)}return obj.update||obj}).sort(function(a,b){return a.y-b.y})}},{key:"getTransformedDataFromIdentifiers",value:function getTransformedDataFromIdentifiers(identifiers){var measureIndex,enc,idx=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,_identifiers$getData=identifiers.getData(),identifierData=_identifiers$getData.data,identifierSchema=_identifiers$getData.schema,normalizedData=this._normalizedData,fieldsConfig=this.data().getFieldsConfig(),_this$encodingFieldsI=this.encodingFieldsInf(),yField=_this$encodingFieldsI.yField,xField=_this$encodingFieldsI.xField,yFieldType=_this$encodingFieldsI.yFieldType;if(_this$encodingFieldsI.xFieldType===dist_datamodel.FieldType.MEASURE)measureIndex=fieldsConfig[xField].index,enc="x";else if(yFieldType===dist_datamodel.FieldType.MEASURE){var layerName=this.constructor.formalName();measureIndex=fieldsConfig[yField].index,enc="y",layerName===AREA_LAYER&&(enc=idx%2==0?"y":"y0")}var transformedData=[];return normalizedData.forEach(function(dataArr){dataArr.forEach(function(dataObj){var tupleArr=dataObj.source;if(identifierSchema.every(function(obj,i){return-1!==identifierData.findIndex(function(d){return tupleArr[fieldsConfig[obj.name].index]===d[i]})})){var transformedVal=dataObj[enc]||0,row=dataObj.source,tuple={};for(var key in fieldsConfig){var index=fieldsConfig[key].index;tuple[key]=row[index],index===measureIndex&&(tuple[key]=transformedVal)}transformedData.push(tuple)}})}),[transformedData,this.data().getSchema()]}},{key:"getPlotElementsFromSet",value:function getPlotElementsFromSet(set){for(var graphicElems=this._graphicElems,elems=[],i=0,len=set.length;i1&&renderer_getElementsForLine({mount:mount,data:d,strokeStyle:strokeStyle,className:".".concat(className,"-").concat(nullDataLineClass),layer:layer,linepath:linepath,transition:transition,updateFns:updateFns}),null}),elementWithNullData},line_default_config_defaultConfig={classPrefix:CLASSPREFIX,defClassName:"layer-line",className:"",interpolate:"linear",transform:{type:"group"},interaction:{fade:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},focus:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},brushStroke:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}}},crossline:!0,nearestPointThreshold:20,encoding:{color:{},x:{},y:{},strokeOpacity:{value:1},fillOpacity:{value:0},strokeWidth:{value:"2px"}},transition:{effect:"cubic",duration:1e3},connectNullData:!1,nullDataLineStyle:{},nullDataLineClass:"null"};__webpack_require__(21);function line_mixin_typeof(obj){return(line_mixin_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function line_mixin_toConsumableArray(arr){return function line_mixin_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{};return this.getDataFromEvent(config.event)}},{key:"getDataFromEvent",value:function getDataFromEvent(event){var dataPoint=renderer_utils_selectElement(event.target).data()[0];if(isSimpleObject(dataPoint)){var source=dataPoint.source,rowId=dataPoint.rowId;return{id:this.getIdentifiersFromData(source,rowId),layerId:this.id()}}return null}},{key:"translatePoints",value:function translatePoints(data){var _this2=this,_this$axes=this.axes(),angle=_this$axes.angle,colorAxis=_this$axes.color,radiusAxis=_this$axes.radius,pieIndex={},prevData=this._points[0]||[],points=[],angleV={};return this._prevPieData={},prevData.forEach(function(e,index){_this2._prevPieData[e.rowId]=[e,index],pieIndex[e.index]=e}),data.forEach(function(d,i){var angles=angle.getScaleValue(d.angle);if(angles){!angleV[d.angle]&&(angleV[d.angle]=0);var _angles=angles[angleV[d.angle]++],startAngle=_angles.startAngle,endAngle=_angles.endAngle,uid=d.rowId,resolvedEncodings=helpers_resolveEncodingValues({values:{radius:radiusAxis.getOuterRadius(d.radius),radius0:radiusAxis.getInnerRadius(d.radius0),color:colorAxis.getColor(d.color),angle0:startAngle,angle:endAngle,startAngle:startAngle,endAngle:endAngle,startAngle0:startAngle,endAngle0:endAngle},data:d},i,data,_this2),color=resolvedEncodings.color;points.push({source:d.source,index:i,enter:{},update:{angle0:resolvedEncodings.angle0,angle:resolvedEncodings.angle,radius0:resolvedEncodings.radius0,radius:resolvedEncodings.radius},color:color,meta:getColorMetaInf({fill:color}),rowId:uid,_previousInfo:_this2._prevPieData[uid]?_this2._prevPieData[uid][0]:function getPreviousPoint(prevData,currIndex,context){var prevArc=prevData[currIndex-1],nextArc=prevData[currIndex],_context$axes$angle$r2=arc_helper_slicedToArray(context.axes().angle.range(),2),startAngle=_context$axes$angle$r2[0],endAngle=_context$axes$angle$r2[1];return prevArc&&nextArc?{update:{angle0:getObjProp(prevArc,"update","angle"),angle:getObjProp(nextArc,"update","angle0")}}:nextArc?{update:{angle0:(startAngle-90)*Math.PI*2/360,angle:(startAngle-90)*Math.PI*2/360}}:{update:{angle0:(endAngle-90)*Math.PI*2/360,angle:(endAngle-90)*Math.PI*2/360}}}(pieIndex,i,_this2)})}}),points}},{key:"render",value:function render(container){var _this3=this,measurement=this.measurement(),_this$config=this.config(),classPrefix=_this$config.classPrefix,defClassName=_this$config.defClassName,cornerRadius=_this$config.cornerRadius,padAngle=_this$config.padAngle,padRadius=_this$config.padRadius,transition=_this$config.transition,qualClassName=getQualifiedClassName(defClassName,this.id(),classPrefix),path=this._arcFn=arc_mixin_arc().cornerRadius(cornerRadius).startAngle(function(d){return d.update.angle0+Math.PI/2}).endAngle(function(d){return d.update.angle+Math.PI/2}).padAngle(padAngle).padRadius(padRadius).outerRadius(function(d){return d.update.radius}).innerRadius(function(d){return d.update.radius0});this._points=this._normalizedData.map(function(arr){return _this3.translatePoints(arr)});var graphicElems=this._graphicElems={},g=makeElement(renderer_utils_selectElement(container),"g",this._points,"".concat(qualClassName[0],"-group")).classed("".concat(qualClassName[1],"-group"),!0).attr("transform","translate(".concat(measurement.width/2,",\n ").concat(measurement.height/2,")")),consecutiveExits=[],exitCounter=0;return makeElement(g,"g",function(d){return d},"".concat(qualClassName[0]),{update:function tween(elem){makeElement(elem,"path",function(d){return[d]},"".concat(qualClassName[0],"-path")).style("fill",function(d){return d.color}).each(function(d){graphicElems[d.rowId]=renderer_utils_selectElement(this)}).transition().duration(transition.duration).on("end",_this3.registerAnimationDoneHook()).attrTween("d",function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return function tweenPie(path,b){var datum=b[0];return function(t){return path(common_utils_interpolator()(datum._previousInfo,datum)(t))}}(path,params)}).attr("class",function(d,i){var individualClass=getIndividualClassName(d,i,_this3._points,_this3);return"".concat(qualClassName[0],"-path ").concat(qualClassName[1],"-path-").concat(d.index,"\n ").concat(individualClass)})},exit:function tweenExit(elem,d){var exitArr=consecutiveExits[exitCounter],oldExitCounter=exitCounter;exitArr?exitArr[exitArr.length-1].datum.index===d.index-1?exitArr.push({elem:elem,datum:d}):exitCounter++:exitArr=[{elem:elem,datum:d}],consecutiveExits[oldExitCounter]=exitArr}}).attr("class",function(d,i){return"".concat(qualClassName[0]," ").concat(qualClassName[1],"-").concat(i)}),function tweenExitPie(consecutiveExits,transition,path){consecutiveExits.length>0&&consecutiveExits.forEach(function(consecutiveExitArr){var startAngle=consecutiveExitArr[0].datum.update.angle0,endAngle=consecutiveExitArr[consecutiveExitArr.length-1].datum.update.angle,mid=2*Math.PI*startAngle/(2*Math.PI+startAngle-endAngle);consecutiveExitArr.forEach(function(e){var elem=e.elem,datum=e.datum;elem.each(function(){var gElem=renderer_utils_selectElement(this);gElem.selectAll("path").transition().duration(transition.duration).attrTween("d",function(){return function(t){return path(common_utils_interpolator()(datum,{update:{angle0:mid,angle:mid,radius:datum.radius,radius0:datum.radius0}})(t))}}).remove(),gElem.remove()})})})}(consecutiveExits,transition,path),this}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){if(!this.data())return[];var fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length),pieSlices=renderer_utils_selectElement(this.mount()).selectAll("path").data(),fieldsConfig=this.data().getFieldsConfig(),pieSliceInf=pieSlices.filter(function(tData){var source=tData.source,rowId=tData.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})})[0];if(pieSliceInf){var measurement=this.measurement(),centroid=this._arcFn.centroid(pieSliceInf);return[{x:centroid[0]+measurement.width/2,y:centroid[1]+measurement.height/2,width:2,height:2}]}return[]}}],[{key:"defaultConfig",value:function defaultConfig(){return arc_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"arc"}}]),_class}()};function arc_typeof(obj){return(arc_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function arc_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var _this=this,config=this.config(),normalizedData=this._normalizedData,className=config.className,qualifiedClassName=getQualifiedClassName(config.defClassName,this.id(),config.classPrefix);return renderer_utils_selectElement(container).classed("".concat(qualifiedClassName.join(" ")," ").concat(className),!0),this._graphicElems={},renderer_utils_createElements({data:normalizedData,append:"g",selector:"g",container:container,each:function each(dataArr,group){var node=group.node(),points=_this.translatePoints(dataArr,{},_this);renderer_utils_setStyles(node,{"text-anchor":TEXT_ANCHOR_MIDDLE}),text_renderer(node,points,{className:qualifiedClassName[0]},_this)}}),this}},{key:"getNearestPoint",value:function getNearestPoint(x,y,_ref){var event=_ref.event;return this.data()?this.getDataFromEvent(event):null}},{key:"getDataFromEvent",value:function getDataFromEvent(event){return helpers_getDataFromEvent(this,event)}}],[{key:"defaultConfig",value:function defaultConfig(){return text_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"text"}}]),_class}()};function text_typeof(obj){return(text_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function text_defineProperties(target,props){for(var i=0;i4)}(shape)?shape:common_utils_getSymbol(shape).size(size)(update);var pathEl=makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr);renderer_utils_setStyles(pathEl,style)}else d.shape="circle",createShape(d,groupElement)}(d,group),graphicElems[d.rowId]=group;var update=d.update,style=d.style;objectIterator(style,function(key){return group.style(key,style[key])}),group.attr("class",className),group.classed(d.className,!0),disabled||(group=group.transition().duration(transition.duration).on("end",layer.registerAnimationDoneHook())),group.attr("transform","translate(".concat(update.x,",").concat(update.y,")"))},exit:function exit(exitGroup){disabled?exitGroup.remove():exitGroup.transition().ease(easeFns[effect]).duration(duration).on("end",function(){return exitGroup.remove()}).style("fill-opacity",0).style("stroke-opacity",0)}},params.keyFn)},point_default_config_defaultConfig={defClassName:"layer-point",className:"",classPrefix:CLASSPREFIX,defColorStyle:"stroke",interaction:{highlight:{className:"highlight-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"center"},focusStroke:{className:"focus-stroke-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"outside"},commonDoubleStroke:{style:{stroke:"black","stroke-width":"2px"},strokePosition:"outside"},brushStroke:{className:"brush-stroke-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"outside"},doubleStroke:{style:{stroke:"black","stroke-width":"2px"},strokePosition:"outside"},fade:{style:{fill:function fill(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},focus:{style:{fill:function fill(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}}},innerPadding:.1,nearestPointThreshold:5,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},encoding:{size:{value:30},color:{},stroke:{value:"#000"},"stroke-width":{value:0},fill:{},shape:{value:"circle"},x:{},y:{},"stroke-opacity":{value:1},"fill-opacity":{value:.5},strokePosition:{value:"center"},interaction:{anchors:"highlight","persistent-anchors":"focusStroke","brush-anchors":"brushStroke"}},shapes:["circle","cross","diamond","square","star","wye","triangle"],sizes:[20,30,40,50,60,70]};__webpack_require__(25);function point_helper_slicedToArray(arr,i){return function point_helper_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function point_helper_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function point_helper_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var helper_prepareDrawingInf=function prepareDrawingInf(_ref){var data=_ref.data,datum=_ref.datum,i=_ref.i,layerInst=_ref.layerInst,xPx=_ref.xPx,yPx=_ref.yPx,axes=layerInst.axes(),shapeAxis=axes.shape,colorAxis=axes.color,sizeAxis=axes.size,shape=shapeAxis.getShape(datum.shape),size=sizeAxis.getSize(datum.size),color=colorAxis.getColor(datum.color),layerEncoding=layerInst.config().encoding,stroke=layerEncoding.stroke.value,strokeWidth=layerEncoding["stroke-width"].value,resolvedEncodings=helpers_resolveEncodingValues({values:{x:xPx,y:yPx,color:color,stroke:stroke,"stroke-width":strokeWidth,size:size,shape:shape,data:datum},data:datum},i,data,layerInst),rowId=datum.rowId,source=datum.source;shape=resolvedEncodings.shape,size=resolvedEncodings.size;var style={fill:color=resolvedEncodings.color,stroke:resolvedEncodings.stroke,"stroke-width":resolvedEncodings["stroke-width"]},pos={x:resolvedEncodings.x,y:resolvedEncodings.y};return{enter:pos,update:pos,shape:shape,source:source,rowId:rowId,style:style,data:datum.dataObj,meta:Object.assign({layerId:layerInst.id()},getColorMetaInf(style,{strokePosition:layerEncoding.strokePosition.value})),size:size}},helper_pointTranslators=function helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},COORD_TYPES.CARTESIAN,function(data,config,layerInst){for(var points=[],encoding=layerInst.config().encoding,axes=layerInst.axes(),x=encoding.x,y=encoding.y,xField=x.field,yField=y.field,fieldsConfig=layerInst.data().getFieldsConfig(),isXDim=fieldsConfig[xField]&&fieldsConfig[xField].def.type===dist_datamodel.FieldType.DIMENSION,isYDim=fieldsConfig[yField]&&fieldsConfig[yField].def.type===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_loop=function _loop(i,len){var d=data[i],_map2=point_helper_slicedToArray([ENCODING.X,ENCODING.Y].map(function(type){var value=null===d[type]?void 0:d[type],measure=type===ENCODING.X?measurement.width:measurement.height;return encoding[type].field?axes[type].getScaleValue(value):measure/2}),2),xPx=_map2[0],yPx=_map2[1];if(xPx+=offsetX,yPx+=offsetY,!isNaN(xPx)&&!isNaN(yPx)){var point=helper_prepareDrawingInf({data:data,datum:d,i:i,layerInst:layerInst,xPx:xPx,yPx:yPx});point.className=getIndividualClassName(d,i,data,layerInst),points.push(point),layerInst.cachePoint(d[key],point)}},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{};return helper_pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var seriesClassName,_this2=this,maxSize=0,config=this.config(),keys=this._transformedData.map(function(d){return d.key}),transition=config.transition,className=config.className,defClassName=config.defClassName,classPrefix=config.classPrefix,normalizedData=this._normalizedData,containerSelection=renderer_utils_selectElement(container),qualifiedClassName=getQualifiedClassName(defClassName,this.id(),classPrefix);this._points=[],this._pointMap={},containerSelection.classed(qualifiedClassName.join(" "),!0).classed(className,!0),this._points=this.generateDataPoints(normalizedData,keys),this._graphicElems={};var schema=this.data().getSchema();return makeElement(container,"g",this._points,null,{update:function update(group,points){maxSize=Math.max.apply(Math,[maxSize].concat(point_mixin_toConsumableArray(points.map(function(d){return d.size||0})))),seriesClassName="".concat(qualifiedClassName[0]),_this2.constructor.drawFn()({layer:_this2,container:group.node(),points:points,interpolate:config.interpolate,className:seriesClassName,transition:transition,keyFn:function keyFn(v){return helpers_getMarkId(v.source,schema)}})}},function(data){return data[0].rowId}),this._maxSize=2*Math.sqrt(maxSize/Math.PI),this.attachDataToVoronoi(this._points),this}},{key:"attachDataToVoronoi",value:function attachDataToVoronoi(points){helpers_attachDataToVoronoi(this._voronoi,points)}},{key:"generateDataPoints",value:function generateDataPoints(normalizedData,keys){var _this3=this,_getPlotMeasurement2=point_mixin_slicedToArray(helpers_getPlotMeasurement(this,keys),2),widthMetrics=_getPlotMeasurement2[0],heightMetrics=_getPlotMeasurement2[1],offsetXValues=widthMetrics.offsetValues||[],offsetYValues=heightMetrics.offsetValues||[];return normalizedData.map(function(dataArr,i){var measurementConf=_this3.getMeasurementConfig(offsetXValues[i],offsetYValues[i],widthMetrics.span,heightMetrics.span);return _this3.translatePoints(dataArr,measurementConf)}).filter(function(d){return d.length})}},{key:"getMeasurementConfig",value:function getMeasurementConfig(offsetX,offsetY,widthSpan,heightSpan){return{offset:{x:(offsetX||0)+widthSpan/2,y:(offsetY||0)+heightSpan/2},span:{x:widthSpan,y:heightSpan}}}},{key:"getNearestPoint",value:function getNearestPoint(x,y){var nearestPointThreshold=this.config().nearestPointThreshold,distanceLimit=Math.max(this._maxSize,nearestPointThreshold);if(!this.data())return null;var point=this._voronoi.find(x,y,distanceLimit),dimensions=point&&point.data.data.update,radius=point?Math.sqrt(point.data.data.size/Math.PI):0;if(point&&pointWithinCircle({x:dimensions.x,y:dimensions.y,r:radius+nearestPointThreshold},{x:x,y:y})){var _point$data$data=point.data.data,source=_point$data$data.source,rowId=_point$data$data.rowId;return{id:this.getIdentifiersFromData(source,rowId),dimensions:[{x:dimensions.x,y:dimensions.y,width:radius,height:radius}],layerId:this.id()}}return null}},{key:"addOverlayPath",value:function addOverlayPath(refElement,data,style,strokePosition){var pathElement,container=refElement.parentElement;if(this._overlayPath[data.rowId]?pathElement=this._overlayPath[data.rowId]:((pathElement=makeElement(container,"path",[data.update],null,{},function(d){return"".concat(d.x," ").concat(data.rowId)})).style("fill","none"),pathElement.style("fill-opacity",0),pathElement.attr("id",data.rowId),this._overlayPath[data.rowId]=pathElement),"stroke-width"===style.type){var position=strokePosition,radius=Math.sqrt(data.size/Math.PI);radius=getStrokeWidthByPosition(position,radius);var size=data.size+radius;if("string"==typeof data.shape){var path=common_utils_getSymbol(data.shape).size(size);pathElement.attr("d",path)}}var styleVal=style.value;"function"==typeof styleVal&&(styleVal=styleVal(pathElement.style(style.type)));pathElement.style(style.type,styleVal),appendElement(refElement,pathElement.node())}},{key:"removeOverlayPath",value:function removeOverlayPath(data,style){var currentPath=this._overlayPath[data.rowId];currentPath&&(currentPath.node().removeAttribute("style"),Object.keys(style).forEach(function(s){return currentPath.style(s,style[s])}),currentPath.style("fill-opacity",0))}},{key:"getBoundBoxes",value:function getBoundBoxes(){return helpers_getBoundBoxes(this._points.flat())}},{key:"applyElementStyles",value:function applyElementStyles(elem,styles,styleObj){styles.forEach(function(type){elem.select("path").style(type,styleObj[type])})}}],[{key:"defaultConfig",value:function defaultConfig(){return point_default_config_defaultConfig}},{key:"defaultPolicy",value:function defaultPolicy(conf,userConf){var config=point_mixin_get(point_mixin_getPrototypeOf(_class),"defaultPolicy",this).call(this,conf,userConf),encoding=config.encoding,transform=config.transform,colorField=encoding.color&&encoding.color.field;return colorField&&(transform.groupBy=colorField),config}},{key:"drawFn",value:function drawFn(){return point_renderer}}]),_class}()};function point_typeof(obj){return(point_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function point_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];for(var layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],radiusAxis=axes.radius,angleAxis=axes.angle,angle0Axis=axes.angle0,measurement=layerInst.measurement(),colorAxis=axes.color,angleV={},angle0V={},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],xAxis=axes.x,yAxis=axes.y,_layerInst$encodingFi=layerInst.encodingFieldsInf(),xField=_layerInst$encodingFi.xField,yField=_layerInst$encodingFi.yField,x0Field=_layerInst$encodingFi.x0Field,y0Field=_layerInst$encodingFi.y0Field,xFieldType=_layerInst$encodingFi.xFieldType,yFieldType=_layerInst$encodingFi.yFieldType,isXDim=xFieldType===dist_datamodel.FieldType.DIMENSION,isYDim=yFieldType===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_config$span=config.span,xSpan=_config$span.x,ySpan=_config$span.y,i=0,len=data.length;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];var layerRegistry=factoryObj._layerRegistry,instances=(layerDef=layerDef instanceof Array?layerDef:[layerDef]).map(function(layerObj){var layerConstructor=layerRegistry[layerObj.mark];return layerConstructor.create.apply(layerConstructor,params)});return 1===instances.length?instances[0]:instances},getLayerClass:function getLayerClass(mark){return factoryObj._layerRegistry[mark]},composeLayers:function composeLayers(layerType,layerDefs){compositeLayers[layerType]=layerDefs},sanitizeLayerConfig:function sanitizeLayerConfig(layerDef){var newConf=mergeRecursive({},layerDef);return sanitizeEncoding(newConf.encoding),newConf}};return factoryObj}();function defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_LAYERS=(defaults_defineProperty(_DEFAULT_LAYERS={},layer_types_AREA_LAYER,area_AreaLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_ARC_LAYER,ArcLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_LINE_LAYER,line_LineLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TEXT_LAYER,TextLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_POINT_LAYER,point_PointLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TICK_LAYER,TickLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BAR_LAYER,bar_BarLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BASE_LAYER,base_layer_BaseLayer),_DEFAULT_LAYERS),layer_registry=function(){var layers=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_LAYERS,reg=Object.assign({},layers),regObj={register:function register(def){var key=def.formalName();return reg[key]=def,regObj},get:function get(){return reg}};return regObj},helpers=Object.assign(helpers_namespaceObject,{pointLayerHelpers:point_helper_namespaceObject}),layerMixins={BarLayerMixin:bar_mixin_BarLayerMixin,BaseLayerMixin:base_mixin_BaseLayerMixin,LineLayerMixin:line_mixin_LineLayerMixin,AreaLayerMixin:area_mixin_AreaLayerMixin,PointLayerMixin:point_mixin_PointLayerMixin,TextLayerMixin:text_mixin_TextLayerMixin,TickLayerMixin:tick_mixin_TickLayerMixin,ArcLayerMixin:arc_mixin_ArcLayerMixin};function src_helper_slicedToArray(arr,i){return function src_helper_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function src_helper_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function src_helper_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function src_helper_toConsumableArray(arr){return function src_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=0?axisInf[key]:axisArr.length-1;axes[key]&&(axesObj[key]=defaultValue(axes[key][axisIndex]))}}),Object.keys(axesObj).length&&layer.axes(axesObj)})},helper_X=ENCODING.X,helper_Y=ENCODING.Y,helper_RADIUS=ENCODING.RADIUS,helper_ANGLE=ENCODING.ANGLE,helper_ANGLE0=ENCODING.ANGLE0,RADIUS0=ENCODING.RADIUS0,helper_getLayerAxisIndex=function getLayerAxisIndex(layers,fields){var layerAxisIndex={};return layers.forEach(function(layer){var _layer$config=layer.config(),axis=_layer$config.axis,encoding=_layer$config.encoding,id=layer.id();[helper_X,helper_Y,helper_ANGLE,helper_ANGLE0,helper_RADIUS].forEach(function(type){var index,specificField=getObjProp(encoding,type,"field"),encodingField=type===helper_RADIUS?defaultValue(specificField,getObjProp(encoding,RADIUS0,"field")):getObjProp(encoding,type,"field"),field=defaultValue(getObjProp(axis,type),encodingField);index=fields[type]&&fields[type].length?fields[type].findIndex(function(fieldInst){return-1!==fieldInst.getMembers().indexOf(field)}):0,!layerAxisIndex[id]&&(layerAxisIndex[id]={}),layerAxisIndex[id][type]=index})}),layerAxisIndex},helper_unionDomainFromLayers=function unionDomainFromLayers(layers,axisFields,layerAxisIndex,fieldsConfig){var domains={};return(layers=layers.filter(function(layer){return null!==layer.getDataDomain()})).forEach(function(layer){var domainValues={},config=layer.config(),layerDomain=layer.getDataDomain(),layerId=layer.id();null!==layerDomain&&!1!==config.calculateDomain&&(domainValues=Object.entries(layerDomain),domains=domainValues.reduce(function(fieldDomain,domain){var encodingType=domain[0],axisIndex=layerAxisIndex[layerId][encodingType],field=getObjProp(axisFields,encodingType,axisIndex);!fieldDomain[encodingType]&&(fieldDomain[encodingType]={});var encodingDomain=fieldDomain[encodingType];if(field){var fieldStr="".concat(field);encodingDomain[fieldStr]=encodingDomain[fieldStr]||[],encodingDomain[fieldStr]=function getValidDomain(domain,domain1,encodingType,fieldType){return encodingType===helper_ANGLE||encodingType===helper_ANGLE0?domain.concat(domain1.filter(function(d){return-1===domain.indexOf(d)})):unionDomain([domain,domain1],fieldType)}(encodingDomain[fieldStr],domain[1],encodingType,fieldsConfig[field.getMembers()[0]].def.subtype)}return fieldDomain},domains))}),domains},helper_renderLayers=function renderLayers(context,container,layers,measurement){context._lifeCycleManager.notify({client:layers,action:"beforedraw",formalName:"layer"});var classPrefix=context.config().classPrefix,orderedLayers=layers.sort(function(a,b){return a.config().order-b.config().order}),layerParentGroup=makeElement(container,"g",[1],"".concat(classPrefix,"-layer-group")),layerDepOrder=getDependencyOrder(context._layerDepOrder),groups={};makeElement(layerParentGroup,"g",orderedLayers,null,{update:function update(group,layer){groups[layer.alias()]={group:group,layer:layer}}}),layerDepOrder.map(function(name){return groups[name]}).filter(function(d){return void 0!==d}).forEach(function(o){var layer=o.layer,group=o.group;layer.measurement(measurement),layer.dataProps({timeDiffs:context._timeDiffs}),!1!==layer.config().render&&layer.mount(group.node())})},helper_getNearestDimensionalValue=function getNearestDimensionalValue(context,position){var fields=context.fields();if(!fields.x.length||!fields.y.length)return null;var data=context.data(),axes=context.axes(),fieldsConfig=data.getFieldsConfig(),xField=getObjProp(fields,"x",0).getMembers()[0],yField=getObjProp(fields,"y",0).getMembers()[0],xFieldType=fieldsConfig[xField].def.subtype,yFieldType=fieldsConfig[yField].def.subtype,entryVal=[["x",xFieldType,xField],["y",yFieldType,yField]].find(function(entry){return entry[1]===dist_datamodel.DimensionSubtype.CATEGORICAL||entry[1]===dist_datamodel.DimensionSubtype.TEMPORAL});if(!entryVal||xFieldType!==dist_datamodel.MeasureSubtype.CONTINUOUS&&yFieldType!==dist_datamodel.MeasureSubtype.CONTINUOUS)return null;var field=entryVal[2],index=fieldsConfig[field].index,key=axes[entryVal[0]][0].invert(position[entryVal[0]]);if(entryVal[1]===dist_datamodel.DimensionSubtype.TEMPORAL){var filterData=src_helper_toConsumableArray(new Set(data.getData().data.map(function(d){return d[index]})));key=getNearestValue(filterData,key)}return void 0!==key?[[field],[key]]:null},getLayersBy=function getLayersBy(layers,searchBy,value){return layers.filter(function(layer){return("type"===searchBy?layer.constructor.formalName():layer.alias())===value})},removeLayersBy=function removeLayersBy(layers,searchBy,value){layers.filter(function(inst){return("type"===searchBy?inst.config().mark:inst.alias())!==value||(inst.remove(),!1)})},helper_createSideEffectGroup=function createSideEffectGroup(container,className){return makeElement(container,"g",[1],className).node()},createRenderPromise=function createRenderPromise(unit){unit._renderedPromise.then(function(){unit._renderedPromise=new Promise(function(resolve){unit._renderedResolve=resolve}),createRenderPromise(unit)})},getRadiusRange=function getRadiusRange(width,height){var config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},innerRadius=config.innerRadius,outerRadius=config.outerRadius;return[innerRadius||0,outerRadius||Math.min(height,width)/2]},helper_setAxisRange=function setAxisRange(context){var radiusAxes=context.axes().radius;radiusAxes&&radiusAxes.forEach(function(axis){axis.range(getRadiusRange(context.width(),context.height()))})},helper_isXandYMeasures=function isXandYMeasures(context){var _context$fields=context.fields(),_map2=src_helper_slicedToArray([_context$fields.x,_context$fields.y].map(function(fields){return fields.every(function(field){return field.type()===dist_datamodel.FieldType.MEASURE})}),2),xMeasures=_map2[0],yMeasures=_map2[1];return xMeasures&&yMeasures},getKey=function getKey(arr,row){for(var key=row[arr[0]],i=1,len=arr.length;i0&&void 0!==arguments[0]?arguments[0]:{},set=this._set,uidMap=this._uidMap,retObj={entrySet:[[],[]],exitSet:[[],[]],mergedEnter:[],mergedExit:[],completeSet:[]},measureNames=this._measureNames,dimVals=this._dimVals,_config$keepDims=config.keepDims,keepDims=void 0!==_config$keepDims&&_config$keepDims,_config$dimensions=config.dimensions,dimensions=void 0===_config$dimensions?this._fields:_config$dimensions,fieldIndices=this._fieldIndices,_loop=function _loop(key){var val=void 0,measureNamesArr=measureNames[key]||[],dims=dimVals[key];keepDims?measureNamesArr.length?(dims=dimensions.map(function(d){return dims[fieldIndices[d]]}),val=dims.length?[].concat(selection_set_toConsumableArray(dims),["".concat(measureNamesArr)]):[uidMap[key],"".concat(measureNamesArr)]):val=dims.length?selection_set_toConsumableArray(dims):[uidMap[key]]:val=measureNamesArr.length?[uidMap[key],measureNames[key],dims]:[uidMap[key]],set[key]>0?([SELECTION_OLD_ENTRY,SELECTION_NEW_ENTRY].forEach(function(v,i){set[key]===v&&retObj.entrySet[i].push(val)}),set[key]!==SELECTION_OLD_ENTRY&&set[key]!==SELECTION_NEW_ENTRY||retObj.mergedEnter.push(val)):set[key]<0&&([SELECTION_OLD_EXIT,SELECTION_NEW_EXIT].forEach(function(v,i){set[key]===v&&retObj.exitSet[i].push(val)}),set[key]!==SELECTION_OLD_EXIT&&set[key]!==SELECTION_NEW_EXIT||retObj.mergedExit.push(val)),retObj.completeSet.push(val)};for(var key in set)_loop(key);return retObj}},{key:"reset",value:function reset(ids){var set=this._set;if(ids)ids.forEach(function(i){i in set&&(set[i]=SELECTION_NULL)});else for(var key in set)set[key]=SELECTION_NULL;return this._resetted=!0,this}},{key:"getEntrySet",value:function getEntrySet(){var set=this._set,addSet=[];for(var key in set)set[key]===SELECTION_NEW_ENTRY&&addSet.push(key);return addSet}},{key:"getExistingEntrySet",value:function getExistingEntrySet(addSet){var set=this._set;return addSet.filter(function(d){return set[d]===SELECTION_NEW_ENTRY||set[d]===SELECTION_OLD_ENTRY})}},{key:"getExistingExitSet",value:function getExistingExitSet(removeSet){var set=this._set;return removeSet.filter(function(d){return set[d]===SELECTION_NEW_EXIT||set[d]===SELECTION_OLD_EXIT})}},{key:"getOldEntry",value:function getOldEntry(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_ENTRY&&updateSet.push(key);return updateSet}},{key:"getOldExit",value:function getOldExit(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_EXIT&&updateSet.push(key);return updateSet}},{key:"getExitSet",value:function getExitSet(){var set=this._set,removeSet=[];for(var key in set)set[key]===SELECTION_NEW_EXIT&&removeSet.push(key);return removeSet}},{key:"getCompleteSet",value:function getCompleteSet(){var set=this._set,completeSet=[];for(var key in set)completeSet.push(key);return completeSet}},{key:"getCompleteSetCount",value:function getCompleteSetCount(){return this._completeSetCount}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"toggle",value:function toggle(){var set=this._set;for(var key in set)set[key]===SELECTION_NEW_ENTRY?set[key]=SELECTION_NEW_EXIT:set[key]===SELECTION_NEW_EXIT?set[key]=SELECTION_NEW_ENTRY:set[key]===SELECTION_OLD_ENTRY?set[key]=SELECTION_OLD_EXIT:set[key]=SELECTION_OLD_ENTRY;return this}},{key:"getMergedEntrySet",value:function getMergedEntrySet(raw){var set=this._set,mergedEnter=[],uidMap=this._uidMap,measureNames=this._measureNames,dimVals=this._dimVals;for(var key in set){var val=raw?[].concat(selection_set_toConsumableArray(dimVals[key]),["".concat(measureNames[key])]):[uidMap[key],measureNames[key]];set[key]!==SELECTION_NEW_ENTRY&&set[key]!==SELECTION_OLD_ENTRY||mergedEnter.push(val)}return mergedEnter}},{key:"getMergedExitSet",value:function getMergedExitSet(raw){var set=this._set,mergedExit=[],uidMap=this._uidMap,measureNames=this._measureNames,dimVals=this._dimVals;for(var key in set){var val=raw?[].concat(selection_set_toConsumableArray(dimVals[key]),["".concat(measureNames[key])]):[uidMap[key],measureNames[key]];set[key]!==SELECTION_NEW_EXIT&&set[key]!==SELECTION_OLD_EXIT||mergedExit.push(val)}return mergedExit}}]),SelectionSet}();function muze_firebolt_src_helper_toConsumableArray(arr){return function muze_firebolt_src_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i3&&void 0!==arguments[3]?arguments[3]:{},sideEffect=this.sideEffects()[name],setTransform=options.setTransform;selectionSet=setTransform?setTransform(selectionSet,payload,sideEffect):selectionSet,sideEffect.apply(selectionSet,payload,options)}},{key:"registerPropagationBehaviourMap",value:function registerPropagationBehaviourMap(map){return this._propagationBehaviourMap=Object.assign(this._propagationBehaviourMap,map||{}),this}},{key:"dispatchBehaviour",value:function dispatchBehaviour(behaviour,payload){var propagationInfo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};payload=this.sanitizePayload(payload);var propagate=void 0===propagationInfo.propagate||propagationInfo.propagate,action=this._actions.behavioural[behaviour],behaviourEffectMap=this._behaviourEffectMap,sideEffects=getSideEffects(behaviour,behaviourEffectMap);if(this._propagationInf=propagationInfo,this._payloads[behaviour]=payload,action){action.dispatch(payload),this._entryExitSet[behaviour]=action.entryExitSet();var shouldApplySideEffects=this.shouldApplySideEffects(propagationInfo);if(propagate&&this.propagate(behaviour,payload,action.propagationIdentifiers(),{sideEffects:sideEffects}),shouldApplySideEffects){var applicableSideEffects=this.getApplicableSideEffects(sideEffects,payload,propagationInfo);this.applySideEffects(applicableSideEffects,this.getEntryExitSet(behaviour),payload)}}return this}},{key:"getPropagationSelectionSet",value:function getPropagationSelectionSet(selectionSet){return selectionSet.find(function(d){return!d.sourceSelectionSet})}},{key:"shouldApplySideEffects",value:function shouldApplySideEffects(){return!0}},{key:"changeBehaviourStateOnPropagation",value:function changeBehaviourStateOnPropagation(behaviour,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",behaviourConditions=this._behaviourPolicies[behaviour]||(this._behaviourPolicies[behaviour]={});return value instanceof Function?behaviourConditions[key]=value:behaviourConditions[key]=function(){return value},this}},{key:"changeSideEffectStateOnPropagation",value:function changeSideEffectStateOnPropagation(sideEffect,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",sideEffectConditions=this._sideEffectPolicies[sideEffect]||(this._sideEffectPolicies[sideEffect]={});value instanceof Function?sideEffectConditions[key]=value:sideEffectConditions[key]=function(){return value}}},{key:"removeSideEffectPolicy",value:function removeSideEffectPolicy(sideEffect,key){return delete this._sideEffectPolicies[sideEffect][key],this}},{key:"removeBehaviourPolicy",value:function removeBehaviourPolicy(behaviour,key){return delete this._behaviourPolicies[behaviour][key],this}},{key:"propagate",value:function propagate(){return this}},{key:"sideEffects",value:function sideEffects(){return arguments.length?(this._sideEffects=arguments.length<=0?void 0:arguments[0],this):this._sideEffects}},{key:"enableSideEffects",value:function enableSideEffects(fn){return changeSideEffectAvailability(this,fn,!0),this}},{key:"disableSideEffects",value:function disableSideEffects(fn){return changeSideEffectAvailability(this,fn,!1),this}},{key:"dissociateBehaviour",value:function dissociateBehaviour(behaviour,physicalAction){var actionBehaviourMap=this._actionBehaviourMap;for(var key in actionBehaviourMap)if(key===physicalAction){var behaviourMap=actionBehaviourMap[key];behaviourMap.behaviours=behaviourMap.behaviours.filter(function(d){return d!==behaviour}),this.mapActionsAndBehaviour(key)}return this}},{key:"dissociateSideEffect",value:function dissociateSideEffect(sideEffect,behaviour){var behaviourEffectMap=this._behaviourEffectMap;return behaviourEffectMap[behaviour]=behaviourEffectMap[behaviour].filter(function(d){return(d.name||d)!==sideEffect}),this}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects){return sideEffects}},{key:"attachPropagationListener",value:function attachPropagationListener(dataModel){var handler=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.onDataModelPropagation();return dataModel.unsubscribe("propagation"),dataModel.on("propagation",handler),this}},{key:"onDataModelPropagation",value:function onDataModelPropagation(){var _this2=this;return function(propValue){var payload=propValue.payload,action=payload.action;_this2.dispatchBehaviour(action,payload,{propagate:!1})}}},{key:"createSelectionSet",value:function createSelectionSet(uniqueIds,behaviouralActions){var behaviours=behaviouralActions||this._actions.behavioural,selectionSet=this._selectionSet,volatileSelectionSet=this._volatileSelectionSet;for(var key in behaviours)({}).hasOwnProperty.call(behaviours,key)&&(selectionSet[key]=new src_selection_set(uniqueIds),volatileSelectionSet[key]=new src_selection_set(uniqueIds,!0),this._entryExitSet[key]=null);return this._volatileSelectionSet=volatileSelectionSet,this.selectionSet(selectionSet),this}},{key:"selectionSet",value:function selectionSet(){return arguments.length?(this._selectionSet=arguments.length<=0?void 0:arguments[0],this):this._selectionSet}},{key:"initializeSideEffects",value:function initializeSideEffects(){var sideEffectDefinitions=this._sideEffectDefinitions;return this.sideEffects(function initializeSideEffects(context,sideEffects){var sideEffectsMap=context._sideEffects;return(sideEffects=sideEffects instanceof Array?sideEffects:Object.values(sideEffects)).forEach(function(SideEffect){var formalName=SideEffect.formalName(),target=SideEffect.target();if(target===context.target()||"all"===target){var sideEffectInstance=sideEffectsMap[formalName];sideEffectsMap[formalName]=sideEffectInstance||new SideEffect(context)}}),sideEffectsMap}(this,sideEffectDefinitions)),this}},{key:"target",value:function target(){return"all"}},{key:"registerPhysicalActions",value:function registerPhysicalActions(actions){var initedActions=function initializePhysicalActions(context,actions){var physicalActions={};for(var name in actions)({}).hasOwnProperty.call(name,actions)||(physicalActions[name]=actions[name](context));return physicalActions}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,actions);return Object.assign(this._actions.physical,initedActions),this}},{key:"propagateWith",value:function propagateWith(action,fields){var append=arguments.length>2&&void 0!==arguments[2]&&arguments[2],behaviouralActions=this._actions.behavioural;if(action===ALL_ACTIONS)for(var key in behaviouralActions)this._propagationFields[key]={fields:fields,append:append};else this._propagationFields[action]={fields:fields,append:append};return this}},{key:"mapActionsAndBehaviour",value:function mapActionsAndBehaviour(phyAction){var initedPhysicalActions=this._actions.physical,map=this._actionBehaviourMap;for(var action in map)if(!{}.hasOwnProperty.call(action,map)&&action===(phyAction||action)){var target=void 0,mapObj=map[action];target=mapObj.target;var touch=mapObj.touch;target||(target=this.context.getDefaultTargetContainer()),(hasTouch()?!0===touch||void 0===touch:!touch)&&this.bindActionWithBehaviour(initedPhysicalActions[action],target,mapObj.behaviours)}return this.registerPhysicalActionHandlers(),this}},{key:"registerPhysicalBehaviouralMap",value:function registerPhysicalBehaviouralMap(map){return this._actionBehaviourMap=mergeRecursive(this._actionBehaviourMap,map),this}},{key:"bindActionWithBehaviour",value:function bindActionWithBehaviour(action,targets,behaviourList){var _this3=this;return"string"==typeof targets&&(targets=[targets]),targets.forEach(function(target){var mount=_this3.context.mount(),nodes=target.node instanceof Function?target:renderer_utils_selectElement(mount).selectAll(target);nodes.empty()||(nodes instanceof Array?nodes.forEach(function(node){action(renderer_utils_selectElement(node),behaviourList)}):action(nodes,behaviourList))}),this}},{key:"getPropagationInf",value:function getPropagationInf(){return this._propagationInf}},{key:"getAddSetFromCriteria",value:function getAddSetFromCriteria(criteria){var propagationInf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{model:propagationInf.data?propagationInf.data:null,uids:criteria?firebolt_getKeysFromCriteria(criteria,this):null}}},{key:"getSelectionSets",value:function getSelectionSets(action){var sourceId=this.id(),propagationSource=(this._propagationInf||{}).sourceId,applicableSelectionSets=[];return propagationSource!==sourceId&&(applicableSelectionSets=[this._volatileSelectionSet[action]]),propagationSource&&applicableSelectionSets.push(this.selectionSet()[action]),applicableSelectionSets}},{key:"getFullData",value:function getFullData(){return this.context.data()}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"getEntryExitSet",value:function getEntryExitSet(behaviour){return this._entryExitSet[behaviour]}},{key:"mergeSelectionSets",value:function mergeSelectionSets(behaviours){return helper_unionSets(this,behaviours)}},{key:"data",value:function data(){return this.context.data()}},{key:"triggerPhysicalAction",value:function triggerPhysicalAction(event,payload){var handlers=this._handlers[event]||[],genericHandlers=this._handlers["*"];return[].concat(firebolt_toConsumableArray(Object.values(handlers)),firebolt_toConsumableArray(Object.values(genericHandlers))).forEach(function(fn){fn(event,payload)}),this}},{key:"onPhysicalAction",value:function onPhysicalAction(event,fn,namespace){return!this._handlers[event]&&(this._handlers[event]={}),this._handlers[event][namespace]=fn,this}},{key:"registerPhysicalActionHandlers",value:function registerPhysicalActionHandlers(){var _this4=this;this.onPhysicalAction("*",function(event,payload){_this4._actionBehaviourMap[event].behaviours.forEach(function(beh){return _this4.dispatchBehaviour(beh,payload)})})}},{key:"id",value:function id(){return this.context.id()}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(){var _this$context;return(_this$context=this.context).getRangeFromIdentifiers.apply(_this$context,arguments)}},{key:"sanitizePayload",value:function sanitizePayload(payload){return payload}},{key:"payloadGenerators",value:function payloadGenerators(){return arguments.length&&Object.assign(this._payloadGenerators,arguments.length<=0?void 0:arguments[0]),this._payloadGenerators}},{key:"getPayloadGeneratorFor",value:function getPayloadGeneratorFor(action){var defaultFn=this._payloadGenerators.__default,fn=this._payloadGenerators[action];return defaultValue(fn,defaultFn)}},{key:"getPayload",value:function getPayload(action){return this._payloads[action]}},{key:"actions",value:function actions(){return this._actions}}]),Firebolt}();function generic_toConsumableArray(arr){return function generic_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},sourceIdentifiers=propagationInf.sourceIdentifiers;return sourceIdentifiers?sourceIdentifiers.fields.map(function(d){return d.name}):criteria instanceof Array?criteria[0]:Object.keys(criteria||{})}(propagationInf,payload.criteria)},this}return this._entryExitSet}},{key:"getSetInfo",value:function getSetInfo(type,set,filteredDataModel,setFields){var model=null,data=this.firebolt.data();if("mergedEnter"===type)model=filteredDataModel||null;else if("mergedExit"===type){if(filteredDataModel){var setKeys=new Set(set.map(function(d){return d[0]}));model=data.select(function(fields,i){return setKeys.has(setFields.map(function(field){return field===reserved_fields.ROW_ID?i:fields[field].value}))},{saveChild:!1})}model=filteredDataModel||null}var aggFns=common_utils_retrieveNearestGroupByReducers(model);return{uids:set,length:set.length,model:model,fields:setFields,aggFns:aggFns}}},{key:"propagationIdentifiers",value:function propagationIdentifiers(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(params.length){var propData=null,selectionSet=params[0],payload=params[1],fieldsConfig=this.firebolt.data().getFieldsConfig(),criteria=payload.criteria,propagationFields=this._propagationFields;if(selectionSet.resetted()||null===criteria)propData=null;else if(isSimpleObject(criteria)){var fields=Object.keys(criteria),otherFields=generic_slicedToArray(partition(fields,function(d){return fieldsConfig[d]?fieldsConfig[d].def.subtype===dist_datamodel.DimensionSubtype.CATEGORICAL:d===reserved_fields.MEASURE_NAMES}),2)[1],allFields=selectionSet._fields.filter(function(d){return d===reserved_fields.ROW_ID||fieldsConfig[d].def.subtype===dist_datamodel.DimensionSubtype.CATEGORICAL}),mergedEnter=selectionSet.getSets({keepDims:!0,dimensions:allFields}).mergedEnter;propData={fields:fields.map(function(d){return fieldsConfig[d]?fieldsConfig[d].def:{name:d}}),range:this.firebolt.getRangeFromIdentifiers({criteria:criteria,entrySet:mergedEnter,fields:otherFields}),identifiers:[[].concat(generic_toConsumableArray(allFields),[reserved_fields.MEASURE_NAMES])].concat(generic_toConsumableArray(mergedEnter))}}else{var _mergedEnter=selectionSet.getSets({keepDims:!0,dimensions:propagationFields}).mergedEnter,_fields=propagationFields?[].concat(generic_toConsumableArray(propagationFields),[reserved_fields.MEASURE_NAMES]):criteria[0];propData={fields:_fields.map(function(d){return fieldsConfig[d]?fieldsConfig[d].def:{name:d}}),identifiers:[_fields].concat(generic_toConsumableArray(_mergedEnter))}}return this._propagationIdentifiers=propData,this}return this._propagationIdentifiers}},{key:"enable",value:function enable(){this._enabled=!0}},{key:"disable",value:function disable(){this._enabled=!1}},{key:"isEnabled",value:function isEnabled(){return this._enabled}},{key:"propagateWith",value:function propagateWith(){return this._propagationFields=arguments.length<=0?void 0:arguments[0],this}}],[{key:"mutates",value:function mutates(){return!1}}]),GenericBehaviour}();function volatile_typeof(obj){return(volatile_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function volatile_defineProperties(target,props){for(var i=0;iendPos.x&&(newStartPos.x=endPos.x,newEndPos.x=startPos.x),startPos.y>endPos.y){var y=startPos.y;newStartPos.y=endPos.y,newEndPos.y=y}var payload=drag_action_config(firebolt,{startPos:newStartPos,endPos:newEndPos});payload.dragging=!0,payload.dragDiff=Math.abs(startPos.x-endPos.x)+Math.abs(startPos.y-endPos.y),firebolt.triggerPhysicalAction(action,payload)}}).on("end",function(){var event=renderer_utils_getEvent();endPos={x:event.x,y:event.y};var duration=(new Date).getTime()-touchStart;if(!(touch&&duration>100&&Math.abs(startPos.x-endPos.x)<=5)){if(endPos.x=Math.max(0,Math.min(endPos.x,drawingInf.width)),endPos.y=Math.max(0,Math.min(endPos.y,drawingInf.height)),startPos.x>endPos.x){var x=startPos.x;startPos.x=endPos.x,endPos.x=x}if(startPos.y>endPos.y){var y=startPos.y;startPos.y=endPos.y,endPos.y=y}var payload=drag_action_config(firebolt,{startPos:startPos,endPos:endPos});payload.dragEnd=!0,firebolt.triggerPhysicalAction(action,payload)}}))},physical_hover=function hover(firebolt){return function(targetEl){var dispatchBehaviour=function dispatchBehaviour(args){var event=renderer_utils_getEvent(),context=firebolt.context,mode=context.config().interaction.tooltip.mode,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{getAllPoints:!0,data:args,event:event}),payload={criteria:nearestPoint?nearestPoint.id:null,getAllPoints:!1,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos,mode:mode};firebolt.triggerPhysicalAction(HOVER,payload),event.stopPropagation()};targetEl.on("mouseover",dispatchBehaviour).on("mousemove",dispatchBehaviour).on("mouseout",function(){firebolt.triggerPhysicalAction(HOVER,{criteria:null})})}},helpers_generatePayloadFromEvent=function generatePayloadFromEvent(args,event,firebolt){var context=firebolt.context,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event.touches?event.touches[0]:event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{data:args,event:event});return{criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos}},physical_click=function click(firebolt){return function(targetEl){targetEl.on("click",function dispatchBehaviour(args){var event=renderer_utils_getEvent(),payload=helpers_generatePayloadFromEvent(args,event,firebolt);firebolt.triggerPhysicalAction(CLICK,payload),event.stopPropagation()})}};function physical_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var physicalActions=(physical_defineProperty(_physicalActions={},DRAG,function drag(firebolt){return function(targetEl){drag_event_attachDragEvent(targetEl,DRAG,firebolt)}}),physical_defineProperty(_physicalActions,HOVER,physical_hover),physical_defineProperty(_physicalActions,CLICK,physical_click),physical_defineProperty(_physicalActions,LONGTOUCH,function longtouch(firebolt){return function(targetEl){var event,touchEnd;touchEnd=!1,event=renderer_utils_getEvent(),targetEl.on("touchstart",function(args){event=renderer_utils_getEvent(),touchEnd=!1,setTimeout(function(){touchEnd?firebolt.triggerPhysicalAction(LONGTOUCH,{criteria:null}):function dispatchBehaviour(args){var payload=helpers_generatePayloadFromEvent(args,event,firebolt);firebolt.triggerPhysicalAction(LONGTOUCH,payload),event.stopPropagation()}(args)},100)}).on("touchend",function(){touchEnd=!0})}}),physical_defineProperty(_physicalActions,TOUCHDRAG,function touchdrag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt,!0)}}),_physicalActions),side_effects_ANCHORS="anchors",side_effects_TOOLTIP="tooltip",side_effects_BRUSH_ANCHORS="brush-anchors",side_effects_PERSISTENT_ANCHORS="persistent-anchors",side_effects_FILTER="filter",side_effects_HIGHLIGHTER="highlighter",CROSSLINE="crossline",FRAGMENTED_TOOLTIP="fragmented-tooltip",AXIS_LABEL_HIGHLIGHTER="axis-label-highlighter",generic_props_PROPS={valueParser:{defaultValue:function defaultValue(val){return val}}};function generic_sideeffect_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},layers=arguments.length>2?arguments[2]:void 0,interactionType=config.interactionType,apply=config.apply,_config$reset=config.reset,reset=void 0!==_config$reset&&_config$reset;return(layers||this.firebolt.context.layers()).forEach(function(layer){if(!1!==layer.config().interactive){var layerFields=layer.data().getFieldsConfig(),filteredUids=set.uids.filter(function(_ref){var _ref2$=surrogate_slicedToArray(_ref,2)[1];return(void 0===_ref2$?[]:_ref2$).every(function(m){return m in layerFields})}).map(function(d){return d[0]}),options={apply:apply,reset:reset,styles:null};layer.applyInteractionStyle(interactionType,filteredUids,options)}}),this}}]),SurrogateSideEffect}();function spawnable_typeof(obj){return(spawnable_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function spawnable_defineProperties(target,props){for(var i=0;i=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(firebolt,{startPos:{x:x,y:y},endPos:{x:x2,y:y2}});onDrag(payload)}}).on("end",function(){var width=drawingInf.width,height=drawingInf.height,x=Math.min(width-subject.width,Math.max(subject.x,0)),y=Math.min(height-subject.height,Math.max(subject.y,0)),y2=y+subject.height,x2=x+subject.width;if(x>=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(firebolt,{startPos:{x:x,y:y},endPos:{x:x2,y:y2}});payload.dragEnd=!0,onDrag(payload)}}))}}(firebolt)(renderer_utils_selectElement(this),["brush"],sideEffect)}).merge(selection).each(function(attrs){var element=renderer_utils_selectElement(this);for(var key in transition&&(element=element.transition().duration(transition.duration)),attrs)({}).hasOwnProperty.call(attrs,key)&&isValidValue(attrs[key])&&element.attr(key,attrs[key])}),boxClassName=getQualifiedClassName(boxConf.defClassName,this._id,classPrefix);return selectionBox.classed(boxClassName.join(" "),!0),selectionBox.classed(boxConf.className,!0),this}},{key:"hide",value:function hide(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!1)}},{key:"show",value:function show(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!0)}}],[{key:"defaultConfig",value:function defaultConfig(){return{defClassName:"selection-box-group",className:"",classPrefix:"muze",box:{defClassName:"selection-box",className:""},transition:{duration:200},persistent:!1}}},{key:"formalName",value:function formalName(){return"selectionBox"}}]),SelectionBox}(),src_default_config_defaultConfig={classPrefix:"muze",defClassName:"tooltip-box",parentClassName:"tooltip-parent-container",connectorClassName:"tooltip-connectors",className:"",row:{margin:0},spacing:5,content:{spacing:5,iconContainerSize:10,iconScale:1,iconShape:"circle",iconColor:"#ff0000",rowMargin:"4px 0 4px 0",margin:10,separator:":",className:"tooltip-content-container",parentClassName:"tooltip-content-parent-container"},arrow:{size:10,disabled:!1,defClassName:"tooltip-arrow",className:"",color:"rgba(195,195,195,0.85)"}};__webpack_require__(28);function content_defineProperties(target,props){for(var i=0;i0?(this._config=mergeRecursive(this._config,arguments.length<=0?void 0:arguments[0]),this):this._config}},{key:"update",value:function update(item){return this._model=item.model,this._formatter=item.formatter,this}},{key:"context",value:function context(ctx){return this._context=ctx,this}},{key:"render",value:function render(mount){var data,config=this._config,iconContainerSize=config.iconContainerSize,formatter=this._formatter,rowMargin=config.rowMargin,model=this._model,classPrefix=config.classPrefix;if(this._mount=mount,(data=model instanceof Array?model:formatter(this._model,this.config(),this._context))instanceof Function){makeElement(mount,"div",[1],"".concat(classPrefix,"-tooltip-html-container")).html(data())}else{var content=data,displayFormat="default";isSimpleObject(data)&&(content=data.content,displayFormat=data.displayFormat);var body=makeElement(mount,"div",[displayFormat],"".concat(classPrefix,"-tooltip-content"),{},function(d){return d});if("table"===displayFormat){var table=makeElement(body,"table",[1],"".concat(classPrefix,"-tooltip-table")),tbody=makeElement(table,"tbody",[1],"".concat(classPrefix,"-tooltip-table-tbody")),rows=makeElement(tbody,"tr",content,"".concat(classPrefix,"-tooltip-table-row"));rows.each(function(d,i){renderer_utils_selectElement(this).classed("".concat(classPrefix,"-tooltip-table-row-").concat(i),!0)}),makeElement(rows,"td",function(d){return d},"".concat(classPrefix,"-tooltip-table-cell")).each(function(d){renderer_utils_selectElement(this).html(d)})}else{var _rows=makeElement(body,"div",content,"",{update:function update(elem,elemData){return elem.attr("class",elemData.className)}}),_cells=makeElement(_rows,"span",function(d){return d.data},"".concat(classPrefix,"-tooltip-content"));_cells.attr("class","".concat(classPrefix,"-tooltip-content")),renderer_utils_setStyles(_rows,{margin:rowMargin}),renderer_utils_setStyles(_cells,{display:"inline-block"}),_cells.each(function(d){var el=renderer_utils_selectElement(this);if(el.html(""),d instanceof Object)if("icon"===d.type){var svg=makeElement(el,"svg",[1]),path=makeElement(svg,"path",[1]),shape=d.shape instanceof Function?d.shape:common_utils_getSymbol(d.shape);renderer_utils_setAttrs(svg,{x:0,y:0,width:iconContainerSize,height:iconContainerSize}),renderer_utils_setAttrs(path,{d:shape.size(d.size)(),transform:"translate(".concat(iconContainerSize/2,", ").concat(iconContainerSize/2,")")}),renderer_utils_setStyles(path,{fill:d.color}),renderer_utils_setStyles(svg,{width:"".concat(iconContainerSize,"px"),height:"".concat(iconContainerSize,"px")})}else el.html(d.value),d.className&&el.classed(d.className,!0),renderer_utils_setStyles(el,d.style);else el.html(d)})}}return this}},{key:"clear",value:function clear(){return this._model=null,this}}],[{key:"defaultConfig",value:function defaultConfig(){var config=src_default_config_defaultConfig.content;return config.classPrefix=src_default_config_defaultConfig.classPrefix,config}}]),Content}();function tooltip_defineProperties(target,props){for(var i=0;i0){var defConf=mergeRecursive({},this.constructor.defaultConfig());return this._config=mergeRecursive(defConf,arguments.length<=0?void 0:arguments[0]),this}return this._config}},{key:"addClass",value:function addClass(className){return this._tooltipContainer.classed(className,!0),this}},{key:"context",value:function context(){return arguments.length?(this._context=arguments.length<=0?void 0:arguments[0],this):this._context}},{key:"content",value:function content(name,data){var contentConfig=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},config=this.config(),classPrefix=config.classPrefix,contentClass=config.content.className,formatter=config.formatter,className="".concat(classPrefix,"-").concat(contentClass,"-").concat(name),specificClass="".concat(classPrefix,"-").concat(contentConfig.className),content=this._contents[name]=this._contents[name]||new content_Content,container=makeElement(this._contentContainer,"div",[contentConfig.order],className);container.attr("class","".concat(classPrefix,"-").concat(contentClass," ").concat(className," ").concat(specificClass)),function reorderContainers(parentContainer,className){parentContainer.selectAll(className).sort(function(a,b){return a-b})}(this._contentContainer,".".concat(classPrefix,"-").concat(contentClass));var contentConf=config.content;return contentConfig.classPrefix=this._config.classPrefix,content.config(contentConf),null===data?(content.clear(),container.remove(),delete this._contents[name]):(content.update({model:data,formatter:contentConfig.formatter||formatter}),content.context(this._context),content.render(container)),Object.keys(this._contents).length||this.hide(),this}},{key:"getContents",value:function getContents(){return Object.values(this._contents)}},{key:"position",value:function position(x,y){if(!Object.keys(this._contents).length)return this.hide(),this;this.show();var target=this._target;if(target){var node=this._tooltipContainer.node(),tooltipPos=this._orientation;if("left"===tooltipPos||"right"===tooltipPos?y+node.offsetHeighttarget.y+target.height:x+node.offsetWidthtarget.x+target.width){var path;this._tooltipConnectorContainer.style("display","block");var connector=this._tooltipConnectorContainer.selectAll("path").data([1]),enter=connector.enter().append("path");"left"===tooltipPos?path="M ".concat(x," ").concat(y+node.offsetHeight/2," L ").concat(target.x+target.width)+" ".concat(target.y+target.height/2):"right"===tooltipPos?path="M ".concat(x+node.offsetWidth," ").concat(y+node.offsetHeight/2)+" L ".concat(target.x," ").concat(target.y+target.height/2):"bottom"===tooltipPos&&(path="M ".concat(x+node.offsetWidth/2," ").concat(y+node.offsetHeight)+" L ".concat(target.x+target.width/2," ").concat(target.y)),enter.merge(connector).attr("d",path).style("display","block")}else this._tooltipConnectorContainer.style("display","none")}var offset=this._offset||{x:0,y:0};return this._tooltipContainer.style("left","".concat(offset.x+x,"px")).style("top","".concat(offset.y+y,"px")),this}},{key:"positionRelativeTo",value:function positionRelativeTo(dim){var obj,tooltipConf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},orientation=tooltipConf.orientation;if(this.show(),!dim)return this.hide(),this;var extent=this._extent,contentContainer=this._contentContainer.node();this._tooltipContainer.style("top","0px").style("left","0px").style("width","2000px").style("height","2000px");var offsetWidth=contentContainer.offsetWidth+4,offsetHeight=contentContainer.offsetHeight+4,config=this._config,offset=this._offset,spacing=config.spacing,draw=void 0===tooltipConf.draw||tooltipConf.draw,topSpace=dim.y,dimX=dim.x+dim.width+offset.x,rightSpace=extent.width-dimX,leftSpace=dim.x+offset.x-extent.x,bottomSpace=extent.height-(dim.y+dim.height+offset.y),arrowSize=spacing,tooltipHeight=offsetHeight+arrowSize,tooltipWidth=offsetWidth+arrowSize,spaces=[{position:"top",value:topSpace-tooltipHeight},{position:"right",value:rightSpace-tooltipWidth},{position:"left",value:leftSpace-tooltipWidth},{position:"bottom",value:bottomSpace-tooltipHeight}],positionHorizontal=function positionHorizontal(positionVal){var position,x=dim.x+dim.width,y=dim.y;return"right"===positionVal?(position="left",x+=arrowSize):"left"===positionVal&&(x=dim.x-offsetWidth,position="right",x-=arrowSize),dim.height0?positionHorizontal(hMax.position):positionVertical(vMax.position);return this._position={x:obj.x,y:obj.y},this._tooltipContainer.style("height","".concat(offsetHeight,"px")).style("width","".concat(offsetWidth,"px")),this._orientation=obj.position,draw&&this.position(obj.x,obj.y),this}},{key:"hide",value:function hide(){return this._tooltipContainer.style("display","none"),this._tooltipConnectorContainer.style("display","none"),this}},{key:"show",value:function show(){return this._tooltipContainer.style("display","block"),this}},{key:"extent",value:function extent(_extent){return this._extent=_extent,this}},{key:"offset",value:function offset(_offset){return this._offset=_offset,this}},{key:"remove",value:function remove(){return this._tooltipContainer.remove(),this._tooltipConnectorContainer.remove(),this}}],[{key:"defaultConfig",value:function defaultConfig(){return src_default_config_defaultConfig}}]),Tooltip}(),HIGHLIGHT_SUMMARY="highlightSummary";function strategies_construct(Parent,args,Class){return(strategies_construct=function strategies_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&strategies_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function strategies_setPrototypeOf(o,p){return(strategies_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function strategies_toConsumableArray(arr){return function strategies_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1;hasMultipleMeasures&&content.push({data:[icon,formattedRetinalValue]});var isSelected=(target&&target[1][target[0].indexOf(retField)])===retinalFieldValue;measuresArr.forEach(function(measure){var measureIndex=fieldsConfig[measure].index,_fieldInf$measure=fieldInf[measure],dName=_fieldInf$measure.displayName,formatterFn=_fieldInf$measure.fn,currentMeasureValue=valueArr[measureIndex],value=formatterFn(currentMeasureValue),keyValue=strategies_getKeyValue({field:hasMultipleMeasures?"".concat(dName).concat(separator):formattedRetinalValue,value:value,classPrefix:classPrefix,margin:hasMultipleMeasures?margin:void 0,isSelected:isSelected,stackedSum:stackedSum,stackedValue:currentMeasureValue instanceof strategies_InvalidAwareTypes?currentMeasureValue.value():currentMeasureValue.toFixed(2),isStackedBar:isStackedBar});hasMultipleMeasures||(keyValue.data=[icon].concat(strategies_toConsumableArray(keyValue.data))),content.push(keyValue)})}};for(var retField in retinalFields)_loop(retField)},strategies_buildTooltipData=function buildTooltipData(dataModel){var nestedDataObj,displayFormat,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=arguments.length>2?arguments[2]:void 0,fieldValues=[],_dataModel$getData=dataModel.getData(),data=_dataModel$getData.data,schema=_dataModel$getData.schema,fieldspace=dataModel.getFieldspace(),fieldsConfig=dataModel.getFieldsConfig(),_context$retinalField=context.retinalFields,color=_context$retinalField.color,shape=_context$retinalField.shape,size=_context$retinalField.size,detailFields=context.detailFields||[],_ref2$showStackSum=(context.config||{}).showStackSum,showStackSum=void 0===_ref2$showStackSum||_ref2$showStackSum,_context$payload$sele=context.payload.selectedMeasures,selectedMeasures=void 0===_context$payload$sele?[]:_context$payload$sele,dimensions=schema.filter(function(d){return d.type===dist_datamodel.FieldType.DIMENSION}),measures=schema.filter(function(d){return d.type===dist_datamodel.FieldType.MEASURE}),containsDetailField=!!common_utils_intersect(schema,detailFields).length,dataLen=data.length,dimensionMeasureMap=context.dimensionMeasureMap,axes=context.axes,fieldInf=function getFieldInf(schema,dataModel,context){var valueParser=context.valueParser,timeDiffs=context.timeDiffs,fieldsObj=dataModel.getFieldspace().fieldsObj(),defFormatter=strategies_formatters(null,null,valueParser)[dist_datamodel.DimensionSubtype.CATEGORICAL];return schema.reduce(function(inf,field){var subtype=field.subtype,name=field.name,type=field.type,interval=subtype===dist_datamodel.DimensionSubtype.TEMPORAL?timeDiffs[name]:0,nf=type===dist_datamodel.FieldType.MEASURE?fieldsObj[name].numberFormat():function(val){return val};return inf[name]={fn:defaultValue(strategies_formatters(nf,interval,valueParser)[subtype],defFormatter),displayName:"".concat(retrieveFieldDisplayName(dataModel,name))},inf},{})}(schema,dataModel,context);if(dataLen>1&&containsDetailField)fieldValues=function getTabularData(dataObj,fieldInf){var rows=[],data=dataObj.data,schema=dataObj.schema;return rows.push(schema.map(function(d){return fieldInf[d.name].displayName})),data.forEach(function(d){var row=[];schema.forEach(function(fieldObj,i){var value=fieldInf[fieldObj.name].fn(d[i]);row.push(value)}),rows.push(row)}),rows}({data:data,schema:schema,fieldspace:fieldspace},fieldInf),displayFormat="table";else{var retinalFields=[color.field,shape.field,size.field].reduce(function(acc,field){return field&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION&&(acc[field]=1),acc},{}),indices=dimensions.filter(function(field){return!retinalFields[field.name]}).map(function(dim){return fieldsConfig[dim.name].index}),allMeasures=strategies_toConsumableArray(strategies_construct(Set,strategies_toConsumableArray(Object.values(dimensionMeasureMap)))),isStacked=function isStackedChart(layers){return layers.some(function(d){return"stack"===d.transformType()})}(context.layers),isStackedBar=function isStackedBarChart(layers){return layers.some(function(d){return"stack"===d.transformType()&&d.config().mark===BAR})}(context.layers),filteredMeasures=isSingleValue(dataLen,isStacked)?measures:measures.filter(function(d){return-1===allMeasures.indexOf(d.name)});!function generateTooltipContent(nestedData){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,content=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],classPrefix=config.classPrefix,separator=config.separator,i=0,len=nestedData.length;i2&&void 0!==arguments[2]?arguments[2]:{},dataModel=selectionSet&&selectionSet.mergedEnter.model;if(null===payload.criteria||dataModel&&dataModel.isEmpty()||null===selectionSet)return this.hide(options,null),this;var strategy=defaultValue(options.strategy,this._strategy);return this.createTooltip(dataModel,Object.assign({},{payload:payload,selectionSet:selectionSet,strategy:strategy,options:options}),null,0),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips,orientation=this.config().orientation;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var tooltip=tooltips[key],strategy=options.strategy||this._strategy;tooltip.content(strategy,null),Object.keys(tooltip._contents).length?tooltip.positionRelativeTo(tooltip._target,{orientation:orientation}):tooltip.hide()}}},{key:"getPlotPointsFromIdentifiers",value:function getPlotPointsFromIdentifiers(payload){var target=payload.target,targetFields=[];if(target){targetFields=target[0]||[];for(var sourceFields=payload.sourceFields,indices=[],i=0,len=targetFields.length;i1&&void 0!==arguments[1]?arguments[1]:{},plotDim=arguments.length>2?arguments[2]:void 0,key=arguments.length>3?arguments[3]:void 0,drawingInf=this.drawingContext(),sourceInf=this.sourceInfo(),config=this.config(),strategy=props.strategy,payload=props.payload,selectionSet=props.selectionSet;plotDim=(plotDim=defaultValue(plotDim,this.getPlotPointsFromIdentifiers(payload)))&&plotDim[0];var pad=config.padding,showInPosition=payload.showInPosition,tooltipPos=payload.position,_config$strategy=config[strategy],projectFields=_config$strategy.fields,dataTransform=_config$strategy.dataTransform,strategyFn=this._strategies[strategy],dt=dataTransform(dataModel,projectFields,this),layoutContainer=drawingInf.parentContainer,parentContainerDimensions=drawingInf.parentContainerDimensions,layoutBoundBox=layoutContainer.getBoundingClientRect(),unitBoundBox=drawingInf.htmlContainer.getBoundingClientRect(),offsetLeft=unitBoundBox.left-layoutBoundBox.left,offsetTop=unitBoundBox.top-layoutBoundBox.top,tooltipInst=this._tooltips[key]=this._tooltips[key]||new tooltip_Tooltip(layoutContainer,drawingInf.svgContainer);Object.assign(sourceInf,{payload:payload,firebolt:this.firebolt,detailFields:[],timeDiffs:sourceInf.timeDiffs,valueParser:this.valueParser(),selectionSet:selectionSet,config:config[strategy]}),tooltipInst.context(sourceInf),tooltipInst.content(strategy,dt,{formatter:strategyFn,order:config[strategy].order,className:config[strategy].className}).config(this.config()).extent({x:0,y:0,width:parentContainerDimensions.width,height:parentContainerDimensions.height}).offset({x:offsetLeft+(config.offset.x||0),y:offsetTop+(config.offset.y||0)}),showInPosition?tooltipInst.position(tooltipPos.x+pad,tooltipPos.y+pad):plotDim?tooltipInst.positionRelativeTo({x:plotDim.x,y:plotDim.y,width:plotDim.width||0,height:plotDim.height||0},{orientation:config.orientation}):tooltipInst.hide()}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:5,offset:{x:0,y:0},highlightSummary:{order:1,dataTransform:function dataTransform(dm,fields){return fields?dm.project(fields,{saveChild:!1}):dm}},selectionSummary:{order:0,dataTransform:function dataTransform(dm){return dm}}}}},{key:"formalName",value:function formalName(){return side_effects_TOOLTIP}},{key:"target",value:function target(){return"all"}}]),Tooltip}();function fragmented_tooltip_typeof(obj){return(fragmented_tooltip_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fragmented_tooltip_toConsumableArray(arr){return function fragmented_tooltip_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);idrawingInf.height:totalWidth>drawingInf.width)break;position&&boxes.push({x:position.x,y:position.y,width:tooltipBoundBox.width,height:tooltipBoundBox.height,tooltip:tooltipInst})}for(var key in tooltips)if(!enter[key]){var tooltip=tooltips[key];tooltip.content(strategy,null),tooltip.getContents().length||(tooltip.remove(),delete tooltips[key])}return boxes.length&&function spaceOutBoxes(boxes,extent,showVertically){var y,height,x,width,i,len=boxes.length,spaceOutIfOverlap=function spaceOutIfOverlap(firstBox,secondBox,opposite){x=firstBox.x,width=firstBox.width,y=firstBox.y,height=firstBox.height;var bottom=y+height,right=x+width;showVertically?(opposite?ysecondBox.y)&&(secondBox.y=opposite?firstBox.y-secondBox.height-5:bottom+5):(opposite?xsecondBox.x)&&(secondBox.x=opposite?firstBox.x-secondBox.width-5:right+5)};for(boxes.sort(function(a,b){return showVertically?a.y-b.y:a.x-b.x}),i=0,i=0;iextent.height||boxes[i].x+boxes[i].width>extent.width)for(showVertically?boxes[i].y-=boxes[i].height+boxes[i].y-extent.height:boxes[i].x-=boxes[i].width+boxes[i].x-extent.width,i=len-1;i>0;i--)spaceOutIfOverlap(boxes[i],boxes[i-1],!0)}(boxes,boundBox,showVertically),boxes.forEach(function(box){return box.tooltip.position(box.x,box.y,{repositionArrow:!0})}),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var strategy=options.strategy||this._strategy;tooltips[key].content(strategy,null),tooltips[key].hide()}}}],[{key:"formalName",value:function formalName(){return FRAGMENTED_TOOLTIP}}]),FragmentedTooltip}();__webpack_require__(30);function crossline_typeof(obj){return(crossline_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function crossline_toConsumableArray(arr){return function crossline_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]&&arguments[2]?common_utils_intersect:difference)(set.uids,selectedPointsId,[function(d){return d[0]},function(d){return d[0]}]);return function helper_objectSpread(target){for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:[];return excludeSet instanceof Function?excludeSet(this.firebolt.getEntryExitSet):excludeSet.reduce(function(acc,behaviour){var selectedPointsIds=((_this2.firebolt.getEntryExitSet(behaviour)||{}).mergedEnter||{}).uids;return selectedPointsIds&&acc.push.apply(acc,plot_highlighter_toConsumableArray(selectedPointsIds)),acc},[])}},{key:"apply",value:function apply(selectionSet,payload){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},currentStrategy=this._strategies[options.strategy||this._strategy],excludeSetIds=this.getExcludeSetIds(options.excludeSet);return currentStrategy({selectionSet:selectionSet,formattedSet:function plot_highlighter_objectSpread(target){for(var i=1;i3&&void 0!==arguments[3]?arguments[3]:[],propPayload=propConfig.payload,sourceIdentifiers=propConfig.sourceIdentifiers,excludeSelectedMeasures=propConfig.excludeSelectedMeasures,dataObj=selectionDataModel.getData({withUid:!0}),payload=Object.assign({},propPayload),data=dataObj.data,fieldsConfig=Object.assign({},selectionDataModel.getFieldsConfig(),function payload_generator_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},reserved_fields.ROW_ID,{index:Object.keys(selectionDataModel.getFieldsConfig()).length,def:{type:dist_datamodel.FieldType.DIMENSION}})),selectionSetFields=instance._selectionSet[propConfig.action]._fields;return sourceIdentifiers?function(){for(var _facetByFields=payload_generator_slicedToArray(facetByFields,2),_facetByFields$=_facetByFields[0],facetFields=void 0===_facetByFields$?[]:_facetByFields$,_facetByFields$2=_facetByFields[1],facetValues=void 0===_facetByFields$2?[]:_facetByFields$2,facetIndices=facetFields.reduce(function(acc,v,i){return acc[v]=i,acc},{}),identifierIdxMap=sourceIdentifiers.fields.reduce(function(acc,v,i){return acc[v.name]=i,acc},{}),identifiers=sourceIdentifiers.identifiers.slice(1,sourceIdentifiers.identifiers.length),sourceIdentifierFields=sourceIdentifiers.fields.filter(function(d){return d.name in fieldsConfig||d.name in facetIndices||d.name===reserved_fields.ROW_ID}),identifierMap=identifiers.reduce(function(acc,v){var key=sourceIdentifierFields.map(function(d){return v[identifierIdxMap[d.name]]}),measureNamesIdx=identifierIdxMap[reserved_fields.MEASURE_NAMES];return measureNamesIdx&&(!acc[key]&&(acc[key]=[]),acc[key].push([v[measureNamesIdx]])),acc},{}),dataArr=[],_loop=function _loop(i,len){var row=data[i],dims=[];selectionSetFields.forEach(function(field){if(fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION){var idx=fieldsConfig[field].index;dims.push(row[idx])}});var vals="".concat(sourceIdentifierFields.map(function(d){return d.name in fieldsConfig?row[fieldsConfig[d.name].index]:d.name in facetIndices?facetValues[facetIndices[d.name]]:null}).filter(function(d){return null!==d}));if(vals in identifierMap){var measures=identifierMap[vals],allMeasures=instance._metaData.dimensionsMap[dims];if(excludeSelectedMeasures){var fn=function fn(v){return"".concat(v)};difference(allMeasures,measures,[fn,fn]).forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}else measures.forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}else{var _measures=instance._metaData.dimensionsMap[dims];(_measures=_measures&&_measures.length?_measures:[[]]).forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}},i=0,len=data.length;i3&&void 0!==arguments[3]?arguments[3]:[];return payloadGenerator.__default(instance,selectionDataModel,Object.assign({},{excludeSelectedMeasures:!0},propConfig),facetByFields)}};function firebolt_helper_toConsumableArray(arr){return function firebolt_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{},obj=function getUniqueKeys(data,dimensions,_ref2){var layers=_ref2.layers,uids=_ref2.uids,_ref2$keys=_ref2.keys,keys=void 0===_ref2$keys?{}:_ref2$keys,_ref2$dimensionsMap=_ref2.dimensionsMap,dimensionsMap=void 0===_ref2$dimensionsMap?{}:_ref2$dimensionsMap;return data.forEach(function(row,i){var key=dimensions.length?dimensions.map(function(d){return row[d.index]}):[uids[i]];layers.forEach(function(layer){var measureNames=Object.keys(layer.data().getFieldspace().getMeasure()),mKey="".concat([key].concat(firebolt_helper_toConsumableArray(measureNames)));keys[mKey]=defaultValue(keys[mKey],{}),keys[mKey]={dims:key,measureNames:measureNames,uid:uids[i]},dimensionsMap[key]=defaultValue(dimensionsMap[key],[]),dimensionsMap[key].push(measureNames)})}),{keys:keys,dimensionsMap:dimensionsMap}}(data,dimensions,{layers:layers,uids:uids,keys:maps.keys,dimensionsMap:maps.dimensionsMap});return{keys:obj.keys,dimensionsMap:obj.dimensionsMap}},helper_sanitizePayloadCriteria=function sanitizePayloadCriteria(data,propFields,_ref4){var dm=_ref4.dm,dimensionsMap=_ref4.dimensionsMap,dimsMapGetter=_ref4.dimsMapGetter,fieldsConfig=Object.assign({},dm.getFieldsConfig(),function firebolt_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},reserved_fields.ROW_ID,{index:Object.keys(dm.getFieldsConfig()).length,def:{name:reserved_fields.ROW_ID,type:dist_datamodel.FieldType.DIMENSION}}));if(null===data)return null;if(isSimpleObject(data))return Object.keys(data).reduce(function(acc,v){return(v in fieldsConfig||v===reserved_fields.MEASURE_NAMES)&&(acc[v]=data[v]),acc},{});for(var criteriaFields=data[0],fields=criteriaFields.length?criteriaFields.map(function(d,i){return{name:d,index:i}}):[],fieldIndexMap=fields.reduce(function(acc,v,i){return acc[v.name]=i,acc},{}),dataWithFacets=[propFields=propFields||fields.map(function(d){return d.name})],measureNameField=criteriaFields.find(function(field){return field===reserved_fields.MEASURE_NAMES}),propDims=fields.filter(function(d){return d.name in fieldsConfig}).map(function(d){return d.name}),dimsMap=dimsMapGetter(propDims,fieldsConfig),_loop=function _loop(i,len){var row=data[i],dimKey=propDims.map(function(field){return row[fieldIndexMap[field]]}),origRow=dimsMap[dimKey];origRow&&origRow.forEach(function(rowVal){var newRowVal=[];(propFields.forEach(function(field){if(field in fieldIndexMap){var idx=fieldIndexMap[field];newRowVal.push(row[idx])}else{var _idx=getObjProp(fieldsConfig[field],"index");void 0!==_idx&&newRowVal.push(rowVal[_idx])}}),measureNameField)?dataWithFacets.push(newRowVal):(dimensionsMap[newRowVal].length?dimensionsMap[newRowVal]:[[]]).forEach(function(measures){dataWithFacets.push([].concat(newRowVal,firebolt_helper_toConsumableArray(measures)))})})},i=1,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},points=[],parsedIdentifiers=identifiers;if(null===identifiers)return[];var layers=this.layers(),len=layers.length;isSimpleObject(identifiers)&&(parsedIdentifiers=[Object.keys(identifiers)],parsedIdentifiers=[].concat(visual_unit_toConsumableArray(parsedIdentifiers),visual_unit_toConsumableArray(transposeArray(Object.values(identifiers)))));for(var i=0;iydom[0]?ydom:xdom,max=min===ydom?xdom:ydom;min[1]0&&(dimensionArr[0]=[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),dimensionArr[1]=[]),{fields:dimensionArr.map(function(list,i){return 1===i?measureArr[i].concat(dimensionArr[i]):dimensionArr[i].concat(measureArr[i])}),dimensions:[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),measures:[].concat(field_sanitizer_toConsumableArray(measureArr[0]),field_sanitizer_toConsumableArray(measureArr[1])),temporal:[].concat(field_sanitizer_toConsumableArray(temporalArr[0]),field_sanitizer_toConsumableArray(temporalArr[1])),categorical:[].concat(field_sanitizer_toConsumableArray(categoricalArr[0]),field_sanitizer_toConsumableArray(categoricalArr[1]))}}(norFields,fields)}),2),rowsInfo=_map2[0],columnsInfo=_map2[1],rows=rowsInfo.fields,rowDimensions=rowsInfo.dimensions,rowMeasures=rowsInfo.measures,rowTemporalFields=rowsInfo.temporal,rowCategoricalFields=rowsInfo.categorical,columns=columnsInfo.fields,columnDimensions=columnsInfo.dimensions,columnMeasures=columnsInfo.measures;return{rows:rows,rowDimensions:rowDimensions,rowMeasures:rowMeasures,rowTemporalFields:rowTemporalFields,rowCategoricalFields:rowCategoricalFields,columns:columns,columnTemporalFields:columnsInfo.temporal,columnCategoricalFields:columnsInfo.categorical,columnDimensions:columnDimensions,columnMeasures:columnMeasures}},BORDER_WIDTH={default:2,facet:1},cell_border_applier_handleBlankCell=function handleBlankCell(data){data.config().externalClassname.push("".concat(NONE,"-").concat(constants_LEFT)),data.config().externalClassname.push("".concat(NONE,"-").concat(constants_RIGHT))},cell_border_applier_sanitiseHeaderMatrix=function sanitiseHeaderMatrix(matrices,header){if(header)for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return"".concat(axisName,"-axis-").concat(params.join("-"))},getCellKey=function getCellKey(rowId,columnId){return"cell-".concat(rowId,"-").concat(columnId)},group_utils_extractUnitConfig=function extractUnitConfig(config){var unitConfig={};return[INTERACTION,GRID_LINES,GRID_BANDS].forEach(function(attr){void 0!==config[attr]&&(unitConfig[attr]=config[attr])}),unitConfig},hasOneField=function hasOneField(fields){return Object.keys(fields).some(function(d){return fields[d].length>0})},getHeaderText=function getHeaderText(headers,index,rowLength){var header="";if(index===rowLength-1&&headers.length>rowLength){for(var i=index;i0?fields[0].map(function(cell,i){return new TextCell({type:HEADER,className:"".concat(classPrefix,"-grid-headers")},{labelManager:labelManager}).source(getHeaderText(fieldHeaders,i,fields[0].length)).config({show:cell.config().show})}):[];return cell_border_applier_sanitiseHeaderMatrix(headers,!0),headers},group_utils_findInGroup=function findInGroup(variable,allFields){var channel=null;return[enums_constants_COLOR,enums_constants_SIZE,enums_constants_SHAPE].forEach(function(e){group_utils_this.store.get(e)&&variable===group_utils_this.store.get(e)[0]&&(channel=e)}),channel?{channel:channel}:([ROW,COL].forEach(function(facetType){allFields["".concat(facetType,"Facets")].forEach(function(e){e.toString()===variable&&(channel={channel:FACET,type:facetType===COL?COLUMN:ROW})})}),channel||([ROW,COL].forEach(function(projType){allFields["".concat(projType,"Projections")].forEach(function(e){e.forEach(function(m){m.toString()===variable&&(channel=projType===COL?X:Y)})})}),channel?{channel:channel}:null))},group_utils_getAxisType=function getAxisType(fieldsConfig,field){var fieldType=enums_constants_ORDINAL;return field&&fieldsConfig[field].def.type!==DIMENSION&&(fieldType=enums_constants_LINEAR),fieldType},retriveDomainFromData=function retriveDomainFromData(datamodel,fieldName){return datamodel.getFieldspace().fields.find(function(d){return d.name()===fieldName.toString()}).domain()},mutateAxesFromMap=function mutateAxesFromMap(cacheMaps,axes){var xAxes=null,yAxes=null,xAxesMap=cacheMaps.xAxesMap,yAxesMap=cacheMaps.yAxesMap,xAxisSet=axes.x,yAxisSet=axes.y;return xAxisSet&&xAxisSet.forEach(function(axisId){var xAxis=xAxesMap.get(axisId);(xAxes=xAxes||[]).push(xAxis)}),yAxisSet&&yAxisSet.forEach(function(axisId){var yAxis=yAxesMap.get(axisId);(yAxes=yAxes||[]).push(yAxis)}),{xAxes:xAxes,yAxes:yAxes}},group_utils_getEncoder=function getEncoder(layers){var encoder=new cartesian_encoder_CartesianEncoder;return layers.length&&(encoder=layers.some(function(layerConf){return function hasPolarEncodings(layerConf){return layerConf.mark===ARC||[enums_constants_RADIUS,enums_constants_ANGLE].some(function(field){return getObjProp(layerConf.encoding,field)})}(layerConf)})?new polar_encoder_PolarEncoder:encoder),encoder},group_utils_getHeaderAxisFrom=function getHeaderAxisFrom(type,fields,userAxisFromConfig){var axisFrom=userAxisFromConfig[type],headerFrom="",options=type===ROW?[constants_LEFT,constants_RIGHT]:[enums_constants_BOTTOM,enums_constants_TOP],_fields=group_utils_slicedToArray(fields,2),firstField=_fields[0],secondField=_fields[1],firstFieldType=function firstFieldType(i){return firstField.length?firstField[i].type():null},secondFieldType=function secondFieldType(i){return secondField.length?secondField[i].type():null};return firstFieldType(firstField.length-1)===DIMENSION&&secondFieldType(0)===DIMENSION?(headerFrom=axisFrom?options[1-options.indexOf(axisFrom)]:options[1],axisFrom=type===COLUMN&&firstField[firstField.length-1].toString()===secondField[0].toString()?enums_constants_TOP:axisFrom||options[0]):secondFieldType(secondField.length-1)===DIMENSION?(headerFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM,axisFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM):(headerFrom=type===ROW?constants_LEFT:enums_constants_TOP,axisFrom=type===ROW?constants_LEFT:enums_constants_TOP),firstFieldType(firstField.length-1)===MEASURE&&secondFieldType(0)===MEASURE?axisFrom=type===ROW?constants_LEFT:enums_constants_TOP:secondFieldType(0)===MEASURE?axisFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM:firstFieldType(firstField.length-1)===MEASURE&&(axisFrom=type===ROW?constants_LEFT:enums_constants_TOP),[headerFrom,axisFrom]},setFacetsAndProjections=function setFacetsAndProjections(context,fieldInfo,encoder){var fields=fieldInfo.fields,type=fieldInfo.type,_encoder$simpleEncode=encoder.simpleEncoder.getFacetsAndProjections(fields,type),facets=_encoder$simpleEncode.facets,projections=_encoder$simpleEncode.projections;return context.facets(group_utils_defineProperty({},"".concat(type,"Facets"),facets)),context.projections(group_utils_defineProperty({},"".concat(type,"Projections"),projections)),{facets:facets,projections:projections,fields:fields}},getBorders=function getBorders(matrices,encoder){var showRowBorders={top:!1,bottom:!1},showColBorders={left:!1,right:!1},showValueBorders={top:!1,bottom:!1,left:!1,right:!1},rows=matrices.rows,columns=matrices.columns,valueMatrix=matrices.values,_rows=group_utils_slicedToArray(rows,2),leftRows=_rows[0],rightRows=_rows[1],_columns=group_utils_slicedToArray(columns,2),topColumns=_columns[0],bottomColumns=_columns[1],_encoder$fieldInfo=encoder.fieldInfo(),rowDimensions=_encoder$fieldInfo.rowDimensions,columnDimensions=_encoder$fieldInfo.columnDimensions,rowTemporalFields=_encoder$fieldInfo.rowTemporalFields,columnTemporalFields=_encoder$fieldInfo.columnTemporalFields,columnMeasures=_encoder$fieldInfo.columnMeasures,rowMeasures=_encoder$fieldInfo.rowMeasures,allDimensionLength=rowDimensions.length+columnDimensions.length,allMeasuresLength=rowMeasures.length+columnMeasures.length,allTemporalFieldsLength=rowTemporalFields.length+columnTemporalFields.length;if(encoder.constructor.type()===group_utils_POLAR){if(!allDimensionLength)return{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}}else if(!allMeasuresLength&&!allTemporalFieldsLength&&allDimensionLength<=2)return{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders};return showRowBorders=function getRowBorders(left,right){var borders={top:!1,bottom:!1};return(left.length>1||right.length>1)&&(borders.top=!0,borders.bottom=!0),borders}(leftRows,rightRows),showColBorders=function getColumnsBorders(top,bottom){var borders={left:!1,right:!1};return(top.length||bottom.length)&&(top[0]&&top[0].length>1||bottom[0]&&bottom[0].length>1)&&(borders.left=!0,borders.right=!0),borders}(topColumns,bottomColumns),showValueBorders=function getValueBorders(rows,columns){var borders={top:!0,left:!0,bottom:!0,right:!0},borderTypeRow=[constants_LEFT,constants_RIGHT],borderTypeCol=[enums_constants_TOP,enums_constants_BOTTOM];return rows.forEach(function(e,i){e[0]&&e[0].length?borders[borderTypeRow[i]]=!0:borders[borderTypeRow[i]]=!1}),columns.forEach(function(e,i){e.length?borders[borderTypeCol[i]]=!0:borders[borderTypeCol[i]]=!1}),borders}([leftRows,rightRows],[topColumns,bottomColumns]),valueMatrix.length>1&&(showValueBorders.top=!0,showValueBorders.bottom=!0),valueMatrix.length&&valueMatrix[0].length>1&&(showValueBorders.left=!0,showValueBorders.right=!0),{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}},getFieldsFromSuppliedLayers=function getFieldsFromSuppliedLayers(suppliedLayerConfig){var _ref3,encodingArr=suppliedLayerConfig.map(function(conf){return conf.encoding||{}}),fields=(_ref3=[]).concat.apply(_ref3,group_utils_toConsumableArray(encodingArr.map(function(enc){return Object.values(enc).map(function(d){return"object"===group_utils_typeof(d)?d.field:d})})));return group_utils_toConsumableArray(new Set(fields.filter(function(d){return d})))},group_utils_extractFields=function extractFields(facetsAndProjections,layerFields){var _ref6,fields=Object.values(facetsAndProjections).map(function(arr){var _ref4,_ref5,flattenArray=(_ref4=[]).concat.apply(_ref4,group_utils_toConsumableArray(arr));return(_ref5=[]).concat.apply(_ref5,group_utils_toConsumableArray(flattenArray.map(function(field){return field instanceof variable_Variable?field.getMembers():field})))});return(_ref6=[]).concat.apply(_ref6,group_utils_toConsumableArray(fields).concat(group_utils_toConsumableArray(layerFields)))},group_utils_sortFacetFields=function sortFacetFields(facets,keys,config){var schema=[],facetNames=[],sortInfo=[],sortConfig=config.sort;return facets.forEach(function(facet){var name="".concat(facet);facetNames.push(name);var facetSortConfig=sortConfig[name];facetSortConfig?sortInfo.push([name,facetSortConfig]):sortInfo.push([name,null]),schema.push(facet.getSchemaDef())}),new datamodel_default.a([facetNames].concat(group_utils_toConsumableArray(keys)),schema).getData({sort:sortInfo}).data},group_utils_removeExitCells=function removeExitCells(resolver){var _ref7,exitCells=resolver.cacheMaps().exitCellMap,store=resolver.store(),qualifiedStateProps=(_ref7=[]).concat.apply(_ref7,group_utils_toConsumableArray(visual_unit_VisualUnit.getQualifiedStateProps()).concat(group_utils_toConsumableArray(base_layer_BaseLayer.getQualifiedStateProps())));store.lockCommits(qualifiedStateProps),exitCells.forEach(function(placeholder){placeholder.remove()}),store.unlockCommits(qualifiedStateProps)},encoder_props_PROPS={layers:{},data:{},globalConfig:{}};function visual_encoder_slicedToArray(arr,i){return function visual_encoder_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function visual_encoder_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function visual_encoder_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function visual_encoder_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},fields=arguments.length>1?arguments[1]:void 0,_getHeaderAxisFrom2=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(ROW,fields.rows,axisFrom),2),rowHeader=_getHeaderAxisFrom2[0],rowAxis=_getHeaderAxisFrom2[1],_getHeaderAxisFrom4=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(COLUMN,fields.columns,axisFrom),2),colHeader=_getHeaderAxisFrom4[0],colAxis=_getHeaderAxisFrom4[1];return this.axisFrom({row:rowAxis,column:colAxis}),this.headerFrom({row:rowHeader,column:colHeader}),this}},{key:"getProjectionFields",value:function getProjectionFields(layers){return getFieldsFromSuppliedLayers(layers)}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){return hasOneField(fields)}}]),VisualEncoder}(),scaleMaps={linear:continous_axis_ContinousAxis,band:band_axis_BandAxis,temporal:time_axis_TimeAxis,size:size_axis_SizeAxis,color:color_axis_ColorAxis,shape:shape_axis_ShapeAxis};function matrix_model_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function matrix_model_objectSpread(target){for(var i=1;i1){var facetsUserConfig=config.facetsUserConfig,border=config.border,isBorderPresent=facetsUserConfig.isBorderPresent,isGridLinePresent=facetsUserConfig.isGridLinePresent,gridLinesShowLength=Object.keys(isGridLinePresent).length,borderWidth=border.width,gridLines={};isBorderPresent||(borderWidth=BORDER_WIDTH[FACET]),gridLinesShowLength<=0&&(gridLines={x:{show:!1}}),conf={border:{width:borderWidth},gridLines:gridLines}}return conf}(facetInfo,projectionInfo,globalConfig);globalConfig=mergeRecursive(globalConfig,defaultConfig);var generalContext={matrix:matrix,geomCellCreator:geomCellCreator,projectionInfo:projectionInfo,splitModelsHashMap:splitModelsHashMap,colKeys:colKeys};if(rowKeys.length)rowKeys.forEach(function(rowKeyObj){var rowIndex=function createRowDataModels(rowContext,fieldInfo,sourceDM){var currentColumnIndex=0,rowIndexForCurrentKey=0,colKeys=rowContext.colKeys,rowKeyObj=rowContext.rowKeyObj,currentRowIndex=rowContext.currentRowIndex,newRowIndex=currentRowIndex,colContext=matrix_model_objectSpread({},rowContext,{rowKeyArr:rowKeyObj.keyArr,rowKey:rowKeyObj.joinedKey,newRowIndex:newRowIndex});if(rowIndexForCurrentKey=currentRowIndex,colKeys.length)colKeys.forEach(function(colKeyObj){colContext.colKeyObj=colKeyObj,colContext.currentColumnIndex=currentColumnIndex;var _createColumnDataMode=matrix_model_createColumnDataModels(colContext,fieldInfo,sourceDM),columnIndex=_createColumnDataMode.columnIndex,rowIndex=_createColumnDataMode.rowIndex;currentColumnIndex=columnIndex,rowIndexForCurrentKey=rowIndex});else{colContext.colKeyObj={keyArr:[],joinedKey:""},colContext.currentColumnIndex=currentColumnIndex;var _createColumnDataMode2=matrix_model_createColumnDataModels(colContext,fieldInfo,sourceDM),columnIndex=_createColumnDataMode2.columnIndex,rowIndex=_createColumnDataMode2.rowIndex;currentColumnIndex=columnIndex,rowIndexForCurrentKey=rowIndex}return{rowIndex:++rowIndexForCurrentKey}}(matrix_model_objectSpread({},generalContext,{rowKeyObj:rowKeyObj,currentRowIndex:currentRowIndex}),fieldInfo,dataModel).rowIndex;currentRowIndex=rowIndex});else if(colKeys.length){var currentColumnIndex=0,newRowIndex=currentRowIndex;colKeys.forEach(function(colKeyObj){var colContext=matrix_model_objectSpread({},generalContext,{rowKeyArr:[],rowKey:"",colKeyObj:colKeyObj,newRowIndex:newRowIndex,currentColumnIndex:currentColumnIndex}),_createColumnDataMode3=matrix_model_createColumnDataModels(colContext,fieldInfo,dataModel),columnIndex=_createColumnDataMode3.columnIndex,rowIndex=_createColumnDataMode3.rowIndex;currentRowIndex=rowIndex,currentColumnIndex=columnIndex})}else{var _currentColumnIndex=0,colContext=matrix_model_objectSpread({},generalContext,{rowKeyArr:[],rowKey:"",colKeyObj:{keyArr:[],joinedKey:""},newRowIndex:currentRowIndex,currentColumnIndex:_currentColumnIndex}),_createColumnDataMode4=matrix_model_createColumnDataModels(colContext,fieldInfo,dataModel),columnIndex=_createColumnDataMode4.columnIndex,rowIndex=_createColumnDataMode4.rowIndex;currentRowIndex=rowIndex,_currentColumnIndex=columnIndex}var formattedColKeys=formatKeys(colKeys.map(function(e){return e.keyArr}),colFacets.map(function(facetField){return facetField.rawFormat()}));return{matrix:matrix,rowKeys:formatKeys(rowKeys.map(function(e){return e.keyArr}),rowFacets.map(function(facetField){return facetField.rawFormat()})),columnKeys:formattedColKeys.length>0?formattedColKeys[0].map(function(col,i){return formattedColKeys.map(function(row){return row[i]})}):formattedColKeys}};function cell_creator_slicedToArray(arr,i){return function cell_creator_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function cell_creator_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function cell_creator_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function cell_creator_toConsumableArray(arr){return function cell_creator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?rowProjections.length:1):(keys=columnKeys,length=colProjections.length>0?colProjections.length:1),keys=keys.map(function(arr){return arr.map(function(val){return resolver.valueParser()(val)})}),section.length&&headerFrom===type&&axis&&keys.length){var hContext={axis:axis,length:length,type:type},headers=[];index<2?(hContext.keys=keys,hContext.facet=facet.rows,headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)):(hContext.facet=facet.columns,hContext.keys=keys[0].map(function(key,i){return keys.map(function(e){return e[i]})}),headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)),selectionObj["".concat(type,"Headers")]=headers}else selectionObj["".concat(type,"Headers")]=null}),selectionObj},cell_creator_getAxisFields=function getAxisFields(projections){var fieldHolder=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return projections.reduce(function(acc,item){return[].concat(cell_creator_toConsumableArray(acc),cell_creator_toConsumableArray(item.reduce(function(ac,field){return field instanceof simple_var_SimpleVariable?[].concat(cell_creator_toConsumableArray(ac),[field.oneVar()]):ac},[])))},fieldHolder)},cell_creator_transformDataModel=function transformDataModel(dataModel,config,resolver){var groupedModel,fieldsConfig=dataModel.getFieldsConfig(),resolvedData=resolver.data(),groupBy=config.groupBy,suppliedLayers=config.suppliedLayers,facetsAndProjections=config.facetsAndProjections;resolvedData instanceof datamodel_default.a&&resolvedData.dispose();var fields=getFieldsFromSuppliedLayers(suppliedLayers).filter(function(field){return getObjProp(fieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),allFields=group_utils_extractFields(facetsAndProjections,fields);if(groupedModel=dataModel.project(allFields),resolver.data(groupedModel),!groupBy.disabled){var newFieldsConfig=groupedModel.getFieldsConfig(),dimensions=allFields.filter(function(field){return getObjProp(newFieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),aggregationFns=groupBy.measures,measureNames=Object.keys(groupedModel.getFieldspace().getMeasure()),nearestAggFns=common_utils_retrieveNearestGroupByReducers.apply(void 0,[groupedModel].concat(cell_creator_toConsumableArray(measureNames))),resolvedAggFns=mergeRecursive(nearestAggFns,aggregationFns);groupedModel=groupedModel.groupBy(dimensions.length?dimensions:[""],resolvedAggFns)}return groupedModel=function sortDmTemporalFields(resolver,datamodel){var axisFields=[],projections=resolver.projections();axisFields=cell_creator_getAxisFields(projections.rowProjections,cell_creator_getAxisFields(projections.colProjections));var fieldConfig=datamodel.getFieldsConfig(),temporalFields=axisFields.reduce(function(acc,field){return fieldConfig[field].def.subtype===constants_TEMPORAL?[].concat(cell_creator_toConsumableArray(acc),[[field]]):acc},[]);return temporalFields.length?datamodel.sort(temporalFields,{saveChild:!0}):datamodel}(resolver,groupedModel),resolver.transformedData(groupedModel),groupedModel},cell_creator_computeMatrices=function computeMatrices(resolverConfig){var datamodel=resolverConfig.datamodel,encoders=resolverConfig.encoders,resolver=resolverConfig.resolver,globalConfig=resolverConfig.globalConfig,selection=resolverConfig.selection,transform=resolverConfig.transform,componentRegistry=resolverConfig.componentRegistry,groupBy=resolverConfig.groupBy,labelManager=resolverConfig.labelManager,fieldMap=resolverConfig.fieldMap,layerConfig=resolverConfig.layerConfig,registry=resolverConfig.registry,normalizedRows=resolverConfig.normalizedRows,normalizedColumns=resolverConfig.normalizedColumns,otherEncodings=resolverConfig.otherEncodings,facetsAndProjections=resolverConfig.facetsAndProjections,simpleEncoder=resolverConfig.simpleEncoder,config=resolverConfig.config,rowFacets=facetsAndProjections.rowFacets,colFacets=facetsAndProjections.colFacets,colProjections=facetsAndProjections.colProjections,isProjection=facetsAndProjections.rowProjections.length>0||colProjections.length>0,isFacet=rowFacets.length>0||colFacets.length>0;isFacet&&(globalConfig.isFacet=!0);var matrixGnContext={normalizedColumns:normalizedColumns,normalizedRows:normalizedRows,facetsAndProjections:facetsAndProjections,layers:layerConfig,fieldMap:fieldMap,otherEncodings:otherEncodings,encoders:encoders,facet:globalConfig.facet||{},axisFrom:globalConfig.axisFrom||{},selection:selection,resolver:resolver},cells={GeomCell:resolver.getCellDef(registry.cells.GeomCell),AxisCell:resolver.getCellDef(registry.cells.AxisCell),BlankCell:resolver.getCellDef(registry.cells.BlankCell),TextCell:resolver.getCellDef(registry.cells.TextCell)},isRowSizeEqual=group_utils_isDistributionEqual(normalizedRows),isColumnSizeEqual=group_utils_isDistributionEqual(normalizedColumns);resolver.colCells({}),resolver.rowCells({}),resolver.datamodelTransform(transform||{}),resolver.resetSimpleAxes();var newCacheMap={exitCellMap:resolver.cacheMaps().entryCellMap,entryCellMap:new Map};resolver.cacheMaps(newCacheMap);var valueCellContext={config:globalConfig,suppliedLayers:simpleEncoder.serializeLayerConfig(resolver.layerConfig()),resolver:resolver,cell:cells.GeomCell,encoder:simpleEncoder,newCacheMap:newCacheMap,detailFields:config.detail,retinalConfig:{color:config.color,size:config.size,shape:config.shape}},groupedModel=cell_creator_transformDataModel(datamodel,{facetsAndProjections:facetsAndProjections,suppliedLayers:valueCellContext.suppliedLayers,groupBy:groupBy},resolver);simpleEncoder.data(groupedModel);var cellCreator=resolver.valueCellsCreator(valueCellContext),valueMatrixInfo=matrix_model_getMatrixModel(groupedModel,facetsAndProjections,cellCreator,globalConfig);group_utils_removeExitCells(resolver),resolver.cacheMaps().exitCellMap.clear(),resolver.valueMatrix(valueMatrixInfo.matrix);var _mutateAxesFromMap=mutateAxesFromMap(resolver.cacheMaps(),resolver.axes()),xAxes=_mutateAxesFromMap.xAxes,yAxes=_mutateAxesFromMap.yAxes;resolver.axes({x:xAxes,y:yAxes}),resolver.createUnits(componentRegistry,config);var _generateMatrices=function generateMatrices(context,matrices,cells,labelManager){var unitHeight=context.unitHeight,unitWidth=context.unitWidth,facetsAndProjections=context.facetsAndProjections,normalizedRows=context.normalizedRows,normalizedColumns=context.normalizedColumns,selection=context.selection,axisFrom=context.axisFrom,facet=context.facet,encoders=context.encoders,resolver=context.resolver,selectionObj=cell_creator_generatePlaceholders({fields:{rows:normalizedRows,columns:normalizedColumns},matrices:matrices,facetsAndProjections:facetsAndProjections,selection:selection,axisFrom:axisFrom,facet:facet,encoders:encoders,resolver:resolver},cells,labelManager),columnsPrimary=selectionObj.columnsPrimary,columnsSecondary=selectionObj.columnsSecondary,rowsPrimary=selectionObj.rowsPrimary,rowsSecondary=selectionObj.rowsSecondary,leftHeaders=selectionObj.leftHeaders,topHeaders=selectionObj.topHeaders,bottomHeaders=selectionObj.bottomHeaders,rightHeaders=selectionObj.rightHeaders,_map2=cell_creator_slicedToArray([rowsPrimary,rowsSecondary,columnsPrimary,columnsSecondary].map(function(d){return d?d.getObjects():[]}),4),rowPrime=_map2[0],rowSec=_map2[1],colPrime=_map2[2],colSec=_map2[3],_map4=cell_creator_slicedToArray([leftHeaders,rightHeaders].map(function(e){return e?e.getObjects().map(function(f){return f.getObjects()}):[]}),2),leftFacets=_map4[0],rightFacets=_map4[1],rowPriority=rowSec.length?1:-1;rowPrime.length&&rowPriority++;var colPriority=colSec.length?1:-1;colPrime.length&&colPriority++;var leftMatrix=leftFacets.length?leftFacets.map(function(d,i){return rowPrime[i]=rowPrime[i]?[rowPrime[i]]:[],[].concat(cell_creator_toConsumableArray(d),cell_creator_toConsumableArray(rowPrime[i]))}):rowPrime?rowPrime.map(function(d){return[d]}):[],rightMatrix=rowSec.length?rowSec.map(function(d,i){return[d].concat(cell_creator_toConsumableArray(rightFacets[i]||[]))}):rightFacets.length?rightFacets.map(function(d){return cell_creator_toConsumableArray(d)}):[],topMatrix=[];topHeaders&&topHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){topMatrix[i]=topMatrix[i]||[],topMatrix[i].push(x)})});colPrime.length&&topMatrix.push(colPrime);var bottomMatrix=[];colSec.length&&bottomMatrix.push(colSec);var currentBottomLength=bottomMatrix.length;bottomHeaders&&bottomHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){bottomMatrix[i+currentBottomLength]=bottomMatrix[i+currentBottomLength]||[],bottomMatrix[i+currentBottomLength].push(x)})});if(!leftMatrix.length&&!rightMatrix.length){var cell=new cells.BlankCell;cell.setAvailableSpace(unitWidth,unitHeight),leftMatrix=[[cell]]}if(!(topMatrix.length||bottomMatrix.length&&bottomMatrix[0].length)){var _cell=new cells.BlankCell;_cell.setAvailableSpace(unitWidth,unitHeight),bottomMatrix=[[_cell]]}return{rows:[leftMatrix,rightMatrix],columns:[topMatrix,bottomMatrix],selectionObj:selectionObj,colPriority:colPriority,rowPriority:rowPriority}}(matrixGnContext,{valuesMatrix:valueMatrixInfo,axesMatrix:resolver.axes()},cells,labelManager),rows=_generateMatrices.rows,columns=_generateMatrices.columns,selectionObj=_generateMatrices.selectionObj,rowPriority=_generateMatrices.rowPriority,colPriority=_generateMatrices.colPriority;if(resolver.rowMatrix(rows),resolver.columnMatrix(columns),isFacet||isProjection){var arr=function sanitiseBorderMatrix(matrices,blankCell){var leftMatrix=matrices.leftMatrix,rightMatrix=matrices.rightMatrix,topMatrix=matrices.topMatrix,bottomMatrix=matrices.bottomMatrix,bottomBorderObj={};return rightMatrix.length&&(bottomBorderObj=cell_border_applier_sanitiseFacetValues(rightMatrix,"".concat(constants_RIGHT),blankCell)),leftMatrix.length&&(bottomBorderObj=cell_border_applier_sanitiseFacetValues(leftMatrix,"".concat(constants_LEFT),blankCell)),topMatrix.length&&cell_border_applier_sanitiseHeaderMatrix(topMatrix),bottomMatrix.length&&cell_border_applier_sanitiseHeaderMatrix(bottomMatrix),bottomBorderObj}({leftMatrix:rows[0],rightMatrix:rows[1],topMatrix:columns[0],bottomMatrix:columns[1]},registry.cells.BlankCell);valueMatrixInfo.matrix=function sanitiseGeomMatrix(matrices){for(var arr=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=0;i0?leftRows[0].map(blankCellCreator):[],right:rightRows.length>0?rightRows[0].map(blankCellCreator):[]},_map2=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return topCols.map(function(col,i){return i===topCols.length-1?headers[type]:footers[type]})}),2),topLeft=_map2[0],topRight=_map2[1];if(0===topCols.length){var _map4=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return bottomCols.map(function(col,i){return 0===i?headers[type]:footers[type]})}),2);bottomLeft=_map4[0],bottomRight=_map4[1]}else bottomLeft=bottomCols.map(function(){return leftRows.length>0?leftRows[0].map(blankCellCreator):[]}),bottomRight=bottomCols.map(function(){return rightRows.length>0?rightRows[0].map(blankCellCreator):[]});return lifeCycleManager.notify({client:[topLeft,topRight,bottomLeft,bottomRight],action:INITIALIZED,formalName:FACET_HEADERS}),{topLeft:topLeft,topRight:topRight,bottomLeft:bottomLeft,bottomRight:bottomRight}}},{key:"updateVisualUnit",value:function updateVisualUnit(retinalConfig){var retinalAxes=this.getRetinalAxes(),lifeCycleManager=this.dependencies().lifeCycleManager;lifeCycleManager.notify({client:this.axes(),action:INITIALIZED,formalName:AXIS}),lifeCycleManager.notify({client:this.units(),action:BEFORE_UPDATE,formalName:UNIT});var units=[],matrixLayers=this.matrixLayers(),props=["".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".domain"),"".concat(namespace_namespaceObject.UNIT_GLOBAL_NAMESPACE,".domain")],store=this.store();return store.lockCommits(props),store.lockModel(),this.forEach(VALUE_MATRIX,function(i,j,el){el.axes(Object.assign(el.axes(),retinalAxes)),el.source()&&el.source().retinalFields(retinalConfig),el.layerDef(matrixLayers[i][j]),el.updateModel(),units.push(el.source())}),store.unlockModel().unlockCommits([props[0]]).unlockCommits([props[1]]),lifeCycleManager.notify({client:units,action:UPDATED,formalName:UNIT}),this}},{key:"getMatrices",value:function getMatrices(resolverConfig){return this._placeholderInfo=cell_creator_computeMatrices(resolverConfig),this._placeholderInfo}},{key:"clear",value:function clear(){var cacheMaps=this._cacheMaps;for(var key in cacheMaps)cacheMaps[key].clear()}}],[{key:"getterSetters",value:function getterSetters(){return RESOLVER_PROPS}}]),MatrixResolver}();function src_data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var src_data_type_scale_map_dataTypeScaleMap=(src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap={},dist_datamodel.FieldType.DIMENSION,scale_type_namespaceObject.BAND),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.CATEGORICAL,scale_type_namespaceObject.BAND),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.TEMPORAL,scale_type_namespaceObject.TIME),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.FieldType.MEASURE,scale_type_namespaceObject.LINEAR),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.MeasureSubtype.CONTINUOUS,scale_type_namespaceObject.LINEAR),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.BINNED,scale_type_namespaceObject.BAND),data_type_scale_map_dataTypeScaleMap);function encoder_helper_toConsumableArray(arr){return function encoder_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&min[1]>0&&min[1]>0&&max[1]>0&&(allSameSign=!0,min[0]=0,min[1]=0),min[0]<0&&min[1]<0&&min[1]<0&&max[1]<0&&(allSameSign=!0,max[0]=0,max[1]=0),allSameSign||y1ratio===y2ratio||(y1ratio1&&void 0!==arguments[1]?arguments[1]:{},axisType=axesCreators.axisType,fieldsConfig=axesCreators.fieldsConfig,field=fieldProps.field,axis=[],Cls=scaleMaps[axisType];return fieldProps.type=fieldProps.type?fieldProps.type:group_utils_getAxisType(fieldsConfig,field||null),axis.push(new Cls(fieldProps)),axis},getIndex=function getIndex(arr,val){for(var i=0,arrIndex=-1;-1===arrIndex&&i1?axesCreators.position=BOTH:axesCreators.position=_this.axisFrom()[type],geomCellAxes[axis]=encoder_helper_generateAxisFromMap(axis,axisFields[i],axesCreators,{groupAxes:axis===X?xAxes:yAxes,valueParser:resolver.valueParser()},indices,facetFields)}),geomCell.axes(geomCellAxes),geomCellAxes}},{key:"unionUnitDomains",value:function unionUnitDomains(context){for(var store=context.store(),resolver=context.resolver(),units=resolver.units(),domains={0:{},1:{}},fieldsObj={0:{},1:{}},_loop=function _loop(rIdx,len){for(var unitsArr=units[rIdx],_loop2=function _loop2(cIdx,len2){var unit=unitsArr[cIdx],axisFields=unit.fields(),encodingDomains=unit.dataDomain();["x","y"].forEach(function(axisType,axisTypeIndex){axisFields[axisType].forEach(function(field,axisIndex){var key=axisTypeIndex?"".concat(rIdx,"0").concat(axisIndex):"0".concat(cIdx).concat(axisIndex),dom=encodingDomains[axisType],typeOfField=field.subtype();fieldsObj[axisTypeIndex][key]=field,dom&&0!==Object.keys(dom).length&&(domains[axisTypeIndex][key]=unionDomain([domains[axisTypeIndex]&&domains[axisTypeIndex][key]||[],dom["".concat(field)]],typeOfField))})})},cIdx=0,len2=unitsArr.length;cIdx1&&typeOfAxis===scale_type_namespaceObject.LINEAR&&axes[0].config().alignZeroLine)axes.forEach(function(axis,i){key=axisType?"".concat(idx,"0").concat(i):"0".concat(idx).concat(i),domain=domains[axisType][key],min[i]=domain[0],max[i]=domain[1]}),adjustedDomain=getAdjustedDomain(max,min);else if(typeOfAxis===scale_type_namespaceObject.BAND){key=axisType?"".concat(idx,"00"):"0".concat(idx,"0");var currentFieldName=fieldsObj[axisType][key].oneVar(),sortingOrder=getSortingConfig(context,currentFieldName,axes[0].config);sortingOrder&&domains[axisType][key]instanceof Array&&domains[axisType][key].sort(function(a,b){return sortCategoricalField(sortingOrder,a,b)})}axes.forEach(function(axis,index){key=axisType?"".concat(idx,"0").concat(index):"0".concat(idx).concat(index),(domain=adjustedDomain[index]||domains[axisType][key])&&axis.domain(domain);var type=axisType?"y":"x";store.commit("".concat(namespace_namespaceObject.GROUP_GLOBAL_NAMESPACE,".domain.").concat(type),domain,"".concat(idx).concat(index))})})}),store.unlockModel()}},{key:"getFacetsAndProjections",value:function getFacetsAndProjections(fields,type){for(var facets=[],projections=[],counter=0,primaryFacets=[],secondaryFacets=[],primaryFields=fields[0],secondaryFields=fields[1],primaryLen=primaryFields.length,secondaryLen=secondaryFields.length,axisFrom=this.axisFrom(),i=0;icounter)for(var _i=counter;_i-1&&(projections=[[_facet,_facet]],primaryFacets.splice(_existIndex,1)),secondaryFacets.splice(0,1)}else{var axisFromIndex=primaryFacets.length-1,facet=primaryFacets[axisFromIndex];projections=[[facet]];var existIndex=getIndex(secondaryFacets,facet);existIndex>-1&&(projections=[[facet,facet]],secondaryFacets.splice(existIndex,1)),primaryFacets.splice(axisFromIndex,1)}return{facets:facets=(facets=[].concat(primaryFacets,secondaryFacets)).filter(function(el,index,self){return index===self.findIndex(function(t){return t.toString()===el.toString()})}),projections:projections}}},{key:"fieldSanitizer",value:function fieldSanitizer(datamodel,config){return cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"fieldSanitizer",this).call(this,datamodel,config)}},{key:"getRetinalFieldsDomain",value:function getRetinalFieldsDomain(dataModels,encoding){var groupedModel=dataModels.groupedModel,domains={};for(var key in encoding)if({}.hasOwnProperty.call(encoding,key)){var encodingObj=encoding[key],field=encodingObj.field;if(!encodingObj.domain&&field){var domain=retriveDomainFromData(groupedModel,field);domains[field]=domain}}return domains}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer,i){var def=src_layer_factory.sanitizeLayerConfig(layer);def.order=i,serializedLayers.push(def)}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),layerConfig.push(config)}),layerConfig}},{key:"getLayerConfig",value:function getLayerConfig(fields,userLayerConfig,retinalConfig){var layerConfig=[],columnFields=fields.columnFields,rowFields=fields.rowFields;return columnFields.forEach(function(colField){var colFieldName=colField.toString();rowFields.forEach(function(rowField){var configs=[],rowFieldName=rowField.toString(),encoding={x:{field:colFieldName},y:{field:rowFieldName}},rowFieldType=rowField.subtype(),colFieldType=colField.subtype(),mark=encoder_helper_getDefaultMark(colFieldType,rowFieldType),defConfigs=[{mark:mark,def:{mark:mark,encoding:encoding}}],layerConfigs=getLayerConfFromFields(colField.getMembers(),rowField.getMembers(),userLayerConfig||[]);configs=layerConfigs.length?layerConfigs.map(function(layerConf){var mergedLayerConf=mergeRecursive(mergeRecursive({},defConfigs[0].def),layerConf),serializedLayerConfig=src_layer_factory.getSerializedConf(mergedLayerConf.mark,mergedLayerConf);return{mark:mergedLayerConf.mark,order:mergedLayerConf.order,def:serializedLayerConfig}}):defConfigs,layerConfig.push.apply(layerConfig,cartesian_encoder_toConsumableArray(configs))})}),this.sanitizeLayerConfig(retinalConfig,layerConfig)}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){var colProjections=fields.colProjections,rowProjections=fields.rowProjections,colFields=cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"hasMandatoryFields",this).call(this,{colProjections:colProjections}),rowFields=cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"hasMandatoryFields",this).call(this,{rowProjections:rowProjections});return colFields&&rowFields}}],[{key:"type",value:function type(){return cartesian_encoder_CARTESIAN}}]),CartesianEncoder}();function polar_encoder_typeof(obj){return(polar_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function polar_encoder_toConsumableArray(arr){return function polar_encoder_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);icounter)for(var _i=counter;_i0&&(config=mergeRecursive(config,userLayerConfig[0])),layerConfig.push(config)}),0===layerConfig.length&&(layerConfig=userLayerConfig);var sanitizedConfig=this.sanitizeLayerConfig(retinalConfig,layerConfig);return this.layers(sanitizedConfig),sanitizedConfig}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer){var def=src_layer_factory.getSerializedConf(layer.mark,layer);serializedLayers.push({mark:layer.mark,def:def})}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),def.forEach(function(conf){var encoding=conf.encoding||(conf.encoding={});!encoding.angle&&(encoding.angle={});var angleField=getObjProp(encoding.angle,"field"),angle0Field=getObjProp(encoding.angle0,"field");angleField||Object.assign(encoding.angle,{field:encodingConfigs.color&&encodingConfigs.color.field}),angle0Field||(!encoding.angle0&&(encoding.angle0={}),Object.assign(encoding.angle0,{field:encoding.angle.field}))}),layerConfig.push(config)}),layerConfig}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){var optionalProjections=fields.optionalProjections;return polar_encoder_get(polar_encoder_getPrototypeOf(PolarEncoder.prototype),"hasMandatoryFields",this).call(this,{optionalProjections:optionalProjections})}}],[{key:"type",value:function type(){return polar_encoder_POLAR}}]),PolarEncoder}();function retinal_encoder_typeof(obj){return(retinal_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function retinal_encoder_defineProperties(target,props){for(var i=0;i=drawingInfMeasure+offset?[axisScale.invert(drawingInfMeasure+offset-selectionBoxMeasure),axisScale.invert(drawingInfMeasure+offset)]:subjectStartPoint-offset1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-fadeout"),!0),classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)},brighten:function brighten(set){var config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-brighten"),!0),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-brighten"),!1)}}};function legend_highlighter_typeof(obj){return(legend_highlighter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_highlighter_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};(0,this._strategies[options.strategy||this._strategy])(selectionSet,this)}}],[{key:"formalName",value:function formalName(){return"highlighter"}}]),LegendHighlighter}();__webpack_require__(35);function legend_marker_typeof(obj){return(legend_marker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_marker_defineProperties(target,props){for(var i=0;i0?measurement[space]:0,.1*measurement.maxWidth,.1*measurement.maxHeight)}),measurement}},logicalSpace:{},metaData:{onset:function onset(context,value){return context.firebolt().attachPropagationListener(value)}},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.resetLogicalSpace(),context.store().commit("range",value),value}},scale:{},smartTicks:{},store:{},title:{sanitization:function sanitization(context,value){return mergeRecursive(context._title||{},value)}},labelManager:{},minTickDistance:{},valueParser:{defaultValue:function defaultValue(val){return val}}};var legend_helper_getScaleInfo=function getScaleInfo(scale){var scaleType=scale.constructor.type();return{scaleType:scaleType,domain:scale.uniqueValues(),steps:scale.config().stops||1,scaleFn:SCALE_FUNCTIONS[scaleType]}},legend_helper_getInterpolatedArrayData=function getInterpolatedArrayData(domainForLegend,scaleParams){var requiredWidth,requiredHeight,upperBound=domainForLegend[domainForLegend.length-1],minTickDiff=Math.ceil(domainForLegend[1]-domainForLegend[0]),maxTickDiff=Math.ceil(upperBound-domainForLegend[0]),alignment=scaleParams.alignment,smartLabelCalc=scaleParams.smartLabel,availableSpace=scaleParams.measures,minimumTickSize=scaleParams.minTickDistance,_smartLabelCalc$getOr=smartLabelCalc.getOriSize(upperBound),tickDimHeight=_smartLabelCalc$getOr.height,tickDimWidth=_smartLabelCalc$getOr.width;return Number.isInteger(upperBound)||(upperBound=upperBound.toFixed(2)),minTickDiff=minTickDiff<1?1:minTickDiff,requiredWidth=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*(tickDimWidth+minimumTickSize.width),requiredWidth-=Math.abs(maxTickDiff),requiredHeight=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*tickDimHeight,requiredHeight-=Math.abs(maxTickDiff),domainForLegend=function getcomputedArray(computationhelper,requiredMeasure,availableMeasure,domainForLegend){var currentTickValue,nextTickValue,upperBound=domainForLegend[domainForLegend.length-1],param=computationhelper.measureParam,smartLabelCalc=computationhelper.smartLabelCalc,pixelPerTick=availableMeasure[param]/upperBound;if(availableMeasure[param]>=requiredMeasure[param])return domainForLegend;currentTickValue=smartLabelCalc.getOriSize(domainForLegend[0])[param];for(var i=1;i0?titleSpace.height+effPadding:0,titleWidth=titleSpace.width+effPadding,labelSpaces=this.getLabelSpaces(effPadding,align),_computeItemSpaces=function computeItemSpaces(config,measures,data){var totalHeight=0,totalWidth=0,maxItemSpaces={width:0,height:0},effPadding=measures.effPadding,titleWidth=measures.titleWidth,labelSpaces=measures.labelSpaces,titleHeight=measures.titleHeight,maxWidth=measures.maxWidth,item=config.item,align=config.align,icon=item.icon,textOrientation=item.text.orientation,itemSpaces=[],iconSpaces=[],maxIconWidth=0;return labelSpaces.forEach(function(labelSpace,i){var itemSpace={width:0,height:0},iconSpace={width:0,height:0},datum=data[i]||{};"left"===textOrientation||"right"===textOrientation?(labelSpace.width+=effPadding,iconSpace.width=(datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),itemSpace.width=labelSpace.width+maxIconWidth,labelSpace.height=Math.max(labelSpace.height,icon.height)+effPadding,iconSpace.height=labelSpace.height,itemSpace.height=labelSpace.height):(labelSpace.width=Math.max(labelSpace.width,datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,iconSpace.width=labelSpace.width,itemSpace.width=labelSpace.width,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),labelSpace.height+=effPadding,iconSpace.height=icon.height+effPadding,itemSpace.height=labelSpace.height+iconSpace.height),"horizontal"===align?totalHeight=Math.max(totalHeight,itemSpace.height):(totalHeight+=itemSpace.height,totalWidth=Math.max(totalWidth,itemSpace.width,titleWidth)),maxItemSpaces={width:Math.max(itemSpace.width,maxItemSpaces.width),height:Math.max(itemSpace.height,maxItemSpaces.height)},itemSpaces.push(itemSpace),iconSpaces.push(iconSpace)}),itemSpaces.forEach(function(itemSpace,i){if("horizontal"===align)itemSpace.height=totalHeight,"left"===textOrientation||"right"===textOrientation?(labelSpaces[i].height=totalHeight,iconSpaces[i].height=totalHeight,itemSpaces[i].width=labelSpaces[i].width+iconSpaces[i].width+2*effPadding):(labelSpaces[i].width=iconSpaces[i].width,itemSpaces[i].width=iconSpaces[i].width,labelSpaces[i].width=iconSpaces[i].width),totalWidth+=itemSpaces[i].width;else if(itemSpace.width=Math.max(totalWidth,maxWidth),"top"===textOrientation||"bottom"===textOrientation)labelSpaces[i].width=totalWidth,iconSpaces[i].width=totalWidth,maxIconWidth=totalWidth;else{var labelWidth=labelSpaces[i].width,newLabelWidth=maxItemSpaces.width-maxIconWidth;iconSpaces[i].width=maxIconWidth,itemSpaces[i].width=labelWidth+maxIconWidth,labelSpaces[i].width=Math.max(labelWidth,newLabelWidth),totalWidth=Math.max(totalWidth,itemSpace.width)}}),totalWidth=Math.ceil(Math.max(totalWidth,titleWidth))+effPadding,totalHeight+=titleHeight+effPadding,{totalHeight:totalHeight=Math.ceil(totalHeight),totalWidth:totalWidth,itemSpaces:itemSpaces,iconSpaces:iconSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth}}(this.config(),{effPadding:effPadding,titleWidth:titleWidth,labelSpaces:labelSpaces,titleHeight:titleHeight,maxWidth:maxWidth,maxHeight:maxHeight},this.data()),totalHeight=_computeItemSpaces.totalHeight,totalWidth=_computeItemSpaces.totalWidth,itemSpaces=_computeItemSpaces.itemSpaces,iconSpaces=_computeItemSpaces.iconSpaces,maxItemSpaces=_computeItemSpaces.maxItemSpaces,maxIconWidth=_computeItemSpaces.maxIconWidth;return this.measurement({width:Math.max(totalWidth,width)+effMargin+effBorder,height:Math.max(totalHeight,height)+effMargin+effBorder,labelSpaces:labelSpaces,iconSpaces:iconSpaces,itemSpaces:itemSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth,titleSpaces:{width:Math.min(maxWidth,this.measurement().width)-effMargin-effBorder,height:titleHeight}}),this}},{key:"getTitleSpace",value:function getTitleSpace(){return this._labelManager.setStyle(renderer_utils_getSmartComputedStyle(renderer_utils_selectElement("body"),"".concat(this.config().classPrefix,"-legend-title"))),this._labelManager.getOriSize(this.title().text?this.title().text:"")}},{key:"renderTitle",value:function renderTitle(container){var _this$measurement2=this.measurement(),titleSpaces=_this$measurement2.titleSpaces,border=_this$measurement2.border,padding=_this$measurement2.padding,maxWidth=_this$measurement2.maxWidth,width=legend_helper_calculateTitleWidth(this.measurement(),this._labelManager.getOriSize(this._title.text).width,this.config()),_this$config3=this.config(),borderStyle=_this$config3.borderStyle,borderColor=_this$config3.borderColor;return function titleCreator(container,title,measurement,config){var orientation=config.item.text.orientation,textAlign="left",alignment=measurement.alignment,maxWidth=measurement.maxWidth,width=measurement.width,height=measurement.height,border=measurement.border,padding=measurement.padding;"top"!==orientation&&"bottom"!==orientation&&alignment!==HORIZONTAL||(textAlign="center");var titleWidth=Math.min(maxWidth,width),titleContainer=makeElement(container,"table",[1],"".concat(config.classPrefix,"-legend-title")).style("width","".concat(titleWidth,"px")).style("height","".concat(height,"px")).style("border-bottom","".concat(border,"px ").concat(config.borderStyle," ").concat(config.borderColor)).style("text-align",title.orientation instanceof Function?title.orientation(config.position):title.orientation);return makeElement(titleContainer,"td",[1],"".concat(config.classPrefix,"-legend-title-text")).style("width","".concat(titleWidth,"px")).style("max-width","".concat(maxWidth,"px")).style("height","100%").style("line-height",1).style("padding","".concat(padding,"px")).text(title.text).style("text-align",textAlign).style("overflow-x","scroll").node()}(container,this.title(),{height:titleSpaces.height,width:width,maxWidth:maxWidth,border:border,padding:padding,borderStyle:borderStyle,borderColor:borderColor,alignment:POSITION_ALIGNMENT_MAP[this.config().position]},this.config())}},{key:"render",value:function render(){var marginPosition,firebolt=this.firebolt(),_this$config4=this.config(),classPrefix=_this$config4.classPrefix,borderStyle=_this$config4.borderStyle,borderColor=_this$config4.borderColor,position=_this$config4.position,_this$measurement3=this.measurement(),border=_this$measurement3.border,marginHorizontal=_this$measurement3.marginHorizontal,maxHeight=_this$measurement3.maxHeight,height=_this$measurement3.height,width=_this$measurement3.width,maxWidth=_this$measurement3.maxWidth,margin=this.measurement().margin,legendContainer=makeElement(renderer_utils_selectElement(this.mount()),"div",[1],"".concat(classPrefix,"-legend-box"));switch(position){case"top":marginPosition="margin-".concat("bottom"),margin=marginHorizontal;break;case"left":marginPosition="margin-".concat("right");break;case"bottom":marginPosition="margin-".concat("top"),margin=marginHorizontal;break;default:marginPosition="margin-".concat("left")}legendContainer.classed("".concat(classPrefix,"-legend-box-").concat(this._id),!0),legendContainer.style("float","left");var widthBox=legend_helper_calculateTitleWidth(this.measurement(),this._labelManager.getOriSize(this._title.text).width,this.config()),titleWidth=Math.min(maxWidth,widthBox);return width1&&void 0!==arguments[1]?arguments[1]:[],data=this.data();return fields.length?(id=Number(id),[data.find(function(d){return id===d.id}).rawVal]):[]}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(_ref2){var fields=_ref2.fields,entrySet=_ref2.entrySet,idRangeMap=this.data().reduce(function(acc,v){return acc[v.id]=v,acc},{});return fields.reduce(function(acc,v){return acc[v]=entrySet.reduce(function(ranges,id){return id in idRangeMap&&ranges.push(idRangeMap[id].range),ranges},[]),acc},{})}},{key:"setParentInfo",value:function setParentInfo(info){this._canvasMount=info.canvasRoot}}],[{key:"create",value:function create(dependencies){return new SimpleLegend(dependencies)}},{key:"defaultConfig",value:function defaultConfig(){return legend_defaults_DEFAULT_CONFIG}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENT}}]),SimpleLegend}();function position_config_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legendOrientation=(position_config_defineProperty(_legendOrientation={},HORIZONTAL,{datasets:function datasets(data){return{row:[1],column:data}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var itemSpaces=measurement.itemSpaces,width=measurement.width,buffer=config.buffer;return{row:{width:"".concat(width+itemSpaces.length*buffer.horizontal||1,"px"),padding:"".concat(0,"px")},column:{width:function width(d,i){return"".concat(itemSpaces[i].width+buffer.horizontal,"px")},padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces;return{iconHeight:measurement.height,iconWidth:maxItemSpaces.width,stepPadding:{horizontal:!0,vertical:!1}}}}),position_config_defineProperty(_legendOrientation,"vertical",{datasets:function datasets(data){return{row:data,column:function column(d){return[d]}}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var width=measurement.width,padding=config.padding;return{row:{width:"".concat(width,"px"),padding:"".concat(padding,"px")},column:{width:"".concat(width,"px"),padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces,width=measurement.width;return{iconHeight:maxItemSpaces.height,iconWidth:width,stepPadding:{horizontal:!1,vertical:!0}}}}),_legendOrientation),positionConfig=(position_config_defineProperty(_positionConfig={},"left",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"right",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"top",legendOrientation.horizontal),position_config_defineProperty(_positionConfig,"bottom",legendOrientation.horizontal),_positionConfig),alignmentMap=(position_config_defineProperty(_alignmentMap={},"left","end"),position_config_defineProperty(_alignmentMap,"right","start"),position_config_defineProperty(_alignmentMap,"top","center"),position_config_defineProperty(_alignmentMap,"bottom","center"),_alignmentMap),itemStack=(position_config_defineProperty(_itemStack={},"left",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"right",["shape",VALUE]),position_config_defineProperty(_itemStack,"top",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"bottom",["shape",VALUE]),_itemStack),renderer_createLegendSkeleton=function createLegendSkeleton(context,container,classPrefix,data){var gradWidth,gradHeight,maxGradHeight,maxGradWidth,measurement=context.measurement(),margin=measurement.margin,border=measurement.border,titleSpaces=measurement.titleSpaces,width=measurement.width,height=measurement.height,maxWidth=measurement.maxWidth,maxHeight=measurement.maxHeight;gradHeight=height-(titleSpaces.height+2*margin+2*border),gradWidth=width-(2*margin+2*border),maxGradHeight=maxHeight-(titleSpaces.height+2*margin+2*border),maxGradWidth=maxWidth-(2*margin+2*border);var legendBody=makeElement(container,"div",[1],"".concat(classPrefix,"-legend-body"));return legendBody.style("width","".concat(gradWidth,"px")),legendBody.style("height","".concat(gradHeight,"px")),legendBody.select(".".concat(classPrefix,"-legend-overflow")).remove(),maxGradWidth&&maxGradWidth4)}(shape)?shape:defaults_ICON_MAP(shape).size(size)(),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}return d[1]="circle",createShape(d,elem,"circle")}(datum,makeElement(svg,"g",[datum[1]],"".concat(classPrefix,"-legend-icon")),icon).attr("transform","translate(".concat(transalate," ").concat(iconHeight/2,")")).attr("fill",datum[2]||color).attr("stroke",datum[2]||color):makeElement(svg,"rect",[datum[1]],"".concat(classPrefix,"-legend-icon")).attr("x",0).attr("y",0).attr("width",maxIconWidth).attr("height",iconHeight).attr("fill",datum[2]||color)};function discrete_legend_typeof(obj){return(discrete_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function discrete_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function discrete_legend_toConsumableArray(arr){return function discrete_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainForLegend.push(domain[1]),domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b}),domainForLegend=legend_helper_getInterpolatedArrayData(domainForLegend,scaleParams)):domainForLegend=legend_helper_getInterpolatedData(domain,steps-1,scaleParams),(domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=domainForLegend[i];return gradient_legend_defineProperty(_ref={},scaleType,"size"===scaleType?scale[scaleFn](ele)*scale.getScaleFactor():scale[scaleFn](ele)),gradient_legend_defineProperty(_ref,"value",+value.toFixed(1)),gradient_legend_defineProperty(_ref,"id",i),_ref}).filter(function(d){return null!==d.value})}},{key:"getLabelSpaces",value:function getLabelSpaces(effPadding){this.config({item:{text:{orientation:this.config().position}}});var axis=function createAxis(context){var data=context.data(),align=context.config().align,AxisCell=context._cells.AxisCell,newAxis=new continous_axis_ContinousAxis({id:"legend-".concat(context._id),orientation:align===ALIGN_VERTICAL?"right":"bottom",style:context._computedStyle,nice:!1,showAxisName:!1,tickValues:data.map(function(d){return d.value}),fixedBaseline:!1,labels:{rotation:null}},{labelManager:context._labelManager});return newAxis.domain(getGradientDomain(data)),newAxis.range([1,1]),(new AxisCell).source(newAxis).config({margin:{left:0,bottom:0,top:0,right:0}})}(this),axisSpace=axis.getLogicalSpace(),space={width:axisSpace.width-effPadding,height:axisSpace.height-effPadding},axisDomainLength=axis.source().domain().length,labelSpaces=new Array(axisDomainLength).fill(space);return this.axis(axis),labelSpaces}},{key:"getDrawingContext",value:function getDrawingContext(){return{svgContainer:this._legendGradientSvg}}},{key:"render",value:function render(){var firebolt=this.firebolt(),legendContainer=gradient_legend_get(gradient_legend_getPrototypeOf(GradientLegend.prototype),"render",this).call(this,this.mount());return function renderGradient(context,container){var gradHeight,gradWidth,_context$config2=context.config(),align=_context$config2.align,classPrefix=_context$config2.classPrefix,item=_context$config2.item,data=context.data(),_createLegendSkeleton=gradient_helper_createLegendSkeleton(container,classPrefix,data,context._id),legendContainer=_createLegendSkeleton.legendContainer,legendGradSvg=_createLegendSkeleton.legendGradSvg,legendGradCont=_createLegendSkeleton.legendGradCont,linearGradient=_createLegendSkeleton.linearGradient,legendRect=_createLegendSkeleton.legendRect,labelDim=context.axis().source().getAxisDimensions().tickDimensions,_context$measurement=context.measurement(),padding=_context$measurement.padding,margin=_context$measurement.margin,border=_context$measurement.border,titleSpaces=_context$measurement.titleSpaces,maxItemSpaces=_context$measurement.maxItemSpaces,maxHeight=_context$measurement.maxHeight,maxWidth=_context$measurement.maxWidth,height=_context$measurement.height,width=_context$measurement.width,gradientDimensions={};gradHeight=Math.floor(Math.min(height,maxHeight)-(titleSpaces.height+2*margin+2*border)),gradWidth=Math.floor(Math.min(width,maxWidth)-(2*margin+2*border)),align===ALIGN_HORIZONTAL?(gradientDimensions.height=item.icon.height,gradientDimensions.width=gradWidth-2*padding-labelDim.width/2,linearGradient.attr("x2","100%").attr("y1","0%"),legendGradCont.attr("transform","translate( ".concat(labelDim.width/2," ").concat(LEGEND_MARKER_PROPS_size+4,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-item.icon.height-padding,gradWidth-2*padding-1),renderer_utils_applyStyle(legendContainer,{height:"".concat(maxItemSpaces.height+border+padding,"px"),width:"".concat(Math.min(width,maxWidth),"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height),legendRect.attr("width",gradientDimensions.width-labelDim.width/2)):(gradientDimensions.height=gradHeight-2*padding-labelDim.height/2,gradientDimensions.width=item.icon.width,linearGradient.attr("x2","0%").attr("y1","100%"),legendGradCont.attr("transform","translate(".concat(LEGEND_MARKER_PROPS_size+4," ").concat(labelDim.height/2,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-2*padding-1,gradWidth-item.icon.width-2*padding),renderer_utils_applyStyle(legendContainer,{height:"".concat(Math.min(height,maxHeight),"px"),width:"".concat(maxWidth,"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height-labelDim.height/2),legendRect.attr("width",gradientDimensions.width)),renderer_utils_applyStyle(legendGradSvg,{height:"".concat(gradientDimensions.height+LEGEND_MARKER_PROPS_size+4,"px"),width:"".concat(gradientDimensions.width+LEGEND_MARKER_PROPS_size+4,"px")}),renderer_utils_applyStyle(legendRect,{fill:"url(#linear-gradient-".concat(context._id,")")}),legendGradSvg.attr("height",gradientDimensions.height+LEGEND_MARKER_PROPS_size+4),legendGradSvg.attr("width",gradientDimensions.width+LEGEND_MARKER_PROPS_size+4),context.measurement({gradientDimensions:gradientDimensions}),context._legendGradientSvg=legendGradSvg}(this,legendContainer),legendContainer.selectAll("div").style("float","left"),firebolt.mapActionsAndBehaviour(),firebolt.mapSideEffects(gradient_legend_defineProperty({},"highlight",["marker"])),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){return[[this.fieldName()],[data.value]]}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(_ref2){var fields=_ref2.fields,criteria=_ref2.criteria;return fields.reduce(function(range,v){return range[v]=criteria[v],range},{})}}],[{key:"create",value:function create(dependencies){return new GradientLegend(dependencies)}},{key:"type",value:function type(){return"gradient"}}]),GradientLegend}();function step_legend_typeof(obj){return(step_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function step_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function step_legend_toConsumableArray(arr){return function step_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainLeg.push(domain[1]),domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})):domainLeg=legend_helper_getInterpolatedData(domain,steps,scaleParams),domainLeg=(domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,range,value=null;if(i0&&void 0!==arguments[0]?arguments[0]:{},registrableComponents=this._registrableComponents,mergedPolicy=mergeRecursive(mergeRecursive({},function defaultPolicy(registrableComponents){var aliases=registrableComponents.map(function(comp){return comp.alias()});return{behaviours:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}},sideEffects:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}}}}(registrableComponents)),policy);return registrableComponents.forEach(function(canvas){canvas.firebolt().crossInteractionPolicy(mergedPolicy)}),this}}]),ActionModel}()),TITLE_CONFIG={position:"top",align:"left",padding:4,className:"".concat("muze","-title-container")},SUB_TITLE_CONFIG={position:"top",align:"left",padding:16,maxLines:2,className:"".concat("muze","-subtitle-container")},MESSAGE_CONFIG={className:"".concat("muze","-message-container"),baseFontLimit:16,upperFontLimit:24,baseSizeLimit:100,upperSizeLimit:300,fractionImage:.8,fractionChild:.7};function local_options_typeof(obj){return(local_options_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function local_options_slicedToArray(arr,i){return function local_options_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function local_options_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function local_options_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function canvas_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var canvas_local_options_localOptions=(canvas_local_options_defineProperty(_localOptions={},"rows",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"columns",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"color",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"shape",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"size",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"detail",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"layers",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"transform",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object"}}),_localOptions),canvasOptions=(canvas_local_options_defineProperty(_canvasOptions={},"title",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref){var _ref2=local_options_slicedToArray(_ref,2),arg1=_ref2[0],arg2=_ref2[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref3){var _ref4=local_options_slicedToArray(_ref3,2),title=_ref4[0],titleConfig=_ref4[1],t=title;"string"!=typeof title&&title||(t=function t(){return title});var defConfig=mergeRecursive({},TITLE_CONFIG);return[t,mergeRecursive(defConfig,titleConfig)]}}}),canvas_local_options_defineProperty(_canvasOptions,"subtitle",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref5){var _ref6=local_options_slicedToArray(_ref5,2),arg1=_ref6[0],arg2=_ref6[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref7){var _ref8=local_options_slicedToArray(_ref7,2),subtitle=_ref8[0],subtitleConfig=_ref8[1],sub=subtitle;"string"!=typeof subtitle&&subtitle||(sub=function sub(){return subtitle});var defConfig=mergeRecursive({},SUB_TITLE_CONFIG);return[sub,mergeRecursive(defConfig,subtitleConfig)]}}}),_canvasOptions);function layoutComponent_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],isGridComponent=arguments.length>3&&void 0!==arguments[3]&&arguments[3],cut="",componentRatioWidth=1,leftHeight=0,leftWidth=0;if(!component)return{first:definitionModel,second:definitionModel};var _component$getLogical=component.getLogicalSpace(),componentHeight=_component$getLogical.height,componentWidth=_component$getLogical.width,position=component.position();"top"===position||"bottom"===position?(cut="h",componentRatioWidth=componentHeight/definitionModel.remainingHeight(),leftHeight=definitionModel.remainingHeight()-componentHeight,leftWidth=definitionModel.remainingWidth()):(cut="v",componentRatioWidth=componentWidth/definitionModel.remainingWidth(),leftWidth=definitionModel.remainingWidth()-componentWidth,leftHeight=definitionModel.remainingHeight()),leftOvercomponentRationWidth=1-componentRatioWidth,definitionModel.cut(cut);var firstLaneConfig={host:component.name(),cut:null,ratioWeight:componentRatioWidth,preferred:!isGridComponent&&isPreferred,lanes:[]},firstLane=new DefinitionModel(firstLaneConfig);firstLane.remainingHeight(componentHeight),firstLane.remainingWidth(componentWidth);var secondLane=new DefinitionModel({host:null,cut:null,ratioWeight:leftOvercomponentRationWidth,preferred:!isGridComponent&&!isPreferred,lanes:[]});return secondLane.remainingHeight(leftHeight),secondLane.remainingWidth(leftWidth),isPreferred?definitionModel.lanes([firstLane]):"top"===position||"left"===position?definitionModel.lanes([firstLane,secondLane]):definitionModel.lanes([secondLane,firstLane]),{first:firstLane,second:secondLane}}function tree_toConsumableArray(arr){return function tree_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?matrix[0]:matrix[1];return isTransposed?(joinedMatrix=matrix[0].length>0?utils_toConsumableArray(matrix[0]):[],joinedMatrix=matrix[1].length>0?[].concat(utils_toConsumableArray(joinedMatrix),utils_toConsumableArray(matrix[1])):joinedMatrix):joinedMatrix=joinedMatrix.map(function(row,rowIndex){var rowData=[];return matrix[0].length>0&&(rowData=utils_toConsumableArray(matrix[0][rowIndex])),matrix[1].length>0&&(rowData=[].concat(utils_toConsumableArray(rowData),utils_toConsumableArray(matrix[1][rowIndex]))),rowData}),joinedMatrix},utils_computeLogicalSpace=function computeLogicalSpace(){var item=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},config=arguments.length>1?arguments[1]:void 0,maxMeasures=arguments.length>2?arguments[2]:void 0,_config$isTransposed=config.isTransposed,isTransposed=void 0!==_config$isTransposed&&_config$isTransposed,unitMeasures=config.unitMeasures,_getMeasureInfo=function getMeasureInfo(isTransposed){return isTransposed?{firstMeasure:enums_constants_HEIGHT,secondMeasure:"width"}:{firstMeasure:"width",secondMeasure:enums_constants_HEIGHT}}(isTransposed),firstMeasure=_getMeasureInfo.firstMeasure,secondMeasure=_getMeasureInfo.secondMeasure,values=item.values,minMeasures=function getMinMeasures(isTransposed,unitMeasures){return isTransposed?{height:0,width:unitMeasures.width}:{height:unitMeasures.height,width:0}}(isTransposed,unitMeasures);if(values[0].key){var _logicalSpace,logicalSpace=(utils_defineProperty(_logicalSpace={},firstMeasure,0),utils_defineProperty(_logicalSpace,secondMeasure,0),_logicalSpace);return values.forEach(function(valueItem){var space=computeLogicalSpace(valueItem,config,maxMeasures);logicalSpace[firstMeasure]=Math.max(logicalSpace[firstMeasure],space[firstMeasure],minMeasures[firstMeasure]),logicalSpace[secondMeasure]+=+space[secondMeasure]}),item.space=logicalSpace,logicalSpace}return function getLogicalSpace(item,measures,minMeasures){var _ref,maxMeasure=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],firstMeasure=measures.firstMeasure,secondMeasure=measures.secondMeasure,firstMeasureValue=0,secondMeasureValue=0;return item.values.forEach(function(valueArray){var _item$space,fMeasure=0,sMeasure=0;valueArray.forEach(function(placeholder,colIndex){placeholder.setAvailableSpace();var space=placeholder.getLogicalSpace(),minSecondMeasure=placeholder.getMinMeasures(minMeasures[secondMeasure]);sMeasure=Math.max(sMeasure,+space[secondMeasure],minSecondMeasure),maxMeasure[colIndex]=Math.max(maxMeasure[colIndex]||0,space[firstMeasure]),fMeasure+=+maxMeasure[colIndex]}),secondMeasureValue+=sMeasure,firstMeasureValue=Math.max(firstMeasureValue,fMeasure),item.space=(utils_defineProperty(_item$space={},secondMeasure,Math.ceil(secondMeasureValue)),utils_defineProperty(_item$space,firstMeasure,Math.ceil(firstMeasureValue)),_item$space)}),utils_defineProperty(_ref={},secondMeasure,secondMeasureValue),utils_defineProperty(_ref,firstMeasure,firstMeasureValue),_ref}(item,{firstMeasure:firstMeasure,secondMeasure:secondMeasure},minMeasures,maxMeasures)},createMatrixEachLevel=function createMatrixEachLevel(item,isTransposed){if(item.values[0].key){var arr=[];return item.values.forEach(function(child){isTransposed?createMatrixEachLevel(child,isTransposed).forEach(function(e,i){var _arr$i;arr[i]=arr[i]||[],(_arr$i=arr[i]).push.apply(_arr$i,utils_toConsumableArray(e))}):arr.push.apply(arr,utils_toConsumableArray(createMatrixEachLevel(child,isTransposed)))}),item.matrix=arr,arr}return item.matrix=isTransposed?item.values[0].map(function(col,colIndex){return item.values.map(function(row){return row[colIndex]})}):item.values,item.matrix},extraCellsRemover=function extraCellsRemover(arr,beg,end){return arr.slice(beg,-end)},visual_matrix_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},maxMeasures:{},availableSpace:{},logicalSpace:{}},visual_matrix_default_config_defaultConfig={distribution:[],classPrefix:"muze",isDistributionEqual:!0,unitMeasures:{height:100,width:100,border:1},isTransposed:!1,facet:"primary",extraCellLengths:[]};function visual_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function visual_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VisualMatrix),this._lastLevelKey=0,this._primaryMatrix=matrix[0]||[],this._secondaryMatrix=matrix[1]||[],this._maxMeasures=[],this._availableSpace={},generateGetterSetters(this,visual_matrix_props_PROPS);var defCon=Object.assign({},this.constructor.defaultConfig());this.config(mergeRecursive(defCon,config)),this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],this.config())}return function visual_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&visual_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&visual_matrix_defineProperties(Constructor,staticProps),Constructor}(VisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"computeViewableSpaces",value:function computeViewableSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"removeExtraCells",value:function removeExtraCells(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getPriorityDistribution",value:function getPriorityDistribution(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"calculateDepth",value:function calculateDepth(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeSpaces",value:function redistributeSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeViewSpaces",value:function redistributeViewSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getCellDimensions",value:function getCellDimensions(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"primaryMatrix",value:function primaryMatrix(){return arguments.length?this:this._primaryMatrix}},{key:"secondaryMatrix",value:function secondaryMatrix(){return arguments.length?this:this._secondaryMatrix}},{key:"tree",value:function tree(){return arguments.length?this:this._tree}},{key:"createTree",value:function createTree(){var _createTree2=function createTree(context){var matrixTree={},lastLevelKey=0,facet="primary",nestFn=utils_nest(),keys=[],layoutMatrix=context._layoutMatrix,primaryMatrix=context.primaryMatrix(),secondaryMatrix=context.secondaryMatrix(),_context$config=context.config(),isTransposed=_context$config.isTransposed,breakPage=_context$config.breakPage;if(isTransposed){if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var _i2=0;_i20){for(var primaryMatrixLength=primaryMatrix.length,_i3=secondaryMatrix.length-1;_i3>0;_i3--)keys.push(_i3+primaryMatrixLength);keys.push(primaryMatrixLength),"primary"===facet&&(lastLevelKey=primaryMatrixLength)}var newMatrix;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),newMatrix=layoutMatrix[0].map(function(col,colIndex){return layoutMatrix.map(function(row){return row[colIndex]})}),matrixTree=nestFn.entries(newMatrix)}else{if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var i=0;i0){for(var keyLength=primaryMatrix.length>0?primaryMatrix[0].length:0,_i=secondaryMatrix[0].length-1;_i>0;_i--)keys.push(_i+keyLength);keys.push(keyLength),"primary"===facet&&(lastLevelKey=keyLength)}else lastLevelKey=primaryMatrix.length>0?primaryMatrix[0].length-1:0;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),matrixTree=nestFn.entries(layoutMatrix)}return{tree:matrixTree,lastLevelKey:lastLevelKey}}(this),tree=_createTree2.tree,lastLevelKey=_createTree2.lastLevelKey;return this._lastLevelKey=lastLevelKey,tree}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()}},{key:"setAvailableSpace",value:function setAvailableSpace(width,height){this.availableSpace({width:width,height:height});var tree=this.tree(),heightMeasures=this.populateMaxMeasures(enums_constants_HEIGHT,tree),widthMeasures=this.populateMaxMeasures("width",tree),depth=this.calculateDepth(widthMeasures,heightMeasures);return this.viewableMatrix=this.createViewPortMatrix(depth),this.viewableMeasures=this.redistributeSpaces(width,height),this}},{key:"populateMaxMeasures",value:function populateMaxMeasures(type,matrixTree){var _this=this,depth=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,measures=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(measures[depth]=Math.max(measures[depth]||0,matrixTree.space[type]),matrixTree.values){var childDepth=depth+1;matrixTree.values.forEach(function(child){child.space&&(measures=_this.populateMaxMeasures(type,child,childDepth,measures))})}return measures}},{key:"getViewableSpaces",value:function getViewableSpaces(){return this.viewableMeasures}},{key:"getViewableMatrices",value:function getViewableMatrices(){return this.viewableMatrix}},{key:"createViewPortMatrix",value:function createViewPortMatrix(depth){var arr=[];return function createMatrixInstances(){var arr=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],depth=arguments.length>1?arguments[1]:void 0,matrixInfo=arguments.length>2?arguments[2]:void 0,layout=arguments.length>3?arguments[3]:void 0,breakPointer=layout._breakPointer,isTransposed=layout.config().isTransposed,tree=matrixInfo.tree,layoutMatrix=matrixInfo.layoutMatrix;if(0===depth){var brokenMatrix=function breakMatrix(matrix,isTransposed,breakPointer){var primaryMatrix=[],secondaryMatrix=[];return isTransposed?matrix.forEach(function(row,rowIndex){rowIndex>=breakPointer?secondaryMatrix.push(row):primaryMatrix.push(row)}):matrix.forEach(function(row,rowIndex){row.forEach(function(column,columnIndex){columnIndex>=breakPointer?(secondaryMatrix[rowIndex]=secondaryMatrix[rowIndex]||[],secondaryMatrix[rowIndex].push(column)):(primaryMatrix[rowIndex]=primaryMatrix[rowIndex]||[],primaryMatrix[rowIndex].push(column))})}),[primaryMatrix,secondaryMatrix]}(tree.matrix,isTransposed,breakPointer);return arr.push({matrix:tree.matrix,primaryMatrix:brokenMatrix[0],secondaryMatrix:brokenMatrix[1],space:tree.space}),arr}var nextLevel=depth-1;return tree.values.forEach(function(e){createMatrixInstances(arr,nextLevel,{tree:e,layoutMatrix:layoutMatrix},layout)}),arr}(arr,depth,this.removeExtraCells(),this),arr}}],[{key:"defaultConfig",value:function defaultConfig(){return visual_matrix_default_config_defaultConfig}}]),VisualMatrix}();function row_matrix_typeof(obj){return(row_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function row_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function row_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RowVisualMatrix),(_this=row_matrix_possibleConstructorReturn(this,row_matrix_getPrototypeOf(RowVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length>0?matrix[0][0].length:0,_this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],_this.config()),_this._tree={key:ROW_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function row_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&row_matrix_setPrototypeOf(subClass,superClass)}(RowVisualMatrix,visual_matrix_VisualMatrix),function row_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&row_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&row_matrix_defineProperties(Constructor,staticProps),Constructor}(RowVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!1),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),widths=_this2$getCellDimensi.widths,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=[height,height],columnMeasures=widths;return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=extraCellsRemover(tree.matrix,begCellLen,endCellLen),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var remainingAvailWidth,remainingWidth,cWidths=[],conditions=[],maxPrioritySpace=0,matrix=measures.matrix,availableWidth=measures.width,maxWidths=measures.maxMeasures,currentWidth=measures.maxWidth,height=measures.height,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length?this.primaryMatrix()[0].length:0,dist=[];remainingAvailWidth=availableWidth,remainingWidth=currentWidth,(conditions=2===priority?[primaryMatrixLength-1,primaryMatrixLength]:0===priority?[primaryMatrixLength-1]:[primaryMatrixLength]).forEach(function(i){dist[i]=maxWidths[i],maxPrioritySpace+=maxWidths[i],remainingAvailWidth-=dist[i],remainingWidth-=dist[i]}),matrix[0].forEach(function(e,i){-1===conditions.indexOf(i)&&(dist[i]=remainingAvailWidth*(maxWidths[i]/remainingWidth))}),matrix.forEach(function(row){return row.forEach(function(col,cIdx){-1===conditions.indexOf(cIdx)?(col.setAvailableSpace(dist[cIdx],height),cWidths[cIdx]=Math.max(cWidths[cIdx]||0,Math.floor(col.getLogicalSpace().width))):cWidths[cIdx]=0})});var prioritySpace=availableWidth-cWidths.reduce(function(t,n){return t+n});return prioritySpace<0?cWidths=cWidths.map(function(){return 0}):conditions.forEach(function(i){cWidths[i]=Math.floor(prioritySpace*(dist[i]/maxPrioritySpace||1))}),cWidths}},{key:"calculateDepth",value:function calculateDepth(widthMeasures,heightMeasures){var i,height=this.availableSpace().height;for(i=0;i0?logicalWidths:maxMeasures.map(function(){return 0}),rHeights=function getDistributedHeight(context){var heightWithoutGutter,distSum=0,gutterSum=0,isTransposed=context.isTransposed,distribution=context.distribution,availableHeight=context.availableHeight,height=context.height,isDistributionEqual=context.isDistributionEqual,gutter=context.gutter,matrix=context.matrix,cIdx=context.cIdx;distribution&&void 0!==distribution[0]&&(distSum=distribution.reduce(function(t,n){return t+=n})),gutter&&void 0!==gutter[0]&&(gutterSum=gutter.reduce(function(t,n){return t+=n})),heightWithoutGutter=availableHeight-Math.floor(availableHeight*gutterSum);var colLen=matrix.length;return matrix.map(function(row,rIdx){var space=row[cIdx].getLogicalSpace().height,distHeight=space+space/height*(heightWithoutGutter-height);return isTransposed||(distribution.length>0&&colLen===distribution.length?distHeight=heightWithoutGutter*distribution[rIdx]/distSum:(isDistributionEqual||0===context.height)&&(distHeight=heightWithoutGutter/colLen)),Math.floor(distHeight)})}({matrix:matrix,cIdx:this._lastLevelKey,height:mHeight,availableHeight:height,isDistributionEqual:isDistributionEqual,distribution:distribution,isTransposed:isTransposed,gutter:gutter}),maxWidths.length>0&&(cWidths=cWidths.map(function(e,i){return Math.max(e,maxWidths[0][i]||0)})),maxWidths.push(cWidths);for(var x=0;x=breakPointer&&(columnWidths[1][cIdx-breakPointer]=colWidth,widths[1]=(widths[1]||0)+colWidth),cIdx===_this4._lastLevelKey&&(rowHeights[0][rIdx]=colHeight,rowHeights[1][rIdx]=colHeight)})}),{heights:[0,0],widths:widths,rowHeights:rowHeights,columnWidths:columnWidths}}}]),RowVisualMatrix}();function column_matrix_typeof(obj){return(column_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function column_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function column_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ColumnVisualMatrix),(_this=column_matrix_possibleConstructorReturn(this,column_matrix_getPrototypeOf(ColumnVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length,_this._tree={key:COLUMN_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function column_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&column_matrix_setPrototypeOf(subClass,superClass)}(ColumnVisualMatrix,visual_matrix_VisualMatrix),function column_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&column_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&column_matrix_defineProperties(Constructor,staticProps),Constructor}(ColumnVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!0),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height,width=measures.width;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i,height:height},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),heights=_this2$getCellDimensi.heights,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=heights,columnMeasures=[width,width];return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=tree.matrix.map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var height=measures.height,maxHeights=measures.maxHeights,remainingHeight=height,heightDist=[],conditions=[],divider=2,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length;return 2===priority?(conditions=[primaryMatrixLength-1,primaryMatrixLength],divider=2):(conditions=0===priority?[primaryMatrixLength-1]:[primaryMatrixLength],divider=1),maxHeights.forEach(function(heights,index){-1===conditions.indexOf(index)&&(heightDist[index]=heights,remainingHeight-=heights)}),remainingHeight<0?heightDist=heightDist.map(function(){return 0}):conditions.forEach(function(condition){heightDist[condition]=Math.min(maxHeights[condition],remainingHeight/divider)}),heightDist}},{key:"calculateDepth",value:function calculateDepth(widthMeasures){var j,width=this.availableSpace().width;for(j=0;j0)distWidth=availableWidth*distribution[colIndex]/distSum;else if(isDistributionEqual||0===width){var rowLen=row.length;distWidth=availableWidth/rowLen}return Math.floor(distWidth)})}({row:matrix[this._lastLevelKey],width:mWidth,availableWidth:width},this.config());matrix.forEach(function(row,rIdx){return row.forEach(function(col,cIdx){var oldLogicalSpace=col.getLogicalSpace();col.setAvailableSpace(cWidths[cIdx]-borderWidth,oldLogicalSpace.height),rHeights[rIdx]=Math.max(rHeights[rIdx]||0,Math.floor(col.getLogicalSpace().height))})}),maxHeights.length>0&&(rHeights=rHeights.map(function(e,i){return Math.max(e,maxHeights[0][i])})),maxHeights.push(rHeights);for(var x=0;x=breakPointer&&(rowHeights[1][rIdx-breakPointer]=colHeight,heights[1]=(heights[1]||0)+colHeight),rIdx===_this4._lastLevelKey&&(columnWidths[0][cIdx]=colWidth,columnWidths[1][cIdx]=colWidth)})}),{heights:heights,widths:[0,0],rowHeights:rowHeights,columnWidths:columnWidths}}}]),ColumnVisualMatrix}();function layout_helper_toConsumableArray(arr){return function layout_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);imaxMeasure&&layout.scrollInfo(computations_defineProperty({},scrollType,!0)),Math.max(maxMeasure,actualMeasure)}}(layout,paginationDetailsMap[matrixType],relatedMaxMeasure,buffer)},computations_getMatrixHeightDetails=function getMatrixHeightDetails(layout,columnMatrixWidth){var height=layout.measurement().height,buffer=layout.config().buffer,_getHeightRequiredByC=function getHeightRequiredByColMatrix(layout,columnMatrixWidth){var height=layout.measurement().height,columnMatrix=layout.columnMatrix(),maxColumnMatrixHeight=Math.min(columnMatrix.getLogicalSpace().height,height/2);columnMatrix.setAvailableSpace(columnMatrixWidth,maxColumnMatrixHeight);var columnViewSpace=columnMatrix.getViewableSpaces()[layout.config().columnPointer];return{columnMatrixHeight:columnViewSpace.height.primary+columnViewSpace.height.secondary,maxColumnMatrixHeight:maxColumnMatrixHeight}}(layout,columnMatrixWidth),columnMatrixHeight=_getHeightRequiredByC.columnMatrixHeight,maxColumnMatrixHeight=_getHeightRequiredByC.maxColumnMatrixHeight,maxHeightAvailableForRowMatrix=height-Math.min(maxColumnMatrixHeight,columnMatrixHeight);return{columnMatrixHeight:columnMatrixHeight,maxColumnMatrixHeight:maxColumnMatrixHeight,rowMatrixHeight:paginationMeasureGetter(layout,"row",maxHeightAvailableForRowMatrix,buffer),maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix}},bufferCondition={isScroll:!0,pagination:"scroll"},computations_getActualBufferFromConfig=function getActualBufferFromConfig(layout){var buffer=layout.config().buffer,_map2=computations_slicedToArray([enums_constants_HORIZONTAL,enums_constants_VERTICAL].map(function(type){return function getBufferFromCondition(layout,type){var scrollInfo=layout.scrollInfo(),currentBufferType={pagination:layout.config().pagination,isScroll:scrollInfo[type]};return Object.keys(bufferCondition).every(function(e){return bufferCondition[e]===currentBufferType[e]})}(layout,type)?buffer:0}),2);return{horizontalBuffer:_map2[0],verticalBuffer:_map2[1]}},computations_computeLayoutMeasurements=function computeLayoutMeasurements(layout){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_getMatrixWidthDetail=function getMatrixWidthDetails(layout){var rowMatrix=layout.rowMatrix(),width=layout.measurement().width,_layout$config3=layout.config(),border=_layout$config3.border,buffer=_layout$config3.buffer,borderWidth=border.width,rowMatrixWidth=getMatrixMeasurement(rowMatrix,"width"),maxRowMatrixWidth=Math.min(rowMatrixWidth+buffer,width/2),maxWidthAvailableForColumnMatrix=width-maxRowMatrixWidth-borderWidth;return{rowMatrixWidth:rowMatrixWidth,maxRowMatrixWidth:maxRowMatrixWidth,columnMatrixWidth:paginationMeasureGetter(layout,"column",maxWidthAvailableForColumnMatrix,0),maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}}(layout),rowMatrixWidth=_getMatrixWidthDetail.rowMatrixWidth,maxRowMatrixWidth=_getMatrixWidthDetail.maxRowMatrixWidth,maxWidthAvailableForColumnMatrix=_getMatrixWidthDetail.maxWidthAvailableForColumnMatrix,columnMatrixWidth=_getMatrixWidthDetail.columnMatrixWidth,_getMatrixHeightDetai=computations_getMatrixHeightDetails(layout,columnMatrixWidth),columnMatrixHeight=_getMatrixHeightDetai.columnMatrixHeight,rowMatrixHeight=_getMatrixHeightDetai.rowMatrixHeight,maxHeightAvailableForRowMatrix=_getMatrixHeightDetai.maxHeightAvailableForRowMatrix,_getActualBufferFromC=computations_getActualBufferFromConfig(layout),horizontalBuffer=_getActualBufferFromC.horizontalBuffer,verticalBuffer=_getActualBufferFromC.verticalBuffer;rowMatrix.setAvailableSpace(maxRowMatrixWidth-verticalBuffer,rowMatrixHeight-horizontalBuffer);var rowViewableSpaces=rowMatrix.getViewableSpaces(),columnViewableSpaces=columnMatrix.getViewableSpaces();return setViewSpaces(layout,"row",rowViewableSpaces),setViewSpaces(layout,"column",columnViewableSpaces),function setValueMatrixMeasurements(layout,rowViewableSpaces,columnViewableSpaces){var _ref,_ref2,_ref3,_ref4,_ref5,centerMatrix=layout.centerMatrix(),border=layout.config().border,matrices=layout.matrices(),top=matrices.top,bottom=matrices.bottom,borderWidth=border.width,rowHeights=(_ref=[]).concat.apply(_ref,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.rowHeights.primary}))),rowWidthsPrimary=(_ref2=[]).concat.apply(_ref2,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.primary}))),rowWidthsSecondary=(_ref3=[]).concat.apply(_ref3,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.secondary}))),columnWidths=(_ref4=[]).concat.apply(_ref4,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.columnWidths.primary}))),columnHeightsPrimary=columnViewableSpaces[0].rowHeights.primary,columnHeightsSecondary=(_ref5=[]).concat.apply(_ref5,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.rowHeights.secondary})));centerMatrix.forEach(function(matrix,rIdx){matrix.forEach(function(placeholder,cIdx){placeholder.setAvailableSpace(columnWidths[cIdx]-borderWidth,rowHeights[rIdx]-borderWidth)})}),computations_setAvailableSpace(top[0],rowWidthsPrimary,columnHeightsPrimary),computations_setAvailableSpace(top[2],rowWidthsSecondary,columnHeightsPrimary),computations_setAvailableSpace(bottom[0],rowWidthsPrimary,columnHeightsSecondary),computations_setAvailableSpace(bottom[2],rowWidthsSecondary,columnHeightsSecondary)}(layout,rowViewableSpaces,columnViewableSpaces),{rowMatrixHeight:rowMatrixHeight-horizontalBuffer,rowMatrixWidth:rowMatrixWidth-verticalBuffer,maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix-horizontalBuffer,columnMatrixHeight:columnMatrixHeight,columnMatrixWidth:columnMatrixWidth,maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}},measureSum=function measureSum(measureArr){return measureArr.reduce(function(total,measure){return total+measure},0)};function layout_typeof(obj){return(layout_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function layout_defineProperties(target,props){for(var i=0;i0&&(leftMatrix=[].concat(layout_helper_toConsumableArray(topLeft),layout_helper_toConsumableArray(leftRows),layout_helper_toConsumableArray(bottomLeft))),rightRows.length>0&&(rightMatrix=[].concat(layout_helper_toConsumableArray(topRight),layout_helper_toConsumableArray(rightRows),layout_helper_toConsumableArray(bottomRight))),topColumns.length>0&&topColumns[0].length>0&&(topMatrix=topColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(topLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(topRight[i]))})),bottomColumns.length>0&&bottomColumns[0].length>0&&(bottomMatrix=bottomColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(bottomLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(bottomRight[i]))})),context.rowMatrix(new row_matrix_RowVisualMatrix([leftMatrix,rightMatrix],{isDistributionEqual:isRowSizeEqual,distribution:distribution.rows,gutter:gutterSpace.rows,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.row,breakPage:breakPage.rows.map(function(e){return e+Math.max(topLeft.length,topRight.length)}),extraCellLengths:[topLeft.length,bottomLeft.length]})),begColCells=topLeft.length>0?topLeft[0].length:bottomLeft.length>0?bottomLeft[0].length:0,endColCells=topRight.length>0?topRight[0].length:bottomRight.length>0?bottomRight[0].length:0,context.columnMatrix(new column_matrix_ColumnVisualMatrix([topMatrix,bottomMatrix],{isDistributionEqual:isColumnSizeEqual,distribution:distribution.columns,gutter:gutterSpace.columns,isTransposed:!0,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.col,breakPage:breakPage.columns,extraCellLengths:[begColCells,endColCells]})),context.centerMatrix(valueMatrix),matrices}(this,_matrices),this):layout_get(layout_getPrototypeOf(GridLayout.prototype),"matrices",this).call(this,_matrices)}},{key:"triggerReflow",value:function triggerReflow(){this.scrollInfo({horizontal:!1,vertical:!1});var _computeLayoutMeasure=computations_computeLayoutMeasurements(this),maxHeightAvailableForRowMatrix=_computeLayoutMeasure.maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix=_computeLayoutMeasure.maxWidthAvailableForColumnMatrix;return this.setViewInformation(maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix),this}},{key:"gotoPage",value:function gotoPage(type,pageNumber){var pageType=type.toLowerCase(),totalPages=this.viewInfo().viewMatricesInfo["".concat(pageType,"Pages")],pointer=Math.min(Math.max(1,pageNumber),totalPages);return this.config(function layout_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},"".concat(pageType,"Pointer"),pointer-1)),this.setViewInformation(),this.renderGrid(),this}},{key:"pages",value:function pages(type){var viewMatricesInfo=this.viewInfo().viewMatricesInfo,pageType=type.toLowerCase();return{totalPages:viewMatricesInfo["".concat(pageType,"Pages")],currentPage:this.config()["".concat(pageType,"Pointer")]+1}}},{key:"viewInfo",value:function viewInfo(){return arguments.length?(this._viewInfo=arguments.length<=0?void 0:arguments[0],this):this._viewInfo}},{key:"scrollInfo",value:function scrollInfo(){return arguments.length?(this._scrollInfo=mergeRecursive(this._scrollInfo,arguments.length<=0?void 0:arguments[0]),this):this._scrollInfo}},{key:"setViewInformation",value:function setViewInformation(maxRowHeight,maxColWidth){var _this$config2=this.config(),rowPointer=_this$config2.rowPointer,columnPointer=_this$config2.columnPointer,border=_this$config2.border,viewMatricesInfo=function getViewMatrices(layout,rowPointer,columnPointer){for(var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),centerMatrix=layout.centerMatrix(),matrices=layout.matrices(),rowMatrices=rowMatrix.getViewableMatrices(),columnMatrices=columnMatrix.getViewableMatrices(),centralMatrixPointer={row:0,column:0},i=rowPointer-1;i>=0;i--){var length=Math.max(rowMatrices[i].primaryMatrix.length,rowMatrices[i].secondaryMatrix.length);centralMatrixPointer.row+=length}for(var _i=columnPointer-1;_i>=0;_i--){var matrix=columnMatrices[_i],primaryMatrix=matrix.primaryMatrix,secondaryMatrix=matrix.secondaryMatrix,_length=Math.max(primaryMatrix[0]?primaryMatrix[0].length:0,secondaryMatrix[0]?secondaryMatrix[0].length:0);centralMatrixPointer.column+=_length}matrices.top[1]=columnMatrices[columnPointer].primaryMatrix,matrices.bottom[1]=columnMatrices[columnPointer].secondaryMatrix,matrices.center[0]=rowMatrices[rowPointer].primaryMatrix,matrices.center[2]=rowMatrices[rowPointer].secondaryMatrix;var rowMatrixLen=Math.max(matrices.center[0].length,matrices.center[2].length),columnMatrixLen=Math.max(matrices.top[1][0]?matrices.top[1][0].length:0,matrices.bottom[1][0]?matrices.bottom[1][0].length:0);return matrices.center[1]=centerMatrix.slice(centralMatrixPointer.row,centralMatrixPointer.row+rowMatrixLen).map(function(matrix){return matrix.slice(centralMatrixPointer.column,centralMatrixPointer.column+columnMatrixLen)}),{matrices:matrices,rowPages:rowMatrices.length,columnPages:columnMatrices.length}}(this,rowPointer,columnPointer),layoutDimensions=function getViewMeasurements(layout,maxRowHeight,maxColWidth){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_layout$config=layout.config(),columnPointer=_layout$config.columnPointer,rowPointer=_layout$config.rowPointer,rowSpaces=rowMatrix.getViewableSpaces()[rowPointer],colSpaces=columnMatrix.getViewableSpaces()[columnPointer],rowHeights=rowSpaces.rowHeights,rowMatrixWidth=rowSpaces.width,columnWidths=colSpaces.columnWidths,columnMatrixHeight=colSpaces.height,leftWidth=rowMatrixWidth.primary,rightWidth=rowMatrixWidth.secondary,topHeight=columnMatrixHeight.primary,bottomHeight=columnMatrixHeight.secondary,centerHeight=measureSum(rowHeights.primary),centerWidth=measureSum(columnWidths.primary),viewWidth=[leftWidth,Math.min(centerWidth,maxColWidth),rightWidth],viewHeight=[topHeight,Math.min(centerHeight,maxRowHeight),bottomHeight];return{viewWidth:viewWidth,viewHeight:viewHeight,actualCenterMeasures:{height:centerHeight,width:centerWidth},totalMeasures:{width:measureSum(viewWidth),height:measureSum(viewHeight)},unitHeights:rowHeights,unitWidths:columnWidths}}(this,maxRowHeight,maxColWidth);return layoutDimensions.border=border,this.viewInfo({viewMatricesInfo:viewMatricesInfo,layoutDimensions:layoutDimensions}),this}}],[{key:"defaultViewInfo",value:function defaultViewInfo(){return Object.assign({},{layoutDimensions:{border:this.defaultConfig().border,viewHeight:[0,0,0],viewWidth:[0,0,0]},viewMatricesInfo:{columnPages:0,rowPages:0,matrices:{top:[],center:[],bottom:[]}}})}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENTS}},{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIGURATION}},{key:"create",value:function create(){return new GridLayout(null,null,this.defaultMeasurement(),this.defaultConfig())}}]),GridLayout}();function border_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _matrixSpanGeneratorM,_spanApplierMap,border_helper_specificBorderApplier=function specificBorderApplier(params){var borderTypes=params.borderTypes,showBorders=params.showBorders,cells=params.cells,borderInfo=params.borderInfo,name=params.name,isFacet=params.isFacet,color=borderInfo.color,style=borderInfo.style,width=borderInfo.width;borderTypes.forEach(function(borderType){!function applySpecificBorder(params){var type=params.type,borderWidth=params.borderWidth,borderStyle=params.borderStyle,cells=params.cells,isFacet=params.isFacet,color=params.color;isFacet?(cells.style("border-".concat(type,"-width"),"".concat(borderWidth,"px")),cells.style("border-".concat(type,"-style"),"".concat(borderStyle))):cells.style("border-".concat(type),"".concat(borderWidth,"px ").concat(borderStyle," ").concat(color))}({cells:cells,color:showBorders[borderType]?color:"rgba(0,0,0,0)",type:borderType,borderWidth:width,borderStyle:style,name:name,isFacet:isFacet})})},border_helper_applyBorders=function applyBorders(params){var cells=params.cells,border=params.border,row=params.row,column=params.column,isFacet=params.isFacet,showHeaders=params.showHeaders,name="".concat(ROW_MATRIX_INDEX[VIEW_INDEX[row]],"-").concat(COLUMN_MATRIX_INDEX[column]),borderApplierFn=function borderApplier(cells,borderInfo,name,isFacet){var _ref2,showRowBorders=borderInfo.showRowBorders,showColBorders=borderInfo.showColBorders,showValueBorders=borderInfo.showValueBorders;return border_helper_defineProperty(_ref2={},"row",function(){return border_helper_specificBorderApplier({borderTypes:["top","bottom"],showBorders:showRowBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"column",function(){return border_helper_specificBorderApplier({borderTypes:["left","right"],showBorders:showColBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"center",function(){return border_helper_specificBorderApplier({borderTypes:["left","right","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"left",function(){return border_helper_specificBorderApplier({borderTypes:["left"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"right",function(){return border_helper_specificBorderApplier({borderTypes:["right"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"".concat("center").concat("left"),function _(){return border_helper_specificBorderApplier({borderTypes:["left","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"".concat("center").concat("right"),function _(){return border_helper_specificBorderApplier({borderTypes:["right","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),_ref2}(cells,border,name,isFacet),borderMapVal=function borderMap(isFacet,showHeaders){var _ref;return border_helper_defineProperty(_ref={},"".concat("top","-").concat("left"),isFacet&&showHeaders?"left":null),border_helper_defineProperty(_ref,"".concat("top","-").concat("middle"),"column"),border_helper_defineProperty(_ref,"".concat("top","-").concat("right"),isFacet&&showHeaders?"right":null),border_helper_defineProperty(_ref,"".concat("center","-").concat("left"),isFacet?"".concat("center").concat("left"):"row"),border_helper_defineProperty(_ref,"".concat("center","-").concat("middle"),"center"),border_helper_defineProperty(_ref,"".concat("center","-").concat("right"),isFacet?"".concat("center").concat("right"):"row"),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("left"),null),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("middle"),"column"),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("right"),null),_ref}(isFacet,showHeaders)[name];borderMapVal&&borderApplierFn[borderMapVal]()};function span_maker_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var orderMaker=function orderMaker(arr){return Array.from(Array(arr.length).keys())},nestByStack=function nestByStack(stack,updateArr){var optionalParams=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},order=optionalParams.order,keyFn=optionalParams.keyFn,arr=updateArr.slice(),currStack=stack.slice(),prevStack=currStack.slice();if(order=order||Array.from(Array(arr.length).keys()),keyFn=keyFn||function(v){return v},0===currStack.length){var _newArr=[];return order.forEach(function(e){_newArr.push(arr[e])}),{prevStack:prevStack,currStack:arr,arr:_newArr}}for(var arrVal="",stackVal="",newArr=[],i=order.length-1;i>=0;i--){var currElemIndex=order[i];if((arrVal+=keyFn(arr[currElemIndex]))===(stackVal+=keyFn(currStack[currElemIndex])))newArr[currElemIndex]=null;else{stackVal="";for(var j=i;j0&&void 0!==arguments[0]?arguments[0]:1,placeholder=arguments.length>1?arguments[1]:void 0,config=arguments.length>2?arguments[2]:void 0,index=arguments.length>3?arguments[3]:void 0,height=placeholder.availHeight(),width=placeholder.availWidth(),borderWidth=config.border.width,unitWidths=config.dimensions.unitWidths,col=index.col;return span_maker_defineProperty(_ref={},"rowSpan",function(){placeholder.setAvailableSpace(width,height*span),1===span&&renderer_utils_selectElement(this).style("height","".concat(height*span+borderWidth,"px"))}),span_maker_defineProperty(_ref,"colSpan",function(){var primaryUnitWidth=unitWidths.primary[col];if(span>1){for(var cumulativeWidth=0,i=col;i0&&void 0!==arguments[0]?arguments[0]:0}},{key:"type",get:function get(){return"simple"}}],[{key:"formalName",value:function formalName(){return"SimpleCell"}},{key:"defaultConfig",value:function defaultConfig(){return{}}}]),SimpleCell}();function enums_defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var visual_cell_src_props_PROPS,enums_defaults_DEFAULT_CONFIG=(enums_defaults_defineProperty(_DEFAULT_CONFIG={},"margin",(enums_defaults_defineProperty(_CONSTANTS$MARGIN={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$MARGIN)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"spaceFixer",2),enums_defaults_defineProperty(_DEFAULT_CONFIG,"isOffset",!1),enums_defaults_defineProperty(_DEFAULT_CONFIG,"verticalAlign",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"textAlign","center"),enums_defaults_defineProperty(_DEFAULT_CONFIG,"show",!0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"maxLines",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"minCharacters",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"rotation",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"padding",(enums_defaults_defineProperty(_CONSTANTS$PADDING={},visual_cell_src_enums_constants_LEFT,8),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_RIGHT,8),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_TOP,10),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$PADDING)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"headerPadding",(enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD={},visual_cell_src_enums_constants_LEFT,8),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_RIGHT,5),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_TOP,2),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_BOTTOM,5),_CONSTANTS$HEADER_PAD)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"titlePadding",(enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$TITLE_PADD)),_DEFAULT_CONFIG);function visual_cell_src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_PROPS={mount:{},availHeight:{},availWidth:{},config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config,value)}},logicalSpace:{},minSpacing:{},source:{}},packages_visual_cell_src_props_PROPS=(visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS={},GEOM,mergeRecursive({data:{},caption:{},config:{},axes:{},facetByFields:{},fields:{},transform:{},layerDef:{},detailFields:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_TEXT,mergeRecursive({smartText:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_AXIS,DEFAULT_PROPS),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,BLANK,DEFAULT_PROPS),visual_cell_src_props_PROPS);function axis_cell_typeof(obj){return(axis_cell_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function axis_cell_defineProperties(target,props){for(var i=0;i(availWidth||0)&&maxLines&&(space.height=space.oriTextHeight*maxLines),availWidth&&availWidthcurrHeight?(sections++,currWidth=0,currHeight=legHeight):sections<0&§ions++,sectionComponents[sections]=sectionComponents[sections]||[],currHeight-=Math.min(leg.measurement().height,currHeight),currWidth=Math.max(Math.min(leg.measurement().width,leg.measurement().maxWidth),currWidth),sectionComponents[sections].push({legend:leg,legendHeight:legHeight,legendWidth:currWidth})});var mount=makeElement(legendMount,["div"],sectionComponents,"".concat(classPrefix,"-legend-section"));mount.classed("".concat(classPrefix,"-legend-vertical-section"),!0).style("width",function(d){return"".concat(d[0].legendWidth,"px")}),makeElement(mount,["div"],function(d){return d},"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legendWidth,"px")})}else{var _mount=makeElement(legendMount,"div",[1],"".concat(classPrefix,"-legend-section"));_mount.classed("".concat(classPrefix,"-legend-horizontal-section"),!0),_mount.classed("".concat(classPrefix,"-legend-section-",0),!0).style("width","".concat(legWidth,"px")),makeElement(_mount,"div",this.components,"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).style("width",function(d){return"".concat(d.legend.measurement().width,"px")}).each(function(d){d.legend.mount(this)})}}},{key:"draw",value:function draw(container){this.renderLegend(container||document.getElementById(this.renderAt()))}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.boundBox(params.config.measurement.legendSpace),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.components=params.component,this.params=params,this.target(params.config.target),this.position(params.config.position);var _defaultAlignmentHelp=function defaultAlignmentHelper(position){var alignment=null,alignWith="".concat(ROW_MATRIX_INDEX[1],"-").concat(COLUMN_MATRIX_INDEX[1]);switch(position){case src_constants_TOP:case src_constants_BOTTOM:alignment=HORIZONTAL_CENTER;break;case src_constants_LEFT:case src_constants_RIGHT:alignment=VERTICAL_CENTER;break;default:alignment=VERTICAL_CENTER}return{alignment:alignment,alignWith:alignWith}}(params.config.position),alignWith=_defaultAlignmentHelp.alignWith,alignment=_defaultAlignmentHelp.alignment;this.className(params.config.className),this.alignWith(params.config.alignWith||alignWith),this.alignment(params.config.alignment||alignment)}},{key:"setComponentInfo",value:function setComponentInfo(params){var rootNode=params.rootNode;this.components.forEach(function(legendInfo){legendInfo.legend.setParentInfo({canvasRoot:rootNode})})}}]),LegendComponent}(),helper_d3Drag=(__webpack_require__(37),renderer_utils_getD3Drag()),arrowSizeMap={left:"width",right:"width",top:"height",bottom:"height"},getUnitPositions=function getUnitPositions(unitMeasures,totalLength,viewLength){var currentLen=0;return(unitMeasures.primary&&unitMeasures.primary.length?unitMeasures.primary:unitMeasures.secondary).map(function(e){var unitPosition=100*currentLen/(totalLength-viewLength);return currentLen+=e,unitPosition})},helper_createScrollBarArrow=function createScrollBarArrow(mount,type,config){var classPrefix=config.classPrefix,thickness=config.thickness,arrow=makeElement(mount,"div",[type],"".concat(classPrefix,"-scroll-arrow-").concat(type));return arrow.classed("".concat(classPrefix,"-scroll-arrow"),!0),arrow.style(arrowSizeMap[type],"".concat(thickness,"px")),makeElement(arrow,"div",[1],"".concat(classPrefix,"-scroll-arrow-chevron")).attr("id","".concat(classPrefix,"-scroll-arrow-chevron-").concat(type)),arrow},helper_createScrollBarRect=function createScrollBarRect(mount,config){var classPrefix=config.classPrefix,rect=makeElement(mount,"div",[1],"".concat(classPrefix,"-scroll-rect"));return{rect:rect,mover:makeElement(rect,"div",[1],"".concat(classPrefix,"-scroll-mover"))}},applyScrollMouseDownAction=function applyScrollMouseDownAction(moverRect,scrollMaker,speed){var mover=moverRect.mover,rect=moverRect.rect,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y;scrollMaker.changeMoverPosition({x:x-rectX+speed,y:y-rectY+speed})},helper_registerListenerOnArrow=function registerListenerOnArrow(scrollMaker,moverRect,arrowType,speed){var timer="",arrow=scrollMaker._components[arrowType],isTouchDevice=hasTouch();arrow.on(isTouchDevice?"touchstart":"mousedown",function(){renderer_utils_getEvent().preventDefault(),timer=setInterval(function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)},100)}).on(isTouchDevice?"touchend":"mouseup",function(){renderer_utils_getEvent().preventDefault(),clearInterval(timer)}).on("click",function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)})},helper_registerListeners=function registerListeners(scrollMaker){var moverRect=scrollMaker._components.moverRect,speed=scrollMaker.config().speed;helper_registerListenerOnArrow(scrollMaker,moverRect,"prevArrow",-speed),function applyMoverDrag(scrollMaker,moverRect){var startPos={},moverStartPos=0,rectStartPos=0,endPos={},mover=moverRect.mover,rect=moverRect.rect;mover.call(helper_d3Drag().on("start",function(){var event=renderer_utils_getEvent();moverStartPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect(),startPos={x:event.x,y:event.y}}).on("drag",function(){var event=renderer_utils_getEvent(),window=getWindow(),distanceMoved_x=(endPos={x:event.x,y:event.y}).x-startPos.x,distanceMoved_y=endPos.y-startPos.y,actualPosition={x:moverStartPos.x+distanceMoved_x-rectStartPos.x+window.pageXOffset,y:moverStartPos.y+distanceMoved_y-rectStartPos.y+window.pageYOffset};scrollMaker.changeMoverPosition(actualPosition)}))}(scrollMaker,moverRect),function applyRectClick(scrollMaker,moverRect){moverRect.rect.on("click",function(){var event=renderer_utils_getEvent();scrollMaker.emptyScrollAreaClick(event)})}(scrollMaker,moverRect),helper_registerListenerOnArrow(scrollMaker,moverRect,"nextArrow",speed)},scroll_bar_maker_props_PROPS={config:{sanitization:function sanitization(context,value){return value=mergeRecursive(context._config,value)}},manager:{},unitPositions:{},logicalSpace:{}};function scroll_maker_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=horizontal_scroll_maker_get(horizontal_scroll_maker_getPrototypeOf(HorizontalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,config,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"left",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"right",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitWidths=_this$logicalSpace.unitWidths,scrollBarWithouArrowLength=width-2*height;rect.style("width","".concat(dimensions.width-2*height,"px")),rect.style("height","".concat(100,"%")),mover.style("width","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style("height","".concat(100,"%")),mover.style(src_constants_LEFT,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitWidths,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.xrectStartPos.width?rectStartPos.width-moverPos.width:newPosition.x,mover.style(src_constants_LEFT,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:0,x:moverPos.x-rectStartPos.x-delta}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.width)/100;return this.changeMoverPosition({y:0,x:movement}),this}}],[{key:"type",value:function type(){return"horizontal"}}]),HorizontalScrollMaker}(),vertical:function(_ScrollMaker){function VerticalScrollMaker(){return function vertical_scroll_maker_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VerticalScrollMaker),vertical_scroll_maker_possibleConstructorReturn(this,vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker).apply(this,arguments))}return function vertical_scroll_maker_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&vertical_scroll_maker_setPrototypeOf(subClass,superClass)}(VerticalScrollMaker,scroll_maker_ScrollMaker),function vertical_scroll_maker_createClass(Constructor,protoProps,staticProps){return protoProps&&vertical_scroll_maker_defineProperties(Constructor.prototype,protoProps),staticProps&&vertical_scroll_maker_defineProperties(Constructor,staticProps),Constructor}(VerticalScrollMaker,[{key:"createScroll",value:function createScroll(mountPoint){var dimensions=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=vertical_scroll_maker_get(vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"top",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"bottom",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitHeights=_this$logicalSpace.unitHeights,scrollBarWithouArrowLength=height-2*width;rect.style("height","".concat(scrollBarWithouArrowLength,"px")),rect.style("width","".concat(100,"%")),mover.style("width","".concat(100,"%")),mover.style("height","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style(src_constants_TOP,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitHeights,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.yrectStartPos.height?rectStartPos.height-moverPos.height:newPosition.y,mover.style(src_constants_TOP,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:moverPos.y-rectStartPos.y-delta,x:0}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.height)/100;return this.changeMoverPosition({x:0,y:movement}),this}}],[{key:"type",value:function type(){return"vertical"}}]),VerticalScrollMaker}()},ScrollComponent=function(_MuzeComponent){function ScrollComponent(params){var _this;!function scroll_component_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ScrollComponent);var ScrollMaker=scrollMakerMap[params.config.type];return params.component=new ScrollMaker,params.component.config(params.config.scrollBarComponentConfig),params.component.logicalSpace(params.dimensions),(_this=scroll_component_possibleConstructorReturn(this,scroll_component_getPrototypeOf(ScrollComponent).call(this,params.name,params.component.getLogicalSpace(),0))).setParams(params),_this}return function scroll_component_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&scroll_component_setPrototypeOf(subClass,superClass)}(ScrollComponent,MuzeComponent),function scroll_component_createClass(Constructor,protoProps,staticProps){return protoProps&&scroll_component_defineProperties(Constructor.prototype,protoProps),staticProps&&scroll_component_defineProperties(Constructor,staticProps),Constructor}(ScrollComponent,[{key:"manager",value:function manager(){return arguments.length?(this.component.manager(arguments.length<=0?void 0:arguments[0]),this):this.component.manager()}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){return this.component.scrollDeltaTo(delta),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){return this.component.scrollTo(scrollPercentage),this}},{key:"scrollToUnitIndex",value:function scrollToUnitIndex(unitIndex){var unitPositions=this.component.unitPositions(),sanitizedUnitIndex=Math.min(Math.max(0,unitIndex),unitPositions.length-1);return this.component.scrollTo(unitPositions[sanitizedUnitIndex]),this}},{key:"getScrollPositionsForUnits",value:function getScrollPositionsForUnits(){return this.component.unitPositions()}},{key:"draw",value:function draw(container){return this.component.createScroll(container||document.getElementById(this.renderAt())),this}},{key:"attachScrollAction",value:function attachScrollAction(externalAction){return this.component.attachScrollAction(externalAction),this}},{key:"detachScrollAction",value:function detachScrollAction(){return this.component.detachScrollAction(),this}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.component.config(params.config.scrollBarComponentConfig),this.component.logicalSpace(params.dimensions),this.boundBox(this.component.getLogicalSpace()),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.component=params.component||this.component,this.params=params,this.target(params.config.target),this.position(params.config.position),this.className(params.config.className),this.alignWith(params.config.alignWith),this.alignment(params.config.alignment)}},{key:"remove",value:function remove(){this.component.remove()}}]),ScrollComponent}();__webpack_require__(38);function matrix_component_typeof(obj){return(matrix_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function matrix_component_defineProperties(target,props){for(var i=0;iMath.abs(wheelDeltaY)&&scrollBarManager.preventBrowserScroll("horizontal",event).triggerScrollBarAction("horizontal",wheelDeltaX/30),0!==wheelDeltaY&&Math.abs(wheelDeltaX)MESSAGE_CONFIG.baseSizeLimit?MESSAGE_CONFIG.fractionChild*height:0,message=config.message;renderer_utils_applyStyle(node,{width:"".concat(width,"px"),height:"".concat(height,"px")});var childNode=makeElement(node,"div",[1],"".concat(className,"-child")),imageNode=makeElement(childNode,"div",[1],"".concat(className,"-child-img")),messageNode=makeElement(childNode,"div",[1],"".concat(className,"-child-message"));renderer_utils_applyStyle(childNode,{width:width,height:"".concat(childHeight,"px")}),renderer_utils_applyStyle(imageNode,{width:width,height:"".concat(childHeight*MESSAGE_CONFIG.fractionImage,"px")}),imageNode.html('\n\x3c!-- Generator: Sketch 60.1 (88133) - https://sketch.com --\x3e\n\nGroup 23\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ');var textElement=makeElement(messageNode,"text",[1]);renderer_utils_applyStyle(messageNode,{"font-size":"".concat(function formatFontSize(width,height){var baseFontLimit=MESSAGE_CONFIG.baseFontLimit,upperFontLimit=MESSAGE_CONFIG.upperFontLimit,baseSizeLimit=MESSAGE_CONFIG.baseSizeLimit,upperSizeLimit=MESSAGE_CONFIG.upperSizeLimit,fontSize=upperFontLimit,dim=widthbaseSizeLimit&&dim0?heightAttr:height,minHeight),availableWidthForCanvas=Math.max(widthAttr>0?widthAttr:width,minWidth),_createHeaders=function createHeaders(context,canvasHeight,canvasWidth){var headerHeight=0,headers={},subtitle=context.subtitle(),isSubtitle=title_maker_resolveTitleSubTitleContent(subtitle[0]);return canvasHeight>=200&&canvasWidth>=200&&["title","subtitle"].forEach(function(type){var headerOptions=context[type](),content=title_maker_resolveTitleSubTitleContent(headerOptions[0]);if(content){var config=headerOptions[1];config.width=context.width(),config.height=context.height(),config.classPrefix=context.config().classPrefix,config.content=content,config.padding="title"!==type||isSubtitle.length?config.padding:subtitle[1].padding;var _createHeading=createHeading(config,type,context.dependencies().smartlabel,context["".concat(type,"Cell")]),height=_createHeading.height,cell=_createHeading.cell;headers["".concat(type,"Cell")]=cell,context._composition[type]=cell,headerHeight+=height}}),{headerHeight:headerHeight,headers:headers}}(context,availableHeightForCanvas,availableWidthForCanvas),headers=_createHeaders.headers,headerHeight=_createHeaders.headerHeight,legends=function createLegend(context,headerHeight,height,width){var measurement={height:height,width:width,headerHeight:headerHeight},legend=context.config().legend,show=legend.show,position=legend.position;legend.classPrefix=context.config().classPrefix;var align=position===src_constants_LEFT||position===src_constants_RIGHT?"vertical":"horizontal";return legend.show=show?"vertical"===align&&width>200||"horizontal"===align&&height>200:show,legend.align=align,legend_maker_legendInitializer(legend,context,measurement,context.composition().legend||{})}(context,headerHeight,availableHeightForCanvas,availableWidthForCanvas);context._composition.legend={},legends.forEach(function(e){context._composition.legend[e.scaleType]=e.legend});var legendSpace=function getLegendSpace(legends,legendConfig,availableHeight,availableWidth){var legendSpace={width:0,height:0};return legends.map(function(legendInfo){return legendInfo.legend.measurement()}).forEach(function(space){var height,width;width=Math.min(space.width,space.maxWidth),height=Math.min(space.height,space.maxHeight),"horizontal"===legendConfig.align?legendSpace.width+width>availableWidth?(legendSpace.width=availableWidth,legendSpace.height+=height):(legendSpace.width+=width,legendSpace.height=Math.max(legendSpace.height,height)):legendSpace.height+height>availableHeight?(legendSpace.height=height,legendSpace.width+=width):(legendSpace.height+=height,legendSpace.width=Math.max(legendSpace.width,width))}),"horizontal"===legendConfig.align&&(legendSpace.width=availableWidth),legendSpace}(legends,legend,availableHeightForCanvas,availableWidthForCanvas),legendWidth=legendPosition===src_constants_LEFT||legendPosition===src_constants_RIGHT?legendSpace.width:0,legendHeight=legendPosition===src_constants_TOP||legendPosition===src_constants_BOTTOM?legendSpace.height:0,components={headers:headers,legends:legends,canvases:[context],rows:rows,columns:columns,values:values,cornerMatrices:visGroup.cornerMatrices()},measurement={mountSpace:{height:height,width:width},headerHeight:headerHeight,legendSpace:legendSpace,canvasWidth:availableWidthForCanvas,canvasHeight:availableHeightForCanvas,width:availableWidthForCanvas-legendWidth,height:availableHeightForCanvas-headerHeight-legendHeight,minUnitHeight:context.minUnitHeight(),minUnitWidth:context.minUnitWidth()};return{layoutConfig:layoutConfig=mergeRecursive(layoutConfig,{classPrefix:classPrefix,showHeaders:showHeaders,border:mergeRecursive(visGroup.metaData().border,context.config().border),layoutArrangement:layoutArrangement,legend:legend,buffer:scrollBar.thickness,pagination:pagination,title:titleConfig,subtitle:subtitleConfig,isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,mount:mount,priority:priority}),components:components,measurement:measurement}},componentIndexes={title:0,subtitle:1,legend:2,verticalScrollBar:3,horizontalScrollBar:4,grid:5,message:6},componentNames={0:"title",1:"subtitle",2:"legend",3:"verticalScrollBar",4:"horizontalScrollBar",5:"grid",6:"message"},layout_maker_renderLayout=function renderLayout(canvas,renderDetails){var layoutManager=canvas._layoutManager,gridLayout=canvas.layout(),grid=componentIndexes.grid,compWrappers=component_wrapper_maker_componentWrapperMaker(canvas,gridLayout,renderDetails),componentWrappers=Object.keys(componentIndexes).map(function(e){return compWrappers[e]});componentWrappers[grid]&&function createScrollManager(componentWrappers,canvas){var verticalScrollBar=componentIndexes.verticalScrollBar,grid=componentIndexes.grid,horizontalScrollWrapper=componentWrappers[componentIndexes.horizontalScrollBar],verticalScrollWrapper=componentWrappers[verticalScrollBar],gridWrapper=componentWrappers[grid],scrollBarManager=new ScrollManager,scrollBarComponents={};verticalScrollWrapper&&(scrollBarComponents.vertical=verticalScrollWrapper),horizontalScrollWrapper&&(scrollBarComponents.horizontal=horizontalScrollWrapper),scrollBarManager.scrollBarComponents(scrollBarComponents).attachedComponents({grid:gridWrapper}),canvas.composition().hScrollBar=horizontalScrollWrapper,canvas.composition().vScrollBar=verticalScrollWrapper,[horizontalScrollWrapper,verticalScrollWrapper].forEach(function(wrapper){wrapper&&wrapper.manager(scrollBarManager)}),gridWrapper.scrollBarManager(scrollBarManager)}(componentWrappers,canvas),componentWrappers.forEach(function(componentWrapper,index){if(!componentWrapper){var deleteElementName=componentNames[index];layoutManager.removeComponent(deleteElementName)}}),layoutManager.registerComponents(componentWrappers).compute(),function attachListeners(componentWrappers){componentWrappers.forEach(function(componentWrapper){componentWrapper&&componentWrapper.attachListener()})}(componentWrappers)};function canvas_firebolt_helper_toConsumableArray(arr){return function canvas_firebolt_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1||rowProj.length>1))},helper_dispatchBehaviours=function dispatchBehaviours(firebolt,_ref){var payload=_ref.payload,unit=_ref.unit,behaviours=_ref.behaviours,_firebolt$context$con2=firebolt.context.config().interaction.behaviours,behaviourConfs=void 0===_firebolt$context$con2?{}:_firebolt$context$con2,unitFirebolt=unit.firebolt();behaviours.forEach(function(action){var mode=behaviourConfs[action],targetFirebolt=unitFirebolt;"common"===mode&&(targetFirebolt=firebolt);var actions=targetFirebolt._actions.behavioural;payload.criteria=helper_addFacetDataAndMeasureNames(payload.criteria,unit.facetFieldsMap(),unit.layers().map(function(layer){return Object.keys(layer.data().getFieldspace().getMeasure())})),targetFirebolt.dispatchBehaviour(action,payload,{propagate:!1,applySideEffect:!1});var identifiers=actions[action].propagationIdentifiers();firebolt.propagate(action,payload,identifiers,{sideEffects:getSideEffects(action,targetFirebolt._behaviourEffectMap),sourceUnitId:unit.id(),sourceId:targetFirebolt.id(),propagationDataSource:targetFirebolt.getPropagationSource()})})};function group_firebolt_typeof(obj){return(group_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function group_firebolt_defineProperties(target,props){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{};!function propagateValues(instance,action){var config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},payload=config.payload,identifiers=config.identifiers,sourceUnitId=config.sourceUnitId,sourceCanvasId=config.sourceCanvasId,dataModel=config.propagationDataSource,sideEfffects=instance._sideEffectDefinitions,behaviourEffectMap=instance._behaviourEffectMap,propagationBehaviour=instance._propagationBehaviourMap[action]||action;payload.sourceUnit=sourceUnitId,payload.action=action,payload.sourceCanvas=sourceCanvasId;var groupId=sourceCanvasId,sourceBehaviour=instance._actions.behavioural[action],isMutableAction=!!sourceBehaviour&&sourceBehaviour.constructor.mutates(),propConfig={payload:payload,action:action,criteria:identifiers,isMutableAction:isMutableAction,groupId:groupId,sourceId:config.sourceId,filterFn:function filterFn(entry,propagationConf){var effects=behaviourEffectMap[entry.config.action],mutates=!entry.config.groupId||!!effects&&effects.some(function(d){return sideEfffects[d.name||d].mutates()});return entry.config.groupId!==propagationConf.groupId&&mutates},enabled:function enabled(propConf,firebolt){return action===propagationBehaviour||propConf.payload.sourceCanvas===firebolt.sourceCanvas()}};if(dataModel.propagate(identifiers,propConfig,!0),action!==propagationBehaviour){var behaviourInstance=instance._actions.behavioural[propagationBehaviour];isMutableAction=!!behaviourInstance&&behaviourInstance.constructor.mutates(),dataModel.propagate(identifiers,Object.assign({},propConfig,{isMutableAction:isMutableAction,applyOnSource:!1,action:propagationBehaviour,sourceId:isMutableAction?groupId:sourceUnitId,enabled:function enabled(propConf,firebolt){return propConf.payload.sourceCanvas!==firebolt.sourceCanvas()}}),!0,{filterImmutableAction:function filterImmutableAction(actionInf,propInf){return actionInf.groupId!==propInf.groupId}})}}(this,behaviour,Object.assign({payload:payload,identifiers:identifiers,propagationFields:this._propagationFields,sourceId:this.id(),sourceCanvasId:this.id(),propagationDataSource:this.data()},auxConfig))}},{key:"getPropagationSource",value:function getPropagationSource(){return this.data()}},{key:"sourceCanvas",value:function sourceCanvas(){return this.context.alias()}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects,payload,propagationInf){var _this5=this;if(payload.sideEffects)return[{effects:payload.sideEffects,behaviours:[payload.action]}];var mode=this.context.config().interaction.tooltip.mode;return propagationInf.propPayload=propagationInf.propPayload||payload,sideEffects.forEach(function(d){var mappedEffects=d.effects;mappedEffects=mappedEffects.filter(function(se){return(se.name!==side_effects_TOOLTIP||"fragmented"!==mode)&&isSideEffectEnabled(_this5,{se:se,propagationInf:propagationInf})}),d.effects=mappedEffects}),sideEffects}}],[{key:"defaultInteractionPolicy",value:function defaultInteractionPolicy(){return function(){}}},{key:"defaultCrossInteractionPolicy",value:function defaultCrossInteractionPolicy(){return _defaultCrossInteractionPolicy}}]),GroupFireBolt}(),APP_INITIAL_STATE={app:{group:{},units:{},layers:{},canvas:{}},local:{canvas:{},group:{},units:{},layers:{}}};function canvas_typeof(obj){return(canvas_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function canvas_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function canvas_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:COMPONENTS,reg=Object.assign({},components);return{register:function register(cls){var key=cls.formalName();return reg[key]=cls,componentRegistry},get:function get(){return reg}}}(COMPONENTS),cells:cell_registry(),layers:layer_registry(),interactions:registry_registry};__webpack_require__(39);function muze_slicedToArray(arr,i){return function muze_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function muze_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function muze_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var muze_transactor=store_transactor,Smartlabel=SmartlabelManager_default.a,muze_enableChainedTransaction=enableChainedTransaction,muze_LifeCycleManager=lifecycle_manager,DataModel=datamodel_default.a,muze_Store=store_Store,globalCache={},defaultRegistry=default_registry_registry.components,overrideRegistryDefinitions=function overrideRegistryDefinitions(overrideRegistry,registry){overrideRegistry.forEach(function(def){registry.register(def)})},muze_muze=function muze(){var _transactor2=muze_slicedToArray(muze_transactor({},src_options),2),env=_transactor2[0],globalStore=_transactor2[1],components=Object.assign({},default_registry_registry.components.get()),componentSubRegistryDef=Object.assign({},SUBREGISTRIES),componentSubRegistry={};for(var prop in componentSubRegistryDef)componentSubRegistry[prop]=componentSubRegistryDef[prop](default_registry_registry[prop].get());return env.canvas=function(){var settings=globalStore.serialize(),canvas=canvas_Canvas.withSettings(settings,{components:components,componentSubRegistry:componentSubRegistry,interactions:default_registry_registry.interactions},env.globalDependencies());return muze_enableChainedTransaction(globalStore,canvas,Object.keys(settings)),canvas},env.globalDependencies=function(){return globalCache.smartlabel||(globalCache.smartlabel=new Smartlabel(1,"body")),{smartlabel:globalCache.smartlabel,lifeCycleManager:new muze_LifeCycleManager}},env.settings=function(){return globalStore.serialize()},env.registry=function(){for(var _len=arguments.length,overrideRegistry=new Array(_len),_key=0;_key<_len;_key++)overrideRegistry[_key]=arguments[_key];return overrideRegistry.length?(overrideRegistry.forEach(function(def){var prop=def.formalName();prop in defaultRegistry&&(components[prop]=def)}),env):components},env.cellRegistry=function(){for(var cellRegistry=componentSubRegistry.cellRegistry,_len2=arguments.length,overrideRegistry=new Array(_len2),_key2=0;_key2<_len2;_key2++)overrideRegistry[_key2]=arguments[_key2];return overrideRegistry.length?(overrideRegistryDefinitions(overrideRegistry,cellRegistry),env):cellRegistry.get()},env.layerRegistry=function(){for(var layerRegistry=componentSubRegistry.layerRegistry,_len3=arguments.length,overrideRegistry=new Array(_len3),_key3=0;_key3<_len3;_key3++)overrideRegistry[_key3]=arguments[_key3];return overrideRegistry.length?(overrideRegistryDefinitions(overrideRegistry,layerRegistry),env):layerRegistry.get()},env};muze_muze.registry=default_registry_registry,muze_muze.Components={VisualLayer:{layers:{BaseLayer:base_layer_BaseLayer,LineLayer:line_LineLayer,TextLayer:TextLayer,TickLayer:TickLayer,PointLayer:point_PointLayer,SimpleLayer:simple_layer_SimpleLayer,AreaLayer:area_AreaLayer,ArcLayer:ArcLayer},helpers:helpers,enums:src_enums_namespaceObject,layerMixins:layerMixins},VisualUnit:{constructor:visual_unit_VisualUnit,helpers:visual_unit_src_helper_namespaceObject,enums:visual_unit_src_enums_namespaceObject,UnitFireBolt:firebolt_UnitFireBolt},VisualGroup:{constructor:visual_group,Encoders:encoder_namespaceObject,encoderHelpers:encoder_helper_namespaceObject,groupUtils:group_utils_namespaceObject,enums:visual_group_src_enums_constants_namespaceObject},Canvas:{constructor:canvas_Canvas},Firebolt:{constructor:firebolt_Firebolt}};var SideEffects={sideEffects:src_side_effects_namespaceObject,standards:{SurrogateSideEffect:SurrogateSideEffect,SpawnableSideEffect:spawnable_SpawnableSideEffect,GenericSideEffect:generic}},Behaviours={behaviouralActions:behavioural_namespaceObject,standards:{GenericBehaviour:generic_GenericBehaviour,PersistentBehaviour:persistent_PersistentBehaviour,VolatileBehaviour:volatile_VolatileBehaviour}};muze_muze.DataModel=DataModel,muze_muze.version=muze_package.version,muze_muze.SideEffects=SideEffects,muze_muze.ActionModel=actionModel,muze_muze.layerFactory=src_layer_factory,muze_muze.Operators=operators_namespaceObject,muze_muze.Behaviours=Behaviours,muze_muze.utils=muze_utils_src_namespaceObject,muze_muze.Model=(new muze_Store).model.constructor;__webpack_exports__.default=muze_muze}])}); //# sourceMappingURL=muze.js.map \ No newline at end of file diff --git a/dist/muze.js.map b/dist/muze.js.map index 02a14ecc..50a945f9 100644 --- a/dist/muze.js.map +++ b/dist/muze.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://muze/webpack/universalModuleDefinition","webpack://muze/webpack/bootstrap","webpack://muze/./packages/muze-utils/node_modules/datamodel/dist/datamodel.js","webpack://muze/(webpack)/buildin/module.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/SmartlabelManager.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/lib.js","webpack://muze/./packages/muze-utils/node_modules/hyperdis/dist/hyperdis.js","webpack://muze/./packages/muze/src/index.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/container-manager.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisector.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisect.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/range.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ticks.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/threshold/sturges.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/map.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/nest.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/set.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/ordinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/band.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/define.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/lab.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basis.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/rgb.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basisClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/object.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/string.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/value.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/parse.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/date.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/round.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/decompose.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/zoom.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/hsl.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/hcl.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/piecewise.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/quantize.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/continuous.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatDecimal.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/exponent.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatSpecifier.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTrim.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatPrefixAuto.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatRounded.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTypes.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatGroup.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatNumerals.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionFixed.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/tickFormat.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionPrefix.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionRound.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/nice.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/log.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/pow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantize.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/threshold.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/interval.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/millisecond.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/second.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/minute.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/hour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/day.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/week.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/month.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/year.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMinute.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcHour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcDay.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcWeek.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMonth.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcYear.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/isoFormat.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/isoParse.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/time.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category10.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20b.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20c.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/sequential.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Dark2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Paired.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Accent.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set3.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/ramp.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Blues.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/BrBG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PRGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PiYG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PuOr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdGy.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/Spectral.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greens.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greys.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Purples.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Reds.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js","webpack://muze/./packages/muze-utils/src/enums/namespace.js","webpack://muze/./packages/muze-utils/src/enums/reserved-fields.js","webpack://muze/./packages/muze-utils/src/enums/common-props.js","webpack://muze/./packages/muze-utils/src/enums/constants.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/axis.js","webpack://muze/./packages/muze-utils/node_modules/d3-path/src/path.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/arc.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/line.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/area.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/radial.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/lineRadial.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/diamond.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/star.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/square.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/triangle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/wye.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/noop.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/basis.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/basisClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/basisOpen.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/bundle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/cardinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/cardinalClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/cardinalOpen.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/catmullRom.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/catmullRomClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/catmullRomOpen.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/linearClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/monotone.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/natural.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/step.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/stack.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/cubic.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/poly.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/sin.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/bounce.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/back.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/elastic.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/RedBlackTree.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Edge.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Cell.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Beach.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Diagram.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/voronoi.js","webpack://muze/./packages/muze-utils/src/DataSystem/selection.js","webpack://muze/./packages/muze-utils/src/enums/stack-config.js","webpack://muze/./packages/muze-utils/src/common-utils.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/circle.js","webpack://muze/./packages/muze-utils/src/DataSystem/dataSelect.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/diverging.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/expand.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/wiggle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/pie.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespaces.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespace.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/creator.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selector.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selectorAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/matcher.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sparse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/enter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/data.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sort.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/window.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/classed.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/html.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/raise.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/lower.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/insert.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/clone.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/exit.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/join.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/order.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/call.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/nodes.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/node.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/size.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/empty.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/each.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/property.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/append.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/datum.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/local.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/sourceEvent.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/mouse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/touch.js","webpack://muze/./packages/muze-utils/node_modules/d3-dispatch/src/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/noevent.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/nodrag.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/event.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/drag.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timer.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timeout.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/schedule.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/tween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/interpolate.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selection.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attrTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/styleTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/delay.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/ease.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/end.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/interrupt.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/interrupt.js","webpack://muze/./packages/muze-utils/src/renderer-utils.js","webpack://muze/./packages/muze-utils/src/store.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/event-list.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/lifecycle-manager.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/index.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/helper.js","webpack://muze/./packages/muze-utils/src/index.js","webpack://muze/./packages/muze-firebolt/src/enums/actions.js","webpack://muze/./packages/muze-firebolt/src/enums/selection.js","webpack://muze/./packages/muze-firebolt/src/selection-set/index.js","webpack://muze/./packages/muze-firebolt/src/selection-set/selection-set.js","webpack://muze/./packages/muze-firebolt/src/helper/index.js","webpack://muze/./packages/muze-firebolt/src/firebolt.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/generic.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/volatile.js","webpack://muze/./packages/muze-firebolt/src/enums/behaviours.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/highlight.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/brush.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/filter.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/persistent.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/select.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-event.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/hover.js","webpack://muze/./packages/muze-firebolt/src/enums/constants.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/click.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/drag.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/longtouch.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/touch-drag.js","webpack://muze/./packages/muze-firebolt/src/enums/side-effects.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/props.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js","webpack://muze/./packages/muze-firebolt/src/side-effects/surrogate.js","webpack://muze/./packages/muze-firebolt/src/side-effects/spawnable.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/helper.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/selection-box-drag.js","webpack://muze/./packages/muze-tooltip/src/constants.js","webpack://muze/./packages/muze-tooltip/src/default-config.js","webpack://muze/./packages/muze-tooltip/src/helper.js","webpack://muze/./packages/muze-tooltip/src/content.js","webpack://muze/./packages/muze-tooltip/src/tooltip.js","webpack://muze/./packages/muze-firebolt/src/enums/tooltip-strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/helper/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/crossline/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/filter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/anchors/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/persistent-anchors.js","webpack://muze/./packages/muze-firebolt/src/side-effects/brush-anchors.js","webpack://muze/./packages/muze-firebolt/src/behaviour-effect-map.js","webpack://muze/./packages/visual-layer/src/enums/constants.js","webpack://muze/./packages/visual-layer/src/layers/area/default-config.js","webpack://muze/./packages/visual-layer/src/simple-layer/simple-layer.js","webpack://muze/./packages/visual-layer/src/base-layer/props.js","webpack://muze/./packages/visual-layer/src/enums/props.js","webpack://muze/./packages/muze-axis/src/enums/axis-orientation.js","webpack://muze/./packages/muze-axis/src/enums/scale-type.js","webpack://muze/./packages/muze-axis/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/scale-creator.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/default-config.js","webpack://muze/./packages/muze-axis/src/axis-renderer.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/skip-ticks.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/space-setter.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/helper.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/props.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/simple-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/linear.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/log.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/pow.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/continous-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/band-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/time-axis.js","webpack://muze/./packages/muze-axis/src/color-axis/color-maps.js","webpack://muze/./packages/muze-axis/src/color-axis/defaults.js","webpack://muze/./packages/muze-axis/src/color-axis/props.js","webpack://muze/./packages/muze-axis/src/helper.js","webpack://muze/./packages/muze-axis/src/color-axis/color-strategy.js","webpack://muze/./packages/muze-axis/src/color-axis/color-axis.js","webpack://muze/./packages/muze-axis/src/size-axis/defaults.js","webpack://muze/./packages/muze-axis/src/size-axis/size-strategy.js","webpack://muze/./packages/muze-axis/src/size-axis/props.js","webpack://muze/./packages/muze-axis/src/size-axis/size-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/defaults.js","webpack://muze/./packages/muze-axis/src/shape-axis/props.js","webpack://muze/./packages/muze-axis/src/shape-axis/shape-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/helper.js","webpack://muze/./packages/muze-axis/src/polar-axis/props.js","webpack://muze/./packages/muze-axis/src/polar-axis/angle-axis.js","webpack://muze/./packages/visual-group/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/polar-axis/radius-axis.js","webpack://muze/./packages/muze-axis/src/data-type-scale-map.js","webpack://muze/./packages/transform/src/group-transform/index.js","webpack://muze/./packages/transform/src/identity-transform/index.js","webpack://muze/./packages/transform/src/transform-factory/index.js","webpack://muze/./packages/transform/src/enums/transform-type.js","webpack://muze/./packages/transform/src/stack-transform/index.js","webpack://muze/./packages/visual-layer/src/helpers/index.js","webpack://muze/./packages/visual-layer/src/base-layer/local-options.js","webpack://muze/./packages/visual-layer/src/base-layer/listener-map.js","webpack://muze/./packages/visual-layer/src/base-layer/base-layer.js","webpack://muze/./packages/visual-layer/src/layers/line/renderer.js","webpack://muze/./packages/visual-layer/src/layers/line/default-config.js","webpack://muze/./packages/visual-layer/src/layers/line/line.js","webpack://muze/./packages/visual-layer/src/layers/area/renderer.js","webpack://muze/./packages/visual-layer/src/layers/area/area.js","webpack://muze/./packages/visual-layer/src/layers/arc/default-config.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc-helper.js","webpack://muze/./packages/visual-layer/src/layers/text/renderer.js","webpack://muze/./packages/visual-layer/src/layers/text/default-config.js","webpack://muze/./packages/visual-layer/src/layers/text/text.js","webpack://muze/./packages/visual-layer/src/layers/point/renderer.js","webpack://muze/./packages/visual-layer/src/layers/point/default-config.js","webpack://muze/./packages/visual-layer/src/layers/point/point.js","webpack://muze/./packages/visual-layer/src/layers/bar/renderer.js","webpack://muze/./packages/visual-layer/src/layers/bar/default-config.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar-helper.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar.js","webpack://muze/./packages/visual-layer/src/layers/tick/default-config.js","webpack://muze/./packages/visual-layer/src/layers/tick/renderer.js","webpack://muze/./packages/visual-layer/src/layers/tick/tick.js","webpack://muze/./packages/visual-layer/src/enums/layer-types.js","webpack://muze/./packages/visual-layer/src/layer-factory/layer-factory.js","webpack://muze/./packages/visual-layer/src/layer-factory/index.js","webpack://muze/./packages/visual-layer/src/defaults.js","webpack://muze/./packages/visual-group/src/visual-group/local-options.js","webpack://muze/./packages/visual-group/src/simple-group/simple-group.js","webpack://muze/./packages/visual-unit/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/visual-unit/src/helper/index.js","webpack://muze/./packages/visual-unit/src/enums/constants.js","webpack://muze/./packages/visual-unit/src/helper/grid-lines.js","webpack://muze/./packages/visual-unit/src/listener-map.js","webpack://muze/./packages/visual-unit/src/enums/reactive-props.js","webpack://muze/./packages/visual-unit/src/props.js","webpack://muze/./packages/visual-unit/src/firebolt/payload-generator.js","webpack://muze/./packages/visual-unit/src/firebolt/data-propagator.js","webpack://muze/./packages/visual-unit/src/firebolt/index.js","webpack://muze/./packages/visual-unit/src/firebolt/helper.js","webpack://muze/./packages/visual-unit/src/default-config.js","webpack://muze/./packages/visual-unit/src/local-options.js","webpack://muze/./packages/visual-unit/src/visual-unit.js","webpack://muze/./packages/visual-group/src/variable/variable.js","webpack://muze/./packages/visual-group/src/variable/composed-vars.js","webpack://muze/./packages/visual-group/src/variable/simple-var.js","webpack://muze/./packages/visual-group/src/encoder/field-sanitizer.js","webpack://muze/./packages/visual-group/src/encoder/visual-encoder.js","webpack://muze/./packages/visual-group/src/enums/scale-maps.js","webpack://muze/./packages/visual-group/src/data-type-scale-map.js","webpack://muze/./packages/visual-group/src/encoder/encoder-helper.js","webpack://muze/./packages/visual-group/src/encoder/cartesian-encoder.js","webpack://muze/./packages/visual-group/src/encoder/polar-encoder.js","webpack://muze/./packages/visual-group/src/encoder/retinal-encoder.js","webpack://muze/./packages/visual-group/src/group-helper/group-utils.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-model.js","webpack://muze/./packages/visual-group/src/group-helper/cell-creator.js","webpack://muze/./packages/visual-group/src/group-helper/resolver-props.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-resolver.js","webpack://muze/./packages/visual-group/src/visual-group/value-matrix.js","webpack://muze/./packages/visual-group/src/visual-group/helper.js","webpack://muze/./packages/visual-group/src/visual-group/change-listener.js","webpack://muze/./packages/visual-group/src/visual-group/props.js","webpack://muze/./packages/visual-group/src/visual-group/visual-group.js","webpack://muze/./packages/muze-legend/src/firebolt/behavioural/select.js","webpack://muze/./packages/muze-legend/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/muze-legend/src/firebolt/behaviour-effect-map.js","webpack://muze/./packages/muze-legend/src/enums/behaviours.js","webpack://muze/./packages/muze-legend/src/enums/side-effects.js","webpack://muze/./packages/muze-legend/src/enums/constants.js","webpack://muze/./packages/muze-legend/src/firebolt/helper.js","webpack://muze/./packages/muze-legend/src/firebolt/legend-firebolt.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/drag.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/hover.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/click.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/index.js","webpack://muze/./packages/muze-legend/src/enums/actions.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/selection-box-drag.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/selection-box/index.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/index.js","webpack://muze/./packages/muze-legend/src/legend/props.js","webpack://muze/./packages/muze-legend/src/legend/defaults.js","webpack://muze/./packages/muze-legend/src/legend/legend-helper.js","webpack://muze/./packages/muze-legend/src/legend/simple-legend.js","webpack://muze/./packages/muze-legend/src/legend/position-config.js","webpack://muze/./packages/muze-legend/src/legend/renderer.js","webpack://muze/./packages/muze-legend/src/legend/discrete-legend.js","webpack://muze/./packages/muze-legend/src/legend/gradient-helper.js","webpack://muze/./packages/muze-legend/src/legend/gradient-legend.js","webpack://muze/./packages/muze-legend/src/legend/step-legend.js","webpack://muze/./packages/muze/src/constants.js","webpack://muze/./packages/muze/src/operators.js","webpack://muze/./packages/muze/src/action-model.js","webpack://muze/./packages/muze/src/canvas/defaults.js","webpack://muze/./packages/muze/src/canvas/local-options.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/layoutComponent.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/dummy-component.js","webpack://muze/./packages/muze/src/defaults.js","webpack://muze/./packages/layout/src/tree-layout/constants/defaults.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/definitionModel.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/helper/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/tree/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/layout-model/index.js","webpack://muze/./packages/layout/src/enums/constants.js","webpack://muze/./packages/layout/src/tree-layout/utils/index.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-point.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-parser.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/helper.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/html-data.js","webpack://muze/./packages/layout/src/tree-layout/renderers/renderer.js","webpack://muze/./packages/layout/src/tree-layout/renderers/html-renderer.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/layout-def.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/index.js","webpack://muze/./packages/muze/src/canvas/helper.js","webpack://muze/./packages/muze/src/options.js","webpack://muze/./packages/layout/src/generic-layout/index.js","webpack://muze/./packages/layout/src/grid-layout/defaults.js","webpack://muze/./packages/layout/src/utils/index.js","webpack://muze/./packages/layout/src/visual-matrix/props.js","webpack://muze/./packages/layout/src/visual-matrix/default-config.js","webpack://muze/./packages/layout/src/visual-matrix/visual-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/row-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/column-matrix.js","webpack://muze/./packages/layout/src/grid-layout/computations.js","webpack://muze/./packages/layout/src/grid-layout/view-info-getter.js","webpack://muze/./packages/layout/src/grid-layout/layout.js","webpack://muze/./packages/layout/src/grid-layout/layout-helper.js","webpack://muze/./packages/layout/src/grid-layout/border-helper.js","webpack://muze/./packages/layout/src/grid-layout/span-maker.js","webpack://muze/./packages/muze/src/transaction-support.js","webpack://muze/./packages/muze/src/canvas/component-resolver.js","webpack://muze/./packages/visual-cell/src/enums/constants.js","webpack://muze/./packages/visual-cell/src/enums/cell-type.js","webpack://muze/./packages/visual-cell/src/simple-cell.js","webpack://muze/./packages/visual-cell/src/enums/defaults.js","webpack://muze/./packages/visual-cell/src/props.js","webpack://muze/./packages/visual-cell/src/axis-cell.js","webpack://muze/./packages/visual-cell/src/blank-cell.js","webpack://muze/./packages/visual-cell/src/text-cell.js","webpack://muze/./packages/visual-cell/src/geom-cell.js","webpack://muze/./packages/visual-cell/src/defaults.js","webpack://muze/./packages/visual-cell/src/constants.js","webpack://muze/./packages/visual-cell/src/cell-registry.js","webpack://muze/./packages/muze/src/canvas/title-maker.js","webpack://muze/./packages/muze/src/canvas/legend-maker.js","webpack://muze/./packages/muze/src/canvas/components/muze-chart-component.js","webpack://muze/./packages/muze/src/canvas/components/headerComponent.js","webpack://muze/./packages/muze/src/canvas/components/legendComponent.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/helper.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/props.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-component.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/horizontal-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/vertical-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/matrix-component.js","webpack://muze/./packages/muze/src/canvas/components/grid-component.js","webpack://muze/./packages/muze/src/enums/constants.js","webpack://muze/./packages/muze/src/canvas/components/message-component.js","webpack://muze/./packages/muze/src/canvas/component-wrapper-maker.js","webpack://muze/./packages/muze/src/canvas/scroll-manager.js","webpack://muze/./packages/muze/src/canvas/layout-maker.js","webpack://muze/./packages/muze/src/canvas/firebolt/group-firebolt.js","webpack://muze/./packages/muze/src/canvas/firebolt/index.js","webpack://muze/./packages/muze/src/canvas/app-state.js","webpack://muze/./packages/muze/src/canvas/canvas.js","webpack://muze/./packages/muze/src/default-registry.js","webpack://muze/./packages/visual-layer/src/layer-registry.js","webpack://muze/./packages/muze/src/muze.js"],"names":["webpackUniversalModuleDefinition","root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","e","_typeof","undefined","__WEBPACK_AMD_DEFINE_RESULT__","__WEBPACK_AMD_DEFINE_FACTORY__","apply","__WEBPACK_AMD_DEFINE_ARRAY__","a","JSON","parse","u","f","rt","mt","yt","bt","un","cn","fn","ln","sn","dn","pn","hn","FLAT_JSON","DSV_STR","DSV_ARR","AUTO","CATEGORICAL","TEMPORAL","GEO","BINNED","CONTINUOUS","MEASURE","DIMENSION","NORMAL","INVERSE","ALL","SUM","AVG","MIN","MAX","FIRST","LAST","COUNT","STD","Date","h","this","format","dtParams","nativeDate","RegExp","escape","replace","TOKEN_PREFIX","DATETIME_PARAM_SEQUENCE","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND","MILLISECOND","defaultNumberParser","isFinite","parseInt","defaultRangeParser","toLowerCase","length","getTokenDefinitions","short","long","H","index","extract","parser","formatter","getHours","toString","P","M","getMinutes","S","getSeconds","K","getMilliseconds","join","getDay","A","getDate","b","getMonth","B","y","substring","Math","trunc","getFullYear","Y","getTokenFormalNames","HOUR_12","AMPM_UPPERCASE","AMPM_LOWERCASE","SHORT_DAY","LONG_DAY","DAY_OF_MONTH","DAY_OF_MONTH_CONSTANT_WIDTH","SHORT_MONTH","LONG_MONTH","MONTH_OF_YEAR","SHORT_YEAR","LONG_YEAR","tokenResolver","arguments","findTokens","keys","indexOf","push","token","formatAs","String","extractTokenValue","noBreak","v","splice","checkIfOnlyYear","unshift","map","match","shift","getNativeDate","Number","Function","concat","Array","isArray","from","forEach","iterator","constructor","g","w","O","_","E","getTime","round","random","j","D","F","data","createNamespace","fields","fieldsObj","_cachedFieldsObj","getMeasure","_cachedMeasure","schema","type","getDimension","_cachedDimension","N","configurable","writable","k","TypeError","Qt","defineProperties","_value","_formattedValue","_internalValue","field","T","split","R","C","assign","_invalidAwareValsMap","invalidAwareVals","NULL","NA","NIL","invalid","nil","null","L","SELECT","PROJECT","GROUPBY","COMPOSE","CAL_VAR","BIN","SORT","U","CROSS","LEFTOUTER","RIGHTOUTER","NATURAL","FULLOUTER","G","getFieldspace","Error","_rowDiffset","partialField","rawValue","formattedValue","formattedData","At","detachedRoot","on","J","z","floor","next","done","W","X","q","Map","has","set","Z","label","reduce","$","Ht","slice","Q","ee","ne","uids","addUid","columnWise","te","filter","findIndex","pop","re","_colIdentifier","sort","ae","ie","oe","ue","ce","fe","le","se","de","pe","he","ve","me","isNaN","we","ye","min","max","sqrt","pow","ge","be","Oe","store","entries","__unregister","_e","Ee","je","internalValue","Se","yn","De","Fe","Ne","ke","rowDiffset","subtype","description","displayName","Te","Re","ReferenceError","__proto__","getPrototypeOf","setPrototypeOf","_cachedDomain","calculateDataDomain","Ce","Me","Set","add","Ie","Pe","_cachedMinDiff","POSITIVE_INFINITY","isInvalid","getInvalidType","xe","Le","bins","Ue","Ve","unit","defAggFn","numberFormat","Be","Ye","NEGATIVE_INFINITY","He","Ge","Je","ze","trim","Ke","We","_dtf","Xe","qe","parseFloat","Ze","$e","Qe","et","_sanitize","tt","nt","dataFormat","firstRowHeader","at","it","ot","ut","ct","ft","stringify","lt","st","pt","charCodeAt","dt","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getUTCFullYear","getUTCMonth","getUTCDate","test","columns","parseRows","formatBody","formatRows","ht","vt","gt","fieldSeparator","FlatJSON","DSVStr","DSVArr","wt","Ot","_t","Et","Ft","St","_derivation","op","meta","criteria","Dt","_ancestorDerivation","Nt","diffIndex","calcDiff","kt","Tt","rejectRowDiffset","Ct","getPartialFieldspace","It","Pt","operation","filterByMeasure","Mt","clone","__calculateFieldspace","calculateFieldsConfig","getFieldsConfig","getData","domain","every","select","saveChild","some","xt","config","Lt","projField","actualProjField","Vt","Bt","Yt","as","_partialFieldspace","_cachedValueObjects","_dataFormat","Gt","getDerivations","groupByString","params","Jt","nonTraversingModel","excludeModels","handlePropagation","_children","Xt","propagationNameSpace","propagateToSource","sourceId","propagateInterpolatedValues","persistent","values","mutableActions","filterFn","applyOnSource","action","model","models","path","Wt","_parent","sourceIdentifiers","propagationSourceId","groupByModel","reverse","$t","search","en","tn","_fieldStoreName","_propagationNameSpace","immutableActions","_fieldspace","jt","setParent","_fieldConfig","def","removeChild","nn","rn","an","_onPropagation","order","withUid","getAllFields","fill","Ae","defaultReducer","resolve","fieldsArr","replaceVar","addField","isMutableAction","payload","Kt","zt","find","Zt","qt","propConfig","filterImmutableAction","buckets","binsCount","binSize","start","end","I","ceil","abs","x","binnedData","measureFieldName","binFieldName","serialize","getSchema","Rt","splitRowDiffset","dimensionMap","Ut","sum","avg","first","last","count","std","vn","compose","dispose","bin","project","groupBy","calculateVariable","crossProduct","difference","naturalJoin","leftOuterJoin","rightOuterJoin","fullOuterJoin","union","mn","version","Operators","Stats","DM_DERIVATIVES","DateTimeFormatter","DataFormat","FilteringMode","InvalidAwareTypes","webpackPolyfill","deprecate","paths","children","_interopRequireDefault","obj","default","_lib2","require","_containerManager2","slLib","init","doc","win","document","htmlSplCharSpace"," ","documentSupport","getDocumentSupport","SVG_BBOX_CORRECTION","isWebKit","SmartLabelManager","id","container","useEllipses","options","wrapper","prop","prevInstance","isBrowserLess","maxCacheLimit","maxDefaultCacheLimit","getElementById","createContainer","innerHTML","testStrAvg","isHeadLess","isIE","offsetHeight","offsetWidth","parentContainerStyle","style","parentContainer","_containerManager","_showNoEllipses","_init","setStyle","textToLines","smartlabel","text","lines","_calCharDimWithCache","calculateDifference","size","csArr","tw","twi","cachedStyle","asymmetricDifference","maxAdvancedCacheLimit","_container","cache","_advancedCache","advancedCacheKey","_advancedCacheKey","cacheName","fontSize","fontFamily","fontWeight","fontStyle","cacheInitName","repeat","width","height","_getWidthFn","contObj","_containerObj","svgText","str","bbox","textContent","getBBox","_styleNotSet","setLineHeight","sCont","node","_context","context","_cache","charCache","_lineHeight","lineHeight","useEllipsesOnOverflow","getSmartText","maxWidth","maxHeight","noWrap","len","trimStr","tempArr","tmpText","maxWidthWithEll","toolText","oriWidth","oriHeight","newCharIndex","nearestChar","tempChar","getWidth","initialLeft","initialTop","getOriSizeImproveObj","spanArr","minWidth","elem","chr","elemRightMostPoint","elemLowestPoint","lastBR","removeFromIndex","removeFromIndexForEllipses","hasHTMLTag","maxStrWidth","lastDash","lastSpace","lastIndexBroken","strWidth","strHeight","oriTextArr","ellipsesStr","ellipsesWidth","dotWidth","characterArr","dashIndex","spaceIndex","lastLineBreak","fastTrim","ws","charAt","smartLabel","oriTextWidth","oriTextHeight","oriText","isTruncated","xmlTagRegEx","ltgtRegex","getOriSize","substr","getNearestBreakIndex","detailObj","tooltext","lastIndexOf","spanAdditionRegx","spanAdditionReplacer","classNameWithTag","classNameWithTagBR","childRetriverFn","childRetriverString","noClassTesting","classNameReg","className","spaceIdx","dashIdx","offsetLeft","offsetTop","parentNode","insertBefore","createElement","classNameBrReg","spanRemovalRegx","error","detailedCalculationFlag","textArr","letter","lSize","cumulativeSize","indiSizeStore","lib","userAgent","navigator","clsNameSpace","containerClass","brReplaceRegex","position","top","whiteSpace","padding","overflow","supportedStyle","font","font-family","font-weight","font-size","line-height","font-style","getElementsByClassName","opera","hasSVG","Boolean","SVGAngle","implementation","hasFeature","containerParent","body","appendChild","setAttribute","getElementsByTagName","sl","charLen","increment","avgWidth","styleObj","fSize","_set","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","setTimeout","__lastTime","__id","unique","qualifiedName","seed","dependencies","outgoingEdges","accumulate","identity","dep","edges","_seed","requireResolve","retriever","history","resolver","electricEdges","retrieveDetails","listeners","nextFrame","currentFrame","qualifiedNodeMap","_wholeSet","_propagate","propagationOverride","currentFrameListeners","nextFrameListeners","_schedule","flushTarget","flush","perv","addDependencies","getDependencies","getResolvedList","addEdges","addElectricNode","append","__execUniqueElectricEdges","toArray","repeatHead","resetPropagationOverride","update","isRoot","_graph","_lockFlag","_reqQ","_addPropInModel","createNodesFrom","createElectricNodeOf","stopPropagation","setPropagationOverride","resetNodeValue","setProp","getNodeValue","getNodeFromQualifiedName","Muze","ContainerManager","maxContainers","svg","containers","rootNode","createElementNS","setAttributeNS","svgRoot","diff","containerObj","keyStr","prev","removeContainer","addContainer","avgCharWidth","display","cObj","ascending","NaN","bisector","compare","ascendingComparator","left","lo","hi","mid","right","ascendingBisect","bisectRight","number","array","src_range","stop","step","range","e10","e5","e2","src_ticks","ticks","tickIncrement","power","log","LN10","tickStep","step0","step1","quantile","valueof","i0","value0","each","remove","clear","empty","src_nest","sortValues","rollup","nest","sortKeys","depth","createResult","setResult","keyValue","valuesByKey","result","createObject","setObject","createMap","setMap","sortKey","proto","implicit","ordinal","unknown","scale","copy","band","bandwidth","ordinalRange","paddingInner","paddingOuter","align","rescale","sequence","rangeRound","invertExtent","r0","r1","hiIndex","getClosestIndexOf","invert","arr","side","highVal","d1","low","high","extend","parent","definition","Color","reI","reN","reP","reHex3","reHex6","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","color","exec","Rgb","rgbn","rgba","hsla","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","Hsl","hslConvert","hsl","hsl2rgb","m1","m2","channels","displayable","formatHsl","color_formatHsl","brighter","darker","deg2rad","PI","rad2deg","Xn","Yn","Zn","t0","t1","t2","t3","labConvert","Lab","Hcl","hcl2lab","rgb2lrgb","xyz2lab","lab","lab2xyz","lrgb2rgb","hclConvert","atan2","hcl","cos","sin","ED","EB","BC_DA","cubehelix","cubehelixConvert","Cubehelix","bl","basis","v0","v1","v2","v3","cosh","sinh","src_constant","linear","hue","constant","gamma","nogamma","exponential","src_rgb","rgbGamma","colorRgb","rgbSpline","spline","colors","rgbBasis","src_number","reA","reB","source","src_string","am","bm","bs","bi","lastIndex","one","zero","cssNode","cssRoot","cssView","svgNode","src_value","value_typeof","string","setTime","nb","na","valueOf","src_round","degrees","translateX","translateY","rotate","skewX","scaleX","scaleY","decompose","atan","interpolateTransform","pxComma","pxParen","degParen","translate","xa","ya","xb","yb","interpolateTransformCss","parseCss","documentElement","defaultView","transform","getComputedStyle","getPropertyValue","interpolateTransformSvg","parseSvg","baseVal","consolidate","matrix","SQRT2","colorHsl","hslLong","colorHcl","cubehelixGamma","colorCubehelix","cubehelixLong","piecewise","interpolate","d3_scale_src_constant","d3_scale_src_number","deinterpolateLinear","bimap","deinterpolate","reinterpolate","d0","polymap","bisect","target","clamp","continuous","output","input","interpolateValue","deinterpolateClamp","reinterpolateClamp","interpolateRound","formatDecimal","toExponential","coefficient","src_exponent","formatSpecifier","specifier","FormatSpecifier","sign","symbol","comma","precision","prefixExponent","locale","formatPrefix","formatTrim","out","i1","formatRounded","exponent","formatTypes","%","toFixed","toPrecision","toUpperCase","src_identity","prefixes","src_locale","group","grouping","thousands","formatGroup","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","prefix","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","Infinity","defaultLocale","formatLocale","src_tickFormat","precisionPrefix","precisionRound","precisionFixed","linearish","tickFormat","nice","interval","x0","x1","pow10","powp","base","exp","logp","log10","log2","reflect","logs","pows","raise","thresholds","threshold","quantiles","quantize","newInterval","floori","offseti","date","offset","previous","millisecond","durationMinute","durationWeek","second","minute","hour","day","setHours","setDate","getTimezoneOffset","weekday","sunday","monday","tuesday","wednesday","thursday","friday","saturday","month","setMonth","year","setFullYear","utcMinute","setUTCSeconds","utcHour","setUTCMinutes","utcDay","setUTCHours","setUTCDate","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcMonth","setUTCMonth","utcYear","setUTCFullYear","localDate","utcDate","UTC","newYear","timeFormat","utcFormat","utcParse","pads","-","0","numberRe","percentRe","requoteRe","pad","requote","formatRe","names","formatLookup","parseWeekdayNumberSunday","parseWeekdayNumberMonday","parseWeekNumberSunday","parseWeekNumberISO","V","parseWeekNumberMonday","parseFullYear","parseYear","parseZone","parseMonthNumber","parseDayOfMonth","parseDayOfYear","parseHour24","parseMinutes","parseSeconds","parseMilliseconds","parseMicroseconds","parseLiteralPercent","parseUnixTimestamp","parseUnixTimestampSeconds","formatDayOfMonth","formatHour24","formatHour12","formatDayOfYear","timeDay","timeYear","formatMilliseconds","formatMicroseconds","formatMonthNumber","formatMinutes","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","timeSunday","formatWeekNumberISO","timeThursday","formatWeekdayNumberSunday","formatWeekNumberMonday","timeMonday","formatYear","formatFullYear","formatZone","formatUTCDayOfMonth","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMicroseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","dow","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","formatLiteralPercent","formatUnixTimestamp","formatUnixTimestampSeconds","locale_dateTime","dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatPeriod","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCPeriod","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseSpecifier","parsePeriod","parseLocaleDate","parseLocaleTime","newParse","newDate","week","toISOString","durationSecond","durationHour","durationDay","durationMonth","durationYear","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","tickIntervals","tickInterval","src_time","timeMonth","timeWeek","timeHour","timeMinute","timeSecond","timeMillisecond","src_colors","interpolateCubehelixLong","ramp","sequential","interpolator","d3_scale_chromatic_src_colors","src_ramp","scheme","interpolateRgbBasis","magma","inferno","plasma","warm","cool","sequential_multi_rainbow","ts","UNIT_GLOBAL_NAMESPACE","UNIT_LOCAL_NAMESPACE","LAYER_LOCAL_NAMESPACE","LAYER_GLOBAL_NAMESPACE","GROUP_GLOBAL_NAMESPACE","GROUP_LOCAL_NAMESPACE","CANVAS_LOCAL_NAMESPACE","CANVAS_GLOBAL_NAMESPACE","ReservedFields","ROW_ID","CommonProps","ACTION_INF","ON_LAYER_DRAW","MATRIX_CREATED","COORD_TYPES","DATA_TYPE","d3_axis_src_identity","bottom","epsilon","entering","__axis","axis","orient","tickArguments","tickValues","tickTransform","tickSizeInner","tickSizeOuter","tickPadding","spacing","range0","range1","center","selection","selectAll","tick","tickExit","exit","tickEnter","enter","attr","line","merge","insert","transition","getAttribute","tickSize","pi","tau","tauEpsilon","Path","_x0","_y0","_x1","_y1","moveTo","closePath","lineTo","quadraticCurveTo","y1","bezierCurveTo","x2","y2","arcTo","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","acos","t01","t21","arc","a0","a1","ccw","dx","dy","cw","da","rect","d3_shape_src_constant","halfPi","asin","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","Linear","areaStart","_line","areaEnd","lineStart","_point","lineEnd","point","curve_linear","src_line","pointX","pointY","defined","curve","curveLinear","buffer","defined0","src_area","area","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","src_descending","d3_shape_src_identity","curveRadial","Radial","_curve","radial","symbol_circle","draw","symbol_cross","tan30","tan30_2","diamond","kr","kx","ky","star","square","sqrt3","triangle","wye","noop","that","Basis","BasisClosed","_x2","_x3","_x4","_y2","_y3","_y4","BasisOpen","Bundle","beta","_basis","_beta","_x","_y","custom","bundle","_k","Cardinal","tension","cardinal","CardinalClosed","_x5","_y5","CardinalOpen","_l01_a","_l01_2a","_l12_a","_l12_2a","_l23_a","_l23_2a","CatmullRom","alpha","_alpha","x23","y23","curve_catmullRom","catmullRom","CatmullRomClosed","CatmullRomOpen","LinearClosed","slope3","h0","h1","s0","s1","slope2","MonotoneX","MonotoneY","ReflectContext","Natural","controlPoints","_t0","px","py","Step","curve_step","stepBefore","stepAfter","none","series","order_none","stackValue","order_ascending","sums","cubicInOut","polyIn","polyOut","polyInOut","b1","b2","b3","b4","b5","b6","b7","b8","b9","b0","bounceOut","backIn","overshoot","backOut","backInOut","elasticOut","elasticIn","amplitude","period","d3_voronoi_src_constant","elasticInOut","RedBlackTree","RedBlackNode","RedBlackRotateLeft","tree","RedBlackRotateRight","RedBlackFirst","after","grandpa","uncle","sibling","createEdge","edge","setEdgeEnd","cells","halfedges","createBorderEdge","vertex","clipEdge","ax","ay","connectEdge","fm","fb","lx","ly","rx","ry","fx","fy","cellHalfedgeAngle","cell","site","va","vb","cellHalfedgeStart","cellHalfedgeEnd","firstCircle","circlePool","attachCircle","lArc","rArc","lSite","cSite","rSite","bx","by","epsilon2","ha","hc","circle","Circle","before","circles","detachCircle","beachPool","createBeach","beach","Beach","detachBeach","beaches","removeBeach","disappearing","iArc","nArcs","addBeach","dxl","dxr","directrix","leftBreakPoint","rightBreakPoint","createCell","newArc","hb","rfocx","rfocy","pby2","lfocx","lfocy","plby2","hl","aby2","triangleArea","lexicographic","Diagram","sites","extent","sortCellHalfedges","clipEdges","clipCells","iCell","iHalfedge","nHalfedges","startX","startY","endX","endY","nCells","cover","dc","v00","v01","v11","v10","polygons","polygon","triangles","e1","links","radius","_found","vx","vy","src_voronoi","voronoi","Selection","idGetter","_classCallCheck","_dataObjects","_updateData","_enterData","_exitData","_idGetter","newData","val","entryData","exitdata","tempMap","duplicateData","updatedData","newSelection","callback","dataObjects","defaultValue","_mode","mergedObjects","mergedData","newdata","sortFn","updateData","sortSel","sortSelection","kA","kB","_toConsumableArray","objects","DimensionSubtype","STRING","FUNCTION","DataModel","isSimpleObject","HTMLElement","common_utils_typeof","getUniqueId","sanitizeIP","typeObj","nonExistentKeys","checkExistence","getMax","common_utils_toConsumableArray","getMin","getDomainFromData","fieldType","_ref","domArr","_loop","_fields","_slicedToArray","field0","field1","arr0","arr1","firstMin","secondMin","firstMax","secondMax","sanitizeDomainWhenEqual","unionDomain","domains","_ref2","dom","symbolFns","symbolCircle","cross","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolWye","symbolTriangle","easeFns","cubic","easeCubic","bounce","easeBounce","elastic","easeElastic","back","easeBack","poly","easePoly","circleInOut","getNearestValue","filterData","getWindow","getQualifiedClassName","cancelAnimationFrame","cls","param","objectIterator","Voronoi","common_utils_classCallCheck","_voronoi","_voronoiFn","getObjProp","retObj","_len","_key","intSanitizer","generateGetterSetters","props","propInfo","_propInfo$","sanitization","preset","onset","typeChecker","defVal","isEqual","oldVal","newVal","arraysEqual","arr2","is","ERROR_MSG","INTERFACE_IMPL","mergeRecursive","sink","createSelection","sel","appendObj","idFn","dataSelect","mergedSelection","exitSelection","getObjects","inst","numberInterpolator","interpolateNumber","piecewiseInterpolator","rgbToHsv","detectColor","col","getDataModelFromRange","dataModel","selFields","selFn","getDataModelFromIdentifiers","identifiers","filteredDataModel","fieldsConfig","dataArr","filteredSchema","include","propField","idx","isValidValue","getSymbol","stackOrders","_defineProperty","_stackOrders","stackOrderNone","stackOrderAscending","stackOffsets","_stackOffsets","yp","stackOffsetNone","s2","si","sij0","s3","sk","stack","orderNone","offsetNone","oz","kz","sz","sij","ki","d3Stack","nestCollection","nestFn","pathInterpolators","curveStepAfter","curveStepBefore","curveStep","curveCatmullRom","Symbols","axisLeft","axisRight","axisTop","axisBottom","pie","descending","arcs","pa","cornerRadius","padRadius","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","p0","p1","oc","intersect","x3","y3","x32","y32","kc","lc","centroid","Scales","scaleBand","getSmallestDiff","points","minDiff","timeFormats","timeDurations","formatTemporal","nearestInterval","getNearestInterval","getValueParser","retrieveNearestGroupByReducers","_len3","measureFieldNames","_key3","filteredReducers","derivations","getAncestorDerivations","nearestReducers","derv","measures","measureName","measureField","retrieveFieldDisplayName","dm","fieldName","sortOrderMap","_sortOrderMap","firstVal","secondVal","localeCompare","_accessors","fn1","fn2","xhtml","src_namespaces","xlink","xml","xmlns","src_namespace","namespaces","space","local","creator","fullname","namespace","creatorFixed","ownerDocument","creatorInherit","uri","namespaceURI","src_selector","selector","querySelector","selectorAll","querySelectorAll","matcher","matches","sparse","EnterNode","datum","_next","__data__","child","keyPrefix","bindIndex","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","src_window","styleValue","classArray","classList","ClassList","_node","_names","classedAdd","list","classedRemove","contains","textRemove","htmlRemove","nextSibling","lower","previousSibling","firstChild","constantNull","selection_cloneShallow","cloneNode","selection_cloneDeep","filterEvents","event","mouseenter","mouseleave","filterContextListener","listener","contextListener","related","relatedTarget","compareDocumentPosition","event1","event0","onRemove","typename","__on","removeEventListener","capture","onAdd","wrap","addEventListener","customEvent","args","sourceEvent","dispatchEvent","CustomEvent","createEvent","initEvent","bubbles","cancelable","detail","groups","parents","_groups","_parents","subgroups","subnode","subgroup","enterGroup","updateGroup","_enter","_exit","onenter","onupdate","onexit","groups0","groups1","m0","merges","group0","group1","compareNode","sortgroups","sortgroup","nodes","getAttributeNS","attrRemoveNS","removeAttributeNS","attrRemove","removeAttribute","attrFunctionNS","attrFunction","attrConstantNS","attrConstant","priority","styleRemove","removeProperty","styleFunction","setProperty","styleConstant","propertyRemove","propertyFunction","propertyConstant","classed","classedFunction","classedTrue","classedFalse","textFunction","textConstant","html","htmlFunction","htmlConstant","deep","typenames","parseTypenames","dispatch","dispatchFunction","dispatchConstant","src_select","nextId","Local","current","src_point","ownerSVGElement","createSVGPoint","clientX","clientY","matrixTransform","getScreenCTM","inverse","getBoundingClientRect","clientLeft","clientTop","mouse","changedTouches","src_touch","touches","identifier","touch","Dispatch","types","nopropagation","stopImmediatePropagation","noevent","preventDefault","nodrag","view","__noselect","MozUserSelect","d3_drag_src_constant","DragEvent","subject","active","defaultFilter","ctrlKey","button","defaultContainer","defaultSubject","defaultTouchable","maxTouchPoints","src_drag","mousedownx","mousedowny","mousemoving","touchending","touchable","gestures","clickDistance2","drag","mousedowned","touchstarted","touchmoved","touchended","gesture","beforestart","mousemoved","mouseupped","yesdrag","noclick","clearTimeout","sublisteners","clickDistance","taskHead","taskTail","frame","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","timer_typeof","now","setFrame","clearNow","Timer","_call","_time","timer","delay","restart","wake","timerFlush","nap","sleep","poke","clearInterval","setInterval","src_timeout","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","transition_schedule","timing","schedules","__transition","self","tween","state","duration","ease","schedule","tweenValue","_id","transition_interpolate","interpolateRgb","interpolateString","Transition","_name","newId","selection_prototype","inherit","id0","id1","onFunction","on0","on1","sit","attrTween","string00","string10","interpolate0","string0","string1","value1","attrTweenNS","attrInterpolateNS","attrInterpolate","styleTween","styleNull","styleMaybeRemove","listener0","styleInterpolate","removeFunction","tweenRemove","tween0","tween1","tweenFunction","delayFunction","delayConstant","durationFunction","durationConstant","easeConstant","Promise","reject","cancel","interrupt","defaultTiming","easeCubicInOut","selectElement","element","makeElement","elemType","callbacks","keyFn","SVGElement","selectorVal","selectorType","actualSelector","enterSel","mergeSel","_len2","_key2","exitSel","applyStyle","setElementAttrs","attrs","setAttrs","setStyles","styles","createElements","getClientPoint","pos","clientPoint","getEvent","d3event","getD3Drag","d3drag","getSmartComputedStyle","css","textEl","mandatoryStyle","fill-opacity","renderer_utils_typeof","computedStyle","styleForSmartLabel","hasTouch","initProp","fetchPropValues","propNames","deps","setContexts","contexts","propObj","contextMap","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","depProps","err","registerListener","propList","callBack","instantCall","_options$","namespaceInf","callbackFn","namespaceVal","commits","_savedCommits","propListenerMap","_propListenerMap","listenersObj","_registeredListeners","_contextMap","contextsObj","commitsObj","subNamespaces","propDeps","nm","fnInf","fns","store_toConsumableArray","registerPropInMaps","registeredListeners","subNamespace","allProps","_fnCount","addListenerToNamespace","_listeners","namespaceListeners","listenerTypes","removePropValue","propInf","sns","Store","store_classCallCheck","Model","_commits","_queuedProps","_locked","store_createClass","lockModel","lock","unlockModel","unlock","lockCommits","_this","locked","queue","unlockCommits","_this2","queuedProps","_params","store_slicedToArray","propName","_params2","commit","addSubNamespace","propFns","acc","nsObj","retrieveNamespaces","disableListener","sanitizedVal","savedCommits","disabled","registerChangeListener","registerImmediateListener","_len4","_key4","computed","calculatedProp","_this$model","unsubscribeAll","unsubscribe","listenersMap","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","removeSubNamespace","listenerMap","snsMap","transactor","holder","conf","stateProps","nameSpaceProp","nsProp","_len5","_key5","_ref$takesMultiplePar","takesMultipleParams","prevVal","typeCheck","typeExpected","oldValues","events","EVENT_LIST","composition","resolveFn","notification","hasOwn","LifeCycleManager","lifecycle_manager_classCallCheck","_eventList","_promises","_notifiers","_lifeCycles","_unreleasedLifeCycles","_boot","_preparePromises","eventName","promise","_makeNotifierPromise","createPromise","then","prm","formalName","client","_releasePromisesFromCache","_notify","stage","_resolvePromise","retrieve","_callLifeCycleCallback","_cachePromise","_resetTargetPromise","_this3","lifeCycles","_this4","DRAG","HOVER","SELECTIONDRAG","CLICK","LONGTOUCH","TOUCHDRAG","ALL_ACTIONS","SELECTION_NEW_ENTRY","SELECTION_NEW_EXIT","SELECTION_NULL","SELECTION_OLD_ENTRY","SELECTION_OLD_EXIT","SelectionSet","completeSet","_volatile","selection_set_classCallCheck","_completeSetCount","_lockedSelection","_resetted","ids","entrySet","exitSet","lockedSel","addSet","removeSet","updateSet","changeSideEffectAvailability","toEnable","sideEffects","change","enable","disable","getMergedSet","helper_toConsumableArray","conditionsMap","mergedEnter","SELECTION","mergedExit","complete","getSetInfo","selectionSet","propagationData","resetted","getModelFromSet","conditions","condition","Firebolt","actions","behaviourEffectMap","firebolt_classCallCheck","_sideEffectDefinitions","_sideEffects","_propagationInf","_actions","behavioural","physical","_selectionSet","_volatileSelectionSet","_propagationFields","_sourceSideEffects","_propagationBehaviourMap","_sourceBehaviours","_actionBehaviourMap","_config","_behaviourEffectMap","_entryExitSet","_actionHistory","_queuedSideEffects","mapSideEffects","registerBehaviouralActions","registerSideEffects","registerPhysicalBehaviouralMap","physicalBehaviouralMap","registerPhysicalActions","setSideEffectConfig","sideEffect","sideEffectConf","behEffectMap","preventDefaultActions","effectNames","effects","firebolt_toConsumableArray","behaviours","initializeBehaviouralActions","dispatchableBehaviours","Action","prepareSelectionSets","initializeSideEffects","sideEffectStore","actionHistory","queuedSideEffects","combinedSet","unionSets","behaviour","entryExitSet","existingModel","aggFns","effect","firebolt_typeof","sideEffectInstance","isEnabled","mutates","dispatchSideEffect","propagationInfo","propagate","getSideEffects","propagationSelectionSet","getPropagationSelectionSet","shouldApplySideEffects","sourceSelectionSet","applicableSideEffects","getApplicableSideEffects","applySideEffects","behaviourConditions","sideEffectConditions","physicalAction","actionBehaviourMap","behaviourMap","mapActionsAndBehaviour","onDataModelPropagation","propValue","dispatchBehaviour","uniqueIds","behaviouralActions","volatileSelectionSet","sideEffectDefinitions","sideEffectsMap","SideEffect","initedActions","initializePhysicalActions","physicalActions","phyAction","initedPhysicalActions","mapObj","getDefaultTargetContainer","bindActionWithBehaviour","targets","behaviourList","mount","propagationInf","entryRowIds","getUids","propagationSource","applicableSelectionSets","GenericBehaviour","firebolt","generic_classCallCheck","_enabled","selectionSets","getSelectionSets","_this$firebolt$getAdd","getAddSetFromCriteria","getPropagationInf","setSelectionSet","getEntryExitSet","_selectionSet$getSets","getSets","setConfig","getFullData","getSourceFields","VolatileBehaviour","reset","existingAddSet","updateExit","getCompleteSet","BRUSH","HIGHLIGHT","TOOLTIP","FILTER","HighlightBehaviour","BrushBehaviour","BEHAVIOURNAMES","FilterBehaviour","PersistentBehaviour","updateEntry","mergedExitSet","completeSetCount","SelectBehaviour","getDragActionConfig","sourceInfo","axes","xAxis","yAxis","axisFields","xField","getMembers","yField","xFieldType","yFieldType","dimensions","stPos","startPos","endPos","dragDim","MeasureSubtype","isXDimension","isYDimension","xRange","yRange","selectedDomains","rangeObj","xdom","ydom","snap","getNearestRange","attachDragEvent","targetEl","drawingInf","touchStart","d3Drag","getDrawingContext","getSourceInfo","beh","dragEnd","hover","interaction","tooltip","svgContainer","nearestPoint","getNearestPoint","getAllPoints","showInPosition","generatePayloadFromEvent","click","physical_defineProperty","_physicalActions","ACTIONNAMES","longtouch","touchEnd","touchdrag","ANCHORS","BRUSH_ANCHORS","PERSISTENT_ANCHORS","HIGHLIGHTER","CROSSLINE","PROPS","valueParser","GenericSideEffect","generic_sideeffect_classCallCheck","_strategy","_strategies","defaultConfig","SurrogateSideEffect","interactionType","layers","layer","interactive","applyInteractionStyle","SpawnableSideEffect","_drawingContext","changeVisibility","sideEffectGroup","visible","defClassName","classPrefix","SelectionBox","boxConf","box","drawingContext","mountPoint","unitWidth","unitHeight","selectionGroupClassName","hide","sourceInf","_getBoxDimensionsFrom","getBoxDimensionsFromPayload","direction","xDim","yDim","xLinear","yLinear","xCriteria","yCriteria","x1Val","x2Val","bandScale","x1DomainIndex","x2DomainIndex","_sort2","helper_slicedToArray","getScaleValue","getUnitWidth","y1Val","y2Val","y1DomainIndex","y2DomainIndex","_sort4","_xDim","_yDim","dimension","show","selectionBox","selectionBoxDrag","onDrag","boxClassName","INITIAL_STYLE","connectorClassName","row","margin","content","iconContainerSize","iconScale","iconShape","iconColor","rowMargin","separator","parentClassName","arrow","getArrowPos","dim","measurement","arrowPos","boxHeight","boxWidth","arrowWidth","plotBottom","boxBottom","plotRight","boxRight","placeArrow","tooltipArrow","_tooltipArrow","tooltipBackground","_tooltipBackground","arrowConf","_arrowOrientation","Content","content_classCallCheck","_model","_formatter","item","ctx","_mount","displayFormat","table","tbody","rows","elemData","el","shape","Tooltip","htmlContainer","tooltip_classCallCheck","connectorContainer","tooltipConf","contentClass","_tooltipContainer","_contentContainer","_contents","_tooltipConnectorContainer","qualifiedClassName","addClass","defConf","contentConfig","reorderContainers","contentConf","render","_target","repositionArrow","arrowDisabled","arrowOrient","outsidePlot","connector","_offset","orientation","_extent","arrowSize","topSpace","dimX","rightSpace","leftSpace","positionTop","positionRight","positionLeft","positionHorizontal","positionVertical","_position","_arrowPos","HIGHLIGHT_SUMMARY","GROUP_BY_FUNCTIONS","formatters","strategies_defineProperty","getKeyValue","isSelected","removeKey","keyObj","valueObj","margin-left","generateRetinalFieldsValues","valueArr","retinalFields","dimensionMeasureMap","fieldInf","dataLen","colorAxis","shapeAxis","sizeAxis","retField","retIndex","retinalFieldValue","measuresArr","icon","getColor","getShape","getSize","_fieldInf$retField","formattedRetinalValue","hasMultipleMeasures","measure","measureIndex","_fieldInf$measure","dName","formatterFn","strategies_toConsumableArray","buildTooltipData","nestedDataObj","fieldValues","_dataModel$getData","fieldspace","_context$firebolt$con","detailFields","FieldType","containsDetailField","getFieldInf","timeDiffs","defFormatter","inf","nf","getTabularData","dataObj","fieldObj","indices","allMeasures","_construct","filteredMeasures","generateTooltipContent","nestedData","_nestedData$i","_fieldInf$field","_loop2","len2","_fieldInf$name","strategies","aggregatedModel","fieldsConf","measureNames","configResolvers","tooltip_defineProperty","_configResolvers","specificConf","_default","_getPrototypeOf2","side_effects_tooltip_classCallCheck","tooltip_possibleConstructorReturn","tooltip_getPrototypeOf","_tooltips","sanitizeConfig","strategyObj","sanitizedConf","setStrategy","totalHeight","totalWidth","isEmpty","tooltips","boundBox","dataModels","fragmented","showVertically","tooltipPos","boxes","tooltip_toConsumableArray","targetFields","sourceFields","plotDimensions","getPlotPointsFromIdentifiers","strategy","strategyConf","dataTransform","projectFields","plotDim","layoutContainer","parentContainerDimensions","layoutBoundBox","unitBoundBox","tooltipInst","TooltipRenderer","timeDiffsByField","strategyFn","positionRelativeTo","tooltipBoundBox","getContents","spaceOutBoxes","spaceOutIfOverlap","firstBox","secondBox","opposite","highlightSummary","selectionSummary","projectedFields","Crossline","bandWidth","_this$config","bandClass","lineClass","fieldIndex","axisIndex","fieldInst","xOffset","plotWidth","crossline_toConsumableArray","getPlotSpan","getPlotPadding","startPx","endPx","dataPoint","parentGroup","fade","fadeFn","focus","highlight","PlotHighlighter","plot_highlighter_classCallCheck","plot_highlighter_possibleConstructorReturn","plot_highlighter_getPrototypeOf","FilterEffect","entryModel","clearCaching","resetData","enableCaching","AnchorEffect","anchors_classCallCheck","anchors_possibleConstructorReturn","anchors_getPrototypeOf","_layersMap","addAnchorLayers","addLayer","layerRegistry","layerDefs","layerDef","mark","layerCls","shouldDrawAnchors","depLayerEncoding","encoding","defaultSizeValue","commonName","groupId","calculateDomain","getTransitionConfig","owner","registry","_linkedLayer$getTrans2","anchors_slicedToArray","getLayerByName","getTransformedDataFromIdentifiers","transformedData","transformedDataModel","PersistentAnchors","BrushAnchors","behaviour_effect_map_defineProperty","BEHAVIOURS","SIZE","COLOR","SHAPE","TEXT","ENCODING","X0","Y0","RADIUS","RADIUS0","ANGLE","ANGLE0","nearestPointThreshold","strokeOpacity","connectNullData","SimpleLayer","props_defineProperty","metaInf","coord","_customConfig","newConf","defaultPolicy","BOTTOM","TOP","LEFT","RIGHT","axisOrientationMap","axis_orientation_defineProperty","_axisOrientationMap","AxisOrientation","LINEAR","BAND","TIME","ORDINAL","QUANTIZE","QUANTILE","LOG","POW","IDENTITY","SEQUENTIAL","THRESHOLD","CONTINOUS","DISCRETE","HIDDEN","DEFAULT_ANGLE_DOMAIN","scaleLinear","scales","scaleThreshold","scaleLog","scalePow","scaleIdentity","scaleOrdinal","scaleSequential","scaleQuantize","scaleQuantile","scaleTime","scaleMap","scale_creator_defineProperty","_scaleMap","ScaleType","createScale","scaleFactory","adjustRange","axisName","axisNamePadding","fixedBaseline","labels","rotation","smartTicks","numberOfTicks","showAxisName","showInnerTicks","showOuterTicks","yOffset","rotateAxis","instance","tickText","labelManager","renderConfig","getTickSize","yShift","xShift","tickLabelDim","quadrant","rotationNormalizer","angleToRadian","angle","changeTickOrientation","selectContainer","axisInstance","_smartTicks","isSmartTicks","registerAnimationDoneHook","setFixedBaseline","setAxisNamePos","textNode","axisNameHeight","availableSpace","longestWord","quarter","halfYearly","mintues","seconds","getTickIntervalFnBasedOnNumberOfTicks","possibleTickLevelIndex","maxPossibleTicks","tickIntervalLevelInfo","tickIntervalInfo","numOfPossibleTicks","getActualTickInterval","noOfTicks","minWidthBetweenTicks","_minTickDistance","getTickIntervalBasedOnCurrentLevel","_dependencies","longestWordType","applyTickSkipping","minTickDistance","minTickSpace","_minTickSpace","minTickWidth","maxTicks","getSkippedTicks","actualNumberOfTicks","_minDiff","millisecondInterval","numOfTicksAccordingToMinDiff","adjustHorizontalRange","adjustVerticalRange","rangeAdjustmentMap","space_setter_defineProperty","_rangeAdjustmentMap","setAxisRange","rangeBounds","getAdjustedRange","getAxisOffset","timeDiff","avWidth","bars","spaceSetter","spaceConfig","heightForTicks","_context$availableSpa2","availWidth","availHeight","isOffset","_context$renderConfig2","_context$getAxisDimen","getAxisDimensions","tickDimensions","allTickDimensions","axisNameDimensions","tickDimHeight","tickDimWidth","namePadding","labelConfig","minTickHeight","getTickValues","tickShifter","maxTickSpaces","widthForTicks","totalTickWidth","getRotatedSpaces","rotatedHeight","rotatedWidth","setOffset","logicalSpace","getAxisComponentDimensions","axisTicks","largestTick","largestTickDimensions","smartTick","_context$renderConfig","labelFunc","_tickLabelStyle","originalLabel","getFormattedText","_axisNameStyle","getHorizontalAxisSpace","axisDimensions","_context$config2","axisDimHeight","minTickDiff","getMinTickDifference","cartesian_axis_helper_toConsumableArray","getVerticalAxisSpace","_context$config3","calculateBandSpace","largestDimHeight","_getHorizontalAxisSpa","_getVerticalAxisSpace","getValidDomain","userDom","setContinousAxisDomain","_domain","axisComponentDimensions","oldConfig","mockedOldConfig","shouldAxesScaleUpdate","hasAxesConfigChanged","obj1","properties","tickFormatter","sanitizeTickFormatter","_scale","_axis","createAxis","_tickFormatter","resetRenderConfig","_renderConfig","_maxTickSpaces","SimpleAxis","simple_axis_classCallCheck","_range","_domainLock","_axisDimensions","defCon","simpleConfig","bodyElem","dist","_animationDonePromises","domainValue","setAxisComponentDimensions","smartAxisName","axisClass","_objectSpread","setTickConfig","setSmartAxisName","_this$config2","dimType","widthDim","getSmartAxisName","oriSize","domainVal","computeAxisDimensions","_getAxisComponentDime","labelHeight","labelWidth","calculateContinousSpace","_context$renderConfig6","axisNameWidth","_getHorizontalAxisSpa2","_getVerticalAxisSpace2","renderAxis","tickLabelStyle","axisTickFormatter","labelProps","labelOffset","all","LinearInterpolator","LogInterpolator","PowInterpolator","interpolatorMap","continous_axis_defineProperty","_interpolatorMap","ContinousAxis","continous_axis_classCallCheck","continous_axis_possibleConstructorReturn","continous_axis_getPrototypeOf","InterpolatorCls","_interpolator","_this$renderConfig","sanitizeDomain","_get2","_get","_this$renderConfig2","newTickValues","tickSpace","getNumberOfTicks","labelDim","numberOfValues","tickLength","_this$smartTicks$","BandAxis","_this$maxTickSpaces","_getRotatedSpaces","paddingNormalized","formatTickValue","TimeAxis","time_axis_classCallCheck","time_axis_possibleConstructorReturn","time_axis_getPrototypeOf","time_axis_get","rawTicks","resetTickInterval","_context$config8","_context$availableSpa","adjustedRange","x11Colors","Pink","LightPink","HotPink","DeepPink","PaleVioletRed","MediumVioletRed","LightSalmon","Salmon","DarkSalmon","LightCoral","IndianRed","Crimson","FireBrick","DarkRed","Red","OrangeRed","Tomato","Coral","DarkOrange","Orange","Gold","Yellow","LightYellow","LemonChiffon","LightGoldenrodYellow","PapayaWhip","Moccasin","PeachPuff","PaleGoldenrod","Khaki","DarkKhaki","Cornsilk","BlanchedAlmond","Bisque","NavajoWhite","Wheat","BurlyWood","Tan","RosyBrown","SandyBrown","Goldenrod","DarkGoldenrod","Peru","Chocolate","SaddleBrown","Sienna","Brown","Maroon","DarkOliveGreen","Olive","OliveDrab","YellowGreen","LimeGreen","Lime","LawnGreen","Chartreuse","GreenYellow","SpringGreen","MediumSpringGreen","LightGreen","PaleGreen","DarkSeaGreen","MediumSeaGreen","SeaGreen","ForestGreen","Green","DarkGreen","MediumAquamarine","Aqua","Cyan","LightCyan","PaleTurquoise","Aquamarine","Turquoise","MediumTurquoise","DarkTurquoise","LightSeaGreen","CadetBlue","DarkCyan","Teal","LightSteelBlue","PowderBlue","LightBlue","SkyBlue","LightSkyBlue","DeepSkyBlue","DodgerBlue","CornflowerBlue","SteelBlue","RoyalBlue","Blue","MediumBlue","DarkBlue","Navy","MidnightBlue","Lavender","Thistle","Plum","Violet","Orchid","Fuchsia","Magenta","MediumOrchid","MediumPurple","BlueViolet","DarkViolet","DarkOrchid","DarkMagenta","Purple","Indigo","DarkSlateBlue","SlateBlue","MediumSlateBlue","White","Snow","Honeydew","MintCream","Azure","AliceBlue","GhostWhite","WhiteSmoke","Seashell","Beige","OldLace","FloralWhite","Ivory","AntiqueWhite","Linen","LavenderBlush","MistyRose","Gainsboro","LightGray","Silver","DarkGrey","Grey","DimGrey","LightSlateGrey","SlateGrey","DarkSlateGrey","Black","palette","DEFAULT_GRADIENT_COLOR","DEFAULT_CONFIG","stops","getHslString","hslArr","convertToXllString","baseString","getActualHslColor","paletteColor","hexToHsv","props_toConsumableArray","newConfig","uniqueValues","treatNullMeasures","scaledVal","minDomainScaledVal","resolveAxisConfig","propVal","defaultVal","getStops","newStops","color_strategy_toConsumableArray","rangeStops","newStopsLength","newRange","hslInterpolator","interpolateHslLong","indexedDomain","uniqueVals","scaleDomain","indexedDomainMeasure","normalDomain","steppedDomain","_getStops","continousSteppedDomain","_getStops2","uniqueRange","indexedRange","numVal","normalRange","strategyGetter","domainType","rangeType","schemeType","color_strategy_defineProperty","domainRange","ColorAxis","color_axis_classCallCheck","_domainType","_rangeType","_schemeType","getSchemeType","_colorStrategy","setColorStrategy","updateDomain","colorStrategy","getScheme","colorSchemes","hslColorArray","getRawColor","color_axis_toConsumableArray","scaleInfo","domainRangeFn","transformationArr","newH","newS","newL","newA","size_strategy_defineProperty","size_strategy_strategies","pieceWiseRange","size_strategy_toConsumableArray","intervals","newIntervals","discreteRange","SizeAxis","size_axis_classCallCheck","_sizeStrategy","domainInfo","domainFn","generator","ShapeAxis","shape_axis_classCallCheck","_generatedShapes","shapeType","shapeGenerator","generatorFn","generatedShapes","createAngleValues","angleData","_angleFn","_angleValues","AngleAxis","angle_axis_classCallCheck","customDomain","customRange","_this$_range","angle_axis_slicedToArray","ROWS","COLUMNS","COL","ROW","CELL","X_AXES","Y_AXES","ENTRY_CELLS","EXIT_CELLS","PRIMARY","SECONDARY","adjustDomain","minOuterRadius","RadiusAxis","radius_axis_classCallCheck","_radiusFactor","sanitizedRange","rangeVal","DATA_TYPES","group_transform","data_type_scale_map_defineProperty","_dataTypeScaleMap","groupByIndices","groupedData","identityTransform","transformMap","transform_factory_defineProperty","_transformMap","uniqueField","valueField","normalizedData","normalizeData","uniqueFieldIndex","valueFieldIndex","seriesKeyIndex","seriesKeys","fieldNames","tuples","rowObj","_tuple","seriesKey","newArr","orderBy","orderIndex","groupByIndex","stackData","seriesData","transformFactory","POLAR","CARTESIAN","transformColor","styleType","intensity","stateColor","originalColor","colorInfo","interactionStyles","elements","getPlotElementsFromSet","_d$meta","colorTransform","helpers_slicedToArray","getAxesScales","_map2","_map4","xScale","yScale","encodingFieldInfRetriever","helpers_defineProperty","_encodingFieldInfRetr","encodingInf","getIndividualClassName","individualClassName","classNameStr","dataNormalizers","_dataNormalizers","encodingFieldInf","radiusFieldIndex","angleFieldIndex","radius0FieldIndex","angle0FieldIndex","fieldsLen","pointObj","radius0","angle0","enc","rowId","transformType","xFieldIndex","yFieldIndex","x0FieldIndex","y0FieldIndex","tuple","domainCalculator","_domainCalculator","layerInst","angleValues","radius0Field","encodingFieldsInf","xFieldSubType","yFieldSubType","x0Field","y0Field","yEnc","xEnc","attachDataToVoronoi","_ref3","helpers_toConsumableArray","updateStyle","positionPoints","positioner","encodingTransform","getPlotMeasurement","dimensionalValues","fieldInfo","_bandScale","span","groupSpan","offsetValues","actualGroupWidth","dataProps","innerPadding","getGroupSpan","isAxisBandScale","axisPadding","groupPadding","resolveInvalidTransformType","transformResolverPredicates","groupByField","dimensionField","getValidTransformForAggFn","resolvedInvalidTransformType","_context$encodingFiel","isCustomTransformTypeProvided","resolveEncodingValues","transformedValues","getColorMetaInf","colorInf","getHslArray","getCoordValue","trig","coordValueGetter","toCartesianCoordinates","rangePlot","_point$update","_coordValueGetter","sortData","axisArr","localOptions","local_options_defineProperty","STATE_NAMESPACES","listener_map_slicedToArray","_cacheEnabled","_cachedData","encodingValue","resolveTransformType","_transformedData","getTransformedData","_normalizedData","getNormalizedData","calculateDomainFromData","layerNs","groupNs","BaseLayer","base_layer_classCallCheck","base_layer_possibleConstructorReturn","base_layer_getPrototypeOf","base_layer_assertThisInitialized","alias","_points","_measurement","_graphicElems","_store","_this$metaInf2","parentNamespace","_encodingFieldsInf","_encodingTransform","_alias","transformData","encodingType","_this$metaInf3","transformedDataArr","_updateLock","_transformType","getValidTransform","_this$metaInf4","unitDom","pointMap","_pointMap","_dataProps","_this$encodingFieldsI","base_layer_slicedToArray","xMeasure","yMeasure","_identifiers$","_identifiers$2","xMeasureIndex","yMeasureIndex","getAllAttrs","filteredPoints","base_layer_toConsumableArray","sizeVal","_identifiers$getData","identifierData","identifierSchema","_this$encodingFieldsI2","tupleArr","transformedVal","graphicElems","elems","_this$metaInf5","rowIndex","unitRowIndex","colIndex","unitColIndex","renderLayer","throwback","_context$metaInf","base_layer_defineProperty","getState","base_layer_construct","userConf","drawLine","curveInterpolatorFn","linepath","LineLayer","line_classCallCheck","line_possibleConstructorReturn","line_getPrototypeOf","isXDim","isYDim","xPx","yPx","resolvedEncodings","stroke","cachePoint","seriesClassName","containerSelection","colorField","colorFieldIndex","animateGroup","groupTransition","groupAnimateStyle","stroke-opacity","getPathStyle","translatePoints","colorValFn","colorVal","getDrawFn","searchRadius","_point$data$data","getIdentifiersFromData","layerId","drawArea","easeEffect","renderer_slicedToArray","enterAreaPath","updateAreaPath","selectionEnter","AreaLayer","area_get","area_getPrototypeOf","_getAxesScales","classNameFn","minYVal","basePos","y0Px","invalidY","invalidY0","resolvedValues","stroke-width","stroke-linejoin","states","fadeout","selected","ArcLayer","arc_classCallCheck","arc_possibleConstructorReturn","arc_getPrototypeOf","_prevPieData","_this$axes","radiusAxis","pieIndex","prevData","angleV","angles","_angles","uid","getOuterRadius","getInnerRadius","startAngle0","endAngle0","_previousInfo","getPreviousPoint","currIndex","prevArc","nextArc","_context$axes$angle$r2","arc_helper_slicedToArray","qualClassName","_arcFn","consecutiveExits","exitCounter","tweenPie","individualClass","tweenExit","exitArr","oldExitCounter","tweenExitPie","consecutiveExitArr","gElem","pieSlices","pieSliceInf","tData","drawText","selectionMerge","backgroundVal","textanchor","textStyle","background","backgroundPadding","_smartLabel$getOriSiz","backgroundEl","alignment-baseline","defaultEncoding","alignmentBaseLine","defRotation","pointTranslators","polar","textEncoding","angleAxis","textFormatter","backgroundEncoding","backgroundValue","resolvedVal","cartesian","textField","textFieldIndex","textValue","text_slicedToArray","TextLayer","text-anchor","drawSymbols","createShape","groupElement","res","Element","newShape","nodeName","src","href","shapeElement","pathStr","checkPath","exitGroup","defColorStyle","fillOpacity","shapes","sizes","PointLayer","point_classCallCheck","point_possibleConstructorReturn","point_getPrototypeOf","_config$offset","offsetX","offsetY","point_slicedToArray","maxSize","generateDataPoints","point_toConsumableArray","drawFn","getMarkId","_maxSize","_getPlotMeasurement2","widthMetrics","heightMetrics","offsetXValues","offsetYValues","measurementConf","getMeasurementConfig","widthSpan","heightSpan","distanceLimit","drawRects","barEnterFn","transitionBars","selTransition","positionRetriever","isNegativeVal","barBasePos","resolveDimByField","axesInfo","spaceType","sizeEncoding","sizeConfig","sizeValue","enterSpace","minVal","maxVal","diffPx","minDomVal","_positionRetriever$ty2","bar_helper_slicedToArray","resolveDimensions","_resolveDimByField","enterWidth","enterX","xPos","_resolveDimByField2","enterHeight","BarLayer","bar_classCallCheck","bar_possibleConstructorReturn","bar_getPrototypeOf","_plotPadding","_plotSpan","bar_get","getTranslatedPoints","normalizedDataArr","clipElement","clipPathElement","bar_slicedToArray","barWidthMetrics","barHeightMetrics","barWidthOffsets","barHeightOffsets","barWidth","barWidthOffset","barHeight","barHeightOffset","uniqueFieldType","pointFound","bar_toConsumableArray","p2","tick_renderer","ticksEnter","angle0Axis","angle0V","angles0","_angles2","_layerInst$encodingFi","_config$span","xSpan","ySpan","x0Px","TickLayer","drawTicks","AREA_LAYER","ARC_LAYER","LINE_LAYER","TEXT_LAYER","POINT_LAYER","BAR_LAYER","TICK_LAYER","SIMPLE_LAYER","BASE_LAYER","sanitizeEncoding","layerFactory","compositeLayers","factoryObj","setLayerRegistry","reg","_layerRegistry","getSerializedConf","serializedDefs","defs","unitLayerDef","sDef","parseLayerDefinition","layerType","strs","layer_factory_toConsumableArray","getLayerInstance","instances","layerObj","layerConstructor","getLayerClass","composeLayers","sanitizeLayerConfig","DEFAULT_LAYERS","defaults_defineProperty","_DEFAULT_LAYERS","LAYER_TYPES","local_options","visual_group_local_options_defineProperty","_CONFIG$ROWS$COLUMNS$","SimpleGroup","action_behaviour_map_defineProperty","ACTIONS","sanitizeLayerDef","sanitizedDefs","sConf","unionDomainFromLayers","layerAxisIndex","getDataDomain","domainValues","layerDomain","fieldDomain","encodingDomain","fieldStr","domain1","renderLayers","_lifeCycleManager","notify","orderedLayers","layerParentGroup","layerDepOrder","getDependencyOrder","graph","dependencyOrder","visited","visit","_layerDepOrder","_timeDiffs","getLayersBy","searchBy","removeLayersBy","createRenderPromise","_renderedPromise","_renderedResolve","radiusAxes","getRadiusRange","isXandYMeasures","_context$fields","src_helper_slicedToArray","xMeasures","yMeasures","getKey","GRID_BAND","GRID_LINE","getGridLayerDefinitions","axisType","getDefaultVisibilty","getLayerDefinition","_definition","_axes","_encoding","gridLines","gridBands","gridLineColor","zeroLineColor","gridBandColor","isLinearScale","grid_lines_defineProperty","isNegativeDomain","_context$axes","dimensionSubTypes","getValidSubtype","attachDataToGridLineLayers","_gridLines","_gridBands","gridLayerData","getGridLayerData","gridData","jsonData","_jsonData$push","grid_lines_toConsumableArray","calculateDomainListener","_layerAxisIndex","src_listener_map_slicedToArray","fieldsVal","removeExitLayers","layersMap","markSet","queuedLayerDefs","_queuedLayerDefs","layerDefArr","defFn","listener_map_toConsumableArray","hasPlotSpan","axesObj","temporalFields","filteredFields","_ref5","_ref6","minimumConsecutiveDifference","_ref7","_ref8","_timeDiffsByField","originalData","cachedData","createSelectionSet","attachPropagationListener","_ref9","createGridLineLayer","vuConf","definitions","atomicDef","_ref11","_ref12","transformDataModels","transformVal","_ref15","_ref16","layerAxisIndexVal","axesVal","attachDataToLayers","transformedDataModels","dataSource","_dimensionMeasureMap","getDimensionMeasureMap","retinalEncodingsAndMeasures","_layer$encodingFields","sizeField","shapeField","_retinalEncodingsAndM","src_helper_toConsumableArray","attachAxisToLayers","axisInf","src_props_defineProperty","_PROPS","payloadGenerator","brush","selectionDataModel","propPayload","getRangeFromData","propCriteria","fieldMap","isDimension","payload_generator_toConsumableArray","__default","propagateValues","propagationFieldInf","propagationFields","sideEfffects","mergedModel","sourceUnit","sourceCanvas","parentAlias","propagationBehaviour","propFields","facetByFields","getModelWithFacetData","schema1","data1","derivedSchema","dataAtFirstPos","data_propagator_toConsumableArray","behaviourInstance","entry","propagationConf","sourceBehaviour","enabled","propConf","actionInf","sideEffectPolicy","sourceIdentifierFields","hasCommonCanvas","UnitFireBolt","src_firebolt_classCallCheck","firebolt_possibleConstructorReturn","firebolt_getPrototypeOf","SIDE_EFFECTS","changeSideEffectStateOnPropagation","unitId","aliasName","propagationSourceCanvas","sourceUnitId","sourceSideEffects","sideEffectInstances","actionOnSource","mappedEffects","sideEffectCheckers","checker","_getSelectionRejectio","getSelectionRejectionModel","propModel","propValuesMap","rejectionModel","_propModel$getData","exitRowIds","rowIdsObj","_cachedValuesMap","enabledFn","sourceBehaviours","trackerClassName","arcLayerClassName","sideEffectClassName","src_local_options","src_local_options_defineProperty","_CONFIG$LAYERDEFS$TRA","valuesMap","getValuesMap","_model$getData","fieldIndices","local_options_toConsumableArray","oldData","unitNs","VisualUnit","visual_unit_classCallCheck","lifeCycleManager","_gridLinesSelection","_gridBandsSelection","_this$_dependencies","fireboltDeps","_firebolt","_rootSvg","class","renderGridLineLayers","gridLineParentGroup","_entry","grid_lines_slicedToArray","parentGroupClass","_sideEffectGroup","createSideEffectGroup","initSideEffects","rootSvg","_this$parentContainer","parentContainerInf","layerDefinition","layerDefinitions","components","layerIndex","layersArr","_layersArr","markId","defArr","getLayerFromDef","existingLayer","instanceArr","instanceValues","visual_unit_toConsumableArray","layerdeps","depArr","resolveEncodingTransform","resolvable","resolved","getLayerAxisIndex","_layer$config","specificField","encodingField","_this$_dependencies2","parentModel","dimValue","getNearestDimensionalValue","entryVal","pointInf","getMarkInfFromLayers","markInf","parsedIdentifiers","transposeArray","getPointsFromIdentifiers","localNs","visual_unit_slicedToArray","visual_unit_defineProperty","dispatchQueuedSideEffects","firebolt_helper_toConsumableArray","clearActionHistory","visual_unit_construct","Variable","ComposedVars","composed_vars_classCallCheck","composed_vars_possibleConstructorReturn","composed_vars_getPrototypeOf","vars","_vars","_data","member","getMinDiff","SimpleVariable","simple_var_classCallCheck","simple_var_possibleConstructorReturn","simple_var_getPrototypeOf","oneVar","_oneVar","dtFormat","dateFormat","fieldDef","varInst","convertToVar","datamodel","transformFields","field_sanitizer_slicedToArray","normalizedFields","normalizeFields","norFields","orderFields","fieldArray","dimensionArr","measureArr","temporalArr","categoricalArr","fieldList","numOfMeasures","allDimensions","field_sanitizer_toConsumableArray","temporal","categorical","rowsInfo","columnsInfo","rowDimensions","rowMeasures","rowTemporalFields","rowCategoricalFields","columnDimensions","columnMeasures","columnTemporalFields","columnCategoricalFields","VisualEncoder","_fieldInfo","_axisFrom","_headerFrom","__headerFrom","axisFrom","_getHeaderAxisFrom2","visual_encoder_slicedToArray","getHeaderAxisFrom","rowHeader","rowAxis","_getHeaderAxisFrom4","colHeader","colAxis","column","headerFrom","scaleMaps","dataTypeScaleMap","generateAxisFromMap","axesCreators","facetFields","axisKey","groupAxes","currentAxes","cacheMaps","commonAxisKey","getAxisKey","axisConfig","getAxisConfig","axisInfo","axisOrientation","columnIndex","rawUserAxisConfig","userAxisConfig","_rotationLock","createSimpleAxis","Cls","sanitizeIndividualLayerConfig","encodingConfigs","getIndex","arrIndex","CartesianEncoder","geomCellAxes","projections","rowFields","columnFields","geomCell","xAxes","yAxes","units","1","rIdx","unitsArr","cIdx","encodingDomains","axisTypeIndex","typeOfField","_resolver$axes","axesArr","adjustedDomain","typeOfAxis","alignZeroLine","getAdjustedDomain","y1ratio","y2ratio","allSameSign","currentFieldName","sortingOrder","sortCategoricalField","sortOrder","sortOrderType","facets","counter","primaryFacets","secondaryFacets","primaryFields","secondaryFields","primaryLen","secondaryLen","projArr","primaryField","secondaryField","facet","existIndex","axisFromIndex","cartesian_encoder_get","cartesian_encoder_getPrototypeOf","groupedModel","encodingObj","retriveDomainFromData","layerArray","serializedLayers","userLayerConfig","layerConfig","retinalConfig","colField","colFieldName","rowField","configs","rowFieldName","rowFieldType","getDefaultMark","colFieldType","defConfigs","layerConfigs","getLayerConfFromFields","colFields","encodingArr","encoder_helper_toConsumableArray","xFields","yFields","colFieldExist","rowFieldExist","layerConf","mergedLayerConf","serializedLayerConfig","cartesian_encoder_toConsumableArray","axesCls","polar_encoder_defineProperty","_axesCls","PolarEncoder","pieAxes","matrixLayers","resolverAxes","varInstances","encType","userConfig","domainProps","matrixInstance","unitDomains","setRadiusFactor","sizeFieldIndex","sizeMultiplier","getSizeMultiplier","sizeAxisDomain","encodingFields","_layers","sanitizedRows","sanitizedColumns","polar_encoder_get","polar_encoder_getPrototypeOf","sanitizedFields","typeIndex","fieldSet","polar_encoder_toConsumableArray","layerEncoding","sanitizedConfig","angleField","angle0Field","RetinalEncoder","newAxes","createRetinalAxis","fieldProps","getAxisType","isDistributionEqual","group_utils_toConsumableArray","rowType","initializeCacheMaps","cellMap","xAxesMap","yAxesMap","entryCellMap","exitCellMap","headerCreator","fieldHeaders","TextCell","getHeaderText","headers","rowLength","header","getEncoder","encoder","hasPolarEncodings","userAxisFromConfig","group_utils_slicedToArray","firstField","secondField","firstFieldType","secondFieldType","setFacetsAndProjections","_encoder$simpleEncode","simpleEncoder","getFacetsAndProjections","group_utils_defineProperty","getBorders","matrices","showRowBorders","showColBorders","showValueBorders","valueMatrix","_rows","leftRows","rightRows","_columns","topColumns","bottomColumns","_encoder$fieldInfo","allDimensionLength","allMeasuresLength","allTemporalFieldsLength","getRowBorders","borders","getColumnsBorders","getValueBorders","borderTypeRow","borderTypeCol","sortFacetFields","facetNames","sortInfo","sortConfig","facetSortConfig","getSchemaDef","getFieldNames","fieldVar","matrix_model_toConsumableArray","prepareHashMaps","hashMap","rowKey","joinedRowKey","createJoinedKeys","keyArr","joinedKey","formatKeys","formatterList","formattedKeys","rKeys","createColumnDataModels","colContext","sourceDM","rowFacets","colFacets","rowKeyArr","colKeyObj","newRowIndex","splitModelsHashMap","currentColumnIndex","colKeyArr","colKey","hashMapKey","splitByColumn","optionalProjections","facetInfo","projectionInfo","geomCellCreator","uniqueFields","commonFields","_indices$i","projectionIndexObject","matrix_model_objectSpread","getMatrixModel","globalConfig","currentRowIndex","prepareProjectionInfo","colProjections","rowProjections","rowProj","rIndex","newRIndex","colProj","cIndex","newCIndex","newRowProj","newColProj","prepareFacetInfo","rowFacetNames","colFacetNames","allFacets","_getSplitModelHashMap","getSplitModelHashMap","splitModels","rowKeyHashMap","colKeyHashMap","rowKeys","colKeys","splitContext","splitByRow","generalContext","rowKeyObj","createRowDataModels","rowContext","rowIndexForCurrentKey","_createColumnDataMode","_createColumnDataMode2","_createColumnDataMode3","_createColumnDataMode4","formattedColKeys","facetField","rawFormat","columnKeys","createValueCells","suppliedLayers","GeomCell","horizontalAxis","verticalAxis","datamodelTransform","sortedFields","layerConfigArr","getLayerConfig","normalizedColumns","normalizedRows","cell_creator_toConsumableArray","geomCellKey","getCellKey","columnId","updateCells","facetKey","extractAxisIndex","createAxisCells","currObj","axisInst","_axisInst$config","AxisCell","BlankCell","extractFacetIndex","headerPlaceholderGn","selectionObj","selectionKeys","keySet","textCells","createTextCells","textCell","generatePlaceholders","facetsAndProjections","encoders","valuesMatrix","takeAxisFrom","takeHeaderFrom","axisPlaceholderGn","selObj","axesMatrix","selObjProp","axesForDraw","rowsPrimary","rowPrime","rowsSecondary","rowSec","columnsPrimary","colPrime","columnsSecondary","colSec","_selectionObj","section","hContext","getAxisFields","fieldHolder","ac","transformDataModel","resolvedData","allFields","extractFields","layerFields","_ref4","flattenArray","getFieldsFromSuppliedLayers","suppliedLayerConfig","aggregationFns","nearestAggFns","resolvedAggFns","sortDmTemporalFields","fieldConfig","computeMatrices","componentRegistry","autoGroupBy","otherEncodings","matrixGnContext","getCellDef","isRowSizeEqual","isColumnSizeEqual","colCells","rowCells","resetSimpleAxes","newCacheMap","valueCellContext","serializeLayerConfig","cellCreator","valueCellsCreator","valueMatrixInfo","removeExitCells","exitCells","qualifiedStateProps","getQualifiedStateProps","placeholder","_mutateAxesFromMap","mutateAxesFromMap","xAxisSet","yAxisSet","axisId","createUnits","_generateMatrices","generateMatrices","leftHeaders","topHeaders","bottomHeaders","rightHeaders","cell_creator_slicedToArray","leftFacets","rightFacets","rowPriority","colPriority","leftMatrix","rightMatrix","topMatrix","bottomMatrix","currentBottomLength","setAvailableSpace","rowMatrix","columnMatrix","RESOLVER_PROPS","MatrixResolver","matrix_resolver_classCallCheck","_registry","_layerConfig","_matrixLayers","_rowMatrix","_columnMatrix","_valueMatrix","_facets","_projections","_datamodelTransform","_units","_cacheMaps","_fireboltDeps","maps","matrix_resolver_toConsumableArray","_horizontalAxis","_verticalAxis","matrixType","matrix_resolver_defineProperty","_this5","sideEffectRegistry","_this$dependencies","unitConfig","extractUnitConfig","_this$getAllFields","retContext","getRetinalFieldsDomain","retinalEncoder","setCommonDomain","_this6","retinalAxes","updateModel","placeholders","bottomLeft","bottomRight","_this$dependencies3","showHeaders","matrix_resolver_slicedToArray","topCols","bottomCols","rowHeaders","blankCellCreator","footers","topLeft","topRight","ValueMatrix","matrixArr","value_matrix_classCallCheck","instancesById","cellValue","_instancesById","_matrix","_filterFn","rowWidth","currentRowWidth","getLogicalSpace","rowHeight","currentRowHeight","setMatrixInstances","_composition","createMatrices","matrixConfig","unsubscribeChangeListeners","sanitizeRetinalConfig","retinalConf","confValue","groupType","fieldSanitizer","setAxisAndHeaders","placeholderInfo","getMatrices","_groupedDataModel","createRetinalAxes","setDomains","cornerMatrices","createHeaders","metaData","border","unionUnitDomains","registerDomainChangeListener","visual_group_props_defineProperty","visual_group_props_PROPS","cellRegistry","VisualGroup","visual_group_classCallCheck","visual_group_possibleConstructorReturn","visual_group_getPrototypeOf","componentSubRegistry","visual_group_assertThisInitialized","_selection","initializeGlobalState","globalState","createUnitState","_VisualUnit$getState2","visual_group_helper_slicedToArray","localState","createLayerState","_BaseLayer$getState2","setupChangeListeners","stores","comp","getListeners","storeInst","listenerInf","variable","findInGroup","channel","group_utils_this","facetType","projType","getRetinalAxes","getSimpleAxes","_this$resolver$getAll","visual_group_defineProperty","info","existingRemoveSet","select_toConsumableArray","firebolt_action_behaviour_map_defineProperty","action_behaviour_map_actionBehaviourMap","propagationBehaviourMap","_propagationBehaviour","firebolt_behaviour_effect_map_defineProperty","firebolt_behaviour_effect_map_behaviourEffectMap","propagationSideEffects","_propagationSideEffec","SCALE_FUNCTIONS","VALUE","canvasAlias","rawVal","check","assembleModelFromIdentifiers","temp","fieldVal","src_firebolt_helper_toConsumableArray","LegendFireBolt","_Firebolt","legend_firebolt_classCallCheck","legend_firebolt_possibleConstructorReturn","legend_firebolt_getPrototypeOf","legend_firebolt_inherits","legend_firebolt_createClass","behaviourName","getCriteriaFromData","firebolt_physical_defineProperty","physical_physicalActions","boundingBox","gradientDimensions","axisScale","rangeShifter","drag_defineProperty","getSelectionCriteria","selectionBoxMeasure","drawingInfMeasure","subjectStartPoint","gradientDimension","legendGradContainer","legendSelGroup","enterFn","getMousePos","boundingClientRect","selection_box_drag_defineProperty","fadeOut","brighten","LegendHighlighter","legend_highlighter_classCallCheck","legend_highlighter_possibleConstructorReturn","legend_highlighter_getPrototypeOf","legendContainer","resetLogicalSpace","title","_title","ALIGN","DEFAULT_MEASUREMENT","LEGEND_TITLE","borderStyle","borderColor","bounds","upper","ICON_MAP","getScaleInfo","scaleType","steps","scaleFn","getInterpolatedArrayData","domainForLegend","scaleParams","requiredWidth","requiredHeight","upperBound","maxTickDiff","alignment","smartLabelCalc","minimumTickSize","_smartLabelCalc$getOr","isInteger","getcomputedArray","computationhelper","requiredMeasure","availableMeasure","currentTickValue","nextTickValue","measureParam","pixelPerTick","getInterpolatedData","recomputeSteps","getTickMeasure","_scaleParams$measures","interpolatedFn","tickValue","getDomainBounds","domainBounds","domainLeg","ele","legend_helper_defineProperty","getScaleFactor","SimpleLegend","simple_legend_classCallCheck","_metaData","_fieldName","_labelManager","_cells","defaultMeasurement","_computedStyle","legendBehaviours","_canvasAlias","getItemMeasures","_labelManager$getOriS","_this$measurement","effPadding","effBorder","effMargin","dataFromScale","titleSpace","getTitleSpace","titleHeight","titleWidth","labelSpaces","getLabelSpaces","_computeItemSpaces","computeItemSpaces","maxItemSpaces","textOrientation","itemSpaces","iconSpaces","maxIconWidth","labelSpace","itemSpace","iconSpace","newLabelWidth","titleSpaces","_this$measurement2","_this$config3","titleCreator","titleContainer","marginPosition","_this$config4","_this$measurement3","renderTitle","simple_legend_defineProperty","legendOrientation","position_config_defineProperty","_legendOrientation","datasets","itemContainerMeasures","getStepSpacesInfo","iconHeight","iconWidth","stepPadding","horizontal","vertical","positionConfig","_positionConfig","alignmentMap","_alignmentMap","itemStack","_itemStack","createLegendSkeleton","gradWidth","gradHeight","maxGradHeight","maxGradWidth","legendBody","legendItem","getItemContainers","legendInstance","positionObj","createItemSkeleton","_context$config","itemSkeleton","alignClass","applyItemStyle","measureType","stepColorCheck","_context$measurement","renderIcon","defaultIcon","DiscreteLegend","_getScaleInfo","discrete_legend_toConsumableArray","_field$schema","discrete_legend_defineProperty","discrete_legend_get","discrete_legend_getPrototypeOf","renderDiscreteItem","_context$measurement2","_item$icon","text-align","getGradientDomain","accumulator","currentValue","MAX_VALUE","MIN_VALUE","legendGradSvg","legendGradCont","linearGradient","makeLinearGradient","legendRect","GradientLegend","gradient_legend_toConsumableArray","gradient_legend_defineProperty","newAxis","axisSpace","axisDomainLength","_legendGradientSvg","gradient_legend_get","gradient_legend_getPrototypeOf","renderGradient","_createLegendSkeleton","StepLegend","step_legend_toConsumableArray","step_legend_defineProperty","lowerBounds","upperBounds","step_legend_get","step_legend_getPrototypeOf","stepData","renderStepItem","_context$measurement3","_item$icon2","_positionConfig$posit","PADDING","BORDER","MARGIN","TITLE_TEMPLATE_NOT_ALLOWED_TAGS","LEGEND_TYPE_MAP","constants_defineProperty","_LEGEND_TYPE_MAP","HORIZONTAL_CENTER","VERTICAL_CENTER","share","operators_construct","operators_toConsumableArray","strings","htmlCode","expLn","frag","createDocumentFragment","treeShakeNode","nodeType","Node","ELEMENT_NODE","tagName","childNodes","canvasIterator","canvases","iteratorFn","cFn","canvas","visualGroup","_throwback","listenerFn","registerActions","fnName","_registrableComponents","setFireboltDependencies","actionModel","ActionModel","action_model_classCallCheck","registerPropagationBehaviourMap","dissociateBehaviour","dissociateSideEffect","policy","registrableComponents","mergedPolicy","aliases","*","propagationPayload","propagationCanvas","crossInteractionPolicy","TITLE_CONFIG","SUB_TITLE_CONFIG","maxLines","MESSAGE_CONFIG","canvas_local_options_defineProperty","_localOptions","canvasOptions","_canvasOptions","local_options_slicedToArray","arg1","arg2","local_options_typeof","titleConfig","defConfig","subtitle","subtitleConfig","sub","LayoutComponent","layoutComponent_classCallCheck","_boundBox","_renderAt","_alignWith","_alignment","_componentName","_className","DummyComponent","newDimensions","renderAt","component","componentName","pagination","scrollBar","thickness","speed","legend","minHeight","minCharacters","verticalAlign","collapse","invalidValues","DEFAULT_WIDTH","DEFAULT_HEIGHT","DEFAULT_CLASS_NAME","NODE_PREFIX","DefinitionModel","definitionModel_classCallCheck","_host","host","_cut","cut","_ratioWeight","ratioWeight","_preferred","preferred","_lanes","lanes","_remainingHeight","_remainingWidth","remainingHeight","remainingWidth","getNodeId","_uid","yExtraSpace","smallestHeight","getCutType","smallestExtraHeightHorizontally","MAX_SAFE_INTEGER","containerHeight","hostHeight","xExtraSpace","smallestWidth","smallestExtraWidthVertically","containerWidth","hostWidth","createPlaceHolderComponent","placeComponent","definitionModel","leftOvercomponentRationWidth","isPreferred","isGridComponent","componentRatioWidth","leftHeight","leftWidth","_component$getLogical","componentHeight","componentWidth","firstLaneConfig","firstLane","secondLane","tree_classCallCheck","_parentCut","_this$_children","tree_toConsumableArray","parentCut","bound","nodeconfig","searchNode","childNode","nodeId","deleteSearchNode","LayoutModel","measurements","layout_model_classCallCheck","_measurements","_root","createTree","setBoundBox","addChildren","lane","allocateBoundingBox","totalWeight","carry","lastSibling","ratio","setHostSpatialConfig","setHostPosition","negotiateDimension","alteredDim","nonAlteredDim","cumultiveExtraSpaceAmt","childrenLength","extraSpaceAmt","computePosition","determineBoundBox","bb","_lastSibling$boundBox","_top","_left","_height","_width","_instance$parent$boun","setSpatialConfig","VIEW_INDEX","ROW_MATRIX_INDEX","2","COLUMN_MATRIX_INDEX","HEIGHT","ROW_ROOT","COLUMN_ROOT","VERTICAL","HORIZONTAL","Utils","utils_classCallCheck","utils_createClass","isDOMElement","getID","getElement","findContainer","coordinate","removeDiv","divId","DataPoint","data_point_classCallCheck","DataParser","data_parser_classCallCheck","data_parser_createClass","defaultDataPointLogic","nodepoints","getnodePoints","datapoint","HTMLDataAdapter","_DataParser","html_data_classCallCheck","html_data_possibleConstructorReturn","html_data_getPrototypeOf","html_data_inherits","html_data_createClass","getCoordinates","html_data_get","Renderer","renderer_classCallCheck","renderer_createClass","initRenderer","__logicalTree","HTMLRenderer","_Renderer","html_renderer_classCallCheck","html_renderer_possibleConstructorReturn","html_renderer_getPrototypeOf","_coordinates","html_renderer_inherits","html_renderer_createClass","createhtml","mainDiv","html_renderer_get","parentDiv","createAndCustomiseParent","hasHost","createAndPositionDiv","html_renderer_objectSpread","div","coordinates","findNode","nodeID","renderer","drawLayout","renderHTML","resolveAligment","componentData","alignWith","componentToAlign","componentMap","refNode","newNodeConfig","setAlignConfig","DrawingManager","drawing_manager_classCallCheck","_componentMap","_layoutClassName","layoutClassName","_renderer","drawing_manager_createClass","drawComponent","DefinitionManager","definition_manager_classCallCheck","_prioritySequence","_totalHeight","_totalWidth","_targetComponentMap","prepareTargetComponentMap","targetComponentMap","canvasComponent","tempDefModel","componentRef","getComponent","placeGridComponent","gridComponents","iscolumnPreffered","_placeComponent","rowpreffred","LayoutDef","layout_def_classCallCheck","_layoutDefinition","layout_def_createClass","addComponent","layoutDefinition","addMultipleComponent","componentArray","sanitizedDefinition","hostObj","hostID","childHost","resetComponentMap","LayoutManager","layout_manager_classCallCheck","_dimension","_skeletonType","skeletonType","_layoutDef","_drawingManager","_rootNodeID","con","resetNode","updateNode","compute","_layout","calLayOutDef","_context$dimension","layoutDef","prioritySequence","generateConfigModel","negotiate","broadcast","layoutComponents","componentArr","compo","elementName","removeElement","elemID","co","deleteElement","setupChangeListener","allOptions","_allOptions","canvas_helper_toConsumableArray","nameSpaceProps","equalityProps","equalityChecker","option","updateProps","updateChecker","dispatchProps","_cachedProps","notifyAnimationEnd","viewInfo","layout","centerMatrix","viewMatricesInfo","promises","cellArr","lifeCycle","animDonePromises","animationDone","applyInteractionPolicy","interactionPolicy","_interactionPolicy","_crossInteractionPolicy","unitFireBolt","changeBehaviourStateOnPropagation","createLayoutManager","src_options","minUnitWidth","minUnitHeight","options_slicedToArray","_ref2$","_auxConfig$reset","oldConf","fixScrollBarConfig","GenericLayout","generic_layout_classCallCheck","_matrices","_centerMatrix","_mountPoint","DEFAULT_CONFIGURATION","grid_layout_defaults_defineProperty","_DEFAULT_CONFIGURATIO","_FieldNames$BORDER","DEFAULT_MEASUREMENTS","_DEFAULT_MEASUREMENTS","findInPage","page","combineMatrices","isTransposed","joinedMatrix","utils_toConsumableArray","rowData","computeLogicalSpace","maxMeasures","_config$isTransposed","unitMeasures","_getMeasureInfo","getMeasureInfo","firstMeasure","secondMeasure","minMeasures","getMinMeasures","_logicalSpace","utils_defineProperty","valueItem","maxMeasure","firstMeasureValue","secondMeasureValue","valueArray","_item$space","fMeasure","sMeasure","minSecondMeasure","createMatrixEachLevel","_arr$i","extraCellsRemover","beg","distribution","extraCellLengths","VisualMatrix","visual_matrix_classCallCheck","_lastLevelKey","_primaryMatrix","_secondaryMatrix","_maxMeasures","_availableSpace","_layoutMatrix","_tree","_createTree2","matrixTree","lastLevelKey","layoutMatrix","primaryMatrix","secondaryMatrix","breakPage","primaryMatrixLength","newMatrix","keyLength","heightMeasures","populateMaxMeasures","widthMeasures","calculateDepth","viewableMatrix","createViewPortMatrix","viewableMeasures","redistributeSpaces","childDepth","createMatrixInstances","matrixInfo","breakPointer","_breakPointer","brokenMatrix","breakMatrix","nextLevel","removeExtraCells","RowVisualMatrix","row_matrix_classCallCheck","row_matrix_possibleConstructorReturn","row_matrix_getPrototypeOf","maxHeights","maxWidths","matrixInst","cellDimOptions","matrixIndex","_this2$getCellDimensi","getCellDimensions","widths","rowHeights","columnWidths","primary","secondary","begCellLen","endCellLen","remainingAvailWidth","cWidths","maxPrioritySpace","availableWidth","currentWidth","prioritySpace","logicalWidths","getPriorityDistribution","mWidth","mHeight","redistributeViewSpaces","computeViewableSpaces","rHeights","gutter","spaceTakenByColumn","spaces","getDistributedHeight","heightWithoutGutter","distSum","gutterSum","availableHeight","colLen","distHeight","borderWidth","colHeight","colWidth","heights","ColumnVisualMatrix","column_matrix_classCallCheck","column_matrix_possibleConstructorReturn","column_matrix_getPrototypeOf","heightDist","divider","spaceTakenByRow","getDistributedWidth","layoutConfig","distWidth","rowLen","oldLogicalSpace","heightDistribution","getMatrixMeasurement","setViewSpaces","pointerType","viewSpaces","pointer","computations_defineProperty","paginationDetailsMap","scrollType","paginationMeasureGetter","relatedMaxMeasure","getMatrixMeasureForPagination","measureDetails","actualMeasure","scrollInfo","getMatrixHeightDetails","columnMatrixWidth","_getHeightRequiredByC","getHeightRequiredByColMatrix","maxColumnMatrixHeight","columnViewSpace","getViewableSpaces","columnPointer","columnMatrixHeight","maxHeightAvailableForRowMatrix","rowMatrixHeight","bufferCondition","isScroll","getActualBufferFromConfig","computations_slicedToArray","getBufferFromCondition","currentBufferType","horizontalBuffer","verticalBuffer","computeLayoutMeasurements","_getMatrixWidthDetail","getMatrixWidthDetails","_layout$config3","rowMatrixWidth","maxRowMatrixWidth","maxWidthAvailableForColumnMatrix","_getMatrixHeightDetai","_getActualBufferFromC","rowViewableSpaces","columnViewableSpaces","setValueMatrixMeasurements","computations_toConsumableArray","rowWidthsPrimary","rowWidthsSecondary","columnHeightsPrimary","columnHeightsSecondary","measureSum","total","GridLayout","layout_classCallCheck","layout_possibleConstructorReturn","layout_getPrototypeOf","_layoutId","_scrollInfo","generateVisualMatrices","begColCells","endColCells","gutterSpace","layout_helper_slicedToArray","_center","_bottom","layout_helper_toConsumableArray","RowMatrix","ColumnMatrix","layout_get","_computeLayoutMeasure","setViewInformation","pageNumber","pageType","totalPages","layout_defineProperty","renderGrid","currentPage","_viewInfo","maxRowHeight","maxColWidth","rowPointer","getViewMatrices","rowMatrices","getViewableMatrices","columnMatrices","centralMatrixPointer","rowMatrixLen","columnMatrixLen","rowPages","columnPages","layoutDimensions","getViewMeasurements","_layout$config","rowSpaces","colSpaces","rightWidth","topHeight","bottomHeight","centerHeight","centerWidth","viewWidth","viewHeight","actualCenterMeasures","totalMeasures","unitHeights","unitWidths","borderMap","border_helper_defineProperty","_borderMap","specificBorderApplier","borderTypes","showBorders","borderInfo","borderType","applySpecificBorder","applyBorders","borderApplierFn","borderApplier","borderMapVal","orderMaker","nestByStack","updateArr","optionalParams","currStack","prevStack","arrVal","stackVal","currElemIndex","newElem","arrElem","returnArr","spanCalculator","colData","colIdx","isNull","maskCreator","_nestByStack","viewMatrix","hierarchy","_nestByStack2","spanGenerator","spans","ridx","currSpan","getOrder","matrixSpanGeneratorMap","span_maker_defineProperty","_matrixSpanGeneratorM","orderGetter","viewMatrixMaker","spanMaker","matrixSpanGenerator","spanApplier","cellCounter","spaceAllocationDueToSpan","primaryUnitWidth","cumulativeWidth","spanApplierMap","_spanApplierMap","TransactionSupport","INTERFACE_IMPl","CLASSPREFIX","HEADER","DATA","AXES","FACET_BY_FIELDS","FIELDS","TRANSFORM","LAYER_DEF","CONFIG","DETAIL_FIELDS","AXIS","GEOM","BLANK","SimpleCell","simple_cell_classCallCheck","enums_defaults_defineProperty","_DEFAULT_CONFIG","_CONSTANTS$MARGIN","CONSTANTS","DEFAULT_PROPS","minSpacing","visual_cell_src_props_defineProperty","visual_cell_src_props_PROPS","caption","smartText","axis_cell_classCallCheck","axis_cell_possibleConstructorReturn","axis_cell_getPrototypeOf","_availHeight","_availWidth","axis_cell_assertThisInitialized","computeAxisSpace","logicalWidth","logicalHeight","spaceFixer","_axis$getLogicalSpace","actualWidth","actualHeight","_axis$config2","wrapperDiv","blank_cell_classCallCheck","blank_cell_possibleConstructorReturn","blank_cell_getPrototypeOf","blank_cell_assertThisInitialized","setSmartText","_context$minSpacing","minHeightSpace","minWidthSpace","paddedHeight","paddedWidth","text_cell_classCallCheck","text_cell_possibleConstructorReturn","text_cell_getPrototypeOf","text_cell_assertThisInitialized","computeTextSpace","_context$minSpacing2","minText","_minTextSpace","smartSpace","textAlign","vAlign","_this$smartText","translation","middle","geom_cell_classCallCheck","geom_cell_possibleConstructorReturn","geom_cell_getPrototypeOf","_unit","_datamodel","_facetByFields","_transform","_caption","geom_cell_assertThisInitialized","captionSpace","computeGeomSpace","getCaptionSpace","captionDom","DEFAULT_PLACEHOLDERS","src_defaults_defineProperty","_DEFAULT_PLACEHOLDERS","resolveTitleSubTitleContent","rawContent","escapeHTML","htmlEscapes","&","<",">","\"","'","/","createHeading","prevCell","cellType","_minTickDiff","legendInitializer","legendConfig","prevLegends","legends","headerHeight","legendInfo","legendCreator","LegendCls","dataset","scaleProps","_scale$config","stepMapper","dataInfo","legendMeasures","titleText","getGroupByData","setLegendMeasures","MuzeComponent","_this$boundBox","HeaderComponent","headerComponent_classCallCheck","headerComponent_possibleConstructorReturn","headerComponent_getPrototypeOf","setParams","cont","renderHeader","LegendComponent","legendComponent_classCallCheck","legendComponent_possibleConstructorReturn","legendComponent_getPrototypeOf","legendSpace","sectionComponents","_this$params$config","legendMount","legWidth","legHeight","sections","currHeight","currWidth","leg","legendHeight","legendWidth","renderLegend","_defaultAlignmentHelp","defaultAlignmentHelper","arrowSizeMap","getUnitPositions","totalLength","viewLength","currentLen","unitPosition","createScrollBarArrow","createScrollBarRect","mover","applyScrollMouseDownAction","moverRect","scrollMaker","_mover$node$getBoundi","_rect$node$getBoundin","rectX","rectY","changeMoverPosition","registerListenerOnArrow","arrowType","_components","isTouchDevice","registerListeners","applyMoverDrag","moverStartPos","rectStartPos","distanceMoved","actualPosition","pageXOffset","pageYOffset","applyRectClick","emptyScrollAreaClick","manager","unitPositions","ScrollMaker","scroll_maker_classCallCheck","_attachedScrollAction","_unitPositions","scroll_maker_createClass","scrollTo","scrollDeltaTo","createScroll","scrollBarContainer","scrollContainerHelper","attachScrollAction","externalScrollAction","detachScrollAction","scrollMakerMap","_ScrollMaker","HorizontalScrollMaker","horizontal_scroll_maker_classCallCheck","horizontal_scroll_maker_possibleConstructorReturn","horizontal_scroll_maker_getPrototypeOf","horizontal_scroll_maker_inherits","horizontal_scroll_maker_createClass","horizontal_scroll_maker_get","prevArrow","nextArrow","_this$logicalSpace","scrollBarWithouArrowLength","_scrollBarWithouArrowLength","_this$_components$mov","positionAdjuster","newPosition","currentPos","_this$_components$mov2","moverPos","movedViewLength","performAttachedScrollFunction","delta","_this$_components$mov3","scrollPercentage","movement","VerticalScrollMaker","vertical_scroll_maker_classCallCheck","vertical_scroll_maker_possibleConstructorReturn","vertical_scroll_maker_getPrototypeOf","vertical_scroll_maker_inherits","vertical_scroll_maker_createClass","vertical_scroll_maker_get","ScrollComponent","scroll_component_classCallCheck","scrollBarComponentConfig","scroll_component_possibleConstructorReturn","scroll_component_getPrototypeOf","unitIndex","sanitizedUnitIndex","externalAction","MatrixComponent","matrix_component_classCallCheck","matrix_component_possibleConstructorReturn","matrix_component_getPrototypeOf","_this$params$config$s","containerForMatrix","applyScroll","_cellSpanMaker","cellSpanMaker","_matrixSpanGenerator","renderTable","applySpans","applier","renderPlaceholders","renderMatrix","applyScrollAction","scollDistance","GridComponent","grid_component_classCallCheck","grid_component_possibleConstructorReturn","grid_component_getPrototypeOf","_this$component$viewI","matrixDim","matrixName","updateWrapper","matrixWrapper","allComponents","_scrollBarManager","scrollBarManager","wheelDeltaX","wheelDeltaY","preventBrowserScroll","triggerScrollBarAction","movedView","scrollActionApplier","_this$component$0$0$b","sanitizeGrid","attachScrollListener","MessageComponent","message_component_classCallCheck","message_component_possibleConstructorReturn","message_component_getPrototypeOf","_config$dimensions","message","_params$config","headerMap","headerCell","configType","headerAlignmentMap","component_wrapper_maker_defineProperty","_headerAlignmentMap","isGridPresent","renderDetails","_renderDetails$compon","checkParamsValidation","createHeaderWrapper","headerType","layoutManager","_headerMap$headerType","headerConfig","wrapperParams","component_wrapper_maker_objectSpread","existingComponent","createScrollBarWrapper","scrollBarType","grid","_scrollBarMap$scrollB","scrollBarMap","layoutBasedMeasure","viewMeasure","rowAlign","colAlign","componentWrapperMaker","_layoutManager","createMessageWrapper","_i","_headerValues","defaultDimensions","gridComponent","getBoundBox","createLegendWrapper","legendWrapper","gridLayoutWrapper","verticalScrollBar","horizontalScrollBar","ScrollManager","scroll_manager_classCallCheck","_scrollBarComponents","_attachedComponents","scroll_manager_createClass","scrollBarComponents","attachedComponents","performScrollAction","getRenderDetails","_mount$getBoundingCli","heightAttr","widthAttr","visGroup","_visGroup$placeholder","legendPosition","layoutArrangement","arrangeComponents","_titleLayouts","titleLayouts","component_resolver_defineProperty","legendLayouts","titlePosition","subtitlePosition","availableHeightForCanvas","availableWidthForCanvas","_createHeaders","canvasHeight","canvasWidth","isSubtitle","headerOptions","_createHeading","createLegend","getLegendSpace","mountSpace","componentIndexes","componentNames","3","4","5","6","renderLayout","gridLayout","compWrappers","componentWrappers","createScrollManager","horizontalScrollWrapper","verticalScrollWrapper","gridWrapper","hScrollBar","vScrollBar","componentWrapper","deleteElementName","removeComponent","registerComponents","attachListeners","attachListener","defaultInteractionPolicy","isMeasure","group_firebolt_toConsumableArray","getFieldsFromChannel","colDim","unitColFacets","equals","unitRowFacets","propagateWith","defaultCrossInteractionPolicy","propagationCanvasAlias","propagationUnit","GroupFireBolt","group_firebolt_classCallCheck","group_firebolt_possibleConstructorReturn","group_firebolt_getPrototypeOf","behaviouralAction","validFields","APP_INITIAL_STATE","app","Canvas","globalDependencies","canvas_classCallCheck","canvas_possibleConstructorReturn","canvas_getPrototypeOf","canvas_defineProperty","canvas_assertThisInitialized","initedComponents","initCanvas","createGroupState","_VisualGroup$getState2","canvas_helper_slicedToArray","register","prepareLayout","triggerReflow","setLayoutInfForUnits","getRootNodeId","setLabelRotationForAxes","rotationVal","getAxes","initialSettings","regEntry","COMPONENTS","SUBREGISTRIES","regObj","globalCache","defaultRegistry","overrideRegistryDefinitions","overrideRegistry","muze","_transactor2","muze_slicedToArray","env","globalStore","componentSubRegistryDef","settings","withSettings","enableChainedTransaction","transactionModel","transactionEndpoint","transactionItems","Smartlabel","SideEffects","standards","Behaviours","pkg","operators","utils","lookupWhat","lookupDetails","lookupTarget"],"mappings":"CAAA,SAAAA,iCAAAC,KAAAC,SACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,UACA,mBAAAG,eAAAC,IACAD,OAAA,UAAAH,SACA,iBAAAC,QACAA,QAAA,KAAAD,UAEAD,KAAA,KAAAC,UARA,CASCK,OAAA,WACD,yBCTA,IAAAC,oBAGA,SAAAC,oBAAAC,UAGA,GAAAF,iBAAAE,UACA,OAAAF,iBAAAE,UAAAP,QAGA,IAAAC,OAAAI,iBAAAE,WACAC,EAAAD,SACAE,GAAA,EACAT,YAUA,OANAU,QAAAH,UAAAI,KAAAV,OAAAD,QAAAC,cAAAD,QAAAM,qBAGAL,OAAAQ,GAAA,EAGAR,OAAAD,QA0DA,OArDAM,oBAAAM,EAAAF,QAGAJ,oBAAAO,EAAAR,iBAGAC,oBAAAQ,EAAA,SAAAd,QAAAe,KAAAC,QACAV,oBAAAW,EAAAjB,QAAAe,OACAG,OAAAC,eAAAnB,QAAAe,MAA0CK,YAAA,EAAAC,IAAAL,UAK1CV,oBAAAgB,EAAA,SAAAtB,SACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,QAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,QAAA,cAAiDyB,OAAA,KAQjDnB,oBAAAoB,EAAA,SAAAD,MAAAE,MAEA,GADA,EAAAA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AC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,+BAES0W,cAAKK,aCALL,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,gBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,gBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,kBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCAS0W,gBAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,gCCES0W,eAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,gCCES0W,iBAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,gCCES0W,iBAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,gCCES0W,cAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAI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I,OACT,IAAM28L,aAAe38L,MAAMy8L,YACrB53D,OAAS63D,cAAc/+L,MAAM,EAAG++L,cAAc9oM,OAAS,GACvDnD,GAAKisM,cAAcA,cAAc9oM,OAAS,GAE1C42E,KAAOq6D,OAAOttI,IAAI,SAAAud,KAAG,OAAI6nL,aAAa7nL,OAC5C,OACIrkB,GAAIA,GAAEb,WAAF,EAAAs4D,+BAAMsiB,OACVq6D,mB+WtiCZy2D,UAAK7tH,OAAQ,IAAIF,aAAQnjE,MAAMjS,YAChBmjM","file":"muze.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"muze\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"muze\"] = factory();\n\telse\n\t\troot[\"muze\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"DataModel\",[],t):\"object\"==typeof exports?exports.DataModel=t():e.DataModel=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=1)}([function(e){e.exports=JSON.parse('{\"name\":\"datamodel\",\"description\":\"Relational algebra compliant in-memory tabular data store\",\"homepage\":\"https://github.com/chartshq/datamodel\",\"version\":\"2.2.3\",\"license\":\"MIT\",\"main\":\"dist/datamodel.js\",\"keywords\":[\"datamodel\",\"data\",\"relational\",\"algebra\",\"model\",\"muze\",\"fusioncharts\",\"table\",\"tabular\",\"operation\"],\"author\":\"Muzejs.org (https://muzejs.org/)\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/chartshq/datamodel.git\"},\"contributors\":[{\"name\":\"Akash Goswami\",\"email\":\"akashgoswami90s@gmail.com\"},{\"name\":\"Subhash Haldar\"},{\"name\":\"Rousan Ali\",\"email\":\"rousanali786@gmail.com\",\"url\":\"https://rousan.io\"},{\"name\":\"Ujjal Kumar Dutta\",\"email\":\"duttaujjalkumar@live.com\"},{\"name\":\"Ranajit Banerjee\",\"email\":\"ranajit.113124@gmail.com\"},{\"name\":\"Adarsh Lilha\",\"email\":\"adarshlilha@gmail.com\"}],\"dependencies\":{\"d3-dsv\":\"^1.0.8\"},\"devDependencies\":{\"babel-cli\":\"6.26.0\",\"babel-core\":\"^6.26.3\",\"babel-eslint\":\"6.1.2\",\"babel-loader\":\"^7.1.4\",\"babel-plugin-transform-runtime\":\"^6.23.0\",\"babel-preset-env\":\"^1.7.0\",\"babel-preset-es2015\":\"^6.24.1\",\"babel-preset-flow\":\"^6.23.0\",\"chai\":\"3.5.0\",\"cross-env\":\"^5.0.5\",\"eslint\":\"3.19.0\",\"eslint-config-airbnb\":\"15.1.0\",\"eslint-plugin-import\":\"2.7.0\",\"eslint-plugin-jsx-a11y\":\"5.1.1\",\"eslint-plugin-react\":\"7.3.0\",\"istanbul-instrumenter-loader\":\"^3.0.0\",\"jsdoc\":\"3.5.5\",\"json2yaml\":\"^1.1.0\",\"karma\":\"1.7.1\",\"karma-chai\":\"0.1.0\",\"karma-chrome-launcher\":\"2.1.1\",\"karma-coverage-istanbul-reporter\":\"^1.3.0\",\"karma-mocha\":\"1.3.0\",\"karma-spec-reporter\":\"0.0.31\",\"karma-webpack\":\"2.0.3\",\"marked\":\"^0.5.0\",\"mocha\":\"3.4.2\",\"mocha-webpack\":\"0.7.0\",\"transform-runtime\":\"0.0.0\",\"webpack\":\"^4.12.0\",\"webpack-cli\":\"^3.0.7\",\"webpack-dev-server\":\"^3.1.4\"},\"scripts\":{\"test\":\"npm run lint && npm run ut\",\"ut\":\"karma start karma.conf.js\",\"utd\":\"karma start --single-run false --browsers Chrome karma.conf.js \",\"build\":\"npm run build:prod\",\"build:dev\":\"webpack --mode development\",\"build:prod\":\"webpack --mode production\",\"start\":\"webpack-dev-server --config webpack.config.dev.js --mode development --open\",\"lint\":\"eslint ./src\",\"lint-errors\":\"eslint --quiet ./src\",\"docs\":\"rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json\"}}')},function(e,t,n){var r=n(2);e.exports=r.default?r.default:r},function(e,t,n){\"use strict\";n.r(t);var r={};n.r(r),n.d(r,\"DataFormat\",(function(){return o})),n.d(r,\"DimensionSubtype\",(function(){return u})),n.d(r,\"MeasureSubtype\",(function(){return c})),n.d(r,\"FieldType\",(function(){return f})),n.d(r,\"FilteringMode\",(function(){return l})),n.d(r,\"GROUP_BY_FUNCTIONS\",(function(){return s}));var a={};n.r(a),n.d(a,\"DSVArr\",(function(){return rt})),n.d(a,\"DSVStr\",(function(){return mt})),n.d(a,\"FlatJSON\",(function(){return yt})),n.d(a,\"Auto\",(function(){return bt}));var i={};n.r(i),n.d(i,\"sum\",(function(){return un})),n.d(i,\"avg\",(function(){return cn})),n.d(i,\"min\",(function(){return fn})),n.d(i,\"max\",(function(){return ln})),n.d(i,\"first\",(function(){return sn})),n.d(i,\"last\",(function(){return dn})),n.d(i,\"count\",(function(){return pn})),n.d(i,\"sd\",(function(){return hn}));var o={FLAT_JSON:\"FlatJSON\",DSV_STR:\"DSVStr\",DSV_ARR:\"DSVArr\",AUTO:\"Auto\"},u={CATEGORICAL:\"categorical\",TEMPORAL:\"temporal\",GEO:\"geo\",BINNED:\"binned\"},c={CONTINUOUS:\"continuous\"},f={MEASURE:\"measure\",DIMENSION:\"dimension\"},l={NORMAL:\"normal\",INVERSE:\"inverse\",ALL:\"all\"},s={SUM:\"sum\",AVG:\"avg\",MIN:\"min\",MAX:\"max\",FIRST:\"first\",LAST:\"last\",COUNT:\"count\",STD:\"std\"};function d(e){return e instanceof Date?e:new Date(e)}function p(e){return e<10?\"0\"+e:e}function h(e){this.format=e,this.dtParams=void 0,this.nativeDate=void 0}RegExp.escape=function(e){return e.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\")},h.TOKEN_PREFIX=\"%\",h.DATETIME_PARAM_SEQUENCE={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6},h.defaultNumberParser=function(e){return function(t){var n;return isFinite(n=parseInt(t,10))?n:e}},h.defaultRangeParser=function(e,t){return function(n){var r,a=void 0;if(!n)return t;var i=n.toLowerCase();for(a=0,r=e.length;aa.getFullYear()&&(t=\"\"+(i-1)+r),d(t).getFullYear()},formatter:function(e){var t=d(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:\"Y\",index:0,extract:function(){return\"(\\\\d{4})\"},parser:h.defaultNumberParser(),formatter:function(e){return d(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[i+1],-1!==r.indexOf(o)&&a.push({index:i,token:o});return a},h.formatAs=function(e,t){var n,r=d(e),a=h.findTokens(t),i=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=a.length;l=0;d--)(f=i[d].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(d=0;d0&&e.split(\",\").forEach((function(e){var n=e.split(\"-\"),r=+n[0],a=+(n[1]||n[0]);if(a>=r)for(var i=r;i<=a;i+=1)t(i)}))}var R=function(){function e(e,t){for(var n=0;n=(i=e[a=n+Math.floor((r-n)/2)]).start&&t=i.end?n=a+1:t3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U.CROSS,i=[],o=[],u=n||H,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,d=c.name+\".\"+f.name,p=Y(c,f);if(l===s)throw new Error(\"DataModels must have different alias names\");return c.fields.forEach((function(e){var t=_({},e.schema());-1===p.indexOf(t.name)||r||(t.name=c.name+\".\"+t.name),i.push(t)})),f.fields.forEach((function(e){var t=_({},e.schema());-1!==p.indexOf(t.name)?r||(t.name=f.name+\".\"+t.name,i.push(t)):i.push(t)})),T(e._rowDiffset,(function(n){var d=!1,h=void 0;T(t._rowDiffset,(function(v){var m=[],y={};y[l]={},y[s]={},c.fields.forEach((function(e){m.push(e.partialField.data[n]),y[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}})),f.fields.forEach((function(e){-1!==p.indexOf(e.schema().name)&&r||m.push(e.partialField.data[v]),y[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}}));var g=At(y[l]),b=At(y[s]);if(u(g,b,(function(){return e.detachedRoot()}),(function(){return t.detachedRoot()}),{})){var w={};m.forEach((function(e,t){w[i[t].name]=e})),d&&U.CROSS!==a?o[h]=w:(o.push(w),d=!0,h=n)}else if((a===U.LEFTOUTER||a===U.RIGHTOUTER)&&!d){var O={},_=c.fields.length-1;m.forEach((function(e,t){O[i[t].name]=t<=_?e:null})),d=!0,h=n,o.push(O)}}))})),new on(o,i,{name:d})}function J(e,t){var n=\"\"+e,r=\"\"+t;return nr?1:0}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J;return e.length>1&&function e(t,n,r,a){if(r===n)return t;var i=n+Math.floor((r-n)/2);return e(t,n,i,a),e(t,i+1,r,a),function(e,t,n,r,a){for(var i=e,o=[],u=t;u<=r;u+=1)o[u]=i[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(i[l]=o[f],f+=1):f>r?(i[l]=o[c],c+=1):a(o[c],o[f])<=0?(i[l]=o[c],c+=1):(i[l]=o[f],f+=1)}(t,n,i,r,a),t}(e,0,e.length-1,t),e}var K=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")};function W(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=\"\"+e)===(t=\"\"+t)?0:e>t?-1:1}}return n}(e.type,n)}function q(e,t){var n=new Map,r=[];return e.forEach((function(e){var a=e[t];n.has(a)?r[n.get(a)][1].push(e):(r.push([a,[e]]),n.set(a,r.length-1))})),r}function Z(e,t,n){var r={label:e[0]};return t.reduce((function(t,r,a){return t[r]=e[1].map((function(e){return e[n[a].index]})),t}),r),r}function $(e,t,n){for(var r=void 0,a=void 0,i=void 0,o=n.length-1;o>=0;o--)r=n[o][0],a=n[o][1],(i=Ht(t,r))&&(\"function\"==typeof a?z(e,(function(e,t){return a(e[i.index],t[i.index])})):E(a)?function(){var n=q(e,i.index),r=a[a.length-1],o=a.slice(0,a.length-1),u=o.map((function(e){return Ht(t,e)}));n.forEach((function(e){e.push(Z(e,o,u))})),z(n,(function(e,t){var n=e[2],a=t[2];return r(n,a)})),e.length=0,n.forEach((function(t){e.push.apply(e,W(t[1]))}))}():function(){var t=X(i,a);z(e,(function(e,n){return t(e[i.index],n[i.index])}))}())}var Q,ee=function e(t,n,r,a){if(0===t.length)return n;var i=t[0],o=new Map;n.reduce((function(e,t){var n=t[i.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e}),o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var d=l.value,p=K(d,2),h=p[0],v=p[1],m=e(t.slice(1),v,r,a);o.set(h,m),Array.isArray(m)&&$(m,r,a)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function te(e,t){var n=e.schema,r=e.data;if(0!==(t=t.filter((function(e){return!!Ht(n,e[0])}))).length){var a=t.findIndex((function(e){return null===e[1]}));a=-1!==a?a:t.length;var i=t.slice(0,a),o=t.slice(a);$(r,n,i),r=function(e,t,n,r){if(0===(n=n.filter((function(e){return null!==e[1]||(r.push(e[0]),!1)}))).length)return e;r=r.map((function(e){return Ht(t,e)}));var a=ee(r,e,t,n);return e.map((function(e){for(var t=0,n=a;!Array.isArray(n);)n=n.get(e[r[t++].index]);return n.shift()}))}(r,n,o,i.map((function(e){return e[0]}))),e.uids=r.map((function(e){return e.pop()})),e.data=r}}function ne(e,t,n,r,a){a=Object.assign({},{addUid:!1,columnWise:!1},a);var i={schema:[],data:[],uids:[]},o=a.addUid,u=r&&r.length>0,c=[];if(n.split(\",\").forEach((function(t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),a=_e.defaultReducer();return Object.keys(r).forEach((function(e){\"string\"!=typeof t[e]&&(t[e]=r[e].defAggFn());var i=_e.resolve(t[e]);i?n[e]=i:(n[e]=a,t[e]=ge)})),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],d=[],p={},h=[],v=void 0;Object.entries(u).forEach((function(e){var t=Ee(e,2),n=t[0],r=t[1];if(-1!==a.indexOf(n)||i[n])switch(d.push(_({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}}));var m=0;T(e._rowDiffset,(function(e){var t=\"\";l.forEach((function(n){t=t+\"-\"+u[n].partialField.data[e]})),void 0===p[t]?(p[t]=m,h.push({}),l.forEach((function(t){h[m][t]=u[t].partialField.data[e]})),s.forEach((function(t){h[m][t]=[u[t].partialField.data[e]]})),m+=1):s.forEach((function(n){h[p[t]][n].push(u[n].partialField.data[e])}))}));var y={},g=function(){return e.detachedRoot()};return h.forEach((function(e){var t=e;s.forEach((function(n){t[n]=i[n](e[n],g,y)}))})),r?(r.__calculateFieldspace(),v=r):v=new yn(h,d,{name:c}),v}function je(e,t){var n=Y(e.getFieldspace(),t.getFieldspace());return function(e,t){var r=!0;return n.forEach((function(n){r=!(e[n].internalValue!==t[n].internalValue||!r)})),r}}function Se(e,t){var n={},r=[],a=[],i=[],o=e.getFieldspace(),u=t.getFieldspace(),c=o.fieldsObj(),f=u.fieldsObj(),l=o.name+\" union \"+u.name;if(!j(e._colIdentifier.split(\",\").sort(),t._colIdentifier.split(\",\").sort()))return null;function s(e,t){T(e._rowDiffset,(function(e){var r={},o=\"\";a.forEach((function(n){var a=t[n].partialField.data[e];o+=\"-\"+a,r[n]=a})),n[o]||(i.push(r),n[o]=!0)}))}return e._colIdentifier.split(\",\").forEach((function(e){var t=c[e];r.push(_({},t.schema())),a.push(t.schema().name)})),s(e,c),s(t,f),new yn(i,r,{name:l})}function De(e,t,n){return G(e,t,n,!1,U.LEFTOUTER)}function Fe(e,t,n){return G(t,e,n,!1,U.RIGHTOUTER)}var Ne=function(){function e(e,t){for(var n=0;nn&&(n=a))})),[t,n]}}]),t}(Ve),He=function(){function e(e,t){for(var n=0;n9999?\"+\"+st(t,6):st(t,4))+\"-\"+st(e.getUTCMonth()+1,2)+\"-\"+st(e.getUTCDate(),2)+(i?\"T\"+st(n,2)+\":\"+st(r,2)+\":\"+st(a,2)+\".\"+st(i,3)+\"Z\":a?\"T\"+st(n,2)+\":\"+st(r,2)+\":\"+st(a,2)+\"Z\":r||n?\"T\"+st(n,2)+\":\"+st(r,2)+\"Z\":\"\")}var pt=function(e){var t=new RegExp('[\"'+e+\"\\n\\r]\"),n=e.charCodeAt(0);function r(e,t){var r,a=[],i=e.length,o=0,u=0,c=i<=0,f=!1;function l(){if(c)return it;if(f)return f=!1,at;var t,r,a=o;if(e.charCodeAt(a)===ot){for(;o++=i?c=!0:(r=e.charCodeAt(o++))===ut?f=!0:r===ct&&(f=!0,e.charCodeAt(o)===ut&&++o),e.slice(a+1,t-1).replace(/\"\"/g,'\"')}for(;o2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,_t(a))):e._derivation.push({op:t,meta:r,criteria:a})},Dt=function(e,t){var n;(n=t._ancestorDerivation).push.apply(n,_t(e._ancestorDerivation).concat(_t(e._derivation)))},Ft=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments[4];St(t,n,r,a),Dt(e,t)},Nt=(Ot(gt={},l.NORMAL,{diffIndex:[\"rowDiffset\"],calcDiff:[!0,!1]}),Ot(gt,l.INVERSE,{diffIndex:[\"rejectRowDiffset\"],calcDiff:[!1,!0]}),Ot(gt,l.ALL,{diffIndex:[\"rowDiffset\",\"rejectRowDiffset\"],calcDiff:[!0,!0]}),gt),kt=function(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split(\"-\")[0]+\"-\"+t}else e.push(\"\"+t)},Tt=function(e,t,n){var r=[],a=[],i=wt(Nt[n].calcDiff,2),o=i[0],u=i[1];return T(e,(function(e){var n=t(e);n&&o&&kt(r,e,-1),!n&&u&&kt(a,e,-1)})),{rowDiffset:r.join(\",\"),rejectRowDiffset:a.join(\",\")}},Rt=function(e,t,n,r,a){var i={},o={},u={};return T(e,(function(e){if(t(e)){var n=\"\",c={keys:{}};r.forEach((function(t){var r=a[t].partialField.data[e];n=n+\"-\"+r,c.keys[t]=r})),void 0===o[n]&&(o[n]=[],i[n]=-1,u[n]=c),kt(o[n],e,i[n]),i[n]=e}})),{splitRowDiffset:o,dimensionMap:u}},Ct=function(e,t,n,r,a){var i={},o=function(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e.getPartialFieldspace().fields,l=f.map((function(e){return e.formattedData()})),s=f.map((function(e){return e.data()}));return a(c,(function(e){return t(Et(f,l,s,e),e,o,i)}),u)},Mt=function(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map((function(e){return e.name()})).join(\",\"),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t},It=function(e,t,n){for(var r=n(e,t,0),a=1,i=e.length;a2&&void 0!==arguments[2]?arguments[2]:{},r=[],a=n.operation||V,i=n.filterByMeasure||!1,o=Mt(e),u=o.getFieldsConfig();r=t.length?t.map((function(e){return n=void 0,r=(t=e).getData(),a=t.getFieldsConfig(),o=Object.keys(t.getFieldspace().getDimension()).filter((function(e){return e in u})),c=o.length,f=o.map((function(e){return a[e].index})),l=Object.keys(t.getFieldspace().getMeasure()).filter((function(e){return e in u})),s=t.getFieldspace().fieldsObj(),d=r.data,p=l.reduce((function(e,t){return e[t]=s[t].domain(),e}),{}),h={},n=function(e,t,n){return t[e[n]]},c&&d.forEach((function(e){var t=It(f,e,n);h[t]=1})),n=function(e,t,n){return t[e[n]].internalValue},d.length?function(e){var t=!c||h[It(o,e,n)];return i?l.every((function(t){return e[t].internalValue>=p[t][0]&&e[t].internalValue<=p[t][1]}))&&t:t}:function(){return!1};var t,n,r,a,o,c,f,l,s,d,p,h})):[function(){return!1}];return a===V?o.select((function(e){return r.every((function(t){return t(e)}))}),{saveChild:!1}):o.select((function(e){return r.some((function(t){return t(e)}))}),{saveChild:!1})},xt=function(e,t,n,r,a){e._rowDiffset=t,e.__calculateFieldspace().calculateFieldsConfig(),Ft(n,e,L.SELECT,{config:r},a)},Lt=function(e,t,n,r){var a=e.clone(n.saveChild),i=t;return n.mode===l.INVERSE&&(i=r.filter((function(e){return-1===t.indexOf(e)}))),a._colIdentifier=i.join(\",\"),a.__calculateFieldspace().calculateFieldsConfig(),Ft(e,a,L.PROJECT,{projField:t,config:n,actualProjField:i},null),a},Ut=function(e,t,n,r){return t.map((function(t){return Lt(e,t,n,r)}))},Vt=function(e){if((e=_({},e)).type||(e.type=f.DIMENSION),!e.subtype)switch(e.type){case f.MEASURE:e.subtype=c.CONTINUOUS;break;default:case f.DIMENSION:e.subtype=u.CATEGORICAL}return e},Bt=function(e){return e.map((function(e){return function(e){var t=[c.CONTINUOUS],n=[u.CATEGORICAL,u.BINNED,u.TEMPORAL,u.GEO],r=e.type,a=e.subtype,i=e.name;switch(r){case f.DIMENSION:if(-1===n.indexOf(a))throw new Error(\"DataModel doesn't support dimension field subtype \"+a+\" used for \"+i+\" field\");break;case f.MEASURE:if(-1===t.indexOf(a))throw new Error(\"DataModel doesn't support measure field subtype \"+a+\" used for \"+i+\" field\");break;default:throw new Error(\"DataModel doesn't support field type \"+r+\" used for \"+i+\" field\")}}(e=Vt(e)),e}))},Yt=function(e,t,n,r){n=Bt(n),r=Object.assign(Object.assign({},nt),r);var i=a[r.dataFormat];if(!i||\"function\"!=typeof i)throw new Error(\"No converter function found for \"+r.dataFormat+\" format\");var u=i(t,n,r),c=wt(u,2),f=c[0],l=c[1];!function(e,t){e.forEach((function(e){var n=e.as;if(n){var r=t.indexOf(e.name);t[r]=n,e.name=n,delete e.as}}))}(n,f);var s=tt(l,n,f),d=F.createNamespace(s,r.name);e._partialFieldspace=d,e._rowDiffset=l.length&&l[0].length?\"0-\"+(l[0].length-1):\"\";var p=[],h=d.fields,v=h.map((function(e){return e.data()})),m=h.map((function(e){return e.formattedData()}));return T(e._rowDiffset,(function(e){p[e]=Et(h,m,v,e)})),d._cachedValueObjects=p,e._colIdentifier=n.map((function(e){return e.name})).join(),e._dataFormat=r.dataFormat===o.AUTO?D(t):r.dataFormat,e},Ht=function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=a.nonTraversingModel,o=a.excludeModels||[];if(t!==i){var u=!o.length||-1===o.indexOf(t);u&&t.handlePropagation(n,r);var c=t._children;c.forEach((function(t){var i=Gt(n,t);e(t,i,r,a)}))}},zt=function(e){for(;e._parent&&e._derivation.find((function(e){return e.op!==L.GROUPBY}));)e=e._parent;return e},Kt=function(e){for(;e._parent;)e=e._parent;return e},Wt=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t},Xt=function(e,t,n,r){var a=void 0,i=void 0,o=n.propagationNameSpace,u=n.propagateToSource,c=n.sourceId,f=r.propagateInterpolatedValues,l=[];if(null===e&&!0!==r.persistent)l=[{criteria:[]}],a=[];else{var s,d=Object.values(o.mutableActions);!1!==u&&(d=d.filter((function(e){return e.config.sourceId!==c})));var p=d.filter((function(e){return(r.filterFn||function(){return!0})(e,r)})).map((function(e){return e.config.criteria})),h=[];if(!1!==u){var v=Object.values(o.mutableActions);v.forEach((function(e){var t=e.config;!1===t.applyOnSource&&t.action===r.action&&t.sourceId!==c&&(h.push(e.model),(a=v.filter((function(t){return t!==e})).map((function(e){return e.config.criteria}))).length&&l.push({criteria:a,models:e.model,path:Wt(e.model)}))}))}a=(s=[]).concat.apply(s,[].concat(_t(p),[e])).filter((function(e){return null!==e})),l.push({criteria:a,excludeModels:[].concat(h,_t(r.excludeModels||[]))})}var m=t.model,y=Object.assign({sourceIdentifiers:e,propagationSourceId:c},r),g=t.groupByModel;f&&g&&(i=Pt(g,a,{filterByMeasure:f}),Jt(g,i,y)),l.forEach((function(e){var t=Pt(m,e.criteria),n=e.path;if(n){var r=function(e,t){for(var n=0,r=t.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,a=t.isMutableAction,i=t.criteria,o=t.action+\"-\"+t.sourceId;r=a?e.mutableActions:e.immutableActions,null===i?delete r[o]:r[o]={model:n,config:t}},$t=function(e,t,n){var r=e.reduce((function(e,r){return\"RegExp\"===r.constructor.name?e.push.apply(e,_t(t.filter((function(e){return-1!==e.search(r)})))):r in n&&e.push(r),e}),[]);return Array.from(new Set(r)).map((function(e){return e.trim()}))},Qt=function(e,t){return e.numberFormat?e.numberFormat()(t):t},en=function(){function e(e,t){for(var n=0;n1?(a=e.clone(r.saveChild),xt(a,u[c[1]],e,n,t),[o,a]):o}(this,e,t,{saveChild:t.saveChild})}},{key:\"isEmpty\",value:function(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:\"clone\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:\"project\",value:function(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),a=Object.keys(r),i=t.mode,o=$t(e,a,r),u=void 0;i===l.ALL?u=[Lt(this,o,{mode:l.NORMAL,saveChild:t.saveChild},a),Lt(this,o,{mode:l.INVERSE,saveChild:t.saveChild},a)]:u=Lt(this,o,t,a);return u}},{key:\"getFieldsConfig\",value:function(){return this._fieldConfig}},{key:\"calculateFieldsConfig\",value:function(){return this._fieldConfig=this._fieldspace.fields.reduce((function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e}),{}),this}},{key:\"dispose\",value:function(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach((function(e){e._parent=null})),this._children=[]}},{key:\"removeChild\",value:function(e){var t=this._children.findIndex((function(t){return t===e}));-1===t||this._children.splice(t,1)}},{key:\"setParent\",value:function(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:\"getParent\",value:function(){return this._parent}},{key:\"getChildren\",value:function(){return this._children}},{key:\"getDerivations\",value:function(){return this._derivation}},{key:\"getAncestorDerivations\",value:function(){return this._ancestorDerivation}}]),e}(),nn=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")},rn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=\"\"+e.join(),a=[this,e,t],i=Ae.apply(void 0,a);return Ft(this,i,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:_e.defaultReducer()},t),n.saveChild?i.setParent(this):i.setParent(null),i}},{key:\"sort\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:\"row\",sort:e}),r=n.schema.map((function(e){return e.name})),a=[r].concat(n.data),i=new this.constructor(a,n.schema,{dataFormat:\"DSVArr\"});return Ft(this,i,L.SORT,t,e),t.saveChild?i.setParent(this):i.setParent(null),i}},{key:\"serialize\",value:function(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:\",\"},t);var n=this.getFieldspace().fields,r=n.map((function(e){return e.formattedData()})),a=r[0].length,i=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(i=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach((function(t,n){t[e.name()]=new k(a[n],i[n],e)}));return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:\"calculateVariable\",value:function(e,t,n){var r=this;e=Vt(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var a=this.getFieldsConfig(),i=t.slice(0,t.length-1),o=t[t.length-1];if(a[e.name]&&!n.replaceVar)throw new Error(e.name+\" field already exists in datamodel\");var u=i.map((function(e){var t=a[e];if(!t)throw new Error(e+\" is not a valid column name.\");return t.index})),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map((function(e){return f[e]})),s={},d=function(){return r.detachedRoot()},p=[];T(c._rowDiffset,(function(e){var t=l.map((function(t){return t.partialField.data[e]}));p[e]=o.apply(void 0,an(t).concat([e,d,s]))}));var h=tt([p],[e],[e.name]),v=nn(h,1)[0];return c.addField(v),Ft(this,c,L.CAL_VAR,{config:e,fields:i},o),c}},{key:\"propagate\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.isMutableAction,i=t.sourceId,o=t.payload,u=Kt(this),c=u._propagationNameSpace,f=zt(this),l={groupByModel:f,model:u};return n&&Zt(c,t,this),Xt(e,l,{propagationNameSpace:c,sourceId:i},Object.assign({payload:o},t)),a&&qt(c,l,{config:t,propConfig:r}),this}},{key:\"on\",value:function(e,t){switch(e){case\"propagation\":this._onPropagation.push(t)}return this}},{key:\"unsubscribe\",value:function(e){switch(e){case\"propagation\":this._onPropagation=[]}return this}},{key:\"handlePropagation\",value:function(e,t){var n=this;this._onPropagation.forEach((function(r){return r.call(n,e,t)}))}},{key:\"bin\",value:function(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error(\"Field \"+e+\" doesn't exist\");var r=t.name||e+\"_binned\";if(n[r])throw new Error(\"Field \"+r+\" already exists\");var a=function(e,t,n){var r=n.buckets,a=n.binsCount,i=n.binSize,o=n.start,u=n.end,c=e.domain(),f=I(c,2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var d=[],p=0;p2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],a=r.saveChild,i=e.getFieldspace().fieldsObj(),o=Ct(e.clone(a),n,r,e,(function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},a=this.getFieldsConfig(),i=Object.keys(a),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach((function(e,n){o[n]=$t([].concat(an(e),an(t)),i,a)})),Ut(this,o,n,i)}}],[{key:\"configureInvalidAwareTypes\",value:function(e){return M.invalidAwareVals(e)}},{key:\"Reducers\",get:function(){return _e}}]),t}(tn),un=ye.sum,cn=ye.avg,fn=ye.min,ln=ye.max,sn=ye.first,dn=ye.last,pn=ye.count,hn=ye.std,vn={compose:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,a=void 0,i=[];return t.forEach((function(e){r=e(r),i.push.apply(i,B(r._derivation)),a||(a=r)})),a&&a!==r&&a.dispose(),r._ancestorDerivation=[],Ft(e,r,L.COMPOSE,null,i),n.saveChild?r.setParent(e):r.setParent(null),r}},bin:function(){for(var e=arguments.length,t=Array(e),n=0;n whenever a break is necessary. This is to recgonize one\n * generalized format independent of the implementation (canvas based solution, svg based solution). This method\n * converts the output of getSmartText().text to array of lines if the text is wrapped. It sets a named property\n * `lines` on the object passed as parameter.\n *\n * @param {Object} smartlabel - the object returned by getSmartText based on which line arr which to be formed.\n *\n * @return {Object} - The same object which was passed in the arguments. Also a named property `lines` is set.\n */\nSmartLabelManager.textToLines = function (smartlabel) {\n smartlabel = smartlabel || {};\n\n if (!smartlabel.text) {\n smartlabel.text = '';\n } else if (typeof smartlabel.text !== 'string') {\n smartlabel.text = smartlabel.text.toString();\n }\n\n smartlabel.lines = smartlabel.text.split(/\\n|/ig);\n return smartlabel;\n};\n\n// Saves all the instance created so far\nSmartLabelManager.store = {};\n\n// Calculates space taken by a character with an approximation value which is calculated by repeating the\n// character by string length times.\nSmartLabelManager.prototype._calCharDimWithCache = function (text, calculateDifference, length) {\n if (!this._init) {\n return false;\n }\n\n var size,\n csArr,\n tw,\n twi,\n cachedStyle,\n asymmetricDifference,\n maxAdvancedCacheLimit = this.options.maxCacheLimit,\n container = this._container,\n style = this.style || {},\n cache = this._advancedCache || (this._advancedCache = {}),\n advancedCacheKey = this._advancedCacheKey || (this._advancedCacheKey = []),\n cacheName = text + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK),\n cacheInitName = text + 'init' + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK);\n\n htmlSplCharSpace[text] && (text = htmlSplCharSpace[text]);\n\n if (!calculateDifference) {\n asymmetricDifference = 0;\n } else {\n if ((asymmetricDifference = cache[cacheInitName]) === undefined) {\n container.innerHTML = text.repeat ? text.repeat(length) : Array(length + 1).join(text); // jshint ignore:line\n tw = container.offsetWidth;\n\n container.innerHTML = text;\n twi = container.offsetWidth;\n\n asymmetricDifference = cache[cacheInitName] = (tw - length * twi) / (length + 1);\n advancedCacheKey.push(cacheInitName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n }\n }\n\n if (cachedStyle = cache[cacheName]) {\n csArr = cachedStyle.split(',');\n return {\n width: parseFloat(csArr[0], 10),\n height: parseFloat(csArr[1], 10)\n };\n }\n\n container.innerHTML = text;\n\n size = {\n height: container.offsetHeight,\n width: container.offsetWidth + asymmetricDifference\n };\n\n cache[cacheName] = size.width + ',' + size.height;\n advancedCacheKey.push(cacheName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n\n return size;\n};\n\n// Provide function to calculate the height and width based on the environment and available support from dom.\nSmartLabelManager.prototype._getWidthFn = function () {\n var contObj = this._containerObj,\n container = this._container,\n svgText = contObj.svgText;\n\n if (svgText) {\n return function (str) {\n var bbox, width;\n\n svgText.textContent = str;\n bbox = svgText.getBBox();\n width = bbox.width - SVG_BBOX_CORRECTION;\n if (width < 1) {\n width = bbox.width;\n }\n\n return width;\n };\n } else {\n return function (str) {\n container.innerHTML = str;\n return container.offsetWidth;\n };\n }\n};\n\n/*\n * Sets the style based on which the text's metrics to be calculated.\n *\n * @param {Object} style - The style object which affects the text size\n * {\n * fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)\n * fontFamily / 'font-family'\n * fontWeight / 'font-weight'\n * fontStyle / 'font-style'\n * }\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.setStyle = function (style) {\n if (!this._init) {\n return this;\n }\n\n var sCont;\n\n if (style === this.style && !this._styleNotSet) {\n return;\n }\n\n if (!style) {\n style = this.style;\n }\n\n slLib.setLineHeight(style);\n this.style = style;\n\n this._containerObj = sCont = this._containerManager.get(style);\n\n if (this._containerObj) {\n this._container = sCont.node;\n this._context = sCont.context;\n this._cache = sCont.charCache;\n this._lineHeight = sCont.lineHeight;\n this._styleNotSet = false;\n } else {\n this._styleNotSet = true;\n }\n\n return this;\n};\n\n/*\n * Decides whether ellipses to be shown if the node is truncated\n *\n * @param {Boolean} useEllipses - decides if a ellipses to be appended if the text is truncated. Default: false\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.useEllipsesOnOverflow = function (useEllipses) {\n if (!this._init) {\n return this;\n }\n this._showNoEllipses = !useEllipses;\n return this;\n};\n\n/*\n * Get wrapped or truncated text if a bound box is defined around it. The result text would be separated by
\n * if wrapped\n *\n * @param {String} text - the subject text\n * @param {Number} maxWidth - width in px of the the bound box\n * @param {Number} maxHeight - height in px of the the bound box\n * @param {Boolean} noWrap - whether the text to be wrapped. Default false.\n *\n * @return {Object} - The metrics of the text bounded by the box\n * {\n * height : height of the wrapped text\n * width : width of the wrapped text\n * isTruncated : whether the text is truncated\n * maxHeight : Maximum height given\n * maxWidth : Maximum width given\n * oriText : Original text sent\n * oriTextHeight : Original text height\n * oriTextWidth : Original text width\n * text : SMART TEXT\n * }\n */\nSmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight, noWrap) {\n if (!this._init) {\n return false;\n }\n\n if (text === undefined || text === null) {\n text = '';\n } else if (typeof text !== 'string') {\n text = text.toString();\n }\n\n var len,\n trimStr,\n tempArr,\n tmpText,\n maxWidthWithEll,\n toolText,\n oriWidth,\n oriHeight,\n newCharIndex,\n nearestChar,\n tempChar,\n getWidth,\n initialLeft,\n initialTop,\n getOriSizeImproveObj,\n spanArr,\n x,\n y,\n minWidth,\n elem,\n chr,\n elemRightMostPoint,\n elemLowestPoint,\n lastBR,\n removeFromIndex,\n removeFromIndexForEllipses,\n hasHTMLTag = false,\n maxStrWidth = 0,\n lastDash = -1,\n lastSpace = -1,\n lastIndexBroken = -1,\n strWidth = 0,\n strHeight = 0,\n oriTextArr = [],\n i = 0,\n ellipsesStr = this._showNoEllipses ? '' : '...',\n lineHeight = this._lineHeight,\n context = this._context,\n container = this._container,\n sCont = this._containerObj,\n ellipsesWidth = sCont.ellipsesWidth,\n dotWidth = sCont.dotWidth,\n characterArr = [],\n dashIndex = -1,\n spaceIndex = -1,\n lastLineBreak = -1,\n fastTrim = function fastTrim(str) {\n str = str.replace(/^\\s\\s*/, '');\n var ws = /\\s/,\n i = str.length;\n while (ws.test(str.charAt(i -= 1))) {/* jshint noempty:false */}\n return str.slice(0, i + 1);\n },\n smartLabel = {\n text: text,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n width: null,\n height: null,\n oriTextWidth: null,\n oriTextHeight: null,\n oriText: text,\n isTruncated: false\n };\n\n getWidth = this._getWidthFn();\n\n // In some browsers, offsetheight of a single-line text is getting little (1 px) heigher value of the\n // lineheight. As a result, smartLabel is unable to return single-line text.\n // To fix this, increase the maxHeight a little amount. Hence maxHeight = lineHeight * 1.2\n if (maxHeight === lineHeight) {\n maxHeight *= 1.2;\n }\n\n if (container) {\n if (!documentSupport.isBrowserLess) {\n hasHTMLTag = slLib.xmlTagRegEx.test(text);\n if (!hasHTMLTag) {\n // Due to support of <,> for xml we convert <, > to <,> respectively so to get the correct\n // width it is required to convert the same before calculation for the new improve version of the\n // get text width.\n tmpText = text.replace(slLib.ltgtRegex, function (match) {\n return match === '<' ? '<' : '>';\n });\n getOriSizeImproveObj = this.getOriSize(tmpText, true);\n\n smartLabel.oriTextWidth = oriWidth = getOriSizeImproveObj.width;\n smartLabel.oriTextHeight = oriHeight = getOriSizeImproveObj.height;\n } else {\n container.innerHTML = text;\n smartLabel.oriTextWidth = oriWidth = container.offsetWidth;\n smartLabel.oriTextHeight = oriHeight = container.offsetHeight;\n }\n\n if (oriHeight <= maxHeight && oriWidth <= maxWidth) {\n smartLabel.width = smartLabel.oriTextWidth = oriWidth;\n smartLabel.height = smartLabel.oriTextHeight = oriHeight;\n return smartLabel;\n }\n\n if (lineHeight > maxHeight) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = 0;\n smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n }\n }\n\n // Calculate width with ellipses\n text = fastTrim(text).replace(/(\\s+)/g, ' ');\n maxWidthWithEll = this._showNoEllipses ? maxWidth : maxWidth - ellipsesWidth;\n\n if (!hasHTMLTag) {\n oriTextArr = text.split('');\n len = oriTextArr.length;\n trimStr = '', tempArr = [];\n tempChar = oriTextArr[0];\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n minWidth = getWidth(tempChar);\n this._cache[tempChar] = { width: minWidth };\n }\n\n if (maxWidthWithEll > minWidth) {\n tempArr = text.substr(0, slLib.getNearestBreakIndex(text, maxWidthWithEll, this)).split('');\n i = tempArr.length;\n } else if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n } else if (ellipsesStr) {\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n strWidth = getWidth(tempArr.join(''));\n strHeight = this._lineHeight;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n smartLabel.width = getWidth(smartLabel.text);\n smartLabel.height = this._lineHeight;\n return smartLabel;\n }\n }\n }\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = strWidth;\n smartLabel.height = this._lineHeight;\n return smartLabel;\n } else {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (tempChar === ' ' && !context) {\n tempChar = ' ';\n }\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n /** @todo use regular expressions for better performance. */\n lastSpace = text.substr(0, tempArr.length).lastIndexOf(' ');\n lastDash = text.substr(0, tempArr.length).lastIndexOf('-');\n if (lastSpace > lastIndexBroken) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastSpace, 1, '
');\n lastIndexBroken = lastSpace;\n newCharIndex = lastSpace + 1;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === tempArr.length - 1) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '
-');\n } else {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '-
');\n }\n lastIndexBroken = lastDash;\n newCharIndex = lastDash + 1;\n } else {\n tempArr.splice(tempArr.length - 1, 1, '
' + oriTextArr[i]);\n lastLineBreak = tempArr.length - 2;\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastLineBreak + 1).join(''));\n lastIndexBroken = lastLineBreak;\n newCharIndex = i;\n }\n strHeight += this._lineHeight;\n if (strHeight > maxHeight) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n // The max width among all the lines will be the width of the string.\n smartLabel.width = maxWidth;\n smartLabel.height = strHeight - this._lineHeight;\n return smartLabel;\n } else {\n maxStrWidth = max(maxStrWidth, strWidth);\n trimStr = null;\n nearestChar = slLib.getNearestBreakIndex(text.substr(newCharIndex), maxWidthWithEll, this);\n strWidth = getWidth(text.substr(newCharIndex, nearestChar || 1));\n if (tempArr.length < newCharIndex + nearestChar) {\n tempArr = tempArr.concat(text.substr(tempArr.length, newCharIndex + nearestChar - tempArr.length).split(''));\n i = tempArr.length - 1;\n }\n }\n }\n }\n }\n\n maxStrWidth = max(maxStrWidth, strWidth);\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = maxStrWidth;\n smartLabel.height = strHeight;\n return smartLabel;\n }\n } else {\n toolText = text.replace(slLib.spanAdditionRegx, '$2');\n text = text.replace(slLib.spanAdditionRegx, slLib.spanAdditionReplacer);\n text = text.replace(/()/g, '$1');\n\n container.innerHTML = text;\n\n spanArr = container[documentSupport.childRetriverFn](documentSupport.childRetriverString);\n\n for (x = 0, y = spanArr.length; x < y; x += 1) {\n elem = spanArr[x];\n //chech whether this span is temporary inserted span from it's class\n if (documentSupport.noClassTesting || slLib.classNameReg.test(elem.className)) {\n chr = elem.innerHTML;\n if (chr !== '') {\n if (chr === ' ') {\n spaceIndex = characterArr.length;\n } else if (chr === '-') {\n dashIndex = characterArr.length;\n }\n\n characterArr.push({\n spaceIdx: spaceIndex,\n dashIdx: dashIndex,\n elem: elem\n });\n oriTextArr.push(chr);\n }\n }\n }\n\n i = 0;\n len = characterArr.length;\n minWidth = characterArr[0].elem.offsetWidth;\n\n if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n\n return smartLabel;\n } else if (minWidth > maxWidthWithEll && !this._showNoEllipses) {\n\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n initialLeft = characterArr[0].elem.offsetLeft;\n initialTop = characterArr[0].elem.offsetTop;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n if (container.offsetWidth > maxWidth) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n } else {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemLowestPoint = elem.offsetHeight + (elem.offsetTop - initialTop);\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n lastBR = null;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n\n if (elemRightMostPoint > maxWidth) {\n lastSpace = characterArr[i].spaceIdx;\n lastDash = characterArr[i].dashIdx;\n if (lastSpace > lastIndexBroken) {\n characterArr[lastSpace].elem.innerHTML = '
';\n lastIndexBroken = lastSpace;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === i) {\n // in case the overflowing character itself is the '-'\n characterArr[lastDash].elem.innerHTML = '
-';\n } else {\n characterArr[lastDash].elem.innerHTML = '-
';\n }\n lastIndexBroken = lastDash;\n } else {\n elem.parentNode.insertBefore(lastBR = doc.createElement('br'), elem);\n }\n\n //check whether this break made current element outside the area height\n if (elem.offsetHeight + elem.offsetTop > maxHeight) {\n //remove the lastly inserted line break\n if (lastBR) {\n lastBR.parentNode.removeChild(lastBR);\n } else if (lastIndexBroken === lastDash) {\n characterArr[lastDash].elem.innerHTML = '-';\n } else {\n characterArr[lastSpace].elem.innerHTML = ' ';\n }\n removeFromIndex = i;\n //break the looping condition\n i = len;\n } else {\n removeFromIndexForEllipses = null;\n }\n }\n } else {\n //check whether this break made current element outside the area height\n if (elemLowestPoint > maxHeight) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n }\n\n if (removeFromIndex < len) {\n //set the trancated property of the smartlabel\n smartLabel.isTruncated = true;\n\n /** @todo is this really needed? */\n removeFromIndexForEllipses = removeFromIndexForEllipses ? removeFromIndexForEllipses : removeFromIndex;\n\n for (i = len - 1; i >= removeFromIndexForEllipses; i -= 1) {\n elem = characterArr[i].elem;\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n }\n\n for (; i >= 0; i -= 1) {\n elem = characterArr[i].elem;\n if (slLib.classNameBrReg.test(elem.className)) {\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n } else {\n i = 0;\n }\n }\n }\n\n //get the smart text\n smartLabel.text = container.innerHTML.replace(slLib.spanRemovalRegx, '$1').replace(/\\&\\;/g, '&');\n if (smartLabel.isTruncated) {\n smartLabel.text += ellipsesStr;\n smartLabel.tooltext = toolText;\n }\n }\n\n smartLabel.height = container.offsetHeight;\n smartLabel.width = container.offsetWidth;\n\n return smartLabel;\n } else {\n smartLabel.error = new Error('Body Tag Missing!');\n return smartLabel;\n }\n};\n\n/*\n * Get the height and width of a text.\n *\n * @param {String} text - Text whose metrics to be measured\n * @param {Boolean} Optional detailedCalculationFlag - this flag if set it calculates per letter position\n * information and returns it. Ideally you dont need it unless you want to post process the\n * string. And its an EXPENSIVE OPERATION.\n *\n * @return {Object} - If detailedCalculationFlag is set to true the returned object would be\n * {\n * height: height of the text\n * width: width of the text\n * detailObj: detail calculation of letters in the format {lettername: width}\n * }\n * If detailedCalculationFlag is set to false the returned object wont have the detailObj prop.\n */\nSmartLabelManager.prototype.getOriSize = function (text, detailedCalculationFlag) {\n if (!this._init) {\n return false;\n }\n\n var textArr,\n letter,\n lSize,\n i,\n l,\n cumulativeSize = 0,\n height = 0,\n indiSizeStore = {};\n\n if (!detailedCalculationFlag) {\n return this._calCharDimWithCache(text);\n }\n\n // Calculate the width of every letter with an approximation\n textArr = text.split('');\n for (i = 0, l = textArr.length; i < l; i++) {\n letter = textArr[i];\n lSize = this._calCharDimWithCache(letter, true, textArr.length);\n height = max(height, lSize.height);\n cumulativeSize += lSize.width;\n indiSizeStore[letter] = lSize.width;\n }\n\n return {\n width: round(cumulativeSize),\n height: height,\n detailObj: indiSizeStore\n };\n};\n\n/*\n * Dispose the container and object allocated by the smartlabel\n */\nSmartLabelManager.prototype.dispose = function () {\n if (!this._init) {\n return this;\n }\n\n this._containerManager && this._containerManager.dispose && this._containerManager.dispose();\n\n delete this._container;\n delete this._context;\n delete this._cache;\n delete this._containerManager;\n delete this._containerObj;\n delete this.id;\n delete this.style;\n delete this.parentContainer;\n delete this._showNoEllipses;\n\n return this;\n};\n\nexports['default'] = SmartLabelManager;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n\tvalue: true\n});\nvar lib = {\n\tinit: function init(win) {\n\t\tvar doc = win.document,\n\t\t nav = win.navigator,\n\t\t userAgent = nav.userAgent,\n\t\t DIV = 'DIV',\n\t\t ceil = Math.ceil,\n\t\t floor = Math.floor,\n\t\t containerInstanceCount = 0,\n\t\t clsNameSpace = 'fusioncharts-smartlabel-',\n\t\t containerClass = clsNameSpace + 'container',\n\t\t classNameWithTag = clsNameSpace + 'tag',\n\t\t classNameWithTagBR = clsNameSpace + 'br';\n\n\t\tlib = {\n\t\t\twin: win,\n\n\t\t\tcontainerClass: containerClass,\n\n\t\t\tclassNameWithTag: classNameWithTag,\n\n\t\t\tclassNameWithTagBR: classNameWithTagBR,\n\n\t\t\tmaxDefaultCacheLimit: 500,\n\n\t\t\tclassNameReg: new RegExp('\\b' + classNameWithTag + '\\b'),\n\n\t\t\tclassNameBrReg: new RegExp('\\b' + classNameWithTagBR + '\\b'),\n\n\t\t\tspanAdditionRegx: /(<[^<\\>]+?\\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,\n\n\t\t\tspanAdditionReplacer: '$1$2',\n\n\t\t\tspanRemovalRegx: new RegExp('\\\\]+?' + classNameWithTag + '[^\\\\>]{0,}\\\\>(.*?)\\\\<\\\\/span\\\\>', 'ig'),\n\n\t\t\txmlTagRegEx: new RegExp('<[^>][^<]*[^>]+>', 'i'),\n\n\t\t\tltgtRegex: /<|>/g,\n\n\t\t\tbrReplaceRegex: //ig,\n\n\t\t\ttestStrAvg: 'WgI',\n\n\t\t\t// This style is applied over the parent smartlabel container. The container is kept hidden from the viewport\n\t\t\tparentContainerStyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: '-9999em',\n\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\tpadding: '0px',\n\t\t\t\twidth: '1px',\n\t\t\t\theight: '1px',\n\t\t\t\toverflow: 'hidden'\n\t\t\t},\n\n\t\t\t// All the style which might affect the text metrics\n\t\t\tsupportedStyle: {\n\t\t\t\tfont: 'font',\n\t\t\t\tfontFamily: 'font-family',\n\t\t\t\t'font-family': 'font-family',\n\t\t\t\tfontWeight: 'font-weight',\n\t\t\t\t'font-weight': 'font-weight',\n\t\t\t\tfontSize: 'font-size',\n\t\t\t\t'font-size': 'font-size',\n\t\t\t\tlineHeight: 'line-height',\n\t\t\t\t'line-height': 'line-height',\n\t\t\t\tfontStyle: 'font-style',\n\t\t\t\t'font-style': 'font-style'\n\t\t\t},\n\n\t\t\t// Get the support list for html the document where the text calcution is to be done.\n\t\t\tgetDocumentSupport: function getDocumentSupport() {\n\t\t\t\tvar childRetriverFn, childRetriverString, noClassTesting;\n\n\t\t\t\tif (doc.getElementsByClassName) {\n\t\t\t\t\tchildRetriverFn = 'getElementsByClassName';\n\t\t\t\t\tchildRetriverString = classNameWithTag;\n\t\t\t\t\tnoClassTesting = true;\n\t\t\t\t} else {\n\t\t\t\t\tchildRetriverFn = 'getElementsByTagName';\n\t\t\t\t\tchildRetriverString = 'span';\n\t\t\t\t\tnoClassTesting = false;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisIE: /msie/i.test(userAgent) && !win.opera,\n\t\t\t\t\thasSVG: Boolean(win.SVGAngle || doc.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')),\n\t\t\t\t\tisHeadLess: new RegExp(' HtmlUnit').test(userAgent),\n\t\t\t\t\tisWebKit: new RegExp(' AppleWebKit/').test(userAgent),\n\t\t\t\t\tchildRetriverFn: childRetriverFn,\n\t\t\t\t\tchildRetriverString: childRetriverString,\n\t\t\t\t\tnoClassTesting: noClassTesting\n\t\t\t\t};\n\t\t\t},\n\n\t\t\t/*\n * Create a html div element and attach it with a parent. All the subsequent operations are performed\n * by upding this dom tree only.\n *\n * @param {HTMLElement} - The html element where the newly created div is to be attached. If not passed,\n * the new div is appended on the body.\n */\n\t\t\tcreateContainer: function createContainer(containerParent) {\n\t\t\t\tvar body, container;\n\n\t\t\t\tif (containerParent && (containerParent.offsetWidth || containerParent.offsetHeight)) {\n\t\t\t\t\tif (containerParent.appendChild) {\n\t\t\t\t\t\tcontainerParent.appendChild(container = doc.createElement(DIV));\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody = doc.getElementsByTagName('body')[0];\n\n\t\t\t\t\tif (body && body.appendChild) {\n\t\t\t\t\t\tcontainer = doc.createElement(DIV);\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\tcontainerInstanceCount += 1;\n\t\t\t\t\t\tbody.appendChild(container);\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Finds a approximate position where the text is to be broken\n\t\t\tgetNearestBreakIndex: function getNearestBreakIndex(text, maxWidth, sl) {\n\t\t\t\tif (!text || !text.length) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tvar difference,\n\t\t\t\t getWidth = sl._getWidthFn(),\n\t\t\t\t charLen = 0,\n\t\t\t\t increment = 0,\n\t\t\t\t oriWidth = getWidth(text),\n\t\t\t\t avgWidth = oriWidth / text.length;\n\n\t\t\t\tdifference = maxWidth;\n\t\t\t\tcharLen = ceil(maxWidth / avgWidth);\n\n\t\t\t\tif (oriWidth < maxWidth) {\n\t\t\t\t\treturn text.length - 1;\n\t\t\t\t}\n\n\t\t\t\tif (charLen > text.length) {\n\t\t\t\t\tdifference = maxWidth - oriWidth;\n\t\t\t\t\tcharLen = text.length;\n\t\t\t\t}\n\n\t\t\t\twhile (difference > 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twhile (difference < 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn charLen;\n\t\t\t},\n\n\t\t\t/*\n * Determine lineheight of a text for a given style. It adds propery lineHeight to the style passed\n *\n * @param {Object} - The style based on which the text's metric needs to be calculated. The calculation happens\n * based on fontSize property, if its not present a default font size is assumed.\n *\n * @return {Object} - The style that was passed with lineHeight as a named propery set on the object.\n */\n\t\t\tsetLineHeight: function setLineHeight(styleObj) {\n\t\t\t\tvar fSize = styleObj.fontSize = styleObj.fontSize || '12px';\n\t\t\t\tstyleObj.lineHeight = styleObj.lineHeight || styleObj['line-height'] || parseInt(fSize, 10) * 1.2 + 'px';\n\t\t\t\treturn styleObj;\n\t\t\t}\n\t\t};\n\n\t\treturn lib;\n\t}\n};\n\nexports['default'] = lib;\nmodule.exports = exports['default'];","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"hyperdis\",[],t):\"object\"==typeof exports?exports.hyperdis=t():e.hyperdis=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){\"use strict\";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:\"_addPropInModel\",value:function(e,t){return this._graph.createNodesFrom(t,e),this}},{key:\"on\",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:\"CurrFrame\",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride(\"nextFrame\")).resetNodeValue.apply(n,P(e));return o}},{key:\"next\",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:\"NextFrame\",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride(\"currentFrame\")).resetNodeValue.apply(n,P(e));return o}},{key:\"lock\",value:function(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:\"unlock\",value:function(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:\"prop\",value:function(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:\"setProp\",value:function(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i 5 ? maxContainers : 5;\n maxContainers = maxContainers < 20 ? maxContainers : 20;\n\n this.maxContainers = maxContainers;\n this.first = null;\n this.last = null;\n this.containers = {};\n this.length = 0;\n this.rootNode = parentContainer;\n\n if (isBrowserLess) {\n svg = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'height', '0');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'width', '0');\n this.svgRoot = svg;\n this.rootNode.appendChild(svg);\n }\n}\n\nContainerManager.prototype.get = function (style) {\n var diff,\n key,\n containerObj,\n containers = this.containers,\n len = this.length,\n max = this.maxContainers,\n keyStr = '';\n\n for (key in slLib.supportedStyle) {\n if (style[key] !== undefined) {\n keyStr += slLib.supportedStyle[key] + ':' + style[key] + ';';\n }\n }\n\n if (!keyStr) {\n return false;\n }\n\n if (containerObj = containers[keyStr]) {\n if (this.first !== containerObj) {\n containerObj.prev && (containerObj.prev.next = containerObj.next);\n containerObj.next && (containerObj.next.prev = containerObj.prev);\n containerObj.next = this.first;\n containerObj.next.prev = containerObj;\n this.last === containerObj && (this.last = containerObj.prev);\n containerObj.prev = null;\n this.first = containerObj;\n }\n } else {\n if (len >= max) {\n diff = len - max + 1;\n // +1 is to remove an extra entry to make space for the new container to be added.\n while (diff--) {\n this.removeContainer(this.last);\n }\n }\n containerObj = this.addContainer(keyStr);\n }\n\n return containerObj;\n};\n\nContainerManager.prototype.addContainer = function (keyStr) {\n var node, container;\n\n this.containers[keyStr] = container = {\n next: null,\n prev: null,\n node: null,\n ellipsesWidth: 0,\n lineHeight: 0,\n dotWidth: 0,\n avgCharWidth: 4,\n keyStr: keyStr,\n charCache: {}\n };\n\n // Since the container objects are arranged from most recent to least recent order, we need to add the new\n // object at the beginning of the list.\n container.next = this.first;\n container.next && (container.next.prev = container);\n this.first = container;\n if (!this.last) {\n this.last = container;\n }\n this.length += 1;\n\n node = container.node = doc.createElement('div');\n this.rootNode.appendChild(node);\n\n if (documentSupport.isIE && !documentSupport.hasSVG) {\n node.style.setAttribute('cssText', keyStr);\n } else {\n node.setAttribute('style', keyStr);\n }\n\n node.setAttribute('aria-hidden', 'true');\n node.setAttribute('role', 'presentation');\n node.style.display = 'inline-block';\n\n node.innerHTML = slLib.testStrAvg; // A test string.\n container.lineHeight = node.offsetHeight;\n container.avgCharWidth = node.offsetWidth / 3;\n\n if (documentSupport.isBrowserLess) {\n node = container.svgText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n node.setAttribute('style', keyStr);\n this.svgRoot.appendChild(node);\n\n node.textContent = slLib.testStrAvg; // A test string.\n container.lineHeight = node.getBBox().height;\n container.avgCharWidth = (node.getBBox().width - SVG_BBOX_CORRECTION) / 3;\n\n node.textContent = '...';\n container.ellipsesWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n node.textContent = '.';\n container.dotWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n } else {\n node.innerHTML = '...';\n container.ellipsesWidth = node.offsetWidth;\n node.innerHTML = '.';\n container.dotWidth = node.offsetWidth;\n node.innerHTML = '';\n }\n\n return container;\n};\n\nContainerManager.prototype.removeContainer = function (cObj) {\n var keyStr = cObj.keyStr;\n\n if (!keyStr || !this.length || !cObj) {\n return;\n }\n this.length -= 1;\n\n cObj.prev && (cObj.prev.next = cObj.next);\n cObj.next && (cObj.next.prev = cObj.prev);\n this.first === cObj && (this.first = cObj.next);\n this.last === cObj && (this.last = cObj.prev);\n\n cObj.node.parentNode.removeChild(cObj.node);\n\n delete this.containers[keyStr];\n};\n\nContainerManager.prototype.dispose = function () {\n var key,\n containers = this.containers;\n\n this.maxContainers = null;\n for (key in containers) {\n this.removeContainer(containers[key]);\n }\n\n this.rootNode.parentNode.removeChild(this.rootNode);\n\n this.rootNode = null;\n this.first = null;\n this.last = null;\n};\n\nmodule.exports = ContainerManager;","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import map from \"./map\";\n\nexport default function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map.entries();\n else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n}\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return map();\n}\n\nfunction setMap(map, key, value) {\n map.set(key, value);\n}\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n scale.invertExtent = function(r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1, a, b, t,\n hiIndex;\n values.push(values[n] + this.step());\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo));\n hiIndex = getClosestIndexOf(values, hi);\n b = lo===hi ? a : Math.max(a, hiIndex - 1);\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n if (reverse) t = a, a = n - b, b = n - t; // map + swap\n return (a > b) ? undefined : domain().slice(a, b+1);\n };\n\n scale.invert = function (r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1,\n a,\n t;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo, 'left'));\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n return domain()[reverse ? n - a : a];\n }\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n\nfunction getClosestIndexOf (arr, value, side) {\n var low = 0,\n arrLen = arr.length,\n high = arrLen - 1,\n highVal,\n mid,\n d1,\n d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left'? high - 1 : high;\n } else {\n if (high === arr.length - 1) { return high; }\n return side === 'left'? high : high + 1;\n }\n}","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex3 = /^#([0-9a-f]{3})$/,\n reHex6 = /^#([0-9a-f]{6})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00\n : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nvar K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * rad2deg;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * deg2rad;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return hcl2lab(this).rgb();\n }\n}));\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis\";\nimport basisClosed from \"./basisClosed\";\nimport nogamma, {gamma} from \"./color\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return a + b * t;\n };\n}\n","import {basis} from \"./basis\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb\";\nimport array from \"./array\";\nimport date from \"./date\";\nimport number from \"./number\";\nimport object from \"./object\";\nimport string from \"./string\";\nimport constant from \"./constant\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : Array.isArray(b) ? array\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","import decompose, {identity} from \"./decompose\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b -= a, function(t) {\n return d.setTime(a + b * t), d;\n };\n}\n","import value from \"./value\";\n\nexport default function(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return Math.round(a + b * t);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number\";\nimport {parseCss, parseSvg} from \"./parse\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var rho = Math.SQRT2,\n rho2 = 2,\n rho4 = 4,\n epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n// p0 = [ux0, uy0, w0]\n// p1 = [ux1, uy1, w1]\nexport default function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n}\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function piecewise(interpolate, values) {\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns [\"123\", 0].\nexport default function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": function(x) { return Math.round(x).toString(10); },\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = new Date(+date)), date;\n }\n\n interval.floor = interval;\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval\";\nimport {durationSecond} from \"./duration\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval\";\nimport {durationMinute, durationSecond} from \"./duration\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval\";\nimport {durationDay, durationMinute} from \"./duration\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval\";\nimport {durationMinute, durationWeek} from \"./duration\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","import interval from \"./interval\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval\";\nimport {durationMinute} from \"./duration\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","import interval from \"./interval\";\nimport {durationHour} from \"./duration\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval\";\nimport {durationDay} from \"./duration\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval\";\nimport {durationWeek} from \"./duration\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newYear(y) {\n return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, newDate) {\n return function(string) {\n var d = newYear(1900),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newYear(d.y)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = newDate(newYear(d.y)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return newDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", localDate);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier, utcDate);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatWeekNumberISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {utcFormat} from \"./defaultLocale\";\n\nexport var isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : utcFormat(isoSpecifier);\n\nexport default formatIso;\n","import {isoSpecifier} from \"./isoFormat\";\nimport {utcParse} from \"./defaultLocale\";\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : utcParse(isoSpecifier);\n\nexport default parseIso;\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","export default function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return \"#\" + x;\n });\n}\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"./colors\";\n\nexport default colors(\"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6\");\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5\");\n","import colors from \"./colors\";\n\nexport default colors(\"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9\");\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar rainbow = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + \"\";\n}\n","import colors from \"./colors\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import {interpolateRgbBasis} from \"d3-interpolate\";\n\nexport default function(scheme) {\n return interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar c = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n","export const UNIT_GLOBAL_NAMESPACE = 'app.units';\nexport const UNIT_LOCAL_NAMESPACE = 'local.units';\nexport const LAYER_LOCAL_NAMESPACE = 'local.layers';\nexport const LAYER_GLOBAL_NAMESPACE = 'app.layers';\nexport const GROUP_GLOBAL_NAMESPACE = 'app.group';\nexport const GROUP_LOCAL_NAMESPACE = 'local.group';\nexport const CANVAS_LOCAL_NAMESPACE = 'local.canvas';\nexport const CANVAS_GLOBAL_NAMESPACE = 'app.canvas';\n\n","const ReservedFields = {\n ROW_ID: '__id__'\n};\n\nexport default ReservedFields;\n","const CommonProps = {\n ACTION_INF: 'actionInf',\n ON_LAYER_DRAW: 'onLayerDraw',\n MATRIX_CREATED: 'matrixCreated'\n};\n\nexport default CommonProps;\n","export const COORD_TYPES = {\n POLAR: 'polar',\n CARTESIAN: 'cartesian'\n};\nexport const DATA_TYPE = {\n FUNCTION: 'function',\n STRING: 'string',\n NUMBER: 'number',\n BOOLEAN: 'Boolean'\n};\nexport const SORT_ORDER_ASCENDING = 'asc';\nexport const SORT_ORDER_DESCENDING = 'desc';\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickTransform = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"#000\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"#000\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"))\n .style('transform', tickTransform);\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter\n : \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter);\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.tickTransform = function(_) {\n return arguments.length ? (tickTransform = _, axis) : tickTransform;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport line from \"./line\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import curveLinear from \"./linear\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial\";\nimport line from \"./line\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n","export var slice = Array.prototype.slice;\n","import {pi, tau} from \"../math\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop\";\nimport {point} from \"./basis\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop\";\nimport {point} from \"./cardinal\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math\";\nimport {Cardinal} from \"./cardinal\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed\";\nimport noop from \"../noop\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import {slice} from \"./array\";\nimport constant from \"./constant\";\nimport offsetNone from \"./offset/none\";\nimport orderNone from \"./order/none\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","import none from \"./none\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","var exponent = 3;\n\nexport var polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nexport var polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nexport var polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n","var pi = Math.PI,\n halfPi = pi / 2;\n\nexport function sinIn(t) {\n return 1 - Math.cos(t * halfPi);\n}\n\nexport function sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nexport function sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n","var b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nexport function bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nexport function bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nexport function bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n","var overshoot = 1.70158;\n\nexport var backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nexport var backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nexport var backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n","var tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nexport var elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nexport var elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nexport var elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export function x(d) {\n return d[0];\n}\n\nexport function y(d) {\n return d[1];\n}\n","function RedBlackTree() {\n this._ = null; // root node\n}\n\nexport function RedBlackNode(node) {\n node.U = // parent node\n node.C = // color - true for red, false for black\n node.L = // left node\n node.R = // right node\n node.P = // previous node\n node.N = null; // next node\n}\n\nRedBlackTree.prototype = {\n constructor: RedBlackTree,\n\n insert: function(after, node) {\n var parent, grandpa, uncle;\n\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = RedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n RedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n RedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n\n var parent = node.U,\n sibling,\n left = node.L,\n right = node.R,\n next,\n red;\n\n if (!left) next = right;\n else if (!right) next = left;\n else next = RedBlackFirst(right);\n\n if (parent) {\n if (parent.L === node) parent.L = next;\n else parent.R = next;\n } else {\n this._ = next;\n }\n\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) { node.C = false; return; }\n\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n RedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n RedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n RedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n RedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n\n if (node) node.C = false;\n }\n};\n\nfunction RedBlackRotateLeft(tree, node) {\n var p = node,\n q = node.R,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n}\n\nfunction RedBlackRotateRight(tree, node) {\n var p = node,\n q = node.L,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n}\n\nfunction RedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n}\n\nexport default RedBlackTree;\n","import {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createEdge(left, right, v0, v1) {\n var edge = [null, null],\n index = edges.push(edge) - 1;\n edge.left = left;\n edge.right = right;\n if (v0) setEdgeEnd(edge, left, right, v0);\n if (v1) setEdgeEnd(edge, right, left, v1);\n cells[left.index].halfedges.push(index);\n cells[right.index].halfedges.push(index);\n return edge;\n}\n\nexport function createBorderEdge(left, v0, v1) {\n var edge = [v0, v1];\n edge.left = left;\n return edge;\n}\n\nexport function setEdgeEnd(edge, left, right, vertex) {\n if (!edge[0] && !edge[1]) {\n edge[0] = vertex;\n edge.left = left;\n edge.right = right;\n } else if (edge.left === right) {\n edge[1] = vertex;\n } else {\n edge[0] = vertex;\n }\n}\n\n// Liang–Barsky line clipping.\nfunction clipEdge(edge, x0, y0, x1, y1) {\n var a = edge[0],\n b = edge[1],\n ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?\n\n if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];\n if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];\n return true;\n}\n\nfunction connectEdge(edge, x0, y0, x1, y1) {\n var v1 = edge[1];\n if (v1) return true;\n\n var v0 = edge[0],\n left = edge.left,\n right = edge.right,\n lx = left[0],\n ly = left[1],\n rx = right[0],\n ry = right[1],\n fx = (lx + rx) / 2,\n fy = (ly + ry) / 2,\n fm,\n fb;\n\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!v0) v0 = [fx, y0];\n else if (v0[1] >= y1) return;\n v1 = [fx, y1];\n } else {\n if (!v0) v0 = [fx, y1];\n else if (v0[1] < y0) return;\n v1 = [fx, y0];\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!v0) v0 = [(y0 - fb) / fm, y0];\n else if (v0[1] >= y1) return;\n v1 = [(y1 - fb) / fm, y1];\n } else {\n if (!v0) v0 = [(y1 - fb) / fm, y1];\n else if (v0[1] < y0) return;\n v1 = [(y0 - fb) / fm, y0];\n }\n } else {\n if (ly < ry) {\n if (!v0) v0 = [x0, fm * x0 + fb];\n else if (v0[0] >= x1) return;\n v1 = [x1, fm * x1 + fb];\n } else {\n if (!v0) v0 = [x1, fm * x1 + fb];\n else if (v0[0] < x0) return;\n v1 = [x0, fm * x0 + fb];\n }\n }\n }\n\n edge[0] = v0;\n edge[1] = v1;\n return true;\n}\n\nexport function clipEdges(x0, y0, x1, y1) {\n var i = edges.length,\n edge;\n\n while (i--) {\n if (!connectEdge(edge = edges[i], x0, y0, x1, y1)\n || !clipEdge(edge, x0, y0, x1, y1)\n || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon\n || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {\n delete edges[i];\n }\n }\n}\n","import {createBorderEdge} from \"./Edge\";\nimport {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createCell(site) {\n return cells[site.index] = {\n site: site,\n halfedges: []\n };\n}\n\nfunction cellHalfedgeAngle(cell, edge) {\n var site = cell.site,\n va = edge.left,\n vb = edge.right;\n if (site === vb) vb = va, va = site;\n if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);\n if (site === va) va = edge[1], vb = edge[0];\n else va = edge[0], vb = edge[1];\n return Math.atan2(va[0] - vb[0], vb[1] - va[1]);\n}\n\nexport function cellHalfedgeStart(cell, edge) {\n return edge[+(edge.left !== cell.site)];\n}\n\nexport function cellHalfedgeEnd(cell, edge) {\n return edge[+(edge.left === cell.site)];\n}\n\nexport function sortCellHalfedges() {\n for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {\n if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {\n var index = new Array(m),\n array = new Array(m);\n for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);\n index.sort(function(i, j) { return array[j] - array[i]; });\n for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];\n for (j = 0; j < m; ++j) halfedges[j] = array[j];\n }\n }\n}\n\nexport function clipCells(x0, y0, x1, y1) {\n var nCells = cells.length,\n iCell,\n cell,\n site,\n iHalfedge,\n halfedges,\n nHalfedges,\n start,\n startX,\n startY,\n end,\n endX,\n endY,\n cover = true;\n\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n halfedges = cell.halfedges;\n iHalfedge = halfedges.length;\n\n // Remove any dangling clipped edges.\n while (iHalfedge--) {\n if (!edges[halfedges[iHalfedge]]) {\n halfedges.splice(iHalfedge, 1);\n }\n }\n\n // Insert any border edges as necessary.\n iHalfedge = 0, nHalfedges = halfedges.length;\n while (iHalfedge < nHalfedges) {\n end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];\n start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];\n if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {\n halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,\n Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]\n : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]\n : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]\n : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]\n : null)) - 1);\n ++nHalfedges;\n }\n }\n\n if (nHalfedges) cover = false;\n }\n }\n\n // If there weren’t any edges, have the closest site cover the extent.\n // It doesn’t matter which corner of the extent we measure!\n if (cover) {\n var dx, dy, d2, dc = Infinity;\n\n for (iCell = 0, cover = null; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n dx = site[0] - x0;\n dy = site[1] - y0;\n d2 = dx * dx + dy * dy;\n if (d2 < dc) dc = d2, cover = cell;\n }\n }\n\n if (cover) {\n var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];\n cover.halfedges.push(\n edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,\n edges.push(createBorderEdge(site, v01, v11)) - 1,\n edges.push(createBorderEdge(site, v11, v10)) - 1,\n edges.push(createBorderEdge(site, v10, v00)) - 1\n );\n }\n }\n\n // Lastly delete any cells with no edges; these were entirely clipped.\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n if (!cell.halfedges.length) {\n delete cells[iCell];\n }\n }\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {circles, epsilon2} from \"./Diagram\";\n\nvar circlePool = [];\n\nexport var firstCircle;\n\nfunction Circle() {\n RedBlackNode(this);\n this.x =\n this.y =\n this.arc =\n this.site =\n this.cy = null;\n}\n\nexport function attachCircle(arc) {\n var lArc = arc.P,\n rArc = arc.N;\n\n if (!lArc || !rArc) return;\n\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n if (lSite === rSite) return;\n\n var bx = cSite[0],\n by = cSite[1],\n ax = lSite[0] - bx,\n ay = lSite[1] - by,\n cx = rSite[0] - bx,\n cy = rSite[1] - by;\n\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -epsilon2) return;\n\n var ha = ax * ax + ay * ay,\n hc = cx * cx + cy * cy,\n x = (cy * ha - ay * hc) / d,\n y = (ax * hc - cx * ha) / d;\n\n var circle = circlePool.pop() || new Circle;\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom\n\n arc.circle = circle;\n\n var before = null,\n node = circles._;\n\n while (node) {\n if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {\n if (node.L) node = node.L;\n else { before = node.P; break; }\n } else {\n if (node.R) node = node.R;\n else { before = node; break; }\n }\n }\n\n circles.insert(before, circle);\n if (!before) firstCircle = circle;\n}\n\nexport function detachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) firstCircle = circle.N;\n circles.remove(circle);\n circlePool.push(circle);\n RedBlackNode(circle);\n arc.circle = null;\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {createCell} from \"./Cell\";\nimport {attachCircle, detachCircle} from \"./Circle\";\nimport {createEdge, setEdgeEnd} from \"./Edge\";\nimport {beaches, epsilon} from \"./Diagram\";\n\nvar beachPool = [];\n\nfunction Beach() {\n RedBlackNode(this);\n this.edge =\n this.site =\n this.circle = null;\n}\n\nfunction createBeach(site) {\n var beach = beachPool.pop() || new Beach;\n beach.site = site;\n return beach;\n}\n\nfunction detachBeach(beach) {\n detachCircle(beach);\n beaches.remove(beach);\n beachPool.push(beach);\n RedBlackNode(beach);\n}\n\nexport function removeBeach(beach) {\n var circle = beach.circle,\n x = circle.x,\n y = circle.cy,\n vertex = [x, y],\n previous = beach.P,\n next = beach.N,\n disappearing = [beach];\n\n detachBeach(beach);\n\n var lArc = previous;\n while (lArc.circle\n && Math.abs(x - lArc.circle.x) < epsilon\n && Math.abs(y - lArc.circle.cy) < epsilon) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n detachBeach(lArc);\n lArc = previous;\n }\n\n disappearing.unshift(lArc);\n detachCircle(lArc);\n\n var rArc = next;\n while (rArc.circle\n && Math.abs(x - rArc.circle.x) < epsilon\n && Math.abs(y - rArc.circle.cy) < epsilon) {\n next = rArc.N;\n disappearing.push(rArc);\n detachBeach(rArc);\n rArc = next;\n }\n\n disappearing.push(rArc);\n detachCircle(rArc);\n\n var nArcs = disappearing.length,\n iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);\n\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nexport function addBeach(site) {\n var x = site[0],\n directrix = site[1],\n lArc,\n rArc,\n dxl,\n dxr,\n node = beaches._;\n\n while (node) {\n dxl = leftBreakPoint(node, directrix) - x;\n if (dxl > epsilon) node = node.L; else {\n dxr = x - rightBreakPoint(node, directrix);\n if (dxr > epsilon) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -epsilon) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -epsilon) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n\n createCell(site);\n var newArc = createBeach(site);\n beaches.insert(lArc, newArc);\n\n if (!lArc && !rArc) return;\n\n if (lArc === rArc) {\n detachCircle(lArc);\n rArc = createBeach(lArc.site);\n beaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);\n attachCircle(lArc);\n attachCircle(rArc);\n return;\n }\n\n if (!rArc) { // && lArc\n newArc.edge = createEdge(lArc.site, newArc.site);\n return;\n }\n\n // else lArc !== rArc\n detachCircle(lArc);\n detachCircle(rArc);\n\n var lSite = lArc.site,\n ax = lSite[0],\n ay = lSite[1],\n bx = site[0] - ax,\n by = site[1] - ay,\n rSite = rArc.site,\n cx = rSite[0] - ax,\n cy = rSite[1] - ay,\n d = 2 * (bx * cy - by * cx),\n hb = bx * bx + by * by,\n hc = cx * cx + cy * cy,\n vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];\n\n setEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = createEdge(lSite, site, null, vertex);\n rArc.edge = createEdge(site, rSite, null, vertex);\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nfunction leftBreakPoint(arc, directrix) {\n var site = arc.site,\n rfocx = site[0],\n rfocy = site[1],\n pby2 = rfocy - directrix;\n\n if (!pby2) return rfocx;\n\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n\n site = lArc.site;\n var lfocx = site[0],\n lfocy = site[1],\n plby2 = lfocy - directrix;\n\n if (!plby2) return lfocx;\n\n var hl = lfocx - rfocx,\n aby2 = 1 / pby2 - 1 / plby2,\n b = hl / plby2;\n\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n\n return (rfocx + lfocx) / 2;\n}\n\nfunction rightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return leftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site[1] === directrix ? site[0] : Infinity;\n}\n","import {addBeach, removeBeach} from \"./Beach\";\nimport {sortCellHalfedges, cellHalfedgeStart, clipCells} from \"./Cell\";\nimport {firstCircle} from \"./Circle\";\nimport {clipEdges} from \"./Edge\";\nimport RedBlackTree from \"./RedBlackTree\";\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var beaches;\nexport var cells;\nexport var circles;\nexport var edges;\n\nfunction triangleArea(a, b, c) {\n return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);\n}\n\nfunction lexicographic(a, b) {\n return b[1] - a[1]\n || b[0] - a[0];\n}\n\nexport default function Diagram(sites, extent) {\n var site = sites.sort(lexicographic).pop(),\n x,\n y,\n circle;\n\n edges = [];\n cells = new Array(sites.length);\n beaches = new RedBlackTree;\n circles = new RedBlackTree;\n\n while (true) {\n circle = firstCircle;\n if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {\n if (site[0] !== x || site[1] !== y) {\n addBeach(site);\n x = site[0], y = site[1];\n }\n site = sites.pop();\n } else if (circle) {\n removeBeach(circle.arc);\n } else {\n break;\n }\n }\n\n sortCellHalfedges();\n\n if (extent) {\n var x0 = +extent[0][0],\n y0 = +extent[0][1],\n x1 = +extent[1][0],\n y1 = +extent[1][1];\n clipEdges(x0, y0, x1, y1);\n clipCells(x0, y0, x1, y1);\n }\n\n this.edges = edges;\n this.cells = cells;\n\n beaches =\n circles =\n edges =\n cells = null;\n}\n\nDiagram.prototype = {\n constructor: Diagram,\n\n polygons: function() {\n var edges = this.edges;\n\n return this.cells.map(function(cell) {\n var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });\n polygon.data = cell.site.data;\n return polygon;\n });\n },\n\n triangles: function() {\n var triangles = [],\n edges = this.edges;\n\n this.cells.forEach(function(cell, i) {\n if (!(m = (halfedges = cell.halfedges).length)) return;\n var site = cell.site,\n halfedges,\n j = -1,\n m,\n s0,\n e1 = edges[halfedges[m - 1]],\n s1 = e1.left === site ? e1.right : e1.left;\n\n while (++j < m) {\n s0 = s1;\n e1 = edges[halfedges[j]];\n s1 = e1.left === site ? e1.right : e1.left;\n if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {\n triangles.push([site.data, s0.data, s1.data]);\n }\n }\n });\n\n return triangles;\n },\n\n links: function() {\n return this.edges.filter(function(edge) {\n return edge.right;\n }).map(function(edge) {\n return {\n source: edge.left.data,\n target: edge.right.data\n };\n });\n },\n\n find: function(x, y, radius) {\n var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;\n\n // Use the previously-found cell, or start with an arbitrary one.\n while (!(cell = that.cells[i1])) if (++i1 >= n) return null;\n var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;\n\n // Traverse the half-edges to find a closer cell, if any.\n do {\n cell = that.cells[i0 = i1], i1 = null;\n cell.halfedges.forEach(function(e) {\n var edge = that.edges[e], v = edge.left;\n if ((v === cell.site || !v) && !(v = edge.right)) return;\n var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;\n if (v2 < d2) d2 = v2, i1 = v.index;\n });\n } while (i1 !== null);\n\n that._found = i0;\n\n return radius == null || d2 <= radius * radius ? cell.site : null;\n }\n}\n","import constant from \"./constant\";\nimport {x as pointX, y as pointY} from \"./point\";\nimport Diagram, {epsilon} from \"./Diagram\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n extent = null;\n\n function voronoi(data) {\n return new Diagram(data.map(function(d, i) {\n var s = [Math.round(x(d, i, data) / epsilon) * epsilon, Math.round(y(d, i, data) / epsilon) * epsilon];\n s.index = i;\n s.data = d;\n return s;\n }), extent);\n }\n\n voronoi.polygons = function(data) {\n return voronoi(data).polygons();\n };\n\n voronoi.links = function(data) {\n return voronoi(data).links();\n };\n\n voronoi.triangles = function(data) {\n return voronoi(data).triangles();\n };\n\n voronoi.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), voronoi) : x;\n };\n\n voronoi.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), voronoi) : y;\n };\n\n voronoi.extent = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];\n };\n\n voronoi.size = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];\n };\n\n return voronoi;\n}\n","import { defaultValue } from '../common-utils';\n\nconst sortSelection = (dataObjects, updateData, sortFn) =>\n (a, b) => {\n const kA = a[0];\n const kB = b[0];\n return sortFn([a[0], dataObjects.get(kA), updateData.get(kA)], [kB, dataObjects.get(kB), updateData.get(kB)]);\n };\n\n/**\n * This class represents a selection applied on a data array.\n *\n * @class Selection\n */\nclass Selection {\n /**\n * Creates an instance of Selection.\n * @param {Array} data Array of DataObjects.\n * @memberof Selection\n */\n constructor (idGetter) {\n this._dataObjects = new Map();\n this._updateData = new Map();\n this._enterData = new Map();\n this._exitData = new Map();\n this._idGetter = idGetter;\n }\n\n /**\n * This method is used to supply seed data to a selection.\n *\n * @param {Array} newData Seed data to create the enter selection.\n * @param {Functon | undefined } idGetter This function is used to uniqely identify a data entry.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n data (newData) {\n const entryData = new Map();\n const exitdata = new Map();\n const tempMap = new Map();\n const duplicateData = new Map();\n const updatedData = this._updateData;\n const idGetter = this._idGetter;\n\n newData.forEach((...params) => {\n const key = idGetter ? idGetter(...params) : params[1];\n if (!tempMap.has(key)) {\n tempMap.set(key, params[0]);\n } else {\n duplicateData.push(key, params[0]);\n }\n });\n\n let val;\n // prepare enter data\n let entries = tempMap.entries();\n while (val = entries.next().value) {\n if (!updatedData.has(val[0])) {\n entryData.set(val[0], val[1]);\n } else {\n updatedData.set(val[0], val[1]);\n }\n }\n // prepare exit data\n entries = updatedData.entries();\n while (val = entries.next().value) {\n if (!tempMap.has(val[0])) {\n exitdata.set(val[0], val[1]);\n }\n }\n\n // put duplicate data to exit list\n entries = duplicateData.entries();\n while (val = entries.next().value) {\n exitdata.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = updatedData;\n newSelection._dataObjects = this._dataObjects;\n newSelection._enterData = entryData;\n newSelection._exitData = exitdata;\n\n return newSelection;\n }\n\n /**\n * Applies the supplied callback to each data element\n * and returns a new selection.\n *\n * @param {Function} callback Callback to execute on each item.\n * @return {Selection} New selection with data created using callback.\n * @memberof Selection\n */\n append (callback) {\n let val;\n const dataObjects = new Map();\n const data = new Map();\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n dataObjects.set(val[0], callback(val[1]));\n data.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = data;\n newSelection._dataObjects = dataObjects;\n\n return newSelection;\n }\n\n /**\n * This method returns an enter selection that\n * allows or update operations.\n *\n * @return {Selection} Instance of enter selection.\n * @memberof Selection\n */\n enter () {\n this._mode = 'enter';\n return this;\n }\n\n /**\n * Returns a selection with exit data.\n *\n * @return {Selection} Instance of selection.\n * @memberof Selection\n */\n exit () {\n this._mode = 'exit';\n return this;\n }\n\n /**\n * This method merges the data of one selection with another.\n *\n * @param {Selection} selection Instance of selection.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n merge (target) {\n const mergedObjects = new Map();\n const mergedData = new Map();\n let val;\n let entries;\n\n // merge Object and data present in this selection\n entries = this._updateData.entries();\n while (val = entries.next().value) {\n if (!this._exitData.has(val[0])) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], this._dataObjects.get(val[0]));\n }\n }\n\n // merge object from target selection\n entries = target._updateData.entries();\n while (val = entries.next().value) {\n if (!(mergedData.has(val[0]) || target._exitData.has(val[0]))) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], target._dataObjects.get(val[0]));\n }\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = mergedData;\n newSelection._dataObjects = mergedObjects;\n\n return newSelection;\n }\n\n each (fn) {\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n fn(val[1], this._updateData.get(val[0]), val[0]);\n }\n }\n\n map (fn) {\n const newdata = new Map();\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n newdata.set(val[0], fn(val[1], this._updateData.get(val[0]), val[0]));\n }\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = this._updateData;\n newSelection._dataObjects = newdata;\n\n return newSelection;\n }\n\n remove () {\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n\n currentData.clear();\n\n return this;\n }\n\n sort (sortFn) {\n const updateData = this._updateData;\n const dataObjects = this._dataObjects;\n const sortSel = sortSelection(dataObjects, updateData, sortFn);\n\n this._updateData = new Map([...updateData.entries()].sort(sortSel));\n this._dataObjects = new Map([...dataObjects.entries()].sort(sortSel));\n return this;\n }\n\n /**\n * Gets the object bound to a class\n *\n * @return {Object} current data set bound to the class\n * @memberof Selection\n */\n getObjects () {\n let val;\n const objects = [];\n const dataObjects = this._dataObjects;\n // select the data to create object\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n if (dataObjects.has(val[0])) {\n objects.push(dataObjects.get(val[0]));\n }\n }\n\n return objects;\n }\n}\n\nexport default Selection;\n","export const ORDER_ASCENDING = 'ascending';\nexport const ORDER_DESCENDING = 'descending';\nexport const ORDER_NONE = 'none';\nexport const OFFSET_DIVERGING = 'diverging';\nexport const OFFSET_NONE = 'none';\nexport const OFFSET_EXPAND = 'expand';\nexport const OFFSET_WIGGLE = 'wiggle';\n","/* global window, requestAnimationFrame, cancelAnimationFrame */\nimport { FieldType, DimensionSubtype, DateTimeFormatter, DM_DERIVATIVES, default as DataModel } from 'datamodel';\nimport {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom\n} from 'd3-axis';\nimport {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolWye,\n symbolTriangle,\n symbol,\n stack as d3Stack,\n stackOffsetDiverging,\n stackOrderNone,\n stackOrderAscending,\n stackOrderDescending,\n stackOffsetNone,\n stackOffsetExpand,\n stackOffsetWiggle,\n pie,\n arc,\n line,\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n area\n} from 'd3-shape';\nimport { scaleBand } from 'd3-scale';\nimport { nest } from 'd3-collection';\nimport {\n interpolate,\n interpolateRgb,\n piecewise,\n interpolateNumber,\n interpolateHslLong\n} from 'd3-interpolate';\nimport {\n easeCubic,\n easeBounce,\n easePoly,\n easeBack,\n easeCircle,\n easeLinear,\n easeElastic\n} from 'd3-ease';\nimport {\n color,\n rgb,\n hsl\n} from 'd3-color';\nimport { voronoi } from 'd3-voronoi';\nimport { dataSelect } from './DataSystem';\nimport { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING } from './enums';\nimport * as STACK_CONFIG from './enums/stack-config';\n\nconst { CATEGORICAL, TEMPORAL } = DimensionSubtype;\nconst { STRING, FUNCTION } = DATA_TYPE;\nconst { InvalidAwareTypes } = DataModel;\nconst HTMLElement = window.HTMLElement;\n\nconst isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n};\n\n/**\n * Returns unique id\n * @return {string} Unique id string\n */\nconst\n getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Deep copies an object and returns a new object.\n * @param {Object} o Object to clone\n * @return {Object} New Object.\n */\nconst clone = (o) => {\n const output = {};\n let v;\n for (const key in o) {\n if ({}.hasOwnProperty.call(o, key)) {\n v = o[key];\n output[key] = isSimpleObject(v) ? clone(v) : v;\n }\n }\n return output;\n};\n\n/**\n* Checks the existence of keys in an object\n* @param {Array} keys Set of keys which are to be checked\n* @param {Object} obj whose keys are checked from the set of keys provided\n* @return {Object} Error if the keys are absent, or the object itself\n*/\nconst checkExistence = (keys, obj) => {\n const nonExistentKeys = [];\n keys.forEach((key) => {\n if (key in obj) {\n return;\n }\n nonExistentKeys.push(key);\n });\n return nonExistentKeys;\n};\n\nconst sanitizeIP = {\n typeObj: (keys, obj) => {\n if (typeof obj !== 'object') {\n return Error('Argument type object expected');\n }\n\n const nonExistentKeys = checkExistence(keys, obj);\n if (nonExistentKeys.length) {\n return Error(`Missing keys from parameter ${nonExistentKeys.join(', ')}`);\n }\n return obj;\n },\n\n /* istanbul ignore next */ htmlElem: (elem) => {\n if (!(elem instanceof HTMLElement)) {\n return Error('HTMLElement required');\n }\n return elem;\n }\n};\n\n/**\n * Gets the maximum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Maximum value\n */\nconst getMax = (data, field) => Math.max(...data.map(d => d[field]));\n\n/**\n * Gets the minimum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Minimum value\n */\nconst getMin = (data, field) => Math.min(...data.map(d => d[field]));\n\n/**\n * Gets the domain from the data based on the field name and type of field\n * @param {Array. | Array.} data Data Array\n * @param {Array.} fields Array of fields from where the domain will be calculated\n * @param {string} fieldType Type of field - nominal, quantitiative, temporal.\n * @return {Array} Usually contains a min and max value if field is quantitative or\n * an array of values if field type is nominal or ordinal\n */\nconst getDomainFromData = (data, fields, fieldType) => {\n let domain;\n const domArr = [];\n data = data[0] instanceof Array ? data : [data];\n switch (fieldType) {\n case CATEGORICAL:\n domain = [].concat(...data.map(arr => arr.map(d => d[fields[0]]).filter(d => d !== undefined)));\n break;\n default:\n for (let i = 0, len = data.length; i < len; i++) {\n const arr = data[i];\n const [field0, field1] = fields;\n const arr0 = arr.filter(d => !isNaN(d[field0]));\n const arr1 = arr.filter(d => !isNaN(d[field1]));\n if (arr0.length || arr1.length) {\n const firstMin = getMin(arr0, field0);\n const secondMin = getMin(arr1, field1);\n const firstMax = getMax(arr0, field0);\n const secondMax = getMax(arr1, field1);\n domArr.push([Math.min(firstMin, secondMin), Math.max(firstMax, secondMax)]);\n }\n }\n domain = domArr.length ? [Math.min(...domArr.map(d => d[0])), Math.max(...domArr.map(d => d[1]))] : [];\n break;\n }\n return domain;\n};\n\nconst sanitizeDomainWhenEqual = (domain) => {\n if (domain[0] === domain[1]) {\n domain[0] = domain[0] > 0 ? 0 : domain[0];\n domain[1] = domain[1] > 0 ? domain[1] : 0;\n }\n return domain;\n};\n\n/**\n * Union Domain values\n * @param {Array.} domains Array of domain values\n * @param {string} fieldType type of field - dimension,measure or datetime.\n * @return {Array} Unioned domain of all domain values.\n */\nconst unionDomain = (domains, fieldType) => {\n let domain = [];\n domains = domains.filter(dom => dom && dom.length);\n if (domains.length) {\n if (fieldType === CATEGORICAL) {\n domain = [].concat(...domains);\n } else {\n domain = [Math.min(...domains.map(d => d[0])), Math.max(...domains.map(d => d[1]))];\n }\n }\n\n return domain;\n};\n\nconst symbolFns = {\n circle: symbolCircle,\n cross: symbolCross,\n diamond: symbolDiamond,\n square: symbolSquare,\n star: symbolStar,\n wye: symbolWye,\n triangle: symbolTriangle\n};\n\nconst easeFns = {\n cubic: easeCubic,\n bounce: easeBounce,\n linear: easeLinear,\n elastic: easeElastic,\n back: easeBack,\n poly: easePoly,\n circle: easeCircle\n};\n\n/**\n * Returns the maximum or minimum points of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @param {string} minOrMax minimum or maximum.\n * @return {Object} Minimum or maximum point.\n */\nconst getExtremePoint = (points, compareValue, minOrMax) => {\n let extremePoint;\n let point;\n const len = points.length;\n let minOrMaxVal = minOrMax === 'max' ? -Infinity : Infinity;\n let val;\n\n for (let i = 0; i < len; i++) {\n point = points[i];\n val = point[compareValue];\n if (minOrMax === 'min' ? val < minOrMaxVal : val > minOrMaxVal) {\n minOrMaxVal = val;\n extremePoint = point;\n }\n }\n\n return extremePoint;\n};\n\n/**\n * Returns the minimum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Minimum point.\n */\nconst getMinPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'min');\n\n/**\n * Returns the maximum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Maximum point.\n */\nconst getMaxPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'max');\n\n/**\n * Gets the index of the closest value of the given value from the array.\n * @param {Array} arr Array of values\n * @param {number} value Value from which the nearest value will be calculated.\n * @param {string} side side property.\n * @return {number} index of the closest value\n */\n/* istanbul ignore next */const getClosestIndexOf = (arr, value, side) => {\n let low = 0;\n const arrLen = arr.length;\n let high = arrLen - 1;\n\n let mid;\n let d1;\n let d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n const highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left' ? high - 1 : high;\n }\n if (high === arr.length - 1) { return high; }\n return side === 'left' ? high : high + 1;\n};\n\nconst getNearestValue = (data, key) => {\n const filterData = data.filter(d => typeof d === 'number');\n return filterData[getClosestIndexOf(filterData, key)];\n};\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst getWindow = () => window;\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst reqAnimFrame = (() => requestAnimationFrame)();\n\nconst cancelAnimFrame = (() => cancelAnimationFrame)();\n\n/**\n * Capitalizes the first letter of the word\n * @param {string} text word\n * @return {string} Capitalized word\n */\nconst capitalizeFirst = (text) => {\n text = text.toLowerCase();\n\n return text.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1));\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst unique = arr => ([...new Set(arr)]);\n\n/**\n * Gets the minimum difference between two consecutive numbers in an array.\n * @param {Array} arr Array of numbers\n * @param {number} index index of the value\n * @return {number} minimum difference between values\n */\n/* istanbul ignore next */ const getMinDiff = (arr, index) => {\n let diff;\n let uniqueVals;\n if (index !== undefined) {\n uniqueVals = unique(arr.map(d => d[index]));\n } else {\n uniqueVals = unique(arr);\n }\n if (uniqueVals.length > 1) {\n diff = Math.abs(uniqueVals[1] - uniqueVals[0]);\n for (let i = 2, len = uniqueVals.length; i < len; i++) {\n diff = Math.min(diff, Math.abs(uniqueVals[i] - uniqueVals[i - 1]));\n }\n } else {\n diff = uniqueVals[0];\n }\n\n return diff;\n};\n\n/**\n * Returns the class name appended with a given id.\n * @param {string} cls class name\n * @param {string} id unique identifier\n * @param {string} prefix string needed to add before the classname\n * @return {string} qualified class name\n */\n/* istanbul ignore next */const getQualifiedClassName = (cls, id, prefix) => {\n cls = cls.replace(/^\\.*/, '');\n return [`${prefix}-${cls}`, `${prefix}-${cls}-${id}`];\n};\n\n/**\n * This method is used to set the default value for variables\n * without sullying the code with conditional statements.\n *\n * @export\n * @param {any} param The parameter to test.\n * @param {any} value The default value to assign.\n * @return {any} The value.\n */\n/* istanbul ignore next */ const defaultValue = (param, value) => {\n if (typeof param === 'undefined' || (typeof param === 'object' && !param)) {\n return value;\n }\n return param;\n};\n\n/**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} graph graph whose dependency order has to be generated\n * @return {Object}\n */\nconst getDependencyOrder = (graph) => {\n const dependencyOrder = [];\n const visited = {};\n const keys = Object.keys(graph);\n /**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} name\n * @return {Object}\n */\n const visit = (name) => {\n if (dependencyOrder.length === keys.length) {\n return true;\n }\n visited[name] = true;\n const edges = graph[name];\n for (let e = 0; e < edges.length; e++) {\n const dep = edges[e];\n if (!visited[dep]) {\n visit(dep);\n }\n }\n\n dependencyOrder.push(name);\n return false;\n };\n\n for (let i = 0; i < keys.length; i++) {\n if (visit(keys[i], i)) break;\n }\n\n return dependencyOrder;\n};\n\n/**\n * Iterates over the properties of an object and applies the function\n *\n * @param {any} obj object to be iterated upon\n * @param {any} fn function to be applied on it\n */\nconst objectIterator = (obj, fn) => {\n for (const key in obj) {\n if (Object.hasOwnProperty.call(obj, key)) {\n fn(key, obj);\n }\n }\n};\n\n/**\n * This class creates a d3 voronoi for retrieving the nearest neighbour of any point from a set of two\n * dimensional points\n * @class Voronoi\n */\n/* istanbul ignore next */ class Voronoi {\n /**\n * Initialize the voronoi with the data given.\n * @param {Array.} data Array of points.\n */\n constructor (data = []) {\n this._voronoi = voronoi().x(d => d.x).y(d => d.y);\n this.data(data);\n }\n\n /**\n * Sets the data to voronoi\n * @param {Array.} data Array of objects.\n * @return {Voronoi} Instance of voronoi.\n */\n data (data) {\n if (data) {\n this._voronoiFn = this._voronoi(data);\n }\n return this;\n }\n\n /**\n * Finds the closest point to the x and y position given.\n * @param {number} x x value\n * @param {number} y y value\n * @param {number} radius search radius.\n * @return {Object} Details of the nearest point.\n */\n find (x, y, radius) {\n return this._voronoiFn.find(x, y, radius);\n }\n}\n\nconst getObjProp = (obj, ...fields) => {\n if (obj === undefined || obj === null) {\n return obj;\n }\n let retObj = obj;\n for (let i = 0, len = fields.length; i < len; i++) {\n retObj = retObj[fields[i]];\n if (retObj === undefined || retObj === null) {\n break;\n }\n }\n return retObj;\n};\n\n/**\n * Sanitize an input number / string mixed number. Currently dot in the no is not supported.\n *\n * @param {number | string} val pure number or string mixed number\n * @return {number | null} Number if it can be extracted. Otherwise null\n */\nconst intSanitizer = (val) => {\n const arr = val.toString().match(/(\\d+)(px)*/g);\n if (!arr) {\n // If only characters are passed\n return null;\n }\n\n return parseInt(arr[0], 10);\n};\n\nconst generateGetterSetters = (context, props) => {\n Object.entries(props).forEach((propInfo) => {\n const prop = propInfo[0];\n const { sanitization, preset, onset, typeChecker, defaultValue: defVal } = propInfo[1];\n const prototype = context.constructor.prototype;\n if (!(Object.hasOwnProperty.call(prototype, prop))) {\n if (defVal) {\n context[`_${prop}`] = defVal;\n }\n context[prop] = (...params) => {\n if (params.length) {\n let value = params[0];\n if (sanitization) {\n value = sanitization(context, params[0], context[`_${prop}`]);\n }\n if (preset) {\n preset(context, value);\n }\n if (typeChecker && !typeChecker(value)) {\n return context[`_${prop}`];\n }\n context[`_${prop}`] = value;\n if (onset) {\n onset(context, value);\n }\n return context;\n } return context[`_${prop}`];\n };\n }\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} prop\n */\nconst getArraySum = (arr, prop) => arr.reduce((total, elem) => {\n total += prop ? elem[prop] : elem;\n return total;\n}, 0);\n\n/**\n *\n *\n * @param {*} arr1\n * @param {*} arr2\n *\n */\nconst arraysEqual = (arr1, arr2) => {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = arr1.length; i >= 0; i--) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n\n return true;\n};\n\n/* eslint valid-typeof:0 */\n/**\n * Returns a validation function which can be used to validate variables against a type and value\n *\n * @param {any} type type of value that the object should have\n * @return {Object} validation function\n */\nconst isEqual = type => (oldVal, newVal) => {\n if (type === 'Array') {\n if (!oldVal) {\n return false;\n }\n return arraysEqual(oldVal, newVal);\n } else if (type === 'Object') {\n return Object.is(oldVal, newVal);\n } return oldVal === newVal;\n};\n\n/**\n * Description @todo\n *\n * @param {any} transactionModel @todo\n * @param {any} transactionEndpoint @todo\n * @param {any} transactionItems @todo\n * @return {any} @todo\n */\nconst enableChainedTransaction = (transactionModel, transactionEndpoint, transactionItems) =>\n transactionItems.forEach(item => transactionModel\n .registerImmediateListener(item, ([, newVal]) => transactionEndpoint[item](newVal)));\n\n/**\n * Chceks if the element is istanceof HTMLElement\n *\n * @param {Object} elem any JS Object\n */\nconst isHTMLElem = elem => elem instanceof HTMLElement;\n\nconst ERROR_MSG = {\n INTERFACE_IMPL: 'Method not implemented'\n};\n\n/**\n * Merges the sink object in the source by recursively iterating through the object properties\n * @param {Object} source Source Object\n * @param {Object} sink Sink Object\n * @return {Object} Merged object\n */\nconst mergeRecursive = (source, sink) => {\n for (const prop in sink) {\n if (isSimpleObject(source[prop]) && isSimpleObject(sink[prop])) {\n mergeRecursive(source[prop], sink[prop]);\n } else if (sink[prop] instanceof Object && sink[prop].constructor === Object) {\n source[prop] = {};\n mergeRecursive(source[prop], sink[prop]);\n } else {\n source[prop] = sink[prop];\n }\n }\n return source;\n};\n\n/**\n * Creates a selection set from a data set with corresponding attributes\n *\n * @export\n * @param {Selection} sel contains previous selection\n * @param {Object} appendObj Object to be appended\n * @param {Array} data Data based on which the selection is entered/updated/removed\n * @param {Object} [attrs={}] Attributes to be set on the data\n * @return {Selection} Merged selection\n */\nconst createSelection = (sel, appendObj, data, idFn) => {\n let selection = sel || dataSelect(idFn);\n\n selection = selection.data(data);\n\n const enter = selection.enter().append(appendObj);\n const mergedSelection = enter.merge(selection);\n\n const exitSelection = selection.exit();\n exitSelection.getObjects().forEach(inst => inst.remove());\n exitSelection.remove();\n return mergedSelection;\n};\n\nconst interpolateArray = (data, fitCount) => {\n const linearInterpolate = function (before, after, atPoint) {\n return before + (after - before) * atPoint;\n };\n const newData = [];\n const springFactor = ((data.length - 1) / (fitCount - 1));\n newData[0] = data[0]; // for new allocation\n for (let i = 1; i < fitCount - 1; i++) {\n const tmp = i * springFactor;\n const before = (Math.floor(tmp)).toFixed();\n const after = (Math.ceil(tmp)).toFixed();\n const atPoint = tmp - before;\n newData[i] = linearInterpolate(data[before], data[after], atPoint);\n }\n newData[fitCount - 1] = data[data.length - 1]; // for new allocation\n return newData;\n};\n\n/**\n *\n *\n * @param {*} fn\n */\nconst nextFrame = (fn) => {\n setTimeout(() => {\n fn();\n }, 0);\n};\n\n/**\n *\n *\n * @param {*} angle\n */\nconst angleToRadian = angle => angle * Math.PI / 180;\n\n/**\n *\n *\n * @param {*} newName\n * @param {*} oldName\n */\nconst replaceCSSPrefix = () => {\n // @todo\n};\n\n/**\n * Gets the interpolator function from d3 color\n *\n */\nconst interpolator = () => interpolate;\n\n/**\n * Gets the number interpolator from d3 color\n *\n */\nconst numberInterpolator = () => interpolateNumber;\n\n/**\n * Gets the rgb interpolator from d3 color\n *\n */\nconst colorInterpolator = () => interpolateRgb;\n\n/**\n * Gets the hsl interpolator from d3 color\n *\n */\nconst hslInterpolator = () => interpolateHslLong;\n\nconst transformColors = () => ({\n color,\n rgb,\n hsl\n});\n\n/**\n * Gets the piecewise interpolator from d3 color\n *\n */\nconst piecewiseInterpolator = () => piecewise;\n\nfunction hue2rgb (p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\n\n /**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number l The lightness\n * @return Array The RGB representation\n */\nconst hslToRgb = (h, s, l, a = 1) => {\n let r;\n let g;\n let b;\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\n /**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nconst rgbToHsv = (r, g, b, a = 1) => {\n r = +r; g = +g; b = +b; a = +a;\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n default: break;\n }\n h /= 6;\n }\n return [h, s, l, a];\n};\n\n /**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nconst hsvToRgb = (h, s, v, a = 1) => {\n let r;\n let g;\n let b;\n\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0: r = v; g = t; b = p; break;\n case 1: r = q; g = v; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 3: r = p; g = q; b = v; break;\n case 4: r = t; g = p; b = v; break;\n case 5: r = v; g = p; b = q; break;\n default: break;\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\nconst hexToHsv = (hex) => {\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? rgbToHsv(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : '';\n};\n\nconst detectColor = (col) => {\n const matchRgb = /rgb\\((\\d{1,3}), (\\d{1,3}), (\\d{1,3})\\)/;\n const matchHsl = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\n\n // Source : https://gist.github.com/sethlopezme/d072b945969a3cc2cc11\n // eslint-disable-next-line\n const matchRgba = /rgba?\\(((25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,\\s*?){2}(25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,?\\s*([01]\\.?\\d*?)?\\)/;\n // eslint-disable-next-line\n const matchHsla = /^hsla\\(([\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n const matchHex = /^#([0-9a-f]{3}){1,2}$/i;\n\n if (matchRgb.test(col) || matchRgba.test(col)) {\n return 'rgb';\n } else if (matchHsl.test(col) || matchHsla.test(col)) {\n return 'hsl';\n } else if (matchHex.test(col)) {\n return 'hex';\n } return col;\n};\n\nconst assembleModelFromIdentifiers = (model, identifiers) => {\n let schema = [];\n let data;\n const fieldMap = model.getFieldsConfig();\n if (identifiers.length) {\n const fields = identifiers[0];\n const len = fields.length;\n for (let i = 0; i < len; i++) {\n const field = fields[i];\n const fieldObj = fieldMap[field] && Object.assign({}, fieldMap[field].def);\n if (fieldObj) {\n schema.push(Object.assign(fieldObj));\n }\n }\n\n data = [];\n const header = identifiers[0];\n for (let i = 1; i < identifiers.length; i += 1) {\n const vals = identifiers[i];\n const temp = {};\n vals.forEach((fieldVal, cIdx) => {\n temp[header[cIdx]] = fieldVal;\n });\n data.push(temp);\n }\n } else {\n data = [];\n schema = [];\n }\n\n return new model.constructor(data, schema);\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} criteria\n *\n */\nconst getDataModelFromRange = (dataModel, criteria, mode) => {\n if (criteria === null) {\n return null;\n }\n const selFields = Object.keys(criteria);\n const selFn = fields => selFields.every((field) => {\n const val = fields[field].internalValue;\n const range = criteria[field][0] instanceof Array ? criteria[field][0] : criteria[field];\n if (typeof range[0] === STRING) {\n return range.find(d => d === val) !== undefined;\n }\n return range ? val >= range[0] && val <= range[1] : true;\n });\n\n return dataModel.select(selFn, {\n saveChild: false,\n mode\n });\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} identifiers\n *\n */\nconst getDataModelFromIdentifiers = (dataModel, identifiers, mode) => {\n let filteredDataModel;\n if (identifiers instanceof Array) {\n const fieldsConfig = dataModel.getFieldsConfig();\n\n const dataArr = identifiers.slice(1, identifiers.length);\n if (identifiers instanceof Function) {\n filteredDataModel = identifiers(dataModel, {}, false);\n } else if (identifiers instanceof Array && identifiers[0].length) {\n const filteredSchema = identifiers[0].filter(d => d in fieldsConfig);\n filteredDataModel = dataModel.select((fields) => {\n let include = true;\n filteredSchema.forEach((propField, idx) => {\n const value = fields[propField].internalValue;\n const index = dataArr.findIndex(d => d[idx] === value);\n include = include && index !== -1;\n });\n return include;\n }, {\n saveChild: false,\n mode\n });\n } else {\n filteredDataModel = dataModel.select(() => false, {\n saveChild: false,\n mode\n });\n }\n } else {\n filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode);\n }\n return filteredDataModel;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} listenerMap\n */\nconst registerListeners = (context, listenerMap, ...params) => {\n const propListenerMap = listenerMap(context, ...params);\n for (const key in propListenerMap) {\n if ({}.hasOwnProperty.call(propListenerMap, key)) {\n const { namespace } = params[1];\n let ns = null;\n if (namespace) {\n ns = namespace;\n }\n const mapObj = propListenerMap[key];\n const propType = mapObj.type;\n const props = mapObj.props;\n const listenerFn = mapObj.listener;\n context.store()[propType](props, listenerFn, false, {\n namespace: ns\n });\n }\n }\n};\n\nconst isValidValue = value => !isNaN(value) && value !== -Infinity && value !== Infinity;\n/**\n *\n *\n * @param {*} str\n *\n */\nconst escapeHTML = (str) => {\n const htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n };\n const htmlEscaper = /[&<>\"'/]/g;\n return (`${str}`).replace(htmlEscaper, match => htmlEscapes[match]);\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst transposeArray = arr => arr[0].map((col, i) => arr.map(row => row[i]));\nconst toArray = arr => (arr instanceof Array ? arr : [arr]);\nconst extendsClass = (cls, extendsFrom, found) => {\n if (!cls) {\n return false;\n }\n const prototype = cls.prototype;\n if (prototype instanceof extendsFrom) {\n found = true;\n } else {\n found = extendsClass(prototype, extendsFrom, found);\n }\n return found;\n};\n\n/**\n *\n * @param {*} dm1\n * @param {*} dm2\n */\nconst concatModels = (dm1, dm2) => {\n const dataObj1 = dm1.getData();\n const dataObj2 = dm2.getData();\n const data1 = dataObj1.data;\n const data2 = dataObj2.data;\n const schema1 = dataObj1.schema;\n const schema2 = dataObj2.schema;\n const tuples1 = {};\n const tuples2 = {};\n const commonTuples = {};\n for (let i = 0; i < data1.length; i++) {\n for (let ii = 0; ii < data2.length; ii++) {\n const row1 = data1[i];\n const row2 = data2[ii];\n const dim1Values = row1.filter((d, idx) => schema1[idx].type === FieldType.DIMENSION);\n const dim2Values = row2.filter((d, idx) => schema2[idx].type === FieldType.DIMENSION);\n const allDimSame = dim1Values.every(value => dim2Values.indexOf(value) !== -1);\n if (allDimSame) {\n const key = dim1Values.join();\n !commonTuples[key] && (commonTuples[key] = {});\n row1.forEach((value, idx) => {\n commonTuples[key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n commonTuples[key][schema2[idx].name] = value;\n });\n } else {\n const dm1Key = dim1Values.join();\n const dm2Key = dim2Values.join();\n if (!commonTuples[dm1Key] && !commonTuples[dm2Key]) {\n !tuples1[dm1Key] && (tuples1[dm1Key] = {});\n !tuples2[dm2Key] && (tuples2[dm2Key] = {});\n row1.forEach((value, idx) => {\n tuples1[dm1Key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n tuples2[dm2Key][schema2[idx].name] = value;\n });\n }\n }\n }\n }\n\n const commonSchema = [...schema1, ...schema2.filter(s2 => schema1.findIndex(s1 => s1.name === s2.name) === -1)];\n const data = [...Object.values(tuples1), ...Object.values(tuples2), ...Object.values(commonTuples)];\n return [data, commonSchema];\n};\n\nconst getSymbol = type => symbol().type(symbolFns[type]);\n\nconst stackOrders = {\n [STACK_CONFIG.ORDER_NONE]: stackOrderNone,\n [STACK_CONFIG.ORDER_ASCENDING]: stackOrderAscending,\n [STACK_CONFIG.ORDER_DESCENDING]: stackOrderDescending\n};\nconst stackOffsets = {\n [STACK_CONFIG.OFFSET_DIVERGING]: stackOffsetDiverging,\n [STACK_CONFIG.OFFSET_NONE]: stackOffsetNone,\n [STACK_CONFIG.OFFSET_EXPAND]: stackOffsetExpand,\n [STACK_CONFIG.OFFSET_WIGGLE]: stackOffsetWiggle\n};\n\n// eslint-disable-next-line require-jsdoc\nconst stack = params => d3Stack().keys(params.keys).offset(stackOffsets[params.offset])\n .order(stackOrders[params.order])(params.data);\n\n/**\n * Groups the data into a hierarchical tree structure based on one or more fields.\n * @param { Object } params Configuration properties for nesting data\n * @param { Array. } params.data Data which needs to be grouped\n * @param { Array. } params.keys Field indices by which the data will be grouped\n * @return { Array. } Grouped data array\n */\nconst nestCollection = (params) => {\n const nestFn = nest();\n params.keys.forEach(key => nestFn.key(d => d[key]));\n return nestFn.entries(params.data);\n};\n\nconst pathInterpolators = {\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n stepAfter: curveStepAfter,\n catmullRom: curveCatmullRom,\n step: curveStep,\n stepBefore: curveStepBefore,\n linear: curveLinear\n};\n\nconst Symbols = {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom,\n line,\n area,\n pie,\n arc,\n nest\n};\n\nconst Scales = {\n band: scaleBand\n};\n\nconst getSmallestDiff = (points) => {\n points = points.sort((a, b) => a - b);\n let minDiff = points[1] - points[0];\n for (let i = 2; i < points.length; i++) {\n minDiff = Math.min(minDiff, points[i] - points[i - 1]);\n }\n\n return minDiff;\n};\n\nconst timeFormats = {\n millisecond: '%A, %b %e, %H:%M:%S.%L',\n second: '%A, %b %e, %H:%M:%S',\n minute: '%A, %b %e, %H:%M',\n hour: '%A, %b %e, %H:%M',\n day: '%A, %b %e, %Y',\n month: '%B %Y',\n year: '%Y'\n};\n\nconst timeDurations = [\n ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'],\n [1, 1000, 60000, 3600000, 86400000, 2592000000, 31536000000]\n];\n\nconst getNearestInterval = (interval) => {\n const index = getClosestIndexOf(timeDurations[1], interval);\n return timeDurations[0][index];\n};\n\nconst formatTemporal = (value, interval) => {\n const nearestInterval = getNearestInterval(interval);\n return DateTimeFormatter.formatAs(value, timeFormats[nearestInterval]);\n};\n\nconst temporalFields = (dataModel) => {\n const filteredFields = {};\n Object.entries(dataModel.getFieldspace().getDimension()).forEach(([fieldName, fieldObj]) => {\n if (fieldObj.subtype() === TEMPORAL) {\n filteredFields[fieldName] = fieldObj;\n }\n });\n return filteredFields;\n};\n\nconst require = (lookupWhat, lookupDetails) => ({\n resolvable: (store) => {\n const lookupTarget = store[lookupWhat];\n const depArr = lookupDetails.slice(0, lookupDetails.length - 1);\n const fn = lookupDetails[lookupDetails.length - 1]; // fn\n\n const deps = depArr.map(str => lookupTarget[str]);\n return {\n fn: fn(...deps),\n depArr\n };\n }\n});\n\nconst nextAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n };\n\nconst getValueParser = config => (val) => {\n if (InvalidAwareTypes.getInvalidType(val)) {\n return val in config ? config[val] : `${val}`;\n }\n return val;\n};\n\nconst retrieveNearestGroupByReducers = (dataModel, ...measureFieldNames) => {\n const filteredReducers = {};\n if (dataModel instanceof DataModel) {\n const derivations = [...dataModel.getDerivations().reverse(), ...dataModel.getAncestorDerivations().reverse()];\n const nearestReducers = defaultValue(\n getObjProp(derivations.find(derv => derv.op === DM_DERIVATIVES.GROUPBY), 'criteria'), {});\n\n const measures = dataModel.getFieldspace().getMeasure();\n measureFieldNames = measureFieldNames.length ? measureFieldNames : Object.keys(measures);\n measureFieldNames.forEach((measureName) => {\n if (nearestReducers[measureName]) {\n filteredReducers[measureName] = nearestReducers[measureName];\n } else {\n const measureField = measures[measureName];\n if (measureField) {\n filteredReducers[measureName] = measureField.defAggFn();\n }\n }\n });\n }\n return filteredReducers;\n};\n\nconst retrieveFieldDisplayName = (dm, fieldName) => dm.getFieldspace().fieldsObj()[fieldName].displayName();\n/**\n * Fetches the nearest sort operation details by traversing the chain of parent DataModels\n * @param {Object} dataModel Instance of DataModel\n *\n * @return {Array|null} sort criteria, null if no sort operation found\n */\nconst nearestSortingDetails = (dataModel) => {\n const allDerivations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n const nearestSortDerivation = allDerivations.reverse().find(derivation => derivation.op === DM_DERIVATIVES.SORT);\n\n return nearestSortDerivation ? nearestSortDerivation.criteria : null;\n};\n\n/**\n * Map containing key, value sortingOrder pairs\n */\nconst sortOrderMap = {\n [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => firstVal.localeCompare(secondVal),\n [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => secondVal.localeCompare(firstVal)\n};\n\n/**\n * Sort categorical field based on it's sorting order\n * @param {string} sortOrder Order by which field is to be sorted (asc or desc or func)\n * @param {string} firstVal First sort parameter\n * @param {string} secondVal Second sort parameter\n * @return {number} position|null if sort order is invalid\n*/\nconst sortCategoricalField = (sortOrder, firstVal, secondVal) => {\n const sortOrderType = typeof sortOrder;\n\n if (sortOrderType === FUNCTION) {\n return sortOrder(firstVal, secondVal);\n } else if (sortOrderType === STRING) {\n if (!sortOrderMap[sortOrder]) return null;\n return sortOrderMap[sortOrder](firstVal, secondVal);\n }\n return null;\n};\n\nconst intersect = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => set.has(fn1(value)));\n};\n\nexport {\n getValueParser,\n require,\n intersect,\n Scales,\n Symbols,\n pathInterpolators,\n stack,\n nestCollection,\n getSymbol,\n transformColors,\n detectColor,\n hexToHsv,\n hslToRgb,\n rgbToHsv,\n hsvToRgb,\n concatModels,\n toArray,\n angleToRadian,\n escapeHTML,\n generateGetterSetters,\n getArraySum,\n interpolator,\n piecewiseInterpolator,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n colorInterpolator,\n numberInterpolator,\n ERROR_MSG,\n reqAnimFrame,\n nextAnimFrame,\n transposeArray,\n cancelAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n symbolFns,\n easeFns,\n clone,\n isEqual,\n interpolateArray,\n getMinPoint,\n defaultValue,\n getMaxPoint,\n getClosestIndexOf,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isSimpleObject,\n nextFrame,\n registerListeners,\n replaceCSSPrefix,\n getObjProp,\n extendsClass,\n assembleModelFromIdentifiers,\n isValidValue,\n hslInterpolator,\n getSmallestDiff,\n getNearestValue,\n retrieveNearestGroupByReducers,\n nearestSortingDetails,\n createSelection,\n formatTemporal,\n temporalFields,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField\n};\n","export function linear(t) {\n return +t;\n}\n","export function circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nexport function circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nexport function circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n","import Selection from './selection';\n/**\n * This function applies a selection operation on a data array.\n *\n * @export\n * @param {Array} [data=[]] The data array to be observed.\n * @return {Selection} Instance of a selection.\n */\nexport default function dataSelect (idFn) {\n return new Selection(idFn);\n}\n\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle\";\nimport cross from \"./symbol/cross\";\nimport diamond from \"./symbol/diamond\";\nimport star from \"./symbol/star\";\nimport square from \"./symbol/square\";\nimport triangle from \"./symbol/triangle\";\nimport wye from \"./symbol/wye\";\nimport constant from \"./constant\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import ascending from \"./ascending\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = yp;\n }\n }\n }\n}\n","import none from \"./none\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import constant from \"./constant\";\nimport descending from \"./descending\";\nimport identity from \"./identity\";\nimport {tau} from \"./math\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n return this.parentNode.insertBefore(this.cloneNode(false), this.nextSibling);\n}\n\nfunction selection_cloneDeep() {\n return this.parentNode.insertBefore(this.cloneNode(true), this.nextSibling);\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_join from \"./join\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n","import {event} from \"./selection/on\";\n\nexport default function() {\n var current = event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n}\n","export default function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart(\"mouse\", container.apply(this, arguments), mouse, this, arguments);\n if (!gesture) return;\n select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\");\n }\n\n function mouseupped() {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent();\n gestures.mouse(\"end\");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, touch, this, arguments)) {\n nopropagation();\n gesture(\"start\");\n }\n }\n }\n\n function touchmoved() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture(\"drag\");\n }\n }\n }\n\n function touchended() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture(\"end\");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!customEvent(new DragEvent(drag, \"beforestart\", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[id] = gesture, n = active++; break;\n case \"end\": delete gestures[id], --active; // nobreak\n case \"drag\": p = point(container, id), n = active; break;\n }\n customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {get, set} from \"./schedule\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","import {tweenValue} from \"./tween\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr\";\nimport transition_attrTween from \"./attrTween\";\nimport transition_delay from \"./delay\";\nimport transition_duration from \"./duration\";\nimport transition_ease from \"./ease\";\nimport transition_filter from \"./filter\";\nimport transition_merge from \"./merge\";\nimport transition_on from \"./on\";\nimport transition_remove from \"./remove\";\nimport transition_select from \"./select\";\nimport transition_selectAll from \"./selectAll\";\nimport transition_selection from \"./selection\";\nimport transition_style from \"./style\";\nimport transition_styleTween from \"./styleTween\";\nimport transition_text from \"./text\";\nimport transition_transition from \"./transition\";\nimport transition_tween from \"./tween\";\nimport transition_end from \"./end\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n end: transition_end\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {get, set, init} from \"./schedule\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i(t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i(t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i(t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {get, init} from \"./schedule\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n });\n}\n","import {Transition, newId} from \"../transition/index\";\nimport schedule from \"../transition/schedule\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt\";\nimport selection_transition from \"./transition\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import { select, event as d3event, selection, clientPoint } from 'd3-selection';\nimport { drag as d3drag } from 'd3-drag';\nimport 'd3-transition';\nimport { mergeRecursive } from './common-utils';\n/**\n * This function takes a raw DOM element or\n * a string and returns a d3 selection of that element.\n *\n * @param {HTMLElement | string} element The element to wrap in d3 selection.\n * @return {Selection} Instance of d3 selection.\n */\nconst selectElement = element => select(element);\n\n/**\n * It creates a new d3 element on the parent element\n * @param {Selection} parent Element to which the element is to be appended\n * @param {Object} elemType Type of the new element\n * @param {Array} data Data for the new element\n * @param {Object} selector classname/id/tagname for the element\n * @return {HTMLElement} Newly Created Element\n */\nconst makeElement = (parent, elemType, data, selector, callbacks = {}, keyFn) => {\n if ((parent instanceof HTMLElement || parent instanceof SVGElement)) {\n parent = selectElement(parent);\n }\n\n const selectorVal = selector ? selector[0] : null;\n let selectorType = null;\n let actualSelector = null;\n let element = null;\n let enterSel = null;\n let mergeSel = null;\n let filter;\n if (selectorVal) {\n if (selectorVal === '#') {\n selectorType = 'id';\n actualSelector = selector;\n } else {\n selectorType = 'class';\n actualSelector = selector[0] === '.' ? selector : `.${selector}`;\n }\n } else {\n actualSelector = elemType;\n filter = true;\n }\n element = parent.selectAll(actualSelector);\n\n filter && (element = element.filter(function () {\n return this.parentNode === parent.node();\n }));\n element = element.data(data, keyFn);\n\n enterSel = element.enter()\n .append(elemType || 'div');\n callbacks.enter && enterSel.each(function (...params) {\n callbacks.enter(selectElement(this), ...params);\n });\n\n mergeSel = enterSel.merge(element);\n callbacks.update && mergeSel.each(function (...params) {\n callbacks.update(selectElement(this), ...params);\n });\n if (selectorType === 'class') {\n mergeSel.classed(selectorVal === '.' ? selector.substring(1, selector.length) : selector, true);\n } else if (selectorType === 'id') {\n mergeSel.attr('id', selector.substring(1, selector.length));\n }\n const exitSel = element.exit();\n\n if (callbacks.exit) {\n exitSel.each(function (...params) {\n callbacks.exit(selectElement(this), ...params);\n });\n } else {\n exitSel.remove();\n }\n return mergeSel;\n};\n\n/**\n * This function applies styles to an element\n * @param {Object} elem Element Selection\n * @param {Object} styleObj Style Object to be applied\n * @return {Element} Newly Created Element\n*/\nconst applyStyle = (elem, styleObj) => {\n Object.entries(styleObj).forEach((d) => {\n elem.style(d[0], d[1]);\n }, this);\n return elem;\n};\n\n/**\n * This function appends a dom element in another element.\n * @param {HTMLElement | SVGElement} element1 The element in which to append the second element\n * @param {HTMLElement | SVGElement} element2 The element which will be appended.\n */\nconst appendElement = (element1, element2) => {\n element1.appendChild(element2);\n};\n\n/**\n * Sets the attributes to the element.\n * @param {HTMLElement | SVGElement} element Element on which attributes will be applied\n * @param {Object} attrs Attributes which need to be applied\n */\nconst setElementAttrs = (element, attrs) => {\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n element.attr(key, attrs[key]);\n }\n }\n};\n\n/**\n * Sets attributes in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which attrs will be applied\n * @param {Array.} attrs Array of attributes\n * @param {string} className className of elements to select.\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setAttrs = (element, attrs, className) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n className !== undefined ? element.selectAll(`.${className}`).each(function () {\n setElementAttrs(select(this), attrs);\n }) : setElementAttrs(element, attrs);\n return element;\n};\n\n/**\n * Adds a css class to elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst addClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, true) :\n elem.classed(className, true);\n });\n};\n\n/**\n * Removes the css class from elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst removeClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, false) :\n elem.classed(className, false);\n });\n};\n\n/**\n * Sets styles in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which styles will be applied\n * @param {Array.} styles Array of style attributes\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setStyles = (element, styles) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n element.style(key, styles[key]);\n }\n }\n return element;\n};\n\n/**\n * Creates svg or html elements by binding data to the selection.Removes extra elements\n * on exit.\n * @param {Object} params Parameter object\n * @param {SVGElement | HTMLElement} params.container Container element where all elements will be appended\n * @param {string} params.selector Selector by which elements will be selected from dom\n * @param {string} params.append Append tag\n * @param {Function} params.each Function which will be executed for each data point and element.\n */\nconst createElements = (params) => {\n const container = select(params.container);\n let data;\n let sel;\n\n data = params.data;\n if (typeof data === 'number') {\n data = Array(data).fill().map((d, i) => i);\n }\n sel = container.selectAll(params.selector).data(data);\n\n sel = container.selectAll(params.selector).filter(function () {\n return this.parentNode === container.node();\n }).data(params.data);\n\n const selectionMerge = sel.enter().append(params.append).merge(sel).each(function (d, i) {\n params.each(d, select(this), i);\n });\n\n selectionMerge.attr('class', params.className || '');\n sel.exit().remove();\n};\n\n/**\n * Clips an element with given measurement. Basically it is used to hide overflowing portions\n * of any element.\n * @param {SVGElement} container svg element which needs to be clipped.\n * @param {Object} measurement Dimensions of the clipped rectangle.\n * @param {string} id Unique id of the clip element\n */\nconst clipElement = (container, measurement, id) => {\n const clipPathElement = makeElement(select(container), 'clipPath', [1], `#${id}`);\n const clipPathRect = makeElement(clipPathElement, 'rect', [1]);\n clipPathRect.attr('x', measurement.x)\n .attr('y', measurement.x)\n .attr('width', measurement.width)\n .attr('height', measurement.height);\n clipPathElement.attr('clip-path', `url(#${id})`);\n};\n\n/**\n * Returns the element of the corresponding classname.\n * @param {HTMLElement | SVGElement} node html or svg node element.\n * @param {string} className css class to be applied.\n * @return {HTMLElement | SVGElement} html or svg element.\n */\nconst getElementsByClassName = (node, className) => select(node).selectAll(className).nodes();\n\n/**\n * Gets the mouse position relative to an svg type of element\n * @param {SVGElement} element Any svg element like rect, circle, etc.\n * @param {Event} event Event object.\n * @return {Object} x and y position relative to the container element passed.\n */\nconst getMousePos = (element, event) => {\n const boundingClientRect = element.getBoundingClientRect();\n return {\n x: event.x - boundingClientRect.x,\n y: event.y - boundingClientRect.y\n };\n};\n\nconst getClientPoint = (...params) => {\n const pos = clientPoint(...params);\n return {\n x: pos[0],\n y: pos[1]\n };\n};\n\n/** This function appends a dom element in another element.\n * @param {Object} tag The tag name of the element to append\n * @param {Object} mount Mount point fo the element\n * @return {Object} selection of the appended element\n */\nconst createElement = (tag, mount) => select(mount).append(tag).node();\n\n/**\n * Gets the d3 event function\n * @return {Object} d3 event\n */\nconst getEvent = () => d3event;\n\n/**\n * Gets the d3 drag function\n * @return {Object} d3 drag\n */\nconst getD3Drag = () => d3drag;\n\nconst getSmartComputedStyle = (group, css) => {\n let textEl;\n const testText = 'W';\n const mandatoryStyle = {\n 'fill-opacity': 0\n };\n const className = typeof css === 'string' ? css : (css instanceof Array ? css.join(' ') : undefined);\n\n if (group.node() instanceof HTMLElement) {\n textEl = group.append('div').html(testText);\n } else {\n textEl = group.append('text').text(testText);\n }\n\n if (className) {\n textEl.attr('class', className);\n } else if (typeof css === 'object') {\n delete css['fill-opacity'];\n mergeRecursive(mandatoryStyle, css);\n }\n\n textEl.style(mandatoryStyle);\n const computedStyle = window.getComputedStyle(textEl.node());\n const styleForSmartLabel = {\n fontSize: computedStyle.fontSize,\n fontFamily: computedStyle.fontFamily,\n fontWeight: computedStyle.fontWeight,\n fontStyle: computedStyle.fontStyle\n };\n\n textEl.remove();\n\n return styleForSmartLabel;\n};\n\nconst hasTouch = () => 'ontouchstart' in document.documentElement;\n\nexport {\n hasTouch,\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint\n};\n","import Model from 'hyperdis';\nimport { defaultValue, getObjProp, toArray } from './common-utils';\n\nconst initProp = (obj, props, val = () => ({})) => {\n props.forEach((prop) => {\n if (!obj[prop]) {\n obj[prop] = val();\n }\n obj = obj[prop];\n });\n return obj;\n};\n\nconst fetchPropValues = (propNames, params, deps) => params.map((param, i) => {\n const prop = propNames[i];\n\n return param.map(val => (val === undefined || val === null ? val : val[deps[prop]]));\n});\n\nconst addListenerToNamespace = (namespaceInf, fn, context) => {\n let key = namespaceInf.key;\n const namespace = namespaceInf.id;\n const listeners = context._listeners;\n\n if (namespace) {\n !listeners.get(namespace) && (listeners.set(namespace, new Map()));\n const namespaceListeners = listeners.get(namespace);\n\n if (!key) {\n key = namespaceListeners.size;\n }\n namespaceListeners.set(key, fn);\n } else {\n key = key || listeners.size;\n listeners.set(key, fn);\n }\n};\n\nconst setContexts = (contexts, propObj, contextMap) => {\n for (const key of propObj.keys()) {\n contexts[key] = {\n context: contextMap[key],\n deps: propObj.get(key).depProps\n };\n }\n return contexts;\n};\n\nconst registerPropInMaps = (store, props, namespaceInf, type) => {\n const {\n _registeredListeners: registeredListeners,\n _propListenerMap: propListenerMap\n } = store;\n const {\n subNamespace,\n namespace: ns\n } = namespaceInf;\n\n initProp(registeredListeners, [ns]);\n props.forEach((prop) => {\n const subNamespaces = defaultValue(getObjProp(registeredListeners, ns, prop, 'subNamespace'), []);\n let fns = defaultValue(getObjProp(propListenerMap, prop, type, 'fns'), 0);\n\n fns++;\n subNamespace && subNamespaces.push(subNamespace);\n registeredListeners[ns][prop] = {\n subNamespace: subNamespaces,\n allProps: props,\n subNamespaces: {}\n };\n initProp(propListenerMap, [prop, type]);\n propListenerMap[prop][type] = {\n fns,\n _fnCount: fns\n };\n });\n};\n\nconst registerListener = (context, type, ...options) => {\n const [propList, callBack, instantCall, namespaceInf = {}] = options;\n let props = propList;\n\n if (!Array.isArray(propList)) {\n props = [propList];\n }\n\n const { namespace: ns } = namespaceInf;\n const callbackFn = ((propNames, namespaceVal) => (...params) => {\n const { _savedCommits: commits, _propListenerMap: propListenerMap } = context;\n\n if (!propNames.some(prop => getObjProp(propListenerMap, prop, 'disabled'))) {\n if (namespaceVal) {\n const listenersObj = context._registeredListeners[namespaceVal];\n const contextMap = context._contextMap[namespaceVal];\n const contextsObj = {};\n\n propNames.forEach((prop) => {\n const commitsObj = defaultValue(getObjProp(commits, prop, type), {});\n const listeners = listenersObj[prop].subNamespaces;\n const propDeps = propListenerMap[prop][type];\n\n for (const nm in commitsObj) {\n const fnInf = defaultValue(propDeps[nm], { fns: 0 });\n let { fns } = fnInf;\n\n if (fns > 0) {\n setContexts(contextsObj, listeners[nm], contextMap);\n fns--;\n }\n\n if (fns <= 0) {\n delete commitsObj[nm];\n }\n fnInf.fns = fns;\n }\n });\n for (const key in contextsObj) {\n const obj = contextsObj[key];\n\n callBack(obj.context, ...fetchPropValues(propNames, params, obj.deps));\n }\n } else {\n callBack(...params);\n }\n }\n })(props, ns, type);\n\n const fn = context.model[type](props, callbackFn, instantCall);\n\n if (ns) {\n registerPropInMaps(context, props, namespaceInf, type);\n }\n addListenerToNamespace(namespaceInf, fn, context);\n};\n\nconst retrieveNamespaces = (names, key) => {\n if (names instanceof Object) {\n return [names[key]];\n } else if (names instanceof Array) {\n return names;\n }\n return [names];\n};\n\nconst createMap = () => new Map();\n\nconst listenerTypes = ['next', 'on'];\n\nconst removePropValue = (context, map, propInf) => {\n const { subNamespace: sns, prop, propListenerMap } = propInf;\n const propObj = propListenerMap[prop];\n\n listenerTypes.forEach((type) => {\n if (type in propObj) {\n delete propObj[type][sns];\n }\n });\n if (map.has(sns)) {\n const value = context.get(prop);\n\n if (value instanceof Object && sns in value) {\n delete value[sns];\n }\n map.delete(sns);\n }\n};\n\n/**\n * Methods to handle changes to table configuration and reactivity are handled by this\n * class.\n */\n/**\n * Common store class\n *\n * @class Store\n */\nexport class Store {\n /**\n * Creates an instance of Store.\n * @param {Object} config The object to create the state store with.\n * @memberof Store\n */\n constructor (config) {\n // create reactive model\n this.model = Model.create(config);\n this._listeners = new Map();\n this._registeredListeners = {};\n this._contextMap = {};\n this._commits = {};\n this._savedCommits = {};\n this._queuedProps = {};\n this._propListenerMap = {};\n this._locked = false;\n }\n\n lockModel () {\n this.model.lock();\n this._locked = true;\n return this;\n }\n\n unlockModel () {\n this._locked = false;\n this.model.unlock();\n return this;\n }\n\n /**\n * This method returns a plain JSON object\n * with all the fields in the state store.\n *\n * @return {Object} Serialized representation of state store.\n * @memberof Store\n */\n serialize () {\n return this.model.serialize();\n }\n\n lockCommits (props) {\n props.forEach((prop) => {\n this._commits[prop] = {\n locked: true,\n queue: []\n };\n });\n return this;\n }\n\n unlockCommits (props) {\n const commitsObj = this._commits;\n\n this.lockModel();\n props.forEach((prop) => {\n commitsObj[prop].locked = false;\n const queuedProps = {};\n const { queue } = commitsObj[prop];\n\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n if (namespace) {\n const propObj = initProp(queuedProps, [propName, namespace]);\n\n Object.assign(propObj, value);\n }\n });\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n this.commit(propName, propName in queuedProps ? queuedProps[propName][namespace] : value,\n namespace);\n });\n delete commitsObj[prop];\n });\n this.unlockModel();\n return this;\n }\n\n addSubNamespace (sns, namespace, context) {\n // Get all the listeners registered by the component\n const listeners = this._registeredListeners[namespace];\n const propListenerMap = this._propListenerMap;\n\n initProp(this._contextMap, [namespace]);\n this._contextMap[namespace][sns] = context;\n for (const key in listeners) {\n const obj = listeners[key];\n const propObj = propListenerMap[key];\n const propFns = listenerTypes.reduce((acc, type) => {\n const val = defaultValue(getObjProp(propObj, type, 'fns'), 0);\n val && (acc[type] = val);\n return acc;\n }, {});\n const { allProps, subNamespaces, subNamespace } = obj;\n const snsArr = subNamespace.length ? subNamespace : [sns];\n\n snsArr.forEach((ns) => {\n const nsObj = ns instanceof Function ? ns(context) : ns;\n const names = retrieveNamespaces(nsObj, key);\n const depProps = allProps.reduce((acc, prop) => {\n acc[prop] = ns instanceof Function ? nsObj[prop] : ns;\n return acc;\n }, {});\n\n names.forEach((nm) => {\n initProp(subNamespaces, [nm], createMap).set(sns, {\n depProps\n });\n\n for (const type in propFns) {\n initProp(propObj, [type, nm]);\n const fns = propFns[type];\n\n propObj[type][nm] = {\n fns,\n _fnCount: fns\n };\n }\n });\n });\n }\n return this;\n }\n\n /**\n * This method is used to update the value of a property in the state store.\n *\n * @param {string} propName The name of the property.\n * @param {number} value The new value of the property.\n * @memberof Store\n */\n commit (propName, value, namespace, disableListener = false) {\n let sanitizedVal = value;\n const commits = this._commits;\n const savedCommits = this._savedCommits;\n const locked = getObjProp(commits, propName, 'locked');\n const propListenerMap = this._propListenerMap[propName] || {};\n\n propListenerMap.disabled = disableListener;\n\n if (locked) {\n commits[propName].queue.push([propName, value, namespace]);\n return this;\n }\n\n if (namespace) {\n if (this._locked) {\n const queuedProps = initProp(this._queuedProps, [propName]);\n queuedProps[namespace] = value;\n sanitizedVal = queuedProps;\n } else {\n sanitizedVal = defaultValue(this.get(propName), {});\n sanitizedVal[namespace] = value;\n }\n\n listenerTypes.forEach((type) => {\n initProp(savedCommits, [propName, type]);\n savedCommits[propName][type][namespace] = true;\n if (getObjProp(propListenerMap, type, namespace)) {\n propListenerMap[type][namespace].fns = propListenerMap[type][namespace]._fnCount;\n }\n });\n }\n\n this.model.prop(propName, sanitizedVal);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */registerChangeListener (...params) {\n registerListener(this, 'next', ...params);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */ registerImmediateListener (...params) {\n registerListener(this, 'on', ...params);\n }\n\n /**\n * This method is used to get the name of the property\n * from the state store.\n *\n * @param {string} propName The name of the field in state store.\n * @return {any} The value of the field.\n * @memberof Store\n */\n get (propName, subNamespace) {\n const value = this.model.prop(propName);\n return subNamespace ? value && value[subNamespace] : value;\n }\n\n /**\n * This method is used to register a computed property that is computed every time\n * the store value changes.\n *\n * @param {string} propName The name of the property to create.\n * @param {Function} callBack The function to execute when depemdent props change.\n * @memberof Store\n */\n computed (propName, callBack) {\n return this.model.calculatedProp(propName, callBack);\n }\n\n append (...params) {\n this.model.append(...params);\n return this;\n }\n\n unsubscribeAll () {\n Object.values(this._listeners).forEach(fn => fn());\n return this;\n }\n\n unsubscribe (namespaceInf = {}) {\n const { id, key } = namespaceInf;\n const listenersMap = this._listeners;\n const listeners = listenersMap.get(id);\n\n if (key) {\n const fn = listenersMap.get(key);\n\n fn && fn();\n } else {\n for (const fn of listeners.values()) {\n fn();\n }\n listenersMap.set(id, []);\n }\n return this;\n }\n\n removeSubNamespace (subNamespace, namespace) {\n const {\n _registeredListeners: listenerMap,\n _contextMap: contextMap,\n _propListenerMap: propListenerMap\n } = this;\n const listenersObj = listenerMap[namespace];\n\n for (const prop in listenersObj) {\n const { subNamespaces } = listenersObj[prop];\n const propInf = {\n subNamespace,\n prop,\n propListenerMap\n };\n\n if (subNamespaces[subNamespace]) {\n removePropValue(this, subNamespaces[subNamespace], propInf);\n delete subNamespaces[subNamespace];\n } else {\n for (const ns in subNamespaces) {\n const snsMap = subNamespaces[ns];\n\n removePropValue(this, snsMap, propInf);\n if (!snsMap.size) {\n delete subNamespaces[ns];\n }\n }\n }\n }\n delete contextMap[namespace][subNamespace];\n return this;\n }\n}\n\n/**\n * Setter getter creator from config\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args. (Optional)\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitization: // Need for sanitization before type is checked\n * }\n * }\n *\n * @param {Object} holder an empty object on which the getters and setters will be mounted\n * @param {Object} options options config based on which the getters and setters are determined.\n * @param {Hyperdis} model optional model to attach the property. If not sent new moel is created.\n * @return {Array}\n */\nexport const transactor = (holder, options, model, namespaceInf = {}) => {\n let conf;\n const store = model instanceof Store ? model : new Store({});\n const stateProps = {};\n const { namespace, subNamespace } = namespaceInf;\n\n for (const prop in options) {\n if ({}.hasOwnProperty.call(options, prop)) {\n conf = options[prop];\n const nameSpaceProp = namespace ? `${namespace}.${prop}` : prop;\n\n if (subNamespace) {\n const value = defaultValue(store.get(nameSpaceProp), {});\n value[subNamespace] = conf.value;\n stateProps[nameSpaceProp] = value;\n } else {\n stateProps[prop] = conf.value;\n }\n\n holder[prop] = ((context, meta, nsProp) => (...params) => {\n const paramsLen = params.length;\n if (paramsLen) {\n const { takesMultipleParams = false } = meta || {};\n // If parameters are passed then it's a setter\n let val = takesMultipleParams ? params : params[0];\n\n if (meta) {\n let values;\n const prevVal = context.get(nsProp, subNamespace);\n const { sanitization, typeCheck, typeExpected } = meta;\n if (typeof sanitization === 'function') {\n // Sanitize if required\n val = sanitization(val, prevVal, holder);\n }\n\n // Checking if a setter is valid\n if (typeof typeCheck === 'function') {\n const typeCheckResult = typeCheck(val);\n\n if (typeCheckResult) {\n values = val;\n }\n } else if (typeof typeCheck === 'string' && typeCheck === 'constructor') {\n if (val && val.constructor.name === typeExpected) {\n values = val;\n }\n } else {\n values = val;\n }\n\n const preset = meta.preset;\n const oldValues = toArray(context.get(nsProp, subNamespace));\n preset && preset(values, holder);\n if (takesMultipleParams) {\n oldValues.forEach((value, i) => {\n if (values[i] === undefined) {\n values[i] = value;\n }\n });\n }\n values && context.commit(nsProp, values, subNamespace);\n } else {\n context.commit(nsProp, val, subNamespace);\n }\n return holder;\n }\n // No parameters are passed hence its a getter\n return context.get(nsProp, subNamespace);\n })(store, conf.meta, nameSpaceProp, Array.isArray(conf.value));\n }\n }\n\n if (subNamespace) {\n for (const key in stateProps) {\n store.commit(key, stateProps[key][subNamespace], subNamespace);\n }\n } else if (namespace === undefined) {\n store.append(stateProps);\n } else {\n store.append(namespace, stateProps);\n }\n\n return [holder, store];\n};\n","const events = [\n 'initialized',\n 'beforeupdate',\n 'updated',\n 'beforedraw',\n 'drawn',\n 'beforeremove',\n 'removed',\n 'animationend'\n];\n\nconst compositions = [\n 'canvas',\n 'unit',\n 'layer',\n 'axis',\n 'facet-headers',\n 'legend',\n 'caption'\n];\n\nconst EVENT_LIST = [];\n\ncompositions.forEach((composition) => {\n events.forEach((event) => {\n EVENT_LIST.push(`${composition}.${event}`);\n });\n});\n\nexport default EVENT_LIST;\n","import EVENT_LIST from './event-list';\nimport { createPromise } from './helper';\n\n/**\n * At first call it accepts one function\n * calling it second time accepts notification object.\n * notification object then called with first accepted function\n *\n * @param {Function} resolveFn a promise's resolve function\n * @return {Function} a function to accept notification object\n */\nconst resolver = resolveFn => notification => resolveFn(notification);\n\n/**\n * Checks if the property string is present in the source object\n *\n * @param {Object} source source object whom you want to check the property\n * @param {string} property key name that need to be checked\n * @return {boolean} returns true if the property found in the source object\n */\nconst hasOwn = (source, property) => Object.prototype.hasOwnProperty.call(source, property);\n\n/**\n * LifeCycleManager which goes as a dependendecy to a muze\n * it accepts notification from the entire library throughout\n * the exeecution life\n *\n * @export\n * @class LifeCycleManager\n */\nexport default class LifeCycleManager {\n\n /**\n * Creates an instance of LifeCycleManager.\n * @memberof LifeCycleManager\n */\n constructor () {\n this._eventList = EVENT_LIST;\n this._promises = new Map();\n this._notifiers = {};\n this._lifeCycles = {};\n this._unreleasedLifeCycles = {};\n this._boot();\n }\n\n /**\n * Fills all the notifiers with resolver callback\n *\n * @memberof LifeCycleManager\n */\n _boot () {\n this._notifiers = this._eventList.reduce((acc, name) => {\n acc[name] = resolver;\n return acc;\n }, {});\n this._preparePromises();\n }\n\n /**\n * Public method which gives the promise corresponding\n * to the event name\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} promise that is passed to the user\n * @memberof LifeCycleManager\n */\n retrieve (eventName) {\n return this._promises.get(eventName);\n }\n\n /**\n * Creates a promise that will be passed to user's callback\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} a pending promise waiting for resolve to be called\n * @memberof LifeCycleManager\n */\n _makeNotifierPromise (eventName) {\n return new Promise((resolve) => {\n this._notifiers[eventName] = resolver(resolve);\n });\n }\n\n /**\n * Prepares the promise map with pending promises\n * all the promises are in a pending state where their's\n * resolve function waiting to be called with notification object\n * @memberof LifeCycleManager\n */\n _preparePromises () {\n this._eventList.forEach((eventName) => {\n const promise = this._makeNotifierPromise(eventName);\n this._promises.set(eventName, promise);\n createPromise(promise, eventName, this);\n });\n }\n\n /**\n * Resolves the promise with notification object\n *\n * @param {string} eventName name of the event in the system\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n *\n * @memberof LifeCycleManager\n */\n _resolvePromise (eventName, notification) {\n this._notifiers[eventName](notification);\n }\n\n /**\n * Public method which is being called by different\n * subcompoents of the system at different execution atages\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n notify (notification) {\n // get the composition name from notification\n // or from static formalName() method\n const composition = notification.formalName || notification.client.constructor.formalName();\n notification.formalName = composition;\n this._releasePromisesFromCache();\n this._notify(composition, notification);\n }\n\n /**\n * Notify user the with promsie in a callback\n * if callback not found then cache it\n *\n * @param {string} composition\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n _notify (composition, notification) {\n const stage = notification.action;\n const eventName = `${composition}.${stage}`;\n\n // resolves promise with the notification object\n this._resolvePromise(eventName, notification);\n\n // get the promise from the promise map\n const promise = this.retrieve(eventName);\n\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // if user given call back exists, then call with promise\n this._callLifeCycleCallback(composition, stage, promise);\n } else {\n // otherwise cache the promise\n this._cachePromise(composition, stage, promise);\n }\n } else {\n this._cachePromise(composition, stage, promise);\n }\n }\n\n /**\n * Calls the user's callback with callback\n *\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _callLifeCycleCallback (composition, stage, promise) {\n const eventName = `${composition}.${stage}`;\n this._lifeCycles[composition][stage](promise);\n this._resetTargetPromise(eventName);\n }\n\n /**\n * Try to clear the cached promsies once we have\n * macthed callbacks from the user\n *\n * @memberof LifeCycleManager\n */\n _releasePromisesFromCache () {\n const compositions = Object.keys(this._unreleasedLifeCycles);\n compositions.forEach((composition) => {\n const stages = Object.keys(this._unreleasedLifeCycles[composition]);\n stages.forEach((stage) => {\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // take the promise from unreleased lifeCycles\n const promise = this._unreleasedLifeCycles[composition][stage];\n // call the user given callback with that promise\n this._callLifeCycleCallback(composition, stage, promise);\n // delete promise from unreleased lifeCycles\n delete this._unreleasedLifeCycles[composition][stage];\n }\n }\n });\n });\n }\n\n /**\n * Cache the promise in the map. This cache\n * then get consumed if we get user callbacks\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _cachePromise (composition, stage, promise) {\n if (!hasOwn(this._unreleasedLifeCycles, composition)) {\n this._unreleasedLifeCycles[composition] = {};\n }\n\n if (!hasOwn(this._unreleasedLifeCycles[composition], stage)) {\n this._unreleasedLifeCycles[composition][stage] = {};\n }\n this._unreleasedLifeCycles[composition][stage] = promise;\n }\n\n /**\n * It register's the callbacks gievn the user\n *\n * @param {Object} [lifeCycles={}] a object with list of callbacks\n * @memberof LifeCycleManager\n */\n register (lifeCycles = {}) {\n this._lifeCycles = lifeCycles;\n // as we get all the callbacks, try to call them\n // from unreleased promise map\n this._releasePromisesFromCache();\n }\n\n /**\n * Reset the promise into pending state\n *\n * @param {string} eventName name of the event happening\n * @memberof LifeCycleManager\n */\n _resetTargetPromise (eventName) {\n setTimeout(() => {\n this._notifiers[eventName] = resolver;\n this._promises.set(eventName, this._makeNotifierPromise(eventName));\n }, 0);\n }\n}\n","import LifeCycleManager from './lifecycle-manager';\n\nexport default LifeCycleManager;\n","/**\n * Creates a new promise when the given promise is resolved. This needs to be done so that after the lifecycle event\n * is completed, then again when the event gets completed, then a new promise gets resolved.\n *\n * @param {Promise} promise Instance of promise\n * @param {string} eventName name of event\n * @param {LifeCycleManager} context Instance of lifecyclemanager\n */\nexport const createPromise = (promise, eventName, context) => {\n promise.then(() => {\n const prm = context._makeNotifierPromise(eventName);\n context._promises.set(eventName, prm);\n createPromise(prm, eventName, context);\n });\n};\n","import { default as DataModel } from 'datamodel';\nimport * as scales from './scales';\nimport * as colorSchemes from './color-schemes';\nimport * as STATE_NAMESPACES from './enums/namespace';\n\nconst InvalidAwareTypes = DataModel.InvalidAwareTypes;\n\nexport {\n InvalidAwareTypes,\n DataModel\n};\n\nexport {\n ReservedFields,\n CommonProps,\n COORD_TYPES\n} from './enums';\n\nexport { STATE_NAMESPACES };\n\nexport {\n scales,\n colorSchemes\n};\n\nexport {\n getNearestValue,\n getValueParser,\n transformColors,\n detectColor,\n hslToRgb,\n rgbToHsv,\n hexToHsv,\n hsvToRgb,\n escapeHTML,\n angleToRadian,\n generateGetterSetters,\n getArraySum,\n ERROR_MSG,\n interpolator,\n colorInterpolator,\n numberInterpolator,\n piecewiseInterpolator,\n reqAnimFrame,\n cancelAnimFrame,\n nextAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n replaceCSSPrefix,\n symbolFns,\n defaultValue,\n easeFns,\n clone,\n interpolateArray,\n getMinPoint,\n getMaxPoint,\n getClosestIndexOf,\n registerListeners,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isEqual,\n isSimpleObject,\n nextFrame,\n getObjProp,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n transposeArray,\n toArray,\n extendsClass,\n concatModels,\n assembleModelFromIdentifiers,\n isValidValue,\n nestCollection,\n stack,\n getSymbol,\n Scales,\n Symbols,\n pathInterpolators,\n hslInterpolator,\n getSmallestDiff,\n require,\n formatTemporal,\n nearestSortingDetails,\n createSelection,\n temporalFields,\n retrieveNearestGroupByReducers,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n intersect\n} from './common-utils';\n\nexport {\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint,\n hasTouch\n} from './renderer-utils';\n\nexport {\n Store,\n transactor\n} from './store';\n\nexport {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'd3-time';\n\nexport { default as Smartlabel } from 'fusioncharts-smartlabel';\nexport { dataSelect } from './DataSystem';\n\nexport { default as LifeCycleManager } from './lifecycle-manager';\n\nexport {\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n DateTimeFormatter,\n DM_DERIVATIVES,\n GROUP_BY_FUNCTIONS\n} from 'datamodel';\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\nexport const LONGTOUCH = 'longtouch';\nexport const TOUCHDRAG = 'touchdrag';\nexport const ALL_ACTIONS = '*';\n","const SELECTION_NEW_ENTRY = 1;\nconst SELECTION_NEW_EXIT = -1;\nconst SELECTION_NULL = 0;\nconst SELECTION_OLD_ENTRY = 2;\nconst SELECTION_OLD_EXIT = -2;\n\nexport {\n SELECTION_NEW_ENTRY,\n SELECTION_NEW_EXIT,\n SELECTION_NULL,\n SELECTION_OLD_ENTRY,\n SELECTION_OLD_EXIT\n};\n","import SelectionSet from './selection-set';\n\nexport default SelectionSet;\n","import {\n SELECTION_NEW_ENTRY, SELECTION_NEW_EXIT, SELECTION_NULL, SELECTION_OLD_ENTRY, SELECTION_OLD_EXIT\n} from '../enums/selection';\n/* eslint-disable guard-for-in */\n\n/**\n * This component is used to keep track of the row tuples of the data which gets added and removed. This keeps\n * information of which rows are in previous and new entry set and previous and new exit set. This is initialized by\n * {@link Firebolt}.\n *\n * @public\n *\n * @class SelectionSet\n */\nclass SelectionSet {\n /**\n * Creates an instance of selection set\n *\n * @param {Array.} completeSet Set of unique ids.\n */\n constructor (completeSet, _volatile) {\n this.completeSet = completeSet;\n this._set = completeSet.reduce((obj, key) => {\n obj[key] = SELECTION_NULL;\n return obj;\n }, {});\n this._volatile = _volatile;\n this._completeSetCount = completeSet.length;\n this._lockedSelection = {};\n this._resetted = true;\n }\n\n /**\n * Adds a set of ids to the selection set. This also moves the other rows to exit set.\n *\n * @public\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n add (ids) {\n this._resetted = false;\n\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n set[i] = SELECTION_NEW_ENTRY;\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_ENTRY && set[key] !== SELECTION_OLD_ENTRY) {\n set[key] = set[key] < 0 ? SELECTION_OLD_EXIT : SELECTION_NEW_EXIT;\n }\n }\n return this;\n }\n\n /**\n * Adds an array of ids to the old entry set.\n *\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n update (ids) {\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n set[i] = SELECTION_OLD_ENTRY;\n });\n\n return this;\n }\n\n /**\n * Moves all ids which in new entry set to old entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateEntry () {\n const set = this._set;\n\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_ENTRY ? SELECTION_OLD_ENTRY : set[key];\n }\n return this;\n }\n\n /**\n * Moves an array of ids which are in new exit set to old exit set.\n *\n * @public\n *\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateExit () {\n const set = this._set;\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_EXIT ? SELECTION_OLD_EXIT : set[key];\n }\n return this;\n }\n\n /**\n * Removes an array of ids from the selection set. It also moves the remaining row ids to entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set\n */\n remove (ids) {\n this._resetted = false;\n\n const set = this._set;\n ids.forEach((i) => {\n set[i] = SELECTION_NEW_EXIT;\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_EXIT && set[key] !== SELECTION_OLD_EXIT) {\n set[key] = set[key] === 0 ? SELECTION_NEW_ENTRY : SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getSets () {\n const set = this._set;\n const retObj = {\n entrySet: [[], []],\n exitSet: [[], []],\n completeSet: []\n };\n\n for (const key in set) {\n if (set[key] > 0) {\n set[key] === SELECTION_OLD_ENTRY && retObj.entrySet[0].push(key);\n set[key] === SELECTION_NEW_ENTRY && retObj.entrySet[1].push(key);\n } else if (set[key] < 0) {\n set[key] === SELECTION_OLD_EXIT && retObj.exitSet[0].push(key);\n set[key] === SELECTION_NEW_EXIT && retObj.exitSet[1].push(key);\n }\n retObj.completeSet.push(key);\n }\n\n ['entrySet', 'exitSet'].forEach((type) => {\n retObj[type] = retObj[type].map(e => e.map(Number));\n });\n retObj.completeSet = retObj.completeSet.map(Number);\n\n return retObj;\n }\n\n /**\n * Resets an array of ids in the selection set to initial state. It sets the value of every unique id value to\n * null in the selection set which means they are neither in entry set nor in exit set. If no ids are passed,\n * then it resets all the ids to null.\n *\n * @public\n *\n * @param {Array} ids Array of unique ids.\n * @return {SelectionSet} Instance of selection set.\n */\n reset (ids) {\n const set = this._set;\n if (ids) {\n ids.forEach((i) => {\n set[i] = SELECTION_NULL;\n });\n } else {\n const lockedSel = this._lockedSelection;\n for (const key in set) {\n if (!(key in lockedSel)) {\n set[key] = SELECTION_NULL;\n }\n }\n }\n this._resetted = true;\n return this;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n *\n * @public\n *\n * @return {Array.} Array of unique ids\n */\n getEntrySet () {\n const set = this._set;\n const addSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_ENTRY && addSet.push(key);\n }\n\n return addSet;\n }\n\n /**\n * Returns a set of unique ids which are already present in entry set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old entry set or new entry set\n */\n getExistingEntrySet (addSet) {\n const set = this._set;\n return addSet.filter(d => set[d] === SELECTION_NEW_ENTRY || set[d] === SELECTION_OLD_ENTRY);\n }\n\n /**\n * Returns a set of unique ids which are already present in exit set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old exit set or new exit set\n */\n getExistingExitSet (removeSet) {\n const set = this._set;\n return removeSet.filter(d => set[d] === SELECTION_NEW_EXIT || set[d] === SELECTION_OLD_EXIT);\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldEntry () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_ENTRY && updateSet.push(key);\n }\n return updateSet;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldExit () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_EXIT && updateSet.push(key);\n }\n\n return updateSet;\n }\n\n /**\n * Gets the array of ids which are in the exit set.\n *\n * @public\n * @return {Array.} Array of unique ids\n */\n getExitSet () {\n const set = this._set;\n const removeSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_EXIT && removeSet.push(key);\n }\n return removeSet;\n }\n\n /**\n * Gets all the ids which are either in exit or entry set.\n *\n * @public\n * @return {Array} Array of unique ids\n */\n getCompleteSet () {\n const set = this._set;\n const completeSet = [];\n\n for (const key in set) {\n completeSet.push(key);\n }\n\n return completeSet;\n }\n\n getCompleteSetCount () {\n return this._completeSetCount;\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Swaps the add set and remove set in the selection set.\n * @return {SelectionSet} Instance of selection set.\n */\n toggle () {\n const set = this._set;\n\n for (const key in set) {\n if (set[key] === SELECTION_NEW_ENTRY) {\n set[key] = SELECTION_NEW_EXIT;\n } else if (set[key] === SELECTION_NEW_EXIT) {\n set[key] = SELECTION_NEW_ENTRY;\n } else if (set[key] === SELECTION_OLD_ENTRY) {\n set[key] = SELECTION_OLD_EXIT;\n } else {\n set[key] = SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n}\n\nexport default SelectionSet;\n","import { clone, retrieveNearestGroupByReducers } from 'muze-utils';\nimport * as SELECTION from '../enums/selection';\n\nexport const initializeSideEffects = (context, sideEffects) => {\n const sideEffectsMap = context._sideEffects;\n sideEffects = sideEffects instanceof Array ? sideEffects : Object.values(sideEffects);\n sideEffects.forEach((SideEffect) => {\n const formalName = SideEffect.formalName();\n const sideEffectInstance = sideEffectsMap[formalName];\n sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context);\n });\n return sideEffectsMap;\n};\n\nexport const setSideEffectConfig = (sideEffects, config) => {\n for (const key in sideEffects) {\n const sideEffect = sideEffects[key];\n const formalName = sideEffect.constructor.formalName();\n const sideEffectConf = config[formalName];\n\n sideEffectConf && sideEffect.config(sideEffectConf);\n }\n};\n\nexport const initializeBehaviouralActions = (context, actions) => {\n const dispatchableBehaviours = {};\n\n actions = actions instanceof Array ? actions : Object.values(actions);\n actions.forEach((Action) => {\n dispatchableBehaviours[Action.formalName()] = new Action(context);\n });\n return dispatchableBehaviours;\n};\n\nexport const initializePhysicalActions = (context, actions) => {\n const physicalActions = {};\n\n for (const name in actions) {\n if (!({}).hasOwnProperty.call(name, actions)) {\n physicalActions[name] = actions[name](context);\n }\n }\n return physicalActions;\n};\n\nexport const changeSideEffectAvailability = (context, fn, toEnable) => {\n const sideEffects = context.sideEffects();\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n let change = true;\n if (fn && fn(key) === false) {\n change = false;\n }\n if (change) {\n toEnable ? sideEffects[key].enable() : sideEffects[key].disable();\n }\n }\n }\n};\n\nexport const getMergedSet = set => [...new Set([...set[0], ...set[1]])];\n\nexport const getSourceFields = (propagationInf, criteria = {}) => {\n const sourceIdentifiers = propagationInf.sourceIdentifiers;\n let sourceFields;\n if (sourceIdentifiers) {\n sourceFields = sourceIdentifiers.getSchema().map(d => d.name);\n } else if (criteria instanceof Array) {\n sourceFields = criteria[0];\n } else {\n sourceFields = Object.keys(criteria || {});\n }\n return sourceFields;\n};\n\nconst conditionsMap = {\n mergedEnter: [SELECTION.SELECTION_NEW_ENTRY, SELECTION.SELECTION_OLD_ENTRY],\n mergedExit: [SELECTION.SELECTION_NEW_EXIT, SELECTION.SELECTION_OLD_EXIT],\n complete: []\n};\n\nexport const getModelFromSet = (type, model, set) => {\n const conditions = conditionsMap[type];\n if (model && conditions) {\n return model.select((fields, i) =>\n (conditions.some(condition => set[i] === condition)), {\n saveChild: false\n });\n }\n return null;\n};\n\nexport const getSetInfo = (type, set, config) => {\n let model = null;\n const filteredDataModel = config.filteredDataModel;\n const selectionSet = config.selectionSet;\n if (!config.propagationData) {\n if (selectionSet.resetted()) {\n model = null;\n } else if (type === 'mergedEnter') {\n model = getModelFromSet(type, config.dataModel, config.selectionSet._set);\n }\n } else if (filteredDataModel) {\n model = type === 'mergedEnter' ? filteredDataModel[0] : filteredDataModel[1];\n }\n return {\n uids: set,\n length: set.length,\n model\n };\n};\n\nexport const getSideEffects = (behaviour, behaviourEffectMap) => {\n const sideEffects = [];\n for (const key in behaviourEffectMap) {\n const behaviours = key.split(',');\n const found = behaviours.some(d => d === behaviour);\n if (found) {\n sideEffects.push({\n effects: behaviourEffectMap[key],\n behaviours\n });\n }\n }\n return sideEffects;\n};\n\nexport const unionSets = (context, behaviours) => {\n let combinedSet = {};\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n behaviours.forEach((behaviour) => {\n const entryExitSet = context._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const model = entryExitSet[type].model;\n let existingModel = models[type];\n let aggFns = retrieveNearestGroupByReducers(model);\n if (!existingModel) {\n existingModel = models[type] = model;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n aggFns = Object.assign({}, retrieveNearestGroupByReducers(existingModel));\n existingModel = models[type] = model.union(existingModel);\n } else {\n existingModel = model;\n }\n combinedSet[type].model = existingModel;\n combinedSet[type].aggFns = aggFns;\n });\n }\n });\n return combinedSet;\n};\n","import {\n mergeRecursive,\n hasTouch,\n selectElement,\n isSimpleObject\n} from 'muze-utils';\nimport { ALL_ACTIONS } from './enums/actions';\nimport SelectionSet from './selection-set';\nimport {\n initializeBehaviouralActions,\n initializeSideEffects,\n changeSideEffectAvailability,\n initializePhysicalActions,\n unionSets,\n getSideEffects,\n setSideEffectConfig\n} from './helper';\n\n/**\n * This class is responsible for dispatching behavioural actions and side effects. It also keeps the information of\n * registered physical actions, behavioural actions and side effects. Also, it keeps the map of physical and behavioural\n * actions and behavioural actions and side effects. Whenever any behavioural action is dispatched, it also propagates\n * the rows which got affected to the other datamodels. This class is initialized by {@link VisualUnit} and legend to\n * manage it's interaction.\n *\n * @public\n * @class Firebolt\n * @module Firebolt\n */\nexport default class Firebolt {\n constructor (context, actions, sideEffects, behaviourEffectMap) {\n this.context = context;\n this._sideEffectDefinitions = {};\n this._sideEffects = {};\n this._propagationInf = {};\n this._actions = {\n behavioural: {},\n physical: {}\n };\n this._selectionSet = {};\n this._volatileSelectionSet = {};\n this._propagationFields = {};\n this._sourceSideEffects = {};\n this._propagationBehaviourMap = {};\n this._sourceBehaviours = {};\n this._actionBehaviourMap = {};\n this._config = {};\n this._behaviourEffectMap = {};\n this._entryExitSet = {};\n this._actionHistory = {};\n this._queuedSideEffects = {};\n\n this.mapSideEffects(behaviourEffectMap);\n this.registerBehaviouralActions(actions.behavioural);\n this.registerSideEffects(sideEffects);\n this.registerPhysicalBehaviouralMap(actions.physicalBehaviouralMap);\n this.registerPhysicalActions(actions.physical);\n }\n\n config (...config) {\n if (config.length) {\n this._config = mergeRecursive(this._config, config[0]);\n setSideEffectConfig(this.sideEffects(), this._config);\n return this;\n }\n return this._config;\n }\n\n mapSideEffects (behEffectMap) {\n const behaviourEffectMap = this._behaviourEffectMap;\n for (const key in behEffectMap) {\n if ({}.hasOwnProperty.call(behEffectMap, key)) {\n const sideEffects = behEffectMap[key] || [];\n let preventDefaultActions = false;\n let effectNames;\n if (isSimpleObject(sideEffects)) {\n effectNames = sideEffects.effects;\n preventDefaultActions = sideEffects.preventDefaultActions;\n } else {\n effectNames = sideEffects;\n }\n !behaviourEffectMap[key] && (behaviourEffectMap[key] = []);\n this._behaviourEffectMap[key] = [...new Set(preventDefaultActions ? effectNames :\n [...behaviourEffectMap[key], ...effectNames])];\n }\n }\n return this;\n }\n\n registerBehaviouralActions (actions) {\n const behaviours = initializeBehaviouralActions(this, actions);\n this.prepareSelectionSets(behaviours);\n Object.assign(this._actions.behavioural, behaviours);\n return this;\n }\n\n prepareSelectionSets () {\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n return this;\n }\n\n applySideEffects (sideEffects, selectionSet, payload) {\n const sideEffectStore = this.sideEffects();\n const actionHistory = this._actionHistory;\n const queuedSideEffects = this._queuedSideEffects;\n sideEffects.forEach((sideEffect) => {\n let options;\n let name;\n const effects = sideEffect.effects;\n const behaviours = sideEffect.behaviours;\n const combinedSet = unionSets(this, behaviours, selectionSet);\n effects.forEach((effect) => {\n if (typeof effect === 'object') {\n name = effect.name;\n options = effect.options;\n } else {\n name = effect;\n }\n\n const sideEffectInstance = sideEffectStore[name];\n if (sideEffectInstance.isEnabled()) {\n if (!sideEffectInstance.constructor.mutates() &&\n Object.values(actionHistory).some(d => d.isMutableAction)) {\n queuedSideEffects[`${name}-${behaviours.join()}`] = {\n name,\n params: [combinedSet, payload, options]\n };\n } else {\n this.dispatchSideEffect(name, combinedSet, payload, options);\n }\n }\n });\n });\n return this;\n }\n\n dispatchSideEffect (name, selectionSet, payload, options = {}) {\n const sideEffectStore = this.sideEffects();\n const sideEffect = sideEffectStore[name];\n let disable = false;\n if (options.filter && options.filter(sideEffect)) {\n disable = true;\n }\n !disable && sideEffectStore[name].apply(selectionSet, payload, options);\n }\n\n registerPropagationBehaviourMap (map) {\n this._propagationBehaviourMap = Object.assign(this._propagationBehaviourMap, map || {});\n return this;\n }\n\n dispatchBehaviour (behaviour, payload, propagationInfo = {}) {\n const propagate = propagationInfo.propagate !== undefined ? propagationInfo.propagate : true;\n const behaviouralActions = this._actions.behavioural;\n const action = behaviouralActions[behaviour];\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(behaviour, behaviourEffectMap);\n this._propagationInf = propagationInfo;\n\n if (action) {\n const selectionSet = action.dispatch(payload);\n const propagationSelectionSet = this.getPropagationSelectionSet(selectionSet);\n this._entryExitSet[behaviour] = propagationSelectionSet;\n const shouldApplySideEffects = this.shouldApplySideEffects(propagate);\n\n if (propagate) {\n this.propagate(behaviour, payload, selectionSet.find(d => d.sourceSelectionSet), sideEffects);\n }\n if (shouldApplySideEffects) {\n const applicableSideEffects = this.getApplicableSideEffects(sideEffects, payload, propagationInfo);\n this.applySideEffects(applicableSideEffects, propagationSelectionSet, payload);\n }\n }\n\n return this;\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet.find(d => !d.sourceSelectionSet);\n }\n\n shouldApplySideEffects () {\n return true;\n }\n\n changeBehaviourStateOnPropagation (behaviour, value, key = 'default') {\n const behaviourConditions = this._sourceBehaviours[behaviour] || (this._sourceBehaviours[behaviour] = {});\n if (value instanceof Function) {\n behaviourConditions[key] = value;\n } else {\n behaviourConditions[key] = () => value;\n }\n return this;\n }\n\n changeSideEffectStateOnPropagation (sideEffect, value, key = 'default') {\n const sideEffectConditions = this._sourceSideEffects[sideEffect] || (this._sourceSideEffects[sideEffect] = {});\n if (value instanceof Function) {\n sideEffectConditions[key] = value;\n } else {\n sideEffectConditions[key] = () => value;\n }\n }\n\n removeSideEffectPolicy (sideEffect, key) {\n delete this._sourceSideEffects[sideEffect][key];\n return this;\n }\n\n removeBehaviourPolicy (behaviour, key) {\n delete this._sourceBehaviours[behaviour][key];\n return this;\n }\n\n propagate () {\n return this;\n }\n\n sideEffects (...sideEffects) {\n if (sideEffects.length) {\n this._sideEffects = sideEffects[0];\n return this;\n }\n return this._sideEffects;\n }\n\n enableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, true);\n return this;\n }\n\n disableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, false);\n return this;\n }\n\n dissociateBehaviour (behaviour, physicalAction) {\n const actionBehaviourMap = this._actionBehaviourMap;\n for (const key in actionBehaviourMap) {\n if (key === physicalAction) {\n const behaviourMap = actionBehaviourMap[key];\n behaviourMap.behaviours = behaviourMap.behaviours.filter(d => d !== behaviour);\n this.mapActionsAndBehaviour(key);\n }\n }\n\n return this;\n }\n\n dissociateSideEffect (sideEffect, behaviour) {\n const behaviourEffectMap = this._behaviourEffectMap;\n behaviourEffectMap[behaviour] = behaviourEffectMap[behaviour].filter(d => (d.name || d) !== sideEffect);\n return this;\n }\n\n getApplicableSideEffects (sideEffects) {\n return sideEffects;\n }\n\n attachPropagationListener (dataModel) {\n dataModel.unsubscribe('propagation');\n dataModel.on('propagation', this.onDataModelPropagation());\n return this;\n }\n\n onDataModelPropagation () {\n return (propValue) => {\n const payload = propValue.payload;\n const action = payload.action;\n\n this.dispatchBehaviour(action, payload, {\n propagate: false\n });\n };\n }\n\n createSelectionSet (uniqueIds, behaviouralActions) {\n const behaviours = behaviouralActions || this._actions.behavioural;\n const selectionSet = this._selectionSet;\n const volatileSelectionSet = this._volatileSelectionSet;\n\n for (const key in behaviours) {\n if ({}.hasOwnProperty.call(behaviours, key)) {\n selectionSet[key] = new SelectionSet(uniqueIds);\n volatileSelectionSet[key] = new SelectionSet(uniqueIds, true);\n this._entryExitSet[key] = null;\n }\n }\n this._volatileSelectionSet = volatileSelectionSet;\n this.selectionSet(selectionSet);\n return this;\n }\n\n selectionSet (...selectionSet) {\n if (selectionSet.length) {\n this._selectionSet = selectionSet[0];\n return this;\n }\n return this._selectionSet;\n }\n\n initializeSideEffects () {\n const sideEffectDefinitions = this._sideEffectDefinitions;\n this.sideEffects(initializeSideEffects(this, sideEffectDefinitions));\n return this;\n }\n\n registerPhysicalActions (actions) {\n const initedActions = initializePhysicalActions(this, actions);\n Object.assign(this._actions.physical, initedActions);\n return this;\n }\n\n /**\n * Allows to propagate the datamodel with only the supplied fields. When propagation is done, then the fields\n * which are supplied for the specified behavioural action is propagated.\n *\n * @public\n *\n * @param {string} action Name of behavioural action. If '*' is specified, then for all behavioural actions it is\n * applied.\n * @param {Array} fields Array of field names which will be propagated.\n * @param {boolean} append If true, then it is appended to the existing propagation data model fields else only\n * those fields are projected from propagation data model and propagated.\n *\n * @return {Firebolt} Instance of firebolt\n */\n propagateWith (action, fields, append = false) {\n const behaviouralActions = this._actions.behavioural;\n if (action === ALL_ACTIONS) {\n for (const key in behaviouralActions) {\n this._propagationFields[key] = {\n fields,\n append\n };\n }\n } else {\n this._propagationFields[action] = {\n fields,\n append\n };\n }\n return this;\n }\n\n /**\n * Map actions and behaviours\n * @return {Firebolt} Firebolt instance\n */\n mapActionsAndBehaviour (phyAction) {\n const initedPhysicalActions = this._actions.physical;\n const map = this._actionBehaviourMap;\n\n for (const action in map) {\n if (!({}).hasOwnProperty.call(action, map) && action === (phyAction || action)) {\n let target;\n const mapObj = map[action];\n target = mapObj.target;\n const touch = mapObj.touch;\n if (!target) {\n target = this.context.getDefaultTargetContainer();\n }\n const bind = hasTouch() ? touch === true || touch === undefined : !touch;\n bind && this.bindActionWithBehaviour(initedPhysicalActions[action],\n target, mapObj.behaviours);\n }\n }\n return this;\n }\n\n registerPhysicalBehaviouralMap (map) {\n this._actionBehaviourMap = mergeRecursive(this._actionBehaviourMap, map);\n return this;\n }\n\n /**\n * Binds a target element with an action.\n *\n * @param {Function} action Action method\n * @param {string} target Class name of element\n * @param {Array} behaviourList Array of behaviours\n * @return {FireBolt} Instance of firebolt\n */\n bindActionWithBehaviour (action, targets, behaviourList) {\n if (typeof (targets) === 'string') {\n targets = [targets];\n }\n targets.forEach((target) => {\n const mount = this.context.mount();\n const nodes = target.node instanceof Function ? target : selectElement(mount).selectAll(target);\n if (!nodes.empty()) {\n if (nodes instanceof Array) {\n nodes.forEach((node) => {\n action(selectElement(node), behaviourList);\n });\n } else {\n action(nodes, behaviourList);\n }\n }\n });\n return this;\n }\n\n getPropagationInf () {\n return this._propagationInf;\n }\n\n getAddSetFromCriteria (criteria, propagationInf = {}) {\n const context = this.context;\n const filteredDataModel = propagationInf.data ? propagationInf.data :\n context.getDataModelFromIdentifiers(criteria, 'all');\n return {\n model: filteredDataModel,\n uids: criteria === null ? null : (propagationInf.data ? propagationInf.entryRowIds :\n filteredDataModel[0].getUids())\n };\n }\n\n getSelectionSets (action) {\n const sourceId = this.context.id();\n const propagationInf = this._propagationInf || {};\n const propagationSource = propagationInf.sourceId;\n let applicableSelectionSets = [];\n if (propagationSource !== sourceId) {\n applicableSelectionSets = [this._volatileSelectionSet[action]];\n }\n\n if (propagationSource) {\n applicableSelectionSets.push(this.selectionSet()[action]);\n }\n return applicableSelectionSets;\n }\n\n getFullData () {\n return this.context.data();\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Returns the entry and exit set information of the specified behavioural action.\n *\n * @public\n *\n * @param {string} behaviour Name of behavioural action.\n *\n * @return {Object} Entry exit set information.\n */\n getEntryExitSet (behaviour) {\n return this._entryExitSet[behaviour];\n }\n}\n","import { getSetInfo, getMergedSet, getSourceFields } from '../../helper';\n\n/**\n * This is the base class has all the common functionalities needed for all behavioural actions. Any other behavioural\n * action needs to extend this class.\n *\n * @public\n * @class GenericBehaviour\n * @module GenericBehaviour\n */\nexport default class GenericBehaviour {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n }\n\n /**\n * Returns entry and exit set information. This method is called by firebolt when ```dispatchBehaviour``` is called\n * dynamically or when any physical action is triggered on the chart.\n *\n * @param {Object} payload Payload information.\n * @param {Object|Array} payload.criteria Identifiers of data interacted with.\n *\n * @return {Array} Entry and exit set information.\n */\n dispatch (payload) {\n const criteria = payload.criteria;\n const firebolt = this.firebolt;\n const formalName = this.constructor.formalName();\n const selectionSets = firebolt.getSelectionSets(formalName);\n const {\n model: filteredDataModel,\n uids\n } = this.firebolt.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf());\n const entryExitSets = selectionSets.map((selectionSet) => {\n this.setSelectionSet(uids, selectionSet);\n return this.getEntryExitSet(selectionSet, filteredDataModel, payload);\n });\n\n return entryExitSets;\n }\n\n /**\n * Updates the selection set by adding uids to the instance of {@link SelectionSet} or removing them.\n * {@link SelectionSet} keeps the information of which rows are in the entry set and exit set.\n *\n * @public\n * @param {Array} addSet Array of row ids which got affected during interaction.\n * @param {SelectionSet} selectionSet Instance of selection set.\n *\n * @return {GenericBehaviour} Instance of behaviour.\n */\n setSelectionSet () {\n return this;\n }\n\n getEntryExitSet (selectionSet, filteredDataModel, payload) {\n const {\n entrySet,\n exitSet,\n completeSet\n } = selectionSet.getSets();\n const propagationInf = this.firebolt.getPropagationInf();\n const dataModel = this.firebolt.getFullData();\n const setConfig = {\n dataModel,\n filteredDataModel,\n propagationData: propagationInf.data,\n selectionSet\n };\n\n return {\n entrySet: [getSetInfo('oldEntry', entrySet[0], setConfig),\n getSetInfo('newEntry', entrySet[1], setConfig)],\n exitSet: [getSetInfo('oldEntry', exitSet[0], setConfig),\n getSetInfo('newExit', exitSet[1], setConfig)],\n mergedEnter: getSetInfo('mergedEnter', getMergedSet(entrySet), setConfig),\n mergedExit: getSetInfo('mergedExit', getMergedSet(exitSet), setConfig),\n completeSet: getSetInfo('complete', completeSet, setConfig),\n fields: getSourceFields(propagationInf, payload.criteria),\n sourceSelectionSet: selectionSet._volatile === true\n };\n }\n\n static mutates () {\n return false;\n }\n\n enable () {\n this._enabled = true;\n }\n\n disable () {\n this._enabled = false;\n }\n\n isEnabled () {\n return this._enabled;\n }\n}\n\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class VolatileBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets();\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n","import VolatileBehaviour from './volatile';\nimport { HIGHLIGHT } from '../../enums/behaviours';\n\nexport default class HighlightBehaviour extends VolatileBehaviour {\n static formalName () {\n return HIGHLIGHT;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport * as BEHAVIOURNAMES from '../../enums/behaviours';\n\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class BrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BEHAVIOURNAMES.BRUSH;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport { FILTER } from '../../enums/behaviours';\n\nexport default class FilterBehaviour extends VolatileBehaviour {\n static formalName () {\n return FILTER;\n }\n\n static mutates () {\n return true;\n }\n}\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class PersistentBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.propagate === false) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets();\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n // existing add set\n if (existingAddSet.length) {\n selectionSet.updateExit();\n selectionSet.remove(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n const { exitSet } = selectionSet.getSets();\n const mergedExitSet = getMergedSet(exitSet);\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n\n return this;\n }\n}\n","import PersistentBehaviour from './persistent';\nimport { SELECT } from '../../enums/behaviours';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return SELECT;\n }\n}\n\n","import { DimensionSubtype, MeasureSubtype } from 'muze-utils';\n/**\n * Gets the drag action configuration\n * @param {VisualUnit} instance instance of visual unit\n * @param {Object} config x y positions\n * @return {Object} Payload of behaviour\n*/\n/* istanbul ignore next */ const getDragActionConfig = (sourceInfo, config, fieldsConfig) => {\n if (!(sourceInfo.axes.x || sourceInfo.axes.y)) {\n return {\n criteria: null\n };\n }\n\n const axes = sourceInfo.axes;\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const axisFields = sourceInfo.fields;\n const xField = axisFields.x[0].getMembers()[0];\n const yField = axisFields.y[0].getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n const dimensions = {};\n const stPos = config.startPos;\n const endPos = config.endPos;\n\n if (stPos.x === endPos.x && stPos.y === endPos.y) {\n return {\n criteria: null\n };\n }\n\n const dragDim = xFieldType === MeasureSubtype.CONTINUOUS ? (yFieldType === MeasureSubtype.CONTINUOUS ?\n ['x', 'y'] : ['y']) : ['x'];\n const criteria = {};\n const isXDimension = xFieldType === DimensionSubtype.CATEGORICAL;\n const isYDimension = yFieldType === DimensionSubtype.CATEGORICAL;\n const xRange = xAxis.invertExtent(stPos.x, endPos.x);\n const yRange = yAxis.invertExtent(stPos.y, endPos.y);\n const selectedDomains = {\n x: stPos.x === endPos.x ? [] : (isXDimension ? xRange : xRange.sort((a, b) => a - b)),\n y: stPos.y === endPos.y ? [] : (isYDimension ? yRange : yRange.sort((a, b) => a - b))\n };\n const rangeObj = {};\n\n if (dragDim.length === 2) {\n rangeObj[xField] = selectedDomains.x;\n rangeObj[yField] = selectedDomains.y;\n if (xField === yField) {\n const xdom = selectedDomains.x;\n const ydom = selectedDomains.y;\n const min = xdom[0] > ydom[0] ? ydom : xdom;\n const max = min === ydom ? xdom : ydom;\n if (min[1] < max[0]) {\n rangeObj[xField] = [];\n } else {\n rangeObj[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]];\n }\n dimensions.x = [stPos.x, endPos.x];\n dimensions.y = [stPos.y, endPos.y];\n }\n } else {\n criteria[dragDim[0]] = selectedDomains[dragDim[0]] || [];\n\n if (dragDim[0] === 'x') {\n rangeObj[xField] = criteria.x;\n if (xFieldType === DimensionSubtype.CATEGORICAL) {\n dimensions.x = (config.snap && stPos.x !== endPos.x) ? xAxis.getNearestRange(stPos.x, endPos.x) :\n [stPos.x, endPos.x];\n }\n } else {\n rangeObj[yField] = criteria.y;\n if (yFieldType === DimensionSubtype.CATEGORICAL) {\n dimensions.y = (config.snap && stPos.y !== endPos.y) ? yAxis.getNearestRange(stPos.y, endPos.y) :\n [stPos.y, endPos.y];\n }\n }\n }\n\n return {\n criteria: rangeObj,\n dimensions\n };\n};\n\nexport default getDragActionConfig;\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './drag-action-config';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const attachDragEvent = (targetEl, behaviours, firebolt, touch) => {\n let startPos = {};\n let endPos = {};\n let drawingInf;\n\n const d3Drag = getD3Drag();\n let touchStart;\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n drawingInf = firebolt.context.getDrawingContext();\n touchStart = new Date().getTime();\n }).on('drag', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n if (touch && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n\n const payload = getDragActionConfig(firebolt.context.getSourceInfo(), {\n startPos,\n endPos\n }, firebolt.context.data().getFieldsConfig());\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n }).on('end', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n const duration = new Date().getTime() - touchStart;\n\n if (touch && duration > 100 && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n\n const payload = getDragActionConfig(firebolt.context.getSourceInfo(), {\n startPos,\n endPos,\n snap: true\n }, firebolt.context.data().getFieldsConfig());\n payload.dragEnd = true;\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n }));\n};\n\n","import { getClientPoint, getEvent } from 'muze-utils';\nimport { CONSOLIDATED, FRAGMENTED } from '../../enums/constants';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} instance instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const context = firebolt.context;\n const tooltipConf = context.config().interaction.tooltip;\n const mode = tooltipConf.mode;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n getAllPoints: mode === CONSOLIDATED || mode === FRAGMENTED,\n data: args,\n event\n });\n const payload = {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos,\n mode\n };\n\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, {\n criteria: null\n }));\n });\n};\n\nexport default hover;\n","export const CLASSPREFIX = 'muze';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\n\n","import { getClientPoint } from 'muze-utils';\n\nexport const generatePayloadFromEvent = function (args, event, firebolt) {\n const context = firebolt.context;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event.touches ? event.touches[0] : event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n data: args,\n event\n });\n return {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos\n };\n};\n","import { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = generatePayloadFromEvent(args, event, firebolt);\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport { longtouch } from './longtouch';\nimport { touchdrag } from './touch-drag';\nimport * as ACTIONNAMES from '../../enums/actions';\nimport click from './click';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click,\n [ACTIONNAMES.LONGTOUCH]: longtouch,\n [ACTIONNAMES.TOUCHDRAG]: touchdrag\n};\n\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt);\n};\n\nexport default drag;\n","/* global setTimeout */\nimport { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nexport const longtouch = firebolt => (targetEl, behaviours) => {\n let event;\n let touchEnd;\n const dispatchBehaviour = function (args) {\n const payload = generatePayloadFromEvent(args, event, firebolt);\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n touchEnd = false;\n event = getEvent();\n targetEl.on('touchstart', (args) => {\n event = getEvent();\n touchEnd = false;\n setTimeout(() => {\n if (!touchEnd) {\n dispatchBehaviour(args);\n } else {\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, {\n criteria: null\n }));\n }\n }, 100);\n }).on('touchend', () => {\n touchEnd = true;\n });\n};\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const touchdrag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt, true);\n};\n\n","const ANCHORS = 'anchors';\nconst TOOLTIP = 'tooltip';\nconst BRUSH_ANCHORS = 'brush-anchors';\nconst PERSISTENT_ANCHORS = 'persistent-anchors';\nconst FILTER = 'filter';\nconst HIGHLIGHTER = 'highlighter';\nconst CROSSLINE = 'crossline';\n\nexport {\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS,\n FILTER,\n HIGHLIGHTER,\n CROSSLINE,\n TOOLTIP\n};\n","export const PROPS = {\n valueParser: {\n defaultValue: val => val\n }\n};\n","import GenericSideEffect from './generic-sideeffect';\n\nexport default GenericSideEffect;\n","import { mergeRecursive, getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { PROPS } from './props';\n\n/**\n * This is the base class of all side effects. It contains all common methods like setting configuration, disabling,\n * enabling side effect, etc. Every new side effect has to inherit this class or {@link SpawnableSideEffect} or\n * {@link SurrogateSideEffect} class. All side effects are initialized by firebolt. The instance of firebolt is\n * passed on initialization. The firebolt instance contains ```context``` which is the instance of visual unit with\n * which the firebolt is attached.\n *\n * @public\n * @class\n * @module GenericSideEffect\n */\nexport default class GenericSideEffect {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n this._strategy = 'default';\n this._config = {};\n this._id = getUniqueId();\n this._strategies = {};\n generateGetterSetters(this, PROPS);\n this.config(this.constructor.defaultConfig());\n }\n\n /**\n * Returns the default configuration of the side effect.\n *\n * @public\n * @return {Object} Default configuration of side effect.\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the formal name of a side effect. This method must be implemented by all side effects which changes\n * or adds any element in the visualization.\n *\n * @return {string} Formal name of side effect.\n */\n static formalName () {\n return 'generic';\n }\n\n static target () {\n return 'all';\n }\n\n /**\n * Returns true if the side effects mutates the data of chart.\n *\n * @public\n *\n * @return {boolean} If the side effect mutates the data of chart.\n */\n static mutates () {\n return false;\n }\n\n /**\n * Sets or gets the configuration of side effect.\n *\n * When setter,\n * @param {Object} config Configuration of side effect.\n * @return {GenericSideEffect} Side effect instance.\n *\n * When getter,\n * @return {Object} Side effect configuration.\n */\n config (...params) {\n if (params.length) {\n this._config = mergeRecursive(this._config, params[0]);\n return this;\n }\n return this._config;\n }\n\n disable () {\n this._enabled = false;\n return this;\n }\n\n enable () {\n this._enabled = true;\n return this;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n /**\n * Applies the interaction effect on the chart. This is where the implemntation of the side effect is defined.\n *\n * @param {Object} selectionSet Contains the entry and exit set of data which got affected during interaction.\n * @param {Object} selectionSet.mergedEnter Combined previous entry and new entry set.\n * @param {DataModel} selectionSet.mergedEnter.model Instance of data model containing all rows which got\n * affected during interaction.\n * @param {Array} selectionSet.mergedEnter.uids Ids of all rows which were affected during interaction.\n * @param {Object} selectionSet.mergedExit Combined previous exit and new exit set.\n * @param {DataModel} selectionSet.mergedExit.model Instance of data model containing rows which were not affected\n * during interaction.\n * @param {Array} selectionSet.mergedExit.uids Ids of all rows which were not affected during interaction.\n * @param {Object} selectionSet.entrySet Entry set information.\n * @param {Array} selectionSet.entrySet[0].uids All row ids which got affected during previous interaction.\n * @param {Array} selectionSet.entrySet[1].uids All row ids which got affected during current interaction.\n * @param {Array} selectionSet.exitSet[0].uids All row ids which were not affected during previous interaction.\n * @param {Array} selectionSet.exitSet[1].uids All row ids which were not affected during current interaction.\n * @param {Object} payload Payload information of the behavioural action on trigger of which this side effect\n * is applied.\n * @param {Object} options Optional information for side effect like strategy, etc.\n */\n apply () {\n return this;\n }\n\n /**\n * Adds a new strategy method for this side effect. The strategy method is implemented by side effect class.\n *\n * @param {string} name Name of the strategy.\n * @param {Function} fn Strategy method.\n *\n * @return {GenericSideEffect} Instance of side effect.\n */\n setStrategy (name, fn) {\n if (fn) {\n this._strategies[name] = fn;\n }\n return this;\n }\n}\n","import GenericSideEffect from './generic';\n\n/**\n * This class is inherited by all side effects which changes the look of any existing elements in the visualization.\n * For example, if a side effect wants to change the color of bar plots, then it is a surrogate side effect.\n *\n * To use this,\n * ```\n * const SurrogateSideEffect = muze.SideEffects.standards.SurrogateSideEffect;\n *\n * class BarColorChanger extends SurrogateSideEffect {\n * static formalName () {\n * return 'colorChanger';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n *\n * @module SurrogateSideEffect\n * @class\n * @extends GenericSideEffect\n */\nexport default class SurrogateSideEffect extends GenericSideEffect {\n /**\n * Applies or removes interaction styles from plot elements. An array of row ids needs to be passed\n * which identifies the plot elements and applies styles to them.\n *\n * To apply the interaction style,\n * ```\n * const entryRowIds = entrySet[0].uids;\n * const interactionStyle = [{\n * type: 'fill',\n * intensity: [0, 0, 15, 0] // hsla configuration\n * }];\n *\n * this.applyInteractionStyle(entryRowIds, interactionStyle, 'brighten', true);\n * ```\n * @public\n * @param {Array} set Array of row ids.\n * @param {Array} config Style configuration.\n * @param {Object} config[0] fill or stroke configuration.\n * @param {string} config[0].type Type of style - fill or stroke.\n * @param {Array} config[0].intensity hsla configuration.\n * @param {string} interactionType Type of interaction. This is needed for storing the styles for\n * each type of interaction in the plot elements.\n * @param {boolean} apply Whether to apply or remove the interaction style.\n *\n * @return {SurrogateSideEffect} Instance of surrogate side effect.\n */\n applyInteractionStyle (set, config = {}, interactionType, apply) {\n const layers = this.firebolt.context.layers();\n layers.forEach(layer => layer.config().interactive !== false &&\n layer.applyInteractionStyle(interactionType, set.uids, apply));\n return this;\n }\n}\n","import { makeElement } from 'muze-utils';\n\nimport GenericSideEffect from './generic';\n\n/**\n * Any side effect which will add any new element to the chart like drawing a rectangular box or any annotation over\n * the chart needs to inherit this class. This class has methods which returns the container where the dom elements\n * needs to be created.\n *\n * To use this,\n * ```\n * const SpawnableSideEffect = muze.SideEffects.standards.SpawnableSideEffect;\n *\n * class SelectionBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'selectionBox';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n * @class\n * @extends GenericSideEffect\n * @module SpawnableSideEffect\n */\nexport default class SpawnableSideEffect extends GenericSideEffect {\n /**\n * Creates a html or svg element in the container.\n *\n * @public\n * @param {SVGElement|HTMLElement} container Container where the dom element will be rendered.\n * @param {string} elemType Type of dom element.\n * @param {Array} data Array of objects with which the dom elements will be binded.\n * @param {string} className class name of the element.\n *\n * @return {Selection} D3 Selection of the element.\n */\n createElement (container, elemType, data, className, callbacks) {\n return makeElement(container, elemType, data, className, callbacks);\n }\n\n /**\n * Returns the drawing information for side effect like svg container, dimensions of the visual unit.\n *\n * @public\n * @return {Object} Drawing information for side effect.\n * ```\n * sideEffectGroup: // svg container where the side effect needs to be appended.\n * svgContainer: // svg container of the {@link VisualUnit}.\n * htmlContainer: // html div container of the {@link VisualUnit}.\n * width: // Width of the {@link VisualUnit}\n * height: // Height of the {@link VisualUnit}\n * ```\n */\n drawingContext (...drawingContext) {\n if (drawingContext.length) {\n this._drawingContext = drawingContext[0];\n return this;\n }\n return this._drawingContext();\n }\n\n show () {\n return this;\n }\n\n hide () {\n return this;\n }\n}\n","import { selectElement } from 'muze-utils';\n\nexport const getBoxDimensionsFromPayload = (payload, axes, axisFields) => {\n let x1;\n let x2;\n let y1;\n let y2;\n let xRange;\n let yRange;\n let direction;\n const criteria = payload.criteria;\n const dimensions = payload.dimensions || {};\n const xDim = dimensions.x;\n const yDim = dimensions.y;\n\n if (criteria === null) {\n return null;\n }\n\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const xLinear = xAxis.constructor.type() === 'linear';\n const yLinear = yAxis.constructor.type() === 'linear';\n const xField = `${axisFields.x[0]}`;\n const yField = `${axisFields.y[0]}`;\n const xCriteria = criteria[xField];\n const yCriteria = criteria[yField];\n\n if (xCriteria && xCriteria[0] instanceof Array) {\n xRange = xCriteria[0];\n yRange = xCriteria[1];\n } else {\n xRange = xCriteria || [];\n yRange = yCriteria || [];\n }\n direction = xCriteria && yCriteria ? 'both' : (xCriteria ? 'vertical' : 'horizontal');\n if (xRange && xRange.length) {\n if ((yAxis.constructor.type() === 'band' && xLinear)) {\n x1 = x2 = undefined;\n direction = 'horizontal';\n } else {\n const domain = xAxis.domain();\n const bandScale = xAxis.constructor.type() === 'band';\n let x1Val;\n let x2Val;\n if (bandScale) {\n let x1DomainIndex = domain.indexOf(xRange[0]);\n let x2DomainIndex = domain.indexOf(xRange[xRange.length - 1]);\n [x1DomainIndex, x2DomainIndex] = [x1DomainIndex, x2DomainIndex].sort((a, b) => a - b);\n x1Val = domain[x1DomainIndex];\n x2Val = domain[x2DomainIndex];\n } else {\n x1Val = xRange[0];\n x2Val = xRange[xRange.length - 1];\n }\n x1 = xAxis.getScaleValue(x1Val);\n x2 = xAxis.getScaleValue(x2Val);\n x2 += bandScale ? xAxis.getUnitWidth() : 0;\n }\n } else {\n x1 = x2 = undefined;\n }\n if (yRange && yRange.length) {\n if ((xAxis.constructor.type() === 'band' && yLinear)) {\n y1 = y2 = undefined;\n direction = 'vertical';\n } else {\n const domain = yAxis.domain();\n const bandScale = yAxis.constructor.type() === 'band';\n let y1Val;\n let y2Val;\n if (bandScale) {\n let y1DomainIndex = domain.indexOf(yRange[0]);\n let y2DomainIndex = domain.indexOf(yRange[yRange.length - 1]);\n [y1DomainIndex, y2DomainIndex] = [y1DomainIndex, y2DomainIndex].sort(((a, b) => b - a));\n y1Val = domain[y1DomainIndex];\n y2Val = domain[y2DomainIndex];\n } else {\n y1Val = yRange[0];\n y2Val = yRange[yRange.length - 1];\n }\n y1 = yAxis.getScaleValue(y1Val);\n y2 = yAxis.getScaleValue(y2Val);\n y2 += yAxis.constructor.type() === 'band' ? yAxis.getUnitWidth() : 0;\n }\n } else {\n y1 = y2 = undefined;\n }\n\n if ((yLinear && xLinear) || !payload.dragEnd) {\n if (xDim) {\n [x1, x2] = xDim;\n }\n if (yDim) {\n [y1, y2] = yDim;\n }\n }\n\n return {\n dimension: {\n x1,\n x2,\n y1,\n y2\n },\n direction\n };\n};\n\nexport const changeVisibility = (context, sideEffectGroup, visible) => {\n const config = context.config();\n const className = config.defClassName;\n const classPrefix = config.classPrefix;\n selectElement(sideEffectGroup).selectAll(`.${classPrefix}-${className}`)\n .style('display', visible ? 'block' : 'none');\n};\n","import {\n getQualifiedClassName,\n selectElement,\n makeElement,\n isValidValue\n} from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport './styles.scss';\nimport SpawnableSideEffect from '../spawnable';\nimport { selectionBoxDrag } from '../../actions/physical/selection-box-drag';\nimport { getBoxDimensionsFromPayload, changeVisibility } from './helper';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\nclass SelectionBox extends SpawnableSideEffect {\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n defClassName: 'selection-box-group',\n className: '',\n classPrefix: CLASSPREFIX,\n box: {\n defClassName: 'selection-box',\n className: ''\n },\n transition: {\n duration: 200\n }\n };\n }\n\n static formalName () {\n return 'selectionBox';\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n * @param {Object} dimension Dimensions of the selection box.\n * @param {number} dimension.x1 Starting x position\n * @param {number} dimension.x2 Ending x position\n * @param {number} dimension.y1 Starting y position\n * @param {number} dimension.y2 Ending y position\n * @param {Object} conf Configuration needed to draw the selection box\n * @param {number} unitWidth Width of the visual unit.\n * @param {number} unitHeight Height of the visual unit.\n */\n apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const config = this._config;\n const boxConf = config.box;\n const firebolt = this.firebolt;\n const drawingInf = this.drawingContext();\n const mountPoint = drawingInf.sideEffectGroup;\n const unitWidth = drawingInf.width;\n const unitHeight = drawingInf.height;\n const classPrefix = config.classPrefix;\n const selectionGroupClassName = config.defClassName;\n\n if (payload.criteria === null) {\n this.hide(drawingInf);\n return this;\n }\n\n const sourceInf = firebolt.context.getSourceInfo();\n const { dimension, direction } = getBoxDimensionsFromPayload(payload, sourceInf.axes,\n sourceInf.fields);\n const transition = payload.dragEnd && config.transition;\n\n if (direction === 'both' || direction === 'vertical') {\n x = Math.min(dimension.x1, dimension.x2);\n width = Math.abs(dimension.x2 - dimension.x1);\n } else {\n x = 0;\n width = unitWidth;\n }\n if (direction === 'both' || direction === 'horizontal') {\n y = Math.min(dimension.y1, dimension.y2);\n height = Math.abs(dimension.y2 - dimension.y1);\n } else {\n height = unitHeight;\n y = 0;\n }\n this.show(drawingInf);\n // Create the data array for drawing the rectangle\n const points = [\n {\n x,\n y,\n width,\n height\n }\n ];\n // Create the container group for selection box.\n const selectionGroup = makeElement(selectElement(mountPoint), 'g', [1],\n `.${classPrefix}-${selectionGroupClassName}`);\n const sideEffect = this;\n const selection = selectionGroup.selectAll('rect').data(points);\n const selectionBox = selection.enter().append('rect')\n .each(function () {\n selectionBoxDrag(firebolt)(selectElement(this), ['brush'], sideEffect);\n })\n .merge(selection)\n .each(function (attrs) {\n let element = selectElement(this);\n transition && (element = element.transition().duration(transition.duration));\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n isValidValue(attrs[key]) && element.attr(key, attrs[key]);\n }\n }\n });\n // Get the qualified class name for selection box rectangle\n const boxClassName = getQualifiedClassName(boxConf.defClassName, this._id, classPrefix);\n selectionBox.classed(boxClassName.join(' '), true);\n selectionBox.classed(boxConf.className, true);\n\n return this;\n }\n\n hide (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, false);\n }\n\n show (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, true);\n }\n}\n\nexport default SelectionBox;\n\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './helpers/drag-action-config';\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let subject;\n let drawingInf;\n const context = firebolt.context;\n const onDrag = (payload) => {\n behaviours.forEach(action => firebolt.dispatchBehaviour(action, payload));\n };\n const d3Drag = getD3Drag();\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n drawingInf = context.getDrawingContext();\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n subject.x += event.dx;\n subject.y += event.dy;\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(context.getSourceInfo(), {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n }, context.data().getFieldsConfig());\n onDrag(payload);\n }\n }).on('end', () => {\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(context.getSourceInfo(), {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n },\n snap: true\n }, context.data().getFieldsConfig());\n payload.dragEnd = true;\n onDrag(payload);\n }\n }));\n};\n","export const CLASSPREFIX = 'muze';\nexport const ARROW_RIGHT = 'right';\nexport const ARROW_TOP = 'top';\nexport const ARROW_BOTTOM = 'bottom';\nexport const ARROW_LEFT = 'left';\nexport const TOOLTIP_LEFT = 'left';\nexport const TOOLTIP_RIGHT = 'right';\nexport const TOOLTIP_BOTTOM = 'bottom';\nexport const TOOLTIP_TOP = 'top';\nexport const INITIAL_STYLE = {\n position: 'absolute',\n width: 0,\n height: 0\n};\nexport const TABLE_FORMAT = 'table';\n","import { CLASSPREFIX } from './constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'tooltip-box',\n connectorClassName: 'tooltip-connectors',\n className: '',\n row: {\n margin: 0\n },\n content: {\n spacing: 5,\n iconContainerSize: 10,\n iconScale: 1,\n iconShape: 'circle',\n iconColor: '#ff0000',\n rowMargin: '4px 0 4px 0',\n margin: 10,\n separator: ':',\n className: 'tooltip-content-container',\n parentClassName: 'tooltip-content-parent-container'\n },\n arrow: {\n size: 10,\n disabled: false,\n defClassName: 'tooltip-arrow',\n className: '',\n color: 'rgba(195,195,195,0.85)'\n }\n};\n","import { getQualifiedClassName } from 'muze-utils';\nimport { TOOLTIP_LEFT, TOOLTIP_RIGHT, ARROW_RIGHT, ARROW_LEFT, TOOLTIP_BOTTOM } from './constants';\n\nexport const getArrowPos = (orient, dim, measurement, config) => {\n let arrowPos;\n const { x, y, boxHeight, boxWidth } = measurement;\n const arrowDisabled = config.arrow.disabled;\n const arrowWidth = arrowDisabled ? 0 : config.arrow.size;\n\n if (orient === ARROW_LEFT || orient === ARROW_RIGHT) {\n let start = 0;\n let diff = boxHeight / 2;\n const plotBottom = dim.y + dim.height;\n const boxBottom = y + boxHeight;\n\n if (dim.y > y) {\n start = dim.y - y;\n diff = (plotBottom >= boxBottom ? (boxBottom - dim.y) : dim.height) / 2;\n } else if (boxBottom > plotBottom) {\n diff = Math.abs(y - (dim.y + dim.height)) / 2;\n }\n arrowPos = start + diff - arrowWidth / 2;\n } else {\n let start = 0;\n let diff = boxWidth / 2;\n const plotRight = dim.x + dim.width;\n const boxRight = x + boxWidth;\n\n if (dim.x > x) {\n start = dim.x - x;\n diff = (plotRight >= boxRight ? (boxRight - dim.x) : dim.width) / 2;\n } else if (boxRight > plotRight) {\n diff = Math.abs(x - (dim.x + dim.width)) / 2;\n }\n arrowPos = start + diff - arrowWidth / 2;\n }\n return arrowPos;\n};\n\n/**\n * Places the arrow in the specified arrow position. It also applies appropriate arrow\n * class name to the arrow element.\n * @param {string} position Left, bottom or right position of the arrow;\n * @param {number} arrowPos position of arrow in pixels\n * @return {Tooltip} Instance of tooltip.\n */\nexport const placeArrow = (context, position, arrowPos) => {\n const tooltipArrow = context._tooltipArrow;\n const tooltipBackground = context._tooltipBackground;\n const config = context._config;\n const classPrefix = config.classPrefix;\n const arrowConf = config.arrow;\n const className = getQualifiedClassName(arrowConf.defClassName, context._id, config.classPrefix);\n\n tooltipArrow.style('display', 'block');\n tooltipArrow.attr('class', `${className.join(' ')}`);\n if (position === TOOLTIP_LEFT || position === TOOLTIP_RIGHT) {\n tooltipArrow.style('top', `${arrowPos}px`);\n tooltipArrow.style('left', '');\n tooltipBackground.style('top', `${arrowPos}px`);\n tooltipBackground.style('left', '');\n } else {\n position === TOOLTIP_BOTTOM ? tooltipArrow.style('top', '100%') : tooltipArrow.style('top',\n `-${arrowConf.size}px`);\n tooltipArrow.style('left', `${arrowPos}px`);\n position === TOOLTIP_BOTTOM ? tooltipBackground.style('top', '100%') : tooltipBackground.style('top',\n `-${arrowConf.size + 3}px`);\n tooltipBackground.style('left', `${arrowPos}px`);\n }\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow`, true);\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${context._arrowOrientation}`, false);\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${position}`, true);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow`, true);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${context._arrowOrientation}`, false);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${position}`, true);\n return this;\n};\n\nexport const reorderContainers = (parentContainer, className) => {\n parentContainer.selectAll(className).sort((a, b) => a - b);\n};\n","import {\n selectElement,\n mergeRecursive,\n makeElement,\n setAttrs,\n setStyles,\n getSymbol,\n isSimpleObject\n} from 'muze-utils';\nimport { TABLE_FORMAT } from './constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class is used to manage the content of tooltip.\n */\nexport default class Content {\n /**\n * Creates an instance of content.\n */\n constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n const config = defaultConfig.content;\n config.classPrefix = defaultConfig.classPrefix;\n return config;\n }\n\n config (...c) {\n if (c.length > 0) {\n this._config = mergeRecursive(this._config, c[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Update model. The format contains presentation strategy which determines how to show the content.\n * If no strategy is mentioned then default is to show key value pair\n */\n update (item) {\n this._model = item.model;\n this._formatter = item.formatter;\n return this;\n }\n\n context (ctx) {\n this._context = ctx;\n return this;\n }\n\n render (mount) {\n let data;\n const config = this._config;\n const iconContainerSize = config.iconContainerSize;\n const formatter = this._formatter;\n const rowMargin = config.rowMargin;\n const model = this._model;\n const { classPrefix } = config;\n\n this._mount = mount;\n if (model instanceof Array) {\n data = model;\n } else {\n data = formatter(this._model, this.config(), this._context);\n }\n\n if (data instanceof Function) {\n const mountHtmlTooltip = makeElement(mount, 'div', [1], `${classPrefix}-tooltip-html-container`);\n mountHtmlTooltip.html(data());\n } else {\n let content = data;\n let displayFormat = 'default';\n\n if (isSimpleObject(data)) {\n content = data.content;\n displayFormat = data.displayFormat;\n }\n\n const body = makeElement(mount, 'div', [displayFormat], `${classPrefix}-tooltip-content`, {},\n d => d);\n\n if (displayFormat === TABLE_FORMAT) {\n const table = makeElement(body, 'table', [1], `${classPrefix}-tooltip-table`);\n const tbody = makeElement(table, 'tbody', [1], `${classPrefix}-tooltip-table-tbody`);\n const rows = makeElement(tbody, 'tr', content, `${classPrefix}-tooltip-table-row`);\n rows.each(function (d, i) {\n selectElement(this).classed(`${classPrefix}-tooltip-table-row-${i}`, true);\n });\n const cells = makeElement(rows, 'td', d => d, `${classPrefix}-tooltip-table-cell`);\n cells.each(function (d) {\n selectElement(this).html(d);\n });\n } else {\n const rows = makeElement(body, 'div', content, '', {\n update: (elem, elemData) => elem.attr('class', elemData.className)\n });\n const cells = makeElement(rows, 'span', d => d.data, `${classPrefix}-tooltip-content`);\n cells.attr('class', `${classPrefix}-tooltip-content`);\n setStyles(rows, {\n margin: rowMargin\n });\n setStyles(cells, {\n display: 'inline-block' // 'margin-right': `${config.spacing}px`\n });\n\n cells.each(function (d) {\n const el = selectElement(this);\n el.html('');\n if (d instanceof Object) {\n if (d.type === 'icon') {\n const svg = makeElement(el, 'svg', [1]);\n const path = makeElement(svg, 'path', [1]);\n const shape = d.shape instanceof Function ? d.shape : getSymbol(d.shape);\n\n setAttrs(svg, {\n x: 0,\n y: 0,\n width: iconContainerSize,\n height: iconContainerSize\n });\n setAttrs(path, {\n d: shape.size(d.size)(),\n transform: `translate(${iconContainerSize / 2}, ${iconContainerSize / 2})`\n });\n setStyles(path, {\n fill: d.color\n });\n setStyles(svg, {\n width: `${iconContainerSize}px`,\n height: `${iconContainerSize}px`\n });\n } else {\n el.html(d.value);\n d.className && el.classed(d.className, true);\n setStyles(el, d.style);\n }\n } else {\n el.html(d);\n }\n });\n }\n }\n return this;\n }\n\n clear () {\n this._model = null;\n return this;\n }\n}\n","import {\n mergeRecursive,\n getQualifiedClassName,\n getUniqueId,\n selectElement,\n setStyles,\n makeElement\n} from 'muze-utils';\nimport { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM, TOOLTIP_TOP,\n INITIAL_STYLE } from './constants';\nimport { defaultConfig } from './default-config';\nimport { getArrowPos, placeArrow, reorderContainers } from './helper';\nimport './styles.scss';\nimport Content from './content';\n\n/**\n * This component is responsible for creating a tooltip element. It appends the tooltip\n * in the body element.\n * @class Tooltip\n */\nexport default class Tooltip {\n /**\n * Initializes the tooltip with the container element and configuration\n * @param {HTMLElement} container container where the tooltip will be mounted.\n * @param {string} className Class name of the tooltip.\n */\n constructor (htmlContainer, svgContainer) {\n let connectorContainer = svgContainer;\n this._id = getUniqueId();\n this._config = {};\n this.config({});\n const tooltipConf = this._config;\n const classPrefix = tooltipConf.classPrefix;\n const contentClass = tooltipConf.content.parentClassName;\n const container = makeElement(htmlContainer, 'div', [1], `${classPrefix}-tooltip-container`);\n this._container = container;\n this._tooltipContainer = container.append('div').style('position', 'absolute');\n this._contentContainer = this._tooltipContainer.append('div').attr('class', `${classPrefix}-${contentClass}`);\n this._tooltipBackground = this._tooltipContainer.append('div').style('position', 'relative');\n this._tooltipArrow = this._tooltipContainer.append('div');\n\n if (!svgContainer) {\n connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none');\n }\n this._contents = {};\n this._tooltipConnectorContainer = selectElement(connectorContainer)\n .append('g')\n .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`);\n const id = this._id;\n const defClassName = tooltipConf.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix);\n\n setStyles(this._tooltipArrow, INITIAL_STYLE);\n setStyles(this._tooltipBackground, INITIAL_STYLE);\n this.addClass(qualifiedClassName.join(' '));\n this.addClass(tooltipConf.className);\n this.hide();\n }\n\n /**\n * Sets the configuration of tooltip.\n * @param {Object} config Configuration of tooltip\n * @return {Tooltip} Instance of tooltip\n */\n config (...config) {\n if (config.length > 0) {\n const defConf = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConf, config[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n return defaultConfig;\n }\n /**\n * Sets the class name of tooltip\n * @param {string} className tooltip class name\n * @return {Tooltip} Instance of tooltip.\n */\n addClass (className) {\n this._tooltipContainer.classed(className, true);\n return this;\n }\n\n context (...ctx) {\n if (ctx.length) {\n this._context = ctx[0];\n return this;\n }\n return this._context;\n }\n\n content (name, data, contentConfig = {}) {\n const config = this.config();\n const { classPrefix } = config;\n const contentClass = config.content.className;\n const formatter = config.formatter;\n const className = contentConfig.className || `${classPrefix}-${contentClass}-${name}`;\n const content = this._contents[name] = this._contents[name] || new Content();\n const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className);\n container.attr('class', `${classPrefix}-${contentClass} ${className}`);\n reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`);\n const contentConf = config.content;\n contentConfig.classPrefix = this._config.classPrefix;\n content.config(contentConf);\n\n if (data === null) {\n content.clear();\n container.remove();\n delete this._contents[name];\n } else {\n content.update({\n model: data,\n formatter: contentConfig.formatter || formatter\n });\n content.context(this._context);\n content.render(container);\n }\n\n if (!Object.keys(this._contents).length) {\n this.hide();\n }\n return this;\n }\n\n getContents () {\n return Object.values(this._contents);\n }\n\n /**\n * Positions the tooltip at the given x and y position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Tooltip} Instance of tooltip.\n */\n position (x, y, conf = {}) {\n if (!Object.keys(this._contents).length) {\n this.hide();\n return this;\n }\n this.show();\n const target = this._target;\n const repositionArrow = conf.repositionArrow;\n\n if (target && repositionArrow) {\n const node = this._tooltipContainer.node();\n const config = this._config;\n const arrowDisabled = config.arrow.disabled;\n const arrowWidth = arrowDisabled ? 0 : config.arrow.size;\n const arrowOrient = this._arrowOrientation;\n const outsidePlot = arrowOrient === ARROW_LEFT || arrowOrient === ARROW_RIGHT ?\n (y + node.offsetHeight - arrowWidth) < target.y || y > (target.y + target.height) :\n (x + node.offsetWidth - arrowWidth) < target.x || x > (target.x + target.width);\n\n if (!arrowDisabled) {\n if (outsidePlot) {\n let path;\n this._tooltipArrow.style('display', 'none');\n this._tooltipBackground.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'block');\n const connector = this._tooltipConnectorContainer.selectAll('path').data([1]);\n const enter = connector.enter().append('path');\n if (arrowOrient === ARROW_LEFT) {\n path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}`\n + ` ${target.y + target.height / 2}`;\n } else if (arrowOrient === ARROW_RIGHT) {\n path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}`\n + ` L ${target.x} ${target.y + target.height / 2}`;\n } else if (arrowOrient === ARROW_BOTTOM) {\n path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}`\n + ` L ${target.x + target.width / 2} ${target.y}`;\n }\n enter.merge(connector).attr('d', path).style('display', 'block');\n } else {\n const arrowPos = getArrowPos(arrowOrient, target, {\n x,\n y,\n boxHeight: node.offsetHeight,\n boxWidth: node.offsetWidth\n }, this._config);\n\n placeArrow(this, this._arrowOrientation, arrowPos);\n this._tooltipConnectorContainer.style('display', 'none');\n }\n }\n }\n\n const offset = this._offset || {\n x: 0,\n y: 0\n };\n this._tooltipContainer.style('left', `${offset.x + x}px`).style('top',\n `${offset.y + y}px`);\n\n return this;\n }\n\n /**\n * Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the\n * boundaries.\n * @param {Object} dim Dimensions of the plot.\n */\n positionRelativeTo (dim, tooltipConf = {}) {\n let obj;\n let orientation = tooltipConf.orientation;\n this.show();\n if (!dim) {\n this.hide();\n return this;\n }\n\n const extent = this._extent;\n const node = this._tooltipContainer.node();\n\n this._tooltipContainer.style('top', '0px')\n .style('left', '0px');\n const offsetWidth = node.offsetWidth + 2;\n const offsetHeight = node.offsetHeight + 2;\n const config = this._config;\n const offset = this._offset;\n const arrowDisabled = config.arrow.disabled;\n const arrowSize = arrowDisabled ? 0 : config.arrow.size;\n const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true;\n const topSpace = dim.y;\n // When there is no space in right\n const dimX = dim.x + dim.width + offset.x;\n const rightSpace = extent.width - dimX;\n const leftSpace = dim.x + offset.x - extent.x;\n const positionTop = topSpace > (offsetHeight + arrowSize);\n const positionRight = rightSpace >= offsetWidth + arrowSize;\n const positionLeft = leftSpace >= offsetWidth + arrowSize;\n\n const positionHorizontal = () => {\n let position;\n let x = dim.x + dim.width;\n let y = dim.y;\n\n if (positionRight) {\n position = TOOLTIP_LEFT;\n x += arrowSize;\n } else if (positionLeft) {\n x = dim.x - offsetWidth;\n position = TOOLTIP_RIGHT;\n x -= arrowSize;\n } else {\n position = 'left';\n x += arrowSize;\n }\n if (dim.height < offsetHeight) {\n y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2);\n }\n\n const arrowPos = getArrowPos(position, dim, {\n x,\n y,\n boxHeight: offsetHeight,\n boxWidth: offsetWidth\n }, this._config);\n\n return {\n position,\n arrowPos,\n x,\n y\n };\n };\n\n const positionVertical = () => {\n let position;\n let y;\n // Position tooltip at the center of plot\n let x = dim.x - offsetWidth / 2 + dim.width / 2;\n\n // Overflows to the right\n if ((extent.width - (dim.x + offset.x)) < offsetWidth) {\n x = extent.width - offsetWidth - offset.x;\n } else if ((x + offset.x) < extent.x) { // Overflows to the left\n x = extent.x;\n }\n\n if (positionTop) {\n y = dim.y - offsetHeight - arrowSize;\n position = TOOLTIP_BOTTOM;\n } else {\n y = dim.y + dim.height + arrowSize;\n position = TOOLTIP_TOP;\n }\n\n const arrowPos = getArrowPos(position, dim, {\n x,\n y,\n boxHeight: offsetHeight,\n boxWidth: offsetWidth\n }, this._config);\n\n return {\n position,\n arrowPos,\n x,\n y\n };\n };\n\n this._target = dim;\n if (!orientation) {\n if (positionTop) {\n orientation = 'vertical';\n } else if (positionRight || positionLeft) {\n orientation = 'horizontal';\n } else {\n orientation = 'vertical';\n }\n }\n\n if (orientation === 'horizontal') {\n obj = positionHorizontal();\n } else if (orientation === 'vertical') {\n obj = positionVertical();\n }\n\n this._position = {\n x: obj.x,\n y: obj.y\n };\n\n this._arrowPos = obj.arrowPos;\n if (!arrowDisabled) {\n placeArrow(this, obj.position, obj.arrowPos);\n } else {\n this._tooltipArrow.style('display', 'none');\n this._tooltipBackground.style('display', 'none');\n }\n this._arrowOrientation = obj.position;\n draw && this.position(obj.x, obj.y);\n return this;\n }\n\n /**\n * Hides the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n hide () {\n this._tooltipContainer.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'none');\n return this;\n }\n\n /**\n * Shows the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n show () {\n this._tooltipContainer.style('display', 'block');\n return this;\n }\n\n extent (extent) {\n this._extent = extent;\n return this;\n }\n\n offset (offset) {\n this._offset = offset;\n return this;\n }\n\n remove () {\n this._tooltipContainer.remove();\n this._tooltipBackground.remove();\n this._tooltipConnectorContainer.remove();\n return this;\n }\n}\n","export const SELECTION_SUMMARY = 'selectionSummary';\nexport const HIGHLIGHT_SUMMARY = 'highlightSummary';\n","import {\n FieldType,\n GROUP_BY_FUNCTIONS,\n formatTemporal,\n DimensionSubtype,\n MeasureSubtype,\n DataModel,\n defaultValue,\n retrieveFieldDisplayName,\n nestCollection,\n getObjProp,\n intersect\n} from 'muze-utils';\nimport { TABLE_FORMAT } from '@chartshq/muze-tooltip';\nimport { SELECTION_SUMMARY, HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst { SUM, COUNT } = GROUP_BY_FUNCTIONS;\nconst { InvalidAwareTypes } = DataModel;\nconst FIRST_VALUE_MARGIN = '10px';\nconst SINGLE_DATA_MARGIN = 10;\n\nconst formatters = (formatter, interval, valueParser) => ({\n [DimensionSubtype.TEMPORAL]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatTemporal(Number(value), interval)),\n [MeasureSubtype.CONTINUOUS]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatter(value.toFixed(2))),\n [DimensionSubtype.CATEGORICAL]: value => valueParser(value)\n});\n\nconst getTabularData = (dataObj, fieldInf) => {\n const rows = [];\n const { data, schema } = dataObj;\n rows.push(schema.map(d => fieldInf[d.name].displayName));\n\n data.forEach((d) => {\n const row = [];\n schema.forEach((fieldObj, i) => {\n const value = fieldInf[fieldObj.name].fn(d[i]);\n row.push(value);\n });\n rows.push(row);\n });\n return rows;\n};\n\nconst getKeyValue = (params) => {\n const { field, value, classPrefix, margin, isSelected, removeKey } = params;\n\n if (!removeKey) {\n const keyObj = {\n value: field,\n className: `${classPrefix}-tooltip-key`\n };\n const valueObj = {\n value,\n className: `${classPrefix}-tooltip-value`\n };\n if (margin !== undefined) {\n keyObj.style = {\n 'margin-left': `${margin}px`\n };\n valueObj.style = {\n 'margin-left': `${margin}px`\n };\n }\n\n return ({\n className: isSelected ? `${classPrefix}-tooltip-row ${classPrefix}-tooltip-selected-row`\n : `${classPrefix}-tooltip-row`,\n data: [keyObj, valueObj]\n }\n );\n }\n return ({\n data: [{\n className: '',\n value,\n style: {\n 'margin-left': FIRST_VALUE_MARGIN\n }\n }],\n className: `${classPrefix}-tooltip-first`\n });\n};\n\nconst generateRetinalFieldsValues = (valueArr, retinalFields, content, context) => {\n const { fieldsConfig, dimensionMeasureMap, axes, config, fieldInf, dataLen, target } = context;\n const { classPrefix, margin, separator } = config;\n const colorAxis = axes.color[0];\n const shapeAxis = axes.shape[0];\n const sizeAxis = axes.size[0];\n const REF_VALUES_INDEX = 1;\n const REF_KEYS_INDEX = 0;\n\n for (const retField in retinalFields) {\n const retIndex = fieldsConfig[retField].index;\n const retinalFieldValue = valueArr[retIndex];\n const measuresArr = dimensionMeasureMap[retField];\n const icon = {\n type: 'icon',\n color: colorAxis.getColor(retinalFieldValue),\n shape: shapeAxis.getShape(retinalFieldValue),\n size: sizeAxis.getSize(retinalFieldValue) * config.iconScale\n };\n const { displayName, fn } = fieldInf[retField];\n const formattedRetinalValue = fn(retinalFieldValue);\n\n if (dataLen === 1) {\n content.push(getKeyValue({\n field: displayName,\n value: formattedRetinalValue,\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n } else {\n const hasMultipleMeasures = measuresArr.length > 1;\n hasMultipleMeasures && (content.push({ data: [icon, formattedRetinalValue] }));\n const selectedContext = target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)];\n const isSelected = selectedContext === retinalFieldValue;\n measuresArr.forEach((measure) => {\n const measureIndex = fieldsConfig[measure].index;\n const { displayName: dName, fn: formatterFn } = fieldInf[measure];\n const value = formatterFn(valueArr[measureIndex]);\n const keyValue = getKeyValue({\n field: hasMultipleMeasures ? `${dName}${separator}` : formattedRetinalValue,\n value,\n classPrefix,\n margin: hasMultipleMeasures ? margin : undefined,\n isSelected\n });\n if (!hasMultipleMeasures) {\n keyValue.data = [icon, ...keyValue.data];\n }\n content.push(keyValue);\n });\n }\n }\n};\n\nconst getFieldInf = (schema, dataModel, context) => {\n const { valueParser, timeDiffs } = context;\n const fieldsObj = dataModel.getFieldspace().fieldsObj();\n const defFormatter = formatters(null, null, valueParser)[DimensionSubtype.CATEGORICAL];\n\n return schema.reduce((inf, field) => {\n const { subtype, name, type } = field;\n const interval = subtype === DimensionSubtype.TEMPORAL ? timeDiffs[name] : 0;\n const nf = type === FieldType.MEASURE ? fieldsObj[name].numberFormat() : val => val;\n inf[name] = {\n fn: defaultValue(formatters(nf, interval, valueParser)[subtype], defFormatter),\n displayName: `${retrieveFieldDisplayName(dataModel, name)}`\n };\n return inf;\n }, {});\n};\n\nexport const buildTooltipData = (dataModel, config = {}, context) => {\n let nestedDataObj;\n let fieldValues = [];\n const { data, schema } = dataModel.getData();\n const fieldspace = dataModel.getFieldspace();\n const fieldsConfig = dataModel.getFieldsConfig();\n const { color, shape, size } = context.firebolt.context.retinalFields();\n const detailFields = context.detailFields || [];\n const dimensions = schema.filter(d => d.type === FieldType.DIMENSION);\n const measures = schema.filter(d => d.type === FieldType.MEASURE);\n const containsDetailField = !!intersect(schema, detailFields).length;\n const dataLen = data.length;\n const {\n dimensionMeasureMap,\n axes\n } = context;\n const fieldInf = getFieldInf(schema, dataModel, context);\n\n let displayFormat;\n if (dataLen > 1 && containsDetailField) {\n fieldValues = getTabularData({\n data,\n schema,\n fieldspace\n }, fieldInf);\n displayFormat = TABLE_FORMAT;\n } else {\n const retinalFields = [color.field, shape.field, size.field].reduce((acc, field) => {\n field && fieldsConfig[field].def.type === FieldType.DIMENSION && (acc[field] = 1);\n return acc;\n }, {});\n const filteredDimensions = dimensions.filter(field => !retinalFields[field.name]);\n const indices = filteredDimensions.map(dim => fieldsConfig[dim.name].index);\n const allMeasures = [...new Set(...Object.values(dimensionMeasureMap))];\n const filteredMeasures = dataLen > 1 ? measures.filter(d => allMeasures.indexOf(d.name) === -1) : measures;\n\n nestedDataObj = nestCollection({\n data,\n keys: indices\n });\n\n nestedDataObj = !('key' in nestedDataObj[0]) ? [{\n values: nestedDataObj\n }] : nestedDataObj;\n\n const generateTooltipContent = (nestedData, index = 0, content = []) => {\n const { classPrefix, separator } = config;\n for (let i = 0, len = nestedData.length; i < len; i++) {\n const { values, key } = nestedData[i];\n const field = getObjProp(schema, indices[index], 'name');\n const margin = dataLen === 1 || Object.keys(retinalFields).length === 0\n ? SINGLE_DATA_MARGIN : undefined;\n if (field) {\n const { displayName, fn } = fieldInf[field];\n const formattedValue = fn(key);\n const removeKey = values.length > 1;\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: formattedValue,\n classPrefix,\n margin,\n isSelected: undefined,\n removeKey\n }));\n }\n\n if (values[0] && values[0].key) {\n generateTooltipContent(values, index + 1, content);\n } else {\n for (let j = 0, len2 = values.length; j < len2; j++) {\n const valueArr = values[j];\n generateRetinalFieldsValues(valueArr, retinalFields, content, {\n fieldInf,\n axes,\n config,\n fieldsConfig,\n dimensionMeasureMap,\n dataLen,\n target: context.payload.target\n });\n\n filteredMeasures.forEach((measure) => {\n const { name } = measure;\n const { displayName, fn } = fieldInf[name];\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: fn(valueArr[fieldsConfig[name].index]),\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n });\n }\n }\n }\n };\n generateTooltipContent(nestedDataObj, 0, fieldValues);\n }\n\n return {\n content: fieldValues,\n displayFormat\n };\n};\n\nexport const strategies = {\n [SELECTION_SUMMARY]: (dm, config, context) => {\n const { selectionSet } = context;\n const aggFns = selectionSet.mergedEnter.aggFns;\n const dataObj = dm.getData();\n const measures = dataObj.schema.filter(d => d.type === FieldType.MEASURE);\n const aggregatedModel = dm.groupBy([''], measures.reduce((acc, v) => {\n acc[v.name] = aggFns[v.name] === COUNT ? SUM : aggFns[v.name];\n return acc;\n }, {\n saveChild: false\n }));\n const fieldsConf = aggregatedModel.getFieldsConfig();\n let values = [[{\n value: `${dataObj.data.length}`,\n style: {\n 'font-weight': 'bold'\n }\n }, 'Items Selected']];\n const measureNames = measures.map(d => d.name);\n const data = aggregatedModel.getData().data;\n measureNames.forEach((measure) => {\n const value = data[0][fieldsConf[measure].index];\n value instanceof InvalidAwareTypes ? values.push([]) : values.push([`(${aggFns[measure].toUpperCase()})`,\n `${retrieveFieldDisplayName(dm, measure)}`,\n {\n value: `${value.toFixed(2)}`,\n style: {\n 'font-weight': 'bold'\n }\n }]);\n });\n if (measureNames.length === 1) {\n values = [[...values[0], ...values[1]]];\n }\n return ([{\n data: values[0]\n }]);\n },\n [HIGHLIGHT_SUMMARY]: (data, config, context) => buildTooltipData(data, config, context)\n};\n","import { Tooltip as TooltipRenderer } from '@chartshq/muze-tooltip';\nimport { FieldType, mergeRecursive, defaultValue } from 'muze-utils';\nimport { spaceOutBoxes } from '../helper';\nimport { strategies } from './strategies';\nimport { FRAGMENTED } from '../../enums/constants';\nimport { TOOLTIP } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\nimport { HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst configResolvers = {\n [HIGHLIGHT_SUMMARY]: (specificConf, config) => defaultValue(specificConf, config),\n default: specificConf => defaultValue(specificConf, {})\n};\n\nconst sanitizeConfig = (config, context) => {\n const strategyObj = context._strategies;\n const sanitizedConf = Object.assign({}, config);\n for (const key in strategyObj) {\n sanitizedConf[key] = defaultValue(configResolvers[key], configResolvers.default)(config[key], config);\n }\n return sanitizedConf;\n};\n\nexport default class Tooltip extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._tooltips = {};\n this._strategies = mergeRecursive({}, strategies);\n this._strategy = HIGHLIGHT_SUMMARY;\n }\n\n static defaultConfig () {\n return {\n padding: 5,\n offset: {\n x: 0,\n y: 0\n },\n highlightSummary: {\n dataTransform: (dt, fields) => (fields ? dt.project(fields, { saveChild: false }) : dt\n )\n },\n selectionSummary: {\n dataTransform: (dt, fields) => {\n const fieldspace = dt.getFieldspace();\n const dimensions = Object.keys(fieldspace.getDimension());\n const measures = Object.keys(fieldspace.getMeasure());\n const projectedFields = defaultValue(fields, measures.length ? [measures[0]] : []);\n return dt.project([...dimensions, ...projectedFields], {\n saveChild: false\n });\n }\n }\n };\n }\n\n static formalName () {\n return TOOLTIP;\n }\n\n config (...params) {\n if (params.length) {\n const config = this._config = mergeRecursive(this._config, sanitizeConfig(params[0], this));\n const strategyObj = this._strategies;\n for (const key in strategyObj) {\n const formatter = config[key].formatter;\n this.setStrategy(key, formatter);\n }\n return this;\n }\n return this._config;\n }\n\n apply (selectionSet, payload, options = {}) {\n let totalHeight = 0;\n let totalWidth = 0;\n const dataModel = selectionSet.mergedEnter.model;\n const context = this.firebolt.context;\n const drawingInf = this.drawingContext();\n if ((dataModel.isEmpty() || payload.criteria === null)) {\n this.hide(options, null);\n return this;\n }\n\n const tooltips = this._tooltips;\n const config = this.config();\n const boundBox = {\n width: drawingInf.width,\n height: drawingInf.height\n };\n const showInPosition = payload.showInPosition;\n const pad = config.padding;\n const dataModels = [];\n const fragmented = config.mode === FRAGMENTED;\n const sourceInf = context.getSourceInfo();\n const fields = sourceInf.fields;\n const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false;\n const showVertically = !!xFieldDim;\n const tooltipPos = payload.position;\n const boxes = [];\n const enter = {};\n const uids = dataModel.getData().uids;\n if (fragmented) {\n dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, {\n saveChild: false\n })));\n } else {\n dataModels.push(dataModel);\n }\n\n let target = payload.target;\n let targetFields = [];\n if (target) {\n targetFields = target[0] || [];\n const sourceFields = payload.sourceFields;\n const indices = [];\n for (let i = 0, len = targetFields.length; i < len; i++) {\n if (sourceFields.indexOf(targetFields[i]) !== -1) {\n indices.push(i);\n }\n }\n target = target.map(d => d.filter((v, i) => indices.indexOf(i) !== -1));\n }\n\n const plotDimensions = context.getPlotPointsFromIdentifiers(target || payload.criteria, {\n getBBox: true\n });\n\n const strategy = defaultValue(options.strategy, this._strategy);\n const strategyConf = config[strategy];\n const { dataTransform, fields: projectFields } = strategyConf;\n const strategyObj = this._strategies;\n // Show tooltip for each datamodel\n for (let i = 0; i < dataModels.length; i++) {\n let plotDim = plotDimensions[i];\n if (fragmented) {\n const dimensions = dataModels[i].getData().schema.filter(d => d.type === FieldType.DIMENSION)\n .map(d => d.name);\n plotDim = context.getPlotPointsFromIdentifiers(dataModels[i].project(dimensions), { getBBox: true });\n plotDim = plotDim && plotDim[0];\n }\n\n const dt = dataTransform(dataModels[i], projectFields, this);\n\n enter[i] = true;\n const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf;\n const layoutBoundBox = layoutContainer.getBoundingClientRect();\n const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect();\n\n const offsetLeft = unitBoundBox.left - layoutBoundBox.left;\n const offsetTop = unitBoundBox.top - layoutBoundBox.top;\n const tooltipInst = tooltips[i] = tooltips[i] || new TooltipRenderer(layoutContainer,\n drawingInf.svgContainer);\n\n sourceInf.payload = payload;\n sourceInf.firebolt = this.firebolt;\n sourceInf.detailFields = context.detailFields();\n sourceInf.timeDiffs = context.timeDiffsByField();\n sourceInf.valueParser = context.valueParser();\n sourceInf.selectionSet = selectionSet;\n tooltipInst.context(sourceInf);\n const strategyFn = strategyObj[strategy];\n tooltipInst.content(strategy, dt, {\n formatter: strategyFn,\n order: options.order\n })\n .config(this.config())\n .extent({\n x: 0,\n y: 0,\n width: parentContainerDimensions.width,\n height: parentContainerDimensions.height\n })\n .offset({\n x: offsetLeft + (config.offset.x || 0),\n y: offsetTop + (config.offset.y || 0)\n });\n\n if (showInPosition) {\n tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad);\n } else if (plotDim) {\n tooltipInst.positionRelativeTo({\n x: plotDim.x,\n y: plotDim.y,\n width: plotDim.width || 0,\n height: plotDim.height || 0\n }, {\n orientation: fragmented ?\n (showVertically ? 'horizontal' : 'vertical') : undefined\n });\n } else {\n tooltipInst.hide();\n break;\n }\n\n if (fragmented) {\n const position = tooltipInst._position;\n const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect();\n\n totalHeight += tooltipBoundBox.height + pad;\n totalWidth += tooltipBoundBox.width + pad;\n if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) {\n break;\n }\n boxes.push({\n x: position.x,\n y: position.y,\n width: tooltipBoundBox.width,\n height: tooltipBoundBox.height,\n tooltip: tooltipInst\n });\n }\n }\n\n for (const key in tooltips) {\n if (!enter[key]) {\n const tooltip = tooltips[key];\n tooltip.content(payload.action, null);\n if (!tooltip.getContents().length) {\n tooltip.remove();\n delete tooltips[key];\n }\n }\n }\n if (fragmented) {\n spaceOutBoxes(boxes, boundBox, showVertically);\n boxes.forEach(box => box.tooltip.position(box.x, box.y, {\n repositionArrow: true\n }));\n }\n return this;\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const strategy = options.strategy || this._strategy;\n tooltips[key].content(strategy, null);\n tooltips[key].hide();\n }\n }\n }\n}\n","export const spaceOutBoxes = (boxes, extent, showVertically) => {\n let y;\n let height;\n let x;\n let width;\n let i;\n const pad = 5;\n const len = boxes.length;\n const spaceOutIfOverlap = (firstBox, secondBox, opposite) => {\n x = firstBox.x;\n width = firstBox.width;\n y = firstBox.y;\n height = firstBox.height;\n const bottom = y + height;\n const right = x + width;\n\n if (showVertically) {\n if (opposite ? y < (secondBox.y + secondBox.height) : bottom > secondBox.y) {\n secondBox.y = opposite ? firstBox.y - secondBox.height - pad :\n bottom + pad;\n }\n } else if (opposite ? x < (secondBox.x + secondBox.width) : right > secondBox.x) {\n secondBox.x = opposite ? firstBox.x - secondBox.width - pad :\n right + pad;\n }\n };\n\n boxes.sort((a, b) => (showVertically ? a.y - b.y : a.x - b.x));\n i = 0;\n\n for (i = 0; i < len - 1; i++) {\n spaceOutIfOverlap(boxes[i], boxes[i + 1]);\n }\n\n if ((boxes[i].y + boxes[i].height) > extent.height ||\n (boxes[i].x + boxes[i].width) > extent.width) {\n if (showVertically) {\n boxes[i].y -= (boxes[i].height + boxes[i].y) - extent.height;\n } else {\n boxes[i].x -= (boxes[i].width + boxes[i].x) - extent.width;\n }\n for (i = len - 1; i > 0; i--) {\n spaceOutIfOverlap(boxes[i], boxes[i - 1], true);\n }\n }\n return boxes;\n}\n;\n","import { selectElement, FieldType } from 'muze-utils';\n\nimport './styles.scss';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { CROSSLINE } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nexport default class Crossline extends SpawnableSideEffect {\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-crossline-group`,\n bandClass: `${CLASSPREFIX}-crossband`,\n lineClass: `${CLASSPREFIX}-crossline`\n };\n }\n\n static formalName () {\n return CROSSLINE;\n }\n\n apply (selectionSet, payload) {\n let height;\n let bandWidth;\n let px;\n let width;\n const {\n className,\n bandClass,\n lineClass\n } = this.config();\n const dataModel = selectionSet.mergedEnter.model;\n const drawingInf = this.drawingContext();\n if (payload.criteria && dataModel && dataModel.isEmpty()) {\n return this;\n }\n if (payload.criteria === null || !dataModel) {\n this.hide();\n return this;\n }\n\n const dataObj = dataModel.getData();\n const sourceInf = this.firebolt.context.getSourceInfo();\n const axes = sourceInf.axes;\n const axisFields = sourceInf.fields;\n const fields = selectionSet.fields;\n const data = dataObj.data;\n const fieldsConfig = dataModel.getFieldsConfig();\n const svgContainer = drawingInf.sideEffectGroup;\n\n const elemData = [];\n fields.forEach((field) => {\n const fieldIndex = fieldsConfig[field] && fieldsConfig[field].index;\n const dataArr = data.map(d => d[fieldIndex]);\n const axisIndex = [['x', 0], ['x', 1], ['y', 0], ['y', 1]].find((arr) => {\n const fieldInst = axisFields[arr[0]][arr[1]];\n return fieldInst && fieldInst.type() === FieldType.DIMENSION &&\n fieldInst.getMembers().indexOf(field) !== -1;\n });\n if (axisIndex !== undefined && data.length) {\n const type = axisIndex[0];\n const axis = axes[type][axisIndex[1]];\n const value = dataArr[0];\n bandWidth = axis.getUnitWidth() || 0;\n px = axis.getScaleValue(value) + bandWidth / 2 + drawingInf.xOffset;\n const layers = this.firebolt.context.layers();\n const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type]));\n const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type]));\n height = drawingInf.height;\n width = drawingInf.width;\n const startPx = px - plotWidth / 2 - pad / 2;\n const endPx = px + plotWidth / 2 + pad / 2;\n const dataPoint = {};\n if (type === 'y') {\n dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`;\n } else {\n dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`;\n }\n dataPoint.className = plotWidth ? bandClass : lineClass;\n !isNaN(px) && elemData.push(dataPoint);\n }\n });\n if (elemData.length) {\n const parentGroup = this.createElement(svgContainer, 'g', [1], className);\n const elem = this.createElement(parentGroup, 'path', elemData);\n elem.attr('d', d => d.d).style('pointer-events', 'none')\n .attr('class', d => d.className);\n }\n return this;\n }\n\n hide () {\n const className = this.config().className;\n const drawingInf = this.drawingContext();\n selectElement(drawingInf.sideEffectGroup).selectAll(`.${className}`).remove();\n }\n}\n","const fadeFn = (set, context, strategy) => {\n const {\n mergedEnter,\n mergedExit,\n exitSet,\n completeSet\n } = set;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, strategy, false);\n } else {\n context.applyInteractionStyle(exitSet[1], {}, strategy, true);\n context.applyInteractionStyle(mergedEnter, {}, strategy, false);\n }\n};\n\nexport const strategies = {\n fade: fadeFn,\n focus: (set, context) => {\n const {\n mergedEnter,\n mergedExit,\n completeSet\n } = set;\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, 'focus', false);\n } else {\n context.applyInteractionStyle(mergedExit, {}, 'focus', true);\n context.applyInteractionStyle(mergedEnter, {}, 'focus', false);\n }\n },\n highlight: (set, context) => {\n const {\n mergedEnter,\n mergedExit,\n entrySet,\n exitSet,\n completeSet\n } = set;\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, 'highlight', false);\n } else {\n context.applyInteractionStyle(entrySet[1], {}, 'highlight', true);\n context.applyInteractionStyle(exitSet[1], {}, 'highlight', false);\n }\n }\n};\n","import SurrogateSideEffect from '../surrogate';\nimport { strategies } from './strategy';\nimport { HIGHLIGHTER } from '../../enums/side-effects';\n\nexport default class PlotHighlighter extends SurrogateSideEffect {\n constructor (...params) {\n super(...params);\n this._strategy = 'highlight';\n this._strategies = strategies;\n }\n\n static formalName () {\n return HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this, options.strategy || this._strategy);\n\n return this;\n }\n}\n","import SurrogateSideEffect from '../surrogate';\n\nexport default class FilterEffect extends SurrogateSideEffect {\n static formalName () {\n return 'filter';\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static mutates () {\n return true;\n }\n\n apply (selectionSet, payload) {\n const context = this.firebolt.context;\n const entryModel = selectionSet.mergedEnter.model;\n if (payload.criteria === null) {\n context.clearCaching().resetData();\n } else {\n context.enableCaching().data(entryModel);\n }\n return this;\n }\n}\n","import { DataModel, getObjProp } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { ANCHORS } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\n\nconst addLayer = (layerRegistry, context, sideEffect) => {\n context.addLayer((layerDefs) => {\n const layers = [];\n\n if (layerDefs) {\n layerDefs.forEach((layerDef) => {\n const mark = layerDef.mark;\n const layerCls = layerRegistry[mark];\n\n if (layerCls && layerCls.shouldDrawAnchors()) {\n const depLayerEncoding = layerDef.def.encoding;\n const encoding = {\n x: getObjProp(depLayerEncoding, 'x', 'field'),\n y: getObjProp(depLayerEncoding, 'y', 'field'),\n color: getObjProp(depLayerEncoding, 'color', 'field'),\n size: {\n field: getObjProp(depLayerEncoding, 'size', 'field'),\n value: sideEffect.defaultSizeValue()\n }\n };\n const commonName = sideEffect.constructor.formalName();\n const name = `${layerDef.def.name}-${commonName}`;\n\n layers.push({\n name,\n mark: 'point',\n groupId: commonName,\n className: sideEffect.constructor.defaultConfig().className,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n }\n });\n }\n return layers;\n });\n};\n\nexport default class AnchorEffect extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._layersMap = {};\n this.addAnchorLayers();\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-anchors-group`\n };\n }\n\n static formalName () {\n return ANCHORS;\n }\n\n addAnchorLayers () {\n const context = this.firebolt.context;\n const layerRegistry = context.registry().layerRegistry;\n\n addLayer(layerRegistry, context, this);\n return this;\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n /**\n * Returns the default area value of the anchor point.\n * @return { number } Default area value of anchor.\n */\n defaultSizeValue () {\n return 100;\n }\n\n apply (selectionSet) {\n const dataModel = selectionSet.mergedEnter.model;\n const formalName = this.constructor.formalName();\n\n const context = this.firebolt.context;\n const layers = context.layers().filter(layer => layer.config().groupId === formalName);\n\n layers.forEach((layer) => {\n const linkedLayer = context.getLayerByName(layer.config().owner);\n const [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel);\n const transformedDataModel = new DataModel(transformedData, schema);\n\n layer.data(transformedDataModel);\n });\n return this;\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { PERSISTENT_ANCHORS } from '../enums/side-effects';\n\nexport default class PersistentAnchors extends AnchorEffect {\n static formalName () {\n return PERSISTENT_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-persistent-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { BRUSH_ANCHORS } from '../enums/side-effects';\n\nexport default class BrushAnchors extends AnchorEffect {\n static formalName () {\n return BRUSH_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-brush-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n}\n","import * as BEHAVIOURS from './enums/behaviours';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: ['selectionBox', {\n name: 'highlighter',\n options: {\n strategy: 'fade'\n }\n }, 'brush-anchors'],\n [`${BEHAVIOURS.BRUSH},${BEHAVIOURS.SELECT}`]: [{\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary',\n order: 0,\n filter: context => context.config().mode === 'fragmented'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: 'highlighter',\n options: {\n strategy: 'highlight'\n }\n }, 'crossline', {\n name: 'tooltip',\n options: {\n order: 9999\n }\n }, 'anchors'],\n [BEHAVIOURS.FILTER]: ['filter'],\n [BEHAVIOURS.SELECT]: [{\n name: 'highlighter',\n options: {\n strategy: 'focus'\n }\n }, 'persistent-anchors']\n};\n","export const CLASSPREFIX = 'muze';\nexport const STACK = 'stack';\nexport const GROUP = 'group';\nexport const IDENTITY = 'identity';\nexport const ANGLE = 'angle';\nexport const RADIUS = 'radius';\nexport const SIZE = 'size';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const TEXT = 'text';\nexport const OUTER_RADIUS_VALUE = 'outerRadiusValue';\nexport const TEXT_ANCHOR_MIDDLE = 'middle';\nexport const ENCODING = {\n X: 'x',\n Y: 'y',\n X0: 'x0',\n Y0: 'y0',\n RADIUS: 'radius',\n RADIUS0: 'radius0',\n ANGLE: 'angle',\n ANGLE0: 'angle0'\n};\n\nexport const ASCENDING = 'asc';\n\nexport const AGG_FN_SUM = 'sum';\n\nexport const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { CLASSPREFIX, STACK } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-area',\n className: '',\n interpolate: 'linear',\n transform: {\n type: STACK\n },\n interaction: {\n\n },\n nearestPointThreshold: 10,\n encoding: {\n color: {},\n x: {},\n y: {},\n y0: {},\n strokeOpacity: {\n value: 1\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * This is an interface class which any new layer class has to extend.\n *\n * @example\n * class BarLayer extends BaseLayer {\n * update (params) {\n * // super.update(params);\n * // Update the bar layer\n * }\n * }\n * @class\n */\nexport default class SimpleLayer {\n\n formalName () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets or gets the dependencies.\n * @param {Object} dependencies Dependencies needed by layer\n * @return {BaseLayer} Instance of base layer.\n */\n dependencies () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the config of the layer\n *\n * @param {Object} config Configuration of layer\n * @return {Object} configuration of layer\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Acts as a getter or setter function\n * When setter\n * Returns the datamodel of the layer\n * @param { DataModel } dataModel instance of DataModel\n * @return { DataModel } DataModel instance of the layer\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized schema of the layer\n * @return {Object} Serialized schema\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the unique identifier of this layer\n * @return {string} id of the layer\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n /*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldMap field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n * @private\n */\n normalizeTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of dataModel\n * @param {Object} config configuration for transforming data\n * @return {Array.} Transformed data.\n * @private\n */\n getTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a nominal field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @return {Array} Domain values array.\n */\n _calculateDomainFromData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, color, etc.\n * @return {Object} Axis domains\n */\n getDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for getting nearest point\n * @return {BaseLayer} Instance of base layer\n */\n getNearestPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for highlighting points\n * @return {BaseLayer} Instance of base layer\n */\n highlightPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for deselecting points\n * @return {BaseLayer} Instance of base layer\n */\n dehighlightPoint () {\n return this;\n }\n\n linkLayerStore () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets the container element for the layer to be renderered.\n * @param {SVGElement} mountPoint SVG element or group element.\n */\n mount () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n","import { COORD_TYPES, mergeRecursive } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nconst { CARTESIAN } = COORD_TYPES;\nexport const props = {\n axes: {},\n mount: {},\n measurement: {},\n metaInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {\n defaultValue: CARTESIAN\n },\n [PROPS.CONFIG]: {\n value: null,\n sanitization: (context, config) => {\n context._customConfig = config;\n const constructor = context.constructor;\n const newConf = mergeRecursive({}, constructor.defaultConfig());\n\n return constructor.defaultPolicy(newConf, config);\n }\n }\n};\n","export const DATA = 'data';\nexport const CONFIG = 'config';\nexport const MEASUREMENT = 'measurement';\nexport const DOMAIN = 'domain';\nexport const MOUNT = 'mount';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { Symbols } from 'muze-utils';\nimport * as AxisOrientation from '../enums/axis-orientation';\n\n/**\n * @module Axis\n * This file exports constants that are used to reference axis orientations\n * in a consistent manner.\n */\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\n\n/**\n * This object is used to associate the axis orientation with the d3 class\n * used to represent that axis.\n */\nexport const axisOrientationMap = {\n [AxisOrientation.LEFT]: Symbols.axisLeft,\n [AxisOrientation.BOTTOM]: Symbols.axisBottom,\n [AxisOrientation.RIGHT]: Symbols.axisRight,\n [AxisOrientation.TOP]: Symbols.axisTop\n};\n","/**\n * @module axis\n * This file exports constants used to reference scale type\n * consistently throughout the project.\n */\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const TIME = 'temporal';\nexport const COLOR = 'color';\nexport const ORDINAL = 'ordinal';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\nexport const LOG = 'log';\nexport const POW = 'pow';\nexport const IDENTITY = 'identity';\nexport const SEQUENTIAL = 'sequential';\nexport const THRESHOLD = 'threshold';\n","export const CLASSPREFIX = 'muze';\n\nexport const CONTINOUS = 'continous';\nexport const DISCRETE = 'discrete';\nexport const SEQUENTIAL = 'sequential';\nexport const ORDINAL = 'ordinal';\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const THRESHOLD = 'threshold';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\n\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\n\nexport const DOMAIN = 'domain';\nexport const HIDDEN = 'hidden';\nexport const NUMBER = 'number';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\n\nexport const RGB = 'rgb';\nexport const HEX = 'hex';\nexport const HSLA = 'hsla';\nexport const HSL = 'hsl';\n\nexport const DEFAULT_ANGLE_DOMAIN = [1];\nexport const MIN_NO_OF_TICKS = 2;\nexport const DEFAULT_NO_OF_TICKS = 10;\n\n","import { scales, colorSchemes } from 'muze-utils';\n\nimport {\n SEQUENTIAL,\n ORDINAL,\n LINEAR,\n CONTINOUS,\n THRESHOLD,\n QUANTIZE\n} from './enums/constants';\n\nimport * as ScaleType from './enums/scale-type';\n\nconst {\n scaleLinear,\n scaleThreshold,\n scaleLog,\n scalePow,\n scaleIdentity,\n scaleOrdinal,\n scaleSequential,\n scaleQuantize,\n scaleQuantile,\n schemeCategory10,\n schemeCategory20,\n schemeCategory20b,\n scaleBand,\n scaleTime\n} = scales;\nexport const scaleMap = {\n [ScaleType.LINEAR]: scaleLinear,\n [ScaleType.BAND]: scaleBand,\n [ScaleType.QUANTIZE]: scaleQuantize,\n [ScaleType.QUANTILE]: scaleQuantile,\n [ScaleType.THRESHOLD]: scaleThreshold,\n [ScaleType.SEQUENTIAL]: scaleSequential,\n [ScaleType.LOG]: scaleLog,\n [ScaleType.POW]: scalePow,\n [ScaleType.IDENTITY]: scaleIdentity,\n [ScaleType.TIME]: scaleTime,\n [ScaleType.COLOR]: scaleLinear,\n [ScaleType.ORDINAL]: scaleOrdinal\n};\nexport const SCHEMES = {\n SCHEME1: schemeCategory10,\n SCHEME2: schemeCategory20,\n SCHEME3: schemeCategory20b\n};\n\n/**\n * Accepts a scheme in a string format and returns the scale from d3-scale-chromatic\n *\n * @export\n * @param {string} scheme a string representing the kind of scheme for the color axis\n * @return {Object} The corresponding scale from a scheme type from d3 chromatic scale\n */\nexport function getScheme (scheme) {\n if (scheme[0] === 'i') {\n return scaleSequential(colorSchemes[scheme]);\n }\n return scaleOrdinal(colorSchemes[scheme]);\n}\n\n/**\n *\n *\n * @export\n * @param {*} scheme\n *\n */\nexport function getSchemeType (scheme) {\n let schemeType = '';\n if (scheme && typeof (scheme) === 'string') {\n schemeType = scheme[0] === 'i' ? SEQUENTIAL : ORDINAL;\n } else {\n schemeType = ORDINAL;\n }\n return schemeType;\n}\n\n/**\n * This function is used to create a scale that is assigned to\n * an instance of axis.\n *\n * @export\n * @param {Object} params the input parameters to create a Scale object\n * @param {string} params.type the type of scale\n * @param {Array} params.range the range of scale\n * @return {Object} instance of scale\n */\nexport function createScale (params) {\n if (!params.type || !scaleMap[params.type]) {\n throw new Error(`${params.type} is not a valid scale type`);\n }\n if (!Array.isArray(params.range)) {\n throw new Error('range parameter must be an array');\n }\n let scaleFactory = null;\n const range = params.range;\n // @todo: do it using scale decorator\n if (params.type === LINEAR && params.interpolator) {\n scaleFactory = scaleMap[params.interpolator];\n if (params.interpolator === ScaleType.POW) {\n return scaleFactory().range(range).exponent(params.exponent);\n } else if (params.interpolator === ScaleType.LOG) {\n return scaleFactory().range(range).base([params.base]);\n }\n } else {\n scaleFactory = scaleMap[params.type];\n }\n\n if (params.type === QUANTIZE) {\n scaleFactory().nice();\n }\n return scaleFactory().range(range);\n}\n\n/**\n * This method is used to update the range of a scale\n * so that the core module can remain agnostic of the d3\n * scale api.\n *\n * @export\n * @param {Scale} scale Instance of d3 Scale.\n * @param {Array} range new range of the scale.\n * @return {Scale} Updated scale.\n */\nexport function updateScaleRange (scale, range) {\n return scale.range(range);\n}\n\n/**\n *\n *\n * @export\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} steps\n *\n */\nexport function getScaleType (domainType, rangeType, steps) {\n if (rangeType === CONTINOUS) {\n return LINEAR;\n }\n if (domainType === CONTINOUS) {\n if (steps instanceof Array) {\n return THRESHOLD;\n }\n return QUANTIZE;\n }\n return ORDINAL;\n}\n","import { getUniqueId } from 'muze-utils';\nimport { CLASSPREFIX } from '../enums/constants';\n\n/**\n *\n *\n */\nexport const defaultConfig = {\n id: getUniqueId(),\n adjustRange: false,\n axisName: {\n defClassName: 'axis-name'\n },\n axisNamePadding: 12,\n base: 10,\n classPrefix: CLASSPREFIX,\n className: `${CLASSPREFIX}-axis`,\n exponent: 1,\n interpolator: 'linear',\n fixedBaseline: true,\n labels: {\n rotation: null,\n smartTicks: null\n },\n orientation: 'left',\n numberFormat: val => val,\n padding: 0.3,\n nice: true,\n numberOfTicks: null,\n rotate: false,\n show: true,\n showAxisName: true,\n showInnerTicks: true,\n showOuterTicks: true,\n style: {},\n type: 'linear',\n tickFormat: null,\n tickValues: null,\n xOffset: 0,\n yOffset: 0\n};\n\n","/**\n * This file exports functionality that is used to render axis.\n */\nimport { selectElement, makeElement, angleToRadian } from 'muze-utils';\nimport * as AxisOrientation from './enums/axis-orientation';\nimport { LINEAR, HIDDEN, BOTTOM, TOP } from './enums/constants';\n\n/**\n *\n *\n * @param {*} instance\n * @param {*} container\n * @param {*} labelManager\n * @param {*} config\n */\nconst rotateAxis = (instance, tickText, labelManager) => {\n let rotation;\n const axis = instance.axis();\n const config = instance.config();\n const renderConfig = instance.renderConfig();\n const smartTicks = instance.smartTicks();\n const scale = axis.scale();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n const ticks = labelFunc();\n const {\n orientation,\n fixedBaseline,\n type\n } = config;\n const {\n labels\n } = renderConfig;\n\n rotation = labels.rotation;\n\n const tickSize = instance.getTickSize();\n tickText.each(function (d, index) {\n let yShift;\n let xShift;\n let datum = smartTicks[index] ? smartTicks[index].text : d;\n\n datum = datum.toString();\n\n const tickLabelDim = labelManager.getOriSize(datum);\n\n const width = tickLabelDim.width * 0.5;\n const height = tickLabelDim.height * 0.5;\n\n if (rotation < 0) {\n rotation = 360 + rotation;\n }\n\n const quadrant = 4 - Math.floor(rotation / 90);\n const rotationNormalizer = ((quadrant % 2 === 0) ? rotation : 180 * Math.ceil(rotation / 180) - rotation) % 180;\n\n yShift = Math.sqrt(height ** 2 + width ** 2) * Math.sin(angleToRadian(rotationNormalizer));\n\n if ((quadrant === 3 || quadrant === 2) && !(rotationNormalizer > 67.5 && rotationNormalizer <= 90)) {\n yShift += height * 2;\n }\n xShift = width;\n\n if (rotation === 90) {\n xShift = height;\n } else if (rotation === 270) {\n xShift = -height;\n } else {\n xShift = 0;\n }\n\n if (orientation === AxisOrientation.TOP) {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift + xShift / 2 : xShift;\n selectElement(this)\n .attr('transform', `translate(${-xShift + tickSize}\n ${-yShift - tickSize}) rotate(${rotation})`);\n } else {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift - xShift / 2 : xShift;\n\n selectElement(this)\n .attr('transform', `translate(${xShift - tickSize}\n ${yShift + tickSize}) rotate(${rotation})`);\n }\n selectElement(this).transition()\n .duration(1000).text(datum);\n });\n return tickText;\n};\n\n/**\n *\n *\n * @param {*} tickText\n * @param {*} axisInstance\n */\nconst changeTickOrientation = (selectContainer, axisInstance, tickSize) => {\n const {\n _smartTicks\n } = axisInstance;\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const {\n orientation,\n classPrefix\n } = config;\n const {\n labels\n } = renderConfig;\n const {\n rotation,\n smartTicks: isSmartTicks\n } = labels;\n\n const tickText = selectContainer.selectAll('.tick text');\n tickText.selectAll('tspan').remove();\n\n // rotate labels if not enough space is available\n if (rotation && (orientation === TOP || orientation === BOTTOM)) {\n rotateAxis(axisInstance, tickText, labelManager);\n } else if (!rotation && !isSmartTicks) {\n tickText.attr('transform', '');\n } else {\n tickText.text('');\n if (orientation === TOP || orientation === BOTTOM) {\n tickText.attr('y', 0)\n .attr('x', 0)\n .attr('transform', '')\n .text('');\n const tspan = makeElement(tickText, 'tspan', (d, i) => {\n if (_smartTicks[i]) {\n return _smartTicks[i].lines;\n } return [];\n }, `${classPrefix}-smart-text`);\n\n tspan.attr('dy', '0')\n .style('opacity', '0')\n\n .transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .attr('dy', (d, i) => {\n if (orientation === BOTTOM || i !== 0) {\n return _smartTicks[0].oriTextHeight;\n }\n return -_smartTicks[0].oriTextHeight * (_smartTicks[0].lines.length - 1) - tickSize;\n })\n .style('opacity', 1)\n .text(e => e)\n .attr('x', 0);\n } else {\n const tspan = makeElement(tickText, 'tspan', (d, i) => _smartTicks[i].lines, `${classPrefix}-smart-text`);\n tspan.text(e => e);\n }\n }\n\n return tickText;\n};\n\nconst setFixedBaseline = (axisInstance) => {\n const {\n fixedBaseline\n } = axisInstance.config();\n const {\n showInnerTicks\n } = axisInstance.renderConfig();\n const domain = axisInstance.domain();\n if (fixedBaseline && domain.length && showInnerTicks) {\n axisInstance.setFixedBaseline();\n }\n};\n\n/**\n *\n *\n * @param {*} textNode\n * @param {*} orientation\n * @param {*} measures\n */\nconst setAxisNamePos = (textNode, orientation, measures) => {\n const {\n axisNameHeight,\n availableSpace\n } = measures;\n\n switch (orientation) {\n case AxisOrientation.LEFT:\n textNode.attr('transform',\n `translate(${-(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(-90)`);\n break;\n case AxisOrientation.RIGHT:\n textNode.attr('transform',\n `translate(${(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(90)`);\n break;\n case AxisOrientation.TOP:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${-availableSpace.height + axisNameHeight})`);\n break;\n case AxisOrientation.BOTTOM:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${availableSpace.height - axisNameHeight / 2})`);\n break;\n default:\n }\n return textNode;\n};\n\n/**\n * This method is used to render the axis inside an\n * svg container.\n *\n * @export\n * @param {Object} axisInstance the nput object required to render axis\n * @param {string} axisInstance.orientation the orientation of axis\n * @param {Object} axisInstance.scale instance of d3 scale\n * @param {SVGElement} axisInstance.container the container in which to render\n */\nexport function renderAxis (axisInstance) {\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const mount = axisInstance.mount();\n const range = axisInstance.range();\n const axis = axisInstance.axis();\n const scale = axisInstance.scale();\n const {\n _tickLabelStyle: tickLabelStyle,\n _tickFormatter: axisTickFormatter\n } = axisInstance;\n const {\n orientation,\n axisNamePadding,\n className,\n id,\n classPrefix\n } = config;\n const {\n show,\n xOffset,\n yOffset,\n showAxisName,\n labels,\n smartAxisName\n } = renderConfig;\n\n if (!show) {\n return;\n }\n\n const tickSize = axisInstance.getTickSize();\n\n const selectContainer = makeElement(selectElement(mount), 'g', [axisInstance], `${className}`, {},\n key => key.config().id);\n\n // Set style for tick labels\n labelManager.setStyle(tickLabelStyle);\n\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n const ticks = axis.tickValues() || labelFunc();\n\n axis.tickFormat(axisTickFormatter(ticks));\n\n // Get range(length of range)\n const availableSpace = Math.abs(range[0] - range[1]);\n\n // Get width and height taken by axis labels\n const labelProps = axisInstance.axisComponentDimensions().largestTickDimensions;\n\n // Draw axis ticks\n selectContainer.attr('transform', `translate(${xOffset},${yOffset})`);\n setFixedBaseline(axisInstance);\n if (labels.smartTicks === false || tickSize === 0) {\n selectContainer.transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .call(axis);\n } else {\n selectContainer.call(axis);\n }\n selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true);\n selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true);\n\n // Set classes for ticks\n const tickText = selectContainer.selectAll('.tick text');\n tickText.classed(`${classPrefix}-ticks`, true)\n .classed(`${classPrefix}-ticks-${id}`, true);\n\n changeTickOrientation(selectContainer, axisInstance, tickSize);\n\n // Create axis name\n const textNode = makeElement(selectContainer, 'text', [smartAxisName], `${classPrefix}-axis-name`)\n .attr('text-anchor', 'middle')\n .classed(`${classPrefix}-axis-name-${id}`, true)\n .text(d => d.text);\n\n // Hide axis name if show is off\n textNode.classed(HIDDEN, !showAxisName);\n\n // render labels based on orientation of axis\n const labelOffset = availableSpace / 2;\n\n const measures = {\n labelProps,\n tickSize,\n axisNamePadding,\n axisNameHeight: smartAxisName.height,\n yOffset,\n xOffset,\n labelOffset,\n availableSpace: axisInstance.availableSpace()\n };\n // Set position for axis name\n setAxisNamePos(textNode, orientation, measures);\n}\n","import {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'muze-utils';\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\n// Longest Word for each level based on which tick skipping is decided\nconst longestWord = {\n month: 'September',\n quarter: 'October',\n halfYearly: 'July',\n year: 9999,\n day: 'September',\n hour: '24 AM',\n mintues: '60:60',\n seconds: ':60',\n week: 'Wed 31'\n};\n\n// These are the various levels of ticks that can be shown by Muze.\n// Each level is described as how frequently the ticks appear\n// The format is as follows:\n// [Frequency, Milliseconds, Name of Seconds, Tick Generator, Level Type]\nconst tickIntervals = [\n [1, 1, 'milliseconds', timeMillisecond.every(1), 'seconds'],\n [1, durationSecond, 'seconds', timeSecond.every(1), 'seconds'],\n [5, 5 * durationSecond, 'five seconds', timeSecond.every(5), 'seconds'],\n [10, 10 * durationSecond, 'ten seconds', timeSecond.every(10), 'seconds'],\n [15, 15 * durationSecond, 'fifteen seconds', timeSecond.every(15), 'seconds'],\n [30, 30 * durationSecond, 'thirty seconds', timeSecond.every(30), 'seconds'],\n [1, durationMinute, 'minute', timeMinute.every(1), 'minutes'],\n [5, 5 * durationMinute, 'five minutes', timeMinute.every(5), 'minutes'],\n [10, 10 * durationMinute, 'ten minutes', timeMinute.every(10), 'minutes'],\n [15, 15 * durationMinute, 'fifteen minutes', timeMinute.every(15), 'minutes'],\n [30, 30 * durationMinute, 'thirty minutes', timeMinute.every(30), 'minutes'],\n [1, durationHour, 'hour', timeHour.every(1), 'hour'],\n [3, 3 * durationHour, 'three hours', timeHour.every(3), 'hour'],\n [6, 6 * durationHour, 'six hours', timeHour.every(6), 'hour'],\n [12, 12 * durationHour, 'twelve hours', timeHour.every(12), 'hour'],\n [1, durationDay, 'daily', timeDay.every(1), 'day'],\n [1, durationWeek, 'weekly', timeWeek.every(1), 'week'],\n [1, durationMonth, 'monthly', timeMonth.every(1), 'week'],\n [3, 3 * durationMonth, 'quaterly', timeMonth.every(3), 'quarter'],\n [6, 6 * durationMonth, 'half yearly', timeMonth.every(6), 'halfYearly'],\n [1, durationYear, 'yearly', timeYear.every(1), 'year'],\n [2, 2 * durationYear, '2 year', timeYear.every(2), 'year'],\n [3, 3 * durationYear, '3 year', timeYear.every(3), 'year'],\n [5, 5 * durationYear, '5 year', timeYear.every(5), 'year'],\n [10, 10 * durationYear, 'decade', timeYear.every(10), 'year'],\n [100, 100 * durationYear, 'century', timeYear.every(100), 'year'],\n [1000, 1000 * durationYear, 'millenium', timeYear.every(1000), 'year']\n];\n/**\n * Get the actual tick interval based on the available width, number of ticks\n * and the distance between two ticks\n *\n * @param {Object} context Axis Context\n * @param {number} noOfTicks Number of Ticks based on which interval is calculated\n * @return {number} The width for the tick interval\n */\nconst getActualTickInterval = (context, noOfTicks) => {\n const minTickDistance = context._minTickDistance;\n const minWidthBetweenTicks = minTickDistance.width;\n\n const { width } = context.availableSpace();\n const actualTickInterval = Math.floor(((width - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks));\n\n return actualTickInterval;\n};\n\n/**\n * Get the tick interval based on the current level of ticks. Levels are decided on\n * the number of ticks that are possible to show\n *\n * @param {Object} context Axis Context\n * @param {string} type Type of level (yearly, monthly, etc)\n * @return {number} The width for the tick interval\n */\nconst getTickIntervalBasedOnCurrentLevel = (context, type) => {\n const labelManager = context._dependencies.labelManager;\n const longestWordType = longestWord[type];\n const measure = labelManager.getOriSize(longestWordType);\n\n return measure.width;\n};\n\nconst getTickIntervalFnBasedOnNumberOfTicks = (interval, count, context) => {\n let possibleTickLevelIndex = tickIntervals.length - 1;\n let maxPossibleTicks = 1;\n let tickIntervalLevelInfo = null;\n\n // Decide possible tick level based on min tick width (with ellipses)\n for (let i = tickIntervals.length - 1; i >= 0; i--) {\n const tickIntervalInfo = tickIntervals[i];\n const numOfPossibleTicks = Math.floor(interval / tickIntervalInfo[1]);\n if (numOfPossibleTicks <= count) {\n possibleTickLevelIndex = i;\n maxPossibleTicks = numOfPossibleTicks;\n }\n }\n\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex];\n\n // Get actual tick interval based on the level of ticks generated\n const actualTickInterval = getActualTickInterval(context, maxPossibleTicks);\n\n // Maximum Possible tick Interval for a particular level based on a pre decided set of values\n const maxTickInterval = getTickIntervalBasedOnCurrentLevel(context, tickIntervalLevelInfo[4]);\n\n // Display the next level involving tick skipping if current level does not meet the requirement\n // for displaying max tick\n if (actualTickInterval < maxTickInterval && possibleTickLevelIndex < tickIntervals.length - 1) {\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex + 1];\n }\n return tickIntervalLevelInfo[3];\n};\n\nexport const getSkippedTicks = (context, maxPossibleTicks) => {\n let actualNumberOfTicks = maxPossibleTicks;\n const domain = context.domain();\n const minDiff = context._minDiff;\n // Get the interval in ms from the domain\n const millisecondInterval = domain[1] - domain[0];\n // Get number of ticks based on the minimum difference in the data\n const numOfTicksAccordingToMinDiff = Math.floor(millisecondInterval / minDiff);\n\n // Show ticks according to min diff if possible\n if (maxPossibleTicks >= numOfTicksAccordingToMinDiff) {\n actualNumberOfTicks = numOfTicksAccordingToMinDiff;\n }\n\n return getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval, actualNumberOfTicks, context);\n};\n","import { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { getSkippedTicks } from './skip-ticks';\nimport { TIME, LINEAR, BAND } from '../enums/scale-type';\n\nexport const applyTickSkipping = (context) => {\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = minTickSpace.width;\n\n const { width } = context.availableSpace();\n\n const maxTicks = Math.floor((width + minWidthBetweenTicks) / (minTickWidth + minWidthBetweenTicks));\n\n const ticks = context.scale().ticks(getSkippedTicks(context, maxTicks));\n\n context.renderConfig({\n tickValues: ticks\n });\n};\n\nconst adjustHorizontalRange = (range, diff) => {\n range[0] += diff;\n range[1] -= diff;\n return range;\n};\n\nconst adjustVerticalRange = (range, diff) => {\n range[0] -= diff;\n range[1] += diff;\n return range;\n};\n\nconst rangeAdjustmentMap = {\n [TOP]: adjustHorizontalRange,\n [BOTTOM]: adjustHorizontalRange,\n [LEFT]: adjustVerticalRange,\n [RIGHT]: adjustVerticalRange\n};\n\nexport const setAxisRange = (context, type, rangeBounds, offset) => {\n context.range(rangeBounds);\n offset && context.renderConfig({ [`${type}Offset`]: offset });\n};\n\nconst getAxisOffset = (timeDiff, range, domain) => {\n const avWidth = Math.abs(range[1] - range[0]);\n const pvr = avWidth / (domain[1] - domain[0]);\n const width = (pvr * timeDiff);\n const bars = avWidth / width;\n const barWidth = avWidth / (bars + 1);\n const diff = avWidth - barWidth * bars;\n\n return diff / 2;\n};\n\nexport const getAdjustedRange = (minDiff, range, domain, config) => {\n const {\n orientation,\n adjustRange\n } = config;\n const diff = getAxisOffset(minDiff, range, domain);\n\n if (adjustRange) {\n return rangeAdjustmentMap[orientation](range, diff);\n }\n return range;\n};\n\nexport const spaceSetter = (context, spaceConfig) => {\n let tickInterval;\n let heightForTicks;\n const config = context.config();\n const {\n width: availWidth,\n height: availHeight,\n padding\n } = context.availableSpace();\n const {\n top,\n left,\n bottom,\n right\n } = padding;\n const {\n isOffset\n } = spaceConfig;\n const {\n showAxisName,\n labels\n } = context.renderConfig();\n const {\n rotation\n } = labels;\n const {\n fixedBaseline,\n axisNamePadding,\n tickValues\n } = config;\n const {\n tickDimensions,\n allTickDimensions,\n axisNameDimensions,\n tickSize\n } = context.getAxisDimensions();\n const {\n height: tickDimHeight,\n width: tickDimWidth\n } = tickDimensions;\n\n const namePadding = showAxisName ? axisNamePadding : 0;\n const labelConfig = { smartTicks: true, rotation: labels.rotation };\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minDiff = context._minDiff;\n const domain = context.domain();\n const axisNameHeight = axisNameDimensions.height;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = Math.min(minTickSpace.width, tickDimWidth);\n const minTickHeight = Math.min(minTickSpace.height, tickDimHeight);\n\n return {\n [TIME]: {\n x: () => {\n !tickValues && context.applyTickSkipping();\n const noOfTicks = context.getTickValues().length;\n\n // Get the Tick Interval\n tickInterval = ((availWidth - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks);\n\n // Get height for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation;\n // Remove ticks if not enough height\n if (tickInterval < minTickHeight) {\n heightForTicks = availHeight;\n tickInterval = minTickHeight;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n const tickShifter = Math.min(tickInterval, tickDimWidth);\n // set range for axis\n setAxisRange(context, 'y', getAdjustedRange(minDiff, [tickShifter / 2,\n availWidth - left - right - tickShifter / 2], domain, config),\n isOffset ? availHeight : null);\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n\n return labelConfig;\n },\n y: () => {\n let widthForTicks = availWidth;\n const tickShifter = tickDimHeight / 2;\n\n setAxisRange(context, 'x', getAdjustedRange(minDiff,\n [availHeight - top - bottom - tickShifter, tickShifter], domain, config),\n isOffset ? availWidth : null);\n\n if ((availWidth - axisNameHeight - namePadding) <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [BAND]: {\n x: () => {\n setAxisRange(context, 'y', [0, availWidth - left - right], isOffset ? availHeight : null);\n const range = context.range();\n\n // Get Tick Interval\n tickInterval = ((range[1] - range[0]) / (tickValues || domain).length) - minWidthBetweenTicks;\n\n // Get height available for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation === null ? -90 : rotation;\n labelConfig.smartTicks = false;\n\n tickInterval = Math.max(heightForTicks, minTickWidth);\n\n if (heightForTicks < minTickWidth) {\n context.renderConfig({ showAxisName: false });\n }\n } else if (tickValues) {\n const interval = (availWidth / domain.length) - minWidthBetweenTicks;\n if (interval < minTickWidth) {\n context.range([minTickHeight / 2, availWidth - minTickHeight / 2]);\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n return labelConfig;\n },\n y: () => {\n setAxisRange(context, 'x', [availHeight - bottom, top], isOffset ? availWidth : null);\n\n let widthForTicks = availWidth - axisNameHeight - tickSize - namePadding;\n if (widthForTicks <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [LINEAR]: {\n x: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimWidth / 2;\n\n const baseline = fixedBaseline ? 0 : tickShifter;\n\n setAxisRange(context, 'y', [baseline + left, availWidth - right - tickShifter],\n isOffset ? availHeight : null);\n\n const range = context.range();\n\n // Get Tick widths and available space\n const totalTickWidth = allTickDimensions.length * (tickDimWidth + minWidthBetweenTicks);\n const availableWidth = range[1] - range[0];\n\n // Rotate labels if not enough width\n if (availableWidth < totalTickWidth && labels.rotation !== null) {\n if (availHeight - tickDimWidth - namePadding - tickSize > axisNameHeight) {\n labelConfig.rotation = null;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: true\n });\n } else {\n labelConfig.rotation = -90;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: false\n\n });\n }\n }\n\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n },\n y: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimensions.height / 2;\n const baseline = fixedBaseline ? 1 : tickShifter;\n\n setAxisRange(context, 'x', [availHeight - bottom - baseline, tickShifter + top],\n isOffset ? availWidth : null);\n\n // Remove display of ticks if no space is left\n if (availWidth < tickDimWidth + axisNameHeight + namePadding) {\n context.renderConfig({ showInnerTicks: false });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n }\n return labelConfig;\n }\n }\n };\n};\n","import { defaultValue } from 'muze-utils';\nimport { TOP, LEFT, BOTTOM } from '../enums/axis-orientation';\nimport { MIN_NO_OF_TICKS, DEFAULT_NO_OF_TICKS } from '../enums/constants';\nimport { setAxisRange, getAdjustedRange } from './space-setter';\n\nexport const getRotatedSpaces = (rotation = 0, width, height) => {\n let rotatedHeight = height;\n let rotatedWidth = width;\n if (rotation) {\n const angle = ((rotation || 0) * Math.PI) / 180;\n rotatedWidth = Math.abs(height * Math.sin(angle)) + Math.abs(width * Math.cos(angle));\n rotatedHeight = Math.abs(width * Math.sin(angle)) + Math.abs(height * Math.cos(angle));\n }\n return { width: rotatedWidth, height: rotatedHeight };\n};\n\nexport const setOffset = (context) => {\n let x = 0;\n let y = 0;\n const logicalSpace = context.logicalSpace();\n const config = context.config();\n const {\n orientation,\n xOffset,\n yOffset\n } = config;\n if (orientation === LEFT) {\n x = xOffset === undefined ? logicalSpace.width : xOffset;\n }\n if (orientation === TOP) {\n y = yOffset === undefined ? logicalSpace.height : yOffset;\n }\n context.renderConfig({ xOffset: x, yOffset: y });\n};\n\nexport const getNumberOfTicks = (availableSpace, labelDim, axis, axisInstance) => {\n let numberOfValues = 0;\n let tickValues = [];\n let { numberOfTicks } = axisInstance.config();\n const ticks = axis.scale().ticks();\n const tickLength = ticks.length;\n const minTickDistance = axisInstance._minTickDistance.width;\n\n numberOfValues = tickLength;\n\n if (tickLength * (labelDim + minTickDistance) > availableSpace) {\n numberOfValues = Math.floor(availableSpace / (labelDim + minTickDistance));\n }\n\n numberOfTicks = numberOfTicks || numberOfValues;\n numberOfValues = Math.min(numberOfTicks, Math.max(MIN_NO_OF_TICKS, numberOfValues));\n\n tickValues = axis.scale().ticks(numberOfValues);\n\n if (tickValues.length > numberOfValues) {\n tickValues = tickValues.filter((e, i) => i % 2 === 0);\n }\n\n if (numberOfValues === MIN_NO_OF_TICKS) {\n tickValues = axis.scale().ticks(DEFAULT_NO_OF_TICKS);\n tickValues = [tickValues[0], tickValues[tickValues.length - 1]];\n }\n return tickValues;\n};\n\nexport const getAxisComponentDimensions = (context) => {\n let largestTick = '';\n let largestTickDimensions = { width: 0, height: 0 };\n let smartTick = {};\n let axisTicks;\n const allTickDimensions = [];\n const scale = context.scale();\n const { tickValues, showAxisName } = context.renderConfig();\n const { name } = context.config();\n const { labelManager } = context.dependencies();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(context._tickLabelStyle);\n\n // get the values along the domain\n axisTicks = tickValues || labelFunc();\n\n // Get the tick labels\n axisTicks = axisTicks.map((originalLabel, i) => {\n const label = context.getFormattedText(originalLabel, i, axisTicks);\n\n // convert to string for quant values\n const tickDimensions = labelManager.getOriSize(label);\n\n // Get spaces for all labels\n allTickDimensions.push(tickDimensions);\n\n // Getting largest label\n if (tickDimensions.width > largestTickDimensions.width) {\n largestTick = label;\n smartTick = context.smartTicks() ? context.smartTicks()[i] : {};\n\n largestTickDimensions = tickDimensions;\n smartTick = smartTick || tickDimensions;\n }\n return label;\n });\n\n labelManager.setStyle(context._axisNameStyle);\n const axisNameDimensions = showAxisName ? labelManager.getOriSize(name) : { width: 0, height: 0 };\n\n return {\n axisNameDimensions,\n largestTick,\n largestTickDimensions,\n allTickDimensions,\n axisTicks,\n smartTick,\n tickSize: context.getTickSize()\n };\n};\n\nexport const computeAxisDimensions = (context) => {\n let tickDimensions = {};\n const { labels } = context.renderConfig();\n const { smartTicks, rotation } = labels;\n const {\n largestTickDimensions,\n axisTicks,\n smartTick,\n axisNameDimensions,\n allTickDimensions,\n tickSize\n } = getAxisComponentDimensions(context);\n const { height: labelHeight, width: labelWidth } = largestTickDimensions;\n\n // get the domain of axis\n const domain = context.domain();\n // const angle = ((rotation || 0) * Math.PI) / 180;\n\n if (domain.length === 0) {\n return null;\n }\n\n if (smartTicks) {\n tickDimensions = smartTick;\n } else {\n tickDimensions = { width: labelWidth, height: labelHeight };\n }\n tickDimensions = getRotatedSpaces(rotation, tickDimensions.width, tickDimensions.height);\n\n if (tickSize === 0) {\n tickDimensions = { width: 0, height: 0 };\n }\n return {\n allTickDimensions,\n tickSize,\n tickDimensions,\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getHorizontalAxisSpace = (context, axisDimensions, range) => {\n let width;\n let height;\n const domain = context.domain();\n const minTickDistance = context._minTickDistance.width;\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n width = range && range.length ? range[1] - range[0] : ((tickDimWidth + minTickDistance) * 3);\n\n height = 0;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n width = ((max - min) / Math.abs(minTickDiff)) * (tickDimWidth + context._minTickDistance.width);\n }\n if (!range || !range.length) {\n height = Math.max(tickDimWidth, tickDimHeight);\n } else {\n height = tickDimHeight;\n }\n\n height += (showAxisName ? axisDimHeight + axisNamePadding : 0) + tickSize;\n\n return {\n width,\n height\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getVerticalAxisSpace = (context, axisDimensions) => {\n let height;\n let width;\n const domain = context.domain();\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n height = 0;\n width = tickDimWidth;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n height = ((max - min) / Math.abs(minTickDiff)) * tickDimHeight;\n }\n width += (showAxisName ? axisDimHeight : 0) + tickSize + axisNamePadding;\n\n return {\n height,\n width\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateBandSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n\n const { orientation } = context.config();\n const { show } = context.renderConfig();\n const { largestTickDimensions, axisTicks, allTickDimensions } = axisDimensions;\n const { height: largestDimHeight } = largestTickDimensions;\n const minTickWidth = context._minTickDistance.width;\n if (orientation === TOP || orientation === BOTTOM) {\n let {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n\n if (!range || !range.length) {\n width = allTickDimensions.reduce((t, n) =>\n t + Math.min(n.width, n.height) + minTickWidth, 0);\n }\n\n if (show === false) {\n height = 0;\n width = 0;\n }\n return {\n width,\n height\n };\n }\n\n let {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n if (!height || height === 0) {\n height = axisTicks.length * (largestDimHeight + context._minTickDistance.height);\n }\n if (show === false) {\n width = 0;\n }\n return {\n width,\n height\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateContinousSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n const { orientation } = context.config();\n const { show, showAxisName } = context.renderConfig();\n const { axisNameDimensions } = axisDimensions;\n\n if (show === false) {\n return {\n width: 0,\n height: 0\n };\n }\n\n const { width: axisNameWidth } = axisNameDimensions;\n\n if (orientation === TOP || orientation === BOTTOM) {\n const {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n const axisWidth = Math.max(width, axisNameWidth);\n\n return {\n width: axisWidth,\n height\n };\n }\n const {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n const effHeight = Math.max(height, showAxisName ? axisNameWidth : 0);\n\n return {\n width,\n height: effHeight\n };\n};\n\n/**\n * Overwrites domain with user defined domain (if present)\n * @param {Object} context reference to current axes\n * @param {Array} domain default domain\n *\n * @return {Array} domain\n */\nexport const getValidDomain = (context, domain) => {\n const { domain: userDom } = context.config();\n\n if (userDom) {\n domain = userDom;\n }\n\n return defaultValue(domain, []);\n};\n\nexport const setContinousAxisDomain = (context, domain) => {\n const { nice } = context.config();\n const scale = context.scale.bind(context);\n\n scale().domain(domain);\n nice && scale().nice();\n context._domain = scale().domain();\n};\n\n/**\n * Checks if any of the properties have changed between two objects\n * @param {Object} obj first object\n * @param {Object} obj1 second object\n * @param {Array} properties properties to be compared between two objects\n *\n * @return {Boolean} boolean value\n */\nexport const hasAxesConfigChanged = (obj = {}, obj1 = {}, properties) => {\n if (!Object.keys(obj).length || !Object.keys(obj1).length) {\n return false;\n }\n return properties.some(key => obj[key] !== obj1[key]);\n};\n\nexport const resetTickInterval = (context, domain) => {\n const {\n orientation,\n isOffset\n } = context.config();\n\n const minDiff = context._minDiff;\n // Set available space on interaction\n if (context.range().length && (orientation === TOP || orientation === BOTTOM)) {\n context.applyTickSkipping();\n const {\n largestTickDimensions\n } = context.getAxisDimensions();\n\n const noOfTicks = context.getTickValues().length;\n\n const { width, height, padding } = context.availableSpace();\n const {\n left,\n right\n } = padding;\n // Get the Tick Interval\n const tickInterval = Math.min(largestTickDimensions.width,\n ((width - (noOfTicks - 1) * (context._minTickDistance.width)) / noOfTicks));\n\n context.maxTickSpaces({\n width: tickInterval\n });\n\n const adjustedRange = getAdjustedRange(minDiff, [tickInterval / 2,\n width - left - right - tickInterval / 2], domain, context.config());\n\n // set range for axis\n setAxisRange(context, 'y', adjustedRange, isOffset ? height : null);\n\n context.setTickConfig();\n }\n};\n\nexport const getSmartAxisName = (name, width, labelManager) => {\n const oriSize = labelManager.getOriSize(name);\n\n labelManager.useEllipsesOnOverflow(true);\n\n return labelManager.getSmartText(name, width, oriSize.height, true);\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { hasAxesConfigChanged } from './helper';\n\nexport const PROPS = {\n availableSpace: {},\n axisDimensions: {},\n axisComponentDimensions: {},\n config: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._config || {});\n const mockedOldConfig = mergeRecursive({}, oldConfig);\n value = mergeRecursive(mockedOldConfig, value);\n\n value.axisNamePadding = Math.max(value.axisNamePadding, 0);\n const shouldAxesScaleUpdate = hasAxesConfigChanged(\n value, oldConfig, ['interpolator', 'exponent', 'base', 'orientation']\n );\n const tickFormatter = context.sanitizeTickFormatter(value);\n\n if (shouldAxesScaleUpdate) {\n context._scale = context.createScale(value);\n context._axis = context.createAxis(value);\n }\n\n context._tickFormatter = ticks => tickFormatter(ticks);\n\n context.resetRenderConfig(value);\n return value;\n }\n },\n renderConfig: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._renderConfig || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n logicalSpace: {},\n mount: {\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.logicalSpace(null);\n return value;\n }\n },\n\n smartTicks: {},\n tickSize: {},\n maxTickSpaces: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._maxTickSpaces || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n valueParser: {\n defaultValue: val => val\n }\n};\n","import {\n mergeRecursive,\n getSmartComputedStyle,\n selectElement,\n generateGetterSetters,\n getUniqueId\n} from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { axisOrientationMap, BOTTOM, TOP } from '../enums/axis-orientation';\nimport { defaultConfig } from './default-config';\nimport { renderAxis } from '../axis-renderer';\nimport { spaceSetter } from './space-setter';\nimport {\n getAxisComponentDimensions,\n computeAxisDimensions,\n calculateContinousSpace,\n setOffset,\n getValidDomain,\n getSmartAxisName\n} from './helper';\nimport { PROPS } from './props';\n\nexport default class SimpleAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @memberof SimpleAxis\n */\n constructor (config, dependencies) {\n this._id = getUniqueId();\n\n this._dependencies = dependencies;\n this._mount = null;\n this._range = [];\n this._domain = [];\n this._domainLock = false;\n this._axisDimensions = {};\n this._smartTicks = [];\n\n const defCon = mergeRecursive({}, this.constructor.defaultConfig());\n const simpleConfig = mergeRecursive(defCon, config);\n\n const bodyElem = selectElement('body');\n const classPrefix = simpleConfig.classPrefix;\n this._tickLabelStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-ticks`);\n this._axisNameStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-axis-name`);\n\n dependencies.labelManager.setStyle(this._tickLabelStyle);\n const dist = dependencies.labelManager.getOriSize('w');\n\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n this._minTickSpace = dependencies.labelManager.getOriSize('www...');\n\n generateGetterSetters(this, PROPS);\n this.config(simpleConfig);\n\n this._scale = this.createScale(this._config);\n this._axis = this.createAxis(this._config);\n this._animationDonePromises = [];\n }\n\n /**\n * Returns the default configuration of simple axis\n * @return {Object} default configurations\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline () {\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n scale (...params) {\n if (params.length) {\n this._scale = params[0];\n return this;\n }\n return this._scale;\n }\n\n resetDomain () {\n this._domain = [];\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n axis (...params) {\n if (params.length) {\n this._axis = params[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n this.scale().domain(domainValue);\n this._domain = this.scale().domain();\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n setAxisComponentDimensions () {\n this.axisComponentDimensions(getAxisComponentDimensions(this));\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const scale = createScale({\n padding,\n interpolator,\n exponent,\n base,\n range,\n type: this.constructor.type()\n });\n\n return scale;\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat, numberFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(numberFormat(val), val, i, ticks);\n }\n\n return () => val => numberFormat(val);\n }\n\n resetRenderConfig (config) {\n const {\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n } = config;\n this.renderConfig({\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n });\n return this;\n }\n\n resetLogicalSpace () {\n this.logicalSpace(null);\n this.range([]);\n\n this.resetRenderConfig(this.config());\n }\n\n getFormattedText (text, index, axisTicks) {\n const formatter = this._tickFormatter;\n\n return formatter(axisTicks)(text, index);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createAxis (config) {\n const { orientation } = config;\n const axisClass = axisOrientationMap[orientation];\n\n if (axisClass) {\n const axis = axisClass(this.scale());\n return axis;\n }\n return null;\n }\n\n setTickValues (tickValues) {\n const renderConfig = this.renderConfig();\n this.config({ ...renderConfig, tickValues });\n this.tickValues = tickValues;\n this.axis().tickValues(tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (width = 0, height, padding, isOffset) {\n let labelConfig = {};\n const {\n orientation\n } = this.config();\n\n this.availableSpace({ width, height, padding });\n const type = this.constructor.type();\n\n if (orientation === TOP || orientation === BOTTOM) {\n labelConfig = spaceSetter(this, { isOffset })[type].x();\n } else {\n labelConfig = spaceSetter(this, { isOffset })[type].y();\n }\n\n // Set config\n this.renderConfig({\n labels: labelConfig\n });\n this.setTickConfig();\n this.setSmartAxisName();\n return this;\n }\n\n setSmartAxisName () {\n const { orientation, name } = this.config();\n const dimType = (orientation === TOP || orientation === BOTTOM) ? 'width' : 'height';\n const widthDim = this.availableSpace()[dimType];\n const labelManager = this.dependencies().labelManager;\n labelManager.setStyle(this._axisNameStyle);\n this.renderConfig({\n smartAxisName: getSmartAxisName(name, widthDim, labelManager)\n });\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n return this;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this.scale()(domainVal);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n return this.axis().tickSize();\n }\n\n /**\n * Gets the space occupied by the parts of an axis\n *\n * @return {Object} object with details about sizes of the axis.\n * @memberof SimpleAxis\n */\n getAxisDimensions (...params) {\n this.axisDimensions(computeAxisDimensions(this, ...params));\n return this.axisDimensions();\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateContinousSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n * Returns the value from the domain when given a value from the range.\n * @param {number} value Value from the range.\n * @return {number} Value\n */\n invert (value) {\n return this.scale().invert(value);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n *\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n return [v1, v2];\n }\n\n invertExtent (v1, v2) {\n return [this.invert(v1), this.invert(v2)];\n }\n\n getMinTickDifference () {\n return this.domain();\n }\n\n getFormattedTickValues (tickValues) {\n return tickValues;\n }\n\n /**\n * This method returns the width in pixels for one\n * unit along the axis. It is only applicable to band scale\n * and returns undefined for other scale type.\n *\n * @return {number} the width of one band along band scale axis\n * @memberof SimpleAxis\n */\n getUnitWidth () {\n return 0;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof SimpleAxis\n */\n serialize () {\n return {\n name: this.name,\n type: this.type,\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to render the axis inside\n * the supplied svg container.\n *\n * @param {SVGElement} svg the svg element in which to render the path\n * @memberof SimpleAxis\n */\n /* istanbul ignore next */render () {\n if (this.mount()) {\n this.setTickConfig();\n renderAxis(this);\n }\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n remove () {\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n unsubscribe () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n isReverse () {\n const range = this.range();\n return range[0] > range[1];\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getPixelToValueRatio () {\n const scale = this.scale();\n const range = scale.range();\n const domain = scale.domain();\n\n return Math.abs(range[1] - range[0]) / (domain[1] - domain[0]);\n }\n\n /**\n * Notifies when all animations/transitions of the axis are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n}\n\n","import { sanitizeDomainWhenEqual } from 'muze-utils';\nimport { scaleMap } from '../../scale-creator';\n\nexport default class LinearInterpolator {\n\n createScale (config) {\n const {\n range\n } = config;\n const scaleFactory = scaleMap.linear;\n this._scale = scaleFactory().range(range);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain.length) {\n domain = sanitizeDomainWhenEqual(domain);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class LogInterpolator {\n\n createScale (config) {\n const {\n range,\n base\n } = config;\n const scaleFactory = scaleMap.log;\n this._scale = scaleFactory().range(range).base(base);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n const scale = this._scale;\n if (domainVal <= 0) {\n return scale(scale.domain()[0]);\n }\n\n return scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain[0] <= 0) {\n domain[0] = Math.max(1, domain[0]);\n }\n if (domain[1] <= 0) {\n domain[1] = Math.max(1, domain[1]);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class PowInterpolator {\n\n createScale (config) {\n const {\n range,\n exponent\n } = config;\n const scaleFactory = scaleMap.pow;\n this._scale = scaleFactory().range(range).exponent(exponent);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n return domain;\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { LINEAR, LOG, POW } from '../enums/scale-type';\nimport { LogInterpolator, PowInterpolator, LinearInterpolator } from './interpolators';\nimport {\n getNumberOfTicks,\n getValidDomain,\n setContinousAxisDomain\n} from './helper';\n\nexport const interpolatorMap = {\n [LOG]: LogInterpolator,\n [POW]: PowInterpolator,\n [LINEAR]: LinearInterpolator\n};\n\nexport default class ContinousAxis extends SimpleAxis {\n constructor (config, dependencies) {\n config.tickFormat = config.tickFormat || (val => val);\n super(config, dependencies);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const InterpolatorCls = interpolatorMap[interpolator];\n\n this._interpolator = new InterpolatorCls();\n let scale = this._interpolator.createScale({\n padding,\n exponent,\n base,\n range\n });\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ContinousAxis\n */\n static type () {\n return LINEAR;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this._interpolator.getScaleValue(domainVal);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n\n return axis.tickSize();\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainVal = this._interpolator.sanitizeDomain(getValidDomain(this, domain[0]));\n setContinousAxisDomain(this, domainVal);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @param {*} tickValues\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n const {\n tickValues,\n showInnerTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n if (!showInnerTicks) {\n axis.tickValues([]);\n return this;\n }\n\n if (tickValues) {\n tickValues instanceof Array && this.axis().tickValues(tickValues);\n }\n const newTickValues = this.getTickValues();\n\n axis.tickValues(newTickValues);\n const smartLabel = this.dependencies().labelManager;\n smartLabel.setStyle(this._tickLabelStyle);\n const formatter = this._tickFormatter(newTickValues);\n const smartTicks = newTickValues.map((val, i) => {\n const text = formatter(val, i);\n const tickSpace = smartLabel.getOriSize(text);\n\n tickSpace.text = text;\n return tickSpace;\n });\n\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickValues () {\n let labelDim = 0;\n const {\n orientation\n\n } = this.config();\n const {\n tickValues\n } = this.renderConfig();\n const range = this.range();\n const axis = this.axis();\n\n const availableSpace = Math.abs(range[0] - range[1]);\n\n const labelProps = this.axisComponentDimensions().largestTickDimensions;\n\n if (tickValues) {\n return tickValues;\n }\n labelDim = labelProps[orientation === BOTTOM || orientation === TOP ? 'width' : 'height'];\n\n return getNumberOfTicks(availableSpace, labelDim, axis, this);\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.renderConfig().tickValues);\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline (tickText) {\n const {\n orientation\n } = this.config();\n const {\n labels\n } = this.renderConfig();\n\n const {\n rotation\n } = labels;\n const axis = this.axis();\n const ticks = axis.tickValues();\n const smartTicks = this.smartTicks();\n\n if (smartTicks && smartTicks.length) {\n const { width, height } = this.smartTicks()[0];\n\n axis.tickTransform((d) => {\n if (d === ticks[0]) {\n if ((orientation === LEFT || orientation === RIGHT)) {\n return `translate(0, -${(height) / 3}px)`;\n }\n\n if ((orientation === TOP || orientation === BOTTOM) && !rotation) {\n return `translate(${width / 2}px, ${0}px)`;\n }\n } return '';\n });\n }\n return tickText;\n }\n\n}\n","import SimpleAxis from './simple-axis';\nimport { BAND } from '../enums/scale-type';\nimport { calculateBandSpace, setOffset, getRotatedSpaces } from './helper';\n\nexport default class BandAxis extends SimpleAxis {\n /**\n *\n *\n * @static\n *\n * @memberof BandAxis\n */\n static type () {\n return BAND;\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks = '';\n let smartlabel;\n const domain = this.domain();\n const { labelManager } = this._dependencies;\n const { padding } = this.config();\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n tickValues && this.axis().tickValues(tickValues);\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n // Update padding between plots\n if (typeof padding === 'number') {\n const paddingNormalized = Math.min(1, Math.max(0, padding));\n this.scale().padding(paddingNormalized);\n }\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n *\n *\n * @memberof BandAxis\n */\n getTickValues () {\n return this.axis().scale().domain();\n }\n\n formatTickValue (val) {\n return this.valueParser()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(this.formatTickValue(val), val, i, ticks);\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n getUnitWidth () {\n return this.scale().bandwidth();\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n axis.tickSizeInner(showInnerTicks ? 6 : 0);\n axis.tickSizeOuter(showOuterTicks ? 6 : 0);\n return axis.tickSize();\n }\n\n invertExtent (v1, v2) {\n return this.scale().invertExtent(v1, v2);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n const scale = this.scale();\n const range = scale.range();\n const reverse = range[0] > range[1];\n\n const extent = this.invertExtent(v1, v2);\n const p1 = scale(reverse ? extent[extent.length - 1] : extent[0]);\n const p2 = scale(reverse ? extent[0] : extent[extent.length - 1]) + scale.bandwidth();\n return [p1, p2];\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { TIME } from '../enums/scale-type';\nimport { calculateBandSpace, getRotatedSpaces, getValidDomain, setContinousAxisDomain, setOffset,\n resetTickInterval } from './helper';\nimport { applyTickSkipping } from './space-setter';\n\n/**\n *\n *\n * @export\n * @class TimeAxis\n * @extends {SimpleAxis}\n */\nexport default class TimeAxis extends SimpleAxis {\n\n constructor (...params) {\n super(...params);\n this._minDiff = Infinity;\n }\n\n /**\n *\n *\n * @param {*} range\n *\n * @memberof TimeAxis\n */\n createScale (range) {\n let scale = super.createScale(range);\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TimeAxis\n */\n static type () {\n return TIME;\n }\n\n formatTickValue (val) {\n return this.scale().tickFormat()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return (ticks) => {\n const rawTicks = ticks.map(t => t.getTime());\n return (val, i) => tickFormat(this.formatTickValue(val), val.getTime(), i, rawTicks);\n };\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n return super.getTickSize();\n }\n\n /**\n *\n *\n *\n * @memberof TimeAxis\n */\n getTickValues () {\n return this.renderConfig().tickValues || this.scale().ticks();\n }\n\n /**\n *\n *\n * @param {*} diff\n *\n * @memberof TimeAxis\n */\n minDiff (diff) {\n this._minDiff = Math.min(this._minDiff, diff);\n return this;\n }\n\n applyTickSkipping () {\n applyTickSkipping(this);\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n setContinousAxisDomain(this, domainValue);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n\n resetTickInterval(this, domainValue);\n return this;\n }\n return this._domain;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.config().tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @returns\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks;\n let smartlabel;\n\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { labelManager } = this._dependencies;\n const domain = this.getTickValues();\n\n tickValues && this.axis().tickValues(tickValues);\n\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n\n this.smartTicks(smartTicks);\n return this;\n }\n}\n","export const x11Colors = {\n Pink: { hex: 'ffc0cb', rgb: '255,192,203' },\n LightPink: { hex: 'ffb6c1', rgb: '255,182,193' },\n HotPink: { hex: 'ff69b4', rgb: '255,105,180' },\n DeepPink: { hex: 'ff1493', rgb: '255,20,147' },\n PaleVioletRed: { hex: 'db7093', rgb: '219,112,147' },\n MediumVioletRed: { hex: 'c71585', rgb: '199,21,133' },\n LightSalmon: { hex: 'ffa07a', rgb: '255,160,122' },\n Salmon: { hex: 'fa8072', rgb: '250,128,114' },\n DarkSalmon: { hex: 'e9967a', rgb: '233,150,122' },\n LightCoral: { hex: 'f08080', rgb: '240,128,128' },\n IndianRed: { hex: 'cd5c5c', rgb: '205,92,92' },\n Crimson: { hex: 'dc143c', rgb: '220,20,60' },\n FireBrick: { hex: 'b22222', rgb: '178,34,34' },\n DarkRed: { hex: '8b0000', rgb: '139,0,0' },\n Red: { hex: 'ff0000', rgb: '255,0,0' },\n OrangeRed: { hex: 'ff4500', rgb: '255,69,0' },\n Tomato: { hex: 'ff6347', rgb: '255,99,71' },\n Coral: { hex: 'ff7f50', rgb: '255,127,80' },\n DarkOrange: { hex: 'ff8c00', rgb: '255,140,0' },\n Orange: { hex: 'ffa500', rgb: '255,165,0' },\n Gold: { hex: 'ffd700', rgb: '255,215,0' },\n Yellow: { hex: 'ffff00', rgb: '255,255,0' },\n LightYellow: { hex: 'ffffe0', rgb: '255,255,224' },\n LemonChiffon: { hex: 'fffacd', rgb: '255,250,205' },\n LightGoldenrodYellow: { hex: 'fafad2', rgb: '250,250,210' },\n PapayaWhip: { hex: 'ffefd5', rgb: '255,239,213' },\n Moccasin: { hex: 'ffe4b5', rgb: '255,228,181' },\n PeachPuff: { hex: 'ffdab9', rgb: '255,218,185' },\n PaleGoldenrod: { hex: 'eee8aa', rgb: '238,232,170' },\n Khaki: { hex: 'f0e68c', rgb: '240,230,140' },\n DarkKhaki: { hex: 'bdb76b', rgb: '189,183,107' },\n Cornsilk: { hex: 'fff8dc', rgb: '255,248,220' },\n BlanchedAlmond: { hex: 'ffebcd', rgb: '255,235,205' },\n Bisque: { hex: 'ffe4c4', rgb: '255,228,196' },\n NavajoWhite: { hex: 'ffdead', rgb: '255,222,173' },\n Wheat: { hex: 'f5deb3', rgb: '245,222,179' },\n BurlyWood: { hex: 'deb887', rgb: '222,184,135' },\n Tan: { hex: 'd2b48c', rgb: '210,180,140' },\n RosyBrown: { hex: 'bc8f8f', rgb: '188,143,143' },\n SandyBrown: { hex: 'f4a460', rgb: '244,164,96' },\n Goldenrod: { hex: 'daa520', rgb: '218,165,32' },\n DarkGoldenrod: { hex: 'b8860b', rgb: '184,134,11' },\n Peru: { hex: 'cd853f', rgb: '205,133,63' },\n Chocolate: { hex: 'd2691e', rgb: '210,105,30' },\n SaddleBrown: { hex: '8b4513', rgb: '139,69,19' },\n Sienna: { hex: 'a0522d', rgb: '160,82,45' },\n Brown: { hex: 'a52a2a', rgb: '165,42,42' },\n Maroon: { hex: '800000', rgb: '128,0,0' },\n DarkOliveGreen: { hex: '556b2f', rgb: '85,107,47' },\n Olive: { hex: '808000', rgb: '128,128,0' },\n OliveDrab: { hex: '6b8e23', rgb: '107,142,35' },\n YellowGreen: { hex: '9acd32', rgb: '154,205,50' },\n LimeGreen: { hex: '32cd32', rgb: '50,205,50' },\n Lime: { hex: '00ff00', rgb: '0,255,0' },\n LawnGreen: { hex: '7cfc00', rgb: '124,252,0' },\n Chartreuse: { hex: '7fff00', rgb: '127,255,0' },\n GreenYellow: { hex: 'adff2f', rgb: '173,255,47' },\n SpringGreen: { hex: '00ff7f', rgb: '0,255,127' },\n MediumSpringGreen: { hex: '00fa9a', rgb: '0,250,154' },\n LightGreen: { hex: '90ee90', rgb: '144,238,144' },\n PaleGreen: { hex: '98fb98', rgb: '152,251,152' },\n DarkSeaGreen: { hex: '8fbc8f', rgb: '143,188,143' },\n MediumSeaGreen: { hex: '3cb371', rgb: '60,179,113' },\n SeaGreen: { hex: '2e8b57', rgb: '46,139,87' },\n ForestGreen: { hex: '228b22', rgb: '34,139,34' },\n Green: { hex: '008000', rgb: '0,128,0' },\n DarkGreen: { hex: '006400', rgb: '0,100,0' },\n MediumAquamarine: { hex: '66cdaa', rgb: '102,205,170' },\n Aqua: { hex: '00ffff', rgb: '0,255,255' },\n Cyan: { hex: '00ffff', rgb: '0,255,255' },\n LightCyan: { hex: 'e0ffff', rgb: '224,255,255' },\n PaleTurquoise: { hex: 'afeeee', rgb: '175,238,238' },\n Aquamarine: { hex: '7fffd4', rgb: '127,255,212' },\n Turquoise: { hex: '40e0d0', rgb: '64,224,208' },\n MediumTurquoise: { hex: '48d1cc', rgb: '72,209,204' },\n DarkTurquoise: { hex: '00ced1', rgb: '0,206,209' },\n LightSeaGreen: { hex: '20b2aa', rgb: '32,178,170' },\n CadetBlue: { hex: '5f9ea0', rgb: '95,158,160' },\n DarkCyan: { hex: '008b8b', rgb: '0,139,139' },\n Teal: { hex: '008080', rgb: '0,128,128' },\n LightSteelBlue: { hex: 'b0c4de', rgb: '176,196,222' },\n PowderBlue: { hex: 'b0e0e6', rgb: '176,224,230' },\n LightBlue: { hex: 'add8e6', rgb: '173,216,230' },\n SkyBlue: { hex: '87ceeb', rgb: '135,206,235' },\n LightSkyBlue: { hex: '87cefa', rgb: '135,206,250' },\n DeepSkyBlue: { hex: '00bfff', rgb: '0,191,255' },\n DodgerBlue: { hex: '1e90ff', rgb: '30,144,255' },\n CornflowerBlue: { hex: '6495ed', rgb: '100,149,237' },\n SteelBlue: { hex: '4682b4', rgb: '70,130,180' },\n RoyalBlue: { hex: '4169e1', rgb: '65,105,225' },\n Blue: { hex: '0000ff', rgb: '0,0,255' },\n MediumBlue: { hex: '0000cd', rgb: '0,0,205' },\n DarkBlue: { hex: '00008b', rgb: '0,0,139' },\n Navy: { hex: '000080', rgb: '0,0,128' },\n MidnightBlue: { hex: '191970', rgb: '25,25,112' },\n Lavender: { hex: 'e6e6fa', rgb: '230,230,250' },\n Thistle: { hex: 'd8bfd8', rgb: '216,191,216' },\n Plum: { hex: 'dda0dd', rgb: '221,160,221' },\n Violet: { hex: 'ee82ee', rgb: '238,130,238' },\n Orchid: { hex: 'da70d6', rgb: '218,112,214' },\n Fuchsia: { hex: 'ff00ff', rgb: '255,0,255' },\n Magenta: { hex: 'ff00ff', rgb: '255,0,255' },\n MediumOrchid: { hex: 'ba55d3', rgb: '186,85,211' },\n MediumPurple: { hex: '9370db', rgb: '147,112,219' },\n BlueViolet: { hex: '8a2be2', rgb: '138,43,226' },\n DarkViolet: { hex: '9400d3', rgb: '148,0,211' },\n DarkOrchid: { hex: '9932cc', rgb: '153,50,204' },\n DarkMagenta: { hex: '8b008b', rgb: '139,0,139' },\n Purple: { hex: '800080', rgb: '128,0,128' },\n Indigo: { hex: '4b0082', rgb: '75,0,130' },\n DarkSlateBlue: { hex: '483d8b', rgb: '72,61,139' },\n SlateBlue: { hex: '6a5acd', rgb: '106,90,205' },\n MediumSlateBlue: { hex: '7b68ee', rgb: '123,104,238' },\n White: { hex: 'ffffff', rgb: '255,255,255' },\n Snow: { hex: 'fffafa', rgb: '255,250,250' },\n Honeydew: { hex: 'f0fff0', rgb: '240,255,240' },\n MintCream: { hex: 'f5fffa', rgb: '245,255,250' },\n Azure: { hex: 'f0ffff', rgb: '240,255,255' },\n AliceBlue: { hex: 'f0f8ff', rgb: '240,248,255' },\n GhostWhite: { hex: 'f8f8ff', rgb: '248,248,255' },\n WhiteSmoke: { hex: 'f5f5f5', rgb: '245,245,245' },\n Seashell: { hex: 'fff5ee', rgb: '255,245,238' },\n Beige: { hex: 'f5f5dc', rgb: '245,245,220' },\n OldLace: { hex: 'fdf5e6', rgb: '253,245,230' },\n FloralWhite: { hex: 'fffaf0', rgb: '255,250,240' },\n Ivory: { hex: 'fffff0', rgb: '255,255,240' },\n AntiqueWhite: { hex: 'faebd7', rgb: '250,235,215' },\n Linen: { hex: 'faf0e6', rgb: '250,240,230' },\n LavenderBlush: { hex: 'fff0f5', rgb: '255,240,245' },\n MistyRose: { hex: 'ffe4e1', rgb: '255,228,225' },\n Gainsboro: { hex: 'dcdcdc', rgb: '220,220,220' },\n LightGray: { hex: 'd3d3d3', rgb: '211,211,211' },\n Silver: { hex: 'c0c0c0', rgb: '192,192,192' },\n DarkGrey: { hex: 'a9a9a9', rgb: '169,169,169' },\n Grey: { hex: '808080', rgb: '128,128,128' },\n DimGrey: { hex: '696969', rgb: '105,105,105' },\n LightSlateGrey: { hex: '778899', rgb: '119,136,153' },\n SlateGrey: { hex: '708090', rgb: '112,128,144' },\n DarkSlateGrey: { hex: '2f4f4f', rgb: '47,79,79' },\n Black: { hex: '000000', rgb: '0,0,0' }\n};\n","import {\n LINEAR\n} from '../enums/constants';\n/**\n * Set of default colors\n */\nexport const palette = [\n '#086bb6',\n '#f37d45',\n '#f5ce02',\n '#67bda0',\n '#c54e4e',\n '#ae70af'\n];\n\nexport const DEFAULT_GRADIENT_COLOR = '#eaeaea';\n\nexport const DEFAULT_CONFIG = {\n range: palette,\n value: palette[0],\n step: false,\n stops: 5,\n type: LINEAR\n};\n","import { mergeRecursive, detectColor, hexToHsv, rgbToHsv, defaultValue } from 'muze-utils';\nimport { x11Colors } from './color-maps';\nimport { palette, DEFAULT_GRADIENT_COLOR } from './defaults';\nimport { LINEAR, RGB, HEX, HSL, HSLA } from '../enums/constants';\n\nexport const getHslString = hslArr => `hsla(${hslArr[0] * 360},${hslArr[1] * 100}%,${hslArr[2] * 100}%,\\\n${hslArr[3] || 1})`;\n\nexport const convertToXllString = baseString => (baseString.split(' ') || [])\n .reduce((x, e) => `${x}${e.charAt(0).toUpperCase()}${e.slice(1)}`, '');\n\nexport const getActualHslColor = (e, paletteColor) => {\n let color = '';\n if (typeof e === 'string') {\n e = e.replace(/ /g, '');\n e = e.toLowerCase();\n if (detectColor(e) === HSL || detectColor(e) === HSLA) {\n color = e.match(/(\\d+(\\.\\d+)?)/g);\n color = [color[0] / 360, color[1] / 100, color[2] / 100, defaultValue(Number(color[3]), 1)];\n } else if (detectColor(e) === HEX) {\n color = hexToHsv(e);\n } else if (detectColor(e) === RGB) {\n const col = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')')).split(/,\\s*/);\n color = rgbToHsv(...col);\n } else if (x11Colors[convertToXllString(e)]) {\n color = rgbToHsv(...x11Colors[convertToXllString(e)].rgb.split(','));\n }\n } else if (!(e instanceof Array)) {\n color = rgbToHsv(paletteColor);\n } else {\n color = e;\n }\n return color;\n};\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => {\n const defCon = mergeRecursive({}, context.constructor.defaultConfig());\n if (config.type === LINEAR) {\n config.range = config.range || [defCon.range[0]];\n config.range = config.range.length > 1 ? config.range : [DEFAULT_GRADIENT_COLOR, ...config.range];\n }\n const oldConfig = mergeRecursive(defCon, context.config());\n const newConfig = mergeRecursive(oldConfig, config);\n\n if (newConfig.range instanceof Array) {\n newConfig.range = newConfig.range.map((e, i) => getActualHslColor(e, palette[i]));\n newConfig.stops = config.stops || newConfig.range.length;\n }\n newConfig.value = getActualHslColor(newConfig.value, newConfig.value);\n return newConfig;\n }\n },\n domain: {},\n scale: {},\n uniqueValues: {}\n};\n","import { InvalidAwareTypes, getObjProp } from 'muze-utils';\n\nexport const treatNullMeasures = (domainVal, scaledVal, minDomainScaledVal) => {\n if (domainVal instanceof InvalidAwareTypes) {\n return minDomainScaledVal;\n }\n return scaledVal;\n};\n\nexport const resolveAxisConfig = (propVal, defaultVal, context) => {\n const constructor = getObjProp(propVal, 'constructor');\n switch (constructor) {\n case Function:\n return propVal(defaultVal, context);\n case Array:\n return propVal;\n default:\n return defaultVal;\n }\n};\n","import { numberInterpolator, piecewiseInterpolator, hslInterpolator, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, SEQUENTIAL, ORDINAL, QUANTILE } from '../enums/scale-type';\nimport { getHslString } from './props';\nimport { treatNullMeasures } from '../helper';\n\nconst getStops = (domain, stops) => {\n let newStops = [];\n\n if (stops instanceof Array) {\n newStops = stops.slice().sort();\n newStops = [...new Set([domain[0], ...stops, domain[1]])].sort();\n } else {\n const interpolator = numberInterpolator()(...domain);\n for (let i = 0; i <= stops; i++) {\n newStops[i] = interpolator(i / stops);\n }\n }\n\n if (newStops[0] < domain[0]) {\n newStops.shift();\n }\n return { domain, newStops };\n};\n\nconst rangeStops = (newStopsLength, range) => {\n let newRange = [];\n const maxRangeLength = Math.min(range.length, 18);\n\n if (newStopsLength > maxRangeLength) {\n const interpolator = piecewiseInterpolator()(hslInterpolator(), range.map(e => getHslString(e)));\n for (let i = 0; i < newStopsLength; i++) {\n newRange[i] = interpolator(i / (newStopsLength - 1));\n }\n } else {\n newRange = range.slice(0, newStopsLength);\n }\n return { newRange };\n};\n\n/**\n*\n*\n* @param {*} domain\n*\n*/\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomainMeasure = (domain, stops, range) => {\n const uniqueVals = domain;\n return { domain, uniqueVals, scaleDomain: [0, 1], range };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain, stops, range) => {\n const uniqueVals = domain;\n return { uniqueVals, domain, nice: true, range };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} stops\n *\n */\nconst steppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(domain, stops);\n const { newRange } = rangeStops(newStops.length - 1, range);\n\n return { uniqueVals, domain: newStops, nice: true, range: newRange };\n};\n\nconst continousSteppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(sanitizeDomainWhenEqual(domain), range.length - 1);\n const hslRange = range.map(e => getHslString(e));\n return { uniqueVals, domain: newStops, nice: true, range: hslRange };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst uniqueRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n return scale(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst indexedRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n\n return treatNullMeasures(domainValue, scale(numVal), scale(0));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) => treatNullMeasures(domainValue, scale(domainValue),\n scale(domain[0]));\n\n/**\n *\n *\n * @param {*} stops\n */\nconst strategies = () => ({\n [`${CONTINOUS}-${CONTINOUS}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${CONTINOUS}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${DISCRETE}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomain,\n value: () => uniqueRange\n },\n [`${DISCRETE}-${DISCRETE}-${ORDINAL}`]: {\n scale: ORDINAL,\n domainRange: () => normalDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${CONTINOUS}-${ORDINAL}`]: {\n scale: LINEAR,\n domainRange: () => continousSteppedDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${DISCRETE}-${ORDINAL}`]: {\n scale: QUANTILE,\n domainRange: () => steppedDomain,\n value: () => normalRange\n\n }\n});\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} stops\n */\nexport const strategyGetter = (domainType, rangeType, schemeType) =>\n strategies()[`${domainType}-${rangeType}-${schemeType || ''}`];\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters, rgbToHsv, defaultValue } from 'muze-utils';\nimport { createScale, getScheme, getSchemeType } from '../scale-creator';\nimport { CONTINOUS, DISCRETE, COLOR } from '../enums/constants';\nimport { strategyGetter } from './color-strategy';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { PROPS, getHslString, getActualHslColor } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ColorAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @param {Object | undefined} params.range Type of color range.\n * @param {string} params.name the label to show on axis.\n * @param {string} params.type The type of scale to handle.\n * @memberof ColorAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n this.config(config);\n\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = (this._config.type === 'linear' && !this._config.step) ? CONTINOUS : DISCRETE;\n\n this._schemeType = getSchemeType(this._config.range);\n\n this._colorStrategy = this.setColorStrategy(this._domainType, this._rangeType, this._schemeType);\n this._scale = this.createScale(this._colorStrategy);\n\n this._id = getUniqueId();\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return COLOR;\n }\n\n /**\n *\n *\n * @param {*} colorStrategy\n *\n * @memberof ColorAxis\n */\n createScale (colorStrategy) {\n const { range } = this.config();\n if (range && typeof (range) === 'string') {\n return getScheme(range);\n }\n return createScale({\n type: colorStrategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setColorStrategy (domainType, rangeType, schemeType) {\n return strategyGetter(domainType, rangeType, schemeType);\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getHslString (hslColorArray) {\n return getHslString(hslColorArray);\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getColor (domainVal) {\n return this.getHslString(this.getRawColor(domainVal));\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getRawColor (domainVal) {\n if (this.domain() && domainVal !== undefined) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const color = this._colorStrategy.value(range)(domainVal, scale, this.domain(), this.uniqueValues());\n if (color) {\n if (typeof color === 'string') {\n const col = color.substring(color.indexOf('(') + 1, color.lastIndexOf(')')).split(/,\\s*/);\n return rgbToHsv(...col);\n }\n return [...color];\n }\n }\n return [...this.config().value];\n }\n\n /**\n *\n *\n * @param {*} [domain=[]]\n *\n * @memberof ColorAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const domainRangeFn = this._colorStrategy.domainRange();\n const scaleInfo = domainRangeFn(domain, this.config().stops, range);\n\n this.domain(scaleInfo.domain);\n scaleInfo.range && this.scale().range(scaleInfo.range);\n this.uniqueValues(scaleInfo.uniqueVals);\n this.scale().domain(scaleInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n config: this.config()\n };\n }\n\n transformColor (color, transformationArr) {\n const h = color[0] * 360;\n const s = color[1] * 100;\n const l = color[2] * 100;\n const a = Math.min(defaultValue(color[3], 0), 1);\n const newH = h + transformationArr[0];\n const newS = s + transformationArr[1];\n const newL = l + transformationArr[2];\n const newA = Math.min(a + transformationArr[3] || 0, 1);\n\n return { color: `hsla(${newH},${newS}%,${newL}%,${newA})`, hsla: [newH / 360, newS / 100, newL / 100, newA] };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n\n getHslArray (color) {\n return getActualHslColor(color);\n }\n\n}\n","export const DEFAULT_CONFIG = {\n value: 36,\n range: [36, 1000]\n};\n","import { numberInterpolator, piecewiseInterpolator } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, THRESHOLD } from '../enums/scale-type';\nimport { treatNullMeasures } from '../helper';\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain) => {\n const uniqueVals = domain;\n return { uniqueVals, domain };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} intervals\n *\n */\nconst steppedDomain = (domain, intervals) => {\n let newIntervals = [];\n if (intervals instanceof Array) {\n newIntervals = intervals.slice().sort();\n } else {\n const interpolator = numberInterpolator()(...domain);\n for (let i = 0; i < intervals; i++) {\n newIntervals[i] = interpolator(i / (intervals - 1));\n }\n }\n if (newIntervals[0] < domain[0]) {\n newIntervals.shift();\n }\n const retDomain = newIntervals;\n return { uniqueVals: newIntervals, domain: retDomain, nice: true };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst discreteRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n const interpolator = numberInterpolator()(...scale.range());\n return treatNullMeasures(domainValue, interpolator(numVal), interpolator(domain[0]));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst pieceWiseRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n const fn = piecewiseInterpolator()(numberInterpolator(), [...scale.range()]);\n return fn(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) =>\n treatNullMeasures(domainValue, scale(domainValue), scale(domain[0]));\n\n/**\n *\n *\n * @param {*} intervals\n */\nconst strategies = {\n [`${DISCRETE}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: indexedDomain,\n range: pieceWiseRange\n },\n [`${CONTINOUS}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: normalDomain,\n range: normalRange\n },\n [`${CONTINOUS}-${DISCRETE}`]: {\n scale: THRESHOLD,\n domain: steppedDomain,\n range: discreteRange\n }\n};\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} intervals\n */\nexport const strategyGetter = (domainType, rangeType) =>\n strategies[`${domainType}-${rangeType}`];\n","export const PROPS = {\n config: {},\n domain: {\n sanitization: (context, value) => {\n context.scale().domain(value);\n return value;\n }\n },\n range: {},\n scale: {},\n uniqueValues: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SIZE, CONTINOUS, DISCRETE } from '../enums/constants';\nimport { strategyGetter } from './size-strategy';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class SizeAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @memberof SizeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig(), config);\n // @todo: Will use configuration override using scale decorator\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = CONTINOUS;\n\n this._sizeStrategy = this.setStrategy(this._domainType, this._rangeType);\n this._scale = this.createScale(this._sizeStrategy);\n this._range = this._config.range;\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setStrategy (domainType, rangeType) {\n return strategyGetter(domainType, rangeType);\n }\n\n /**\n *\n *\n *\n * @memberof SizeAxis\n */\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SIZE;\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof SizeAxis\n */\n getSize (domainVal = 0) {\n let sizeVal = 1;\n const {\n value\n } = this.config();\n const scale = this.scale();\n const domain = this.domain() || [1, 1];\n\n if (!scale || domain[0] === domain[1]) {\n sizeVal = value;\n } else {\n return this._sizeStrategy.range(domainVal, scale, this.domain(), this.uniqueValues());\n }\n return sizeVal;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof SizeAxis\n */\n updateDomain (domain) {\n if (domain) {\n const domainFn = this._sizeStrategy.domain;\n\n const domainInfo = domainFn(domain, this.config().intervals);\n\n this.domain(domainInfo.domain);\n this.uniqueValues(domainInfo.uniqueVals);\n\n this.scale().domain(domainInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","export const DEFAULT_CONFIG = {\n generator: null,\n value: 'circle',\n range: ['circle', 'diamond', 'star', 'cross', 'square', 'wye', 'triangle']\n};\n","export const PROPS = {\n config: {},\n domain: {},\n scale: {},\n uniqueValues: {},\n generator: {}\n};\n\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, getSymbol, generateGetterSetters, mergeRecursive, InvalidAwareTypes } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SHAPE } from '../enums/constants';\nimport { shapeGenerator } from './helper';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ShapeAxis {\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} params input parameters.\n * @param {Object | undefined} params.range Type of color scheme.\n * @memberof ShapeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(this._config, config);\n\n this._scale = createScale({\n type: 'ordinal',\n range: this._config.range\n });\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SHAPE;\n }\n\n /**\n *\n *\n * @param {*} value\n *\n * @memberof ShapeAxis\n */\n getShape (value) {\n if (!this.scale() || !this.domain() || !value || value instanceof InvalidAwareTypes) {\n return this.config().value;\n }\n\n if (this._generatedShapes) {\n return this._generatedShapes[value];\n }\n\n const shapeType = this.scale()(value);\n if (shapeType === 'string') {\n return getSymbol(shapeType);\n }\n\n return shapeType;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof ShapeAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n this.uniqueValues(domain);\n this.domain(domain);\n this.scale().domain(domain);\n\n if (this.config().generator) {\n this._generatedShapes = shapeGenerator(domain, this.config().generator);\n }\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.config().range,\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","/**\n *\n *\n * @param {*} domain\n * @param {*} generatorFn\n *\n */\nexport const shapeGenerator = (domain, generatorFn) => {\n const generatedShapes = {};\n domain.forEach((value) => {\n generatedShapes[value] = generatorFn(value);\n });\n return generatedShapes;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => mergeRecursive(context.config(), config),\n preset: (context, config) => {\n const { range, domain } = config;\n range && context.range(range);\n domain && context.domain(domain);\n }\n },\n domain: {},\n range: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, Symbols, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_ANGLE_DOMAIN } from '../enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst { pie } = Symbols;\n\nconst createAngleValues = (context) => {\n const angleData = context._angleFn(context._domain);\n angleData.forEach((v) => {\n v.startAngle -= Math.PI / 2;\n v.endAngle -= Math.PI / 2;\n });\n context._angleValues = angleData.reduce((values, d) => {\n const key = d.data;\n !values[key] && (values[key] = []);\n values[key].push(d);\n return values;\n }, {});\n};\n\n/**\n* This class is used to instantiate a AngleAxis.\n* @class AngleAxis\n*/\nexport default class AngleAxis {\n\n /**\n * Creates an instance of AngleAxis.\n * @param {Object} config input parameters.\n * @memberof AngleAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._range = [0, 360];\n this._angleFn = pie()\n .value(d => (typeof d === 'string' ? 1 : d))\n .sortValues(null);\n this._angleValues = {};\n }\n\n static defaultConfig () {\n return {};\n }\n\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n getScaleValue (domainVal) {\n return this._angleValues[domainVal];\n }\n\n padAngle (angle) {\n this._angleFn = this._angleFn.padAngle(angle);\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n const domain = domainVal[0].length ? domainVal[0] : DEFAULT_ANGLE_DOMAIN;\n this._domain = resolveAxisConfig(customDomain, domain, this);\n createAngleValues(this);\n return this;\n }\n return this._domain;\n }\n\n range (...range) {\n if (range.length) {\n const { range: customRange } = this.config();\n this._range = resolveAxisConfig(customRange, range[0], this);\n const domain = this.domain();\n const [startAngle, endAngle] = this._range;\n this._angleFn\n .startAngle((startAngle / 180) * Math.PI)\n .endAngle(Math.PI * endAngle / 180);\n if (domain && domain.length) {\n createAngleValues(this);\n }\n return this;\n }\n return this._range;\n }\n}\n","/**\n * This file exports constants that are used as enums in the\n * crosstab group implementation.\n */\n/**\n * Width of the crosstab.\n */\nexport const X = 'x';\n/**\n * Width of the crosstab.\n */\nexport const Y = 'y';\n/**\n * Width of the crosstab.\n */\nexport const WIDTH = 'width';\n\n/**\n * Height of the crosstab.\n */\nexport const HEIGHT = 'height';\n\n/**\n * Field referring to object storing measurement configuration.\n */\nexport const MEASUREMENT = 'measurement';\n\n/**\n * Field referring to object storing configuration properties.\n */\nexport const CONFIG = 'config';\n\n/**\n * Width of visual unit in crosstab.\n */\nexport const MIN_UNIT_WIDTH = 'minUnitWidth';\n\n/**\n * Height of visual unit.\n */\nexport const MIN_UNIT_HEIGHT = 'minUnitHeight';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSIONS = 'dimensions';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURES = 'measures';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSION = 'dimension';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURE = 'measure';\n\n/**\n * Flag to specify if model should be pivoted.\n */\nexport const PIVOT = 'pivot';\n\n/**\n * Flag to specify format\n */\nexport const FORMAT = 'format';\n\n/**\n * Mount point where the variable will be hosted\n */\nexport const MOUNT = 'mount';\n\n/**\n * Data update flag\n */\nexport const HAS_DATA_UPDATED = 'hasDataUpdated';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROWS = 'rows';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMNS = 'columns';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COL = 'col';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROW = 'row';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMN = 'column';\n\n/**\n * Field referring to object storing color field\n */\nexport const COLOR = 'color';\n\n/**\n * Field referring to object storing shape field\n */\nexport const SHAPE = 'shape';\n\n/**\n * Field referring to object storing size field\n */\nexport const SIZE = 'size';\n\n/**\n * Field referring to object storing detail field\n */\nexport const DETAIL = 'detail';\n\n/**\n * Field referring to object storing set of layers\n */\nexport const LAYERS = 'layers';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const TRANSFORM = 'transform';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const ORDINAL = 'ordinal';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const LINEAR = 'linear';\n/**\n * Field referring to object storing the transforms\n */\nexport const LEFT = 'left';\n/**\n * Field referring to object storing the transforms\n */\nexport const RIGHT = 'right';\n/**\n * Field referring to object storing the transforms\n */\nexport const TOP = 'top';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTTOM = 'bottom';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const RETINAL = 'retinal';\n/**\n * Field referring to object storing the transforms\n */\nexport const CELL = 'cell';\n/**\n * Field referring to object storing the transforms\n */\nexport const X_AXES = 'xAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const Y_AXES = 'yAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const ENTRY_CELLS = 'entryCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const INITIALIZED = 'initialized';\n/**\n * Field referring to object storing the transforms\n */\nexport const EXIT_CELLS = 'exitCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const AXIS = 'axis';\n/**\n * Field referring to object storing the transforms\n */\nexport const UNIT = 'unit';\n/**\n * Field referring to object storing the transforms\n */\nexport const UPDATED = 'updated';\n/**\n * Field referring to object storing the transforms\n */\nexport const BEFORE_UPDATE = 'beforeupdate';\n/**\n * Field referring to object storing the transforms\n */\nexport const VALUE_MATRIX = 'valueMatrix';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET_HEADERS = 'facet-headers';\n/**\n * Field referring to object storing the transforms\n */\nexport const RADIUS = 'radius';\n/**\n * Field referring to object storing the transforms\n */\nexport const ANGLE = 'angle';\n\nexport const ANGLE0 = 'angle0';\n/**\n * Field referring to object storing the transforms\n */\nexport const ARC = 'arc';\n/**\n * Field referring to object storing the transforms\n */\nexport const CATEGORICAL = 'categorical';\n/**\n * Field referring to object storing the transforms\n */\nexport const TEMPORAL = 'temporal';\n/**\n * Field referring to object storing the transforms\n */\nexport const BAR = 'bar';\n/**\n * Field referring to object storing the transforms\n */\nexport const LINE = 'line';\n/**\n * Field referring to object storing the transforms\n */\nexport const POINT = 'point';\n/**\n * Field referring to object storing the transforms\n */\nexport const PRIMARY = 'Primary';\n/**\n * Field referring to object storing the transforms\n */\nexport const SECONDARY = 'Secondary';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTH = 'both';\n/**\n * Field referring to object storing the transforms\n */\nexport const INTERACTION = 'interaction';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_LINES = 'gridLines';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_BANDS = 'gridBands';\n/**\n * Field referring to object storing the transforms\n */\nexport const HEADER = 'header';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET = 'facet';\n/**\n * Ordering type\n */\nexport const ASCENDING = 'asc';\n/**\n * Ordering type\n */\nexport const DESCENDING = 'desc';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, mergeRecursive, generateGetterSetters, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { LINEAR } from '../../../visual-group/src/enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst adjustDomain = (context) => {\n const minOuterRadius = context.config().minOuterRadius;\n const domain = context._domain;\n if (context._range.length) {\n const scale = context._scale;\n const value = scale.invert(minOuterRadius) - scale.invert(0);\n context._domain = [domain[0] - value, domain[1]];\n scale.domain(context._domain);\n }\n};\n\n/**\n* This class is used to instantiate a RadiusAxis.\n* @class RadiusAxis\n*/\nexport default class RadiusAxis {\n\n /**\n * Creates an instance of RadiusAxis.\n * @param {Object} config input parameters.\n * @memberof RadiusAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._range = [];\n this._radiusFactor = 1;\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._scale = this.createScale({\n scale: LINEAR\n });\n }\n\n static defaultConfig () {\n return {\n padding: [0, 1],\n minOuterRadius: 10\n };\n }\n\n config (...params) {\n if (params.length) {\n const config = mergeRecursive(this.config(), params[0]);\n this._config = config;\n return this;\n }\n return this._config;\n }\n\n createScale (strategy) {\n return createScale({\n type: strategy.scale,\n range: this.range()\n });\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n let domain = resolveAxisConfig(customDomain, domainVal[0], this);\n domain = sanitizeDomainWhenEqual(domain);\n this._scale.domain(domain);\n this._domain = domain;\n adjustDomain(this);\n }\n return this._domain;\n }\n\n getInnerRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[0];\n }\n return this._scale(domainVal);\n }\n\n getOuterRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[1];\n }\n const radius = this._scale(domainVal) * this._radiusFactor;\n return radius;\n }\n\n range (...range) {\n if (range.length) {\n const { padding, range: customRange } = this.config();\n const sanitizedRange = range[0].map((v, i) => v + (i ? -padding[i] : padding[i]));\n const rangeVal = resolveAxisConfig(customRange, sanitizedRange, this);\n this._range = rangeVal;\n this._scale.range(rangeVal);\n adjustDomain(this);\n }\n return this._range;\n }\n\n setRadiusFactor (val) {\n this._radiusFactor = val;\n return this;\n }\n}\n","import * as ScaleType from './enums/scale-type';\n\nconst DATA_TYPES = {\n DIMENSION: 'dimension',\n CATEGORICAL: 'categorical',\n MEASURE: 'measure',\n TEMPORAL: 'temporal'\n};\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [DATA_TYPES.DIMENSION]: ScaleType.BAND,\n [DATA_TYPES.MEASURE]: ScaleType.LINEAR,\n [DATA_TYPES.TEMPORAL]: ScaleType.TIME\n};\n\n","import { nestCollection, InvalidAwareTypes } from 'muze-utils';\n\n/**\n * Create multiple datasets from a single dataset by grouping the data using\n * a dimensional field.\n * @param {Array} schema Name and type of fields are stored in schema\n * @param {Array} data Data array\n * @param {Object} config Configuration object\n * @return {Array} Grouped data array\n */\nexport default (schema, data, config) => {\n const groupBy = config.groupBy instanceof Array ? config.groupBy : [config.groupBy];\n const groupByIndices = groupBy.map(fieldName => schema.findIndex(d => d.name === fieldName));\n\n if (groupByIndices.find(d => d === -1) !== undefined) {\n throw new Error(`Groupby field ${groupBy} not found in schema`);\n }\n\n const groupedData = nestCollection({\n keys: groupByIndices,\n data\n });\n\n groupedData.forEach((d) => {\n const key = d.key;\n if (InvalidAwareTypes.isInvalid(key)) {\n d.key = InvalidAwareTypes.getInvalidType(key);\n }\n });\n return groupedData;\n};\n","/**\n * @module Transform\n * This file exports a function that is used to implement\n * the identity transform\n */\n /* eslint no-unused-vars: 0 */\n /**\n * This function accepts data and returns the data unchanged.\n * @param {Object} schema The schema.\n * @param {Array} data The data array.\n * @param {Object} config The config object.\n * @return {Array} The unchanged data.\n */\n function identityTransform (schema, data, config) {\n return data;\n }\n\n export default identityTransform;\n","/**\n * @module Transform\n * This file exports the transform factory.\n */\nimport * as TransformType from '../enums/transform-type';\nimport identity from '../identity-transform';\nimport group from '../group-transform';\nimport stack from '../stack-transform';\n\n/* istanbul ignore next */\nconst transformMap = {\n [TransformType.IDENTITY]: identity,\n [TransformType.GROUP]: group,\n [TransformType.STACK]: stack\n};\n\n/**\n * This function is used to retirn a transform associated\n * with the given type.\n *\n * @param {string} type The type of the transform.\n * @return {Function} The transform function.\n */\nfunction transformFactory (type) {\n const transform = transformMap[type];\n if (typeof transform !== 'function') {\n throw new Error('Invalid transform type supplied.');\n }\n return transform;\n}\n\nexport default transformFactory;\n","/**\n * @module Transform\n * This module exports constants that are used to reference transforms in\n * a consistent manner throughout the project.\n */\n/* eslint one-var: 0 */\n export const IDENTITY = 'identity';\n export const GROUP = 'group';\n export const STACK = 'stack';\n export const FRACTURE = 'fracture';\n","import { stack } from 'muze-utils';\n\nimport group from '../group-transform';\n/*\n Normalize the data to a form which can be given to d3 stack for stacking the data\n ['Product', 'Sales', 'Region'],\n 0 ['A', 2000, 'North'],\n 1 ['A', 3000, 'South'],\n 2 ['B', 3000, 'South'],\n 3 ['B', 2000, 'North'],\n 4 ['C', 3000, 'South'],\n 5 ['C', 2000, 'North']\n |\n |\n ['Product', 'North', 'South'],\n ['A', 2000, 3000],\n ['B', 2000, 3000],\n ['C', 2000, 3000]\n*/\n// eslint-disable-next-line require-jsdoc\nconst normalizeData = (data, schema, valueField, uniqueField, groupBy) => {\n const groupedData = group(schema, data, {\n groupBy: uniqueField\n });\n const uniqueFieldIndex = schema.findIndex(d => d.name === uniqueField);\n const valueFieldIndex = schema.findIndex(d => d.name === valueField);\n const seriesKeyIndex = schema.findIndex(d => d.name === groupBy);\n const seriesKeys = data.map(d => d[seriesKeyIndex]).filter((item, pos, arr) => arr.indexOf(item) === pos).sort();\n const fieldNames = schema.reduce((acc, obj, i) => {\n acc[i] = obj.name;\n return acc;\n }, {});\n const dataArr = groupedData.map((arr) => {\n const tuples = {};\n const rowObj = arr.values.reduce((acc, row) => {\n acc = row.reduce((obj, value, i) => {\n if (i === seriesKeyIndex) {\n obj[value] = row[valueFieldIndex];\n tuples[value] = row;\n } else if (i !== valueFieldIndex) {\n obj[fieldNames[i]] = value;\n }\n return obj;\n }, acc);\n return acc;\n }, {});\n rowObj._tuple = tuples;\n // Set missing values field to zero value\n seriesKeys.forEach((seriesKey) => {\n if (rowObj[seriesKey] === undefined) {\n rowObj[seriesKey] = 0;\n const newArr = new Array(arr.values[0].length);\n newArr[uniqueFieldIndex] = arr.key;\n newArr[seriesKeyIndex] = seriesKey;\n rowObj._tuple[seriesKey] = newArr;\n }\n });\n return rowObj;\n });\n\n return {\n data: dataArr,\n keys: seriesKeys\n };\n};\n/**\n * Generate a stacked representation of data\n * @param {Array} schema schema Array\n * @param {Array} data data array\n * @param {Object} config Configuration object\n * @return {Array} stacked data\n */\nexport default (schema, data, config) => {\n const uniqueField = config.uniqueField;\n const valueField = config.value;\n const groupBy = config.groupBy;\n const sort = config.sort || 'descending';\n const normalizedData = normalizeData(data, schema, valueField, uniqueField, groupBy);\n const keys = normalizedData.keys;\n const map = {};\n const orderBy = config.orderBy;\n const orderIndex = schema.findIndex(d => d.name === orderBy);\n const groupByIndex = schema.findIndex(d => d.name === groupBy);\n if (orderIndex !== -1) {\n keys.forEach((key) => {\n const name = data.find(d => d[groupByIndex] === key);\n map[key] = name[orderIndex];\n });\n normalizedData.keys.sort((a, b) => map[a].localeCompare(map[b]));\n }\n\n const stackData = stack({\n keys: normalizedData.keys,\n offset: config.offset || 'diverging',\n order: sort,\n data: normalizedData.data\n });\n stackData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n dataObj.data = dataObj.data._tuple[seriesData.key];\n });\n });\n return stackData;\n};\n\n","import {\n FieldType,\n getDomainFromData,\n setStyles,\n easeFns,\n selectElement,\n DimensionSubtype,\n retrieveNearestGroupByReducers,\n getObjProp,\n COORD_TYPES,\n CommonProps,\n defaultValue\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { transformFactory } from '@chartshq/transform';\nimport { IDENTITY, STACK, GROUP, COLOR, SHAPE, SIZE, ENCODING, AGG_FN_SUM, ASCENDING, TEXT } from '../enums/constants';\n\nconst BAND = ScaleType.BAND;\nconst { POLAR, CARTESIAN } = COORD_TYPES;\n\nconst transformColor = (colorAxis, datum, styleType, intensity) => {\n const meta = datum.meta;\n const stateColor = defaultValue(meta.stateColor[styleType], meta.originalColor[styleType]);\n const colorInfo = colorAxis.transformColor(stateColor, intensity);\n\n meta.stateColor[styleType] = colorInfo.hsla;\n return colorInfo;\n};\n\nexport const applyInteractionStyle = (context, selectionSet, interactionStyles, config) => {\n const elements = context.getPlotElementsFromSet(selectionSet);\n const axes = context.axes();\n const colorAxis = axes.color;\n const apply = config.apply;\n const interactionType = config.interactionType;\n interactionStyles.forEach((style) => {\n const styleType = style.type;\n elements.forEach((elem) => {\n elem.style(styleType, ((d) => {\n const { colorTransform, stateColor, originalColor } = d.meta;\n colorTransform[interactionType] = colorTransform[interactionType] || {};\n if (apply && !colorTransform[interactionType][styleType]) {\n // fade selections\n colorTransform[interactionType][styleType] = style.intensity;\n const color = transformColor(colorAxis, d, styleType, style.intensity).color;\n return color;\n }\n if (!apply && colorTransform[interactionType][styleType]) {\n // unfade selections\n colorTransform[interactionType][styleType] = null;\n return transformColor(colorAxis, d, styleType, style.intensity.map(e => -e)).color;\n }\n const [h, s, l, a] = stateColor[styleType] ? stateColor[styleType] : originalColor[styleType];\n return `hsla(${h * 360},${s * 100}%,${l * 100}%, ${a})`;\n }));\n });\n });\n};\n\n/**\n *\n *\n * @param {*} selectionSet\n * @param {*} className\n * @param {*} hasFaded\n */\nexport const fadeUnfadeSelection = (context, selectionSet, hasFaded, interaction) => {\n const interactionConfig = { interaction, apply: hasFaded };\n applyInteractionStyle(context, selectionSet, 'fade', interactionConfig);\n};\n\n/**\n *\n *\n * @param {*} selectionSet\n * @param {*} className\n * @param {*} hasFaded\n */\nexport const focusUnfocusSelection = (context, selectionSet, isFocussed, interaction) => {\n const interactionConfig = { interaction, apply: isFocussed };\n applyInteractionStyle(context, selectionSet, 'focus', interactionConfig);\n};\n\n/**\n *\n *\n * @param {*} axes\n *\n */\nexport const getAxesScales = (axes) => {\n const [xAxis, yAxis] = [ENCODING.X, ENCODING.Y].map(e => axes[e]);\n const [xScale, yScale] = [xAxis, yAxis].map(e => e && e.scale());\n return {\n xAxis,\n yAxis,\n xScale,\n yScale\n };\n};\n\nexport const encodingFieldInfRetriever = {\n [POLAR]: (encoding, fieldsConfig) => {\n const encodingInf = {};\n [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT]\n .forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n });\n return encodingInf;\n },\n [CARTESIAN]: (encoding, fieldsConfig) => {\n const encodingInf = {};\n [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT].forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n encodingInf[`${e}FieldType`] = getObjProp(fieldsConfig, field, 'def', 'type');\n encodingInf[`${e}FieldSubType`] = getObjProp(fieldsConfig, field, 'def', 'subtype');\n });\n\n return encodingInf;\n }\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} config\n * @param {*} transformType\n *\n */\nexport const transformData = (dataModel, config, transformType, encodingFieldInf) => {\n const data = dataModel.getData({ withUid: true });\n const schema = data.schema;\n const transform = config.transform;\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = encodingFieldInf;\n const uniqueField = xFieldType === FieldType.MEASURE ? yField : xField;\n\n return transformFactory(transformType)(schema, data.data, {\n groupBy: transform.groupBy,\n uniqueField,\n sort: transform.sort || 'none',\n offset: transform.offset,\n orderBy: transform.orderBy,\n value: yFieldType === FieldType.MEASURE ? yField : xField\n }, data.uids);\n};\n\nexport const getIndividualClassName = (d, i, data, context) => {\n const className = context.config().individualClassName;\n let classNameStr = '';\n if (className instanceof Function) {\n classNameStr = className(d, i, data, context);\n }\n return classNameStr;\n};\n\nconst dataNormalizers = {\n [POLAR]: (transformedData, encodingFieldInf, fieldsConfig) => {\n const {\n radiusFieldIndex,\n angleFieldIndex,\n radius0FieldIndex,\n angle0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map(data => data.map((d) => {\n const pointObj = {\n radius: d[radiusFieldIndex],\n angle: angleFieldIndex !== undefined ? d[angleFieldIndex] : 1,\n radius0: d[radius0FieldIndex],\n angle0: d[angle0FieldIndex]\n };\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n return pointObj;\n })).filter(d => d.length);\n },\n [CARTESIAN]: (transformedData, encodingFieldInf, fieldsConfig, transformType) => {\n const {\n xFieldType,\n xFieldIndex,\n yFieldIndex,\n x0FieldIndex,\n y0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map((data) => {\n const values = transformType === GROUP ? data.values : data;\n return values.map((d) => {\n let pointObj = {};\n let tuple;\n if (transformType === STACK) {\n tuple = d.data || [];\n let y;\n let y0;\n let x;\n let x0;\n if (d[1] >= d[0]) {\n y = x0 = d[1];\n x = y0 = d[0];\n } else {\n y = x0 = d[0];\n x = y0 = d[1];\n }\n\n pointObj = xFieldType === FieldType.MEASURE ? {\n x,\n x0,\n y: tuple[yFieldIndex],\n y0: tuple[yFieldIndex]\n } : {\n x: tuple[xFieldIndex],\n x0: tuple[xFieldIndex],\n y,\n y0\n };\n pointObj.source = tuple;\n pointObj.rowId = tuple[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = tuple[encodingFieldInf[`${enc}FieldIndex`]];\n });\n } else {\n pointObj = {\n x: d[xFieldIndex],\n y: d[yFieldIndex],\n x0: d[x0FieldIndex],\n y0: d[y0FieldIndex]\n };\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n }\n return pointObj;\n });\n }).filter(d => d.length);\n }\n};\n/*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldsConfig field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n*/\nexport const getNormalizedData = (transformedData, context) => {\n const transformType = context.transformType();\n const transformedDataArr = transformType === IDENTITY ? [transformedData] : transformedData;\n const encodingFieldInf = context.encodingFieldsInf();\n const fieldsConfig = context.data().getFieldsConfig();\n return dataNormalizers[context.coord()](transformedDataArr, encodingFieldInf, fieldsConfig, transformType);\n};\n\nexport const domainCalculator = {\n [POLAR]: (data, layerInst) => {\n const config = layerInst.config();\n const { sort } = config;\n let angleValues = data[0];\n const radius0Field = getObjProp(config.encoding.radius0, 'field');\n if (sort) {\n angleValues = angleValues.sort((a, b) => (sort === ASCENDING ? a.radius - b.radius : b.radius - a.radius));\n }\n const radiusDomain = getDomainFromData(data, [ENCODING.RADIUS, radius0Field ?\n ENCODING.RADIUS0 : ENCODING.RADIUS]);\n return {\n radius: radiusDomain,\n angle: angleValues.map(d => d.angle),\n angle0: angleValues.map(d => d.angle0)\n };\n },\n [CARTESIAN]: (data, layerInst) => {\n const transformType = layerInst.transformType();\n const encodingFieldInf = layerInst.encodingFieldsInf();\n const {\n xFieldSubType,\n yFieldSubType,\n xField,\n yField,\n x0Field,\n y0Field\n } = encodingFieldInf;\n const domains = {};\n const yEnc = ENCODING.Y;\n const xEnc = ENCODING.X;\n if (xField) {\n domains.x = getDomainFromData(data, x0Field || transformType === STACK ? [xEnc, ENCODING.X0] : [xEnc, xEnc],\n xFieldSubType);\n }\n if (yField) {\n domains.y = getDomainFromData(data, y0Field || transformType === STACK ? [ENCODING.Y0, ENCODING.Y] :\n [yEnc, yEnc], yFieldSubType);\n }\n\n return domains;\n }\n};\n\nexport const attachDataToVoronoi = (voronoi, points) => {\n voronoi.data([].concat(...points).filter(d => d.rowId !== undefined).map((d) => {\n const point = d.update;\n return {\n x: point.x,\n y: point.y,\n data: d\n };\n }));\n};\n\n/**\n *\n *\n * @param {*} target\n * @param {*} styles\n * @param {*} remove\n */\nexport const updateStyle = (target, styles, remove) => {\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n target.style(key, remove ? null : styles[key]);\n }\n }\n};\n\n/**\n *\n *\n * @param {*} mount\n * @param {*} context\n */\nexport const animateGroup = (mount, context) => {\n let groupTransition;\n let update;\n const { transition, groupAnimateStyle } = context;\n const { duration, effect, disabled } = transition;\n if (groupAnimateStyle) {\n setStyles(mount.node(), groupAnimateStyle.enter);\n update = groupAnimateStyle.update;\n if (!disabled) {\n groupTransition = mount.transition()\n .ease(easeFns[effect])\n .duration(duration)\n .on('end', function () {\n updateStyle(selectElement(this), update, true);\n });\n } else {\n groupTransition = mount;\n }\n updateStyle(groupTransition, update);\n }\n};\n\nexport const positionPoints = (context, points) => {\n const positioner = context.encodingTransform();\n if (positioner) {\n return positioner(points, context, { smartLabel: context._dependencies.smartLabel });\n }\n return points;\n};\n\n/**\n * Gets the width of each group. It gets the width from axis if it is available for\n * example when the scale is nominal else it calculates the width from the\n * range of the axis and number of data points.\n *\n * @param {SimpleAxis} axis instance of axis\n * @param {number} minDiff Minimum difference between data points\n * @return {number} width of each bar\n * @private\n*/\nexport const getGroupSpan = (axis, minDiff) => {\n let groupSpan;\n const width = axis.getUnitWidth();\n const scale = axis.scale();\n const range = scale.range();\n const domain = scale.domain();\n !width ? groupSpan = (Math.abs(range[1] - range[0]) / Math.abs(domain[1] - domain[0])) * minDiff :\n (groupSpan = width);\n\n return groupSpan;\n};\n\nexport const getPlotMeasurement = (context, dimensionalValues) => {\n const fieldInfo = context.encodingFieldsInf();\n const axes = context.axes();\n const transformType = context.transformType();\n const config = context.config();\n const bandScale = context._bandScale;\n\n return ['x', 'y'].map((type) => {\n let span = 0;\n let groupSpan = 0;\n let padding = 0;\n let offsetValues = [];\n if (fieldInfo[`${type}FieldType`] === FieldType.DIMENSION) {\n let actualGroupWidth;\n const isTemporal = fieldInfo[`${type}FieldSubType`] === DimensionSubtype.TEMPORAL;\n const timeDiff = isTemporal ? context.dataProps().timeDiffs[type] : 0;\n const axis = axes[type];\n const pad = config[`pad${type.toUpperCase()}`];\n const innerPadding = config.innerPadding;\n const keys = dimensionalValues;\n const scale = axis.scale();\n groupSpan = getGroupSpan(axis, timeDiff);\n const isAxisBandScale = axis.constructor.type() === BAND;\n const axisPadding = axis.config().padding;\n // If it is a grouped bar then the width of each bar in a grouping is retrieved from\n // a band scale. The band scale will have range equal to width of one group of bars and\n // the domain is set to series keys.\n if (transformType === 'group') {\n const groupPadding = isAxisBandScale ? 0 : axisPadding * groupSpan / 2;\n bandScale.range([groupPadding, groupSpan - groupPadding]).domain(keys).paddingInner(innerPadding);\n span = bandScale.bandwidth();\n actualGroupWidth = groupSpan - (isAxisBandScale ? 0 : axisPadding * groupSpan);\n offsetValues = keys.map(key => bandScale(key) - (isAxisBandScale ? 0 : (groupSpan / 2)));\n } else if (pad !== undefined) {\n let offset;\n if (isAxisBandScale) {\n const step = scale.step();\n offset = scale.padding() * step;\n span = scale.bandwidth() + offset;\n } else {\n span = groupSpan;\n }\n offsetValues = keys.map(() => (isAxisBandScale ? -(offset / 2) : -(span / 2)));\n } else {\n padding = isAxisBandScale ? 0 : axisPadding * groupSpan;\n span = groupSpan - padding;\n actualGroupWidth = span;\n offsetValues = keys.map(() => (isAxisBandScale ? 0 : -(span / 2)));\n }\n\n groupSpan = actualGroupWidth;\n padding = isAxisBandScale ? axisPadding * axis.scale().step() : axisPadding * groupSpan;\n }\n\n return {\n span,\n offsetValues,\n groupSpan,\n padding\n };\n });\n};\n\nexport const renderLayer = (context) => {\n const mount = context.mount();\n if (mount) {\n context.render(mount);\n context.dependencies().throwback.commit(CommonProps.ON_LAYER_DRAW, true, context.metaInf().parentNamespace);\n }\n};\n\nconst transformResolverPredicates = (encodingFieldInf, context, groupByField) => {\n const fieldsConfig = context.data().getFieldsConfig();\n const { xField, yField, xFieldType, yFieldType } = encodingFieldInf;\n const dimensionField = ['xField', 'yField'].find(type =>\n encodingFieldInf[`${type}Type`] === FieldType.DIMENSION);\n\n return [\n !xField,\n !yField,\n !groupByField,\n getObjProp(fieldsConfig[groupByField], 'def', 'type') === FieldType.MEASURE,\n xFieldType === FieldType.DIMENSION && yFieldType === FieldType.DIMENSION,\n dimensionField && encodingFieldInf[dimensionField] === groupByField\n ];\n};\n\nexport const resolveInvalidTransformType = (context) => {\n const encodingFieldInf = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n\n if (transformResolverPredicates(encodingFieldInf, context, groupByField).some(value => value)) {\n return IDENTITY;\n }\n return null;\n};\n\nexport const getValidTransform = context => resolveInvalidTransformType(context) || context.config().transform.type;\n\nexport const getValidTransformForAggFn = (context) => {\n const resolvedInvalidTransformType = resolveInvalidTransformType(context);\n if (resolvedInvalidTransformType) {\n return resolvedInvalidTransformType;\n }\n\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n const isCustomTransformTypeProvided = !!getObjProp(context._customConfig, 'transform', 'type');\n let transformType = context.config().transform.type;\n\n if (!isCustomTransformTypeProvided && groupByField && xFieldType !== yFieldType) {\n const measureField = xFieldType === FieldType.MEASURE ? xField : yField;\n const { [measureField]: aggFn } = retrieveNearestGroupByReducers(context.data(), measureField);\n transformType = aggFn === AGG_FN_SUM ? STACK : GROUP;\n }\n\n return transformType;\n};\n\nexport const getMarkId = (source, schema) => source.filter((val, i) => schema[i] &&\n schema[i].type === FieldType.DIMENSION).join();\n\nexport const resolveEncodingValues = (data, i, dataArr, layerInst) => {\n const transformedValues = {};\n const values = data.values;\n const encoding = layerInst.config().encoding;\n for (const key in values) {\n const value = getObjProp(encoding[key], 'value');\n if (value instanceof Function) {\n transformedValues[key] = value(values, i, dataArr, layerInst);\n } else {\n transformedValues[key] = values[key];\n }\n }\n return transformedValues;\n};\n\nexport const getColorMetaInf = (colorInf, colorAxis) => ({\n originalColor: Object.keys(colorInf).reduce((acc, key) => {\n if (colorInf[key]) {\n acc[key] = colorAxis.getHslArray(colorInf[key]);\n }\n return acc;\n }, {}),\n stateColor: {},\n colorTransform: {}\n});\n\nconst getCoordValue = (radius, trig, angle, offset) => radius * Math[trig](angle) + offset;\n\nconst coordValueGetter = (radius, angle, xOffset, yOffset) => ({\n x: getCoordValue(radius, 'cos', angle, xOffset),\n y: getCoordValue(radius, 'sin', angle, yOffset)\n});\n\nexport const toCartesianCoordinates = (points, measurement, rangePlot = false) => {\n const xOffset = measurement.width / 2;\n const yOffset = measurement.height / 2;\n for (let i = 0, len = points.length; i < len; i++) {\n const point = points[i];\n const { angle, radius, radius0, angle0 } = point.update;\n point.update = coordValueGetter(radius, angle, xOffset, yOffset);\n if (rangePlot) {\n const update = point.update = coordValueGetter(radius0, angle0, xOffset, yOffset);\n const { x: x0, y: y0 } = coordValueGetter(radius, angle, xOffset, yOffset);\n update.x0 = x0;\n update.y0 = y0;\n }\n }\n return points;\n};\n\nexport const sortData = (data, axes) => {\n const { x: xAxis, y: yAxis } = axes;\n const axisArr = [xAxis, yAxis];\n for (let i = 0, len = axisArr.length; i < len; i++) {\n const axis = axisArr[i];\n if (axis.constructor.type() === BAND) {\n const key = i ? 'y' : 'x';\n const dom = axis.domain();\n const indices = dom.reduce((acc, v, idx) => {\n acc[v] = idx;\n return acc;\n }, {});\n data.sort((a, b) => indices[a[key]] - indices[b[key]]);\n break;\n }\n }\n return data;\n};\n","import * as PROPS from '../enums/props';\n\nexport const localOptions = {\n [PROPS.DATA]: {\n value: null\n }\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\nimport * as PROPS from '../enums/props';\nimport { encodingFieldInfRetriever } from '../helpers';\n\nexport const listenerMap = [\n {\n props: [`${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}.${PROPS.DATA}`],\n type: 'registerImmediateListener',\n listener: (context, [, data]) => {\n const config = context.config();\n if (data && config) {\n if (context._cacheEnabled) {\n context._cachedData.push(data);\n } else {\n context._cachedData = [data];\n }\n const encodingValue = config.encoding;\n if (encodingValue) {\n const fieldsConfig = data.getFieldsConfig();\n const encodingFieldsInf = encodingFieldInfRetriever[context.coord()](encodingValue, fieldsConfig);\n context.encodingFieldsInf(encodingFieldsInf);\n context.resolveTransformType();\n context._transformedData = context.getTransformedData(data, config,\n context.transformType(), encodingFieldsInf);\n context._normalizedData = context.getNormalizedData(context._transformedData, fieldsConfig);\n if (config.calculateDomain !== false) {\n const domain = context.calculateDomainFromData(context._normalizedData,\n context.encodingFieldsInf(), context.data().getFieldsConfig());\n context.domain(domain);\n }\n }\n }\n },\n namespace: context => context.metaInf().namespace\n }\n];\n","import {\n getUniqueId,\n mergeRecursive,\n FieldType,\n selectElement,\n ReservedFields,\n DataModel,\n clone,\n generateGetterSetters,\n STATE_NAMESPACES,\n COORD_TYPES,\n transactor,\n defaultValue,\n getObjProp\n} from 'muze-utils';\nimport { SimpleLayer } from '../simple-layer';\nimport * as PROPS from '../enums/props';\nimport { props } from './props';\nimport {\n transformData,\n getNormalizedData,\n applyInteractionStyle,\n getValidTransform,\n domainCalculator,\n renderLayer\n} from '../helpers';\nimport { localOptions } from './local-options';\nimport { listenerMap } from './listener-map';\n\nconst layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * An abstract class which gives definition of common layer functionality like\n * - transforming data for various modes. Supported modes: identity, group and stack.\n * - calculating data domain\n * - linking dependent layers\n * - merging policy of configuration\n * - interaction sideffect helpers\n * - retrieving dom elements from data using id\n * - retrieving the physical dimensions of marks\n * - disposing layer\n *\n * Every layer has to extend base layer and give concrete definition.\n * This layer does not have any default visual. A new layer has to define the logic of `render` for rendering the\n * visuals\n *\n * @public\n * @class\n * @module BaseLayer\n */\nexport default class BaseLayer extends SimpleLayer {\n\n /**\n * Creates a layer using a configuration and data.\n *\n * @public\n * @constructor\n * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a layer.\n * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from\n * value to px.\n * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators\n * @param {ShapeAxis} axes.shape Axis for providing a shape\n * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator\n * @param {LayerConfig} config Configuration of the layer\n * @param {Object} dependencies Dependencies of the layer\n * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance\n */\n constructor (data, axes, config, dependencies = {}) {\n super();\n\n generateGetterSetters(this, props);\n this.axes(axes);\n this.alias(this.constructor.formalName() + getUniqueId());\n this.dependencies(dependencies);\n this._points = [];\n this._cachedData = [];\n this._id = getUniqueId();\n this._measurement = {};\n this._animationDonePromises = [];\n this._graphicElems = {};\n this._customConfig = null;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys(localOptions).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getListeners () {\n return {\n store: [...listenerMap, {\n type: 'registerChangeListener',\n props: [`${layerNs[1]}.${PROPS.DATA}`,\n ...['x', 'y', 'radius'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context) => {\n renderLayer(context);\n },\n subNamespace: (context) => {\n const { unitRowIndex, unitColIndex, namespace } = context.metaInf();\n return {\n [`${layerNs[1]}.${PROPS.DATA}`]: namespace,\n [`${groupNs}.domain.x`]: `${unitColIndex}0`,\n [`${groupNs}.domain.y`]: `${unitRowIndex}0`,\n [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}`\n };\n }\n }],\n throwback: []\n };\n }\n\n static getQualifiedStateProps () {\n const layerState = BaseLayer.getState();\n return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`));\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { namespace } = this.metaInf();\n store.addSubNamespace(namespace, BaseLayer.formalName(), this);\n\n transactor(this, localOptions, store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}`\n });\n return this;\n }\n return this._store;\n }\n\n domain (...dom) {\n const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`;\n const store = this.store();\n if (dom.length) {\n const { parentNamespace, namespace } = this.metaInf();\n const domain = defaultValue(store.get(prop, parentNamespace), {});\n domain[namespace] = dom[0];\n this.store().commit(prop, domain, parentNamespace);\n return this;\n }\n return this.store().get(prop, this.metaInf().namespace);\n }\n\n /**\n * Creates a layer instance\n * @return {BaseLayer} Instance of a layer\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Default configuration of the layer. This configuration gets merged to the user passed configuration using a\n * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own\n * configuration.\n *\n * @public\n * @static\n *\n * @return {Object} Default configuration\n */\n static defaultConfig () {\n return {\n transform: {\n type: 'identity'\n }\n };\n }\n\n /**\n * Policy defines how user config gets merged to default config. The default policy here does a deep copy\n * operation.\n * Any policy which does more than deep copying should define the policy as a static member.\n *\n * @static\n * @public\n *\n * @param {LayerConfig} conf Configuration with which the user config will be merged\n * @param {LayerConfig} userConf Configuration given by the user\n *\n * @return {LayerConfig} Merged layer configuration\n */\n static defaultPolicy (conf, userConf) {\n return mergeRecursive(conf, userConf);\n }\n\n /**\n * Determines a name for a layer. This name of the layer is used in the input data to refer to this layer.\n * ```\n * .layers([\n * mark: 'bar',\n * encoding: { ... }\n * ])\n * ```\n *\n * @static\n * @public\n *\n * @return {string} name of layer\n */\n static formalName () {\n return 'base';\n }\n\n encodingFieldsInf (...fieldsInf) {\n if (fieldsInf.length) {\n this._encodingFieldsInf = fieldsInf[0];\n return this;\n }\n return this._encodingFieldsInf;\n }\n\n encodingTransform (...encodingTransform) {\n if (encodingTransform.length) {\n this._encodingTransform = encodingTransform[0];\n return this;\n }\n return this._encodingTransform;\n }\n\n /**\n * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among multiple\n * layers of same type if one layer has to be referred, alias is used. If no alias is given then `formalName` is set\n * as the alias name.\n *\n *\n * If used as setter\n * @param {string} alias Name of the alias\n * @return {BaseLayer} Instance of current base layer\n *\n * If used as getter\n * @return {string} Alias of the current layer\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n this._alias = params[0];\n return this;\n }\n return this._alias || this.constructor.formalName();\n }\n\n dependencies (...params) {\n if (params.length) {\n this._dependencies = params[0];\n return this;\n }\n return this._dependencies;\n }\n\n enableCaching () {\n this._cacheEnabled = true;\n return this;\n }\n\n clearCaching () {\n this._cacheEnabled = false;\n return this.data(this._cachedData[0]);\n }\n\n /**\n * Serialize the schema. Merge config is used for serialization.\n *\n * @public\n *\n * @return {LayerConfig} Serialized schema\n */\n serialize () {\n return this.config();\n }\n\n /**\n * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema.\n *\n * @public\n *\n * @return {string} id of the layer\n */\n id () {\n return this._id;\n }\n\n /**\n * Returns the transformed data based on given transform type.\n * It first gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of DataModel\n * @param {Object} config Configuration for transforming data\n * @return {Array.} Transformed data.\n */\n getTransformedData (dataModel, config, transformType, encodingFieldsInf) {\n return transformData(dataModel, config, transformType, encodingFieldsInf);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a categorical field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @param {Object} fieldsConfig Configuration of fields\n * @return {Array} Domain values array.\n */\n calculateDomainFromData (data) {\n let domains = {};\n const isEmpty = this.data().isEmpty();\n\n if (!isEmpty) {\n domains = domainCalculator[this.coord()](data, this);\n }\n return domains;\n }\n\n static shouldDrawAnchors () {\n return false;\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getDataDomain (encodingType) {\n const { parentNamespace, namespace } = this.metaInf();\n const domains = getObjProp(this.store()\n .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace);\n return encodingType !== undefined ? domains[encodingType] || [] : domains;\n }\n\n /**\n * Normalizes the transformed data and returns it.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getNormalizedData (transformedData) {\n return getNormalizedData(transformedData, this);\n }\n\n /**\n * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns\n * null.\n *\n * @public\n *\n * @param {number} x X Coordinate.\n * @param {number} y Y Coordinate.\n *\n * @return {Object} Information of the nearest point.\n * ```\n * {\n * // id property contains the field names and their corresponding values in a 2d array. This is the data\n * // associated with the nearest point.\n * id: // Example data: [['Origin'], ['USA']],\n * dimensions: // Physical dimensions of the point.\n * layerId: // Id of the layer instance.\n * }\n * ```\n */\n getNearestPoint () {\n return null;\n }\n\n applyInteractionStyle (interactionType, selectionSet, apply, styles) {\n const interactionConfig = this.config().interaction || {};\n\n let interactionStyles = interactionConfig[interactionType];\n interactionStyles = styles || interactionStyles;\n if (interactionStyles) {\n applyInteractionStyle(this, selectionSet, interactionStyles, {\n apply,\n interactionType\n });\n }\n }\n\n disableUpdate () {\n this._updateLock = true;\n return this;\n }\n\n enableUpdate () {\n this._updateLock = false;\n return this;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransform(this);\n }\n\n transformType () {\n return this._transformType;\n }\n\n /**\n * Renders the layer\n * @return {BaseLayer} Instance of the layer.\n */\n render () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof BaseLayer\n */\n elemType () {\n return 'g';\n }\n\n /**\n * Disposes the entire layer.\n *\n * @return {BaseLayer} Instance of layer.\n */\n remove () {\n const { namespace, parentNamespace } = this.metaInf();\n const store = this.store();\n store.removeSubNamespace(namespace, BaseLayer.formalName());\n const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`);\n const unitDom = layersDomain[parentNamespace];\n unitDom && (delete unitDom[namespace]);\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n * Stores point in an object with key as the categorical value or temporal value\n *\n * @param {string} key categorical value or temporal value\n * @param {Object} data Information of the data point\n * @return {BarLayer} Instance of bar layer\n */\n cachePoint (key, data) {\n if (key === null) {\n return this;\n }\n const pointMap = this._pointMap;\n !pointMap[key] && (pointMap[key] = []);\n pointMap[key].push(data);\n return this;\n }\n\n /**\n *\n *\n * @param {*} dataProps\n *\n * @memberof BaseLayer\n */\n dataProps (...dataProps) {\n if (dataProps.length) {\n this._dataProps = dataProps[0];\n return this;\n }\n return this._dataProps;\n }\n\n /**\n *\n *\n * @param {*} data\n * @param {*} id\n *\n * @memberof BaseLayer\n */\n getIdentifiersFromData (data) {\n const schema = this.data().getSchema();\n const fieldsConfig = this.data().getFieldsConfig();\n const identifiers = [[], []];\n const {\n xFieldType,\n yFieldType,\n xField,\n yField\n } = this.encodingFieldsInf();\n\n const [xMeasure, yMeasure] = [xFieldType, yFieldType].map(type => type === FieldType.MEASURE);\n schema.forEach((d, i) => {\n const name = d.name;\n if (fieldsConfig[name].def.type === FieldType.DIMENSION) {\n identifiers[0].push(name);\n identifiers[1].push(data[i]);\n }\n });\n\n if (xMeasure && yMeasure) {\n const xMeasureIndex = fieldsConfig[xField].index;\n const yMeasureIndex = fieldsConfig[yField].index;\n identifiers[0].push(...[xField, yField]);\n identifiers[1].push(...[data[xMeasureIndex], data[yMeasureIndex]]);\n }\n return identifiers;\n }\n\n hasPlotSpan () {\n return false;\n }\n\n getPlotSpan () {\n return {\n x: 0,\n y: 0\n };\n }\n\n getPlotPadding () {\n return {\n x: 0,\n y: 0\n };\n }\n\n /**\n * Returns the information of the marks corresponding to the supplied identifiers. Identifiers are a set of field\n * names and their corresponding values in an array. It can also be an instance of datamodel.\n *\n * For example,\n * ```\n * const identifiers = [\n * ['Origin', 'Cylinders'],\n * ['USA', '8']\n * ];\n * const points = barLayer.getPointsFromIdentifiers(identifiers);\n * ```\n * @public\n * @param {Array|DataModel} identifiers Identifiers of the marks.\n * @param {Object} config Optional configuration which describes how to get the information.\n * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only\n * the positions of the points.\n * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks.\n *\n * @return {Array} Array of points contains\n */\n getPointsFromIdentifiers (identifiers, config = {}) {\n const getAllAttrs = config.getAllAttrs;\n const getBBox = config.getBBox;\n if (!this.data()) {\n return [];\n }\n let fieldNames;\n let values;\n if (identifiers instanceof DataModel) {\n const dataObj = identifiers.getData();\n fieldNames = dataObj.schema.map(d => d.name);\n values = dataObj.data;\n } else {\n fieldNames = identifiers[0];\n values = identifiers.slice(1, identifiers.length);\n }\n\n const points = this._points;\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPoints = [].concat(...points).filter((point) => {\n const { source, rowId } = point;\n\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n return getAllAttrs ? filteredPoints : filteredPoints.map((d) => {\n const obj = clone(d);\n if (getBBox) {\n const update = obj.update || obj;\n if (obj.size !== undefined) {\n const sizeVal = Math.sqrt(obj.size / Math.PI) * 2;\n update.width = sizeVal;\n update.height = sizeVal;\n update.x -= sizeVal / 2;\n update.y -= sizeVal / 2;\n } else {\n if (update.width === undefined) {\n update.width = 2;\n }\n if (update.height === undefined) {\n update.height = 2;\n }\n }\n }\n\n return obj.update || obj;\n }).sort((a, b) => a.y - b.y);\n }\n\n getTransformedDataFromIdentifiers (identifiers) {\n const { data: identifierData, schema: identifierSchema } = identifiers.getData();\n const normalizedData = this._normalizedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const {\n yField,\n xField,\n yFieldType,\n xFieldType\n } = this.encodingFieldsInf();\n let measureIndex;\n let enc;\n if (xFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[xField].index;\n enc = 'x';\n } else if (yFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[yField].index;\n enc = 'y';\n }\n\n const transformedData = [];\n normalizedData.forEach((dataArr) => {\n dataArr.forEach((dataObj) => {\n const tupleArr = dataObj.source;\n const exist = identifierSchema.every((obj, i) =>\n identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1);\n if (exist) {\n const transformedVal = dataObj[enc];\n const row = dataObj.source;\n const tuple = {};\n for (const key in fieldsConfig) {\n const index = fieldsConfig[key].index;\n tuple[key] = row[index];\n if (index === measureIndex) {\n tuple[key] = transformedVal;\n }\n }\n transformedData.push(tuple);\n }\n });\n });\n\n return [transformedData, this.data().getSchema()];\n }\n\n /**\n * Returns the dom elements associated with the supplied set of row ids.\n * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids, it returns all\n * the elements which is mapped with those row ids.\n *\n * @public\n * @param {Array} set Array of row ids\n *\n * @return {Selection} D3 Selection of dom elements.\n */\n getPlotElementsFromSet (set) {\n const graphicElems = this._graphicElems;\n const elems = [];\n for (let i = 0, len = set.length; i < len; i++) {\n const elem = graphicElems[set[i]];\n if (elem) {\n elems.push(elem);\n }\n }\n return elems;\n }\n\n /**\n * Notifies when all animations/transitions of the layer are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n getRenderProps () {\n if (this.coord() === COORD_TYPES.POLAR) {\n return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.radius`];\n }\n const { unitRowIndex: rowIndex, unitColIndex: colIndex } = this.metaInf();\n return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.y.${rowIndex}0`,\n `${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.x.${colIndex}0`];\n }\n}\n","import {\n selectElement,\n makeElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\nimport { updateStyle } from '../../helpers';\n\nconst line = Symbols.line;\n\nconst filterFn = (d) => {\n const { update } = d;\n return update.y !== null && update.x !== null;\n};\n\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nexport const drawLine = (context) => {\n let filteredPoints;\n const { layer, container, points, interpolate, connectNullData, className, style, transition } = context;\n const mount = selectElement(container).attr('class', className);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(d => d.update.x)\n .y(d => d.update.y)\n .defined(filterFn);\n\n filteredPoints = points;\n if (connectNullData) {\n filteredPoints = points.filter(filterFn);\n }\n\n updateStyle(mount, style);\n let element = makeElement(mount, 'path', points.length ? [points[0].className] : []);\n element.attr('class', d => d);\n if (!transition.disabled) {\n element = element.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n element.attr('d', linepath(filteredPoints))\n .style('fill-opacity', 0);\n return element;\n};\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-line',\n className: '',\n interpolate: 'linear',\n transform: {\n type: 'group'\n },\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'stroke',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'stroke',\n intensity: [0, 0, +15, 0]\n }]\n },\n nearestPointThreshold: 20,\n encoding: {\n color: {},\n x: {},\n y: {},\n strokeOpacity: {\n value: 1\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n\n","import {\n Voronoi,\n getQualifiedClassName,\n selectElement,\n makeElement,\n FieldType,\n InvalidAwareTypes,\n getObjProp\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawLine } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n animateGroup,\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\nimport './styles.scss';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport default class LineLayer extends BaseLayer {\n\n /**\n * Creates an instance of LineLayer.\n * @param {*} args\n * @memberof LineLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n }\n\n static formalName () {\n return 'line';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Default configuration of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField && !transform.groupBy) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n * Returns the draw method for line\n * @return {Function} Draw method of line layer\n */\n getDrawFn () {\n return drawLine;\n }\n\n static shouldDrawAnchors () {\n return true;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @param {number} seriesIndex index of series\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const axes = this.axes();\n const xAxis = axes.x;\n const yAxis = axes.y;\n const colorAxis = axes.color;\n const { xFieldType, yFieldType } = this.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n sortData(data, axes);\n points = data.map((d, i) => {\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2;\n const color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color\n },\n data: d\n }, i, data, this);\n\n const point = {\n enter: {},\n update: {\n x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x,\n y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y\n },\n style: {\n stroke: resolvedEncodings.color,\n 'fill-opacity': 0\n },\n rowId: d.rowId,\n source: d.source,\n meta: getColorMetaInf({\n stroke: resolvedEncodings.color\n }, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n\n points = points.filter((point) => {\n const { update } = point;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n /**\n * Renders the line plot\n * @param {SVGElement} container svg element\n * @return {LineLayer} instance of line layer\n */\n render (container) {\n let points;\n let seriesClassName;\n let style;\n\n const config = this.config();\n const {\n encoding,\n interpolate,\n className,\n defClassName,\n transition\n } = config;\n const normalizedData = this._normalizedData;\n const transformedData = this._transformedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const keys = transformedData.map(d => d.key);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n const colorField = encoding.color.field;\n const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index;\n\n this._points = [];\n this._pointMap = {};\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n makeElement(container, 'g', normalizedData, null, {\n enter: (group) => {\n animateGroup(group, {\n transition,\n groupAnimateStyle: {\n enter: {\n 'stroke-opacity': 0,\n 'fill-opacity': this.getPathStyle()['fill-opacity']\n },\n update: {\n 'stroke-opacity': encoding.strokeOpacity.value\n }\n }\n });\n },\n update: (group, dataArr, i) => {\n points = this.translatePoints(dataArr);\n this._points.push(points);\n seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n\n let color;\n const colorValFn = encoding.color.value;\n const colorVal = points.find(d => d.source[colorFieldIndex] !== null &&\n d.source[colorFieldIndex] !== undefined);\n\n if (colorValFn) {\n color = colorValFn(dataArr, i, normalizedData);\n } else {\n color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]);\n }\n\n style = this.getPathStyle(color);\n this.getDrawFn()({\n layer: this,\n container: group.node(),\n interpolate,\n points,\n className: seriesClassName,\n transition,\n style: style || {},\n connectNullData: config.connectNullData\n });\n }\n }, d => d[0].source[colorFieldIndex] || d[0].rowId);\n\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n stroke: color,\n 'fill-opacity': '0'\n };\n }\n\n /**\n * Gets the nearest point closest to the given position\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point information\n */\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n const point = this._voronoi.find(x, y, searchRadius);\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n}\n","import {\n easeFns,\n selectElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\n\nconst area = Symbols.area;\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nconst /* istanbul ignore next */ drawArea = (params) => {\n let filteredPoints;\n const { layer, container, points, style, transition, className, connectNullData, interpolate } = params;\n\n const { effect: easeEffect, duration } = transition;\n const mount = selectElement(container);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const selection = mount.selectAll('path').data(points.length ? [points[0].className] : []);\n const [enterAreaPath, updateAreaPath] = ['enter', 'update'].map(e => area().curve(curveInterpolatorFn)\n .x(d => d[e].x)\n .y1(d => d[e].y)\n .y0(d => d[e].y0)\n .defined(d => d[e].y !== null\n ));\n\n filteredPoints = points;\n mount.attr('class', className);\n if (connectNullData) {\n filteredPoints = points.filter(d => d.update.y !== null);\n }\n const selectionEnter = selection.enter().append('path').attr('d', enterAreaPath(filteredPoints));\n selection.merge(selectionEnter).transition().ease(easeFns[easeEffect])\n .duration(duration)\n .on('end', layer.registerAnimationDoneHook())\n .attr('d', updateAreaPath(filteredPoints))\n .each(function (d) {\n const element = selectElement(this);\n element.attr('class', d);\n Object.keys(style).forEach(key => element.style(key, style[key]));\n });\n};\n\nexport default drawArea;\n","import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { LineLayer } from '../line';\nimport drawArea from './renderer';\nimport './styles.scss';\nimport { STACK, ENCODING } from '../../enums/constants';\nimport {\n getAxesScales,\n positionPoints,\n getIndividualClassName,\n getValidTransformForAggFn,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport default class AreaLayer extends LineLayer {\n /** oation of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof AreaLayer\n */\n static formalName () {\n return 'area';\n }\n\n /**\n * Calculates the domain from data. It calls its parent class's method which is line layer\n * to get the domain and overwrites the domain according to its need.\n * @return {Array} Domain values\n */\n calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) {\n const domains = super.calculateDomainFromData(data, fieldsConfig);\n [ENCODING.X, ENCODING.Y].forEach((type) => {\n const { [`${type}FieldType`]: fieldType } = encodingFieldsInf;\n if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) {\n domains[type][0] = Math.min(domains[type][0], 0);\n domains[type][1] = Math.max(0, domains[type][1]);\n }\n });\n return domains;\n }\n\n /**\n * Returns the drawing method of this layer\n * @return {Function} Draw method\n */\n getDrawFn () {\n return drawArea;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const transformType = this.transformType();\n const axes = this.axes();\n const colorAxis = axes.color;\n const config = this.config();\n const fieldsConfig = this.data().getFieldsConfig();\n const { xField, yField, y0Field } = this.encodingFieldsInf();\n const {\n xAxis,\n yAxis\n } = getAxesScales(axes);\n const classNameFn = config.individualClassName;\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const minYVal = yAxis.domain()[0];\n const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal);\n sortData(data, axes);\n points = data.map((d, i) => {\n let color;\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y);\n const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos;\n color = colorAxis.getColor(d.color);\n const invalidY = d.y instanceof InvalidAwareTypes;\n const invalidY0 = d.y0 instanceof InvalidAwareTypes;\n const resolvedValues = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, this);\n color = resolvedValues.color;\n const style = {\n fill: color\n };\n\n const point = {\n enter: {\n x: xPx,\n y: invalidY ? null : basePos,\n y0: invalidY0 ? null : basePos\n },\n update: {\n x: xPx,\n y: invalidY ? null : resolvedValues.y,\n y0: invalidY0 ? null : resolvedValues.y0\n },\n source: d.source,\n rowId: d.rowId,\n className: classNameFn ? classNameFn(d, i, data, this) : '',\n style,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n points = points.filter((point) => {\n const update = point.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n fill: color\n };\n }\n}\n\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-arc',\n padding: { top: 1, bottom: 1, left: 1, right: 1 },\n className: '',\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n height: 100,\n width: 100,\n sort: '',\n colors: ['#F44336', 'blue', 'green', 'yellow', 'orange', 'purple'],\n transform: {\n type: 'identity'\n },\n encoding: {\n 'stroke-width': {\n value: '2px'\n },\n 'stroke-linejoin': {\n value: 'round'\n },\n angle: {\n value: '1'\n },\n radius: {\n value: '1'\n },\n opacity: {\n value: '1'\n },\n color: {\n value: '1'\n },\n shape: {\n value: '1'\n },\n size: {\n value: '1'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 500\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-arc-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-arc-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-arc-selected`\n }\n }\n};\n\n","import {\n makeElement,\n selectElement,\n getQualifiedClassName,\n isSimpleObject,\n Symbols,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { BaseLayer } from '../../base-layer';\nimport { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers';\nimport { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper';\nimport './styles.scss';\n\nconst arc = Symbols.arc;\n\n/**\n * Arc Layer creates a plot with polar coordinates.\n *\n * @public\n *\n * @class\n * @module ArcLayer\n * @extends BaseLayer\n */\nexport default class ArcLayer extends BaseLayer {\n\n constructor (data, axes, config, dependencies) {\n super(data, axes, config, dependencies);\n this._prevPieData = {};\n }\n\n /**\n * returns the default configuration of the layer\n *\n * @static\n * @return {Object} Default configuration for arc layer\n * @memberof ArcLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'arc';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n *\n *\n * @param {Object} x\n * @param {Object} y\n * @return {}\n * @memberof ArcLayer\n */\n getNearestPoint (x, y, config = {}) {\n const dataPoint = selectElement(config.event.target).data()[0];\n if (isSimpleObject(dataPoint)) {\n const { source, rowId } = dataPoint;\n return {\n id: this.getIdentifiersFromData(source, rowId),\n layerId: this.id()\n };\n }\n return null;\n }\n\n translatePoints (data) {\n const { angle, color: colorAxis, radius: radiusAxis } = this.axes();\n const pieIndex = {};\n const prevData = this._points[0] || [];\n const points = [];\n const angleV = {};\n\n this._prevPieData = {};\n prevData.forEach((e, index) => {\n this._prevPieData[e.rowId] = [e, index];\n pieIndex[e.index] = e;\n });\n data.forEach((d, i) => {\n const angles = angle.getScaleValue(d.angle);\n if (angles) {\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const uid = d.rowId;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n radius: radiusAxis.getOuterRadius(d.radius),\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color: colorAxis.getColor(d.color),\n angle0: startAngle,\n angle: endAngle,\n startAngle,\n endAngle,\n startAngle0: startAngle,\n endAngle0: endAngle\n },\n data: d\n }, i, data, this);\n const color = resolvedEncodings.color;\n points.push({\n source: d.source,\n index: i,\n enter: {},\n update: {\n angle0: resolvedEncodings.angle0,\n angle: resolvedEncodings.angle,\n radius0: resolvedEncodings.radius0,\n radius: resolvedEncodings.radius\n },\n color,\n meta: getColorMetaInf({\n fill: color\n }, colorAxis),\n rowId: uid,\n _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] :\n getPreviousPoint(pieIndex, i, this)\n });\n }\n });\n return points;\n }\n\n /**\n *\n *\n * @param {Object} container\n * @return {}\n * @memberof ArcLayer\n */\n render (container) {\n const measurement = this.measurement();\n const {\n classPrefix,\n defClassName,\n cornerRadius,\n padAngle,\n padRadius,\n transition\n } = this.config();\n const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n // This returns a function that generates the arc path based on the datum provided\n const path = this._arcFn = arc()\n .cornerRadius(cornerRadius)\n .startAngle(d => d.update.angle0 + Math.PI / 2)\n .endAngle(d => d.update.angle + Math.PI / 2)\n .padAngle(padAngle)\n .padRadius(padRadius)\n .outerRadius(d => d.update.radius)\n .innerRadius(d => d.update.radius0);\n\n this._points = this._normalizedData.map(arr => this.translatePoints(arr));\n const graphicElems = this._graphicElems = {};\n // Creating the group that holds all the arcs\n const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`)\n .classed(`${qualClassName[1]}-group`, true)\n .attr('transform', `translate(${measurement.width / 2},\n ${measurement.height / 2})`);\n const tween = (elem) => {\n makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`)\n .style('fill', d => d.color)\n .each(function (d) {\n graphicElems[d.rowId] = selectElement(this);\n })\n .transition()\n .duration(transition.duration)\n .on('end', this.registerAnimationDoneHook())\n .attrTween('d', (...params) => tweenPie(path, params))\n .attr('class', (d, i) => {\n const individualClass = getIndividualClassName(d, i, this._points, this);\n return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index}\n ${individualClass}`;\n });\n };\n const consecutiveExits = [];\n let exitCounter = 0;\n const tweenExit = (elem, d) => {\n let exitArr = consecutiveExits[exitCounter];\n const oldExitCounter = exitCounter;\n if (!exitArr) {\n exitArr = [{ elem, datum: d }];\n } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) {\n exitArr.push({ elem, datum: d });\n } else {\n exitCounter++;\n }\n consecutiveExits[oldExitCounter] = exitArr;\n };\n // Creating groups for all the arcs present individually\n makeElement(g, 'g', d => d, `${qualClassName[0]}`,\n {\n update: tween,\n exit: tweenExit\n })\n .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`);\n tweenExitPie(consecutiveExits, transition, path);\n return this;\n }\n\n getPointsFromIdentifiers (identifiers) {\n if (!this.data()) {\n return [];\n }\n const fieldNames = identifiers[0];\n const values = identifiers.slice(1, identifiers.length);\n const pieSlices = selectElement(this.mount()).selectAll('path').data();\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPies = pieSlices.filter((tData) => {\n const { source, rowId } = tData;\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n\n const pieSliceInf = filteredPies[0];\n if (pieSliceInf) {\n const measurement = this.measurement();\n const centroid = this._arcFn.centroid(pieSliceInf);\n return [{\n x: centroid[0] + measurement.width / 2,\n y: centroid[1] + measurement.height / 2,\n width: 2,\n height: 2\n }];\n }\n return [];\n }\n}\n","import { getObjProp, interpolator, FieldType, selectElement } from 'muze-utils';\nimport { ANGLE, RADIUS, SIZE, COLOR } from '../../enums/constants';\n\nexport const getPreviousPoint = (prevData, currIndex, context) => {\n const prevArc = prevData[currIndex - 1];\n const nextArc = prevData[currIndex];\n const [startAngle, endAngle] = context.axes().angle.range();\n if (prevArc && nextArc) {\n return {\n update: {\n angle0: getObjProp(prevArc, 'update', 'angle'),\n angle: getObjProp(nextArc, 'update', 'angle0')\n }\n };\n } else if (!nextArc) {\n return {\n update: {\n angle0: (endAngle - 90) * Math.PI * 2 / 360,\n angle: (endAngle - 90) * Math.PI * 2 / 360\n }\n };\n }\n return {\n update: {\n angle0: (startAngle - 90) * Math.PI * 2 / 360,\n angle: (startAngle - 90) * Math.PI * 2 / 360\n }\n };\n};\n\nexport const tweenPie = (path, b) => {\n const datum = b[0];\n return function (t) {\n return path(interpolator()(datum._previousInfo, datum)(t));\n };\n};\n\nexport const tweenExitPie = (consecutiveExits, transition, path) => {\n if (consecutiveExits.length > 0) {\n consecutiveExits.forEach((consecutiveExitArr) => {\n const startAngle = consecutiveExitArr[0].datum.update.angle0;\n const endAngle = consecutiveExitArr[consecutiveExitArr.length - 1].datum.update.angle;\n const mid = (Math.PI * 2 * startAngle) / ((Math.PI * 2) + startAngle - endAngle);\n\n consecutiveExitArr.forEach((e) => {\n const { elem, datum } = e;\n\n elem.each(function () {\n const gElem = selectElement(this);\n gElem.selectAll('path')\n .transition()\n .duration(transition.duration)\n .attrTween('d', () => function (t) {\n return path(interpolator()(datum, {\n update: {\n angle0: mid,\n angle: mid,\n radius: datum.radius,\n radius0: datum.radius0\n }\n })(t));\n })\n .remove();\n gElem.remove();\n });\n });\n });\n }\n};\n\nexport const getFieldIndices = (encoding, fieldsConfig) => {\n const [angleField, radiusField, colorField, sizeField] = [ANGLE, RADIUS, COLOR, SIZE]\n .map(e => encoding[e].field);\n const [angleIndex, sizeIndex, radiusIndex] = [angleField, sizeField, radiusField]\n .map((e) => {\n const conf = fieldsConfig[e];\n if (conf && conf.def.type === FieldType.MEASURE) {\n return conf.index;\n }\n return null;\n });\n const colorIndex = getObjProp(fieldsConfig, colorField, 'index');\n return {\n angleIndex,\n sizeIndex,\n radiusIndex,\n colorIndex\n };\n};\n","import {\n setAttrs,\n setStyles,\n selectElement,\n makeElement,\n getSmartComputedStyle\n} from 'muze-utils';\n\n/**\n * Draws svg text in the specified container.\n * @param {SVGElement} container Container where labels will be appended.\n * @param {Array.} data Data of the elements.\n * @return {Selection} d3 selection of the elements.\n */\nconst drawText = (container, data, config, layerInst) => {\n const selection = selectElement(container).selectAll('g').data(data);\n const { smartLabel } = layerInst._dependencies;\n const graphicElems = layerInst._graphicElems;\n\n const selectionMerge = selection.enter().append('g')\n .each(function (dataObj) {\n setAttrs(this, dataObj.enter);\n })\n .merge(selection);\n const style = getSmartComputedStyle(selectElement(container), config.className);\n const fontSize = parseInt(style.fontSize, 10);\n\n smartLabel.setStyle(style);\n selectionMerge.each(function (dataObj) {\n const element = selectElement(this);\n graphicElems[dataObj.rowId] = element;\n const { update, text, color, textanchor, style: textStyle } = dataObj;\n const background = dataObj.background;\n let backgroundVal;\n if (backgroundVal = background.value) {\n const backgroundPadding = background.padding;\n let diff;\n const { width, height } = smartLabel.getOriSize(dataObj.text);\n const backgroundEl = makeElement(element, 'rect', [1]);\n\n if (textanchor === 'end') {\n diff = width;\n } else if (textanchor === 'start') {\n diff = 0;\n } else {\n diff = width / 2;\n }\n\n setAttrs(backgroundEl.node(), {\n x: update.x - diff - backgroundPadding / 2,\n y: update.y - fontSize - backgroundPadding / 2,\n width: width + backgroundPadding,\n height: height + backgroundPadding\n });\n background && setStyles(backgroundEl, {\n background: backgroundVal\n });\n }\n const textEl = makeElement(element, 'text', d => [d]).text(text);\n const textNode = textEl.node();\n textStyle && setStyles(textNode, textStyle);\n color && setStyles(textNode, {\n fill: color\n });\n dataObj.className && textEl.classed(dataObj.className, true);\n setAttrs(textNode, update);\n textEl.attr('text-anchor', textanchor);\n textEl.attr('alignment-baseline', dataObj['alignment-baseline']);\n textEl.attr('transform', `rotate(${dataObj.rotation} ${update.x} ${update.y})`);\n });\n selection.exit().remove();\n return selection;\n};\n\nexport default drawText;\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-text',\n classPrefix: CLASSPREFIX,\n className: '',\n transform: {\n type: 'identity'\n },\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n color: {},\n size: {},\n radius: {},\n angle: {},\n text: {\n value: '',\n formatter: (val, i, data, context) => {\n const valueParser = context.valueParser();\n return valueParser(val);\n },\n background: {\n padding: 10\n }\n },\n rotation: {\n value: 0\n },\n 'alignment-baseline': {\n value: 'middle'\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-text-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-text-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-text-selected`\n }\n }\n};\n","import {\n getQualifiedClassName,\n selectElement,\n setStyles,\n createElements\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport drawText from './renderer';\nimport { defaultConfig } from './default-config';\nimport { positionPoints, getIndividualClassName, resolveEncodingValues, getColorMetaInf, toCartesianCoordinates }\n from '../../helpers';\nimport { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants';\n\nimport './styles.scss';\n\nconst defaultEncoding = defaultConfig.encoding;\nconst alignmentBaseLine = defaultEncoding['alignment-baseline'].value;\nconst defRotation = defaultEncoding.rotation.value;\n\nconst pointTranslators = {\n polar: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes;\n const { formatter: textFormatter } = textEncoding;\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const angleV = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const source = d.source;\n const text = d.text;\n\n const color = colorAxis.getColor(d.color);\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n\n const angle = (startAngle + endAngle) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n angle,\n radius,\n color,\n text,\n startAngle,\n endAngle,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n angle: resolvedVal.angle,\n radius: resolvedVal.radius\n },\n text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text,\n color: resolvedVal.color,\n rotation: resolvedVal.rotation,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedVal['alignment-baseline'],\n meta: getColorMetaInf({\n fill: resolvedVal.color\n }, colorAxis),\n style: {},\n source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement());\n\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n },\n cartesian: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const colorAxis = axes.color;\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { field: textField, value, formatter: textFormatter } = textEncoding;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1;\n const xEnc = ENCODING.X;\n const yEnc = ENCODING.Y;\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const row = d.source;\n const textValue = textField ? row[textFieldIndex] : value;\n\n const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) +\n axes[type].getUnitWidth() / 2 : 0));\n\n const color = colorAxis.getColor(d.color, colorAxis);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n text: textValue,\n color,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n },\n text: textFormatter(resolvedEncodings.text, i, data, layerInst),\n color: resolvedEncodings.color,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedEncodings['alignment-baseline'],\n rotation: resolvedEncodings.rotation,\n meta: getColorMetaInf({\n fill: resolvedEncodings.color\n }, colorAxis),\n style: {},\n source: d.source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = positionPoints(layerInst, points);\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n};\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport default class TextLayer extends BaseLayer {\n /**\n * Returns the default configuration of the text layer\n * @return {Object} Default configuration of the text layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'text';\n }\n\n elemType () {\n return 'text';\n }\n\n getPointTranslator (val) {\n return pointTranslators[val];\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {textLayer} Instance of text layer\n */\n render (container) {\n const config = this.config();\n const normalizedData = this._normalizedData;\n const className = config.className;\n const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n\n containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true);\n this._graphicElems = {};\n\n createElements({\n data: normalizedData,\n append: 'g',\n selector: 'g',\n container,\n each: (dataArr, group) => {\n const node = group.node();\n const points = this.translatePoints(dataArr, {}, this);\n setStyles(node, {\n 'text-anchor': TEXT_ANCHOR_MIDDLE\n });\n drawText(node, points, {\n className: qualifiedClassName[0]\n }, this);\n }\n });\n return this;\n }\n}\n","/* global Element, document */\nimport {\n makeElement,\n selectElement,\n easeFns,\n objectIterator,\n getSymbol\n} from 'muze-utils';\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, groupElement) {\n const { shape, size, update } = d;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n createShape(d, groupElement);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n if (newShape.nodeName === 'path' || newShape.nodeName === 'image') {\n shapeElement.attr('transform', `scale(${size / 100})`);\n } else {\n shapeElement.attr('height', size);\n shapeElement.attr('width', size);\n }\n shapeElement.attr('x', -size / 2);\n shapeElement.attr('y', -size / 2);\n makeElement(groupElement, () => newShape, [1]);\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = getSymbol(shape).size(size)(update);\n }\n makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n } else {\n d.shape = 'circle';\n createShape(d, groupElement);\n }\n};\n\n/**\n * Draws symbols using d3 symbol api\n * @param {Object} params Contains the svg container, points and other symbol related attributes.\n */\n/* istanbul ignore next */ const drawSymbols = (params) => {\n const { layer, container, points, transition, className } = params;\n const { duration, effect, disabled } = transition;\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const { enter } = d;\n group.attr('transform', `translate(${enter.x},${enter.y})`);\n },\n update: (group, d) => {\n createShape(d, group);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n objectIterator(style, key => group.style(key, style[key]));\n group.attr('class', className);\n group.classed(d.className, true);\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n group.attr('transform', `translate(${update.x},${update.y})`);\n },\n exit: (exitGroup) => {\n if (!disabled) {\n exitGroup.transition().ease(easeFns[effect])\n .duration(duration)\n .on('end', () => exitGroup.remove())\n .style('fill-opacity', 0)\n .style('stroke-opacity', 0);\n } else {\n exitGroup.remove();\n }\n }\n }, params.keyFn);\n};\n\nexport default drawSymbols;\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-point',\n className: '',\n classPrefix: CLASSPREFIX,\n defColorStyle: 'stroke',\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, 0, +1]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +20, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +20, 0]\n }\n ]\n },\n innerPadding: 0.1,\n nearestPointThreshold: 10,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n size: {\n value: 30\n },\n color: {},\n stroke: {\n value: 'hsla(0,0%,0%,0)'\n },\n fill: {},\n shape: {\n value: 'circle'\n },\n x: {},\n y: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n shapes: ['circle', 'cross', 'diamond', 'square', 'star', 'wye', 'triangle'],\n sizes: [20, 30, 40, 50, 60, 70]\n};\n","import {\n Voronoi,\n selectElement,\n getQualifiedClassName,\n makeElement,\n FieldType,\n Scales\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport drawSymbols from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n positionPoints,\n getPlotMeasurement,\n getIndividualClassName,\n getMarkId,\n getColorMetaInf,\n resolveEncodingValues\n} from '../../helpers';\n\nimport './styles.scss';\n\n/**\n * This layer is used to create various symbols for each data point. This is commonly used in\n * scatterplot visualizations. The mark type of this layer is ```point```.\n *\n * @public\n *\n * @class\n * @module PointLayer\n * @extends BaseLayer\n */\nexport default class PointLayer extends BaseLayer {\n\n /**\n * Creates an instance of PointLayer.\n * @param {*} args\n * @memberof PointLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n this._bandScale = Scales.band();\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Returns the default configuration of the point layer\n * @return {Object} Default configuration of the point layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n static formalName () {\n return 'point';\n }\n\n static drawFn () {\n return drawSymbols;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n let points = [];\n const encoding = this.config().encoding;\n const axes = this.axes();\n const {\n x,\n y\n } = encoding;\n const xField = x.field;\n const yField = y.field;\n const { size: sizeAxis, shape: shapeAxis } = axes;\n const fieldsConfig = this.data().getFieldsConfig();\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = this.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const stroke = encoding.stroke.value;\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const size = sizeAxis.getSize(d.size);\n const shape = shapeAxis.getShape(d.shape);\n\n let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => {\n const value = d[type] === null ? undefined : d[type];\n const measure = type === ENCODING.X ? measurement.width : measurement.height;\n return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value);\n });\n\n xPx += offsetX;\n yPx += offsetY;\n\n let color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color,\n shape,\n size,\n data: d\n },\n data: d\n }, i, data, this);\n color = resolvedEncodings.color;\n\n const style = {\n fill: color,\n stroke\n };\n const pos = {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: pos,\n update: pos,\n shape: resolvedEncodings.shape,\n size: Math.abs(resolvedEncodings.size),\n meta: getColorMetaInf(style, colorAxis),\n style,\n source: d.source,\n rowId: d.rowId\n };\n point.className = getIndividualClassName(d, i, data, this);\n points.push(point);\n this.cachePoint(d[key], point);\n }\n }\n points = positionPoints(this, points);\n return points;\n }\n\n /**\n * Renders the plot in the given container.\n *\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {BarLayer} Instance of bar layer\n */\n render (container) {\n let maxSize = 0;\n let seriesClassName;\n const config = this.config();\n const keys = this._transformedData.map(d => d.key);\n const { transition, className, defClassName, classPrefix } = config;\n const normalizedData = this._normalizedData;\n const containerSelection = selectElement(container);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n this._points = [];\n this._pointMap = {};\n\n containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true);\n\n this._points = this.generateDataPoints(normalizedData, keys);\n this._graphicElems = {};\n\n const schema = this.data().getSchema();\n makeElement(container, 'g', this._points, null, {\n update: (group, points) => {\n maxSize = Math.max(maxSize, ...points.map(d => d.size));\n seriesClassName = `${qualifiedClassName[0]}`;\n this.constructor.drawFn()({\n layer: this,\n container: group.node(),\n points,\n interpolate: config.interpolate,\n className: seriesClassName,\n transition,\n keyFn: v => getMarkId(v.source, schema)\n });\n }\n }, data => data[0].rowId);\n this._maxSize = Math.sqrt(maxSize / Math.PI) * 2;\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n generateDataPoints (normalizedData, keys) {\n const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys);\n const offsetXValues = widthMetrics.offsetValues || [];\n const offsetYValues = heightMetrics.offsetValues || [];\n return normalizedData.map((dataArr, i) => {\n const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span,\n heightMetrics.span);\n return this.translatePoints(dataArr, measurementConf);\n }).filter(d => d.length);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0) + widthSpan / 2,\n y: (offsetY || 0) + heightSpan / 2\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n /**\n * Gets the nearest point from a position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Point details\n */\n getNearestPoint (x, y) {\n const distanceLimit = Math.max(this._maxSize, this.config().nearestPointThreshold);\n\n if (!this.data()) {\n return null;\n }\n\n const point = this._voronoi.find(x, y, distanceLimit);\n const dimensions = point && point.data.data.update;\n const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0;\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: radius,\n height: radius\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n}\n","import { makeElement, easeFns } from 'muze-utils';\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} datum\n * @param {*} index\n * @param {*} context\n */\nconst transitionBars = (layer, elem, datum, index, context) => {\n const { transition } = context;\n const { duration, disabled, effect } = transition;\n const selection = elem;\n\n const selTransition = disabled ? selection :\n selection.transition()\n .duration(duration)\n .ease(easeFns[effect])\n .on('end', layer.registerAnimationDoneHook());\n const update = datum.update || datum;\n const updateStyle = datum.style || {};\n datum.className && selection.classed(datum.className, true);\n Object.entries(update).forEach(attr => (!isNaN(attr[1]) && selTransition.attr(attr[0], attr[1])));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n};\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} d\n */\nconst barEnterFn = (elem, d) => {\n const selection = elem;\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n};\n\n/**\n * Draws rectangles by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Bar Selection\n */\n/* istanbul ignore next */ export const drawRects = (params) => {\n const { layer, points, container, keyFn } = params;\n const graphicElems = layer._graphicElems;\n const updateFns = {\n enter (elem, d) { barEnterFn(elem, d); },\n update (elem, d, i) {\n graphicElems[d.rowId] = elem;\n transitionBars(layer, elem, d, i, params);\n }\n };\n return makeElement(container, 'rect', points, null, updateFns, keyFn);\n};\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-bar',\n className: '',\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n transform: {\n type: 'stack'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n innerPadding: 0.1,\n encoding: {\n color: {},\n x: {},\n y: {},\n x0: {},\n y0: {}\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-bar-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-bar-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-bar-selected`\n }\n }\n};\n\n","import { MeasureSubtype, DimensionSubtype } from 'muze-utils';\nimport { STACK } from '../../enums/constants';\nimport { positionPoints, getIndividualClassName, getColorMetaInf, resolveEncodingValues } from '../../helpers';\n\nconst positionRetriever = {\n x: (xPx, isNegativeVal, barBasePos) => (isNegativeVal ? [xPx, barBasePos] : [barBasePos, xPx]),\n y: (yPx, isNegativeVal, barBasePos) => (isNegativeVal ? [barBasePos, yPx] : [yPx, barBasePos])\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fieldInfo\n * @param {*} config\n * @param {*} data\n *\n */\nconst resolveDimByField = (type, axesInfo, config, data) => {\n const spaceType = type === 'x' ? 'width' : 'height';\n const [fieldType, axis] = [config[`${type}FieldType`], axesInfo[`${type}Axis`]];\n const {\n transformType,\n sizeEncoding,\n sizeConfig,\n measurement\n } = config;\n\n const sizeValue = sizeEncoding.value;\n let enter = 0;\n let pos;\n let space = 0;\n let enterSpace = 0;\n if (fieldType !== undefined) {\n if (config[`${type}0Field`]) {\n const minVal = data[type];\n const maxVal = data[`${type}0`];\n let min;\n let max;\n if (minVal === null || maxVal === null) {\n return {\n enterSpace: undefined,\n enter: undefined,\n pos: undefined,\n space: undefined\n };\n } else if (fieldType === MeasureSubtype.CONTINUOUS || fieldType === DimensionSubtype.TEMPORAL) {\n min = Math.min(minVal, maxVal);\n max = Math.max(minVal, maxVal);\n } else {\n min = minVal;\n max = maxVal;\n }\n const scales = type === 'x' ? [min, max] : [max, min];\n pos = axis.getScaleValue(scales[0]) + axis.getUnitWidth() / 2;\n space = Math.abs(axis.getScaleValue(scales[1]) - pos) + axis.getUnitWidth() / 2;\n\n enter = pos;\n enterSpace = 0;\n } else if (fieldType === DimensionSubtype.CATEGORICAL || fieldType === DimensionSubtype.TEMPORAL) {\n pos = axis.getScaleValue(data[type]) +\n (sizeConfig[type === 'x' ? 'barWidthOffset' : 'barHeightOffset'] || 0);\n\n space = sizeConfig[type === 'x' ? 'barWidth' : 'barHeight'];\n if (sizeValue !== undefined) {\n const diffPx = sizeValue * space;\n space -= diffPx;\n pos += diffPx / 2;\n }\n enter = pos;\n enterSpace = space;\n } else {\n const minDomVal = axis.domain()[0];\n const barBasePos = minDomVal < 0 ? axis.getScaleValue(0) : axis.getScaleValue(minDomVal);\n pos = axis.getScaleValue(data[type]);\n let endPos = axis.getScaleValue(data[`${type}0`]);\n\n enterSpace = 0;\n const isNegativeVal = data[type] < 0;\n if (transformType !== STACK) {\n [pos, endPos] = positionRetriever[type](pos, isNegativeVal, barBasePos);\n }\n space = Math.abs(pos - endPos);\n enter = barBasePos;\n }\n } else {\n pos = 0;\n space = measurement[spaceType];\n }\n\n return {\n enterSpace,\n enter,\n pos,\n space\n };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} config\n * @param {*} axes\n *\n */\nconst resolveDimensions = (data, config, axes) => {\n const axesInfo = {\n xAxis: axes.x,\n yAxis: axes.y\n };\n const {\n enterSpace: enterWidth,\n enter: enterX,\n pos: xPos,\n space: width\n } = resolveDimByField('x', axesInfo, config, data);\n\n const {\n enterSpace: enterHeight,\n enter: enterY,\n pos: yPos,\n space: height\n } = resolveDimByField('y', axesInfo, config, data);\n return {\n enter: {\n x: enterX,\n y: enterY,\n width: enterWidth,\n height: enterHeight\n },\n update: {\n x: xPos,\n y: yPos,\n width,\n height\n }\n };\n};\n\n/**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\nexport const getTranslatedPoints = (context, data, sizeConfig) => {\n let points = [];\n const encoding = context.config().encoding;\n const axes = context.axes();\n const colorAxis = axes.color;\n const sizeEncoding = encoding.size || {};\n const {\n x0Field,\n y0Field,\n xFieldSubType,\n yFieldSubType\n } = context.encodingFieldsInf();\n const measurement = context.measurement();\n const isXDim = xFieldSubType === DimensionSubtype.CATEGORICAL || xFieldSubType === DimensionSubtype.TEMPORAL;\n const isYDim = yFieldSubType === DimensionSubtype.CATEGORICAL || yFieldSubType === DimensionSubtype.TEMPORAL;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const transformType = context.transformType();\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const dimensions = resolveDimensions(d, {\n xFieldType: xFieldSubType,\n yFieldType: yFieldSubType,\n x0Field,\n y0Field,\n transformType,\n measurement,\n sizeConfig,\n sizeEncoding\n }, axes);\n\n let color = colorAxis.getColor(d.color);\n\n const update = dimensions.update;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: update.x,\n y: update.y,\n width: update.width,\n height: update.height,\n color\n },\n data: d\n }, i, data, context);\n color = resolvedEncodings.color;\n const { x, y, width, height } = resolvedEncodings;\n const style = {\n fill: color\n };\n\n if (!isNaN(x) && !isNaN(y) && d.rowId !== undefined) {\n let point = null;\n point = {\n enter: dimensions.enter,\n update: {\n x,\n y,\n width,\n height\n },\n source: d.source,\n rowId: d.rowId,\n style,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, context);\n points.push(point);\n // Store each point in a hashmap with key as the dimensional or temporal field value\n context.cachePoint(d[key], point);\n }\n }\n\n points = positionPoints(context, points);\n return points;\n};\n","import {\n getQualifiedClassName,\n selectElement,\n createElements,\n clipElement,\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n Scales,\n getNearestValue,\n getObjProp\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawRects } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { getPlotMeasurement, getValidTransformForAggFn } from '../../helpers';\nimport './styles.scss';\nimport { getTranslatedPoints } from './bar-helper';\n\nconst MEASURE = FieldType.MEASURE;\nconst scaleBand = Scales.band;\n\n/**\n * Bar layer creates rectangle marks. The mark type of this layer is ```bar```. This layer can be used\n * to create stacked or grouped bars, range bars, heatmap plots and also reference bands by using\n * the encoding properties.\n *\n * @public\n *\n * @class\n * @module BarLayer\n * @extends BaseLayer\n */\nexport default class BarLayer extends BaseLayer {\n /**\n * Creates an instance of bar layer\n */\n constructor (...params) {\n super(...params);\n this._bandScale = scaleBand();\n this._plotPadding = {\n x: 0,\n y: 0\n };\n this._plotSpan = {\n x: 0,\n y: 0\n };\n this._pointMap = {};\n }\n\n /**\n *\n *\n *\n * @memberof BarLayer\n */\n elemType () {\n return 'rect';\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof BarLayer\n */\n static formalName () {\n return 'bar';\n }\n\n /**\n * Returns the default configuration of the bar layer\n * @return {Object} Default configuration of the bar layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n * @param {*} conf\n * @param {*} userConf\n *\n * @memberof BarLayer\n */\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const colorField = encoding.color.field;\n const transform = config.transform;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n *\n *\n * @param {*} data\n * @param {*} fieldsConfig\n *\n * @memberof BarLayer\n */\n calculateDomainFromData (data, encodingFieldInf, fieldsConfig) {\n const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig);\n ['x', 'y'].forEach((d) => {\n if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) {\n if (encodingFieldInf[`${d}0Field`]) {\n domain[d] = domain[d].sort((a, b) => a - b);\n } else {\n domain[d][0] = Math.min(domain[d][0], 0);\n domain[d][1] = Math.max(0, domain[d][1]);\n }\n }\n });\n return domain;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\n translatePoints (data, sizeConfig) {\n return getTranslatedPoints(this, data, sizeConfig);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGGroup} container SVGGroup where plot will be rendered.\n * @return {BarLayer} Instance of bar layer.\n */\n render (container) {\n const config = this.config();\n const transition = config.transition;\n const normalizedDataArr = this._normalizedData;\n const transformedData = this._transformedData;\n const keys = transformedData.map(d => d.key);\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const height = axes.y && axes.y.scale().range()[0];\n const width = axes.x && axes.x.scale().range()[1];\n const defClassName = config.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const className = config.className;\n const containerSelection = selectElement(container);\n const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION)\n .map(e => e.index);\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n clipElement(container, {\n x: 0,\n y: 0,\n width,\n height\n }, `id-${this.id()}`);\n\n this._points = this.generateDataPoints(normalizedDataArr, keys);\n this._graphicElems = {};\n\n createElements({\n data: this._points,\n container,\n selector: 'g',\n append: 'g',\n each: (points, group, i) => {\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n group.style('display', 'block');\n drawRects({\n layer: this,\n container: group.node(),\n points,\n className: seriesClassName,\n transition,\n style: {},\n keyFn: d => dimensions.map(key => d.source[key]).join('-')\n });\n }\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} normalizedData\n * @param {*} keys\n *\n * @memberof BarLayer\n */\n generateDataPoints (normalizedData, keys) {\n const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys);\n const barWidthOffsets = barWidthMetrics.offsetValues || [];\n const barHeightOffsets = barHeightMetrics.offsetValues || [];\n this._plotSpan = {\n x: barWidthMetrics.groupSpan || 0,\n y: barHeightMetrics.groupSpan || 0\n };\n this._plotPadding = {\n x: barWidthMetrics.padding || 0,\n y: barHeightMetrics.padding || 0\n };\n\n this._pointMap = {};\n return normalizedData.map((data, i) => this.translatePoints(data,\n {\n barWidth: barWidthMetrics.span,\n barWidthOffset: barWidthOffsets[i] || 0,\n barHeight: barHeightMetrics.span,\n barHeightOffset: barHeightOffsets[i] || 0\n }));\n }\n\n getPlotPadding () {\n return this._plotPadding;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Gets the nearest point of the position passed.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point.\n */\n getNearestPoint (x, y) {\n if (!this.data()) {\n return null;\n }\n let axis;\n let value;\n let points;\n let uniqueFieldType;\n let uniqueFieldIndex;\n let filterData;\n let identifiers;\n let pointFound = null;\n const dataModel = this.data();\n const dataObj = dataModel.getData();\n const fieldsConfig = dataModel.getFieldsConfig();\n const axes = this.axes();\n const data = dataObj.data;\n const pointMap = this._pointMap;\n const {\n xField,\n yField,\n xFieldSubType,\n yFieldSubType\n } = this.encodingFieldsInf();\n\n if (xFieldSubType === MeasureSubtype.CONTINUOUS) {\n axis = axes.y;\n value = axis.invert(y);\n uniqueFieldIndex = fieldsConfig[yField].index;\n uniqueFieldType = yFieldSubType;\n } else {\n axis = axes.x;\n value = axis.invert(x);\n uniqueFieldIndex = fieldsConfig[xField].index;\n uniqueFieldType = xFieldSubType;\n }\n\n if (uniqueFieldType === DimensionSubtype.CATEGORICAL) {\n points = pointMap[value];\n }\n\n if (uniqueFieldType === DimensionSubtype.TEMPORAL) {\n filterData = [...new Set(data.map(d => d[uniqueFieldIndex]))];\n value = getNearestValue(filterData, value);\n points = pointMap[value];\n }\n const len = points && points.length;\n points && points.sort((p1, p2) => p1.update.y - p2.update.y);\n for (let i = 0; i < len; i++) {\n const point = points[i];\n const update = point.update;\n if (x >= update.x && x <= (update.width + update.x) && y >= update.y && y <= (update.height + update.y)) {\n pointFound = point;\n break;\n }\n pointFound = null;\n }\n\n const values = pointFound && pointFound.source;\n if (values) {\n identifiers = this.getIdentifiersFromData(values, pointFound.rowId);\n }\n return pointFound ? {\n dimensions: [pointFound.update],\n id: identifiers,\n layerId: this.id()\n } : pointFound;\n }\n\n getPlotSpan () {\n return this._plotSpan;\n }\n\n hasPlotSpan () {\n return true;\n }\n}\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-tick',\n className: '',\n classPrefix: CLASSPREFIX,\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'stroke',\n intensity: [0, 0, 15, 0]\n }],\n focus: [{\n type: 'stroke',\n intensity: [0, 0, 15, 0]\n }]\n },\n innerPadding: 0.1,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n interpolate: 'linear',\n encoding: {\n color: { },\n x: {},\n y: {},\n x0: {},\n y0: {},\n radius: {},\n radius0: {},\n angle: {},\n angle0: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-tick-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-tick-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-tick-selected`\n }\n }\n};\n\n","import { selectElement, Symbols, pathInterpolators } from 'muze-utils';\n\nconst line = Symbols.line;\n\n/**\n * Draws ticks by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Ticks Selection\n */\nexport default /* istanbul ignore next */ (params) => {\n const { points, container, keyFn, className, interpolate, layer } = params;\n const mount = selectElement(container);\n const ticks = mount.selectAll('path').data(points, keyFn);\n const ticksEnter = ticks.enter().append('path');\n const graphicElems = layer._graphicElems;\n mount.attr('class', className || '');\n ticksEnter.each(function (d) {\n const selection = selectElement(this);\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n });\n\n ticks.exit().remove();\n return ticks.merge(ticksEnter)\n .each(function (d) {\n const selection = selectElement(this);\n graphicElems[d.rowId] = selection;\n const update = d.update;\n const updateStyle = d.style || {};\n const x0 = update.x0 !== undefined ? update.x0 : update.x;\n const y0 = update.y0 !== undefined ? update.y0 : update.y;\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(e => e[0])\n .y(e => e[1]);\n d.className && selection.classed(d.className, true);\n selection.attr('d', linepath([[update.x, update.y], [x0, y0]]));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n });\n};\n\n","import { FieldType } from 'muze-utils';\nimport { PointLayer } from '../point';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport drawTicks from './renderer';\nimport './styles.scss';\nimport { getAxesScales, positionPoints, getIndividualClassName,\n getColorMetaInf, resolveEncodingValues, toCartesianCoordinates } from '../../helpers';\n\nconst pointTranslators = {\n polar: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes;\n const measurement = layerInst.measurement();\n\n const colorAxis = axes.color;\n const angleV = {};\n const angle0V = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const color = colorAxis.getColor(d.color);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const angles0 = angle0Axis.getScaleValue(d.angle0);\n !angle0V[d.angle0] && (angle0V[d.angle0] = 0);\n const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++];\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angle = (startAngle + endAngle) / 2;\n const angle0 = (startAngle0 + endAngle0) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n radius,\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color,\n angle,\n angle0,\n startAngle,\n endAngle,\n startAngle0,\n endAngle0\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedVal.color\n };\n\n const point = {\n enter: {},\n update: {\n radius: resolvedVal.radius,\n radius0: resolvedVal.radius0,\n angle: resolvedVal.angle,\n angle0: resolvedVal.angle0\n },\n style,\n source: d.source,\n rowId: d.rowId,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true);\n return points;\n },\n cartesian: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const {\n xAxis,\n yAxis\n } = getAxesScales(axes);\n const {\n xField,\n yField,\n x0Field,\n y0Field,\n xFieldType,\n yFieldType\n } = layerInst.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const { x: xSpan, y: ySpan } = config.span;\n for (let i = 0, len = data.length; i < len; i++) {\n let xPx;\n let x0Px;\n let y0Px;\n let yPx;\n const d = data[i];\n const row = d.source;\n if (xField) {\n xPx = xAxis.getScaleValue(d.x) + offsetX;\n x0Px = xPx + xSpan;\n }\n\n if (yField) {\n yPx = yAxis.getScaleValue(d.y) + offsetY;\n y0Px = yPx !== null ? yPx + ySpan : null;\n }\n\n if (!xField) {\n xPx = 0;\n x0Px = measurement.width;\n if (!isNaN(yPx)) {\n yPx += ySpan / 2;\n y0Px = yPx;\n }\n }\n\n if (!yField) {\n yPx = 0;\n y0Px = measurement.height;\n x0Px = xPx += xSpan / 2;\n }\n\n if (x0Field) {\n x0Px = xAxis.getScaleValue(d.x0) + xSpan;\n yPx += ySpan / 2;\n y0Px -= ySpan / 2;\n }\n\n if (y0Field) {\n y0Px = yAxis.getScaleValue(d.y0) + ySpan;\n xPx += xSpan / 2;\n x0Px -= xSpan / 2;\n }\n const color = colorAxis.getColor(d.color);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n x0: x0Px,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedEncodings.color\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y,\n x0: resolvedEncodings.x0,\n y0: resolvedEncodings.y0\n },\n style,\n source: row,\n rowId: d.rowId,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport default class TickLayer extends PointLayer {\n\n /**\n *\n *\n * @staticg\n *\n * @memberof TickLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TickLayer\n */\n static formalName () {\n return 'tick';\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TickLayer\n */\n static drawFn () {\n return drawTicks;\n }\n\n /**\n *\n *\n *\n * @memberof TickLayer\n */\n elemType () {\n return 'path';\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0),\n y: (offsetY || 0)\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n}\n","export const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { isSimpleObject, mergeRecursive, getObjProp } from 'muze-utils';\n\nconst parseLayerDefinition = (sink, definition, layerDef, layerType) => {\n for (const key in definition) {\n if (Object.hasOwnProperty.call(definition, key)) {\n let strs;\n let propValue;\n const def = definition[key];\n if (isSimpleObject(def)) {\n sink[key] = {};\n parseLayerDefinition(sink[key], def, layerDef, layerType);\n } else if (typeof def === 'string' && (strs = def.split('.')) && strs[0] === layerType) {\n propValue = getObjProp(layerDef, ...strs.slice(1, strs.length));\n if (propValue !== undefined) {\n sink[key] = propValue;\n }\n } else {\n sink[key] = def;\n }\n }\n }\n};\n\nconst sanitizeEncoding = (encoding) => {\n // Create object for each encoding value if encoding value is a string\n for (const key in encoding) {\n if (typeof encoding[key] === 'string') {\n encoding[key] = {\n field: encoding[key]\n };\n }\n }\n};\n\n/**\n * Layer Factory creates layers based on the layer type. All types of layers needs to register in\n * the layer factory. For getting a layer instance, getLayer method needs to invoked with the\n * layerType and other arguments. It also registers the definition of composite layers.\n *\n * @public\n *\n * @module LayerFactory\n */\nconst layerFactory = (() => {\n const compositeLayers = {};\n const factoryObj = {\n setLayerRegistry: (reg) => {\n factoryObj._layerRegistry = reg;\n },\n getSerializedConf: (mark, layerDef) => {\n let serializedDefs;\n const defs = compositeLayers[mark];\n const newConf = mergeRecursive({}, layerDef);\n\n // If it is a composite layer then resolve all the definitions of each unit layer\n if (defs) {\n serializedDefs = defs.map((unitLayerDef) => {\n const sDef = {};\n parseLayerDefinition(sDef, unitLayerDef, newConf, mark);\n sanitizeEncoding(sDef.encoding);\n return sDef;\n });\n } else {\n const encoding = newConf.encoding;\n // Create object for each encoding value if encoding value is a string\n sanitizeEncoding(encoding);\n serializedDefs = newConf;\n }\n\n return serializedDefs;\n },\n getLayerInstance: (layerDef, ...params) => {\n const layerRegistry = factoryObj._layerRegistry;\n layerDef = !(layerDef instanceof Array) ? [layerDef] : layerDef;\n const instances = layerDef.map((layerObj) => {\n const layerConstructor = layerRegistry[layerObj.mark];\n return layerConstructor.create(...params);\n });\n return instances.length === 1 ? instances[0] : instances;\n },\n getLayerClass: mark => factoryObj._layerRegistry[mark],\n /**\n * Registers a new composite layer definition in the layer factory.\n *\n * @public\n *\n * @param {string} layerType Mark type of the new composite layer.\n * @param {Array} layerDefs Layer definitions of the composite layer.\n */\n composeLayers: (layerType, layerDefs) => {\n compositeLayers[layerType] = layerDefs;\n },\n sanitizeLayerConfig: (layerDef) => {\n const newConf = mergeRecursive({}, layerDef);\n sanitizeEncoding(newConf.encoding);\n return newConf;\n }\n };\n return factoryObj;\n})();\n\nexport default layerFactory;\n","import layerFactory from './layer-factory';\n\nexport default layerFactory;\n","import { AreaLayer } from './layers/area';\nimport { ArcLayer } from './layers/arc';\nimport { LineLayer } from './layers/line';\nimport { TextLayer } from './layers/text';\nimport { PointLayer } from './layers/point';\nimport { BarLayer } from './layers/bar';\nimport { BaseLayer } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport { TickLayer } from './layers/tick';\n\nexport const DEFAULT_LAYERS = {\n [LAYER_TYPES.AREA_LAYER]: AreaLayer,\n [LAYER_TYPES.ARC_LAYER]: ArcLayer,\n [LAYER_TYPES.LINE_LAYER]: LineLayer,\n [LAYER_TYPES.TEXT_LAYER]: TextLayer,\n [LAYER_TYPES.POINT_LAYER]: PointLayer,\n [LAYER_TYPES.TICK_LAYER]: TickLayer,\n [LAYER_TYPES.BAR_LAYER]: BarLayer,\n [LAYER_TYPES.BASE_LAYER]: BaseLayer\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Artboard.\n * Artboard merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module\n */\n\nexport default {\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * Interfaces for VisualGroup. Any new VisualGroup has to implement this class.\n * @class SimpleGroup\n */\nclass SimpleGroup {\n\n /**\n * This method is used to set or get the DataModel instance.\n *\n * @param {DataModel | undefined} dataModel Instance of datamodel.\n\n * @memberof SimpleGroup\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to set or get the group specific configuration\n * properties\n *\n * @param {Object | undefined} configObj The input configuration.\n * or instance of visual group.\n * @memberof SimpleGroup\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to return a serialized representation of the\n * instance's properties.\n *\n * @memberof SimpleGroup\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to get or set the measurement object which houses\n * layout properties like width and height.\n *\n * @param {Object | undefined} mObj The measurement properties.\n * @memberof SimpleGroup\n */\n measurement () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n\nexport default SimpleGroup;\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: false\n },\n [ACTIONS.HOVER]: {\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.LONGTOUCH]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: true\n },\n [ACTIONS.TOUCHDRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: true\n },\n [ACTIONS.CLICK]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: false\n }\n};\n","import {\n FieldType,\n getDependencyOrder,\n getObjProp,\n defaultValue,\n objectIterator,\n unionDomain,\n makeElement,\n DimensionSubtype,\n toArray,\n MeasureSubtype,\n getNearestValue\n} from 'muze-utils';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\n\nexport const getDimensionMeasureMap = (layers, fieldsConfig) => {\n const retinalEncodingsAndMeasures = {};\n\n layers.forEach((layer) => {\n const {\n colorField,\n sizeField,\n shapeField,\n xField,\n yField\n } = layer.encodingFieldsInf();\n const measures = [xField, yField].filter(field => fieldsConfig[field] && fieldsConfig[field].def.type ===\n FieldType.MEASURE);\n [colorField, sizeField, shapeField].forEach((field) => {\n if (getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION && measures.length) {\n !retinalEncodingsAndMeasures[field] && (retinalEncodingsAndMeasures[field] = []);\n retinalEncodingsAndMeasures[field].push(...measures);\n }\n });\n });\n\n for (const key in retinalEncodingsAndMeasures) {\n if ({}.hasOwnProperty.call(retinalEncodingsAndMeasures, key)) {\n retinalEncodingsAndMeasures[key] = [...new Set(retinalEncodingsAndMeasures[key])];\n }\n }\n return retinalEncodingsAndMeasures;\n};\n\nexport const transformDataModels = (transform, dataModel) => {\n const dataModels = {};\n for (const key in transform) {\n if ({}.hasOwnProperty.call(transform, key)) {\n const transformVal = transform[key];\n dataModels[key] = transformVal(dataModel);\n }\n }\n\n return dataModels;\n};\n\nexport const getLayerFromDef = (context, definition, existingLayer, namespaces) => {\n let instances = existingLayer;\n const dependencies = context._dependencies;\n const metaInf = context.metaInf();\n if (!existingLayer) {\n instances = layerFactory.getLayerInstance(definition);\n toArray(instances).forEach((inst, i) => {\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: namespaces[i],\n parentNamespace: metaInf.namespace\n })\n .dependencies(dependencies)\n .store(context.store());\n });\n }\n const layers = {};\n const instanceArr = toArray(instances);\n definition = toArray(definition);\n definition.reduce((acc, def, idx) => {\n const instance = instanceArr[idx];\n instance.coord(context.coord());\n instance.config(def);\n instance.valueParser(context.valueParser());\n instance.dataProps({\n timeDiffs: context._timeDiffs\n });\n if (def.name) {\n instance.alias(def.name);\n }\n layers[instance.alias()] = instance;\n return acc;\n }, {});\n return layers;\n};\n\nexport const resolveEncodingTransform = (layerInst, store) => {\n const encodingTransform = layerInst.config().encodingTransform || {};\n const resolvable = encodingTransform.resolvable;\n let depArr = [];\n if (resolvable) {\n const resolved = resolvable(store);\n depArr = resolved.depArr;\n layerInst.encodingTransform(resolved.fn);\n } else if (encodingTransform instanceof Function) {\n layerInst.encodingTransform(encodingTransform);\n }\n return depArr;\n};\n\nexport const sanitizeLayerDef = (layerDefs) => {\n const sanitizedDefs = [];\n layerDefs.forEach((layerDef, i) => {\n const def = layerDef.def;\n const mark = layerDef.mark;\n if (!def) {\n const sConf = layerFactory.getSerializedConf(layerDef.mark, layerDef);\n if (!sConf.name) {\n sConf.name = `${mark}-${i}`;\n }\n sanitizedDefs.push({\n mark: layerDef.mark,\n def: sConf\n });\n } else {\n if (!def.name) {\n def.name = `${mark}-${i}`;\n }\n sanitizedDefs.push(layerDef);\n }\n });\n return sanitizedDefs;\n};\n\nexport const attachDataToLayers = (layers, dm, transformedDataModels) => {\n layers.forEach((layer) => {\n const dataSource = layer.config().source;\n const dataModel = dataSource instanceof Function ? dataSource(dm) :\n (transformedDataModels[dataSource] || dm);\n layer.data(dataModel);\n });\n};\n\nexport const attachAxisToLayers = (axes, layers, layerAxisIndex) => {\n layers.forEach((layer) => {\n const layerId = layer.id();\n const axesObj = {};\n\n objectIterator(axes, (key) => {\n const axisInf = layerAxisIndex[layerId];\n if (axisInf) {\n const axisArr = axes[key] || [];\n const axisIndex = axisInf[key] >= 0 ? axisInf[key] : axisArr.length - 1;\n axes[key] && (axesObj[key] = defaultValue(axes[key][axisIndex]));\n }\n });\n Object.keys(axesObj).length && layer.axes(axesObj);\n });\n};\n\nconst { X, Y, RADIUS, ANGLE, ANGLE0, RADIUS0 } = ENCODING;\n\nexport const getLayerAxisIndex = (layers, fields) => {\n const layerAxisIndex = {};\n layers.forEach((layer) => {\n const { axis, encoding } = layer.config();\n const id = layer.id();\n [X, Y, ANGLE, ANGLE0, RADIUS].forEach((type) => {\n let index;\n const specificField = getObjProp(encoding, type, 'field');\n const encodingField = type === RADIUS ? defaultValue(specificField, getObjProp(encoding, RADIUS0, 'field'))\n : getObjProp(encoding, type, 'field');\n const field = defaultValue(getObjProp(axis, type), encodingField);\n if (fields[type] && fields[type].length) {\n index = fields[type].findIndex(fieldInst => fieldInst.getMembers().indexOf(field) !== -1);\n } else {\n index = 0;\n }\n !layerAxisIndex[id] && (layerAxisIndex[id] = {});\n layerAxisIndex[id][type] = index;\n });\n });\n return layerAxisIndex;\n};\n\nconst getValidDomain = (domain, domain1, encodingType, fieldType) => {\n if (encodingType === ANGLE || encodingType === ANGLE0) {\n return domain.concat(domain1.filter(d => domain.indexOf(d) === -1));\n }\n return unionDomain([domain, domain1], fieldType);\n};\n\nexport const unionDomainFromLayers = (layers, axisFields, layerAxisIndex, fieldsConfig) => {\n let domains = {};\n layers = layers.filter(layer => layer.getDataDomain() !== null);\n layers.forEach((layer) => {\n let domainValues = {};\n const config = layer.config();\n // const encoding = config.encoding;\n const layerDomain = layer.getDataDomain();\n const layerId = layer.id();\n\n if (layerDomain !== null && config.calculateDomain !== false) {\n domainValues = Object.entries(layerDomain);\n domains = domainValues.reduce((fieldDomain, domain) => {\n const encodingType = domain[0];\n const axisIndex = layerAxisIndex[layerId][encodingType];\n const field = getObjProp(axisFields, encodingType, axisIndex);\n !fieldDomain[encodingType] && (fieldDomain[encodingType] = {});\n const encodingDomain = fieldDomain[encodingType];\n if (field) {\n const fieldStr = `${field}`;\n encodingDomain[fieldStr] = encodingDomain[fieldStr] || [];\n encodingDomain[fieldStr] = getValidDomain(encodingDomain[fieldStr],\n domain[1], encodingType, fieldsConfig[field.getMembers()[0]].def.subtype);\n }\n return fieldDomain;\n }, domains);\n }\n });\n return domains;\n};\n\nexport const renderLayers = (context, container, layers, measurement) => {\n context._lifeCycleManager.notify({ client: layers, action: 'beforedraw', formalName: 'layer' });\n const config = context.config();\n const classPrefix = config.classPrefix;\n const orderedLayers = context.layers().sort((a, b) => a.config().order - b.config().order);\n const layerParentGroup = makeElement(container, 'g', [1], `${classPrefix}-layer-group`);\n const layerDepOrder = getDependencyOrder(context._layerDepOrder);\n const groups = {};\n makeElement(layerParentGroup, 'g', orderedLayers, null, {\n update: (group, layer) => {\n groups[layer.alias()] = {\n group,\n layer\n };\n }\n });\n\n const layerSeq = layerDepOrder.map(name => groups[name]);\n layerSeq.forEach((o) => {\n const layer = o.layer;\n const group = o.group;\n layer.measurement(measurement);\n layer.dataProps({\n timeDiffs: context._timeDiffs\n });\n layer.config().render !== false && layer.mount(group.node());\n });\n return this;\n};\n\nexport const getNearestDimensionalValue = (context, position) => {\n const fields = context.fields();\n if (!fields.x.length || !fields.y.length) {\n return null;\n }\n const data = context.data();\n const axes = context.axes();\n const fieldsConfig = data.getFieldsConfig();\n const xField = getObjProp(fields, 'x', 0).getMembers()[0];\n const yField = getObjProp(fields, 'y', 0).getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n\n const entryVal = [['x', xFieldType, xField], ['y', yFieldType, yField]].find(entry =>\n entry[1] === DimensionSubtype.CATEGORICAL || entry[1] === DimensionSubtype.TEMPORAL);\n\n if (!entryVal || (xFieldType !== MeasureSubtype.CONTINUOUS && yFieldType !== MeasureSubtype.CONTINUOUS)) {\n return null;\n }\n const field = entryVal[2];\n const index = fieldsConfig[field].index;\n let key = axes[entryVal[0]][0].invert(position[entryVal[0]]);\n if (entryVal[1] === DimensionSubtype.TEMPORAL) {\n const filterData = [...new Set(data.getData().data.map(d => d[index]))];\n key = getNearestValue(filterData, key);\n }\n\n return key !== undefined ? [[field], [key]] : null;\n};\n\nexport const getLayersBy = (layers, searchBy, value) => layers.filter((layer) => {\n const name = searchBy === 'type' ? layer.constructor.formalName() : layer.alias();\n return name === value;\n});\n\nexport const removeLayersBy = (layers, searchBy, value) => {\n layers.filter((inst) => {\n const name = searchBy === 'type' ? inst.config().mark : inst.alias();\n if (name === value) {\n inst.remove();\n return false;\n }\n return true;\n });\n};\n\nexport const createSideEffectGroup = (container, className) => makeElement(container, 'g', [1], className).node();\n\nexport const createRenderPromise = (unit) => {\n const renderedPromise = unit._renderedPromise;\n renderedPromise.then(() => {\n unit._renderedPromise = new Promise((resolve) => {\n unit._renderedResolve = resolve;\n });\n createRenderPromise(unit);\n });\n};\n\nexport const getRadiusRange = (width, height, config = {}) => {\n const {\n innerRadius,\n outerRadius\n } = config;\n\n return [innerRadius || 0, outerRadius || Math.min(height,\n width) / 2];\n};\n\nexport const setAxisRange = (context) => {\n const axes = context.axes();\n const { radius: radiusAxes } = axes;\n if (radiusAxes) {\n radiusAxes.forEach((axis) => {\n axis.range(getRadiusRange(context.width(), context.height()));\n });\n }\n};\n\nexport const isXandYMeasures = (context) => {\n const { x: xFields, y: yFields } = context.fields();\n const [xMeasures, yMeasures] = [xFields, yFields].map(fields => fields\n .every(field => field.type() === FieldType.MEASURE));\n return xMeasures && yMeasures;\n};\n\nconst getKey = (arr, row) => {\n let key = row[arr[0]];\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${row[arr[i]]}`;\n }\n return key;\n};\n\nexport const getValuesMap = (model, context) => {\n const valuesMap = {};\n const { data: dataArr, schema, uids } = model.getData();\n const fieldsConfig = model.getFieldsConfig();\n const fieldIndices = isXandYMeasures(context) ? schema.map((d, i) => i) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldsConfig[d].index);\n dataArr.forEach((row, i) => {\n const key = getKey(fieldIndices, row);\n valuesMap[key] = uids[i];\n });\n return valuesMap;\n};\n\nexport const getSelectionRejectionModel = (model, propModel, measures, propValuesMap) => {\n let rejectionModel;\n const { data, schema } = propModel.getData();\n const entryRowIds = [];\n const exitRowIds = [];\n\n if (schema.length) {\n const fieldMap = model.getFieldsConfig();\n const rowIdsObj = {};\n const filteredSchema = measures ? schema.map((d, idx) => idx) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldMap[d].index);\n data.forEach((row) => {\n const key = getKey(filteredSchema, row);\n const id = propValuesMap[key];\n if (key in propValuesMap) {\n entryRowIds.push(id);\n rowIdsObj[id] = 1;\n }\n });\n rejectionModel = model.select((fields, i) => {\n if (!rowIdsObj[i]) {\n exitRowIds.push(i);\n return true;\n }\n return false;\n }, {\n saveChild: false\n });\n } else {\n rejectionModel = propModel;\n }\n\n return {\n model: [propModel, rejectionModel],\n entryRowIds,\n exitRowIds\n };\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const GRID_LINE_PARENT_GROUP_CLASS = 'grid-lines';\nexport const GRID_BAND_PARENT_GROUP_CLASS = 'grid-bands';\nexport const GRID_PARENT_GROUP = 'grid-parent-group';\nexport const BAND = 'band';\nexport const TICK = 'tick';\nexport const GRID_BAND = 'gridBands';\nexport const GRID_LINE = 'gridLines';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const RETINAL_FIELDS = 'retinalFields';\nexport const PARENT_ALIAS = 'parentAlias';\nexport const LAYERS = 'layers';\nexport const CACHED_DATA = 'cachedData';\nexport const STORE = 'store';\n","import { getObjProp, defaultValue, makeElement, DimensionSubtype, DataModel, createSelection } from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { layerFactory, LAYER_TYPES } from '@chartshq/visual-layer';\nimport {\n GRID_BAND,\n GRID_LINE,\n GRID_BAND_PARENT_GROUP_CLASS,\n GRID_LINE_PARENT_GROUP_CLASS,\n GRID_PARENT_GROUP\n} from '../enums/constants';\n\nconst { BAR_LAYER, TICK_LAYER } = LAYER_TYPES;\n\nconst LINEAR = ScaleType.LINEAR;\n\nconst getLayerDefinition = (context, axes, type, orientation) => {\n let encoding;\n const config = context.config();\n const { classPrefix, gridLines, gridBands } = config;\n const gridLineColor = gridLines.color;\n const zeroLineColor = gridLines.zeroLineColor;\n const defClassName = type === GRID_BAND ? gridBands.defClassName : gridLines.defClassName;\n const gridBandColor = gridBands[orientation].color;\n const axis = axes[orientation][0];\n const isLinearScale = axis.constructor.type() === LINEAR;\n\n if (type === GRID_BAND && isLinearScale) {\n encoding = {\n [orientation]: `${orientation}value`,\n [`${orientation}0`]: `${orientation}value0`\n };\n } else {\n encoding = {\n [orientation]: isLinearScale ? `${orientation}value` : `${orientation}dim`\n };\n }\n encoding.color = {\n value: (data, i) => {\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (type === GRID_BAND) {\n return gridBandColor[i % 2];\n }\n return isNegativeDomain && data[orientation] === 0 ? zeroLineColor : gridLineColor;\n }\n };\n const { color, shape, size } = context.axes();\n return {\n definition: {\n defClassName: `${defClassName}-${orientation}`,\n className: config.className,\n name: orientation,\n calculateDomain: false,\n individualClassName: (data, i) => {\n let className;\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (isNegativeDomain && data.y === 0 && type !== GRID_BAND) {\n className = `${classPrefix}-axis-zero-line`;\n } else {\n className = `${classPrefix}-grid-${type}-${orientation}-${i % 2}`;\n }\n return className;\n },\n [`pad${orientation.toUpperCase()}`]: type === GRID_BAND ? 0 : undefined,\n encoding\n },\n axes: {\n [orientation]: axis,\n color: color[0],\n shape: shape[0],\n size: size[0]\n },\n interactive: false\n };\n};\n\nconst getDefaultVisibilty = (show, axis) => {\n if (axis.constructor.type() === LINEAR) {\n return show;\n }\n return false;\n};\n\nexport const getGridLayerDefinitions = (context, config, type) => ['x', 'y'].map((axisType) => {\n const axes = context.axes();\n if (!axes[axisType]) {\n return null;\n }\n const show = defaultValue(config[axisType] && config[axisType].show,\n getDefaultVisibilty(config.show, axes[axisType][0]));\n\n return show ? getLayerDefinition(context, axes, type, axisType) : null;\n}).filter(d => d !== null);\n\nconst dimensionSubTypes = Object.values(DimensionSubtype).reduce((acc, v) => {\n acc[v] = 1;\n return acc;\n}, {});\nconst getValidSubtype = subtype => (!dimensionSubTypes[subtype] ? DimensionSubtype.CATEGORICAL : subtype);\n\nexport const getGridLayerData = (axes, fields, fieldsConfig) => {\n const gridData = {};\n\n ['x', 'y'].forEach((type) => {\n let ticks = axes[type][0].getTickValues();\n const subtype = getObjProp(fieldsConfig, getObjProp(fields, type, 0).getMembers()[0], 'def', 'subtype');\n const jsonData = [];\n const schema = [\n {\n name: 'yvalue',\n type: 'measure'\n }, {\n name: 'xvalue',\n type: 'measure'\n },\n {\n name: 'yvalue0',\n type: 'measure'\n }, {\n name: 'xvalue0',\n type: 'measure'\n }, {\n name: 'xdim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }, {\n name: 'ydim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }\n ];\n const len = Math.max(ticks.length);\n ticks = subtype === DimensionSubtype.TEMPORAL ? ticks.map(d => d.getTime()) : ticks;\n for (let i = 0; i < len; i += 1) {\n jsonData.push({\n [`${type}value`]: ticks[i],\n [`${type}value0`]: ticks[i + 1],\n [`${type}dim`]: ticks[i],\n [`${type}dim`]: ticks[i]\n });\n }\n gridData[type] = new DataModel(jsonData, schema);\n });\n return gridData;\n};\n\nexport const createGridLineLayer = (context) => {\n const vuConf = context.config();\n const metaInf = context.metaInf();\n const store = context.store();\n const timeDiffs = context._timeDiffs;\n [GRID_BAND, GRID_LINE].forEach((type) => {\n let mark;\n let config;\n if (type === GRID_BAND) {\n mark = BAR_LAYER;\n config = vuConf.gridBands;\n } else {\n mark = TICK_LAYER;\n config = vuConf.gridLines;\n }\n const definitions = getGridLayerDefinitions(context, config, type);\n\n const sel = `_${type}Selection`;\n context[sel] = createSelection(context[sel], (atomicDef) => {\n const inst = layerFactory.getLayerInstance({ mark });\n inst.dependencies(context._dependencies);\n const name = atomicDef.definition.name;\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: `${metaInf.namespace}${type}${name}`,\n parentNamespace: metaInf.namespace\n })\n .store(store);\n return inst;\n }, definitions, atomicDef => atomicDef.definition.name);\n context[sel].each((layer, atomicDef) => {\n const definition = atomicDef.definition;\n const sConf = layerFactory.getSerializedConf(mark, definition);\n const axesObj = atomicDef.axes;\n layer.config(sConf)\n .dataProps({\n timeDiffs\n })\n .axes(axesObj);\n });\n context[`_${type}`] = context[sel].getObjects();\n });\n};\n\nexport const attachDataToGridLineLayers = (context) => {\n const axes = context.axes();\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n if (gridLines.length || gridBands.length) {\n const gridLayerData = getGridLayerData(axes, context.fields(), context.data().getFieldsConfig());\n [].concat(...gridBands, ...gridLines).forEach((inst) => {\n inst.data(inst.axes().x ? gridLayerData.x : gridLayerData.y);\n });\n }\n};\n\nexport const renderGridLineLayers = (context, container) => {\n const config = context.config();\n const classPrefix = config.classPrefix;\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n const measurement = {\n width: context.width(),\n height: context.height()\n };\n const gridLineParentGroup = makeElement(container, 'g', [1], `${classPrefix}-${GRID_PARENT_GROUP}`);\n\n [[gridLines, `${classPrefix}-${GRID_LINE_PARENT_GROUP_CLASS}`],\n [gridBands, `${classPrefix}-${GRID_BAND_PARENT_GROUP_CLASS}`]].forEach((entry) => {\n const [instances, parentGroupClass] = entry;\n const mountPoint = makeElement(gridLineParentGroup, 'g', [1], `.${parentGroupClass}`);\n const className = `${parentGroupClass}-group`;\n makeElement(mountPoint, 'g', instances, `.${className}`, {\n update: (group, instance) => {\n instance.dataProps({ timeDiffs: context._timeDiffs })\n .measurement(measurement)\n .mount(group.node());\n }\n });\n });\n};\n","import { STATE_NAMESPACES, temporalFields, getObjProp, defaultValue } from 'muze-utils';\nimport * as PROPS from './enums/reactive-props';\nimport {\n transformDataModels,\n getDimensionMeasureMap,\n attachDataToLayers,\n attachAxisToLayers,\n unionDomainFromLayers\n} from './helper';\n\nimport { createGridLineLayer } from './helper/grid-lines';\n\nconst removeExitLayers = (layerDefs, context) => {\n const layersMap = context._layersMap;\n const markSet = {};\n layerDefs.forEach((layerDef, i) => {\n const id = defaultValue(layerDef.name, `${layerDef.mark}-${i}`);\n markSet[id] = true;\n });\n\n for (const key in layersMap) {\n if (!(key in markSet)) {\n layersMap[key].forEach(layer => layer.remove());\n delete layersMap[key];\n }\n }\n};\n\nexport const calculateDomainListener = (context) => {\n const { namespace } = context.metaInf();\n const domain = unionDomainFromLayers(context.layers(), context.fields(), context._layerAxisIndex,\n context.data().getFieldsConfig());\n context.store().commit(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, domain, namespace);\n};\n\nexport const listenerMap = [\n {\n type: 'registerImmediateListener',\n props: [PROPS.LAYERDEFS],\n listener: (context, [, layerDefs]) => {\n const fieldsVal = context.fields();\n if (layerDefs && fieldsVal) {\n removeExitLayers(layerDefs, context);\n const queuedLayerDefs = context._queuedLayerDefs;\n let layerDefArr = layerDefs;\n queuedLayerDefs.forEach((defFn) => {\n layerDefArr = [...layerDefArr, ...defFn(layerDefs)];\n });\n context.addLayer(layerDefArr);\n const adjustRange = context.layers().some(inst => inst.hasPlotSpan());\n ['x', 'y'].forEach((type) => {\n const axisArr = defaultValue(getObjProp(context.axes(), type), []);\n axisArr.forEach((axis) => {\n axis.config({\n adjustRange\n });\n });\n });\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'initialized',\n formalName: 'layer'\n });\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA],\n listener: (context, [, dataModel]) => {\n if (dataModel) {\n const axesObj = context.axes();\n const timeDiffs = {};\n const timeDiffsByField = {};\n\n Object.entries(temporalFields(dataModel)).forEach(([fieldName, fieldObj]) => {\n timeDiffsByField[fieldName] = fieldObj.minimumConsecutiveDifference();\n });\n\n Object.entries(context.fields()).forEach(([type, [field]]) => {\n if (field) {\n const timeDiff = timeDiffsByField[`${field}`];\n if (timeDiff) {\n timeDiffs[type] = timeDiff;\n axesObj[type].forEach(axis => axis.minDiff(timeDiff));\n }\n }\n });\n\n context._timeDiffsByField = timeDiffsByField;\n context._timeDiffs = timeDiffs;\n const firebolt = context.firebolt();\n const originalData = context.cachedData()[0];\n firebolt.createSelectionSet(context.data().getUids());\n firebolt.attachPropagationListener(originalData);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.CONFIG],\n listener: (context, [, config]) => {\n if (config) {\n context.firebolt().config(config.interaction);\n createGridLineLayer(context);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA, PROPS.TRANSFORM],\n listener: (context, [, dataModel], [, transform]) => {\n if (dataModel) {\n const dataModels = transformDataModels(transform, dataModel);\n const metaInf = context.metaInf();\n context.store().commit(`${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}.${PROPS.TRANSFORMEDDATA}`,\n dataModels, metaInf.namespace);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.TRANSFORMEDDATA, PROPS.LAYERS],\n listener: (context, [, transformedData], [, layers]) => {\n const layerAxisIndexVal = context._layerAxisIndex;\n const axesVal = context.axes();\n const dataModel = context.data();\n if (transformedData && layers && axesVal && layerAxisIndexVal) {\n context._lifeCycleManager.notify({ client: layers, action: 'beforeupdate', formalName: 'layer' });\n attachDataToLayers(layers, dataModel, transformedData);\n context._dimensionMeasureMap = getDimensionMeasureMap(layers,\n dataModel.getFieldsConfig(), context.retinalFields());\n attachAxisToLayers(axesVal, layers, layerAxisIndexVal);\n context._lifeCycleManager.notify({ client: layers, action: 'updated', formalName: 'layer' });\n }\n }\n }\n];\n","export const CONFIG = 'config';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const MOUNT = 'mount';\nexport const TRANSFORM = 'transform';\nexport const TRANSFORMEDDATA = 'transformedData';\nexport const DATADOMAIN = 'dataDomain';\nexport const FIELDS = 'fields';\nexport const LAYERAXISINDEX = 'layerAxisIndex';\nexport const LAYERS = 'layers';\nexport const DOMAIN = 'domain';\n\n","import { mergeRecursive } from 'muze-utils';\nimport { FACET_BY_FIELDS, RETINAL_FIELDS, PARENT_ALIAS, CACHED_DATA } from './enums/constants';\n\nexport const PROPS = {\n [FACET_BY_FIELDS]: {},\n [RETINAL_FIELDS]: {},\n [PARENT_ALIAS]: {},\n [CACHED_DATA]: {},\n detailFields: {},\n axes: {\n defaultValue: {\n x: [],\n y: []\n }\n },\n fields: {\n defaultValue: {\n x: [],\n y: []\n },\n sanitization: (context, value) => mergeRecursive({\n x: [],\n y: []\n }, value)\n },\n metaInf: {},\n registry: {},\n parentContainerInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {}\n};\n","import { DimensionSubtype } from 'muze-utils';\n\nconst getRangeFromData = (instance, selectionDataModel, propConfig) => {\n let criteria;\n const dataObj = selectionDataModel[0].getData();\n const propCriteria = propConfig.payload.criteria;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const schema = dataObj.schema;\n const fieldMap = instance.data().getFieldsConfig();\n const data = dataObj.data;\n const isActionSourceSame = instance.id() === propConfig.sourceId;\n\n if (isActionSourceSame) {\n criteria = propCriteria;\n } else {\n criteria = (sourceIdentifiers !== null) ? schema.reduce((acc, obj, index) => {\n let range;\n const field = obj.name;\n const fieldObj = fieldMap[field];\n const type = fieldObj && (fieldObj.def.subtype ? fieldObj.def.subtype : fieldObj.def.type);\n const isDimension = type === DimensionSubtype.CATEGORICAL;\n\n if (!fieldObj) {\n return acc;\n }\n\n if (!isDimension) {\n range = [Math.min(...data.map(d => d[index])), Math.max(...data.map(d => d[index]))];\n } else {\n range = data.map(d => d[index]);\n }\n acc[field] = range;\n return acc;\n }, {}) : null;\n }\n return criteria;\n};\n\nexport const payloadGenerator = {\n brush: (instance, selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const criteria = getRangeFromData(instance, selectionDataModel, propConfig);\n const payload = Object.assign({}, propPayload);\n payload.criteria = criteria;\n return payload;\n },\n\n __default: (instance, selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const dataObj = selectionDataModel[0].getData();\n let schema = dataObj.schema;\n const payload = Object.assign({}, propPayload);\n schema = dataObj.schema;\n const data = dataObj.data;\n const sourceFields = schema.map(d => d.name);\n payload.criteria = !sourceIdentifiers && selectionDataModel[0].isEmpty() ? null :\n [sourceFields, ...data];\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.getSchema().map(d => d.name) : [];\n return payload;\n }\n};\n\n","import { isSimpleObject, FieldType, DataModel } from 'muze-utils';\n\nconst getModelWithFacetData = (dm, data) => {\n const dataObj = dm.getData();\n const schema1 = dataObj.schema;\n const data1 = dataObj.data;\n const jsonData = [];\n const derivedSchema = data[0].map(d => ({\n name: `${d}`,\n type: FieldType.DIMENSION,\n subtype: d.subtype()\n }));\n const dataAtFirstPos = data[1];\n\n data1.forEach((d) => {\n const tuple = {};\n schema1.forEach((obj, i) => {\n tuple[obj.name] = d[i];\n });\n derivedSchema.forEach((obj, i) => {\n tuple[obj.name] = dataAtFirstPos[i];\n });\n jsonData.push(tuple);\n });\n\n return new DataModel(jsonData, [...schema1, ...derivedSchema]);\n};\n\nexport const propagateValues = (instance, action, config = {}) => {\n let propagationData;\n const payload = config.payload;\n const selectionSet = config.selectionSet;\n const propagationFieldInf = config.propagationFields[action] || {};\n const propagationFields = propagationFieldInf.fields || [];\n const append = propagationFieldInf.append;\n const criteria = payload.criteria;\n const context = instance.context;\n const dataModel = context.cachedData()[0];\n const sourceId = context.id();\n const sideEfffects = instance.sideEffects();\n const behaviourEffectMap = instance._behaviourEffectMap;\n const mergedModel = selectionSet.mergedEnter.model;\n const fieldsConfig = dataModel.getFieldsConfig();\n payload.sourceUnit = sourceId;\n payload.action = action;\n payload.sourceCanvas = context.parentAlias();\n const propagationBehaviourMap = instance._propagationBehaviourMap;\n const propagationBehaviour = propagationBehaviourMap[action] || action;\n\n let propFields = [];\n if (criteria === null) {\n propagationData = null;\n } else if (isSimpleObject(criteria)) {\n propFields = Object.keys(criteria || {});\n propagationData = mergedModel ? mergedModel.project(propFields) : null;\n } else {\n propFields = criteria[0];\n propagationData = mergedModel ? mergedModel.project(propFields) : null;\n }\n\n const facetByFields = context.facetByFields();\n if (propagationData !== null && propagationFields.length) {\n const fields = propagationData.getData().schema.map(d => d.name);\n propagationData = getModelWithFacetData(propagationData, facetByFields);\n propFields = append ? [...fields, ...propagationFields] : propagationFields;\n propagationData = propagationData.project(propFields);\n }\n\n let propagateInterpolatedValues = false;\n if (propFields.length && propFields.every(field => fieldsConfig[field] &&\n fieldsConfig[field].def.type === FieldType.MEASURE)) {\n propagateInterpolatedValues = true;\n }\n\n const groupId = context.parentAlias();\n payload.action = action;\n const behaviourInstance = instance._actions.behavioural[propagationBehaviour];\n const isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false;\n\n const filterFn = (entry, propagationConf) => {\n const effects = behaviourEffectMap[entry.config.action];\n const mutates = entry.config.groupId ?\n effects.some(d => sideEfffects[d.name || d].constructor.mutates()) : true;\n return entry.config.groupId !== propagationConf.groupId && mutates;\n };\n\n const sourceBehaviour = instance._actions.behavioural[action];\n const mutates = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false;\n let propConfig = {\n payload,\n action,\n criteria: propagationData,\n isMutableAction: mutates,\n propagateInterpolatedValues,\n groupId,\n sourceId: mutates ? groupId : sourceId,\n filterFn,\n enabled: (propConf, firebolt) => (action !== propagationBehaviour ?\n propConf.payload.sourceCanvas === firebolt.context.parentAlias() : true)\n };\n\n dataModel.propagate(propagationData, propConfig, true);\n\n if (action !== propagationBehaviour) {\n propConfig = {\n payload,\n sourceId: isMutableAction ? groupId : sourceId,\n criteria: propagationData,\n isMutableAction,\n propagateInterpolatedValues,\n action: propagationBehaviour,\n groupId,\n applyOnSource: action === propagationBehaviour,\n enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.context.parentAlias(),\n filterFn\n };\n\n dataModel.propagate(propagationData, propConfig, true, {\n filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId\n });\n }\n};\n","import { FieldType, intersect } from 'muze-utils';\nimport { Firebolt, SIDE_EFFECTS } from '@chartshq/muze-firebolt';\nimport { isXandYMeasures, getSelectionRejectionModel } from '../helper';\nimport { payloadGenerator } from './payload-generator';\nimport { propagateValues } from './data-propagator';\n\nconst sideEffectPolicy = (propPayload, context, propagationInf) => {\n const { sourceIdentifiers, propagationData } = propagationInf;\n const fieldsConfig = sourceIdentifiers.getFieldsConfig();\n const sourceIdentifierFields = Object.keys(fieldsConfig).filter(field =>\n fieldsConfig[field].def.type !== FieldType.MEASURE);\n const propFields = Object.keys(propagationData[0].getFieldsConfig());\n const hasCommonCanvas = propPayload.sourceCanvas === context.parentAlias();\n return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas;\n};\n\n/**\n * This class manages the interactions of visual unit. It associates physical actions with\n * behavioural actions. It also propagates the behavioural actions to other datamodels.\n */\nexport default class UnitFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n const {\n TOOLTIP,\n HIGHLIGHTER,\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS\n } = SIDE_EFFECTS;\n\n const disabledSideEffects = [TOOLTIP, HIGHLIGHTER, ANCHORS, BRUSH_ANCHORS, PERSISTENT_ANCHORS];\n disabledSideEffects.forEach((sideEffect) => {\n this.changeSideEffectStateOnPropagation(sideEffect, sideEffectPolicy, 'sourceTargetPolicy');\n });\n }\n propagate (behaviour, payload, selectionSet, sideEffects) {\n propagateValues(this, behaviour, {\n payload,\n selectionSet,\n sideEffects,\n propagationFields: this._propagationFields\n });\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n const context = this.context;\n const unitId = context.id();\n const aliasName = context.parentAlias();\n const propagationSourceCanvas = propagationInf.propPayload && propagationInf.propPayload.sourceCanvas;\n const sourceUnitId = propagationInf.propPayload && propagationInf.propPayload.sourceUnit;\n const sourceSideEffects = this._sourceSideEffects;\n const sideEffectInstances = this.sideEffects();\n const actionOnSource = sourceUnitId ? sourceUnitId === unitId : true;\n\n const applicableSideEffects = payload.sideEffects ? [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }] : sideEffects;\n applicableSideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n const mutates = sideEffectInstances[se.name || se].constructor.mutates();\n if (mutates && propagationInf.isMutableAction === false) {\n return false;\n }\n if (!actionOnSource && payload.criteria !== null) {\n const sideEffectCheckers = Object.values(sourceSideEffects[se.name || se] || {});\n const { sourceIdentifiers, data: propagationData } = propagationInf;\n return sideEffectCheckers.length ? sideEffectCheckers.every(checker =>\n checker(propagationInf.propPayload, context, {\n sourceIdentifiers,\n propagationData\n })) : true;\n }\n if (propagationSourceCanvas === aliasName || actionOnSource) {\n return se.applyOnSource !== false;\n }\n\n return true;\n });\n d.effects = mappedEffects;\n });\n return applicableSideEffects;\n }\n\n shouldApplySideEffects (propagate) {\n return propagate === false;\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n let isMutableAction = false;\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const {\n model: propagationData,\n entryRowIds,\n exitRowIds\n } = getSelectionRejectionModel(context.data(), data, isXandYMeasures(context), context._cachedValuesMap());\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n\n const payloadFn = payloadGenerator[action] || payloadGenerator.__default;\n const payload = payloadFn(context, propagationData, config);\n const sourceBehaviours = this._sourceBehaviours;\n const filterFns = Object.values(sourceBehaviours[action] || sourceBehaviours['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, context, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled !== false;\n }\n\n if (enabled) {\n const effects = this._behaviourEffectMap[action];\n const sideEffectInstances = this.sideEffects();\n isMutableAction = config.groupId ?\n effects.some(d => sideEffectInstances[d.name || d].constructor.mutates()) : config.isMutableAction;\n\n const propagationInf = {\n propagate: false,\n data: propagationData,\n entryRowIds,\n exitRowIds,\n propPayload,\n sourceIdentifiers,\n persistent: false,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n this._actionHistory[action] = {\n payload,\n propagationInf,\n isMutableAction\n };\n this.dispatchBehaviour(action, payload, propagationInf);\n }\n };\n }\n\n prepareSelectionSets (behaviours) {\n const data = this.context.data();\n if (data) {\n this.createSelectionSet(data.getData().uids, behaviours);\n }\n return this;\n }\n\n remove () {\n this.context.cachedData()[0].unsubscribe('propagation');\n return this;\n }\n}\n","import { SpawnableSideEffect } from '@chartshq/muze-firebolt';\n\nexport const initSideEffects = (sideEffects, firebolt) => {\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n sideEffects[key] instanceof SpawnableSideEffect && sideEffects[key].drawingContext(() => {\n const context = firebolt.context;\n return context.getDrawingContext();\n });\n sideEffects[key].valueParser(firebolt.context.valueParser());\n }\n }\n};\n\nexport const clearActionHistory = (context) => {\n const actionHistory = context._actionHistory;\n for (const key in actionHistory) {\n if (actionHistory[key].isMutableAction) {\n delete context._actionHistory[key];\n }\n }\n};\n\nexport const dispatchQueuedSideEffects = (context) => {\n const queuedSideEffects = context._queuedSideEffects;\n Object.entries(queuedSideEffects).forEach((entry) => {\n const sideEffect = entry[1];\n context.dispatchSideEffect(sideEffect.name, ...sideEffect.params);\n });\n context._queuedSideEffects = {};\n};\n","import { CLASSPREFIX, CONSOLIDATED } from './enums/constants';\n\n/**\n * Returns the default configuration of the visual unit\n * @return {Object} Default configuration of visual unit\n */\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'visual-unit',\n className: '',\n trackerClassName: 'visual-unit-tracker',\n minOuterRadius: 10,\n gridLines: {\n defClassName: 'axis-grid-lines',\n className: '',\n show: true,\n color: '#efefef',\n zeroLineColor: '#b6b6b6'\n },\n gridBands: {\n defClassName: 'axis-grid-bands',\n className: '',\n show: false,\n y: {\n color: ['#fff', '#fbfbfb']\n },\n x: {\n color: ['#fff', '#f9f9f9']\n }\n },\n arcLayerClassName: 'layer-arc',\n interaction: {\n tooltip: {\n mode: CONSOLIDATED\n }\n },\n sideEffectClassName: 'side-effect-container'\n};\n","import { mergeRecursive, DataModel } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { CONFIG, LAYERDEFS, TRANSFORM, DATA, LAYERS, TRANSFORMEDDATA } from './enums/reactive-props';\nimport { sanitizeLayerDef, getValuesMap } from './helper';\n\nexport default {\n [CONFIG]: {\n value: null,\n meta: {\n sanitization: (config, oldConfig) => (\n mergeRecursive(oldConfig || mergeRecursive({}, defaultConfig), config)\n )\n }\n },\n [LAYERDEFS]: {\n value: null,\n meta: {\n preset: layerDef => sanitizeLayerDef(layerDef)\n }\n },\n [TRANSFORM]: {\n value: null\n },\n [LAYERS]: {\n value: null\n },\n [DATA]: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel,\n preset: (data, context) => {\n context._cachedValuesMap = ((model) => {\n let valuesMap = null;\n return () => {\n if (valuesMap) {\n return valuesMap;\n }\n valuesMap = getValuesMap(model, context);\n return valuesMap;\n };\n })(data);\n if (context._cache) {\n const cachedData = context.cachedData();\n context.cachedData([...cachedData, data]);\n } else {\n const oldData = context.cachedData()[0];\n oldData && oldData.unsubscribe('propagation');\n context.cachedData([data]);\n }\n }\n }\n },\n [TRANSFORMEDDATA]: {\n value: null\n },\n width: {\n value: null\n },\n height: {\n value: null\n }\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n setAttrs,\n getUniqueId,\n getQualifiedClassName,\n selectElement,\n transactor,\n makeElement,\n generateGetterSetters,\n getDataModelFromIdentifiers,\n isSimpleObject,\n transposeArray,\n CommonProps,\n toArray,\n STATE_NAMESPACES\n} from 'muze-utils';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { actionBehaviourMap } from './firebolt/action-behaviour-map';\nimport {\n renderLayers,\n getNearestDimensionalValue,\n removeLayersBy,\n getLayersBy,\n getLayerFromDef,\n getLayerAxisIndex,\n sanitizeLayerDef,\n createSideEffectGroup,\n resolveEncodingTransform,\n createRenderPromise,\n setAxisRange\n} from './helper';\nimport { renderGridLineLayers, attachDataToGridLineLayers } from './helper/grid-lines';\nimport { calculateDomainListener, listenerMap } from './listener-map';\nimport { PROPS } from './props';\nimport UnitFireBolt from './firebolt';\nimport { initSideEffects, dispatchQueuedSideEffects, clearActionHistory } from './firebolt/helper';\nimport './styles.scss';\nimport localOptions from './local-options';\nimport { WIDTH, HEIGHT } from './enums/reactive-props';\n\nconst FORMAL_NAME = 'unit';\nconst unitNs = [STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * Visual Unit is hierarchical component created by {@link VisualGroup}. This component accepts layer definitions\n * and creates concrete layer instances from them, binds data and attaches axis to them. It also retreives the domain\n * from the layers and unions them and sets them on corresponding axis instances. This also creates the parent svg\n * groups for all the layers and delegates the rendering to all the layers.\n *\n * @public\n * @module VisualUnit\n * @class\n */\nexport default class VisualUnit {\n\n /**\n * Creates instance of visualization unit.\n *\n * @param {Object} registry Component registry\n * @param {Object} dependencies Dependencies required by visual unit.\n */\n constructor (registry, dependencies) {\n this._id = getUniqueId();\n this._dependencies = dependencies;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n createRenderPromise(this);\n this._lifeCycleManager = dependencies.lifeCycleManager;\n this._layersMap = {};\n this._gridLinesSelection = null;\n this._gridBandsSelection = null;\n this._gridLines = [];\n this._gridBands = [];\n this._layerAxisIndex = {};\n this._queuedLayerDefs = [];\n layerFactory.setLayerRegistry(registry.layerRegistry);\n generateGetterSetters(this, PROPS);\n this.registry(registry);\n this.cachedData([]);\n }\n\n static formalName () {\n return FORMAL_NAME;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys((localOptions)).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getQualifiedStateProps () {\n const unitState = VisualUnit.getState();\n return unitState.map((state, i) => Object.keys(state).map(prop => `${unitNs[i]}.${prop}`));\n }\n\n static getListeners () {\n return {\n store: [...listenerMap.map((d) => {\n const o = Object.assign({}, d);\n const localNs = unitNs[1];\n o.props = o.props.map(prop => `${localNs}.${prop}`);\n return o;\n }), {\n type: 'registerImmediateListener',\n props: [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`],\n listener: calculateDomainListener\n }, {\n type: 'registerImmediateListener',\n props: [`${unitNs[1]}.${WIDTH}`,\n `${unitNs[1]}.${HEIGHT}`,\n ...['x', 'y'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context, [, width], [, height]) => {\n if (width && height) {\n attachDataToGridLineLayers(context);\n }\n },\n subNamespace: (context) => {\n const { rowIndex, colIndex, namespace } = context.metaInf();\n return {\n [`${unitNs[1]}.${WIDTH}`]: namespace,\n [`${unitNs[1]}.${HEIGHT}`]: namespace,\n [`${groupNs}.domain.x`]: `${colIndex}0`,\n [`${groupNs}.domain.y`]: `${rowIndex}0`\n };\n }\n }],\n throwback: [\n {\n type: 'registerChangeListener',\n props: [CommonProps.ON_LAYER_DRAW],\n listener: (context, [, drawn]) => {\n if (drawn) {\n const firebolt = context.firebolt();\n dispatchQueuedSideEffects(firebolt);\n clearActionHistory(firebolt);\n }\n context._renderedResolve();\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'drawn',\n formalName: 'layer'\n });\n }\n }\n ]\n };\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { throwback, fireboltDeps } = this._dependencies;\n const { namespace } = this.metaInf();\n\n store.addSubNamespace(namespace, FORMAL_NAME, this);\n throwback.addSubNamespace(namespace, FORMAL_NAME, this);\n transactor(this, localOptions, store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}`\n });\n\n this.firebolt(new UnitFireBolt(this, {\n physical: Object.assign({}, physicalActions, fireboltDeps.physicalActions),\n behavioural: Object.assign({}, behaviouralActions, fireboltDeps.behaviouralActions),\n physicalBehaviouralMap: actionBehaviourMap\n }, Object.assign({}, sideEffects, fireboltDeps.sideEffects), behaviourEffectMap));\n return this;\n }\n return this._store;\n }\n\n /**\n * Static helper for creates a unit instance\n *\n * @param {Object} [id] optional unique identifier for a unit; , id is calculated internally\n * @param {DataModel} data instance of datamodel\n * @param {Array.} layers layer configuration\n * @param {Object} config configurtion for the visual unit\n * @return {VisualUnit} Instance of a unit\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Returns the instance of firebolt associated with this visual unit. Firebolt dispatches the behavioural actions\n * when any physical action happens on the elements of visual unit.\n *\n * @public\n *\n * @return {Firebolt} Instance of firebolt.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Returns the unique id of this visual unit.\n *\n * @public\n * @return {string} Unique identifier.\n */\n id () {\n return this._id;\n }\n\n lockModel () {\n this.store().lockModel();\n return this;\n }\n\n unlockModel () {\n this.store().unlockModel();\n return this;\n }\n\n timeDiffsByField (...params) {\n if (params.length) {\n return this;\n }\n return this._timeDiffsByField;\n }\n\n /**\n * Renders the visual unit. It creates the layout and renders the axes and layers.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n render (container) {\n const config = this.config();\n const { className, defClassName, sideEffectClassName, classPrefix } = config;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const width = this.width();\n const height = this.height();\n const containerSelection = selectElement(container).style('position', 'relative');\n\n this._rootSvg = makeElement(containerSelection, 'svg', [null], className)\n .style('width', `${width}px`).style('height', `${height}px`);\n\n const node = this._rootSvg.node();\n setAttrs(node, {\n width,\n height,\n class: qualifiedClassName.join(' ')\n });\n\n setAxisRange(this);\n renderGridLineLayers(this, node);\n renderLayers(this, node, this.layers(), {\n width,\n height\n });\n this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`);\n const firebolt = this.firebolt();\n initSideEffects(firebolt.sideEffects(), firebolt);\n return this;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Caches all the datamodels in an array from the next `data()` call on visual unit until `clearCaching()` or\n * `resetData()` is called on it.\n *\n * @public\n * @return {VisualUnit} Instance of visual unit.\n */\n\n enableCaching () {\n this._cache = true;\n return this;\n }\n\n /**\n * Clears all the previous cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n clearCaching () {\n this._cache = false;\n this.cachedData([this.cachedData()[0]]);\n return this;\n }\n\n /**\n * Returns the drawing information from visual unit.Drawing context contains the dimensions of unit and the svg\n * container of the visual unit.\n *\n * @public\n *\n * @return {Object} Drawing information.\n * ```\n * {\n * htmlContainer: // Html container of svg container of the visual unit\n * svgContainer: // Root svg container\n * width: // Width of the visual unit\n * height: // Height of the visual unit\n * sideEffectGroup: // Svg group for drawing side effect elements.\n * parentContainer: // Parent html container of the visual unit.\n * xOffset: // x offset space from the starting x position of the container,\n * yOffset: // y offset space from the starting y position of the container\n * }\n * ```\n */\n getDrawingContext () {\n const rootSvg = this._rootSvg && this._rootSvg.node();\n const width = this.width();\n const height = this.height();\n const { el, dimensions } = this.parentContainerInf();\n return {\n htmlContainer: this.mount(),\n svgContainer: rootSvg,\n width,\n height,\n sideEffectGroup: this._sideEffectGroup,\n parentContainer: el,\n parentContainerDimensions: dimensions,\n xOffset: 0,\n yOffset: 0\n };\n }\n\n /**\n * Returns the serialized configuration of visual unit.\n *\n * @return {Object} serialized configuration\n */\n serialize () {\n return {\n layers: this.layers().map(layer => layer.serialize()),\n config: this.config(),\n axes: this.axes().map(axis => axis.serialize())\n };\n }\n\n mount (...mount) {\n if (mount.length) {\n this._mount = mount[0];\n this.render(mount[0]);\n this.firebolt().mapActionsAndBehaviour();\n return this;\n }\n return this._mount;\n }\n\n /**\n * Adds a new layer to the visual unit. It takes a layer definition and creates layer instances from them. It does\n * not render the layers. It returns the layer instances in an array. If the layer definition is a composite layer,\n * then multiple layer instances will be returned in the array.\n *\n * To add a layer in the unit,\n * ```\n * unit.addLayer({\n * name: 'bullet',\n * mark: 'bar',\n * encoding: {\n * x: 'Year',\n * y: 'Acceleration',\n * color: 'Origin'\n * }\n * });\n * ```\n * @public\n * @param {Object} layerDef Definition of new layer.\n *\n * @return {Array} Array of layer instances.\n */\n addLayer (layerDefinition) {\n if (layerDefinition instanceof Function) {\n this._queuedLayerDefs.push(layerDefinition);\n return this;\n }\n const layerDefinitions = sanitizeLayerDef(toArray(layerDefinition));\n\n const layersMap = this._layersMap;\n const markSet = {};\n const store = {\n layers: {},\n components: {\n unit: this\n }\n };\n let layerIndex = 0;\n const metaInf = this.metaInf();\n const layers = layerDefinitions.sort((a, b) => a.order - b.order).reduce((layersArr, layerDef) => {\n const definition = layerDef.def;\n const markId = definition.name;\n const defArr = toArray(definition);\n const namespaces = [];\n defArr.forEach((def) => {\n def.order = layerDef.order + layerIndex;\n const namespace = `${metaInf.namespace}-${def.mark}-${getUniqueId()}`;\n namespaces.push(namespace);\n });\n layerIndex += defArr.length;\n const instances = getLayerFromDef(this, definition, layersMap[markId], namespaces);\n store.layers = Object.assign(store.layers, instances);\n const instanceValues = Object.values(instances);\n layersArr = layersArr.concat(...instanceValues);\n layersMap[markId] = instanceValues;\n markSet[markId] = markId;\n return layersArr;\n }, []);\n\n store.unit = this;\n const layerdeps = {};\n const layersArr = [].concat(...Object.values(this._layersMap));\n layersArr.forEach((layer) => {\n const alias = layer.alias();\n store.layers[alias] = layer;\n layerdeps[alias] = [];\n });\n layers.forEach((layer) => {\n const depArr = resolveEncodingTransform(layer, store);\n layerdeps[layer.alias()] = depArr;\n });\n\n this._layerDepOrder = layerdeps;\n this._layerAxisIndex = Object.assign(this._layerAxisIndex, getLayerAxisIndex(layers, this.fields()));\n this.layers(layersArr);\n return layers;\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n remove () {\n const formalName = this.constructor.formalName();\n const { lifeCycleManager, throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n lifeCycleManager.notify({ client: this, action: 'beforeremove', formalName: 'unit' });\n const layers = this.layers();\n this.store().removeSubNamespace(namespace, formalName);\n throwback.removeSubNamespace(namespace, FORMAL_NAME);\n selectElement(this.mount()).remove();\n this.firebolt().remove();\n // Remove layers\n lifeCycleManager.notify({ client: layers, action: 'beforeremove', formalName: 'layer' });\n [...layers, ...this._gridLines, ...this._gridBands].forEach(layer => layer.remove());\n lifeCycleManager.notify({ client: layers, action: 'removed', formalName: 'layer' });\n lifeCycleManager.notify({ client: this, action: 'removed', formalName: 'unit' });\n return this;\n }\n\n /**\n *\n *\n * @param {*} identifiers\n *\n * @memberof VisualUnit\n */\n getDataModelFromIdentifiers (identifiers, mode, parentModel) {\n if (identifiers === null) {\n return null;\n }\n const dataModel = parentModel || this.data();\n return getDataModelFromIdentifiers(dataModel, identifiers, mode);\n }\n\n /**\n * Resets the data of visual unit to original data model. It also clears the cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n resetData () {\n this.data(this.cachedData()[0]);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n getSourceInfo () {\n return {\n dimensionMeasureMap: this._dimensionMeasureMap,\n fields: this.fields(),\n data: this.data(),\n axes: this.axes()\n };\n }\n\n getDataDomain () {\n return this.store().get(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`, this.metaInf().namespace);\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n getDefaultTargetContainer () {\n const { classPrefix, defClassName } = this.config();\n return [`.${classPrefix}-${defClassName}`];\n }\n\n /**\n * Returns an array of layer instances which matches the supplied mark type.\n *\n * @public\n *\n * @param {string} type Mark type of layer.\n *\n * @return {Array} Array of layer instances.\n */\n getLayersByType (type) {\n const layers = getLayersBy(this.layers(), 'type', type);\n return layers;\n }\n\n /**\n * Returns the layer instance which matches the supplied layer name. If no layer is found, then it returns\n * undefined.\n *\n * @public\n * @param {string} name Name of layer.\n *\n * @return {VisualUnit} Layer instance.\n */\n getLayerByName (name) {\n const layers = getLayersBy(this.layers(), 'name', name);\n return layers[0];\n }\n\n /**\n * Returns the point located nearest to the supplied x and y position. It returns the unique identifiers of the\n * point. This function also accepts an additional configuration `getAllPoints` inside `config` object in the third\n * argument which if set to true, then it returns the identifiers of all the points which falls on the nearest\n * x value or y value if any one of the field is a dimension. Additionally, a target property is also returned\n * which contains the identifier of the nearest point. If no nearest point is found, then it returns identifier\n * as null.\n *\n * @public\n *\n * @param {number} x X Position of the point from where nearest point is to be found.\n * @param {number} y Y Position of the point from where nearest point is to be found.\n * @param {Object} config Additional configuration options.\n * @param {boolean} config.getAllPoints If true, then returns all the points nearest to the x value or y value if\n * it is dimension.\n * @param {Object} config.data Data associated with the nearest point.\n * @return {Object} Nearest point information\n * ```\n * {\n * id: [['Origin'], ['USA'], ['Japan']], // Identifiers of all the points closest to the x value.\n * target: [['Origin'], ['Japan']] // Identifier of the nearest point.\n * }\n * ```\n */\n getNearestPoint (x, y, config) {\n let pointObj = {\n id: null\n };\n const dimValue = getNearestDimensionalValue(this, {\n x,\n y\n });\n\n if (dimValue !== null && config.getAllPoints) {\n pointObj.id = dimValue;\n const pointInf = this.getMarkInfFromLayers(x, y, config);\n pointObj.target = pointInf && pointInf.id ? pointInf.id : pointObj.id;\n return pointObj;\n }\n\n const markInf = this.getMarkInfFromLayers(x, y, config) || { id: null };\n pointObj = Object.assign({}, markInf);\n\n pointObj.target = markInf.id;\n return pointObj;\n }\n\n getMarkInfFromLayers (x, y, args) {\n const layers = this.layers();\n const len = layers.length;\n let point = null;\n // Iterate through the layers array and fetch the nearest point from each layer. If a valid\n // nearest point is found from any layer, then return that point.\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n const config = layer.config();\n if (config.interactive !== false) {\n point = layer.getNearestPoint(x, y, args);\n }\n if (point) {\n return point;\n }\n }\n return point;\n }\n\n /**\n * Get the information of all the marks such as x, y position and size from supplied identifiers. It\n * returns an array of points whose data matches the given identifiers.\n *\n * @public\n *\n * @param {Array|Object} identifiers Field names and their corresponding values.\n * ```\n * identifiers can be given in an array of array,\n * ['Origin', 'Name'], // Names of the fields supplied in first array\n * ['USA', 'ford'], // Data values of each field supplied in rest of the arrays.\n * ['Japan', 'ford']\n * or in an object,\n * {\n * Origin: ['USA']\n * }\n * ```\n * @param {Object} config Optional configurations which decides which information of the mark will\n * be retrieved.\n * @param {boolean} [config.getAllAttrs = false] If true, then returns all the information of each mark.\n * @param {boolean} [config.getBBox = false] If true, then returns the bounding box of each mark.\n *\n * @return {Array} Array of objects containing the information of each point.\n * ```\n * By default, the method returns the array of points in this structure,\n * [\n * {\n * x: 20,\n * y: 100,\n * width: 200,\n * height: 100\n * }\n * ]\n * If 'config.getAllAttrs' is true, then it returns all the information of each mark,\n * [\n * // Positions of mark on initial state of transition.\n * enter: {\n * x: 0,\n * y: 0\n * },\n * // Final positions of the mark\n * update: {\n * x: 20,\n * y: 10\n * },\n * style: // css styles of each mark\n * source: [200, 'USA'] // Row information of each mark\n * id: 20 // Row id of each mark\n * ]\n * ```\n */\n getPlotPointsFromIdentifiers (identifiers, config = {}) {\n let points = [];\n let parsedIdentifiers = identifiers;\n if (identifiers === null) {\n return [];\n }\n const layers = this.layers();\n const len = layers.length;\n if (isSimpleObject(identifiers)) {\n parsedIdentifiers = [Object.keys(identifiers)];\n parsedIdentifiers = [...parsedIdentifiers, ...transposeArray(Object.values(identifiers))];\n }\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n if (layer.config().interactive !== false) {\n points = [...points, ...layer.getPointsFromIdentifiers(parsedIdentifiers, config)];\n }\n }\n return points;\n }\n\n /**\n * Removes the layer instance which matches the supplied layer name.\n *\n * @public\n * @param {string} name Name of layer\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayerByName (name) {\n removeLayersBy('name', name);\n return this;\n }\n\n /**\n * Removes all the layer instances which matches the supplied mark type.\n *\n * @public\n * @param {string} type Mark type of layer.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayersByType (type) {\n removeLayersBy('type', type);\n return this;\n }\n}\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n *\n *\n * @export\n * @class Variable\n */\nexport default class Variable {\n\n /**\n *\n *\n * @memberof Variable\n */\n type () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof Variable\n */\n toString () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n}\n","import Variable from './variable';\n\n/**\n * This is a wrapper on top of multiple variables which are of same type but they are shown in the same axis.This is\n * required in case of range plots or ohlc plots where one plot is mapped to multiple measure fields. At that time,\n * we need to create a composed variable from multiple variables. This class just wraps them into one variable instance\n * and provides methods to get the type and other common functionalities which can be performed on a simple variable\n * instance.\n *\n * @public\n * @class ComposeVars\n */\nclass ComposedVars extends Variable {\n\n /**\n * Creates an instance of ComposeVars.\n *\n * @param {Array} vars Array of SimpleVars.\n */\n constructor (...vars) {\n super();\n this.vars(vars);\n }\n\n vars (...params) {\n if (params.length) {\n this._vars = params[0];\n return this;\n }\n return this._vars;\n }\n\n data (...dm) {\n if (dm.length) {\n this.vars().forEach(d => d.data(dm[0]));\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n /**\n * Get all the field names from composed variable instance.\n *\n * @public\n * @return {Array} Array of field names.\n */\n getMembers () {\n const vars = this.vars();\n return vars.map(member => member.getMembers()[0]);\n }\n\n /**\n * Type of field associated with this composed variable.\n *\n * @return {string} Type of variable (Measure/Dimension).\n */\n type () {\n return this.vars()[0].type();\n }\n\n toString () {\n return this.vars().map(d => d.toString()).join(',');\n }\n\n /**\n * Returns the number formatter function of the variable.\n *\n * @return {Function} Number formatter function of the variable.\n */\n numberFormat () {\n return this.vars()[0].numberFormat();\n }\n\n format (values) {\n return this.vars()[0].format(values);\n }\n\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.vars()[0]].def;\n }\n\n /**\n * Returns the subtype of the fields associated with this variable instance.\n *\n * @public\n * @return {string} Subtype of the variable.\n */\n subtype () {\n return this.vars()[0].subtype();\n }\n\n /**\n * Returns the consecutive minimum difference of the field values.\n *\n * @public\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n return this.vars()[0].getMinDiff();\n }\n\n /**\n * Returns the display name of the fields.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return this.vars().map(d => d.displayName()).join(',');\n }\n}\n\nexport default ComposedVars;\n","import { DateTimeFormatter, retrieveFieldDisplayName, DimensionSubtype } from 'muze-utils';\nimport Variable from './variable';\n\n/**\n * This is a wrapper on top of fields passed in rows or columns in canvas. This is used to get the type of field or\n * get min difference from the field values.\n *\n * @public\n * @class SimpleVariable\n */\nexport default class SimpleVariable extends Variable {\n\n /**\n * Creates an instance of simple variable instance.\n *\n * @param {string} name Field name.\n */\n constructor (name) {\n super();\n this.oneVar(name);\n }\n\n /**\n * Gets the field name associated with this variable instance.\n *\n * @public\n * @return {string} Name of the field.\n */\n oneVar (...oneV) {\n if (oneV.length) {\n this._oneVar = oneV[0];\n return this;\n }\n return this._oneVar;\n }\n\n data (...dm) {\n if (dm.length) {\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n toString () {\n return this.oneVar();\n }\n\n /**\n * Gets the number formatter function of this variable.\n *\n * @public\n * @return {Function} Number formatter function.\n */\n numberFormat () {\n if (this.type() === 'measure') {\n const formatter = this.data().getFieldspace().getMeasure()[this.oneVar()];\n return formatter.numberFormat();\n } return val => val;\n }\n\n format (values) {\n if (values && this.subtype() === 'temporal') {\n const formatter = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n const dtFormat = new DateTimeFormatter(formatter);\n values = values.map(e => dtFormat.getNativeDate(e));\n }\n return values;\n }\n\n /**\n * Returns a formatter function which transforms the input value to its original form.\n *\n * @public\n * @return {Function} Returns raw formatter function.\n */\n rawFormat () {\n if (this.subtype() === DimensionSubtype.TEMPORAL) {\n const dateFormat = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n return val => DateTimeFormatter.formatAs(val, dateFormat);\n }\n return val => val;\n }\n\n /**\n * Return the field names associated with this variable instance.\n *\n * @public\n * @return {Array} Array of fields.\n */\n getMembers () {\n return [this.oneVar()];\n }\n\n /**\n * Returns the type of the variable. Whether it is measure or dimension.\n *\n * @public\n * @return {string} Type of variable.\n */\n type () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.type;\n }\n\n /**\n * Returns the subtype of the variable. Subtype can be categorical or temporal. If no subtype is found, then it\n * returns the type of the variable.\n *\n * @public\n * @return {string} Subtype of variable.\n */\n subtype () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.subtype || fieldDef.type;\n }\n\n /**\n * Returns the minimum consecutive difference between the data values of this variable.\n *\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n const fieldSpace = this.data().getFieldspace();\n return fieldSpace.fieldsObj()[this.oneVar()].minimumConsecutiveDifference();\n }\n\n /**\n * Returns true if two variable instances are same.If both variable has the same field names, they are equal.\n *\n * @return {Boolean} Whether two variable instances are same.\n */\n equals (varInst) {\n return this.oneVar() === varInst.oneVar();\n }\n\n /**\n * Returns the display name of the field.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return retrieveFieldDisplayName(this.data(), this.oneVar());\n }\n\n /**\n * Returns the schema defination of the field.\n *\n * @return {Object} schema def\n */\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.oneVar()].def;\n }\n}\n","import { ComposedVars, SimpleVariable } from '../variable';\nimport { DIMENSION, COLUMNS, ROWS, TEMPORAL } from '../enums/constants';\n\n/**\n * Gets the list of fields in a sorted order by measurement and dimension\n *\n * @param {Array} fieldList List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields sorted by measurement and dimensions\n */\nconst orderFields = (fieldArray, type) => {\n const dimensionArr = [[], []];\n const measureArr = [[], []];\n const temporalArr = [[], []];\n const categoricalArr = [[], []];\n\n fieldArray.forEach((fieldList, index) => {\n fieldList.forEach((field) => {\n if (field.type() === DIMENSION) {\n dimensionArr[index].push(field);\n field.subtype() === TEMPORAL ? temporalArr[index].push(field) : categoricalArr[index].push(field);\n } else {\n measureArr[index].push(field);\n }\n });\n });\n\n const numOfMeasures = measureArr[0].length + (measureArr[1] ? measureArr[1].length : 0);\n\n // Single array of fields\n if (!fieldArray[1]) {\n // Push measures to bottom\n measureArr[1] = type === COLUMNS ? measureArr[0] : [];\n // Push measures to left\n measureArr[0] = type !== COLUMNS ? measureArr[0] : [];\n // Bottom and right dimensions empty\n dimensionArr[1] = [];\n // Left and top filled with dimensions\n dimensionArr[0] = dimensionArr[0];\n if (numOfMeasures === 0) {\n const allDimensions = [...dimensionArr[0], ...dimensionArr[1]];\n if (type === COLUMNS) {\n dimensionArr[1] = allDimensions[allDimensions.length - 1] ? [allDimensions[allDimensions.length - 1]]\n : [];\n allDimensions.splice(-1, 1);\n } else {\n dimensionArr[1] = [];\n }\n dimensionArr[0] = [...allDimensions];\n }\n }\n\n if (dimensionArr[0].length && dimensionArr[1].length && numOfMeasures > 0) {\n dimensionArr[0] = [...dimensionArr[0], ...dimensionArr[1]];\n dimensionArr[1] = [];\n }\n return {\n fields: dimensionArr.map((list, i) => (i === 1 ?\n measureArr[i].concat(dimensionArr[i]) : dimensionArr[i].concat(measureArr[i]))),\n dimensions: [...dimensionArr[0], ...dimensionArr[1]],\n measures: [...measureArr[0], ...measureArr[1]],\n temporal: [...temporalArr[0], ...temporalArr[1]],\n categorical: [...categoricalArr[0], ...categoricalArr[1]]\n };\n};\n\n/**\n * Gets the list of normalized fields\n *\n * @param {Array} fields List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields normalized by measurement and dimensions\n */\nconst normalizeFields = (config, type) => {\n const fieldsArr = [];\n const fields = config[type];\n\n if (!(fields[0] instanceof Array)) {\n fieldsArr[0] = fields;\n } else {\n fieldsArr[0] = fields[0] || [];\n fieldsArr[1] = fields[1] || [];\n }\n return fieldsArr;\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} datamodel\n *\n */\nconst convertToVar = (datamodel, fields) => {\n const vars = [];\n\n fields && fields.forEach((field) => {\n if (field instanceof ComposedVars) {\n vars.push(field);\n field.data(datamodel);\n } else {\n vars.push(new SimpleVariable(field).data(datamodel));\n }\n });\n return vars;\n};\n\n/**\n *\n *\n * @param {*} rows\n * @param {*} columns\n * @param {*} datamodel\n *\n */\nexport const transformFields = (datamodel, config) => {\n const [rowsInfo, columnsInfo] = [ROWS, COLUMNS].map((fields) => {\n const normalizedFields = normalizeFields(config, fields);\n const norFields = [convertToVar(datamodel, normalizedFields[0])];\n\n if (normalizedFields[1]) {\n norFields[1] = convertToVar(datamodel, normalizedFields[1]);\n }\n return orderFields(norFields, fields);\n });\n const {\n fields: rows,\n dimensions: rowDimensions,\n measures: rowMeasures,\n temporal: rowTemporalFields,\n categorical: rowCategoricalFields\n } = rowsInfo;\n const {\n fields: columns,\n dimensions: columnDimensions,\n measures: columnMeasures,\n temporal: columnTemporalFields,\n categorical: columnCategoricalFields\n } = columnsInfo;\n return {\n rows,\n rowDimensions,\n rowMeasures,\n rowTemporalFields,\n rowCategoricalFields,\n columns,\n columnTemporalFields,\n columnCategoricalFields,\n columnDimensions,\n columnMeasures\n };\n};\n","import { ERROR_MSG, mergeRecursive } from 'muze-utils';\nimport { transformFields } from './field-sanitizer';\nimport { getHeaderAxisFrom } from '../group-helper/group-utils';\nimport { ROW, COLUMN } from '../enums/constants';\n\n/**\n *\n *\n * @export\n * @class VisualEncoder\n */\nexport default class VisualEncoder {\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n createAxis () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n setCommonDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n getLayerConfig () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n fieldInfo (...info) {\n if (info.length) {\n this._fieldInfo = mergeRecursive(this._fieldInfo || {}, info[0]);\n return this;\n }\n return this._fieldInfo;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof VisualEncoder\n */\n fieldSanitizer (datamodel, config) {\n this.fieldInfo(transformFields(datamodel, config));\n return this.fieldInfo();\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n axisFrom (...params) {\n if (params.length) {\n this._axisFrom = params[0];\n return this;\n }\n return this._axisFrom;\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n headerFrom (...params) {\n if (params.length) {\n this._headerFrom = params[0];\n return this;\n }\n return this.__headerFrom;\n }\n\n /**\n *\n *\n * @param {*} axisFrom\n *\n * @memberof CartesianEncoder\n */\n setAxisAndHeaders (axisFrom = {}, fields) {\n const [rowHeader, rowAxis] = getHeaderAxisFrom(ROW, fields.rows, axisFrom);\n const [colHeader, colAxis] = getHeaderAxisFrom(COLUMN, fields.columns, axisFrom);\n\n this.axisFrom({\n row: rowAxis,\n column: colAxis\n });\n this.headerFrom({\n row: rowHeader,\n column: colHeader\n });\n return this;\n }\n}\n","import { ContinousAxis, BandAxis, TimeAxis, ColorAxis, SizeAxis, ShapeAxis } from '@chartshq/muze-axis';\n\nexport const scaleMaps = {\n linear: ContinousAxis,\n band: BandAxis,\n temporal: TimeAxis,\n size: SizeAxis,\n color: ColorAxis,\n shape: ShapeAxis\n};\n","import { ScaleType } from '@chartshq/muze-axis';\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n dimension: ScaleType.BAND,\n categorical: ScaleType.BAND,\n temporal: ScaleType.TIME,\n measure: ScaleType.LINEAR,\n continuous: ScaleType.LINEAR\n};\n","import { mergeRecursive, getObjProp } from 'muze-utils';\nimport { AxisOrientation } from '@chartshq/muze-axis';\nimport { ENCODING } from '@chartshq/visual-layer';\nimport { scaleMaps } from '../enums/scale-maps';\nimport { getAxisType, getAxisKey } from '../group-helper';\nimport { dataTypeScaleMap } from '../data-type-scale-map';\nimport { CATEGORICAL, TEMPORAL, BAR, LINE, POINT, BOTH, Y, COLOR, SHAPE, SIZE, ANGLE0 } from '../enums/constants';\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst getAxisConfig = (axisInfo, field, axesCreators, indices, facetFields) => {\n let axisOrientation;\n const { index, axisIndex, axisType } = axisInfo;\n const { config, position } = axesCreators;\n const { rowIndex, columnIndex } = indices;\n const rawUserAxisConfig = config.axes ? (config.axes[axisType] || {}) : {};\n\n // Change config object to a function if not already one\n const userAxisConfigFn = typeof rawUserAxisConfig !== 'function' ?\n () => rawUserAxisConfig : rawUserAxisConfig;\n const userAxisConfig = userAxisConfigFn(rowIndex, columnIndex, {\n axisFields: field.getMembers(),\n facetFields\n });\n\n // If current config does not specifes config for an axis, retain old config\n if (!userAxisConfig) {\n return {};\n }\n\n const {\n LEFT,\n RIGHT,\n TOP,\n BOTTOM\n } = AxisOrientation;\n const allOrientations = axisType === Y ? [LEFT, RIGHT] : [TOP, BOTTOM];\n\n if (position === BOTH) {\n axisOrientation = allOrientations[axisIndex];\n } else {\n axisOrientation = position;\n }\n const axisConfig = {\n id: `${axisType}-${index}-${axisIndex}`,\n name: field.displayName(),\n field: field.toString(),\n numberFormat: field.numberFormat(),\n orientation: axisOrientation,\n showAxisName: true,\n show: true,\n type: dataTypeScaleMap[field.subtype()]\n };\n userAxisConfig.tickValues = field.format(userAxisConfig.tickValues);\n userAxisConfig.domain = field.format(userAxisConfig.domain);\n\n return mergeRecursive(axisConfig, userAxisConfig);\n};\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst createSimpleAxis = (axisConfig, field, axesCreators) => {\n const { labelManager } = axesCreators;\n const Cls = scaleMaps[dataTypeScaleMap[field.subtype()]];\n const simpleAxis = new Cls(axisConfig, { labelManager });\n return simpleAxis;\n};\n\nexport const getAdjustedDomain = (max, min) => {\n const y1ratio = max[0] / (max[0] - min[0]);\n const y2ratio = max[1] / (max[1] - min[1]);\n\n // adjust min/max values for positive negative values zero line etc\n let allSameSign = false;\n\n // if all numbers are positive set floor to zero\n if (min[0] > 0 && min[1] > 0 && min[1] > 0 && max[1] > 0) {\n allSameSign = true;\n min[0] = 0;\n min[1] = 0;\n }\n\n // if all numbers are negative set ceiling to zero\n if (min[0] < 0 && min[1] < 0 && min[1] < 0 && max[1] < 0) {\n allSameSign = true;\n max[0] = 0;\n max[1] = 0;\n }\n\n // align zero line if necessary\n if (!allSameSign && y1ratio !== y2ratio) {\n if (y1ratio < y2ratio) {\n // adjust min[1]\n min[1] = min[0] / max[0] * max[1];\n } else {\n // adjust min[0]\n min[0] = min[1] / max[1] * max[0];\n }\n }\n return [\n [min[0], max[0]],\n [min[1], max[1]]\n ];\n};\n\n/**\n *\n *\n * @param {*} axisType\n * @param {*} fieldInfo\n * @param {*} axesCreators\n * @param {*} groupAxes\n *\n */\nexport const generateAxisFromMap = (axisType, fieldInfo, axesCreators, axesInfo, indices, facetFields) => {\n let axisKey;\n const { groupAxes, valueParser } = axesInfo;\n const currentAxes = [];\n const { fields, index } = fieldInfo;\n const { cacheMaps } = axesCreators;\n const map = cacheMaps[`${axisType}AxesMap`];\n\n const commonAxisKey = getAxisKey(axisType, index);\n fields.forEach((field, axisIndex) => {\n axisKey = getAxisKey(axisType, index, axisIndex, dataTypeScaleMap[field.subtype()]);\n const axisConfig = getAxisConfig({ index, axisIndex, axisType }, field, axesCreators, indices, facetFields);\n\n let axis;\n if (!map.has(axisKey)) {\n axis = createSimpleAxis(axisConfig, field, axesCreators);\n } else {\n axis = map.get(axisKey);\n axis._rotationLock = false;\n axis.config(axisConfig);\n }\n axis.valueParser(valueParser);\n currentAxes.push(axis);\n map.set(axisKey, axis);\n });\n\n if (currentAxes.length) {\n map.set(commonAxisKey, currentAxes);\n groupAxes.add(commonAxisKey);\n }\n\n return currentAxes;\n};\n\nexport const sanitizeIndividualLayerConfig = (encodingConfigs, def) => {\n [COLOR, SHAPE, SIZE].forEach((axis) => {\n if (encodingConfigs[axis] && encodingConfigs[axis].field) {\n def.forEach((conf) => {\n conf.encoding = conf.encoding || {};\n !conf.encoding[axis] && (conf.encoding[axis] = {});\n conf.encoding[axis].field = encodingConfigs[axis].field;\n });\n }\n });\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n const xAxes = [];\n const yAxes = [];\n\n xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes.push(xAxis);\n });\n yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes.push(yAxis);\n });\n return {\n xAxes, yAxes\n };\n};\n\n/**\n * return a default mark based on predefined set of rules of type and subtype of the fields\n *\n * @param {string} colFieldType dimension/measure - temporal/ordinal/nominal\n * @param {string} rowFieldType dimension/measure - temporal/ordinal/nominal\n * @return {Object} return mark type\n */\nexport const getDefaultMark = (colFieldType, rowFieldType) => {\n let mark;\n\n if (colFieldType === CATEGORICAL || rowFieldType === CATEGORICAL) {\n mark = BAR;\n } else if (colFieldType === TEMPORAL || rowFieldType === TEMPORAL) {\n mark = LINE;\n } else {\n mark = POINT;\n }\n\n return mark;\n};\n\n/**\n *\n *\n * @param {*} axesCreators\n * @param {*} [fieldInfo=[]]\n *\n */\nexport const createRetinalAxis = (axesCreators, fieldProps = {}) => {\n const { axisType, fieldsConfig } = axesCreators;\n const field = fieldProps.field;\n const axis = [];\n const Cls = scaleMaps[axisType];\n\n fieldProps.type = fieldProps.type ? fieldProps.type : getAxisType(fieldsConfig, field || null);\n axis.push(new Cls(fieldProps));\n return axis;\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} val\n *\n */\nexport const getIndex = (arr, val) => {\n let i = 0;\n let arrIndex = -1;\n\n while (arrIndex === -1 && i < arr.length) {\n if (arr[i].toString() === val.toString()) {\n arrIndex = i;\n }\n i++;\n }\n return arrIndex;\n};\n\n/**\n *\n *\n * @param {*} colFields\n * @param {*} rowFields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\nexport const getLayerConfFromFields = (colFields, rowFields, userLayerConfig) => userLayerConfig.filter((conf) => {\n const userConf = conf instanceof Array ? conf : [conf];\n const encodingArr = [].concat(...userConf.map(d => d.encoding).filter(d => d !== undefined));\n\n if (!encodingArr.length) {\n return true;\n }\n\n const xFields = [].concat(...encodingArr.map(d => [d.x && d.x.field, d.x0 && d.x0.field]))\n .filter(d => d !== undefined && d !== null);\n const yFields = [].concat(...encodingArr.map(d => [d.y && d.y.field, d.y0 && d.y0.field]))\n .filter(d => d !== undefined && d !== null);\n\n if (!xFields.length && !yFields.length) {\n return true;\n }\n\n const colFieldExist = xFields.length ? xFields.every(d => colFields.indexOf(d) !== -1) : false;\n const rowFieldExist = yFields.length ? yFields.every(d => rowFields.indexOf(d) !== -1) : false;\n if (xFields.length && yFields.length) {\n return colFieldExist && rowFieldExist;\n }\n return colFieldExist || rowFieldExist;\n});\n\nexport const resolveAxisConfig = (context, fieldInf, axisInfo) => {\n const { rowIndex, columnIndex, axesObj } = axisInfo;\n const { config, facetFields, resolver } = context;\n const resolverAxes = resolver.axes();\n const { RADIUS, ANGLE } = ENCODING;\n [RADIUS, ANGLE, ANGLE0].forEach((enc) => {\n const axesArr = resolverAxes[enc];\n if (!axesArr[rowIndex]) {\n axesArr[rowIndex] = [];\n }\n axesArr[rowIndex][columnIndex] = axesObj[enc];\n const axisConfig = getObjProp(config.axes, enc) || {};\n\n axesObj[enc].forEach((axis, i) => {\n let userConfig = axisConfig;\n if (axisConfig instanceof Function) {\n userConfig = axisConfig(rowIndex, columnIndex, {\n axisFields: [fieldInf[enc][i]],\n facetFields\n });\n }\n axis.config(userConfig);\n });\n });\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n unionDomain,\n COORD_TYPES,\n toArray,\n sortCategoricalField\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport {\n generateAxisFromMap,\n getDefaultMark,\n getIndex,\n getLayerConfFromFields,\n getAdjustedDomain,\n sanitizeIndividualLayerConfig\n} from './encoder-helper';\nimport { retriveDomainFromData } from '../group-helper';\n\nimport { ROW, COLUMN, COL, LEFT, TOP, MEASURE, BOTH, X, Y } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\nconst CARTESIAN = COORD_TYPES.CARTESIAN;\n\n/**\n *\n *\n * @export\n * @class CartesianEncoder\n * @extends {VisualEncoder}\n */\nexport default class CartesianEncoder extends VisualEncoder {\n\n /**\n *\n *\n *\n * @memberof CartesianEncoder\n */\n static type () {\n return CARTESIAN;\n }\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof CartesianEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const geomCellAxes = {};\n const {\n axes\n } = axesCreators;\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const axisFields = [{\n fields: rowFields,\n index: rowIndex\n }, {\n fields: columnFields,\n index: columnIndex\n }];\n const { resolver, facetFields, geomCell } = context;\n const xAxes = axes.x || [];\n const yAxes = axes.y || [];\n\n [rowFields, columnFields].forEach((fields, i) => {\n const type = i === 0 ? ROW : COLUMN;\n const axis = i === 0 ? Y : X;\n\n if (fields.length > 1) {\n axesCreators.position = BOTH;\n } else {\n axesCreators.position = this.axisFrom()[type];\n }\n geomCellAxes[axis] = generateAxisFromMap(axis, axisFields[i], axesCreators, {\n groupAxes: axis === X ? xAxes : yAxes,\n valueParser: resolver.valueParser()\n }, indices, facetFields);\n });\n geomCell.axes(geomCellAxes);\n return geomCellAxes;\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n const resolver = context.resolver();\n const units = resolver.units();\n const domains = {\n 0: {},\n 1: {}\n };\n const config = context.config();\n const fieldsObj = {\n 0: {},\n 1: {}\n };\n\n for (let rIdx = 0, len = units.length; rIdx < len; rIdx++) {\n const unitsArr = units[rIdx];\n for (let cIdx = 0, len2 = unitsArr.length; cIdx < len2; cIdx++) {\n const unit = unitsArr[cIdx];\n const axisFields = unit.fields();\n const encodingDomains = unit.getDataDomain();\n ['x', 'y'].forEach((axisType, axisTypeIndex) => {\n const fieldArr = axisFields[axisType];\n fieldArr.forEach((field, axisIndex) => {\n const key = !axisTypeIndex ? `0${cIdx}${axisIndex}` : `${rIdx}0${axisIndex}`;\n const dom = encodingDomains[axisType];\n const typeOfField = field.subtype();\n fieldsObj[axisTypeIndex][key] = field;\n\n if (dom && Object.keys(dom).length !== 0) {\n domains[axisTypeIndex][key] = unionDomain([(domains[axisTypeIndex] &&\n domains[axisTypeIndex][key]) || [], dom[`${field}`]], typeOfField);\n }\n });\n });\n }\n }\n\n const { x: xAxes, y: yAxes } = resolver.axes();\n store.lockModel();\n [xAxes, yAxes].forEach((axesArr, axisType) => {\n axesArr.forEach((axes, idx) => {\n let key;\n let domain = [];\n let adjustedDomain = [];\n const min = [];\n const max = [];\n const typeOfAxis = axes[0].constructor.type();\n\n if (axes.length > 1 && typeOfAxis === ScaleType.LINEAR && axes[0].config().alignZeroLine) {\n axes.forEach((axis, i) => {\n key = !axisType ? `0${idx}${i}` : `${idx}0${i}`;\n domain = domains[axisType][key];\n min[i] = domain[0];\n max[i] = domain[1];\n });\n adjustedDomain = getAdjustedDomain(max, min);\n } else if (typeOfAxis === ScaleType.BAND) {\n /* Sort categorical fields to ensure consistency across all rows\n only if sorted by user */\n key = !axisType ? `0${idx}0` : `${idx}00`;\n const currentFieldName = fieldsObj[axisType][key].oneVar();\n const sortingOrder = config.sort && config.sort[currentFieldName];\n\n if (sortingOrder) {\n domains[axisType][key].sort((a, b) => sortCategoricalField(sortingOrder, a, b));\n }\n }\n\n axes.forEach((axis, index) => {\n key = !axisType ? `0${idx}${index}` : `${idx}0${index}`;\n domain = adjustedDomain[index] || domains[axisType][key];\n\n domain && axis.domain(domain);\n const type = !axisType ? 'x' : 'y';\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${type}`, domain, `${idx}${index}`);\n });\n });\n });\n store.unlockModel();\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields, type) {\n let facets = [];\n let projections = [];\n let counter = 0;\n const primaryFacets = [];\n const secondaryFacets = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n const axisFrom = this.axisFrom();\n\n for (let i = 0; i < primaryLen; i++) {\n let projArr = [primaryFields[i]];\n const primaryField = primaryFields[i];\n\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter];\n if (secondaryField && secondaryField.type() === MEASURE) {\n counter++;\n projArr = [primaryField, secondaryField];\n }\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n primaryFacets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n secondaryFacets.push(secondaryField);\n }\n }\n }\n if ((primaryFacets.length || secondaryFacets.length) && !projections.length) {\n type = type === COL ? COLUMN : type;\n if ((axisFrom[type] === LEFT || axisFrom[type] === TOP) && primaryFacets.length) {\n const axisFromIndex = primaryFacets.length - 1;\n const facet = primaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(secondaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n secondaryFacets.splice(existIndex, 1);\n }\n primaryFacets.splice(axisFromIndex, 1);\n } else {\n const axisFromIndex = 0;\n const facet = secondaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(primaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n primaryFacets.splice(existIndex, 1);\n }\n secondaryFacets.splice(axisFromIndex, 1);\n }\n }\n\n facets = [...primaryFacets, ...secondaryFacets];\n facets = facets.filter((el, index, self) => index === self.findIndex(t => (t.toString() === el.toString())));\n return {\n facets,\n projections\n };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof CartesianEncoder\n */\n fieldSanitizer (datamodel, config) {\n return super.fieldSanitizer(datamodel, config);\n }\n\n /**\n *\n *\n * @param {*} datamodel\n *\n * @memberof CartesianEncoder\n */\n getRetinalFieldsDomain (dataModels, encoding) {\n const groupedModel = dataModels.groupedModel;\n const domains = {};\n for (const key in encoding) {\n if ({}.hasOwnProperty.call(encoding, key)) {\n const encodingObj = encoding[key];\n const field = encodingObj.field;\n if (!encodingObj.domain && field) {\n const domain = retriveDomainFromData(groupedModel, field);\n domains[field] = domain;\n }\n }\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n * @memberof CartesianEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n // let currentLayerIndex = 0;\n layerArray.length && layerArray.forEach((layer, i) => {\n const def = layerFactory.sanitizeLayerConfig(layer);\n def.order = i;\n serializedLayers.push(def);\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n const layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n\n // let currentLayerIndex = 0;\n columnFields.forEach((colField) => {\n const colFieldName = colField.toString();\n rowFields.forEach((rowField) => {\n let configs = [];\n const rowFieldName = rowField.toString();\n const encoding = {\n x: {\n field: colFieldName\n },\n y: {\n field: rowFieldName\n }\n };\n const rowFieldType = rowField.subtype();\n const colFieldType = colField.subtype();\n const mark = getDefaultMark(colFieldType, rowFieldType);\n\n const defConfigs = [{\n mark,\n def: {\n mark,\n encoding\n }\n }];\n\n const layerConfigs = getLayerConfFromFields(colField.getMembers(),\n rowField.getMembers(), userLayerConfig || []);\n if (layerConfigs.length) {\n configs = layerConfigs.map((layerConf) => {\n const mergedLayerConf = mergeRecursive(mergeRecursive({}, defConfigs[0].def), layerConf);\n const serializedLayerConfig = layerFactory.getSerializedConf(mergedLayerConf.mark,\n mergedLayerConf);\n return {\n mark: mergedLayerConf.mark,\n order: mergedLayerConf.order,\n def: serializedLayerConfig\n };\n });\n } else {\n configs = defConfigs;\n }\n\n layerConfig.push(...configs);\n });\n });\n return this.sanitizeLayerConfig(retinalConfig, layerConfig);\n }\n}\n","import { AngleAxis, RadiusAxis } from '@chartshq/muze-axis';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n GROUP_BY_FUNCTIONS,\n COORD_TYPES,\n toArray,\n getObjProp,\n defaultValue\n} from 'muze-utils';\nimport VisualEncoder from './visual-encoder';\nimport { SIZE, MEASURE, ARC, COLOR } from '../enums/constants';\nimport { sanitizeIndividualLayerConfig, resolveAxisConfig } from './encoder-helper';\nimport { SimpleVariable } from '../variable';\n\nconst POLAR = COORD_TYPES.POLAR;\nconst { RADIUS, ANGLE, ANGLE0 } = ENCODING;\n\nconst axesCls = {\n [RADIUS]: RadiusAxis,\n [ANGLE]: AngleAxis,\n [ANGLE0]: AngleAxis\n};\n\nconst getSizeMultiplier = (sizeVal, sizeAxis) => {\n const sizeAxisDomain = sizeAxis.domain();\n const sizeMultiplier = sizeAxis.getSize(sizeVal) / (sizeAxisDomain ? sizeAxis.range()[1] : sizeAxis.config().value);\n return sizeMultiplier;\n};\n\nconst setRadiusFactor = (context) => {\n const data = context.data();\n const sizeField = context.retinalFields().size.field;\n const { radius, size } = context.axes();\n\n if (sizeField && radius && radius.length) {\n const sizeFieldIndex = data.getFieldsConfig()[sizeField].index;\n const sizeVal = data.getData().data.reduce((acc, val) => acc + val[sizeFieldIndex], 1);\n const sizeMultiplier = getSizeMultiplier(sizeVal, size[0]);\n radius.forEach(axis => axis.setRadiusFactor(sizeMultiplier));\n }\n};\n\n/**\n *\n *\n * @export\n * @class PolarEncoder\n * @extends {VisualEncoder}\n */\nexport default class PolarEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof PolarEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const {\n axes\n } = axesCreators;\n const geomCellAxes = axes;\n const {\n indices\n } = fieldInfo;\n const {\n rowIndex,\n columnIndex\n } = indices;\n // Dummy axes for polar, to create blank cells\n const pieAxes = geomCellAxes.pie || [];\n\n pieAxes[rowIndex] = pieAxes[rowIndex] || [];\n pieAxes[rowIndex][columnIndex] = [];\n\n const axesObj = {};\n const { geomCell, resolver } = context;\n const layers = resolver.matrixLayers();\n const resolverAxes = resolver.axes();\n const cellLayers = layers[rowIndex][columnIndex];\n const fields = {\n radius: {},\n angle: {},\n angle0: {}\n };\n\n cellLayers.forEach((layerConf) => {\n const def = layerConf.def;\n [ANGLE, ANGLE0, RADIUS].forEach((enc) => {\n const field = getObjProp(def.encoding, enc, 'field');\n field && (fields[enc][field] = 0);\n });\n });\n const fieldInf = {};\n const varInstances = {};\n\n for (const encType in fields) {\n fieldInf[encType] = Object.keys(fields[encType]);\n axesObj[encType] = [];\n varInstances[encType] = [];\n fieldInf[encType].forEach((field, i) => {\n varInstances[encType][i] = new SimpleVariable(field);\n axesObj[encType][i] = new axesCls[encType]();\n });\n axesObj[encType][axesObj[encType].length] = new axesCls[encType]();\n }\n resolveAxisConfig(context, fieldInf, {\n axesObj,\n rowIndex,\n columnIndex\n });\n geomCell.axes(axesObj)\n .fields(Object.assign({}, varInstances, geomCell.fields()));\n resolverAxes.pie = pieAxes;\n return geomCellAxes;\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields) {\n let counter = 0;\n const facets = [];\n const projections = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n\n for (let i = 0; i < primaryLen; i++) {\n const primaryField = primaryFields[i];\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter++];\n const projArr = secondaryField ? [primaryField, secondaryField] : [primaryField];\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n }\n }\n }\n return {\n facets,\n projections\n };\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n store.lockModel();\n const domainProps = {\n radius: [],\n angle: [],\n angle0: []\n };\n const axes = context.resolver().axes();\n context.matrixInstance().value.each((cell, rIdx, cIdx) => {\n const unit = cell.valueOf();\n const unitDomains = unit.getDataDomain();\n const fields = unit.fields();\n setRadiusFactor(unit);\n [RADIUS, ANGLE, ANGLE0].forEach((encType) => {\n const encodingFields = fields[encType];\n const domains = unitDomains[encType] || {};\n encodingFields.forEach((field, i) => {\n !domainProps[encType][rIdx] && (domainProps[encType][rIdx] = []);\n !domainProps[encType][rIdx][cIdx] && (domainProps[encType][rIdx][cIdx] = []);\n domainProps[encType][rIdx][cIdx][i] = domains[`${field}`] || [];\n });\n });\n });\n\n for (const key in domainProps) {\n const specificAxes = axes[key];\n specificAxes.forEach((axesArr, rIdx) => {\n axesArr.forEach((axisArr, cIdx) => {\n axisArr.forEach((axis, i) => {\n axis.domain(defaultValue(getObjProp(domainProps[key], rIdx, cIdx, i), []));\n\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${key}`, domainProps[key],\n `${rIdx}-${cIdx}`);\n });\n });\n });\n }\n store.unlockModel();\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n setCommonDomain () {\n // No domain to be set\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n static type () {\n return POLAR;\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof PolarEncoder\n */\n fieldSanitizer (datamodel, config) {\n let sanitizedRows = [[], []];\n let sanitizedColumns = [[], []];\n const fields = super.fieldSanitizer(datamodel, config);\n const {\n layers\n } = config;\n const {\n rows,\n columns\n } = fields;\n const layer = layers[0];\n const encoding = layer.encoding;\n const radius = encoding && encoding.radius ? encoding.radius.field : null;\n const angle = encoding && encoding.angle ? encoding.angle.field : null;\n const sanitizedFields = [sanitizedRows, sanitizedColumns];\n\n [rows, columns].forEach((fieldType, typeIndex) => {\n fieldType.forEach((fieldSet, i) => fieldSet.forEach((field) => {\n if (field.toString() !== radius && field.toString() !== angle && field.type() !== MEASURE) {\n sanitizedFields[typeIndex][i].push(field);\n }\n }));\n });\n sanitizedColumns = [...new Set(sanitizedColumns)];\n sanitizedRows = [...new Set(sanitizedRows)];\n this.fieldInfo({ rows: sanitizedRows, columns: sanitizedColumns });\n return this.fieldInfo();\n }\n\n getRetinalFieldsDomain (dataModels, encoding, facetFields, groupBy) {\n let sizeField;\n let colorField;\n const fields = [];\n const layers = this.layers();\n const dataModel = dataModels.groupedModel;\n const fieldsConfig = dataModel.getFieldsConfig();\n const domains = {};\n if (layers && layers[0]) {\n const layer = layers[0];\n const layerEncoding = layer.def.encoding || {};\n\n [RADIUS, ANGLE, SIZE, COLOR].forEach((encType) => {\n const field = layerEncoding[encType] ? layerEncoding[encType].field : '';\n const measureField = fieldsConfig[field] && fieldsConfig[field].def.type === MEASURE;\n if (encType === SIZE && measureField) {\n sizeField = field;\n }\n if (encType === COLOR) {\n colorField = field;\n }\n fieldsConfig[field] && !measureField && fields.push(field);\n });\n }\n\n if (sizeField) {\n domains[sizeField] = dataModel.groupBy(facetFields, {\n [sizeField]: GROUP_BY_FUNCTIONS.SUM\n }).getFieldspace().fieldsObj()[sizeField].domain();\n }\n\n if (colorField) {\n const dm = dataModel.groupBy([...facetFields, ...fields], groupBy.measures);\n domains[colorField] = dm.getFieldspace().fieldsObj()[colorField].domain();\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof PolarEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n let layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n const allFields = [...columnFields, ...rowFields];\n\n allFields.forEach(() => {\n const encoding = {};\n let config = {\n mark: ARC,\n def: {\n encoding\n }\n };\n if (userLayerConfig && userLayerConfig.length > 0) {\n config = mergeRecursive(config, userLayerConfig[0]);\n }\n layerConfig.push(config);\n });\n if (layerConfig.length === 0) {\n layerConfig = userLayerConfig;\n }\n const sanitizedConfig = this.sanitizeLayerConfig(retinalConfig, layerConfig);\n this.layers(sanitizedConfig);\n return sanitizedConfig;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n *\n * @memberof PolarEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n\n layerArray.length && layerArray.forEach((layer) => {\n const def = layerFactory.getSerializedConf(layer.mark, layer);\n serializedLayers.push({\n mark: layer.mark,\n def\n });\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n def.forEach((conf) => {\n const encoding = conf.encoding || (conf.encoding = {});\n !encoding.angle && (encoding.angle = {});\n const angleField = getObjProp(encoding.angle, 'field');\n const angle0Field = getObjProp(encoding.angle0, 'field');\n if (!angleField) {\n Object.assign(encoding.angle, {\n field: encodingConfigs.color && encodingConfigs.color.field\n });\n }\n if (!angle0Field) {\n !encoding.angle0 && (encoding.angle0 = {});\n Object.assign(encoding.angle0, {\n field: encoding.angle.field\n });\n }\n });\n\n layerConfig.push(config);\n });\n return layerConfig;\n }\n}\n","import { createRetinalAxis } from './encoder-helper';\nimport { COLOR, SHAPE, SIZE } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\n/**\n *\n *\n * @export\n * @class RetinalEncoder\n * @extends {VisualEncoder}\n */\nexport default class RetinalEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n *\n * @memberof RetinalEncoder\n */\n createAxis (axesCreators) {\n const { fieldsConfig, config } = axesCreators;\n const newAxes = {};\n\n [COLOR, SHAPE, SIZE].forEach((axisType) => {\n newAxes[`${axisType}`] = createRetinalAxis({ axisType, fieldsConfig }, config[axisType]);\n });\n return newAxes;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof RetinalEncoder\n */\n static type () {\n return 'retinal';\n }\n\n /**\n *\n *\n * @param {*} context\n *\n * @memberof RetinalEncoder\n */\n setCommonDomain (context) {\n const { domains, axes, encoding } = context;\n\n Object.entries(encoding).forEach((enc) => {\n if (enc[1] && enc[1].field) {\n const encType = enc[0];\n const field = enc[1].field;\n\n if (field) {\n axes[encType].forEach((axis) => {\n const domain = domains[field];\n !enc[1].domain && axis.updateDomain(domain);\n });\n }\n }\n });\n return axes;\n }\n}\n","import { Store, FieldType, COORD_TYPES, getObjProp, DataModel } from 'muze-utils';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { DATA_UPDATE_COUNTER } from '../enums/defaults';\nimport { Variable } from '../variable';\nimport { PolarEncoder, CartesianEncoder } from '../encoder';\nimport {\n DIMENSION,\n MEASURE,\n ORDINAL,\n LINEAR,\n ROW,\n COLUMN,\n COL,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n COLOR,\n SIZE,\n TEMPORAL,\n SHAPE,\n INTERACTION,\n GRID_LINES,\n GRID_BANDS,\n HEADER,\n FACET,\n X,\n Y,\n ARC,\n RADIUS,\n ANGLE\n} from '../enums/constants';\n\nconst POLAR = COORD_TYPES.POLAR;\n\n/**\n * Creates an instance of a store which contains the arguments to make the class reactive\n *\n * @return {Object} instance of store\n * @memberof VisualGroup\n */\nexport const initStore = () => new Store({\n [DATA_UPDATE_COUNTER]: DATA_UPDATE_COUNTER\n});\n\n/**\n *\n *\n * @param {*} arr\n */\nexport const isDistributionEqual = arr => [...arr[0], ...arr[1]].reduce((isEqual, row) => {\n const rowType = row.type();\n\n if (rowType === MEASURE || rowType === TEMPORAL) {\n isEqual = true;\n }\n return isEqual;\n}, false);\n\n/**\n *\n *\n */\nexport const initializeCacheMaps = () => ({\n cellMap: new Map(),\n xAxesMap: new Map(),\n yAxesMap: new Map(),\n entryCellMap: new Map(),\n exitCellMap: new Map()\n});\n\n/**\n *\n *\n * @param {*} axisName\n * @param {*} id\n */\nexport const getAxisKey = (axisName, ...params) => `${axisName}-axis-${params.join('-')}`;\n\n/**\n *\n *\n * @param {*} rowId\n * @param {*} columnId\n */\nexport const getCellKey = (rowId, columnId) => `cell-${rowId}-${columnId}`;\n\n/**\n *\n *\n * @param {*} config\n *\n */\nexport const extractUnitConfig = (config) => {\n const unitConfig = {};\n const attrNames = [INTERACTION, GRID_LINES, GRID_BANDS];\n\n attrNames.forEach((attr) => {\n if (config[attr] !== undefined) {\n unitConfig[attr] = config[attr];\n }\n });\n return unitConfig;\n};\n\n/**\n *\n *\n * @param {*} headers\n * @param {*} index\n * @param {*} rowLength\n *\n * @memberof MatrixResolver\n */\nexport const getHeaderText = (headers, index, rowLength) => {\n let header = '';\n\n if (index === rowLength - 1 && headers.length > rowLength) {\n for (let i = index; i < headers.length - 1; i++) {\n header += `${headers[i].toString()} / `;\n }\n header += headers[headers.length - 1].toString();\n return header;\n } else if (headers[index]) {\n return headers[index].toString();\n }\n return '';\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} fieldHeaders\n * @param {*} TextCell\n * @param {*} labelManager\n *\n */\nexport const headerCreator = (fields, fieldHeaders, TextCell, { classPrefix, labelManager }) => {\n const headers = fields.length > 0 ? fields[0].map((cell, i) => new TextCell({\n type: HEADER,\n className: `${classPrefix}-grid-headers`\n }, {\n labelManager\n }).source(getHeaderText(fieldHeaders, i, fields[0].length))\n .config({ show: cell.config().show })) : [];\n return headers;\n};\n\n/**\n *\n *\n * @param {*} variable\n * @param {*} allFields\n *\n */\nexport const findInGroup = (variable, allFields) => {\n let channel = null;\n\n [COLOR, SIZE, SHAPE].forEach((e) => {\n if (this.store.get(e) && variable === this.store.get(e)[0]) {\n channel = e;\n }\n });\n\n if (channel) {\n return { channel };\n }\n [ROW, COL].forEach((facetType) => {\n allFields[`${facetType}Facets`].forEach((e) => {\n if (e.toString() === variable) {\n channel = { channel: FACET, type: facetType === COL ? COLUMN : ROW };\n }\n });\n });\n\n if (channel) {\n return channel;\n }\n\n [ROW, COL].forEach((projType) => {\n allFields[`${projType}Projections`].forEach((e) => {\n e.forEach((m) => {\n if (m.toString() === variable) {\n channel = projType === COL ? X : Y;\n }\n });\n });\n });\n\n if (channel) {\n return { channel };\n }\n return null;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} field\n */\nexport const getAxisType = (fieldsConfig, field) => {\n let fieldType = ORDINAL;\n\n if (field && fieldsConfig[field].def.type !== DIMENSION) {\n fieldType = LINEAR;\n }\n return fieldType;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} fieldName\n *\n */\nexport const retriveDomainFromData = (datamodel, fieldName) => {\n const field = datamodel.getFieldspace().fields.find(d => d.name() === fieldName.toString());\n return field.domain();\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n let xAxes = null;\n let yAxes = null;\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n\n xAxisSet && xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes = xAxes || [];\n xAxes.push(xAxis);\n });\n\n yAxisSet && yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes = yAxes || [];\n yAxes.push(yAxis);\n });\n\n return {\n xAxes, yAxes\n };\n};\n\nconst hasPolarEncodings = layerConf => layerConf.mark === ARC || [RADIUS, ANGLE].some(field =>\n getObjProp(layerConf.encoding, field));\n\n/**\n *\n *\n * @param {*} layers\n *\n */\nexport const getEncoder = (layers) => {\n let encoder = new CartesianEncoder();\n\n if (layers.length) {\n // Figuring out the kind of layers the group will have\n encoder = layers.some(layerConf => hasPolarEncodings(layerConf)) ? new PolarEncoder() : encoder;\n }\n return encoder;\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} userAxisFromConfig\n *\n */\nexport const getHeaderAxisFrom = (type, fields, userAxisFromConfig) => {\n let axisFrom = userAxisFromConfig[type];\n let headerFrom = '';\n const options = type === ROW ? [LEFT, RIGHT] : [BOTTOM, TOP];\n const [firstField, secondField] = fields;\n const firstFieldType = i => (firstField.length ? firstField[i].type() : null);\n const secondFieldType = i => (secondField.length ? secondField[i].type() : null);\n\n if (firstFieldType(firstField.length - 1) === DIMENSION && secondFieldType(0) === DIMENSION) {\n headerFrom = axisFrom ? options[1 - options.indexOf(axisFrom)] : options[1];\n\n if (type === COLUMN && (firstField[firstField.length - 1].toString() === secondField[0].toString())) {\n axisFrom = TOP;\n } else {\n axisFrom = axisFrom || options[0];\n }\n } else if (secondFieldType(secondField.length - 1) === DIMENSION) {\n headerFrom = type === ROW ? RIGHT : BOTTOM;\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else {\n headerFrom = type === ROW ? LEFT : TOP;\n axisFrom = type === ROW ? LEFT : TOP;\n }\n if (firstFieldType(firstField.length - 1) === MEASURE && secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n } else if (secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else if (firstFieldType(firstField.length - 1) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n }\n return [headerFrom, axisFrom];\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} layers\n *\n * @memberof MatrixResolver\n */\nexport const setFacetsAndProjections = (context, fieldInfo, encoder) => {\n const {\n fields,\n type\n } = fieldInfo;\n const { facets, projections } = encoder.simpleEncoder.getFacetsAndProjections(fields, type);\n\n context.facets({ [`${type}Facets`]: facets });\n context.projections({ [`${type}Projections`]: projections });\n\n return { facets, projections, fields };\n};\n\nconst getRowBorders = (left, right) => {\n const borders = {};\n borders.top = false;\n borders.bottom = false;\n if (left.length > 1 || right.length > 1) {\n borders.top = true;\n borders.bottom = true;\n }\n return borders;\n};\n\nconst getColumnsBorders = (top, bottom) => {\n const borders = {};\n borders.left = false;\n borders.right = false;\n if (top.length || bottom.length) {\n if ((top[0] && top[0].length > 1) || (bottom[0] && bottom[0].length > 1)) {\n borders.left = true;\n borders.right = true;\n }\n }\n return borders;\n};\n\nconst getValueBorders = (rows, columns) => {\n const borders = { top: true, left: true, bottom: true, right: true };\n const borderTypeRow = [LEFT, RIGHT];\n const borderTypeCol = [TOP, BOTTOM];\n rows.forEach((e, i) => {\n if (e[0] && e[0].length) {\n borders[borderTypeRow[i]] = true;\n } else {\n borders[borderTypeRow[i]] = false;\n }\n });\n columns.forEach((e, i) => {\n if (e.length) {\n borders[borderTypeCol[i]] = true;\n } else {\n borders[borderTypeCol[i]] = false;\n }\n });\n\n return borders;\n};\n\nexport const getBorders = (matrices, encoder) => {\n let showRowBorders = { top: false, bottom: false };\n let showColBorders = { left: false, right: false };\n let showValueBorders = { top: false, bottom: false, left: false, right: false };\n const {\n rows,\n columns,\n values: valueMatrix\n } = matrices;\n const [leftRows, rightRows] = rows;\n const [topColumns, bottomColumns] = columns;\n const {\n rowDimensions,\n columnDimensions,\n rowTemporalFields,\n columnTemporalFields,\n columnMeasures,\n rowMeasures\n } = encoder.fieldInfo();\n const allDimensionLength = rowDimensions.length + columnDimensions.length;\n const allMeasuresLength = rowMeasures.length + columnMeasures.length;\n const allTemporalFieldsLength = rowTemporalFields.length + columnTemporalFields.length;\n\n if (encoder.constructor.type() === POLAR) {\n if (!allDimensionLength) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n } else if (!allMeasuresLength && !allTemporalFieldsLength && allDimensionLength <= 2) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n\n showRowBorders = getRowBorders(leftRows, rightRows);\n showColBorders = getColumnsBorders(topColumns, bottomColumns);\n showValueBorders = getValueBorders([leftRows, rightRows], [topColumns, bottomColumns]);\n\n if (valueMatrix.length > 1) {\n showValueBorders.top = true;\n showValueBorders.bottom = true;\n }\n if (valueMatrix.length && valueMatrix[0].length > 1) {\n showValueBorders.left = true;\n showValueBorders.right = true;\n }\n return { showRowBorders, showColBorders, showValueBorders };\n};\n\nexport const getFieldsFromSuppliedLayers = (suppliedLayerConfig, fieldsConfig) => {\n let fields = [];\n const encodingArr = suppliedLayerConfig.map(conf => (conf.encoding || {}));\n fields = [...fields, [].concat(...encodingArr.map(enc => Object.values(enc).map(d => d.field)))];\n fields = fields.filter(field => fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION);\n return fields;\n};\n\nexport const extractFields = (facetsAndProjections, layerFields) => {\n const fields = Object.values(facetsAndProjections).map((arr) => {\n const flattenArray = [].concat(...arr);\n return [].concat(...flattenArray.map((field) => {\n if (field instanceof Variable) {\n return field.getMembers();\n }\n return field;\n }));\n });\n return [].concat(...fields, ...layerFields);\n};\n\n/**\n * This method sorts the facets fields inplace if field is of categorical type\n * @param {Object} facets Array of facets\n * @param {Array} keys Array of the facet field values\n * @param {Object} config configuration object\n * @return {Array} Returns sorted facets\n */\nexport const sortFacetFields = (facets, keys, config) => {\n /**\n * Check if the facet sorted by the user is plotted\n * If an incorrect field is sorted, return the keys as is\n */\n const schema = [];\n const facetNames = [];\n const sortInfo = [];\n const sortConfig = config.sort;\n\n facets.forEach((facet) => {\n const name = `${facet}`;\n facetNames.push(name);\n\n const facetSortConfig = sortConfig[name];\n\n if (facetSortConfig) {\n sortInfo.push([name, facetSortConfig]);\n } else {\n sortInfo.push([name, null]);\n }\n schema.push(facet.getSchemaDef());\n });\n\n return new DataModel([facetNames, ...keys], schema).getData({ sort: sortInfo }).data;\n};\n\nexport const removeExitCells = (resolver) => {\n const exitCells = resolver.cacheMaps().exitCellMap;\n const store = resolver.store();\n const qualifiedStateProps = [].concat(...VisualUnit.getQualifiedStateProps(),\n ...BaseLayer.getQualifiedStateProps());\n store.lockCommits(qualifiedStateProps);\n exitCells.forEach((placeholder) => {\n placeholder.remove();\n });\n store.unlockCommits(qualifiedStateProps);\n};\n","import { DataModel } from 'muze-utils';\nimport { sortFacetFields } from './group-utils';\n\n/**\n* Gets name of fields form the variables\n*\n* @param {*} fields1\n* @param {*} [fields2=[]]\n*\n*/\nconst getFieldNames = fieldVar => fieldVar.reduce((acc, d) => {\n acc = [...acc, ...d.getMembers()];\n return acc;\n}, []);\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareProjectionInfo = (fieldInfo) => {\n const {\n colProjections,\n rowProjections\n } = fieldInfo;\n const uniqueFields = [];\n let indices = [];\n let projections = [];\n\n rowProjections.forEach((rowProj, rIndex) => {\n const newRIndex = rIndex;\n colProjections.forEach((colProj, cIndex) => {\n const newCIndex = cIndex;\n const newRowProj = getFieldNames(rowProj);\n const newColProj = getFieldNames(colProj);\n\n uniqueFields.push([...newRowProj, ...newColProj]);\n indices.push({ rowIndex: newRIndex, colIndex: newCIndex });\n projections.push({ rowFields: rowProj, columnFields: colProj });\n });\n });\n indices = indices.length ? indices : [{ rowIndex: 0, colIndex: 0 }];\n projections = projections.length ? projections : [{ rowFields: [], columnFields: [] }];\n return { uniqueFields, indices, projections };\n};\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareFacetInfo = (fieldInfo) => {\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const rowFacetNames = getFieldNames(rowFacets);\n const colFacetNames = getFieldNames(colFacets);\n const allFacets = [...rowFacetNames, ...colFacetNames];\n\n return { rowFacetNames, colFacetNames, allFacets, rowFacets, colFacets };\n};\n\n/**\n*\n*\n* @param {*} context\n* @param {*} facetNames\n* @param {*} hashMap\n* @param {*} keys\n* @param {*} index\n* @returns\n*/\nconst prepareHashMaps = (context, facetNames, hashMap, keys, index) => {\n const rowKey = [];\n facetNames.forEach((name) => {\n const key = context._derivation[context._derivation.length - 1].meta.keys[name];\n\n rowKey.push(key);\n });\n\n const joinedRowKey = rowKey.join(',');\n\n if (hashMap[joinedRowKey] === undefined) {\n hashMap[joinedRowKey] = index++;\n keys.push(rowKey);\n }\n return rowKey;\n};\n\nconst createJoinedKeys = keys => keys.map(e => ({\n keyArr: e,\n joinedKey: e.join(',')\n}));\n\n/**\n*\n*\n* @param {*} splitModels\n* @param {*} facetInfo\n* @returns\n*/\nconst getSplitModelHashMap = (splitModels, facetInfo, config) => {\n const {\n rowFacetNames,\n colFacetNames,\n rowFacets,\n colFacets\n } = facetInfo;\n\n const rowKeyHashMap = {};\n const colKeyHashMap = {};\n\n const rowKeys = [];\n const colKeys = [];\n const rowIndex = 0;\n\n const splitModelsHashMap = {};\n\n splitModels.forEach((splitContext) => {\n const rowKey = prepareHashMaps(splitContext, rowFacetNames, rowKeyHashMap, rowKeys, rowIndex);\n const colKey = prepareHashMaps(splitContext, colFacetNames, colKeyHashMap, colKeys, 1);\n\n splitModelsHashMap[`${rowKey}-${colKey}`] = splitContext;\n });\n\n return {\n splitModelsHashMap,\n rowKeys: createJoinedKeys(sortFacetFields(rowFacets, rowKeys, config)),\n colKeys: createJoinedKeys(sortFacetFields(colFacets, colKeys, config))\n };\n};\n\n/**\n * Formats row or columns keys with the provided formatter.\n *\n * @param {Array} keys - The collection of row or column keys.\n * @param {Array} formatterList - The list of corresponding formatter.\n */\nconst formatKeys = (keys, formatterList) => {\n const formattedKeys = [];\n keys.forEach((rKeys, rIdx) => {\n formattedKeys[rIdx] = [];\n rKeys.forEach((key, idx) => {\n formattedKeys[rIdx][idx] = formatterList[idx](key);\n });\n });\n return formattedKeys;\n};\n\n/**\n*\n*\n* @param {Object} context\n* @param {Object} fieldInfo\n* @returns\n*/\nconst splitByColumn = (context, optionalProjections) => {\n const {\n matrix,\n dataModel,\n rowIndex,\n colIndex,\n facetInfo,\n projectionInfo,\n geomCellCreator\n } = context;\n const {\n indices,\n uniqueFields,\n projections\n } = projectionInfo;\n\n const commonFields = optionalProjections;\n\n dataModel.splitByColumn(uniqueFields, commonFields).forEach((model, i) => {\n let { rowIndex: row, colIndex: col } = indices[i];\n row += rowIndex;\n col += colIndex;\n\n matrix[row] = matrix[row] || [];\n\n const projectionIndexObject = {\n indices: {\n rowIndex: row,\n columnIndex: col\n },\n projections: projections[i]\n };\n\n matrix[row][col] = geomCellCreator(model, projectionIndexObject, facetInfo);\n });\n const lastIndex = indices[indices.length - 1];\n\n return {\n rowIndex: lastIndex.rowIndex + rowIndex,\n colIndex: lastIndex.colIndex + colIndex\n };\n};\n\nconst createColumnDataModels = (colContext, fieldInfo, sourceDM) => {\n let context = {};\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n const {\n rowKeyArr,\n rowKey,\n colKeyObj,\n newRowIndex,\n splitModelsHashMap,\n currentColumnIndex\n } = colContext;\n\n const { keyArr: colKeyArr, joinedKey: colKey } = colKeyObj;\n const hashMapKey = splitModelsHashMap[`${rowKey}-${colKey}`];\n\n if (hashMapKey) {\n context = { dataModel: hashMapKey };\n } else {\n const emptyDm = new DataModel([], sourceDM.getData().schema);\n context = { dataModel: emptyDm };\n }\n\n context = {\n ...context,\n ...colContext,\n facetInfo: {\n rowFacets: [rowFacets, rowKeyArr],\n colFacets: [colFacets, colKeyArr]\n },\n rowIndex: newRowIndex,\n colIndex: currentColumnIndex\n };\n const dataModels = splitByColumn(context, fieldInfo.optionalProjections);\n\n return {\n columnIndex: dataModels.colIndex + 1,\n rowIndex: dataModels.rowIndex\n };\n};\n\nconst createRowDataModels = (rowContext, fieldInfo, sourceDM) => {\n let currentColumnIndex = 0;\n let rowIndexForCurrentKey = 0;\n const {\n colKeys,\n rowKeyObj,\n currentRowIndex\n } = rowContext;\n const newRowIndex = currentRowIndex;\n const { keyArr: rowKeyArr, joinedKey: rowKey } = rowKeyObj;\n const colContext = {\n ...rowContext,\n rowKeyArr,\n rowKey,\n newRowIndex\n };\n rowIndexForCurrentKey = currentRowIndex;\n if (colKeys.length) {\n colKeys.forEach((colKeyObj) => {\n colContext.colKeyObj = colKeyObj;\n colContext.currentColumnIndex = currentColumnIndex;\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n });\n } else {\n colContext.colKeyObj = { keyArr: [], joinedKey: '' };\n colContext.currentColumnIndex = currentColumnIndex;\n\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n }\n return {\n rowIndex: ++rowIndexForCurrentKey\n };\n};\n\n/**\n* Gets Matrixes for corresponding datamodel, facets and projections\n*\n* @param {Object} dataModel input datamodel\n* @param {Object} fieldInfo Information about the fields\n* @param {Function} geomCellCreator Callback executed after datamodels are prepared after sel/proj\n* @return {Object} set of matrices with the corresponding row and column keys\n*/\nexport const getMatrixModel = (dataModel, fieldInfo, geomCellCreator, globalConfig) => {\n let currentRowIndex = 0;\n const matrix = [];\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const projectionInfo = prepareProjectionInfo(fieldInfo);\n const facetInfo = prepareFacetInfo(fieldInfo);\n const allSplitModels = dataModel.splitByRow(facetInfo.allFacets);\n\n const {\n splitModelsHashMap,\n rowKeys,\n colKeys\n } = getSplitModelHashMap(allSplitModels, facetInfo, globalConfig);\n\n const generalContext = {\n matrix,\n geomCellCreator,\n projectionInfo,\n splitModelsHashMap,\n colKeys\n };\n if (rowKeys.length) {\n rowKeys.forEach((rowKeyObj) => {\n const rowContext = {\n ...generalContext,\n rowKeyObj,\n currentRowIndex\n };\n const { rowIndex } = createRowDataModels(rowContext, fieldInfo, dataModel);\n\n currentRowIndex = rowIndex;\n });\n } else if (colKeys.length) {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n\n colKeys.forEach((colKeyObj) => {\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj,\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n });\n } else {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj: { keyArr: [], joinedKey: '' },\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n }\n\n const formattedColKeys = formatKeys(colKeys.map(e => e.keyArr),\n colFacets.map(facetField => facetField.rawFormat()));\n const formattedRowKeys = formatKeys(rowKeys.map(e => e.keyArr),\n rowFacets.map(facetField => facetField.rawFormat()));\n\n // Getting column keys\n const transposedColKeys = formattedColKeys.length > 0 ? formattedColKeys[0].map((col, i) =>\n formattedColKeys.map(row => row[i])) : formattedColKeys;\n\n return { matrix, rowKeys: formattedRowKeys, columnKeys: transposedColKeys };\n};\n","import { AxisOrientation } from '@chartshq/muze-axis';\nimport {\n getObjProp,\n FieldType,\n retrieveNearestGroupByReducers,\n mergeRecursive,\n createSelection,\n DataModel\n} from 'muze-utils';\nimport { getMatrixModel } from './matrix-model';\nimport {\n getCellKey,\n isDistributionEqual,\n mutateAxesFromMap,\n getFieldsFromSuppliedLayers,\n extractFields,\n removeExitCells\n} from './group-utils';\nimport { ROW, ROWS, COLUMNS, COL, LEFT, RIGHT, TOP,\n BOTTOM, PRIMARY, SECONDARY, X, Y, TEMPORAL } from '../enums/constants';\nimport { SimpleVariable } from '../variable';\n\n/**\n * Updates row and column cells with the geom cell corresponding to the facet keys\n *\n * @param {*} resolver\n * @param {*} facets\n */\nconst updateCells = (resolver, facets, geomCell) => {\n [ROW, COL].forEach((field) => {\n const cells = resolver[`${field}Cells`]();\n const facetKey = facets[`${field}Facets`][1].join();\n\n !cells[facetKey] && (cells[facetKey] = []);\n cells[facetKey].push(geomCell);\n resolver[`${field}Cells`](cells);\n });\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} datamodel\n * @param {*} fieldInfo\n * @param {*} facets\n *\n */\nexport const createValueCells = (context, datamodel, fieldInfo, facets) => {\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const {\n suppliedLayers,\n cell: GeomCell,\n resolver,\n config,\n encoder,\n detailFields\n } = context;\n const axes = resolver.axes();\n const cacheMaps = resolver.cacheMaps();\n const matrixLayers = resolver.matrixLayers();\n const labelManager = resolver.dependencies().smartlabel;\n const horizontalAxis = resolver.horizontalAxis();\n const verticalAxis = resolver.verticalAxis();\n const datamodelTransform = resolver.datamodelTransform();\n const sortedFields = config.sort;\n const {\n entryCellMap,\n exitCellMap\n } = cacheMaps;\n const layerConfigArr = encoder.getLayerConfig({ columnFields, rowFields }, suppliedLayers || [],\n context.retinalConfig);\n const axesCreators = { config, labelManager, axes, cacheMaps };\n\n fieldInfo.normalizedColumns = verticalAxis.fields;\n fieldInfo.normalizedRows = horizontalAxis.fields;\n\n const allFacets = [\n [...facets.rowFacets[0], ...facets.colFacets[0]],\n [...facets.rowFacets[1], ...facets.colFacets[1]]\n ];\n const facetFields = allFacets.slice();\n facetFields[0] = facetFields[0].map(facetField => facetField.oneVar());\n\n matrixLayers[rowIndex] = matrixLayers[rowIndex] ? matrixLayers[rowIndex] : [];\n matrixLayers[rowIndex][columnIndex] = layerConfigArr;\n\n // return from map if already there otherwise create and put in map\n const geomCellKey = getCellKey(rowIndex, columnIndex);\n const fields = {\n y: rowFields,\n x: columnFields\n };\n\n const geomCell = !exitCellMap.has(geomCellKey) ? new GeomCell() : exitCellMap.get(geomCellKey);\n\n // Sort datamodel if user has sorted a field\n const sortConfig = Object.keys(sortedFields).map(field => [field, sortedFields[field]]);\n if (sortConfig.length) {\n datamodel = datamodel.sort(sortConfig, { saveChild: true });\n }\n\n geomCell.data(datamodel)\n .fields(fields)\n .transform(datamodelTransform)\n .detailFields(detailFields)\n .facetByFields(allFacets);\n\n encoder.createAxis(axesCreators, fieldInfo, Object.assign({}, context, { geomCell, facetFields }));\n entryCellMap.set(geomCellKey, geomCell);\n exitCellMap.delete(geomCellKey);\n\n updateCells(resolver, facets, geomCell);\n\n return entryCellMap.get(geomCellKey);\n};\n\nconst extractAxisIndex = id => getObjProp(id.match(/^[0-9]*?(?=-)/g), 0);\n\n/**\n * Creates axis cells based on the set of axes\n *\n * @param {Selection} selection Contains a selection of the axis units\n * @param {Array} axes Actual axis units\n * @param {number} axisIndex 0-> primary axis, 1-> secondary axis(when dual axis is made)\n * @param {Object} cells Contains a collection of the cells\n * @return {Object} return either set of axis/blank cells depending on the config\n */\nconst createAxisCells = (selection, axes, axisIndex, cells) =>\n createSelection(selection, axis => axis, axes, (item, i) => i + item.reduce((e, n) => {\n const id = n.id + axisIndex;\n return `${e}-${id}`;\n }, '')).map((currObj, axis) => {\n if (axis && axis[axisIndex]) {\n const axisInst = axis[axisIndex];\n const { orientation, show } = axisInst.config();\n\n return new cells.AxisCell().source(axisInst).config({\n isOffset: orientation === AxisOrientation.LEFT || orientation === AxisOrientation.TOP,\n show\n });\n }\n return new cells.BlankCell().config({ show: false });\n }).sort((a, b) => extractAxisIndex(a[0]) - extractAxisIndex(b[0]));\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @retur\n */\nconst axisPlaceholderGn = (context, selObj, cells) => {\n const {\n matrices\n } = context;\n const {\n axesMatrix\n } = matrices;\n\n return (type, axisFrom) => {\n const axes = axesMatrix[`${type}`];\n\n if (axes && axes.length) {\n if (type === X || type === Y) {\n const fieldNames = type === Y ? ROWS : COLUMNS;\n\n [PRIMARY, SECONDARY].forEach((fieldType, index) => {\n const selObjProp = `${fieldNames}${fieldType}`;\n let axisIndex = index;\n let axesForDraw = axes;\n if (axisFrom === RIGHT || axisFrom === BOTTOM) {\n axisIndex = 1 - axisIndex;\n }\n if (!getObjProp(axes, 0, axisIndex)) {\n axesForDraw = [];\n }\n selObj[selObjProp] = createAxisCells(selObj[selObjProp], axesForDraw, axisIndex, cells);\n });\n } else {\n selObj.rowsPrimary = createAxisCells(selObj.rowPrime, axes.map(() => []), 0, cells);\n selObj.rowsSecondary = createAxisCells(selObj.rowSec, axes.map(() => []), 0, cells);\n selObj.columnsPrimary = createAxisCells(selObj.colPrime, axes[0], 0, cells);\n selObj.columnsSecondary = createAxisCells(selObj.colSec, axes[0], 0, cells);\n }\n }\n return selObj;\n };\n};\n\n/**\n * Creates header cells based on the set of headers\n *\n * @param {Object} selection Contains a selection of the header units\n * @param {string} headers Contains a list of the headers\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} return either set of header cells depending on the config\n */\nconst createTextCells = (selection, headers, cells, labelManager) => createSelection(selection,\n (label) => {\n const textCell = new cells.TextCell({}, { labelManager });\n textCell.source(label);\n return textCell;\n }, headers, (key, i) => key + i);\n\nconst extractFacetIndex = id => id.split('-').pop();\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @param {*} labelManager\n *\n */\nconst headerPlaceholderGn = (context, selectionObj, cells, labelManager) => {\n const {\n axis,\n keys,\n type,\n facet\n } = context;\n const counter = axis.length / keys.length;\n const selectionKeys = keys.length ? axis.map((d, i) => keys[Math.floor(i / counter)]) : [];\n\n const selObjUpdater = createSelection(selectionObj[`${type}Headers`], keySet => keySet, selectionKeys,\n (keySet, i) => `${keySet.join(',')}-${i}`)\n .sort((a, b) => extractFacetIndex(a[0]) - extractFacetIndex(b[0]));\n\n return selObjUpdater.map((keySet, data) => {\n let textCells = createTextCells(null, data, cells, labelManager);\n textCells = textCells.map((cell, k) => cell.source(k).config(facet));\n return textCells;\n });\n};\n\n/**\n * Creates a set of placeholders as a part of selection object\n *\n * @param {Array} normalizedOptions contains normalized rows and columns\n * @param {Array} matrices contains axis and value matrices\n * @param {aArrayny} projections contains set of row and column projections\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} Creates a set of placeholders as a part of selections\n */\nconst generatePlaceholders = (context, cells, labelManager) => {\n let selectionObj;\n const {\n matrices,\n fields,\n facetsAndProjections,\n selection,\n facet,\n encoders,\n resolver\n } = context;\n const {\n rows,\n columns\n } = fields;\n const {\n valuesMatrix\n } = matrices;\n const {\n rowProjections,\n colProjections\n } = facetsAndProjections;\n const {\n rowKeys,\n columnKeys\n } = valuesMatrix;\n const takeAxisFrom = encoders.simpleEncoder._axisFrom;\n const takeHeaderFrom = encoders.simpleEncoder._headerFrom;\n\n selectionObj = selection || {};\n\n ['pie', X, Y].forEach((axis) => {\n const axisFrom = axis === X ? takeAxisFrom.column : takeAxisFrom.row;\n selectionObj = axisPlaceholderGn(context, selectionObj, cells)(axis, axisFrom);\n });\n\n const {\n rowsPrimary,\n rowsSecondary,\n columnsPrimary,\n columnsSecondary\n } = selectionObj;\n\n const rowAxis = rowsPrimary && rowsPrimary.getObjects().length ? rowsPrimary.getObjects() :\n (rowsSecondary && rowsSecondary.getObjects().length ? rowsSecondary.getObjects() : []);\n const colAxis = columnsPrimary && columnsPrimary.getObjects().length ? columnsPrimary.getObjects() :\n (columnsSecondary && columnsSecondary.getObjects().length ? columnsSecondary.getObjects() : []);\n\n const headerConfig = [\n { type: LEFT, section: rows[0], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: RIGHT, section: rows[1], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: TOP, section: columns[0], axis: colAxis, headerFrom: takeHeaderFrom.column },\n { type: BOTTOM, section: columns[1], axis: colAxis, headerFrom: takeHeaderFrom.column }\n ];\n\n headerConfig.forEach((config, index) => {\n let keys;\n let length;\n const {\n type,\n section,\n axis,\n headerFrom\n } = config;\n\n if (index < 2) {\n keys = rowKeys;\n length = rowProjections.length > 0 ? rowProjections.length : 1;\n } else {\n keys = columnKeys;\n length = colProjections.length > 0 ? colProjections.length : 1;\n }\n keys = keys.map(arr => arr.map(val => resolver.valueParser()(val)));\n if (section.length && headerFrom === type && axis && keys.length) {\n const hContext = { axis, length, type };\n let headers = [];\n if (index < 2) {\n hContext.keys = keys;\n hContext.facet = facet.rows;\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n } else {\n hContext.facet = facet.columns;\n hContext.keys = keys[0].map((key, i) => keys.map(e => e[i]));\n\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n }\n selectionObj[`${type}Headers`] = headers;\n } else {\n selectionObj[`${type}Headers`] = null;\n }\n });\n return selectionObj;\n};\n\n/**\n * Generates matrices\n *\n * @param {Object} config Configuration to generate matrices\n * @param {Array} matrices Matrices containing the set of visual units and axes units\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} contains a collection of matrices\n */\nexport const generateMatrices = (context, matrices, cells, labelManager) => {\n const {\n unitHeight,\n unitWidth,\n facetsAndProjections,\n normalizedRows,\n normalizedColumns,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n } = context;\n const placeholderContext = {\n fields: {\n rows: normalizedRows,\n columns: normalizedColumns\n },\n matrices,\n facetsAndProjections,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n };\n // Generate placeholders for all matrices\n const selectionObj = generatePlaceholders(placeholderContext, cells, labelManager);\n const {\n columnsPrimary,\n columnsSecondary,\n rowsPrimary,\n rowsSecondary,\n leftHeaders,\n topHeaders,\n bottomHeaders,\n rightHeaders\n } = selectionObj;\n const [rowPrime, rowSec, colPrime, colSec] = [rowsPrimary, rowsSecondary, columnsPrimary, columnsSecondary]\n .map(d => (d ? d.getObjects() : []));\n const [leftFacets, rightFacets] = [leftHeaders, rightHeaders]\n .map(e => (e ? e.getObjects()\n .map(f => f.getObjects()) : []));\n let rowPriority = rowSec.length ? 1 : -1;\n rowPrime.length && rowPriority++;\n let colPriority = colSec.length ? 1 : -1;\n colPrime.length && colPriority++;\n\n // Compute left matrix using left headers and the axes on the rows\n let leftMatrix = leftFacets.length ? leftFacets.map((d, i) => {\n rowPrime[i] = rowPrime[i] ? [rowPrime[i]] : [];\n return [...d, ...rowPrime[i]];\n }) : (rowPrime ? rowPrime.map(d => [d]) : []);\n\n // Compute right matrix using right headers and the axes on the rows\n const rightMatrix = rowSec.length ? rowSec.map((d, i) => [d, ...(rightFacets[i] || [])]) : (rightFacets.length ?\n rightFacets.map(d => [...d]) : []);\n\n const topMatrix = [];\n if (topHeaders) {\n const headers = topHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n topMatrix[i] = topMatrix[i] || [];\n topMatrix[i].push(x);\n });\n });\n }\n // Compute top matrix using the top headers and axes on the columns\n if (colPrime.length) {\n topMatrix.push(colPrime);\n }\n\n // Bottom and right matrices are prepared using the user config.\n let bottomMatrix = [];\n if (colSec.length) {\n bottomMatrix.push(colSec);\n }\n const currentBottomLength = bottomMatrix.length;\n if (bottomHeaders) {\n const headers = bottomHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n bottomMatrix[i + currentBottomLength] = bottomMatrix[i + currentBottomLength] || [];\n bottomMatrix[i + currentBottomLength].push(x);\n });\n });\n }\n\n if (!leftMatrix.length && !rightMatrix.length) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n leftMatrix = [[cell]];\n }\n\n if (!topMatrix.length && (!bottomMatrix.length || !bottomMatrix[0].length)) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n bottomMatrix = [[cell]];\n }\n\n return {\n rows: [leftMatrix, rightMatrix],\n columns: [topMatrix, bottomMatrix],\n selectionObj,\n colPriority,\n rowPriority\n };\n};\n\nconst getAxisFields = (projections, fieldHolder = []) =>\n projections.reduce((acc, item) =>\n [...acc, ...item.reduce((ac, field) =>\n (field instanceof SimpleVariable ? [...ac, field.oneVar()] : ac), [])], fieldHolder);\n\nconst sortDmTemporalFields = (resolver, datamodel) => {\n let axisFields = [];\n const projections = resolver.projections();\n axisFields = getAxisFields(projections.rowProjections, getAxisFields(projections.colProjections));\n\n const fieldConfig = datamodel.getFieldsConfig();\n const temporalFields = axisFields.reduce((acc, field) =>\n ((fieldConfig[field].def.subtype === TEMPORAL) ? [...acc, [field]] : acc), []);\n return temporalFields.length ? datamodel.sort(temporalFields, { saveChild: true }) : datamodel;\n};\n\nconst transformDataModel = (dataModel, config, resolver) => {\n let groupedModel;\n\n const fieldsConfig = dataModel.getFieldsConfig();\n const resolvedData = resolver.data();\n const { groupBy, suppliedLayers, facetsAndProjections } = config;\n\n if (resolvedData instanceof DataModel) {\n resolvedData.dispose();\n }\n groupedModel = dataModel.project(dataModel.getSchema().map(d => d.name));\n resolver.data(groupedModel);\n if (!groupBy.disabled) {\n const fields = getFieldsFromSuppliedLayers(suppliedLayers, groupedModel.getFieldsConfig());\n const allFields = extractFields(facetsAndProjections, fields);\n const dimensions = allFields.filter(field =>\n getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const aggregationFns = groupBy.measures;\n const measureNames = Object.keys(groupedModel.getFieldspace().getMeasure());\n const nearestAggFns = retrieveNearestGroupByReducers(groupedModel, ...measureNames);\n const resolvedAggFns = mergeRecursive(nearestAggFns, aggregationFns);\n\n groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns)\n .project(allFields);\n }\n // sort temporal fields if any in the given rows and columns\n groupedModel = sortDmTemporalFields(resolver, groupedModel);\n return groupedModel;\n};\n\n/**\n * Computes matrices for a group\n *\n * @param {Object} datamodel on which the matrices are to be computed\n * @param {Object} config configuration of the matrices\n * @param {Object} layerRegistry contains the registered layers\n * @return {Object} conputed matrices\n * @memberof MatrixResolver\n */\nexport const computeMatrices = (context, config) => {\n const {\n resolver,\n datamodel,\n componentRegistry,\n encoders\n } = context;\n const {\n globalConfig,\n selection,\n transform\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const { smartlabel: labelManager } = resolver.dependencies();\n const fieldMap = datamodel.getFieldsConfig();\n const layerConfig = resolver.layerConfig();\n const registry = resolver.registry();\n const { fields: normalizedRows } = resolver.horizontalAxis();\n const { fields: normalizedColumns } = resolver.verticalAxis();\n const otherEncodings = resolver.optionalProjections(config, layerConfig);\n const facetsAndProjections = resolver.getAllFields();\n const matrixGnContext = {\n // Configuration to be passed to generate the different matrices.\n // A common config is used for both value matrices and other matrices\n normalizedColumns,\n normalizedRows,\n facetsAndProjections,\n layers: layerConfig,\n fieldMap,\n otherEncodings,\n encoders,\n facet: globalConfig.facet || {},\n axisFrom: globalConfig.axisFrom || {},\n selection,\n resolver\n };\n const cells = {\n GeomCell: resolver.getCellDef(registry.GeomCell),\n AxisCell: resolver.getCellDef(registry.AxisCell),\n BlankCell: resolver.getCellDef(registry.BlankCell),\n TextCell: resolver.getCellDef(registry.TextCell)\n };\n const isRowSizeEqual = isDistributionEqual(normalizedRows);\n const isColumnSizeEqual = isDistributionEqual(normalizedColumns);\n\n resolver.colCells({});\n resolver.rowCells({});\n resolver.datamodelTransform(transform || {});\n\n // Cell creation begins here\n resolver.resetSimpleAxes();\n\n const {\n entryCellMap\n } = resolver.cacheMaps();\n const newCacheMap = {\n exitCellMap: entryCellMap,\n entryCellMap: new Map()\n };\n\n resolver.cacheMaps(newCacheMap);\n\n const valueCellContext = {\n config: globalConfig,\n suppliedLayers: encoders.simpleEncoder.serializeLayerConfig(resolver.layerConfig()),\n resolver,\n cell: cells.GeomCell,\n encoder: encoders.simpleEncoder,\n newCacheMap,\n detailFields: config.detail,\n retinalConfig: {\n color: config.color,\n size: config.size,\n shape: config.shape\n }\n };\n\n const groupedModel = transformDataModel(datamodel, {\n facetsAndProjections,\n suppliedLayers: valueCellContext.suppliedLayers,\n groupBy\n }, resolver);\n\n // return a callback function to create the cells from the matrix\n const cellCreator = resolver.valueCellsCreator(valueCellContext);\n // Creates value matrices from the datamodel and configs\n const valueMatrixInfo = getMatrixModel(groupedModel, facetsAndProjections, cellCreator, globalConfig);\n\n removeExitCells(resolver);\n resolver.cacheMaps().exitCellMap.clear();\n resolver.valueMatrix(valueMatrixInfo.matrix);\n\n const { xAxes, yAxes } = mutateAxesFromMap(resolver.cacheMaps(), resolver.axes());\n\n resolver.axes({\n x: xAxes,\n y: yAxes\n });\n\n resolver.createUnits(componentRegistry, config);\n\n const matrices = {\n valuesMatrix: valueMatrixInfo,\n axesMatrix: resolver.axes()\n };\n // Create all matrices\n const {\n rows,\n columns,\n selectionObj,\n rowPriority,\n colPriority\n } = generateMatrices(matrixGnContext, matrices, cells, labelManager);\n\n resolver.rowMatrix(rows);\n resolver.columnMatrix(columns);\n\n return {\n rows: resolver.rowMatrix(),\n columns: resolver.columnMatrix(),\n values: resolver.valueMatrix(),\n isColumnSizeEqual,\n isRowSizeEqual,\n priority: {\n row: rowPriority,\n col: colPriority\n },\n selection: selectionObj,\n dataModels: {\n groupedModel,\n parentModel: datamodel\n }\n };\n};\n","export const RESOLVER_PROPS = {\n dependencies: {},\n units: {},\n datamodelTransform: {},\n layerConfig: {},\n matrixLayers: {},\n colCells: {},\n rowCells: {},\n rowMatrix: {},\n columnMatrix: {},\n valueMatrix: {},\n encoder: {},\n valueParser: {},\n data: {}\n};\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { generateGetterSetters, STATE_NAMESPACES, getUniqueId } from 'muze-utils';\nimport {\n initializeCacheMaps,\n headerCreator,\n extractUnitConfig,\n setFacetsAndProjections\n} from './group-utils';\nimport {\n ROW, COL, LEFT, RIGHT, COLOR, SIZE, SHAPE, DETAIL, CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS, INITIALIZED,\n AXIS, UNIT, BEFORE_UPDATE, UPDATED, VALUE_MATRIX, FACET_HEADERS\n} from '../enums/constants';\nimport { createValueCells, computeMatrices } from './cell-creator';\nimport { RESOLVER_PROPS } from './resolver-props';\n\n/**\n * Resolves the matrices from configuration provided\n *\n * @export\n * @class MatrixResolver\n */\nexport default class MatrixResolver {\n\n /**\n * Creates an instance of MatrixResolver.\n * @param {Object} dependencies needed to run the resolver\n * @memberof MatrixResolver\n */\n constructor (dependencies) {\n this._registry = {};\n this._layerConfig = [];\n this._matrixLayers = [];\n this._dependencies = dependencies;\n this._rowMatrix = [];\n this._columnMatrix = [];\n this._valueMatrix = [];\n this._facets = { rowFacets: [], colFacets: [] };\n this._projections = { rowProjections: [], colProjections: [] };\n this._datamodelTransform = {};\n this._units = [];\n this._cacheMaps = {};\n this._fireboltDeps = {};\n this._axes = {\n x: {},\n y: {},\n color: [],\n size: [],\n shape: [],\n radius: [],\n angle: [],\n angle0: []\n };\n generateGetterSetters(this, RESOLVER_PROPS);\n this.cacheMaps(initializeCacheMaps());\n }\n\n /**\n * Set: Registers placeholders, Get: return {Object} those placeholders\n *\n * @param {Object} placeholders cells that will construct the group\n * @return {Object} Either current instance or the set of placeholders\n * @memberof MatrixResolver\n */\n registry (...placeholders) {\n if (placeholders.length) {\n Object.entries(placeholders[0]).forEach((val) => {\n this._registry[val[0]] = val[1];\n });\n return this;\n }\n return this._registry;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n cacheMaps (...maps) {\n if (maps.length) {\n [CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS].forEach((e) => {\n this._cacheMaps[`${e}Map`] = maps[0][`${e}Map`] || this._cacheMaps[`${e}Map`];\n });\n return this;\n }\n return this._cacheMaps;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n axes (...axes) {\n if (axes.length) {\n this._axes = Object.assign({}, this._axes, axes[0]);\n return this;\n }\n return this._axes;\n }\n\n /**\n *\n *\n * @param {*} facets\n *\n * @memberof MatrixResolver\n */\n facets (...facets) {\n if (facets.length) {\n Object.entries(facets[0]).forEach((e) => {\n this._facets[e[0]] = e[1];\n });\n return this;\n }\n return this._facets;\n }\n\n /**\n *\n *\n * @param {*} projections\n *\n * @memberof MatrixResolver\n */\n projections (...projections) {\n if (projections.length) {\n Object.entries(projections[0]).forEach((e) => {\n this._projections[e[0]] = e[1];\n });\n return this;\n }\n return this._projections;\n }\n\n /**\n *\n *\n * @param {*} config\n * @param {*} layerConfig\n *\n * @memberof MatrixResolver\n */\n optionalProjections (config, layerConfig) {\n const otherEncodings = {};\n const optionalProjections = [];\n const otherEncodingTypes = [SIZE, COLOR, SHAPE];\n\n otherEncodingTypes.forEach((type) => {\n if (config[type] && config[type].field) {\n const enc = config[type];\n otherEncodings[type] = enc.field;\n optionalProjections.push(enc.field);\n }\n });\n\n if (config[DETAIL]) {\n optionalProjections.push(...config.detail);\n }\n\n if (layerConfig.length) {\n layerConfig.forEach((layer) => {\n if (layer.encoding) {\n Object.values(layer.encoding).forEach((enc) => {\n if (enc && optionalProjections.indexOf(enc.field) === -1) {\n optionalProjections.push(enc.field ? enc.field : enc);\n }\n });\n }\n });\n }\n this.projections({ optionalProjections });\n return otherEncodings;\n }\n\n /**\n * return the normalized set of rows and facets and projections\n *\n * @param {Object} rows parameters needed to set horizontal axis consisiting of rows\n * @return {Object} facets, projections and normalized rows\n * @memberof MatrixResolver\n */\n horizontalAxis (rows, encoder) {\n if (rows) {\n this._horizontalAxis = setFacetsAndProjections(this, { type: ROW, fields: rows }, encoder);\n return this;\n }\n return this._horizontalAxis;\n }\n\n /**\n * return the normalized set of columns and facets and projections\n *\n * @param {Object} columns parameters needed to set vertical axis consisiting of columns\n * @return {Object} facets, projections and normalized columns\n * @memberof MatrixResolver\n */\n verticalAxis (columns, encoder) {\n if (columns) {\n this._verticalAxis = setFacetsAndProjections(this, { type: COL, fields: columns }, encoder);\n return this;\n }\n return this._verticalAxis;\n }\n\n /**\n * Gets the class definition of a particular cell type(if the particular type has been extended, that particular\n * definition is returned)\n *\n * @param {Object} cell cell whose class definition is to be retrieved\n * @return {Object} cell definition\n * @memberof MatrixResolver\n */\n getCellDef (cell) {\n const registry = this.registry();\n\n Object.values(registry).forEach((e) => {\n if (e.prototype instanceof cell) {\n cell = e;\n }\n });\n return cell;\n }\n\n /**\n * return a visual cell creator along with its axis information to be injected to the datamodel creation\n * function\n *\n * @param {Object} GeomCell Type of cell to be created\n * @return {Object} Created cell\n * @memberof MatrixResolver\n */\n valueCellsCreator (context) {\n // reset matrix layers\n this.matrixLayers([]);\n\n return (datamodel, fieldInfo, facets) => createValueCells(context, datamodel, fieldInfo, facets);\n }\n\n /**\n * Callback to be applied on each cell of a matrix of a particular type\n *\n * @param {string} matrixType type of matrix on which callback is to be applied\n * @param {Function} callback function to be applied to each cell\n * @memberof MatrixResolver\n */\n forEach (matrixType, callback) {\n this[matrixType]().forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n callback(rIndex, cIndex, col);\n });\n });\n }\n\n /**\n *\n *\n *\n * @memberof MatrixResolver\n */\n getAllFields () {\n const retObj = this.projections();\n\n Object.entries(this.facets()).forEach((e) => {\n retObj[e[0]] = e[1];\n });\n return retObj;\n }\n\n /**\n *\n *\n * @memberof MatrixResolver\n */\n resetSimpleAxes () {\n return this.axes({\n x: new Set(),\n y: new Set(),\n radius: [],\n angle: [],\n angle0: [],\n pie: []\n });\n }\n\n setFireboltDependencies (prop, deps) {\n Object.assign(this._fireboltDeps, {\n [prop]: deps\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} componentRegistry\n * @param {*} config\n * @memberof MatrixResolver\n */\n createUnits (componentRegistry, config) {\n const {\n globalConfig,\n alias,\n coord\n } = config;\n const {\n layerRegistry,\n sideEffectRegistry\n } = componentRegistry;\n const {\n smartlabel: smartLabel,\n lifeCycleManager,\n throwback\n } = this.dependencies();\n const fireboltDeps = this._fireboltDeps;\n\n // Provide the source for the matrix\n const units = [[]];\n // Setting unit configuration\n const unitConfig = extractUnitConfig(globalConfig || {});\n const store = this.store();\n store.lockModel();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n let unit = el.source();\n if (!unit) {\n const namespace = `unit${i}-${j}-${getUniqueId()}`;\n\n unit = VisualUnit.create({\n layerRegistry,\n sideEffectRegistry\n }, {\n smartLabel,\n lifeCycleManager,\n throwback,\n fireboltDeps\n });\n unit.metaInf({\n rowIndex: i,\n colIndex: j,\n namespace\n });\n unit.store(store);\n unit.coord(coord);\n el.source(unit);\n }\n !units[i] && (units[i] = []);\n units[i][j] = unit;\n unit.parentAlias(alias)\n .valueParser(this.valueParser())\n .coord(coord);\n el.config(unitConfig);\n });\n store.unlockModel();\n lifeCycleManager.notify({ client: units, action: INITIALIZED, formalName: UNIT });\n return this.units(units);\n }\n\n /**\n *\n *\n * @param {*} config\n * @memberof MatrixResolver\n */\n setDomains (config, datamodel, encoders) {\n const {\n color,\n shape,\n size,\n globalConfig\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const {\n rowFacets,\n colFacets\n } = this.getAllFields();\n const encoding = {\n color,\n shape,\n size\n };\n const facetFields = [...rowFacets.map(e => e.toString()), ...colFacets.map(e => e.toString())];\n const retContext = {\n domains: encoders.simpleEncoder.getRetinalFieldsDomain(datamodel, encoding, facetFields, groupBy),\n axes: this.axes(),\n encoding\n };\n encoders.retinalEncoder.setCommonDomain(retContext);\n return this;\n }\n\n resetFacetsAndProjections () {\n this._facets = {};\n this._projections = {};\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof MatrixResolver\n */\n getRetinalAxes () {\n const {\n color,\n shape,\n size\n } = this.axes();\n\n return {\n color: [...color],\n shape: [...shape],\n size: [...size]\n };\n }\n\n /**\n *\n *\n * @param {*} type\n *\n * @memberof MatrixResolver\n */\n getSimpleAxes (type) {\n return this.axes()[`${type}`];\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof MatrixResolver\n */\n createRetinalAxes (fieldsConfig, config, encoders) {\n const layerConfig = this.layerConfig();\n this.optionalProjections(config, layerConfig);\n const retinalAxes = encoders.retinalEncoder.createAxis({\n fieldsConfig,\n config,\n axes: this.axes()\n });\n const {\n lifeCycleManager\n } = this.dependencies();\n\n [COLOR, SHAPE, SIZE].forEach((e) => {\n this.axes()[e] = retinalAxes[e];\n });\n\n lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS });\n lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT });\n\n const units = [];\n const matrixLayers = this.matrixLayers();\n const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`,\n `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`];\n const store = this.store();\n store.lockCommits(props);\n store.lockModel();\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n el.axes(Object.assign(el.axes(), retinalAxes));\n el.source() && el.source().retinalFields(config);\n el.layerDef(matrixLayers[i][j]);\n el.updateModel();\n\n units.push(el.source());\n });\n store.unlockModel()\n .unlockCommits([props[0]])\n .unlockCommits([props[1]]);\n lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT });\n return this;\n }\n\n /**\n *\n *\n * @param {*} placeholders\n * @param {*} fieldNames\n *\n * @memberof MatrixResolver\n */\n createHeaders (placeholders, fieldNames, config) {\n let bottomLeft = [];\n let bottomRight = [];\n const {\n rows,\n columns\n } = placeholders;\n const {\n smartlabel: labelManager,\n lifeCycleManager\n } = this.dependencies();\n const {\n showHeaders,\n classPrefix\n } = config;\n const TextCell = this.getCellDef(this.registry().TextCell);\n const BlankCell = this.getCellDef(this.registry().BlankCell);\n const [leftRows, rightRows] = rows;\n const [topCols, bottomCols] = columns;\n const rowHeaders = fieldNames.rows;\n const blankCellCreator = cell => new BlankCell().config({ show: cell.config().show });\n\n // Headers and footers are created based on the rows. Thereafter, using the column information\n // they are tabularized into the current structure\n const headers = {\n left: headerCreator(leftRows, rowHeaders[0], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager }),\n right: headerCreator(rightRows, rowHeaders[1], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager })\n };\n const footers = {\n left: leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : [],\n right: rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []\n };\n const [topLeft, topRight] = [LEFT, RIGHT].map(type => topCols.map((col, i) => {\n if (i === topCols.length - 1) {\n return headers[type];\n }\n return footers[type];\n }));\n\n // Creating only bottom matrices if there is no information on the top\n if (topCols.length === 0) {\n [bottomLeft, bottomRight] = [LEFT, RIGHT].map(type => bottomCols.map((col, i) => {\n if (i === 0) {\n return headers[type];\n }\n return footers[type];\n }));\n } else {\n bottomLeft = bottomCols.map(() => (leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : []));\n bottomRight = bottomCols.map(() => (rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []));\n }\n\n lifeCycleManager.notify({\n client: [topLeft, topRight, bottomLeft, bottomRight],\n action: INITIALIZED,\n formalName: FACET_HEADERS\n });\n\n return { topLeft, topRight, bottomLeft, bottomRight };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @param {*} componentRegistry\n * @param {*} encoders\n *\n * @memberof MatrixResolver\n */\n getMatrices (datamodel, config, componentRegistry, encoders) {\n const context = {\n datamodel,\n componentRegistry,\n encoders,\n resolver: this\n };\n\n return computeMatrices(context, config);\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n return this;\n }\n return this._store;\n }\n\n clear () {\n const cacheMaps = this._cacheMaps;\n for (const key in cacheMaps) {\n cacheMaps[key].clear();\n }\n }\n\n}\n","/**\n * This is a wrapper class over the matrix of cells which gets created in visual group. Visual Group creates left,\n * right, bottom and top and center matrices and wraps them using this class.\n *\n * @public\n * @class ValueMatrix\n */\nclass ValueMatrix {\n\n /**\n * Creates an instance of ValueMatrix.\n *\n * @param {Array} matrixArr Matrix array.\n */\n constructor (matrixArr) {\n const instancesById = {};\n\n this.matrix(matrixArr || []);\n this.filter(() => true);\n\n this.each((el, rIdx, cIdx) => {\n const cellValue = el.valueOf();\n if (cellValue && cellValue.id) {\n const id = cellValue.id();\n instancesById[id] = {\n instance: cellValue,\n rowIndex: rIdx,\n colIndex: cIdx\n };\n }\n });\n\n this.instancesById(instancesById);\n }\n\n instancesById (...id) {\n if (id.length) {\n this._instancesById = id[0];\n return this;\n }\n return this._instancesById;\n }\n\n /**\n * Returns the array of matrices contained in this instance.\n *\n * @public\n * @return {Array} Array of matrices.\n */\n matrix (...matrix) {\n if (matrix.length) {\n this._matrix = matrix[0];\n return this;\n }\n return this._matrix;\n }\n\n /**\n * Sets a filter criteria. This filter criteria gets applied when each function is called.\n *\n * @public\n * @param {Function} fn Filter function.\n *\n * @return {ValueMatrix} Instance of value matrix.\n */\n filter (...fn) {\n if (fn.length) {\n this._filterFn = fn[0];\n return this;\n }\n return this._filterFn;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n width () {\n let rowWidth = 0;\n\n this.matrix().forEach((row) => {\n let currentRowWidth = 0;\n row.forEach((cell) => {\n currentRowWidth += cell.getLogicalSpace().width;\n });\n rowWidth = Math.max(rowWidth, currentRowWidth);\n });\n return rowWidth;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n height () {\n let rowHeight = 0;\n\n this.matrix().forEach((row) => {\n let currentRowHeight = 0;\n row.forEach((cell) => {\n currentRowHeight = Math.max(currentRowHeight, cell.getLogicalSpace().height);\n });\n rowHeight += currentRowHeight;\n });\n return rowHeight;\n }\n\n /**\n * Iterates through the two dimensional matrix array and calls the given callback function with the cell instance,\n * row index, column index and the matrix array.\n *\n * @param {Function} fn Callback function which will get called for every cell.\n * @return {ValueMatrix} Instance of the value matrix.\n */\n each (fn) {\n const matrix = this.matrix();\n const filterFn = this.filter();\n\n matrix.forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n if (filterFn(col)) {\n fn(col, rIndex, cIndex, matrix);\n }\n });\n });\n return this;\n }\n\n findPlaceHolderById (id) {\n return this.instancesById()[id];\n }\n\n clear () {\n this.each(cell => cell.remove());\n this.matrix([]);\n }\n}\n\nexport default ValueMatrix;\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { getEncoder, getBorders } from '../group-helper';\nimport { RetinalEncoder } from '../encoder';\nimport { registerDomainChangeListener, unsubscribeChangeListeners } from './change-listener';\nimport ValueMatrix from './value-matrix';\n\nexport const createUnitState = (context) => {\n const [globalState, localState] = VisualUnit.getState();\n const store = context.store();\n store.append(STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE, localState);\n};\n\nexport const initializeGlobalState = (context) => {\n const globalState = context.constructor.getState()[0];\n const store = context.store();\n store.append(STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE, globalState);\n};\n\nexport const createLayerState = (context) => {\n const [globalState, localState] = BaseLayer.getState();\n context.store().append(STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE, localState);\n};\n\nconst sanitizeRetinalConfig = (retinalConf) => {\n const conf = {};\n for (const key in retinalConf) {\n const confValue = retinalConf[key];\n if (typeof confValue === 'string' || !confValue) {\n conf[key] = {\n field: retinalConf[key]\n };\n } else {\n conf[key] = confValue;\n }\n }\n return conf;\n};\n\nexport const setMatrixInstances = (context, placeholder) => {\n let {\n values,\n rows,\n columns\n } = placeholder;\n values = values || [];\n rows = rows || [];\n columns = columns || [];\n context._composition.matrices = {\n value: new ValueMatrix(values),\n left: new ValueMatrix(rows[0]),\n right: new ValueMatrix(rows[1]),\n top: new ValueMatrix(columns[0]),\n bottom: new ValueMatrix(columns[1])\n };\n\n context._dependencies.throwback.commit(CommonProps.MATRIX_CREATED, true);\n return context;\n};\n\nexport const createMatrices = (context) => {\n const rows = context.rows();\n const columns = context.columns();\n const color = context.color();\n const datamodel = context.data();\n const size = context.size();\n const detail = context.detail();\n const layers = context.layers();\n const transform = context.transform();\n const config = context.config();\n const shape = context.shape();\n\n // Get the resolver for the matrices\n const resolver = context.resolver();\n resolver.store(context.store());\n resolver.valueParser(context.valueParser());\n // Prepare configuration for matrix preparation\n let matrixConfig = {\n selection: context.selection(),\n alias: context.alias(),\n globalConfig: config || {},\n rows,\n columns,\n detail,\n layers,\n transform\n };\n\n unsubscribeChangeListeners(context);\n\n const retinalConfig = sanitizeRetinalConfig({\n color,\n shape,\n size\n });\n\n matrixConfig = Object.assign(matrixConfig, retinalConfig);\n // Create the encoders for the group\n const encoders = {};\n encoders.retinalEncoder = new RetinalEncoder();\n encoders.simpleEncoder = getEncoder(layers);\n matrixConfig.coord = encoders.simpleEncoder.constructor.type();\n resolver.encoder(encoders.simpleEncoder);\n\n // Set the group type\n context.groupType(encoders.simpleEncoder.constructor.type());\n\n // Get sanitized fields as instances of the Vars Class\n const fields = encoders.simpleEncoder.fieldSanitizer(datamodel, matrixConfig);\n encoders.simpleEncoder.setAxisAndHeaders(config ? config.axisFrom : {}, fields);\n // Setting layers for the code\n layers && resolver.layerConfig(layers);\n // Set the row and column axes\n resolver.horizontalAxis(fields.rows, encoders).verticalAxis(fields.columns, encoders);\n // Getting the placeholders\n const placeholderInfo = resolver.getMatrices(datamodel, matrixConfig, context.registry(), encoders);\n context._groupedDataModel = placeholderInfo.dataModels.groupedModel;\n // Set the selection object\n context.selection(placeholderInfo.selection);\n\n // Create retinal axes\n resolver.createRetinalAxes(placeholderInfo.dataModels.parentModel.getFieldsConfig(), retinalConfig,\n encoders);\n\n // Domains are evaluated for each of the axes for commonality\n resolver.setDomains(matrixConfig, placeholderInfo.dataModels, encoders);\n\n // Create matrix instances\n setMatrixInstances(context, placeholderInfo);\n\n // Prepare corner matrices\n context.cornerMatrices(resolver.createHeaders(placeholderInfo, fields, config));\n\n // Set placeholder information\n context.placeholderInfo(placeholderInfo);\n\n context._composition.axes = resolver.axes();\n context.metaData({\n border: getBorders(placeholderInfo, encoders.simpleEncoder)\n });\n\n resolver.encoder().unionUnitDomains(context);\n\n registerDomainChangeListener(context);\n return context;\n};\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\n\nimport { STATE_NAMESPACES } from 'muze-utils';\n\nexport const setupChangeListeners = (context) => {\n const store = context.store();\n const stores = {\n throwback: context._dependencies.throwback,\n store\n };\n\n ['x', 'y'].forEach((axisType) => {\n store.registerChangeListener([`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${axisType}`], () => {\n const groupAxes = context.resolver().axes();\n groupAxes[axisType].forEach(axes => axes.forEach((axis) => {\n axis.render();\n }));\n });\n });\n\n [VisualUnit, BaseLayer].forEach((comp) => {\n const formalName = comp.formalName();\n ['store', 'throwback'].forEach((type) => {\n const listeners = comp.getListeners()[type];\n const storeInst = stores[type];\n listeners.forEach((listenerInf) => {\n storeInst[listenerInf.type](listenerInf.props, listenerInf.listener, false, {\n namespace: formalName,\n subNamespace: listenerInf.subNamespace\n });\n });\n });\n });\n};\n\nexport const registerDomainChangeListener = (context) => {\n const store = context.store();\n store.registerChangeListener([`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`], () => {\n context.resolver().encoder().unionUnitDomains(context);\n }, false, {\n key: 'unionDomain'\n });\n};\n\nexport const unsubscribeChangeListeners = (context) => {\n context.store().unsubscribe({\n key: 'unionDomain'\n });\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\nexport const PROPS = {\n alias: {},\n data: {},\n cornerMatrices: {\n defaultValue: {\n topLeft: [],\n topRight: [],\n bottomLeft: [],\n bottomRight: []\n }\n },\n groupType: {},\n\n metaData: {\n defaultValue: {\n border: {}\n }\n },\n placeholderInfo: {\n defaultValue: {}\n },\n resolver: {},\n valueParser: {\n defaultValue: val => val\n },\n registry: {\n sanitization: (context, value) => {\n if (context.resolver) {\n context.resolver().registry(value.cellRegistry);\n }\n return value;\n }\n },\n selection: {},\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { generateGetterSetters } from 'muze-utils';\nimport localOptions from './local-options';\nimport { SimpleGroup } from '../simple-group';\nimport {\n MatrixResolver,\n findInGroup\n} from '../group-helper';\nimport { createUnitState, initializeGlobalState, setMatrixInstances, createMatrices, createLayerState } from './helper';\nimport { setupChangeListeners } from './change-listener';\nimport { PROPS } from './props';\nimport {\n CONFIG,\n MOUNT,\n RETINAL,\n Y\n} from '../enums/constants';\n\n/**\n * VisualGroup is instantiated by canvas for creating {@link VisualUnit} and axes instances.It creates the\n * the matrix of visual units and axes. It also creates the layout instance which manages the allocation\n * of space of matrices.\n *\n * To get instance of visual group,\n * ```\n * const visualGroup = canvas.composition().visualGroup;\n * ```\n * @public\n *\n * @class VisualGroup\n */\nclass VisualGroup extends SimpleGroup {\n\n /**\n * Creates an instance of VisualGroup. Requires dependencies and other registry options for placeholders\n * and layers that create individual units.\n *\n * @param {Object} registry Key value pair of compostions for the group\n * @param {Object} dependencies Dependencies needed to run the group\n * @memberof VisualGroup\n */\n constructor (registry, dependencies) {\n super();\n\n const {\n componentSubRegistry\n } = registry;\n\n this._dependencies = dependencies;\n // Generate getter/setter methods for all properties of the class\n // One can get each property by calling the method and can set it\n // by passing paramaters for the same. Thus, one can chain setter\n // getter methods.\n generateGetterSetters(this, PROPS);\n generateGetterSetters(this, localOptions);\n // Populate the store with default values\n // initialize group compositions\n this._composition = {};\n // store reference to data\n this._data = [];\n // store reference to mountpoint\n this._mount = null;\n // selection object that takes care of updating of components\n this._selection = {};\n // Create instance of matrix resolver\n this.resolver(new MatrixResolver(this._dependencies));\n // matrix instance store each of the matrices\n setMatrixInstances(this, {});\n // Getting indiviual registered items\n this.registry({\n layerRegistry: componentSubRegistry.layerRegistry.get(),\n cellRegistry: componentSubRegistry.cellRegistry.get()\n });\n }\n\n static getState () {\n return [{\n domain: {\n x: null,\n y: null,\n radius: null,\n angle: null,\n angle0: null\n }\n }, {}];\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n initializeGlobalState(this);\n createUnitState(this);\n createLayerState(this);\n // Register listeners\n setupChangeListeners(this);\n return this;\n }\n return this._store;\n }\n\n /**\n * Return the instances of matrices created by the visual group.\n *\n * @return {Object} Instance of matrices.\n */\n matrixInstance (...matrices) {\n if (matrices.length) {\n return this;\n }\n return this.composition().matrices;\n }\n\n /**\n * Returns the composition of visual group.\n *\n * @public\n *\n * @return {Object} Composition of visual group. It contains instance of matrices {@link ValueMatrix}\n * and instances of axis.\n * ```\n * {\n * matrices: {\n * value: // Instance of center value matrix.\n * left: // Instance of left value matrix\n * right: // Instance of right value matrix\n * bottom: // Instance of bottom value matrix\n * top: // Instance of top value matrix.\n * },\n * axes: {\n * x: // Array of x axis.\n * y: // Array of y axis\n * color: // Array of color axis\n * shape: // Array of shape axis\n * size: // Array of size axis.\n * }\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n /**\n * Locks the model to prevent change listeners to be triggered until unlocked\n *\n * @return {Object} Instance of class VisualGroup\n * @memberof VisualGroup\n */\n lockModel () {\n this.store().model.lock();\n return this;\n }\n\n /**\n * Unlocks the model so that all change listeners can be triggered\n *\n * @return {Object} Instance of class VisualGroup\n */\n unlockModel () {\n this.store().model.unlock();\n return this;\n }\n\n /**\n * Returns the channel name of the variable. Channels are rows, columns, color, shape and size.\n *\n * @public\n * @param {string} variable Name of the variable.\n *\n * @return {string} Name of the channel.\n */\n where (variable) {\n return findInGroup(variable, this.resolver().getAllFields());\n }\n\n /**\n * Gets the axis instances of the visual group based on the given axis type.\n *\n * @public\n * @param {string} type Type of axis. X,Y or retinal axes.\n *\n * @return {Array} Array of axis instances.\n */\n getAxes (type) {\n if (type === RETINAL) {\n return this.resolver().getRetinalAxes();\n }\n return this.resolver().getSimpleAxes(type);\n }\n\n /**\n * Returns the instances of cells based on the given type. Type can be given as `row' or `col`.\n *\n * @public\n * @return {Array} Two dimensional array of cells.\n */\n getCells (type) {\n return this.resolver()[`${type}Cells`]();\n }\n\n getFieldsFromChannel (channel) {\n const {\n rowProjections,\n colProjections\n } = this.resolver().getAllFields();\n return channel === Y ? rowProjections : colProjections;\n }\n\n getCellsByFacetKey (facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey] || [];\n return cells;\n }\n\n getAxesByFacetKey (axisType, facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey];\n const axes = cells[0].valueOf().axes()[axisType] || [];\n\n return axes;\n }\n\n /**\n * This method is used to return a serialized representation of the instance's properties.\n *\n * @return {Object} Object with config proprties.\n * @memberof VisualGroup\n */\n serialize () {\n const store = this.store();\n\n return {\n [CONFIG]: store.get(CONFIG),\n [MOUNT]: store.get(MOUNT)\n };\n }\n\n /**\n * Returns the grouped datamodel prepared by visual group. If there is no group by performed, then it returns the\n * original data model passed to visual group.\n *\n * @return {DataModel} Grouped data model.\n */\n getGroupByData () {\n return this._groupedDataModel;\n }\n\n createMatrices () {\n createMatrices(this);\n }\n\n remove () {\n this.matrixInstance().value.clear();\n this.resolver().clear();\n const info = this.placeholderInfo();\n info.rows = null;\n info.columns = null;\n info.values = null;\n }\n}\n\nexport default VisualGroup;\n","import { PersistentBehaviour, SELECTION } from '@chartshq/muze-firebolt';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return 'select';\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingRemoveSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_OLD_EXIT\n || selectionSet._set[d] === SELECTION.SELECTION_NEW_EXIT);\n // existing add set\n if (existingRemoveSet.length) {\n selectionSet.updateEntry();\n selectionSet.add(existingRemoveSet);\n } else {\n selectionSet.updateExit();\n selectionSet.remove(addSet);\n }\n const { exitSet } = selectionSet.getSets();\n const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])];\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n return this;\n }\n}\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nconst CLASSPREFIX = 'muze';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n target: `.${CLASSPREFIX}-gradient-rect`,\n behaviours: [BEHAVIOURS.BRUSH]\n },\n [ACTIONS.HOVER]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.CLICK]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.SELECT]\n }\n};\n\nexport const propagationBehaviourMap = {\n [BEHAVIOURS.SELECT]: BEHAVIOURS.FILTER,\n [BEHAVIOURS.BRUSH]: BEHAVIOURS.HIGHLIGHT\n};\n","import * as BEHAVIOURS from '../enums/behaviours';\nimport * as sideEffects from '../enums/side-effects';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: [sideEffects.SELECTIONBOX, {\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [sideEffects.Highlighter],\n select: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }]\n};\n\nexport const propagationSideEffects = {\n [BEHAVIOURS.BRUSH]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: ['filter']\n};\n\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n\n","export const SELECTIONBOX = 'selectionBox';\nexport const Highlighter = 'highlighter';\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const CONFIG = 'config';\nexport const DATAMODEL = 'dataModel';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const MAXWIDTH = 'max-width';\nexport const HEIGHT = 'height';\nexport const MOUNTPOINT = 'mountPoint';\nexport const GRIDLINEPARENTGROUPCLASS = 'grid-lines';\nexport const TRANSFORM = 'transform';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const DEFAULTCOLOR = '#F44336';\nexport const DEFAULTSIZE = 50;\nexport const DEFAULTSHAPE = 'circle';\nexport const STEP = 'step';\nexport const GRADIENT = 'gradient';\nexport const ORDINAL = 'ordinal';\nexport const SCALE_FUNCTIONS = {\n size: 'getSize',\n shape: 'getShape',\n color: 'getColor'\n};\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const HORIZONTAL = 'horizontal';\nexport const VERTICAL = 'vertical';\nexport const CENTER = 'center';\nexport const VALUE = 'value';\nexport const PATH = 'path';\nexport const SHAPE = 'shape';\nexport const ICON = 'icon';\nexport const RECT = 'rect';\nexport const START = 'start';\nexport const UPPER = 'upper';\nexport const LOWER = 'lower';\nexport const END = 'end';\nexport const SIZE = 'size';\nexport const DISCRETE = 'discrete';\nexport const MEASURE = 'measure';\n\n","import { assembleModelFromIdentifiers, getDataModelFromRange } from 'muze-utils';\nimport { propagationBehaviourMap } from './action-behaviour-map';\nimport { propagationSideEffects } from './behaviour-effect-map';\nimport { STEP, GRADIENT, DISCRETE, MEASURE } from '../enums/constants';\n\nexport const propagate = (firebolt, action, selectionSet, config = {}) => {\n let propagationData;\n const context = firebolt.context;\n const type = context.constructor.type();\n const payload = config.payload;\n const data = context.data();\n const metaData = context.metaData();\n const fieldType = metaData.getData().schema[0].type;\n\n const propPayload = {};\n const sourceId = context._id;\n propPayload.action = propagationBehaviourMap[action] || action;\n propPayload.sideEffects = propagationSideEffects[action];\n propPayload.sourceCanvas = context.canvasAlias();\n const isMutableAction = firebolt._actions.behavioural[propPayload.action].constructor.mutates();\n if (payload.criteria === null) {\n propagationData = null;\n } else {\n const entrySet = selectionSet.mergedEnter;\n let values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.rawVal);\n if (type === STEP || (type === DISCRETE && fieldType === MEASURE)) {\n const field = Object.keys(payload.criteria || {})[0];\n values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.range);\n propagationData = values.length ? metaData.select((fields) => {\n let check = false;\n for (let i = 0; i < values.length; i++) {\n check = fields[field].internalValue >= values[i][0] && fields[field].internalValue <= values[i][1];\n if (check === true) {\n break;\n }\n }\n return check;\n }, {\n saveChild: false\n }) : null;\n } else if (type === GRADIENT) {\n propagationData = getDataModelFromRange(metaData, payload.criteria);\n } else if (values.length) {\n propagationData = assembleModelFromIdentifiers(metaData, [payload.criteria[0], ...values.map(d => [d])]);\n } else {\n propPayload.criteria = null;\n propagationData = metaData.select(() => true, {\n saveChild: false\n });\n }\n }\n\n let propagateInterpolatedValues = false;\n\n if (propagationData) {\n const schema = propagationData.getSchema();\n propagateInterpolatedValues = schema.every(d => d.type === MEASURE);\n }\n\n const propConfig = {\n sourceId: `legend-${sourceId}`,\n payload: propPayload,\n criteria: propPayload.criteria === null ? null : propagationData,\n isMutableAction,\n propagateInterpolatedValues,\n action: propPayload.action\n };\n\n metaData.propagate(propagationData, propConfig, true);\n};\n","import { Firebolt } from '@chartshq/muze-firebolt';\nimport { propagate } from './helper';\nimport { STEP, GRADIENT } from '../enums/constants';\n\n/**\n * This class manages the interactions of legend.\n * @export\n * @class LegendFireBolt\n * @extends {Firebolt}\n */\nexport class LegendFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.initializeSideEffects();\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet[0];\n }\n\n propagate (behaviourName, payload, selectionSet) {\n propagate(this, behaviourName, selectionSet, {\n payload\n });\n }\n\n getAddSetFromCriteria (criteria) {\n let values;\n let uniqueIds;\n const type = this.context.constructor.type();\n\n if (criteria === null) {\n uniqueIds = null;\n } else if (type === STEP) {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n } else if (type === GRADIENT) {\n uniqueIds = [];\n } else {\n values = criteria[1];\n if (values) {\n uniqueIds = this.context.data().filter(d => values.indexOf(d.rawVal) !== -1).map(d => d.id);\n } else {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n }\n }\n return {\n uids: uniqueIds,\n model: null\n };\n }\n\n getFullData () {\n return null;\n }\n}\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\n/**\n * Adds dragging action to the target element.\n * @param {firebolt} firebolt firebolt\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let endPos = {};\n let payload;\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const boundingBox = context.measurement().gradientDimensions;\n const axisType = context.config().align === 'horizontal' ? 'x' : 'y';\n const axisScale = context.axis().source().scale();\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n }).on('drag', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }).on('end', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n if (startPos[axisType] === endPos[axisType]) {\n payload = {\n criteria: {}\n };\n } else {\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n }\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }));\n};\n\nexport default drag;\n","import { getEvent } from 'muze-utils';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} Firebolt instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n const event = getEvent();\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, {\n criteria: null\n }));\n event.stopPropagation();\n });\n};\n\nexport default hover;\n","/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nconst click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\n\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport click from './click';\nimport * as ACTIONNAMES from '../../enums/actions';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click\n};\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\n","import {\n getMousePos,\n getEvent,\n getD3Drag\n } from 'muze-utils';\nimport { HEIGHT, WIDTH, HORIZONTAL } from '../../enums/constants';\n\nconst getSelectionCriteria = (subject, axis, measures) => {\n let criteria = [];\n const {\n axisScale,\n axisType\n } = axis;\n const {\n startPos,\n endPos,\n selectionBoxMeasure,\n drawingInfMeasure,\n offset\n } = measures;\n const subjectStartPoint = subject[axisType];\n\n if (startPos[axisType] === endPos[axisType]) {\n criteria = [];\n } else if (subjectStartPoint + selectionBoxMeasure >= drawingInfMeasure + offset) {\n criteria = [axisScale.invert(drawingInfMeasure + offset - selectionBoxMeasure),\n axisScale.invert(drawingInfMeasure + offset)];\n } else if (subjectStartPoint - offset < offset) {\n criteria = [axisScale.invert(offset * 2), axisScale.invert(selectionBoxMeasure + offset * 2)];\n } else {\n criteria = [axisScale.invert(subjectStartPoint), axisScale.invert(subjectStartPoint + selectionBoxMeasure)];\n }\n axisType === 'x' ? criteria : criteria.reverse();\n return criteria;\n};\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let payload;\n const endPos = {};\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const axisScale = context.axis().source().scale();\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n const drawingInfMeasure = context.measurement().gradientDimensions[axisType === 'x' ?\n WIDTH : HEIGHT];\n const offset = axisScale.range()[axisType === 'x' ? 0 : 1];\n const measures = {\n drawingInfMeasure,\n offset\n };\n let subject = {};\n\n targetEl.call(d3Drag().on('start', function () {\n const event = getEvent();\n startPos = getMousePos(this, event.sourceEvent);\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n\n subject.x += event.dx;\n subject.y += event.dy;\n\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(subject, { axisScale, axisType }, measures);\n\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }).on('end', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(event, { axisScale, axisType }, measures);\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true,\n config: {\n transition: {\n duration: 200\n }\n }\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }));\n};\n\n","import { makeElement } from 'muze-utils';\nimport { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { CLASSPREFIX, HEIGHT, WIDTH, HORIZONTAL, RECT } from '../../../enums/constants';\nimport { SELECTIONBOX } from '../../../enums/side-effects';\nimport { selectionBoxDrag } from '../../physical/selection-box-drag';\nimport './styles.scss';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\n/* istanbul ignore next */ class SelectionBox extends SpawnableSideEffect {\n static formalName () {\n return SELECTIONBOX;\n }\n\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n className: 'legend-selection-box',\n classPrefix: CLASSPREFIX\n };\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n */\n /* istanbul ignore next */ apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const firebolt = this.firebolt;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n const className = `${config.classPrefix}-${config.className}`;\n\n const domain = payload.criteria[firebolt.context.fieldName()];\n const axisScale = axis.scale();\n const range = domain ? [axis.getScaleValue(domain[0]), axis.getScaleValue(domain[1])] : [];\n\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n\n const gradientDimension = firebolt.context.measurement().gradientDimensions[axisType === 'x' ?\n HEIGHT : WIDTH];\n\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n const legendGradContainer = context.getDrawingContext().svgContainer;\n const legendSelGroup = makeElement(legendGradContainer, 'g', [1], `${config.classPrefix}-selection-box-group`);\n\n if (firebolt.context.config().align === HORIZONTAL) {\n x = range[0] - rangeShifter || 0;\n y = 0;\n width = range[1] - range[0] || 0;\n height = gradientDimension;\n } else {\n x = 0;\n y = range[1] - rangeShifter || 0;\n height = range[0] - range[1] || 0;\n width = gradientDimension;\n }\n const enterFn = function (el) {\n selectionBoxDrag(firebolt)(el, ['brush']);\n };\n const selBox = makeElement(legendSelGroup, RECT, [{ domain, x, y, width, height }], className,\n { enter: enterFn });\n selBox.attr('y', y)\n .attr('x', x)\n .attr(WIDTH, width)\n .attr(HEIGHT, height);\n }\n}\n\nexport default SelectionBox;\n\n","import { selectElement } from 'muze-utils';\n\nexport const strategies = (firebolt) => {\n const context = firebolt.context;\n const classed = (set, className, change) => {\n const classPrefix = context.config().classPrefix;\n selectElement(context.mount())\n .selectAll(`.${classPrefix}-legend-columns`)\n .filter(d => set.uids.indexOf(d.id) !== -1)\n .selectAll('div')\n .classed(className, change);\n };\n\n return {\n fade: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-fadeout`, false);\n } else {\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-fadeout`, true);\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-fadeout`, false);\n }\n },\n brighten: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-brighten`, false);\n } else {\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-brighten`, true);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n }\n }\n };\n};\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { strategies } from './strategies';\nimport { Highlighter } from '../../../enums/side-effects';\n\nexport default class LegendHighlighter extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._strategies = strategies(this.firebolt);\n this._strategy = 'brighten';\n }\n\n static formalName () {\n return Highlighter;\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this);\n }\n}\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n data: {},\n fieldName: {},\n legendContainer: {},\n measurement: {\n sanitization: (context, value) => {\n const measurement = mergeRecursive(context._measurement, value);\n ['padding', 'border', 'margin'].forEach((space) => {\n measurement[space] = Math.min(measurement[space] > 0 ? measurement[space] : 0,\n measurement.maxWidth * 0.1, measurement.maxHeight * 0.1);\n });\n return measurement;\n }\n },\n logicalSpace: {},\n metaData: {},\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.resetLogicalSpace();\n context.store().commit('range', value);\n return value;\n }\n },\n scale: {},\n smartTicks: {},\n store: {},\n title: {\n sanitization: (context, value) => mergeRecursive(context._title || {}, value)\n },\n labelManager: {},\n minTickDistance: {},\n valueParser: {\n defaultValue: val => val\n }\n};\n","import { getSymbol } from 'muze-utils';\nimport {\n CENTER,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\nexport const ALIGN = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical'\n};\n\nexport const DEFAULT_MEASUREMENT = {\n height: 30,\n width: 30,\n maxWidth: Infinity,\n maxHeight: Infinity,\n padding: 2,\n margin: 2,\n border: 1\n};\n\nexport const LEGEND_TITLE = {\n text: '',\n orientation: (pos) => {\n if (pos === LEFT || pos === RIGHT) {\n return LEFT;\n } return CENTER;\n }\n};\n\nexport const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n borderStyle: 'solid',\n borderColor: 'rgba(0,0,0,0)',\n formatter: {\n bounds: {\n lower: 'less than',\n upper: 'more than'\n }\n },\n item: {\n text: {\n orientation: 'right',\n width: 10,\n formatter: (val, i, data, context) => context.valueParser()(val)\n },\n icon: {\n className: 'legend-icon',\n height: 20,\n width: 20,\n color: 'rgba(0,0,0,.5)',\n type: 'square'\n }\n }\n};\n\n/**\n * Creates a map of pre defined icons\n *\n * @param {string} icon Accepts a icon name like 'square', 'cross', 'diamond' etc\n * @return {Object} icon object which can be used to draw the icons\n */\nexport const ICON_MAP = (icon) => {\n if (icon && typeof (icon) === 'string') {\n return getSymbol(icon);\n } return icon;\n};\n","import { makeElement, numberInterpolator } from 'muze-utils';\n\nimport {\n SCALE_FUNCTIONS,\n WIDTH,\n HEIGHT,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n MAXWIDTH\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} scale\n *\n */\nexport const getScaleInfo = (scale) => {\n const scaleType = scale.constructor.type();\n const domain = scale.uniqueValues();\n const steps = scale.config().stops || 1;\n const scaleFn = SCALE_FUNCTIONS[scaleType];\n\n return { scaleType, domain, steps, scaleFn };\n};\n\n/**\n * Function to recompute the stops in array in case to left and right alignment of legend.\n *\n * @param {string} param - parameter to measure\n * @param {Object} requiredMeasure - required measure parameters\n * @param {Object} availableMeasure - available meassure parameters\n * @param {Array} domainForLegend - array\n * @param {Object} smartLabelCalc - smartLabel Manager\n * @return {Array} - Array\n */\nconst getcomputedArray = (computationhelper, requiredMeasure, availableMeasure, domainForLegend) => {\n // declaring Current and Next Tick Value variable\n let currentTickValue;\n let nextTickValue;\n const upperBound = domainForLegend[domainForLegend.length - 1];\n const param = computationhelper.measureParam;\n const smartLabelCalc = computationhelper.smartLabelCalc;\n\n // calculating pixel required per Tick Values\n const pixelPerTick = (availableMeasure[param] / upperBound);\n\n // checking if available max width is smaller than required width for legend.\n if (availableMeasure[param] >= requiredMeasure[param]) {\n return domainForLegend;\n }\n\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[0]))[param]);\n for (let i = 1; i < domainForLegend.length - 1; i++) {\n nextTickValue = Math.floor((currentTickValue / pixelPerTick) + domainForLegend[i - 1]);\n if (domainForLegend[i] < nextTickValue) {\n domainForLegend.splice(i, 1);\n i -= 1;\n }\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[i]))[param]);\n }\n return domainForLegend;\n};\n\n/**\n * function to recompute the Stops Array provided to prevent the Overlapping of values\n * @param {Array} domainForLegend - Stops Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - modified Stops Array\n */\nexport const getInterpolatedArrayData = (domainForLegend, scaleParams) => {\n // defining param for height/width selector\n let measureParam;\n\n // declaring variable for required Width\n let requiredWidth;\n\n // declaring variable for required height\n let requiredHeight;\n\n // declaring the variable for upperbound\n let upperBound = domainForLegend[domainForLegend.length - 1];\n\n // Initializing Minimum Tick Difference Variable and checking if it's less than 1 or not\n let minTickDiff = Math.ceil(domainForLegend[1] - domainForLegend[0]);\n\n // calculating max tick difference\n const maxTickDiff = Math.ceil(upperBound - domainForLegend[0]);\n\n // gradient Alignment\n const { alignment } = scaleParams;\n\n // getting SmartLabel Manager to calculate tick Params\n const smartLabelCalc = scaleParams.smartLabel;\n\n // scale Measurements (i.e MaxWidth and MaxHeight available)\n const availableSpace = scaleParams.measures;\n\n // getting minimum Tick size (i.e height and width)\n const minimumTickSize = scaleParams.minTickDistance;\n\n // getting domain upperbound dimensions\n const { height: tickDimHeight, width: tickDimWidth } = smartLabelCalc.getOriSize((upperBound));\n\n /* Checking if UpperBound of Domain is Floating or Not.\n In case of floating constricting it to 2 decimals after point. */\n if (!Number.isInteger(upperBound)) {\n upperBound = ((upperBound).toFixed(2));\n }\n\n // Calculating minimum tick difference\n minTickDiff = minTickDiff < 1 ? 1 : minTickDiff;\n\n // required width to render legend\n requiredWidth = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * (tickDimWidth + (minimumTickSize.width));\n\n requiredWidth -= Math.abs(maxTickDiff);\n\n // require height to render legend\n requiredHeight = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * tickDimHeight;\n\n requiredHeight -= Math.abs(maxTickDiff);\n\n // checking the alignment of legend\n if (alignment === TOP || alignment === BOTTOM) {\n measureParam = WIDTH;\n } else {\n measureParam = HEIGHT;\n }\n\n // calculating computed array\n domainForLegend = getcomputedArray({\n smartLabelCalc,\n measureParam\n }, {\n height: requiredHeight,\n width: requiredWidth\n }, {\n height: availableSpace.maxHeight,\n width: availableSpace.maxWidth\n }, domainForLegend);\n\n return domainForLegend;\n};\n\n/**\n * function to recalculate steps on providing more number of stops than canvas can accomodate.\n * @param {Array} domain - Array\n * @param {Array} steps - Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - recalculated Step Array\n */\nexport const getInterpolatedData = (domain, steps, scaleParams) => {\n // declaring recomputeSteps Variable\n let recomputeSteps = 0;\n\n const getTickMeasure = scaleParams.smartLabel;\n const { maxWidth, maxHeight } = scaleParams.measures;\n const { alignment } = scaleParams;\n const domainForLegend = [];\n const interpolatedFn = numberInterpolator()(domain[0], domain[1]);\n\n // getting tick measure(i.e height and width)\n const tickValue = getTickMeasure.getOriSize(domain[1].toFixed(2));\n\n // To round the floating values to Integer and checking if value is 1.\n steps = Math.round(steps);\n steps = steps < 1 ? (steps + 1) : steps;\n\n // checking alignment of the Axis\n if (alignment === TOP || alignment === BOTTOM) {\n recomputeSteps = Math.floor(maxWidth / (tickValue.width));\n } else {\n recomputeSteps = Math.floor(maxHeight / (tickValue.height));\n }\n steps = Math.min(steps, recomputeSteps);\n\n // scaling the axis based on steps provided\n for (let i = 0; i <= steps; i++) {\n domainForLegend[i] = interpolatedFn(i / steps);\n }\n return domainForLegend;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} text\n * @param {*} measurement\n * @param {*} classPrefix\n */\nexport const titleCreator = (container, title, measurement, config) => {\n const titleWidth = Math.min(measurement.maxWidth, measurement.width);\n\n const titleContainer = makeElement(container, 'table', [1], `${config.classPrefix}-legend-title`)\n .style(WIDTH, `${titleWidth}px`)\n .style(HEIGHT, `${measurement.height}px`)\n .style('border-bottom', `${measurement.border}px ${config.borderStyle} ${config.borderColor}`)\n .style('text-align', title.orientation instanceof Function ?\n title.orientation(config.position) : title.orientation);\n return makeElement(titleContainer, 'td', [1], `${config.classPrefix}-legend-title-text`)\n .style(WIDTH, `${titleWidth}px`)\n .style(MAXWIDTH, `${titleWidth}px`)\n .style(HEIGHT, '100%')\n .style('line-height', 1)\n .style('padding', `${measurement.padding}px`)\n .text(title.text)\n .style('overflow-x', 'scroll')\n .node();\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getMaxMeasures = (data, prop, labelManager) => {\n let maxHeight = -Infinity;\n let maxWidth = -Infinity;\n\n data.forEach((item) => {\n const value = prop ? item[prop] : item;\n const space = labelManager.getOriSize(value);\n maxHeight = Math.max(space.height + 2, maxHeight);\n maxWidth = Math.max(space.width + 2, maxWidth);\n });\n\n return { height: maxHeight, width: maxWidth };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getItemMeasures = (context, prop, formatter) => {\n const space = [];\n const data = context.data();\n const labelManager = context._labelManager;\n\n data.forEach((item, index) => {\n const value = prop ? item[prop] : item;\n const { height, width } = labelManager.getOriSize(formatter(value, index, data, context));\n space[index] = { height: height + 1, width: width + 1 };\n });\n return space;\n};\n\n/**\n *\n *\n * @param {*} textOrientation\n * @param {*} effPadding\n * @param {*} titleSpace\n *\n * @memberof Legend\n */\nexport const computeItemSpaces = (config, measures, data) => {\n let totalHeight = 0;\n let totalWidth = 0;\n let maxItemSpaces = {\n width: 0, height: 0\n };\n const {\n effPadding,\n titleWidth,\n labelSpaces,\n titleHeight,\n maxWidth\n } = measures;\n const {\n item,\n align\n } = config;\n const {\n icon,\n text\n } = item;\n const textOrientation = text.orientation;\n const itemSpaces = [];\n const iconSpaces = [];\n let maxIconWidth = 0;\n labelSpaces.forEach((labelSpace, i) => {\n const itemSpace = { width: 0, height: 0 };\n const iconSpace = { width: 0, height: 0 };\n const datum = data[i] || {};\n // Compute each legend item height/width\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n // Get label, icon and item widths\n labelSpace.width += effPadding;\n iconSpace.width = (datum.size ? 2 * Math.sqrt(datum.size / Math.PI) : icon.width) + effPadding;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n itemSpace.width = labelSpace.width + maxIconWidth;\n\n // Get label, icon and item heights\n labelSpace.height = Math.max(labelSpace.height, icon.height) + effPadding;\n iconSpace.height = labelSpace.height;\n itemSpace.height = labelSpace.height;\n } else {\n // Get label, icon and item widths\n labelSpace.width = Math.max(labelSpace.width, datum.size ? 2 * Math.sqrt(datum.size / Math.PI)\n : icon.width) + effPadding;\n iconSpace.width = labelSpace.width;\n itemSpace.width = labelSpace.width;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n\n // Get label, icon and item heights\n labelSpace.height += effPadding;\n iconSpace.height = icon.height + effPadding;\n itemSpace.height = labelSpace.height + iconSpace.height;\n }\n // Compute height and width of legend for each alignment\n if (align === 'horizontal') {\n totalHeight = Math.max(totalHeight, itemSpace.height);\n } else {\n totalHeight += itemSpace.height;\n totalWidth = Math.max(totalWidth, itemSpace.width, titleWidth);\n }\n maxItemSpaces = {\n width: Math.max(itemSpace.width, maxItemSpaces.width),\n height: Math.max(itemSpace.height, maxItemSpaces.height)\n };\n itemSpaces.push(itemSpace);\n iconSpaces.push(iconSpace);\n });\n itemSpaces.forEach((itemSpace, i) => {\n if (align === 'horizontal') {\n itemSpace.height = totalHeight;\n iconSpaces[i].width = maxIconWidth;\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n labelSpaces[i].height = totalHeight;\n iconSpaces[i].height = totalHeight;\n itemSpaces[i].width = labelSpaces[i].width + maxIconWidth;\n } else {\n labelSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = maxIconWidth;\n labelSpaces[i].width = maxIconWidth;\n }\n totalWidth = Math.max(totalWidth + itemSpaces[i].width);\n } else {\n itemSpace.width = Math.max(totalWidth, maxWidth);\n if (textOrientation === TOP || textOrientation === BOTTOM) {\n labelSpaces[i].width = totalWidth;\n iconSpaces[i].width = totalWidth;\n maxIconWidth = totalWidth;\n } else {\n const labelWidth = labelSpaces[i].width;\n const newLabelWidth = (maxItemSpaces.width - maxIconWidth);\n iconSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = labelSpaces[i].width + maxIconWidth;\n labelSpaces[i].width = Math.max(labelWidth, newLabelWidth);\n totalWidth = Math.max(totalWidth, itemSpace.width);\n }\n }\n });\n totalWidth = Math.ceil(Math.max(totalWidth, titleWidth)) + effPadding;\n totalHeight += titleHeight + effPadding;\n totalHeight = Math.ceil(totalHeight);\n return { totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth };\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} scaleInfo\n * @param {*} domainInfo\n *\n */\nexport const getDomainBounds = (type, scaleInfo, domainInfo) => {\n const {\n scaleFn,\n scaleType,\n scale\n } = scaleInfo;\n const {\n domain,\n domainBounds,\n domainLeg,\n steps\n } = domainInfo;\n const ele = domain[type === 'lower' ? 0 : domain.length - 1];\n const step = steps[type === 'lower' ? 0 : steps.length - 1];\n\n return {\n [scaleType]: scaleType === 'size' ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value: domainBounds[type],\n id: type === 'lower' ? 0 : domainLeg.length + 2,\n range: [ele, step]\n };\n};\n","import {\n makeElement,\n selectElement,\n getUniqueId,\n getSmartComputedStyle,\n generateGetterSetters,\n mergeRecursive\n} from 'muze-utils';\nimport { behaviouralActions } from '@chartshq/muze-firebolt';\nimport * as legendBehaviours from '../firebolt/behavioural';\n\nimport { LegendFireBolt } from '../firebolt/legend-firebolt';\nimport { actionBehaviourMap } from '../firebolt/action-behaviour-map';\nimport { physicalActions } from '../firebolt/physical';\nimport * as sideEffects from '../firebolt/side-effects';\nimport { behaviourEffectMap } from '../firebolt/behaviour-effect-map';\nimport { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM } from '../enums/constants';\nimport { PROPS } from './props';\nimport { DEFAULT_MEASUREMENT, DEFAULT_CONFIG, LEGEND_TITLE } from './defaults';\nimport { getItemMeasures, titleCreator, computeItemSpaces } from './legend-helper';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class SimpleLegend\n */\nexport default class SimpleLegend {\n\n /**\n * Creates an instance of Legend.\n * @param {Object} dependencies Set of dependencies required by the legend\n * @memberof Legend\n */\n constructor (dependencies) {\n this._data = [];\n this._metaData = [];\n this._mount = null;\n this._fieldName = null;\n this._title = Object.assign({}, LEGEND_TITLE);\n this._metaData = null;\n this._labelManager = dependencies.labelManager;\n this._cells = dependencies.cells;\n this._id = getUniqueId();\n this._measurement = Object.assign({}, this.constructor.defaultMeasurement());\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n\n const dist = dependencies.labelManager.getOriSize('w');\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n\n generateGetterSetters(this, PROPS);\n this._computedStyle = getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-item-info`);\n\n this._firebolt = new LegendFireBolt(this, {\n behavioural: Object.assign({}, behaviouralActions, legendBehaviours),\n physical: physicalActions,\n physicalBehaviouralMap: actionBehaviourMap\n }, sideEffects, behaviourEffectMap);\n }\n\n id () {\n return this._id;\n }\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new SimpleLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENT;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleLegend\n */\n firebolt (...params) {\n if (params.length) {\n return this;\n }\n return this._firebolt;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return PATH;\n }\n\n canvasAlias (...alias) {\n if (alias.length) {\n this._canvasAlias = alias[0];\n return this;\n }\n return this._canvasAlias;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n mount (...params) {\n if (params.length) {\n this._mount = params[0];\n this.render();\n return this;\n }\n return this._mount;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n const {\n item,\n classPrefix\n } = this.config();\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${classPrefix}-legend-item-info`));\n return getItemMeasures(this, VALUE, item.text.formatter);\n }\n\n /**\n * Sets the height and width of a legend based on provided max\n * height and width and based on its contents\n *\n * @return {Instance} Current instance\n * @memberof Legend\n */\n setLegendMeasures () {\n const {\n width,\n height,\n maxWidth,\n maxHeight,\n padding,\n margin,\n border\n } = this.measurement();\n const {\n align\n } = this.config();\n\n // Effective padding, margin and padding\n const effPadding = padding * 2;\n const effBorder = border * 2;\n const effMargin = margin * 2;\n\n this.data(this.dataFromScale());\n // Get space occupied by title\n const titleSpace = this.getTitleSpace();\n const titleHeight = titleSpace.height > 0 ? titleSpace.height + effPadding : 0;\n const titleWidth = titleSpace.width + effPadding;\n\n // Get space occupied by labels\n const labelSpaces = this.getLabelSpaces(effPadding, align);\n const {\n totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth\n } = computeItemSpaces(this.config(),\n { effPadding, titleWidth, labelSpaces, titleHeight, maxWidth, maxHeight }, this.data());\n\n this.measurement({\n width: Math.max(totalWidth, width) + effMargin + effBorder,\n height: Math.max(totalHeight, height) + effMargin + effBorder,\n labelSpaces,\n iconSpaces,\n itemSpaces,\n maxItemSpaces,\n maxIconWidth,\n titleSpaces: {\n width: Math.min(maxWidth, this.measurement().width) - effMargin - effBorder,\n height: titleHeight\n }\n });\n return this;\n }\n\n /**\n * Returns the space occupied by the legend title\n *\n * @return {Object} Space occupied by title\n * @memberof Legend\n */\n getTitleSpace () {\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-title`));\n return this._labelManager.getOriSize(this.title().text ? this.title().text : '');\n }\n\n /**\n * Creates the title for the legend\n *\n * @param {DOM} container Container made for the title\n * @return {Selection} Title and it's node\n * @memberof Legend\n */\n renderTitle (container) {\n const { titleSpaces, border, padding, width, maxWidth } = this.measurement();\n const { borderStyle, borderColor } = this.config();\n return titleCreator(container, this.title(), {\n height: titleSpaces.height,\n width,\n maxWidth,\n border,\n padding,\n borderStyle,\n borderColor\n }, this.config());\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const {\n classPrefix,\n borderStyle,\n borderColor,\n position\n } = this.config();\n const {\n maxWidth,\n maxHeight,\n width,\n height,\n margin,\n border\n } = this.measurement();\n const legendContainer = makeElement(selectElement(this.mount()), 'div', [1], `${classPrefix}-legend-box`);\n let marginPosition;\n switch (position) {\n case TOP:\n marginPosition = `margin-${BOTTOM}`;\n break;\n case LEFT:\n marginPosition = `margin-${RIGHT}`;\n break;\n case BOTTOM:\n marginPosition = `margin-${TOP}`;\n break;\n default:\n marginPosition = `margin-${LEFT}`;\n }\n legendContainer.classed(`${classPrefix}-legend-box-${this._id}`, true);\n legendContainer.style('float', 'left');\n // set height and width\n legendContainer.style('width', `${Math.min(maxWidth, width) - margin * 2}px`)\n .style('height', `${Math.min(maxHeight, height) - margin * 2}px`)\n .style(`${marginPosition}`, `${margin}px`)\n .style('border', `${border}px ${borderStyle} ${borderColor}`);\n this.legendContainer(legendContainer.node());\n\n // create title\n this.renderTitle(legendContainer);\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n /**\n *\n *\n * @param {*} data\n *\n * @memberof StepLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n const type = this.metaData().getData().schema[0].type;\n if (type === 'measure') {\n return {\n [fieldName]: data.range\n };\n }\n return [[fieldName], [data.rawVal]];\n }\n}\n","import {\n LEFT,\n RIGHT,\n START,\n END,\n TOP,\n BOTTOM,\n HORIZONTAL,\n VERTICAL,\n CENTER,\n SHAPE,\n VALUE\n} from '../enums/constants';\n\nconst legendOrientation = {\n [HORIZONTAL]: {\n datasets: data => ({\n row: [1],\n column: data\n }),\n itemContainerMeasures: (measurement) => {\n const {\n itemSpaces,\n width\n } = measurement;\n return {\n row: {\n width: `${width}px`,\n padding: `${0}px`\n },\n column: {\n width: (d, i) => `${itemSpaces[i].width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, height } = measurement;\n return {\n iconHeight: height,\n iconWidth: maxItemSpaces.width,\n stepPadding: {\n horizontal: true,\n vertical: false\n }\n };\n }\n },\n [VERTICAL]: {\n datasets: data => ({\n row: data,\n column: d => [d]\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n width\n } = measurement;\n const { padding } = config;\n\n return {\n row: {\n width: `${width}px`,\n padding: `${padding}px`\n },\n column: {\n width: `${width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, width } = measurement;\n return {\n iconHeight: maxItemSpaces.height,\n iconWidth: width,\n stepPadding: {\n horizontal: false,\n vertical: true\n }\n };\n }\n }\n};\n\nexport const positionConfig = {\n [LEFT]: legendOrientation[VERTICAL],\n [RIGHT]: legendOrientation[VERTICAL],\n [TOP]: legendOrientation[HORIZONTAL],\n [BOTTOM]: legendOrientation[HORIZONTAL]\n};\n\nexport const alignmentMap = {\n [LEFT]: END,\n [RIGHT]: START,\n [TOP]: CENTER,\n [BOTTOM]: CENTER\n};\n\n// Reverses data for step legend\nexport const stepData = data => ({\n [LEFT]: data.reverse(),\n [RIGHT]: data.reverse(),\n [TOP]: data,\n [BOTTOM]: data\n});\n\n// Changes the item layout based on the position of the text\nexport const itemStack = {\n [LEFT]: [VALUE, SHAPE],\n [RIGHT]: [SHAPE, VALUE],\n [TOP]: [VALUE, SHAPE],\n [BOTTOM]: [SHAPE, VALUE]\n};\n","import { makeElement, selectElement, applyStyle } from 'muze-utils';\nimport { ICON_MAP } from './defaults';\nimport { positionConfig, alignmentMap, itemStack } from './position-config';\nimport {\n WIDTH,\n HEIGHT,\n CENTER,\n VALUE,\n RECT,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} legendInstance\n * @param {*} align\n *\n */\nexport const getItemContainers = (container, data, legendInstance) => {\n const measurement = legendInstance.measurement();\n const config = legendInstance.config();\n const {\n itemSpaces\n } = measurement;\n const {\n classPrefix,\n position\n } = config;\n const positionObj = positionConfig[position];\n const datasets = positionObj.datasets(data);\n const measures = positionObj.itemContainerMeasures(measurement, config);\n\n const rows = makeElement(container, 'div', datasets.row, `${classPrefix}-legend-row`);\n rows.style(HEIGHT, (d, i) => `${itemSpaces[i].height}px`);\n rows.style(WIDTH, measures.row.width);\n rows.style('padding', measures.row.padding);\n\n const columns = makeElement(rows, 'div', datasets.column, `${classPrefix}-legend-columns`);\n columns.style(WIDTH, measures.column.width);\n columns.style('padding', measures.column.padding);\n\n return columns;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} classPrefix\n * @param {*} data\n *\n * @memberof DiscreteLegend\n */\nexport const createLegendSkeleton = (context, container, classPrefix, data) => {\n let gradWidth = 0;\n let gradHeight = 0;\n let maxGradHeight = 0;\n let maxGradWidth = 0;\n const measurement = context.measurement();\n const {\n margin,\n border,\n titleSpaces,\n width,\n height,\n maxWidth,\n maxHeight\n } = measurement;\n\n gradHeight = height - (titleSpaces.height + 2 * margin + 2 * border);\n gradWidth = width - (margin * 2 + border * 2);\n\n maxGradHeight = maxHeight - (titleSpaces.height + margin * 2 + border * 2);\n maxGradWidth = maxWidth - (margin * 2 + border * 2);\n\n let legendBody = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n legendBody.select(`.${classPrefix}-legend-overflow`).remove();\n // Create a div with scroll when overflow\n if (maxGradWidth && maxGradWidth < gradWidth) {\n legendBody = legendBody.style(WIDTH, `${maxGradWidth}px`).style('overflow-x', 'scroll');\n }\n // Create a div with scroll when overflow\n if (maxGradHeight && maxGradHeight < gradHeight) {\n legendBody.style(HEIGHT, `${maxGradHeight}px`).style('overflow-y', 'scroll');\n }\n\n legendBody = makeElement(legendBody, 'div', [1], `${classPrefix}-legend-overflow`);\n\n legendBody.style(WIDTH, `${gradWidth}px`);\n legendBody.style(HEIGHT, `${gradHeight}px`);\n\n const legendItem = getItemContainers(legendBody, data, context);\n return { legendItem };\n};\n\n/**\n * Creates legend item based on alignment and text orientation\n *\n * @param {Selection} container Point where items are to be mounted\n * @return {Instance} Current instance\n * @memberof Legend\n */\nexport const createItemSkeleton = (context, container) => {\n const {\n classPrefix,\n item\n } = context.config();\n const textOrientation = item.text.orientation;\n\n const stack = itemStack[textOrientation];\n const itemSkeleton = makeElement(container, 'div', (d, i) => stack.map(e => [e, d[e], d.color, d.size,\n d.value, context.fieldName(), i]), `${classPrefix}-legend-item-info`);\n\n const alignClass = alignmentMap[textOrientation];\n\n itemSkeleton.classed(alignClass, true);\n return { itemSkeleton };\n};\n\n/**\n *\n *\n * @param {*} measureType\n * @param {*} stepColorCheck\n */\nexport const applyItemStyle = (item, measureType, stepColorCheck, context) => {\n const {\n padding,\n labelSpaces,\n iconSpaces,\n maxIconWidth\n } = context.measurement();\n const diff = stepColorCheck ? -padding * 2 : 0;\n\n if (item[0] === VALUE) {\n return `${labelSpaces[item[6]][measureType]}px`;\n }\n return `${measureType === 'width' && !stepColorCheck ? maxIconWidth : iconSpaces[item[6]][measureType] - diff}px`;\n};\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, elem, defaultIcon, width, height) {\n const groupElement = elem;\n // const { shape, size, update } = d;\n const size = d[3] || Math.min(width, height) * Math.PI;\n const shape = d[1] || defaultIcon;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n return createShape(d, elem);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n shapeElement.attr('transform', `scale(${size / 100})`);\n return selectElement(groupElement.node().appendChild(newShape));\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = ICON_MAP(shape).size(size)();\n }\n return makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n }\n d[1] = 'circle';\n return createShape(d, elem, 'circle');\n};\n\n/**\n * Returns the icon of the legend item\n *\n * @param {Object} datum Data property attached to the item\n * @param {number} width width of the item\n * @param {number} height height of the item\n * @return {Object|string} returns the path string or the string name of the icon\n * @memberof Legend\n */\nexport const getLegendIcon = (datum, width, height, defaultIcon) => {\n const icon = ICON_MAP(datum[1]);\n\n if (icon) {\n return icon.size(datum[3] || Math.min(width, height) * Math.PI);\n }\n return ICON_MAP(datum[3] ? 'circle' : defaultIcon).size(datum[3] || Math.min(width, height) * Math.PI);\n};\n\n/**\n *\n *\n */\nexport const renderIcon = (icon, container, datum, context) => {\n const {\n classPrefix,\n iconHeight,\n iconWidth,\n maxIconWidth,\n padding,\n color\n } = context;\n const svg = makeElement(container, 'svg', f => [f], `${classPrefix}-legend-icon-svg`)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .style(WIDTH, `${maxIconWidth}px`)\n .style(HEIGHT, `${iconHeight}px`);\n\n if (icon !== RECT) {\n const group = makeElement(svg, 'g', [datum[1]], `${classPrefix}-legend-icon`);\n createShape(datum, group, datum[3] ? 'circle' : 'square', iconWidth, iconHeight)\n .attr('transform', `translate(${maxIconWidth / 2 - padding} ${iconHeight / 2})`)\n .attr('fill', datum[2] || color);\n } else {\n makeElement(svg, RECT, [datum[1]], `${classPrefix}-legend-icon`)\n .attr('x', 0)\n .attr('y', 0)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .attr('fill', datum[2] || color);\n }\n};\n\n/**\n * Renders the items in the legend i.e, icon and text\n *\n * @param {DOM} container Point where item is to be mounted\n * @memberof Legend\n */\nexport const renderDiscreteItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n classPrefix\n } = context.config();\n const {\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width: iconWidth,\n height: iconHeight,\n color,\n className\n } = item.icon;\n\n const textOrientation = item.text.orientation;\n const formatter = item.text.formatter;\n\n labelManager.useEllipsesOnOverflow(true);\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, false, context),\n height: d => applyItemStyle(d, HEIGHT, false, context),\n 'text-align': CENTER,\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = container.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context))\n .style(`padding-${textOrientation === RIGHT ? LEFT : RIGHT}`, '0px');\n } else {\n // const icon = getLegendIcon(d, iconWidth, iconHeight, type);\n selectElement(this).classed(`${classPrefix}-${className}`, true);\n selectElement(this).classed(`${classPrefix}-${className}-${i}`, true);\n renderIcon('circle', selectElement(this), d, {\n classPrefix,\n iconWidth,\n // iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth,\n iconHeight,\n maxIconWidth,\n padding,\n color\n });\n }\n });\n};\n\n/**\n* Renders the items in the legend i.e, icon and text\n*\n* @param {DOM} container Point where item is to be mounted\n* @memberof Legend\n*/\nexport const renderStepItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n position,\n classPrefix\n } = context.config();\n const {\n maxItemSpaces,\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width,\n height,\n color\n } = item.icon;\n const {\n formatter\n } = item.text;\n\n labelManager.useEllipsesOnOverflow(true);\n const { iconHeight, iconWidth, stepPadding } = positionConfig[position].getStepSpacesInfo({\n maxItemSpaces, height, width\n });\n\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, stepPadding.horizontal, context),\n height: d => applyItemStyle(d, HEIGHT, stepPadding.vertical, context),\n 'text-align': 'center',\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = container.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context));\n } else {\n renderIcon(RECT, selectElement(this), d, {\n classPrefix,\n iconWidth,\n iconHeight,\n maxIconWidth,\n color\n });\n }\n });\n};\n","import {\n FieldType,\n DimensionSubtype,\n formatTemporal\n} from 'muze-utils';\nimport SimpleLegend from './simple-legend';\nimport { DISCRETE, LEFT, SIZE } from '../enums/constants';\nimport { getScaleInfo } from './legend-helper';\nimport { createLegendSkeleton, createItemSkeleton, renderDiscreteItem } from './renderer';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class DiscreteLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new DiscreteLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof DiscreteLegend\n */\n static type () {\n return DISCRETE;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof DiscreteLegend\n */\n dataFromScale () {\n const scale = this.scale();\n const { scaleType, domain, scaleFn } = getScaleInfo(scale);\n let domainForLegend = [...new Set(domain)];\n const field = this.metaData().getFieldspace().fields[0];\n const { type, subtype } = field.schema();\n\n domainForLegend = domainForLegend.map((ele, i) => {\n let value = 0;\n let range = 0;\n const rawVal = domainForLegend[i];\n if (type === FieldType.MEASURE) {\n value = (+domainForLegend[i]).toFixed(0);\n const nextVal = domainForLegend[i + 1] ? +domainForLegend[i + 1] : +value;\n range = [value, nextVal.toFixed(0)];\n } else {\n let domainVal = rawVal;\n if (subtype === DimensionSubtype.TEMPORAL) {\n domainVal = formatTemporal(domainForLegend[i], field.minimumConsecutiveDifference());\n }\n value = domainVal;\n range = [domainVal];\n }\n return {\n [scaleType]: scale[scaleFn](ele),\n value,\n id: i,\n range,\n rawVal\n };\n }).filter(d => d.value !== null);\n\n domainForLegend = scaleType === SIZE ? domainForLegend.sort((a, b) => a[scaleType] - b[scaleType])\n : domainForLegend;\n return domainForLegend;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const data = this.data();\n const { classPrefix } = this.config();\n const legendContainer = super.render(this.mount());\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n renderDiscreteItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n}\n","import { makeElement, applyStyle } from 'muze-utils';\nimport { ContinousAxis } from '@chartshq/muze-axis';\nimport { BOTTOM, RIGHT } from '../enums/constants';\nimport { ALIGN } from './defaults';\nimport '../styles.scss';\n\n/**\n *\n *\n * @param {*} data\n *\n */\nexport const getGradientDomain = (data) => {\n if (typeof data[0].value === 'number') {\n return data.reduce((accumulator, currentValue) =>\n [Math.min(currentValue.value, accumulator[0]), Math.max(currentValue.value, accumulator[1])],\n [Number.MAX_VALUE, Number.MIN_VALUE]);\n }\n return data.map(e => e.value);\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} domain\n *\n */\nexport const makeLinearGradient = (container, data, domain) => {\n const defs = makeElement(container, 'defs', [1]);\n const linearGradient = makeElement(defs, 'linearGradient', [1])\n .attr('id', 'linear-gradient')\n .attr('x1', '0%')\n .attr('y2', '0%');\n\n makeElement(linearGradient, 'stop', data, 'stop-gradient')\n .attr('offset', d => `${(d.value - domain[0]) * 100 / (domain[1] - domain[0]) || 1}%`)\n .attr('stop-color', d => d.color);\n return linearGradient;\n};\n\n/**\n * Creates an axis cell with a linear axis for computing space and\n * creating gradient legend\n *\n * @return {AxisCell} Instance of Axis Cell for the gradient axis\n * @memberof Legend\n */\nexport const createAxis = (context) => {\n const data = context.data();\n const { align } = context.config();\n const AxisCell = context._cells.AxisCell;\n const newAxis = new ContinousAxis({\n id: `legend-${context._id}`,\n orientation: align === ALIGN.VERTICAL ? RIGHT : BOTTOM,\n style: context._computedStyle,\n nice: false,\n showAxisName: false,\n tickValues: data.map(d => d.value),\n fixedBaseline: false,\n labels: {\n rotation: null\n }\n }, { labelManager: context._labelManager });\n\n newAxis.domain(getGradientDomain(data));\n newAxis.range([1, 1]);\n return new AxisCell().source(newAxis).config({\n margin: { left: 0, bottom: 0, top: 0, right: 0 }\n });\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} classPrefix\n *\n * @memberof GradientLegend\n */\nconst createLegendSkeleton = (container, classPrefix, data) => {\n const domain = getGradientDomain(data);\n const legendContainer = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n const legendGradSvg = makeElement(legendContainer, 'svg', [1], `${classPrefix}-gradient`);\n const legendGradCont = makeElement(legendGradSvg, 'g', [1], `${classPrefix}-gradient-group`);\n const linearGradient = makeLinearGradient(legendGradSvg, data, domain);\n const legendRect = makeElement(legendGradCont, 'rect', [1], `${classPrefix}-gradient-rect`);\n\n return {\n legendContainer,\n legendGradCont,\n legendGradSvg,\n linearGradient,\n legendRect\n };\n};\n\n/**\n * Renders the axis for the gradient\n *\n * @param {Selection} container Point where axis is to be mounted\n * @param {number} height Height for axis\n * @param {number} width Width for axis\n * @memberof Legend\n */\nexport const renderAxis = (context, container, height, width) => {\n const axis = context.axis();\n\n axis.setAvailableSpace(width, height);\n axis.render(container.node());\n axis.source().render();\n};\n\n/**\n * Renders gradient legends\n *\n * @param {Selection} container Point where the legend is to be appended\n * @memberof GradientLegend\n */\nexport const renderGradient = (context, container) => {\n let gradHeight = 0;\n let gradWidth = 0;\n const {\n align,\n classPrefix,\n item\n } = context.config();\n const data = context.data();\n // Create the skeleton for the legend\n const {\n legendContainer,\n legendGradSvg,\n legendGradCont,\n linearGradient,\n legendRect\n } = createLegendSkeleton(container, classPrefix, data);\n const labelDim = context.axis().source().getAxisDimensions().tickDimensions;\n const {\n padding,\n margin,\n border,\n titleSpaces,\n maxItemSpaces,\n maxHeight,\n maxWidth,\n height,\n width\n } = context.measurement();\n const gradientDimensions = {};\n\n gradHeight = Math.floor(Math.min(height, maxHeight) - (titleSpaces.height + 2 * margin + 2 * border));\n gradWidth = Math.floor(Math.min(width, maxWidth) - (margin * 2 + border * 2));\n\n if (align === ALIGN.HORIZONTAL) {\n gradientDimensions.height = item.icon.height;\n gradientDimensions.width = gradWidth - 2 * padding - labelDim.width / 2;\n linearGradient.attr('x2', '100%').attr('y1', '0%');\n legendGradCont.attr('transform', `translate( ${labelDim.width / 2} 0)`);\n renderAxis(context, legendContainer, gradHeight - item.icon.height - padding, gradWidth - 2 * padding - 1);\n\n applyStyle(legendContainer, {\n height: `${maxItemSpaces.height + border + padding}px`,\n width: `${Math.min(width, maxWidth)}px`,\n padding: `${padding}px`\n });\n\n legendRect.attr('height', gradientDimensions.height);\n legendRect.attr('width', gradientDimensions.width - labelDim.width / 2);\n } else {\n gradientDimensions.height = gradHeight - 2 * padding - labelDim.height / 2;\n gradientDimensions.width = item.icon.width;\n linearGradient.attr('x2', '0%').attr('y1', '100%');\n legendGradCont.attr('transform', `translate(0 ${labelDim.height / 2})`);\n renderAxis(context, legendContainer, gradHeight - 2 * padding - 1, gradWidth - item.icon.width - padding * 2);\n\n applyStyle(legendContainer, {\n height: `${Math.min(height, maxHeight)}px`,\n width: `${maxWidth}px`,\n padding: `${padding}px`\n });\n legendRect.attr('height', gradientDimensions.height - labelDim.height / 2);\n legendRect.attr('width', gradientDimensions.width);\n }\n\n // Apply Styles to the legend plot area\n applyStyle(legendGradSvg, {\n height: `${gradientDimensions.height}px`,\n width: `${gradientDimensions.width}px`\n });\n\n // Apply styles to the legend rect\n applyStyle(legendRect, {\n fill: 'url(#linear-gradient)'\n });\n legendGradSvg.attr('height', gradientDimensions.height);\n legendGradSvg.attr('width', gradientDimensions.width);\n\n context.measurement({\n gradientDimensions\n });\n context._legendGradientSvg = legendGradSvg;\n return context;\n};\n","import SimpleLegend from './simple-legend';\nimport { getScaleInfo, getInterpolatedData, getInterpolatedArrayData } from './legend-helper';\nimport { GRADIENT, LEFT, SIZE } from '../enums/constants';\nimport { renderGradient, createAxis } from './gradient-helper';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class GradientLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new GradientLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof GradientLegend\n */\n static type () {\n return GRADIENT;\n }\n\n /**\n *\n *\n * @param {*} axis\n *\n * @memberof GradientLegend\n */\n axis (...axis) {\n if (axis.length) {\n this._axis = axis[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof GradientLegend\n */\n dataFromScale () {\n let domainForLegend = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainForLegend[0] = domain[0];\n }\n domainForLegend = [...domainForLegend, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainForLegend.push(domain[1]);\n }\n // Sorting the domain Array\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n domainForLegend = getInterpolatedArrayData(domainForLegend, scaleParams);\n } else {\n domainForLegend = getInterpolatedData(domain, steps - 1, scaleParams);\n }\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n return domainForLegend.map((ele, i) => {\n const value = domainForLegend[i];\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](Math.floor(ele)),\n value: +value.toFixed(2),\n id: i\n };\n }).filter(d => d.value !== null);\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const axis = createAxis(this);\n const axisSpace = axis.getLogicalSpace();\n const space = { width: axisSpace.width - effPadding, height: axisSpace.height - effPadding };\n const axisDomainLength = axis.source().domain().length;\n const labelSpaces = new Array(axisDomainLength).fill(space);\n\n this.axis(axis);\n return labelSpaces;\n }\n\n /**\n *\n *\n *\n * @memberof GradientLegend\n */\n getDrawingContext () {\n return {\n svgContainer: this._legendGradientSvg\n };\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const legendContainer = super.render(this.mount());\n // create Legend\n renderGradient(this, legendContainer);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n return [[this.fieldName()], [data.value]];\n }\n}\n","import SimpleLegend from './simple-legend';\nimport {\n getScaleInfo,\n getInterpolatedData,\n getDomainBounds\n} from './legend-helper';\nimport {\n createLegendSkeleton,\n createItemSkeleton,\n renderStepItem\n} from './renderer';\nimport { STEP, RECT, LEFT, SIZE, UPPER, LOWER } from '../enums/constants';\nimport { stepData } from './position-config';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class StepLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new StepLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static type () {\n return STEP;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof StepLegend\n */\n dataFromScale () {\n let domainLeg = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n const { formatter } = this.config();\n const domainBounds = {\n lower: null, upper: null\n };\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainBounds.lower = [`${formatter.bounds.lower} ${steps[0]}`];\n }\n domainLeg = [...domainLeg, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainBounds.upper = [`${formatter.bounds.upper} ${steps[steps.length - 1]}`];\n }\n } else {\n domainLeg = getInterpolatedData(domain, steps, scaleParams);\n }\n\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n domainLeg = domainLeg.map((ele, i) => {\n let value = null;\n if (i < domainLeg.length - 1) {\n value = `${(ele.toFixed(1))} - ${(+domainLeg[i + 1].toFixed(1))}`;\n } else if (domainLeg.length === 1) {\n value = ele.toFixed(1);\n }\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value,\n id: i + 1,\n range: [ele, domainLeg[i + 1]]\n };\n }).filter(d => d.value !== null);\n\n if (domainBounds.lower) {\n const lowerBounds = getDomainBounds(LOWER, { scale, scaleFn, scaleType },\n { domain, steps, domainBounds });\n domainLeg = [lowerBounds, ...domainLeg];\n }\n if (domainBounds.upper) {\n const upperBounds = getDomainBounds(UPPER, { scale, scaleFn, scaleType },\n { domain, steps, domainBounds, domainLeg });\n domainLeg = [...domainLeg, upperBounds];\n }\n\n return domainLeg;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding, align) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n return super.getLabelSpaces(effPadding, align);\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return RECT;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const { classPrefix, position } = this.config();\n const data = stepData(this.data())[position];\n\n const legendContainer = super.render(this.mount());\n\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n\n renderStepItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof StepLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n return {\n [fieldName]: data.range\n };\n }\n}\n","import { GradientLegend, DiscreteLegend, StepLegend } from '@chartshq/muze-legend';\n\n/**\n * Contants to be used as attr\n */\nexport const ROWS = 'rows';\nexport const COLUMNS = 'columns';\nexport const DATA = 'data';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const DETAIL = 'detail';\nexport const LAYERS = 'layers';\nexport const TRANSFORM = 'transform';\nexport const INITIALIZED = 'isInitialized';\nexport const SOURCE = 'source';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const PADDING = 'padding';\nexport const BORDER = 'border';\nexport const MARGIN = 'margin';\nexport const CONFIG = 'config';\nexport const MOUNT = 'mount';\nexport const CANVAS_UPDATED = 'canvasUpdated';\nexport const CLASSPREFIX = 'classPrefix';\nexport const POLICIES = '_policies';\nexport const LEGEND = 'legend';\nexport const TITLE = 'title';\nexport const SUB_TITLE = 'subtitle';\nexport const RESOLVE = 'resolve';\nexport const DISCRETE = 'discrete';\nexport const STEP_COLOR = 'step-color';\nexport const GRADIENT = 'gradient';\nexport const LINEAR = 'linear';\nexport const ORDINAL = 'ordinal';\nexport const MUZE_PREFIX = 'muze';\n\nexport const TITLE_TEMPLATE_NOT_ALLOWED_TAGS = [\n 'script',\n 'style'\n];\n\nexport const LEGEND_TYPE_MAP = {\n [`${ORDINAL}-${true}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SIZE}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${COLOR}`]: StepLegend,\n [`${LINEAR}-${false}-${COLOR}`]: GradientLegend\n};\n\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const GROUP = 'group';\nexport const LAYOUT = 'layout';\nexport const RETINAL = 'retinal';\nexport const DIMENSION = 'dimension';\nexport const MEASURE = 'measure';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const HORIZONTAL_CENTER = 'h-center';\nexport const VERTICAL_CENTER = 'v-center';\nexport const HIDDEN = 'hidden';\nexport const OVERFLOW = 'overflow';\nexport const OVERFLOW_X = 'overflow-x';\nexport const OVERFLOW_Y = 'overflow-y';\nexport const AUTO = 'auto';\nexport const VISIBLE = 'visible';\nexport const VERTICAL_SCROLL_BAR = 'verticalScrollBar';\nexport const HORIZONTAL_SCROLL_BAR = 'horizontalScrollBar';\nexport const GRID = 'grid';\nexport const MESSAGE = 'message';\nexport const NO_DATA_MESSAGE = 'No data to display';\n\n","import { ComposedVars, SimpleVariable } from '@chartshq/visual-group';\nimport { TITLE_TEMPLATE_NOT_ALLOWED_TAGS } from './constants';\n\n/**\n * This method creates a new composed variable instance from multiple variables. This is required when we have multiple\n * variables on a single axis and the union of domain of all the variables needs to be set on the axis.\n *\n * To create a new composed variable from multiple fields,\n * ```\n * const sharedVar = share('open', 'high', 'low', 'close');\n * canvas.rows([sharedVar])\n * .columns(['date']);\n * ```\n *\n * @module Operators\n * @public\n * @function share\n * @param {Array} vars Variable names.\n *\n * @return {ComposedVars} Instance of composed variable\n */\nexport const share = (...vars) => new ComposedVars(...vars.map(variable => new SimpleVariable(variable)));\n\n/**\n *\n *\n * @param {*} node\n *\n */\nfunction treeShakeNode (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) { return; }\n\n if (TITLE_TEMPLATE_NOT_ALLOWED_TAGS.indexOf(node.tagName.toLowerCase()) !== -1) {\n node.parentNode.removeChild(node);\n } else {\n for (const childNode of node.childNodes) {\n treeShakeNode(childNode);\n }\n }\n}\n\n/**\n * A string template tagged function which sanitizes input html formatted string according to the allowed html tags.\n * This is used to render html in canvas components like title and tooltip.\n *\n * To render html in canvas components,\n * ```\n * canvas.title(html`TITLE`);\n * ```\n *\n * @public\n * @module Operators\n * @function html\n * @param {Array.} strings - The string parts of the template.\n * @param {Array} exps - The list of evaluated expression values.\n *\n * @return {Function} Returns a function which returns the sanitized html string.\n */\nexport function html (strings, ...exps) {\n let htmlCode = '';\n const expLn = exps.length;\n let i = 0;\n\n for (; i < expLn; ++i) {\n htmlCode += strings[i] + exps[i];\n }\n htmlCode += strings[i];\n\n const frag = document.createDocumentFragment();\n const wrapper = document.createElement('div');\n\n frag.appendChild(wrapper);\n wrapper.innerHTML = htmlCode;\n\n treeShakeNode(wrapper);\n const { innerHTML } = wrapper;\n\n return () => innerHTML;\n}\n","import { mergeRecursive, CommonProps } from 'muze-utils';\n\nconst defaultPolicy = (registrableComponents) => {\n const aliases = registrableComponents.map(comp => comp.alias());\n return {\n behaviours: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n }\n };\n};\n\nconst listenerFn = (canvas, fn) => () => {\n const valueMatrix = canvas.composition().visualGroup.matrixInstance().value;\n valueMatrix.each(cell => fn(cell.valueOf().firebolt()));\n};\n\nconst canvasIterator = (canvases, iteratorFn, cFn) => {\n canvases.forEach((canvas) => {\n const matrix = canvas.composition().visualGroup.matrixInstance().value;\n matrix.each(cell => iteratorFn(cell.valueOf().firebolt()));\n cFn && cFn(canvas);\n // Also register actions on canvas update\n const throwback = canvas._throwback;\n\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED],\n listenerFn(canvas, iteratorFn));\n });\n};\n\nconst registerActions = (context, type, fnName, deps) => {\n const canvases = context._registrableComponents;\n\n canvases.forEach((canvas) => {\n const vGroup = canvas.composition().visualGroup;\n\n vGroup.resolver().setFireboltDependencies(type, deps);\n canvas.firebolt()[fnName](deps);\n });\n};\n\n/**\n * This class is initiated only once in lifecycle and is reponsible for regisration of physical and behavioural\n * actions and side effects and the mapping between them.\n *\n * To get the instance of action model\n * ```\n * const ActionModel = muze.ActionModel;\n * ```\n *\n * @public\n * @module ActionModel\n */\nclass ActionModel {\n constructor () {\n this._registrableComponents = [];\n }\n\n /**\n * Takes an array of canvases on which the physical and behavioural actions will get registered.\n *\n * @public\n * @param {Canvas} components Array of canvases\n *\n * @return {ActionModel} Instance of action model.\n */\n for (...components) {\n this._registrableComponents = components;\n return this;\n }\n\n /**\n * Registers physical actions on the canvases. It takes an object with key as the name of action and value having\n * the definition of the action.\n *\n * To register a {@link PhysicalAction},\n * ```\n * const ActionModel = muze.ActionModel;\n * ActionModel\n * // Physical actions will be registered on these canvases.\n * .for(canvas)\n * .registerPhysicalActions({\n * // Key is the name of physical action.\n * ctrlClick: (firebolt) => (targetEl, behaviours) => {\n * targetEl.on('click', function (data) {\n * const event = utils.getEvent();\n * const pos = utils.getClientPoint(event, this);\n * // Get the data point nearest to the mouse position.\n * const nearestPoint = firebolt.context.getNearestPoint(pos, {\n * data\n * });\n * // Prepare the payload\n * const payload = {\n * criteria: nearestPoint.id\n * };\n * behaviours.forEach((behaviour) => firebolt.dispatchBehaviour(behaviour, payload));\n * });\n * }\n * });\n * ```\n * @public\n *\n * @param {Object} action Names of physical actions and their definitions.\n *\n * @return {ActionModel} Instance of the action model.\n */\n registerPhysicalActions (action) {\n registerActions(this, 'physicalActions', 'registerPhysicalActions', action);\n return this;\n }\n\n /**\n * Registers behavioural actions on the canvases. It takes definitions of the behavioural actions and registers\n * them on the canvases. Every behavioural action must inherit the {@link GenericBehaviour} class.\n *\n * To register a behavioural action\n * ```\n * // Define a new behavioural action\n * class SingleSelectBehaviour extends GenericBehaviour {\n * static formalName () {\n * return 'singleSelect';\n * }\n *\n * setSelectionSet (addSet, selectionSet) {\n * if (addSet === null) {\n * selectionSet.reset();\n * } else if (addSet.length) {\n * const existingAddSet = selectionSet.getExistingEntrySet(addSet);\n * if (existingAddSet.length){\n * selectionSet.reset();\n * } else {\n * selectionSet.add(addSet);\n * }\n * } else {\n * selectionSet.reset();\n * }\n * }\n * }\n * muze.ActionModel.registerBehaviouralActions(SingleSelectBehaviour);\n * ```\n *\n * @public\n *\n * @param {GenericBehaviour} actions Definition of behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerBehaviouralActions (...actions) {\n registerActions(this, 'behaviouralActions', 'registerBehaviouralActions', actions);\n return this;\n }\n\n /**\n * Registers the mapping of physical and behavioural actions. This mapping is used to establish which behavioural\n * actions should be dispatched on any triggering of physical actions.\n *\n * To map physical actions with behavioural actions,\n * ```\n * muze.ActionModel.registerPhysicalBehaviouralMap({\n * ctrlClick: {\n * behaviours: ['select'] // This array must be the formal names of the behavioural actions.\n * }\n * });\n * ```\n *\n * @public\n * @param {Object} map Contains the physical and behavioural action map.\n * ```\n * {\n * // Name of the physical action\n * click: {\n * // Target element selector. This is an optional field. If not passed, then by default takes the\n * // container element of visual unit.\n * target: '.muze-layers-area path',\n * // Behaviours which should be dispatched on triggering of the mapped physical action.\n * behaviours: ['select']\n * }\n * }\n * ```\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPhysicalBehaviouralMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPhysicalBehaviouralMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPhysicalBehaviouralMap(map);\n });\n return this;\n }\n\n /**\n * Registers what behaviour to propagate on dispatch of a certain behavioural action. By default, when any\n * behavioural action is dispatched, then the same behavioural action gets propagated to all the other canvases.\n * This can be changed using this api.\n *\n * To register what behaviour should be propagated on dispatch of any behavioural action,\n * ```\n * ActionModel.for(canvas1, canvas2).registerPropagationBehaviourMap({\n * select: 'filter',\n * brush: 'filter'\n * });\n * ```\n *\n * @public\n * @param {Object} map Propagation behaviour map.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPropagationBehaviourMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPropagationBehaviourMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPropagationBehaviourMap(map);\n });\n\n return this;\n }\n\n /**\n * Registers the mapping of side effects and behavioural actions. It takes an object which contains key as the\n * name of behavioural action and the side effects which will be linked to it.\n *\n * To map side effects to select behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: ['infoBox'] // This array must be the formal names of the side effects\n * });\n * ```\n *\n * To map side effects to select behaviour, but disable all the default side effects attached with this behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: {\n * effects: ['infoBox'],\n * preventDefaultActions: true\n * }\n * });\n * @public\n * @param {Object} map Mapping of behavioural actions and side effects.\n * ```\n * {\n * select: ['infoBox']\n * }\n * ```\n * @return {ActionModel} Instance of action model.\n */\n mapSideEffects (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.mapSideEffects(map);\n }, (canvas) => {\n canvas.firebolt().mapSideEffects(map);\n });\n return this;\n }\n\n /**\n * Registers the side effects on the registered canvases. It takes definitions of side effects and registers them\n * on the canvases. Every side effect must inherit the base class {@link GenericSideEffect} or\n * {@link SpawnableSideEffect} or {@link SurrogateSideEffect} class.\n *\n * ```\n * // Define a custom side effect\n * class InfoBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'infoBox';\n * }\n *\n * apply (selectionSet) {\n * }\n * }\n * muze.ActionModel.registerSideEffects(InfoBox);\n * ```\n * @public\n * @param {GenericSideEffect} sideEffects Definition of side effects.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerSideEffects (...sideEffects) {\n registerActions(this, 'sideEffects', 'registerSideEffects', sideEffects);\n return this;\n }\n\n /**\n * Breaks the link between behavioural actions and physical actions. It takes an array of behavioural action\n * and it's physical action.\n *\n * To dissociate behavioural actions from physical actions\n * ```\n * muze.ActionModel.dissociateBehaviour(['select', 'click'], ['highlight', 'hover']);\n * ```\n * @public\n * @param {Array} maps Array of behavioural action and physical action.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateBehaviour (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateBehaviour(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateBehaviour(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * Breaks the link between side effects and behavioural actions. It takes an array of formal names of the side\n * effects and it's linked behavioural action.\n *\n * To dissociate side effects from behavioural actions\n * ```\n * muze.ActionModel.dissociateSideEffect(['crossline', 'highlight'], ['selectionBox', 'brush']);\n * ```\n * @public\n * @param {Array} maps Array of side effects and behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateSideEffect (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateSideEffect(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateSideEffect(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * By default cross interactivity is disabled between canvases. This enables cross interaction between the canvases\n * so that any action happening in one canvas gets dispatched on other canvases as well. An optional policy can also\n * be passed in this method. The policy can be used to control on which canvases the behavioural actions and\n * side effects gets dispatched.\n *\n * To just enable cross interactivity between two canvases,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity();\n * ```\n *\n * To enable cross interactivity but enable any behavioural action only when it is triggered from canvas1.\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * behaviours: {\n * // Here * stands for any behavioural action name. We can also give any name of behavioural action\n * // in place of this.\n * '*': (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n *\n * To enable cross interactivity but enable tooltip effect if the action is propagated from canvas1,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * sideEffects: {\n * tooltip: (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n * @public\n * @param {Object} policy Policy definition.\n *\n * @return {ActionModel} Instance of action model.\n */\n enableCrossInteractivity (policy = {}) {\n const registrableComponents = this._registrableComponents;\n const mergedPolicy = mergeRecursive(mergeRecursive({}, defaultPolicy(registrableComponents)), policy);\n\n registrableComponents.forEach((canvas) => {\n canvas.firebolt().crossInteractionPolicy(mergedPolicy);\n });\n\n return this;\n }\n}\n\nexport const actionModel = (() => new ActionModel())();\n","import { MUZE_PREFIX } from '../constants';\n\nexport const TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 4,\n className: `${MUZE_PREFIX}-title-container`\n};\n\nexport const SUB_TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 16,\n maxLines: 2,\n className: `${MUZE_PREFIX}-subtitle-container`\n};\n\nexport const MESSAGE_CONFIG = {\n className: `${MUZE_PREFIX}-message-container`\n};\n\nexport const CANVAS = 'canvas';\n","import { mergeRecursive } from 'muze-utils';\nimport {\n ROWS,\n COLUMNS,\n COLOR,\n SHAPE,\n SIZE,\n DETAIL,\n LAYERS,\n TRANSFORM,\n TITLE,\n SUB_TITLE\n} from '../constants';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG } from './defaults';\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Canvas.\n * Canvas merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module LocalOptions\n */\n\nexport const localOptions = {\n [ROWS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLUMNS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLOR]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SHAPE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SIZE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [DETAIL]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n\n [LAYERS]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [TRANSFORM]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object'\n }\n }\n};\n\nexport const canvasOptions = {\n [TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([title, titleConfig]) => {\n let t = title;\n if (typeof title === 'string' || !title) {\n t = () => title;\n }\n const defConfig = mergeRecursive({}, TITLE_CONFIG);\n return [t, mergeRecursive(defConfig, titleConfig)];\n }\n }\n },\n [SUB_TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([subtitle, subtitleConfig]) => {\n let sub = subtitle;\n if (typeof subtitle === 'string' || !subtitle) {\n sub = () => subtitle;\n }\n const defConfig = mergeRecursive({}, SUB_TITLE_CONFIG);\n return [sub, mergeRecursive(defConfig, subtitleConfig)];\n }\n }\n }\n};\n","export default class LayoutComponent {\n constructor (name, dimensions, seed) {\n this._seed = seed;\n this._boundBox = {\n height: dimensions.height,\n width: dimensions.width,\n top: null,\n left: null\n };\n this._renderAt = null;\n this._alignWith = null;\n this._alignment = null;\n this._target = null;\n this._position = null;\n this._componentName = name;\n this._className = null;\n }\n\n getLogicalSpace () {\n throw new Error('getLogicalSpace is not defined');\n }\n\n setSpatialConfig () {\n throw new Error('setSpatialSpace is not defined');\n }\n\n name (param) {\n if (param) {\n this._componentName = param;\n }\n return this._componentName;\n }\n\n target (param) {\n if (param) {\n this._target = param;\n }\n return this._target;\n }\n\n position (param) {\n if (param) {\n this._position = param;\n }\n return this._position;\n }\n\n alignment (param) {\n if (param) {\n this._alignment = param;\n }\n return this._alignment;\n }\n\n alignWith (param) {\n if (param) {\n this._alignWith = param;\n }\n return this._alignWith;\n }\n\n renderAt (param) {\n if (param) {\n this._renderAt = param;\n }\n return this._renderAt;\n }\n\n boundBox (param) {\n if (param) {\n Object.assign(this._boundBox, param);\n }\n return this._boundBox;\n }\n\n className (param) {\n if (param) {\n this._className = param;\n }\n return this._className;\n }\n\n draw () {\n throw new Error('draw is not defined');\n }\n\n attachListener () {\n return this;\n }\n }\n\n","import LayoutComponent from './layoutComponent';\n\nclass DummyComponent extends LayoutComponent {\n getLogicalSpace () {\n return {\n width: this.boundBox().width,\n height: this.boundBox().height\n };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n return this;\n }\n\n draw () {\n if (!this.component) {\n throw new Error(`Component not set for ${this.componentName}`);\n }\n this.component.mount(document.getElementById(this.renderAt)); // Change the draw method to component draw\n return this;\n }\n}\n\nexport default DummyComponent;\n","export const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n interaction: {\n sideEffect: 'individual'\n },\n pagination: 'scroll',\n scrollBar: {\n thickness: 10,\n speed: 2,\n vertical: {\n align: 'right'\n },\n horizontal: {\n align: 'bottom'\n }\n },\n legend: {\n position: 'right',\n color: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n shape: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n size: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n }\n },\n showHeaders: false,\n minWidth: 100,\n minHeight: 100,\n facet: {\n rows: {\n minCharacters: 3\n },\n columns: {\n maxLines: 2,\n verticalAlign: 'middle',\n minCharacters: 1\n }\n },\n border: {\n style: 'solid',\n color: '#d6d6d6',\n width: 2,\n collapse: true,\n spacing: 0\n },\n autoGroupBy: {\n disabled: false\n },\n invalidValues: {},\n sort: {}\n};\n","import { DEFAULT_CONFIG } from '../../../../muze/src/defaults';\n\nconst DEFAULT_WIDTH = 600;\nconst DEFAULT_HEIGHT = 400;\nconst DEFAULT_CLASS_NAME = `${DEFAULT_CONFIG.classPrefix}-layout-container-component`;\nconst NODE_PREFIX = `${DEFAULT_CONFIG.classPrefix}-layout-container`;\n\nexport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT,\n DEFAULT_CLASS_NAME,\n NODE_PREFIX\n};\n","export default class DefinitionModel {\n constructor (config) {\n this._host = config.host || null;\n this._cut = config.cut || null;\n this._ratioWeight = config.ratioWeight === 0 ? 0 : config.ratioWeight || 1;\n this._preferred = config.preferred || false;\n this._lanes = config.lanes || [];\n this._remainingHeight = 0;\n this._remainingWidth = 0;\n }\n\n host (host) {\n if (host) {\n this._host = host;\n }\n return this._host;\n }\n\n preferred (preferred) {\n if (preferred) {\n this._preferred = preferred;\n }\n return this._preferred;\n }\n\n cut (cut) {\n if (cut) {\n this._cut = cut;\n }\n return this._cut;\n }\n\n ratioWeight (ratioWeight) {\n if (ratioWeight) {\n this._ratioWeight = ratioWeight;\n }\n return this._ratioWeight;\n }\n\n lanes (lanes) {\n if (lanes) {\n this._lanes = lanes;\n }\n return this._lanes;\n }\n\n remainingHeight (remainingHeight) {\n if (remainingHeight) {\n this._remainingHeight = remainingHeight;\n }\n return this._remainingHeight;\n }\n\n remainingWidth (remainingWidth) {\n if (remainingWidth) {\n this._remainingWidth = remainingWidth;\n }\n return this._remainingWidth;\n }\n}\n","import { NODE_PREFIX } from '../../constants/defaults';\nimport DefinitionModel from '../definition-manager/definitionModel';\nimport DummyComponent from '../../layout-component/dummy-component';\n/**\n * Compares two strings in lowercase\n *\n * @export\n * @param {string} value the value to be compared\n * @param {string} compareTo whom the value would be compared\n * @return {boolean} true if values are equal\n */\nexport function isEqual (value, compareTo) {\n if (typeof value !== 'string' || typeof compareTo !== 'string') {\n throw new TypeError('value and compareTo must be string');\n }\n return value.toLowerCase() === compareTo.toLowerCase();\n}\n\nexport const getNodeId = (() => {\n let _uid = 0;\n return () => `${NODE_PREFIX}-${++_uid}`;\n})();\n\nexport function yExtraSpace (node) {\n let smallestHeight = 0;\n if (node.getCutType() === 'v') {\n smallestHeight = smallestExtraHeightHorizontally(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'h') {\n node.children().forEach((child) => {\n smallestHeight += yExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerHeight = node.boundBox().height;\n const hostHeight = node.model().host().getLogicalSpace().height;\n\n smallestHeight = containerHeight - hostHeight;\n if (smallestHeight < 0) {\n smallestHeight = 0;\n }\n } else {\n smallestHeight = 0;\n }\n return smallestHeight;\n}\n\nexport function smallestExtraHeightHorizontally (node) {\n let smallestHeight = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const h = yExtraSpace(child);\n if (h < smallestHeight) {\n smallestHeight = h;\n }\n });\n return smallestHeight;\n}\n\nexport function xExtraSpace (node) {\n let smallestWidth = 0;\n if (node.getCutType() === 'h') {\n smallestWidth = smallestExtraWidthVertically(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'v') {\n node.children().forEach((child) => {\n smallestWidth += xExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerWidth = node.boundBox().width;\n const hostWidth = node.model().host().getLogicalSpace().width;\n smallestWidth = containerWidth - hostWidth;\n if (smallestWidth < 0) {\n smallestWidth = 0;\n }\n } else {\n smallestWidth = 0;\n }\n return smallestWidth;\n}\n\nexport function smallestExtraWidthVertically (node) {\n let smallestWidth = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const w = xExtraSpace(child);\n if (w < smallestWidth) {\n smallestWidth = w;\n }\n });\n return smallestWidth;\n}\n\nexport function determineBoundBox (bb, i, arr, instance) {\n if (i) {\n // if not first sibling, take boundbox from previous sibling\n const lastSibling = arr[i - 1];\n const { top: _top, left: _left, height: _height, width: _width } = lastSibling.boundBox();\n return {\n width: bb.width,\n height: bb.height,\n\n top: instance.parentCut() === 'h'\n ? _top + _height : _top,\n\n left: instance.parentCut() === 'h'\n ? _left : _left + _width\n };\n }\n // if first sibling, take boundbox from parent\n const { top: _top, left: _left } = instance.parent().boundBox();\n return {\n width: bb.width,\n height: bb.height,\n top: _top,\n left: _left\n };\n}\n\n// prepares the targetComponent Map for target Mapping ie. where a component should lie\nexport function prepareTargetComponentMap (context) {\n context.targetComponentMap(new Map());\n context.componentMap().forEach((value) => {\n if (context.targetComponentMap().has(value.target())) {\n context.targetComponentMap().get(value.target()).push(value);\n } else {\n const temp = [];\n temp.push(value);\n context.targetComponentMap().set(value.target(), temp);\n }\n });\n}\n\nexport function getComponent (canvasComponent, componentName) {\n const comp = canvasComponent.find(component => component.name() === componentName);\n return (comp && comp !== -1) ? comp : null;\n}\nexport function createPlaceHolderComponent (height, width, position) {\n const comp = new DummyComponent(0, { height, width });\n comp.name('placeHolder');\n comp.position(position);\n return comp;\n}\n\nexport function placeComponent (definitionModel, component, isPreferred = false, isGridComponent = false) {\n let cut = '';\n let componentRatioWidth = 1;\n let leftOvercomponentRationWidth = 1;\n let leftHeight = 0;\n let leftWidth = 0;\n\n if (!component) {\n return { first: definitionModel, second: definitionModel };\n }\n\n const { height: componentHeight, width: componentWidth } = component.getLogicalSpace();\n const position = component.position();\n if (position === 'top' || position === 'bottom') {\n cut = 'h';\n componentRatioWidth = componentHeight / definitionModel.remainingHeight();\n leftHeight = definitionModel.remainingHeight() - componentHeight;\n leftWidth = definitionModel.remainingWidth();\n } else {\n cut = 'v';\n componentRatioWidth = componentWidth / definitionModel.remainingWidth();\n leftWidth = definitionModel.remainingWidth() - componentWidth;\n leftHeight = definitionModel.remainingHeight();\n }\n leftOvercomponentRationWidth = 1 - componentRatioWidth;\n\n// update parentModel\n definitionModel.cut(cut);\n const firstLaneConfig = {\n host: component.name(),\n cut: null,\n ratioWeight: componentRatioWidth,\n preferred: isGridComponent ? false : isPreferred,\n lanes: []\n };\n const firstLane = new DefinitionModel(firstLaneConfig);\n firstLane.remainingHeight(componentHeight);\n firstLane.remainingWidth(componentWidth);\n\n const secondLaneConfig = {\n host: null,\n cut: null,\n ratioWeight: leftOvercomponentRationWidth,\n preferred: isGridComponent ? false : !isPreferred,\n lanes: []\n };\n const secondLane = new DefinitionModel(secondLaneConfig);\n secondLane.remainingHeight(leftHeight);\n secondLane.remainingWidth(leftWidth);\n if (isPreferred) {\n definitionModel.lanes([firstLane]);\n } else if (position === 'top' || position === 'left') {\n definitionModel.lanes([firstLane, secondLane]);\n } else {\n definitionModel.lanes([secondLane, firstLane]);\n }\n return { first: firstLane, second: secondLane };\n}\n\nexport function placeGridComponent (definitionModel, gridComponents) {\n let tempDefModel = definitionModel;\n const rows = gridComponents.length;\n const column = rows ? gridComponents[0].length : 0;\n const height = gridComponents.reduce((acc, val) => (acc + val[0].getLogicalSpace().height), 0);\n\n for (let i = 0; i < column; i++) {\n const iscolumnPreffered = i === column - 1;\n const columnPlaceHolderComponent = createPlaceHolderComponent(height,\n gridComponents[0][i].getLogicalSpace().width, 'left');\n const { first, second } = placeComponent(tempDefModel, columnPlaceHolderComponent, iscolumnPreffered);\n tempDefModel = first;\n for (let j = 0; j < rows; j++) {\n const rowpreffred = j === (rows - 1);\n tempDefModel = placeComponent(tempDefModel, gridComponents[j][i], rowpreffred, true).second;\n }\n tempDefModel = second;\n }\n return tempDefModel;\n}\n\nexport function negotiateDimension (node) {\n let preferred;\n let cumultiveExtraSpaceAmt = 0;\n let alteredDim;\n let nonAlteredDim;\n\n const childrenLength = node.children().length;\n\n for (let index = 0; index < childrenLength; index++) {\n let fn;\n let extraSpaceAmt;\n const child = node.children()[index];\n\n if (child.parentCut() === 'h') {\n fn = yExtraSpace;\n alteredDim = 'height';\n nonAlteredDim = 'width';\n } else {\n fn = xExtraSpace;\n alteredDim = 'width';\n nonAlteredDim = 'height';\n }\n // if vertical then get extra height from other node and push it to the preferred node.\n // for horizontal cut the same thing is to be done with width\n if (child.isPreferred()) {\n // push extra space in sink. Execute it when all non preferred space are computed.\n preferred = child;\n\n continue; // eslint-disable-line no-continue\n }\n // reduce own height and save it in a var\n cumultiveExtraSpaceAmt += (extraSpaceAmt = fn(child));\n child.boundBox()[alteredDim] -= extraSpaceAmt;\n // update nonaltered dim from parent for any change which happened during negotiation\n child.boundBox()[nonAlteredDim] = child.parent().boundBox()[nonAlteredDim];\n\n negotiateDimension(child);\n }\n\n if (preferred) {\n preferred.boundBox()[alteredDim] += cumultiveExtraSpaceAmt;\n preferred.boundBox()[nonAlteredDim] = preferred.parent().boundBox()[nonAlteredDim];\n negotiateDimension(preferred);\n }\n}\n\nexport function computePosition (node) {\n node.children().forEach((child, i, children) => {\n const boundBox = determineBoundBox(child.boundBox(), i, children, child);\n child.boundBox(boundBox);\n computePosition(child);\n });\n}\n\nexport function allocateBoundingBox (node) {\n const totalWeight = node.children()\n .map(child => child.model().ratioWeight())\n .reduce((carry, val) => carry + val, 0);\n\n node.children().forEach((child, i, children) => {\n const lastSibling = children[i - 1];\n const ratio = child.model().ratioWeight() / totalWeight;\n\n if (child.parentCut() === 'h') {\n child.boundBox({\n top: i ? lastSibling.boundBox().top + lastSibling.boundBox().height : 0,\n left: child.parent().boundBox().left,\n height: child.parent().boundBox().height * ratio,\n width: child.parent().boundBox().width\n });\n } else {\n child.boundBox({\n top: child.parent().boundBox().top,\n left: i ? lastSibling.boundBox().left + lastSibling.boundBox().width : 0,\n height: child.parent().boundBox().height,\n width: child.parent().boundBox().width * ratio\n });\n }\n allocateBoundingBox(child);\n });\n}\n\n","import { getNodeId } from '../helper';\nimport { LayoutComponent } from '../../layout-component';\n\nclass Node {\n constructor (data) {\n this._model = data;\n this._parent = null;\n this._children = [];\n this._parentCut = null;\n this._boundBox = {\n top: null,\n left: null,\n height: null,\n width: null\n };\n\n this._id = this._model.host() instanceof LayoutComponent && this._model.host().renderAt() ?\n this._model.host().renderAt() :\n getNodeId();\n }\n\n addChildren (entries) {\n this._children.push(...entries);\n entries.forEach((e) => { e.parent(this); });\n }\n\n isRoot () {\n return this._parent === null;\n }\n\n isLeaf () {\n return !this._children.length;\n }\n\n getCutType () {\n return this._model.cut();\n }\n\n isPreferred () {\n return !!this._model.preferred();\n }\n\n children (children) {\n if (children) {\n this._children = children;\n }\n return this._children;\n }\n\n parent (parent) {\n if (parent) {\n this._parent = parent;\n }\n return this._parent;\n }\n\n parentCut (parentCut) {\n if (parentCut) {\n this._parentCut = parentCut;\n }\n return this._parentCut;\n }\n\n id (id) {\n if (id) {\n this._id = id;\n }\n return this._id;\n }\n\n model (model) {\n if (model) {\n this._model = model;\n }\n return this._model;\n }\n\n boundBox (bound) {\n if (bound) {\n this._boundBox = {\n top: bound.top,\n left: bound.left,\n height: bound.height,\n width: bound.width\n };\n }\n return this._boundBox;\n }\n /**\n * function to search a node and update it with the config provided.\n * @param {Object} nodeconfig\n */\n updateNode (nodeconfig) {\n if (this._id === nodeconfig._id) {\n this._model.cut(nodeconfig.cut);\n this._model.ratioWeight(nodeconfig.ratioWeight);\n } else {\n this._children.forEach((node) => {\n if (node._id === nodeconfig._id) {\n node.model.cut(nodeconfig.cut);\n node.model.ratioWeight(nodeconfig.ratioWeight);\n return;\n }\n this.searchNode(node, nodeconfig);\n });\n }\n }\n\n // Recursive function to search a node\n searchNode (node, nodeconfig) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeconfig._id) {\n childNode.model().cut(nodeconfig.cut);\n childNode.model().ratioWeight(nodeconfig.ratioWeight);\n } else {\n this.searchNode(childNode, nodeconfig);\n }\n });\n }\n\n /**\n * function to delete a node from tree Structure.\n * @param {String} nodeId - node Id of the Node\n */\n delete (nodeId) {\n this._children.forEach((node) => {\n if (node.id() === nodeId) {\n const index = this._children.indexOf(node);\n this._model.lanes().splice(index, 1);\n }\n this.deleteSearchNode(node, nodeId);\n });\n }\n\n // Recursive function to search a node\n deleteSearchNode (node, nodeId) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeId) {\n const index = node.children().indexOf(childNode);\n node.model().lanes().splice(index, 1);\n } else {\n this.deleteSearchNode(childNode, nodeId);\n }\n });\n }\n}\n\nexport default Node;\n","import Node from '../tree';\nimport {\n allocateBoundingBox,\n negotiateDimension,\n computePosition\n} from '../helper';\n\nexport default class LayoutModel {\n constructor (measurements, config) {\n this._measurements = measurements;\n this._config = config;\n this._root = this.createTree(this._config, null);\n this.setBoundBox();\n }\n\n createTree (config, parent) {\n const node = new Node(config);\n if (parent) {\n node.parentCut(parent.getCutType());\n parent.addChildren([node]);\n } else {\n this._root = node;\n }\n for (const lane of config.lanes()) {\n this.createTree(lane, node);\n }\n\n return this._root;\n }\n\n setBoundBox () {\n this._root.boundBox({\n top: 0,\n left: 0,\n width: this._measurements.width,\n height: this._measurements.height\n });\n allocateBoundingBox(this._root);\n }\n\n setHostPosition (node) {\n node.children().forEach((child) => {\n LayoutModel.setHostSpatialConfig(child);\n this.setHostPosition(child);\n });\n }\n\n static setHostSpatialConfig (node) {\n const bb = node.boundBox();\n const host = node.model().host();\n if (host && host.setSpatialConfig) {\n const conf = {\n x: bb.left,\n y: bb.top,\n width: bb.width,\n height: bb.height,\n renderAt: node.id()\n };\n host.setSpatialConfig(conf);\n }\n }\n\n negotiate () {\n negotiateDimension(this._root);\n computePosition(this._root);\n return this;\n }\n\n broadcast () {\n this.setHostPosition(this._root);\n return this;\n }\n\n tree () {\n return this._root;\n }\n}\n","/**\n * This file exports constants that will be used to\n * create the state store of the table layout.\n */\n/**\n * The index of top, bottom and center in the matrix\n */\nexport const VIEW_INDEX = {\n top: 0,\n center: 1,\n bottom: 2\n};\n\nexport const ROW_MATRIX_INDEX = {\n 0: 'top',\n 1: 'center',\n 2: 'bottom'\n};\n\nexport const COLUMN_MATRIX_INDEX = {\n 0: 'left',\n 1: 'middle',\n 2: 'right'\n};\n\n/**\n * The width of the grid suppied by the user.\n */\nexport const GRID_WIDTH = 'width';\n\n/**\n * The height of the grid supplied by the user.\n */\nexport const GRID_HEIGHT = 'height';\n\n/**\n * The border for the grid\n */\nexport const BORDER = 'border';\n\n /**\n * The index of the first visible row in view matrix.\n */\nexport const ROW_POINTER = 'rowPointer';\n\n/**\n * The index of the first visible column in the view matrix.\n */\nexport const COLUMN_POINTER = 'columnPointer';\n\n/**\n * Flag to specify whether row sizes should be equal.\n */\nexport const ROW_SIZE_IS_EQUAL = 'isRowSizeEqual';\n\n/**\n * Flag to specify whether column sizes are equal.\n */\nexport const COLUMN_SIZE_IS_EQUAL = 'isColumnSizeEqual';\n\n/**\n * Field to store an array an of the widths of visible columns.\n * @computed\n */\nexport const COLUMN_WIDTHS = 'visibleColumnWidths';\n\n/**\n * Field to store an array of heights of visible rows.\n * @computed\n */\nexport const ROW_HEIGHTS = 'visibleRowHeights';\n\n/**\n * Field to store the width of the left matrix.\n * @computed\n */\nexport const LEFT_MATRIX_WIDTH = 'leftMatrixWidth';\n\n/**\n * Field to store the width of the right matrix.\n * @computed\n */\nexport const RIGHT_MATRIX_WIDTH = 'rightMatrixWidth';\n\n/**\n * Field to store the height of the top matrix.\n * @computed\n */\nexport const TOP_MATRIX_HEIGHT = 'topMatrixHeight';\n\n/**\n * Field to store the height of the bottom matrix.\n * @computed\n */\nexport const BOTTOM_MATRIX_HEIGHT = 'bottomMatrixHeight';\n\n/**\n * The dom element to render the layout inside.\n */\nexport const MOUNT_POINT = 'mount';\n\n/**\n * The id attribute of the left table element.\n */\nexport const LEFT_TABLE_ID = 'grid-left';\n\n/**\n * The id attribute of the right table element.\n */\nexport const RIGHT_TABLE_ID = 'grid-right';\n\n/**\n * The id attribute of the top table.\n */\nexport const TOP_TABLE_ID = 'grid-top';\n\n/**\n * The id attribute of the bottom table.\n */\nexport const BOTTOM_TABLE_ID = 'grid-bottom';\n\n/**\n * The id attribute of the center table.\n */\nexport const CENTER_TABLE_ID = 'grid-center';\n\n/**\n * The id attribute of the top div.\n */\nexport const TOP_DIV_ID = 'muze-div-top';\n\n/**\n * The id attribute of the bottom div.\n */\nexport const BOTTOM_DIV_ID = 'muze-div-bottom';\n\n/**\n * The id attribute of the center div.\n */\nexport const CENTER_DIV_ID = 'muze-div-center';\n\n/**\n * Field that indicates if the row configuration has changed\n */\nexport const HAVE_ROWS_CHANGED = 'haveRowsChanged';\n\n/**\n * Field that indicates if the column configuration has changed\n */\nexport const HAVE_COLUMNS_CHANGED = 'haveColumnsChanged';\n\n/**\n * Field that indicates if the values configuration for the center matrix has changed\n */\nexport const HAVE_VALUES_CHANGED = 'haveValuesChanged';\n\n/**\n * Field that indicates the width of row matrix\n */\nexport const ROW_MATRIX_WIDTH = 'rowMatrixWidth';\n\n/**\n * Field that indicates the height of row matrix\n */\nexport const COLUMN_MATRIX_HEIGHT = 'columnMatrixHeight';\n\n/**\n * Field that indicates the unit width of layout\n */\nexport const UNIT_WIDTH = 'unitWidth';\n\n/**\n * Field that indicates the unit height of layout\n */\nexport const UNIT_HEIGHT = 'unitHeight';\n\n/**\n * Field that indicates the style object\n */\nexport const STYLE = 'style';\n\n/**\n * Field that indicates the color configuration\n */\nexport const COLOR = 'color';\n\n/**\n * Field that indicates width\n */\nexport const WIDTH = 'width';\n\n/**\n * Field that indicates collpase property for border\n */\nexport const COLLAPSE = 'collapse';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SPACING = 'spacing';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const DISTRIBUTION = 'distribution';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const GUTTERSPACE = 'gutterSpace';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const BREAK_PAGE = 'breakPage';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_ROW_BORDERS = 'showRowBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_COL_BORDERS = 'showColBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_VALUE_BORDERS = 'showValueBorders';\n\nexport const HEIGHT = 'height';\nexport const COLUMN = 'column';\nexport const ROW = 'row';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const CENTER = 'center';\nexport const CLICK = 'click';\nexport const ROW_LEFT = 'rowLeft';\nexport const ROW_RIGHT = 'rowRight';\nexport const COLUMN_BOTTOM = 'colBottom';\nexport const COLUMN_TOP = 'colTop';\nexport const AUTO = 'auto';\nexport const ROW_SPAN = 'rowSpan';\nexport const COL_SPAN = 'colSpan';\nexport const ROW_ROOT = 'rowRoot';\nexport const COLUMN_ROOT = 'columnRoot';\nexport const PRIMARY = 'primary';\nexport const SECONDARY = 'secondary';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const GRID = 'grid';\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n\nexport const PAGINATION = 'pagination';\nexport const BUFFER = 'buffer';\nexport const HOLISTIC = 'holistic';\nexport const SCROLL = 'scroll';\nexport const MIDDLE = 'middle';\nexport const NO_BORDERS = null;\n\nexport const MAX_WIDTH_AVAIL_FOR_COL_MATRIX = 'maxWidthAvailableForColumnMatrix';\nexport const COLUMN_MATRIX = 'columnMatrix';\nexport const MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX = 'maxHeightAvailableForRowMatrix';\nexport const ROW_MATRIX = 'rowMatrix';\n","/* eslint no-undef: \"off\" */\n/* eslint default-case: \"off\" */\nexport class Utils {\n static isDOMElement (element) {\n return element instanceof Element;\n }\n\n static getID (element) {\n return element.id;\n }\n\n static getElement (id) {\n return document.getElementById(id);\n }\n\n static findContainer (data) {\n return data.filter(coordinate => coordinate.parent == null)[0];\n }\n /**\n * static method to remove the div\n * @param {} divId - div ID to be removed.\n */\n static removeDiv (divId) {\n if (document.getElementById(divId) !== null) { document.getElementById(divId).remove(); }\n }\n}\n","import { DEFAULT_CLASS_NAME } from '../constants/defaults';\nimport { LayoutComponent } from '../layout-component';\n\nexport default class DataPoint {\n constructor (node) {\n this._node = node;\n this._className = node.model().host() instanceof LayoutComponent ?\n node.model().host().className() : DEFAULT_CLASS_NAME;\n }\n\n node () {\n return this._node;\n }\n\n hasHost () {\n return this._node.model().host() instanceof LayoutComponent;\n }\n\n className () {\n return this._className || DEFAULT_CLASS_NAME;\n }\n}\n","import { getnodePoints } from './helper';\n\nexport class DataParser {\n constructor (data) {\n this._data = data;\n }\n\n defaultDataPointLogic () {\n const nodepoints = [];\n getnodePoints(this._data, nodepoints);\n return nodepoints;\n }\n\n}\n","import DataPoint from './data-point';\n\nexport const getnodePoints = (node, nodepoints) => {\n const datapoint = new DataPoint(node);\n nodepoints.push(datapoint);\n node.children().forEach((child) => {\n getnodePoints(child, nodepoints);\n });\n};\n","import { DataParser } from './data-parser';\n\nexport class HTMLDataAdapter extends DataParser {\n getCoordinates () {\n return super.defaultDataPointLogic();\n }\n}\n","export class Renderer {\n\n initRenderer (node, tree) {\n node.__logicalTree = tree;\n }\n}\n","import { HTMLDataAdapter } from '../data-adapters/html-data';\nimport { Utils } from '../utils';\nimport { Renderer } from './renderer';\n\nexport class HTMLRenderer extends Renderer {\n constructor (data) {\n super();\n this._data = data;\n this._coordinates = new HTMLDataAdapter(this._data).getCoordinates();\n }\n\n createhtml (mount, className) {\n const mainDiv = mount;\n super.initRenderer(mainDiv, this._data); // Initialise node with layout id\n this.parentDiv = this.createAndCustomiseParent(className);\n this._coordinates.forEach((node) => {\n if (node.hasHost()) {\n const host = node.node();\n this.parentDiv.appendChild(this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: node.className() }));\n }\n });\n mainDiv.appendChild(this.parentDiv);\n }\n\n createAndPositionDiv (config) {\n const { top, left, height, width, className, id } = config;\n const existingDiv = document.getElementById(id);\n const div = existingDiv || document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = `${left}px`;\n div.style.top = `${top}px`;\n div.style.height = `${height}px`;\n div.style.width = `${width}px`;\n div.id = id;\n div.className = className;\n return div;\n }\n\n createAndCustomiseParent (className) {\n const container = Utils.findContainer(this._coordinates);\n const host = container.node();\n const parentDiv = this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: container.className() });\n parentDiv.className = className;\n parentDiv.style.position = 'relative';\n return parentDiv;\n }\n\n coordinates () {\n return this._coordinates;\n }\n}\n","import { selectElement } from 'muze-utils';\nimport { HTMLRenderer } from '../renderers/html-renderer';\nimport { LayoutComponent } from '../layout-component';\n\nexport const getChildNode = (context, config) =>\n context.renderer().createAndPositionDiv(config);\n\nexport const findNode = (context, nodeID) =>\n context.renderer().coordinates().find(point => point.node().id() === nodeID);\n\nexport const renderHTML = (context) => {\n context.renderer(new HTMLRenderer(context.data()));\n context.renderer().createhtml(context.mount(), context.className());\n};\n\nexport const drawLayout = context => renderHTML(context);\n\nexport const drawComponent = (componentData) => {\n componentData.children().forEach((node) => {\n const host = node.model().host();\n if (host instanceof LayoutComponent) {\n host.draw();\n }\n drawComponent(node);\n });\n};\n\nexport const removeElement = (elemID) => {\n if (elemID) {\n selectElement(`#${elemID}`).remove();\n }\n};\n\nconst setAlignConfig = (alignment, params) => {\n let newNodeConfig = {};\n const { node, refNode } = params;\n switch (alignment) {\n case 'left':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(refNode.left - node.left))\n };\n break;\n\n case 'right':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(node.left + node.width - (refNode.left + refNode.width)))\n };\n break;\n\n case 'top':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: Math.abs(node.height - Math.abs(refNode.top - node.top)),\n width: node.width\n };\n break;\n\n case 'bottom':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: Math.abs(node.top - refNode.top + refNode.height),\n width: node.width\n };\n break;\n\n case 'h-center':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: refNode.width\n };\n break;\n\n case 'v-center':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: refNode.top,\n width: node.width\n };\n break;\n default:\n break;\n }\n return newNodeConfig;\n};\n\nexport const resolveAligment = (context, componentData) => {\n componentData.children().forEach((component) => {\n const host = component.model().host();\n\n if (host instanceof LayoutComponent && host.alignWith()) {\n const componentToAlign = context.componentMap().get(host.alignWith());\n\n if (componentToAlign) {\n const point = findNode(context, component.id()).node();\n const node = point.boundBox();\n const refNode = findNode(context, componentToAlign.renderAt())\n .node()\n .boundBox();\n const newNodeConfig = setAlignConfig(host.alignment(), { node, refNode });\n\n // check if model in parent component\n Object.assign(newNodeConfig, { id: point.id(), className: host.className() });\n context.renderer().createAndPositionDiv(newNodeConfig);\n context.componentMap().get(host.name()).setSpatialConfig({\n x: newNodeConfig.left,\n y: newNodeConfig.top,\n height: newNodeConfig.height,\n width: newNodeConfig.width\n\n });\n }\n }\n\n resolveAligment(context, component);\n });\n};\n","import { Utils } from '../utils';\nimport { drawLayout, resolveAligment, drawComponent } from './helper';\n\nexport class DrawingManager {\n constructor (data, renderer, container) {\n this._data = data.tree;\n this._componentMap = data.componentMap;\n this._layoutClassName = data.layoutClassName;\n this._renderer = renderer;\n this._mount = Utils.isDOMElement(container) ? container : Utils.getElement(container);\n }\n\n draw () {\n drawLayout(this);\n resolveAligment(this, this._data);\n drawComponent(this._data);\n return this;\n }\n\n data (data) {\n if (data) {\n this._data = data;\n }\n return this._data;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n className (param) {\n if (param) {\n this._layoutClassName = param;\n }\n return this._layoutClassName;\n }\n\n renderer (param) {\n if (param) {\n this._renderer = param;\n }\n return this._renderer;\n }\n\n mount (param) {\n if (param) {\n this._mount = param;\n }\n return this._mount;\n }\n}\n","import DefinitionModel from './definitionModel';\nimport { prepareTargetComponentMap, getComponent, placeComponent, placeGridComponent } from '../helper';\n\nexport default class DefinitionManager {\n constructor (componentMap, sequence, totalHeight, totalWidth) {\n this._componentMap = componentMap;\n this._prioritySequence = sequence;\n this._totalHeight = totalHeight;\n this._totalWidth = totalWidth;\n this._targetComponentMap = null;\n }\n\n // create the config model\n generateConfigModel () {\n prepareTargetComponentMap(this);\n const canvasComponent = this._targetComponentMap.get('canvas');\n const definitionModel = new DefinitionModel({});\n let tempDefModel = definitionModel;\n definitionModel.remainingHeight(this._totalHeight);\n definitionModel.remainingWidth(this._totalWidth);\n\n let componentRef = null;\n\n this._prioritySequence.forEach((name) => {\n componentRef = getComponent(canvasComponent, name);\n if (name !== 'grid') {\n tempDefModel = placeComponent(tempDefModel, componentRef).second;\n } else {\n tempDefModel = placeGridComponent(tempDefModel, componentRef.component);\n }\n });\n return definitionModel;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n targetComponentMap (param) {\n if (param) {\n this._targetComponentMap = param;\n }\n return this._targetComponentMap;\n }\n}\n","import { sanitizeConfig } from './helper';\n\nexport class LayoutDef {\n constructor () {\n this._componentMap = new Map();\n this._layoutDefinition = null;\n }\n\n addComponent (component) {\n this._componentMap.set(component.name(), component);\n }\n\n layoutDefinition (def) {\n if (def) {\n this._layoutDefinition = def;\n }\n return this._layoutDefinition;\n }\n\n addMultipleComponent (componentArray) {\n componentArray.forEach((comp) => {\n this.addComponent(comp);\n });\n }\n\n sanitizedDefinition () {\n sanitizeConfig(this, this._layoutDefinition);\n return this.layoutDefinition();\n }\n\n componentMap () {\n return this._componentMap;\n }\n resetComponentMap () {\n this._componentMap.clear();\n }\n}\n","import DefinitionManager from '../layout-definition/definition-manager';\n\nexport function sanitizeConfig (context, hostObj) {\n const hostID = hostObj.host();\n if (hostObj.lanes() && hostObj.lanes().length) {\n hostObj.lanes().forEach(childHost => sanitizeConfig(context, childHost));\n }\n if (hostID != null && typeof (hostID) === 'string') {\n if (context.componentMap().get(hostID) !== undefined) {\n hostObj.host(context.componentMap().get(hostID));\n }\n }\n}\n\nexport function calLayOutDef (context) {\n const { height, width } = context.dimension();\n const defManager = new DefinitionManager(context.layoutDef().componentMap(),\n context.prioritySequence(),\n height,\n width);\n const genLayoutdef = defManager.generateConfigModel();\n return genLayoutdef;\n}\n","import {\n LayoutModel\n} from '../layout-definition';\n\nimport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT\n} from '../constants/defaults';\n\nimport {\n GRID\n} from '../../enums/constants';\n\nimport { DrawingManager } from '../drawing-manager';\nimport { removeElement } from '../drawing-manager/helper';\nimport { Utils } from '../utils';\nimport { LayoutDef } from './layout-def';\nimport { calLayOutDef } from './helper';\n\nexport default class LayoutManager {\n constructor (conf) {\n this._renderAt = conf.renderAt;\n this._layoutClassName = conf.className;\n this._dimension = {\n width: conf.width || DEFAULT_WIDTH,\n height: conf.height || DEFAULT_HEIGHT\n };\n\n this._skeletonType = conf.skeletonType || 'html';\n this._layoutDefinition = null;\n this._layoutDef = new LayoutDef();\n this._drawingManager = null;\n this._prioritySequence = [];\n this.tree = null;\n this._rootNodeID = null;\n }\n\n layoutDef (param) {\n if (param) {\n this._layoutDef = param;\n }\n return this._layoutDef;\n }\n\n prioritySequence (param) {\n if (param) {\n this._prioritySequence = param;\n }\n return this._prioritySequence;\n }\n\n dimension (param) {\n if (param) {\n Object.assign(this._dimension, param);\n }\n return this._dimension;\n }\n\n addComponent (component) {\n this._layoutDef.addComponent(component);\n }\n\n addMultipleComponent (componentArray) {\n this._layoutDef.addMultipleComponent(componentArray);\n }\n\n resetNode (node) {\n if (this.con) {\n this.con.resetNode(node);\n }\n }\n\n /**\n * function to update the node and rerender the layout.\n * @param {} config - node configuration to change.\n */\n updateNode (config) {\n this.tree.updateNode(config);\n this._layoutDefinition = this.tree.model;\n this.compute();\n }\n\n compute () {\n //----\n if (Utils.isDOMElement(this._renderAt)) {\n this._renderAt._layout = this;\n } else {\n document.getElementById(this._renderAt)._layout = this;\n }\n //-----\n this._layoutDefinition = calLayOutDef(this);\n this._layoutDef.layoutDefinition(this._layoutDefinition);\n this._layoutDefinition = this._layoutDef.sanitizedDefinition();\n this._layout = new LayoutModel({\n width: this._dimension.width,\n height: this._dimension.height\n },\n this._layoutDefinition);\n this.tree = this._layout.negotiate().tree();\n this._layout.broadcast();\n this._drawingManager = new DrawingManager({\n tree: this.tree,\n componentMap: this._layoutDef.componentMap(),\n layoutClassName: this._layoutClassName\n }, this._skeletonType, this._renderAt);\n\n if (this._rootNodeID) {\n this.tree.id(this._rootNodeID);\n } else {\n this._rootNodeID = this.tree.id();\n }\n // this will draw all the components by calling their draw method\n this._drawingManager.draw();\n }\n\n getRootNodeId () {\n return this._rootNodeID;\n }\n\n /**\n * This function takes the LayoutComponents and Register them in component store\n * @param {Array} layoutComponents\n */\n registerComponents (layoutComponents) {\n this._prioritySequence.length = 0;\n this._layoutDef.resetComponentMap();\n layoutComponents.forEach((container) => {\n if (container) {\n this._prioritySequence.push(container.name());\n this.addComponent(container);\n if (container.name() === 'grid') {\n container.component.forEach((componentArr) => {\n componentArr.forEach((compo) => {\n this.addComponent(compo);\n });\n });\n }\n }\n });\n return this;\n }\n\n getComponent (componentName) {\n return this._layoutDef.componentMap().get(componentName);\n }\n\n deleteElement (component, elementName) {\n this._layoutDef.componentMap().delete(elementName);\n const deleteElementId = component.renderAt();\n return removeElement(deleteElementId);\n }\n\n removeComponent (name) {\n const component = this.getComponent(name);\n if (component) {\n if (name === GRID) {\n return component.component.map(comp => comp.map(\n co => this.deleteElement(co, co.name())\n ));\n }\n return this.deleteElement(component, name);\n }\n return this;\n }\n\n renderAt (mount) {\n if (mount) {\n this._renderAt = mount;\n }\n return this._renderAt;\n }\n}\n","import { isEqual, STATE_NAMESPACES, selectElement, getValueParser } from 'muze-utils';\nimport { VisualGroup } from '@chartshq/visual-group';\nimport { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID }\n from '../constants';\nimport { canvasOptions } from './local-options';\nimport { LayoutManager } from '../../../layout/src/tree-layout';\n\n/**\n * Instantiate high level components. Canvas knows what all high level component it has.\n * @nice-to-have dynamic high level components.\n * - Is it even required ?\n * - Reactive to source (canvas) streaming ?\n * @param {*} context Canvas instance\n * @return {Object.} Arrays of Title, visualGroup, Legend\n */\nexport const initCanvas = (context) => {\n const reg = context._registry.components;\n\n return [new reg.VisualGroup(context._registry, Object.assign({\n throwback: context._throwback\n }, context.dependencies()))];\n};\n\nexport const fixScrollBarConfig = (config) => {\n config.scrollBar.thickness = Math.min(50, Math.max(10, config.scrollBar.thickness));\n return config;\n};\n\nexport const setLayoutInfForUnits = (context) => {\n const layoutManager = context._layoutManager;\n const gridLayout = layoutManager.getComponent(GRID);\n const boundBox = gridLayout && gridLayout.getBoundBox();\n const valueMatrix = context.composition().visualGroup.matrixInstance().value;\n const parentContainer = selectElement(`#${layoutManager.getRootNodeId()}`).node();\n valueMatrix.each((cell) => {\n cell.valueOf().parentContainerInf({\n el: parentContainer,\n dimensions: boundBox\n });\n });\n};\n\n/**\n *\n *\n * @memberof Canvas\n */\nexport const dispatchProps = (context) => {\n const lifeCycleManager = context.dependencies().lifeCycleManager;\n lifeCycleManager.notify({ client: context, action: 'beforeupdate' });\n const visualGroup = context.composition().visualGroup;\n\n const allOptions = context._allOptions;\n for (const key in allOptions) {\n const value = context[key]();\n if (value !== null) {\n visualGroup[key] && visualGroup[key](value);\n }\n }\n const { invalidValues } = context.config();\n\n visualGroup.valueParser(getValueParser(invalidValues));\n visualGroup.createMatrices();\n context._cachedProps = {};\n lifeCycleManager.notify({ client: context, action: 'initialized' });\n lifeCycleManager.notify({ client: context, action: 'updated' });\n};\n\nconst equalityChecker = (props, params) => {\n let checker = () => false;\n return !props.every((option, i) => {\n switch (option) {\n case ROWS:\n case COLUMNS:\n case DETAIL:\n checker = isEqual('Array');\n break;\n\n case SHAPE:\n case SIZE:\n case COLOR:\n case DATA:\n case CONFIG:\n checker = isEqual('Object');\n break;\n default:\n checker = () => true;\n break;\n }\n const oldVal = params[i][0];\n const newVal = params[i][1];\n\n return checker(oldVal, newVal);\n });\n};\n\nconst updateChecker = (props, params) => props.every((option, i) => {\n const val = params[i][1];\n switch (option) {\n case ROWS:\n case COLUMNS:\n return val !== null;\n\n case DATA:\n return val && !val.isEmpty();\n\n default:\n return true;\n\n }\n});\n\nexport const notifyAnimationEnd = (context) => {\n const viewInfo = context.layout().viewInfo();\n const centerMatrix = viewInfo && viewInfo.viewMatricesInfo.matrices.center[1] || [];\n const promises = [];\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n promises.push(cell.valueOf().done());\n });\n });\n const lifeCycleManager = context.lifeCycle();\n if (promises.length) {\n Promise.all(promises).then(() => {\n // Update life cycle\n lifeCycleManager.notify({ client: context, action: 'drawn' });\n const animDonePromises = [];\n\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n cell.valueOf().layers().forEach((layer) => {\n animDonePromises.push(layer.animationDone());\n });\n });\n });\n\n [context.xAxes(), context.yAxes()].forEach((axisArr) => {\n axisArr = axisArr || [];\n axisArr.forEach((axes) => {\n axes.forEach((axisInst) => {\n animDonePromises.push(axisInst.animationDone());\n });\n });\n });\n\n Promise.all(animDonePromises).then(() => {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n });\n });\n } else {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n }\n};\n\nexport const setupChangeListener = (context) => {\n const store = context._store;\n\n const allOptions = Object.keys(context._allOptions);\n const props = [...allOptions, ...Object.keys(canvasOptions)];\n const nameSpaceProps = [...allOptions, ...Object.keys(canvasOptions)].map(prop =>\n `${STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE}.${prop}`);\n store.registerChangeListener(nameSpaceProps, (...params) => {\n const equalityProps = equalityChecker(props, params);\n const updateProps = updateChecker(props, params);\n // inform attached board to rerender\n if (equalityProps && context.mount()) {\n if (updateProps) {\n dispatchProps(context);\n } else {\n context.composition().visualGroup.remove();\n }\n context.render();\n }\n notifyAnimationEnd(context);\n }, true);\n};\n\nexport const applyInteractionPolicy = (firebolt) => {\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n if (visualGroup) {\n const valueMatrix = visualGroup.matrixInstance().value;\n const interactionPolicy = firebolt._interactionPolicy;\n interactionPolicy(valueMatrix, firebolt);\n const crossInteractionPolicy = firebolt._crossInteractionPolicy;\n const behaviours = crossInteractionPolicy.behaviours;\n const sideEffects = crossInteractionPolicy.sideEffects;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n for (const key in behaviours) {\n unitFireBolt.changeBehaviourStateOnPropagation(key, behaviours[key]);\n }\n for (const key in sideEffects) {\n unitFireBolt.changeSideEffectStateOnPropagation(key, sideEffects[key]);\n }\n });\n }\n};\n\n/**\n * Sets the rotation for all x axes if any axis has the rotation config set in the\n * entire view\n *\n * @param {Array} columns Column cells that contain the axes cells\n */\nexport const setLabelRotationForAxes = (context) => {\n let rotation = 0;\n\n const xAxes = context.xAxes() || [];\n\n (() => {\n for (let i = 0; i < xAxes.length; i++) {\n for (let j = 0; j < xAxes[i].length; j++) {\n const rotationVal = xAxes[i][j].renderConfig().labels.rotation;\n if (rotationVal && rotationVal !== 0) {\n rotation = rotationVal;\n return;\n }\n }\n }\n })();\n\n if (rotation) {\n xAxes.forEach((axes) => {\n axes.forEach((axis) => {\n axis.renderConfig({ labels: { rotation } });\n axis.smartTicks(axis.setTickConfig());\n });\n });\n }\n};\n\nexport const createGroupState = (context) => {\n const [globalState, localState] = VisualGroup.getState();\n const store = context._store;\n store.append('app.group', globalState);\n store.append('local.group', localState);\n};\n\nexport const removeChild = (mount) => {\n while (mount.firstChild) {\n mount.removeChild(mount.firstChild);\n }\n};\n\nexport const createLayoutManager = () => {\n const layoutManager = new LayoutManager({\n className: 'muze-group-container'\n });\n return layoutManager;\n};\n","/**\n * This is the global options semantics based on which setters getters are created and reactivity is initiated.\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n * @module GlobalOptions\n */\n\nimport { intSanitizer, mergeRecursive, DataModel } from 'muze-utils';\nimport { fixScrollBarConfig } from './canvas/helper';\nimport { DEFAULT_CONFIG } from './defaults';\n\nexport default {\n data: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel\n }\n },\n width: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n height: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitWidth: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitHeight: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n config: {\n value: [null, null],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n takesMultipleParams: true,\n sanitization: ([config, auxConfig = {}], oldConfig) => {\n // Stores additional config, if passed\n const { reset = false } = auxConfig;\n let oldConf = {};\n\n if (!reset) {\n oldConf = mergeRecursive({}, config === null ? {} : oldConfig);\n }\n\n const defConfig = mergeRecursive(oldConf, DEFAULT_CONFIG);\n const newConf = mergeRecursive(defConfig, config);\n return fixScrollBarConfig(newConf);\n }\n\n }\n }\n};\n","import { sanitizeIP, mergeRecursive } from 'muze-utils';\nimport { TOP, CENTER, BOTTOM } from '../enums/constants';\n\n/*\n * This is the abstract implementation of the root layout. This takes care of common work which all the layouts\n * has to handle. The common work includes sanitizaion of inputs, update, rerender, dispose etc. This class can't be\n * used directly (as ofcourse this is an abstract implementaiton), the class which is implementing it has to implement\n * the necessary methods and gives its on visual.\n */\n\n/**\n * This class is used to create a generic layout. It can be extended to create layouts\n * of different types\n * @class GenericLayout\n */\nexport default class GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config configuration to be given for the layout\n * @param {Object} dependencies external dependencies.\n *\n * @memberof GenericLayout\n *\n */\n constructor (mountPoint, measurement, config, dependencies) {\n this._config = {};\n this._measurement = {};\n this._matrices = [];\n // External dependencies to be included for the layout. This includes the ext global dependencies like\n // smartlabel which has one single implementation of throughout the page or per isntance\n this._dependencies = dependencies;\n\n this.measurement(measurement);\n this.mountPoint(mountPoint);\n this.config(config);\n }\n\n /**\n * Returns an object which is used to recreate the layout.\n * @return {Object} the serialized components\n */\n serialize () {\n return {\n measurement: this.measurement(),\n config: this.config(),\n matrices: this.matrices()\n };\n }\n\n /**\n * Sets/Gets the config for the layout\n * @param {Object} config configuration for the layout\n * @return {Layout|Object} Gets the Config/ Returns this instance when set\n */\n config (config) {\n if (config) {\n this._config = mergeRecursive(this._config || {}, config);\n this._config.border.width = Math.max(0, this._config.border.width);\n return this;\n }\n return this._config;\n }\n\n /**\n * Sets/Gets the measurement for the layout\n * @param {Object} measurement measurement for the layout\n * @return {Layout|Object} Gets the measurement/ Returns this instance when set\n */\n measurement (measurement) {\n if (measurement) {\n this._measurement = mergeRecursive(this._measurement || {}, measurement);\n\n return this;\n }\n return this._measurement;\n }\n\n /**\n * Sets/Gets the matrices for the layout\n * @param {Object} matrices matrices for the layout\n * @return {Layout|Object} Gets the matrices/ Returns this instance when set\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = sanitizeIP.typeObj([TOP, CENTER, BOTTOM], matrices);\n\n return this;\n }\n return this._matrices;\n }\n\n /**\n * Sets/Gets the matrix for row\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n rowMatrix (matrix) {\n if (matrix) {\n this._rowMatrix = matrix;\n return this;\n }\n return this._rowMatrix;\n }\n\n /**\n * Sets/Gets the matrix for columns\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n columnMatrix (matrix) {\n if (matrix) {\n this._columnMatrix = matrix;\n return this;\n }\n return this._columnMatrix;\n }\n\n /**\n * Sets/Gets the matrix for value\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n centerMatrix (matrix) {\n if (matrix) {\n this._centerMatrix = matrix;\n return this;\n }\n return this._centerMatrix;\n }\n\n /**\n * Sets/Gets the mountPoint for the layout\n * @param {Object} mountPoint mountPoint for the layout\n * @return {Layout|Object} Gets the mountPoint/ Returns this instance when set\n */\n mountPoint (mountPoint) {\n if (mountPoint) {\n this._mountPoint = mountPoint;\n\n return this;\n }\n return this._mountPoint;\n }\n}\n","import * as FieldNames from '../enums/constants';\n\n/**\n * Default configuration of the layout\n * @return {Object} returns the default configuration\n */\nexport const DEFAULT_CONFIGURATION = {\n [FieldNames.BORDER]: {\n [FieldNames.STYLE]: 'solid',\n [FieldNames.COLOR]: '#d6d6d6',\n [FieldNames.WIDTH]: 2,\n [FieldNames.COLLAPSE]: true,\n [FieldNames.SPACING]: 0\n },\n [FieldNames.PAGINATION]: 'scroll',\n [FieldNames.BUFFER]: 20,\n [FieldNames.GUTTERSPACE]: { rows: [], columns: [] },\n [FieldNames.DISTRIBUTION]: { rows: [], columns: [] },\n [FieldNames.BREAK_PAGE]: { rows: [], columns: [] },\n [FieldNames.ROW_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_POINTER]: 0,\n [FieldNames.ROW_POINTER]: 0\n};\n\n/**\n * Default measurements for the layout\n * @return {Object} returns the default measurements\n */\nexport const DEFAULT_MEASUREMENTS = {\n [FieldNames.GRID_WIDTH]: 100,\n [FieldNames.GRID_HEIGHT]: 100,\n [FieldNames.UNIT_WIDTH]: 100,\n [FieldNames.UNIT_HEIGHT]: 100\n};\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n","/**\n * This file exports utility functions that are used across the layout module\n */\nimport { Symbols } from 'muze-utils';\nimport { PRIMARY, SECONDARY, HEIGHT, WIDTH } from '../enums/constants';\n\nconst nest = Symbols.nest;\n/**\n *\n *\n * @param {*} isTransposed\n *\n */\nconst getMeasureInfo = (isTransposed) => {\n if (isTransposed) {\n return {\n firstMeasure: HEIGHT,\n secondMeasure: WIDTH\n };\n }\n return {\n firstMeasure: WIDTH,\n secondMeasure: HEIGHT\n };\n};\n\n/**\n *\n *\n * @param {*} i\n * @param {*} page\n *\n */\nconst findInPage = (i, page) => {\n let count = 0;\n for (const x in page) {\n if (i < page[x]) {\n count = x;\n break;\n }\n }\n return count;\n};\n\n/**\n * Creates a single matrix from two matrices\n *\n * @param {Array} matrix Input matrix\n * @return {Array} Joined matrix\n * @memberof VisualMatrix\n */\nexport const combineMatrices = (matrix, config) => {\n const { isTransposed } = config;\n let joinedMatrix = matrix[0].length > 0 ? matrix[0] : matrix[1];\n if (isTransposed) {\n joinedMatrix = matrix[0].length > 0 ? [...matrix[0]] : [];\n joinedMatrix = matrix[1].length > 0 ? [...joinedMatrix, ...matrix[1]] : joinedMatrix;\n } else {\n joinedMatrix = joinedMatrix.map((row, rowIndex) => {\n let rowData = [];\n if (matrix[0].length > 0) {\n rowData = [...matrix[0][rowIndex]];\n }\n if (matrix[1].length > 0) {\n rowData = [...rowData, ...matrix[1][rowIndex]];\n }\n return rowData;\n });\n }\n return joinedMatrix;\n};\n\n/**\n * Creates a hirachical tree from the context\n *\n * @param {Object} context context for creating tree\n * @return {Object} nested tree\n */\nexport const createTree = (context) => {\n let matrixTree = {};\n let lastLevelKey = 0;\n let facet = PRIMARY;\n const nestFn = nest();\n const keys = [];\n const layoutMatrix = context._layoutMatrix;\n const primaryMatrix = context.primaryMatrix();\n const secondaryMatrix = context.secondaryMatrix();\n const { isTransposed, breakPage } = context.config();\n\n if (!isTransposed) {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix[0].length - 1; i++) {\n keys.push(i);\n }\n keys.push(primaryMatrix[0].length - 1);\n if (facet === SECONDARY || secondaryMatrix.length === 0) {\n lastLevelKey = primaryMatrix[0].length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const keyLength = primaryMatrix.length > 0 ? primaryMatrix[0].length : 0;\n for (let i = secondaryMatrix[0].length - 1; i > 0; i--) {\n keys.push(i + keyLength);\n }\n keys.push(keyLength);\n\n if (facet === PRIMARY) {\n lastLevelKey = keyLength;\n }\n } else {\n lastLevelKey = primaryMatrix.length > 0 ? primaryMatrix[0].length - 1 : 0;\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n matrixTree = nestFn.entries(layoutMatrix);\n } else {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix.length - 1; i++) {\n keys.push(i);\n }\n // if (facet === PRIMARY) {\n keys.push(primaryMatrix.length - 1);\n // } else {\n if (facet === SECONDARY) {\n lastLevelKey = primaryMatrix.length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const primaryMatrixLength = primaryMatrix.length;\n for (let i = secondaryMatrix.length - 1; i > 0; i--) {\n keys.push(i + primaryMatrixLength);\n }\n // if (facet === SECONDARY) {\n keys.push(primaryMatrixLength);\n // }\n if (facet === PRIMARY) {\n lastLevelKey = primaryMatrixLength;\n }\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n let newMatrix = [];\n newMatrix = layoutMatrix[0].map((col, colIndex) => layoutMatrix.map(row => row[colIndex]));\n matrixTree = nestFn.entries(newMatrix);\n }\n return { tree: matrixTree, lastLevelKey };\n};\n\n/**\n * Gives the min measues\n *\n * @param {boolean} isTransposed is column matrix\n * @param {Object} unitMeasures min measures to be given to cells\n * @return {Object} dimension min cell\n */\nexport const getMinMeasures = (isTransposed, unitMeasures) => {\n if (!isTransposed) {\n return {\n height: unitMeasures.height,\n width: 0\n };\n }\n return {\n height: 0,\n width: unitMeasures.width\n };\n};\n\n/**\n * Get the logical space from the tree\n *\n * @param {Node} item tree to be calculated\n * @param {number} measures width and height\n * @param {Array} minMeasures min measures for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} dimension\n */\nexport const getLogicalSpace = (item, measures, minMeasures, maxMeasure = []) => {\n const { firstMeasure, secondMeasure } = measures;\n let firstMeasureValue = 0;\n let secondMeasureValue = 0;\n item.values.forEach((valueArray) => {\n let fMeasure = 0;\n let sMeasure = 0;\n valueArray.forEach((placeholder, colIndex) => {\n placeholder.setAvailableSpace();\n const space = placeholder.getLogicalSpace();\n const minSecondMeasure = placeholder.getMinMeasures(minMeasures[secondMeasure]);\n\n sMeasure = Math.max(sMeasure, +space[secondMeasure], minSecondMeasure);\n maxMeasure[colIndex] = Math.max(maxMeasure[colIndex] || 0, space[firstMeasure]);\n fMeasure += +maxMeasure[colIndex];\n });\n secondMeasureValue += sMeasure;\n firstMeasureValue = Math.max(firstMeasureValue, fMeasure);\n item.space = {\n [secondMeasure]: Math.ceil(secondMeasureValue),\n [firstMeasure]: Math.ceil(firstMeasureValue)\n };\n });\n return {\n [secondMeasure]: secondMeasureValue,\n [firstMeasure]: firstMeasureValue\n };\n};\n\n/**\n * Computes the logical spcae taken by the matrix tree\n *\n * @param {*} [item={}] tree to be viewed\n * @param {boolean} [isTransposed=false] is column matrix\n * @param {*} unitMeasures min measues for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} logical space taken\n */\nexport const computeLogicalSpace = (item = {}, config, maxMeasures) => {\n const { isTransposed = false, unitMeasures } = config;\n const { firstMeasure, secondMeasure } = getMeasureInfo(isTransposed);\n const { values } = item;\n const minMeasures = getMinMeasures(isTransposed, unitMeasures);\n\n if (values[0].key) {\n const logicalSpace = { [firstMeasure]: 0, [secondMeasure]: 0 };\n\n values.forEach((valueItem) => {\n // Compute logical space for lowest level\n const space = computeLogicalSpace(valueItem, config, maxMeasures);\n // Set logical space for first measure\n logicalSpace[firstMeasure] = Math.max(logicalSpace[firstMeasure], space[firstMeasure],\n minMeasures[firstMeasure]);\n\n // Set logical space for second measure\n logicalSpace[secondMeasure] += +space[secondMeasure];\n });\n item.space = logicalSpace;\n return logicalSpace;\n }\n\n return getLogicalSpace(item, { firstMeasure, secondMeasure }, minMeasures, maxMeasures);\n};\n\n/**\n * Gives the space taken by a row\n *\n * @param {Array} row matrix array of rows\n * @return {Object} dimension of the row\n */\nexport const spaceTakenByRow = (row) => {\n let height = 0;\n let width = 0;\n row.forEach((col) => {\n const spaces = col.getLogicalSpace();\n height = Math.max(height, spaces.height);\n width += spaces.width;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Gives the space taken by a column\n *\n * @param {Array} matrix column matrix\n * @param {number} colIndex column index\n * @return {Object} dimension of the column\n */\nexport const spaceTakenByColumn = (matrix, colIndex) => {\n let height = 0;\n let width = 0;\n matrix.forEach((row) => {\n const col = row[colIndex];\n const spaces = col.getLogicalSpace();\n width = Math.max(width, spaces.width);\n height += spaces.height;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Creates different level matrices\n *\n * @param {Object} item matrix tree\n * @param {boolean} isTransposed is column matrix\n * @return {Object} matrix of each level\n */\nexport const createMatrixEachLevel = (item, isTransposed) => {\n if (item.values[0].key) {\n const arr = [];\n item.values.forEach((child) => {\n if (!isTransposed) {\n arr.push(...createMatrixEachLevel(child, isTransposed));\n } else {\n const eachLevel = createMatrixEachLevel(child, isTransposed);\n eachLevel.forEach((e, i) => {\n arr[i] = arr[i] || [];\n arr[i].push(...e);\n });\n }\n });\n item.matrix = arr;\n return arr;\n }\n if (!isTransposed) {\n item.matrix = item.values;\n } else {\n item.matrix = item.values[0].map((col, colIndex) => item.values.map(row => row[colIndex]));\n }\n return item.matrix;\n};\n\n/**\n * Breaks the matrix into two part\n *\n * @param {Array} matrix input matrix\n * @param {boolean} isTransposed is column matrix\n * @param {number} breakPointer point in matrix where it is to be broken\n * @return {Array} two broken matrix\n */\nexport const breakMatrix = (matrix, isTransposed, breakPointer) => {\n const primaryMatrix = [];\n const secondaryMatrix = [];\n if (isTransposed) {\n matrix.forEach((row, rowIndex) => {\n if (rowIndex >= breakPointer) {\n secondaryMatrix.push(row);\n } else {\n primaryMatrix.push(row);\n }\n });\n } else {\n matrix.forEach((row, rowIndex) => {\n row.forEach((column, columnIndex) => {\n if (columnIndex >= breakPointer) {\n secondaryMatrix[rowIndex] = secondaryMatrix[rowIndex] || [];\n secondaryMatrix[rowIndex].push(column);\n } else {\n primaryMatrix[rowIndex] = primaryMatrix[rowIndex] || [];\n primaryMatrix[rowIndex].push(column);\n }\n });\n });\n }\n return [primaryMatrix, secondaryMatrix];\n};\n\n/**\n * Distributed width returned\n *\n * @param {Object} context context for the width distibution\n * @return {number} distributed widths\n */\nexport const getDistributedWidth = (context, layoutConfig) => {\n const {\n availableWidth,\n width,\n row\n } = context;\n const {\n isDistributionEqual,\n isTransposed,\n distribution\n } = layoutConfig;\n let distSum = 0;\n if (distribution && distribution[0]) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n return row.map((col, colIndex) => {\n const space = col.getLogicalSpace().width;\n let distWidth = (space + (availableWidth - width) * (space / width));\n if (isTransposed) {\n if (distribution.length > 0) {\n distWidth = (availableWidth * distribution[colIndex] / distSum);\n } else if (isDistributionEqual || width === 0) {\n const rowLen = row.length;\n distWidth = (availableWidth / rowLen);\n }\n }\n return Math.floor(distWidth);\n });\n};\n\n/**\n * Distributeed heights returned\n *\n * @param {Object} context input for the height distribution\n * @return {Object} distribured heights\n */\nexport const getDistributedHeight = (context) => {\n let distSum = 0;\n let gutterSum = 0;\n let heightWithoutGutter = 0;\n const {\n isTransposed,\n distribution,\n availableHeight,\n height,\n isDistributionEqual,\n gutter,\n matrix,\n cIdx\n } = context;\n\n if (distribution && distribution[0] !== undefined) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n if (gutter && gutter[0] !== undefined) {\n gutterSum = gutter.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n heightWithoutGutter = availableHeight - Math.floor(availableHeight * gutterSum);\n\n const colLen = matrix.length;\n return matrix.map((row, rIdx) => {\n const col = row[cIdx];\n const space = col.getLogicalSpace().height;\n let distHeight = (space + (heightWithoutGutter - height) * (space / height));\n\n if (!isTransposed) {\n if (distribution.length > 0 && colLen === distribution.length) {\n distHeight = (heightWithoutGutter * distribution[rIdx] / distSum);\n } else if (isDistributionEqual || context.height === 0) {\n distHeight = (heightWithoutGutter / colLen);\n }\n }\n return Math.floor(distHeight);\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} beg\n * @param {*} end\n */\nexport const extraCellsRemover = (arr, beg, end) => arr.slice(beg, -end);\n\n/**\n * Creates matrix instancess\n *\n * @param {Array} [arr=[]] mutated arry\n * @param {number} depth depth of the tree\n * @param {Array} matrixInfo Details about the matrix(tree, etc) to be inserted\n * @param {boolean} layout Instance of layout\n */\nexport const createMatrixInstances = (arr = [], depth, matrixInfo, layout) => {\n const breakPointer = layout._breakPointer;\n const config = layout.config();\n const {\n isTransposed\n } = config;\n const {\n tree,\n layoutMatrix\n } = matrixInfo;\n\n if (depth === 0) {\n const brokenMatrix = breakMatrix(tree.matrix, isTransposed, breakPointer);\n arr.push({\n matrix: tree.matrix,\n primaryMatrix: brokenMatrix[0],\n secondaryMatrix: brokenMatrix[1],\n space: tree.space\n });\n return arr;\n }\n const nextLevel = depth - 1;\n tree.values.forEach((e) => {\n createMatrixInstances(arr, nextLevel, {\n tree: e,\n layoutMatrix\n }, layout);\n });\n return arr;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n maxMeasures: {},\n availableSpace: {},\n logicalSpace: {}\n};\n","import { PRIMARY } from '../enums/constants';\n/**\n *\n *\n */\nexport const defaultConfig = {\n distribution: [],\n classPrefix: 'muze',\n isDistributionEqual: true,\n unitMeasures: {\n height: 100,\n width: 100,\n border: 1\n },\n isTransposed: false,\n facet: PRIMARY,\n extraCellLengths: []\n};\n","import { mergeRecursive, generateGetterSetters, ERROR_MSG } from 'muze-utils';\nimport {\n createTree,\n combineMatrices,\n createMatrixInstances\n } from '../utils';\nimport { PROPS } from './props';\nimport { HEIGHT, WIDTH } from '../enums/constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n // Prepare matrices\n this._lastLevelKey = 0;\n this._primaryMatrix = matrix[0] || [];\n this._secondaryMatrix = matrix[1] || [];\n this._maxMeasures = [];\n this._availableSpace = {};\n\n // Store the config\n generateGetterSetters(this, PROPS);\n const defCon = Object.assign({}, this.constructor.defaultConfig());\n this.config(mergeRecursive(defCon, config));\n\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n computeViewableSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getPriorityDistribution () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @param {*} params\n * @returns\n * @memberof VisualMatrix\n */\n primaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._primaryMatrix;\n }\n\n secondaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._secondaryMatrix;\n }\n\n tree (...params) {\n if (params.length) {\n return this;\n }\n return this._tree;\n }\n\n static defaultConfig () {\n return defaultConfig;\n }\n\n createTree () {\n const { tree, lastLevelKey } = createTree(this);\n this._lastLevelKey = lastLevelKey;\n return tree;\n }\n\n /**\n * Returns the space taken by visual matrix\n *\n * @return {Object} space taken by the matrix\n * @memberof VisualMatrix\n */\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n /**\n * Sets the provied space to the visual matrix\n *\n * @param {number} width width provided\n * @param {number} height height provided\n * @memberof VisualMatrix\n */\n setAvailableSpace (width, height) {\n this.availableSpace({ width, height });\n const tree = this.tree();\n const heightMeasures = this.populateMaxMeasures(HEIGHT, tree);\n const widthMeasures = this.populateMaxMeasures(WIDTH, tree);\n const depth = this.calculateDepth(widthMeasures, heightMeasures);\n\n this.viewableMatrix = this.createViewPortMatrix(depth);\n this.viewableMeasures = this.redistributeSpaces(width, height);\n return this;\n }\n\n /**\n * Populate the max measures in the array\n *\n * @param {Array} measures array to be filled with max measures\n * @param {Object} matrixTree matrix tree of visual matrix\n * @param {number} measure width or height\n * @param {number} [depth=0] depth of the tree that to be calculated\n * @memberof VisualMatrix\n */\n populateMaxMeasures (type, matrixTree, depth = 0, measures = []) {\n measures[depth] = Math.max(measures[depth] || 0, matrixTree.space[type]);\n if (matrixTree.values) {\n const childDepth = depth + 1;\n matrixTree.values.forEach((child) => {\n if (child.space) {\n measures = this.populateMaxMeasures(type, child, childDepth, measures);\n }\n });\n }\n return measures;\n }\n\n /**\n * Gets the viewable measures for the current viewable matrix\n *\n * @return {Object} Set of viewable measures\n * @memberof VisualMatrix\n */\n getViewableSpaces () {\n return this.viewableMeasures;\n }\n\n /**\n * Returns the matrix that can be viewed in the current viewport\n *\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n getViewableMatrices () {\n return this.viewableMatrix;\n }\n\n /**\n * Creates the viewport that can be viewed together\n *\n * @param {number} depth maxDepth that can be viewed in the viewport\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n createViewPortMatrix (depth) {\n const arr = [];\n createMatrixInstances(arr, depth, this.removeExtraCells(), this);\n return arr;\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n combineMatrices,\n spaceTakenByColumn,\n getDistributedHeight,\n computeLogicalSpace,\n createMatrixEachLevel\n } from '../utils';\nimport { ROW_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class RowVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = (matrix[0].length > 0 ? matrix[0][0].length : 0);\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n\n // Create Tree\n this._tree = {\n key: ROW_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, false);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height\n } = measures;\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i };\n const { widths, rowHeights, columnWidths } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = [height, height];\n const columnMeasures = widths;\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n tree.matrix = extraCellsRemover(tree.matrix, begCellLen, endCellLen);\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n let remainingAvailWidth;\n let remainingWidth;\n let cWidths = [];\n let conditions = [];\n let maxPrioritySpace = 0;\n const {\n matrix,\n width: availableWidth,\n maxMeasures: maxWidths,\n maxWidth: currentWidth,\n height\n } = measures;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length ? this.primaryMatrix()[0].length : 0;\n\n const dist = [];\n\n remainingAvailWidth = availableWidth;\n remainingWidth = currentWidth;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n // divider = Math.min(2, matrixLen);\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n // divider = Math.min(1, matrixLen);\n }\n conditions.forEach((i) => {\n dist[i] = maxWidths[i];\n maxPrioritySpace += maxWidths[i];\n remainingAvailWidth -= dist[i];\n remainingWidth -= dist[i];\n });\n matrix[0].forEach((e, i) => {\n if (conditions.indexOf(i) === -1) {\n dist[i] = remainingAvailWidth * (maxWidths[i] / remainingWidth);\n }\n });\n matrix.forEach(row => row.forEach((col, cIdx) => {\n if (conditions.indexOf(cIdx) === -1) {\n col.setAvailableSpace(dist[cIdx], height);\n\n cWidths[cIdx] = Math.max(cWidths[cIdx] || 0, Math.floor(col.getLogicalSpace().width));\n } else {\n cWidths[cIdx] = 0;\n }\n }));\n\n const prioritySpace = availableWidth - cWidths.reduce((t, n) => t + n);\n if (prioritySpace < 0) {\n cWidths = cWidths.map(() => 0);\n } else {\n conditions.forEach((i) => {\n cWidths[i] = Math.floor(prioritySpace * (dist[i] / maxPrioritySpace || 1));\n });\n }\n return cWidths;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures, heightMeasures) {\n let i;\n const { height } = this.availableSpace();\n\n for (i = 0; i < heightMeasures.length; i++) {\n if (heightMeasures[i] <= height) break;\n }\n\n return Math.min(widthMeasures.length - 1, i);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n const maxMeasures = this.maxMeasures();\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n const logicalWidths = this.getPriorityDistribution({\n matrix: this._layoutMatrix,\n maxWidth,\n maxMeasures,\n width,\n height\n });\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths, logicalWidths };\n const measures = this.redistributeViewSpaces(options);\n maxWidths = measures.maxWidths;\n maxHeights = measures.maxHeights;\n });\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let cWidths = [];\n let rHeights = [];\n let mHeight = 0;\n const maxMeasures = this.maxMeasures();\n\n const {\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n } = this.config();\n const { matrix, height, maxHeights, maxWidths, logicalWidths } = measures;\n mHeight = spaceTakenByColumn(matrix, this._lastLevelKey).height;\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n measures.maxMeasures = maxMeasures;\n measures.maxWidth = maxWidth;\n if (maxWidth > 0) {\n cWidths = logicalWidths;\n } else {\n cWidths = maxMeasures.map(() => 0);\n }\n rHeights = getDistributedHeight({\n matrix,\n cIdx: this._lastLevelKey,\n height: mHeight,\n availableHeight: height,\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n });\n if (maxWidths.length > 0) {\n cWidths = cWidths.map((e, i) => Math.max(e, maxWidths[0][i] || 0));\n }\n maxWidths.push(cWidths);\n for (let x = 0; x < maxWidths.length; x++) {\n maxWidths[x] = cWidths;\n }\n maxHeights.push(rHeights);\n return { maxWidths, maxHeights };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = maxHeights[matrixIndex][rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth, colHeight - borderWidth);\n\n if (rIdx === 0 && cIdx < breakPointer) {\n columnWidths[0][cIdx] = colWidth;\n widths[0] = (widths[0] || 0) + colWidth;\n } else if (rIdx === 0 && cIdx >= breakPointer) {\n columnWidths[1][cIdx - breakPointer] = colWidth;\n widths[1] = (widths[1] || 0) + colWidth;\n }\n if (cIdx === this._lastLevelKey) {\n rowHeights[0][rIdx] = colHeight;\n rowHeights[1][rIdx] = colHeight;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n getDistributedWidth,\n spaceTakenByRow,\n createMatrixEachLevel,\n computeLogicalSpace\n } from '../utils';\nimport { COLUMN_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class ColumnVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = matrix[0].length;\n\n // Create Tree\n this._tree = {\n key: COLUMN_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, true);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height,\n width\n } = measures;\n\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i, height };\n const {\n heights,\n rowHeights,\n columnWidths\n } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = heights;\n const columnMeasures = [width, width];\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n\n tree.matrix = tree.matrix.map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n const {\n height,\n maxHeights\n } = measures;\n let remainingHeight = height;\n let heightDist = [];\n let conditions = [];\n let divider = 2;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n divider = 2;\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n divider = 1;\n }\n maxHeights.forEach((heights, index) => {\n if (conditions.indexOf(index) === -1) {\n heightDist[index] = heights;\n remainingHeight -= heights;\n }\n });\n if (remainingHeight < 0) {\n heightDist = heightDist.map(() => 0);\n } else {\n conditions.forEach((condition) => {\n heightDist[condition] = Math.min(maxHeights[condition], (remainingHeight) / divider);\n });\n }\n return heightDist;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures) {\n let j;\n const { width } = this.availableSpace();\n\n for (j = 0; j < widthMeasures.length; j++) {\n if (widthMeasures[j] <= width) break;\n }\n return Math.min(widthMeasures.length - 1, j);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths };\n const maxMeasures = this.redistributeViewSpaces(options);\n maxWidths = maxMeasures.maxWidths;\n maxHeights = maxMeasures.maxHeights;\n });\n\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space column wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let rHeights = [];\n const {\n matrix,\n width,\n maxHeights,\n maxWidths\n } = measures;\n const borderWidth = this.config().unitMeasures.border;\n\n const mWidth = spaceTakenByRow(matrix[this._lastLevelKey]).width;\n const cWidths = getDistributedWidth({\n row: matrix[this._lastLevelKey],\n width: mWidth,\n availableWidth: width\n }, this.config());\n\n matrix.forEach((row, rIdx) => row.forEach((col, cIdx) => {\n const oldLogicalSpace = col.getLogicalSpace();\n\n col.setAvailableSpace(cWidths[cIdx] - borderWidth, oldLogicalSpace.height);\n\n rHeights[rIdx] = Math.max(rHeights[rIdx] || 0, Math.floor(col.getLogicalSpace().height));\n }));\n if (maxHeights.length > 0) {\n rHeights = rHeights.map((e, i) => Math.max(e, maxHeights[0][i]));\n }\n maxHeights.push(rHeights);\n for (let x = 0; x < maxHeights.length; x++) {\n maxHeights[x] = rHeights;\n }\n maxWidths.push(cWidths);\n return { maxHeights, maxWidths };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, height, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n const heightDistribution = this.getPriorityDistribution({ height, maxHeights: maxHeights[0] || [] });\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = heightDistribution[rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth - borderWidth, colHeight);\n\n if (cIdx === 0 && rIdx < breakPointer) {\n rowHeights[0][rIdx] = colHeight;\n heights[0] = (heights[0] || 0) + colHeight;\n } else if (cIdx === 0 && rIdx >= breakPointer) {\n rowHeights[1][rIdx - breakPointer] = colHeight;\n heights[1] = (heights[1] || 0) + colHeight;\n }\n if (rIdx === this._lastLevelKey) {\n columnWidths[0][cIdx] = colWidth;\n columnWidths[1][cIdx] = colWidth;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import {\n HEIGHT, WIDTH, COLUMN, ROW, HORIZONTAL, VERTICAL, HOLISTIC,\n MAX_WIDTH_AVAIL_FOR_COL_MATRIX, COLUMN_MATRIX, MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX, ROW_MATRIX, SCROLL\n} from '../enums/constants';\n\n/**\n * Gets measurement for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @return {Object} Logical height/width of the matrix\n */\nexport function getMatrixMeasurement (matrix, type) {\n if (matrix) {\n return matrix.getLogicalSpace()[type];\n }\n return 0;\n}\n\n/**\n * Sets available space for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @param {number} value Value of measurement\n */\nexport function setMatrixMeasurement (matrix, type, value) {\n if (matrix) {\n const spaces = matrix.getLogicalSpace();\n if (value && spaces[type] !== value) {\n type === HEIGHT ? matrix.setAvailableSpace(spaces.width, value) :\n matrix.setAvailableSpace(value, spaces.height);\n }\n }\n}\n\nconst setAvailableSpace = (matrix, widths, heights) => {\n matrix.forEach((row, rIdx) => {\n row.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(widths[cIdx], heights[rIdx]);\n });\n });\n};\n\nconst setViewSpaces = (layout, pointerType, viewSpaces) => {\n let pointer = layout.config()[`${pointerType}Pointer`];\n if (viewSpaces.length - 1 < pointer) {\n pointer = 0;\n layout.config({ [`${pointerType}Pointer`]: pointer });\n }\n return pointer;\n};\n\nconst paginationDetailsMap = {\n column: {\n maxMeasure: MAX_WIDTH_AVAIL_FOR_COL_MATRIX,\n matrix: COLUMN_MATRIX,\n measureType: WIDTH,\n scrollType: HORIZONTAL\n },\n row: {\n maxMeasure: MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX,\n matrix: ROW_MATRIX,\n measureType: HEIGHT,\n scrollType: VERTICAL\n }\n};\n\n/**\n * This method provides the required width/height in the different pagination stages.\n * If the pagination is holistic, then only the max width/height will be provided for layouting\n * If scroll is enabled, then the entire width/height shall be provided for layouting\n * Note: width is required for scrolling the columns while height is required for scrolling rows\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {Object} measureDetails different measure details for row/column\n * @param {number} maxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst getMatrixMeasureForPagination = (layout, measureDetails, maxMeasure, buffer) => {\n const {\n pagination\n } = layout.config();\n const {\n matrix,\n measureType,\n scrollType\n } = measureDetails;\n\n switch (pagination) {\n case HOLISTIC:\n return maxMeasure;\n default: {\n const actualMeasure = getMatrixMeasurement(layout[matrix](), measureType) + buffer;\n\n if (actualMeasure > maxMeasure) {\n layout.scrollInfo({ [scrollType]: true });\n }\n return Math.max(maxMeasure, actualMeasure);\n }\n }\n};\n\n/**\n * This method uses the getMatrixMeasureForPagination function to calculate maximum measure\n * depending on the layouting algorithm used\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {string} matrixType row/column\n * @param {number} relatedMaxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst paginationMeasureGetter = (layout, matrixType, relatedMaxMeasure, buffer) =>\n getMatrixMeasureForPagination(layout, paginationDetailsMap[matrixType], relatedMaxMeasure, buffer);\n\nconst getMatrixWidthDetails = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const {\n width\n } = layout.measurement();\n const {\n border,\n buffer\n } = layout.config();\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get width of row matrix\n const rowMatrixWidth = getMatrixMeasurement(rowMatrix, WIDTH);\n\n // Get maximum width allowed for the row matrix\n const maxRowMatrixWidth = Math.min(rowMatrixWidth + buffer, width / 2);\n\n // Get maximum width available for the column matrix\n const maxWidthAvailableForColumnMatrix = width - maxRowMatrixWidth - borderWidth;\n\n // Set width for column matrix\n const columnMatrixWidth = paginationMeasureGetter(layout, COLUMN, maxWidthAvailableForColumnMatrix, 0);\n\n return {\n rowMatrixWidth,\n maxRowMatrixWidth,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n\nconst getHeightRequiredByColMatrix = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const columnMatrix = layout.columnMatrix();\n\n // Get maximum allowed height for colum matrix\n const maxColumnMatrixHeight = Math.min(columnMatrix.getLogicalSpace().height, height / 2);\n\n // Set the computed width and max height to column matrix to determine the actual height\n // that will be taken by the column matrix\n columnMatrix.setAvailableSpace(columnMatrixWidth, maxColumnMatrixHeight);\n\n // Get the set of pages column view\n const columnViewPages = columnMatrix.getViewableSpaces();\n\n // Figuring out total space needed by current view space\n const columnViewSpace = columnViewPages[layout.config().columnPointer];\n\n // Getting height of column matrix\n const columnMatrixHeight = columnViewSpace.height.primary + columnViewSpace.height.secondary;\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight\n };\n};\n\nconst getMatrixHeightDetails = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const {\n buffer\n } = layout.config();\n\n // Get actual height required by column matrix\n const { columnMatrixHeight, maxColumnMatrixHeight } = getHeightRequiredByColMatrix(layout, columnMatrixWidth);\n\n // Based on column height, compute max height available for row matrix\n const maxHeightAvailableForRowMatrix = height - Math.min(maxColumnMatrixHeight, columnMatrixHeight);\n\n // Get height for row matrix\n const rowMatrixHeight = paginationMeasureGetter(layout, ROW, maxHeightAvailableForRowMatrix, buffer);\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n };\n};\n\nconst setValueMatrixMeasurements = (layout, rowViewableSpaces, columnViewableSpaces) => {\n const centerMatrix = layout.centerMatrix();\n\n const {\n border\n } = layout.config();\n const matrices = layout.matrices();\n const {\n top,\n bottom\n } = matrices;\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get the heights for each cell in the row matrix\n const rowHeights = [].concat(...rowViewableSpaces.map(e => e.rowHeights.primary));\n\n // Get the widths for each of the row matrix cells(primary and secondary)\n const rowWidthsPrimary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.primary));\n const rowWidthsSecondary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.secondary));\n\n // Get the widths for each cell in the column matrix\n const columnWidths = [].concat(...columnViewableSpaces.map(e => e.columnWidths.primary));\n\n // Get the widths for each of the column matrix cells(primary and secondary)\n const columnHeightsPrimary = columnViewableSpaces[0].rowHeights.primary;\n const columnHeightsSecondary = [].concat(...columnViewableSpaces.map(e => e.rowHeights.secondary));\n\n // Setting the available space for each cell in the centre matrix computed throught the row and\n // column matrices\n centerMatrix.forEach((matrix, rIdx) => {\n matrix.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(columnWidths[cIdx] - borderWidth, rowHeights[rIdx] - borderWidth);\n });\n });\n\n // Set the heights and widths for the corner matrices namely:\n // TOP_LEFT\n setAvailableSpace(top[0], rowWidthsPrimary, columnHeightsPrimary);\n // TOP_RIGHT\n setAvailableSpace(top[2], rowWidthsSecondary, columnHeightsPrimary);\n // BOTTOM_LEFT\n setAvailableSpace(bottom[0], rowWidthsPrimary, columnHeightsSecondary);\n // BOTTOM_RIGHT\n setAvailableSpace(bottom[2], rowWidthsSecondary, columnHeightsSecondary);\n};\n\nconst bufferCondition = {\n isScroll: true,\n pagination: SCROLL\n};\n\nconst getBufferFromCondition = (layout, type) => {\n const scrollInfo = layout.scrollInfo();\n const {\n pagination\n } = layout.config();\n\n const currentBufferType = {\n pagination,\n isScroll: scrollInfo[type]\n };\n\n return Object.keys(bufferCondition).every(e => bufferCondition[e] === currentBufferType[e]);\n};\n\nconst getActualBufferFromConfig = (layout) => {\n const {\n buffer\n } = layout.config();\n const [horizontalBuffer, verticalBuffer] = [HORIZONTAL, VERTICAL].map((type) => {\n if (getBufferFromCondition(layout, type)) {\n return buffer;\n }\n return 0;\n });\n\n return {\n horizontalBuffer,\n verticalBuffer\n };\n};\n/**\n * Computes the measurements of space for all matrices in the\n * layout\n *\n * @param {Object} layout Instance of grid layout\n * @return {Object} set of measurements for the layout\n */\nexport const computeLayoutMeasurements = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n\n // Compute the widths of the row and column matrices\n const {\n rowMatrixWidth,\n maxRowMatrixWidth,\n maxWidthAvailableForColumnMatrix,\n columnMatrixWidth\n } = getMatrixWidthDetails(layout);\n\n // Compute the heights of the row and column matrices\n const {\n columnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n } = getMatrixHeightDetails(layout, columnMatrixWidth);\n\n const {\n horizontalBuffer,\n verticalBuffer\n } = getActualBufferFromConfig(layout);\n rowMatrix.setAvailableSpace(maxRowMatrixWidth - verticalBuffer, rowMatrixHeight - horizontalBuffer);\n\n // Get row and columns viewable spaces\n const rowViewableSpaces = rowMatrix.getViewableSpaces();\n const columnViewableSpaces = columnMatrix.getViewableSpaces();\n\n // Set view spaces for row and columns\n setViewSpaces(layout, ROW, rowViewableSpaces);\n setViewSpaces(layout, COLUMN, columnViewableSpaces);\n\n // Set measures for each cell of the value matrix\n setValueMatrixMeasurements(layout, rowViewableSpaces, columnViewableSpaces);\n\n return {\n rowMatrixHeight: rowMatrixHeight - horizontalBuffer,\n rowMatrixWidth: rowMatrixWidth - verticalBuffer,\n maxHeightAvailableForRowMatrix: maxHeightAvailableForRowMatrix - horizontalBuffer,\n\n columnMatrixHeight,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n","/**\n * Gets view matrices based on current pointers for row and column\n *\n * @param {Object} layout instance of layout\n * @param {number} rowPointer current row pointer\n * @param {number} columnPointer current column pointer\n * @return {Object} returns the view matrix and its relevant information\n */\nexport const getViewMatrices = (layout, rowPointer, columnPointer) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const centerMatrix = layout.centerMatrix();\n const matrices = layout.matrices();\n const rowMatrices = rowMatrix.getViewableMatrices();\n const columnMatrices = columnMatrix.getViewableMatrices();\n const centralMatrixPointer = {\n row: 0,\n column: 0\n };\n\n for (let i = rowPointer - 1; i >= 0; i--) {\n const length = Math.max(rowMatrices[i].primaryMatrix.length,\n rowMatrices[i].secondaryMatrix.length);\n centralMatrixPointer.row += length;\n }\n /* istanbul ignore next */\n for (let i = columnPointer - 1; i >= 0; i--) {\n const matrix = columnMatrices[i];\n const { primaryMatrix, secondaryMatrix } = matrix;\n const length = Math.max(primaryMatrix[0] ? primaryMatrix[0].length : 0,\n secondaryMatrix[0] ? secondaryMatrix[0].length : 0);\n centralMatrixPointer.column += length;\n }\n\n matrices.top[1] = columnMatrices[columnPointer].primaryMatrix;\n matrices.bottom[1] = columnMatrices[columnPointer].secondaryMatrix;\n\n matrices.center[0] = rowMatrices[rowPointer].primaryMatrix;\n matrices.center[2] = rowMatrices[rowPointer].secondaryMatrix;\n\n const rowMatrixLen = Math.max(matrices.center[0].length, matrices.center[2].length);\n /* istanbul ignore next */\n const columnMatrixLen = Math.max(matrices.top[1][0] ? matrices.top[1][0].length : 0, matrices.bottom[1][0] ?\n matrices.bottom[1][0].length : 0);\n matrices.center[1] = centerMatrix.slice(centralMatrixPointer.row, centralMatrixPointer.row + rowMatrixLen)\n .map(matrix => matrix.slice(centralMatrixPointer.column, centralMatrixPointer.column + columnMatrixLen));\n\n return {\n matrices,\n rowPages: rowMatrices.length,\n columnPages: columnMatrices.length\n };\n};\n\nconst measureSum = measureArr => measureArr.reduce((total, measure) => total + measure, 0);\n/**\n * Returns measurements of the cells of the current matrix\n *\n * @param {Object} layout instance of layout\n * @return {Object} returns the measurements for current view matrix\n */\nexport const getViewMeasurements = (layout, maxRowHeight, maxColWidth) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const {\n columnPointer,\n rowPointer\n } = layout.config();\n\n const rowSpaces = rowMatrix.getViewableSpaces()[rowPointer];\n const colSpaces = columnMatrix.getViewableSpaces()[columnPointer];\n\n const {\n rowHeights,\n width: rowMatrixWidth\n } = rowSpaces;\n const {\n columnWidths,\n height: columnMatrixHeight\n } = colSpaces;\n\n const { primary: leftWidth, secondary: rightWidth } = rowMatrixWidth;\n const { primary: topHeight, secondary: bottomHeight } = columnMatrixHeight;\n\n const centerHeight = measureSum(rowHeights.primary);\n const centerWidth = measureSum(columnWidths.primary);\n const viewWidth = [leftWidth, Math.min(centerWidth, maxColWidth), rightWidth];\n const viewHeight = [topHeight, Math.min(centerHeight, maxRowHeight), bottomHeight];\n\n return {\n viewWidth,\n viewHeight,\n actualCenterMeasures: {\n height: centerHeight,\n width: centerWidth\n },\n totalMeasures: {\n width: measureSum(viewWidth),\n height: measureSum(viewHeight)\n },\n unitHeights: rowHeights,\n unitWidths: columnWidths\n };\n};\n","/**\n * This file declares a table that can be extended to create a Datagrid, crosstab\n * and man other visualzations that require a tabular structure.\n */\n\nimport { getUniqueId, mergeRecursive } from 'muze-utils';\nimport GenericLayout from '../generic-layout';\nimport { DEFAULT_CONFIGURATION, DEFAULT_MEASUREMENTS } from './defaults';\nimport { generateVisualMatrices } from './layout-helper';\nimport { computeLayoutMeasurements } from './computations';\nimport { getViewMeasurements, getViewMatrices } from './view-info-getter';\n/**\n * This class is used to create a tabular structure that\n * can house charts and values.\n *\n * @class GridLayout\n */\nexport default class GridLayout extends GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} matrices Set of upto 9 matrices containing the cells to be rendered\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config external configurations.\n * @memberof GenericLayout\n */\n constructor (matrices, mountPoint, measurement, config) {\n super(mountPoint, measurement, config);\n this.matrices(matrices);\n this.config(this.constructor.defaultConfig());\n this._layoutId = getUniqueId();\n this._scrollInfo = { horizontal: false, vertical: false };\n }\n\n static defaultViewInfo () {\n return Object.assign({}, {\n layoutDimensions: {\n border: this.defaultConfig().border,\n viewHeight: [0, 0, 0],\n viewWidth: [0, 0, 0]\n },\n viewMatricesInfo: {\n columnPages: 0,\n rowPages: 0,\n matrices: { top: [], center: [], bottom: [] }\n }\n });\n }\n\n /**\n * Returns initial set of measurements for the grid layout\n *\n * @static\n * @return {Object} Returns initial set of measurements\n * @memberof GridLayout\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENTS;\n }\n\n /**\n * Returns initialconfiguration for grid layout\n *\n * @static\n * @return {Object} Returns initial configuration for grid layout\n * @memberof GridLayout\n */\n static defaultConfig () {\n return DEFAULT_CONFIGURATION;\n }\n\n /**\n * This function is used to return an instance of GridLayout\n *\n * @return {GridLayout} Instance of grid layout.\n * @static\n * @memberof GridLayout\n */\n static create () {\n return new GridLayout(null, null, this.defaultMeasurement(), this.defaultConfig());\n }\n\n /**\n * Sets/Gets the matrices for the layout\n *\n * @param {Array} matrices Set of matrices\n * @return {Object} Getter/Setter\n * @memberof GridLayout\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = generateVisualMatrices(this, matrices);\n return this;\n }\n return super.matrices(matrices);\n }\n\n /**\n * Triggers the computations for the layout based on the matrices available\n * This causes a reflow in the entire layout system.\n *\n * @return {Object} Layout instance\n * @memberof GridLayout\n */\n triggerReflow () {\n this.scrollInfo({ horizontal: false, vertical: false });\n const {\n maxHeightAvailableForRowMatrix,\n maxWidthAvailableForColumnMatrix\n } = computeLayoutMeasurements(this);\n\n this.setViewInformation(maxHeightAvailableForRowMatrix, maxWidthAvailableForColumnMatrix);\n return this;\n }\n\n gotoPage (type, pageNumber) {\n const pageType = type.toLowerCase();\n const { viewMatricesInfo } = this.viewInfo();\n const totalPages = viewMatricesInfo[`${pageType}Pages`];\n const pointer = Math.min(Math.max(1, pageNumber), totalPages);\n this.config({\n [`${pageType}Pointer`]: pointer - 1\n });\n this.setViewInformation();\n this.renderGrid();\n return this;\n }\n\n pages (type) {\n const { viewMatricesInfo } = this.viewInfo();\n const pageType = type.toLowerCase();\n return {\n totalPages: viewMatricesInfo[`${pageType}Pages`],\n currentPage: this.config()[`${pageType}Pointer`] + 1\n };\n }\n\n viewInfo (...viewInfo) {\n if (viewInfo.length) {\n this._viewInfo = viewInfo[0];\n return this;\n }\n return this._viewInfo;\n }\n\n scrollInfo (...scrollInfo) {\n if (scrollInfo.length) {\n this._scrollInfo = mergeRecursive(this._scrollInfo, scrollInfo[0]);\n return this;\n }\n return this._scrollInfo;\n }\n\n /**\n *\n *\n * @returns\n * @memberof GridLayout\n */\n setViewInformation (maxRowHeight, maxColWidth) {\n const {\n rowPointer,\n columnPointer,\n border\n } = this.config();\n const viewMatricesInfo = getViewMatrices(this, rowPointer, columnPointer);\n const layoutDimensions = getViewMeasurements(this, maxRowHeight, maxColWidth);\n layoutDimensions.border = border;\n this.viewInfo({\n viewMatricesInfo,\n layoutDimensions\n });\n return this;\n }\n}\n","import RowMatrix from '../visual-matrix/row-matrix';\nimport ColumnMatrix from '../visual-matrix/column-matrix';\n\nexport const generateVisualMatrices = (context, matrices) => {\n // Set of matrices for layout is generated starting with the left matrix\n let leftMatrix = [];\n let rightMatrix = [];\n let topMatrix = [];\n let bottomMatrix = [];\n let begColCells;\n let endColCells;\n const {\n isRowSizeEqual,\n isColumnSizeEqual,\n gutterSpace,\n distribution,\n border,\n breakPage,\n priority\n } = context.config();\n const {\n minUnitHeight,\n minUnitWidth\n } = context.measurement();\n const { top, center, bottom } = matrices;\n const [topLeft, topColumns, topRight] = top;\n const [leftRows, valueMatrix, rightRows] = center;\n const [bottomLeft, bottomColumns, bottomRight] = bottom;\n\n if (leftRows.length > 0) {\n // If no left matrix is present, context will be empty\n leftMatrix = [...topLeft, ...leftRows, ...bottomLeft];\n }\n if (rightRows.length > 0) {\n // If no right matrix is present, context will be empty\n rightMatrix = [...topRight, ...rightRows, ...bottomRight];\n }\n if (topColumns.length > 0 && topColumns[0].length > 0) {\n // If no top matrix is present, context will be empty\n topMatrix = topColumns.map((d, i) => [...topLeft[i], ...d, ...topRight[i]]);\n }\n if (bottomColumns.length > 0 && bottomColumns[0].length > 0) {\n // If no bottom matrix is present, context will be empty\n bottomMatrix = bottomColumns.map((d, i) => [...bottomLeft[i], ...d, ...bottomRight[i]]);\n }\n\n context.rowMatrix(new RowMatrix([leftMatrix, rightMatrix], {\n isDistributionEqual: isRowSizeEqual,\n distribution: distribution.rows,\n gutter: gutterSpace.rows,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.row,\n breakPage: breakPage.rows.map(e => e + Math.max(topLeft.length, topRight.length)),\n extraCellLengths: [topLeft.length, bottomLeft.length]\n }));\n\n if (topLeft.length > 0) {\n begColCells = topLeft[0].length;\n } else {\n begColCells = bottomLeft.length > 0 ? bottomLeft[0].length : 0;\n }\n\n if (topRight.length > 0) {\n endColCells = topRight[0].length;\n } else {\n endColCells = bottomRight.length > 0 ? bottomRight[0].length : 0;\n }\n\n context.columnMatrix(new ColumnMatrix([topMatrix, bottomMatrix], {\n isDistributionEqual: isColumnSizeEqual,\n distribution: distribution.columns,\n gutter: gutterSpace.columns,\n isTransposed: true,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.col,\n breakPage: breakPage.columns,\n extraCellLengths: [begColCells, endColCells]\n }));\n context.centerMatrix(valueMatrix);\n\n return matrices;\n};\n","import {\n TOP, BOTTOM, LEFT, RIGHT, CENTER, BLANK_BORDERS, COLUMN, ROW,\n VIEW_INDEX, ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, MIDDLE, NO_BORDERS\n} from '../enums/constants';\n\nconst borderMap = {\n [`${TOP}-${LEFT}`]: NO_BORDERS,\n [`${TOP}-${MIDDLE}`]: COLUMN,\n [`${TOP}-${RIGHT}`]: NO_BORDERS,\n [`${CENTER}-${LEFT}`]: ROW,\n [`${CENTER}-${MIDDLE}`]: CENTER,\n [`${CENTER}-${RIGHT}`]: ROW,\n [`${BOTTOM}-${LEFT}`]: NO_BORDERS,\n [`${BOTTOM}-${MIDDLE}`]: COLUMN,\n [`${BOTTOM}-${RIGHT}`]: NO_BORDERS\n};\n\nconst applySpecificBorder = (cells, color, type, style) => {\n cells.style(`border-${type}`, `${style} ${color}`);\n};\n\nconst specificBorderApplier = (borderTypes, showBorders, cells, borderInfo) => {\n const {\n color,\n width,\n style\n } = borderInfo;\n const borderStyle = `${width}px ${style}`;\n\n borderTypes.forEach((borderType) => {\n applySpecificBorder(cells, showBorders[borderType] ? color : BLANK_BORDERS, borderType, borderStyle);\n });\n};\n\nconst borderApplier = (cells, borderInfo) => {\n const {\n showRowBorders,\n showColBorders,\n showValueBorders\n } = borderInfo;\n return {\n row: () => specificBorderApplier([TOP, BOTTOM], showRowBorders, cells, borderInfo),\n column: () => specificBorderApplier([LEFT, RIGHT], showColBorders, cells, borderInfo),\n center: () => specificBorderApplier([LEFT, RIGHT, TOP, BOTTOM], showValueBorders, cells, borderInfo)\n };\n};\n\nexport const applyBorders = (cells, border, row, column) => {\n const borderApplierFn = borderApplier(cells, border);\n const borderMapVal = borderMap[`${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`];\n if (borderMapVal) {\n borderApplierFn[borderMapVal]();\n }\n};\n","import { selectElement } from 'muze-utils';\nimport {\n TOP, BOTTOM, ROW_SPAN, COL_SPAN, CENTER, ROW, COLUMN\n} from '../enums/constants';\n\nconst orderMaker = arr => Array.from(Array(arr.length).keys());\n\nconst nestByStack = (stack, updateArr, optionalParams = {}) => {\n let {\n order,\n keyFn\n } = optionalParams;\n const arr = updateArr.slice();\n const currStack = stack.slice();\n const prevStack = currStack.slice();\n // Order in which element are to be checked for nesting, default normal looping\n // Order is always in the order of nest, i.e., left to right\n order = order || Array.from(Array(arr.length).keys());\n\n // Key function, if array of objects\n keyFn = keyFn || (v => v);\n\n // Return same array if stack is empty\n if (currStack.length === 0) {\n const newArr = [];\n order.forEach((e) => {\n newArr.push(arr[e]);\n });\n return { prevStack, currStack: arr, arr: newArr };\n }\n\n let arrVal = '';\n let stackVal = '';\n const newArr = [];\n\n // Loop in order\n for (let i = order.length - 1; i >= 0; i--) {\n // Get current element index from the order given\n const currElemIndex = order[i];\n\n // Crete a hashmap for the hierarchy by joining strings of the array for both stack and input array\n arrVal += keyFn(arr[currElemIndex]);\n stackVal += keyFn(currStack[currElemIndex]);\n\n // If the current value and value in stack is same, convert it to null\n if (arrVal === stackVal) {\n newArr[currElemIndex] = null;\n } else {\n stackVal = '';\n // Loop from the current index in order to the last element in order to change the\n // whole hierarchy\n for (let j = i; j < order.length; j++) {\n const newElem = order[j];\n const arrElem = arr[newElem];\n\n newArr[newElem] = arrElem;\n\n // Reset stack to new stack\n currStack[newElem] = arrElem;\n stackVal = arrVal;\n }\n }\n }\n const returnArr = [];\n order.forEach((e) => {\n returnArr.push(newArr[e]);\n });\n return { prevStack, currStack, arr: returnArr };\n};\n\nconst spanCalculator = (colData, colIdx, matrix, rIdx) => {\n // if data is not header cell then rowspan\n // has to be 1\n if (!colData) {\n return () => null;\n }\n\n const conditions = {\n row: count => matrix[rIdx + count] && matrix[rIdx + count][colIdx],\n column: count => matrix[rIdx][colIdx + count]\n };\n\n return (type) => {\n let count = 1;\n let isNull = false;\n\n while (!isNull) {\n if (conditions[type](count) === null) {\n count += 1;\n } else {\n isNull = true;\n }\n }\n return count;\n };\n};\n\nconst maskCreator = (matrix, order) => ({\n row: () => {\n let stack = [];\n return matrix.map((e) => {\n const {\n currStack,\n arr\n } = nestByStack(stack, e, { keyFn: val => val.valueOf(), order });\n\n stack = currStack;\n return arr;\n });\n },\n column: () => {\n let stack = [];\n const viewMatrix = [];\n matrix.length && matrix[0].forEach((cell, colIndex) => {\n const hierarchy = [];\n matrix.forEach((row) => {\n hierarchy.push(row[colIndex]);\n });\n const {\n currStack,\n arr\n } = nestByStack(stack, hierarchy, { keyFn: val => val.valueOf(), order });\n stack = currStack;\n\n matrix.forEach((row, rowIndex) => {\n viewMatrix[rowIndex] = viewMatrix[rowIndex] || [];\n viewMatrix[rowIndex][colIndex] = arr[rowIndex];\n });\n });\n return viewMatrix;\n }\n});\n\nconst spanGenerator = viewMatrix => ({\n row: () => {\n const spans = [];\n viewMatrix.forEach((row, ridx) => {\n spans[ridx] = spans[ridx] || [];\n row.forEach((col, i) => {\n if (viewMatrix[ridx][i]) {\n const currSpan = spanCalculator(col, i, viewMatrix, ridx)('row');\n currSpan && spans[ridx].push(currSpan);\n }\n });\n });\n return spans;\n },\n column: () => viewMatrix.map((row, ridx) => row.map((col, i) => spanCalculator(col, i, viewMatrix, ridx)('column'))\n .filter(col => col !== null))\n});\n\nconst getOrder = () => ({\n row: matrix => orderMaker(matrix[0]),\n column: matrix => orderMaker(matrix)\n});\n\nconst matrixSpanGeneratorMap = {\n [`${TOP}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${BOTTOM}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${CENTER}-0`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n },\n [`${CENTER}-2`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n }\n};\n\nconst matrixSpanGenerator = (type) => {\n const generator = matrixSpanGeneratorMap[type];\n if (generator) {\n return generator;\n }\n return {\n orderGetter: () => null,\n viewMatrixMaker: matrix => () => matrix,\n spanMaker: () => () => null\n };\n};\n\n/**\n * This function is used to set the col and row spans\n * for the matrices based on repeated/hierarchichal data\n *\n * @export\n * @param {Array} matrix The 2d array for which filtering is to be done\n * @param {string} type Type of array (center, top, bottom)\n * @param {number} index Index of array in the row\n * @return {Object} containing the view matrix and their spans\n */\nexport function cellSpanMaker (matrix, type, index) {\n let spans = null;\n let viewMatrix = matrix;\n const {\n orderGetter,\n viewMatrixMaker,\n spanMaker\n } = matrixSpanGenerator(`${type}-${index}`);\n\n if (matrix.length) {\n const order = orderGetter(matrix);\n viewMatrix = viewMatrixMaker(matrix, order)();\n spans = spanMaker(viewMatrix)();\n }\n return { viewMatrix, spans };\n}\n\nconst spaceAllocationDueToSpan = (span = 1, placeholder, config, index) => {\n const height = placeholder.availHeight();\n const width = placeholder.availWidth();\n const borderWidth = config.border.width;\n const { unitWidths } = config.dimensions;\n const { col } = index;\n\n return {\n [ROW_SPAN] () {\n placeholder.setAvailableSpace(width, height * span);\n if (span === 1) {\n selectElement(this).style('height', `${height * span + borderWidth}px`);\n }\n },\n [COL_SPAN] () {\n const primaryUnitWidth = unitWidths.primary[col];\n if (span > 1) {\n let cumulativeWidth = 0;\n for (let i = col; i < col + span; i++) {\n cumulativeWidth += unitWidths.primary[i] - borderWidth;\n }\n placeholder.setAvailableSpace(cumulativeWidth + borderWidth, height);\n } else if (primaryUnitWidth) {\n placeholder.setAvailableSpace(primaryUnitWidth - borderWidth, height);\n }\n selectElement(this).style('height', `${height}px`);\n }\n };\n};\n\nconst spanApplier = (cells, spans, config, type) => {\n let cellCounter = 0;\n cells.attr(type, function (cell, colIndex) {\n if (colIndex === 0) {\n cellCounter = 0;\n }\n const span = spans[cell.rowIndex][colIndex];\n const placeholder = cell.placeholder;\n const index = {\n row: cell.rowIndex,\n col: cellCounter\n };\n\n spaceAllocationDueToSpan(span, placeholder, config, index)[type].bind(this)();\n cellCounter += span;\n return span;\n });\n};\n\nconst spanApplierMap = {\n [`${TOP}-0`]: null,\n [`${TOP}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${TOP}-2`]: null,\n [`${CENTER}-0`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${CENTER}-1`]: null,\n [`${CENTER}-2`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${BOTTOM}-0`]: null,\n [`${BOTTOM}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${BOTTOM}-2`]: null\n};\n\nexport const applySpans = (cells, spans, config, type) => {\n const applier = spanApplierMap[type];\n if (applier) {\n applier(cells, spans, config);\n }\n};\n","import { ERROR_MSG } from 'muze-utils';\n/**\n * An Interface to be implemented if the transaction support is necessary. This class ensures reactivity to\n * global properties.\n */\nexport default class TransactionSupport {\n /**\n * Property accessor for data member of the class. Data is passed to the system by calling this method.\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for width of the class. Width is passed as an integer.\n */\n width () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for height of the class. Height is passed as an integer.\n */\n height () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for config of the class. Config is passed as an object.\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n}\n","import { TOP, BOTTOM, LEFT, TITLE, SUB_TITLE, GROUP, LAYOUT, LEGEND } from '../constants';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const arrangeComponents = (context) => {\n const legendConfig = context.config().legend;\n const titleConfig = context.title()[1];\n const subtitleConfig = context.subtitle()[1];\n const titleLayouts = {\n [`${TOP}-${TOP}`]: [TITLE, SUB_TITLE, GROUP],\n [`${BOTTOM}-${BOTTOM}`]: [GROUP, SUB_TITLE, TITLE],\n [`${TOP}-${BOTTOM}`]: [TITLE, GROUP, SUB_TITLE],\n [`${BOTTOM}-${TOP}`]: [SUB_TITLE, GROUP, TITLE]\n };\n const legendLayouts = [\n [LEGEND, LAYOUT],\n [LAYOUT, LEGEND]\n ];\n const titlePosition = titleConfig.position || TOP;\n const subtitlePosition = subtitleConfig.position || TOP;\n\n return {\n headers: titleLayouts[`${titlePosition}-${subtitlePosition}`],\n legends: legendConfig.position === LEFT || legendConfig.position === TOP ?\n legendLayouts[0] : legendLayouts[1]\n };\n};\n","/**\n * Flag to specify whether direction is vertical.\n */\nexport const MARGIN = 'margin';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const SPACE_FIXER = 'spaceFixer';\nexport const CLASSPREFIX = 'muze';\nexport const VERTICAL_ALIGN = 'verticalAlign';\nexport const TEXT_ALIGN = 'textAlign';\nexport const IS_OFFSET = 'isOffset';\nexport const MIDDLE = 'middle';\nexport const BASELINE = 'baseline';\nexport const SHOW = 'show';\nexport const CENTER = 'center';\nexport const TEXT = 'text';\nexport const HEADER = 'header';\nexport const HEIGHT = 'height';\nexport const WIDTH = 'width';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const FIELDS = 'fields';\nexport const TRANSFORM = 'transform';\nexport const LAYER_DEF = 'layerDef';\nexport const CONFIG = 'config';\nexport const DETAIL_FIELDS = 'detailFields';\nexport const MAX_LINES = 'maxLines';\nexport const MIN_CHARS = 'minCharacters';\nexport const ROTATION = 'rotation';\n\nexport const TEXT_CELL = 'text-cell';\nexport const AXIS_CELL = 'axis-cell';\nexport const GEOM_CELL = 'geom-cell';\nexport const BLANK_CELL = 'blank-cell';\n","// eneum to refer to simple cell\nexport const SIMPLE = 'simple';\n// eneum to refer to header cell\nexport const TEXT = 'text';\n// enum to refer to axis cell\nexport const AXIS = 'axis';\n// enum to refer to visual cell\nexport const GEOM = 'geom';\n// enum to refer blank cell\nexport const BLANK = 'blank';\n","import {\n ERROR_MSG,\n getUniqueId,\n mergeRecursive\n} from 'muze-utils';\nimport { SIMPLE } from './enums/cell-type';\n\n/**\n * This file declares a class that is used as an interface to create new\n * SimpleCell elements.\n * @module SimpleCell\n */\n/**\n * Base class for all table cells.\n *\n * @interface\n * @class SimpleCell\n */\nclass SimpleCell {\n\n /**\n * Creates an instance of SimpleCell.\n *\n * @param {*} config The input configuration.\n * @memberof SimpleCell\n */\n constructor (config) {\n this._id = getUniqueId();\n\n const defConfig = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConfig, config || {});\n\n this._mount = null;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n */\n get type () {\n return SIMPLE;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n * @return {Object} Default config for the placeholder\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the value contained by the SimpleCell.\n *\n * @memberof SimpleCell\n */\n valueOf () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a unique identifier for the instance used\n * to control selective rendering.\n *\n * @memberof SimpleCell\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized representation of the instance.\n *\n * @memberof SimpleCell\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns an object with width and height fields\n * specifying the space taken up by this metod.\n *\n * @memberof SimpleCell\n */\n getLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Method used to set the space available to render the SimpleCell\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @memberof SimpleCell\n */\n setAvailableSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n remove () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getMinMeasures (providedMinMeasure = 0) {\n return providedMinMeasure;\n }\n\n}\n\nexport default SimpleCell;\n","/**\n * This file exports variables that are used as defaults for\n * the placeholders\n */\nimport * as CONSTANTS from './constants';\n\n /**\n * Default Configuration for the cells\n * @return {Object} Default configuration\n */\nexport const DEFAULT_CONFIG = {\n [CONSTANTS.MARGIN]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.SPACE_FIXER]: 2,\n [CONSTANTS.IS_OFFSET]: false,\n [CONSTANTS.VERTICAL_ALIGN]: null,\n [CONSTANTS.TEXT_ALIGN]: CONSTANTS.CENTER,\n [CONSTANTS.SHOW]: true,\n [CONSTANTS.MAX_LINES]: 0,\n [CONSTANTS.MIN_CHARS]: 0,\n [CONSTANTS.ROTATION]: null\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { GEOM, TEXT, AXIS, BLANK } from './enums/cell-type';\n\nconst DEFAULT_PROPS = {\n mount: {},\n availHeight: {},\n availWidth: {},\n config: {\n sanitization: (context, value) => mergeRecursive(context._config, value)\n },\n logicalSpace: {},\n minSpacing: {},\n source: {}\n};\n\nconst geomProps = {\n data: {},\n caption: {},\n config: {},\n axes: {},\n facetByFields: {},\n fields: {},\n transform: {},\n layerDef: {},\n detailFields: {}\n};\n\nconst textProps = {\n smartText: {}\n};\nexport const PROPS = {\n [GEOM]: mergeRecursive(geomProps, DEFAULT_PROPS),\n [TEXT]: mergeRecursive(textProps, DEFAULT_PROPS),\n [AXIS]: DEFAULT_PROPS,\n [BLANK]: DEFAULT_PROPS\n};\n","/**\n * This file declares a class that represents a table cell\n * used to house an axis.\n * @module VisualCell\n */\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport { CLASSPREFIX, HEIGHT, WIDTH, AXIS_CELL, BOTTOM, TOP } from './enums/constants';\nimport SimpleCell from './simple-cell';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { AXIS } from './enums/cell-type';\nimport { PROPS } from './props';\n\n/**\n * Computes the logical space of the an axis instance within an axis cell\n *\n * @param {Object} context Required to get the needed parameters to compute axis space\n * @return {Object} Returns the logical space for axis\n */\nconst computeAxisSpace = (context) => {\n let logicalWidth;\n let logicalHeight;\n const axis = context.source();\n const {\n spaceFixer,\n margin\n } = context.config();\n const {\n width,\n height\n } = axis.getLogicalSpace();\n const {\n show\n } = axis.config();\n if (show === true) {\n logicalHeight = Math.floor(height + margin.top + margin.bottom + spaceFixer);\n logicalWidth = Math.floor(width + margin.left + margin.right + spaceFixer);\n } else {\n [logicalWidth, logicalHeight] = [width, height];\n }\n return {\n width: logicalWidth,\n height: logicalHeight\n };\n};\n\n/**\n * Represents an axis cell.\n *\n * @class Axis\n */\nclass AxisCell extends SimpleCell {\n\n /**\n * Creates an instance of AxisCell.\n *\n * @param {Object} config The input config.\n * @memberof AxisCell\n */\n constructor (config) {\n super(config);\n\n this._axis = null;\n this._availHeight = null;\n this._availWidth = null;\n this._logicalSpace = null;\n\n generateGetterSetters(this, PROPS[AXIS]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof AxisCell\n */\n get type () {\n return AXIS;\n }\n\n /**\n * This method return the value conatined by this SimpleCell.\n *\n * @return {SimpleAxis | ColorAxis} Instance of SimpleAxis or ColorAxis.\n * @memberof AxisCell\n */\n valueOf () {\n return this.source().id;\n }\n\n /**\n * This method return the unique identififer of the axis\n *\n * @return {string} Id of the axis.\n * @memberof AxisCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Retrns the serialized representation of this cell.\n *\n * @return {Object}Object with serializable props.\n * @memberof AxisCell\n */\n serialize () {\n return {\n type: AXIS,\n axis: this.source().serialize()\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof AxisCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * return the space taken up by an axis element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof AxisCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeAxisSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @return {Instance} Returns current Instance\n * @memberof AxisCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n const {\n margin,\n isOffset\n } = this.config();\n\n if (width || height) {\n this.source().setAvailableSpace(width, height, margin, isOffset);\n this.source().logicalSpace(null);\n } else {\n this.source().resetLogicalSpace();\n }\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the axis inside the axis cell.\n *\n * @param {HTMLElement} mount The mount point.\n * @return {Selection} node where axis mounted\n * @memberof AxisCell\n */\n /* istanbul ignore next */render (mount) {\n if (!mount) {\n return this;\n }\n let actualWidth = 0;\n let actualHeight = 0;\n const axis = this.source();\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const {\n margin\n } = this.config();\n const {\n top,\n bottom,\n left,\n right\n } = margin;\n const {\n show,\n orientation\n } = axis.config();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [this], `${CLASSPREFIX}-${AXIS_CELL}`);\n const selection = makeElement(wrapperDiv, 'svg', [1], `${CLASSPREFIX}-axis-container`);\n selection.classed(`${CLASSPREFIX}-axis-container-${orientation}`, true);\n\n this.mount(mount);\n if (!availWidth) {\n selection.attr(WIDTH, `${0}px`);\n }\n if (!availHeight) {\n selection.attr(HEIGHT, `${0}px`);\n }\n actualWidth = availWidth;\n actualHeight = availHeight;\n if (!show) {\n actualWidth = (orientation === TOP || orientation === BOTTOM) ? availWidth : 0;\n actualHeight = (orientation === TOP || orientation === BOTTOM) ? 0 : availHeight;\n }\n wrapperDiv.style(WIDTH, `${actualWidth}px`)\n .style(HEIGHT, `${actualHeight}px`)\n .style('margin-top', top)\n .style('margin-bottom', bottom)\n .style('margin-left', left)\n .style('margin-right', right);\n\n axis.mount(selection.node());\n return selection;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Current instance of AxisCell\n * @memberof AxisCell\n */\n remove () {\n this.source() && this.source().remove();\n this.mount() && this.mount().remove();\n return this;\n }\n}\n\nexport default AxisCell;\n\n","/**\n * This file declares a class that represents a BLANK element in a table.\n * @module VisualCell\n */\nimport {\n selectElement,\n makeElement,\n applyStyle,\n generateGetterSetters\n } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { CLASSPREFIX, BLANK_CELL } from './enums/constants';\nimport { BLANK } from './enums/cell-type';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { PROPS } from './props';\n\n/**\n * Represents a table haeder.\n *\n * @class BLANK\n */\nclass BlankCell extends SimpleCell {\n\n /**\n * Creates an instance of BLANK.\n * @param {Object} config The input configuration.\n * @memberof BLANK\n */\n constructor (config) {\n super(config);\n\n generateGetterSetters(this, PROPS[BLANK]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof BlankCell\n */\n get type () {\n return BLANK;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof BlankCell\n */\n valueOf () {\n return this.id;\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof BlankCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method is used to return a unique identifier for\n * the BLANK cell.\n *\n * @return {string} The unique identifier for the BLANK.\n * @memberof BlankCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof BLANK\n */\n serialize () {\n return {\n type: BLANK\n };\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof BLANK\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n return {\n width: this.width || 0,\n height: this.height || 0\n };\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the BLANK cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof BLANK\n */\n /* istanbul ignore next */render (mount) {\n if (mount) {\n const { style } = this.config();\n // append span element to mount point\n this.mount(mount);\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id]);\n elem.classed(`${CLASSPREFIX}-${BLANK_CELL}`, true);\n elem.style('width', `${this.availWidth()}px`);\n elem.style('height', `${this.availHeight()}px`);\n elem.html('');\n // apply style on the returned element\n if (style) {\n applyStyle(elem, style);\n }\n } return this;\n }\n\n /**\n * Removes the cell(Disposal)\n *\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n\n getMinMeasures () {\n return 0;\n }\n }\nexport default BlankCell;\n","/**\n * This file declares a class that represents a Text element in a table.\n * @module VisualCell\n */\n\nimport {\n selectElement,\n makeElement,\n getSmartComputedStyle,\n generateGetterSetters\n} from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { TEXT } from './enums/cell-type';\nimport { PROPS } from './props';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { CLASSPREFIX, TOP, BOTTOM, LEFT, RIGHT, HEADER, WIDTH, TEXT_CELL } from './enums/constants';\nimport './text-cell.scss';\n\nconst setSmartText = (context) => {\n const source = context.source();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n rotation\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const labelManager = context.dependencies().labelManager;\n\n labelManager.setStyle(context._computedStyle);\n\n !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false));\n rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true));\n\n return context;\n};\n\n/**\n* Computes the Logical Space for the text\n*\n* @param {Object} context Required to get the needed parameters to compute text space\n* @return {Object} Logical space taken up by text\n* @memberof TextCell\n*/\nconst computeTextSpace = (context) => {\n const { labelManager } = context.dependencies();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n show,\n maxLines,\n minCharacters\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const source = context.source();\n const space = context.smartText();\n const minText = new Array(minCharacters).fill('W').join('');\n const _minTextSpace = labelManager.getOriSize(minText);\n\n context.config({ rotation: false });\n if (space.width > (availWidth || 0) && maxLines) {\n space.height = space.oriTextHeight * maxLines;\n }\n if (availWidth && availWidth < space.width) {\n space.width = _minTextSpace.width;\n }\n if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) {\n const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true);\n space.width = smartSpace.height;\n space.height = smartSpace.width;\n context.config({ rotation: true });\n context.smartText(smartSpace);\n }\n\n if (show) {\n return {\n width: Math.ceil(space.width) + paddedWidth,\n height: Math.ceil(space.height) + paddedHeight\n };\n } return {\n width: 0,\n height: 0\n };\n};\n\n/**\n * Represents a table haeder.\n *\n * @class Text\n */\nclass TextCell extends SimpleCell {\n\n /**\n * Creates an instance of Text.\n * @param {Object} config The input configuration.\n * @param {string} dependencies Dependencies for the class(labelManager)\n * @memberof Text\n */\n constructor (config, dependencies) {\n super(config);\n\n this._dependencies = dependencies;\n this._className = this._config.className ||\n (this._config.type === HEADER ? `${CLASSPREFIX}-${HEADER}-cell` : `${CLASSPREFIX}-${TEXT}-cell`);\n this._computedStyle = getSmartComputedStyle(selectElement('body'), this._className);\n this._dependencies.labelManager.setStyle(this._computedStyle);\n generateGetterSetters(this, PROPS[TEXT]);\n const space = this._dependencies.labelManager.getOriSize('w');\n this.minSpacing({ width: Math.floor(space.width * 3 / 4), height: Math.floor(space.height / 2) });\n setSmartText(this);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof TextCell\n */\n get type () {\n return TEXT;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof TextCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return a unique identifier for\n * the Text cell.\n *\n * @return {string} The unique identifier for the Text.\n * @memberof TextCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Returns the dependencies of the instance\n *\n * @return {Object} Dependencies needed by the class\n * @memberof TextCell\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof TextCell\n */\n serialize () {\n return {\n text: this.source(),\n type: TEXT\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof TextCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof Text\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeTextSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n setSmartText(this);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the Text cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof Text\n */\n render (mount) {\n const availWidth = this.availWidth();\n const availHeight = this.availHeight();\n const {\n margin,\n show,\n verticalAlign,\n textAlign,\n rotation\n } = this.config();\n\n this.mount(mount);\n if (show) {\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`);\n const vAlign = verticalAlign || rotation ? 'middle' : 'top';\n const {\n width,\n height\n } = this.smartText();\n const {\n height: minHeightSpace\n } = this.minSpacing();\n const translation = {\n top: width + minHeightSpace / 2,\n middle: width / 2 + minHeightSpace,\n bottom: minHeightSpace\n };\n\n container.style('vertical-align', vAlign);\n\n // Set class name\n elem.classed(this._className, true);\n\n // Apply styles\n elem.style('text-align', textAlign);\n elem.style('display', 'inline');\n elem.style('transform', rotation ? `translate(${height / 2}px,\n ${translation[vAlign]}px) rotate(-90deg)` : '');\n elem.style(WIDTH, availWidth ? `${availWidth}px` : '100%');\n [TOP, BOTTOM, LEFT, RIGHT].forEach((type) => {\n container.style(`margin-${type}`, `${margin[type]}px`);\n });\n elem.style('text-align', textAlign);\n elem.style('display', 'inline');\n // set the text as the innerHTML\n this._dependencies.labelManager.setStyle(this._computedStyle);\n elem.html(this._dependencies.labelManager.getSmartText(this.source(), availWidth, availHeight, true).text);\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n }\n\nexport default TextCell;\n","/**\n * This file declares a class that is used to represent a table cell\n * that houses a visual unit.\n * @module VisualCell\n */\n\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { GEOM } from './enums/cell-type';\nimport { PROPS } from './props';\nimport {\n CLASSPREFIX, HEIGHT, WIDTH, DATA, AXES, FACET_BY_FIELDS, FIELDS, TRANSFORM, LAYER_DEF, CONFIG, GEOM_CELL,\n DETAIL_FIELDS\n} from './enums/constants';\nimport { DEFAULT_CONFIG } from './enums/defaults';\n\n/**\n * Calculates the logical space of the cell\n *\n * @param {Object} context Required to get the needed parameters to compute unit space\n * @return {Object} Logical space taken up by the unit\n * @memberof GeomCell\n */\nconst computeGeomSpace = (context) => {\n const config = context.source().config();\n const { width, height } = config;\n return {\n width: Math.ceil(width),\n height: Math.ceil(height + context.getCaptionSpace().height)\n };\n};\n\n /**\n * This class represents a SimpleCell for visual unit.\n *\n * @class GeomCell\n */\nclass GeomCell extends SimpleCell {\n\n /**\n * Creates an instance of GeomCell.\n * @param {Object} config The input configuration.\n * @memberof GeomCell\n */\n constructor (config) {\n super(config);\n\n this._unit = null;\n this._layers = null;\n this._axes = {};\n this._datamodel = {};\n this._facetByFields = {};\n this._fields = null;\n this._transform = null;\n this._caption = null;\n\n generateGetterSetters(this, PROPS[GEOM]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof GeomCell\n */\n get type () {\n return GEOM;\n }\n\n /**\n * This method return the value contained by this cell.\n *\n * @return {VisualUnit} Instance of visual unit contained by visual unit.\n * @memberof GeomCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return the id of the\n * visual unit housed by this cell.\n *\n * @return {string} The unique id of the visual unit.\n * @memberof GeomCell\n */\n get id () {\n return this.source().id();\n }\n\n /**\n * This method return a serialized representation of\n * this instance.\n *\n * @return {Object} Object with serializable props.\n * @memberof GeomCell\n */\n serialize () {\n return {\n type: GEOM,\n unit: this.source().serialize(),\n caption: this.caption()\n };\n }\n\n /**\n * return the default configuration for the geom cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof GeomCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * Updates the model based on the changed parameters\n *\n * @return {Instance} return instance\n * @memberof GeomCell\n */\n updateModel () {\n const unit = this.source();\n unit.clearCaching();\n [LAYER_DEF, TRANSFORM, AXES, FIELDS, CONFIG, DATA, AXES, FACET_BY_FIELDS, DETAIL_FIELDS].forEach((prop) => {\n this[prop]() && unit[prop](this[prop]());\n });\n return this;\n }\n\n /**\n * It gives the space taken by the caption of the unit\n *\n * @return {Object} return the space taken by caption\n * @memberof GeomCell\n */\n getCaptionSpace () {\n const caption = this.caption();\n\n let captionSpace = { width: 0, height: 0 };\n if (caption) {\n captionSpace = caption.getLogicalSpace();\n }\n return captionSpace;\n }\n\n /**\n * return the space taken up by the element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof GeomCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeGeomSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space available to\n * render the SimpleCell.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n setAvailableSpace (width, height) {\n const unit = this.source();\n\n this.availWidth(width);\n this.availHeight(height);\n unit.lockModel()\n .width(width).height(height - this.getCaptionSpace().height)\n .unlockModel();\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * his method is used to render the visual unit inside the provided cell.\n *\n * @param {HTMLElement} mount The mountpoint in the table.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n render (mount) {\n if (mount) {\n this.mount(mount);\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const caption = this.caption();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [1], `${CLASSPREFIX}-${GEOM_CELL}`);\n\n if (caption) {\n const captionDom = makeElement(wrapperDiv, 'div', [caption], `${CLASSPREFIX}-unit-caption`).node();\n caption.render(captionDom);\n }\n const selection = makeElement(wrapperDiv, 'div', [1], `${CLASSPREFIX}-unit`);\n wrapperDiv.style(WIDTH, `${availWidth}px`).style(HEIGHT, `${availHeight}px`);\n selection.style(WIDTH, `${availWidth}px`)\n .style(HEIGHT, `${availHeight - this.getCaptionSpace().height}px`);\n this.source().mount(selection.node());\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Object} Current instance\n * @memberof GeomCell\n */\n remove () {\n this.mount() && this.mount().remove();\n this.source().remove();\n return this;\n }\n}\n\nexport default GeomCell;\n","import AxisCell from './axis-cell';\nimport BlankCell from './blank-cell';\nimport TextCell from './text-cell';\nimport GeomCell from './geom-cell';\nimport SimpleCell from './simple-cell';\n\nimport * as CONSTANTS from './constants';\n\nexport const DEFAULT_PLACEHOLDERS = {\n [CONSTANTS.SIMPLE_CELL]: SimpleCell,\n [CONSTANTS.TEXT_CELL]: TextCell,\n [CONSTANTS.AXIS_CELL]: AxisCell,\n [CONSTANTS.GEOM_CELL]: GeomCell,\n [CONSTANTS.BLANK_CELL]: BlankCell\n};\n\n","export const SIMPLE_CELL = 'SimpleCell';\nexport const TEXT_CELL = 'TextCell';\nexport const AXIS_CELL = 'AxisCell';\nexport const BLANK_CELL = 'BlankCell';\nexport const GEOM_CELL = 'GeomCell';\n\n","import { DEFAULT_PLACEHOLDERS } from './defaults';\n\n/**\n * Creates a registry for the cells, which can be used for\n * setting a new cell or getting the registered cells\n *\n * @return {Object} Setters and getters for registered cells\n */\nconst cellRegistry = () => {\n const reg = DEFAULT_PLACEHOLDERS;\n return {\n set: (key, def) => {\n if (key in reg) {\n reg[key] = def;\n }\n return cellRegistry;\n },\n get: () => reg\n };\n};\nexport default cellRegistry;\n","import { TextCell } from '@chartshq/visual-cell';\nimport { escapeHTML } from 'muze-utils';\nimport { TOP } from '../constants';\n\n/**\n *\n *\n * @param {*} rawContent\n *\n */\nconst resolveTitleSubTitleContent = (rawContent) => {\n if (typeof rawContent === 'function' && !rawContent._sanitize) {\n return rawContent();\n }\n return escapeHTML(rawContent());\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} cellType\n * @param {*} labelManager\n * @param {*} prevCell\n *\n */\nconst headerCreator = (config, cellType, labelManager, prevCell) => {\n let margin = {};\n const {\n content,\n classPrefix,\n maxLines\n } = config;\n const cell = prevCell || new TextCell(\n {\n type: cellType === 'title' ? 'header' : 'text',\n className: `${classPrefix}-${cellType}-cell`\n }, {\n labelManager\n })\n .config({ maxLines }).minSpacing({ width: 0, height: 0 });\n\n cell.source(content);\n cell._minTickDiff = { height: 0, width: 0 };\n\n if (config.position === TOP) {\n margin = { top: 0, bottom: config.padding };\n } else {\n margin = { top: config.padding, bottom: 0 };\n }\n cell.config({ margin });\n\n return {\n height: cell.getLogicalSpace().height,\n cell\n };\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} type\n * @param {*} labelManager\n * @param {*} cell\n *\n */\nconst createHeading = (config, type, labelManager, prevCell) => {\n if (!config) { return ''; }\n\n return headerCreator(\n config,\n type,\n labelManager,\n prevCell\n );\n};\n\n/**\n *\n *\n * @param {*} context\n */\nexport const createHeaders = (context, canvasHeight, canvasWidth) => {\n let headerHeight = 0;\n const headers = {};\n const subtitle = context.subtitle();\n const isSubtitle = resolveTitleSubTitleContent(subtitle[0]);\n\n canvasHeight >= 200 && canvasWidth >= 200 && ['title', 'subtitle'].forEach((type) => {\n const headerOptions = context[type]();\n const content = resolveTitleSubTitleContent(headerOptions[0]);\n if (content) {\n const config = headerOptions[1];\n\n config.width = context.width();\n config.height = context.height();\n config.classPrefix = context.config().classPrefix;\n config.content = content;\n config.padding = (type === 'title' && !isSubtitle.length) ? subtitle[1].padding : config.padding;\n\n const { height, cell } = createHeading(config, type, context.dependencies().smartlabel,\n context[`${type}Cell`]);\n\n headers[`${type}Cell`] = cell;\n context._composition[type] = cell;\n headerHeight += height;\n }\n });\n return { headerHeight, headers };\n};\n\n","import { TextCell, AxisCell } from '@chartshq/visual-cell';\nimport { getValueParser, retrieveFieldDisplayName, DataModel, getObjProp } from 'muze-utils';\nimport {\n VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING, BORDER, MARGIN\n} from '../constants';\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n *\n */\nexport const legendCreator = (canvas) => {\n let LegendCls;\n const dataset = [];\n const axes = canvas.getRetinalAxes();\n\n Object.entries(axes).forEach((axisInfo) => {\n const scale = axisInfo[1][0];\n const scaleType = axisInfo[0];\n const scaleProps = canvas[scaleType]();\n\n if (scaleProps.field && scale) {\n const {\n type,\n step\n } = scale.config();\n\n const stepMapper = typeof step === 'boolean' ? step : false;\n LegendCls = LEGEND_TYPE_MAP[`${type}-${stepMapper}-${scaleType}`];\n dataset.push({\n scale,\n canvas,\n fieldName: scaleProps.field,\n title: retrieveFieldDisplayName(canvas.data(), scaleProps.field),\n LegendCls,\n scaleType\n });\n }\n });\n\n return dataset;\n};\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n * @param {*} measurement\n * @param {*} prevLegends\n *\n */\nexport const legendInitializer = (legendConfig, canvas, measurement, prevLegends) => {\n const legends = [];\n const {\n height,\n width,\n headerHeight\n } = measurement;\n const {\n position,\n align\n } = legendConfig;\n\n const legendInfo = legendCreator(canvas);\n const { invalidValues } = canvas.config();\n\n const parser = getValueParser(invalidValues);\n legendInfo.forEach((dataInfo, index) => {\n const legendMeasures = {};\n const {\n LegendCls,\n scale,\n fieldName,\n title: titleText,\n scaleType\n } = dataInfo;\n const config = legendConfig[scaleType] || {};\n const title = config.title || {};\n title.text = title.text || titleText;\n if (config.show) {\n config.position = position;\n config.align = align;\n let legend = getObjProp(prevLegends[scaleType], index);\n if (!legend) {\n legend = LegendCls.create({\n labelManager: canvas._dependencies.smartlabel,\n cells: {\n AxisCell, TextCell\n }\n });\n }\n legendMeasures.maxHeight = align === VERTICAL ? (height - headerHeight) : height * 0.2;\n legendMeasures.maxWidth = align === HORIZONTAL ? width : width * 0.2;\n legendMeasures.width = Math.min(legendMeasures.maxWidth, config.width);\n legendMeasures.height = Math.min(legendMeasures.maxHeight, config.height);\n\n [PADDING, BORDER, MARGIN].forEach((e) => {\n legendMeasures[e] = config[e];\n });\n const metaData = legend.metaData();\n if (metaData instanceof DataModel) {\n metaData.dispose();\n }\n legend.scale(scale)\n .valueParser(parser)\n .title(title)\n .fieldName(fieldName)\n .config(config)\n .metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName]))\n .measurement(legendMeasures)\n .canvasAlias(canvas.alias())\n .setLegendMeasures();\n\n legends.push({ canvas, legend, scaleType });\n }\n });\n return legends;\n};\n\n/**\n *\n *\n * @param {*} legends\n * @param {*} legendConfig\n * @param {*} availableHeight\n * @param {*} availableWidth\n *\n */\nexport const getLegendSpace = (legends, legendConfig, availableHeight, availableWidth) => {\n const legendMeasures = legends.map(legendInfo => legendInfo.legend.measurement());\n const legendSpace = { width: 0, height: 0 };\n\n legendMeasures.forEach((space) => {\n let height = 0;\n let width = 0;\n width = Math.min(space.width, space.maxWidth);\n height = Math.min(space.height, space.maxHeight);\n\n if (legendConfig.align === HORIZONTAL) {\n if (legendSpace.width + width > availableWidth) {\n legendSpace.width = availableWidth;\n legendSpace.height += height;\n } else {\n legendSpace.width += width;\n legendSpace.height = Math.max(legendSpace.height, height);\n }\n } else if (legendSpace.height + height > availableHeight) {\n legendSpace.height = height;\n legendSpace.width += width;\n } else {\n legendSpace.height += height;\n legendSpace.width = Math.max(legendSpace.width, width);\n }\n });\n if (legendConfig.align === HORIZONTAL) {\n legendSpace.width = availableWidth;\n }\n return legendSpace;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} headerHeight\n *\n */\nexport const createLegend = (context, headerHeight, height, width) => {\n const measurement = {\n height,\n width,\n headerHeight\n };\n const { legend } = context.config();\n const { show, position } = legend;\n\n legend.classPrefix = context.config().classPrefix;\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n\n legend.show = show ? ((align === VERTICAL && width > 200) || (align === HORIZONTAL && height > 200)) : show;\n legend.align = align;\n return legendInitializer(legend, context, measurement, context.composition().legend || {});\n};\n","import { LayoutComponent } from '../../../../layout/src/tree-layout';\n\nexport default class MuzeComponent extends LayoutComponent {\n getLogicalSpace () {\n const { width, height } = this.boundBox();\n return { width, height };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n }\n\n getBoundBox () {\n return this.boundBox();\n }\n\n updateWrapper () {\n throw Error('Update is not implemented');\n }\n\n setParams () {\n throw Error('set params is not implemented');\n }\n}\n","import { selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { LEFT } from '../../constants';\n\nexport default class HeaderComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n renderHeader (container) {\n const layoutConfig = this.params.config;\n container = selectElement(container);\n const { align } = layoutConfig;\n const sel = container\n .selectAll(`.${layoutConfig.classPrefix}-inner-container`)\n .data([this.name]);\n sel.exit().remove();\n const selEnter = sel.enter().append('div');\n\n const cont = selEnter.merge(sel);\n cont.classed(`${layoutConfig.classPrefix}-inner-container`, true);\n const { height, width } = this.boundBox();\n this.component.setAvailableSpace(width, height);\n\n this.component && this.component.render(cont.node());\n\n cont.selectAll('div').classed(`${layoutConfig.classPrefix}-inner-content`, true);\n cont.style('width', `${100}%`);\n\n if (layoutConfig && this.component) {\n cont.style('float', LEFT)\n .style('text-align', align);\n // .style(`padding-${position === TOP ? BOTTOM : TOP}`, `${padding}px`);\n }\n }\n\n draw (container) {\n this.renderHeader(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.setParams(params);\n this.name(params.name);\n this.boundBox(params.component.getLogicalSpace());\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y,\n left: conf.x,\n width: conf.width,\n height: conf.height });\n this.renderAt(conf.renderAt);\n }\n}\n","import { makeElement, selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport {\n LEFT, RIGHT, VERTICAL, HORIZONTAL, TOP, BOTTOM, HORIZONTAL_CENTER, VERTICAL_CENTER\n} from '../../constants';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\n\nfunction defaultAlignmentHelper (position) {\n let alignment = null;\n const alignWith = `${ROW_MATRIX_INDEX[1]}-${COLUMN_MATRIX_INDEX[1]}`;\n switch (position) {\n case TOP:\n case BOTTOM:\n alignment = HORIZONTAL_CENTER;\n break;\n case LEFT:\n case RIGHT:\n alignment = VERTICAL_CENTER;\n break;\n default:\n alignment = VERTICAL_CENTER;\n }\n return { alignment, alignWith };\n}\nexport default class LegendComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.measurement.legendSpace, 0);\n this.setParams(params);\n }\n\n renderLegend (container) {\n container = selectElement(container);\n const sectionComponents = [];\n const { position, classPrefix } = this.params.config;\n const legendMount = makeElement(container, 'div', [this.components],\n `${classPrefix}-inner-content`, {}, d => d);\n legendMount.classed(`${classPrefix}-legend`, true);\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n const legWidth = this.newDimensions.width;\n const legHeight = this.newDimensions.height;\n\n [container, legendMount].forEach((elem) => {\n elem.style('width', `${Math.floor(legWidth)}px`)\n .style('height', `${legHeight}px`)\n .style('float', LEFT);\n });\n\n if (align === VERTICAL) {\n let sections = -1;\n let currHeight = legHeight;\n let currWidth = 0;\n\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n if (leg.measurement().height > currHeight) {\n sections++;\n currWidth = 0;\n currHeight = legHeight;\n } else {\n sections < 0 && sections++;\n }\n sectionComponents[sections] = sectionComponents[sections] || [];\n currHeight -= Math.min(leg.measurement().height, currHeight);\n currWidth = Math.max(Math.min(leg.measurement().width, leg.measurement().maxWidth), currWidth);\n sectionComponents[sections].push({\n legend: leg,\n legendHeight: legHeight,\n legendWidth: currWidth\n });\n });\n\n const mount = makeElement(legendMount, ['div'], sectionComponents, `${classPrefix}-legend-section`);\n // mount.each((d, i) => selectElement(this).classed(`${classPrefix}-legend-section-${i}`, true));\n mount.classed(`${classPrefix}-legend-vertical-section`, true)\n .style('width', d => `${d[0].legendWidth}px`);\n makeElement(mount, ['div'], d => d, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) {\n d.legend.mount(this);\n })\n .style('width', d => `${d.legendWidth}px`);\n } else {\n const mount = makeElement(legendMount, 'div', [1], `${classPrefix}-legend-section`);\n mount.classed(`${classPrefix}-legend-horizontal-section`, true);\n mount.classed(`${classPrefix}-legend-section-${0}`, true)\n .style('width', `${legWidth}px`);\n\n makeElement(mount, 'div', this.components, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) { d.legend.mount(this); })\n .style('width', d => `${d.legend.measurement().width}px`);\n }\n }\n\n draw (container) {\n this.renderLegend(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.measurement.legendSpace);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.components = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n const { alignWith, alignment } = defaultAlignmentHelper(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith || alignWith);\n this.alignment(params.config.alignment || alignment);\n }\n\n}\n","import {\n selectElement,\n makeElement,\n getD3Drag,\n getEvent,\n getWindow,\n hasTouch\n} from 'muze-utils';\nimport './scroll-bar.scss';\nimport { WIDTH, HEIGHT } from '../../../constants';\n\nconst d3Drag = getD3Drag();\n\nconst arrowSizeMap = {\n left: WIDTH,\n right: WIDTH,\n top: HEIGHT,\n bottom: HEIGHT\n};\n\nexport const getUnitPositions = (unitMeasures, totalLength, viewLength) => {\n let currentLen = 0;\n const measures = unitMeasures.primary && unitMeasures.primary.length ?\n unitMeasures.primary : unitMeasures.secondary;\n\n return measures.map((e) => {\n const unitPosition = currentLen * 100 / (totalLength - viewLength);\n currentLen += e;\n return unitPosition;\n });\n};\n\nexport const createScrollBarArrow = (mount, type, config) => {\n const {\n classPrefix,\n thickness\n } = config;\n const arrow = makeElement(mount, 'div', [type], `${classPrefix}-scroll-arrow-${type}`);\n\n arrow.classed(`${classPrefix}-scroll-arrow`, true);\n arrow.style(arrowSizeMap[type], `${thickness}px`);\n\n const chevron = makeElement(arrow, 'div', [1], `${classPrefix}-scroll-arrow-chevron`);\n\n chevron.attr('id', `${classPrefix}-scroll-arrow-chevron-${type}`);\n\n return arrow;\n};\n\nexport const createScrollBarRect = (mount, config) => {\n const {\n classPrefix\n } = config;\n const rect = makeElement(mount, 'div', [1], `${classPrefix}-scroll-rect`);\n const mover = makeElement(rect, 'div', [1], `${classPrefix}-scroll-mover`);\n\n return { rect, mover };\n};\n\nexport const applyRectClick = (scrollMaker, moverRect) => {\n const {\n rect\n } = moverRect;\n\n rect.on('click', () => {\n const event = getEvent();\n scrollMaker.emptyScrollAreaClick(event);\n });\n};\n\nconst applyMoverDrag = (scrollMaker, moverRect) => {\n let startPos = {};\n let moverStartPos = 0;\n let rectStartPos = 0;\n let endPos = {};\n const {\n mover,\n rect\n } = moverRect;\n\n mover.call(d3Drag()\n .on('start', () => {\n const event = getEvent();\n\n moverStartPos = mover.node().getBoundingClientRect();\n rectStartPos = rect.node().getBoundingClientRect();\n startPos = {\n x: event.x,\n y: event.y\n };\n })\n .on('drag', () => {\n const event = getEvent();\n const window = getWindow();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n const distanceMoved = {\n x: endPos.x - startPos.x,\n y: endPos.y - startPos.y\n };\n const actualPosition = {\n x: moverStartPos.x + distanceMoved.x - rectStartPos.x + window.pageXOffset,\n y: moverStartPos.y + distanceMoved.y - rectStartPos.y + window.pageYOffset\n };\n\n scrollMaker.changeMoverPosition(actualPosition);\n }));\n};\n\nconst applyScrollMouseDownAction = (moverRect, scrollMaker, speed) => {\n const {\n mover,\n rect\n } = moverRect;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n scrollMaker.changeMoverPosition({ x: x - rectX + speed, y: y - rectY + speed });\n};\n\nconst registerListenerOnArrow = (scrollMaker, moverRect, arrowType, speed) => {\n let timer = '';\n const arrow = scrollMaker._components[arrowType];\n const isTouchDevice = hasTouch();\n\n arrow.on(isTouchDevice ? 'touchstart' : 'mousedown', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n timer = setInterval(() => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n }, 100);\n }).on(isTouchDevice ? 'touchend' : 'mouseup', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n clearInterval(timer);\n }).on('click', () => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n });\n};\n\nexport const registerListeners = (scrollMaker) => {\n const {\n moverRect\n } = scrollMaker._components;\n\n const speed = scrollMaker.config().speed;\n\n registerListenerOnArrow(scrollMaker, moverRect, 'prevArrow', -speed);\n applyMoverDrag(scrollMaker, moverRect);\n applyRectClick(scrollMaker, moverRect);\n registerListenerOnArrow(scrollMaker, moverRect, 'nextArrow', speed);\n};\n\nexport const scrollContainerHelper = (mountPoint, config, dimensions, type) => {\n const {\n classPrefix\n } = config;\n const scrollBarContainer = makeElement(selectElement(mountPoint), 'div', [1], `#${classPrefix}-scroll-bar-${type}`);\n\n scrollBarContainer.classed(`${classPrefix}-scroll-bar`, true);\n scrollBarContainer.style(WIDTH, `${dimensions.width}px`);\n scrollBarContainer.style(HEIGHT, `${dimensions.height}px`);\n return scrollBarContainer;\n};\n\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n\n config: {\n sanitization: (context, value) => {\n value = mergeRecursive(context._config, value);\n return value;\n }\n },\n manager: {},\n unitPositions: {},\n logicalSpace: {}\n};\n\n","import { ERROR_MSG, generateGetterSetters } from 'muze-utils';\nimport {\n scrollContainerHelper,\n registerListeners\n} from './helper';\nimport { PROPS } from './props';\n\nexport class ScrollMaker {\n\n constructor () {\n this._components = {};\n this._logicalSpace = {};\n this._attachedScrollAction = () => {};\n this._config = {\n thickness: 10,\n speed: 2\n };\n this._unitPositions = null;\n\n generateGetterSetters(this, PROPS);\n }\n\n static type () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n emptyScrollAreaClick () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n changeMoverPosition () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollDeltaTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n createScroll (mountPoint) {\n const config = this.config();\n\n return {\n scrollBarContainer: scrollContainerHelper(mountPoint, config, this.logicalSpace(), this.constructor.type())\n };\n }\n\n attachScrollAction (externalScrollAction) {\n this._attachedScrollAction = externalScrollAction;\n return this;\n }\n\n detachScrollAction () {\n this._attachedScrollAction = () => {};\n return this;\n }\n\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n registerListeners () {\n registerListeners(this);\n return this;\n }\n\n remove () {\n this._components.scrollBarContainer.remove();\n return this;\n }\n}\n\n","import MuzeComponent from './muze-chart-component';\nimport { HorizontalScrollMaker } from './scroll-bar-maker/horizontal-scroll-maker';\nimport { VerticalScrollMaker } from './scroll-bar-maker/vertical-scroll-maker';\n\nconst scrollMakerMap = {\n horizontal: HorizontalScrollMaker,\n vertical: VerticalScrollMaker\n};\n\n/**\n * Scroll Component acts as a wrapper over the scoll bars created using the respective Scroll Makers\n * This provides a consistent API for layouting using the tree layout system.\n *\n *\n * @class\n * @public\n * @module ScrollComponent\n */\nexport default class ScrollComponent extends MuzeComponent {\n\n constructor (params) {\n const ScrollMaker = scrollMakerMap[params.config.type];\n\n params.component = new ScrollMaker();\n params.component.config(params.config.scrollBarComponentConfig);\n params.component.logicalSpace(params.dimensions);\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n manager (...manager) {\n if (manager.length) {\n this.component.manager(manager[0]);\n return this;\n }\n return this.component.manager();\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollDeltaTo (delta) {\n this.component.scrollDeltaTo(delta);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollTo (scrollPercentage) {\n this.component.scrollTo(scrollPercentage);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page based on the unit index.\n * The input is provided as a number represting the index for the unit.\n * For vertical scroll, it's the row index that will be required.\n * For horizontal scroll, it's the column index that will be required\n *\n * @public\n *\n * @param {number} unitIndex Index of the unit appearing in the grid\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollToUnitIndex (unitIndex) {\n const unitPositions = this.component.unitPositions();\n const sanitizedUnitIndex = Math.min(Math.max(0, unitIndex), unitPositions.length - 1);\n this.component.scrollTo(unitPositions[sanitizedUnitIndex]);\n return this;\n }\n\n /**\n * Provides the positions of the units(either horizontal or vertical based on the type\n * of scroll bar it wraps) relative to it's container. The position of the first unit starts at 0\n *\n *\n * @public\n *\n * @return {Array} Positions of units either horizontal or vertical\n */\n getScrollPositionsForUnits () {\n return this.component.unitPositions();\n }\n\n draw (container) {\n this.component.createScroll(container || document.getElementById(this.renderAt()));\n return this;\n }\n\n /**\n * Can be used to attach a scroll action whenever scrolling occurs in the canvas\n *\n * @public\n * @param {number} externalAction Action to be attached during scroll\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n attachScrollAction (externalAction) {\n this.component.attachScrollAction(externalAction);\n return this;\n }\n\n /**\n * Can be used to detach the scroll action already bound to the scroll bar\n *\n * @public\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n detachScrollAction () {\n this.component.detachScrollAction();\n return this;\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.component.config(params.config.scrollBarComponentConfig);\n this.component.logicalSpace(params.dimensions);\n this.boundBox(this.component.getLogicalSpace());\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component || this.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n remove () {\n this.component.remove();\n }\n}\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { HORIZONTAL, HEIGHT, WIDTH, LEFT } from '../../../constants';\n\nexport class HorizontalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: horizontal\n */\n static type () {\n return HORIZONTAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, config, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'left', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'right', config);\n const {\n mover,\n rect\n } = moverRect;\n\n const { height, width, totalLength, viewLength, unitWidths } = this.logicalSpace();\n const scrollBarWithouArrowLength = width - height * 2;\n\n rect.style(WIDTH, `${dimensions.width - height * 2}px`);\n rect.style(HEIGHT, `${100}%`);\n mover.style(WIDTH, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(HEIGHT, `${100}%`);\n mover.style(LEFT, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n this.unitPositions(getUnitPositions(unitWidths, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n let positionAdjuster = speed * 10;\n if (event.x < x) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n const {\n totalLength\n } = this.logicalSpace();\n\n if (newPosition.x < 0) {\n currentPos = 0;\n } else if (newPosition.x + moverPos.width > rectStartPos.width) {\n currentPos = rectStartPos.width - moverPos.width;\n } else {\n currentPos = newPosition.x;\n }\n\n mover.style(LEFT, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: 0, x: moverPos.x - rectStartPos.x - delta });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {HorizontalScrollMaker} Instance of the HorizontalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.width)) / 100;\n\n this.changeMoverPosition({ y: 0, x: movement });\n return this;\n }\n\n}\n\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { VERTICAL, TOP, HEIGHT, WIDTH } from '../../../constants';\n\nexport class VerticalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: vertical\n */\n static type () {\n return VERTICAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'top', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'bottom', config);\n const {\n mover,\n rect\n } = moverRect;\n const { height, width, totalLength, viewLength, unitHeights } = this.logicalSpace();\n const scrollBarWithouArrowLength = height - width * 2;\n\n rect.style(HEIGHT, `${scrollBarWithouArrowLength}px`);\n rect.style(WIDTH, `${100}%`);\n mover.style(WIDTH, `${100}%`);\n mover.style(HEIGHT, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(TOP, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n\n this.unitPositions(getUnitPositions(unitHeights, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n let positionAdjuster = speed * 10;\n if (event.y < y) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const {\n totalLength\n } = this.logicalSpace();\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n\n if (newPosition.y < 0) {\n currentPos = 0;\n } else if (newPosition.y + moverPos.height > rectStartPos.height) {\n currentPos = rectStartPos.height - moverPos.height;\n } else {\n currentPos = newPosition.y;\n }\n mover.style(TOP, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: moverPos.y - rectStartPos.y - delta, x: 0 });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.height)) / 100;\n\n this.changeMoverPosition({ x: 0, y: movement });\n return this;\n }\n\n}\n","import { makeElement } from 'muze-utils';\nimport { cellSpanMaker, applySpans } from '../../../../layout/src/grid-layout/span-maker';\nimport { applyBorders } from '../../../../layout/src/grid-layout/border-helper';\n\nimport {\n TOP, CENTER\n} from '../../../../layout/src/enums/constants';\nimport MuzeComponent from './muze-chart-component';\nimport { WIDTH, HEIGHT, HIDDEN, OVERFLOW, AUTO, VISIBLE } from '../../constants';\n\nconst renderPlaceholders = (cells) => {\n // Rendering content within placeholders\n cells.each(function (cell) {\n cell.placeholder.render(this);\n });\n};\n\nexport default class MatrixComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n this.className(params.config.className);\n }\n\n applyScroll (container) {\n const row = this.params.config.row;\n const column = this.params.config.column;\n const { horizontal, vertical } = this.params.config.scrollInfo;\n container.style(OVERFLOW, VISIBLE);\n container.style(WIDTH, AUTO);\n container.style(HEIGHT, AUTO);\n\n if (horizontal && column === 1) {\n container.style(OVERFLOW, HIDDEN);\n container.style(WIDTH, '100%');\n }\n\n if (vertical && row === CENTER) {\n container.style(OVERFLOW, HIDDEN);\n container.style(HEIGHT, '100%');\n }\n }\n\n renderMatrix (mountPoint) {\n // Creating containers for each matrix individually\n const classPrefix = this.params.config.classPrefix;\n const row = this.params.config.row;\n const column = this.params.config.column;\n const dimensions = this.params.config.dimensions;\n const border = this.params.config.border;\n\n // Creating containers for each matrix individually\n const containerForMatrix = makeElement(mountPoint, 'div', [1], `${classPrefix}-grid-${row}-${column + 1}`)\n .classed(`${classPrefix}-grid-${row}`, true)\n .classed(`${classPrefix}-grid`, true);\n\n this.applyScroll(containerForMatrix);\n\n const {\n viewMatrix,\n spans\n } = cellSpanMaker(this.component, row, column);\n\n // Rendering the table components\n const { cells } = this.renderTable(containerForMatrix, `${classPrefix}-grid`, viewMatrix);\n\n applySpans(cells, spans, { dimensions, border }, `${row}-${column}`);\n renderPlaceholders(cells);\n\n cells.exit().each((cell) => {\n cell.placeholder.remove();\n });\n\n applyBorders(cells, border, row, column);\n }\n\n renderTable (mount, className, rowData) {\n const table = makeElement(mount, 'table', ['layout'], `${className}-table`);\n const body = makeElement(table, 'tbody', ['layout'], `${className}-body`);\n const rows = makeElement(body, 'tr', rowData, `${className}-tr`);\n const cells = makeElement(rows, 'td', (d, i) => d.filter(e => e !== null).map(e =>\n ({ placeholder: e, rowIndex: i })), `${className}-td`, {}, key => key.placeholder.id);\n\n return { table, body, rows, cells };\n }\n\n draw (container) {\n this.renderMatrix(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(TOP);\n this.className(params.config.className);\n }\n}\n","import { selectElement, getEvent } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport MatrixComponent from './matrix-component';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\nimport { WHEEL_DELTA_MODIFIER } from '../../enums/constants';\n\n/**\n * Based on the type of scroll, it changes the scrollLeft/scrollTop property of the specific\n * elements based on the scroll distance provided\n *\n *\n */\nconst applyScrollAction = (elem, classPrefix, scollDistance, type) => {\n selectElement(elem)\n .selectAll(`.${classPrefix}-grid`)\n .property(type, scollDistance);\n};\n\n/**\n * Applies the action of the scroll by actually scrolling the respective matrices based on the\n * type of scroll. It returns a function which has both the scroll methods available\n *\n * @return {Object} contains the horizontal and vertical scroll actions on the grid component\n */\nconst scrollActionApplier = (movement, context) => {\n const classPrefix = context.params.config.classPrefix;\n\n return {\n horizontal: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[e][1].renderAt()}`, classPrefix, movement, 'scrollLeft'));\n },\n vertical: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[1][e].renderAt()}`, classPrefix, movement, 'scrollTop'));\n }\n };\n};\n\nexport default class GridComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.gridComponents = [];\n this.setParams(params);\n }\n\n sanitizeGrid () {\n let height = 0;\n let width = 0;\n const { viewMatricesInfo, layoutDimensions } = this.component.viewInfo();\n const scrollInfo = this.component.scrollInfo();\n const {\n viewHeight,\n viewWidth,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n\n for (let i = 0; i < 3; i++) {\n if (!(this.gridComponents.length && this.gridComponents[i] instanceof Array)) {\n this.gridComponents[i] = [];\n }\n for (let j = 0; j < 3; j++) {\n const matrixDim = {\n height: viewHeight[i],\n width: viewWidth[j],\n unitHeights,\n unitWidths\n };\n const matrix = viewMatricesInfo.matrices[`${ROW_MATRIX_INDEX[i]}`][j];\n const matrixName = `${ROW_MATRIX_INDEX[i]}-${COLUMN_MATRIX_INDEX[j]}`;\n const matrixConfig = {\n dimensions: matrixDim,\n border: layoutDimensions.border,\n classPrefix: this.params.config.classPrefix,\n scrollInfo,\n row: ROW_MATRIX_INDEX[i],\n column: j\n };\n if (this.gridComponents[i][j] instanceof MuzeComponent) {\n this.gridComponents[i][j].updateWrapper({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n } else {\n const matrixWrapper = new MatrixComponent({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n this.gridComponents[i].push(matrixWrapper);\n }\n if (i === 0) {\n width += matrixDim.width;\n }\n if (j === 0) {\n height += matrixDim.height;\n }\n }\n }\n this.boundBox({ height, width });\n\n this.component = this.gridComponents;\n this.allComponents = this.gridComponents;\n }\n\n scrollBarManager (...manager) {\n if (manager.length) {\n this._scrollBarManager = manager[0];\n return this;\n }\n return this._scrollBarManager;\n }\n\n /**\n * Attaches a mousewheel listener to the center matrix, based on which the scrolling can occur.\n * It uses the scroll component to change the position of the scroller, which ultimately scrolls the center matrix\n *\n *\n * @return {GridComponent} Instance of the GridComponent\n */\n attachScrollListener () {\n const scrollBarManager = this.scrollBarManager();\n selectElement(`#${this.component[1][1].renderAt()}`)\n .on('wheel', () => {\n const event = getEvent();\n const {\n wheelDeltaX,\n wheelDeltaY\n } = event;\n\n // Scrolling horizontally\n if (wheelDeltaX !== 0 && Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('horizontal', event)\n .triggerScrollBarAction('horizontal', wheelDeltaX / WHEEL_DELTA_MODIFIER);\n }\n\n // Scrolling Vertically\n if (wheelDeltaY !== 0 && Math.abs(wheelDeltaX) < Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('vertical', event)\n .triggerScrollBarAction('vertical', wheelDeltaY / WHEEL_DELTA_MODIFIER);\n }\n });\n return this;\n }\n\n performScrollAction (direction, movedView) {\n scrollActionApplier(movedView, this)[direction]();\n return this;\n }\n\n getBoundBox () {\n const { top, left } = this.component[0][0].boundBox();\n const { height, width } = this.boundBox();\n\n return {\n top,\n left,\n height,\n width\n };\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.className(params.config.className);\n this.sanitizeGrid();\n return this;\n }\n\n attachListener () {\n this.attachScrollListener();\n return this;\n }\n}\n","export const SIDE_EFFECT_COMMON = 'common';\nexport const SIDE_EFFECT_INDIVIDUAL = 'individual';\nexport const TOOLTIP_CONSOLIDATED = 'consolidated';\nexport const TOOLTIP_FRAGMENTED = 'fragmented';\nexport const WHEEL_DELTA_MODIFIER = 30;\n","import { selectElement, makeElement, applyStyle } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\n\nexport default class MessageComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n }\n\n render (container) {\n const parent = selectElement(container);\n\n const { config } = this.params;\n const { className } = config.classPrefix;\n\n const node = makeElement(parent, 'div', [1], className);\n const { height, width } = config.dimensions;\n const { message } = config;\n\n applyStyle(node, { width: `${width}px`, height: `${height}px` });\n\n const child = makeElement(node, 'div', [1], `${className}-child`);\n const textElement = makeElement(child, 'text', [1]);\n\n textElement.html(message);\n }\n\n draw (container) {\n this.render(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n const { target, className } = params.config;\n this.component = params.component;\n this.params = params;\n this.target(target);\n this.className(className);\n this.position(params.config.position);\n return this;\n }\n}\n","import {\n TITLE,\n SUB_TITLE,\n LEGEND, VERTICAL,\n HORIZONTAL,\n WIDTH,\n HEIGHT,\n TOP,\n LEFT,\n RIGHT,\n MESSAGE,\n GRID,\n NO_DATA_MESSAGE,\n HORIZONTAL_CENTER\n} from '../constants';\nimport HeaderComponent from './components/headerComponent';\nimport LegendComponent from './components/legendComponent';\nimport ScrollComponent from './components/scroll-component';\nimport GridComponent from './components/grid-component';\nimport MessageComponent from './components/message-component';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG, CANVAS, MESSAGE_CONFIG } from './defaults';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, CENTER } from '../../../layout/src/enums/constants';\n\n// Mapping between types of headers and their required configs for wrapper creation\nconst headerMap = {\n title: {\n headerCell: 'titleCell',\n configType: TITLE_CONFIG\n },\n subtitle: {\n headerCell: 'subtitleCell',\n configType: SUB_TITLE_CONFIG\n }\n};\n\n// Mapping of header alignment values\nconst headerAlignmentMap = {\n [LEFT]: LEFT,\n [RIGHT]: RIGHT,\n [CENTER]: HORIZONTAL_CENTER\n};\n\n/**\n * returns if data is Valid\n *\n *\n * @param {Object} params object where data has to be checked for validity\n * @return {Boolean} Returns true if all of the params are valid\n */\nconst checkParamsValidation = params => Object.keys(params).every((param => params[param]));\n\n/**\n * returns if message Component is needed or not\n *\n *\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Boolean} Returns if grid is present\n */\nconst isGridPresent = (renderDetails) => {\n const { rows, columns, values } = renderDetails.components;\n return checkParamsValidation({ rows, columns, values });\n};\n\n/**\n * Creates the wrapper for the header, i.e., title and subtitle to be used in the tree layout\n *\n *\n * @param {string} headerType type of header: title/subtite\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createHeaderWrapper = (headerType, layoutManager, renderDetails) => {\n let wrapper = null;\n\n const { components, layoutConfig } = renderDetails;\n const { headerCell, configType } = headerMap[headerType];\n const target = { target: CANVAS };\n\n if (components.headers && components.headers[headerCell]) {\n let headerConfig = layoutConfig[headerType];\n const header = components.headers[headerCell];\n\n headerConfig = Object.assign({}, headerConfig, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n alignWith: `${ROW_MATRIX_INDEX[0]}-${COLUMN_MATRIX_INDEX[1]}`,\n alignment: headerAlignmentMap[headerConfig.align],\n className: configType.className\n });\n\n const wrapperParams = {\n name: headerType,\n component: header,\n config: headerConfig\n };\n\n const existingComponent = layoutManager.getComponent(headerType);\n if (existingComponent) {\n wrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n wrapper = new HeaderComponent(wrapperParams);\n }\n }\n return wrapper;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} canvas canvas instance\n * @return {Instance} Returns the respective wrappers\n */\nconst createMessageWrapper = (layoutManager, canvas, renderDetails, renderGrid) => {\n const headerValues = Object.values(renderDetails.components.headers);\n let sum = 0;\n let messageWrapper = null;\n\n for (const val of headerValues) {\n sum += val.logicalSpace().height;\n }\n\n if (!renderGrid) {\n const defaultDimensions = { height: canvas.height() - sum, width: canvas.width() };\n const gridComponent = layoutManager.getComponent(GRID);\n const { height, width } = (gridComponent && gridComponent.getBoundBox()) || defaultDimensions;\n const target = { target: CANVAS };\n const config = {\n ...target,\n dimensions: { height, width },\n message: NO_DATA_MESSAGE,\n classPrefix: MESSAGE_CONFIG,\n position: TOP\n };\n const wrapperParams = {\n name: MESSAGE,\n component: null,\n config\n };\n const existingComponent = layoutManager.getComponent(MESSAGE);\n\n if (existingComponent) {\n messageWrapper = existingComponent.updateWrapper(wrapperParams);\n } else {\n messageWrapper = new MessageComponent(wrapperParams);\n }\n return messageWrapper;\n }\n return null;\n};\n\n// Mapping between types of scrollBars and their required configs for wrapper creation\nconst scrollBarMap = config => ({\n vertical: {\n componentName: 'verticalScrollBar',\n width: 'thickness',\n height: 'layoutBasedMeasure',\n layoutBasedMeasure: HEIGHT,\n viewMeasure: 'viewHeight',\n rowAlign: 1,\n colAlign: config.align === 'right' ? 2 : 0,\n position: config.align,\n alignment: TOP\n },\n horizontal: {\n componentName: 'horizontalScrollBar',\n width: 'layoutBasedMeasure',\n layoutBasedMeasure: WIDTH,\n viewMeasure: 'viewWidth',\n height: 'thickness',\n rowAlign: config.align === 'top' ? 0 : 2,\n colAlign: 1,\n position: config.align,\n alignment: LEFT\n }\n});\n\n/**\n * Creates the wrapper for the scroller, i.e., horizontal and vertical to be used in the tree layout\n *\n *\n * @param {string} scrollBarType type of scrollbar: horizontal/vertical\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst createScrollBarWrapper = (scrollBarType, layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let scrollBarWrapper = null;\n const { layoutConfig } = renderDetails;\n const target = { target: CANVAS };\n const { scrollBar } = layoutConfig;\n const { layoutDimensions } = grid.viewInfo();\n const {\n actualCenterMeasures,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n const {\n componentName, layoutBasedMeasure, width, height, rowAlign, colAlign,\n viewMeasure, position, alignment\n } = scrollBarMap(scrollBar[scrollBarType])[scrollBarType];\n const dimensions = {\n thickness: scrollBar.thickness,\n layoutBasedMeasure: layoutDimensions[viewMeasure][1]\n };\n const isScroll = grid.scrollInfo()[scrollBarType];\n const totalLength = actualCenterMeasures[layoutBasedMeasure];\n const viewLength = layoutDimensions[viewMeasure][1];\n\n const scrollConfig = Object.assign({}, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n scrollBarComponentConfig: {\n ...scrollBar,\n classPrefix: layoutConfig.classPrefix\n },\n\n type: scrollBarType,\n alignWith: `${ROW_MATRIX_INDEX[rowAlign]}-${COLUMN_MATRIX_INDEX[colAlign]}`,\n alignment,\n position\n });\n\n const wrapperParams = {\n name: componentName,\n config: scrollConfig,\n dimensions: {\n width: dimensions[width],\n height: dimensions[height],\n totalLength,\n viewLength,\n unitHeights,\n unitWidths\n }\n };\n\n const existingComponent = layoutManager.getComponent(componentName);\n\n if (!isScroll) {\n existingComponent && existingComponent.remove();\n return null;\n }\n\n if (existingComponent) {\n scrollBarWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n scrollBarWrapper = new ScrollComponent(wrapperParams);\n }\n\n return scrollBarWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the legend to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createLegendWrapper = (layoutManager, renderDetails, renderGrid) => {\n if (renderGrid) {\n let legendWrapper = null;\n const { components, layoutConfig, measurement } = renderDetails;\n const target = { target: CANVAS };\n\n if (components.legends && components.legends.length) {\n const legendConfig = { ...layoutConfig.legend, ...target, measurement };\n const wrapperParams = {\n name: LEGEND,\n component: components.legends,\n config: legendConfig\n };\n\n const existingComponent = layoutManager.getComponent(LEGEND);\n\n if (existingComponent) {\n legendWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n legendWrapper = new LegendComponent(wrapperParams);\n }\n }\n return legendWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst gridLayoutWrapper = (layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let gridWrapper = null;\n const target = { target: CANVAS };\n const { layoutConfig } = renderDetails;\n\n const config = {\n ...target,\n pagination: layoutConfig.pagination,\n classPrefix: layoutConfig.classPrefix,\n dimensions: { height: 0, width: 0 }\n };\n const wrapperParams = {\n name: GRID,\n component: grid,\n config\n };\n const existingComponent = layoutManager.getComponent(GRID);\n if (existingComponent) {\n gridWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n gridWrapper = new GridComponent(wrapperParams);\n }\n return gridWrapper;\n }\n return null;\n};\n/**\n * Responsible for providing the wrapper creators for every component in Muze.\n * This function, when called, returns the set of components and their respective wrappers.\n *\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} grid Instance of the grid layout\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers for each component\n */\nexport const componentWrapperMaker = (canvas, grid, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const renderGrid = isGridPresent(renderDetails);\n return {\n title: createHeaderWrapper(TITLE, layoutManager, renderDetails),\n subtitle: createHeaderWrapper(SUB_TITLE, layoutManager, renderDetails),\n message: createMessageWrapper(layoutManager, canvas, renderDetails, renderGrid),\n legend: createLegendWrapper(layoutManager, renderDetails, renderGrid),\n grid: gridLayoutWrapper(layoutManager, renderDetails, grid, renderGrid),\n verticalScrollBar: createScrollBarWrapper(VERTICAL, layoutManager, renderDetails, grid, renderGrid),\n horizontalScrollBar: createScrollBarWrapper(HORIZONTAL, layoutManager, renderDetails, grid, renderGrid)\n };\n};\n","export class ScrollManager {\n\n constructor () {\n this._scrollBarComponents = {};\n this._attachedComponents = {};\n }\n\n scrollBarComponents (...sbc) {\n if (sbc.length) {\n this._scrollBarComponents = sbc[0];\n return this;\n }\n return this._scrollBarComponents;\n }\n\n attachedComponents (...abc) {\n if (abc.length) {\n this._attachedComponents = abc[0];\n return this;\n }\n return this._attachedComponents;\n }\n\n preventBrowserScroll (type, event) {\n if (this.scrollBarComponents()[type]) {\n // Prevent default behaviour and stop propagating\n event.preventDefault();\n event.stopPropagation();\n }\n return this;\n }\n\n performAttachedScrollFunction (type, movedViewLength) {\n Object.values(this.attachedComponents()).forEach((e) => {\n e.performScrollAction(type, movedViewLength);\n });\n return this;\n }\n\n triggerScrollBarAction (type, delta) {\n this.scrollBarComponents()[type] && this.scrollBarComponents()[type].scrollDeltaTo(delta);\n return this;\n }\n}\n","import { mergeRecursive } from 'muze-utils';\nimport { arrangeComponents } from './component-resolver';\nimport { createHeaders } from './title-maker';\nimport { createLegend, getLegendSpace } from './legend-maker';\nimport { componentWrapperMaker } from './component-wrapper-maker';\nimport {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n TITLE,\n SUB_TITLE,\n LEGEND,\n VERTICAL_SCROLL_BAR,\n HORIZONTAL_SCROLL_BAR,\n GRID,\n MESSAGE\n} from '../constants';\nimport { ScrollManager } from './scroll-manager';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const prepareLayout = (layout, renderDetails) => {\n const { components, layoutConfig, measurement } = renderDetails;\n const {\n rows,\n columns,\n values,\n cornerMatrices\n } = components;\n const {\n topLeft,\n topRight,\n bottomLeft,\n bottomRight\n } = cornerMatrices;\n if (rows && columns) {\n layout.measurement(measurement)\n .config(layoutConfig)\n .matrices({\n top: [topLeft, columns[0], topRight],\n center: [rows[0], values, rows[1]],\n bottom: [bottomLeft, columns[1], bottomRight]\n })\n .triggerReflow();\n }\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} mount\n *\n */\nexport const getRenderDetails = (context, mount) => {\n let layoutConfig = mergeRecursive({}, context.config());\n // Get height width of the mount point\n let { height, width } = mount.getBoundingClientRect();\n const heightAttr = context.height();\n const widthAttr = context.width();\n const visGroup = context.composition().visualGroup;\n const {\n isColumnSizeEqual,\n isRowSizeEqual,\n priority,\n rows,\n columns,\n values\n } = visGroup.placeholderInfo();\n const {\n minWidth,\n minHeight,\n classPrefix,\n showHeaders,\n legend,\n pagination,\n scrollBar\n } = context.config();\n\n // Get title configuration\n const titleConfig = context.title()[1];\n // Get subtitle configuration\n const subtitleConfig = context.subtitle()[1];\n // Get legend position\n const legendPosition = legend.position;\n // Arrange components according to config\n const layoutArrangement = arrangeComponents(context);\n\n height = Math.floor(height);\n width = Math.floor(width);\n\n const availableHeightForCanvas = Math.max(heightAttr > 0 ? heightAttr : height, minHeight);\n const availableWidthForCanvas = Math.max(widthAttr > 0 ? widthAttr : width, minWidth);\n\n // Create headers and determine header height\n const { headers, headerHeight } = createHeaders(context, availableHeightForCanvas, availableWidthForCanvas);\n\n // Create legends and determine legend space\n const legends = createLegend(context, headerHeight, availableHeightForCanvas, availableWidthForCanvas);\n context._composition.legend = {};\n legends.forEach((e) => {\n context._composition.legend[e.scaleType] = e.legend;\n });\n\n const legendSpace = getLegendSpace(legends, legend, availableHeightForCanvas, availableWidthForCanvas);\n const legendWidth = (legendPosition === LEFT || legendPosition === RIGHT) ? legendSpace.width : 0;\n const legendHeight = (legendPosition === TOP || legendPosition === BOTTOM) ? legendSpace.height : 0;\n\n // Set components for layouting\n const components = {\n headers,\n legends,\n canvases: [context],\n rows,\n columns,\n values,\n cornerMatrices: visGroup.cornerMatrices()\n };\n\n const measurement = {\n mountSpace: {\n height,\n width\n },\n headerHeight,\n legendSpace,\n canvasWidth: availableWidthForCanvas,\n canvasHeight: availableHeightForCanvas,\n width: availableWidthForCanvas - legendWidth,\n height: availableHeightForCanvas - headerHeight - legendHeight,\n minUnitHeight: context.minUnitHeight(),\n minUnitWidth: context.minUnitWidth()\n };\n layoutConfig = mergeRecursive(layoutConfig, {\n classPrefix,\n showHeaders,\n border: mergeRecursive(visGroup.metaData().border, context.config().border),\n layoutArrangement,\n legend,\n buffer: scrollBar.thickness,\n pagination,\n title: titleConfig,\n subtitle: subtitleConfig,\n isColumnSizeEqual,\n isRowSizeEqual,\n mount,\n priority\n });\n return {\n layoutConfig,\n components,\n measurement\n };\n};\n\nconst componentIndexes = {\n title: 0,\n subtitle: 1,\n legend: 2,\n verticalScrollBar: 3,\n horizontalScrollBar: 4,\n grid: 5,\n message: 6\n};\n\nconst componentNames = {\n 0: TITLE,\n 1: SUB_TITLE,\n 2: LEGEND,\n 3: VERTICAL_SCROLL_BAR,\n 4: HORIZONTAL_SCROLL_BAR,\n 5: GRID,\n 6: MESSAGE\n};\n\nconst attachListeners = (componentWrappers) => {\n componentWrappers.forEach((componentWrapper) => {\n if (componentWrapper) {\n componentWrapper.attachListener();\n }\n });\n};\n\n/**\n * Responsible for creating a scroll manager that manages interactions between the grid\n * component and the scroll bar components\n *\n * @param {Array} componentWrappers Contains the wrappers for all the components\n * @param {Canvas} canvas Instance of the current canvas\n * @return {Array} Positions of units either horizontal or vertical\n */\nconst createScrollManager = (componentWrappers, canvas) => {\n const {\n horizontalScrollBar,\n verticalScrollBar,\n grid\n } = componentIndexes;\n\n const horizontalScrollWrapper = componentWrappers[horizontalScrollBar];\n const verticalScrollWrapper = componentWrappers[verticalScrollBar];\n const gridWrapper = componentWrappers[grid];\n const scrollBarManager = new ScrollManager();\n const scrollBarComponents = {};\n\n verticalScrollWrapper && (scrollBarComponents.vertical = verticalScrollWrapper);\n horizontalScrollWrapper && (scrollBarComponents.horizontal = horizontalScrollWrapper);\n\n scrollBarManager\n .scrollBarComponents(scrollBarComponents)\n .attachedComponents({\n grid: gridWrapper\n });\n canvas.composition().hScrollBar = horizontalScrollWrapper;\n canvas.composition().vScrollBar = verticalScrollWrapper;\n\n [horizontalScrollWrapper, verticalScrollWrapper].forEach((wrapper) => {\n wrapper && wrapper.manager(scrollBarManager);\n });\n\n gridWrapper.scrollBarManager(scrollBarManager);\n};\n\nexport const renderLayout = (canvas, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const gridLayout = canvas.layout();\n const {\n\n grid\n } = componentIndexes;\n\n // Get the component wrappers\n const compWrappers = componentWrapperMaker(canvas, gridLayout, renderDetails);\n const componentWrappers = Object.keys(componentIndexes).map(e => compWrappers[e]);\n const gridWrapper = componentWrappers[grid];\n if (gridWrapper) {\n createScrollManager(componentWrappers, canvas);\n }\n\n componentWrappers.forEach((componentWrapper, index) => {\n if (!componentWrapper) {\n const deleteElementName = componentNames[index];\n layoutManager.removeComponent(deleteElementName);\n }\n });\n layoutManager.registerComponents(componentWrappers).compute();\n attachListeners(componentWrappers);\n};\n","import {\n getDataModelFromIdentifiers,\n FieldType,\n mergeRecursive,\n isSimpleObject,\n CommonProps\n} from 'muze-utils';\nimport { Firebolt } from '@chartshq/muze-firebolt';\n\nimport { applyInteractionPolicy } from '../helper';\n\nconst defaultInteractionPolicy = (valueMatrix, firebolt) => {\n const isMeasure = field => field.type() === FieldType.MEASURE;\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n const xFields = [].concat(...visualGroup.getFieldsFromChannel('x'));\n const yFields = [].concat(...visualGroup.getFieldsFromChannel('y'));\n const colDim = xFields.every(field => field.type() === FieldType.DIMENSION);\n const fieldInf = visualGroup.resolver().getAllFields();\n const rowFacets = fieldInf.rowFacets;\n const colFacets = fieldInf.colFacets;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n if (!(xFields.every(isMeasure) && yFields.every(isMeasure))) {\n const facetFields = cell.valueOf().facetByFields()[0];\n const unitColFacets = facetFields.filter(d => colFacets.findIndex(v => v.equals(d)) !== -1);\n const unitRowFacets = facetFields.filter(d => rowFacets.findIndex(v => v.equals(d)) !== -1);\n let propFields;\n if (colDim) {\n propFields = unitColFacets.map(d => `${d}`);\n } else {\n propFields = unitRowFacets.map(d => `${d}`);\n }\n\n unitFireBolt.propagateWith('*', propFields, true);\n }\n });\n};\n\nconst defaultCrossInteractionPolicy = {\n behaviours: {\n '*': (propagationPayload, context) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = context.parentAlias();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n }\n },\n sideEffects: {\n tooltip: (propagationPayload, context) => {\n const propagationUnit = propagationPayload.sourceUnit;\n const propagationCanvas = propagationPayload.sourceCanvas;\n const unitId = context.id();\n const canvasAlias = context.parentAlias();\n if (propagationCanvas) {\n return propagationCanvas !== canvasAlias ? true : unitId === propagationUnit;\n }\n return true;\n },\n selectionBox: () => false\n }\n};\n\n/**\n * This class is responsible for dispatching any behavioural action to all the visual units housed by the canvas.\n * It is created by {@link Canvas}. This class does not handle any physical actions. Physical actions get triggered\n * in {@link VisualUnit} which is managed by it's own firebolt instance. The firebolt instance of canvas only\n * propagates the action to all the visual units in it's composition.\n *\n * To get the firebolt instance of {@link Canvas}\n * ```\n * const firebolt = canvas.firebolt();\n * ```\n *\n * @class GroupFireBolt\n * @public\n */\nexport default class GroupFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this._interactionPolicy = this.constructor.defaultInteractionPolicy();\n this.crossInteractionPolicy(this.constructor.defaultCrossInteractionPolicy());\n }\n\n static defaultInteractionPolicy () {\n return defaultInteractionPolicy;\n }\n\n static defaultCrossInteractionPolicy () {\n return defaultCrossInteractionPolicy;\n }\n\n interactionPolicy (...policy) {\n if (policy.length) {\n this._interactionPolicy = policy[0] || this.constructor.defaultInteractionPolicy();\n return this;\n }\n return this._interactionPolicy;\n }\n\n crossInteractionPolicy (...policy) {\n if (policy.length) {\n this._crossInteractionPolicy = mergeRecursive(mergeRecursive({},\n this.constructor.defaultCrossInteractionPolicy()), policy[0] || {});\n const context = this.context;\n applyInteractionPolicy(this);\n context._throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => {\n applyInteractionPolicy(this);\n });\n return this;\n }\n return this._crossInteractionPolicy;\n }\n\n /**\n * Dispatches a behavioural action with a payload. It takes the name of the behavioural action and a payload\n * object which contains the criteria aend an array of side effects which determines what side effects are\n * going to be shown in each visual unit of the canvas. It prepares the datamodel from the given criteria\n * and initiates a propagation from the datamodel of canvas. Then all the visual units of canvas which listens\n * to the propagation gets informed on which rows got selected and dispatches the behavioural action sent during\n * propagation.\n *\n * To dispatch a behavioural action on the canvas\n * ```\n * // Get the firebolt instance of the canvas\n * const firebolt = canvas.firebolt();\n * // Dispatch a brush behaviour\n * firebolt.dispatchBehaviour('brush', {\n * // Selects all the rows with Horsepower having range between 100 and 200.\n * criteria: {\n * Horsepower: [100, 200]\n * }\n * });\n * // On dispatch of this behavioural action, a selection box gets created and plots gets faded out which are the\n * // default side effects mapped to this behavioural action.\n * ```\n *\n * ```\n * Additionally, it can also be passed an array of side effects in the payload.\n * // Dispatch a select behaviour with only crossline as side effect.\n * firebolt.dispatchBehaviour('select', {\n * criteria: {\n * Cylinders: ['8']\n * },\n * sideEffects: ['crossline']\n * });\n * ```\n *\n * @public\n *\n * @param {string} behaviour Name of the behavioural action\n * @param {Object} payload Object which contains the interaction information.\n * @param {Object | Array.} payload.criteria Identifiers by which the selection happens.\n * @param {Array.} payload.sideEffects Side effects which needs to be shown.\n *\n * @return {GroupFireBolt} Instance of firebolt.\n */\n dispatchBehaviour (behaviour, payload) {\n const propPayload = Object.assign(payload);\n const criteria = propPayload.criteria;\n const data = this.context.composition().visualGroup.getGroupByData();\n const fieldsConfig = data.getFieldsConfig();\n const model = getDataModelFromIdentifiers(data, criteria);\n const behaviouralAction = this._actions.behavioural[behaviour];\n\n if (behaviouralAction) {\n const fields = isSimpleObject(criteria) ? Object.keys(criteria) : (criteria ? criteria[0] : []);\n const validFields = fields.filter(field => field in fieldsConfig);\n const mutates = behaviouralAction.constructor.mutates();\n const propConfig = {\n payload: propPayload,\n action: behaviour,\n criteria: model,\n sourceId: this.context.alias(),\n isMutableAction: mutates,\n propagateInterpolatedValues: validFields.every(field => fieldsConfig[field].def.type ===\n FieldType.MEASURE)\n };\n data.propagate(model, propConfig, true);\n }\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n return this;\n }\n}\n","import GroupFireBolt from './group-firebolt';\n\nexport default GroupFireBolt;\n","export const APP_INITIAL_STATE = {\n app: {\n group: {},\n units: {},\n layers: {},\n canvas: {}\n },\n local: {\n canvas: {},\n group: {},\n units: {},\n layers: {}\n }\n};\n\n","import { GridLayout } from '@chartshq/layout';\nimport { transactor, Store, getUniqueId, selectElement, STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { RETINAL } from '../constants';\nimport TransactionSupport from '../transaction-support';\nimport { getRenderDetails, prepareLayout, renderLayout } from './layout-maker';\nimport { localOptions, canvasOptions } from './local-options';\nimport GroupFireBolt from './firebolt';\nimport options from '../options';\nimport { APP_INITIAL_STATE } from './app-state';\nimport { initCanvas,\n setupChangeListener,\n setLabelRotationForAxes,\n createGroupState,\n createLayoutManager,\n setLayoutInfForUnits\n} from './helper';\n/**\n * Canvas is a logical component which houses a visualization by taking multiple variable in different encoding channel.\n * Canvas manages lifecycle of many other logical component and exposes one consistent interface for creation of chart.\n * Canvas is intialized from environment with settings from environment and singleton dependencies.\n *\n * To create an instance of canvas\n * ```\n * const env = Muze();\n * const canvas = env.canvas()\n * ```\n *\n *\n * @class\n * @public\n * @module Canvas\n */\nexport default class Canvas extends TransactionSupport {\n\n /**\n * Creates reactive property accessors.\n * - data\n * - height\n * - width\n * - config\n * This configs are retrieved from options.\n */\n constructor (globalDependencies) {\n super();\n\n this._allOptions = Object.assign({}, options, localOptions);\n this._registry = {};\n this._composition = {};\n this._cachedProps = {};\n this._alias = null;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n this._composition.layout = new GridLayout();\n this._store = new Store(APP_INITIAL_STATE);\n\n this._throwback = new Store({\n [CommonProps.MATRIX_CREATED]: false,\n [CommonProps.ON_LAYER_DRAW]: null\n });\n\n // Setters and getters will be mounted on this. The object will be mutated.\n const namespace = STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE;\n const allOptions = Object.assign({}, options, localOptions, canvasOptions);\n\n transactor(this, allOptions, this._store, {\n namespace\n });\n\n this.dependencies(Object.assign({}, globalDependencies, this._dependencies));\n this.firebolt(new GroupFireBolt(this, {\n behavioural: behaviouralActions,\n physical: physicalActions,\n physicalBehaviouralMap: {}\n }, sideEffects, behaviourEffectMap));\n this.alias(`canvas-${getUniqueId()}`);\n this.title('', {});\n this.subtitle('', {});\n this.legend({});\n this.color({});\n this.shape({});\n this.size({});\n setupChangeListener(this);\n // init layoutManager\n this._layoutManager = createLayoutManager();\n }\n\n /**\n * Retrieves an instance of layout which is responsible for layouting. Layout is responsible for creating faceted\n * presentation using table layout.\n *\n * @public\n *\n * @return {GridLayout} Instance of layout attached to canvas.\n */\n layout (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().layout;\n }\n\n /**\n * Retrieves the composition for a canvas\n *\n * @public\n *\n * @return {object} Instances of the components which canvas requires to draw the full visualization.\n * ```\n * {\n * layout: // Instance of {@link GridLayout}\n * legend: // Instance of {@link Legend}\n * subtitle: // Instance of {@link TextCell} using which the title is rendered\n * title: // Instance of {@link TextCell} using which the title is rendered\n * visualGroup: // Instance of {@link visualGroup}\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Sets or gets the alias of the canvas. Alias is a name by which the canvas can be referred.\n *\n * When setter\n * @param {string} alias Name of the alias.\n *\n * @return {Canvas} Instance of the canvas.\n *\n * When getter\n *\n * @return {string} Alias of canvas.\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n const visualGroup = this.composition().visualGroup;\n this._alias = params[0];\n visualGroup && visualGroup.alias(this.alias());\n return this;\n }\n return this._alias;\n }\n\n /**\n * Creates an instance initiated with given settings.\n *\n * @param {Object} initialSettings Initial settings to be populated in the model\n * @param {Object} regEntry newly created instance with the initial settings\n * @param {Object} globalDependencies dependencies which will be created only once in the page\n *\n * @return {Object} newly created instance with the initial settings\n */\n static withSettings (initialSettings, regEntry, globalDependencies) {\n const instance = new Canvas(globalDependencies);\n\n for (const key in initialSettings) {\n instance[key](initialSettings[key]);\n }\n // set registry for instance\n instance.registry(regEntry);\n return instance;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof Canvas\n */\n static formalName () {\n return 'canvas';\n }\n\n /**\n * Returns the instance of firebolt associated with this canvas. The firebolt instance can be used to dispatch a\n * behaviour dynamically on the canvas. This firebolt does not handle any physical actions. It is just used to\n * propagate the action to all the visual units in it's composition.\n *\n * @public\n *\n * @return {GroupFireBolt} Instance of firebolt associated with canvas.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Registry peoperty accessor\n *\n * @param {Object} reg plain old javascript object keyvalue pairs. Key containing module name and value contains\n * module definition class. The reg object has to be flat object of level 1.\n */\n registry (...params) {\n if (params.length) {\n const components = Object.assign({}, params[0].components);\n const componentSubRegistry = Object.assign({}, params[0].componentSubRegistry);\n\n this._registry = { components, componentSubRegistry };\n const initedComponents = initCanvas(this);\n // @todo is it okay to continue this tight behaviour? If not use a resolver to resolve diff component type.\n this._composition.visualGroup = initedComponents[0];\n createGroupState(this);\n this.composition().visualGroup.alias(this.alias()).store(this._store);\n return this;\n }\n return this._registry;\n }\n\n /*\n * Prepare dependencies for top level elements\n */\n dependencies (...param) {\n if (param.length) {\n this._dependencies = param[0];\n return this;\n }\n // @todo prepare dependencies here.\n return this._dependencies;\n }\n\n /**\n *\n *\n * @param {*} lifeCycles\n *\n * @memberof Canvas\n */\n lifeCycle (lifeCycles) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n if (lifeCycles) {\n lifeCycleManager.register(lifeCycles);\n return this;\n }\n return lifeCycleManager;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof Canvas\n */\n legend (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().legend;\n }\n\n /**\n * Returns a promise for various {@link LifecycleEvents} of the various components of canvas. The promise gets\n * resolved once the particular event gets completed.\n *\n * To use this,\n * ```\n * canvas.once('layer.drawn').then(() => {\n * // Do any post drawing work here.\n * });\n * ```\n * @public\n *\n * @param {string} eventName Name of the lifecycle event.\n *\n * @return {Promise} A pending promise waiting for resolve to be called.\n */\n once (eventName) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n return lifeCycleManager.retrieve(eventName);\n }\n\n /**\n * Internal function to trigger render, this method is cognizant of all the properties of the core modules and\n * establish a passive reactivity. Passive reactivity is not always a bad thing :)\n * @internal\n */\n render () {\n const mount = this.mount();\n // removeChild(mount);\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n // Get render details including arrangement and measurement\n const renderDetails = getRenderDetails(this, mount);\n lifeCycleManager.notify({ client: this, action: 'beforedraw' });\n // Prepare the layout by triggering the matrix calculation\n prepareLayout(this.layout(), renderDetails);\n\n this._layoutManager.dimension({\n height: renderDetails.measurement.canvasHeight,\n width: renderDetails.measurement.canvasWidth\n });\n\n this._layoutManager.renderAt(mount);\n\n // Render each component\n renderLayout(this, renderDetails);\n\n setLayoutInfForUnits(this);\n\n // setLabelRotation\n setLabelRotationForAxes(this);\n }\n\n /**\n * Returns the instances of x axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the top axis and the second element represents the bottom\n * // axis.\n * [\n * [X1, X2],\n * [X3, X4]\n * ]\n * ```\n * @public\n *\n * @return {Array.} Instances of x axis.\n */\n xAxes () {\n return this.composition().visualGroup.getAxes('x');\n }\n\n /**\n * Returns the instances of y axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the left axis and the second element represents the right\n * // axis.\n * [\n * [Y1, Y2],\n * [Y3, Y4]\n * ]\n * ```\n * @public\n * @return {Array.} Instances of y axis.\n */\n yAxes () {\n return this.composition().visualGroup.getAxes('y');\n }\n\n /**\n * Returns all the retinal axis of the canvas. Color, shape and size axis are combinedly called retinal axis.\n *\n * @public\n * @return {Object} Instances of retinal axis.\n * ```\n * {\n * color: [ColorAxis], // Array of color axis.\n * shape: [ShapeAxis], // Array of shape axis.\n * size: [SizeAxis] // Array of size axis.\n * }\n * ```\n */\n getRetinalAxes () {\n const visualGroup = this.composition().visualGroup;\n return visualGroup.getAxes(RETINAL);\n }\n\n mount (...params) {\n if (params.length) {\n let value = params[0];\n if (typeof params[0] === 'string') {\n value = selectElement(params[0]).node();\n }\n this._mount = value;\n return this;\n }\n return this._mount;\n }\n}\n","import { cellRegistry, SimpleCell } from '@chartshq/visual-cell';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { layerRegistry } from '@chartshq/visual-layer';\nimport { SimpleGroup, VisualGroup } from '@chartshq/visual-group';\n\nexport const COMPONENTS = {\n VisualGroup,\n VisualUnit\n};\nexport const SUBREGISTRIES = {\n cellRegistry,\n layerRegistry\n};\nexport const INTERFACES = {\n SimpleGroup,\n SimpleCell\n};\n\n","import { DEFAULT_LAYERS } from './defaults';\n\nexport default () => {\n const reg = DEFAULT_LAYERS;\n const regObj = {\n set: (key, def) => {\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n return regObj;\n};\n","import {\n transactor,\n Smartlabel,\n enableChainedTransaction,\n LifeCycleManager,\n DataModel,\n makeElement,\n getClientPoint,\n selectElement,\n getEvent,\n require,\n DateTimeFormatter,\n Store\n} from 'muze-utils';\n\nimport {\n SurrogateSideEffect,\n SpawnableSideEffect,\n sideEffects,\n PersistentBehaviour,\n GenericBehaviour,\n VolatileBehaviour,\n behaviouralActions,\n GenericSideEffect\n} from '@chartshq/muze-firebolt';\nimport { layerFactory } from '@chartshq/visual-layer';\nimport pkg from '../package.json';\nimport * as operators from './operators';\nimport { actionModel as ActionModel } from './action-model';\nimport options from './options';\nimport { Canvas } from './canvas';\nimport { COMPONENTS, SUBREGISTRIES } from './default-registry';\nimport './muze.scss';\n\n// Cache singleton instances which should be included only once in a page\nconst globalCache = {};\nconst defaultRegistry = COMPONENTS;\n\nconst overrideRegistryDefinitions = (overrideRegistry, registry) => {\n for (const prop in overrideRegistry) {\n registry.set(prop, overrideRegistry[prop]);\n }\n};\n\n/**\n * Entry point to renderer. Initializes an environment with settings and registries for canvas. This is a simple wrapper\n * over {@link Canvas} which enables common configuration passing to multiple such canvases.\n *\n * Everytime `muze()` is called it creates an environment. These environment supports subset of APIs of Canvas. If\n * common configuration is used to render multiple canvases then it can be set directly in the env. Like if data is\n * common across all the visulization then its better to set the data in env. When a canvas is created it receives all\n * those configuration from env.\n *\n * ```\n * // Creates an environment\n * const env = muze()\n * // Set data property in environment, so that all the canvas created from the same environment gets this data\n * // automatically\n * env.data(dm);\n * // Creates canvas, by default env pushes data to canvas instance\n * const canvas = env.canvas();\n * ```\n *\n * If a property is set on both environment and canvas instance, property set on canvas instance gets more priority.\n *\n * @public\n * @module muze\n * @namespace Muze\n *\n * @return {Env} Instance of an environment\n */\nconst muze = () => {\n // Setters and getters will be mounted on this. Object will be mutated.\n const [env, globalStore] = transactor({}, options);\n const components = Object.assign({}, COMPONENTS);\n const componentSubRegistryDef = Object.assign(SUBREGISTRIES);\n const componentSubRegistry = {};\n\n for (const prop in componentSubRegistryDef) {\n componentSubRegistry[prop] = componentSubRegistryDef[prop]();\n }\n\n // Apart form the setter getter, an instance method is injected to create real renderer instances\n env.canvas = () => {\n // Create a canvas instance with this settings\n const settings = globalStore.serialize();\n const canvas = Canvas.withSettings(settings, { /* registry */\n components,\n componentSubRegistry\n }, env.globalDependencies());\n\n // Whenever settings is changed canvas is updated\n enableChainedTransaction(globalStore, canvas, Object.keys(settings));\n\n return canvas;\n };\n\n // Global dependencies for for compositions. Only one copy of the same should be in the page\n env.globalDependencies = () => {\n if (!globalCache.smartlabel) {\n globalCache.smartlabel = new Smartlabel(1, 'body');\n }\n return {\n smartlabel: globalCache.smartlabel,\n lifeCycleManager: new LifeCycleManager()\n };\n };\n\n // Retrieves global settings. This getter is readonly so that user can't change this as change should happen\n // only from setter to avoid unwanted sync issues.\n env.settings = () => globalStore.serialize();\n\n env.registry = (...overrideRegistry) => {\n // Selectively copy the properties from COMPONENTS\n if (overrideRegistry.length) {\n for (const prop in overrideRegistry) {\n if (prop in defaultRegistry) {\n components[prop] = overrideRegistry[prop];\n }\n }\n return env;\n }\n return components;\n };\n\n env.cellRegistry = (...overrideRegistry) => {\n const cellRegistry = componentSubRegistry.cellRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry[0], cellRegistry);\n return env;\n }\n return cellRegistry.get();\n };\n\n env.layerRegistry = (...overrideRegistry) => {\n const layerRegistry = componentSubRegistry.layerRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry[0], layerRegistry);\n return env;\n }\n return layerRegistry.get();\n };\n\n return env;\n};\n\nconst SideEffects = {\n sideEffects,\n standards: {\n SurrogateSideEffect,\n SpawnableSideEffect,\n GenericSideEffect\n }\n};\n\nconst Behaviours = {\n behaviouralActions,\n standards: {\n GenericBehaviour,\n PersistentBehaviour,\n VolatileBehaviour\n }\n};\n\nmuze.DataModel = DataModel;\nmuze.version = pkg.version;\nmuze.SideEffects = SideEffects;\nmuze.ActionModel = ActionModel;\nmuze.layerFactory = layerFactory;\nmuze.Operators = operators;\nmuze.Behaviours = Behaviours;\nmuze.utils = {\n getClientPoint,\n getEvent,\n makeElement,\n selectElement,\n DateTimeFormatter,\n require\n};\nmuze.Model = new Store().model.constructor;\nexport default muze;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://muze/webpack/universalModuleDefinition","webpack://muze/webpack/bootstrap","webpack://muze/webpack://DataModel/webpack/universalModuleDefinition","webpack://muze/webpack://DataModel/webpack/bootstrap","webpack://muze/webpack://DataModel/src/index.js","webpack://muze/webpack://DataModel/src/enums/data-format.js","webpack://muze/webpack://DataModel/src/enums/dimension-subtype.js","webpack://muze/webpack://DataModel/src/enums/measure-subtype.js","webpack://muze/webpack://DataModel/src/enums/field-type.js","webpack://muze/webpack://DataModel/src/enums/filtering-mode.js","webpack://muze/webpack://DataModel/src/enums/group-by-functions.js","webpack://muze/webpack://DataModel/src/utils/date-time-formatter.js","webpack://muze/webpack://DataModel/src/utils/column-major.js","webpack://muze/webpack://DataModel/src/utils/extend2.js","webpack://muze/webpack://DataModel/src/utils/helper.js","webpack://muze/webpack://DataModel/src/field-store.js","webpack://muze/webpack://DataModel/src/value.js","webpack://muze/webpack://DataModel/src/operator/row-diffset-iterator.js","webpack://muze/webpack://DataModel/src/invalid-aware-types.js","webpack://muze/webpack://DataModel/src/constants/index.js","webpack://muze/webpack://DataModel/src/operator/get-common-schema.js","webpack://muze/webpack://DataModel/src/operator/cross-product.js","webpack://muze/webpack://DataModel/src/operator/merge-sort.js","webpack://muze/webpack://DataModel/src/operator/sort.js","webpack://muze/webpack://DataModel/src/operator/data-builder.js","webpack://muze/webpack://DataModel/src/operator/difference.js","webpack://muze/webpack://DataModel/src/operator/group-by-function.js","webpack://muze/webpack://DataModel/src/utils/reducer-store.js","webpack://muze/webpack://DataModel/src/operator/natural-join-filter-function.js","webpack://muze/webpack://DataModel/src/operator/union.js","webpack://muze/webpack://DataModel/src/operator/outer-join.js","webpack://muze/webpack://DataModel/src/fields/partial-field/index.js","webpack://muze/webpack://DataModel/src/fields/field/index.js","webpack://muze/webpack://DataModel/src/fields/dimension/index.js","webpack://muze/webpack://DataModel/src/fields/measure/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/field-parser/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/categorical-parser/index.js","webpack://muze/webpack://DataModel/src/fields/categorical/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/temporal-parser/index.js","webpack://muze/webpack://DataModel/src/fields/helper.js","webpack://muze/webpack://DataModel/src/fields/temporal/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/binned-parser/index.js","webpack://muze/webpack://DataModel/src/fields/binned/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/continuous-parser/index.js","webpack://muze/webpack://DataModel/src/fields/continuous/index.js","webpack://muze/webpack://DataModel/src/fields/field-registry.js","webpack://muze/webpack://DataModel/src/field-creator.js","webpack://muze/webpack://DataModel/src/default-config.js","webpack://muze/webpack://DataModel/src/converter/model/dataConverter.js","webpack://muze/webpack://DataModel/node_modules/d3-dsv/src/dsv.js","webpack://muze/webpack://DataModel/src/converter/utils/dsv-arr.js","webpack://muze/webpack://DataModel/src/converter/utils/dsv-str.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/dsvStringConverter.js","webpack://muze/webpack://DataModel/src/converter/utils/flat-json.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/jsonConverter.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/dsvArrayConverter.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/autoConverter.js","webpack://muze/webpack://DataModel/src/converter/utils/auto-resolver.js","webpack://muze/webpack://DataModel/src/converter/dataConverterStore.js","webpack://muze/webpack://DataModel/src/helper.js","webpack://muze/webpack://DataModel/src/relation.js","webpack://muze/webpack://DataModel/src/datamodel.js","webpack://muze/webpack://DataModel/src/operator/group-by.js","webpack://muze/webpack://DataModel/src/operator/bucket-creator.js","webpack://muze/webpack://DataModel/src/stats/index.js","webpack://muze/webpack://DataModel/src/export.js","webpack://muze/webpack://DataModel/src/operator/compose.js","webpack://muze/webpack://DataModel/src/operator/pure-operators.js","webpack://muze/webpack://DataModel/src/operator/natural-join.js","webpack://muze/(webpack)/buildin/module.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/SmartlabelManager.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/lib.js","webpack://muze/webpack://hyperdis/webpack/universalModuleDefinition","webpack://muze/webpack://hyperdis/webpack/bootstrap","webpack://muze/webpack://hyperdis/src/utils/set.js","webpack://muze/webpack://hyperdis/src/utils/index.js","webpack://muze/webpack://hyperdis/src/graph-node.js","webpack://muze/webpack://hyperdis/src/electric-node.js","webpack://muze/webpack://hyperdis/src/graph.js","webpack://muze/webpack://hyperdis/src/model.js","webpack://muze/webpack://hyperdis/src/index.js","webpack://muze/./packages/muze/src/index.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/container-manager.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisector.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisect.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/range.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ticks.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/threshold/sturges.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/map.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/nest.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/set.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/ordinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/band.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/define.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basis.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/rgb.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/numberArray.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basisClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/object.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/string.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/value.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/date.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/round.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/continuous.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatSpecifier.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatDecimal.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatPrefixAuto.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/exponent.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTrim.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatRounded.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTypes.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatGroup.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatNumerals.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionRound.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/tickFormat.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionPrefix.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionFixed.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/nice.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/log.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/pow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantize.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/threshold.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/interval.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/year.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/month.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/week.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/day.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/hour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/minute.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/second.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/millisecond.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcWeek.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcDay.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcYear.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/time.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMonth.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcHour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMinute.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category10.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20b.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20c.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/sequential.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Dark2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Paired.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Accent.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set3.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/ramp.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Blues.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/BrBG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PRGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PiYG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PuOr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdGy.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/Spectral.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greens.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greys.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Purples.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Reds.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js","webpack://muze/./packages/muze-utils/src/enums/namespace.js","webpack://muze/./packages/muze-utils/src/quick-select.js","webpack://muze/./packages/muze-utils/src/r-tree.js","webpack://muze/./packages/muze-utils/src/enums/reserved-fields.js","webpack://muze/./packages/muze-utils/src/enums/common-props.js","webpack://muze/./packages/muze-utils/src/enums/constants.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/axis.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/diamond.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/square.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/star.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/wye.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/triangle.js","webpack://muze/./packages/muze-utils/node_modules/d3-path/src/path.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/stack.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/step.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/cardinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/catmullRom.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/line.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/arc.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/hsl.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/piecewise.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/cubic.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/bounce.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/elastic.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/back.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/poly.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/RedBlackTree.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Edge.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Cell.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Beach.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Diagram.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/voronoi.js","webpack://muze/./packages/muze-utils/src/DataSystem/selection.js","webpack://muze/./packages/muze-utils/src/DataSystem/dataSelect.js","webpack://muze/./packages/muze-utils/src/enums/stack-config.js","webpack://muze/./packages/muze-utils/src/common-utils.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/diverging.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/expand.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/wiggle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/area.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/pie.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selector.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selectorAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/matcher.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sparse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/enter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/data.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sort.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/call.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespaces.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespace.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/window.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/classed.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/html.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/raise.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/lower.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/creator.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/insert.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/clone.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/exit.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/join.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/order.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/nodes.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/node.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/size.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/empty.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/each.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/property.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/append.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/datum.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-dispatch/src/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/sourceEvent.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/mouse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/touch.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/noevent.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/nodrag.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/event.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/drag.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timer.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timeout.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/schedule.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/interrupt.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/parse.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/decompose.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/tween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/interpolate.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selection.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/textTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attrTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/styleTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/delay.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/ease.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/end.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/interrupt.js","webpack://muze/./packages/muze-utils/src/renderer-utils.js","webpack://muze/./packages/muze-utils/src/store.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/event-list.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/lifecycle-manager.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/index.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/helper.js","webpack://muze/./packages/muze-utils/src/index.js","webpack://muze/./packages/visual-layer/src/enums/constants.js","webpack://muze/./packages/visual-layer/src/simple-layer/simple-layer.js","webpack://muze/./packages/visual-layer/src/enums/props.js","webpack://muze/./packages/visual-layer/src/base-layer/props.js","webpack://muze/./packages/muze-axis/src/enums/axis-orientation.js","webpack://muze/./packages/muze-axis/src/enums/scale-type.js","webpack://muze/./packages/muze-axis/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/scale-creator.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/default-config.js","webpack://muze/./packages/muze-axis/src/axis-renderer.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/skip-ticks.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/space-setter.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/helper.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/props.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/simple-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/linear.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/log.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/pow.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/continous-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/band-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/time-axis.js","webpack://muze/./packages/muze-axis/src/color-axis/color-maps.js","webpack://muze/./packages/muze-axis/src/color-axis/defaults.js","webpack://muze/./packages/muze-axis/src/color-axis/props.js","webpack://muze/./packages/muze-axis/src/helper.js","webpack://muze/./packages/muze-axis/src/color-axis/color-strategy.js","webpack://muze/./packages/muze-axis/src/color-axis/color-axis.js","webpack://muze/./packages/muze-axis/src/size-axis/defaults.js","webpack://muze/./packages/muze-axis/src/size-axis/size-strategy.js","webpack://muze/./packages/muze-axis/src/size-axis/props.js","webpack://muze/./packages/muze-axis/src/size-axis/size-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/defaults.js","webpack://muze/./packages/muze-axis/src/shape-axis/props.js","webpack://muze/./packages/muze-axis/src/shape-axis/shape-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/helper.js","webpack://muze/./packages/muze-axis/src/polar-axis/props.js","webpack://muze/./packages/muze-axis/src/polar-axis/angle-axis.js","webpack://muze/./packages/visual-group/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/polar-axis/radius-axis.js","webpack://muze/./packages/muze-axis/src/data-type-scale-map.js","webpack://muze/./packages/transform/src/group-transform/index.js","webpack://muze/./packages/transform/src/identity-transform/index.js","webpack://muze/./packages/transform/src/transform-factory/index.js","webpack://muze/./packages/transform/src/enums/transform-type.js","webpack://muze/./packages/transform/src/stack-transform/index.js","webpack://muze/./packages/visual-layer/src/helpers/index.js","webpack://muze/./packages/visual-layer/src/base-layer/local-options.js","webpack://muze/./packages/visual-layer/src/base-layer/listener-map.js","webpack://muze/./packages/visual-layer/src/base-layer/helper.js","webpack://muze/./packages/visual-layer/src/base-layer/base-mixin.js","webpack://muze/./packages/visual-layer/src/base-layer/base-layer.js","webpack://muze/./packages/visual-layer/src/layers/line/renderer.js","webpack://muze/./packages/visual-layer/src/layers/line/default-config.js","webpack://muze/./packages/visual-layer/src/layers/line/line-mixin.js","webpack://muze/./packages/visual-layer/src/layers/area/default-config.js","webpack://muze/./packages/visual-layer/src/layers/area/renderer.js","webpack://muze/./packages/visual-layer/src/layers/area/area-mixin.js","webpack://muze/./packages/visual-layer/src/layers/area/area.js","webpack://muze/./packages/visual-layer/src/layers/arc/default-config.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc-mixin.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc-helper.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc.js","webpack://muze/./packages/visual-layer/src/layers/line/line.js","webpack://muze/./packages/visual-layer/src/layers/text/renderer.js","webpack://muze/./packages/visual-layer/src/layers/text/default-config.js","webpack://muze/./packages/visual-layer/src/layers/text/text-mixin.js","webpack://muze/./packages/visual-layer/src/layers/text/text.js","webpack://muze/./packages/visual-layer/src/layers/point/renderer.js","webpack://muze/./packages/visual-layer/src/layers/point/default-config.js","webpack://muze/./packages/visual-layer/src/layers/point/helper.js","webpack://muze/./packages/visual-layer/src/layers/point/point-mixin.js","webpack://muze/./packages/visual-layer/src/layers/point/point.js","webpack://muze/./packages/visual-layer/src/layers/bar/renderer.js","webpack://muze/./packages/visual-layer/src/layers/bar/default-config.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar-helper.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar-mixin.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar.js","webpack://muze/./packages/visual-layer/src/layers/tick/default-config.js","webpack://muze/./packages/visual-layer/src/layers/tick/renderer.js","webpack://muze/./packages/visual-layer/src/layers/tick/tick-mixin.js","webpack://muze/./packages/visual-layer/src/layers/tick/helper.js","webpack://muze/./packages/visual-layer/src/layers/tick/tick.js","webpack://muze/./packages/visual-layer/src/enums/layer-types.js","webpack://muze/./packages/visual-layer/src/layer-factory/layer-factory.js","webpack://muze/./packages/visual-layer/src/layer-factory/index.js","webpack://muze/./packages/visual-layer/src/defaults.js","webpack://muze/./packages/visual-layer/src/layer-registry.js","webpack://muze/./packages/visual-layer/src/index.js","webpack://muze/./packages/visual-unit/src/helper/index.js","webpack://muze/./packages/visual-unit/src/enums/reactive-props.js","webpack://muze/./packages/visual-unit/src/enums/constants.js","webpack://muze/./packages/muze-firebolt/src/enums/actions.js","webpack://muze/./packages/muze-firebolt/src/enums/selection.js","webpack://muze/./packages/muze-firebolt/src/selection-set/index.js","webpack://muze/./packages/muze-firebolt/src/selection-set/selection-set.js","webpack://muze/./packages/muze-firebolt/src/helper/index.js","webpack://muze/./packages/muze-firebolt/src/firebolt.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/generic.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/volatile.js","webpack://muze/./packages/muze-firebolt/src/enums/behaviours.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/highlight.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/brush.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/filter.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/persistent.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/select.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-event.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/hover.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/click.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/drag.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/longtouch.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/touch-drag.js","webpack://muze/./packages/muze-firebolt/src/enums/side-effects.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/props.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js","webpack://muze/./packages/muze-firebolt/src/side-effects/surrogate.js","webpack://muze/./packages/muze-firebolt/src/side-effects/spawnable.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/helper.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/selection-box-drag.js","webpack://muze/./packages/muze-firebolt/src/enums/constants.js","webpack://muze/./packages/muze-tooltip/src/default-config.js","webpack://muze/./packages/muze-tooltip/src/constants.js","webpack://muze/./packages/muze-tooltip/src/content.js","webpack://muze/./packages/muze-tooltip/src/tooltip.js","webpack://muze/./packages/muze-tooltip/src/helper.js","webpack://muze/./packages/muze-firebolt/src/enums/tooltip-strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/fragmented-tooltip/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/helper/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/crossline/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/helper.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/filter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/anchors/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/persistent-anchors.js","webpack://muze/./packages/muze-firebolt/src/side-effects/brush-anchors.js","webpack://muze/./packages/muze-firebolt/src/side-effects/axis-labels-highlighter/index.js","webpack://muze/./packages/muze-firebolt/src/behaviour-effect-map.js","webpack://muze/./packages/muze-firebolt/src/registry.js","webpack://muze/./packages/visual-unit/src/firebolt/payload-generator.js","webpack://muze/./packages/visual-unit/src/firebolt/helper.js","webpack://muze/./packages/visual-unit/src/firebolt/index.js","webpack://muze/./packages/visual-unit/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/visual-unit/src/firebolt/behaviours/brush.js","webpack://muze/./packages/visual-unit/src/enums/behaviours.js","webpack://muze/./packages/visual-unit/src/helper/grid-lines.js","webpack://muze/./packages/visual-unit/src/listener-map.js","webpack://muze/./packages/visual-unit/src/props.js","webpack://muze/./packages/visual-unit/src/default-config.js","webpack://muze/./packages/visual-unit/src/local-options.js","webpack://muze/./packages/visual-unit/src/firebolt/behaviours/pseudo-select.js","webpack://muze/./packages/visual-unit/src/visual-unit.js","webpack://muze/./packages/visual-group/src/variable/variable.js","webpack://muze/./packages/visual-group/src/variable/composed-vars.js","webpack://muze/./packages/visual-group/src/variable/simple-var.js","webpack://muze/./packages/visual-group/src/encoder/field-sanitizer.js","webpack://muze/./packages/visual-group/src/enums/defaults.js","webpack://muze/./packages/visual-group/src/group-helper/cell-border-applier.js","webpack://muze/./packages/visual-group/src/group-helper/group-utils.js","webpack://muze/./packages/visual-group/src/encoder/props.js","webpack://muze/./packages/visual-group/src/encoder/visual-encoder.js","webpack://muze/./packages/visual-group/src/enums/scale-maps.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-model.js","webpack://muze/./packages/visual-group/src/group-helper/cell-creator.js","webpack://muze/./packages/visual-group/src/group-helper/resolver-props.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-resolver.js","webpack://muze/./packages/visual-group/src/data-type-scale-map.js","webpack://muze/./packages/visual-group/src/encoder/encoder-helper.js","webpack://muze/./packages/visual-group/src/encoder/cartesian-encoder.js","webpack://muze/./packages/visual-group/src/encoder/polar-encoder.js","webpack://muze/./packages/visual-group/src/encoder/retinal-encoder.js","webpack://muze/./packages/visual-group/src/visual-group/local-options.js","webpack://muze/./packages/visual-group/src/simple-group/simple-group.js","webpack://muze/./packages/visual-group/src/visual-group/value-matrix.js","webpack://muze/./packages/visual-group/src/visual-group/helper.js","webpack://muze/./packages/visual-group/src/visual-group/change-listener.js","webpack://muze/./packages/visual-group/src/visual-group/props.js","webpack://muze/./packages/visual-group/src/visual-group/visual-group.js","webpack://muze/./packages/muze-legend/src/firebolt/behavioural/select.js","webpack://muze/./packages/muze-legend/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/muze-legend/src/firebolt/behaviour-effect-map.js","webpack://muze/./packages/muze-legend/src/enums/behaviours.js","webpack://muze/./packages/muze-legend/src/enums/side-effects.js","webpack://muze/./packages/muze-legend/src/firebolt/helper.js","webpack://muze/./packages/muze-legend/src/enums/constants.js","webpack://muze/./packages/muze-legend/src/firebolt/legend-firebolt.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/drag.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/hover.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/click.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/index.js","webpack://muze/./packages/muze-legend/src/enums/actions.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/selection-box-drag.js","webpack://muze/./packages/muze-legend/src/legend/defaults.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/selection-box/index.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/index.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-marker/index.js","webpack://muze/./packages/muze-legend/src/legend/props.js","webpack://muze/./packages/muze-legend/src/legend/legend-helper.js","webpack://muze/./packages/muze-legend/src/legend/simple-legend.js","webpack://muze/./packages/muze-legend/src/legend/position-config.js","webpack://muze/./packages/muze-legend/src/legend/renderer.js","webpack://muze/./packages/muze-legend/src/legend/discrete-legend.js","webpack://muze/./packages/muze-legend/src/legend/gradient-helper.js","webpack://muze/./packages/muze-legend/src/legend/gradient-legend.js","webpack://muze/./packages/muze-legend/src/legend/step-legend.js","webpack://muze/./packages/muze/src/constants.js","webpack://muze/./packages/muze/src/operators.js","webpack://muze/./packages/muze/src/action-model.js","webpack://muze/./packages/muze/src/canvas/defaults.js","webpack://muze/./packages/muze/src/canvas/local-options.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/layoutComponent.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/dummy-component.js","webpack://muze/./packages/muze/src/defaults.js","webpack://muze/./packages/layout/src/tree-layout/constants/defaults.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/definitionModel.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/helper/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/tree/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/layout-model/index.js","webpack://muze/./packages/layout/src/enums/constants.js","webpack://muze/./packages/layout/src/tree-layout/utils/index.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-point.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-parser.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/helper.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/html-data.js","webpack://muze/./packages/layout/src/tree-layout/renderers/renderer.js","webpack://muze/./packages/layout/src/tree-layout/renderers/html-renderer.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/layout-def.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/index.js","webpack://muze/./packages/muze/src/canvas/helper.js","webpack://muze/./packages/muze/src/options.js","webpack://muze/./packages/layout/src/generic-layout/index.js","webpack://muze/./packages/layout/src/grid-layout/defaults.js","webpack://muze/./packages/layout/src/utils/index.js","webpack://muze/./packages/layout/src/visual-matrix/props.js","webpack://muze/./packages/layout/src/visual-matrix/default-config.js","webpack://muze/./packages/layout/src/visual-matrix/visual-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/row-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/column-matrix.js","webpack://muze/./packages/layout/src/grid-layout/computations.js","webpack://muze/./packages/layout/src/grid-layout/view-info-getter.js","webpack://muze/./packages/layout/src/grid-layout/layout.js","webpack://muze/./packages/layout/src/grid-layout/layout-helper.js","webpack://muze/./packages/layout/src/grid-layout/border-helper.js","webpack://muze/./packages/layout/src/grid-layout/span-maker.js","webpack://muze/./packages/muze/src/transaction-support.js","webpack://muze/./packages/muze/src/canvas/component-resolver.js","webpack://muze/./packages/visual-cell/src/enums/constants.js","webpack://muze/./packages/visual-cell/src/enums/cell-type.js","webpack://muze/./packages/visual-cell/src/simple-cell.js","webpack://muze/./packages/visual-cell/src/constants.js","webpack://muze/./packages/visual-cell/src/enums/defaults.js","webpack://muze/./packages/visual-cell/src/props.js","webpack://muze/./packages/visual-cell/src/axis-cell.js","webpack://muze/./packages/visual-cell/src/blank-cell.js","webpack://muze/./packages/visual-cell/src/text-cell-helper.js","webpack://muze/./packages/visual-cell/src/text-cell.js","webpack://muze/./packages/visual-cell/src/geom-cell.js","webpack://muze/./packages/visual-cell/src/defaults.js","webpack://muze/./packages/visual-cell/src/cell-registry.js","webpack://muze/./packages/muze/src/canvas/title-maker.js","webpack://muze/./packages/muze/src/canvas/legend-maker.js","webpack://muze/./packages/muze/src/canvas/components/muze-chart-component.js","webpack://muze/./packages/muze/src/canvas/components/headerComponent.js","webpack://muze/./packages/muze/src/canvas/components/legendComponent.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/helper.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/props.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-component.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/horizontal-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/vertical-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/matrix-component.js","webpack://muze/./packages/muze/src/canvas/components/grid-component.js","webpack://muze/./packages/muze/src/enums/constants.js","webpack://muze/./packages/muze/src/canvas/components/message-component.js","webpack://muze/./packages/muze/src/canvas/components/message-icon.js","webpack://muze/./packages/muze/src/canvas/component-wrapper-maker.js","webpack://muze/./packages/muze/src/canvas/scroll-manager.js","webpack://muze/./packages/muze/src/canvas/layout-maker.js","webpack://muze/./packages/muze/src/canvas/firebolt/helper.js","webpack://muze/./packages/muze/src/canvas/firebolt/group-firebolt.js","webpack://muze/./packages/muze/src/canvas/firebolt/index.js","webpack://muze/./packages/muze/src/canvas/app-state.js","webpack://muze/./packages/muze/src/canvas/canvas.js","webpack://muze/./packages/muze/src/default-registry.js","webpack://muze/./packages/muze/src/muze.js"],"names":["webpackUniversalModuleDefinition","root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","_typeof","DataModel","require","DataFormat","FLAT_JSON","DSV_STR","DSV_ARR","AUTO","DimensionSubtype","CATEGORICAL","TEMPORAL","BINNED","MeasureSubtype","CONTINUOUS","FieldType","MEASURE","DIMENSION","FilteringMode","NORMAL","INVERSE","ALL","GROUP_BY_FUNCTIONS","SUM","AVG","MIN","MAX","FIRST","LAST","COUNT","STD","convertToNativeDate","date","Date","pad","DateTimeFormatter","format","this","dtParams","nativeDate","RegExp","escape","text","replace","TOKEN_PREFIX","DATETIME_PARAM_SEQUENCE","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND","MILLISECOND","defaultNumberParser","defVal","val","parsedVal","isFinite","parseInt","defaultRangeParser","range","nVal","toLowerCase","length","getTokenDefinitions","daysDef","short","long","monthsDef","H","index","extract","parser","formatter","getHours","toString","hours","P","M","getMinutes","S","getSeconds","K","getMilliseconds","a","join","day","getDay","A","e","getDate","b","month","getMonth","B","y","result","substring","presentDate","presentYear","Math","trunc","getFullYear","year","Y","getTokenFormalNames","definitions","HOUR_12","AMPM_UPPERCASE","AMPM_LOWERCASE","SHORT_DAY","LONG_DAY","DAY_OF_MONTH","DAY_OF_MONTH_CONSTANT_WIDTH","SHORT_MONTH","LONG_MONTH","MONTH_OF_YEAR","SHORT_YEAR","LONG_YEAR","tokenResolver","defaultResolver","arg","targetParam","arguments","hourFormat24","hourFormat12","ampmLower","ampmUpper","amOrpm","isPM","findTokens","tokenPrefix","tokenLiterals","keys","occurrence","forwardChar","indexOf","push","token","formatAs","nDate","formattedStr","String","formattedVal","parse","dateTimeStamp","options","extractTokenValue","dtParamSeq","noBreak","dtParamArr","args","resolverKey","resolverParams","resolverFn","param","resolvedVal","splice","apply","checkIfOnlyYear","unshift","tokenObj","lastOccurrenceIndex","occObj","occIndex","targetText","regexFormat","tokenArr","map","obj","occurrenceLength","extractValues","match","shift","getNativeDate","Number","len","v","store","fields","Array","forEach","fieldIndex","from","OBJECTSTRING","objectToStrFn","objectToStr","arrayToStr","checkCyclicRef","parentArr","bIndex","extend2","obj1","obj2","skipUndef","merge","tgtArr","srcArr","item","srcVal","tgtVal","str","cRef","isArray","getUniqueId","getTime","round","random","isArrEqual","arr1","arr2","formatNumber","detectDataFormat","data","fieldStore","createNamespace","fieldArr","dataId","fieldsObj","_cachedFieldsObj","field","getMeasure","measureFields","_cachedMeasure","schema","type","getDimension","dimensionFields","_cachedDimension","Value","rawValue","formattedValue","getNumberFormattedVal","defineProperties","_value","configurable","writable","_formattedValue","_internalValue","rowDiffsetIterator","rowDiffset","callback","split","diffStr","diffStsArr","start","end","InvalidAwareTypes","config","assign","_invalidAwareValsMap","invalidAwareVals","NULL","NA","NIL","invalid","nil","null","undefined","ROW_ID","DM_DERIVATIVES","SELECT","PROJECT","GROUPBY","COMPOSE","CAL_VAR","BIN","SORT","JOINS","CROSS","LEFTOUTER","RIGHTOUTER","NATURAL","FULLOUTER","getCommonSchema","fs1","fs2","retArr","fs1Arr","defaultFilterFn","crossProduct","dm1","dm2","filterFn","replaceCommonSchema","jointype","applicableFilterFn","dm1FieldStore","getFieldspace","dm2FieldStore","dm1FieldStoreName","dm2FieldStoreName","commonSchemaList","Error","tmpSchema","_rowDiffset","rowAdded","rowPosition","ii","tuple","userArg","partialField","formattedData","dm1Fields","prepareJoinData","dm2Fields","detachedRoot","tupleObj","cellVal","iii","defSortFn","a1","b1","mergeSort","arr","sortFn","sort","lo","hi","mid","floor","mainArr","auxArr","resolveStrSortOrder","fDetails","strSortOrder","sortOrder","dataType","sortType","retFunc","groupData","hashMap","Map","groupedData","datum","fieldVal","has","set","createSortingFnArg","groupedDatum","targetFields","targetFieldDetails","label","reduce","acc","next","idx","applyStandardSort","sortingDetails","fieldName","sortMeta","fieldInSchema","sortingFn","slice","f","makeGroupMapAndSort","depColumns","targetCol","currRow","fVal","u","iterator","done","W","nMap","dataBuilder","colIdentifier","retObj","uids","addUid","columnWise","reqSorting","tmpDataArr","colName","insertInd","sortData","dataObj","filter","sDetial","groupSortingIdx","findIndex","standardSortingDetails","groupSortingDetails","detail","sortedGroupMap","row","nextMap","pop","tmpData","difference","hashTable","schemaNameArr","dm1FieldStoreFieldObj","dm2FieldStoreFieldObj","_colIdentifier","prepareDataHelper","dm","addData","hashData","schemaName","getFilteredValues","sum","filteredNumber","curr","avg","totalSum","isNaN","fnList","filteredValues","min","max","sqrt","mean","pow","num","defaultReducerName","ReducerStore","defReducer","entries","reducer","__unregister","Function","reducerStore","naturalJoinFilter","commonSchemaArr","retainTuple","internalValue","union","leftOuterJoin","dataModel1","dataModel2","rightOuterJoin","PartialField","_sanitize","Field","subtype","description","displayName","_params","_context","build","Dimension","_cachedDomain","calculateDataDomain","Measure","unit","defAggFn","numberFormat","FieldParser","CategoricalParser","isInvalid","getInvalidType","trim","Categorical","hash","Set","domain","add","TemporalParser","_dtf","calculateContinuousDomain","POSITIVE_INFINITY","NEGATIVE_INFINITY","Temporal","__proto__","getPrototypeOf","_cachedMinDiff","sortedData","arrLn","minDiff","prevDatum","nextDatum","processedCount","dataFormat","parsedDatum","BinnedParser","matched","parseFloat","Binned","binsArr","bins","ContinuousParser","Continuous","FieldTypeRegistry","_fieldType","dimension","fieldRegistry","registerDefaultFields","registerFieldType","createFields","dataColumn","headers","headersObj","header","BUILDER","ct","DataConverter","_type","EOL","EOF","QUOTE","NEWLINE","RETURN","objectConverter","columns","JSON","stringify","inferColumns","rows","columnSet","column","width","_t","delimiter","reFormat","DELIMITER","charCodeAt","parseRows","N","I","eof","eol","j","preformatBody","formatValue","formatRow","formatDate","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","milliseconds","getUTCMilliseconds","getUTCFullYear","getUTCMonth","getUTCDate","test","convert","concat","formatBody","formatRows","DSVArr","schemaFields","unitSchema","firstRowHeader","columnMajor","headerMap","h","schemaField","headIndex","DSVStr","fieldSeparator","dsv","d3Dsv","DSVStringConverter","FlatJSON","insertionIndex","schemaFieldsName","JSONConverter","DSVArrayConverter","AutoDataConverter","Auto","converters","DataConverterStore","_getDefaultConverters","converter","converterStore","resp","persistDerivations","sourceDm","model","operation","persistCurrentDerivation","criteriaFn","_derivation","Vt","op","meta","criteria","persistAncestorDerivation","newDm","_ancestorDerivation","selectModeMap","diffIndex","calcDiff","generateRowDiffset","lastInsertedValue","li","selectRowDiffsetIterator","checker","newRowDiffSet","rejRowDiffSet","Ut","shouldSelect","shouldReject","checkerResult","rejectRowDiffset","selectHelper","clonedDm","selectFn","cachedStore","cloneProvider","cachedValueObjects","_partialFieldspace","_cachedValueObjects","keyFn","rowId","domainChecker","some","dom","boundsChecker","filterPropagationModel","propModels","fns","filterByDim","filterByMeasure","clone","clonedModel","cloneWithAllFields","partialFieldspace","getPartialFieldspace","__calculateFieldspace","calculateFieldsConfig","modelFieldsConfig","getFieldsConfig","identifiers","fieldNames","values","indices","dLen","def","valuesMap","rangeKeys","hasData","present","getKey","fn","every","isWithinDomain","fieldType","propModel","select","saveChild","addDiffsetToClonedDm","selectConfig","cloneWithProject","projField","allFields","cloned","projectionSet","actualProjField","sanitizeUnitSchema","sanitizeAndValidateSchema","updateData","relation","defaultConfig","dataHeader","fieldNameAs","as","nameSpace","valueObjects","rawFieldsData","formattedFieldsData","rawData","_","_dataFormat","applyExistingOperationOnModel","dataModel","selectionModel","getDerivations","derivation","params","groupByString","getRootGroupByModel","_parent","find","propagateToAllDataModels","rootModels","propagationInf","propagationNameSpace","propagateToSource","propagationSourceId","sourceId","addGroupedModel","conf","crit","groupedModel","criterias","actionCriterias","mutableActions","filteredCriteria","entry","excludeModels","sourceActionCriterias","actionInf","actionConf","applyOnSource","action","models","path","getPathToRootModel","propagationSource","rootModel","propConfig","sourceIdentifiers","inf","propagationModel","filteredModel","reverse","handlePropagation","propagateIdentifiers","propModelInf","_children","child","matchingCriteria","getNormalizedProFields","fieldConfig","normalizedProjField","constructor","search","Relation","source","_fieldStoreName","_propagationNameSpace","immutableActions","_fieldspace","updateFields","fieldStoreName","collID","partialFieldMap","newFields","coll","joinWith","unionWith","differenceWith","defConfig","cloneConfig","extraCloneDm","setOfRowDiffsets","setParent","_fieldConfig","fieldObj","removeChild","sibling","parent","_onPropagation","order","withUid","getAllFields","dataGenerated","fmtFieldIdx","elem","fIdx","fmtFn","datumIdx","ids","En","fill","fieldsArr","reducers","newDataModel","groupBy","existingDataModel","sFieldArr","dimensions","je","reducerObj","measures","defaultReducer","measureName","reducerFn","resolve","fieldStoreObj","dbName","dimensionArr","measureArr","rowCount","getData","dataInCSVArr","sortedDm","colData","rowsCount","serializedData","rowIdx","colIdx","fieldinst","dependency","replaceVar","fieldsConfig","depVars","retrieveFn","depFieldIndices","fieldSpec","fs","suppliedFields","computedValues","fieldsData","addField","addToNameSpace","isMutableAction","payload","getRootDataModel","groupByModel","addToPropNamespace","sourceNamespace","propagateImmutableActions","filterImmutableAction","criteriaModel","eventName","measureFieldName","binFieldName","measureField","buckets","binsCount","binSize","dMin","dMax","ceil","abs","generateBuckets","bucketRanges","binnedData","findBucketRange","leftIdx","rightIdx","midIdx","binField","serialize","getSchema","rowSplitDiffsetIterator","splitRowDiffset","dimensionMap","dimensionSet","clonedDMs","uniqueFields","commonFields","normalizedProjFieldSets","fieldSet","splitWithProject","projFieldSet","projFields","first","last","count","sd","std","Operators","compose","operations","currentDM","firstChild","derivations","dispose","bin","project","calculateVariable","naturalJoin","fullOuterJoin","version","Stats","FieldsUtility","enums","webpackPolyfill","deprecate","paths","children","_interopRequireDefault","default","_lib2","_containerManager2","slLib","init","doc","win","document","htmlSplCharSpace"," ","documentSupport","getDocumentSupport","SVG_BBOX_CORRECTION","isWebKit","SmartLabelManager","id","container","useEllipses","wrapper","prop","prevInstance","isBrowserLess","maxCacheLimit","maxDefaultCacheLimit","getElementById","createContainer","innerHTML","testStrAvg","isHeadLess","isIE","offsetHeight","offsetWidth","parentContainerStyle","style","parentContainer","_containerManager","_showNoEllipses","_init","setStyle","textToLines","smartlabel","lines","_calCharDimWithCache","calculateDifference","size","csArr","tw","twi","cachedStyle","asymmetricDifference","maxAdvancedCacheLimit","_container","cache","_advancedCache","advancedCacheKey","_advancedCacheKey","cacheName","fontSize","fontFamily","fontWeight","fontStyle","cacheInitName","repeat","height","_getWidthFn","contObj","_containerObj","svgText","bbox","textContent","getBBox","_styleNotSet","setLineHeight","sCont","node","context","_cache","charCache","_lineHeight","lineHeight","useEllipsesOnOverflow","getSmartText","maxWidth","maxHeight","noWrap","trimStr","tempArr","tmpText","maxWidthWithEll","toolText","oriWidth","oriHeight","newCharIndex","nearestChar","tempChar","getWidth","initialLeft","initialTop","getOriSizeImproveObj","spanArr","x","minWidth","chr","elemRightMostPoint","elemLowestPoint","lastBR","removeFromIndex","removeFromIndexForEllipses","hasHTMLTag","maxStrWidth","lastDash","lastSpace","lastIndexBroken","strWidth","strHeight","oriTextArr","ellipsesStr","ellipsesWidth","dotWidth","characterArr","dashIndex","spaceIndex","lastLineBreak","fastTrim","ws","charAt","smartLabel","oriTextWidth","oriTextHeight","oriText","isTruncated","xmlTagRegEx","ltgtRegex","getOriSize","substr","getNearestBreakIndex","detailObj","tooltext","lastIndexOf","spanAdditionRegx","spanAdditionReplacer","classNameWithTag","classNameWithTagBR","childRetriverFn","childRetriverString","noClassTesting","classNameReg","className","spaceIdx","dashIdx","offsetLeft","offsetTop","parentNode","insertBefore","createElement","classNameBrReg","spanRemovalRegx","error","detailedCalculationFlag","textArr","letter","lSize","cumulativeSize","indiSizeStore","lib","userAgent","navigator","clsNameSpace","containerClass","brReplaceRegex","position","top","whiteSpace","padding","overflow","supportedStyle","font","font-family","font-weight","font-size","line-height","font-style","getElementsByClassName","opera","hasSVG","Boolean","SVGAngle","implementation","hasFeature","containerParent","body","appendChild","setAttribute","getElementsByTagName","sl","charLen","increment","avgWidth","styleObj","fSize","makeEntry","sCon","_classCallCheck","_set","set1","set2","filteredKeys","s1","s2","ForeignSet","isSimpleObject","reqAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","setTimeout","getTimeBasedId","__lastTime","__id","flat","res","scheduler","onFinishCallback","queue","animationFrame","listeners","tempQ","unique","fetch","namedNode","qualifiedName","seed","fetchAggregator","dependencies","getUpstreamNodes","list","rec","qname","placedIndex","preArr","postArr","outgoingEdges","resolver","accumulate","nodeDetails","identity","CustomResolver","utils_classCallCheck","dep","_dep","graph_node_classCallCheck","edges","_seed","requireResolve","retriever","history","electricEdges","_edges","_this","retrieveDetails","edge","head","hist","TypeError","electric_node_classCallCheck","nextFrame","currentFrame","lstnrs","nodes","nFn","_this2","qualifiedNodeMap","graph_node","_wholeSet","_propagate","propagationOverride","currentFrameListeners","nextFrameListeners","_schedule","flushTarget","flush","mount","resolveReqList","objn","perv","addDependencies","_node","getDependencies","getResolvedList","props","fnSpec","eNode","_ref","electric_node","addEdges","addElectricNode","changedSet","upstreamNodes","upstreamNode","append","__execUniqueElectricEdges","cfLstnrs","nfLstnrs","toArray","_this3","repeatHead","resetPropagationOverride","qnames","_this4","update","resolved","resolveDependencyOrder","resolveMap","neighbour","isRoot","model_classCallCheck","_graph","graph","_lockFlag","_reqQ","mountPoint","_addPropInModel","calculationConfig","customResolver","varName","fetchFn","_customResolver","createNodesFrom","instantCall","_graph$stopPropagatio","propsArr","unsub","createElectricNodeOf","stopPropagation","setPropagationOverride","resetNodeValue","_graph$stopPropagatio2","setProp","getNodeValue","getNodeFromQualifiedName","Model","__webpack_exports__","Muze","ContainerManager","maxContainers","svg","containers","rootNode","createElementNS","setAttributeNS","svgRoot","diff","containerObj","keyStr","prev","removeContainer","addContainer","avgCharWidth","display","cObj","ascending","NaN","bisector","compare","ascendingComparator","left","right","ascendingBisect","bisectRight","number","array","src_range","stop","step","e10","e5","e2","src_ticks","ticks","tickIncrement","power","log","LN10","tickStep","step0","step1","quantile","valueof","i0","value0","each","remove","clear","empty","src_nest","sortValues","rollup","nest","sortKeys","depth","createResult","setResult","keyValue","valuesByKey","createObject","setObject","createMap","setMap","sortKey","k","proto","implicit","ordinal","unknown","scale","copy","band","bandwidth","ordinalRange","paddingInner","paddingOuter","align","rescale","sequence","rangeRound","invertExtent","r0","r1","hiIndex","getClosestIndexOf","invert","side","highVal","d1","low","high","src_number","extend","definition","Color","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","color","exec","rgbn","Rgb","rgba","hsla","g","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","Hsl","hslConvert","hsl","hsl2rgb","m1","m2","basis","t1","v0","v1","v2","v3","t2","t3","channels","displayable","formatHsl","color_formatHsl","brighter","darker","src_constant","linear","hue","constant","gamma","nogamma","exponential","src_rgb","rgbGamma","colorRgb","rgbSpline","spline","colors","rgbBasis","numberArray","isNumberArray","ArrayBuffer","isView","DataView","genericArray","nb","na","reA","reB","src_string","am","bm","bs","bi","lastIndex","q","one","zero","src_value","value_typeof","string","setTime","valueOf","src_round","d3_scale_src_constant","d3_scale_src_number","deinterpolateLinear","bimap","deinterpolate","reinterpolate","d0","polymap","bisect","target","interpolate","clamp","continuous","piecewise","output","input","interpolateValue","deinterpolateClamp","reinterpolateClamp","interpolateRound","re","formatSpecifier","specifier","FormatSpecifier","sign","symbol","comma","precision","prefixExponent","locale","formatPrefix","formatDecimal","toExponential","coefficient","src_exponent","formatTrim","out","i1","formatRounded","exponent","formatTypes","%","toFixed","toPrecision","X","toUpperCase","src_identity","prefixes","src_locale","group","grouping","thousands","formatGroup","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","prefix","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","Infinity","defaultLocale","formatLocale","src_tickFormat","precisionPrefix","precisionRound","precisionFixed","linearish","tickFormat","nice","interval","x0","x1","pow10","powp","base","E","exp","logp","log10","log2","reflect","logs","pows","z","raise","thresholds","threshold","quantiles","quantize","t0","newInterval","floori","offseti","offset","previous","setMonth","setHours","setFullYear","setDate","durationMinute","durationWeek","weekday","getTimezoneOffset","sunday","monday","tuesday","wednesday","thursday","friday","saturday","hour","minute","second","millisecond","utcWeekday","setUTCDate","getUTCDay","setUTCHours","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcDay","utcYear","setUTCMonth","setUTCFullYear","localDate","L","utcDate","UTC","newDate","timeFormat","pads","-","0","numberRe","percentRe","requoteRe","requote","formatRe","names","formatLookup","parseWeekdayNumberSunday","w","parseWeekdayNumberMonday","parseWeekNumberSunday","U","parseWeekNumberISO","V","parseWeekNumberMonday","parseFullYear","parseYear","parseZone","Z","parseQuarter","parseMonthNumber","parseDayOfMonth","parseDayOfYear","parseHour24","parseMinutes","parseSeconds","parseMilliseconds","parseMicroseconds","parseLiteralPercent","parseUnixTimestamp","Q","parseUnixTimestampSeconds","formatDayOfMonth","formatHour24","formatHour12","formatDayOfYear","timeDay","timeYear","formatMilliseconds","formatMicroseconds","formatMonthNumber","formatMinutes","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","timeSunday","formatWeekNumberISO","timeThursday","formatWeekdayNumberSunday","formatWeekNumberMonday","timeMonday","formatYear","formatFullYear","formatZone","formatUTCDayOfMonth","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMicroseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","dow","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","formatLiteralPercent","formatUnixTimestamp","formatUnixTimestampSeconds","locale_dateTime","dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatPeriod","formatQuarter","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCPeriod","formatUTCQuarter","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseSpecifier","parsePeriod","parseLocaleDate","parseLocaleTime","newParse","week","utcFormat","utcParse","durationSecond","durationHour","durationDay","durationMonth","durationYear","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","tickIntervals","tickInterval","src_time","timeMonth","timeWeek","timeHour","timeMinute","timeSecond","timeMillisecond","utcMonth","utcHour","setUTCMinutes","utcMinute","setUTCSeconds","src_colors","deg2rad","PI","rad2deg","C","D","ED","EB","BC_DA","cubehelix","cubehelixConvert","Cubehelix","bl","atan2","cubehelixGamma","colorCubehelix","cosh","cos","sinh","sin","cubehelixLong","interpolateCubehelixLong","ramp","sequential","interpolator","d3_scale_chromatic_src_colors","src_ramp","scheme","interpolateRgbBasis","magma","inferno","plasma","warm","cool","sequential_multi_rainbow","ts","UNIT_GLOBAL_NAMESPACE","UNIT_LOCAL_NAMESPACE","LAYER_LOCAL_NAMESPACE","LAYER_GLOBAL_NAMESPACE","GROUP_GLOBAL_NAMESPACE","GROUP_LOCAL_NAMESPACE","CANVAS_LOCAL_NAMESPACE","CANVAS_GLOBAL_NAMESPACE","swap","tmp","defaultCompare","quickselect","quickselectStep","createNode","leaf","minX","minY","maxX","maxY","distBBox","toBBox","destNode","calcBBox","compareNodeMinX","compareNodeMinY","bboxArea","bboxMargin","enlargedArea","intersectionArea","contains","intersects","findItem","items","equalsFn","multiSelect","stack","all","nodesToSearch","_toConsumableArray","RTree","maxEntries","_maxEntries","_minEntries","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","childBBox","err","insert","splitRoot","tmpNode","insertSingleItem","goingUp","indexes","condense","N2","N1","compareMinX","right2","compareMinY","right3","level","minArea","minEnlargement","targetNode","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","area","enlargement","isNode","insertPath","chooseSubtree","adjustParentBoxes","chooseSplitAxis","splitIndex","chooseSplitIndex","newNode","minOverlap","bbox1","bbox2","overlap","allDistMargin","leftBBox","rightBBox","margin","siblings","ReservedFields","MEASURE_NAMES","CommonProps","ACTION_INF","ON_LAYER_DRAW","MATRIX_CREATED","COORD_TYPES","POLAR","CARTESIAN","DATA_TYPE","d3_axis_src_identity","bottom","epsilon","translateX","translateY","entering","__axis","axis","orient","tickArguments","tickValues","tickTransform","tickSizeInner","tickSizeOuter","tickPadding","transform","spacing","range0","range1","center","selection","selectAll","tick","tickExit","exit","tickEnter","enter","attr","line","transition","getAttribute","tickSize","pi","halfPi","tau","asin","symbol_circle","draw","moveTo","arc","symbol_cross","lineTo","closePath","tan30","tan30_2","diamond","square","rect","kr","kx","ky","star","wye","y0","y1","x2","y2","sqrt3","triangle","tauEpsilon","Path","_x0","_y0","_x1","_y1","quadraticCurveTo","bezierCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","acos","t01","t21","a0","ccw","dx","dy","cw","da","d3_shape_src_constant","none","series","order_ascending","sums","offset_none","s0","stackValue","Linear","areaStart","_line","areaEnd","lineStart","_point","lineEnd","point","curve_linear","Step","_x","_y","curve_step","stepBefore","stepAfter","that","_k","_x2","_y2","Cardinal","tension","custom","cardinal","CatmullRom","alpha","_alpha","_l01_a","_l12_a","_l23_a","_l01_2a","_l12_2a","_l23_2a","x23","y23","curve_catmullRom","catmullRom","src_line","pointX","pointY","defined","curve","curveLinear","buffer","defined0","src_descending","d3_shape_src_identity","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","colorHsl","hslLong","cubicInOut","b2","b3","b4","b5","b6","b7","b8","b9","b0","bounceOut","elasticOut","elasticIn","amplitude","period","backInOut","elasticInOut","backIn","overshoot","backOut","polyInOut","polyIn","polyOut","d3_voronoi_src_constant","RedBlackTree","RedBlackNode","R","RedBlackRotateLeft","tree","RedBlackRotateRight","RedBlackFirst","after","grandpa","uncle","createEdge","setEdgeEnd","cells","halfedges","createBorderEdge","vertex","clipEdge","ax","ay","connectEdge","fm","fb","lx","ly","rx","ry","fx","fy","cellHalfedgeAngle","cell","site","va","vb","cellHalfedgeStart","cellHalfedgeEnd","firstCircle","circlePool","attachCircle","lArc","rArc","lSite","cSite","rSite","bx","by","epsilon2","ha","hc","circle","Circle","before","circles","detachCircle","beachPool","createBeach","beach","Beach","detachBeach","beaches","removeBeach","disappearing","iArc","nArcs","addBeach","dxl","dxr","directrix","leftBreakPoint","rightBreakPoint","createCell","newArc","hb","rfocx","rfocy","pby2","lfocx","lfocy","plby2","hl","aby2","triangleArea","lexicographic","Diagram","sites","extent","sortCellHalfedges","clipEdges","clipCells","iCell","iHalfedge","nHalfedges","startX","startY","endX","endY","nCells","cover","dc","v00","v01","v11","v10","polygons","polygon","triangles","e1","links","radius","_found","vx","vy","src_voronoi","voronoi","Selection","idGetter","selection_classCallCheck","_dataObjects","_updateData","_enterData","_exitData","_idGetter","newData","entryData","exitdata","tempMap","duplicateData","updatedData","newSelection","dataObjects","defaultValue","_mode","mergedObjects","mergedData","newdata","sortSel","sortSelection","kA","kB","selection_toConsumableArray","objects","dataSelect","idFn","STRING","FUNCTION","HTMLElement","common_utils_typeof","checkExistence","nonExistentKeys","sanitizeIP","typeObj","htmlElem","getMax","common_utils_toConsumableArray","getMin","getDomainFromData","domArr","_loop","_fields","_slicedToArray","field0","field1","arr0","firstMin","secondMin","firstMax","secondMax","sanitizeDomainWhenEqual","unionDomain","domains","_ref2","symbolFns","symbolCircle","cross","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolWye","symbolTriangle","easeFns","cubic","easeCubic","bounce","easeBounce","elastic","easeElastic","back","easeBack","poly","easePoly","circleInOut","getExtremePoint","points","compareValue","minOrMax","extremePoint","minOrMaxVal","getMinPoint","getMaxPoint","getNearestValue","filterData","getWindow","cancelAnimFrame","cancelAnimationFrame","capitalizeFirst","txt","vals","getMinDiff","uniqueVals","getQualifiedClassName","cls","getDependencyOrder","dependencyOrder","visited","visit","objectIterator","Voronoi","common_utils_classCallCheck","_voronoi","_voronoiFn","getObjProp","_len","_key","intSanitizer","generateGetterSetters","propInfo","_propInfo$","sanitization","preset","onset","typeChecker","getArraySum","total","arraysEqual","isEqual","oldVal","newVal","is","enableChainedTransaction","transactionModel","transactionEndpoint","transactionItems","registerImmediateListener","_ref3","isHTMLElem","ERROR_MSG","INTERFACE_IMPL","mergeRecursive","sink","createSelection","sel","appendObj","mergedSelection","exitSelection","getObjects","inst","interpolateArray","fitCount","linearInterpolate","atPoint","springFactor","angleToRadian","angle","replaceCSSPrefix","numberInterpolator","interpolateNumber","colorInterpolator","interpolateRgb","hslInterpolator","interpolateHslLong","transformColors","piecewiseInterpolator","hue2rgb","hslToRgb","rgbToHsv","hsvToRgb","hexToHsv","hslaToRgb","_hslToRgb2","RGBAtoRGB","r2","g2","r3","g3","detectColor","col","assembleModelFromIdentifiers","fieldMap","_loop2","temp","cIdx","getDataModelFromRange","criteriaFields","selFields","selFn","fieldValue","getArrayIndexMap","getDataModelFromIdentifiers","hasBarLayer","filteredDataModel","dataArr","filteredSchema","include","propField","registerListeners","listenerMap","_len2","_key2","propListenerMap","namespace","mapObj","propType","listenerFn","listener","isValidValue","escapeHTML","htmlEscapes","&","<",">","\"","'","/","transposeArray","extendsClass","extendsFrom","found","concatModels","dataObj1","dataObj2","data1","data2","schema1","schema2","commonTuples","_loop3","row1","row2","dim1Values","dim2Values","dm1Key","dm2Key","commonSchema","getSymbol","stackOrders","_defineProperty","_stackOrders","stackOrderNone","stackOrderAscending","stackOffsets","_stackOffsets","yp","yn","stackOffsetNone","si","sij0","s3","sk","orderNone","offsetNone","oz","kz","sz","sij","ki","d3Stack","nestCollection","nestFn","getArrayDiff","el","pathInterpolators","curveStepAfter","curveStepBefore","curveStep","curveCatmullRom","Symbols","axisLeft","axisRight","axisTop","axisBottom","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","pie","descending","arcs","pa","cornerRadius","padRadius","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","p0","p1","oc","intersect","x3","y3","x32","y32","kc","lc","centroid","Scales","scaleBand","getSmallestDiff","timeFormats","timeDurations","formatTemporal","nearestInterval","getNearestInterval","temporalFields","filteredFields","_ref5","_ref6","lookupWhat","lookupDetails","resolvable","lookupTarget","depArr","deps","nextAnimFrame","getValueParser","retrieveNearestGroupByReducers","_len3","measureFieldNames","_key3","filteredReducers","getAncestorDerivations","nearestReducers","derv","retrieveFieldDisplayName","nearestSortingDetails","nearestSortDerivation","sortingOrder","localeCompare","sortOrderMap","_sortOrderMap","firstVal","secondVal","sortCategoricalField","sortOrderType","_accessors","fn1","fn2","_accessors2","partition","mix","superclass","with","_with","_len4","mixins","_key4","mixin","componentRegistry","comps","reg","regObj","register","customKey","formalName","getReadableTicks","steps","orderedDomain","tempScale","scales","legendTicks","transformColor","rgbaValues","_ref7","_ref7$h","_ref7$s","_ref7$l","_RGBAToHSLA$code","RGBAToHSLA","cmin","cmax","delta","code","origH","origS","origL","origA","sanitizedA","newH","newS","newL","newA","pointWithinCircle","dmMultipleSelection","targetData","payloadMap","currentField","src_selector","selector","querySelector","selectorAll","querySelectorAll","matcher","matches","sparse","EnterNode","ownerDocument","namespaceURI","_next","__data__","keyPrefix","bindIndex","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","xhtml","src_namespaces","xlink","xml","xmlns","src_namespace","namespaces","space","local","src_window","defaultView","styleValue","getPropertyValue","getComputedStyle","classArray","classList","ClassList","_names","classedAdd","classedRemove","textRemove","htmlRemove","nextSibling","lower","previousSibling","creator","fullname","creatorFixed","creatorInherit","uri","documentElement","constantNull","selection_cloneShallow","cloneNode","selection_cloneDeep","filterEvents","event","mouseenter","mouseleave","filterContextListener","contextListener","related","relatedTarget","compareDocumentPosition","event1","event0","onRemove","typename","on","__on","removeEventListener","capture","onAdd","wrap","addEventListener","customEvent","sourceEvent","dispatchEvent","CustomEvent","createEvent","initEvent","bubbles","cancelable","groups","parents","_groups","_parents","subgroups","subnode","subgroup","enterGroup","updateGroup","_enter","_exit","onenter","onupdate","onexit","groups0","groups1","m0","merges","group0","group1","compareNode","sortgroups","sortgroup","getAttributeNS","attrRemoveNS","removeAttributeNS","attrRemove","removeAttribute","attrFunctionNS","attrFunction","attrConstantNS","attrConstant","priority","styleRemove","removeProperty","styleFunction","setProperty","styleConstant","propertyRemove","propertyFunction","propertyConstant","classed","classedFunction","classedTrue","classedFalse","textFunction","textConstant","html","htmlFunction","htmlConstant","deep","typenames","parseTypenames","dispatch","dispatchFunction","dispatchConstant","src_select","src_point","ownerSVGElement","createSVGPoint","clientX","clientY","matrixTransform","getScreenCTM","inverse","getBoundingClientRect","clientLeft","clientTop","noop","Dispatch","T","types","current","mouse","changedTouches","src_touch","touches","identifier","touch","nopropagation","stopImmediatePropagation","noevent","preventDefault","nodrag","view","__noselect","MozUserSelect","d3_drag_src_constant","DragEvent","subject","active","defaultFilter","ctrlKey","button","defaultContainer","defaultSubject","defaultTouchable","maxTouchPoints","src_drag","mousedownx","mousedowny","mousemoving","touchending","touchable","gestures","clickDistance2","drag","mousedowned","touchstarted","touchmoved","touchended","gesture","beforestart","mousemoved","mouseupped","yesdrag","noclick","clearTimeout","sublisteners","clickDistance","taskHead","taskTail","frame","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","timer_typeof","now","setFrame","clearNow","Timer","_call","_time","timer","delay","restart","wake","timerFlush","nap","sleep","poke","clearInterval","setInterval","src_timeout","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","transition_schedule","timing","schedules","__transition","self","tween","state","duration","ease","schedule","cssNode","cssRoot","cssView","svgNode","degrees","rotate","skewX","scaleX","scaleY","decompose","atan","interpolateTransform","pxComma","pxParen","degParen","translate","xa","ya","xb","yb","interpolateTransformCss","parseCss","interpolateTransformSvg","parseSvg","baseVal","consolidate","matrix","tweenValue","_id","transition_interpolate","interpolateString","Transition","_name","newId","selection_prototype","inherit","id0","id1","onFunction","on0","on1","sit","attrTween","string00","string10","interpolate0","string0","string1","value1","attrTweenNS","attrInterpolateNS","attrInterpolate","styleTween","styleNull","styleMaybeRemove","listener0","styleInterpolate","textTween","textInterpolate","removeFunction","tweenRemove","tween0","tween1","tweenFunction","delayFunction","delayConstant","durationFunction","durationConstant","easeConstant","Promise","reject","cancel","interrupt","defaultTiming","easeCubicInOut","selectElement","element","makeElement","elemType","callbacks","SVGElement","selectorVal","selectorType","actualSelector","enterSel","mergeSel","exitSel","applyStyle","appendElement","element1","element2","setElementAttrs","attrs","setAttrs","addClass","removeClass","setStyles","styles","createElements","clipElement","measurement","clipPathElement","getMousePos","boundingClientRect","getClientPoint","pos","clientPoint","tag","getEvent","d3event","getD3Drag","d3drag","getSmartComputedStyle","css","textEl","mandatoryStyle","fill-opacity","renderer_utils_typeof","computedStyle","styleForSmartLabel","hasTouch","initProp","fetchPropValues","propNames","setContexts","contexts","propObj","contextMap","depProps","registerListener","propList","callBack","_options$","namespaceInf","callbackFn","namespaceVal","commits","_savedCommits","_propListenerMap","listenersObj","_registeredListeners","_contextMap","contextsObj","commitsObj","subNamespaces","propDeps","nm","fnInf","store_toConsumableArray","registerPropInMaps","registeredListeners","subNamespace","allProps","_fnCount","addListenerToNamespace","_listeners","namespaceListeners","listenerTypes","removePropValue","propInf","sns","Store","store_classCallCheck","_commits","_queuedProps","_locked","store_createClass","lockModel","lock","unlockModel","unlock","lockCommits","locked","unlockCommits","queuedProps","store_slicedToArray","propName","_params2","commit","addSubNamespace","propFns","nsObj","retrieveNamespaces","disableListener","sanitizedVal","savedCommits","disabled","registerChangeListener","computed","calculatedProp","_this$model","unsubscribeAll","unsubscribe","listenersMap","removeSubNamespace","snsMap","transactor","holder","stateProps","nameSpaceProp","nsProp","_len5","_key5","_ref$takesMultiplePar","takesMultipleParams","prevVal","typeCheck","typeExpected","oldValues","events","EVENT_LIST","composition","resolveFn","notification","hasOwn","LifeCycleManager","lifecycle_manager_classCallCheck","_eventList","_promises","_notifiers","_lifeCycles","_unreleasedLifeCycles","_boot","_preparePromises","promise","_makeNotifierPromise","createPromise","then","prm","client","_releasePromisesFromCache","_notify","stage","_resolvePromise","retrieve","_callLifeCycleCallback","_cachePromise","_resetTargetPromise","lifeCycles","CLASSPREFIX","STACK","GROUP","IDENTITY","ANGLE","RADIUS","SIZE","COLOR","SHAPE","TEXT","OUTER_RADIUS_VALUE","TEXT_ANCHOR_MIDDLE","ENCODING","X0","Y0","RADIUS0","ANGLE0","STROKE_DASHARRAY","ASCENDING","AGG_FN_SUM","AREA_LAYER","ARC_LAYER","LINE_LAYER","TEXT_LAYER","POINT_LAYER","BAR_LAYER","TICK_LAYER","SIMPLE_LAYER","BASE_LAYER","SimpleLayer","DATA","CONFIG","MEASUREMENT","DOMAIN","MOUNT","props_defineProperty","_props","axes","metaInf","valueParser","coord","PROPS","_customConfig","newConf","defaultPolicy","BOTTOM","TOP","LEFT","RIGHT","axisOrientationMap","axis_orientation_defineProperty","_axisOrientationMap","AxisOrientation","LINEAR","BAND","TIME","ORDINAL","QUANTIZE","QUANTILE","LOG","POW","SEQUENTIAL","THRESHOLD","CONTINOUS","DISCRETE","HIDDEN","DEFAULT_ANGLE_DOMAIN","scaleLinear","scaleThreshold","scaleLog","scalePow","scaleIdentity","scaleOrdinal","scaleSequential","scaleQuantize","scaleQuantile","scaleTime","scaleMap","scale_creator_defineProperty","_scaleMap","ScaleType","createScale","scaleFactory","adjustRange","axisName","defClassName","axisNamePadding","classPrefix","fixedBaseline","labels","rotation","smartTicks","orientation","numberOfTicks","show","showAxisName","showInnerTicks","showOuterTicks","xOffset","yOffset","defaultSort","changeTickOrientation","selectContainer","axisInstance","_smartTicks","renderConfig","labelManager","isSmartTicks","tickText","registerAnimationDoneHook","rotateAxis","instance","getTickSize","yShift","xShift","tickLabelDim","quadrant","rotationNormalizer","setFixedBaseline","setAxisNamePos","textNode","axisNameHeight","availableSpace","longestWord","quarter","halfYearly","mintues","getTickIntervalFnBasedOnNumberOfTicks","possibleTickLevelIndex","maxPossibleTicks","tickIntervalLevelInfo","tickIntervalInfo","numOfPossibleTicks","getActualTickInterval","noOfTicks","minWidthBetweenTicks","_minTickDistance","getTickIntervalBasedOnCurrentLevel","_dependencies","longestWordType","applyTickSkipping","minTickDistance","minTickSpace","_minTickSpace","minTickWidth","maxTicks","getSkippedTicks","actualNumberOfTicks","_minDiff","millisecondInterval","numOfTicksAccordingToMinDiff","adjustHorizontalRange","adjustVerticalRange","rangeAdjustmentMap","space_setter_defineProperty","_rangeAdjustmentMap","setAxisRange","rangeBounds","getAdjustedRange","getAxisOffset","timeDiff","avWidth","bars","spaceSetter","spaceConfig","heightForTicks","_context$availableSpa2","availWidth","availHeight","isOffset","_context$renderConfig2","_context$getAxisDimen","getAxisDimensions","tickDimensions","allTickDimensions","axisNameDimensions","tickDimHeight","tickDimWidth","namePadding","labelConfig","minTickHeight","getTickValues","tickShifter","maxTickSpaces","widthForTicks","totalTickWidth","getRotatedSpaces","rotatedHeight","rotatedWidth","setOffset","logicalSpace","getAxisComponentDimensions","axisTicks","largestTick","largestTickDimensions","smartTick","_context$renderConfig","labelFunc","_tickLabelStyle","originalLabel","getFormattedText","_axisNameStyle","getHorizontalAxisSpace","axisDimensions","_context$config2","axisDimHeight","minTickDiff","getMinTickDifference","helper_toConsumableArray","getVerticalAxisSpace","_context$config3","calculateBandSpace","largestDimHeight","_getHorizontalAxisSpa","_getVerticalAxisSpace","getValidDomain","userDom","setContinousAxisDomain","_domain","axisComponentDimensions","oldConfig","_config","mockedOldConfig","shouldAxesScaleUpdate","hasAxesConfigChanged","properties","tickFormatter","sanitizeTickFormatter","_scale","_axis","createAxis","_tickFormatter","resetRenderConfig","_renderConfig","_maxTickSpaces","SimpleAxis","simple_axis_classCallCheck","_mount","_range","_domainLock","_axisDimensions","defCon","simpleConfig","bodyElem","dist","_animationDonePromises","domainValue","setAxisComponentDimensions","smartAxisName","axisClass","_objectSpread","setTickConfig","setSmartAxisName","_this$config2","dimType","widthDim","getSmartAxisName","oriSize","domainVal","computeAxisDimensions","_getAxisComponentDime","labelHeight","labelWidth","calculateContinousSpace","_context$renderConfig6","axisNameWidth","_getHorizontalAxisSpa2","_getVerticalAxisSpace2","renderAxis","labelProps","tickLabelStyle","axisTickFormatter","labelOffset","tickData","allTicks","elementToBeModified","elementNotToBeModified","tickValue","_getRawTickValue","selectionSet","rejectionSet","LinearInterpolator","LogInterpolator","PowInterpolator","interpolatorMap","continous_axis_defineProperty","_interpolatorMap","ContinousAxis","continous_axis_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","InterpolatorCls","_interpolator","getScaleValue","_this$renderConfig","sanitizeDomain","_get2","_get","_this$renderConfig2","newTickValues","tickSpace","getNumberOfTicks","labelDim","numberOfValues","tickLength","_this$smartTicks$","BandAxis","_this$maxTickSpaces","_getRotatedSpaces","paddingNormalized","formatTickValue","TimeAxis","_getPrototypeOf2","time_axis_classCallCheck","time_axis_possibleConstructorReturn","time_axis_getPrototypeOf","time_axis_get","rawTicks","resetTickInterval","_context$config8","_context$availableSpa","adjustedRange","x11Colors","Pink","LightPink","HotPink","DeepPink","PaleVioletRed","MediumVioletRed","LightSalmon","Salmon","DarkSalmon","LightCoral","IndianRed","Crimson","FireBrick","DarkRed","Red","OrangeRed","Tomato","Coral","DarkOrange","Orange","Gold","Yellow","LightYellow","LemonChiffon","LightGoldenrodYellow","PapayaWhip","Moccasin","PeachPuff","PaleGoldenrod","Khaki","DarkKhaki","Cornsilk","BlanchedAlmond","Bisque","NavajoWhite","Wheat","BurlyWood","Tan","RosyBrown","SandyBrown","Goldenrod","DarkGoldenrod","Peru","Chocolate","SaddleBrown","Sienna","Brown","Maroon","DarkOliveGreen","Olive","OliveDrab","YellowGreen","LimeGreen","Lime","LawnGreen","Chartreuse","GreenYellow","SpringGreen","MediumSpringGreen","LightGreen","PaleGreen","DarkSeaGreen","MediumSeaGreen","SeaGreen","ForestGreen","Green","DarkGreen","MediumAquamarine","Aqua","Cyan","LightCyan","PaleTurquoise","Aquamarine","Turquoise","MediumTurquoise","DarkTurquoise","LightSeaGreen","CadetBlue","DarkCyan","Teal","LightSteelBlue","PowderBlue","LightBlue","SkyBlue","LightSkyBlue","DeepSkyBlue","DodgerBlue","CornflowerBlue","SteelBlue","RoyalBlue","Blue","MediumBlue","DarkBlue","Navy","MidnightBlue","Lavender","Thistle","Plum","Violet","Orchid","Fuchsia","Magenta","MediumOrchid","MediumPurple","BlueViolet","DarkViolet","DarkOrchid","DarkMagenta","Purple","Indigo","DarkSlateBlue","SlateBlue","MediumSlateBlue","White","Snow","Honeydew","MintCream","Azure","AliceBlue","GhostWhite","WhiteSmoke","Seashell","Beige","OldLace","FloralWhite","Ivory","AntiqueWhite","Linen","LavenderBlush","MistyRose","Gainsboro","LightGray","Silver","DarkGrey","Grey","DimGrey","LightSlateGrey","SlateGrey","DarkSlateGrey","Black","palette","DEFAULT_GRADIENT_COLOR","DEFAULT_CONFIG","stops","getHslString","hslArr","convertToXllString","baseString","getActualHslColor","paletteColor","props_toConsumableArray","newConfig","uniqueValues","treatNullMeasures","scaledVal","minDomainScaledVal","resolveAxisConfig","propVal","defaultVal","sanitiseConfigIntervals","intervals","getStops","newStops","color_strategy_toConsumableArray","indexedDomain","scaleDomain","indexedDomainMeasure","normalDomain","steppedDomain","_getStops","rangeStops","newStopsLength","newRange","continousSteppedDomain","_getStops2","uniqueRange","indexedRange","numVal","normalRange","strategyGetter","domainType","rangeType","schemeType","strategies","color_strategy_defineProperty","domainRange","ColorAxis","color_axis_classCallCheck","_domainType","_rangeType","_schemeType","getSchemeType","_colorStrategy","setColorStrategy","updateDomain","colorStrategy","getScheme","colorSchemes","hslColorArray","getRawColor","color_axis_toConsumableArray","scaleInfo","domainRangeFn","transformationArr","size_strategy_defineProperty","_strategies","pieceWiseRange","size_strategy_toConsumableArray","newIntervals","discreteRange","_userRange","SizeAxis","size_axis_classCallCheck","_sizeStrategy","setStrategy","strategy","domainInfo","domainFn","generator","ShapeAxis","shape_axis_classCallCheck","_generatedShapes","shapeType","shapeGenerator","generatorFn","generatedShapes","createAngleValues","angleData","_angleFn","_angleValues","AngleAxis","angle_axis_classCallCheck","customDomain","customRange","_this$_range","angle_axis_slicedToArray","WIDTH","HEIGHT","MIN_UNIT_WIDTH","MIN_UNIT_HEIGHT","DIMENSIONS","MEASURES","PIVOT","FORMAT","HAS_DATA_UPDATED","ROWS","COLUMNS","COL","ROW","COLUMN","DETAIL","LAYERS","TRANSFORM","RETINAL","CELL","X_AXES","Y_AXES","ENTRY_CELLS","INITIALIZED","EXIT_CELLS","AXIS","UNIT","UPDATED","BEFORE_UPDATE","VALUE_MATRIX","FACET_HEADERS","ARC","BAR","LINE","POINT","PRIMARY","SECONDARY","BOTH","INTERACTION","GRID_LINES","GRID_BANDS","HEADER","FACET","DEFAULT","DESCENDING","DARK","NONE","DARKER","adjustDomain","minOuterRadius","RadiusAxis","radius_axis_classCallCheck","_radiusFactor","sanitizedRange","rangeVal","DATA_TYPES","group_transform","data_type_scale_map_defineProperty","_dataTypeScaleMap","groupByIndices","identityTransform","transformMap","transform_factory_defineProperty","_transformMap","uniqueField","valueField","normalizedData","normalizeData","uniqueFieldIndex","valueFieldIndex","seriesKeyIndex","seriesKeys","tuples","rowObj","_tuple","seriesKey","newArr","orderBy","orderIndex","groupByIndex","stackData","seriesData","transformFactory","colorAxis","styleType","intensity","interactionType","stateColor","currentState","originalState","colorInfo","applyInteractionStyle","interactionStyles","elements","getPlotElementsFromSet","reset","applyLayerStyle","retrieveEncodingInf","encoding","encodingNames","encodingInf","encodingFieldInfRetriever","helpers_defineProperty","_encodingFieldInfRetr","setNullsInStack","transformedData","setNulls","transformData","transformType","encodingFieldInf","setNullData","connectNullData","xField","yField","xFieldType","yFieldType","getIndividualClassName","individualClassName","classNameStr","dataNormalizers","_dataNormalizers","radiusFieldIndex","angleFieldIndex","radius0FieldIndex","angle0FieldIndex","fieldsLen","pointObj","radius0","angle0","enc","xFieldIndex","yFieldIndex","x0FieldIndex","y0FieldIndex","getNormalizedData","transformedDataArr","encodingFieldsInf","domainCalculator","_domainCalculator","layerInst","angleValues","radius0Field","xFieldSubType","yFieldSubType","x0Field","y0Field","yEnc","xEnc","defFn","_d$update","attachDataToVoronoi","accessor","helpers_toConsumableArray","_accessor","updateStyle","animateGroup","groupTransition","groupAnimateStyle","effect","positionPoints","positioner","encodingTransform","getGroupSpan","getUnitWidth","getPlotMeasurement","dimensionalValues","fieldInfo","bandScale","_bandScale","span","groupSpan","offsetValues","actualGroupWidth","dataProps","timeDiffs","innerPadding","isAxisBandScale","axisPadding","groupPadding","renderLayer","render","throwback","parentNamespace","resolveInvalidTransformType","transformResolverPredicates","groupByField","dimensionField","getValidTransform","getValidTransformForAggFn","resolvedInvalidTransformType","_context$encodingFiel","isCustomTransformTypeProvided","getMarkId","resolveEncodingValues","transformedValues","getColorMetaInf","initialStyle","originalStyle","getCoordValue","trig","coordValueGetter","toCartesianCoordinates","rangePlot","_point$update","_coordValueGetter","axisArr","getBoundBoxes","_point$update2","getDataFromEvent","dataPoint","getIdentifiersFromData","layerId","localOptions","local_options_defineProperty","STATE_NAMESPACES","listener_map_slicedToArray","prevData","dataDidSet","getPreviousStyle","stylesForCurrentLevel","getLastItemInMap","strokeProps","stroke-width","stroke","stroke-opacity","parseStyle","datumStyle","applyStylesOnInteraction","_datum$meta","applicableStyles","strokePosition","applicableStrokePos","sanitizedStyles","parsedStyleVal","currentStyle","styleKeys","_partition2","helper_slicedToArray","strokeStyles","otherStyles","applyStyles","layerNs","groupNs","BaseLayerMixin","_superclass","_class","base_mixin_classCallCheck","base_mixin_possibleConstructorReturn","base_mixin_getPrototypeOf","base_mixin_assertThisInitialized","getterSetters","alias","_points","_cachedData","_measurement","_graphicElems","base_mixin_inherits","base_mixin_createClass","_store","_this$metaInf2","_alias","enableCaching","_cacheEnabled","clearCaching","getTransformedData","calculateDomainFromData","isEmpty","getDataDomain","encodingType","_this$metaInf3","getUidsFromPayload","currentSetIds","getUids","uidMap","getNearestPoint","interactionConfig","interaction","resolveTransformType","_transformType","_this$metaInf4","unitDom","cachePoint","pointMap","_pointMap","getInteractionStyles","addOverlayPath","removeOverlayPath","interactionFn","allMeasures","_identifiers$","_identifiers$2","hasPlotSpan","getPlotSpan","getPlotPadding","getPointsFromIdentifiers","getAllAttrs","filteredPoints","base_mixin_toConsumableArray","sizeVal","getTransformedDataFromIdentifiers","measureIndex","_identifiers$getData","identifierData","identifierSchema","_normalizedData","_this$encodingFieldsI","layerName","tupleArr","transformedVal","graphicElems","elems","animationDone","base_mixin_slicedToArray","encodingValue","retrieveEncodingFields","_transformedData","calculateDomain","applyElementStyles","getState","getListeners","getRenderProps","_context$metaInf","unitRowIndex","unitColIndex","base_mixin_defineProperty","getQualifiedStateProps","_construct","userConf","shouldDrawAnchors","BaseLayer","containsNull","getborderIndexes","prevOfNull","nextOfNull","settIndexPrevOrNext","indexesObj","prevContainsNull","nextContainsNull","getElementsForLine","layer","strokeStyle","linepath","updateFns","drawLine","containerSelection","nullDataLineStyle","nullDataLineClass","curveInterpolatorFn","dd","elementWithNullData","sanitizeNullConfig","makeStartEndPair","borderIndexes","pairArray","pair","prevValue","nextValue","fade","focus","brushStroke","crossline","nearestPointThreshold","strokeOpacity","fillOpacity","strokeWidth","LineLayerMixin","line_mixin_classCallCheck","line_mixin_possibleConstructorReturn","line_mixin_getPrototypeOf","line_mixin_inherits","line_mixin_createClass","getDrawFn","translatePoints","xAxis","yAxis","isXDim","isYDim","xPx","yPx","getColor","resolvedEncodings","getTranslatedData","colorValFn","colorFieldIndex","colorVal","getPathStyle","qualifiedClassName","colorField","translatedPoints","seriesClassName","searchRadius","_point$data$data","line_mixin_toConsumableArray","line_mixin_get","drawArea","easeEffect","_map2","renderer_slicedToArray","enterAreaPath","updateAreaPath","selectionEnter","AreaLayerMixin","area_mixin_classCallCheck","area_mixin_possibleConstructorReturn","area_mixin_getPrototypeOf","area_mixin_inherits","area_mixin_createClass","area_mixin_get","nearestPoint","dimValue","pointArr","_pointArr$i$update","pointY0","classNameFn","minYVal","basePos","y0Px","invalidY","invalidY0","resolvedValues","AreaLayer","highlight","stroke-linejoin","shape","states","fadeout","selected","ArcLayerMixin","arc_mixin_classCallCheck","arc_mixin_possibleConstructorReturn","arc_mixin_getPrototypeOf","_prevPieData","arc_mixin_inherits","arc_mixin_createClass","_this$axes","radiusAxis","pieIndex","angleV","angles","_angles","uid","getOuterRadius","getInnerRadius","startAngle0","endAngle0","_previousInfo","getPreviousPoint","currIndex","prevArc","nextArc","_context$axes$angle$r2","arc_helper_slicedToArray","_this$config","qualClassName","_arcFn","consecutiveExits","exitCounter","tweenPie","individualClass","tweenExit","exitArr","oldExitCounter","tweenExitPie","consecutiveExitArr","gElem","pieSlices","pieSliceInf","tData","ArcLayer","LineLayer","drawText","selectionMerge","backgroundVal","textanchor","textStyle","background","backgroundPadding","_smartLabel$getOriSiz","backgroundEl","alignment-baseline","defaultEncoding","alignmentBaseLine","defRotation","pointTranslators","polar","textEncoding","angleAxis","textFormatter","backgroundEncoding","backgroundValue","text_mixin_objectSpread","cartesian","textField","textFieldIndex","textValue","text_mixin_slicedToArray","TextLayerMixin","text_mixin_classCallCheck","text_mixin_possibleConstructorReturn","text_mixin_getPrototypeOf","text_mixin_inherits","text_mixin_createClass","getPointTranslator","text-anchor","TextLayer","drawSymbols","createShape","groupElement","Element","newShape","nodeName","src","href","shapeElement","pathStr","checkPath","pathEl","exitGroup","defColorStyle","focusStroke","commonDoubleStroke","doubleStroke","anchors","persistent-anchors","brush-anchors","shapes","sizes","prepareDrawingInf","shapeAxis","sizeAxis","getShape","getSize","layerEncoding","helper_defineProperty","_config$offset","offsetX","offsetY","point_helper_slicedToArray","measure","getStrokeWidthByPosition","inside","outside","PointLayerMixin","point_mixin_classCallCheck","point_mixin_possibleConstructorReturn","point_mixin_getPrototypeOf","_overlayPath","formattedUids","point_mixin_inherits","point_mixin_createClass","maxSize","generateDataPoints","point_mixin_toConsumableArray","drawFn","_maxSize","_getPlotMeasurement2","point_mixin_slicedToArray","widthMetrics","heightMetrics","offsetXValues","offsetYValues","measurementConf","getMeasurementConfig","widthSpan","heightSpan","distanceLimit","refElement","pathElement","parentElement","styleVal","currentPath","point_mixin_get","PointLayer","drawRects","barEnterFn","transitionBars","selTransition","positionRetriever","isNegativeVal","barBasePos","resolveDimByField","axesInfo","spaceType","sizeEncoding","sizeConfig","sizeValue","enterSpace","minVal","maxVal","diffPx","minDomVal","endPos","_positionRetriever$ty2","bar_helper_slicedToArray","resolveDimensions","_resolveDimByField","enterWidth","enterX","xPos","_resolveDimByField2","enterHeight","BarLayerMixin","bar_mixin_classCallCheck","bar_mixin_possibleConstructorReturn","bar_mixin_getPrototypeOf","_plotPadding","_plotSpan","bar_mixin_inherits","bar_mixin_createClass","bar_mixin_get","getTranslatedPoints","normalizedDataArr","barContainer","bar_mixin_slicedToArray","barWidthMetrics","barHeightMetrics","barWidthOffsets","barHeightOffsets","barWidth","barWidthOffset","barHeight","barHeightOffset","pathGroup","_strokeWidthPositionM","strokeWidthPositionMap","L1","L2","L3","BarLayer","tick_renderer","pathElem","angle0Axis","angle0V","angles0","_angles2","tick_mixin_objectSpread","_layerInst$encodingFi","_config$span","xSpan","ySpan","x0Px","TickLayerMixin","tick_mixin_classCallCheck","tick_mixin_possibleConstructorReturn","tick_mixin_getPrototypeOf","tick_mixin_inherits","tick_mixin_createClass","offsetM","offsetL","_ref$position","drawTicks","TickLayer","sanitizeEncoding","layerFactory","compositeLayers","factoryObj","setLayerRegistry","_layerRegistry","getSerializedConf","mark","layerDef","serializedDefs","defs","unitLayerDef","sDef","parseLayerDefinition","layerType","strs","propValue","layer_factory_toConsumableArray","getLayerInstance","layerRegistry","instances","layerObj","layerConstructor","getLayerClass","composeLayers","layerDefs","sanitizeLayerConfig","DEFAULT_LAYERS","defaults_defineProperty","_DEFAULT_LAYERS","LAYER_TYPES","layer_registry","layers","helpers","commonHelpers","pointLayerHelpers","layerMixins","getDimensionMeasureMap","retinalEncodingsAndMeasures","_layer$encodingFields","sizeField","shapeField","_retinalEncodingsAndM","src_helper_toConsumableArray","transformDataModels","dataModels","transformVal","getLayerFromDef","existingLayer","rowIndex","colIndex","instanceArr","_timeDiffs","resolveEncodingTransform","sanitizeLayerDef","sanitizedDefs","sConf","attachDataToLayers","transformedDataModels","dataSource","attachAxisToLayers","layerAxisIndex","axesObj","axisInf","axisIndex","getLayerAxisIndex","_layer$config","specificField","encodingField","fieldInst","getMembers","unionDomainFromLayers","axisFields","domainValues","layerDomain","fieldDomain","encodingDomain","fieldStr","domain1","renderLayers","_lifeCycleManager","notify","orderedLayers","layerParentGroup","layerDepOrder","_layerDepOrder","getNearestDimensionalValue","entryVal","getLayersBy","searchBy","removeLayersBy","createSideEffectGroup","createRenderPromise","_renderedPromise","_renderedResolve","getRadiusRange","radiusAxes","isXandYMeasures","_context$fields","src_helper_slicedToArray","xMeasures","yMeasures","getValuesMap","idValuesMap","valuesIdMap","_model$getData","fieldIndices","getSelectionRejectionModel","propValuesMap","rejectionModel","_propModel$getData","entryRowIds","exitRowIds","rowIdsObj","createRTree","interactive","rtree","load","AXES","LAYERDEFS","TRANSFORMEDDATA","DATADOMAIN","FIELDS","LAYERAXISINDEX","IDFIELD","GRID_LINE_PARENT_GROUP_CLASS","GRID_BAND_PARENT_GROUP_CLASS","GRID_PARENT_GROUP","TICK","GRID_BAND","GRID_LINE","CONSOLIDATED","FRAGMENTED","FACET_BY_FIELDS","RETINAL_FIELDS","PARENT_ALIAS","CACHED_DATA","STORE","DRAG","HOVER","SELECTIONDRAG","CLICK","LONGTOUCH","TOUCHDRAG","ALL_ACTIONS","SELECTION_NEW_ENTRY","SELECTION_NEW_EXIT","SELECTION_NULL","SELECTION_OLD_ENTRY","SELECTION_OLD_EXIT","SelectionSet","_volatile","selection_set_classCallCheck","completeSet","_uidMap","_measureNames","_dimVals","measureNames","dims","_completeSetCount","_lockedSelection","_fieldIndices","_resetted","entrySet","exitSet","mergedEnter","mergedExit","dimVals","_config$keepDims","keepDims","_config$dimensions","measureNamesArr","selection_set_toConsumableArray","addSet","removeSet","updateSet","raw","changeSideEffectAvailability","toEnable","sideEffects","change","enable","disable","getMergedSet","muze_firebolt_src_helper_toConsumableArray","getSideEffects","behaviour","behaviourEffectMap","behaviours","effects","unionSets","firebolt","combinedSet","uidSet","entryExitSet","_entryExitSet","_entryExitSet$type","existingModel","cloneObj","clonedVal","getKeysFromCriteria","_firebolt$_metaData","_metaData","dimensionsMap","dimArr","firebolt_defineProperty","dimKey","firebolt_toConsumableArray","Firebolt","actions","firebolt_classCallCheck","_sideEffectDefinitions","_sideEffects","_propagationInf","_sourceSelectionSet","_actions","behavioural","physical","_selectionSet","_volatileSelectionSet","_propagationFields","_sideEffectPolicies","_propagationBehaviourMap","_behaviourPolicies","_actionBehaviourMap","_behaviourEffectMap","_actionHistory","_queuedSideEffects","_handlers","_payloadGenerators","_payloads","mapSideEffects","registerBehaviouralActions","registerSideEffects","registerPhysicalBehaviouralMap","physicalBehaviouralMap","registerPhysicalActions","setSideEffectConfig","sideEffect","sideEffectConf","behEffectMap","preventDefaultActions","effectNames","initializeBehaviouralActions","dispatchableBehaviours","Action","prepareSelectionSets","initializeSideEffects","sideEffectStore","actionHistory","queuedSideEffects","mergeSelectionSets","firebolt_typeof","sideEffectInstance","isEnabled","mutates","dispatchSideEffect","setTransform","propagationInfo","sanitizePayload","propagate","shouldApplySideEffects","propagationIdentifiers","applicableSideEffects","getApplicableSideEffects","applySideEffects","getEntryExitSet","sourceSelectionSet","behaviourConditions","sideEffectConditions","physicalAction","actionBehaviourMap","behaviourMap","mapActionsAndBehaviour","handler","onDataModelPropagation","dispatchBehaviour","uniqueIds","behaviouralActions","volatileSelectionSet","sideEffectDefinitions","sideEffectsMap","SideEffect","initedActions","initializePhysicalActions","physicalActions","phyAction","initedPhysicalActions","getDefaultTargetContainer","bindActionWithBehaviour","registerPhysicalActionHandlers","targets","behaviourList","applicableSelectionSets","handlers","genericHandlers","onPhysicalAction","beh","_this$context","getRangeFromIdentifiers","defaultFn","__default","GenericBehaviour","generic_classCallCheck","_enabled","selectionSets","getSelectionSets","_this$getAddSetFromCr","getAddSetFromCriteria","getPropagationInf","_payload","setSelectionSet","_this$firebolt","_selectionSet$getSets","getSets","getSetInfo","getSourceFields","setFields","setKeys","aggFns","propData","propagationFields","resetted","otherFields","generic_slicedToArray","generic_toConsumableArray","_propagationIdentifiers","VolatileBehaviour","existingAddSet","SELECTION","updateExit","getCompleteSet","BRUSH","HIGHLIGHT","TOOLTIP","FILTER","HighlightBehaviour","BrushBehaviour","BEHAVIOURNAMES","FilterBehaviour","PersistentBehaviour","updateEntry","SelectBehaviour","mergedExitSet","completeSetCount","dragCriteriaRetriever","drag_action_config_defineProperty","_dragCriteriaRetrieve","sourceInfo","startPos","ranges","getRangeFromPositions","getDragActionConfig","getSourceInfo","coordType","attachDragEvent","targetEl","drawingInf","touchStart","d3Drag","getDrawingContext","newStartPos","newEndPos","dragging","dragDiff","triggerPhysicalAction","dragEnd","hover","tooltip","svgContainer","getAllPoints","showInPosition","ACTION_NAMES","generatePayloadFromEvent","click","physical_defineProperty","_physicalActions","longtouch","touchEnd","touchdrag","ANCHORS","BRUSH_ANCHORS","PERSISTENT_ANCHORS","HIGHLIGHTER","CROSSLINE","FRAGMENTED_TOOLTIP","AXIS_LABEL_HIGHLIGHTER","GenericSideEffect","generic_sideeffect_classCallCheck","_strategy","plotPointsFromIdentifiers","_this$firebolt$contex","getPlotPointsFromIdentifiers","_sourceInfo","_layers","_plotPointsFromIdentifiers","SurrogateSideEffect","_config$reset","layerFields","filteredUids","_ref2$","surrogate_slicedToArray","SpawnableSideEffect","_drawingContext","changeVisibility","sideEffectGroup","visible","SelectionBox","boxConf","box","drawingContext","unitWidth","unitHeight","selectionGroupClassName","persistent","hide","sourceInf","_getBoxDimensionsFrom","getBoxDimensionsFromPayload","xRange","yRange","xDim","yDim","xLinear","yLinear","xCriteria","yCriteria","x1Val","x2Val","x1DomainIndex","x2DomainIndex","_sort2","selection_box_helper_slicedToArray","y1Val","y2Val","y1DomainIndex","y2DomainIndex","_sort4","_xDim","_yDim","direction","selectionBox","selectiondrag","BEHAVIOURS","selectionBoxDrag","onDrag","ACTIONS","boxClassName","parentClassName","connectorClassName","content","iconContainerSize","iconScale","iconShape","iconColor","rowMargin","separator","arrow","Content","content_classCallCheck","_model","_formatter","ctx","displayFormat","table","tbody","elemData","Tooltip","htmlContainer","tooltip_classCallCheck","connectorContainer","tooltipConf","contentClass","_tooltipContainer","_contentContainer","_contents","_tooltipConnectorContainer","defConf","contentConfig","specificClass","reorderContainers","contentConf","_target","tooltipPos","_orientation","connector","_offset","dim","_extent","contentContainer","topSpace","dimX","rightSpace","leftSpace","bottomSpace","arrowSize","tooltipHeight","tooltipWidth","spaces","positionHorizontal","positionVal","positionVertical","hMax","vMax","_position","HIGHLIGHT_SUMMARY","defNumberFormat","formatters","strategies_defineProperty","isSingleValue","dataLen","stackedSum","getStackedKeyValue","getKeyValue","isSelected","removeKey","isStackedBar","stackedValue","keyObj","valueObj","stackedValueObj","margin-left","getStackedSum","generateRetinalFieldsValues","valueArr","retinalFields","dimensionMeasureMap","fieldInf","retField","retIndex","retinalFieldValue","measuresArr","icon","_fieldInf$retField","formattedRetinalValue","hasMultipleMeasures","_fieldInf$measure","dName","formatterFn","currentMeasureValue","strategies_toConsumableArray","buildTooltipData","nestedDataObj","fieldValues","_dataModel$getData","fieldspace","_context$retinalField","detailFields","_ref2$showStackSum","showStackSum","_context$payload$sele","selectedMeasures","containsDetailField","getFieldInf","defFormatter","nf","getTabularData","strategies_construct","isStacked","isStackedChart","isStackedBarChart","filteredMeasures","generateTooltipContent","nestedData","_nestedData$i","_fieldInf$field","len2","_fieldInf$name","strategies_strategies","showMultipleMeasures","entryUids","fieldsConf","aggregatedValues","getAggregatedValues","dimsMap","groupedDm","dmFields","_values$0$data","_fieldsConf$measure$d","rowValues","configResolvers","tooltip_defineProperty","_configResolvers","specificConf","_default","side_effects_tooltip_classCallCheck","tooltip_possibleConstructorReturn","tooltip_getPrototypeOf","_tooltips","sanitizeConfig","strategyObj","sanitizedConf","createTooltip","tooltips","positionRelativeTo","sourceFields","tooltip_get","plotDim","_config$strategy","projectFields","dataTransform","strategyFn","dt","layoutContainer","parentContainerDimensions","layoutBoundBox","unitBoundBox","tooltipInst","TooltipRenderer","highlightSummary","selectionSummary","FragmentedTooltip","totalHeight","totalWidth","boundBox","showVertically","boxes","fragmented_tooltip_toConsumableArray","fragmented_tooltip_get","fragmented_tooltip_getPrototypeOf","tooltipBoundBox","getContents","spaceOutBoxes","spaceOutIfOverlap","firstBox","secondBox","opposite","repositionArrow","Crossline","bandWidth","px","bandClass","lineClass","isEmptyDataModel","plotWidth","crossline_toConsumableArray","startPx","endPx","parentGroup","getFormattedSet","selectedPointsId","formattedSet","helper_objectSpread","fadeFn","fadeOnBrush","fadeOnBrushFn","getPayload","actualPoint","commonSet","excludeSetIds","currentHighlightedSet","selectEntrySet","diffSet","pseudoFocus","PlotHighlighter","plot_highlighter_classCallCheck","plot_highlighter_possibleConstructorReturn","plot_highlighter_getPrototypeOf","excludeSet","selectedPointsIds","plot_highlighter_toConsumableArray","currentStrategy","getExcludeSetIds","plot_highlighter_objectSpread","FilterEffect","entryModel","resetData","AnchorEffect","anchors_classCallCheck","anchors_possibleConstructorReturn","anchors_getPrototypeOf","_layersMap","addAnchorLayers","addLayer","layerCls","depLayerEncoding","defaultSizeValue","commonName","layerOwner","defaultClassName","groupId","getTransitionConfig","owner","registry","upperAnchors","lowerAnchors","targetObj","anchors_toConsumableArray","layerConfig","linkedLayer","getLayerByName","linkedLayerName","isUpperAnchor","_linkedLayer$getTrans2","anchors_slicedToArray","dmFromPayload","_linkedLayer$getTrans4","transformedDataModel","anchorSizeConfig","getAnchorSizeOnInteraction","getAnchorStroke","PersistentAnchors","anchor","defaultInteractionLayerEncoding","BrushAnchors","AxisLabelHighLighter","selectedData","selectedDataValues","_context$axes","_context$axes$x","_context$axes$y","axis_labels_highlighter_toConsumableArray","fieldMeta","selData","_axis$getTicksBasedOn","getTicksBasedOnData","selectedElements","nullDataTooltipMap","bar","applySideEffectOnEmptyTarget","behaviour_effect_map_defineProperty","brush","brushEntrySet","unionedSet","highlightUids","SIDE_EFFECTS","convertToObj","payloadGenerator","selectionDataModel","facetByFields","propPayload","getRangeFromData","_propConfig$includeMe","includeMeasures","selectionDataFields","measureNamesIdx","excludeSelectedMeasures","payload_generator_defineProperty","selectionSetFields","_facetByFields","payload_generator_slicedToArray","_facetByFields$","facetFields","_facetByFields$2","facetValues","facetIndices","identifierIdxMap","sourceIdentifierFields","identifierMap","payload_generator_toConsumableArray","pseudoSelect","isSideEffectEnabled","se","sideEffectPolicies","sideEffectCheckers","propagationData","prepareSelectionSetMap","maps","getUniqueKeys","_ref2$keys","_ref2$dimensionsMap","mKey","firebolt_helper_toConsumableArray","sanitizePayloadCriteria","propFields","_ref4","dimsMapGetter","firebolt_helper_defineProperty","fieldIndexMap","dataWithFacets","measureNameField","propDims","origRow","rowVal","newRowVal","createMapByDimensions","cacheMap","_cacheMap","sideEffectPolicy","hasCommonCanvas","sourceCanvas","UnitFireBolt","src_firebolt_classCallCheck","firebolt_possibleConstructorReturn","firebolt_getPrototypeOf","_connectedBehaviours","payloadGenerators","changeSideEffectStateOnPropagation","unitId","aliasName","parentAlias","propagationSourceCanvas","sourceUnitId","sourceUnit","sideEffectInstances","actionOnSource","mappedEffects","applySideEffect","_this$_metaData","_dimsMapGetter","enabledFn","enabled","getPayloadGeneratorFor","payloadFn","behaviourPolicies","dispatchSecondaryActions","secAction","generatedPayload","payloadGeneratorFn","firebolt_get","cachedData","action_behaviour_map_defineProperty","UnitBrushBehaviour","dragStart","brush_get","behaviours_brush_getPrototypeOf","getGridLayerDefinitions","axisType","getDefaultVisibilty","getLayerDefinition","_definition","_axes","_encoding","gridLines","gridBands","gridLineColor","zeroLineColor","gridBandColor","isLinearScale","grid_lines_defineProperty","isNegativeDomain","dimensionSubTypes","getValidSubtype","attachDataToGridLineLayers","_gridLines","_gridBands","gridLayerData","getGridLayerData","gridData","jsonData","_jsonData$push","grid_lines_toConsumableArray","src_listener_map_slicedToArray","fieldsVal","removeExitLayers","layersMap","markSet","queuedLayerDefs","_queuedLayerDefs","layerDefArr","listener_map_toConsumableArray","timeDiffsByField","minimumConsecutiveDifference","_ref8","_timeDiffsByField","originalData","_prepareSelectionSetD","prepareSelectionSetData","_prepareSelectionSetM","createSelectionSet","attachPropagationListener","_ref9","createGridLineLayer","vuConf","atomicDef","_ref11","_ref12","_ref15","_ref16","layerAxisIndexVal","_layerAxisIndex","axesVal","_dimensionMeasureMap","src_props_defineProperty","_PROPS","facets","facetKeys","facetFieldsMap","trackerClassName","arcLayerClassName","sideEffectClassName","local_options","src_local_options_defineProperty","_CONFIG$LAYERDEFS$TRA","_cachedValuesMap","local_options_toConsumableArray","oldData","PseudoSelectBehaviour","unitNs","VisualUnit","visual_unit_classCallCheck","lifeCycleManager","_gridLinesSelection","_gridBandsSelection","createFireboltInstance","_Object$assign","interactions","fireboltDeps","Cls","getFireboltCls","visual_unit_defineProperty","getActionBehaviourMap","getBehaviourEffectMap","_firebolt","createRootContainers","_rootSvg","_sideEffectGroup","initSideEffects","class","renderGridLineLayers","gridLineParentGroup","_entry","grid_lines_slicedToArray","parentGroupClass","rootSvg","_this$parentContainer","parentContainerInf","layerDefinition","layerDefinitions","components","layerIndex","layersArr","_layersArr","markId","defArr","instanceValues","visual_unit_toConsumableArray","layerdeps","_this$_dependencies","parentModel","REACTIVE_PROPS","pointInf","getMarkInfFromLayers","visual_unit_objectSpread","markInf","parsedIdentifiers","_this$fields","xdom","ydom","_rtree","localNs","dataDomain","visual_unit_slicedToArray","dispatchQueuedSideEffects","clearActionHistory","visual_unit_construct","Variable","ComposedVars","composed_vars_classCallCheck","composed_vars_possibleConstructorReturn","composed_vars_getPrototypeOf","vars","_vars","_data","member","SimpleVariable","simple_var_classCallCheck","simple_var_possibleConstructorReturn","simple_var_getPrototypeOf","oneVar","_oneVar","dtFormat","dateFormat","fieldDef","varInst","convertToVar","datamodel","transformFields","field_sanitizer_slicedToArray","normalizedFields","normalizeFields","norFields","orderFields","fieldArray","temporalArr","categoricalArr","fieldList","numOfMeasures","allDimensions","field_sanitizer_toConsumableArray","temporal","categorical","rowsInfo","columnsInfo","rowDimensions","rowMeasures","rowTemporalFields","rowCategoricalFields","columnDimensions","columnMeasures","columnTemporalFields","columnCategoricalFields","BORDER_WIDTH","facet","handleBlankCell","externalClassname","sanitiseHeaderMatrix","matrices","sanitiseFacetValues","blankCell","normal","latestSource","lastSource","initStore","group_utils_defineProperty","isDistributionEqual","group_utils_toConsumableArray","rowType","initializeCacheMaps","cellMap","xAxesMap","yAxesMap","entryCellMap","exitCellMap","getAxisKey","getCellKey","columnId","extractUnitConfig","unitConfig","hasOneField","getHeaderText","rowLength","headerCreator","fieldHeaders","TextCell","findInGroup","variable","channel","group_utils_this","facetType","projType","getAxisType","retriveDomainFromData","mutateAxesFromMap","cacheMaps","xAxes","yAxes","xAxisSet","yAxisSet","axisId","getEncoder","encoder","CartesianEncoder","layerConf","hasPolarEncodings","PolarEncoder","getHeaderAxisFrom","userAxisFromConfig","axisFrom","headerFrom","group_utils_slicedToArray","firstField","secondField","firstFieldType","secondFieldType","setFacetsAndProjections","_encoder$simpleEncode","simpleEncoder","getFacetsAndProjections","projections","getBorders","showRowBorders","showColBorders","showValueBorders","valueMatrix","_rows","leftRows","rightRows","_columns","topColumns","bottomColumns","_encoder$fieldInfo","allDimensionLength","allMeasuresLength","allTemporalFieldsLength","getRowBorders","borders","getColumnsBorders","getValueBorders","borderTypeRow","borderTypeCol","getFieldsFromSuppliedLayers","suppliedLayerConfig","encodingArr","group_utils_typeof","extractFields","facetsAndProjections","flattenArray","sortFacetFields","facetNames","sortInfo","sortConfig","facetSortConfig","getSchemaDef","removeExitCells","exitCells","qualifiedStateProps","placeholder","globalConfig","VisualEncoder","visual_encoder_classCallCheck","_fieldInfo","_axisFrom","_headerFrom","__headerFrom","_getHeaderAxisFrom2","visual_encoder_slicedToArray","rowHeader","rowAxis","_getHeaderAxisFrom4","colHeader","colAxis","scaleMaps","getFieldNames","fieldVar","matrix_model_toConsumableArray","prepareHashMaps","rowKey","joinedRowKey","createJoinedKeys","keyArr","joinedKey","formatKeys","formatterList","formattedKeys","rKeys","rIdx","createColumnDataModels","colContext","sourceDM","rowFacets","colFacets","rowKeyArr","colKeyObj","newRowIndex","splitModelsHashMap","currentColumnIndex","colKeyArr","colKey","hashMapKey","splitByColumn","optionalProjections","facetInfo","projectionInfo","geomCellCreator","_indices$i","projectionIndexObject","columnIndex","matrix_model_objectSpread","getMatrixModel","currentRowIndex","prepareProjectionInfo","colProjections","rowProjections","rowProj","rIndex","newRIndex","colProj","cIndex","newCIndex","newRowProj","newColProj","rowFields","columnFields","prepareFacetInfo","rowFacetNames","colFacetNames","allFacets","_getSplitModelHashMap","getSplitModelHashMap","splitModels","rowKeyHashMap","colKeyHashMap","rowKeys","colKeys","splitContext","splitByRow","setDefaultConfigForFacet","facetsUserConfig","border","isBorderPresent","isGridLinePresent","gridLinesShowLength","borderWidth","generalContext","rowKeyObj","createRowDataModels","rowContext","rowIndexForCurrentKey","_createColumnDataMode","_createColumnDataMode2","_createColumnDataMode3","_createColumnDataMode4","formattedColKeys","facetField","rawFormat","columnKeys","createValueCells","suppliedLayers","GeomCell","matrixLayers","horizontalAxis","verticalAxis","datamodelTransform","sortedFields","layerConfigArr","getLayerConfig","retinalConfig","axesCreators","normalizedColumns","normalizedRows","cell_creator_toConsumableArray","geomCellKey","geomCell","updateCells","facetKey","extractAxisIndex","createAxisCells","currObj","axisInst","_axisInst$config","AxisCell","BlankCell","extractFacetIndex","headerPlaceholderGn","selectionObj","counter","selectionKeys","keySet","textCells","createTextCells","textCell","generatePlaceholders","encoders","valuesMatrix","takeAxisFrom","takeHeaderFrom","axisPlaceholderGn","selObj","axesMatrix","selObjProp","axesForDraw","rowsPrimary","rowPrime","rowsSecondary","rowSec","columnsPrimary","colPrime","columnsSecondary","colSec","_selectionObj","section","hContext","getAxisFields","fieldHolder","ac","transformDataModel","resolvedData","newFieldsConfig","aggregationFns","nearestAggFns","resolvedAggFns","sortDmTemporalFields","computeMatrices","resolverConfig","otherEncodings","isProjection","isFacet","matrixGnContext","getCellDef","isRowSizeEqual","isColumnSizeEqual","colCells","rowCells","resetSimpleAxes","newCacheMap","valueCellContext","serializeLayerConfig","cellCreator","valueCellsCreator","valueMatrixInfo","_mutateAxesFromMap","createUnits","_generateMatrices","generateMatrices","leftHeaders","topHeaders","bottomHeaders","rightHeaders","cell_creator_slicedToArray","_map4","leftFacets","rightFacets","rowPriority","colPriority","leftMatrix","rightMatrix","topMatrix","bottomMatrix","currentBottomLength","setAvailableSpace","rowMatrix","columnMatrix","sanitiseBorderMatrix","bottomBorderObj","sanitiseGeomMatrix","RESOLVER_PROPS","units","MatrixResolver","matrix_resolver_classCallCheck","_registry","_layerConfig","_matrixLayers","_rowMatrix","_columnMatrix","_valueMatrix","_facets","_projections","_datamodelTransform","_units","_cacheMaps","_fireboltDeps","_placeholderInfo","matrix_resolver_toConsumableArray","getProjectionFields","_horizontalAxis","_verticalAxis","matrixType","matrix_resolver_defineProperty","_this5","_this$dependencies","autoGroupBy","_this$getAllFields","retContext","getRetinalFieldsDomain","getRetinalAxes","retinalEncoder","setCommonDomain","retinalAxes","updateVisualUnit","placeholders","bottomLeft","bottomRight","_this$dependencies2","showHeaders","_this$registry$cells","matrix_resolver_slicedToArray","topCols","bottomCols","rowHeaders","blankCellCreator","footers","topLeft","topRight","updateModel","dataTypeScaleMap","src_data_type_scale_map_defineProperty","data_type_scale_map_dataTypeScaleMap","getAdjustedDomain","y1ratio","y2ratio","allSameSign","generateAxisFromMap","axisKey","groupAxes","currentAxes","commonAxisKey","axisConfig","getAxisConfig","axisInfo","axisOrientation","rawUserAxisConfig","userAxisConfig","_rotationLock","createSimpleAxis","sanitizeIndividualLayerConfig","encodingConfigs","getDefaultMark","colFieldType","rowFieldType","createRetinalAxis","fieldProps","getIndex","arrIndex","getLayerConfFromFields","colFields","userLayerConfig","encoder_helper_toConsumableArray","xFields","yFields","colFieldExist","rowFieldExist","resolverAxes","axesArr","userConfig","getSortingConfig","currentFieldName","axesConfig","lastSortConfig","geomCellAxes","1","unitsArr","encodingDomains","axisTypeIndex","typeOfField","_resolver$axes","adjustedDomain","typeOfAxis","alignZeroLine","primaryFacets","secondaryFacets","primaryFields","secondaryFields","primaryLen","secondaryLen","projArr","primaryField","secondaryField","existIndex","axisFromIndex","cartesian_encoder_get","cartesian_encoder_getPrototypeOf","encodingObj","layerArray","serializedLayers","colField","colFieldName","rowField","configs","rowFieldName","defConfigs","layerConfigs","mergedLayerConf","serializedLayerConfig","cartesian_encoder_toConsumableArray","axesCls","polar_encoder_defineProperty","_axesCls","pieAxes","varInstances","encType","domainProps","matrixInstance","unitDomains","setRadiusFactor","sizeFieldIndex","sizeMultiplier","getSizeMultiplier","sizeAxisDomain","encodingFields","sanitizedRows","sanitizedColumns","polar_encoder_get","polar_encoder_getPrototypeOf","sanitizedFields","typeIndex","polar_encoder_toConsumableArray","sanitizedConfig","angleField","angle0Field","RetinalEncoder","newAxes","visual_group_local_options","visual_group_local_options_defineProperty","_CONFIG$ROWS$COLUMNS$","SimpleGroup","ValueMatrix","matrixArr","value_matrix_classCallCheck","instancesById","cellValue","_instancesById","_matrix","_filterFn","rowWidth","currentRowWidth","getLogicalSpace","rowHeight","currentRowHeight","setMatrixInstances","_composition","updateChecker","option","hasValue","hasOneValue","createMatrices","groupConfig","matrixConfig","placeholderInfo","getMatrices","_groupedDataModel","createRetinalAxes","setRetinalAxisDomain","cornerMatrices","createHeaders","metaData","unionUnitDomains","registerDomainChangeListener","visual_group_props_defineProperty","visual_group_props_PROPS","groupType","cellRegistry","VisualGroup","visual_group_classCallCheck","visual_group_possibleConstructorReturn","visual_group_getPrototypeOf","componentSubRegistry","visual_group_assertThisInitialized","_selection","createMatrixResolver","initializeGlobalState","globalState","createUnitState","_VisualUnit$getState2","visual_group_helper_slicedToArray","localState","createLayerState","_BaseLayer$getState2","setupChangeListeners","stores","_context$registry","comp","storeInst","listenerInf","getSimpleAxes","_this$resolver$getAll","visual_group_defineProperty","sanitizedValue","shouldRender","localFields","initializeFields","unsubscribeChangeListeners","sanitizeRetinalConfig","retinalConf","confValue","createEncoderInstance","fieldSanitizer","setAxisAndHeaders","resolverFields","initializeResolverFields","hasMandatoryFields","info","existingRemoveSet","select_toConsumableArray","firebolt_action_behaviour_map_defineProperty","action_behaviour_map_actionBehaviourMap","propagationBehaviourMap","_propagationBehaviour","firebolt_behaviour_effect_map_defineProperty","firebolt_behaviour_effect_map_behaviourEffectMap","propagationSideEffects","_propagationSideEffec","src_firebolt_helper_toConsumableArray","DEFAULTICONSIZE","SCALE_FUNCTIONS","HORIZONTAL","VALUE","POSITION_ALIGNMENT_MAP","constants_defineProperty","_POSITION_ALIGNMENT_M","OPPOSITE_POSITION","_OPPOSITE_POSITION","LegendFireBolt","_Firebolt","legend_firebolt_classCallCheck","legend_firebolt_possibleConstructorReturn","legend_firebolt_getPrototypeOf","legend_firebolt_inherits","legend_firebolt_createClass","getPropagationSelectionSet","behaviourName","canvasAlias","legend_firebolt_toConsumableArray","getFullData","getCriteriaFromData","firebolt_physical_defineProperty","physical_physicalActions","boundingBox","gradientDimensions","axisScale","rangeShifter","drag_defineProperty","getSelectionCriteria","selectionBoxMeasure","drawingInfMeasure","subjectStartPoint","ALIGN","DEFAULT_MEASUREMENT","marginHorizontal","paddingRight","LEGEND_TITLE","_buffer","legend_defaults_defineProperty","borderStyle","borderColor","bounds","upper","tempConfig","STEP_DEFAULT_CONFIG","ICON_MAP","LEGEND_MARKER_PROPS","side_effects_selection_box_classCallCheck","side_effects_selection_box_possibleConstructorReturn","side_effects_selection_box_getPrototypeOf","gradientDimension","legendGradContainer","legendSelGroup","selBox","enterFn","selection_box_drag_defineProperty","fadeOut","brighten","LegendHighlighter","legend_highlighter_classCallCheck","legend_highlighter_possibleConstructorReturn","legend_highlighter_getPrototypeOf","SYMBOL_PADDING","LegendMarker","legend_marker_classCallCheck","legend_marker_possibleConstructorReturn","legend_marker_getPrototypeOf","_graphicElements","markerElement","legendmarkerTextContainer","legendmarkerText","rotateAngle","lableConfig","labelText","_getRelativePosition","getRelativePosition","canvas","legendContainer","_canvasMount","_labelManager$getSmar","MARKER_BUFFER","legendmarkerGroup","textElement","createTextCell","labelManagerRef","maxLines","_minTickDiff","_cells","resetLogicalSpace","title","_title","getScaleInfo","scaleType","scaleFn","getInterpolatedArrayData","domainForLegend","scaleParams","requiredWidth","requiredHeight","upperBound","maxTickDiff","alignment","smartLabelCalc","minimumTickSize","_smartLabelCalc$getOr","isInteger","getcomputedArray","computationhelper","requiredMeasure","availableMeasure","currentTickValue","nextTickValue","measureParam","pixelPerTick","getInterpolatedData","recomputeSteps","getTickMeasure","_scaleParams$measures","getItemMeasures","_labelManager","_labelManager$getOriS","calculateTitleWidth","titleWidth","maxItemSpaces","itemSpaces","localBuffer","cur","SimpleLegend","simple_legend_classCallCheck","_fieldName","defaultMeasurement","_computedStyle","legendBehaviours","_canvasAlias","_this$measurement","effPadding","effBorder","effMargin","dataFromScale","titleSpace","getTitleSpace","titleHeight","labelSpaces","getLabelSpaces","_computeItemSpaces","computeItemSpaces","textOrientation","iconSpaces","maxIconWidth","labelSpace","itemSpace","iconSpace","newLabelWidth","titleSpaces","_this$measurement2","_this$config3","titleCreator","textAlign","titleContainer","marginPosition","_this$config4","_this$measurement3","widthBox","renderTitle","rawVal","simple_legend_defineProperty","idRangeMap","canvasRoot","legendOrientation","position_config_defineProperty","_legendOrientation","datasets","itemContainerMeasures","getStepSpacesInfo","iconHeight","iconWidth","stepPadding","horizontal","vertical","positionConfig","_positionConfig","alignmentMap","_alignmentMap","itemStack","_itemStack","createLegendSkeleton","gradWidth","gradHeight","maxGradHeight","maxGradWidth","legendBody","legendItem","getItemContainers","legendInstance","positionObj","createItemSkeleton","_context$config","itemSkeleton","alignClass","applyItemStyle","measureType","stepColorCheck","_context$measurement","renderIcon","transalate","defaultIcon","defaultIconSize","DiscreteLegend","_getScaleInfo","_field$schema","discrete_legend_toConsumableArray","ele","nextVal","discrete_legend_defineProperty","discrete_legend_get","discrete_legend_getPrototypeOf","renderDiscreteItem","_context$measurement2","_item$icon","text-align","marginVerticalBuffer","allSelections","getGradientDomain","accumulator","currentValue","MAX_VALUE","MIN_VALUE","legendGradSvg","legendGradCont","linearGradient","makeLinearGradient","legendRect","GradientLegend","gradient_legend_toConsumableArray","gradient_legend_defineProperty","getScaleFactor","newAxis","axisSpace","axisDomainLength","_legendGradientSvg","gradient_legend_get","gradient_legend_getPrototypeOf","renderGradient","_createLegendSkeleton","StepLegend","domainLeg","isFraction","step_legend_toConsumableArray","numRight","step_legend_defineProperty","stepData","step_legend_get","step_legend_getPrototypeOf","renderStepItem","_context$measurement3","_item$icon2","_positionConfig$posit","PADDING","BORDER","MARGIN","TITLE_TEMPLATE_NOT_ALLOWED_TAGS","IS_POINT_MAP","true","false","LEGEND_TYPE_MAP","src_constants_defineProperty","_LEGEND_TYPE_MAP","HORIZONTAL_CENTER","VERTICAL_CENTER","share","operators_construct","operators_toConsumableArray","strings","htmlCode","expLn","frag","createDocumentFragment","treeShakeNode","nodeType","Node","ELEMENT_NODE","tagName","childNodes","canvasIterator","canvases","iteratorFn","cFn","visualGroup","_throwback","registerActions","fnName","_registrableComponents","setFireboltDependencies","actionModel","ActionModel","action_model_classCallCheck","registerPropagationBehaviourMap","dissociateBehaviour","dissociateSideEffect","policy","registrableComponents","mergedPolicy","aliases","*","propagationPayload","propagationCanvas","crossInteractionPolicy","TITLE_CONFIG","SUB_TITLE_CONFIG","MESSAGE_CONFIG","baseFontLimit","upperFontLimit","baseSizeLimit","upperSizeLimit","fractionImage","fractionChild","canvas_local_options_defineProperty","_localOptions","canvasOptions","_canvasOptions","local_options_slicedToArray","arg1","arg2","local_options_typeof","titleConfig","subtitle","subtitleConfig","sub","LayoutComponent","layoutComponent_classCallCheck","_boundBox","_renderAt","_alignWith","_alignment","_componentName","_className","DummyComponent","newDimensions","renderAt","component","componentName","pagination","scrollBar","thickness","speed","legend","minHeight","minCharacters","verticalAlign","collapse","invalidValues","DEFAULT_WIDTH","DEFAULT_HEIGHT","DEFAULT_CLASS_NAME","NODE_PREFIX","DefinitionModel","definitionModel_classCallCheck","_host","host","_cut","cut","_ratioWeight","ratioWeight","_preferred","preferred","_lanes","lanes","_remainingHeight","_remainingWidth","remainingHeight","remainingWidth","getNodeId","_uid","yExtraSpace","smallestHeight","getCutType","smallestExtraHeightHorizontally","MAX_SAFE_INTEGER","containerHeight","hostHeight","xExtraSpace","smallestWidth","smallestExtraWidthVertically","containerWidth","hostWidth","createPlaceHolderComponent","placeComponent","definitionModel","leftOvercomponentRationWidth","isPreferred","isGridComponent","componentRatioWidth","leftHeight","leftWidth","_component$getLogical","componentHeight","componentWidth","firstLaneConfig","firstLane","secondLane","tree_classCallCheck","_parentCut","_this$_children","tree_toConsumableArray","parentCut","bound","nodeconfig","searchNode","childNode","nodeId","deleteSearchNode","LayoutModel","measurements","layout_model_classCallCheck","_measurements","_root","createTree","setBoundBox","addChildren","lane","allocateBoundingBox","totalWeight","carry","lastSibling","ratio","setHostSpatialConfig","setHostPosition","negotiateDimension","alteredDim","nonAlteredDim","cumultiveExtraSpaceAmt","childrenLength","extraSpaceAmt","computePosition","determineBoundBox","bb","_lastSibling$boundBox","_top","_left","_height","_width","_instance$parent$boun","setSpatialConfig","VIEW_INDEX","ROW_MATRIX_INDEX","2","COLUMN_MATRIX_INDEX","ROW_ROOT","COLUMN_ROOT","VERTICAL","Utils","utils_createClass","isDOMElement","getID","getElement","findContainer","coordinate","removeDiv","divId","DataPoint","data_point_classCallCheck","DataParser","data_parser_classCallCheck","data_parser_createClass","defaultDataPointLogic","nodepoints","getnodePoints","datapoint","HTMLDataAdapter","_DataParser","html_data_classCallCheck","html_data_possibleConstructorReturn","html_data_getPrototypeOf","html_data_inherits","html_data_createClass","getCoordinates","html_data_get","Renderer","renderer_classCallCheck","renderer_createClass","initRenderer","__logicalTree","HTMLRenderer","_Renderer","html_renderer_classCallCheck","html_renderer_possibleConstructorReturn","html_renderer_getPrototypeOf","_coordinates","html_renderer_inherits","html_renderer_createClass","createhtml","mainDiv","html_renderer_get","parentDiv","createAndCustomiseParent","hasHost","createAndPositionDiv","html_renderer_objectSpread","div","coordinates","findNode","nodeID","renderer","drawLayout","renderHTML","resolveAligment","componentData","alignWith","componentToAlign","componentMap","refNode","newNodeConfig","setAlignConfig","DrawingManager","drawing_manager_classCallCheck","_componentMap","_layoutClassName","layoutClassName","_renderer","drawing_manager_createClass","drawComponent","DefinitionManager","definition_manager_classCallCheck","_prioritySequence","_totalHeight","_totalWidth","_targetComponentMap","prepareTargetComponentMap","targetComponentMap","canvasComponent","tempDefModel","componentRef","getComponent","placeGridComponent","gridComponents","iscolumnPreffered","_placeComponent","rowpreffred","LayoutDef","layout_def_classCallCheck","_layoutDefinition","layout_def_createClass","addComponent","layoutDefinition","addMultipleComponent","componentArray","sanitizedDefinition","hostObj","hostID","childHost","resetComponentMap","LayoutManager","layout_manager_classCallCheck","_dimension","_skeletonType","skeletonType","_layoutDef","_drawingManager","_rootNodeID","con","resetNode","updateNode","compute","_layout","calLayOutDef","_context$dimension","layoutDef","prioritySequence","generateConfigModel","negotiate","broadcast","layoutComponents","componentArr","compo","elementName","removeElement","elemID","co","deleteElement","setupChangeListener","allOptions","_allOptions","canvas_helper_toConsumableArray","nameSpaceProps","equalityChecker","dispatchProps","sanitizedData","getMandatoryFields","_cachedProps","notifyAnimationEnd","viewInfo","layout","centerMatrix","viewMatricesInfo","promises","cellArr","lifeCycle","animDonePromises","applyPropagationPolicy","changeBehaviourStateOnPropagation","isMeasure","applyInteractionPolicy","splom","isSplom","interactionPolicy","_interactionPolicy","_crossInteractionPolicy","unitFireBolt","canvas_helper_defineProperty","canvas_helper_objectSpread","createLayoutManager","src_options","minUnitWidth","minUnitHeight","options_slicedToArray","_auxConfig$reset","oldConf","facetDefaultConfig","fixFacetConfig","fixScrollBarConfig","GenericLayout","generic_layout_classCallCheck","_matrices","_centerMatrix","_mountPoint","DEFAULT_CONFIGURATION","grid_layout_defaults_defineProperty","_DEFAULT_CONFIGURATIO","_FieldNames$BORDER","DEFAULT_MEASUREMENTS","_DEFAULT_MEASUREMENTS","findInPage","page","combineMatrices","isTransposed","joinedMatrix","utils_toConsumableArray","rowData","computeLogicalSpace","maxMeasures","_config$isTransposed","unitMeasures","_getMeasureInfo","getMeasureInfo","firstMeasure","secondMeasure","minMeasures","getMinMeasures","_logicalSpace","utils_defineProperty","valueItem","maxMeasure","firstMeasureValue","secondMeasureValue","valueArray","_item$space","fMeasure","sMeasure","minSecondMeasure","createMatrixEachLevel","_arr$i","extraCellsRemover","beg","distribution","extraCellLengths","VisualMatrix","visual_matrix_classCallCheck","_lastLevelKey","_primaryMatrix","_secondaryMatrix","_maxMeasures","_availableSpace","_layoutMatrix","_tree","_createTree2","matrixTree","lastLevelKey","layoutMatrix","primaryMatrix","secondaryMatrix","breakPage","primaryMatrixLength","newMatrix","keyLength","heightMeasures","populateMaxMeasures","widthMeasures","calculateDepth","viewableMatrix","createViewPortMatrix","viewableMeasures","redistributeSpaces","childDepth","createMatrixInstances","matrixInfo","breakPointer","_breakPointer","brokenMatrix","breakMatrix","nextLevel","removeExtraCells","RowVisualMatrix","row_matrix_classCallCheck","row_matrix_possibleConstructorReturn","row_matrix_getPrototypeOf","maxHeights","maxWidths","matrixInst","cellDimOptions","matrixIndex","_this2$getCellDimensi","getCellDimensions","widths","rowHeights","columnWidths","primary","secondary","begCellLen","endCellLen","remainingAvailWidth","cWidths","conditions","maxPrioritySpace","availableWidth","currentWidth","prioritySpace","logicalWidths","getPriorityDistribution","mWidth","mHeight","redistributeViewSpaces","computeViewableSpaces","rHeights","gutter","spaceTakenByColumn","getDistributedHeight","heightWithoutGutter","distSum","gutterSum","availableHeight","colLen","distHeight","colHeight","colWidth","heights","ColumnVisualMatrix","column_matrix_classCallCheck","column_matrix_possibleConstructorReturn","column_matrix_getPrototypeOf","heightDist","divider","condition","spaceTakenByRow","getDistributedWidth","layoutConfig","distWidth","rowLen","oldLogicalSpace","heightDistribution","getMatrixMeasurement","setViewSpaces","pointerType","viewSpaces","pointer","computations_defineProperty","paginationDetailsMap","scrollType","paginationMeasureGetter","relatedMaxMeasure","getMatrixMeasureForPagination","measureDetails","actualMeasure","scrollInfo","getMatrixHeightDetails","columnMatrixWidth","_getHeightRequiredByC","getHeightRequiredByColMatrix","maxColumnMatrixHeight","columnViewSpace","getViewableSpaces","columnPointer","columnMatrixHeight","maxHeightAvailableForRowMatrix","rowMatrixHeight","bufferCondition","isScroll","getActualBufferFromConfig","computations_slicedToArray","getBufferFromCondition","currentBufferType","horizontalBuffer","verticalBuffer","computeLayoutMeasurements","_getMatrixWidthDetail","getMatrixWidthDetails","_layout$config3","rowMatrixWidth","maxRowMatrixWidth","maxWidthAvailableForColumnMatrix","_getMatrixHeightDetai","_getActualBufferFromC","rowViewableSpaces","columnViewableSpaces","setValueMatrixMeasurements","computations_toConsumableArray","rowWidthsPrimary","rowWidthsSecondary","columnHeightsPrimary","columnHeightsSecondary","measureSum","GridLayout","layout_classCallCheck","layout_possibleConstructorReturn","layout_getPrototypeOf","_layoutId","_scrollInfo","generateVisualMatrices","begColCells","endColCells","gutterSpace","layout_helper_slicedToArray","_center","_bottom","layout_helper_toConsumableArray","RowMatrix","ColumnMatrix","layout_get","_computeLayoutMeasure","setViewInformation","pageNumber","pageType","totalPages","layout_defineProperty","renderGrid","currentPage","_viewInfo","maxRowHeight","maxColWidth","rowPointer","getViewMatrices","rowMatrices","getViewableMatrices","columnMatrices","centralMatrixPointer","rowMatrixLen","columnMatrixLen","rowPages","columnPages","layoutDimensions","getViewMeasurements","_layout$config","rowSpaces","colSpaces","rightWidth","topHeight","bottomHeight","centerHeight","centerWidth","viewWidth","viewHeight","actualCenterMeasures","totalMeasures","unitHeights","unitWidths","specificBorderApplier","borderTypes","showBorders","borderInfo","borderType","applySpecificBorder","applyBorders","borderApplierFn","borderApplier","border_helper_defineProperty","borderMapVal","borderMap","orderMaker","nestByStack","updateArr","optionalParams","currStack","prevStack","arrVal","stackVal","currElemIndex","newElem","arrElem","returnArr","spanCalculator","isNull","maskCreator","_nestByStack","viewMatrix","hierarchy","_nestByStack2","spanGenerator","spans","ridx","currSpan","getOrder","matrixSpanGeneratorMap","span_maker_defineProperty","_matrixSpanGeneratorM","orderGetter","viewMatrixMaker","spanMaker","matrixSpanGenerator","spanApplier","cellCounter","spaceAllocationDueToSpan","primaryUnitWidth","cumulativeWidth","spanApplierMap","_spanApplierMap","TransactionSupport","INTERFACE_IMPl","LAYER_DEF","DETAIL_FIELDS","GEOM","BLANK","SimpleCell","simple_cell_classCallCheck","enums_defaults_defineProperty","_DEFAULT_CONFIG","_CONSTANTS$MARGIN","CONSTANTS","_CONSTANTS$PADDING","_CONSTANTS$HEADER_PAD","_CONSTANTS$TITLE_PADD","DEFAULT_PROPS","minSpacing","visual_cell_src_props_defineProperty","visual_cell_src_props_PROPS","caption","smartText","axis_cell_classCallCheck","axis_cell_possibleConstructorReturn","axis_cell_getPrototypeOf","_availHeight","_availWidth","axis_cell_assertThisInitialized","computeAxisSpace","logicalWidth","logicalHeight","spaceFixer","_axis$getLogicalSpace","actualWidth","actualHeight","_axis$config2","wrapperDiv","blank_cell_classCallCheck","blank_cell_possibleConstructorReturn","blank_cell_getPrototypeOf","blank_cell_assertThisInitialized","setSmartText","_context$minSpacing","minHeightSpace","minWidthSpace","paddedHeight","paddedWidth","isTitleSubtitle","subType","returnVal","computeTextSpace","_context$minSpacing2","minText","_minTextSpace","smartSpace","smHeight","smWidth","headerPadding","text_cell_classCallCheck","text_cell_possibleConstructorReturn","text_cell_getPrototypeOf","text_cell_assertThisInitialized","titlePadding","vAlign","_this$smartText","translation","middle","setPadding","localPadding","geom_cell_classCallCheck","geom_cell_possibleConstructorReturn","geom_cell_getPrototypeOf","_unit","_datamodel","_transform","_caption","geom_cell_assertThisInitialized","captionSpace","computeGeomSpace","getCaptionSpace","captionDom","DEFAULT_PLACEHOLDERS","src_defaults_defineProperty","_DEFAULT_PLACEHOLDERS","resolveTitleSubTitleContent","rawContent","createHeading","prevCell","cellType","legendInitializer","legendConfig","prevLegends","legends","headerHeight","legendInfo","legendCreator","LegendCls","dataset","scaleProps","_scale$config","stepMapper","interactionRegistry","dataInfo","legendMeasures","titleText","legendIconShapeMapper","layerMarks","includes","getGroupByData","setLegendMeasures","MuzeComponent","_this$boundBox","HeaderComponent","headerComponent_classCallCheck","headerComponent_possibleConstructorReturn","headerComponent_getPrototypeOf","setParams","cont","renderHeader","LegendComponent","legendComponent_classCallCheck","legendComponent_possibleConstructorReturn","legendComponent_getPrototypeOf","legendSpace","sectionComponents","_this$params$config","legendMount","legWidth","legHeight","sections","currHeight","currWidth","leg","legendHeight","legendWidth","renderLegend","_defaultAlignmentHelp","defaultAlignmentHelper","setParentInfo","arrowSizeMap","getUnitPositions","totalLength","viewLength","currentLen","unitPosition","createScrollBarArrow","createScrollBarRect","mover","applyScrollMouseDownAction","moverRect","scrollMaker","_mover$node$getBoundi","_rect$node$getBoundin","rectX","rectY","changeMoverPosition","registerListenerOnArrow","arrowType","_components","isTouchDevice","applyMoverDrag","moverStartPos","rectStartPos","distanceMoved","actualPosition","pageXOffset","pageYOffset","applyRectClick","emptyScrollAreaClick","manager","unitPositions","ScrollMaker","scroll_maker_classCallCheck","_attachedScrollAction","_unitPositions","scroll_maker_createClass","scrollTo","scrollDeltaTo","createScroll","scrollBarContainer","scrollContainerHelper","attachScrollAction","externalScrollAction","detachScrollAction","scrollMakerMap","_ScrollMaker","HorizontalScrollMaker","horizontal_scroll_maker_classCallCheck","horizontal_scroll_maker_possibleConstructorReturn","horizontal_scroll_maker_getPrototypeOf","horizontal_scroll_maker_inherits","horizontal_scroll_maker_createClass","horizontal_scroll_maker_get","prevArrow","nextArrow","_this$logicalSpace","scrollBarWithouArrowLength","_scrollBarWithouArrowLength","_this$_components$mov","positionAdjuster","newPosition","currentPos","_this$_components$mov2","moverPos","movedViewLength","performAttachedScrollFunction","_this$_components$mov3","scrollPercentage","movement","VerticalScrollMaker","vertical_scroll_maker_classCallCheck","vertical_scroll_maker_possibleConstructorReturn","vertical_scroll_maker_getPrototypeOf","vertical_scroll_maker_inherits","vertical_scroll_maker_createClass","vertical_scroll_maker_get","ScrollComponent","scroll_component_classCallCheck","scrollBarComponentConfig","scroll_component_possibleConstructorReturn","scroll_component_getPrototypeOf","unitIndex","sanitizedUnitIndex","externalAction","MatrixComponent","matrix_component_classCallCheck","matrix_component_possibleConstructorReturn","matrix_component_getPrototypeOf","_this$params$config$s","containerForMatrix","applyScroll","_cellSpanMaker","cellSpanMaker","_matrixSpanGenerator","renderTable","applySpans","applier","renderPlaceholders","renderMatrix","applyScrollAction","scollDistance","GridComponent","grid_component_classCallCheck","grid_component_possibleConstructorReturn","grid_component_getPrototypeOf","_this$component$viewI","matrixDim","matrixName","_this$params$componen","updateWrapper","_this$params$componen2","matrixWrapper","allComponents","_scrollBarManager","scrollBarManager","wheelDeltaX","wheelDeltaY","preventBrowserScroll","triggerScrollBarAction","movedView","scrollActionApplier","_this$component$0$0$b","sanitizeGrid","attachScrollListener","MessageComponent","message_component_classCallCheck","message_component_possibleConstructorReturn","message_component_getPrototypeOf","childHeight","message","imageNode","messageNode","formatFontSize","_params$config","headerCell","configType","headerAlignmentMap","component_wrapper_maker_defineProperty","_headerAlignmentMap","isGridPresent","renderDetails","_renderDetails$compon","checkParamsValidation","createHeaderWrapper","headerType","layoutManager","_headerMap$headerType","headerConfig","wrapperParams","component_wrapper_maker_objectSpread","existingComponent","createScrollBarWrapper","scrollBarType","grid","_scrollBarMap$scrollB","scrollBarMap","layoutBasedMeasure","viewMeasure","rowAlign","colAlign","componentWrapperMaker","_layoutManager","createMessageWrapper","_i","_headerValues","defaultDimensions","canvasHeight","canvasWidth","gridComponent","getBoundBox","createLegendWrapper","legendWrapper","gridLayoutWrapper","verticalScrollBar","horizontalScrollBar","ScrollManager","scroll_manager_classCallCheck","_scrollBarComponents","_attachedComponents","scroll_manager_createClass","scrollBarComponents","attachedComponents","performScrollAction","getRenderDetails","_mount$getBoundingCli","heightAttr","widthAttr","visGroup","_visGroup$placeholder","legendPosition","layoutArrangement","arrangeComponents","_titleLayouts","titleLayouts","component_resolver_defineProperty","legendLayouts","titlePosition","subtitlePosition","availableHeightForCanvas","availableWidthForCanvas","_createHeaders","isSubtitle","headerOptions","_createHeading","createLegend","getLegendSpace","mountSpace","componentIndexes","componentNames","3","4","5","6","renderLayout","gridLayout","compWrappers","componentWrappers","createScrollManager","horizontalScrollWrapper","verticalScrollWrapper","gridWrapper","hScrollBar","vScrollBar","componentWrapper","deleteElementName","removeComponent","registerComponents","attachListeners","attachListener","addFacetDataAndMeasureNames","facetData","facetVals","canvas_firebolt_helper_defineProperty","hasMeasureNameField","canvas_firebolt_helper_toConsumableArray","measureNameArr","isDimension","isCrosstab","dispatchBehaviours","_firebolt$context$con2","behaviourConfs","unitFirebolt","targetFirebolt","propagationDataSource","getPropagationSource","defaultCrossInteractionPolicy","propagationCanvasAlias","GroupFireBolt","group_firebolt_classCallCheck","group_firebolt_possibleConstructorReturn","group_firebolt_getPrototypeOf","defaultInteractionPolicy","tooltipSideEffect","unitDimsMap","unitDims","group_firebolt_toConsumableArray","groupDataMap","facetMap","unitFieldsConfig","linkedRows","linkedRow","handleDataModelPropagation","attachBehaviours","crosstab","_this$context$config$","_ref$instance","findPlaceHolderById","addSelectedMeasuresInPayload","groupFields","_unit$fields","handlePhysicalAction","resetSelectAction","group_firebolt_get","auxConfig","propagateValues","sourceCanvasId","sideEfffects","propagationBehaviour","sourceBehaviour","propagationConf","propConf","behaviourInstance","APP_INITIAL_STATE","app","Canvas","globalDependencies","canvas_classCallCheck","canvas_possibleConstructorReturn","canvas_getPrototypeOf","canvas_defineProperty","canvas_assertThisInitialized","initedComponents","initCanvas","createGroupState","_VisualGroup$getState2","canvas_helper_slicedToArray","prepareLayout","triggerReflow","setLayoutInfForUnits","getRootNodeId","setComponentInfo","setLabelRotationForAxes","rotationVal","getAxes","initialSettings","regEntry","COMPONENTS","default_registry_defineProperty","_COMPONENTS","SUBREGISTRIES","utils","Smartlabel","globalCache","defaultRegistry","globalRegistry","overrideRegistryDefinitions","overrideRegistry","muze","_transactor2","muze_slicedToArray","env","globalStore","componentSubRegistryDef","settings","withSettings","Components","VisualLayer","unitHelpers","unitEnums","Encoders","encoderHelpers","groupUtils","groupEnums","SideEffects","standards","Behaviours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ACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,+BAESgW,cAAKK,aCALL,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,gBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,gBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,kBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCASgW,gBAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,eAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,iBAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,iBAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,cAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,g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,wCACAM,kDACAf,4BAIF2/E,YACFxmF,+CACAumF,WACI/kF,0CACAsC,mDACAb,+CAIRqiF,UAAK/oO,UAAYA,UACjB+oO,UAAKtzM,QAAUy0M,aAAIz0M,QACnBszM,UAAKgB,YAAcA,YACnBhB,UAAKpjC,YAAcA,YACnBojC,UAAK32F,aAAeA,kBACpB22F,UAAKl0M,UAAYs1M,0BACjBpB,UAAKkB,WAAaA,WAClBlB,UAAKP,MAAQA,+BACbO,UAAKv9L,OAAQ,IAAIm2D,YAAQl+E,MAAMoJ,YAEhBk8M","file":"muze.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"muze\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"muze\"] = factory();\n\telse\n\t\troot[\"muze\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 18);\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DataModel\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DataModel\"] = factory();\n\telse\n\t\troot[\"DataModel\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","const DataModel = require('./export');\n\nmodule.exports = DataModel.default ? DataModel.default : DataModel;\n","/**\n * DataFormat Enum defines the format of the input data.\n * Based on the format of the data the respective adapter is loaded.\n *\n * @readonly\n * @enum {string}\n */\nconst DataFormat = {\n FLAT_JSON: 'FlatJSON',\n DSV_STR: 'DSVStr',\n DSV_ARR: 'DSVArr',\n AUTO: 'Auto'\n};\n\nexport default DataFormat;\n","/**\n * DimensionSubtype enum defines the sub types of the Dimensional Field.\n *\n * @readonly\n * @enum {string}\n */\nconst DimensionSubtype = {\n CATEGORICAL: 'categorical',\n TEMPORAL: 'temporal',\n BINNED: 'binned'\n};\n\nexport default DimensionSubtype;\n","/**\n * MeasureSubtype enum defines the sub types of the Measure Field.\n *\n * @readonly\n * @enum {string}\n */\nconst MeasureSubtype = {\n CONTINUOUS: 'continuous'\n};\n\nexport default MeasureSubtype;\n","/**\n * FieldType enum defines the high level field based on which visuals are controlled.\n * Measure in a high level is numeric field and Dimension in a high level is string field.\n *\n * @readonly\n * @enum {string}\n */\nconst FieldType = {\n MEASURE: 'measure',\n DIMENSION: 'dimension'\n};\n\nexport default FieldType;\n","/**\n * Filtering mode enum defines the filering modes of DataModel.\n *\n * @readonly\n * @enum {string}\n */\nconst FilteringMode = {\n NORMAL: 'normal',\n INVERSE: 'inverse',\n ALL: 'all'\n};\n\nexport default FilteringMode;\n","/**\n * Group by function names\n *\n * @readonly\n * @enum {string}\n */\nconst GROUP_BY_FUNCTIONS = {\n SUM: 'sum',\n AVG: 'avg',\n MIN: 'min',\n MAX: 'max',\n FIRST: 'first',\n LAST: 'last',\n COUNT: 'count',\n STD: 'std'\n};\n\nexport default GROUP_BY_FUNCTIONS;\n","/**\n * Creates a JS native date object from input\n *\n * @param {string | number | Date} date Input using which date object to be created\n * @return {Date} : JS native date object\n */\nfunction convertToNativeDate (date) {\n if (date instanceof Date) {\n return date;\n }\n\n return new Date(date);\n}\n/**\n * Apply padding before a number if its less than 1o. This is used when constant digit's number to be returned\n * between 0 - 99\n *\n * @param {number} n Input to be padded\n * @return {string} Padded number\n */\nfunction pad (n) {\n return (n < 10) ? (`0${n}`) : n;\n}\n/*\n * DateFormatter utility to convert any date format to any other date format\n * DateFormatter parse a date time stamp specified by a user abiding by rules which are defined\n * by user in terms of token. It creates JS native date object from the user specified format.\n * That native date can also be displayed\n * in any specified format.\n * This utility class only takes care of format conversion only\n */\n\n/*\n * Escapes all the special character that are used in regular expression.\n * Like\n * RegExp.escape('sgfd-$') // Output: sgfd\\-\\$\n *\n * @param text {String} : text which is to be escaped\n */\nRegExp.escape = function (text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n};\n\n/**\n * DateTimeFormatter class to convert any user format of date time stamp to any other format\n * of date time stamp.\n *\n * @param {string} format Format of the date given. For the above date,\n * 'year: %Y, month: %b, day: %d'.\n * @class\n */\n/* istanbul ignore next */ function DateTimeFormatter (format) {\n this.format = format;\n this.dtParams = undefined;\n this.nativeDate = undefined;\n}\n\n// The identifier of the tokens\nDateTimeFormatter.TOKEN_PREFIX = '%';\n\n// JS native Date constructor takes the date params (year, month, etc) in a certail sequence.\n// This defines the sequence of the date parameters in the constructor.\nDateTimeFormatter.DATETIME_PARAM_SEQUENCE = {\n YEAR: 0,\n MONTH: 1,\n DAY: 2,\n HOUR: 3,\n MINUTE: 4,\n SECOND: 5,\n MILLISECOND: 6\n};\n\n/*\n * This is a default number parsing utility. It tries to parse a number in integer, if parsing is unsuccessful, it\n * gives back a default value.\n *\n * @param: defVal {Number} : Default no if the parsing to integer is not successful\n * @return {Function} : An closure function which is to be called by passing an the value which needs to be parsed.\n */\nDateTimeFormatter.defaultNumberParser = function (defVal) {\n return function (val) {\n let parsedVal;\n if (isFinite(parsedVal = parseInt(val, 10))) {\n return parsedVal;\n }\n\n return defVal;\n };\n};\n\n/*\n * This is a default number range utility. It tries to find an element in the range. If not found it returns a\n * default no as an index.\n *\n * @param: range {Array} : The list which is to be serached\n * @param: defVal {Number} : Default no if the serach and find does not return anything\n * @return {Function} : An closure function which is to be called by passing an the value which needs to be found\n */\nDateTimeFormatter.defaultRangeParser = function (range, defVal) {\n return (val) => {\n let i;\n let l;\n\n if (!val) { return defVal; }\n\n const nVal = val.toLowerCase();\n\n for (i = 0, l = range.length; i < l; i++) {\n if (range[i].toLowerCase() === nVal) {\n return i;\n }\n }\n\n if (i === undefined) {\n return defVal;\n }\n return null;\n };\n};\n\n/*\n * Defines the tokens which are supporter by the dateformatter. Using this definitation a value gets extracted from\n * the user specifed date string. This also formats the value for display purpose from native JS date.\n * The definition of each token contains the following named properties\n * {\n * %token_name% : {\n * name: name of the token, this is used in reverse lookup,\n * extract: a function that returns the regular expression to extract that piece of information. All the\n * regex should be gouped by using ()\n * parser: a function which receives value extracted by the above regex and parse it to get the date params\n * formatter: a formatter function that takes milliseconds or JS Date object and format the param\n * represented by the token only.\n * }\n * }\n *\n * @return {Object} : Definition of the all the supported tokens.\n */\nDateTimeFormatter.getTokenDefinitions = function () {\n const daysDef = {\n short: [\n 'Sun',\n 'Mon',\n 'Tue',\n 'Wed',\n 'Thu',\n 'Fri',\n 'Sat'\n ],\n long: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ]\n };\n const monthsDef = {\n short: [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ],\n long: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ]\n };\n\n const definitions = {\n H: {\n // 24 hours format\n name: 'H',\n index: 3,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n\n return d.getHours().toString();\n }\n },\n l: {\n // 12 hours format\n name: 'l',\n index: 3,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const hours = d.getHours() % 12;\n\n return (hours === 0 ? 12 : hours).toString();\n }\n },\n p: {\n // AM or PM\n name: 'p',\n index: 3,\n extract () { return '(AM|PM)'; },\n parser: (val) => {\n if (val) {\n return val.toLowerCase();\n }\n return null;\n },\n formatter: (val) => {\n const d = convertToNativeDate(val);\n const hours = d.getHours();\n\n return (hours < 12 ? 'AM' : 'PM');\n }\n },\n P: {\n // am or pm\n name: 'P',\n index: 3,\n extract () { return '(am|pm)'; },\n parser: (val) => {\n if (val) {\n return val.toLowerCase();\n }\n return null;\n },\n formatter: (val) => {\n const d = convertToNativeDate(val);\n const hours = d.getHours();\n\n return (hours < 12 ? 'am' : 'pm');\n }\n },\n M: {\n // Two digit minutes 00 - 59\n name: 'M',\n index: 4,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const mins = d.getMinutes();\n\n return pad(mins);\n }\n },\n S: {\n // Two digit seconds 00 - 59\n name: 'S',\n index: 5,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const seconds = d.getSeconds();\n\n return pad(seconds);\n }\n },\n K: {\n // Milliseconds\n name: 'K',\n index: 6,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const ms = d.getMilliseconds();\n\n return ms.toString();\n }\n },\n a: {\n // Short name of day, like Mon\n name: 'a',\n index: 2,\n extract () { return `(${daysDef.short.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(daysDef.short),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDay();\n\n return (daysDef.short[day]).toString();\n }\n },\n A: {\n // Long name of day, like Monday\n name: 'A',\n index: 2,\n extract () { return `(${daysDef.long.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(daysDef.long),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDay();\n\n return (daysDef.long[day]).toString();\n }\n },\n e: {\n // 8 of March, 11 of November\n name: 'e',\n index: 2,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDate();\n\n return day.toString();\n }\n },\n d: {\n // 08 of March, 11 of November\n name: 'd',\n index: 2,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDate();\n\n return pad(day);\n }\n },\n b: {\n // Short month, like Jan\n name: 'b',\n index: 1,\n extract () { return `(${monthsDef.short.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(monthsDef.short),\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return (monthsDef.short[month]).toString();\n }\n },\n B: {\n // Long month, like January\n name: 'B',\n index: 1,\n extract () { return `(${monthsDef.long.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(monthsDef.long),\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return (monthsDef.long[month]).toString();\n }\n },\n m: {\n // Two digit month of year like 01 for January\n name: 'm',\n index: 1,\n extract () { return '(\\\\d+)'; },\n parser (val) { return DateTimeFormatter.defaultNumberParser()(val) - 1; },\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return pad(month + 1);\n }\n },\n y: {\n // Short year like 90 for 1990\n name: 'y',\n index: 0,\n extract () { return '(\\\\d{2})'; },\n parser (val) {\n let result;\n if (val) {\n const l = val.length;\n val = val.substring(l - 2, l);\n }\n let parsedVal = DateTimeFormatter.defaultNumberParser()(val);\n let presentDate = new Date();\n let presentYear = Math.trunc((presentDate.getFullYear()) / 100);\n\n result = `${presentYear}${parsedVal}`;\n\n if (convertToNativeDate(result).getFullYear() > presentDate.getFullYear()) {\n result = `${presentYear - 1}${parsedVal}`;\n }\n return convertToNativeDate(result).getFullYear();\n },\n formatter (val) {\n const d = convertToNativeDate(val);\n let year = d.getFullYear().toString();\n let l;\n\n if (year) {\n l = year.length;\n year = year.substring(l - 2, l);\n }\n\n return year;\n }\n },\n Y: {\n // Long year like 1990\n name: 'Y',\n index: 0,\n extract () { return '(\\\\d{4})'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const year = d.getFullYear().toString();\n\n return year;\n }\n }\n };\n\n return definitions;\n};\n\n/*\n * The tokens which works internally is not user friendly in terms of memorizing the names. This gives a formal\n * definition to the informal notations.\n *\n * @return {Object} : Formal definition of the tokens\n */\nDateTimeFormatter.getTokenFormalNames = function () {\n const definitions = DateTimeFormatter.getTokenDefinitions();\n\n return {\n HOUR: definitions.H,\n HOUR_12: definitions.l,\n AMPM_UPPERCASE: definitions.p,\n AMPM_LOWERCASE: definitions.P,\n MINUTE: definitions.M,\n SECOND: definitions.S,\n SHORT_DAY: definitions.a,\n LONG_DAY: definitions.A,\n DAY_OF_MONTH: definitions.e,\n DAY_OF_MONTH_CONSTANT_WIDTH: definitions.d,\n SHORT_MONTH: definitions.b,\n LONG_MONTH: definitions.B,\n MONTH_OF_YEAR: definitions.m,\n SHORT_YEAR: definitions.y,\n LONG_YEAR: definitions.Y\n };\n};\n\n/*\n * This defines the rules and declares dependencies that resolves a date parameter (year, month etc) from\n * the date time parameter array.\n *\n * @return {Object} : An object that contains dependencies and a resolver function. The dependencies values are fed\n * to the resolver function in that particular sequence only.\n */\nDateTimeFormatter.tokenResolver = function () {\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const defaultResolver = (...args) => { // eslint-disable-line require-jsdoc\n let i = 0;\n let arg;\n let targetParam;\n const l = args.length;\n\n for (; i < l; i++) {\n arg = args[i];\n if (args[i]) {\n targetParam = arg;\n }\n }\n\n if (!targetParam) { return null; }\n\n return targetParam[0].parser(targetParam[1]);\n };\n\n return {\n YEAR: [definitions.y, definitions.Y,\n defaultResolver\n ],\n MONTH: [definitions.b, definitions.B, definitions.m,\n defaultResolver\n ],\n DAY: [definitions.a, definitions.A, definitions.e, definitions.d,\n defaultResolver\n ],\n HOUR: [definitions.H, definitions.l, definitions.p, definitions.P,\n function (hourFormat24, hourFormat12, ampmLower, ampmUpper) {\n let targetParam;\n let amOrpm;\n let isPM;\n let val;\n\n if (hourFormat12 && (amOrpm = (ampmLower || ampmUpper))) {\n if (amOrpm[0].parser(amOrpm[1]) === 'pm') {\n isPM = true;\n }\n\n targetParam = hourFormat12;\n } else if (hourFormat12) {\n targetParam = hourFormat12;\n } else {\n targetParam = hourFormat24;\n }\n\n if (!targetParam) { return null; }\n\n val = targetParam[0].parser(targetParam[1]);\n if (isPM) {\n val += 12;\n }\n return val;\n }\n ],\n MINUTE: [definitions.M,\n defaultResolver\n ],\n SECOND: [definitions.S,\n defaultResolver\n ]\n };\n};\n\n/*\n * Finds token from the format rule specified by a user.\n * @param format {String} : The format of the input date specified by the user\n * @return {Array} : An array of objects which contains the available token and their occurence index in the format\n */\nDateTimeFormatter.findTokens = function (format) {\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const tokenLiterals = Object.keys(definitions);\n const occurrence = [];\n let i;\n let forwardChar;\n\n while ((i = format.indexOf(tokenPrefix, i + 1)) >= 0) {\n forwardChar = format[i + 1];\n if (tokenLiterals.indexOf(forwardChar) === -1) { continue; }\n\n occurrence.push({\n index: i,\n token: forwardChar\n });\n }\n\n return occurrence;\n};\n\n/*\n * Format any JS date to a specified date given by user.\n *\n * @param date {Number | Date} : The date object which is to be formatted\n * @param format {String} : The format using which the date will be formatted for display\n */\nDateTimeFormatter.formatAs = function (date, format) {\n const nDate = convertToNativeDate(date);\n const occurrence = DateTimeFormatter.findTokens(format);\n const definitions = DateTimeFormatter.getTokenDefinitions();\n let formattedStr = String(format);\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n let token;\n let formattedVal;\n let i;\n let l;\n\n for (i = 0, l = occurrence.length; i < l; i++) {\n token = occurrence[i].token;\n formattedVal = definitions[token].formatter(nDate);\n formattedStr = formattedStr.replace(new RegExp(tokenPrefix + token, 'g'), formattedVal);\n }\n\n return formattedStr;\n};\n\n/*\n * Parses the user specified date string to extract the date time params.\n *\n * @return {Array} : Value of date time params in an array [year, month, day, hour, minutes, seconds, milli]\n */\nDateTimeFormatter.prototype.parse = function (dateTimeStamp, options) {\n const tokenResolver = DateTimeFormatter.tokenResolver();\n const dtParams = this.extractTokenValue(dateTimeStamp);\n const dtParamSeq = DateTimeFormatter.DATETIME_PARAM_SEQUENCE;\n const noBreak = options && options.noBreak;\n const dtParamArr = [];\n const args = [];\n let resolverKey;\n let resolverParams;\n let resolverFn;\n let val;\n let i;\n let param;\n let resolvedVal;\n let l;\n let result = [];\n\n for (resolverKey in tokenResolver) {\n if (!{}.hasOwnProperty.call(tokenResolver, resolverKey)) { continue; }\n\n args.length = 0;\n resolverParams = tokenResolver[resolverKey];\n resolverFn = resolverParams.splice(resolverParams.length - 1, 1)[0];\n\n for (i = 0, l = resolverParams.length; i < l; i++) {\n param = resolverParams[i];\n val = dtParams[param.name];\n\n if (val === undefined) {\n args.push(null);\n } else {\n args.push([param, val]);\n }\n }\n\n resolvedVal = resolverFn.apply(this, args);\n\n if ((resolvedVal === undefined || resolvedVal === null) && !noBreak) {\n break;\n }\n\n dtParamArr[dtParamSeq[resolverKey]] = resolvedVal;\n }\n\n if (dtParamArr.length && this.checkIfOnlyYear(dtParamArr.length))\n {\n result.unshift(dtParamArr[0], 0, 1); }\n else {\n result.unshift(...dtParamArr);\n }\n\n return result;\n};\n\n/*\n * Extract the value of the token from user specified date time string.\n *\n * @return {Object} : An key value pair which contains the tokens as key and value as pair\n */\nDateTimeFormatter.prototype.extractTokenValue = function (dateTimeStamp) {\n const format = this.format;\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n const occurrence = DateTimeFormatter.findTokens(format);\n const tokenObj = {};\n\n let lastOccurrenceIndex;\n let occObj;\n let occIndex;\n let targetText;\n let regexFormat;\n\n let l;\n let i;\n\n regexFormat = String(format);\n\n const tokenArr = occurrence.map(obj => obj.token);\n const occurrenceLength = occurrence.length;\n for (i = occurrenceLength - 1; i >= 0; i--) {\n occIndex = occurrence[i].index;\n\n if (occIndex + 1 === regexFormat.length - 1) {\n lastOccurrenceIndex = occIndex;\n continue;\n }\n\n if (lastOccurrenceIndex === undefined) {\n lastOccurrenceIndex = regexFormat.length;\n }\n\n targetText = regexFormat.substring(occIndex + 2, lastOccurrenceIndex);\n regexFormat = regexFormat.substring(0, occIndex + 2) +\n RegExp.escape(targetText) +\n regexFormat.substring(lastOccurrenceIndex, regexFormat.length);\n\n lastOccurrenceIndex = occIndex;\n }\n\n for (i = 0; i < occurrenceLength; i++) {\n occObj = occurrence[i];\n regexFormat = regexFormat.replace(tokenPrefix + occObj.token, definitions[occObj.token].extract());\n }\n\n const extractValues = dateTimeStamp.match(new RegExp(regexFormat)) || [];\n extractValues.shift();\n\n for (i = 0, l = tokenArr.length; i < l; i++) {\n tokenObj[tokenArr[i]] = extractValues[i];\n }\n return tokenObj;\n};\n\n/*\n * Give back the JS native date formed from user specified date string\n *\n * @return {Date} : Native JS Date\n */\nDateTimeFormatter.prototype.getNativeDate = function (dateTimeStamp) {\n let date = null;\n if (Number.isFinite(dateTimeStamp)) {\n date = new Date(dateTimeStamp);\n } else if (!this.format && Date.parse(dateTimeStamp)) {\n date = new Date(dateTimeStamp);\n }\n else {\n const dtParams = this.dtParams = this.parse(dateTimeStamp);\n if (dtParams.length) {\n this.nativeDate = new Date(...dtParams);\n date = this.nativeDate;\n }\n }\n return date;\n};\n\nDateTimeFormatter.prototype.checkIfOnlyYear = function(len) {\n return len === 1 && this.format.match(/y|Y/g).length;\n};\n\n/*\n * Represents JS native date to a user specified format.\n *\n * @param format {String} : The format according to which the date is to be represented\n * @return {String} : The formatted date string\n */\nDateTimeFormatter.prototype.formatAs = function (format, dateTimeStamp) {\n let nativeDate;\n\n if (dateTimeStamp) {\n nativeDate = this.nativeDate = this.getNativeDate(dateTimeStamp);\n } else if (!(nativeDate = this.nativeDate)) {\n nativeDate = this.getNativeDate(dateTimeStamp);\n }\n\n return DateTimeFormatter.formatAs(nativeDate, format);\n};\n\nexport { DateTimeFormatter as default };\n","/**\n * The utility function to calculate major column.\n *\n * @param {Object} store - The store object.\n * @return {Function} Returns the push function.\n */\nexport default (store) => {\n let i = 0;\n return (...fields) => {\n fields.forEach((val, fieldIndex) => {\n if (!(store[fieldIndex] instanceof Array)) {\n store[fieldIndex] = Array.from({ length: i });\n }\n store[fieldIndex].push(val);\n });\n i++;\n };\n};\n","/* eslint-disable */\nconst OBJECTSTRING = 'object';\nconst objectToStrFn = Object.prototype.toString;\nconst objectToStr = '[object Object]';\nconst arrayToStr = '[object Array]';\n\nfunction checkCyclicRef(obj, parentArr) {\n let i = parentArr.length;\n let bIndex = -1;\n\n while (i) {\n if (obj === parentArr[i]) {\n bIndex = i;\n return bIndex;\n }\n i -= 1;\n }\n\n return bIndex;\n}\n\nfunction merge(obj1, obj2, skipUndef, tgtArr, srcArr) {\n var item,\n srcVal,\n tgtVal,\n str,\n cRef;\n // check whether obj2 is an array\n // if array then iterate through it's index\n // **** MOOTOOLS precution\n\n if (!srcArr) {\n tgtArr = [obj1];\n srcArr = [obj2];\n }\n else {\n tgtArr.push(obj1);\n srcArr.push(obj2);\n }\n\n if (obj2 instanceof Array) {\n for (item = 0; item < obj2.length; item += 1) {\n try {\n srcVal = obj1[item];\n tgtVal = obj2[item];\n }\n catch (e) {\n continue;\n }\n\n if (typeof tgtVal !== OBJECTSTRING) {\n if (!(skipUndef && tgtVal === undefined)) {\n obj1[item] = tgtVal;\n }\n }\n else {\n if (srcVal === null || typeof srcVal !== OBJECTSTRING) {\n srcVal = obj1[item] = tgtVal instanceof Array ? [] : {};\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n }\n }\n else {\n for (item in obj2) {\n try {\n srcVal = obj1[item];\n tgtVal = obj2[item];\n }\n catch (e) {\n continue;\n }\n\n if (tgtVal !== null && typeof tgtVal === OBJECTSTRING) {\n // Fix for issue BUG: FWXT-602\n // IE < 9 Object.prototype.toString.call(null) gives\n // '[object Object]' instead of '[object Null]'\n // that's why null value becomes Object in IE < 9\n str = objectToStrFn.call(tgtVal);\n if (str === objectToStr) {\n if (srcVal === null || typeof srcVal !== OBJECTSTRING) {\n srcVal = obj1[item] = {};\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n else if (str === arrayToStr) {\n if (srcVal === null || !(srcVal instanceof Array)) {\n srcVal = obj1[item] = [];\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n else {\n obj1[item] = tgtVal;\n }\n }\n else {\n if (skipUndef && tgtVal === undefined) {\n continue;\n }\n obj1[item] = tgtVal;\n }\n }\n }\n return obj1;\n}\n\n\nfunction extend2 (obj1, obj2, skipUndef) {\n //if none of the arguments are object then return back\n if (typeof obj1 !== OBJECTSTRING && typeof obj2 !== OBJECTSTRING) {\n return null;\n }\n\n if (typeof obj2 !== OBJECTSTRING || obj2 === null) {\n return obj1;\n }\n\n if (typeof obj1 !== OBJECTSTRING) {\n obj1 = obj2 instanceof Array ? [] : {};\n }\n merge(obj1, obj2, skipUndef);\n return obj1;\n}\n\nexport { extend2 as default };\n","import { DataFormat } from '../enums';\n\n/**\n * Checks whether the value is an array.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is an array otherwise returns false.\n */\nexport function isArray (val) {\n return Array.isArray(val);\n}\n\n/**\n * Checks whether the value is an object.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is an object otherwise returns false.\n */\nexport function isObject (val) {\n return val === Object(val);\n}\n\n/**\n * Checks whether the value is a string value.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is a string value otherwise returns false.\n */\nexport function isString (val) {\n return typeof val === 'string';\n}\n\n/**\n * Checks whether the value is callable.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is callable otherwise returns false.\n */\nexport function isCallable (val) {\n return typeof val === 'function';\n}\n\n/**\n * Returns the unique values from the input array.\n *\n * @param {Array} data - The input array.\n * @return {Array} Returns a new array of unique values.\n */\nexport function uniqueValues (data) {\n return [...new Set(data)];\n}\n\nexport const getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Checks Whether two arrays have same content.\n *\n * @param {Array} arr1 - The first array.\n * @param {Array} arr2 - The 2nd array.\n * @return {boolean} Returns whether two array have same content.\n */\nexport function isArrEqual(arr1, arr2) {\n if (!isArray(arr1) || !isArray(arr2)) {\n return arr1 === arr2;\n }\n\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * It is the default number format function for the measure field type.\n *\n * @param {any} val - The input value.\n * @return {number} Returns a number value.\n */\nexport function formatNumber(val) {\n return val;\n}\n\n/**\n * Returns the detected data format.\n *\n * @param {any} data - The input data to be tested.\n * @return {string} Returns the data format name.\n */\nexport const detectDataFormat = (data) => {\n if (isString(data)) {\n return DataFormat.DSV_STR;\n } else if (isArray(data) && isArray(data[0])) {\n return DataFormat.DSV_ARR;\n } else if (isArray(data) && (data.length === 0 || isObject(data[0]))) {\n return DataFormat.FLAT_JSON;\n }\n return null;\n};\n","import { FieldType } from './enums';\nimport { getUniqueId } from './utils';\n\nconst fieldStore = {\n data: {},\n\n createNamespace (fieldArr, name) {\n const dataId = name || getUniqueId();\n\n this.data[dataId] = {\n name: dataId,\n fields: fieldArr,\n\n fieldsObj () {\n let fieldsObj = this._cachedFieldsObj;\n\n if (!fieldsObj) {\n fieldsObj = this._cachedFieldsObj = {};\n this.fields.forEach((field) => {\n fieldsObj[field.name()] = field;\n });\n }\n return fieldsObj;\n },\n getMeasure () {\n let measureFields = this._cachedMeasure;\n\n if (!measureFields) {\n measureFields = this._cachedMeasure = {};\n this.fields.forEach((field) => {\n if (field.schema().type === FieldType.MEASURE) {\n measureFields[field.name()] = field;\n }\n });\n }\n return measureFields;\n },\n getDimension () {\n let dimensionFields = this._cachedDimension;\n\n if (!this._cachedDimension) {\n dimensionFields = this._cachedDimension = {};\n this.fields.forEach((field) => {\n if (field.schema().type === FieldType.DIMENSION) {\n dimensionFields[field.name()] = field;\n }\n });\n }\n return dimensionFields;\n },\n };\n return this.data[dataId];\n },\n};\n\nexport default fieldStore;\n","import { getNumberFormattedVal } from './helper';\n\n/**\n * The wrapper class on top of the primitive value of a field.\n *\n * @todo Need to have support for StringValue, NumberValue, DateTimeValue\n * and GeoValue. These types should expose predicate API mostly.\n */\nclass Value {\n\n /**\n * Creates new Value instance.\n *\n * @param {*} val - the primitive value from the field cell.\n * @param {string | Field} field - The field from which the value belongs.\n */\n constructor (value, rawValue, field) {\n const formattedValue = getNumberFormattedVal(field, value);\n\n Object.defineProperties(this, {\n _value: {\n enumerable: false,\n configurable: false,\n writable: false,\n value\n },\n _formattedValue: {\n enumerable: false,\n configurable: false,\n writable: false,\n value: formattedValue\n },\n _internalValue: {\n enumerable: false,\n configurable: false,\n writable: false,\n value: rawValue\n }\n });\n\n this.field = field;\n }\n\n /**\n * Returns the field value.\n *\n * @return {*} Returns the current value.\n */\n get value () {\n return this._value;\n }\n\n /**\n * Returns the parsed value of field\n */\n get formattedValue () {\n return this._formattedValue;\n }\n\n /**\n * Returns the internal value of field\n */\n get internalValue () {\n return this._internalValue;\n }\n\n /**\n * Converts to human readable string.\n *\n * @override\n * @return {string} Returns a human readable string of the field value.\n *\n */\n toString () {\n return String(this.value);\n }\n\n /**\n * Returns the value of the field.\n *\n * @override\n * @return {*} Returns the field value.\n */\n valueOf () {\n return this.value;\n }\n}\n\nexport default Value;\n","/**\n * Iterates through the diffSet array and call the callback with the current\n * index.\n *\n * @param {string} rowDiffset - The row diffset string e.g. '0-4,6,10-13'.\n * @param {Function} callback - The callback function to be called with every index.\n */\nexport function rowDiffsetIterator (rowDiffset, callback) {\n if (rowDiffset.length > 0) {\n const rowDiffArr = rowDiffset.split(',');\n rowDiffArr.forEach((diffStr) => {\n const diffStsArr = diffStr.split('-');\n const start = +(diffStsArr[0]);\n const end = +(diffStsArr[1] || diffStsArr[0]);\n if (end >= start) {\n for (let i = start; i <= end; i += 1) {\n callback(i);\n }\n }\n });\n }\n}\n","/**\n * A parser to parser null, undefined, invalid and NIL values.\n *\n * @public\n * @class\n */\nclass InvalidAwareTypes {\n /**\n * Static method which gets/sets the invalid value registry.\n *\n * @public\n * @param {Object} config - The custom configuration supplied by user.\n * @return {Object} Returns the invalid values registry.\n */\n static invalidAwareVals (config) {\n if (!config) {\n return InvalidAwareTypes._invalidAwareValsMap;\n }\n return Object.assign(InvalidAwareTypes._invalidAwareValsMap, config);\n }\n\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {string} value - The value of the invalid data type.\n */\n constructor (value) {\n this._value = value;\n }\n\n /**\n * Returns the current value of the instance.\n *\n * @public\n * @return {string} Returns the value of the invalid data type.\n */\n value () {\n return this._value;\n }\n\n /**\n * Returns the current value of the instance in string format.\n *\n * @public\n * @return {string} Returns the value of the invalid data type.\n */\n toString () {\n return String(this._value);\n }\n\n static isInvalid(val) {\n return (val instanceof InvalidAwareTypes) || !!InvalidAwareTypes.invalidAwareVals()[val];\n }\n\n static getInvalidType(val) {\n return val instanceof InvalidAwareTypes ? val : InvalidAwareTypes.invalidAwareVals()[val];\n }\n}\n\n/**\n * Enums for Invalid types.\n */\nInvalidAwareTypes.NULL = new InvalidAwareTypes('null');\nInvalidAwareTypes.NA = new InvalidAwareTypes('na');\nInvalidAwareTypes.NIL = new InvalidAwareTypes('nil');\n\n/**\n * Default Registry for mapping the invalid values.\n *\n * @private\n */\nInvalidAwareTypes._invalidAwareValsMap = {\n invalid: InvalidAwareTypes.NA,\n nil: InvalidAwareTypes.NIL,\n null: InvalidAwareTypes.NULL,\n undefined: InvalidAwareTypes.NA\n};\n\nexport default InvalidAwareTypes;\n","export { DataFormat, FilteringMode } from '../enums';\n/**\n * The event name for data propagation.\n */\nexport const PROPAGATION = 'propagation';\n\n/**\n * The name of the unique row id column in DataModel.\n */\nexport const ROW_ID = '__id__';\n\n/**\n * The enums for operation names performed on DataModel.\n */\nexport const DM_DERIVATIVES = {\n SELECT: 'select',\n PROJECT: 'project',\n GROUPBY: 'group',\n COMPOSE: 'compose',\n CAL_VAR: 'calculatedVariable',\n BIN: 'bin',\n SORT: 'sort'\n};\n\nexport const JOINS = {\n CROSS: 'cross',\n LEFTOUTER: 'leftOuter',\n RIGHTOUTER: 'rightOuter',\n NATURAL: 'natural',\n FULLOUTER: 'fullOuter'\n};\n\nexport const LOGICAL_OPERATORS = {\n AND: 'and',\n OR: 'or'\n};\n","/**\n * The helper function that returns an array of common schema\n * from two fieldStore instances.\n *\n * @param {FieldStore} fs1 - The first FieldStore instance.\n * @param {FieldStore} fs2 - The second FieldStore instance.\n * @return {Array} An array containing the common schema.\n */\nexport function getCommonSchema (fs1, fs2) {\n const retArr = [];\n const fs1Arr = [];\n fs1.fields.forEach((field) => {\n fs1Arr.push(field.schema().name);\n });\n fs2.fields.forEach((field) => {\n if (fs1Arr.indexOf(field.schema().name) !== -1) {\n retArr.push(field.schema().name);\n }\n });\n return retArr;\n}\n","import DataModel from '../datamodel';\nimport { extend2 } from '../utils';\nimport { getCommonSchema } from './get-common-schema';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { JOINS } from '../constants';\nimport { prepareJoinData } from '../helper';\n/**\n * Default filter function for crossProduct.\n *\n * @return {boolean} Always returns true.\n */\nfunction defaultFilterFn() { return true; }\n\n/**\n * Implementation of cross product operation between two DataModel instances.\n * It internally creates the data and schema for the new DataModel.\n *\n * @param {DataModel} dataModel1 - The left DataModel instance.\n * @param {DataModel} dataModel2 - The right DataModel instance.\n * @param {Function} filterFn - The filter function which is used to filter the tuples.\n * @param {boolean} [replaceCommonSchema=false] - The flag if the common name schema should be there.\n * @return {DataModel} Returns The newly created DataModel instance from the crossProduct operation.\n */\nexport function crossProduct (dm1, dm2, filterFn, replaceCommonSchema = false, jointype = JOINS.CROSS) {\n const schema = [];\n const data = [];\n const applicableFilterFn = filterFn || defaultFilterFn;\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreName = dm1FieldStore.name;\n const dm2FieldStoreName = dm2FieldStore.name;\n const name = `${dm1FieldStore.name}.${dm2FieldStore.name}`;\n const commonSchemaList = getCommonSchema(dm1FieldStore, dm2FieldStore);\n\n if (dm1FieldStoreName === dm2FieldStoreName) {\n throw new Error('DataModels must have different alias names');\n }\n // Here prepare the schema\n dm1FieldStore.fields.forEach((field) => {\n const tmpSchema = extend2({}, field.schema());\n if (commonSchemaList.indexOf(tmpSchema.name) !== -1 && !replaceCommonSchema) {\n tmpSchema.name = `${dm1FieldStore.name}.${tmpSchema.name}`;\n }\n schema.push(tmpSchema);\n });\n dm2FieldStore.fields.forEach((field) => {\n const tmpSchema = extend2({}, field.schema());\n if (commonSchemaList.indexOf(tmpSchema.name) !== -1) {\n if (!replaceCommonSchema) {\n tmpSchema.name = `${dm2FieldStore.name}.${tmpSchema.name}`;\n schema.push(tmpSchema);\n }\n } else {\n schema.push(tmpSchema);\n }\n });\n\n // Here prepare Data\n rowDiffsetIterator(dm1._rowDiffset, (i) => {\n let rowAdded = false;\n let rowPosition;\n rowDiffsetIterator(dm2._rowDiffset, (ii) => {\n const tuple = [];\n const userArg = {};\n userArg[dm1FieldStoreName] = {};\n userArg[dm2FieldStoreName] = {};\n dm1FieldStore.fields.forEach((field) => {\n tuple.push(field.partialField.data[i]);\n userArg[dm1FieldStoreName][field.name()] = {\n rawValue: field.partialField.data[i],\n formattedValue: field.formattedData()[i],\n };\n });\n dm2FieldStore.fields.forEach((field) => {\n if (!(commonSchemaList.indexOf(field.schema().name) !== -1 && replaceCommonSchema)) {\n tuple.push(field.partialField.data[ii]);\n }\n userArg[dm2FieldStoreName][field.name()] = {\n rawValue: field.partialField.data[ii],\n formattedValue: field.formattedData()[ii],\n };\n });\n\n let cachedStore = {};\n let cloneProvider1 = () => dm1.detachedRoot();\n let cloneProvider2 = () => dm2.detachedRoot();\n\n const dm1Fields = prepareJoinData(userArg[dm1FieldStoreName]);\n const dm2Fields = prepareJoinData(userArg[dm2FieldStoreName]);\n if (applicableFilterFn(dm1Fields, dm2Fields, cloneProvider1, cloneProvider2, cachedStore)) {\n const tupleObj = {};\n tuple.forEach((cellVal, iii) => {\n tupleObj[schema[iii].name] = cellVal;\n });\n if (rowAdded && JOINS.CROSS !== jointype) {\n data[rowPosition] = tupleObj;\n }\n else {\n data.push(tupleObj);\n rowAdded = true;\n rowPosition = i;\n }\n } else if ((jointype === JOINS.LEFTOUTER || jointype === JOINS.RIGHTOUTER) && !rowAdded) {\n const tupleObj = {};\n let len = dm1FieldStore.fields.length - 1;\n tuple.forEach((cellVal, iii) => {\n if (iii <= len) {\n tupleObj[schema[iii].name] = cellVal;\n }\n else {\n tupleObj[schema[iii].name] = null;\n }\n });\n rowAdded = true;\n rowPosition = i;\n data.push(tupleObj);\n }\n });\n });\n\n return new DataModel(data, schema, { name });\n}\n","/**\n * The default sort function.\n *\n * @param {*} a - The first value.\n * @param {*} b - The second value.\n * @return {number} Returns the comparison result e.g. 1 or 0 or -1.\n */\nfunction defSortFn (a, b) {\n const a1 = `${a}`;\n const b1 = `${b}`;\n if (a1 < b1) {\n return -1;\n }\n if (a1 > b1) {\n return 1;\n }\n return 0;\n}\n\n/**\n * The helper function for merge sort which creates the sorted array\n * from the two halves of the input array.\n *\n * @param {Array} arr - The target array which needs to be merged.\n * @param {number} lo - The starting index of the first array half.\n * @param {number} mid - The ending index of the first array half.\n * @param {number} hi - The ending index of the second array half.\n * @param {Function} sortFn - The sort function.\n */\nfunction merge (arr, lo, mid, hi, sortFn) {\n const mainArr = arr;\n const auxArr = [];\n for (let i = lo; i <= hi; i += 1) {\n auxArr[i] = mainArr[i];\n }\n let a = lo;\n let b = mid + 1;\n\n for (let i = lo; i <= hi; i += 1) {\n if (a > mid) {\n mainArr[i] = auxArr[b];\n b += 1;\n } else if (b > hi) {\n mainArr[i] = auxArr[a];\n a += 1;\n } else if (sortFn(auxArr[a], auxArr[b]) <= 0) {\n mainArr[i] = auxArr[a];\n a += 1;\n } else {\n mainArr[i] = auxArr[b];\n b += 1;\n }\n }\n}\n\n/**\n * The helper function for merge sort which would be called\n * recursively for sorting the array halves.\n *\n * @param {Array} arr - The target array which needs to be sorted.\n * @param {number} lo - The starting index of the array half.\n * @param {number} hi - The ending index of the array half.\n * @param {Function} sortFn - The sort function.\n * @return {Array} Returns the target array itself.\n */\nfunction sort (arr, lo, hi, sortFn) {\n if (hi === lo) { return arr; }\n\n const mid = lo + Math.floor((hi - lo) / 2);\n sort(arr, lo, mid, sortFn);\n sort(arr, mid + 1, hi, sortFn);\n merge(arr, lo, mid, hi, sortFn);\n\n return arr;\n}\n\n/**\n * The implementation of merge sort.\n * It is used in DataModel for stable sorting as it is not sure\n * what the sorting algorithm used by browsers is stable or not.\n *\n * @param {Array} arr - The target array which needs to be sorted.\n * @param {Function} [sortFn=defSortFn] - The sort function.\n * @return {Array} Returns the input array itself in sorted order.\n */\nexport function mergeSort (arr, sortFn = defSortFn) {\n if (arr.length > 1) {\n sort(arr, 0, arr.length - 1, sortFn);\n }\n return arr;\n}\n","import { DimensionSubtype, MeasureSubtype } from '../enums';\nimport { mergeSort } from './merge-sort';\nimport { fieldInSchema } from '../helper';\nimport { isCallable, isArray } from '../utils';\n\n/**\n * Generates the sorting functions to sort the data of a DataModel instance\n * according to the input data type.\n *\n * @param {string} dataType - The data type e.g. 'measure', 'datetime' etc.\n * @param {string} sortType - The sorting order i.e. 'asc' or 'desc'.\n * @return {Function} Returns the the sorting function.\n */\nfunction getSortFn (dataType, sortType) {\n let retFunc;\n\n switch (dataType) {\n case MeasureSubtype.CONTINUOUS:\n case DimensionSubtype.TEMPORAL:\n if (sortType === 'asc') {\n retFunc = (a, b) => a - b;\n } else {\n retFunc = (a, b) => b - a;\n }\n break;\n default:\n if (sortType === 'asc') {\n retFunc = (a, b) => {\n a = `${a}`;\n b = `${b}`;\n if (a === b) {\n return 0;\n }\n return a > b ? 1 : -1;\n };\n } else {\n retFunc = (a, b) => {\n a = `${a}`;\n b = `${b}`;\n if (a === b) {\n return 0;\n }\n return a > b ? -1 : 1;\n };\n }\n }\n\n return retFunc;\n}\n\n/**\n * Resolves the actual sorting function based on sorting string value.\n *\n * @param {Object} fDetails - The target field info.\n * @param {string} strSortOrder - The sort order value.\n * @return {Function} Returns the sorting function.\n */\nfunction resolveStrSortOrder (fDetails, strSortOrder) {\n const sortOrder = String(strSortOrder).toLowerCase() === 'desc' ? 'desc' : 'asc';\n return getSortFn(fDetails.type, sortOrder);\n}\n\n/**\n * Groups the data according to the specified target field.\n *\n * @param {Array} data - The input data array.\n * @param {number} fieldIndex - The target field index within schema array.\n * @return {Array} Returns an array containing the grouped data.\n */\nfunction groupData (data, fieldIndex) {\n const hashMap = new Map();\n const groupedData = [];\n\n data.forEach((datum) => {\n const fieldVal = datum[fieldIndex];\n if (hashMap.has(fieldVal)) {\n groupedData[hashMap.get(fieldVal)][1].push(datum);\n } else {\n groupedData.push([fieldVal, [datum]]);\n hashMap.set(fieldVal, groupedData.length - 1);\n }\n });\n\n return groupedData;\n}\n\n/**\n * Creates the argument value used for sorting function when sort is done\n * with another fields.\n *\n * @param {Array} groupedDatum - The grouped datum for a single dimension field value.\n * @param {Array} targetFields - An array of the sorting fields.\n * @param {Array} targetFieldDetails - An array of the sorting field details in schema.\n * @return {Object} Returns an object containing the value of sorting fields and the target field name.\n */\nfunction createSortingFnArg (groupedDatum, targetFields, targetFieldDetails) {\n const arg = {\n label: groupedDatum[0]\n };\n\n targetFields.reduce((acc, next, idx) => {\n acc[next] = groupedDatum[1].map(datum => datum[targetFieldDetails[idx].index]);\n return acc;\n }, arg);\n\n return arg;\n}\n\n/**\n * Sorts the data by applying the standard sorting mechanism.\n *\n * @param {Array} data - The input data array.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n */\nfunction applyStandardSort (data, schema, sortingDetails) {\n let fieldName;\n let sortMeta;\n let fDetails;\n let i = sortingDetails.length - 1;\n\n for (; i >= 0; i--) {\n fieldName = sortingDetails[i][0];\n sortMeta = sortingDetails[i][1];\n fDetails = fieldInSchema(schema, fieldName);\n\n if (!fDetails) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (isCallable(sortMeta)) {\n // eslint-disable-next-line no-loop-func\n mergeSort(data, (a, b) => sortMeta(a[fDetails.index], b[fDetails.index]));\n } else if (isArray(sortMeta)) {\n const groupedData = groupData(data, fDetails.index);\n const sortingFn = sortMeta[sortMeta.length - 1];\n const targetFields = sortMeta.slice(0, sortMeta.length - 1);\n const targetFieldDetails = targetFields.map(f => fieldInSchema(schema, f));\n\n groupedData.forEach((groupedDatum) => {\n groupedDatum.push(createSortingFnArg(groupedDatum, targetFields, targetFieldDetails));\n });\n\n mergeSort(groupedData, (a, b) => {\n const m = a[2];\n const n = b[2];\n return sortingFn(m, n);\n });\n\n // Empty the array\n data.length = 0;\n groupedData.forEach((datum) => {\n data.push(...datum[1]);\n });\n } else {\n const sortFn = resolveStrSortOrder(fDetails, sortMeta);\n // eslint-disable-next-line no-loop-func\n mergeSort(data, (a, b) => sortFn(a[fDetails.index], b[fDetails.index]));\n }\n }\n}\n\n/**\n * Creates a map based on grouping.\n *\n * @param {Array} depColumns - The dependency columns' info.\n * @param {Array} data - The input data.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - The sorting details for standard sorting.\n * @return {Map} Returns a map.\n */\nconst makeGroupMapAndSort = (depColumns, data, schema, sortingDetails) => {\n if (depColumns.length === 0) { return data; }\n\n const targetCol = depColumns[0];\n const map = new Map();\n\n data.reduce((acc, currRow) => {\n const fVal = currRow[targetCol.index];\n if (acc.has(fVal)) {\n acc.get(fVal).push(currRow);\n } else {\n acc.set(fVal, [currRow]);\n }\n return acc;\n }, map);\n\n for (let [key, val] of map) {\n const nMap = makeGroupMapAndSort(depColumns.slice(1), val, schema, sortingDetails);\n map.set(key, nMap);\n if (Array.isArray(nMap)) {\n applyStandardSort(nMap, schema, sortingDetails);\n }\n }\n\n return map;\n};\n\n/**\n * Sorts the data by retaining the position/order of a particular field.\n *\n * @param {Array} data - The input data array.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n * @param {Array} depColumns - The dependency column list.\n * @return {Array} Returns the sorted data.\n */\nfunction applyGroupSort (data, schema, sortingDetails, depColumns) {\n sortingDetails = sortingDetails.filter((detail) => {\n if (detail[1] === null) {\n depColumns.push(detail[0]);\n return false;\n }\n return true;\n });\n if (sortingDetails.length === 0) { return data; }\n\n depColumns = depColumns.map(c => fieldInSchema(schema, c));\n\n const sortedGroupMap = makeGroupMapAndSort(depColumns, data, schema, sortingDetails);\n return data.map((row) => {\n let i = 0;\n let nextMap = sortedGroupMap;\n\n while (!Array.isArray(nextMap)) {\n nextMap = nextMap.get(row[depColumns[i++].index]);\n }\n\n return nextMap.shift();\n });\n}\n\n/**\n * Sorts the data.\n *\n * @param {Object} dataObj - An object containing the data and schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n */\nexport function sortData (dataObj, sortingDetails) {\n let { schema, data } = dataObj;\n\n sortingDetails = sortingDetails.filter(sDetial => !!fieldInSchema(schema, sDetial[0]));\n if (sortingDetails.length === 0) { return; }\n\n let groupSortingIdx = sortingDetails.findIndex(sDetial => sDetial[1] === null);\n groupSortingIdx = groupSortingIdx !== -1 ? groupSortingIdx : sortingDetails.length;\n\n const standardSortingDetails = sortingDetails.slice(0, groupSortingIdx);\n const groupSortingDetails = sortingDetails.slice(groupSortingIdx);\n\n applyStandardSort(data, schema, standardSortingDetails);\n data = applyGroupSort(data, schema, groupSortingDetails, standardSortingDetails.map(detail => detail[0]));\n\n dataObj.uids = data.map(row => row.pop());\n dataObj.data = data;\n}\n","import { rowDiffsetIterator } from './row-diffset-iterator';\nimport { sortData } from './sort';\nimport { FieldType } from '../enums';\nimport { ROW_ID } from '../constants';\n\n/**\n * Builds the actual data array.\n *\n * @param {Array} fieldStore - An array of field.\n * @param {string} rowDiffset - A string consisting of which rows to be included eg. '0-2,4,6';\n * @param {string} colIdentifier - A string consisting of the details of which column\n * to be included eg 'date,sales,profit';\n * @param {Object} sortingDetails - An object containing the sorting details of the DataModel instance.\n * @param {Object} options - The options required to create the type of the data.\n * @return {Object} Returns an object containing the multidimensional array and the relative schema.\n */\nexport function dataBuilder (fieldStore, rowDiffset, colIdentifier, sortingDetails, options) {\n const defOptions = {\n addUid: false,\n columnWise: false\n };\n options = Object.assign({}, defOptions, options);\n\n const retObj = {\n schema: [],\n data: [],\n uids: []\n };\n const addUid = options.addUid;\n const reqSorting = sortingDetails && sortingDetails.length > 0;\n // It stores the fields according to the colIdentifier argument\n const tmpDataArr = [];\n // Stores the fields according to the colIdentifier argument\n const colIArr = colIdentifier.split(',');\n\n colIArr.forEach((colName) => {\n for (let i = 0; i < fieldStore.length; i += 1) {\n if (fieldStore[i].name() === colName) {\n tmpDataArr.push(fieldStore[i]);\n break;\n }\n }\n });\n\n // Inserts the schema to the schema object\n tmpDataArr.forEach((field) => {\n /** @todo Need to use extend2 here otherwise user can overwrite the schema. */\n retObj.schema.push(field.schema());\n });\n\n if (addUid) {\n retObj.schema.push({\n name: ROW_ID,\n type: FieldType.DIMENSION\n });\n }\n\n rowDiffsetIterator(rowDiffset, (i) => {\n retObj.data.push([]);\n const insertInd = retObj.data.length - 1;\n let start = 0;\n tmpDataArr.forEach((field, ii) => {\n retObj.data[insertInd][ii + start] = field.partialField.data[i];\n });\n if (addUid) {\n retObj.data[insertInd][tmpDataArr.length] = i;\n }\n // Creates an array of unique identifiers for each row\n retObj.uids.push(i);\n\n // If sorting needed then there is the need to expose the index\n // mapping from the old index to its new index\n if (reqSorting) { retObj.data[insertInd].push(i); }\n });\n\n // Handles the sort functionality\n if (reqSorting) {\n sortData(retObj, sortingDetails);\n }\n\n if (options.columnWise) {\n const tmpData = Array(...Array(retObj.schema.length)).map(() => []);\n retObj.data.forEach((tuple) => {\n tuple.forEach((data, i) => {\n tmpData[i].push(data);\n });\n });\n retObj.data = tmpData;\n }\n\n return retObj;\n}\n","import DataModel from '../datamodel';\nimport { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { isArrEqual } from '../utils/helper';\n\n/**\n * Performs the union operation between two dm instances.\n *\n * @todo Fix the conflicts between union and difference terminology here.\n *\n * @param {dm} dm1 - The first dm instance.\n * @param {dm} dm2 - The second dm instance.\n * @return {dm} Returns the newly created dm after union operation.\n */\nexport function difference (dm1, dm2) {\n const hashTable = {};\n const schema = [];\n const schemaNameArr = [];\n const data = [];\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreFieldObj = dm1FieldStore.fieldsObj();\n const dm2FieldStoreFieldObj = dm2FieldStore.fieldsObj();\n const name = `${dm1FieldStore.name} union ${dm2FieldStore.name}`;\n\n // For union the columns should match otherwise return a clone of the dm1\n if (!isArrEqual(dm1._colIdentifier.split(',').sort(), dm2._colIdentifier.split(',').sort())) {\n return null;\n }\n\n // Prepare the schema\n (dm1._colIdentifier.split(',')).forEach((fieldName) => {\n const field = dm1FieldStoreFieldObj[fieldName];\n schema.push(extend2({}, field.schema()));\n schemaNameArr.push(field.schema().name);\n });\n\n /**\n * The helper function to create the data.\n *\n * @param {dm} dm - The dm instance for which the data is inserted.\n * @param {Object} fieldsObj - The fieldStore object format.\n * @param {boolean} addData - If true only tuple will be added to the data.\n */\n function prepareDataHelper(dm, fieldsObj, addData) {\n rowDiffsetIterator(dm._rowDiffset, (i) => {\n const tuple = {};\n let hashData = '';\n schemaNameArr.forEach((schemaName) => {\n const value = fieldsObj[schemaName].partialField.data[i];\n hashData += `-${value}`;\n tuple[schemaName] = value;\n });\n if (!hashTable[hashData]) {\n if (addData) { data.push(tuple); }\n hashTable[hashData] = true;\n }\n });\n }\n\n // Prepare the data\n prepareDataHelper(dm2, dm2FieldStoreFieldObj, false);\n prepareDataHelper(dm1, dm1FieldStoreFieldObj, true);\n\n return new DataModel(data, schema, { name });\n}\n\n","import { isArray } from '../utils';\nimport InvalidAwareTypes from '../invalid-aware-types';\nimport { GROUP_BY_FUNCTIONS } from '../enums';\n\nconst { SUM, AVG, FIRST, LAST, COUNT, STD, MIN, MAX } = GROUP_BY_FUNCTIONS;\n\nfunction getFilteredValues(arr) {\n return arr.filter(item => !(item instanceof InvalidAwareTypes));\n}\n/**\n * Reducer function that returns the sum of all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the sum of the array.\n */\nfunction sum (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n const filteredNumber = getFilteredValues(arr);\n const totalSum = filteredNumber.length ?\n filteredNumber.reduce((acc, curr) => acc + curr, 0)\n : InvalidAwareTypes.NULL;\n return totalSum;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that returns the average of all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the mean value of the array.\n */\nfunction avg (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n const totalSum = sum(arr);\n const len = arr.length || 1;\n return (Number.isNaN(totalSum) || totalSum instanceof InvalidAwareTypes) ?\n InvalidAwareTypes.NULL : totalSum / len;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the min value amongst all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the minimum value of the array.\n */\nfunction min (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n // Filter out undefined, null and NaN values\n const filteredValues = getFilteredValues(arr);\n\n return (filteredValues.length) ? Math.min(...filteredValues) : InvalidAwareTypes.NULL;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the max value amongst all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the maximum value of the array.\n */\nfunction max (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n // Filter out undefined, null and NaN values\n const filteredValues = getFilteredValues(arr);\n\n return (filteredValues.length) ? Math.max(...filteredValues) : InvalidAwareTypes.NULL;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the first value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the first value of the array.\n */\nfunction first (arr) {\n return arr[0];\n}\n\n/**\n * Reducer function that gives the last value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the last value of the array.\n */\nfunction last (arr) {\n return arr[arr.length - 1];\n}\n\n/**\n * Reducer function that gives the count value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the length of the array.\n */\nfunction count (arr) {\n if (isArray(arr)) {\n return arr.length;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Calculates the variance of the input array.\n *\n * @param {Array.} arr - The input array.\n * @return {number} Returns the variance of the input array.\n */\nfunction variance (arr) {\n let mean = avg(arr);\n return avg(arr.map(num => (num - mean) ** 2));\n}\n\n/**\n * Calculates the square root of the variance of the input array.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the square root of the variance.\n */\nfunction std (arr) {\n return Math.sqrt(variance(arr));\n}\n\n\nconst fnList = {\n [SUM]: sum,\n [AVG]: avg,\n [MIN]: min,\n [MAX]: max,\n [FIRST]: first,\n [LAST]: last,\n [COUNT]: count,\n [STD]: std\n};\n\nconst defaultReducerName = SUM;\n\nexport {\n defaultReducerName,\n sum as defReducer,\n fnList,\n};\n","import { defReducer, fnList } from '../operator';\n\n/**\n * A page level storage which stores, registers, unregisters reducers for all the datamodel instances. There is only one\n * reducer store available in a page. All the datamodel instances receive same instance of reducer store. DataModel\n * out of the box provides handful of {@link reducer | reducers} which can be used as reducer funciton.\n *\n * @public\n * @namespace DataModel\n */\nclass ReducerStore {\n constructor () {\n this.store = new Map();\n this.store.set('defReducer', defReducer);\n\n Object.entries(fnList).forEach((key) => {\n this.store.set(key[0], key[1]);\n });\n }\n\n /**\n * Changes the `defaultReducer` globally. For all the fields which does not have `defAggFn` mentioned in schema, the\n * value of `defaultReducer` is used for aggregation.\n *\n * @public\n * @param {string} [reducer='sum'] - The name of the default reducer. It picks up the definition from store by doing\n * name lookup. If no name is found then it takes `sum` as the default reducer.\n * @return {ReducerStore} Returns instance of the singleton store in page.\n */\n defaultReducer (...params) {\n if (!params.length) {\n return this.store.get('defReducer');\n }\n\n let reducer = params[0];\n\n if (typeof reducer === 'function') {\n this.store.set('defReducer', reducer);\n } else {\n reducer = String(reducer);\n if (Object.keys(fnList).indexOf(reducer) !== -1) {\n this.store.set('defReducer', fnList[reducer]);\n } else {\n throw new Error(`Reducer ${reducer} not found in registry`);\n }\n }\n return this;\n }\n\n /**\n *\n * Registers a {@link reducer | reducer}.\n * A {@link reducer | reducer} has to be registered before it is used.\n *\n * @example\n * // find the mean squared value of a given set\n * const reducerStore = DataModel.Reducers();\n *\n * reducers.register('meanSquared', (arr) => {\n * const squaredVal = arr.map(item => item * item);\n * let sum = 0;\n * for (let i = 0, l = squaredVal.length; i < l; i++) {\n * sum += squaredVal[i++];\n * }\n *\n * return sum;\n * })\n *\n * // datamodel (dm) is already prepared with cars.json\n * const dm1 = dm.groupBy(['origin'], {\n * accleration: 'meanSquared'\n * });\n *\n * @public\n *\n * @param {string} name formal name for a reducer. If the given name already exists in store it is overridden by new\n * definition.\n * @param {Function} reducer definition of {@link reducer} function.\n *\n * @return {Function} function for unregistering the reducer.\n */\n register (name, reducer) {\n if (typeof reducer !== 'function') {\n throw new Error('Reducer should be a function');\n }\n\n name = String(name);\n this.store.set(name, reducer);\n\n return () => { this.__unregister(name); };\n }\n\n __unregister (name) {\n if (this.store.has(name)) {\n this.store.delete(name);\n }\n }\n\n resolve (name) {\n if (name instanceof Function) {\n return name;\n }\n return this.store.get(name);\n }\n}\n\nconst reducerStore = (function () {\n let store = null;\n\n function getStore () {\n if (store === null) {\n store = new ReducerStore();\n }\n return store;\n }\n return getStore();\n}());\n\nexport default reducerStore;\n","import { getCommonSchema } from './get-common-schema';\n\n/**\n * The filter function used in natural join.\n * It generates a function that will have the logic to join two\n * DataModel instances by the process of natural join.\n *\n * @param {DataModel} dm1 - The left DataModel instance.\n * @param {DataModel} dm2 - The right DataModel instance.\n * @return {Function} Returns a function that is used in cross-product operation.\n */\nexport function naturalJoinFilter (dm1, dm2) {\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n // const dm1FieldStoreName = dm1FieldStore.name;\n // const dm2FieldStoreName = dm2FieldStore.name;\n const commonSchemaArr = getCommonSchema(dm1FieldStore, dm2FieldStore);\n\n return (dm1Fields, dm2Fields) => {\n let retainTuple = true;\n commonSchemaArr.forEach((fieldName) => {\n if (dm1Fields[fieldName].internalValue ===\n dm2Fields[fieldName].internalValue && retainTuple) {\n retainTuple = true;\n } else {\n retainTuple = false;\n }\n });\n return retainTuple;\n };\n}\n","import DataModel from '../export';\nimport { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { isArrEqual } from '../utils/helper';\n/**\n * Performs the union operation between two dm instances.\n *\n * @param {dm} dm1 - The first dm instance.\n * @param {dm} dm2 - The second dm instance.\n * @return {dm} Returns the newly created dm after union operation.\n */\nexport function union (dm1, dm2) {\n const hashTable = {};\n const schema = [];\n const schemaNameArr = [];\n const data = [];\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreFieldObj = dm1FieldStore.fieldsObj();\n const dm2FieldStoreFieldObj = dm2FieldStore.fieldsObj();\n const name = `${dm1FieldStore.name} union ${dm2FieldStore.name}`;\n\n // For union the columns should match otherwise return a clone of the dm1\n if (!isArrEqual(dm1._colIdentifier.split(',').sort(), dm2._colIdentifier.split(',').sort())) {\n return null;\n }\n\n // Prepare the schema\n (dm1._colIdentifier.split(',')).forEach((fieldName) => {\n const field = dm1FieldStoreFieldObj[fieldName];\n schema.push(extend2({}, field.schema()));\n schemaNameArr.push(field.schema().name);\n });\n\n /**\n * The helper function to create the data.\n *\n * @param {dm} dm - The dm instance for which the data is inserted.\n * @param {Object} fieldsObj - The fieldStore object format.\n */\n function prepareDataHelper (dm, fieldsObj) {\n rowDiffsetIterator(dm._rowDiffset, (i) => {\n const tuple = {};\n let hashData = '';\n schemaNameArr.forEach((schemaName) => {\n const value = fieldsObj[schemaName].partialField.data[i];\n hashData += `-${value}`;\n tuple[schemaName] = value;\n });\n if (!hashTable[hashData]) {\n data.push(tuple);\n hashTable[hashData] = true;\n }\n });\n }\n\n // Prepare the data\n prepareDataHelper(dm1, dm1FieldStoreFieldObj);\n prepareDataHelper(dm2, dm2FieldStoreFieldObj);\n\n return new DataModel(data, schema, { name });\n}\n","import { crossProduct } from './cross-product';\nimport { JOINS } from '../constants';\nimport { union } from './union';\n\n\nexport function leftOuterJoin (dataModel1, dataModel2, filterFn) {\n return crossProduct(dataModel1, dataModel2, filterFn, false, JOINS.LEFTOUTER);\n}\n\nexport function rightOuterJoin (dataModel1, dataModel2, filterFn) {\n return crossProduct(dataModel2, dataModel1, filterFn, false, JOINS.RIGHTOUTER);\n}\n\nexport function fullOuterJoin (dataModel1, dataModel2, filterFn) {\n return union(leftOuterJoin(dataModel1, dataModel2, filterFn), rightOuterJoin(dataModel1, dataModel2, filterFn));\n}\n","/**\n * Stores the full data and the metadata of a field. It provides\n * a single source of data from which the future Field\n * instance can get a subset of it with a rowDiffset config.\n *\n * @class\n * @public\n */\nexport default class PartialField {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {string} name - The name of the field.\n * @param {Array} data - The data array.\n * @param {Object} schema - The schema object of the corresponding field.\n * @param {FieldParser} parser - The parser instance corresponding to that field.\n */\n constructor (name, data, schema, parser) {\n this.name = name;\n this.schema = schema;\n this.parser = parser;\n this.data = this._sanitize(data);\n }\n\n /**\n * Sanitizes the field data.\n *\n * @private\n * @param {Array} data - The actual input data.\n * @return {Array} Returns the sanitized data.\n */\n _sanitize (data) {\n return data.map(datum => this.parser.parse(datum, { format: this.schema.format }));\n }\n}\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport PartialField from '../partial-field';\n\n/**\n * In {@link DataModel}, every tabular data consists of column, a column is stored as field.\n * Field contains all the data for a given column in an array.\n *\n * Each record consists of several fields; the fields of all records form the columns.\n * Examples of fields: name, gender, sex etc.\n *\n * In DataModel, each field can have multiple attributes which describes its data and behaviour.\n * A field can have two types of data: Measure and Dimension.\n *\n * A Dimension Field is the context on which a data is categorized and the measure is the numerical values that\n * quantify the data set.\n * In short a dimension is the lens through which you are looking at your measure data.\n *\n * Refer to {@link Schema} to get info about possible field attributes.\n *\n * @public\n * @class\n */\nexport default class Field {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {PartialField} partialField - The partialField instance which holds the whole data.\n * @param {string} rowDiffset - The data subset definition.\n */\n constructor (partialField, rowDiffset) {\n this.partialField = partialField;\n this.rowDiffset = rowDiffset;\n }\n\n static parser() {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Generates the field type specific domain.\n *\n * @public\n * @abstract\n */\n domain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the the field schema.\n *\n * @public\n * @return {string} Returns the field schema.\n */\n schema () {\n return this.partialField.schema;\n }\n\n /**\n * Returns the name of the field.\n *\n * @public\n * @return {string} Returns the name of the field.\n */\n name () {\n return this.partialField.name;\n }\n\n /**\n * Returns the type of the field.\n *\n * @public\n * @return {string} Returns the type of the field.\n */\n type () {\n return this.partialField.schema.type;\n }\n\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return this.partialField.schema.subtype;\n }\n\n /**\n * Returns the description of the field.\n *\n * @public\n * @return {string} Returns the description of the field.\n */\n description () {\n return this.partialField.schema.description;\n }\n\n /**\n * Returns the display name of the field.\n *\n * @public\n * @return {string} Returns the display name of the field.\n */\n displayName () {\n return this.partialField.schema.displayName || this.partialField.schema.name;\n }\n\n /**\n * Returns the data associated with the field.\n *\n * @public\n * @return {Array} Returns the data.\n */\n data () {\n const data = [];\n rowDiffsetIterator(this.rowDiffset, (i) => {\n data.push(this.partialField.data[i]);\n });\n return data;\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @abstract\n */\n formattedData () {\n throw new Error('Not yet implemented');\n }\n\n static get BUILDER() {\n const builder = {\n _params: {},\n _context: this,\n fieldName(name) {\n this._params.name = name;\n return this;\n },\n schema(schema) {\n this._params.schema = schema;\n return this;\n },\n data(data) {\n this._params.data = data;\n return this;\n },\n partialField(partialField) {\n this._params.partialField = partialField;\n return this;\n },\n rowDiffset(rowDiffset) {\n this._params.rowDiffset = rowDiffset;\n return this;\n },\n build() {\n let partialField = null;\n if (this._params.partialField instanceof PartialField) {\n partialField = this._params.partialField;\n } else if (this._params.schema && this._params.data) {\n partialField = new PartialField(this._params.name,\n this._params.data,\n this._params.schema,\n this._context.parser());\n }\n else {\n throw new Error('Invalid Field parameters');\n }\n return new this._context(partialField, this._params.rowDiffset);\n }\n };\n return builder;\n }\n}\n","import Field from '../field';\n\n/**\n * Represents dimension field type.\n *\n * @public\n * @class\n * @extends Field\n */\nexport default class Dimension extends Field {\n /**\n * Returns the domain for the dimension field.\n *\n * @override\n * @public\n * @return {any} Returns the calculated domain.\n */\n domain () {\n if (!this._cachedDomain) {\n this._cachedDomain = this.calculateDataDomain();\n }\n return this._cachedDomain;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @abstract\n */\n calculateDataDomain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n return this.data();\n }\n}\n","import { formatNumber } from '../../utils';\nimport { defaultReducerName } from '../../operator/group-by-function';\nimport Field from '../field';\n\n/**\n * Represents measure field type.\n *\n * @public\n * @class\n * @extends Field\n */\nexport default class Measure extends Field {\n /**\n * Returns the domain for the measure field.\n *\n * @override\n * @public\n * @return {any} Returns the calculated domain.\n */\n domain () {\n if (!this._cachedDomain) {\n this._cachedDomain = this.calculateDataDomain();\n }\n return this._cachedDomain;\n }\n\n /**\n * Returns the unit of the measure field.\n *\n * @public\n * @return {string} Returns unit of the field.\n */\n unit () {\n return this.partialField.schema.unit;\n }\n\n /**\n * Returns the aggregation function name of the measure field.\n *\n * @public\n * @return {string} Returns aggregation function name of the field.\n */\n defAggFn () {\n return this.partialField.schema.defAggFn || defaultReducerName;\n }\n\n /**\n * Returns the number format of the measure field.\n *\n * @public\n * @return {Function} Returns number format of the field.\n */\n numberFormat () {\n const { numberFormat } = this.partialField.schema;\n return numberFormat instanceof Function ? numberFormat : formatNumber;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @abstract\n */\n calculateDataDomain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n return this.data();\n }\n}\n","/**\n * A interface to represent a parser which is responsible to parse the field.\n *\n * @public\n * @interface\n */\nexport default class FieldParser {\n /**\n * Parses a single value of a field and return the sanitized form.\n *\n * @public\n * @abstract\n */\n parse () {\n throw new Error('Not yet implemented');\n }\n}\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the categorical values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class CategoricalParser extends FieldParser {\n /**\n * Parses a single value of a field and returns the stringified form.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {string} Returns the stringified value.\n */\n parse (val) {\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n result = String(val).trim();\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport { DimensionSubtype } from '../../enums';\nimport Dimension from '../dimension';\nimport CategoricalParser from '../parsers/categorical-parser';\n/**\n * Represents categorical field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Categorical extends Dimension {\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @override\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return DimensionSubtype.CATEGORICAL;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the unique values.\n */\n calculateDataDomain () {\n const hash = new Set();\n const domain = [];\n\n // here don't use this.data() as the iteration will be occurred two times on same data.\n rowDiffsetIterator(this.rowDiffset, (i) => {\n const datum = this.partialField.data[i];\n if (!hash.has(datum)) {\n hash.add(datum);\n domain.push(datum);\n }\n });\n return domain;\n }\n\n static parser() {\n return new CategoricalParser();\n }\n}\n","import { DateTimeFormatter } from '../../../utils';\nimport FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the temporal values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class TemporalParser extends FieldParser {\n\n /**\n * Parses a single value of a field and returns the millisecond value.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {number} Returns the millisecond value.\n */\n parse (val, { format }) {\n let result;\n // check if invalid date value\n if (!this._dtf) {\n this._dtf = new DateTimeFormatter(format);\n }\n if (!InvalidAwareTypes.isInvalid(val)) {\n let nativeDate = this._dtf.getNativeDate(val);\n result = nativeDate ? nativeDate.getTime() : InvalidAwareTypes.NA;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { rowDiffsetIterator } from '../operator/row-diffset-iterator';\nimport InvalidAwareTypes from '../invalid-aware-types';\n\nexport const calculateContinuousDomain = (data, rowDiffset) => {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // here don't use this.data() as the iteration will be occurred two times on same data.\n rowDiffsetIterator(rowDiffset, (i) => {\n const datum = data[i];\n if (datum instanceof InvalidAwareTypes) {\n return;\n }\n\n if (datum < min) {\n min = datum;\n }\n if (datum > max) {\n max = datum;\n }\n });\n\n return [min, max];\n};\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport Dimension from '../dimension';\nimport { DateTimeFormatter } from '../../utils';\nimport InvalidAwareTypes from '../../invalid-aware-types';\nimport TemporalParser from '../parsers/temporal-parser';\nimport { calculateContinuousDomain } from '../helper';\n\n/**\n * Represents temporal field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Temporal extends Dimension {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {PartialField} partialField - The partialField instance which holds the whole data.\n * @param {string} rowDiffset - The data subset definition.\n */\n constructor (partialField, rowDiffset) {\n super(partialField, rowDiffset);\n\n this._cachedMinDiff = null;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the unique values.\n */\n calculateDataDomain () {\n return calculateContinuousDomain(this.partialField.data, this.rowDiffset);\n }\n\n\n /**\n * Calculates the minimum consecutive difference from the associated field data.\n *\n * @public\n * @return {number} Returns the minimum consecutive diff in milliseconds.\n */\n minimumConsecutiveDifference () {\n if (this._cachedMinDiff) {\n return this._cachedMinDiff;\n }\n\n const sortedData = this.data().filter(item => !(item instanceof InvalidAwareTypes)).sort((a, b) => a - b);\n const arrLn = sortedData.length;\n let minDiff = Number.POSITIVE_INFINITY;\n let prevDatum;\n let nextDatum;\n let processedCount = 0;\n\n for (let i = 1; i < arrLn; i++) {\n prevDatum = sortedData[i - 1];\n nextDatum = sortedData[i];\n\n if (nextDatum === prevDatum) {\n continue;\n }\n\n minDiff = Math.min(minDiff, nextDatum - sortedData[i - 1]);\n processedCount++;\n }\n\n if (!processedCount) {\n minDiff = null;\n }\n this._cachedMinDiff = minDiff;\n\n return this._cachedMinDiff;\n }\n\n /**\n * Returns the format specified in the input schema while creating field.\n *\n * @public\n * @return {string} Returns the datetime format.\n */\n format () {\n return this.partialField.schema.format;\n }\n\n /**\n * Returns the formatted version of the underlying field data\n * If data is of type invalid or has missing format use the raw value\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n const data = [];\n const dataFormat = this.format();\n\n rowDiffsetIterator(this.rowDiffset, (i) => {\n const datum = this.partialField.data[i];\n // If value is of invalid type or format is missing\n if (InvalidAwareTypes.isInvalid(datum) || (!dataFormat && Number.isFinite(datum))) {\n // Use the invalid map value or the raw value\n const parsedDatum = InvalidAwareTypes.getInvalidType(datum) || datum;\n data.push(parsedDatum);\n } else {\n data.push(DateTimeFormatter.formatAs(datum, dataFormat));\n }\n });\n return data;\n }\n\n static parser() {\n return new TemporalParser();\n }\n}\n\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the binned values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class BinnedParser extends FieldParser {\n /**\n * Parses a single binned value of a field and returns the sanitized value.\n *\n * @public\n * @param {string} val - The value of the field.\n * @return {string} Returns the sanitized value.\n */\n parse (val) {\n const regex = /^\\s*([+-]?\\d+(?:\\.\\d+)?)\\s*-\\s*([+-]?\\d+(?:\\.\\d+)?)\\s*$/;\n val = String(val);\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n let matched = val.match(regex);\n result = matched ? `${Number.parseFloat(matched[1])}-${Number.parseFloat(matched[2])}`\n : InvalidAwareTypes.NA;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import Dimension from '../dimension';\nimport BinnedParser from '../parsers/binned-parser';\n\n/**\n * Represents binned field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Binned extends Dimension {\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the last and first values of bins config array.\n */\n calculateDataDomain () {\n const binsArr = this.partialField.schema.bins;\n return [binsArr[0], binsArr[binsArr.length - 1]];\n }\n\n /**\n * Returns the bins config provided while creating the field instance.\n *\n * @public\n * @return {Array} Returns the bins array config.\n */\n bins () {\n return this.partialField.schema.bins;\n }\n\n static parser() {\n return new BinnedParser();\n }\n}\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the continuous values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class ContinuousParser extends FieldParser {\n /**\n * Parses a single value of a field and returns the number form.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {string} Returns the number value.\n */\n parse (val) {\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n let parsedVal = parseFloat(val, 10);\n result = Number.isNaN(parsedVal) ? InvalidAwareTypes.NA : parsedVal;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { MeasureSubtype } from '../../enums';\nimport Measure from '../measure';\nimport ContinuousParser from '../parsers/continuous-parser';\nimport { calculateContinuousDomain } from '../helper';\n\n/**\n * Represents continuous field subtype.\n *\n * @public\n * @class\n * @extends Measure\n */\nexport default class Continuous extends Measure {\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @override\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return MeasureSubtype.CONTINUOUS;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the min and max values.\n */\n calculateDataDomain () {\n return calculateContinuousDomain(this.partialField.data, this.rowDiffset);\n }\n\n static parser() {\n return new ContinuousParser();\n }\n}\n","import Categorical from './categorical';\nimport Temporal from './temporal';\nimport Binned from './binned';\nimport Continuous from './continuous';\nimport { DimensionSubtype, MeasureSubtype } from '../enums';\n\n\nclass FieldTypeRegistry {\n constructor() {\n this._fieldType = new Map();\n }\n\n registerFieldType(subtype, dimension) {\n this._fieldType.set(subtype, dimension);\n return this;\n }\n\n has(type) {\n return this._fieldType.has(type);\n }\n\n get(type) {\n return this._fieldType.get(type);\n }\n}\n\nconst registerDefaultFields = (store) => {\n store\n .registerFieldType(DimensionSubtype.CATEGORICAL, Categorical)\n .registerFieldType(DimensionSubtype.TEMPORAL, Temporal)\n .registerFieldType(DimensionSubtype.BINNED, Binned)\n .registerFieldType(MeasureSubtype.CONTINUOUS, Continuous);\n};\n\nconst fieldRegistry = (function () {\n let store = null;\n function getStore () {\n store = new FieldTypeRegistry();\n registerDefaultFields(store);\n return store;\n }\n return store || getStore();\n}());\n\nexport default fieldRegistry;\n\n","import { FieldType, DimensionSubtype, MeasureSubtype } from './enums';\nimport { fieldRegistry } from './fields';\n\n/**\n * Creates a field instance according to the provided data and schema.\n *\n * @param {Array} data - The field data array.\n * @param {Object} schema - The field schema object.\n * @return {Field} Returns the newly created field instance.\n */\nfunction createUnitField(data, schema) {\n data = data || [];\n\n if (fieldRegistry.has(schema.subtype)) {\n return fieldRegistry.get(schema.subtype)\n .BUILDER\n .fieldName(schema.name)\n .schema(schema)\n .data(data)\n .rowDiffset(`0-${data.length - 1}`)\n .build();\n }\n return fieldRegistry\n .get(schema.type === FieldType.MEASURE ? MeasureSubtype.CONTINUOUS : DimensionSubtype.CATEGORICAL)\n .BUILDER\n .fieldName(schema.name)\n .schema(schema)\n .data(data)\n .rowDiffset(`0-${data.length - 1}`)\n .build();\n}\n\n\n/**\n * Creates a field instance from partialField and rowDiffset.\n *\n * @param {PartialField} partialField - The corresponding partial field.\n * @param {string} rowDiffset - The data subset config.\n * @return {Field} Returns the newly created field instance.\n */\nexport function createUnitFieldFromPartial(partialField, rowDiffset) {\n const { schema } = partialField;\n\n if (fieldRegistry.has(schema.subtype)) {\n return fieldRegistry.get(schema.subtype)\n .BUILDER\n .partialField(partialField)\n .rowDiffset(rowDiffset)\n .build();\n }\n return fieldRegistry\n .get(schema.type === FieldType.MEASURE ? MeasureSubtype.CONTINUOUS : DimensionSubtype.CATEGORICAL)\n .BUILDER\n .partialField(partialField)\n .rowDiffset(rowDiffset)\n .build();\n}\n\n/**\n * Creates the field instances with input data and schema.\n *\n * @param {Array} dataColumn - The data array for fields.\n * @param {Array} schema - The schema array for fields.\n * @param {Array} headers - The array of header names.\n * @return {Array.} Returns an array of newly created field instances.\n */\nexport function createFields(dataColumn, schema, headers) {\n const headersObj = {};\n\n if (!(headers && headers.length)) {\n headers = schema.map(item => item.name);\n }\n\n headers.forEach((header, i) => {\n headersObj[header] = i;\n });\n\n return schema.map(item => createUnitField(dataColumn[headersObj[item.name]], item));\n}\n","import { DataFormat } from './enums';\n\nexport default {\n dataFormat: DataFormat.AUTO\n};\n","/**\n * Interface for all data converters\n */\nexport default class DataConverter {\n constructor(type) {\n this._type = type;\n }\n\n get type() {\n return this._type;\n }\n\n convert() {\n throw new Error('Convert method not implemented.');\n }\n\n}\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","import { columnMajor } from '../../utils';\n\n/**\n * Parses and converts data formatted in DSV array to a manageable internal format.\n *\n * @param {Array.} arr - A 2D array containing of the DSV data.\n * @param {Object} options - Option to control the behaviour of the parsing.\n * @param {boolean} [options.firstRowHeader=true] - Whether the first row of the dsv data is header or not.\n * @return {Array} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = [\n * [\"a\", \"b\", \"c\"],\n * [1, 2, 3],\n * [4, 5, 6],\n * [7, 8, 9]\n * ];\n */\nfunction DSVArr(arr, schema, options) {\n if (!Array.isArray(schema)) {\n throw new Error('Schema missing or is in an unsupported format');\n }\n const defaultOption = {\n firstRowHeader: true,\n };\n const schemaFields = schema.map(unitSchema => unitSchema.name);\n options = Object.assign({}, defaultOption, options);\n\n const columns = [];\n const push = columnMajor(columns);\n\n let headers = schemaFields;\n if (options.firstRowHeader) {\n // If header present then remove the first header row.\n // Do in-place mutation to save space.\n headers = arr.splice(0, 1)[0];\n }\n // create a map of the headers\n const headerMap = headers.reduce((acc, h, i) => (\n Object.assign(acc, { [h]: i })\n ), {});\n\n arr.forEach((fields) => {\n const field = [];\n schemaFields.forEach((schemaField) => {\n const headIndex = headerMap[schemaField];\n field.push(fields[headIndex]);\n });\n return push(...field);\n });\n return [schemaFields, columns];\n}\n\nexport default DSVArr;\n","import { dsvFormat as d3Dsv } from 'd3-dsv';\nimport DSVArr from './dsv-arr';\n\n/**\n * Parses and converts data formatted in DSV string to a manageable internal format.\n *\n * @todo Support to be given for https://tools.ietf.org/html/rfc4180.\n * @todo Sample implementation https://github.com/knrz/CSV.js/.\n *\n * @param {string} str - The input DSV string.\n * @param {Object} options - Option to control the behaviour of the parsing.\n * @param {boolean} [options.firstRowHeader=true] - Whether the first row of the dsv string data is header or not.\n * @param {string} [options.fieldSeparator=\",\"] - The separator of two consecutive field.\n * @return {Array} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = `\n * a,b,c\n * 1,2,3\n * 4,5,6\n * 7,8,9\n * `\n */\nfunction DSVStr (str, schema, options) {\n const defaultOption = {\n firstRowHeader: true,\n fieldSeparator: ','\n };\n options = Object.assign({}, defaultOption, options);\n\n const dsv = d3Dsv(options.fieldSeparator);\n return DSVArr(dsv.parseRows(str), schema, options);\n}\n\nexport default DSVStr;\n","import DataConverter from '../model/dataConverter';\nimport DSVStr from '../utils/dsv-str';\nimport DataFormat from '../../enums/data-format';\n\nexport default class DSVStringConverter extends DataConverter {\n constructor() {\n super(DataFormat.DSV_STR);\n }\n\n convert(data, schema, options) {\n return DSVStr(data, schema, options);\n }\n}\n","import { columnMajor } from '../../utils';\n\n/**\n * Parses and converts data formatted in JSON to a manageable internal format.\n *\n * @param {Array.} arr - The input data formatted in JSON.\n * @return {Array.} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = [\n * {\n * \"a\": 1,\n * \"b\": 2,\n * \"c\": 3\n * },\n * {\n * \"a\": 4,\n * \"b\": 5,\n * \"c\": 6\n * },\n * {\n * \"a\": 7,\n * \"b\": 8,\n * \"c\": 9\n * }\n * ];\n */\nfunction FlatJSON (arr, schema) {\n if (!Array.isArray(schema)) {\n throw new Error('Schema missing or is in an unsupported format');\n }\n\n const header = {};\n let i = 0;\n let insertionIndex;\n const columns = [];\n const push = columnMajor(columns);\n const schemaFieldsName = schema.map(unitSchema => unitSchema.name);\n\n arr.forEach((item) => {\n const fields = [];\n schemaFieldsName.forEach((unitSchema) => {\n if (unitSchema in header) {\n insertionIndex = header[unitSchema];\n } else {\n header[unitSchema] = i++;\n insertionIndex = i - 1;\n }\n fields[insertionIndex] = item[unitSchema];\n });\n push(...fields);\n });\n\n return [Object.keys(header), columns];\n}\n\nexport default FlatJSON;\n","import DataConverter from '../model/dataConverter';\nimport FlatJSON from '../utils/flat-json';\nimport DataFormat from '../../enums/data-format';\n\nexport default class JSONConverter extends DataConverter {\n constructor() {\n super(DataFormat.FLAT_JSON);\n }\n\n convert(data, schema, options) {\n return FlatJSON(data, schema, options);\n }\n}\n","import DataConverter from '../model/dataConverter';\nimport DSVArr from '../utils/dsv-arr';\nimport DataFormat from '../../enums/data-format';\n\nexport default class DSVArrayConverter extends DataConverter {\n constructor() {\n super(DataFormat.DSV_ARR);\n }\n\n convert(data, schema, options) {\n return DSVArr(data, schema, options);\n }\n}\n","import DataConverter from '../model/dataConverter';\nimport AUTO from '../utils/auto-resolver';\nimport DataFormat from '../../enums/data-format';\n\nexport default class AutoDataConverter extends DataConverter {\n constructor() {\n super(DataFormat.AUTO);\n }\n\n convert(data, schema, options) {\n return AUTO(data, schema, options);\n }\n}\n","import FlatJSON from './flat-json';\nimport DSVArr from './dsv-arr';\nimport DSVStr from './dsv-str';\nimport { detectDataFormat } from '../../utils';\n\n/**\n * Parses the input data and detect the format automatically.\n *\n * @param {string|Array} data - The input data.\n * @param {Object} options - An optional config specific to data format.\n * @return {Array.} Returns an array of headers and column major data.\n */\nfunction Auto (data, schema, options) {\n const converters = { FlatJSON, DSVStr, DSVArr };\n const dataFormat = detectDataFormat(data);\n\n if (!dataFormat) {\n throw new Error('Couldn\\'t detect the data format');\n }\n\n return converters[dataFormat](data, schema, options);\n}\n\nexport default Auto;\n","import DataConverter from './model/dataConverter';\nimport { DSVStringConverter, DSVArrayConverter, JSONConverter, AutoDataConverter } from './defaultConverters';\n\nclass DataConverterStore {\n constructor() {\n this.store = new Map();\n this.converters(this._getDefaultConverters());\n }\n\n _getDefaultConverters() {\n return [\n new DSVStringConverter(),\n new DSVArrayConverter(),\n new JSONConverter(),\n new AutoDataConverter()\n ];\n }\n\n /**\n * Sets the given converters in the store and returns the store\n * @param {Array} converters : contains array of converter instance\n * @return { Map }\n */\n converters(converters = []) {\n converters.forEach(converter => this.store.set(converter.type, converter));\n return this.store;\n }\n\n /**\n * Registers a Converter of type DataConverter\n * @param {DataConverter} converter : converter Instance\n * @returns self\n */\n register(converter) {\n if (converter instanceof DataConverter) {\n this.store.set(converter.type, converter);\n return this;\n }\n return null;\n }\n\n /**\n * Rempves a converter from store\n * @param {DataConverter} converter : converter Instance\n * @returns self\n */\n\n unregister(converter) {\n this.store.delete(converter.type);\n return this;\n }\n\n get(name) {\n if (this.store.has(name)) {\n return this.store.get(name);\n }\n return null;\n }\n\n}\n\nconst converterStore = (function () {\n let store = null;\n\n function getStore () {\n store = new DataConverterStore();\n return store;\n }\n return store || getStore();\n}());\n\nexport default converterStore;\n","import { FieldType, FilteringMode, DimensionSubtype, MeasureSubtype, DataFormat } from './enums';\nimport fieldStore from './field-store';\nimport Value from './value';\nimport {\n rowDiffsetIterator\n} from './operator';\nimport { DM_DERIVATIVES, LOGICAL_OPERATORS, ROW_ID } from './constants';\nimport { createFields, createUnitFieldFromPartial } from './field-creator';\nimport defaultConfig from './default-config';\nimport { converterStore } from './converter';\nimport { fieldRegistry } from './fields';\nimport { extend2, detectDataFormat } from './utils';\n\n/**\n * Prepares the selection data.\n */\nfunction prepareSelectionData (fields, formattedData, rawData, i) {\n const resp = {};\n\n for (const [key, field] of fields.entries()) {\n resp[field.name()] = new Value(formattedData[key][i], rawData[key][i], field);\n }\n return resp;\n}\n\nexport function prepareJoinData (fields) {\n const resp = {};\n\n for (const key in fields) {\n resp[key] = new Value(fields[key].formattedValue, fields[key].rawValue, key);\n }\n return resp;\n}\n\nexport const updateFields = ([rowDiffset, colIdentifier], partialFieldspace, fieldStoreName) => {\n let collID = colIdentifier.length ? colIdentifier.split(',') : [];\n let partialFieldMap = partialFieldspace.fieldsObj();\n let newFields = collID.map(coll => createUnitFieldFromPartial(partialFieldMap[coll].partialField, rowDiffset));\n return fieldStore.createNamespace(newFields, fieldStoreName);\n};\n\nexport const persistCurrentDerivation = (model, operation, config = {}, criteriaFn) => {\n if (operation === DM_DERIVATIVES.COMPOSE) {\n model._derivation.length = 0;\n model._derivation.push(...criteriaFn);\n } else {\n model._derivation.push({\n op: operation,\n meta: config,\n criteria: criteriaFn\n });\n }\n};\nexport const persistAncestorDerivation = (sourceDm, newDm) => {\n newDm._ancestorDerivation.push(...sourceDm._ancestorDerivation, ...sourceDm._derivation);\n};\n\nexport const persistDerivations = (sourceDm, model, operation, config = {}, criteriaFn) => {\n persistCurrentDerivation(model, operation, config, criteriaFn);\n persistAncestorDerivation(sourceDm, model);\n};\n\nconst selectModeMap = {\n [FilteringMode.NORMAL]: {\n diffIndex: ['rowDiffset'],\n calcDiff: [true, false]\n },\n [FilteringMode.INVERSE]: {\n diffIndex: ['rejectRowDiffset'],\n calcDiff: [false, true]\n },\n [FilteringMode.ALL]: {\n diffIndex: ['rowDiffset', 'rejectRowDiffset'],\n calcDiff: [true, true]\n }\n};\n\nconst generateRowDiffset = (rowDiffset, i, lastInsertedValue) => {\n if (lastInsertedValue !== -1 && i === (lastInsertedValue + 1)) {\n const li = rowDiffset.length - 1;\n\n rowDiffset[li] = `${rowDiffset[li].split('-')[0]}-${i}`;\n } else {\n rowDiffset.push(`${i}`);\n }\n};\n\nexport const selectRowDiffsetIterator = (rowDiffset, checker, mode) => {\n let lastInsertedValueSel = -1;\n let lastInsertedValueRej = -1;\n const newRowDiffSet = [];\n const rejRowDiffSet = [];\n\n const [shouldSelect, shouldReject] = selectModeMap[mode].calcDiff;\n\n rowDiffsetIterator(rowDiffset, (i) => {\n const checkerResult = checker(i);\n checkerResult && shouldSelect && generateRowDiffset(newRowDiffSet, i, lastInsertedValueSel);\n !checkerResult && shouldReject && generateRowDiffset(rejRowDiffSet, i, lastInsertedValueRej);\n });\n return {\n rowDiffset: newRowDiffSet.join(','),\n rejectRowDiffset: rejRowDiffSet.join(',')\n };\n};\n\n\nexport const rowSplitDiffsetIterator = (rowDiffset, checker, mode, dimensionArr, fieldStoreObj) => {\n let lastInsertedValue = {};\n const splitRowDiffset = {};\n const dimensionMap = {};\n\n rowDiffsetIterator(rowDiffset, (i) => {\n if (checker(i)) {\n let hash = '';\n\n let dimensionSet = { keys: {} };\n\n dimensionArr.forEach((_) => {\n const data = fieldStoreObj[_].partialField.data[i];\n hash = `${hash}-${data}`;\n dimensionSet.keys[_] = data;\n });\n\n if (splitRowDiffset[hash] === undefined) {\n splitRowDiffset[hash] = [];\n lastInsertedValue[hash] = -1;\n dimensionMap[hash] = dimensionSet;\n }\n\n generateRowDiffset(splitRowDiffset[hash], i, lastInsertedValue[hash]);\n lastInsertedValue[hash] = i;\n }\n });\n\n return {\n splitRowDiffset,\n dimensionMap\n };\n};\n\n\nexport const selectHelper = (clonedDm, selectFn, config, sourceDm, iterator) => {\n let cachedStore = {};\n let cloneProvider = () => sourceDm.detachedRoot();\n const { mode } = config;\n const rowDiffset = clonedDm._rowDiffset;\n const cachedValueObjects = clonedDm._partialFieldspace._cachedValueObjects;\n\n const selectorHelperFn = index => selectFn(\n cachedValueObjects[index],\n index,\n cloneProvider,\n cachedStore\n );\n\n return iterator(rowDiffset, selectorHelperFn, mode);\n};\n\nexport const cloneWithAllFields = (model) => {\n const clonedDm = model.clone(false);\n const partialFieldspace = model.getPartialFieldspace();\n clonedDm._colIdentifier = partialFieldspace.fields.map(f => f.name()).join(',');\n\n // flush out cached namespace values on addition of new fields\n partialFieldspace._cachedFieldsObj = null;\n partialFieldspace._cachedDimension = null;\n partialFieldspace._cachedMeasure = null;\n clonedDm.__calculateFieldspace().calculateFieldsConfig();\n\n return clonedDm;\n};\n\nconst getKey = (arr, data, fn, rowId) => {\n let key = fn(arr, data, 0, rowId);\n\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${fn(arr, data, i, rowId)}`;\n }\n return key;\n};\n\nconst keyFn = (arr, fields, idx, rowId) => {\n const field = arr[idx];\n const val = field === ROW_ID ? rowId : fields[field].internalValue;\n return val;\n};\n\nconst domainChecker = (val, domain) => {\n const domainArr = domain[0] instanceof Array ? domain : [domain];\n return domainArr.some(dom => val >= dom[0] && val <= dom[1]);\n};\n\nconst boundsChecker = {\n [MeasureSubtype.CONTINUOUS]: domainChecker,\n [DimensionSubtype.TEMPORAL]: domainChecker\n};\n\nconst isWithinDomain = (value, domain, fieldType) => boundsChecker[fieldType](value, domain);\n\nexport const filterPropagationModel = (model, propModels, config = {}) => {\n let fns = [];\n const operation = config.operation || LOGICAL_OPERATORS.AND;\n const { filterByDim = true, filterByMeasure = false, clone = true } = config;\n const clonedModel = clone ? cloneWithAllFields(model) : model;\n const modelFieldsConfig = clonedModel.getFieldsConfig();\n\n if (!propModels.length) {\n fns = [() => false];\n } else {\n fns = propModels.map(propModel => (({ criteria = {} }) => {\n const { identifiers = [[], []], range } = criteria;\n let [fieldNames = [], values = []] = identifiers;\n const indices = fieldNames.reduce((map, name, i) => {\n map[name] = i;\n return map;\n }, {});\n fieldNames = fieldNames.filter(field => (field in modelFieldsConfig &&\n modelFieldsConfig[field].def.type === FieldType.DIMENSION) || field === ROW_ID);\n const dLen = fieldNames.length;\n const valuesMap = {};\n\n if (dLen) {\n for (let i = 1, len = identifiers.length; i < len; i++) {\n const row = identifiers[i];\n const key = `${fieldNames.map((field) => {\n const idx = indices[field];\n return row[idx];\n })}`;\n valuesMap[key] = 1;\n }\n }\n let rangeKeys = Object.keys(range || {}).filter(field => field in modelFieldsConfig);\n const hasData = values.length || rangeKeys.length;\n\n if (!filterByMeasure) {\n rangeKeys = rangeKeys.filter(field => modelFieldsConfig[field].def.type !== FieldType.MEASURE);\n }\n\n if (!filterByDim) {\n rangeKeys = rangeKeys.filter(field => modelFieldsConfig[field].def.type !== FieldType.DIMENSION);\n }\n\n return hasData ? (fields, i) => {\n let present = true;\n if (filterByDim) {\n present = dLen ? valuesMap[getKey(fieldNames, fields, keyFn, i)] : true;\n }\n\n return rangeKeys.every((field) => {\n const val = fields[field].internalValue;\n return isWithinDomain(val, range[field], modelFieldsConfig[field].def.subtype);\n }) && present;\n } : () => false;\n })(propModel));\n }\n\n let filteredModel;\n if (operation === LOGICAL_OPERATORS.AND) {\n filteredModel = clonedModel.select((fields, i) => fns.every(fn => fn(fields, i)), {\n saveChild: false\n });\n } else {\n filteredModel = clonedModel.select((fields, i) => fns.some(fn => fn(fields, i)), {\n saveChild: false\n });\n }\n\n return filteredModel;\n};\n\n\nexport const splitWithSelect = (sourceDm, dimensionArr, reducerFn = val => val, config) => {\n const {\n saveChild,\n } = config;\n const fieldStoreObj = sourceDm.getFieldspace().fieldsObj();\n\n const {\n splitRowDiffset,\n dimensionMap\n } = selectHelper(\n sourceDm.clone(saveChild),\n reducerFn,\n config,\n sourceDm,\n (...params) => rowSplitDiffsetIterator(...params, dimensionArr, fieldStoreObj)\n );\n\n const clonedDMs = [];\n Object.keys(splitRowDiffset).sort().forEach((e) => {\n if (splitRowDiffset[e]) {\n const cloned = sourceDm.clone(saveChild);\n const derivation = dimensionMap[e];\n cloned._rowDiffset = splitRowDiffset[e].join(',');\n cloned.__calculateFieldspace().calculateFieldsConfig();\n\n const derivationFormula = fields => dimensionArr.every(_ => fields[_].internalValue === derivation.keys[_]);\n // Store reference to child model and selector function\n if (saveChild) {\n persistDerivations(sourceDm, cloned, DM_DERIVATIVES.SELECT, config, derivationFormula);\n }\n cloned._derivation[cloned._derivation.length - 1].meta = dimensionMap[e];\n\n clonedDMs.push(cloned);\n }\n });\n\n\n return clonedDMs;\n};\nexport const addDiffsetToClonedDm = (clonedDm, rowDiffset, sourceDm, selectConfig, selectFn) => {\n clonedDm._rowDiffset = rowDiffset;\n clonedDm.__calculateFieldspace().calculateFieldsConfig();\n persistDerivations(\n sourceDm,\n clonedDm,\n DM_DERIVATIVES.SELECT,\n { config: selectConfig },\n selectFn\n );\n};\n\n\nexport const cloneWithSelect = (sourceDm, selectFn, selectConfig, cloneConfig) => {\n let extraCloneDm = {};\n\n let { mode } = selectConfig;\n\n const cloned = sourceDm.clone(cloneConfig.saveChild);\n const setOfRowDiffsets = selectHelper(\n cloned,\n selectFn,\n selectConfig,\n sourceDm,\n selectRowDiffsetIterator\n );\n const diffIndex = selectModeMap[mode].diffIndex;\n\n addDiffsetToClonedDm(cloned, setOfRowDiffsets[diffIndex[0]], sourceDm, selectConfig, selectFn);\n\n if (diffIndex.length > 1) {\n extraCloneDm = sourceDm.clone(cloneConfig.saveChild);\n addDiffsetToClonedDm(extraCloneDm, setOfRowDiffsets[diffIndex[1]], sourceDm, selectConfig, selectFn);\n return [cloned, extraCloneDm];\n }\n\n return cloned;\n};\n\nexport const cloneWithProject = (sourceDm, projField, config, allFields) => {\n const cloned = sourceDm.clone(config.saveChild);\n let projectionSet = projField;\n if (config.mode === FilteringMode.INVERSE) {\n projectionSet = allFields.filter(fieldName => projField.indexOf(fieldName) === -1);\n }\n // cloned._colIdentifier = sourceDm._colIdentifier.split(',')\n // .filter(coll => projectionSet.indexOf(coll) !== -1).join();\n cloned._colIdentifier = projectionSet.join(',');\n cloned.__calculateFieldspace().calculateFieldsConfig();\n\n persistDerivations(\n sourceDm,\n cloned,\n DM_DERIVATIVES.PROJECT,\n { projField, config, actualProjField: projectionSet },\n null\n );\n\n return cloned;\n};\n\n\nexport const splitWithProject = (sourceDm, projFieldSet, config, allFields) =>\n projFieldSet.map(projFields =>\n cloneWithProject(sourceDm, projFields, config, allFields));\n\nexport const sanitizeUnitSchema = (unitSchema) => {\n // Do deep clone of the unit schema as the user might change it later.\n unitSchema = extend2({}, unitSchema);\n if (!unitSchema.type) {\n unitSchema.type = FieldType.DIMENSION;\n }\n\n if (!unitSchema.subtype) {\n switch (unitSchema.type) {\n case FieldType.MEASURE:\n unitSchema.subtype = MeasureSubtype.CONTINUOUS;\n break;\n default:\n case FieldType.DIMENSION:\n unitSchema.subtype = DimensionSubtype.CATEGORICAL;\n break;\n }\n }\n\n return unitSchema;\n};\n\nexport const validateUnitSchema = (unitSchema) => {\n const { type, subtype, name } = unitSchema;\n if (type === FieldType.DIMENSION || type === FieldType.MEASURE) {\n if (!fieldRegistry.has(subtype)) {\n throw new Error(`DataModel doesn't support measure field subtype ${subtype} used for ${name} field`);\n }\n } else {\n throw new Error(`DataModel doesn't support field type ${type} used for ${name} field`);\n }\n};\n\nexport const sanitizeAndValidateSchema = schema => schema.map((unitSchema) => {\n unitSchema = sanitizeUnitSchema(unitSchema);\n validateUnitSchema(unitSchema);\n return unitSchema;\n});\n\nexport const resolveFieldName = (schema, dataHeader) => {\n schema.forEach((unitSchema) => {\n const fieldNameAs = unitSchema.as;\n if (!fieldNameAs) { return; }\n\n const idx = dataHeader.indexOf(unitSchema.name);\n dataHeader[idx] = fieldNameAs;\n unitSchema.name = fieldNameAs;\n delete unitSchema.as;\n });\n};\n\nexport const updateData = (relation, data, schema, options) => {\n schema = sanitizeAndValidateSchema(schema);\n options = Object.assign(Object.assign({}, defaultConfig), options);\n const converter = converterStore.get(options.dataFormat);\n\n\n if (!converter) {\n throw new Error(`No converter function found for ${options.dataFormat} format`);\n }\n\n const [header, formattedData] = converter.convert(data, schema, options);\n resolveFieldName(schema, header);\n const fieldArr = createFields(formattedData, schema, header);\n\n // This will create a new fieldStore with the fields\n const nameSpace = fieldStore.createNamespace(fieldArr, options.name);\n relation._partialFieldspace = nameSpace;\n\n // If data is provided create the default colIdentifier and rowDiffset\n relation._rowDiffset = formattedData.length && formattedData[0].length ? `0-${formattedData[0].length - 1}` : '';\n\n // This stores the value objects which is passed to the filter method when selection operation is done.\n const valueObjects = [];\n const { fields } = nameSpace;\n const rawFieldsData = fields.map(field => field.data());\n const formattedFieldsData = fields.map(field => field.formattedData());\n rowDiffsetIterator(relation._rowDiffset, (i) => {\n valueObjects[i] = prepareSelectionData(fields, formattedFieldsData, rawFieldsData, i);\n });\n nameSpace._cachedValueObjects = valueObjects;\n\n relation._colIdentifier = (schema.map(_ => _.name)).join();\n relation._dataFormat = options.dataFormat === DataFormat.AUTO ? detectDataFormat(data) : options.dataFormat;\n return relation;\n};\n\nexport const fieldInSchema = (schema, field) => {\n let i = 0;\n\n for (; i < schema.length; ++i) {\n if (field === schema[i].name) {\n return {\n name: field,\n type: schema[i].subtype || schema[i].type,\n index: i,\n };\n }\n }\n return null;\n};\n\nexport const getDerivationArguments = (derivation) => {\n let params = [];\n let operation;\n operation = derivation.op;\n switch (operation) {\n case DM_DERIVATIVES.SELECT:\n params = [derivation.criteria];\n break;\n case DM_DERIVATIVES.PROJECT:\n params = [derivation.meta.actualProjField];\n break;\n case DM_DERIVATIVES.SORT:\n params = [derivation.criteria];\n break;\n case DM_DERIVATIVES.GROUPBY:\n operation = 'groupBy';\n params = [derivation.meta.groupByString.split(','), derivation.criteria];\n break;\n default:\n operation = null;\n }\n\n return {\n operation,\n params\n };\n};\n\nconst applyExistingOperationOnModel = (propModel, dataModel) => {\n const derivations = dataModel.getDerivations();\n let selectionModel = propModel;\n\n derivations.forEach((derivation) => {\n if (!derivation) {\n return;\n }\n\n const { operation, params } = getDerivationArguments(derivation);\n if (operation) {\n selectionModel = selectionModel[operation](...params, {\n saveChild: false\n });\n }\n });\n\n return selectionModel;\n};\n\nconst getFilteredModel = (propModel, path) => {\n for (let i = 0, len = path.length; i < len; i++) {\n const model = path[i];\n propModel = applyExistingOperationOnModel(propModel, model);\n }\n return propModel;\n};\n\nconst propagateIdentifiers = (dataModel, propModel, config = {}, propModelInf = {}) => {\n const excludeModels = propModelInf.excludeModels || [];\n const criterias = propModelInf.criteria;\n\n const propagate = excludeModels.length ? excludeModels.indexOf(dataModel) === -1 : true;\n\n propagate && dataModel.handlePropagation(propModel, config);\n\n const children = dataModel._children;\n children.forEach((child) => {\n const matchingCriteria = criterias.filter(val => val.groupedModel === child);\n let selectionModel = applyExistingOperationOnModel(propModel, child);\n\n if (matchingCriteria.length) {\n selectionModel = filterPropagationModel(selectionModel, matchingCriteria, {\n filterByDim: false,\n filterByMeasure: true,\n clone: false\n });\n }\n propagateIdentifiers(child, selectionModel, config, propModelInf);\n });\n};\n\nexport const getRootGroupByModel = (model) => {\n while (model._parent && model._derivation.find(d => d.op !== DM_DERIVATIVES.GROUPBY)) {\n model = model._parent;\n }\n return model;\n};\n\nexport const getRootDataModel = (model) => {\n while (model._parent) {\n model = model._parent;\n }\n return model;\n};\n\nexport const getPathToRootModel = (model, path = []) => {\n while (model._parent) {\n path.push(model);\n model = model._parent;\n }\n return path;\n};\n\nexport const propagateToAllDataModels = (identifiers, rootModels, propagationInf, config) => {\n let criteria;\n const { propagationNameSpace, propagateToSource } = propagationInf;\n const propagationSourceId = propagationInf.sourceId;\n const filterFn = (entry) => {\n const filter = config.filterFn || (() => true);\n return filter(entry, config);\n };\n\n const addGroupedModel = ({ config: conf, model }) => {\n const { criteria: crit } = conf;\n let groupedModel;\n\n if (crit !== null && crit.fields.some(d => d.type === FieldType.MEASURE)) {\n groupedModel = getRootGroupByModel(model);\n }\n return Object.assign({}, conf, {\n groupedModel\n });\n };\n\n let criterias = [];\n\n if (identifiers === null) {\n criterias = [{\n criteria: []\n }];\n criteria = [];\n } else {\n let actionCriterias = Object.values(propagationNameSpace.mutableActions);\n if (propagateToSource !== false) {\n actionCriterias = actionCriterias.filter(d => d.config.sourceId !== propagationSourceId);\n }\n\n const filteredCriteria = actionCriterias.filter(filterFn);\n\n const excludeModels = [];\n\n if (propagateToSource !== false) {\n const sourceActionCriterias = Object.values(propagationNameSpace.mutableActions);\n\n sourceActionCriterias.forEach((actionInf) => {\n const actionConf = actionInf.config;\n if (actionConf.applyOnSource === false && actionConf.action === config.action &&\n actionConf.sourceId !== propagationSourceId) {\n excludeModels.push(actionInf.model);\n criteria = sourceActionCriterias.filter(d => d !== actionInf).map(addGroupedModel);\n criteria.length && criterias.push({\n criteria,\n models: actionInf.model,\n path: getPathToRootModel(actionInf.model)\n });\n }\n });\n }\n\n\n criteria = [].concat(...[...filteredCriteria.map(addGroupedModel), {\n criteria: identifiers,\n groupedModel: identifiers !== null && identifiers.fields.some(d => d.type === FieldType.MEASURE) ?\n getRootGroupByModel(propagationInf.propagationSource) : null\n }]).filter(d => d !== null);\n criterias.push({\n criteria,\n excludeModels: [...excludeModels, ...config.excludeModels || []]\n });\n }\n\n const rootModel = rootModels.model;\n\n const propConfig = Object.assign({\n sourceIdentifiers: identifiers,\n propagationSourceId\n }, config);\n\n criterias.forEach((inf) => {\n const { criteria: crit } = inf;\n const propagationModel = filterPropagationModel(rootModel, crit, {\n filterByMeasure: !!crit.find(d => d.groupedModel === rootModel)\n });\n const path = inf.path;\n\n if (path) {\n const filteredModel = getFilteredModel(propagationModel, path.reverse());\n inf.models.handlePropagation(filteredModel, propConfig);\n } else {\n propagateIdentifiers(rootModel, propagationModel, propConfig, {\n excludeModels: inf.excludeModels,\n criteria: crit\n });\n }\n });\n};\n\nexport const propagateImmutableActions = (propagationNameSpace, rootModel, propagationInf) => {\n const immutableActions = propagationNameSpace.immutableActions;\n\n for (const action in immutableActions) {\n const actionInf = immutableActions[action];\n const actionConf = actionInf.config;\n const propagationSourceId = propagationInf.config.sourceId;\n const filterImmutableAction = propagationInf.propConfig.filterImmutableAction ?\n propagationInf.propConfig.filterImmutableAction(actionConf, propagationInf.config) : true;\n if (actionConf.sourceId !== propagationSourceId && filterImmutableAction) {\n const criteriaModel = actionConf.criteria;\n propagateToAllDataModels(criteriaModel, {\n model: rootModel,\n groupByModel: getRootGroupByModel(actionInf.model)\n }, {\n propagationNameSpace,\n propagateToSource: false,\n sourceId: propagationSourceId,\n propagationSource: actionInf.model\n }, actionConf);\n }\n }\n};\n\nexport const addToPropNamespace = (propagationNameSpace, config = {}, model) => {\n let sourceNamespace;\n const isMutableAction = config.isMutableAction;\n const criteria = config.criteria;\n const key = `${config.action}-${config.sourceId}`;\n\n if (isMutableAction) {\n sourceNamespace = propagationNameSpace.mutableActions;\n } else {\n sourceNamespace = propagationNameSpace.immutableActions;\n }\n\n if (criteria === null) {\n delete sourceNamespace[key];\n } else {\n sourceNamespace[key] = {\n model,\n config\n };\n }\n\n return this;\n};\n\n\nexport const getNormalizedProFields = (projField, allFields, fieldConfig) => {\n const normalizedProjField = projField.reduce((acc, field) => {\n if (field.constructor.name === 'RegExp') {\n acc.push(...allFields.filter(fieldName => fieldName.search(field) !== -1));\n } else if (field in fieldConfig) {\n acc.push(field);\n }\n return acc;\n }, []);\n return Array.from(new Set(normalizedProjField)).map(field => field.trim());\n};\n\n/**\n * Get the numberFormatted value if numberFormat present,\n * else returns the supplied value.\n * @param {Object} field Field Instance\n * @param {Number|String} value\n * @return {Number|String}\n */\nexport const getNumberFormattedVal = (field, value) => {\n if (field.numberFormat) {\n return field.numberFormat()(value);\n }\n return value;\n};\n","import { FilteringMode } from './enums';\nimport { getUniqueId } from './utils';\nimport {\n updateFields,\n cloneWithSelect,\n cloneWithProject,\n updateData,\n getNormalizedProFields\n} from './helper';\nimport { crossProduct, difference, naturalJoinFilter, union } from './operator';\n\n/**\n * Relation provides the definitions of basic operators of relational algebra like *selection*, *projection*, *union*,\n * *difference* etc.\n *\n * It is extended by {@link DataModel} to inherit the functionalities of relational algebra concept.\n *\n * @class\n * @public\n * @module Relation\n * @namespace DataModel\n */\nclass Relation {\n\n /**\n * Creates a new Relation instance by providing underlying data and schema.\n *\n * @private\n *\n * @param {Object | string | Relation} data - The input tabular data in dsv or json format or\n * an existing Relation instance object.\n * @param {Array} schema - An array of data schema.\n * @param {Object} [options] - The optional options.\n */\n constructor (...params) {\n let source;\n\n this._parent = null;\n this._derivation = [];\n this._ancestorDerivation = [];\n this._children = [];\n\n if (params.length === 1 && ((source = params[0]) instanceof Relation)) {\n // parent datamodel was passed as part of source\n this._colIdentifier = source._colIdentifier;\n this._rowDiffset = source._rowDiffset;\n this._dataFormat = source._dataFormat;\n this._parent = source;\n this._partialFieldspace = this._parent._partialFieldspace;\n this._fieldStoreName = getUniqueId();\n this.__calculateFieldspace().calculateFieldsConfig();\n } else {\n updateData(this, ...params);\n this._fieldStoreName = this._partialFieldspace.name;\n this.__calculateFieldspace().calculateFieldsConfig();\n this._propagationNameSpace = {\n mutableActions: {},\n immutableActions: {}\n };\n }\n }\n\n /**\n * Retrieves the {@link Schema | schema} details for every {@link Field | field} as an array.\n *\n * @public\n *\n * @return {Array.} Array of fields schema.\n * ```\n * [\n * { name: 'Name', type: 'dimension' },\n * { name: 'Miles_per_Gallon', type: 'measure', numberFormat: (val) => `${val} miles / gallon` },\n * { name: 'Cylinder', type: 'dimension' },\n * { name: 'Displacement', type: 'measure', defAggFn: 'max' },\n * { name: 'HorsePower', type: 'measure', defAggFn: 'max' },\n * { name: 'Weight_in_lbs', type: 'measure', defAggFn: 'avg', },\n * { name: 'Acceleration', type: 'measure', defAggFn: 'avg' },\n * { name: 'Year', type: 'dimension', subtype: 'datetime', format: '%Y' },\n * { name: 'Origin' }\n * ]\n * ```\n */\n getSchema () {\n return this.getFieldspace().fields.map(d => d.schema());\n }\n\n /**\n * Returns the name of the {@link DataModel} instance. If no name was specified during {@link DataModel}\n * initialization, then it returns a auto-generated name.\n *\n * @public\n *\n * @return {string} Name of the DataModel instance.\n */\n getName() {\n return this._fieldStoreName;\n }\n\n getFieldspace () {\n return this._fieldspace;\n }\n\n __calculateFieldspace () {\n this._fieldspace = updateFields([this._rowDiffset, this._colIdentifier],\n this.getPartialFieldspace(), this._fieldStoreName);\n return this;\n }\n\n getPartialFieldspace () {\n return this._partialFieldspace;\n }\n\n /**\n * Performs {@link link_of_cross_product | cross-product} between two {@link DataModel} instances and returns a\n * new {@link DataModel} instance containing the results. This operation is also called theta join.\n *\n * Cross product takes two set and create one set where each value of one set is paired with each value of another\n * set.\n *\n * This method takes an optional predicate which filters the generated result rows. If the predicate returns true\n * the combined row is included in the resulatant table.\n *\n * @example\n * let originDM = dm.project(['Origin','Origin_Formal_Name']);\n * let carsDM = dm.project(['Name','Miles_per_Gallon','Origin'])\n *\n * console.log(carsDM.join(originDM)));\n *\n * console.log(carsDM.join(originDM,\n * obj => obj.[originDM.getName()].Origin === obj.[carsDM.getName()].Origin));\n *\n * @text\n * This is chained version of `join` operator. `join` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} joinWith - The DataModel to be joined with the current instance DataModel.\n * @param {SelectionPredicate} filterFn - The predicate function that will filter the result of the crossProduct.\n *\n * @return {DataModel} New DataModel instance created after joining.\n */\n join (joinWith, filterFn) {\n return crossProduct(this, joinWith, filterFn);\n }\n\n /**\n * {@link natural_join | Natural join} is a special kind of cross-product join where filtering of rows are performed\n * internally by resolving common fields are from both table and the rows with common value are included.\n *\n * @example\n * let originDM = dm.project(['Origin','Origin_Formal_Name']);\n * let carsDM = dm.project(['Name','Miles_per_Gallon','Origin'])\n *\n * console.log(carsDM.naturalJoin(originDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} joinWith - The DataModel with which the current instance of DataModel on which the method is\n * called will be joined.\n * @return {DataModel} New DataModel instance created after joining.\n */\n naturalJoin (joinWith) {\n return crossProduct(this, joinWith, naturalJoinFilter(this, joinWith), true);\n }\n\n /**\n * {@link link_to_union | Union} operation can be termed as vertical stacking of all rows from both the DataModel\n * instances, provided that both of the {@link DataModel} instances should have same column names.\n *\n * @example\n * console.log(EuropeanMakerDM.union(USAMakerDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} unionWith - DataModel instance for which union has to be applied with the instance on which\n * the method is called\n *\n * @return {DataModel} New DataModel instance with the result of the operation\n */\n union (unionWith) {\n return union(this, unionWith);\n }\n\n /**\n * {@link link_to_difference | Difference } operation only include rows which are present in the datamodel on which\n * it was called but not on the one passed as argument.\n *\n * @example\n * console.log(highPowerDM.difference(highExpensiveDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} differenceWith - DataModel instance for which difference has to be applied with the instance\n * on which the method is called\n * @return {DataModel} New DataModel instance with the result of the operation\n */\n difference (differenceWith) {\n return difference(this, differenceWith);\n }\n\n /**\n * {@link link_to_selection | Selection} is a row filtering operation. It expects a predicate and an optional mode\n * which control which all rows should be included in the resultant DataModel instance.\n *\n * {@link SelectionPredicate} is a function which returns a boolean value. For selection operation the selection\n * function is called for each row of DataModel instance with the current row passed as argument.\n *\n * After executing {@link SelectionPredicate} the rows are labeled as either an entry of selection set or an entry\n * of rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resultant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @example\n * // with selection mode NORMAL:\n * const normDt = dt.select(fields => fields.Origin.value === \"USA\")\n * console.log(normDt));\n *\n * // with selection mode INVERSE:\n * const inverDt = dt.select(fields => fields.Origin.value === \"USA\", { mode: DataModel.FilteringMode.INVERSE })\n * console.log(inverDt);\n *\n * // with selection mode ALL:\n * const dtArr = dt.select(fields => fields.Origin.value === \"USA\", { mode: DataModel.FilteringMode.ALL })\n * // print the selected parts\n * console.log(dtArr[0]);\n * // print the inverted parts\n * console.log(dtArr[1]);\n *\n * @text\n * This is chained version of `select` operator. `select` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {Function} selectFn - The predicate function which is called for each row with the current row.\n * ```\n * function (row, i, cloneProvider, store) { ... }\n * ```\n * @param {Object} config - The configuration object to control the inclusion exclusion of a row in resultant\n * DataModel instance.\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - The mode of the selection.\n * @return {DataModel} Returns the new DataModel instance(s) after operation.\n */\n select (selectFn, config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n config = Object.assign({}, defConfig, config);\n config.mode = config.mode || defConfig.mode;\n\n const cloneConfig = { saveChild: config.saveChild };\n return cloneWithSelect(\n this,\n selectFn,\n config,\n cloneConfig\n );\n }\n\n /**\n * Retrieves a boolean value if the current {@link DataModel} instance has data.\n *\n * @example\n * const schema = [\n * { name: 'CarName', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n * const data = [];\n *\n * const dt = new DataModel(data, schema);\n * console.log(dt.isEmpty());\n *\n * @public\n *\n * @return {Boolean} True if the datamodel has no data, otherwise false.\n */\n isEmpty () {\n return !this._rowDiffset.length || !this._colIdentifier.length;\n }\n\n /**\n * Creates a clone from the current DataModel instance with child parent relationship.\n *\n * @private\n * @param {boolean} [saveChild=true] - Whether the cloned instance would be recorded in the parent instance.\n * @return {DataModel} - Returns the newly cloned DataModel instance.\n */\n clone (saveChild = true) {\n const clonedDm = new this.constructor(this);\n if (saveChild) {\n clonedDm.setParent(this);\n } else {\n clonedDm.setParent(null);\n }\n return clonedDm;\n }\n\n /**\n * {@link Projection} is filter column (field) operation. It expects list of fields' name and either include those\n * or exclude those based on {@link FilteringMode} on the resultant variable.\n *\n * Projection expects array of fields name based on which it creates the selection and rejection set. All the field\n * whose name is present in array goes in selection set and rest of the fields goes in rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @example\n * const dm = new DataModel(data, schema);\n *\n * // with projection mode NORMAL:\n * const normDt = dt.project([\"Name\", \"HorsePower\"]);\n * console.log(normDt.getData());\n *\n * // with projection mode INVERSE:\n * const inverDt = dt.project([\"Name\", \"HorsePower\"], { mode: DataModel.FilteringMode.INVERSE })\n * console.log(inverDt.getData());\n *\n * // with selection mode ALL:\n * const dtArr = dt.project([\"Name\", \"HorsePower\"], { mode: DataModel.FilteringMode.ALL })\n * // print the normal parts\n * console.log(dtArr[0].getData());\n * // print the inverted parts\n * console.log(dtArr[1].getData());\n *\n * @text\n * This is chained version of `select` operator. `select` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {Array.} projField - An array of column names in string or regular expression.\n * @param {Object} [config] - An optional config to control the creation of new DataModel\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - Mode of the projection\n *\n * @return {DataModel} Returns the new DataModel instance after operation.\n */\n project (projField, config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n config = Object.assign({}, defConfig, config);\n const fieldConfig = this.getFieldsConfig();\n const allFields = Object.keys(fieldConfig);\n const { mode } = config;\n const normalizedProjField = getNormalizedProFields(projField, allFields, fieldConfig);\n\n let dataModel;\n\n if (mode === FilteringMode.ALL) {\n let projectionClone = cloneWithProject(this, normalizedProjField, {\n mode: FilteringMode.NORMAL,\n saveChild: config.saveChild\n }, allFields);\n let rejectionClone = cloneWithProject(this, normalizedProjField, {\n mode: FilteringMode.INVERSE,\n saveChild: config.saveChild\n }, allFields);\n dataModel = [projectionClone, rejectionClone];\n } else {\n let projectionClone = cloneWithProject(this, normalizedProjField, config, allFields);\n dataModel = projectionClone;\n }\n\n return dataModel;\n }\n\n getFieldsConfig () {\n return this._fieldConfig;\n }\n\n calculateFieldsConfig () {\n this._fieldConfig = this._fieldspace.fields.reduce((acc, fieldObj, i) => {\n acc[fieldObj.name()] = {\n index: i,\n def: fieldObj.schema(),\n };\n return acc;\n }, {});\n return this;\n }\n\n\n /**\n * Frees up the resources associated with the current DataModel instance and breaks all the links instance has in\n * the DAG.\n *\n * @public\n */\n dispose () {\n this._parent && this._parent.removeChild(this);\n this._parent = null;\n this._children.forEach((child) => {\n child._parent = null;\n });\n this._children = [];\n }\n\n /**\n * Removes the specified child {@link DataModel} from the child list of the current {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\")\n * dt.removeChild(dt2);\n *\n * @private\n *\n * @param {DataModel} child - Delegates the parent to remove this child.\n */\n removeChild (child) {\n let idx = this._children.findIndex(sibling => sibling === child);\n idx !== -1 ? this._children.splice(idx, 1) : true;\n }\n\n /**\n * Sets the specified {@link DataModel} as a parent for the current {@link DataModel} instance.\n *\n * @param {DataModel} parent - The datamodel instance which will act as parent.\n */\n setParent (parent) {\n this._parent && this._parent.removeChild(this);\n this._parent = parent;\n parent && parent._children.push(this);\n }\n\n /**\n * Returns the parent {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const parentDm = dt2.getParent();\n *\n * @return {DataModel} Returns the parent DataModel instance.\n */\n getParent () {\n return this._parent;\n }\n\n /**\n * Returns the immediate child {@link DataModel} instances.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const childDm1 = dt.select(fields => fields.Origin.value === \"USA\");\n * const childDm2 = dt.select(fields => fields.Origin.value === \"Japan\");\n * const childDm3 = dt.groupBy([\"Origin\"]);\n *\n * @return {DataModel[]} Returns the immediate child DataModel instances.\n */\n getChildren () {\n return this._children;\n }\n\n /**\n * Returns the in-between operation meta data while creating the current {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const dt3 = dt2.groupBy([\"Origin\"]);\n * const derivations = dt3.getDerivations();\n *\n * @return {Any[]} Returns the derivation meta data.\n */\n getDerivations () {\n return this._derivation;\n }\n\n /**\n * Returns the in-between operation meta data happened from root {@link DataModel} to current instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const dt3 = dt2.groupBy([\"Origin\"]);\n * const ancDerivations = dt3.getAncestorDerivations();\n *\n * @return {Any[]} Returns the previous derivation meta data.\n */\n getAncestorDerivations () {\n return this._ancestorDerivation;\n }\n}\n\nexport default Relation;\n","/* eslint-disable default-case */\n\nimport { FieldType, DimensionSubtype, DataFormat, FilteringMode } from './enums';\nimport {\n persistDerivations,\n getRootGroupByModel,\n propagateToAllDataModels,\n getRootDataModel,\n propagateImmutableActions,\n addToPropNamespace,\n sanitizeUnitSchema,\n splitWithSelect,\n splitWithProject,\n getNormalizedProFields\n} from './helper';\nimport { DM_DERIVATIVES, PROPAGATION } from './constants';\nimport {\n dataBuilder,\n rowDiffsetIterator,\n groupBy\n} from './operator';\nimport { createBinnedFieldData } from './operator/bucket-creator';\nimport Relation from './relation';\nimport reducerStore from './utils/reducer-store';\nimport { createFields } from './field-creator';\nimport InvalidAwareTypes from './invalid-aware-types';\nimport Value from './value';\nimport { converterStore } from './converter';\nimport { fieldRegistry } from './fields';\n\n/**\n * DataModel is an in-browser representation of tabular data. It supports\n * {@link https://en.wikipedia.org/wiki/Relational_algebra | relational algebra} operators as well as generic data\n * processing opearators.\n * DataModel extends {@link Relation} class which defines all the relational algebra opreators. DataModel gives\n * definition of generic data processing operators which are not relational algebra complient.\n *\n * @public\n * @class\n * @extends Relation\n * @memberof Datamodel\n */\nclass DataModel extends Relation {\n /**\n * Creates a new DataModel instance by providing data and schema. Data could be in the form of\n * - Flat JSON\n * - DSV String\n * - 2D Array\n *\n * By default DataModel finds suitable adapter to serialize the data. DataModel also expects a\n * {@link Schema | schema} for identifying the variables present in data.\n *\n * @constructor\n * @example\n * const data = loadData('cars.csv');\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'Miles_per_Gallon', type: 'measure', unit : 'cm', scale: '1000', numberformat: val => `${val}G`},\n * { name: 'Cylinders', type: 'dimension' },\n * { name: 'Displacement', type: 'measure' },\n * { name: 'Horsepower', type: 'measure' },\n * { name: 'Weight_in_lbs', type: 'measure' },\n * { name: 'Acceleration', type: 'measure' },\n * { name: 'Year', type: 'dimension', subtype: 'datetime', format: '%Y' },\n * { name: 'Origin', type: 'dimension' }\n * ];\n * const dm = new DataModel(data, schema, { name: 'Cars' });\n * table(dm);\n *\n * @public\n *\n * @param {Array. | string | Array.} data Input data in any of the mentioned formats\n * @param {Array.} schema Defination of the variables. Order of the variables in data and order of the\n * variables in schema has to be same.\n * @param {object} [options] Optional arguments to specify more settings regarding the creation part\n * @param {string} [options.name] Name of the datamodel instance. If no name is given an auto generated name is\n * assigned to the instance.\n * @param {string} [options.fieldSeparator=','] specify field separator type if the data is of type dsv string.\n */\n constructor (...args) {\n super(...args);\n\n this._onPropagation = [];\n }\n\n /**\n * Reducers are simple functions which reduces an array of numbers to a representative number of the set.\n * Like an array of numbers `[10, 20, 5, 15]` can be reduced to `12.5` if average / mean reducer function is\n * applied. All the measure fields in datamodel (variables in data) needs a reducer to handle aggregation.\n *\n * @public\n *\n * @return {ReducerStore} Singleton instance of {@link ReducerStore}.\n */\n static get Reducers () {\n return reducerStore;\n }\n\n /**\n * Converters are functions that transforms data in various format tpo datamodel consumabe format.\n */\n static get Converters() {\n return converterStore;\n }\n\n /**\n * Register new type of fields\n */\n static get FieldTypes() {\n return fieldRegistry;\n }\n\n /**\n * Configure null, undefined, invalid values in the source data\n *\n * @public\n *\n * @param {Object} [config] - Configuration to control how null, undefined and non-parsable values are\n * represented in DataModel.\n * @param {string} [config.undefined] - Define how an undefined value will be represented.\n * @param {string} [config.null] - Define how a null value will be represented.\n * @param {string} [config.invalid] - Define how a non-parsable value will be represented.\n */\n static configureInvalidAwareTypes (config) {\n return InvalidAwareTypes.invalidAwareVals(config);\n }\n\n /**\n * Retrieve the data attached to an instance in JSON format.\n *\n * @example\n * // DataModel instance is already prepared and assigned to dm variable\n * const data = dm.getData({\n * order: 'column',\n * formatter: {\n * origin: (val) => val === 'European Union' ? 'EU' : val;\n * }\n * });\n * console.log(data);\n *\n * @public\n *\n * @param {Object} [options] Options to control how the raw data is to be returned.\n * @param {string} [options.order='row'] Defines if data is retieved in row order or column order. Possible values\n * are `'rows'` and `'columns'`\n * @param {Function} [options.formatter=null] Formats the output data. This expects an object, where the keys are\n * the name of the variable needs to be formatted. The formatter function is called for each row passing the\n * value of the cell for a particular row as arguments. The formatter is a function in the form of\n * `function (value, rowId, schema) => { ... }`\n * Know more about {@link Fomatter}.\n *\n * @return {Array} Returns a multidimensional array of the data with schema. The return format looks like\n * ```\n * {\n * data,\n * schema\n * }\n * ```\n */\n getData (options) {\n const defOptions = {\n order: 'row',\n formatter: null,\n withUid: false,\n getAllFields: false,\n sort: []\n };\n options = Object.assign({}, defOptions, options);\n const fields = this.getPartialFieldspace().fields;\n\n const dataGenerated = dataBuilder.call(\n this,\n this.getPartialFieldspace().fields,\n this._rowDiffset,\n options.getAllFields ? fields.map(d => d.name()).join() : this._colIdentifier,\n options.sort,\n {\n columnWise: options.order === 'column',\n addUid: !!options.withUid\n }\n );\n\n if (!options.formatter) {\n return dataGenerated;\n }\n\n const { formatter } = options;\n const { data, schema, uids } = dataGenerated;\n const fieldNames = schema.map((e => e.name));\n const fmtFieldNames = Object.keys(formatter);\n const fmtFieldIdx = fmtFieldNames.reduce((acc, next) => {\n const idx = fieldNames.indexOf(next);\n if (idx !== -1) {\n acc.push([idx, formatter[next]]);\n }\n return acc;\n }, []);\n\n if (options.order === 'column') {\n fmtFieldIdx.forEach((elem) => {\n const fIdx = elem[0];\n const fmtFn = elem[1];\n\n data[fIdx].forEach((datum, datumIdx) => {\n data[fIdx][datumIdx] = fmtFn.call(\n undefined,\n datum,\n uids[datumIdx],\n schema[fIdx]\n );\n });\n });\n } else {\n data.forEach((datum, datumIdx) => {\n fmtFieldIdx.forEach((elem) => {\n const fIdx = elem[0];\n const fmtFn = elem[1];\n\n datum[fIdx] = fmtFn.call(\n undefined,\n datum[fIdx],\n uids[datumIdx],\n schema[fIdx]\n );\n });\n });\n }\n\n return dataGenerated;\n }\n\n /**\n * Returns the unique ids in an array.\n *\n * @return {Array} Returns an array of ids.\n */\n getUids () {\n const rowDiffset = this._rowDiffset;\n const ids = [];\n\n if (rowDiffset.length) {\n const diffSets = rowDiffset.split(',');\n\n diffSets.forEach((set) => {\n let [start, end] = set.split('-').map(Number);\n\n end = end !== undefined ? end : start;\n ids.push(...Array(end - start + 1).fill().map((_, idx) => start + idx));\n });\n }\n\n return ids;\n }\n /**\n * Groups the data using particular dimensions and by reducing measures. It expects a list of dimensions using which\n * it projects the datamodel and perform aggregations to reduce the duplicate tuples. Refer this\n * {@link link_to_one_example_with_group_by | document} to know the intuition behind groupBy.\n *\n * DataModel by default provides definition of few {@link reducer | Reducers}.\n * {@link ReducerStore | User defined reducers} can also be registered.\n *\n * This is the chained implementation of `groupBy`.\n * `groupBy` also supports {@link link_to_compose_groupBy | composability}\n *\n * @example\n * const groupedDM = dm.groupBy(['Year'], { horsepower: 'max' } );\n * console.log(groupedDm);\n *\n * @public\n *\n * @param {Array.} fieldsArr - Array containing the name of dimensions\n * @param {Object} [reducers={}] - A map whose key is the variable name and value is the name of the reducer. If its\n * not passed, or any variable is ommitted from the object, default aggregation function is used from the\n * schema of the variable.\n *\n * @return {DataModel} Returns a new DataModel instance after performing the groupby.\n */\n groupBy (fieldsArr, reducers = {}, config = { saveChild: true }) {\n const groupByString = `${fieldsArr.join()}`;\n let params = [this, fieldsArr, reducers];\n const newDataModel = groupBy(...params);\n\n persistDerivations(\n this,\n newDataModel,\n DM_DERIVATIVES.GROUPBY,\n { fieldsArr, groupByString, defaultReducer: reducerStore.defaultReducer() },\n reducers\n );\n\n if (config.saveChild) {\n newDataModel.setParent(this);\n } else {\n newDataModel.setParent(null);\n }\n\n return newDataModel;\n }\n\n /**\n * Performs sorting operation on the current {@link DataModel} instance according to the specified sorting details.\n * Like every other operator it doesn't mutate the current DataModel instance on which it was called, instead\n * returns a new DataModel instance containing the sorted data.\n *\n * DataModel support multi level sorting by listing the variables using which sorting needs to be performed and\n * the type of sorting `ASC` or `DESC`.\n *\n * In the following example, data is sorted by `Origin` field in `DESC` order in first level followed by another\n * level of sorting by `Acceleration` in `ASC` order.\n *\n * @example\n * // here dm is the pre-declared DataModel instance containing the data of 'cars.json' file\n * let sortedDm = dm.sort([\n * [\"Origin\", \"DESC\"]\n * [\"Acceleration\"] // Default value is ASC\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * // Sort with a custom sorting function\n * sortedDm = dm.sort([\n * [\"Origin\", \"DESC\"]\n * [\"Acceleration\", (a, b) => a - b] // Custom sorting function\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * @text\n * DataModel also provides another sorting mechanism out of the box where sort is applied to a variable using\n * another variable which determines the order.\n * Like the above DataModel contains three fields `Origin`, `Name` and `Acceleration`. Now, the data in this\n * model can be sorted by `Origin` field according to the average value of all `Acceleration` for a\n * particular `Origin` value.\n *\n * @example\n * // here dm is the pre-declared DataModel instance containing the data of 'cars.json' file\n * const sortedDm = dm.sort([\n * ['Origin', ['Acceleration', (a, b) => avg(...a.Acceleration) - avg(...b.Acceleration)]]\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * @public\n *\n * @param {Array.} sortingDetails - Sorting details based on which the sorting will be performed.\n * @return {DataModel} Returns a new instance of DataModel with sorted data.\n */\n sort (sortingDetails, config = { saveChild: false }) {\n const rawData = this.getData({\n order: 'row',\n sort: sortingDetails\n });\n const header = rawData.schema.map(field => field.name);\n const dataInCSVArr = [header].concat(rawData.data);\n\n const sortedDm = new this.constructor(dataInCSVArr, rawData.schema, { dataFormat: 'DSVArr' });\n\n persistDerivations(\n this,\n sortedDm,\n DM_DERIVATIVES.SORT,\n config,\n sortingDetails\n );\n\n if (config.saveChild) {\n sortedDm.setParent(this);\n } else {\n sortedDm.setParent(null);\n }\n\n return sortedDm;\n }\n\n /**\n * Performs the serialization operation on the current {@link DataModel} instance according to the specified data\n * type. When an {@link DataModel} instance is created, it de-serializes the input data into its internal format,\n * and during its serialization process, it converts its internal data format to the specified data type and returns\n * that data regardless what type of data is used during the {@link DataModel} initialization.\n *\n * @example\n * // here dm is the pre-declared DataModel instance.\n * const csvData = dm.serialize(DataModel.DataFormat.DSV_STR, { fieldSeparator: \",\" });\n * console.log(csvData); // The csv formatted data.\n *\n * const jsonData = dm.serialize(DataModel.DataFormat.FLAT_JSON);\n * console.log(jsonData); // The json data.\n *\n * @public\n *\n * @param {string} type - The data type name for serialization.\n * @param {Object} options - The optional option object.\n * @param {string} options.fieldSeparator - The field separator character for DSV data type.\n * @return {Array|string} Returns the serialized data.\n */\n serialize (type, options) {\n type = type || this._dataFormat;\n options = Object.assign({}, { fieldSeparator: ',' }, options);\n\n const fields = this.getFieldspace().fields;\n const colData = fields.map(f => f.formattedData());\n const rowsCount = colData[0].length;\n let serializedData;\n let rowIdx;\n let colIdx;\n\n if (type === DataFormat.FLAT_JSON) {\n serializedData = [];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = {};\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row[fields[colIdx].name()] = colData[colIdx][rowIdx];\n }\n serializedData.push(row);\n }\n } else if (type === DataFormat.DSV_STR) {\n serializedData = [fields.map(f => f.name()).join(options.fieldSeparator)];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = [];\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row.push(colData[colIdx][rowIdx]);\n }\n serializedData.push(row.join(options.fieldSeparator));\n }\n serializedData = serializedData.join('\\n');\n } else if (type === DataFormat.DSV_ARR) {\n serializedData = [fields.map(f => f.name())];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = [];\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row.push(colData[colIdx][rowIdx]);\n }\n serializedData.push(row);\n }\n } else {\n throw new Error(`Data type ${type} is not supported`);\n }\n\n return serializedData;\n }\n\n addField (field) {\n const fieldName = field.name();\n this._colIdentifier += `,${fieldName}`;\n const partialFieldspace = this._partialFieldspace;\n const cachedValueObjects = partialFieldspace._cachedValueObjects;\n const formattedData = field.formattedData();\n const rawData = field.partialField.data;\n\n if (!partialFieldspace.fieldsObj()[field.name()]) {\n partialFieldspace.fields.push(field);\n cachedValueObjects.forEach((obj, i) => {\n obj[field.name()] = new Value(formattedData[i], rawData[i], field);\n });\n } else {\n const fieldIndex = partialFieldspace.fields.findIndex(fieldinst => fieldinst.name() === fieldName);\n fieldIndex >= 0 && (partialFieldspace.fields[fieldIndex] = field);\n }\n\n // flush out cached namespace values on addition of new fields\n partialFieldspace._cachedFieldsObj = null;\n partialFieldspace._cachedDimension = null;\n partialFieldspace._cachedMeasure = null;\n\n this.__calculateFieldspace().calculateFieldsConfig();\n return this;\n }\n\n /**\n * Creates a new variable calculated from existing variables. This method expects the definition of the newly created\n * variable and a function which resolves the value of the new variable from existing variables.\n *\n * Can create a new measure based on existing variables:\n * @example\n * // DataModel already prepared and assigned to dm variable;\n * const newDm = dataModel.calculateVariable({\n * name: 'powerToWeight',\n * type: 'measure'\n * }, ['horsepower', 'weight_in_lbs', (hp, weight) => hp / weight ]);\n *\n *\n * Can create a new dimension based on existing variables:\n * @example\n * // DataModel already prepared and assigned to dm variable;\n * const child = dataModel.calculateVariable(\n * {\n * name: 'Efficiency',\n * type: 'dimension'\n * }, ['horsepower', (hp) => {\n * if (hp < 80) { return 'low'; },\n * else if (hp < 120) { return 'moderate'; }\n * else { return 'high' }\n * }]);\n *\n * @public\n *\n * @param {Object} schema - The schema of newly defined variable.\n * @param {Array.} dependency - An array containing the dependency variable names and a resolver\n * function as the last element.\n * @param {Object} config - An optional config object.\n * @param {boolean} [config.saveChild] - Whether the newly created DataModel will be a child.\n * @param {boolean} [config.replaceVar] - Whether the newly created variable will replace the existing variable.\n * @return {DataModel} Returns an instance of DataModel with the new field.\n */\n calculateVariable (schema, dependency, config) {\n schema = sanitizeUnitSchema(schema);\n config = Object.assign({}, { saveChild: true, replaceVar: false }, config);\n\n const fieldsConfig = this.getFieldsConfig();\n const depVars = dependency.slice(0, dependency.length - 1);\n const retrieveFn = dependency[dependency.length - 1];\n\n if (fieldsConfig[schema.name] && !config.replaceVar) {\n throw new Error(`${schema.name} field already exists in datamodel`);\n }\n\n const depFieldIndices = depVars.map((field) => {\n const fieldSpec = fieldsConfig[field];\n if (!fieldSpec) {\n // @todo dont throw error here, use warning in production mode\n throw new Error(`${field} is not a valid column name.`);\n }\n return fieldSpec.index;\n });\n\n const clone = this.clone(config.saveChild);\n\n const fs = clone.getFieldspace().fields;\n const suppliedFields = depFieldIndices.map(idx => fs[idx]);\n\n let cachedStore = {};\n let cloneProvider = () => this.detachedRoot();\n\n const computedValues = [];\n rowDiffsetIterator(clone._rowDiffset, (i) => {\n const fieldsData = suppliedFields.map(field => field.partialField.data[i]);\n computedValues[i] = retrieveFn(...fieldsData, i, cloneProvider, cachedStore);\n });\n const [field] = createFields([computedValues], [schema], [schema.name]);\n clone.addField(field);\n\n persistDerivations(\n this,\n clone,\n DM_DERIVATIVES.CAL_VAR,\n { config: schema, fields: depVars },\n retrieveFn\n );\n\n return clone;\n }\n\n /**\n * Propagates changes across all the connected DataModel instances.\n *\n * @param {Array} identifiers - A list of identifiers that were interacted with.\n * @param {Object} payload - The interaction specific details.\n *\n * @return {DataModel} DataModel instance.\n */\n propagate (identifiers, config = {}, addToNameSpace, propConfig = {}) {\n const isMutableAction = config.isMutableAction;\n const propagationSourceId = config.sourceId;\n const payload = config.payload;\n const rootModel = getRootDataModel(this);\n const propagationNameSpace = rootModel._propagationNameSpace;\n const rootGroupByModel = getRootGroupByModel(this);\n const rootModels = {\n groupByModel: rootGroupByModel,\n model: rootModel\n };\n\n addToNameSpace && addToPropNamespace(propagationNameSpace, config, this);\n propagateToAllDataModels(identifiers, rootModels, { propagationNameSpace,\n sourceId: propagationSourceId,\n propagationSource: this },\n Object.assign({\n payload\n }, config));\n\n if (isMutableAction) {\n propagateImmutableActions(propagationNameSpace, rootModel, {\n config,\n propConfig\n }, this);\n }\n\n return this;\n }\n\n /**\n * Associates a callback with an event name.\n *\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback to invoke.\n * @return {DataModel} Returns this current DataModel instance itself.\n */\n on (eventName, callback) {\n switch (eventName) {\n case PROPAGATION:\n this._onPropagation.push(callback);\n break;\n }\n return this;\n }\n\n /**\n * Unsubscribes the callbacks for the provided event name.\n *\n * @param {string} eventName - The name of the event to unsubscribe.\n * @return {DataModel} Returns the current DataModel instance itself.\n */\n unsubscribe (eventName) {\n switch (eventName) {\n case PROPAGATION:\n this._onPropagation = [];\n break;\n\n }\n return this;\n }\n\n /**\n * This method is used to invoke the method associated with propagation.\n *\n * @param {Object} payload The interaction payload.\n * @param {DataModel} identifiers The propagated DataModel.\n * @memberof DataModel\n */\n handlePropagation (propModel, payload) {\n let propListeners = this._onPropagation;\n propListeners.forEach(fn => fn.call(this, propModel, payload));\n }\n\n /**\n * Performs the binning operation on a measure field based on the binning configuration. Binning means discretizing\n * values of a measure. Binning configuration contains an array; subsequent values from the array marks the boundary\n * of buckets in [inclusive, exclusive) range format. This operation does not mutate the subject measure field,\n * instead, it creates a new field (variable) of type dimension and subtype binned.\n *\n * Binning can be configured by\n * - providing custom bin configuration with non-uniform buckets,\n * - providing bins count,\n * - providing each bin size,\n *\n * When custom `buckets` are provided as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHP', buckets: [30, 80, 100, 110] }\n * const binnedDM = dataModel.bin('horsepower', config);\n *\n * @text\n * When `binsCount` is defined as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHP', binsCount: 5, start: 0, end: 100 }\n * const binDM = dataModel.bin('horsepower', config);\n *\n * @text\n * When `binSize` is defined as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHorsepower', binSize: 20, start: 5}\n * const binDM = dataModel.bin('horsepower', config);\n *\n * @public\n *\n * @param {string} measureFieldName - The name of the target measure field.\n * @param {Object} config - The config object.\n * @param {string} [config.name] - The name of the new field which will be created.\n * @param {string} [config.buckets] - An array containing the bucket ranges.\n * @param {string} [config.binSize] - The size of each bin. It is ignored when buckets are given.\n * @param {string} [config.binsCount] - The total number of bins to generate. It is ignored when buckets are given.\n * @param {string} [config.start] - The start value of the bucket ranges. It is ignored when buckets are given.\n * @param {string} [config.end] - The end value of the bucket ranges. It is ignored when buckets are given.\n * @return {DataModel} Returns a new {@link DataModel} instance with the new field.\n */\n bin (measureFieldName, config) {\n const fieldsConfig = this.getFieldsConfig();\n\n if (!fieldsConfig[measureFieldName]) {\n throw new Error(`Field ${measureFieldName} doesn't exist`);\n }\n\n const binFieldName = config.name || `${measureFieldName}_binned`;\n\n if (fieldsConfig[binFieldName]) {\n throw new Error(`Field ${binFieldName} already exists`);\n }\n\n const measureField = this.getFieldspace().fieldsObj()[measureFieldName];\n const { binnedData, bins } = createBinnedFieldData(measureField, this._rowDiffset, config);\n\n const binField = createFields([binnedData], [\n {\n name: binFieldName,\n type: FieldType.DIMENSION,\n subtype: DimensionSubtype.BINNED,\n bins\n }], [binFieldName])[0];\n\n const clone = this.clone(config.saveChild);\n clone.addField(binField);\n\n persistDerivations(\n this,\n clone,\n DM_DERIVATIVES.BIN,\n { measureFieldName, config, binFieldName },\n null\n );\n\n return clone;\n }\n\n /**\n * Creates a new {@link DataModel} instance with completely detached root from current {@link DataModel} instance,\n * the new {@link DataModel} instance has no parent-children relationship with the current one, but has same data as\n * the current one.\n * This API is useful when a completely different {@link DataModel} but with same data as the current instance is\n * needed.\n *\n * @example\n * const dm = new DataModel(data, schema);\n * const detachedDm = dm.detachedRoot();\n *\n * // has different namespace\n * console.log(dm.getPartialFieldspace().name);\n * console.log(detachedDm.getPartialFieldspace().name);\n *\n * // has same data\n * console.log(dm.getData());\n * console.log(detachedDm.getData());\n *\n * @public\n *\n * @return {DataModel} Returns a detached {@link DataModel} instance.\n */\n detachedRoot () {\n const data = this.serialize(DataFormat.FLAT_JSON);\n const schema = this.getSchema();\n\n return new DataModel(data, schema);\n }\n\n /**\n * Creates a set of new {@link DataModel} instances by splitting the set of rows in the source {@link DataModel}\n * instance based on a set of dimensions.\n *\n * For each unique dimensional value, a new split is created which creates a unique {@link DataModel} instance for\n * that split\n *\n * If multiple dimensions are provided, it splits the source {@link DataModel} instance with all possible\n * combinations of the dimensional values for all the dimensions provided\n *\n * Additionally, it also accepts a predicate function to reduce the set of rows provided. A\n * {@link link_to_selection | Selection} is performed on all the split {@link DataModel} instances based on\n * the predicate function\n *\n * @example\n * // without predicate function:\n * const splitDt = dt.splitByRow(['Origin'])\n * console.log(splitDt));\n * // This should give three unique DataModel instances, one each having rows only for 'USA',\n * // 'Europe' and 'Japan' respectively\n *\n * @example\n * // without predicate function:\n * const splitDtMulti = dt.splitByRow(['Origin', 'Cylinders'])\n * console.log(splitDtMulti));\n * // This should give DataModel instances for all unique combinations of Origin and Cylinder values\n *\n * @example\n * // with predicate function:\n * const splitWithPredDt = dt.select(['Origin'], fields => fields.Origin.value === \"USA\")\n * console.log(splitWithPredDt);\n * // This should not include the DataModel for the Origin : 'USA'\n *\n *\n * @public\n *\n * @param {Array} dimensionArr - Set of dimensions based on which the split should occur\n * @param {Object} config - The configuration object\n * @param {string} [config.saveChild] - Configuration to save child or not\n * @param {string}[config.mode=FilteringMode.NORMAL] -The mode of the selection.\n * @return {Array} Returns the new DataModel instances after operation.\n */\n splitByRow (dimensionArr, reducerFn, config) {\n const fieldsConfig = this.getFieldsConfig();\n\n dimensionArr.forEach((fieldName) => {\n if (!fieldsConfig[fieldName]) {\n throw new Error(`Field ${fieldName} doesn't exist in the schema`);\n }\n });\n\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n\n config = Object.assign({}, defConfig, config);\n\n return splitWithSelect(this, dimensionArr, reducerFn, config);\n }\n\n /**\n * Creates a set of new {@link DataModel} instances by splitting the set of fields in the source {@link DataModel}\n * instance based on a set of common and unique field names provided.\n *\n * Each DataModel created contains a set of fields which are common to all and a set of unique fields.\n * It also accepts configurations such as saveChild and mode(inverse or normal) to include/exclude the respective\n * fields\n *\n * @example\n * // without predicate function:\n * const splitDt = dt.splitByColumn( [['Acceleration'], ['Horsepower']], ['Origin'])\n * console.log(splitDt));\n * // This should give two unique DataModel instances, both having the field 'Origin' and\n * // one each having 'Acceleration' and 'Horsepower' fields respectively\n *\n * @example\n * // without predicate function:\n * const splitDtInv = dt.splitByColumn( [['Acceleration'], ['Horsepower'],['Origin', 'Cylinders'],\n * {mode: 'inverse'})\n * console.log(splitDtInv));\n * // This should give DataModel instances in the following way:\n * // All DataModel Instances do not have the fields 'Origin' and 'Cylinders'\n * // One DataModel Instance has rest of the fields except 'Acceleration' and the other DataModel instance\n * // has rest of the fields except 'Horsepower'\n *\n *\n *\n * @public\n *\n * @param {Array} uniqueFields - Set of unique fields included in each datamModel instance\n * @param {Array} commonFields - Set of common fields included in all datamModel instances\n * @param {Object} config - The configuration object\n * @param {string} [config.saveChild] - Configuration to save child or not\n * @param {string}[config.mode=FilteringMode.NORMAL] -The mode of the selection.\n * @return {Array} Returns the new DataModel instances after operation.\n */\n splitByColumn (uniqueFields = [], commonFields = [], config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n const fieldConfig = this.getFieldsConfig();\n const allFields = Object.keys(fieldConfig);\n const normalizedProjFieldSets = [[commonFields]];\n\n config = Object.assign({}, defConfig, config);\n uniqueFields = uniqueFields.length ? uniqueFields : [[]];\n\n\n uniqueFields.forEach((fieldSet, i) => {\n normalizedProjFieldSets[i] = getNormalizedProFields(\n [...fieldSet, ...commonFields],\n allFields,\n fieldConfig);\n });\n\n return splitWithProject(this, normalizedProjFieldSets, config, allFields);\n }\n\n\n}\n\nexport default DataModel;\n","import { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport DataModel from '../export';\nimport reducerStore from '../utils/reducer-store';\nimport { defaultReducerName } from './group-by-function';\nimport { FieldType } from '../enums';\n\n/**\n * This function sanitize the user given field and return a common Array structure field\n * list\n * @param {DataModel} dataModel the dataModel operating on\n * @param {Array} fieldArr user input of field Array\n * @return {Array} arrays of field name\n */\nfunction getFieldArr (dataModel, fieldArr) {\n const retArr = [];\n const fieldStore = dataModel.getFieldspace();\n const dimensions = fieldStore.getDimension();\n\n Object.entries(dimensions).forEach(([key]) => {\n if (fieldArr && fieldArr.length) {\n if (fieldArr.indexOf(key) !== -1) {\n retArr.push(key);\n }\n } else {\n retArr.push(key);\n }\n });\n\n return retArr;\n}\n\n/**\n * This sanitize the reducer provide by the user and create a common type of object.\n * user can give function Also\n * @param {DataModel} dataModel dataModel to worked on\n * @param {Object|function} [reducers={}] reducer provided by the users\n * @return {Object} object containing reducer function for every measure\n */\nfunction getReducerObj (dataModel, reducers = {}) {\n const retObj = {};\n const fieldStore = dataModel.getFieldspace();\n const measures = fieldStore.getMeasure();\n const defReducer = reducerStore.defaultReducer();\n\n Object.keys(measures).forEach((measureName) => {\n if (typeof reducers[measureName] !== 'string') {\n reducers[measureName] = measures[measureName].defAggFn();\n }\n const reducerFn = reducerStore.resolve(reducers[measureName]);\n if (reducerFn) {\n retObj[measureName] = reducerFn;\n } else {\n retObj[measureName] = defReducer;\n reducers[measureName] = defaultReducerName;\n }\n });\n return retObj;\n}\n\n/**\n * main function which perform the group-by operations which reduce the measures value is the\n * fields are common according to the reducer function provided\n * @param {DataModel} dataModel the dataModel to worked\n * @param {Array} fieldArr fields according to which the groupby should be worked\n * @param {Object|Function} reducers reducers function\n * @param {DataModel} existingDataModel Existing datamodel instance\n * @return {DataModel} new dataModel with the group by\n */\nfunction groupBy (dataModel, fieldArr, reducers, existingDataModel) {\n const sFieldArr = getFieldArr(dataModel, fieldArr);\n const reducerObj = getReducerObj(dataModel, reducers);\n const fieldStore = dataModel.getFieldspace();\n const fieldStoreObj = fieldStore.fieldsObj();\n const dbName = fieldStore.name;\n const dimensionArr = [];\n const measureArr = [];\n const schema = [];\n const hashMap = {};\n const data = [];\n let newDataModel;\n\n // Prepare the schema\n Object.entries(fieldStoreObj).forEach(([key, value]) => {\n if (sFieldArr.indexOf(key) !== -1 || reducerObj[key]) {\n schema.push(extend2({}, value.schema()));\n\n switch (value.schema().type) {\n case FieldType.MEASURE:\n measureArr.push(key);\n break;\n default:\n case FieldType.DIMENSION:\n dimensionArr.push(key);\n }\n }\n });\n // Prepare the data\n let rowCount = 0;\n rowDiffsetIterator(dataModel._rowDiffset, (i) => {\n let hash = '';\n dimensionArr.forEach((_) => {\n hash = `${hash}-${fieldStoreObj[_].partialField.data[i]}`;\n });\n if (hashMap[hash] === undefined) {\n hashMap[hash] = rowCount;\n data.push({});\n dimensionArr.forEach((_) => {\n data[rowCount][_] = fieldStoreObj[_].partialField.data[i];\n });\n measureArr.forEach((_) => {\n data[rowCount][_] = [fieldStoreObj[_].partialField.data[i]];\n });\n rowCount += 1;\n } else {\n measureArr.forEach((_) => {\n data[hashMap[hash]][_].push(fieldStoreObj[_].partialField.data[i]);\n });\n }\n });\n\n // reduction\n let cachedStore = {};\n let cloneProvider = () => dataModel.detachedRoot();\n data.forEach((row) => {\n const tuple = row;\n measureArr.forEach((_) => {\n tuple[_] = reducerObj[_](row[_], cloneProvider, cachedStore);\n });\n });\n if (existingDataModel) {\n existingDataModel.__calculateFieldspace();\n newDataModel = existingDataModel;\n }\n else {\n newDataModel = new DataModel(data, schema, { name: dbName });\n }\n return newDataModel;\n}\n\nexport { groupBy, getFieldArr, getReducerObj };\n","import { rowDiffsetIterator } from './row-diffset-iterator';\nimport InvalidAwareTypes from '../invalid-aware-types';\n\nconst generateBuckets = (binSize, start, end) => {\n const buckets = [];\n let next = start;\n\n while (next < end) {\n buckets.push(next);\n next += binSize;\n }\n buckets.push(next);\n\n return buckets;\n};\n\nconst findBucketRange = (bucketRanges, value) => {\n let leftIdx = 0;\n let rightIdx = bucketRanges.length - 1;\n let midIdx;\n let range;\n\n // Here use binary search as the bucketRanges is a sorted array\n while (leftIdx <= rightIdx) {\n midIdx = leftIdx + Math.floor((rightIdx - leftIdx) / 2);\n range = bucketRanges[midIdx];\n\n if (value >= range.start && value < range.end) {\n return range;\n } else if (value >= range.end) {\n leftIdx = midIdx + 1;\n } else if (value < range.start) {\n rightIdx = midIdx - 1;\n }\n }\n\n return null;\n};\n\n /**\n * Creates the bin data from input measure field and supplied configs.\n *\n * @param {Measure} measureField - The Measure field instance.\n * @param {string} rowDiffset - The datamodel rowDiffset values.\n * @param {Object} config - The config object.\n * @return {Object} Returns the binned data and the corresponding bins.\n */\nexport function createBinnedFieldData (measureField, rowDiffset, config) {\n let { buckets, binsCount, binSize, start, end } = config;\n const [dMin, dMax] = measureField.domain();\n\n if (!buckets) {\n start = (start !== 0 && (!start || start > dMin)) ? dMin : start;\n end = (end !== 0 && (!end || end < dMax)) ? (dMax + 1) : end;\n\n if (binsCount) {\n binSize = Math.ceil(Math.abs(end - start) / binsCount);\n }\n\n buckets = generateBuckets(binSize, start, end);\n }\n\n if (buckets[0] > dMin) {\n buckets.unshift(dMin);\n }\n if (buckets[buckets.length - 1] <= dMax) {\n buckets.push(dMax + 1);\n }\n\n const bucketRanges = [];\n for (let i = 0; i < buckets.length - 1; i++) {\n bucketRanges.push({\n start: buckets[i],\n end: buckets[i + 1]\n });\n }\n\n const binnedData = [];\n rowDiffsetIterator(rowDiffset, (i) => {\n const datum = measureField.partialField.data[i];\n if (datum instanceof InvalidAwareTypes) {\n binnedData.push(datum);\n return;\n }\n\n const range = findBucketRange(bucketRanges, datum);\n binnedData.push(`${range.start}-${range.end}`);\n });\n\n return { binnedData, bins: buckets };\n}\n","import { fnList } from '../operator/group-by-function';\n\nexport const { sum, avg, min, max, first, last, count, std: sd } = fnList;\n","import DataModel from './datamodel';\nimport {\n compose,\n bin,\n select,\n project,\n groupby as groupBy,\n calculateVariable,\n sort,\n crossProduct,\n difference,\n naturalJoin,\n leftOuterJoin,\n rightOuterJoin,\n fullOuterJoin,\n union,\n rowDiffsetIterator\n} from './operator';\nimport * as Stats from './stats';\nimport * as enums from './enums';\nimport { DataConverter } from './converter';\nimport { DateTimeFormatter } from './utils';\nimport { DataFormat, FilteringMode, DM_DERIVATIVES } from './constants';\nimport InvalidAwareTypes from './invalid-aware-types';\nimport pkg from '../package.json';\nimport * as FieldsUtility from './fields';\n\nconst Operators = {\n compose,\n bin,\n select,\n project,\n groupBy,\n calculateVariable,\n sort,\n crossProduct,\n difference,\n naturalJoin,\n leftOuterJoin,\n rightOuterJoin,\n fullOuterJoin,\n union,\n rowDiffsetIterator\n};\n\nconst version = pkg.version;\nObject.assign(DataModel, {\n Operators,\n Stats,\n DM_DERIVATIVES,\n DateTimeFormatter,\n DataFormat,\n FilteringMode,\n InvalidAwareTypes,\n version,\n DataConverter,\n FieldsUtility\n}, enums);\n\nexport default DataModel;\n","import { persistDerivations } from '../helper';\nimport { DM_DERIVATIVES } from '../constants';\n\n/**\n * DataModel's opearators are exposed as composable functional operators as well as chainable operators. Chainable\n * operators are called on the instances of {@link Datamodel} and {@link Relation} class.\n *\n * Those same operators can be used as composable operators from `DataModel.Operators` namespace.\n *\n * All these operators have similar behaviour. All these operators when called with the argument returns a function\n * which expects a DataModel instance.\n *\n * @public\n * @module Operators\n * @namespace DataModel\n */\n\n/**\n * This is functional version of selection operator. {@link link_to_selection | Selection} is a row filtering operation.\n * It takes {@link SelectionPredicate | predicate} for filtering criteria and returns a function.\n * The returned function is called with the DataModel instance on which the action needs to be performed.\n *\n * {@link SelectionPredicate} is a function which returns a boolean value. For selection opearation the selection\n * function is called for each row of DataModel instance with the current row passed as argument.\n *\n * After executing {@link SelectionPredicate} the rows are labeled as either an entry of selection set or an entry\n * of rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * [Warn] Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @error\n * [Error] `FilteringMode.ALL` is not a valid working mode for functional version of `select`. Its only avialable on the\n * chained version.\n *\n * @example\n * const select = DataModel.Operators.select;\n * usaCarsFn = select(fields => fields.Origin.value === 'USA');\n * usaCarsDm = usaCarsFn(dm);\n * console.log(usaCarsDm);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {SelectionPredicate} selectFn - Predicate funciton which is called for each row with the current row\n * ```\n * function (row, i) { ... }\n * ```\n * @param {Object} [config] - The configuration object to control the inclusion exclusion of a row in resultant\n * DataModel instance\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - The mode of the selection\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const select = (...args) => dm => dm.select(...args);\n\n/**\n * This is functional version of projection operator. {@link link_to_projection | Projection} is a column filtering\n * operation.It expects list of fields name and either include those or exclude those based on {@link FilteringMode} on\n * the resultant variable.It returns a function which is called with the DataModel instance on which the action needs\n * to be performed.\n *\n * Projection expects array of fields name based on which it creates the selection and rejection set. All the field\n * whose name is present in array goes in selection set and rest of the fields goes in rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @error\n * `FilteringMode.ALL` is not a valid working mode for functional version of `select`. Its only avialable on the\n * chained version.\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {Array.} projField - An array of column names in string or regular expression.\n * @param {Object} [config] - An optional config to control the creation of new DataModel\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - Mode of the projection\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const project = (...args) => dm => dm.project(...args);\n\n/**\n * This is functional version of binnig operator. Binning happens on a measure field based on a binning configuration.\n * Binning in DataModel does not aggregate the number of rows present in DataModel instance after binning, it just adds\n * a new field with the binned value. Refer binning {@link example_of_binning | example} to have a intuition of what\n * binning is and the use case.\n *\n * Binning can be configured by\n * - providing custom bin configuration with non uniform buckets\n * - providing bin count\n * - providing each bin size\n *\n * When custom buckets are provided as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const buckets = {\n * start: 30\n * stops: [80, 100, 110]\n * };\n * const config = { buckets, name: 'binnedHP' }\n * const binFn = bin('horsepower', config);\n * const binnedDm = binFn(dm);\n *\n * @text\n * When `binCount` is defined as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const config = { binCount: 5, name: 'binnedHP' }\n * const binFn = bin('horsepower', config);\n * const binnedDm = binFn(Dm);\n *\n * @text\n * When `binSize` is defined as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const config = { binSize: 200, name: 'binnedHorsepower' }\n * const binnedDm = dataModel.bin('horsepower', config);\n * const binnedDm = binFn(Dm);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {String} name Name of measure which will be used to create bin\n * @param {Object} config Config required for bin creation\n * @param {Array.} config.bucketObj.stops Defination of bucket ranges. Two subsequent number from arrays\n * are picked and a range is created. The first number from range is inclusive and the second number from range\n * is exclusive.\n * @param {Number} [config.bucketObj.startAt] Force the start of the bin from a particular number.\n * If not mentioned, the start of the bin or the lower domain of the data if stops is not mentioned, else its\n * the first value of the stop.\n * @param {Number} config.binSize Bucket size for each bin\n * @param {Number} config.binCount Number of bins which will be created\n * @param {String} config.name Name of the new binned field to be created\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const bin = (...args) => dm => dm.bin(...args);\n\n/**\n * This is functional version of `groupBy` operator.Groups the data using particular dimensions and by reducing\n * measures. It expects a list of dimensions using which it projects the datamodel and perform aggregations to reduce\n * the duplicate tuples. Refer this {@link link_to_one_example_with_group_by | document} to know the intuition behind\n * groupBy.\n *\n * DataModel by default provides definition of few {@link reducer | Reducers}.\n * {@link ReducerStore | User defined reducers} can also be registered.\n *\n * This is the chained implementation of `groupBy`.\n * `groupBy` also supports {@link link_to_compose_groupBy | composability}\n *\n * @example\n * const groupBy = DataModel.Operators.groupBy;\n * const groupedFn = groupBy(['Year'], { horsepower: 'max' } );\n * groupedDM = groupByFn(dm);\n *\n * @public\n *\n * @param {Array.} fieldsArr - Array containing the name of dimensions\n * @param {Object} [reducers={}] - A map whose key is the variable name and value is the name of the reducer. If its\n * not passed, or any variable is ommitted from the object, default aggregation function is used from the\n * schema of the variable.\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const groupBy = (...args) => dm => dm.groupBy(...args);\n\n/**\n * Enables composing operators to run multiple operations and save group of operataion as named opration on a DataModel.\n * The resulting DataModel will be the result of all the operation provided. The operations provided will be executed in\n * a serial manner ie. result of one operation will be the input for the next operations (like pipe operator in unix).\n *\n * Suported operations in compose are\n * - `select`\n * - `project`\n * - `groupBy`\n * - `bin`\n * - `compose`\n *\n * @example\n * const compose = DataModel.Operators.compose;\n * const select = DataModel.Operators.select;\n * const project = DataModel.Operators.project;\n *\n * let composedFn = compose(\n * select(fields => fields.netprofit.value <= 15),\n * project(['netprofit', 'netsales']));\n *\n * const dataModel = new DataModel(data1, schema1);\n *\n * let composedDm = composedFn(dataModel);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {Array.} operators: An array of operation that will be applied on the\n * datatable.\n *\n * @returns {DataModel} Instance of resultant DataModel\n */\nexport const compose = (...operations) =>\n (dm, config = { saveChild: true }) => {\n let currentDM = dm;\n let firstChild;\n const derivations = [];\n\n operations.forEach((operation) => {\n currentDM = operation(currentDM);\n derivations.push(...currentDM._derivation);\n if (!firstChild) {\n firstChild = currentDM;\n }\n });\n\n if (firstChild && firstChild !== currentDM) {\n firstChild.dispose();\n }\n\n // reset all ancestorDerivation saved in-between compose\n currentDM._ancestorDerivation = [];\n persistDerivations(\n dm,\n currentDM,\n DM_DERIVATIVES.COMPOSE,\n null,\n derivations\n );\n\n if (config.saveChild) {\n currentDM.setParent(dm);\n } else {\n currentDM.setParent(null);\n }\n\n return currentDM;\n };\n","/**\n * Wrapper on calculateVariable() method of DataModel to behave\n * the pure-function functionality.\n *\n * @param {Array} args - The argument list.\n * @return {any} Returns the returned value of calling function.\n */\nexport const calculateVariable = (...args) => dm => dm.calculateVariable(...args);\n\n/**\n * Wrapper on sort() method of DataModel to behave\n * the pure-function functionality.\n *\n * @param {Array} args - The argument list.\n * @return {any} Returns the returned value of calling function.\n */\nexport const sort = (...args) => dm => dm.sort(...args);\n","import { crossProduct } from './cross-product';\nimport { naturalJoinFilter } from './natural-join-filter-function';\n\nexport function naturalJoin (dataModel1, dataModel2) {\n return crossProduct(dataModel1, dataModel2, naturalJoinFilter(dataModel1, dataModel2), true);\n}\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _lib = require('./lib');\n\nvar _lib2 = _interopRequireDefault(_lib);\n\nvar _containerManager = require('./container-manager');\n\nvar _containerManager2 = _interopRequireDefault(_containerManager);\n\nvar slLib = _lib2['default'].init(typeof window !== \"undefined\" ? window : undefined),\n doc = slLib.win.document,\n M = slLib.win.Math,\n max = M.max,\n round = M.round,\n BLANK = '',\n htmlSplCharSpace = { ' ': ' ' },\n documentSupport = slLib.getDocumentSupport(),\n SVG_BBOX_CORRECTION = documentSupport.isWebKit ? 0 : 4.5;\n\n/*\n * Create new instance of SmartLabelManager.\n *\n * SmartLabelManager controls the lifetime of the execution space where the text's metrics will be calculated.\n * This takes a string for a given style and returns the height, width.\n * If a bound box is defined it wraps the text and returns the wrapped height and width.\n * It allows to append ellipsis at the end if the text is truncated.\n *\n * @param {String | Number} id - Id of the instance. If the same id is passed, it disposes the old instance and\n * save the new one;\n * @param {String | HTMLElement} container - The id or the instance of the container where the intermediate dom\n * elements are to be attached. If not passed, it appends in div\n *\n * @param {Boolean} useEllipses - This decides if a ellipses to be appended if the text is truncated.\n * @param {Object} options - Control options\n * {\n * maxCacheLimit: No of letter to be cached. Default: 500.\n * }\n * @constructor\n */\nfunction SmartLabelManager(id, container, useEllipses, options) {\n var wrapper,\n prop,\n max,\n prevInstance,\n isBrowserLess = false,\n store = SmartLabelManager.store;\n\n if (typeof id === 'undefined' || typeof id === 'object') {\n return;\n }\n\n if (prevInstance = store[id]) {\n prevInstance.dispose();\n }\n\n store[id] = this;\n options = options || {};\n options.maxCacheLimit = isFinite(max = options.maxCacheLimit) ? max : slLib.maxDefaultCacheLimit;\n\n if (typeof container === 'string') {\n container = doc.getElementById(container);\n }\n\n wrapper = slLib.createContainer(container);\n wrapper.innerHTML = slLib.testStrAvg;\n\n if (documentSupport.isHeadLess || !documentSupport.isIE && !wrapper.offsetHeight && !wrapper.offsetWidth) {\n isBrowserLess = true;\n }\n\n wrapper.innerHTML = '';\n for (prop in slLib.parentContainerStyle) {\n wrapper.style[prop] = slLib.parentContainerStyle[prop];\n }\n\n this.id = id;\n this.parentContainer = wrapper;\n\n this._containerManager = new _containerManager2['default'](wrapper, isBrowserLess, 10);\n this._showNoEllipses = !useEllipses;\n this._init = true;\n this.style = {};\n this.options = options;\n\n this.setStyle();\n}\n\n/*\n * getSmartText returns the text separated by
whenever a break is necessary. This is to recgonize one\n * generalized format independent of the implementation (canvas based solution, svg based solution). This method\n * converts the output of getSmartText().text to array of lines if the text is wrapped. It sets a named property\n * `lines` on the object passed as parameter.\n *\n * @param {Object} smartlabel - the object returned by getSmartText based on which line arr which to be formed.\n *\n * @return {Object} - The same object which was passed in the arguments. Also a named property `lines` is set.\n */\nSmartLabelManager.textToLines = function (smartlabel) {\n smartlabel = smartlabel || {};\n\n if (!smartlabel.text) {\n smartlabel.text = '';\n } else if (typeof smartlabel.text !== 'string') {\n smartlabel.text = smartlabel.text.toString();\n }\n\n smartlabel.lines = smartlabel.text.split(/\\n|/ig);\n return smartlabel;\n};\n\n// Saves all the instance created so far\nSmartLabelManager.store = {};\n\n// Calculates space taken by a character with an approximation value which is calculated by repeating the\n// character by string length times.\nSmartLabelManager.prototype._calCharDimWithCache = function (text, calculateDifference, length) {\n if (!this._init) {\n return false;\n }\n\n var size,\n csArr,\n tw,\n twi,\n cachedStyle,\n asymmetricDifference,\n maxAdvancedCacheLimit = this.options.maxCacheLimit,\n container = this._container,\n style = this.style || {},\n cache = this._advancedCache || (this._advancedCache = {}),\n advancedCacheKey = this._advancedCacheKey || (this._advancedCacheKey = []),\n cacheName = text + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK),\n cacheInitName = text + 'init' + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK);\n\n htmlSplCharSpace[text] && (text = htmlSplCharSpace[text]);\n\n if (!calculateDifference) {\n asymmetricDifference = 0;\n } else {\n if ((asymmetricDifference = cache[cacheInitName]) === undefined) {\n container.innerHTML = text.repeat ? text.repeat(length) : Array(length + 1).join(text); // jshint ignore:line\n tw = container.offsetWidth;\n\n container.innerHTML = text;\n twi = container.offsetWidth;\n\n asymmetricDifference = cache[cacheInitName] = (tw - length * twi) / (length + 1);\n advancedCacheKey.push(cacheInitName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n }\n }\n\n if (cachedStyle = cache[cacheName]) {\n csArr = cachedStyle.split(',');\n return {\n width: parseFloat(csArr[0], 10),\n height: parseFloat(csArr[1], 10)\n };\n }\n\n container.innerHTML = text;\n\n size = {\n height: container.offsetHeight,\n width: container.offsetWidth + asymmetricDifference\n };\n\n cache[cacheName] = size.width + ',' + size.height;\n advancedCacheKey.push(cacheName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n\n return size;\n};\n\n// Provide function to calculate the height and width based on the environment and available support from dom.\nSmartLabelManager.prototype._getWidthFn = function () {\n var contObj = this._containerObj,\n container = this._container,\n svgText = contObj.svgText;\n\n if (svgText) {\n return function (str) {\n var bbox, width;\n\n svgText.textContent = str;\n bbox = svgText.getBBox();\n width = bbox.width - SVG_BBOX_CORRECTION;\n if (width < 1) {\n width = bbox.width;\n }\n\n return width;\n };\n } else {\n return function (str) {\n container.innerHTML = str;\n return container.offsetWidth;\n };\n }\n};\n\n/*\n * Sets the style based on which the text's metrics to be calculated.\n *\n * @param {Object} style - The style object which affects the text size\n * {\n * fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)\n * fontFamily / 'font-family'\n * fontWeight / 'font-weight'\n * fontStyle / 'font-style'\n * }\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.setStyle = function (style) {\n if (!this._init) {\n return this;\n }\n\n var sCont;\n\n if (style === this.style && !this._styleNotSet) {\n return;\n }\n\n if (!style) {\n style = this.style;\n }\n\n slLib.setLineHeight(style);\n this.style = style;\n\n this._containerObj = sCont = this._containerManager.get(style);\n\n if (this._containerObj) {\n this._container = sCont.node;\n this._context = sCont.context;\n this._cache = sCont.charCache;\n this._lineHeight = sCont.lineHeight;\n this._styleNotSet = false;\n } else {\n this._styleNotSet = true;\n }\n\n return this;\n};\n\n/*\n * Decides whether ellipses to be shown if the node is truncated\n *\n * @param {Boolean} useEllipses - decides if a ellipses to be appended if the text is truncated. Default: false\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.useEllipsesOnOverflow = function (useEllipses) {\n if (!this._init) {\n return this;\n }\n this._showNoEllipses = !useEllipses;\n return this;\n};\n\n/*\n * Get wrapped or truncated text if a bound box is defined around it. The result text would be separated by
\n * if wrapped\n *\n * @param {String} text - the subject text\n * @param {Number} maxWidth - width in px of the the bound box\n * @param {Number} maxHeight - height in px of the the bound box\n * @param {Boolean} noWrap - whether the text to be wrapped. Default false.\n *\n * @return {Object} - The metrics of the text bounded by the box\n * {\n * height : height of the wrapped text\n * width : width of the wrapped text\n * isTruncated : whether the text is truncated\n * maxHeight : Maximum height given\n * maxWidth : Maximum width given\n * oriText : Original text sent\n * oriTextHeight : Original text height\n * oriTextWidth : Original text width\n * text : SMART TEXT\n * }\n */\nSmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight, noWrap) {\n if (!this._init) {\n return false;\n }\n\n if (text === undefined || text === null) {\n text = '';\n } else if (typeof text !== 'string') {\n text = text.toString();\n }\n\n var len,\n trimStr,\n tempArr,\n tmpText,\n maxWidthWithEll,\n toolText,\n oriWidth,\n oriHeight,\n newCharIndex,\n nearestChar,\n tempChar,\n getWidth,\n initialLeft,\n initialTop,\n getOriSizeImproveObj,\n spanArr,\n x,\n y,\n minWidth,\n elem,\n chr,\n elemRightMostPoint,\n elemLowestPoint,\n lastBR,\n removeFromIndex,\n removeFromIndexForEllipses,\n hasHTMLTag = false,\n maxStrWidth = 0,\n lastDash = -1,\n lastSpace = -1,\n lastIndexBroken = -1,\n strWidth = 0,\n strHeight = 0,\n oriTextArr = [],\n i = 0,\n ellipsesStr = this._showNoEllipses ? '' : '...',\n lineHeight = this._lineHeight,\n context = this._context,\n container = this._container,\n sCont = this._containerObj,\n ellipsesWidth = sCont.ellipsesWidth,\n dotWidth = sCont.dotWidth,\n characterArr = [],\n dashIndex = -1,\n spaceIndex = -1,\n lastLineBreak = -1,\n fastTrim = function fastTrim(str) {\n str = str.replace(/^\\s\\s*/, '');\n var ws = /\\s/,\n i = str.length;\n while (ws.test(str.charAt(i -= 1))) {/* jshint noempty:false */}\n return str.slice(0, i + 1);\n },\n smartLabel = {\n text: text,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n width: null,\n height: null,\n oriTextWidth: null,\n oriTextHeight: null,\n oriText: text,\n isTruncated: false\n };\n\n getWidth = this._getWidthFn();\n\n // In some browsers, offsetheight of a single-line text is getting little (1 px) heigher value of the\n // lineheight. As a result, smartLabel is unable to return single-line text.\n // To fix this, increase the maxHeight a little amount. Hence maxHeight = lineHeight * 1.2\n if (maxHeight === lineHeight) {\n maxHeight *= 1.2;\n }\n\n if (container) {\n if (!documentSupport.isBrowserLess) {\n hasHTMLTag = slLib.xmlTagRegEx.test(text);\n if (!hasHTMLTag) {\n // Due to support of <,> for xml we convert <, > to <,> respectively so to get the correct\n // width it is required to convert the same before calculation for the new improve version of the\n // get text width.\n tmpText = text.replace(slLib.ltgtRegex, function (match) {\n return match === '<' ? '<' : '>';\n });\n getOriSizeImproveObj = this.getOriSize(tmpText, true);\n\n smartLabel.oriTextWidth = oriWidth = getOriSizeImproveObj.width;\n smartLabel.oriTextHeight = oriHeight = getOriSizeImproveObj.height;\n } else {\n container.innerHTML = text;\n smartLabel.oriTextWidth = oriWidth = container.offsetWidth;\n smartLabel.oriTextHeight = oriHeight = container.offsetHeight;\n }\n\n if (oriHeight <= maxHeight && oriWidth <= maxWidth) {\n smartLabel.width = smartLabel.oriTextWidth = oriWidth;\n smartLabel.height = smartLabel.oriTextHeight = oriHeight;\n return smartLabel;\n }\n\n if (lineHeight > maxHeight) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = 0;\n smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n }\n }\n\n // Calculate width with ellipses\n text = fastTrim(text).replace(/(\\s+)/g, ' ');\n maxWidthWithEll = this._showNoEllipses ? maxWidth : maxWidth - ellipsesWidth;\n\n if (!hasHTMLTag) {\n oriTextArr = text.split('');\n len = oriTextArr.length;\n trimStr = '', tempArr = [];\n tempChar = oriTextArr[0];\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n minWidth = getWidth(tempChar);\n this._cache[tempChar] = { width: minWidth };\n }\n\n if (maxWidthWithEll > minWidth) {\n tempArr = text.substr(0, slLib.getNearestBreakIndex(text, maxWidthWithEll, this)).split('');\n i = tempArr.length;\n } else if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n } else if (ellipsesStr) {\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n strWidth = getWidth(tempArr.join(''));\n strHeight = this._lineHeight;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n smartLabel.width = getWidth(smartLabel.text);\n smartLabel.height = this._lineHeight;\n return smartLabel;\n }\n }\n }\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = strWidth;\n smartLabel.height = this._lineHeight;\n return smartLabel;\n } else {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (tempChar === ' ' && !context) {\n tempChar = ' ';\n }\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n /** @todo use regular expressions for better performance. */\n lastSpace = text.substr(0, tempArr.length).lastIndexOf(' ');\n lastDash = text.substr(0, tempArr.length).lastIndexOf('-');\n if (lastSpace > lastIndexBroken) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastSpace, 1, '
');\n lastIndexBroken = lastSpace;\n newCharIndex = lastSpace + 1;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === tempArr.length - 1) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '
-');\n } else {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '-
');\n }\n lastIndexBroken = lastDash;\n newCharIndex = lastDash + 1;\n } else {\n tempArr.splice(tempArr.length - 1, 1, '
' + oriTextArr[i]);\n lastLineBreak = tempArr.length - 2;\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastLineBreak + 1).join(''));\n lastIndexBroken = lastLineBreak;\n newCharIndex = i;\n }\n strHeight += this._lineHeight;\n if (strHeight > maxHeight) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n // The max width among all the lines will be the width of the string.\n smartLabel.width = maxWidth;\n smartLabel.height = strHeight - this._lineHeight;\n return smartLabel;\n } else {\n maxStrWidth = max(maxStrWidth, strWidth);\n trimStr = null;\n nearestChar = slLib.getNearestBreakIndex(text.substr(newCharIndex), maxWidthWithEll, this);\n strWidth = getWidth(text.substr(newCharIndex, nearestChar || 1));\n if (tempArr.length < newCharIndex + nearestChar) {\n tempArr = tempArr.concat(text.substr(tempArr.length, newCharIndex + nearestChar - tempArr.length).split(''));\n i = tempArr.length - 1;\n }\n }\n }\n }\n }\n\n maxStrWidth = max(maxStrWidth, strWidth);\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = maxStrWidth;\n smartLabel.height = strHeight;\n return smartLabel;\n }\n } else {\n toolText = text.replace(slLib.spanAdditionRegx, '$2');\n text = text.replace(slLib.spanAdditionRegx, slLib.spanAdditionReplacer);\n text = text.replace(/()/g, '$1');\n\n container.innerHTML = text;\n\n spanArr = container[documentSupport.childRetriverFn](documentSupport.childRetriverString);\n\n for (x = 0, y = spanArr.length; x < y; x += 1) {\n elem = spanArr[x];\n //chech whether this span is temporary inserted span from it's class\n if (documentSupport.noClassTesting || slLib.classNameReg.test(elem.className)) {\n chr = elem.innerHTML;\n if (chr !== '') {\n if (chr === ' ') {\n spaceIndex = characterArr.length;\n } else if (chr === '-') {\n dashIndex = characterArr.length;\n }\n\n characterArr.push({\n spaceIdx: spaceIndex,\n dashIdx: dashIndex,\n elem: elem\n });\n oriTextArr.push(chr);\n }\n }\n }\n\n i = 0;\n len = characterArr.length;\n minWidth = characterArr[0].elem.offsetWidth;\n\n if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n\n return smartLabel;\n } else if (minWidth > maxWidthWithEll && !this._showNoEllipses) {\n\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n initialLeft = characterArr[0].elem.offsetLeft;\n initialTop = characterArr[0].elem.offsetTop;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n if (container.offsetWidth > maxWidth) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n } else {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemLowestPoint = elem.offsetHeight + (elem.offsetTop - initialTop);\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n lastBR = null;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n\n if (elemRightMostPoint > maxWidth) {\n lastSpace = characterArr[i].spaceIdx;\n lastDash = characterArr[i].dashIdx;\n if (lastSpace > lastIndexBroken) {\n characterArr[lastSpace].elem.innerHTML = '
';\n lastIndexBroken = lastSpace;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === i) {\n // in case the overflowing character itself is the '-'\n characterArr[lastDash].elem.innerHTML = '
-';\n } else {\n characterArr[lastDash].elem.innerHTML = '-
';\n }\n lastIndexBroken = lastDash;\n } else {\n elem.parentNode.insertBefore(lastBR = doc.createElement('br'), elem);\n }\n\n //check whether this break made current element outside the area height\n if (elem.offsetHeight + elem.offsetTop > maxHeight) {\n //remove the lastly inserted line break\n if (lastBR) {\n lastBR.parentNode.removeChild(lastBR);\n } else if (lastIndexBroken === lastDash) {\n characterArr[lastDash].elem.innerHTML = '-';\n } else {\n characterArr[lastSpace].elem.innerHTML = ' ';\n }\n removeFromIndex = i;\n //break the looping condition\n i = len;\n } else {\n removeFromIndexForEllipses = null;\n }\n }\n } else {\n //check whether this break made current element outside the area height\n if (elemLowestPoint > maxHeight) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n }\n\n if (removeFromIndex < len) {\n //set the trancated property of the smartlabel\n smartLabel.isTruncated = true;\n\n /** @todo is this really needed? */\n removeFromIndexForEllipses = removeFromIndexForEllipses ? removeFromIndexForEllipses : removeFromIndex;\n\n for (i = len - 1; i >= removeFromIndexForEllipses; i -= 1) {\n elem = characterArr[i].elem;\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n }\n\n for (; i >= 0; i -= 1) {\n elem = characterArr[i].elem;\n if (slLib.classNameBrReg.test(elem.className)) {\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n } else {\n i = 0;\n }\n }\n }\n\n //get the smart text\n smartLabel.text = container.innerHTML.replace(slLib.spanRemovalRegx, '$1').replace(/\\&\\;/g, '&');\n if (smartLabel.isTruncated) {\n smartLabel.text += ellipsesStr;\n smartLabel.tooltext = toolText;\n }\n }\n\n smartLabel.height = container.offsetHeight;\n smartLabel.width = container.offsetWidth;\n\n return smartLabel;\n } else {\n smartLabel.error = new Error('Body Tag Missing!');\n return smartLabel;\n }\n};\n\n/*\n * Get the height and width of a text.\n *\n * @param {String} text - Text whose metrics to be measured\n * @param {Boolean} Optional detailedCalculationFlag - this flag if set it calculates per letter position\n * information and returns it. Ideally you dont need it unless you want to post process the\n * string. And its an EXPENSIVE OPERATION.\n *\n * @return {Object} - If detailedCalculationFlag is set to true the returned object would be\n * {\n * height: height of the text\n * width: width of the text\n * detailObj: detail calculation of letters in the format {lettername: width}\n * }\n * If detailedCalculationFlag is set to false the returned object wont have the detailObj prop.\n */\nSmartLabelManager.prototype.getOriSize = function (text, detailedCalculationFlag) {\n if (!this._init) {\n return false;\n }\n\n var textArr,\n letter,\n lSize,\n i,\n l,\n cumulativeSize = 0,\n height = 0,\n indiSizeStore = {};\n\n if (!detailedCalculationFlag) {\n return this._calCharDimWithCache(text);\n }\n\n // Calculate the width of every letter with an approximation\n textArr = text.split('');\n for (i = 0, l = textArr.length; i < l; i++) {\n letter = textArr[i];\n lSize = this._calCharDimWithCache(letter, true, textArr.length);\n height = max(height, lSize.height);\n cumulativeSize += lSize.width;\n indiSizeStore[letter] = lSize.width;\n }\n\n return {\n width: round(cumulativeSize),\n height: height,\n detailObj: indiSizeStore\n };\n};\n\n/*\n * Dispose the container and object allocated by the smartlabel\n */\nSmartLabelManager.prototype.dispose = function () {\n if (!this._init) {\n return this;\n }\n\n this._containerManager && this._containerManager.dispose && this._containerManager.dispose();\n\n delete this._container;\n delete this._context;\n delete this._cache;\n delete this._containerManager;\n delete this._containerObj;\n delete this.id;\n delete this.style;\n delete this.parentContainer;\n delete this._showNoEllipses;\n\n return this;\n};\n\nexports['default'] = SmartLabelManager;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n\tvalue: true\n});\nvar lib = {\n\tinit: function init(win) {\n\t\tvar doc = win.document,\n\t\t nav = win.navigator,\n\t\t userAgent = nav.userAgent,\n\t\t DIV = 'DIV',\n\t\t ceil = Math.ceil,\n\t\t floor = Math.floor,\n\t\t containerInstanceCount = 0,\n\t\t clsNameSpace = 'fusioncharts-smartlabel-',\n\t\t containerClass = clsNameSpace + 'container',\n\t\t classNameWithTag = clsNameSpace + 'tag',\n\t\t classNameWithTagBR = clsNameSpace + 'br';\n\n\t\tlib = {\n\t\t\twin: win,\n\n\t\t\tcontainerClass: containerClass,\n\n\t\t\tclassNameWithTag: classNameWithTag,\n\n\t\t\tclassNameWithTagBR: classNameWithTagBR,\n\n\t\t\tmaxDefaultCacheLimit: 500,\n\n\t\t\tclassNameReg: new RegExp('\\b' + classNameWithTag + '\\b'),\n\n\t\t\tclassNameBrReg: new RegExp('\\b' + classNameWithTagBR + '\\b'),\n\n\t\t\tspanAdditionRegx: /(<[^<\\>]+?\\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,\n\n\t\t\tspanAdditionReplacer: '$1$2',\n\n\t\t\tspanRemovalRegx: new RegExp('\\\\]+?' + classNameWithTag + '[^\\\\>]{0,}\\\\>(.*?)\\\\<\\\\/span\\\\>', 'ig'),\n\n\t\t\txmlTagRegEx: new RegExp('<[^>][^<]*[^>]+>', 'i'),\n\n\t\t\tltgtRegex: /<|>/g,\n\n\t\t\tbrReplaceRegex: //ig,\n\n\t\t\ttestStrAvg: 'WgI',\n\n\t\t\t// This style is applied over the parent smartlabel container. The container is kept hidden from the viewport\n\t\t\tparentContainerStyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: '-9999em',\n\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\tpadding: '0px',\n\t\t\t\twidth: '1px',\n\t\t\t\theight: '1px',\n\t\t\t\toverflow: 'hidden'\n\t\t\t},\n\n\t\t\t// All the style which might affect the text metrics\n\t\t\tsupportedStyle: {\n\t\t\t\tfont: 'font',\n\t\t\t\tfontFamily: 'font-family',\n\t\t\t\t'font-family': 'font-family',\n\t\t\t\tfontWeight: 'font-weight',\n\t\t\t\t'font-weight': 'font-weight',\n\t\t\t\tfontSize: 'font-size',\n\t\t\t\t'font-size': 'font-size',\n\t\t\t\tlineHeight: 'line-height',\n\t\t\t\t'line-height': 'line-height',\n\t\t\t\tfontStyle: 'font-style',\n\t\t\t\t'font-style': 'font-style'\n\t\t\t},\n\n\t\t\t// Get the support list for html the document where the text calcution is to be done.\n\t\t\tgetDocumentSupport: function getDocumentSupport() {\n\t\t\t\tvar childRetriverFn, childRetriverString, noClassTesting;\n\n\t\t\t\tif (doc.getElementsByClassName) {\n\t\t\t\t\tchildRetriverFn = 'getElementsByClassName';\n\t\t\t\t\tchildRetriverString = classNameWithTag;\n\t\t\t\t\tnoClassTesting = true;\n\t\t\t\t} else {\n\t\t\t\t\tchildRetriverFn = 'getElementsByTagName';\n\t\t\t\t\tchildRetriverString = 'span';\n\t\t\t\t\tnoClassTesting = false;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisIE: /msie/i.test(userAgent) && !win.opera,\n\t\t\t\t\thasSVG: Boolean(win.SVGAngle || doc.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')),\n\t\t\t\t\tisHeadLess: new RegExp(' HtmlUnit').test(userAgent),\n\t\t\t\t\tisWebKit: new RegExp(' AppleWebKit/').test(userAgent),\n\t\t\t\t\tchildRetriverFn: childRetriverFn,\n\t\t\t\t\tchildRetriverString: childRetriverString,\n\t\t\t\t\tnoClassTesting: noClassTesting\n\t\t\t\t};\n\t\t\t},\n\n\t\t\t/*\n * Create a html div element and attach it with a parent. All the subsequent operations are performed\n * by upding this dom tree only.\n *\n * @param {HTMLElement} - The html element where the newly created div is to be attached. If not passed,\n * the new div is appended on the body.\n */\n\t\t\tcreateContainer: function createContainer(containerParent) {\n\t\t\t\tvar body, container;\n\n\t\t\t\tif (containerParent && (containerParent.offsetWidth || containerParent.offsetHeight)) {\n\t\t\t\t\tif (containerParent.appendChild) {\n\t\t\t\t\t\tcontainerParent.appendChild(container = doc.createElement(DIV));\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody = doc.getElementsByTagName('body')[0];\n\n\t\t\t\t\tif (body && body.appendChild) {\n\t\t\t\t\t\tcontainer = doc.createElement(DIV);\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\tcontainerInstanceCount += 1;\n\t\t\t\t\t\tbody.appendChild(container);\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Finds a approximate position where the text is to be broken\n\t\t\tgetNearestBreakIndex: function getNearestBreakIndex(text, maxWidth, sl) {\n\t\t\t\tif (!text || !text.length) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tvar difference,\n\t\t\t\t getWidth = sl._getWidthFn(),\n\t\t\t\t charLen = 0,\n\t\t\t\t increment = 0,\n\t\t\t\t oriWidth = getWidth(text),\n\t\t\t\t avgWidth = oriWidth / text.length;\n\n\t\t\t\tdifference = maxWidth;\n\t\t\t\tcharLen = ceil(maxWidth / avgWidth);\n\n\t\t\t\tif (oriWidth < maxWidth) {\n\t\t\t\t\treturn text.length - 1;\n\t\t\t\t}\n\n\t\t\t\tif (charLen > text.length) {\n\t\t\t\t\tdifference = maxWidth - oriWidth;\n\t\t\t\t\tcharLen = text.length;\n\t\t\t\t}\n\n\t\t\t\twhile (difference > 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twhile (difference < 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn charLen;\n\t\t\t},\n\n\t\t\t/*\n * Determine lineheight of a text for a given style. It adds propery lineHeight to the style passed\n *\n * @param {Object} - The style based on which the text's metric needs to be calculated. The calculation happens\n * based on fontSize property, if its not present a default font size is assumed.\n *\n * @return {Object} - The style that was passed with lineHeight as a named propery set on the object.\n */\n\t\t\tsetLineHeight: function setLineHeight(styleObj) {\n\t\t\t\tvar fSize = styleObj.fontSize = styleObj.fontSize || '12px';\n\t\t\t\tstyleObj.lineHeight = styleObj.lineHeight || styleObj['line-height'] || parseInt(fSize, 10) * 1.2 + 'px';\n\t\t\t\treturn styleObj;\n\t\t\t}\n\t\t};\n\n\t\treturn lib;\n\t}\n};\n\nexports['default'] = lib;\nmodule.exports = exports['default'];","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"hyperdis\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"hyperdis\"] = factory();\n\telse\n\t\troot[\"hyperdis\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const makeEntry = (arr, sCon) => {\n arr.forEach((elem) => {\n if (elem === undefined || elem === null) {\n return;\n }\n sCon[elem] = 1;\n });\n};\n\nexport default class ForeignSet {\n constructor (arr) {\n this._set = {};\n makeEntry(arr, this._set);\n }\n\n append (arr) {\n makeEntry(arr, this._set);\n return this;\n }\n\n toArray () {\n return Object.keys(this._set);\n }\n\n static difference (set1, set2) {\n let key;\n const filteredKeys = [],\n s1 = set1._set,\n s2 = set2._set;\n for (key in s1) {\n if (!({}).hasOwnProperty.call(s1, key)) {\n continue;\n }\n if (key in s2) {\n continue;\n }\n filteredKeys.push(key);\n }\n return new ForeignSet(filteredKeys);\n }\n}\n","/* global window */\n\nimport ForeignSet from './set';\n\nconst\n isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n },\n minMsThreshold = 16,\n /* istanbul ignore next */win = typeof window === 'undefined' ? (this || {}) : window,\n /* istanbul ignore next */ reqAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame ||\n win.mozRequestAnimationFrame || win.oRequestAnimationFrame ||\n win.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, minMsThreshold);\n },\n\n getTimeBasedId = () => {\n if (getTimeBasedId.__lastTime === new Date().getTime()) {\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n }\n\n getTimeBasedId.__id = 0;\n getTimeBasedId.__lastTime = new Date().getTime();\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n },\n pullableRecent = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const\n hist = node.history,\n l = hist.length - 1;\n return [hist[l - 1 < 0 ? 0 : l - 1], hist[l]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n pullableEnd = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const hist = node.history;\n return [hist[0], hist[hist.length - 1]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n unique = fns => fns\n .reduce((store, fn) => {\n // @warn function with side effect, it mutates the store passed during initialization\n if (fn.__id in store.map) {\n return store;\n }\n\n store.map[fn.__id] = 1;\n store.unique.push(fn);\n\n return store;\n }, { map: {}, unique: [] })\n .unique,\n compose = fns => () => {\n fns.forEach(fn => fn());\n },\n flat = (...params) => {\n const res = [];\n params.forEach(param => res.push(...param));\n return res;\n },\n identityMap = arrays => arrays,\n splitPathProp = (path) => {\n const pathArr = path.split('.'),\n len = pathArr.length;\n return [pathArr.slice(0, len - 1), pathArr[len - 1]];\n },\n scheduler = (onFinishCallback) => {\n let queue = [],\n animationFrame = null;\n\n onFinishCallback = onFinishCallback &&\n typeof onFinishCallback === 'function' && onFinishCallback || (() => { });\n\n return (listeners, payload) => {\n [].push.apply(queue, listeners);\n if (animationFrame === null) {\n animationFrame = reqAnimFrame(() => {\n const tempQ = queue.slice(0);\n queue.length = 0;\n animationFrame = null;\n\n unique(tempQ).forEach(fn => fn());\n onFinishCallback(payload);\n });\n }\n };\n },\n fetch = namedNode => (...params) => params.map((param) => {\n const node = namedNode[param];\n return {\n name: node.name,\n qualifiedName: node.qualifiedName,\n value: node.seed\n };\n }),\n fetchAggregator = (...params) => ({\n dependencies: params.slice(0, params.length - 1),\n fn: params[params.length - 1]\n }),\n getUpstreamNodes = (list) => {\n let res = [];\n const map = {};\n list.forEach(node => map[node.qualifiedName] = -1);\n function rec (arr) {\n arr.forEach((node) => {\n let qname,\n placedIndex,\n preArr,\n postArr;\n if (!((qname = node.qualifiedName) in map)) {\n map[qname] = res.push(node) - 1;\n } else {\n placedIndex = map[qname];\n if (placedIndex !== -1 && placedIndex !== res.length - 1) {\n // If not the last element, readjust the array so that the later dependency position is saved\n preArr = res.slice(0, placedIndex);\n postArr = res.slice(placedIndex + 1);\n res = preArr.concat(postArr);\n\n // reset the index in map\n postArr.forEach((elem, i) => map[elem.qualifiedName] = i + preArr.length);\n map[qname] = res.push(node) - 1;\n }\n }\n rec(node.outgoingEdges);\n });\n }\n rec(list);\n return res;\n },\n resolver = {\n accumulate: (...params) => {\n const resp = {};\n params.forEach((nodeDetails) => {\n Object.assign(resp, { [nodeDetails.name]: nodeDetails.value });\n });\n return resp;\n },\n identity: nodeDetails => nodeDetails.value\n };\n\nfunction resolveDependencyOrder (node, resolved, resolveMap) {\n let qname;\n node.edges.forEach((neighbour) => {\n resolveDependencyOrder(neighbour, resolved, resolveMap);\n });\n\n if (node.isRoot() || (qname = node.qualifiedName) in resolveMap) {\n return;\n }\n resolved.push(node);\n resolveMap[qname] = 1;\n}\n\nclass CustomResolver {\n constructor (resolver) {\n this.fn = resolver;\n this.dep = [];\n }\n\n addDependencies(...dep) {\n this.dep.push(...dep);\n return this;\n }\n\n getDependencies () {\n return this.dep;\n }\n\n get () {\n return this.fn;\n }\n}\n\nexport {\n isSimpleObject,\n scheduler,\n compose,\n flat,\n identityMap,\n pullableEnd,\n pullableRecent,\n unique,\n splitPathProp,\n resolver,\n ForeignSet,\n resolveDependencyOrder,\n fetch,\n fetchAggregator,\n CustomResolver,\n getUpstreamNodes\n};\n","export default class GraphNode {\n constructor (name, qualifiedName, options) {\n /* istanbul ignore next */options = options || {};\n this.name = name;\n this.qualifiedName = qualifiedName;\n this.edges = [];\n this.outgoingEdges = [];\n this._seed = null;\n this.requireResolve = true;\n this.retriever = options.retriever;\n this.history = [];\n this.resolver = null;\n this.electricEdges = [];\n }\n\n addDependencies (...dep) {\n this.edges.push(...dep);\n dep.forEach(entry => entry.outgoingEdges.push(this));\n return this;\n }\n\n addElectricNode (node) {\n this.electricEdges.push(node);\n return this;\n }\n\n get seed () {\n return this._seed;\n }\n\n set seed (value) {\n this._seed = value;\n this.requireResolve = true;\n return this;\n }\n\n resolve () {\n this.seed = this.resolver(...this.retrieveDetails());\n this.history.push(this.seed);\n this.requireResolve = false;\n return this;\n }\n\n retrieveDetails () {\n if (this.edges.length === 0) {\n return [{\n name: this.name,\n qualifiedName: this.qualifiedName,\n value: this.seed\n }];\n }\n return this.retriever(...this.edges.map(edge => edge.qualifiedName));\n }\n\n repeatHead () {\n const\n history = this.history,\n head = history[history.length - 1];\n // @todo- Akash, write test case if history.length === 0 to pass code coverage\n if (history.length === 0) {\n return this;\n }\n history.push(head);\n return this;\n }\n\n flush () {\n const hist = this.history,\n head = hist[hist.length - 1];\n hist.length = 0;\n hist.push(head);\n return this;\n }\n\n isRoot () {\n return this.name === null;\n }\n}\n","import {\n pullableRecent,\n pullableEnd\n} from './utils';\n\nexport default class ElectricNode {\n constructor () {\n this.edges = [];\n this.listeners = {\n nextFrame: [],\n currentFrame: []\n };\n }\n\n addEdges (...nodes) {\n this.edges.push(...nodes);\n return this;\n }\n\n regListenerForCurrFrame (fn) {\n const lstnrs = this.listeners.currentFrame;\n let index = lstnrs.push(pullableRecent(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.currentFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n regListenerForNextFrame (fn) {\n const lstnrs = this.listeners.nextFrame;\n let index = lstnrs.push(pullableEnd(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.nextFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n hasNextFrameListener () {\n return !!this.listeners.nextFrame.length;\n }\n}\n","import {\n isSimpleObject,\n resolver,\n // upstreamNodes,\n flat,\n resolveDependencyOrder,\n getUpstreamNodes,\n ForeignSet,\n fetch,\n CustomResolver,\n scheduler\n} from './utils';\nimport Node from './graph-node';\nimport ElectricNode from './electric-node';\n\nexport default class Graph {\n constructor () {\n this.qualifiedNodeMap = {};\n this.retriever = fetch(this.qualifiedNodeMap);\n this.root = new Node(null, null, { retriever: this.retriever });\n this.root.resolver = resolver.accumulate;\n\n this._wholeSet = null;\n this._propagate = true;\n this.propagationOverride = {\n currentFrameListeners: false,\n nextFrameListeners: false\n };\n\n this._schedule = scheduler((payload) => {\n let qname;\n for (qname in payload.flushTarget) {\n if (!({}).hasOwnProperty.call(this.qualifiedNodeMap, qname)) {\n return;\n }\n this.qualifiedNodeMap[qname].flush();\n }\n });\n }\n\n createNodesFrom (obj, mount) {\n let val,\n resolveReqList;\n const qualifiedNodeMap = this.qualifiedNodeMap,\n root = this.root,\n retriever = this.retriever;\n\n (function rec (objn, qualifiedName, history) {\n let key,\n qname,\n perv,\n node;\n\n for (key in objn) {\n if (!({}).hasOwnProperty.call(objn, key)) {\n continue;\n }\n qname = `${qualifiedName}${key}`;\n node = new Node(key, qname, { retriever });\n qualifiedNodeMap[qname] = node;\n\n if ((perv = history.perv) !== undefined) {\n perv.addDependencies(node);\n } else {\n // top most level entries\n root.addDependencies(node);\n }\n\n if (isSimpleObject(val = objn[key])) {\n rec(val, `${qualifiedName}${key}.`, { perv: node });\n node.resolver = resolver.accumulate;\n } else if (val instanceof CustomResolver) {\n node.resolver = val.get();\n node.addDependencies(...val.getDependencies().map(qname => qualifiedNodeMap[qname]));\n } else {\n node.resolver = resolver.identity;\n node.seed = val;\n // node.resolve();\n }\n }\n }(obj, mount === null ? '' : `${mount}.`, {\n perv: qualifiedNodeMap[mount]\n }));\n\n this._wholeSet = new ForeignSet(Object.keys(this.qualifiedNodeMap));\n\n // Recalculate the model without firing the listeners\n // @todo selective branch resolve. Currently resolve gets called even for a branch which was updated\n resolveReqList = this.constructor.getResolvedList(root).concat(root).filter(node => node.requireResolve);\n resolveReqList.forEach(node => node.resolve());\n getUpstreamNodes(resolveReqList).forEach(node => node.resolve());\n return this;\n }\n\n getNodeValue (prop) {\n if (prop in this.qualifiedNodeMap) {\n return this.qualifiedNodeMap[prop].seed;\n }\n return undefined;\n }\n\n createElectricNodeOf (props, fnSpec) {\n const nodes = props.map(prop => this.qualifiedNodeMap[prop]),\n eNode = new ElectricNode().addEdges(...nodes);\n\n nodes.forEach(node => node.addElectricNode(eNode));\n return eNode[`regListenerFor${fnSpec.type}`](fnSpec.fn);\n }\n\n update (...params) {\n let changedSet,\n upstreamNodes;\n const\n electricEdges = [],\n nodes = params.map((entry) => {\n entry[0].seed = entry[1];\n return entry[0];\n });\n nodes.forEach(node => node.resolve());\n electricEdges.push(...flat(...nodes.map(node => node.electricEdges)));\n changedSet = new ForeignSet(nodes.map(node => node.qualifiedName));\n\n if (!this._propagate) {\n this.__execUniqueElectricEdges(electricEdges);\n this._propagate = true;\n return this;\n }\n\n upstreamNodes = getUpstreamNodes(nodes);\n upstreamNodes.forEach(upstreamNode => upstreamNode.resolve());\n changedSet.append(upstreamNodes.map(node => node.qualifiedName));\n electricEdges.push(...flat(...upstreamNodes.map(node => node.electricEdges)));\n\n this.__execUniqueElectricEdges(Array.from(new Set(electricEdges)), changedSet);\n return this;\n }\n\n __execUniqueElectricEdges (electricEdges, changedSet) {\n const\n cfLstnrs = [], // current frame listeners\n nfLstnrs = []; // next frame listeners\n if (changedSet) {\n const\n differenceSet = ForeignSet.difference(this._wholeSet, changedSet),\n entries = differenceSet.toArray();\n\n entries.forEach(entry => this.qualifiedNodeMap[entry].repeatHead());\n }\n\n electricEdges.forEach((e) => {\n cfLstnrs.push(...e.listeners.currentFrame);\n });\n electricEdges.forEach((e) => {\n nfLstnrs.push(...e.listeners.nextFrame);\n });\n\n !this.propagationOverride.currentFrameListeners && cfLstnrs.forEach(fn => fn());\n !this.propagationOverride.nextFrameListeners && this._schedule(nfLstnrs, { flushTarget: changedSet });\n this.resetPropagationOverride();\n return this;\n }\n\n resetNodeValue (...qnames) {\n const nodes = qnames.map(qname => this.qualifiedNodeMap[qname]),\n args = nodes.map(node => [node, node.seed]);\n this.update(...args);\n return this;\n }\n\n static getResolvedList (node) {\n const resolved = [];\n resolveDependencyOrder(node, resolved, {});\n return resolved;\n }\n\n stopPropagation () {\n this._propagate = false;\n return this;\n }\n\n resetPropagationOverride () {\n this.propagationOverride.currentFrameListeners = false;\n this.propagationOverride.nextFrameListeners = false;\n return this;\n }\n\n setPropagationOverride (key) {\n this.propagationOverride[`${key}Listeners`] = true;\n return this;\n }\n\n getNodeFromQualifiedName (qname) {\n return this.qualifiedNodeMap[qname];\n }\n}\n","import Graph from './graph';\nimport { CustomResolver, fetchAggregator } from './utils';\n\n/**\n * The container class for Hyperdis. Hyperdis is an enabler for observable object with few interesting features like,\n * calculated property, next frame and same frame listeners, multiple listeners etc with a dependency resolving system.\n * It internally uses a graph to hold the hierarchial relationship of a object. Model is merely a container which\n * ties all the components together.\n *\n * @todo Circular dependency detection is not present\n *\n * @example check src/index.spec.js\n * @class\n */\nclass Model {\n constructor () {\n this._graph = new Graph();\n this._lockFlag = false;\n this._reqQ = [];\n }\n\n /**\n * Static method to create and init the model with an observable seed\n *\n * @param {Object} obj The target object which is required to be made observable\n * @return {Model} instance of the observable object model\n */\n static create (obj) {\n return new Model()._addPropInModel(null, obj);\n }\n\n /**\n * Appends more observable property on the already observable instance. This mutates the original model.\n *\n * This function works in two mode. One being\n * @param {String} mountPoint the property on which the new set of properties will be mounted. If its a nested\n * property then the mountPoint has to be written such a way so it feels like you are\n * accessing the object. If the mount point is not found then he obeservables are added in\n * the root.\n * @param {Object} The target object which is required to be made observable\n *\n * Another being\n * @param {Object} The target object which is required to be made observable\n *\n * @return {Model} instance of the observable object model\n */\n append (...params) {\n let mountPoint,\n obj;\n\n if (params.length === 1) {\n mountPoint = null;\n obj = params[0];\n } else {\n mountPoint = params[0];\n obj = params[1];\n }\n\n this._addPropInModel(mountPoint, obj);\n return this;\n }\n\n /**\n * Creates a calculated variable from existing variable. This variable can't be updated from outside.\n * @param {string} mountpoint property path on which the new variable will be placed\n * @param {string} name name of the variable. If the variable could have hierarchy like `limits.start`\n * @param {Function} fn funtion where the dependent variables are injected based on the dependency requirement\n */\n calculatedProp (...params) {\n let calculationConfig,\n customResolver,\n varName,\n mount,\n fetchFn;\n\n if (params.length > 2) {\n mount = params[0];\n varName = params[1];\n fetchFn = params[2];\n } else {\n mount = null;\n varName = params[0];\n fetchFn = params[1];\n }\n\n calculationConfig = fetchFn(fetchAggregator);\n customResolver = new CustomResolver(calculationConfig.fn);\n customResolver.addDependencies(...calculationConfig.dependencies);\n\n this._addPropInModel(mount, { [varName]: customResolver });\n return this;\n }\n\n // eslint-disable-next-line require-jsdoc\n _addPropInModel (mountPoint, obj) {\n this._graph.createNodesFrom(obj, mountPoint);\n return this;\n }\n\n /**\n * Register a listener in the current frame when a property or group of properties is changed.\n *\n * @example\n * This function takes a single or group of property and handler which is called when any of the properties are\n * changed.\n * When a single property is changed the handler is called with two parameter, what was the old value of the state\n * property and what is the new value.\n * myState.on('range.start', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 9);\n * // Output\n * Value before prop change 1\n * Value after prop change 9\n *\n * If a handler is registered on change of a property which has another state property as value, then the handler\n * gets called whenever any state property connected to it gets changed\n *\n * myState.on('range', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 10);\n * myState.prop('range.type.absolute', false);\n *\n * // Output\n * Value before prop change\n * range {\n * start: 9,\n * end: 5,\n * type: {\n * absolute: true\n * }\n * }\n * Value after prop change\n * range: {\n * start: 10,\n * end: 5,\n * type: {\n * absolute: false\n * }\n * }\n * If a handler is registered with more than one property change then, the handler is called when any of the\n * properties gets changed. In this cast the handler is called with more than one parameter: each for one state\n * property which is registered for listening. Each parameter is of type array containing [oldValue, newValue]\n *\n * myState.on('range.start', 'range.end', (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * myState.prop('range.start', 12);\n *\n * // Output\n * Start [10, 12]\n * End [5, 5]\n *\n * myState.prop('range.end', 7);\n *\n * // Output\n * Start [12, 12]\n * End [5, 7]\n *\n * The on returns a function which is when called the listener registered gets unregistered\n *\n * let unsub = myState.on(['range.start', 'range.end'], (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * // Unsubscribe\n * unsub()\n *\n * On takes an optional boolean value as the last parameter, which if passed as a true value the handler gets called\n * during registration itself.\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n on (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed in the current stack frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'CurrFrame',\n fn\n });\n\n if (instantCall) {\n // Bar current next frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('nextFrame').resetNodeValue(...props);\n }\n return unsub;\n }\n\n /**\n * Register a listener for the next frame when a property or group of properties is changed.\n *\n * @example\n * See the examples for the on listener\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties. Here the oldvalue is last value of the last frame\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n next (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed at the tick of next animation frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'NextFrame',\n fn\n });\n\n // @todo check support for this from the graph side\n if (instantCall) {\n // Bar current frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('currentFrame').resetNodeValue(...props);\n }\n\n return unsub;\n }\n\n /**\n * Lock queues the request of property change and releases the change when unlock is called. This is helpful when\n * multiple property is getting called and the model listeners are to be fired once at the end of update.\n *\n * @return {Model} instance of the model\n */\n lock () {\n this._lockFlag = true;\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * Unlock unleashes the change done after the lock was called.\n\n * @return {Model} instance of the model\n */\n unlock () {\n this._lockFlag = false;\n this.setProp(...this._reqQ);\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * This acts as getter and setter. If the function is called by passing only one argument, it retrieve the value\n * associated with the property. If the same function is called using two parameters, first one being the property\n * and second one being the value, then the value is set for the property and the handlers are called (if any)\n * which got registered using the on function\n *\n * Getter\n * @param {string} prop property path whose value to be retrieved\n * @return {Object} value of the property at the time of call\n *\n * Setter\n * @param {string} property property path whose value to be ser\n * @return {Model} instance of the model\n */\n prop (...params) {\n let prop,\n val,\n len;\n\n switch (len = params.length) {\n case 1:\n prop = params[0];\n break;\n\n case 2:\n prop = params[0];\n val = params[1];\n break;\n\n default:\n return this;\n }\n\n if (len === 2) {\n this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([prop, val]);\n return this;\n }\n\n return this._graph.getNodeValue(prop);\n }\n\n // eslint-disable-next-line require-jsdoc\n setProp (...props) {\n // Filter out the calculated variables, so that it cant be changed from outside\n // @todo if a node is not leafValue, and change is called, ignore it too\n // props = props.filter(prop => !(VirtualObj.walkTill(prop[0].split('.'), this._vObj).leafValue()\n // instanceof CalculatedVar));\n\n if (props.length === 0) {\n return this;\n }\n\n this._graph.update(...props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]]));\n return this;\n }\n\n /**\n * Retrieves the graph representation of the object\n * @return {Graph} instance of the graph associated to the model\n */\n graph () {\n return this._graph;\n }\n\n /**\n * Get serialized data from the model\n *\n * @return {Object} Serialized data\n */\n serialize () {\n return this._graph.root.seed;\n }\n}\n\nexport default Model;\n","import Model from './model';\n\nexport default Model;\n","const Muze = require('./muze');\n\nmodule.exports = Muze.default ? Muze.default : Muze;\n","'use strict';\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _lib = require('./lib');\n\nvar _lib2 = _interopRequireDefault(_lib);\n\nvar slLib = _lib2['default'].init(typeof window !== \"undefined\" ? window : undefined),\n doc = slLib.win.document,\n documentSupport = slLib.getDocumentSupport(),\n SVG_BBOX_CORRECTION = documentSupport.isWebKit ? 0 : 4.5;\n\nfunction ContainerManager(parentContainer, isBrowserLess, maxContainers) {\n var svg;\n\n maxContainers = maxContainers > 5 ? maxContainers : 5;\n maxContainers = maxContainers < 20 ? maxContainers : 20;\n\n this.maxContainers = maxContainers;\n this.first = null;\n this.last = null;\n this.containers = {};\n this.length = 0;\n this.rootNode = parentContainer;\n\n if (isBrowserLess) {\n svg = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'height', '0');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'width', '0');\n this.svgRoot = svg;\n this.rootNode.appendChild(svg);\n }\n}\n\nContainerManager.prototype.get = function (style) {\n var diff,\n key,\n containerObj,\n containers = this.containers,\n len = this.length,\n max = this.maxContainers,\n keyStr = '';\n\n for (key in slLib.supportedStyle) {\n if (style[key] !== undefined) {\n keyStr += slLib.supportedStyle[key] + ':' + style[key] + ';';\n }\n }\n\n if (!keyStr) {\n return false;\n }\n\n if (containerObj = containers[keyStr]) {\n if (this.first !== containerObj) {\n containerObj.prev && (containerObj.prev.next = containerObj.next);\n containerObj.next && (containerObj.next.prev = containerObj.prev);\n containerObj.next = this.first;\n containerObj.next.prev = containerObj;\n this.last === containerObj && (this.last = containerObj.prev);\n containerObj.prev = null;\n this.first = containerObj;\n }\n } else {\n if (len >= max) {\n diff = len - max + 1;\n // +1 is to remove an extra entry to make space for the new container to be added.\n while (diff--) {\n this.removeContainer(this.last);\n }\n }\n containerObj = this.addContainer(keyStr);\n }\n\n return containerObj;\n};\n\nContainerManager.prototype.addContainer = function (keyStr) {\n var node, container;\n\n this.containers[keyStr] = container = {\n next: null,\n prev: null,\n node: null,\n ellipsesWidth: 0,\n lineHeight: 0,\n dotWidth: 0,\n avgCharWidth: 4,\n keyStr: keyStr,\n charCache: {}\n };\n\n // Since the container objects are arranged from most recent to least recent order, we need to add the new\n // object at the beginning of the list.\n container.next = this.first;\n container.next && (container.next.prev = container);\n this.first = container;\n if (!this.last) {\n this.last = container;\n }\n this.length += 1;\n\n node = container.node = doc.createElement('div');\n this.rootNode.appendChild(node);\n\n if (documentSupport.isIE && !documentSupport.hasSVG) {\n node.style.setAttribute('cssText', keyStr);\n } else {\n node.setAttribute('style', keyStr);\n }\n\n node.setAttribute('aria-hidden', 'true');\n node.setAttribute('role', 'presentation');\n node.style.display = 'inline-block';\n\n node.innerHTML = slLib.testStrAvg; // A test string.\n container.lineHeight = node.offsetHeight;\n container.avgCharWidth = node.offsetWidth / 3;\n\n if (documentSupport.isBrowserLess) {\n node = container.svgText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n node.setAttribute('style', keyStr);\n this.svgRoot.appendChild(node);\n\n node.textContent = slLib.testStrAvg; // A test string.\n container.lineHeight = node.getBBox().height;\n container.avgCharWidth = (node.getBBox().width - SVG_BBOX_CORRECTION) / 3;\n\n node.textContent = '...';\n container.ellipsesWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n node.textContent = '.';\n container.dotWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n } else {\n node.innerHTML = '...';\n container.ellipsesWidth = node.offsetWidth;\n node.innerHTML = '.';\n container.dotWidth = node.offsetWidth;\n node.innerHTML = '';\n }\n\n return container;\n};\n\nContainerManager.prototype.removeContainer = function (cObj) {\n var keyStr = cObj.keyStr;\n\n if (!keyStr || !this.length || !cObj) {\n return;\n }\n this.length -= 1;\n\n cObj.prev && (cObj.prev.next = cObj.next);\n cObj.next && (cObj.next.prev = cObj.prev);\n this.first === cObj && (this.first = cObj.next);\n this.last === cObj && (this.last = cObj.prev);\n\n cObj.node.parentNode.removeChild(cObj.node);\n\n delete this.containers[keyStr];\n};\n\nContainerManager.prototype.dispose = function () {\n var key,\n containers = this.containers;\n\n this.maxContainers = null;\n for (key in containers) {\n this.removeContainer(containers[key]);\n }\n\n this.rootNode.parentNode.removeChild(this.rootNode);\n\n this.rootNode = null;\n this.first = null;\n this.last = null;\n};\n\nmodule.exports = ContainerManager;","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import map from \"./map\";\n\nexport default function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map.entries();\n else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n}\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return map();\n}\n\nfunction setMap(map, key, value) {\n map.set(key, value);\n}\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n scale.invertExtent = function(r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1, a, b, t,\n hiIndex;\n values.push(values[n] + this.step());\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo));\n hiIndex = getClosestIndexOf(values, hi);\n b = lo===hi ? a : Math.max(a, hiIndex - 1);\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n if (reverse) t = a, a = n - b, b = n - t; // map + swap\n return (a > b) ? undefined : domain().slice(a, b+1);\n };\n\n scale.invert = function (r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1,\n a,\n t;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo, 'left'));\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n return domain()[reverse ? n - a : a];\n }\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n\nfunction getClosestIndexOf (arr, value, side) {\n var low = 0,\n arrLen = arr.length,\n high = arrLen - 1,\n highVal,\n mid,\n d1,\n d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left'? high - 1 : high;\n } else {\n if (high === arr.length - 1) { return high; }\n return side === 'left'? high : high + 1;\n }\n}","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? new Rgb(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? new Rgb((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns [\"123\", 0].\nexport default function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": function(x) { return Math.round(x).toString(10); },\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval.js\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval.js\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval.js\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","import interval from \"./interval.js\";\nimport {durationWeek} from \"./duration.js\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval.js\";\nimport {durationDay} from \"./duration.js\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval.js\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatWeekNumberISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","import interval from \"./interval.js\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval.js\";\nimport {durationHour} from \"./duration.js\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval.js\";\nimport {durationMinute} from \"./duration.js\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","export default function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return \"#\" + x;\n });\n}\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"./colors\";\n\nexport default colors(\"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6\");\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5\");\n","import colors from \"./colors\";\n\nexport default colors(\"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9\");\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {deg2rad, rad2deg} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar rainbow = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + \"\";\n}\n","import colors from \"./colors\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import {interpolateRgbBasis} from \"d3-interpolate\";\n\nexport default function(scheme) {\n return interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar c = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n","export const UNIT_GLOBAL_NAMESPACE = 'app.units';\nexport const UNIT_LOCAL_NAMESPACE = 'local.units';\nexport const LAYER_LOCAL_NAMESPACE = 'local.layers';\nexport const LAYER_GLOBAL_NAMESPACE = 'app.layers';\nexport const GROUP_GLOBAL_NAMESPACE = 'app.group';\nexport const GROUP_LOCAL_NAMESPACE = 'local.group';\nexport const CANVAS_LOCAL_NAMESPACE = 'local.canvas';\nexport const CANVAS_GLOBAL_NAMESPACE = 'app.canvas';\n\n","const swap = (arr, i, j) => {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n};\n\nconst defaultCompare = (a, b) => {\n if (a > b) {\n return -1;\n }\n return a > b ? 1 : 0;\n};\n\nconst quickselectStep = (arr, k, left, right, compare) => {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n const t = arr[k];\n let i = left;\n let j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n};\n\n/**\n * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the\n * (k - left + 1)-th smallest value in [left, right].\n * array: the array to partially sort (in place)\n * k: middle index for partial sorting (as defined above)\n * left: left index of the range to sort (0 by default)\n * right: right index (last index of the array by default)\n * compareFn: compare function\n *\n * Ref: https://github.com/mourner/quickselect\n * Example:\n * var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];\n * quickselect(arr, 8);\n * arr is [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]\n * ^^ middle index\n * @param {Array} arr the array to partially sort (in place)\n * @param {Number} k middle index for partial sorting (as defined above)\n * @param {Number} left left index of the range to sort (0 by default)\n * @param {Number} right right index (last index of the array by default)\n * @param {Function} compare compare function\n */\nconst quickselect = (arr, k, left, right, compare) => {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n};\n\nexport default quickselect;\n","import quickselect from './quick-select';\n\nconst createNode = children => ({\n children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n});\n\nconst extend = (a, b) => {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n};\n\n// min bounding rectangle of node children from k to p-1\nconst distBBox = (node, k, p, toBBox, destNode) => {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (let i = k; i < p; i++) {\n const child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n};\n\n// calculate node's bbox from bboxes of its children\nconst calcBBox = (node, toBBox) => {\n distBBox(node, 0, node.children.length, toBBox, node);\n};\n\nconst compareNodeMinX = (a, b) => a.minX - b.minX;\nconst compareNodeMinY = (a, b) => a.minY - b.minY;\n\nconst bboxArea = a => (a.maxX - a.minX) * (a.maxY - a.minY);\n\nconst bboxMargin = a => (a.maxX - a.minX) + (a.maxY - a.minY);\n\nconst enlargedArea = (a, b) => (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n\nconst intersectionArea = (a, b) => {\n const minX = Math.max(a.minX, b.minX);\n const minY = Math.max(a.minY, b.minY);\n const maxX = Math.min(a.maxX, b.maxX);\n const maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n};\n\nconst contains = (a, b) => a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n\nconst intersects = (a, b) => b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n\nconst findItem = (item, items, equalsFn) => {\n if (!equalsFn) return items.indexOf(item);\n\n for (let i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n};\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nconst multiSelect = (arr, left, right, n, compare) => {\n const stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n const mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n};\n\nconst all = (node, result) => {\n const nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push(...node.children);\n else nodesToSearch.push(...node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n};\n\nexport default class RTree {\n constructor (maxEntries = 9) {\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n this.clear();\n }\n\n all () {\n return all(this.data, []);\n }\n\n search (bbox) {\n let node = this.data;\n const result = [];\n\n if (!intersects(bbox, node)) return result;\n\n const toBBox = this.toBBox;\n const nodesToSearch = [];\n\n while (node) {\n for (const child of node.children) {\n const childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) all(child, result);\n else nodesToSearch.push(child);\n }\n }\n\n node = nodesToSearch.pop();\n }\n\n return result;\n }\n\n load (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (let i = 0; i < data.length; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n let node = this.build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this.splitRoot(this.data, node);\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n const tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this.insertSingleItem(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n }\n\n insert (item) {\n if (item) this.insertSingleItem(item, this.data.height - 1);\n return this;\n }\n\n clear () {\n this.data = createNode([]);\n return this;\n }\n\n remove (item, equalsFn) {\n if (!item) return this;\n\n let i;\n let parent;\n let goingUp;\n let node = this.data;\n const bbox = this.toBBox(item);\n const path = [];\n const indexes = [];\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n const index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this.condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n } else node = null; // nothing found\n }\n\n return this;\n }\n\n toJSON () { return this.data; }\n\n fromJSON (data) {\n this.data = data;\n return this;\n }\n\n toBBox (item) { return item; }\n\n compareMinX (a, b) { return a.minX - b.minX; }\n compareMinY (a, b) { return a.minY - b.minY; }\n\n build (items, left, right, height) {\n const N = right - left + 1;\n let M = this._maxEntries;\n let node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / (M ** (height - 1)));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n const N2 = Math.ceil(N / M);\n const N1 = N2 * Math.ceil(Math.sqrt(M));\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (let i = left; i <= right; i += N1) {\n const right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (let j = i; j <= right2; j += N2) {\n const right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this.build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n }\n\n chooseSubtree (bbox, node, level, path) {\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n let minArea = Infinity;\n let minEnlargement = Infinity;\n let targetNode;\n\n for (const child of node.children) {\n const area = bboxArea(child);\n const enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n }\n\n insertSingleItem (item, level, isNode) {\n const bbox = isNode ? item : this.toBBox(item);\n const insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n const node = this.chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this.split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this.adjustParentBoxes(bbox, insertPath, level);\n }\n\n // split overflowed node into two\n split (insertPath, level) {\n const node = insertPath[level];\n const M = node.children.length;\n const m = this._minEntries;\n\n this.chooseSplitAxis(node, m, M);\n\n const splitIndex = this.chooseSplitIndex(node, m, M);\n\n const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this.splitRoot(node, newNode);\n }\n\n splitRoot (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n }\n\n chooseSplitIndex (node, m, M) {\n let index;\n let minOverlap = Infinity;\n let minArea = Infinity;\n\n for (let i = m; i <= M - m; i++) {\n const bbox1 = distBBox(node, 0, i, this.toBBox);\n const bbox2 = distBBox(node, i, M, this.toBBox);\n\n const overlap = intersectionArea(bbox1, bbox2);\n const area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index || M - m;\n }\n\n // sorts node children by the best axis for split\n chooseSplitAxis (node, m, M) {\n const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n const xMargin = this.allDistMargin(node, m, M, compareMinX);\n const yMargin = this.allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n }\n\n // total margin of all possible split distributions where each node is at least m full\n allDistMargin (node, m, M, compare) {\n node.children.sort(compare);\n\n const toBBox = this.toBBox;\n const leftBBox = distBBox(node, 0, m, toBBox);\n const rightBBox = distBBox(node, M - m, M, toBBox);\n let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n for (let i = m; i < M - m; i++) {\n const child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (let i = M - m - 1; i >= m; i--) {\n const child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n }\n\n adjustParentBoxes (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (let i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n }\n\n condense (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (let i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n } else this.clear();\n } else calcBBox(path[i], this.toBBox);\n }\n }\n}\n","const ReservedFields = {\n ROW_ID: '__id__',\n MEASURE_NAMES: '__measure_names__'\n};\n\nexport default ReservedFields;\n","const CommonProps = {\n ACTION_INF: 'actionInf',\n ON_LAYER_DRAW: 'onLayerDraw',\n MATRIX_CREATED: 'matrixCreated'\n};\n\nexport default CommonProps;\n","export const COORD_TYPES = {\n POLAR: 'polar',\n CARTESIAN: 'cartesian'\n};\nexport const DATA_TYPE = {\n FUNCTION: 'function',\n STRING: 'string',\n NUMBER: 'number',\n BOOLEAN: 'Boolean'\n};\nexport const SORT_ORDER_ASCENDING = 'asc';\nexport const SORT_ORDER_DESCENDING = 'desc';\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickTransform = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"#000\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"#000\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"))\n .style('transform', tickTransform);\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter\n : \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter);\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.tickTransform = function(_) {\n return arguments.length ? (tickTransform = _, axis) : tickTransform;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n","import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export var slice = Array.prototype.slice;\n","import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export default function piecewise(interpolate, values) {\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","var b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nexport function bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nexport function bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nexport function bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n","var tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nexport var elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nexport var elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nexport var elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n","var overshoot = 1.70158;\n\nexport var backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nexport var backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nexport var backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n","var exponent = 3;\n\nexport var polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nexport var polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nexport var polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export function x(d) {\n return d[0];\n}\n\nexport function y(d) {\n return d[1];\n}\n","function RedBlackTree() {\n this._ = null; // root node\n}\n\nexport function RedBlackNode(node) {\n node.U = // parent node\n node.C = // color - true for red, false for black\n node.L = // left node\n node.R = // right node\n node.P = // previous node\n node.N = null; // next node\n}\n\nRedBlackTree.prototype = {\n constructor: RedBlackTree,\n\n insert: function(after, node) {\n var parent, grandpa, uncle;\n\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = RedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n RedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n RedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n\n var parent = node.U,\n sibling,\n left = node.L,\n right = node.R,\n next,\n red;\n\n if (!left) next = right;\n else if (!right) next = left;\n else next = RedBlackFirst(right);\n\n if (parent) {\n if (parent.L === node) parent.L = next;\n else parent.R = next;\n } else {\n this._ = next;\n }\n\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) { node.C = false; return; }\n\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n RedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n RedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n RedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n RedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n\n if (node) node.C = false;\n }\n};\n\nfunction RedBlackRotateLeft(tree, node) {\n var p = node,\n q = node.R,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n}\n\nfunction RedBlackRotateRight(tree, node) {\n var p = node,\n q = node.L,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n}\n\nfunction RedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n}\n\nexport default RedBlackTree;\n","import {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createEdge(left, right, v0, v1) {\n var edge = [null, null],\n index = edges.push(edge) - 1;\n edge.left = left;\n edge.right = right;\n if (v0) setEdgeEnd(edge, left, right, v0);\n if (v1) setEdgeEnd(edge, right, left, v1);\n cells[left.index].halfedges.push(index);\n cells[right.index].halfedges.push(index);\n return edge;\n}\n\nexport function createBorderEdge(left, v0, v1) {\n var edge = [v0, v1];\n edge.left = left;\n return edge;\n}\n\nexport function setEdgeEnd(edge, left, right, vertex) {\n if (!edge[0] && !edge[1]) {\n edge[0] = vertex;\n edge.left = left;\n edge.right = right;\n } else if (edge.left === right) {\n edge[1] = vertex;\n } else {\n edge[0] = vertex;\n }\n}\n\n// Liang–Barsky line clipping.\nfunction clipEdge(edge, x0, y0, x1, y1) {\n var a = edge[0],\n b = edge[1],\n ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?\n\n if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];\n if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];\n return true;\n}\n\nfunction connectEdge(edge, x0, y0, x1, y1) {\n var v1 = edge[1];\n if (v1) return true;\n\n var v0 = edge[0],\n left = edge.left,\n right = edge.right,\n lx = left[0],\n ly = left[1],\n rx = right[0],\n ry = right[1],\n fx = (lx + rx) / 2,\n fy = (ly + ry) / 2,\n fm,\n fb;\n\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!v0) v0 = [fx, y0];\n else if (v0[1] >= y1) return;\n v1 = [fx, y1];\n } else {\n if (!v0) v0 = [fx, y1];\n else if (v0[1] < y0) return;\n v1 = [fx, y0];\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!v0) v0 = [(y0 - fb) / fm, y0];\n else if (v0[1] >= y1) return;\n v1 = [(y1 - fb) / fm, y1];\n } else {\n if (!v0) v0 = [(y1 - fb) / fm, y1];\n else if (v0[1] < y0) return;\n v1 = [(y0 - fb) / fm, y0];\n }\n } else {\n if (ly < ry) {\n if (!v0) v0 = [x0, fm * x0 + fb];\n else if (v0[0] >= x1) return;\n v1 = [x1, fm * x1 + fb];\n } else {\n if (!v0) v0 = [x1, fm * x1 + fb];\n else if (v0[0] < x0) return;\n v1 = [x0, fm * x0 + fb];\n }\n }\n }\n\n edge[0] = v0;\n edge[1] = v1;\n return true;\n}\n\nexport function clipEdges(x0, y0, x1, y1) {\n var i = edges.length,\n edge;\n\n while (i--) {\n if (!connectEdge(edge = edges[i], x0, y0, x1, y1)\n || !clipEdge(edge, x0, y0, x1, y1)\n || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon\n || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {\n delete edges[i];\n }\n }\n}\n","import {createBorderEdge} from \"./Edge\";\nimport {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createCell(site) {\n return cells[site.index] = {\n site: site,\n halfedges: []\n };\n}\n\nfunction cellHalfedgeAngle(cell, edge) {\n var site = cell.site,\n va = edge.left,\n vb = edge.right;\n if (site === vb) vb = va, va = site;\n if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);\n if (site === va) va = edge[1], vb = edge[0];\n else va = edge[0], vb = edge[1];\n return Math.atan2(va[0] - vb[0], vb[1] - va[1]);\n}\n\nexport function cellHalfedgeStart(cell, edge) {\n return edge[+(edge.left !== cell.site)];\n}\n\nexport function cellHalfedgeEnd(cell, edge) {\n return edge[+(edge.left === cell.site)];\n}\n\nexport function sortCellHalfedges() {\n for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {\n if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {\n var index = new Array(m),\n array = new Array(m);\n for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);\n index.sort(function(i, j) { return array[j] - array[i]; });\n for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];\n for (j = 0; j < m; ++j) halfedges[j] = array[j];\n }\n }\n}\n\nexport function clipCells(x0, y0, x1, y1) {\n var nCells = cells.length,\n iCell,\n cell,\n site,\n iHalfedge,\n halfedges,\n nHalfedges,\n start,\n startX,\n startY,\n end,\n endX,\n endY,\n cover = true;\n\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n halfedges = cell.halfedges;\n iHalfedge = halfedges.length;\n\n // Remove any dangling clipped edges.\n while (iHalfedge--) {\n if (!edges[halfedges[iHalfedge]]) {\n halfedges.splice(iHalfedge, 1);\n }\n }\n\n // Insert any border edges as necessary.\n iHalfedge = 0, nHalfedges = halfedges.length;\n while (iHalfedge < nHalfedges) {\n end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];\n start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];\n if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {\n halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,\n Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]\n : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]\n : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]\n : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]\n : null)) - 1);\n ++nHalfedges;\n }\n }\n\n if (nHalfedges) cover = false;\n }\n }\n\n // If there weren’t any edges, have the closest site cover the extent.\n // It doesn’t matter which corner of the extent we measure!\n if (cover) {\n var dx, dy, d2, dc = Infinity;\n\n for (iCell = 0, cover = null; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n dx = site[0] - x0;\n dy = site[1] - y0;\n d2 = dx * dx + dy * dy;\n if (d2 < dc) dc = d2, cover = cell;\n }\n }\n\n if (cover) {\n var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];\n cover.halfedges.push(\n edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,\n edges.push(createBorderEdge(site, v01, v11)) - 1,\n edges.push(createBorderEdge(site, v11, v10)) - 1,\n edges.push(createBorderEdge(site, v10, v00)) - 1\n );\n }\n }\n\n // Lastly delete any cells with no edges; these were entirely clipped.\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n if (!cell.halfedges.length) {\n delete cells[iCell];\n }\n }\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {circles, epsilon2} from \"./Diagram\";\n\nvar circlePool = [];\n\nexport var firstCircle;\n\nfunction Circle() {\n RedBlackNode(this);\n this.x =\n this.y =\n this.arc =\n this.site =\n this.cy = null;\n}\n\nexport function attachCircle(arc) {\n var lArc = arc.P,\n rArc = arc.N;\n\n if (!lArc || !rArc) return;\n\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n if (lSite === rSite) return;\n\n var bx = cSite[0],\n by = cSite[1],\n ax = lSite[0] - bx,\n ay = lSite[1] - by,\n cx = rSite[0] - bx,\n cy = rSite[1] - by;\n\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -epsilon2) return;\n\n var ha = ax * ax + ay * ay,\n hc = cx * cx + cy * cy,\n x = (cy * ha - ay * hc) / d,\n y = (ax * hc - cx * ha) / d;\n\n var circle = circlePool.pop() || new Circle;\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom\n\n arc.circle = circle;\n\n var before = null,\n node = circles._;\n\n while (node) {\n if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {\n if (node.L) node = node.L;\n else { before = node.P; break; }\n } else {\n if (node.R) node = node.R;\n else { before = node; break; }\n }\n }\n\n circles.insert(before, circle);\n if (!before) firstCircle = circle;\n}\n\nexport function detachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) firstCircle = circle.N;\n circles.remove(circle);\n circlePool.push(circle);\n RedBlackNode(circle);\n arc.circle = null;\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {createCell} from \"./Cell\";\nimport {attachCircle, detachCircle} from \"./Circle\";\nimport {createEdge, setEdgeEnd} from \"./Edge\";\nimport {beaches, epsilon} from \"./Diagram\";\n\nvar beachPool = [];\n\nfunction Beach() {\n RedBlackNode(this);\n this.edge =\n this.site =\n this.circle = null;\n}\n\nfunction createBeach(site) {\n var beach = beachPool.pop() || new Beach;\n beach.site = site;\n return beach;\n}\n\nfunction detachBeach(beach) {\n detachCircle(beach);\n beaches.remove(beach);\n beachPool.push(beach);\n RedBlackNode(beach);\n}\n\nexport function removeBeach(beach) {\n var circle = beach.circle,\n x = circle.x,\n y = circle.cy,\n vertex = [x, y],\n previous = beach.P,\n next = beach.N,\n disappearing = [beach];\n\n detachBeach(beach);\n\n var lArc = previous;\n while (lArc.circle\n && Math.abs(x - lArc.circle.x) < epsilon\n && Math.abs(y - lArc.circle.cy) < epsilon) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n detachBeach(lArc);\n lArc = previous;\n }\n\n disappearing.unshift(lArc);\n detachCircle(lArc);\n\n var rArc = next;\n while (rArc.circle\n && Math.abs(x - rArc.circle.x) < epsilon\n && Math.abs(y - rArc.circle.cy) < epsilon) {\n next = rArc.N;\n disappearing.push(rArc);\n detachBeach(rArc);\n rArc = next;\n }\n\n disappearing.push(rArc);\n detachCircle(rArc);\n\n var nArcs = disappearing.length,\n iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);\n\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nexport function addBeach(site) {\n var x = site[0],\n directrix = site[1],\n lArc,\n rArc,\n dxl,\n dxr,\n node = beaches._;\n\n while (node) {\n dxl = leftBreakPoint(node, directrix) - x;\n if (dxl > epsilon) node = node.L; else {\n dxr = x - rightBreakPoint(node, directrix);\n if (dxr > epsilon) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -epsilon) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -epsilon) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n\n createCell(site);\n var newArc = createBeach(site);\n beaches.insert(lArc, newArc);\n\n if (!lArc && !rArc) return;\n\n if (lArc === rArc) {\n detachCircle(lArc);\n rArc = createBeach(lArc.site);\n beaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);\n attachCircle(lArc);\n attachCircle(rArc);\n return;\n }\n\n if (!rArc) { // && lArc\n newArc.edge = createEdge(lArc.site, newArc.site);\n return;\n }\n\n // else lArc !== rArc\n detachCircle(lArc);\n detachCircle(rArc);\n\n var lSite = lArc.site,\n ax = lSite[0],\n ay = lSite[1],\n bx = site[0] - ax,\n by = site[1] - ay,\n rSite = rArc.site,\n cx = rSite[0] - ax,\n cy = rSite[1] - ay,\n d = 2 * (bx * cy - by * cx),\n hb = bx * bx + by * by,\n hc = cx * cx + cy * cy,\n vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];\n\n setEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = createEdge(lSite, site, null, vertex);\n rArc.edge = createEdge(site, rSite, null, vertex);\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nfunction leftBreakPoint(arc, directrix) {\n var site = arc.site,\n rfocx = site[0],\n rfocy = site[1],\n pby2 = rfocy - directrix;\n\n if (!pby2) return rfocx;\n\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n\n site = lArc.site;\n var lfocx = site[0],\n lfocy = site[1],\n plby2 = lfocy - directrix;\n\n if (!plby2) return lfocx;\n\n var hl = lfocx - rfocx,\n aby2 = 1 / pby2 - 1 / plby2,\n b = hl / plby2;\n\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n\n return (rfocx + lfocx) / 2;\n}\n\nfunction rightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return leftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site[1] === directrix ? site[0] : Infinity;\n}\n","import {addBeach, removeBeach} from \"./Beach\";\nimport {sortCellHalfedges, cellHalfedgeStart, clipCells} from \"./Cell\";\nimport {firstCircle} from \"./Circle\";\nimport {clipEdges} from \"./Edge\";\nimport RedBlackTree from \"./RedBlackTree\";\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var beaches;\nexport var cells;\nexport var circles;\nexport var edges;\n\nfunction triangleArea(a, b, c) {\n return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);\n}\n\nfunction lexicographic(a, b) {\n return b[1] - a[1]\n || b[0] - a[0];\n}\n\nexport default function Diagram(sites, extent) {\n var site = sites.sort(lexicographic).pop(),\n x,\n y,\n circle;\n\n edges = [];\n cells = new Array(sites.length);\n beaches = new RedBlackTree;\n circles = new RedBlackTree;\n\n while (true) {\n circle = firstCircle;\n if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {\n if (site[0] !== x || site[1] !== y) {\n addBeach(site);\n x = site[0], y = site[1];\n }\n site = sites.pop();\n } else if (circle) {\n removeBeach(circle.arc);\n } else {\n break;\n }\n }\n\n sortCellHalfedges();\n\n if (extent) {\n var x0 = +extent[0][0],\n y0 = +extent[0][1],\n x1 = +extent[1][0],\n y1 = +extent[1][1];\n clipEdges(x0, y0, x1, y1);\n clipCells(x0, y0, x1, y1);\n }\n\n this.edges = edges;\n this.cells = cells;\n\n beaches =\n circles =\n edges =\n cells = null;\n}\n\nDiagram.prototype = {\n constructor: Diagram,\n\n polygons: function() {\n var edges = this.edges;\n\n return this.cells.map(function(cell) {\n var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });\n polygon.data = cell.site.data;\n return polygon;\n });\n },\n\n triangles: function() {\n var triangles = [],\n edges = this.edges;\n\n this.cells.forEach(function(cell, i) {\n if (!(m = (halfedges = cell.halfedges).length)) return;\n var site = cell.site,\n halfedges,\n j = -1,\n m,\n s0,\n e1 = edges[halfedges[m - 1]],\n s1 = e1.left === site ? e1.right : e1.left;\n\n while (++j < m) {\n s0 = s1;\n e1 = edges[halfedges[j]];\n s1 = e1.left === site ? e1.right : e1.left;\n if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {\n triangles.push([site.data, s0.data, s1.data]);\n }\n }\n });\n\n return triangles;\n },\n\n links: function() {\n return this.edges.filter(function(edge) {\n return edge.right;\n }).map(function(edge) {\n return {\n source: edge.left.data,\n target: edge.right.data\n };\n });\n },\n\n find: function(x, y, radius) {\n var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;\n\n // Use the previously-found cell, or start with an arbitrary one.\n while (!(cell = that.cells[i1])) if (++i1 >= n) return null;\n var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;\n\n // Traverse the half-edges to find a closer cell, if any.\n do {\n cell = that.cells[i0 = i1], i1 = null;\n cell.halfedges.forEach(function(e) {\n var edge = that.edges[e], v = edge.left;\n if ((v === cell.site || !v) && !(v = edge.right)) return;\n var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;\n if (v2 < d2) d2 = v2, i1 = v.index;\n });\n } while (i1 !== null);\n\n that._found = i0;\n\n return radius == null || d2 <= radius * radius ? cell.site : null;\n }\n}\n","import constant from \"./constant\";\nimport {x as pointX, y as pointY} from \"./point\";\nimport Diagram, {epsilon} from \"./Diagram\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n extent = null;\n\n function voronoi(data) {\n return new Diagram(data.map(function(d, i) {\n var s = [Math.round(x(d, i, data) / epsilon) * epsilon, Math.round(y(d, i, data) / epsilon) * epsilon];\n s.index = i;\n s.data = d;\n return s;\n }), extent);\n }\n\n voronoi.polygons = function(data) {\n return voronoi(data).polygons();\n };\n\n voronoi.links = function(data) {\n return voronoi(data).links();\n };\n\n voronoi.triangles = function(data) {\n return voronoi(data).triangles();\n };\n\n voronoi.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), voronoi) : x;\n };\n\n voronoi.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), voronoi) : y;\n };\n\n voronoi.extent = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];\n };\n\n voronoi.size = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];\n };\n\n return voronoi;\n}\n","import { defaultValue } from '../common-utils';\n\nconst sortSelection = (dataObjects, updateData, sortFn) =>\n (a, b) => {\n const kA = a[0];\n const kB = b[0];\n return sortFn([a[0], dataObjects.get(kA), updateData.get(kA)], [kB, dataObjects.get(kB), updateData.get(kB)]);\n };\n\n/**\n * This class represents a selection applied on a data array.\n *\n * @class Selection\n */\nclass Selection {\n /**\n * Creates an instance of Selection.\n * @param {Array} data Array of DataObjects.\n * @memberof Selection\n */\n constructor (idGetter) {\n this._dataObjects = new Map();\n this._updateData = new Map();\n this._enterData = new Map();\n this._exitData = new Map();\n this._idGetter = idGetter;\n }\n\n /**\n * This method is used to supply seed data to a selection.\n *\n * @param {Array} newData Seed data to create the enter selection.\n * @param {Functon | undefined } idGetter This function is used to uniqely identify a data entry.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n data (newData) {\n const entryData = new Map();\n const exitdata = new Map();\n const tempMap = new Map();\n const duplicateData = new Map();\n const updatedData = this._updateData;\n const idGetter = this._idGetter;\n\n newData.forEach((...params) => {\n const key = idGetter ? idGetter(...params) : params[1];\n if (!tempMap.has(key)) {\n tempMap.set(key, params[0]);\n } else {\n duplicateData.push(key, params[0]);\n }\n });\n\n let val;\n // prepare enter data\n let entries = tempMap.entries();\n while (val = entries.next().value) {\n if (!updatedData.has(val[0])) {\n entryData.set(val[0], val[1]);\n } else {\n updatedData.set(val[0], val[1]);\n }\n }\n // prepare exit data\n entries = updatedData.entries();\n while (val = entries.next().value) {\n if (!tempMap.has(val[0])) {\n exitdata.set(val[0], val[1]);\n }\n }\n\n // put duplicate data to exit list\n entries = duplicateData.entries();\n while (val = entries.next().value) {\n exitdata.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = updatedData;\n newSelection._dataObjects = this._dataObjects;\n newSelection._enterData = entryData;\n newSelection._exitData = exitdata;\n\n return newSelection;\n }\n\n /**\n * Applies the supplied callback to each data element\n * and returns a new selection.\n *\n * @param {Function} callback Callback to execute on each item.\n * @return {Selection} New selection with data created using callback.\n * @memberof Selection\n */\n append (callback) {\n let val;\n const dataObjects = new Map();\n const data = new Map();\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n dataObjects.set(val[0], callback(val[1]));\n data.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = data;\n newSelection._dataObjects = dataObjects;\n\n return newSelection;\n }\n\n /**\n * This method returns an enter selection that\n * allows or update operations.\n *\n * @return {Selection} Instance of enter selection.\n * @memberof Selection\n */\n enter () {\n this._mode = 'enter';\n return this;\n }\n\n /**\n * Returns a selection with exit data.\n *\n * @return {Selection} Instance of selection.\n * @memberof Selection\n */\n exit () {\n this._mode = 'exit';\n return this;\n }\n\n /**\n * This method merges the data of one selection with another.\n *\n * @param {Selection} selection Instance of selection.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n merge (target) {\n const mergedObjects = new Map();\n const mergedData = new Map();\n let val;\n let entries;\n\n // merge Object and data present in this selection\n entries = this._updateData.entries();\n while (val = entries.next().value) {\n if (!this._exitData.has(val[0])) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], this._dataObjects.get(val[0]));\n }\n }\n\n // merge object from target selection\n entries = target._updateData.entries();\n while (val = entries.next().value) {\n if (!(mergedData.has(val[0]) || target._exitData.has(val[0]))) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], target._dataObjects.get(val[0]));\n }\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = mergedData;\n newSelection._dataObjects = mergedObjects;\n\n return newSelection;\n }\n\n each (fn) {\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n fn(val[1], this._updateData.get(val[0]), val[0]);\n }\n }\n\n map (fn) {\n const newdata = new Map();\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n newdata.set(val[0], fn(val[1], this._updateData.get(val[0]), val[0]));\n }\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = this._updateData;\n newSelection._dataObjects = newdata;\n\n return newSelection;\n }\n\n remove () {\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n\n currentData.clear();\n\n return this;\n }\n\n sort (sortFn) {\n const updateData = this._updateData;\n const dataObjects = this._dataObjects;\n const sortSel = sortSelection(dataObjects, updateData, sortFn);\n\n this._updateData = new Map([...updateData.entries()].sort(sortSel));\n this._dataObjects = new Map([...dataObjects.entries()].sort(sortSel));\n return this;\n }\n\n /**\n * Gets the object bound to a class\n *\n * @return {Object} current data set bound to the class\n * @memberof Selection\n */\n getObjects () {\n let val;\n const objects = [];\n const dataObjects = this._dataObjects;\n // select the data to create object\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n if (dataObjects.has(val[0])) {\n objects.push(dataObjects.get(val[0]));\n }\n }\n\n return objects;\n }\n}\n\nexport default Selection;\n","import Selection from './selection';\n/**\n * This function applies a selection operation on a data array.\n *\n * @export\n * @param {Array} [data=[]] The data array to be observed.\n * @return {Selection} Instance of a selection.\n */\nexport default function dataSelect (idFn) {\n return new Selection(idFn);\n}\n\n","export const ORDER_ASCENDING = 'ascending';\nexport const ORDER_DESCENDING = 'descending';\nexport const ORDER_NONE = 'none';\nexport const OFFSET_DIVERGING = 'diverging';\nexport const OFFSET_NONE = 'none';\nexport const OFFSET_EXPAND = 'expand';\nexport const OFFSET_WIGGLE = 'wiggle';\n","/* global window, requestAnimationFrame, cancelAnimationFrame */\nimport { FieldType, DimensionSubtype, DateTimeFormatter, DM_DERIVATIVES, default as DataModel } from 'datamodel';\n\nimport {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom\n} from 'd3-axis';\nimport {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolWye,\n symbolTriangle,\n symbol,\n stack as d3Stack,\n stackOffsetDiverging,\n stackOrderNone,\n stackOrderAscending,\n stackOrderDescending,\n stackOffsetNone,\n stackOffsetExpand,\n stackOffsetWiggle,\n pie,\n arc,\n line,\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n area\n} from 'd3-shape';\nimport { scaleBand } from 'd3-scale';\nimport { nest } from 'd3-collection';\nimport {\n interpolate,\n interpolateRgb,\n piecewise,\n interpolateNumber,\n interpolateHslLong\n} from 'd3-interpolate';\nimport {\n easeCubic,\n easeBounce,\n easePoly,\n easeBack,\n easeCircle,\n easeLinear,\n easeElastic\n} from 'd3-ease';\nimport {\n color,\n rgb,\n hsl\n} from 'd3-color';\nimport { voronoi } from 'd3-voronoi';\nimport { dataSelect } from './DataSystem';\nimport * as scales from './scales';\nimport { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING, ReservedFields } from './enums';\nimport * as STACK_CONFIG from './enums/stack-config';\n\nconst { CATEGORICAL, TEMPORAL } = DimensionSubtype;\nconst { STRING, FUNCTION } = DATA_TYPE;\nconst { InvalidAwareTypes } = DataModel;\nconst HTMLElement = window.HTMLElement;\n\nconst isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n};\n\n/**\n * Returns unique id\n * @return {string} Unique id string\n */\nconst\n getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Deep copies an object and returns a new object.\n * @param {Object} o Object to clone\n * @return {Object} New Object.\n */\nconst clone = (o) => {\n const output = {};\n let v;\n for (const key in o) {\n if ({}.hasOwnProperty.call(o, key)) {\n v = o[key];\n output[key] = isSimpleObject(v) ? clone(v) : v;\n }\n }\n return output;\n};\n\n/**\n* Checks the existence of keys in an object\n* @param {Array} keys Set of keys which are to be checked\n* @param {Object} obj whose keys are checked from the set of keys provided\n* @return {Object} Error if the keys are absent, or the object itself\n*/\nconst checkExistence = (keys, obj) => {\n const nonExistentKeys = [];\n keys.forEach((key) => {\n if (key in obj) {\n return;\n }\n nonExistentKeys.push(key);\n });\n return nonExistentKeys;\n};\n\nconst sanitizeIP = {\n typeObj: (keys, obj) => {\n if (typeof obj !== 'object') {\n return Error('Argument type object expected');\n }\n\n const nonExistentKeys = checkExistence(keys, obj);\n if (nonExistentKeys.length) {\n return Error(`Missing keys from parameter ${nonExistentKeys.join(', ')}`);\n }\n return obj;\n },\n\n /* istanbul ignore next */ htmlElem: (elem) => {\n if (!(elem instanceof HTMLElement)) {\n return Error('HTMLElement required');\n }\n return elem;\n }\n};\n\n/**\n * Gets the maximum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Maximum value\n */\nconst getMax = (data, field) => Math.max(...data.map(d => d[field]));\n\n/**\n * Gets the minimum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Minimum value\n */\nconst getMin = (data, field) => Math.min(...data.map(d => d[field]));\n\n/**\n * Gets the domain from the data based on the field name and type of field\n * @param {Array. | Array.} data Data Array\n * @param {Array.} fields Array of fields from where the domain will be calculated\n * @param {string} fieldType Type of field - nominal, quantitiative, temporal.\n * @return {Array} Usually contains a min and max value if field is quantitative or\n * an array of values if field type is nominal or ordinal\n */\nconst getDomainFromData = (data, fields, fieldType) => {\n let domain;\n const domArr = [];\n data = data[0] instanceof Array ? data : [data];\n\n switch (fieldType) {\n case CATEGORICAL:\n domain = [].concat(...data.map(arr => arr.map(d => d[fields[0]]).filter(d => d !== undefined)));\n break;\n default:\n for (let i = 0, len = data.length; i < len; i++) {\n const arr = data[i];\n const [field0, field1] = fields;\n const arr0 = arr.filter(d => !isNaN(d[field0]));\n const arr1 = arr.filter(d => !isNaN(d[field1]));\n if (arr0.length || arr1.length) {\n const firstMin = getMin(arr0, field0);\n const secondMin = getMin(arr1, field1);\n const firstMax = getMax(arr0, field0);\n const secondMax = getMax(arr1, field1);\n domArr.push([Math.min(firstMin, secondMin), Math.max(firstMax, secondMax)]);\n }\n }\n domain = domArr.length ? [Math.min(...domArr.map(d => d[0])), Math.max(...domArr.map(d => d[1]))] : [];\n break;\n }\n return domain;\n};\n\nconst sanitizeDomainWhenEqual = (domain) => {\n if (domain[0] === domain[1]) {\n domain[0] = domain[0] > 0 ? 0 : domain[0];\n domain[1] = domain[1] > 0 ? domain[1] : 0;\n }\n return domain;\n};\n\n/**\n * Union Domain values\n * @param {Array.} domains Array of domain values\n * @param {string} fieldType type of field - dimension,measure or datetime.\n * @return {Array} Unioned domain of all domain values.\n */\nconst unionDomain = (domains, fieldType) => {\n let domain = [];\n domains = domains.filter(dom => dom && dom.length);\n if (domains.length) {\n if (fieldType === CATEGORICAL) {\n domain = [].concat(...domains);\n } else {\n domain = [Math.min(...domains.map(d => d[0])), Math.max(...domains.map(d => d[1]))];\n }\n }\n\n return domain;\n};\n\nconst symbolFns = {\n circle: symbolCircle,\n cross: symbolCross,\n diamond: symbolDiamond,\n square: symbolSquare,\n star: symbolStar,\n wye: symbolWye,\n triangle: symbolTriangle\n};\n\nconst easeFns = {\n cubic: easeCubic,\n bounce: easeBounce,\n linear: easeLinear,\n elastic: easeElastic,\n back: easeBack,\n poly: easePoly,\n circle: easeCircle\n};\n\n/**\n * Returns the maximum or minimum points of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @param {string} minOrMax minimum or maximum.\n * @return {Object} Minimum or maximum point.\n */\nconst getExtremePoint = (points, compareValue, minOrMax) => {\n let extremePoint;\n let point;\n const len = points.length;\n let minOrMaxVal = minOrMax === 'max' ? -Infinity : Infinity;\n let val;\n\n for (let i = 0; i < len; i++) {\n point = points[i];\n val = point[compareValue];\n if (minOrMax === 'min' ? val < minOrMaxVal : val > minOrMaxVal) {\n minOrMaxVal = val;\n extremePoint = point;\n }\n }\n\n return extremePoint;\n};\n\n/**\n * Returns the minimum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Minimum point.\n */\nconst getMinPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'min');\n\n/**\n * Returns the maximum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Maximum point.\n */\nconst getMaxPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'max');\n\n/**\n * Gets the index of the closest value of the given value from the array.\n * @param {Array} arr Array of values\n * @param {number} value Value from which the nearest value will be calculated.\n * @param {string} side side property.\n * @return {number} index of the closest value\n */\n/* istanbul ignore next */const getClosestIndexOf = (arr, value, side) => {\n let low = 0;\n const arrLen = arr.length;\n let high = arrLen - 1;\n\n let mid;\n let d1;\n let d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n const highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left' ? high - 1 : high;\n }\n if (high === arr.length - 1) { return high; }\n return side === 'left' ? high : high + 1;\n};\n\nconst getNearestValue = (data, key) => {\n const filterData = data.filter(d => typeof d === 'number');\n return filterData[getClosestIndexOf(filterData, key)];\n};\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst getWindow = () => window;\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst reqAnimFrame = (() => requestAnimationFrame)();\n\nconst cancelAnimFrame = (() => cancelAnimationFrame)();\n\n/**\n * Capitalizes the first letter of the word\n * @param {string} text word\n * @return {string} Capitalized word\n */\nconst capitalizeFirst = (text) => {\n text = text.toLowerCase();\n\n return text.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1));\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst unique = (arr, fn = d => d) => {\n const vals = arr.reduce((acc, v) => {\n acc[fn(v)] = v;\n return acc;\n }, {});\n return Object.values(vals);\n};\n\n/**\n * Gets the minimum difference between two consecutive numbers in an array.\n * @param {Array} arr Array of numbers\n * @param {number} index index of the value\n * @return {number} minimum difference between values\n */\n/* istanbul ignore next */ const getMinDiff = (arr, index) => {\n let diff;\n let uniqueVals;\n if (index !== undefined) {\n uniqueVals = unique(arr.map(d => d[index]));\n } else {\n uniqueVals = unique(arr);\n }\n if (uniqueVals.length > 1) {\n diff = Math.abs(uniqueVals[1] - uniqueVals[0]);\n for (let i = 2, len = uniqueVals.length; i < len; i++) {\n diff = Math.min(diff, Math.abs(uniqueVals[i] - uniqueVals[i - 1]));\n }\n } else {\n diff = uniqueVals[0];\n }\n\n return diff;\n};\n\n/**\n * Returns the class name appended with a given id.\n * @param {string} cls class name\n * @param {string} id unique identifier\n * @param {string} prefix string needed to add before the classname\n * @return {string} qualified class name\n */\n/* istanbul ignore next */const getQualifiedClassName = (cls, id, prefix) => {\n cls = cls.replace(/^\\.*/, '');\n return [`${prefix}-${cls}`, `${prefix}-${cls}-${id}`];\n};\n\n/**\n * This method is used to set the default value for variables\n * without sullying the code with conditional statements.\n *\n * @export\n * @param {any} param The parameter to test.\n * @param {any} value The default value to assign.\n * @return {any} The value.\n */\n/* istanbul ignore next */ const defaultValue = (param, value) => {\n if (typeof param === 'undefined' || (typeof param === 'object' && !param)) {\n return value;\n }\n return param;\n};\n\n/**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} graph graph whose dependency order has to be generated\n * @return {Object}\n */\nconst getDependencyOrder = (graph) => {\n const dependencyOrder = [];\n const visited = {};\n const keys = Object.keys(graph);\n /**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} name\n * @return {Object}\n */\n const visit = (name) => {\n if (dependencyOrder.length === keys.length) {\n return true;\n }\n visited[name] = true;\n const edges = graph[name];\n for (let e = 0; e < edges.length; e++) {\n const dep = edges[e];\n if (!visited[dep]) {\n visit(dep);\n }\n }\n\n dependencyOrder.push(name);\n return false;\n };\n\n for (let i = 0; i < keys.length; i++) {\n if (visit(keys[i], i)) break;\n }\n\n return dependencyOrder;\n};\n\n/**\n * Iterates over the properties of an object and applies the function\n *\n * @param {any} obj object to be iterated upon\n * @param {any} fn function to be applied on it\n */\nconst objectIterator = (obj, fn) => {\n for (const key in obj) {\n if (Object.hasOwnProperty.call(obj, key)) {\n fn(key, obj);\n }\n }\n};\n\n/**\n * This class creates a d3 voronoi for retrieving the nearest neighbour of any point from a set of two\n * dimensional points\n * @class Voronoi\n */\n/* istanbul ignore next */ class Voronoi {\n /**\n * Initialize the voronoi with the data given.\n * @param {Array.} data Array of points.\n */\n constructor (data = []) {\n this._voronoi = voronoi().x(d => d.x).y(d => d.y);\n this.data(data);\n }\n\n /**\n * Sets the data to voronoi\n * @param {Array.} data Array of objects.\n * @return {Voronoi} Instance of voronoi.\n */\n data (data) {\n if (data) {\n this._voronoiFn = this._voronoi(data);\n }\n return this;\n }\n\n /**\n * Finds the closest point to the x and y position given.\n * @param {number} x x value\n * @param {number} y y value\n * @param {number} radius search radius.\n * @return {Object} Details of the nearest point.\n */\n find (x, y, radius) {\n return this._voronoiFn.find(x, y, radius);\n }\n}\n\nconst getObjProp = (obj, ...fields) => {\n if (obj === undefined || obj === null) {\n return obj;\n }\n let retObj = obj;\n for (let i = 0, len = fields.length; i < len; i++) {\n retObj = retObj[fields[i]];\n if (retObj === undefined || retObj === null) {\n break;\n }\n }\n return retObj;\n};\n\n/**\n * Sanitize an input number / string mixed number. Currently dot in the no is not supported.\n *\n * @param {number | string} val pure number or string mixed number\n * @return {number | null} Number if it can be extracted. Otherwise null\n */\nconst intSanitizer = (val) => {\n const arr = val.toString().match(/(\\d+)(px)*/g);\n if (!arr) {\n // If only characters are passed\n return null;\n }\n\n return parseInt(arr[0], 10);\n};\n\nconst generateGetterSetters = (context, props) => {\n Object.entries(props).forEach((propInfo) => {\n const prop = propInfo[0];\n const { sanitization, preset, onset, typeChecker, defaultValue: defVal } = propInfo[1];\n const prototype = context.constructor.prototype;\n if (!(Object.hasOwnProperty.call(prototype, prop))) {\n if (defVal) {\n context[`_${prop}`] = defVal;\n }\n context[prop] = (...params) => {\n if (params.length) {\n let value = params[0];\n if (sanitization) {\n value = sanitization(context, params[0], context[`_${prop}`]);\n }\n if (preset) {\n preset(context, value);\n }\n if (typeChecker && !typeChecker(value)) {\n return context[`_${prop}`];\n }\n context[`_${prop}`] = value;\n if (onset) {\n onset(context, value);\n }\n return context;\n } return context[`_${prop}`];\n };\n }\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} prop\n */\nconst getArraySum = (arr, prop) => arr.reduce((total, elem) => {\n total += prop ? elem[prop] : elem;\n return total;\n}, 0);\n\n/**\n *\n *\n * @param {*} arr1\n * @param {*} arr2\n *\n */\nconst arraysEqual = (arr1, arr2) => {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = arr1.length; i >= 0; i--) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n\n return true;\n};\n\n/* eslint valid-typeof:0 */\n/**\n * Returns a validation function which can be used to validate variables against a type and value\n *\n * @param {any} type type of value that the object should have\n * @return {Object} validation function\n */\nconst isEqual = type => (oldVal, newVal) => {\n if (type === 'Array') {\n if (!oldVal) {\n return false;\n }\n return arraysEqual(oldVal, newVal);\n } else if (type === 'Object') {\n return Object.is(oldVal, newVal);\n } return oldVal === newVal;\n};\n\n/**\n * Description @todo\n *\n * @param {any} transactionModel @todo\n * @param {any} transactionEndpoint @todo\n * @param {any} transactionItems @todo\n * @return {any} @todo\n */\nconst enableChainedTransaction = (transactionModel, transactionEndpoint, transactionItems) =>\n transactionItems.forEach(item => transactionModel\n .registerImmediateListener(item, ([, newVal]) => transactionEndpoint[item](newVal)));\n\n/**\n * Chceks if the element is istanceof HTMLElement\n *\n * @param {Object} elem any JS Object\n */\nconst isHTMLElem = elem => elem instanceof HTMLElement;\n\nconst ERROR_MSG = {\n INTERFACE_IMPL: 'Method not implemented'\n};\n\n/**\n * Merges the sink object in the source by recursively iterating through the object properties\n * @param {Object} source Source Object\n * @param {Object} sink Sink Object\n * @return {Object} Merged object\n */\nconst mergeRecursive = (source, sink) => {\n for (const prop in sink) {\n if (isSimpleObject(source[prop]) && isSimpleObject(sink[prop])) {\n mergeRecursive(source[prop], sink[prop]);\n } else if (sink[prop] instanceof Object && sink[prop].constructor === Object) {\n source[prop] = {};\n mergeRecursive(source[prop], sink[prop]);\n } else {\n source[prop] = sink[prop];\n }\n }\n return source;\n};\n\n/**\n * Creates a selection set from a data set with corresponding attributes\n *\n * @export\n * @param {Selection} sel contains previous selection\n * @param {Object} appendObj Object to be appended\n * @param {Array} data Data based on which the selection is entered/updated/removed\n * @param {Object} [attrs={}] Attributes to be set on the data\n * @return {Selection} Merged selection\n */\nconst createSelection = (sel, appendObj, data, idFn) => {\n let selection = sel || dataSelect(idFn);\n\n selection = selection.data(data);\n\n const enter = selection.enter().append(appendObj);\n const mergedSelection = enter.merge(selection);\n\n const exitSelection = selection.exit();\n exitSelection.getObjects().forEach(inst => inst.remove());\n exitSelection.remove();\n return mergedSelection;\n};\n\nconst interpolateArray = (data, fitCount) => {\n const linearInterpolate = function (before, after, atPoint) {\n return before + (after - before) * atPoint;\n };\n const newData = [];\n const springFactor = ((data.length - 1) / (fitCount - 1));\n newData[0] = data[0]; // for new allocation\n for (let i = 1; i < fitCount - 1; i++) {\n const tmp = i * springFactor;\n const before = (Math.floor(tmp)).toFixed();\n const after = (Math.ceil(tmp)).toFixed();\n const atPoint = tmp - before;\n newData[i] = linearInterpolate(data[before], data[after], atPoint);\n }\n newData[fitCount - 1] = data[data.length - 1]; // for new allocation\n return newData;\n};\n\n/**\n *\n *\n * @param {*} fn\n */\nconst nextFrame = (fn) => {\n setTimeout(() => {\n fn();\n }, 0);\n};\n\n/**\n *\n *\n * @param {*} angle\n */\nconst angleToRadian = angle => angle * Math.PI / 180;\n\n/**\n *\n *\n * @param {*} newName\n * @param {*} oldName\n */\nconst replaceCSSPrefix = () => {\n // @todo\n};\n\n/**\n * Gets the interpolator function from d3 color\n *\n */\nconst interpolator = () => interpolate;\n\n/**\n * Gets the number interpolator from d3 color\n *\n */\nconst numberInterpolator = () => interpolateNumber;\n\n/**\n * Gets the rgb interpolator from d3 color\n *\n */\nconst colorInterpolator = () => interpolateRgb;\n\n/**\n * Gets the hsl interpolator from d3 color\n *\n */\nconst hslInterpolator = () => interpolateHslLong;\n\nconst transformColors = () => ({\n color,\n rgb,\n hsl\n});\n\n/**\n * Gets the piecewise interpolator from d3 color\n *\n */\nconst piecewiseInterpolator = () => piecewise;\n\nfunction hue2rgb (p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\n\n/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number l The lightness\n * @return Array The RGB representation\n */\nconst hslToRgb = (h, s, l, a = 1) => {\n let r;\n let g;\n let b;\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nconst rgbToHsv = (r, g, b, a = 1) => {\n r = +r; g = +g; b = +b; a = +a;\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n default: break;\n }\n h /= 6;\n }\n return [h, s, l, a];\n};\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nconst hsvToRgb = (h, s, v, a = 1) => {\n let r;\n let g;\n let b;\n\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0: r = v; g = t; b = p; break;\n case 1: r = q; g = v; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 3: r = p; g = q; b = v; break;\n case 4: r = t; g = p; b = v; break;\n case 5: r = v; g = p; b = q; break;\n default: break;\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\nconst hexToHsv = (hex) => {\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? rgbToHsv(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : '';\n};\n\nconst RGBAtoRGB = (r, g, b, a, r2 = 255, g2 = 255, b2 = 255) => {\n const r3 = Math.round(((1 - a) * r2) + (a * r));\n const g3 = Math.round(((1 - a) * g2) + (a * g));\n const b3 = Math.round(((1 - a) * b2) + (a * b));\n return `rgb(${r3},${g3},${b3})`;\n};\n\nconst hslaToRgb = (h, s, l, a) => {\n const [r, g, b, a1] = hslToRgb(h, s, l, a);\n return RGBAtoRGB(r, g, b, a1);\n};\n\nconst detectColor = (col) => {\n const matchRgb = /rgb\\((\\d{1,3}), (\\d{1,3}), (\\d{1,3})\\)/;\n const matchHsl = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\n\n // Source : https://gist.github.com/sethlopezme/d072b945969a3cc2cc11\n // eslint-disable-next-line\n const matchRgba = /rgba?\\(((25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,\\s*?){2}(25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,?\\s*([01]\\.?\\d*?)?\\)/;\n // eslint-disable-next-line\n const matchHsla = /^hsla\\(([\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n const matchHex = /^#([0-9a-f]{3}){1,2}$/i;\n\n if (matchRgb.test(col) || matchRgba.test(col)) {\n return 'rgb';\n } else if (matchHsl.test(col) || matchHsla.test(col)) {\n return 'hsl';\n } else if (matchHex.test(col)) {\n return 'hex';\n } return col;\n};\n\nfunction RGBAToHexA (rgba) {\n const sep = rgba.indexOf(',') > -1 ? ',' : ' ';\n rgba = rgba.substr(5).split(')')[0].split(sep);\n\n // Strip the slash if using space-separated syntax\n if (rgba.indexOf('/') > -1) { rgba.splice(3, 1); }\n\n for (const R in rgba) {\n const r = rgba[R];\n if (r.indexOf('%') > -1) {\n const p = r.substr(0, r.length - 1) / 100;\n\n if (R < 3) {\n rgba[R] = Math.round(p * 255);\n } else {\n rgba[R] = p;\n }\n }\n }\n\n let r = (+rgba[0]).toString(16);\n let g = (+rgba[1]).toString(16);\n let b = (+rgba[2]).toString(16);\n let a = Math.round(+rgba[3] * 255).toString(16);\n\n if (r.length === 1) { r = `0${r}`; }\n if (g.length === 1) { g = `0${g}`; }\n if (b.length === 1) { b = `0${b}`; }\n if (a.length === 1) { a = `0${a}`; }\n\n return `#${r}${g}${b}${a}`;\n}\n\nconst transformToHex = (datumStyle, colorType) => {\n if (colorType === 'rgb') {\n const [r, g, b, a] = datumStyle.replace(/[^\\d,]/g, '').split(',');\n const aa = a || 1;\n\n const rgbaString = `rgba(${r}, ${g}, ${b}, ${aa})`;\n return RGBAToHexA(rgbaString);\n }\n // Add methods to handle hsl and hex conversion\n return null;\n};\n\nconst assembleModelFromIdentifiers = (model, identifiers) => {\n let schema = [];\n let data;\n const fieldMap = model.getFieldsConfig();\n if (identifiers.length) {\n const fields = identifiers[0];\n const len = fields.length;\n for (let i = 0; i < len; i++) {\n const field = fields[i];\n const fieldObj = fieldMap[field] && Object.assign({}, fieldMap[field].def);\n if (fieldObj) {\n schema.push(Object.assign(fieldObj));\n }\n }\n\n data = [];\n const header = identifiers[0];\n for (let i = 1; i < identifiers.length; i += 1) {\n const vals = identifiers[i];\n const temp = {};\n vals.forEach((fieldVal, cIdx) => {\n temp[header[cIdx]] = fieldVal;\n });\n data.push(temp);\n }\n } else {\n data = [];\n schema = [];\n }\n\n return new model.constructor(data, schema);\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} criteria\n *\n */\nconst getDataModelFromRange = (dataModel, criteria, mode, criteriaFields) => {\n if (criteria === null) return null;\n const fieldsConfig = dataModel.getFieldsConfig();\n const selFields = criteriaFields || Object.keys(criteria).filter(d => d in fieldsConfig);\n const selFn = fields => selFields.every((field) => {\n const fieldValue = fields[field].internalValue;\n const range = criteria[field][0] instanceof Array ? criteria[field][0] : criteria[field];\n\n if (typeof range[0] === STRING) {\n return range.find(d => d === fieldValue) !== undefined;\n }\n\n if (range) {\n // Check if the selected bar value lies insid e the selection box\n return fieldValue >= range[0] && fieldValue <= range[1];\n }\n\n return false;\n });\n\n return dataModel.select(selFn, {\n saveChild: false,\n mode\n });\n};\n\nconst getArrayIndexMap = arr => arr.reduce((acc, value, i) => {\n acc[value] = i;\n return acc;\n}, {});\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} identifiers\n *\n */\nconst getDataModelFromIdentifiers = (dataModel, identifiers, mode, hasBarLayer) => {\n let filteredDataModel;\n if (identifiers instanceof Array) {\n const fieldsConfig = dataModel.getFieldsConfig();\n\n const dataArr = identifiers.slice(1, identifiers.length);\n if (identifiers instanceof Function) {\n filteredDataModel = identifiers(dataModel, {}, false);\n } else if (identifiers instanceof Array && identifiers[0].length) {\n const filteredSchema = identifiers[0].filter(d => d in fieldsConfig || d === ReservedFields.ROW_ID);\n filteredDataModel = dataModel.select((fields, rowId) => {\n let include = true;\n filteredSchema.forEach((propField, idx) => {\n const value = propField === ReservedFields.ROW_ID ? rowId : fields[propField].internalValue;\n const index = dataArr.findIndex(d => d[idx] === value);\n include = include && index !== -1;\n });\n return include;\n }, {\n saveChild: false,\n mode\n });\n } else {\n filteredDataModel = dataModel.select(() => false, {\n saveChild: false,\n mode\n });\n }\n } else {\n filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode, hasBarLayer);\n }\n return filteredDataModel;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} listenerMap\n */\nconst registerListeners = (context, listenerMap, ...params) => {\n const propListenerMap = listenerMap(context, ...params);\n for (const key in propListenerMap) {\n if ({}.hasOwnProperty.call(propListenerMap, key)) {\n const { namespace } = params[1];\n let ns = null;\n if (namespace) {\n ns = namespace;\n }\n const mapObj = propListenerMap[key];\n const propType = mapObj.type;\n const props = mapObj.props;\n const listenerFn = mapObj.listener;\n context.store()[propType](props, listenerFn, false, {\n namespace: ns\n });\n }\n }\n};\n\nconst isValidValue = value => !isNaN(value) && value !== -Infinity && value !== Infinity;\n/**\n *\n *\n * @param {*} str\n *\n */\nconst escapeHTML = (str) => {\n const htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n };\n const htmlEscaper = /[&<>\"'/]/g;\n return (`${str}`).replace(htmlEscaper, match => htmlEscapes[match]);\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst transposeArray = arr => arr[0].map((col, i) => arr.map(row => row[i]));\nconst toArray = arr => (arr instanceof Array ? arr : [arr]);\nconst extendsClass = (cls, extendsFrom, found) => {\n if (!cls) {\n return false;\n }\n const prototype = cls.prototype;\n if (prototype instanceof extendsFrom) {\n found = true;\n } else {\n found = extendsClass(prototype, extendsFrom, found);\n }\n return found;\n};\n\n/**\n *\n * @param {*} dm1\n * @param {*} dm2\n */\nconst concatModels = (dm1, dm2) => {\n const dataObj1 = dm1.getData();\n const dataObj2 = dm2.getData();\n const data1 = dataObj1.data;\n const data2 = dataObj2.data;\n const schema1 = dataObj1.schema;\n const schema2 = dataObj2.schema;\n const tuples1 = {};\n const tuples2 = {};\n const commonTuples = {};\n for (let i = 0; i < data1.length; i++) {\n for (let ii = 0; ii < data2.length; ii++) {\n const row1 = data1[i];\n const row2 = data2[ii];\n const dim1Values = row1.filter((d, idx) => schema1[idx].type === FieldType.DIMENSION);\n const dim2Values = row2.filter((d, idx) => schema2[idx].type === FieldType.DIMENSION);\n const allDimSame = dim1Values.every(value => dim2Values.indexOf(value) !== -1);\n if (allDimSame) {\n const key = dim1Values.join();\n !commonTuples[key] && (commonTuples[key] = {});\n row1.forEach((value, idx) => {\n commonTuples[key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n commonTuples[key][schema2[idx].name] = value;\n });\n } else {\n const dm1Key = dim1Values.join();\n const dm2Key = dim2Values.join();\n if (!commonTuples[dm1Key]) {\n !commonTuples[dm1Key] && (commonTuples[dm1Key] = {});\n row1.forEach((value, idx) => {\n commonTuples[dm1Key][schema1[idx].name] = value;\n });\n }\n if (!commonTuples[dm2Key]) {\n !commonTuples[dm2Key] && (commonTuples[dm2Key] = {});\n row2.forEach((value, idx) => {\n commonTuples[dm2Key][schema2[idx].name] = value;\n });\n }\n }\n }\n }\n\n const commonSchema = [...schema1, ...schema2.filter(s2 => schema1.findIndex(s1 => s1.name === s2.name) === -1)];\n const data = [...Object.values(tuples1), ...Object.values(tuples2), ...Object.values(commonTuples)];\n return [data, commonSchema];\n};\n\nconst getSymbol = type => symbol().type(symbolFns[type]);\n\nconst stackOrders = {\n [STACK_CONFIG.ORDER_NONE]: stackOrderNone,\n [STACK_CONFIG.ORDER_ASCENDING]: stackOrderAscending,\n [STACK_CONFIG.ORDER_DESCENDING]: stackOrderDescending\n};\nconst stackOffsets = {\n [STACK_CONFIG.OFFSET_DIVERGING]: stackOffsetDiverging,\n [STACK_CONFIG.OFFSET_NONE]: stackOffsetNone,\n [STACK_CONFIG.OFFSET_EXPAND]: stackOffsetExpand,\n [STACK_CONFIG.OFFSET_WIGGLE]: stackOffsetWiggle\n};\n\n// eslint-disable-next-line require-jsdoc\nconst stack = params => d3Stack().keys(params.keys).offset(stackOffsets[params.offset])\n .order(stackOrders[params.order])(params.data);\n\n/**\n * Groups the data into a hierarchical tree structure based on one or more fields.\n * @param { Object } params Configuration properties for nesting data\n * @param { Array. } params.data Data which needs to be grouped\n * @param { Array. } params.keys Field indices by which the data will be grouped\n * @return { Array. } Grouped data array\n */\nconst nestCollection = (params) => {\n const nestFn = nest();\n params.keys.forEach(key => nestFn.key(d => d[key]));\n return nestFn.entries(params.data);\n};\n\n/**\n * Returns array difference, elements in array A, not in Array B\n * @param { Array. } arr Data which needs to be grouped\n * @param { Array. } arr1 Field indices by which the data will be grouped\n * @return { Array. } Returns the array difference (A - B)\n */\nconst getArrayDiff = (arr, arr1) => arr.filter(el => arr1.indexOf(el) < 0);\n\nconst pathInterpolators = {\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n stepAfter: curveStepAfter,\n catmullRom: curveCatmullRom,\n step: curveStep,\n stepBefore: curveStepBefore,\n linear: curveLinear\n};\n\nconst Symbols = {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom,\n line,\n area,\n pie,\n arc,\n nest\n};\n\nconst Scales = {\n band: scaleBand\n};\n\nconst getSmallestDiff = (points) => {\n points = points.sort((a, b) => a - b);\n let minDiff = points[1] - points[0];\n for (let i = 2; i < points.length; i++) {\n minDiff = Math.min(minDiff, points[i] - points[i - 1]);\n }\n\n return minDiff;\n};\n\nconst timeFormats = {\n millisecond: '%A, %b %e, %H:%M:%S.%L',\n second: '%A, %b %e, %H:%M:%S',\n minute: '%A, %b %e, %H:%M',\n hour: '%A, %b %e, %H:%M',\n day: '%A, %b %e, %Y',\n month: '%B %Y',\n year: '%Y'\n};\n\nconst timeDurations = [\n ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'],\n [1, 1000, 60000, 3600000, 86400000, 2592000000, 31536000000]\n];\n\nconst getNearestInterval = (interval) => {\n const index = getClosestIndexOf(timeDurations[1], interval);\n return timeDurations[0][index];\n};\n\nconst formatTemporal = (value, interval) => {\n const nearestInterval = getNearestInterval(interval);\n return DateTimeFormatter.formatAs(value, timeFormats[nearestInterval]);\n};\n\nconst temporalFields = (dataModel) => {\n const filteredFields = {};\n Object.entries(dataModel.getFieldspace().getDimension()).forEach(([fieldName, fieldObj]) => {\n if (fieldObj.subtype() === TEMPORAL) {\n filteredFields[fieldName] = fieldObj;\n }\n });\n return filteredFields;\n};\n\nconst require = (lookupWhat, lookupDetails) => ({\n resolvable: (store) => {\n const lookupTarget = store[lookupWhat];\n const depArr = lookupDetails.slice(0, lookupDetails.length - 1);\n const fn = lookupDetails[lookupDetails.length - 1]; // fn\n\n const deps = depArr.map(str => lookupTarget[str]);\n return {\n fn: fn(...deps),\n depArr\n };\n }\n});\n\nconst nextAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n };\n\nconst getValueParser = config => (val) => {\n if (InvalidAwareTypes.getInvalidType(val)) {\n return val in config ? config[val] : `${val}`;\n }\n return val;\n};\n\nconst retrieveNearestGroupByReducers = (dataModel, ...measureFieldNames) => {\n const filteredReducers = {};\n if (dataModel instanceof DataModel) {\n const derivations = [...dataModel.getDerivations().reverse(), ...dataModel.getAncestorDerivations().reverse()];\n const nearestReducers = defaultValue(\n getObjProp(derivations.find(derv => derv.op === DM_DERIVATIVES.GROUPBY), 'criteria'), {});\n\n const measures = dataModel.getFieldspace().getMeasure();\n measureFieldNames = measureFieldNames.length ? measureFieldNames : Object.keys(measures);\n measureFieldNames.forEach((measureName) => {\n if (nearestReducers[measureName]) {\n filteredReducers[measureName] = nearestReducers[measureName];\n } else {\n const measureField = measures[measureName];\n if (measureField) {\n filteredReducers[measureName] = measureField.defAggFn();\n }\n }\n });\n }\n return filteredReducers;\n};\n\nconst retrieveFieldDisplayName = (dm, fieldName) => dm.getFieldspace().fieldsObj()[fieldName].displayName();\n/**\n * Fetches the nearest sort operation details by traversing the chain of parent DataModels\n * @param {Object} dataModel Instance of DataModel\n *\n * @return {Array|null} sort criteria, null if no sort operation found\n */\nconst nearestSortingDetails = (dataModel) => {\n const allDerivations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n const nearestSortDerivation = allDerivations.reverse().find(derivation => derivation.op === DM_DERIVATIVES.SORT);\n\n return nearestSortDerivation ? nearestSortDerivation.criteria : null;\n};\n\nconst sortingOrder = (a, b) => {\n const sortOrder = !(a instanceof InvalidAwareTypes || a instanceof InvalidAwareTypes)\n ? a.localeCompare(b)\n : 1;\n return sortOrder;\n};\n\n/**\n * Map containing key, value sortingOrder pairs\n */\nconst sortOrderMap = {\n [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => sortingOrder(firstVal, secondVal),\n [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => sortingOrder(secondVal, firstVal)\n};\n\n/**\n * Sort categorical field based on it's sorting order\n * @param {string} sortOrder Order by which field is to be sorted (asc or desc or func)\n * @param {string} firstVal First sort parameter\n * @param {string} secondVal Second sort parameter\n * @return {number} position|null if sort order is invalid\n*/\nconst sortCategoricalField = (sortOrder, firstVal, secondVal) => {\n const sortOrderType = typeof sortOrder;\n\n if (sortOrderType === FUNCTION) {\n return sortOrder(firstVal, secondVal);\n } else if (sortOrderType === STRING) {\n if (!sortOrderMap[sortOrder]) return null;\n return sortOrderMap[sortOrder](firstVal, secondVal);\n }\n return null;\n};\n\nconst intersect = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => set.has(fn1(value)));\n};\n\nconst difference = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => !set.has(fn1(value)));\n};\n\nconst partition = (array, filterFn) => array.reduce((acc, v, i) => {\n const pass = filterFn(v, i, array);\n\n pass ? acc[0].push(v) : acc[1].push(v);\n return acc;\n}, [[], []]);\n\nconst mix = superclass => ({\n with: (...mixins) => mixins.reduce((cls, mixin) => mixin(cls), superclass)\n});\n\nconst componentRegistry = (comps) => {\n const reg = Object.assign({}, comps);\n const regObj = {\n register: (def, customKey) => {\n const key = customKey || def.formalName();\n\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n\n return regObj;\n};\n\nconst getReadableTicks = (domain, steps) => {\n // scaling the axis based on steps provided\n const orderedDomain = [Math.min(...domain), Math.max(...domain)];\n if (steps < 3) {\n return orderedDomain;\n }\n\n const tempScale = scales.scaleQuantize().domain(orderedDomain).nice();\n let tempAxis = null;\n let legendTicks = null;\n\n tempAxis = Symbols.axisBottom().scale(tempScale);\n\n legendTicks = tempAxis.scale().ticks(steps);\n\n if (Math.max(...legendTicks) < orderedDomain[1]) {\n // legendTicks.pop();\n legendTicks.push(orderedDomain[1]);\n }\n if (Math.min(...legendTicks) > orderedDomain[0]) {\n // legendTicks.shift();\n legendTicks.unshift(orderedDomain[0]);\n }\n return legendTicks;\n};\n\nconst RGBAToHSLA = (r, g, b, a = 1) => {\n // Make r, g, and b fractions of 1\n r /= 255;\n g /= 255;\n b /= 255;\n\n // Find greatest and smallest channel values\n const cmin = Math.min(r, g, b);\n const cmax = Math.max(r, g, b);\n const delta = cmax - cmin;\n let h = 0;\n let s = 0;\n let l = 0;\n\n // Calculate hue\n // No difference\n if (delta === 0) {\n h = 0;\n } else if (cmax === r) {\n // Red is max\n h = ((g - b) / delta) % 6;\n } else if (cmax === g) {\n // Green is max\n h = (b - r) / delta + 2;\n } else {\n // Blue is max\n h = (r - g) / delta + 4;\n }\n h = Math.round(h * 60);\n\n // Make negative hues positive behind 360°\n if (h < 0) { h += 360; }\n // Calculate lightness\n l = (cmax + cmin) / 2;\n // Calculate saturation\n s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\n // Multiply l and s by 100\n s = +(s * 100).toFixed(1);\n l = +(l * 100).toFixed(1);\n\n return {\n color: `hsla(${h},${s}%,${l}%,${a})`,\n code: [h, s, l, a]\n };\n};\n\nconst transformColor = (rgbaValues, { h = 0, s = 0, l = 0, a }, datum, apply) => {\n const [origH, origS, origL, origA] = RGBAToHSLA(...rgbaValues).code;\n const sanitizedA = parseFloat(a || origA, 10);\n const newH = origH + h;\n const newS = origS + s;\n const newL = origL + l;\n let newA = sanitizedA + 1;\n\n if (!apply) {\n newA = sanitizedA - 1;\n }\n\n const finalcolor = {\n color: `hsla(${newH},${newS}%,${newL}%,${newA})`,\n hsla: [newH, newS, newL, newA]\n };\n return finalcolor;\n};\n\nconst pointWithinCircle = (c, point) => {\n const { x: cx, y: cy, r } = c;\n const { x, y } = point;\n\n const dist = Math.sqrt((cx - x) ** 2 + (cy - y) ** 2);\n return dist <= r;\n};\n\n/**\n * Generates a function which performs an intersection (dataModel select)\n * operation for multiple fields\n * @param {Array} targetData - Nested array with field and values in the format:\n * [\n * [field1, field2]\n * [val1, val2]\n * ]\n * @param {Object} dm - The dataModel instance\n * @return {Function} filter function\n */\nconst dmMultipleSelection = (targetData, dm) => {\n const targetFields = targetData[0];\n const targetVals = targetData.slice(1, targetData.length);\n const payloadMap = targetVals.reduce((acc, v) => {\n acc[v] = v;\n return acc;\n }, {});\n const measures = Object.keys(dm.getFieldspace().getMeasure());\n\n const filterFn = (fields, i) => {\n const row = `${targetFields.map((field) => {\n let val;\n if (field === ReservedFields.MEASURE_NAMES) {\n val = measures;\n } else if (field === ReservedFields.ROW_ID) {\n val = i;\n } else {\n const currentField = fields[field];\n const isFieldInvalid = currentField instanceof InvalidAwareTypes;\n\n val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue;\n }\n return val;\n })}`;\n return row in payloadMap;\n };\n return filterFn;\n};\n\nexport {\n arraysEqual,\n componentRegistry,\n mix,\n partition,\n getArrayIndexMap,\n getValueParser,\n require,\n intersect,\n difference,\n Scales,\n Symbols,\n pathInterpolators,\n stack,\n nestCollection,\n getArrayDiff,\n getSymbol,\n transformColor,\n transformColors,\n detectColor,\n hexToHsv,\n hslToRgb,\n rgbToHsv,\n transformToHex,\n hsvToRgb,\n hslaToRgb,\n concatModels,\n toArray,\n angleToRadian,\n escapeHTML,\n generateGetterSetters,\n getArraySum,\n interpolator,\n piecewiseInterpolator,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n colorInterpolator,\n numberInterpolator,\n ERROR_MSG,\n reqAnimFrame,\n nextAnimFrame,\n transposeArray,\n cancelAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n symbolFns,\n easeFns,\n unique,\n clone,\n isEqual,\n interpolateArray,\n getMinPoint,\n defaultValue,\n getMaxPoint,\n getClosestIndexOf,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isSimpleObject,\n nextFrame,\n registerListeners,\n replaceCSSPrefix,\n getObjProp,\n extendsClass,\n assembleModelFromIdentifiers,\n isValidValue,\n hslInterpolator,\n getSmallestDiff,\n getNearestValue,\n retrieveNearestGroupByReducers,\n nearestSortingDetails,\n createSelection,\n formatTemporal,\n temporalFields,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n getReadableTicks,\n dmMultipleSelection,\n pointWithinCircle\n};\n","export function linear(t) {\n return +t;\n}\n","export function circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nexport function circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nexport function circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_join from \"./join\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","import {event} from \"./selection/on\";\n\nexport default function() {\n var current = event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n}\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart(\"mouse\", container.apply(this, arguments), mouse, this, arguments);\n if (!gesture) return;\n select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\");\n }\n\n function mouseupped() {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent();\n gestures.mouse(\"end\");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, touch, this, arguments)) {\n nopropagation();\n gesture(\"start\");\n }\n }\n }\n\n function touchmoved() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture(\"drag\");\n }\n }\n }\n\n function touchended() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture(\"end\");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!customEvent(new DragEvent(drag, \"beforestart\", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[id] = gesture, n = active++; break;\n case \"end\": delete gestures[id], --active; // nobreak\n case \"drag\": p = point(container, id), n = active; break;\n }\n customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n end: transition_end\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n });\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import { select, event as d3event, selection, clientPoint } from 'd3-selection';\nimport { drag as d3drag } from 'd3-drag';\nimport 'd3-transition';\nimport { mergeRecursive } from './common-utils';\n/**\n * This function takes a raw DOM element or\n * a string and returns a d3 selection of that element.\n *\n * @param {HTMLElement | string} element The element to wrap in d3 selection.\n * @return {Selection} Instance of d3 selection.\n */\nconst selectElement = element => select(element);\n\n/**\n * It creates a new d3 element on the parent element\n * @param {Selection} parent Element to which the element is to be appended\n * @param {Object} elemType Type of the new element\n * @param {Array} data Data for the new element\n * @param {Object} selector classname/id/tagname for the element\n * @return {HTMLElement} Newly Created Element\n */\nconst makeElement = (parent, elemType, data, selector, callbacks = {}, keyFn) => {\n if ((parent instanceof HTMLElement || parent instanceof SVGElement)) {\n parent = selectElement(parent);\n }\n\n const selectorVal = selector ? selector[0] : null;\n let selectorType = null;\n let actualSelector = null;\n let element = null;\n let enterSel = null;\n let mergeSel = null;\n let filter;\n if (selectorVal) {\n if (selectorVal === '#') {\n selectorType = 'id';\n actualSelector = selector;\n } else {\n selectorType = 'class';\n actualSelector = selector[0] === '.' ? selector : `.${selector}`;\n }\n } else {\n actualSelector = elemType;\n filter = true;\n }\n element = parent.selectAll(actualSelector);\n\n filter && (element = element.filter(function () {\n return this.parentNode === parent.node();\n }));\n element = element.data(data, keyFn);\n\n enterSel = element.enter()\n .append(elemType || 'div');\n callbacks.enter && enterSel.each(function (...params) {\n callbacks.enter(selectElement(this), ...params);\n });\n\n mergeSel = enterSel.merge(element);\n callbacks.update && mergeSel.each(function (...params) {\n callbacks.update(selectElement(this), ...params);\n });\n if (selectorType === 'class') {\n mergeSel.classed(selectorVal === '.' ? selector.substring(1, selector.length) : selector, true);\n } else if (selectorType === 'id') {\n mergeSel.attr('id', selector.substring(1, selector.length));\n }\n const exitSel = element.exit();\n\n if (callbacks.exit) {\n exitSel.each(function (...params) {\n callbacks.exit(selectElement(this), ...params);\n });\n } else {\n exitSel.remove();\n }\n return mergeSel;\n};\n\n/**\n * This function applies styles to an element\n * @param {Object} elem Element Selection\n * @param {Object} styleObj Style Object to be applied\n * @return {Element} Newly Created Element\n*/\nconst applyStyle = (elem, styleObj) => {\n Object.entries(styleObj).forEach((d) => {\n elem.style(d[0], d[1]);\n }, this);\n return elem;\n};\n\n/**\n * This function appends a dom element in another element.\n * @param {HTMLElement | SVGElement} element1 The element in which to append the second element\n * @param {HTMLElement | SVGElement} element2 The element which will be appended.\n */\nconst appendElement = (element1, element2) => {\n element1.appendChild(element2);\n};\n\n/**\n * Sets the attributes to the element.\n * @param {HTMLElement | SVGElement} element Element on which attributes will be applied\n * @param {Object} attrs Attributes which need to be applied\n */\nconst setElementAttrs = (element, attrs) => {\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n element.attr(key, attrs[key]);\n }\n }\n};\n\n/**\n * Sets attributes in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which attrs will be applied\n * @param {Array.} attrs Array of attributes\n * @param {string} className className of elements to select.\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setAttrs = (element, attrs, className) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n className !== undefined ? element.selectAll(`.${className}`).each(function () {\n setElementAttrs(select(this), attrs);\n }) : setElementAttrs(element, attrs);\n return element;\n};\n\n/**\n * Adds a css class to elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst addClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, true) :\n elem.classed(className, true);\n });\n};\n\n/**\n * Removes the css class from elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst removeClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, false) :\n elem.classed(className, false);\n });\n};\n\n/**\n * Sets styles in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which styles will be applied\n * @param {Array.} styles Array of style attributes\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setStyles = (element, styles) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n element.style(key, styles[key]);\n }\n }\n return element;\n};\n\n/**\n * Creates svg or html elements by binding data to the selection.Removes extra elements\n * on exit.\n * @param {Object} params Parameter object\n * @param {SVGElement | HTMLElement} params.container Container element where all elements will be appended\n * @param {string} params.selector Selector by which elements will be selected from dom\n * @param {string} params.append Append tag\n * @param {Function} params.each Function which will be executed for each data point and element.\n */\nconst createElements = (params) => {\n const container = select(params.container);\n let data;\n\n data = params.data;\n if (typeof data === 'number') {\n data = Array(data).fill().map((d, i) => i);\n }\n const sel = container.selectAll(params.selector).filter(function () {\n return this.parentNode === container.node();\n }).data(data);\n\n const selectionMerge = sel.enter().append(params.append).merge(sel).each(function (d, i) {\n params.each(d, select(this), i);\n });\n\n selectionMerge.attr('class', params.className || '');\n sel.exit().remove();\n};\n\n/**\n * Clips an element with given measurement. Basically it is used to hide overflowing portions\n * of any element.\n * @param {SVGElement} container svg element which needs to be clipped.\n * @param {Object} measurement Dimensions of the clipped rectangle.\n * @param {string} id Unique id of the clip element\n */\nconst clipElement = (container, measurement, id) => {\n const clipPathElement = makeElement(select(container), 'clipPath', [1], `#${id}`);\n const clipPathRect = makeElement(clipPathElement, 'rect', [1]);\n clipPathRect.attr('x', measurement.x)\n .attr('y', measurement.x)\n .attr('width', measurement.width)\n .attr('height', measurement.height);\n clipPathElement.attr('clip-path', `url(#${id})`);\n};\n\n/**\n * Returns the element of the corresponding classname.\n * @param {HTMLElement | SVGElement} node html or svg node element.\n * @param {string} className css class to be applied.\n * @return {HTMLElement | SVGElement} html or svg element.\n */\nconst getElementsByClassName = (node, className) => select(node).selectAll(className).nodes();\n\n/**\n * Gets the mouse position relative to an svg type of element\n * @param {SVGElement} element Any svg element like rect, circle, etc.\n * @param {Event} event Event object.\n * @return {Object} x and y position relative to the container element passed.\n */\nconst getMousePos = (element, event) => {\n const boundingClientRect = element.getBoundingClientRect();\n return {\n x: event.x - boundingClientRect.x,\n y: event.y - boundingClientRect.y\n };\n};\n\nconst getClientPoint = (...params) => {\n const pos = clientPoint(...params);\n return {\n x: pos[0],\n y: pos[1]\n };\n};\n\n/** This function appends a dom element in another element.\n * @param {Object} tag The tag name of the element to append\n * @param {Object} mount Mount point fo the element\n * @return {Object} selection of the appended element\n */\nconst createElement = (tag, mount) => select(mount).append(tag).node();\n\n/**\n * Gets the d3 event function\n * @return {Object} d3 event\n */\nconst getEvent = () => d3event;\n\n/**\n * Gets the d3 drag function\n * @return {Object} d3 drag\n */\nconst getD3Drag = () => d3drag;\n\nconst getSmartComputedStyle = (group, css) => {\n let textEl;\n const testText = 'W';\n const mandatoryStyle = {\n 'fill-opacity': 0\n };\n const className = typeof css === 'string' ? css : (css instanceof Array ? css.join(' ') : undefined);\n\n if (group.node() instanceof HTMLElement) {\n textEl = group.append('div').html(testText);\n } else {\n textEl = group.append('text').text(testText);\n }\n\n if (className) {\n textEl.attr('class', className);\n } else if (typeof css === 'object') {\n delete css['fill-opacity'];\n mergeRecursive(mandatoryStyle, css);\n }\n\n textEl.style(mandatoryStyle);\n const computedStyle = window.getComputedStyle(textEl.node());\n const styleForSmartLabel = {\n fontSize: computedStyle.fontSize,\n fontFamily: computedStyle.fontFamily,\n fontWeight: computedStyle.fontWeight,\n fontStyle: computedStyle.fontStyle\n };\n\n textEl.remove();\n\n return styleForSmartLabel;\n};\n\nconst hasTouch = () => 'ontouchstart' in document.documentElement;\n\nexport {\n hasTouch,\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint\n};\n","import Model from 'hyperdis';\nimport { defaultValue, getObjProp, toArray } from './common-utils';\n\nconst initProp = (obj, props, val = () => ({})) => {\n props.forEach((prop) => {\n if (!obj[prop]) {\n obj[prop] = val();\n }\n obj = obj[prop];\n });\n return obj;\n};\n\nconst fetchPropValues = (propNames, params, deps) => params.map((param, i) => {\n const prop = propNames[i];\n\n return param.map(val => (val === undefined || val === null ? val : val[deps[prop]]));\n});\n\nconst addListenerToNamespace = (namespaceInf, fn, context) => {\n let key = namespaceInf.key;\n const namespace = namespaceInf.id;\n const listeners = context._listeners;\n\n if (namespace) {\n !listeners.get(namespace) && (listeners.set(namespace, new Map()));\n const namespaceListeners = listeners.get(namespace);\n\n if (!key) {\n key = namespaceListeners.size;\n }\n namespaceListeners.set(key, fn);\n } else {\n key = key || listeners.size;\n listeners.set(key, fn);\n }\n};\n\nconst setContexts = (contexts, propObj, contextMap) => {\n for (const key of propObj.keys()) {\n contexts[key] = {\n context: contextMap[key],\n deps: propObj.get(key).depProps\n };\n }\n return contexts;\n};\n\nconst registerPropInMaps = (store, props, namespaceInf, type) => {\n const {\n _registeredListeners: registeredListeners,\n _propListenerMap: propListenerMap\n } = store;\n const {\n subNamespace,\n namespace: ns\n } = namespaceInf;\n\n initProp(registeredListeners, [ns]);\n props.forEach((prop) => {\n const subNamespaces = defaultValue(getObjProp(registeredListeners, ns, prop, 'subNamespace'), []);\n let fns = defaultValue(getObjProp(propListenerMap, prop, type, 'fns'), 0);\n\n fns++;\n subNamespace && subNamespaces.push(subNamespace);\n registeredListeners[ns][prop] = {\n subNamespace: subNamespaces,\n allProps: props,\n subNamespaces: {}\n };\n initProp(propListenerMap, [prop, type]);\n propListenerMap[prop][type] = {\n fns,\n _fnCount: fns\n };\n });\n};\n\nconst registerListener = (context, type, ...options) => {\n const [propList, callBack, instantCall, namespaceInf = {}] = options;\n let props = propList;\n\n if (!Array.isArray(propList)) {\n props = [propList];\n }\n\n const { namespace: ns } = namespaceInf;\n const callbackFn = ((propNames, namespaceVal) => (...params) => {\n const { _savedCommits: commits, _propListenerMap: propListenerMap } = context;\n\n if (!propNames.some(prop => getObjProp(propListenerMap, prop, 'disabled'))) {\n if (namespaceVal) {\n const listenersObj = context._registeredListeners[namespaceVal];\n const contextMap = context._contextMap[namespaceVal];\n const contextsObj = {};\n\n propNames.forEach((prop) => {\n const commitsObj = defaultValue(getObjProp(commits, prop, type), {});\n const listeners = listenersObj[prop].subNamespaces;\n const propDeps = propListenerMap[prop][type];\n\n for (const nm in commitsObj) {\n const fnInf = defaultValue(propDeps[nm], { fns: 0 });\n let { fns } = fnInf;\n\n if (fns > 0) {\n setContexts(contextsObj, listeners[nm], contextMap);\n fns--;\n }\n\n if (fns <= 0) {\n delete commitsObj[nm];\n }\n fnInf.fns = fns;\n }\n });\n for (const key in contextsObj) {\n const obj = contextsObj[key];\n\n callBack(obj.context, ...fetchPropValues(propNames, params, obj.deps));\n }\n } else {\n callBack(...params);\n }\n }\n })(props, ns, type);\n\n const fn = context.model[type](props, callbackFn, instantCall);\n\n if (ns) {\n registerPropInMaps(context, props, namespaceInf, type);\n }\n addListenerToNamespace(namespaceInf, fn, context);\n};\n\nconst retrieveNamespaces = (names, key) => {\n if (names instanceof Object) {\n return [names[key]];\n } else if (names instanceof Array) {\n return names;\n }\n return [names];\n};\n\nconst createMap = () => new Map();\n\nconst listenerTypes = ['next', 'on'];\n\nconst removePropValue = (context, map, propInf) => {\n const { subNamespace: sns, prop, propListenerMap } = propInf;\n const propObj = propListenerMap[prop];\n\n listenerTypes.forEach((type) => {\n if (type in propObj) {\n delete propObj[type][sns];\n }\n });\n if (map.has(sns)) {\n const value = context.get(prop);\n\n if (value instanceof Object && sns in value) {\n delete value[sns];\n }\n map.delete(sns);\n }\n};\n\n/**\n * Methods to handle changes to table configuration and reactivity are handled by this\n * class.\n */\n/**\n * Common store class\n *\n * @class Store\n */\nexport class Store {\n /**\n * Creates an instance of Store.\n * @param {Object} config The object to create the state store with.\n * @memberof Store\n */\n constructor (config) {\n // create reactive model\n this.model = Model.create(config);\n this._listeners = new Map();\n this._registeredListeners = {};\n this._contextMap = {};\n this._commits = {};\n this._savedCommits = {};\n this._queuedProps = {};\n this._propListenerMap = {};\n this._locked = false;\n }\n\n lockModel () {\n this.model.lock();\n this._locked = true;\n return this;\n }\n\n unlockModel () {\n this._locked = false;\n this.model.unlock();\n return this;\n }\n\n /**\n * This method returns a plain JSON object\n * with all the fields in the state store.\n *\n * @return {Object} Serialized representation of state store.\n * @memberof Store\n */\n serialize () {\n return this.model.serialize();\n }\n\n lockCommits (props) {\n props.forEach((prop) => {\n this._commits[prop] = {\n locked: true,\n queue: []\n };\n });\n return this;\n }\n\n unlockCommits (props) {\n const commitsObj = this._commits;\n\n this.lockModel();\n props.forEach((prop) => {\n commitsObj[prop].locked = false;\n const queuedProps = {};\n const { queue } = commitsObj[prop];\n\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n if (namespace) {\n const propObj = initProp(queuedProps, [propName, namespace]);\n\n Object.assign(propObj, value);\n }\n });\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n this.commit(propName, propName in queuedProps ? queuedProps[propName][namespace] : value,\n namespace);\n });\n delete commitsObj[prop];\n });\n this.unlockModel();\n return this;\n }\n\n addSubNamespace (sns, namespace, context) {\n // Get all the listeners registered by the component\n const listeners = this._registeredListeners[namespace];\n const propListenerMap = this._propListenerMap;\n\n initProp(this._contextMap, [namespace]);\n this._contextMap[namespace][sns] = context;\n for (const key in listeners) {\n const obj = listeners[key];\n const propObj = propListenerMap[key];\n const propFns = listenerTypes.reduce((acc, type) => {\n const val = defaultValue(getObjProp(propObj, type, 'fns'), 0);\n val && (acc[type] = val);\n return acc;\n }, {});\n const { allProps, subNamespaces, subNamespace } = obj;\n const snsArr = subNamespace.length ? subNamespace : [sns];\n\n snsArr.forEach((ns) => {\n const nsObj = ns instanceof Function ? ns(context) : ns;\n const names = retrieveNamespaces(nsObj, key);\n const depProps = allProps.reduce((acc, prop) => {\n acc[prop] = ns instanceof Function ? nsObj[prop] : ns;\n return acc;\n }, {});\n\n names.forEach((nm) => {\n initProp(subNamespaces, [nm], createMap).set(sns, {\n depProps\n });\n\n for (const type in propFns) {\n initProp(propObj, [type, nm]);\n const fns = propFns[type];\n\n propObj[type][nm] = {\n fns,\n _fnCount: fns\n };\n }\n });\n });\n }\n return this;\n }\n\n /**\n * This method is used to update the value of a property in the state store.\n *\n * @param {string} propName The name of the property.\n * @param {number} value The new value of the property.\n * @memberof Store\n */\n commit (propName, value, namespace, disableListener = false) {\n let sanitizedVal = value;\n const commits = this._commits;\n const savedCommits = this._savedCommits;\n const locked = getObjProp(commits, propName, 'locked');\n const propListenerMap = this._propListenerMap[propName] || {};\n\n propListenerMap.disabled = disableListener;\n\n if (locked) {\n commits[propName].queue.push([propName, value, namespace]);\n return this;\n }\n\n if (namespace) {\n if (this._locked) {\n const queuedProps = initProp(this._queuedProps, [propName]);\n queuedProps[namespace] = value;\n sanitizedVal = queuedProps;\n } else {\n sanitizedVal = defaultValue(this.get(propName), {});\n sanitizedVal[namespace] = value;\n }\n\n listenerTypes.forEach((type) => {\n initProp(savedCommits, [propName, type]);\n savedCommits[propName][type][namespace] = true;\n if (getObjProp(propListenerMap, type, namespace)) {\n propListenerMap[type][namespace].fns = propListenerMap[type][namespace]._fnCount;\n }\n });\n }\n\n this.model.prop(propName, sanitizedVal);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */registerChangeListener (...params) {\n registerListener(this, 'next', ...params);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */ registerImmediateListener (...params) {\n registerListener(this, 'on', ...params);\n }\n\n /**\n * This method is used to get the name of the property\n * from the state store.\n *\n * @param {string} propName The name of the field in state store.\n * @return {any} The value of the field.\n * @memberof Store\n */\n get (propName, subNamespace) {\n const value = this.model.prop(propName);\n return subNamespace ? value && value[subNamespace] : value;\n }\n\n /**\n * This method is used to register a computed property that is computed every time\n * the store value changes.\n *\n * @param {string} propName The name of the property to create.\n * @param {Function} callBack The function to execute when depemdent props change.\n * @memberof Store\n */\n computed (propName, callBack) {\n return this.model.calculatedProp(propName, callBack);\n }\n\n append (...params) {\n this.model.append(...params);\n return this;\n }\n\n unsubscribeAll () {\n Object.values(this._listeners).forEach(fn => fn());\n return this;\n }\n\n unsubscribe (namespaceInf = {}) {\n const { id, key } = namespaceInf;\n const listenersMap = this._listeners;\n const listeners = listenersMap.get(id);\n\n if (key) {\n const fn = listenersMap.get(key);\n\n fn && fn();\n } else {\n for (const fn of listeners.values()) {\n fn();\n }\n listenersMap.set(id, []);\n }\n return this;\n }\n\n removeSubNamespace (subNamespace, namespace) {\n const {\n _registeredListeners: listenerMap,\n _contextMap: contextMap,\n _propListenerMap: propListenerMap\n } = this;\n const listenersObj = listenerMap[namespace];\n\n for (const prop in listenersObj) {\n const { subNamespaces } = listenersObj[prop];\n const propInf = {\n subNamespace,\n prop,\n propListenerMap\n };\n\n if (subNamespaces[subNamespace]) {\n removePropValue(this, subNamespaces[subNamespace], propInf);\n delete subNamespaces[subNamespace];\n } else {\n for (const ns in subNamespaces) {\n const snsMap = subNamespaces[ns];\n\n removePropValue(this, snsMap, propInf);\n if (!snsMap.size) {\n delete subNamespaces[ns];\n }\n }\n }\n }\n delete contextMap[namespace][subNamespace];\n return this;\n }\n}\n\n/**\n * Setter getter creator from config\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args. (Optional)\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitization: // Need for sanitization before type is checked\n * }\n * }\n *\n * @param {Object} holder an empty object on which the getters and setters will be mounted\n * @param {Object} options options config based on which the getters and setters are determined.\n * @param {Hyperdis} model optional model to attach the property. If not sent new moel is created.\n * @return {Array}\n */\nexport const transactor = (holder, options, model, namespaceInf = {}) => {\n let conf;\n const store = model instanceof Store ? model : new Store({});\n const stateProps = {};\n const { namespace, subNamespace } = namespaceInf;\n\n for (const prop in options) {\n if ({}.hasOwnProperty.call(options, prop)) {\n conf = options[prop];\n const nameSpaceProp = namespace ? `${namespace}.${prop}` : prop;\n\n if (subNamespace) {\n const value = defaultValue(store.get(nameSpaceProp), {});\n value[subNamespace] = conf.value;\n stateProps[nameSpaceProp] = value;\n } else {\n stateProps[prop] = conf.value;\n }\n\n holder[prop] = ((context, meta, nsProp) => (...params) => {\n const paramsLen = params.length;\n if (paramsLen) {\n const { takesMultipleParams = false } = meta || {};\n // If parameters are passed then it's a setter\n let val = takesMultipleParams ? params : params[0];\n\n if (meta) {\n let values;\n const prevVal = context.get(nsProp, subNamespace);\n const { sanitization, typeCheck, typeExpected } = meta;\n if (typeof sanitization === 'function') {\n // Sanitize if required\n val = sanitization(val, prevVal, holder);\n }\n\n // Checking if a setter is valid\n if (typeof typeCheck === 'function') {\n const typeCheckResult = typeCheck(val);\n\n if (typeCheckResult) {\n values = val;\n }\n } else if (typeof typeCheck === 'string' && typeCheck === 'constructor') {\n if (val && val.constructor.name === typeExpected) {\n values = val;\n }\n } else {\n values = val;\n }\n\n const preset = meta.preset;\n const oldValues = toArray(context.get(nsProp, subNamespace));\n preset && preset(values, holder);\n if (takesMultipleParams) {\n oldValues.forEach((value, i) => {\n if (values[i] === undefined) {\n values[i] = value;\n }\n });\n }\n values && context.commit(nsProp, values, subNamespace);\n } else {\n context.commit(nsProp, val, subNamespace);\n }\n return holder;\n }\n // No parameters are passed hence its a getter\n return context.get(nsProp, subNamespace);\n })(store, conf.meta, nameSpaceProp, Array.isArray(conf.value));\n }\n }\n\n if (subNamespace) {\n for (const key in stateProps) {\n store.commit(key, stateProps[key][subNamespace], subNamespace);\n }\n } else if (namespace === undefined) {\n store.append(stateProps);\n } else {\n store.append(namespace, stateProps);\n }\n\n return [holder, store];\n};\n","const events = [\n 'initialized',\n 'beforeupdate',\n 'updated',\n 'beforedraw',\n 'drawn',\n 'beforeremove',\n 'removed',\n 'animationend'\n];\n\nconst compositions = [\n 'canvas',\n 'unit',\n 'layer',\n 'axis',\n 'facet-headers',\n 'legend',\n 'caption'\n];\n\nconst EVENT_LIST = [];\n\ncompositions.forEach((composition) => {\n events.forEach((event) => {\n EVENT_LIST.push(`${composition}.${event}`);\n });\n});\n\nexport default EVENT_LIST;\n","import EVENT_LIST from './event-list';\nimport { createPromise } from './helper';\n\n/**\n * At first call it accepts one function\n * calling it second time accepts notification object.\n * notification object then called with first accepted function\n *\n * @param {Function} resolveFn a promise's resolve function\n * @return {Function} a function to accept notification object\n */\nconst resolver = resolveFn => notification => resolveFn(notification);\n\n/**\n * Checks if the property string is present in the source object\n *\n * @param {Object} source source object whom you want to check the property\n * @param {string} property key name that need to be checked\n * @return {boolean} returns true if the property found in the source object\n */\nconst hasOwn = (source, property) => Object.prototype.hasOwnProperty.call(source, property);\n\n/**\n * LifeCycleManager which goes as a dependendecy to a muze\n * it accepts notification from the entire library throughout\n * the exeecution life\n *\n * @export\n * @class LifeCycleManager\n */\nexport default class LifeCycleManager {\n\n /**\n * Creates an instance of LifeCycleManager.\n * @memberof LifeCycleManager\n */\n constructor () {\n this._eventList = EVENT_LIST;\n this._promises = new Map();\n this._notifiers = {};\n this._lifeCycles = {};\n this._unreleasedLifeCycles = {};\n this._boot();\n }\n\n /**\n * Fills all the notifiers with resolver callback\n *\n * @memberof LifeCycleManager\n */\n _boot () {\n this._notifiers = this._eventList.reduce((acc, name) => {\n acc[name] = resolver;\n return acc;\n }, {});\n this._preparePromises();\n }\n\n /**\n * Public method which gives the promise corresponding\n * to the event name\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} promise that is passed to the user\n * @memberof LifeCycleManager\n */\n retrieve (eventName) {\n return this._promises.get(eventName);\n }\n\n /**\n * Creates a promise that will be passed to user's callback\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} a pending promise waiting for resolve to be called\n * @memberof LifeCycleManager\n */\n _makeNotifierPromise (eventName) {\n return new Promise((resolve) => {\n this._notifiers[eventName] = resolver(resolve);\n });\n }\n\n /**\n * Prepares the promise map with pending promises\n * all the promises are in a pending state where their's\n * resolve function waiting to be called with notification object\n * @memberof LifeCycleManager\n */\n _preparePromises () {\n this._eventList.forEach((eventName) => {\n const promise = this._makeNotifierPromise(eventName);\n this._promises.set(eventName, promise);\n createPromise(promise, eventName, this);\n });\n }\n\n /**\n * Resolves the promise with notification object\n *\n * @param {string} eventName name of the event in the system\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n *\n * @memberof LifeCycleManager\n */\n _resolvePromise (eventName, notification) {\n this._notifiers[eventName](notification);\n }\n\n /**\n * Public method which is being called by different\n * subcompoents of the system at different execution atages\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n notify (notification) {\n // get the composition name from notification\n // or from static formalName() method\n const composition = notification.formalName || notification.client.constructor.formalName();\n notification.formalName = composition;\n this._releasePromisesFromCache();\n this._notify(composition, notification);\n }\n\n /**\n * Notify user the with promsie in a callback\n * if callback not found then cache it\n *\n * @param {string} composition\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n _notify (composition, notification) {\n const stage = notification.action;\n const eventName = `${composition}.${stage}`;\n\n // resolves promise with the notification object\n this._resolvePromise(eventName, notification);\n\n // get the promise from the promise map\n const promise = this.retrieve(eventName);\n\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // if user given call back exists, then call with promise\n this._callLifeCycleCallback(composition, stage, promise);\n } else {\n // otherwise cache the promise\n this._cachePromise(composition, stage, promise);\n }\n } else {\n this._cachePromise(composition, stage, promise);\n }\n }\n\n /**\n * Calls the user's callback with callback\n *\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _callLifeCycleCallback (composition, stage, promise) {\n const eventName = `${composition}.${stage}`;\n this._lifeCycles[composition][stage](promise);\n this._resetTargetPromise(eventName);\n }\n\n /**\n * Try to clear the cached promsies once we have\n * macthed callbacks from the user\n *\n * @memberof LifeCycleManager\n */\n _releasePromisesFromCache () {\n const compositions = Object.keys(this._unreleasedLifeCycles);\n compositions.forEach((composition) => {\n const stages = Object.keys(this._unreleasedLifeCycles[composition]);\n stages.forEach((stage) => {\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // take the promise from unreleased lifeCycles\n const promise = this._unreleasedLifeCycles[composition][stage];\n // call the user given callback with that promise\n this._callLifeCycleCallback(composition, stage, promise);\n // delete promise from unreleased lifeCycles\n delete this._unreleasedLifeCycles[composition][stage];\n }\n }\n });\n });\n }\n\n /**\n * Cache the promise in the map. This cache\n * then get consumed if we get user callbacks\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _cachePromise (composition, stage, promise) {\n if (!hasOwn(this._unreleasedLifeCycles, composition)) {\n this._unreleasedLifeCycles[composition] = {};\n }\n\n if (!hasOwn(this._unreleasedLifeCycles[composition], stage)) {\n this._unreleasedLifeCycles[composition][stage] = {};\n }\n this._unreleasedLifeCycles[composition][stage] = promise;\n }\n\n /**\n * It register's the callbacks gievn the user\n *\n * @param {Object} [lifeCycles={}] a object with list of callbacks\n * @memberof LifeCycleManager\n */\n register (lifeCycles = {}) {\n this._lifeCycles = lifeCycles;\n // as we get all the callbacks, try to call them\n // from unreleased promise map\n this._releasePromisesFromCache();\n }\n\n /**\n * Reset the promise into pending state\n *\n * @param {string} eventName name of the event happening\n * @memberof LifeCycleManager\n */\n _resetTargetPromise (eventName) {\n setTimeout(() => {\n this._notifiers[eventName] = resolver;\n this._promises.set(eventName, this._makeNotifierPromise(eventName));\n }, 0);\n }\n}\n","import LifeCycleManager from './lifecycle-manager';\n\nexport default LifeCycleManager;\n","/**\n * Creates a new promise when the given promise is resolved. This needs to be done so that after the lifecycle event\n * is completed, then again when the event gets completed, then a new promise gets resolved.\n *\n * @param {Promise} promise Instance of promise\n * @param {string} eventName name of event\n * @param {LifeCycleManager} context Instance of lifecyclemanager\n */\nexport const createPromise = (promise, eventName, context) => {\n promise.then(() => {\n const prm = context._makeNotifierPromise(eventName);\n context._promises.set(eventName, prm);\n createPromise(prm, eventName, context);\n });\n};\n","import { default as DataModel } from 'datamodel';\nimport * as scales from './scales';\nimport * as colorSchemes from './color-schemes';\nimport * as STATE_NAMESPACES from './enums/namespace';\nimport RTree from './r-tree';\n\nconst InvalidAwareTypes = DataModel.InvalidAwareTypes;\n\nexport {\n InvalidAwareTypes,\n DataModel\n};\n\nexport {\n ReservedFields,\n CommonProps,\n COORD_TYPES\n} from './enums';\n\nexport { STATE_NAMESPACES };\n\nexport {\n scales,\n colorSchemes\n};\n\nexport {\n getNearestValue,\n getValueParser,\n transformColor,\n transformColors,\n detectColor,\n hslToRgb,\n rgbToHsv,\n hexToHsv,\n hsvToRgb,\n hslaToRgb,\n escapeHTML,\n angleToRadian,\n generateGetterSetters,\n getArraySum,\n ERROR_MSG,\n interpolator,\n colorInterpolator,\n numberInterpolator,\n piecewiseInterpolator,\n reqAnimFrame,\n cancelAnimFrame,\n nextAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n replaceCSSPrefix,\n symbolFns,\n defaultValue,\n easeFns,\n clone,\n interpolateArray,\n getMinPoint,\n getMaxPoint,\n getClosestIndexOf,\n registerListeners,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isEqual,\n isSimpleObject,\n nextFrame,\n getObjProp,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n transposeArray,\n toArray,\n extendsClass,\n concatModels,\n assembleModelFromIdentifiers,\n isValidValue,\n nestCollection,\n stack,\n getSymbol,\n Scales,\n Symbols,\n pathInterpolators,\n hslInterpolator,\n getSmallestDiff,\n require,\n formatTemporal,\n nearestSortingDetails,\n createSelection,\n temporalFields,\n retrieveNearestGroupByReducers,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n intersect,\n partition,\n mix,\n componentRegistry,\n getArrayDiff,\n difference,\n getArrayIndexMap,\n arraysEqual,\n getReadableTicks,\n unique,\n dmMultipleSelection,\n pointWithinCircle\n} from './common-utils';\n\nexport {\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint,\n hasTouch\n} from './renderer-utils';\n\nexport {\n Store,\n transactor\n} from './store';\n\nexport {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'd3-time';\n\nexport { default as Smartlabel } from 'fusioncharts-smartlabel';\nexport { dataSelect } from './DataSystem';\n\nexport { default as LifeCycleManager } from './lifecycle-manager';\n\nexport {\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n DateTimeFormatter,\n DM_DERIVATIVES,\n GROUP_BY_FUNCTIONS\n} from 'datamodel';\n\nexport {\n RTree\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const STACK = 'stack';\nexport const GROUP = 'group';\nexport const IDENTITY = 'identity';\nexport const ANGLE = 'angle';\nexport const RADIUS = 'radius';\nexport const SIZE = 'size';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const TEXT = 'text';\nexport const OUTER_RADIUS_VALUE = 'outerRadiusValue';\nexport const TEXT_ANCHOR_MIDDLE = 'middle';\nexport const ENCODING = {\n X: 'x',\n Y: 'y',\n X0: 'x0',\n Y0: 'y0',\n RADIUS: 'radius',\n RADIUS0: 'radius0',\n ANGLE: 'angle',\n ANGLE0: 'angle0',\n COLOR: 'color',\n SHAPE: 'shape',\n SIZE: 'size',\n TEXT: 'text'\n};\n\nexport const STROKE_DASHARRAY = 'stroke-dasharray';\n\nexport const ASCENDING = 'asc';\n\nexport const AGG_FN_SUM = 'sum';\n\nexport const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * This is an interface class which any new layer class has to extend.\n *\n * @example\n * class BarLayer extends BaseLayer {\n * update (params) {\n * // super.update(params);\n * // Update the bar layer\n * }\n * }\n * @class\n */\nexport default class SimpleLayer {\n\n formalName () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets or gets the dependencies.\n * @param {Object} dependencies Dependencies needed by layer\n * @return {BaseLayer} Instance of base layer.\n */\n dependencies () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the config of the layer\n *\n * @param {Object} config Configuration of layer\n * @return {Object} configuration of layer\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Acts as a getter or setter function\n * When setter\n * Returns the datamodel of the layer\n * @param { DataModel } dataModel instance of DataModel\n * @return { DataModel } DataModel instance of the layer\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized schema of the layer\n * @return {Object} Serialized schema\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the unique identifier of this layer\n * @return {string} id of the layer\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n /*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldMap field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n * @private\n */\n normalizeTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of dataModel\n * @param {Object} config configuration for transforming data\n * @return {Array.} Transformed data.\n * @private\n */\n getTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a nominal field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @return {Array} Domain values array.\n */\n _calculateDomainFromData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, color, etc.\n * @return {Object} Axis domains\n */\n getDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for getting nearest point\n * @return {BaseLayer} Instance of base layer\n */\n getNearestPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for highlighting points\n * @return {BaseLayer} Instance of base layer\n */\n highlightPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for deselecting points\n * @return {BaseLayer} Instance of base layer\n */\n dehighlightPoint () {\n return this;\n }\n\n linkLayerStore () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets the container element for the layer to be renderered.\n * @param {SVGElement} mountPoint SVG element or group element.\n */\n mount () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n","export const DATA = 'data';\nexport const CONFIG = 'config';\nexport const MEASUREMENT = 'measurement';\nexport const DOMAIN = 'domain';\nexport const MOUNT = 'mount';\n","import { COORD_TYPES, mergeRecursive } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nconst { CARTESIAN } = COORD_TYPES;\nexport const props = {\n axes: {},\n mount: {},\n measurement: {},\n metaInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {\n defaultValue: CARTESIAN\n },\n [PROPS.CONFIG]: {\n value: null,\n sanitization: (context, config) => {\n context._customConfig = config;\n const constructor = context.constructor;\n const newConf = mergeRecursive({}, constructor.defaultConfig());\n\n return constructor.defaultPolicy(newConf, config);\n }\n },\n encodingTransform: {},\n encodingFieldsInf: {},\n dependencies: {},\n dataProps: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { Symbols } from 'muze-utils';\nimport * as AxisOrientation from '../enums/axis-orientation';\n\n/**\n * @module Axis\n * This file exports constants that are used to reference axis orientations\n * in a consistent manner.\n */\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\n\n/**\n * This object is used to associate the axis orientation with the d3 class\n * used to represent that axis.\n */\nexport const axisOrientationMap = {\n [AxisOrientation.LEFT]: Symbols.axisLeft,\n [AxisOrientation.BOTTOM]: Symbols.axisBottom,\n [AxisOrientation.RIGHT]: Symbols.axisRight,\n [AxisOrientation.TOP]: Symbols.axisTop\n};\n","/**\n * @module axis\n * This file exports constants used to reference scale type\n * consistently throughout the project.\n */\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const TIME = 'temporal';\nexport const COLOR = 'color';\nexport const ORDINAL = 'ordinal';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\nexport const LOG = 'log';\nexport const POW = 'pow';\nexport const IDENTITY = 'identity';\nexport const SEQUENTIAL = 'sequential';\nexport const THRESHOLD = 'threshold';\n","export const CLASSPREFIX = 'muze';\n\nexport const CONTINOUS = 'continous';\nexport const DISCRETE = 'discrete';\nexport const SEQUENTIAL = 'sequential';\nexport const ORDINAL = 'ordinal';\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const THRESHOLD = 'threshold';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\n\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\n\nexport const DOMAIN = 'domain';\nexport const HIDDEN = 'hidden';\nexport const NUMBER = 'number';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\n\nexport const RGB = 'rgb';\nexport const HEX = 'hex';\nexport const HSLA = 'hsla';\nexport const HSL = 'hsl';\n\nexport const DEFAULT_ANGLE_DOMAIN = [1];\nexport const MIN_NO_OF_TICKS = 2;\nexport const DEFAULT_NO_OF_TICKS = 10;\n\n","import { scales, colorSchemes } from 'muze-utils';\n\nimport {\n SEQUENTIAL,\n ORDINAL,\n LINEAR,\n CONTINOUS,\n THRESHOLD,\n QUANTIZE\n} from './enums/constants';\n\nimport * as ScaleType from './enums/scale-type';\n\nconst {\n scaleLinear,\n scaleThreshold,\n scaleLog,\n scalePow,\n scaleIdentity,\n scaleOrdinal,\n scaleSequential,\n scaleQuantize,\n scaleQuantile,\n schemeCategory10,\n schemeCategory20,\n schemeCategory20b,\n scaleBand,\n scaleTime\n} = scales;\nexport const scaleMap = {\n [ScaleType.LINEAR]: scaleLinear,\n [ScaleType.BAND]: scaleBand,\n [ScaleType.QUANTIZE]: scaleQuantize,\n [ScaleType.QUANTILE]: scaleQuantile,\n [ScaleType.THRESHOLD]: scaleThreshold,\n [ScaleType.SEQUENTIAL]: scaleSequential,\n [ScaleType.LOG]: scaleLog,\n [ScaleType.POW]: scalePow,\n [ScaleType.IDENTITY]: scaleIdentity,\n [ScaleType.TIME]: scaleTime,\n [ScaleType.COLOR]: scaleLinear,\n [ScaleType.ORDINAL]: scaleOrdinal\n};\nexport const SCHEMES = {\n SCHEME1: schemeCategory10,\n SCHEME2: schemeCategory20,\n SCHEME3: schemeCategory20b\n};\n\n/**\n * Accepts a scheme in a string format and returns the scale from d3-scale-chromatic\n *\n * @export\n * @param {string} scheme a string representing the kind of scheme for the color axis\n * @return {Object} The corresponding scale from a scheme type from d3 chromatic scale\n */\nexport function getScheme (scheme) {\n if (scheme[0] === 'i') {\n return scaleSequential(colorSchemes[scheme]);\n }\n return scaleOrdinal(colorSchemes[scheme]);\n}\n\n/**\n *\n *\n * @export\n * @param {*} scheme\n *\n */\nexport function getSchemeType (scheme) {\n let schemeType = '';\n if (scheme && typeof (scheme) === 'string') {\n schemeType = scheme[0] === 'i' ? SEQUENTIAL : ORDINAL;\n } else {\n schemeType = ORDINAL;\n }\n return schemeType;\n}\n\n/**\n * This function is used to create a scale that is assigned to\n * an instance of axis.\n *\n * @export\n * @param {Object} params the input parameters to create a Scale object\n * @param {string} params.type the type of scale\n * @param {Array} params.range the range of scale\n * @return {Object} instance of scale\n */\nexport function createScale (params) {\n if (!params.type || !scaleMap[params.type]) {\n throw new Error(`${params.type} is not a valid scale type`);\n }\n if (!Array.isArray(params.range)) {\n throw new Error('range parameter must be an array');\n }\n let scaleFactory = null;\n const range = params.range;\n // @todo: do it using scale decorator\n if (params.type === LINEAR && params.interpolator) {\n scaleFactory = scaleMap[params.interpolator];\n if (params.interpolator === ScaleType.POW) {\n return scaleFactory().range(range).exponent(params.exponent);\n } else if (params.interpolator === ScaleType.LOG) {\n return scaleFactory().range(range).base([params.base]);\n }\n } else {\n scaleFactory = scaleMap[params.type];\n }\n\n if (params.type === QUANTIZE) {\n scaleFactory().nice();\n }\n return scaleFactory().range(range);\n}\n\n/**\n * This method is used to update the range of a scale\n * so that the core module can remain agnostic of the d3\n * scale api.\n *\n * @export\n * @param {Scale} scale Instance of d3 Scale.\n * @param {Array} range new range of the scale.\n * @return {Scale} Updated scale.\n */\nexport function updateScaleRange (scale, range) {\n return scale.range(range);\n}\n\n/**\n *\n *\n * @export\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} steps\n *\n */\nexport function getScaleType (domainType, rangeType, steps) {\n if (rangeType === CONTINOUS) {\n return LINEAR;\n }\n if (domainType === CONTINOUS) {\n if (steps instanceof Array) {\n return THRESHOLD;\n }\n return QUANTIZE;\n }\n return ORDINAL;\n}\n","import { getUniqueId } from 'muze-utils';\nimport { CLASSPREFIX } from '../enums/constants';\n\n/**\n *\n *\n */\nexport const defaultConfig = {\n id: getUniqueId(),\n adjustRange: false,\n axisName: {\n defClassName: 'axis-name'\n },\n axisNamePadding: 7,\n base: 10,\n classPrefix: CLASSPREFIX,\n className: `${CLASSPREFIX}-axis`,\n exponent: 1,\n interpolator: 'linear',\n fixedBaseline: true,\n labels: {\n rotation: null,\n smartTicks: null\n },\n orientation: 'left',\n numberFormat: val => val,\n padding: 0.3,\n nice: true,\n numberOfTicks: null,\n rotate: false,\n show: true,\n showAxisName: true,\n showInnerTicks: true,\n showOuterTicks: true,\n style: {},\n type: 'linear',\n tickFormat: null,\n tickValues: null,\n xOffset: 0,\n yOffset: 0,\n defaultSort: 'asc'\n};\n\n","/**\n * This file exports functionality that is used to render axis.\n */\nimport { selectElement, makeElement, angleToRadian } from 'muze-utils';\nimport * as AxisOrientation from './enums/axis-orientation';\nimport { LINEAR, HIDDEN, BOTTOM, TOP } from './enums/constants';\n\n/**\n *\n *\n * @param {*} instance\n * @param {*} container\n * @param {*} labelManager\n * @param {*} config\n */\nconst rotateAxis = (instance, tickText, labelManager) => {\n let rotation;\n const axis = instance.axis();\n const config = instance.config();\n const renderConfig = instance.renderConfig();\n const smartTicks = instance.smartTicks();\n const scale = axis.scale();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n const ticks = labelFunc();\n const {\n orientation,\n fixedBaseline,\n type\n } = config;\n const {\n labels\n } = renderConfig;\n\n rotation = labels.rotation;\n\n const tickSize = instance.getTickSize();\n tickText.each(function (d, index) {\n let yShift;\n let xShift;\n let datum = smartTicks[index] ? smartTicks[index].text : d;\n\n datum = datum.toString();\n\n const tickLabelDim = labelManager.getOriSize(datum);\n\n const width = tickLabelDim.width * 0.5;\n const height = tickLabelDim.height * 0.5;\n\n if (rotation < 0) {\n rotation = 360 + rotation;\n }\n\n const quadrant = 4 - Math.floor(rotation / 90);\n const rotationNormalizer = ((quadrant % 2 === 0) ? rotation : 180 * Math.ceil(rotation / 180) - rotation) % 180;\n\n yShift = Math.sqrt(height ** 2 + width ** 2) * Math.sin(angleToRadian(rotationNormalizer));\n\n if ((quadrant === 3 || quadrant === 2) && !(rotationNormalizer > 67.5 && rotationNormalizer <= 90)) {\n yShift += height * 2;\n }\n xShift = width;\n\n if (rotation === 90) {\n xShift = height;\n } else if (rotation === 270) {\n xShift = -height;\n } else {\n xShift = 0;\n }\n\n if (orientation === AxisOrientation.TOP) {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift + xShift / 2 : xShift;\n selectElement(this)\n .attr('transform', `translate(${-xShift + tickSize}\n ${-yShift - tickSize}) rotate(${rotation})`);\n } else {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift - xShift / 2 : xShift;\n\n selectElement(this)\n .attr('transform', `translate(${xShift - tickSize}\n ${yShift + tickSize}) rotate(${rotation})`);\n }\n // selectElement(this).transition()\n // .duration(1000).text(datum);\n });\n return tickText;\n};\n\n/**\n *\n *\n * @param {*} tickText\n * @param {*} axisInstance\n */\nconst changeTickOrientation = (selectContainer, axisInstance, tickSize) => {\n const {\n _smartTicks\n } = axisInstance;\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const {\n orientation,\n classPrefix\n } = config;\n const {\n labels\n } = renderConfig;\n const {\n rotation,\n smartTicks: isSmartTicks\n } = labels;\n\n const tickText = selectContainer.selectAll('.tick text');\n tickText.selectAll('tspan').remove();\n\n // rotate labels if not enough space is available\n if (rotation && (orientation === TOP || orientation === BOTTOM)) {\n rotateAxis(axisInstance, tickText, labelManager);\n } else if (!rotation && !isSmartTicks) {\n tickText.attr('transform', '');\n } else {\n tickText.text('');\n if (orientation === TOP || orientation === BOTTOM) {\n tickText.attr('y', 0)\n .attr('x', 0)\n .attr('transform', '')\n .text('');\n const tspan = makeElement(tickText, 'tspan', (d, i) => {\n if (_smartTicks[i]) {\n return _smartTicks[i].lines;\n } return [];\n }, `${classPrefix}-smart-text`);\n\n tspan.attr('dy', '0')\n .style('opacity', '0')\n\n .transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .attr('dy', (d, i) => {\n if (orientation === BOTTOM || i !== 0) {\n return _smartTicks[0].oriTextHeight;\n }\n return -_smartTicks[0].oriTextHeight * (_smartTicks[0].lines.length - 1) - tickSize;\n })\n .style('opacity', 1)\n .text(e => e)\n .attr('x', 0);\n } else {\n const tspan = makeElement(tickText, 'tspan', (d, i) => _smartTicks[i].lines, `${classPrefix}-smart-text`);\n tspan.text(e => e);\n }\n }\n\n return tickText;\n};\n\nconst setFixedBaseline = (axisInstance) => {\n const {\n fixedBaseline\n } = axisInstance.config();\n const {\n showInnerTicks\n } = axisInstance.renderConfig();\n const domain = axisInstance.domain();\n if (fixedBaseline && domain.length && showInnerTicks) {\n axisInstance.setFixedBaseline();\n }\n};\n\n/**\n *\n *\n * @param {*} textNode\n * @param {*} orientation\n * @param {*} measures\n */\nconst setAxisNamePos = (textNode, orientation, measures) => {\n const {\n axisNameHeight,\n availableSpace\n } = measures;\n\n switch (orientation) {\n case AxisOrientation.LEFT:\n textNode.attr('transform',\n `translate(${-(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(-90)`);\n break;\n case AxisOrientation.RIGHT:\n textNode.attr('transform',\n `translate(${(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(90)`);\n break;\n case AxisOrientation.TOP:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${-availableSpace.height + axisNameHeight})`);\n break;\n case AxisOrientation.BOTTOM:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${availableSpace.height - axisNameHeight / 2})`);\n break;\n default:\n }\n return textNode;\n};\n\n/**\n * This method is used to render the axis inside an\n * svg container.\n *\n * @export\n * @param {Object} axisInstance the nput object required to render axis\n * @param {string} axisInstance.orientation the orientation of axis\n * @param {Object} axisInstance.scale instance of d3 scale\n * @param {SVGElement} axisInstance.container the container in which to render\n */\nexport function renderAxis (axisInstance) {\n const renderConfig = axisInstance.renderConfig();\n const config = axisInstance.config();\n\n const {\n show,\n xOffset,\n yOffset,\n showAxisName,\n labels,\n smartAxisName\n } = renderConfig;\n const mount = axisInstance.mount();\n\n const {\n orientation,\n axisNamePadding,\n className,\n id,\n classPrefix\n } = config;\n\n if (!show) {\n return;\n }\n\n const selectContainer = makeElement(selectElement(mount), 'g', [axisInstance], `${className}`, {},\n key => key.config().id);\n selectContainer.attr('transform', `translate(${xOffset},${yOffset})`);\n\n let availableSpace;\n let labelProps;\n let tickSize;\n if (axisInstance.domain().length > 0) {\n const labelManager = axisInstance.dependencies().labelManager;\n const range = axisInstance.range();\n const axis = axisInstance.axis();\n const scale = axisInstance.scale();\n\n const {\n _tickLabelStyle: tickLabelStyle,\n _tickFormatter: axisTickFormatter\n } = axisInstance;\n\n tickSize = axisInstance.getTickSize();\n\n // Set style for tick labels\n labelManager.setStyle(tickLabelStyle);\n\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n const ticks = axis.tickValues() || labelFunc();\n\n axis.tickFormat(axisTickFormatter(ticks));\n\n // Get range(length of range)\n availableSpace = Math.abs(range[0] - range[1]);\n\n // Get width and height taken by axis labels\n labelProps = axisInstance.axisComponentDimensions().largestTickDimensions;\n\n // Draw axis ticks\n setFixedBaseline(axisInstance);\n if (!labels.rotation && labels.smartTicks === false) {\n selectContainer.transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .call(axis);\n } else {\n selectContainer.call(axis);\n changeTickOrientation(selectContainer, axisInstance, tickSize);\n }\n\n selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true);\n selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true);\n\n // Set classes for ticks\n const tickText = selectContainer.selectAll('.tick text');\n tickText.classed(`${classPrefix}-ticks`, true)\n .classed(`${classPrefix}-ticks-${id}`, true);\n }\n // Create axis name\n const textNode = makeElement(selectContainer, 'text', [smartAxisName], `${classPrefix}-axis-name`)\n .attr('text-anchor', 'middle')\n .classed(`${classPrefix}-axis-name-${id}`, true)\n .text(d => d.text);\n\n // Hide axis name if show is off\n textNode.classed(HIDDEN, !showAxisName);\n\n // render labels based on orientation of axis\n const labelOffset = availableSpace / 2;\n\n const measures = {\n labelProps,\n tickSize,\n axisNamePadding,\n axisNameHeight: smartAxisName.height,\n yOffset,\n xOffset,\n labelOffset,\n availableSpace: axisInstance.availableSpace()\n };\n // Set position for axis name\n setAxisNamePos(textNode, orientation, measures);\n}\n","import {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'muze-utils';\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\n// Longest Word for each level based on which tick skipping is decided\nconst longestWord = {\n month: 'September',\n quarter: 'October',\n halfYearly: 'July',\n year: 9999,\n day: 'September',\n hour: '24 AM',\n mintues: '60:60',\n seconds: ':60',\n week: 'Wed 31'\n};\n\n// These are the various levels of ticks that can be shown by Muze.\n// Each level is described as how frequently the ticks appear\n// The format is as follows:\n// [Frequency, Milliseconds, Name of Seconds, Tick Generator, Level Type]\nconst tickIntervals = [\n [1, 1, 'milliseconds', timeMillisecond.every(1), 'seconds'],\n [1, durationSecond, 'seconds', timeSecond.every(1), 'seconds'],\n [5, 5 * durationSecond, 'five seconds', timeSecond.every(5), 'seconds'],\n [10, 10 * durationSecond, 'ten seconds', timeSecond.every(10), 'seconds'],\n [15, 15 * durationSecond, 'fifteen seconds', timeSecond.every(15), 'seconds'],\n [30, 30 * durationSecond, 'thirty seconds', timeSecond.every(30), 'seconds'],\n [1, durationMinute, 'minute', timeMinute.every(1), 'minutes'],\n [5, 5 * durationMinute, 'five minutes', timeMinute.every(5), 'minutes'],\n [10, 10 * durationMinute, 'ten minutes', timeMinute.every(10), 'minutes'],\n [15, 15 * durationMinute, 'fifteen minutes', timeMinute.every(15), 'minutes'],\n [30, 30 * durationMinute, 'thirty minutes', timeMinute.every(30), 'minutes'],\n [1, durationHour, 'hour', timeHour.every(1), 'hour'],\n [3, 3 * durationHour, 'three hours', timeHour.every(3), 'hour'],\n [6, 6 * durationHour, 'six hours', timeHour.every(6), 'hour'],\n [12, 12 * durationHour, 'twelve hours', timeHour.every(12), 'hour'],\n [1, durationDay, 'daily', timeDay.every(1), 'day'],\n [1, durationWeek, 'weekly', timeWeek.every(1), 'week'],\n [1, durationMonth, 'monthly', timeMonth.every(1), 'week'],\n [3, 3 * durationMonth, 'quaterly', timeMonth.every(3), 'quarter'],\n [6, 6 * durationMonth, 'half yearly', timeMonth.every(6), 'halfYearly'],\n [1, durationYear, 'yearly', timeYear.every(1), 'year'],\n [2, 2 * durationYear, '2 year', timeYear.every(2), 'year'],\n [3, 3 * durationYear, '3 year', timeYear.every(3), 'year'],\n [5, 5 * durationYear, '5 year', timeYear.every(5), 'year'],\n [10, 10 * durationYear, 'decade', timeYear.every(10), 'year'],\n [100, 100 * durationYear, 'century', timeYear.every(100), 'year'],\n [1000, 1000 * durationYear, 'millenium', timeYear.every(1000), 'year']\n];\n/**\n * Get the actual tick interval based on the available width, number of ticks\n * and the distance between two ticks\n *\n * @param {Object} context Axis Context\n * @param {number} noOfTicks Number of Ticks based on which interval is calculated\n * @return {number} The width for the tick interval\n */\nconst getActualTickInterval = (context, noOfTicks) => {\n const minTickDistance = context._minTickDistance;\n const minWidthBetweenTicks = minTickDistance.width;\n\n const { width } = context.availableSpace();\n const actualTickInterval = Math.floor(((width - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks));\n\n return actualTickInterval;\n};\n\n/**\n * Get the tick interval based on the current level of ticks. Levels are decided on\n * the number of ticks that are possible to show\n *\n * @param {Object} context Axis Context\n * @param {string} type Type of level (yearly, monthly, etc)\n * @return {number} The width for the tick interval\n */\nconst getTickIntervalBasedOnCurrentLevel = (context, type) => {\n const labelManager = context._dependencies.labelManager;\n const longestWordType = longestWord[type];\n const measure = labelManager.getOriSize(longestWordType);\n\n return measure.width;\n};\n\nconst getTickIntervalFnBasedOnNumberOfTicks = (interval, count, context) => {\n let possibleTickLevelIndex = tickIntervals.length - 1;\n let maxPossibleTicks = 1;\n let tickIntervalLevelInfo = null;\n\n // Decide possible tick level based on min tick width (with ellipses)\n for (let i = tickIntervals.length - 1; i >= 0; i--) {\n const tickIntervalInfo = tickIntervals[i];\n const numOfPossibleTicks = Math.floor(interval / tickIntervalInfo[1]);\n if (numOfPossibleTicks <= count) {\n possibleTickLevelIndex = i;\n maxPossibleTicks = numOfPossibleTicks;\n }\n }\n\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex];\n\n // Get actual tick interval based on the level of ticks generated\n const actualTickInterval = getActualTickInterval(context, maxPossibleTicks);\n\n // Maximum Possible tick Interval for a particular level based on a pre decided set of values\n const maxTickInterval = getTickIntervalBasedOnCurrentLevel(context, tickIntervalLevelInfo[4]);\n\n // Display the next level involving tick skipping if current level does not meet the requirement\n // for displaying max tick\n if (actualTickInterval < maxTickInterval && possibleTickLevelIndex < tickIntervals.length - 1) {\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex + 1];\n }\n return tickIntervalLevelInfo[3];\n};\n\nexport const getSkippedTicks = (context, maxPossibleTicks) => {\n let actualNumberOfTicks = maxPossibleTicks;\n const domain = context.domain();\n const minDiff = context._minDiff;\n // Get the interval in ms from the domain\n const millisecondInterval = domain[1] - domain[0];\n // Get number of ticks based on the minimum difference in the data\n const numOfTicksAccordingToMinDiff = Math.floor(millisecondInterval / minDiff);\n\n // Show ticks according to min diff if possible\n if (maxPossibleTicks >= numOfTicksAccordingToMinDiff) {\n actualNumberOfTicks = numOfTicksAccordingToMinDiff;\n }\n\n return getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval, actualNumberOfTicks, context);\n};\n","import { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { getSkippedTicks } from './skip-ticks';\nimport { TIME, LINEAR, BAND } from '../enums/scale-type';\n\nexport const applyTickSkipping = (context) => {\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = minTickSpace.width;\n\n const { width } = context.availableSpace();\n\n const maxTicks = Math.floor((width + minWidthBetweenTicks) / (minTickWidth + minWidthBetweenTicks));\n\n const ticks = context.scale().ticks(getSkippedTicks(context, maxTicks));\n\n context.renderConfig({\n tickValues: ticks\n });\n};\n\nconst adjustHorizontalRange = (range, diff) => {\n range[0] += diff;\n range[1] -= diff;\n return range;\n};\n\nconst adjustVerticalRange = (range, diff) => {\n range[0] -= diff;\n range[1] += diff;\n return range;\n};\n\nconst rangeAdjustmentMap = {\n [TOP]: adjustHorizontalRange,\n [BOTTOM]: adjustHorizontalRange,\n [LEFT]: adjustVerticalRange,\n [RIGHT]: adjustVerticalRange\n};\n\nexport const setAxisRange = (context, type, rangeBounds, offset) => {\n context.range(rangeBounds);\n offset && context.renderConfig({ [`${type}Offset`]: offset });\n};\n\nconst getAxisOffset = (timeDiff, range, domain) => {\n const avWidth = Math.abs(range[1] - range[0]);\n const pvr = avWidth / (domain[1] - domain[0]);\n const width = (pvr * timeDiff);\n const bars = avWidth / width;\n const barWidth = avWidth / (bars + 1);\n const diff = avWidth - barWidth * bars;\n\n return diff / 2;\n};\n\nexport const getAdjustedRange = (minDiff, range, domain, config) => {\n const {\n orientation,\n adjustRange\n } = config;\n const diff = getAxisOffset(minDiff, range, domain);\n\n if (adjustRange) {\n return rangeAdjustmentMap[orientation](range, diff);\n }\n return range;\n};\n\nexport const spaceSetter = (context, spaceConfig) => {\n let tickInterval;\n let heightForTicks;\n const config = context.config();\n const {\n width: availWidth,\n height: availHeight,\n padding\n } = context.availableSpace();\n const {\n top,\n left,\n bottom,\n right\n } = padding;\n const {\n isOffset\n } = spaceConfig;\n const {\n showAxisName,\n labels\n } = context.renderConfig();\n const {\n rotation\n } = labels;\n const {\n fixedBaseline,\n axisNamePadding,\n tickValues\n } = config;\n\n const {\n tickDimensions,\n allTickDimensions,\n axisNameDimensions,\n tickSize\n } = context.getAxisDimensions();\n\n const {\n height: tickDimHeight,\n width: tickDimWidth\n } = tickDimensions;\n\n const namePadding = showAxisName ? axisNamePadding : 0;\n const labelConfig = { smartTicks: true, rotation: labels.rotation };\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minDiff = context._minDiff;\n const domain = context.domain();\n const axisNameHeight = axisNameDimensions.height;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = Math.min(minTickSpace.width, tickDimWidth);\n const minTickHeight = Math.min(minTickSpace.height, tickDimHeight);\n\n return {\n [TIME]: {\n x: () => {\n !tickValues && context.applyTickSkipping();\n const noOfTicks = context.getTickValues().length;\n\n // Get the Tick Interval\n tickInterval = ((availWidth - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks);\n\n // Get height for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation;\n // Remove ticks if not enough height\n if (tickInterval < minTickHeight) {\n heightForTicks = availHeight;\n tickInterval = minTickHeight;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n const tickShifter = Math.min(tickInterval, tickDimWidth);\n // set range for axis\n setAxisRange(context, 'y', getAdjustedRange(minDiff, [tickShifter / 2,\n availWidth - left - right - tickShifter / 2], domain, config),\n isOffset ? availHeight : null);\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n\n return labelConfig;\n },\n y: () => {\n let widthForTicks = availWidth;\n const tickShifter = tickDimHeight / 2;\n\n setAxisRange(context, 'x', getAdjustedRange(minDiff,\n [availHeight - top - bottom - tickShifter, tickShifter], domain, config),\n isOffset ? availWidth : null);\n\n if ((availWidth - axisNameHeight - namePadding) <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [BAND]: {\n x: () => {\n setAxisRange(context, 'y', [0, availWidth - left - right], isOffset ? availHeight : null);\n const range = context.range();\n\n // Get Tick Interval\n tickInterval = ((range[1] - range[0]) / (tickValues || domain).length) - minWidthBetweenTicks;\n\n // Get height available for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation === null ? -90 : rotation;\n labelConfig.smartTicks = false;\n\n tickInterval = Math.max(heightForTicks, minTickWidth);\n\n if (heightForTicks < minTickWidth) {\n context.renderConfig({ showAxisName: false });\n }\n } else if (tickValues) {\n const interval = (availWidth / domain.length) - minWidthBetweenTicks;\n if (interval < minTickWidth) {\n context.range([minTickHeight / 2, availWidth - minTickHeight / 2]);\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n return labelConfig;\n },\n y: () => {\n setAxisRange(context, 'x', [availHeight - bottom, top], isOffset ? availWidth : null);\n\n let widthForTicks = availWidth - axisNameHeight - tickSize - namePadding;\n if (widthForTicks <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [LINEAR]: {\n x: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimWidth / 2;\n\n const baseline = fixedBaseline ? 0 : tickShifter;\n\n setAxisRange(context, 'y', [baseline + left, availWidth - right - tickShifter],\n isOffset ? availHeight : null);\n\n const range = context.range();\n\n // Get Tick widths and available space\n const totalTickWidth = allTickDimensions.length * (tickDimWidth + minWidthBetweenTicks);\n const availableWidth = range[1] - range[0];\n\n // Rotate labels if not enough width\n if (availableWidth < totalTickWidth && labels.rotation !== null) {\n if (availHeight - tickDimWidth - namePadding - tickSize > axisNameHeight) {\n labelConfig.rotation = null;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: true\n });\n } else {\n labelConfig.rotation = -90;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: false\n });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n },\n y: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimHeight / 2;\n const baseline = fixedBaseline ? 1 : tickShifter;\n\n setAxisRange(context, 'x', [availHeight - bottom - baseline, tickShifter + top],\n isOffset ? availWidth : null);\n\n // Remove display of ticks if no space is left\n if (availWidth < tickDimWidth + axisNameHeight + namePadding) {\n context.renderConfig({ showInnerTicks: false });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n }\n return labelConfig;\n }\n }\n };\n};\n","import { defaultValue } from 'muze-utils';\nimport { TOP, LEFT, BOTTOM } from '../enums/axis-orientation';\nimport { MIN_NO_OF_TICKS, DEFAULT_NO_OF_TICKS } from '../enums/constants';\nimport { setAxisRange, getAdjustedRange } from './space-setter';\n\nexport const getRotatedSpaces = (rotation = 0, width, height) => {\n let rotatedHeight = height;\n let rotatedWidth = width;\n if (rotation) {\n const angle = ((rotation || 0) * Math.PI) / 180;\n rotatedWidth = Math.abs(height * Math.sin(angle)) + Math.abs(width * Math.cos(angle));\n rotatedHeight = Math.abs(width * Math.sin(angle)) + Math.abs(height * Math.cos(angle));\n }\n return { width: rotatedWidth, height: rotatedHeight };\n};\n\nexport const setOffset = (context) => {\n let x = 0;\n let y = 0;\n const logicalSpace = context.logicalSpace();\n const config = context.config();\n const {\n orientation,\n xOffset,\n yOffset\n } = config;\n if (orientation === LEFT) {\n x = xOffset === undefined ? logicalSpace.width : xOffset;\n }\n if (orientation === TOP) {\n y = yOffset === undefined ? logicalSpace.height : yOffset;\n }\n\n context.renderConfig({ xOffset: x, yOffset: y });\n};\n\nexport const getNumberOfTicks = (availableSpace, labelDim, axis, axisInstance) => {\n let numberOfValues = 0;\n let tickValues = [];\n let { numberOfTicks } = axisInstance.config();\n const ticks = axis.scale().ticks();\n const tickLength = ticks.length;\n const minTickDistance = axisInstance._minTickDistance.width;\n\n numberOfValues = tickLength;\n\n if (tickLength * (labelDim + minTickDistance) > availableSpace) {\n numberOfValues = Math.floor(availableSpace / (labelDim + minTickDistance));\n }\n\n numberOfTicks = numberOfTicks || numberOfValues;\n numberOfValues = Math.min(numberOfTicks, Math.max(MIN_NO_OF_TICKS, numberOfValues));\n\n tickValues = axis.scale().ticks(numberOfValues);\n\n if (tickValues.length > numberOfValues) {\n tickValues = tickValues.filter((e, i) => i % 2 === 0);\n }\n\n if (numberOfValues === MIN_NO_OF_TICKS) {\n tickValues = axis.scale().ticks(DEFAULT_NO_OF_TICKS);\n tickValues = [tickValues[0], tickValues[tickValues.length - 1]];\n }\n return tickValues;\n};\n\nexport const getAxisComponentDimensions = (context) => {\n let largestTick = '';\n let largestTickDimensions = { width: 0, height: 0 };\n let smartTick = {};\n let axisTicks;\n const allTickDimensions = [];\n const scale = context.scale();\n const { tickValues, showAxisName } = context.renderConfig();\n const { name } = context.config();\n const { labelManager } = context.dependencies();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(context._tickLabelStyle);\n\n // get the values along the domain\n axisTicks = tickValues || labelFunc();\n\n // Get the tick labels\n axisTicks = axisTicks.map((originalLabel, i) => {\n const label = context.getFormattedText(originalLabel, i, axisTicks);\n\n // convert to string for quant values\n const tickDimensions = labelManager.getOriSize(label);\n\n // Get spaces for all labels\n allTickDimensions.push(tickDimensions);\n\n // Getting largest label\n if (tickDimensions.width > largestTickDimensions.width) {\n largestTick = label;\n smartTick = context.smartTicks() ? context.smartTicks()[i] : {};\n\n largestTickDimensions = tickDimensions;\n smartTick = smartTick || tickDimensions;\n }\n return label;\n });\n\n labelManager.setStyle(context._axisNameStyle);\n const axisNameDimensions = showAxisName ? labelManager.getOriSize(name) : { width: 0, height: 0 };\n\n return {\n axisNameDimensions,\n largestTick,\n largestTickDimensions,\n allTickDimensions,\n axisTicks,\n smartTick,\n tickSize: context.getTickSize()\n };\n};\n\nexport const computeAxisDimensions = (context) => {\n let tickDimensions = {};\n const { labels } = context.renderConfig();\n const { smartTicks, rotation } = labels;\n\n const {\n largestTickDimensions,\n axisTicks,\n smartTick,\n axisNameDimensions,\n allTickDimensions,\n tickSize\n } = getAxisComponentDimensions(context);\n const { height: labelHeight, width: labelWidth } = largestTickDimensions;\n\n // get the domain of axis\n const domain = context.domain();\n // const angle = ((rotation || 0) * Math.PI) / 180;\n\n if (domain.length === 0) {\n return {\n allTickDimensions,\n tickSize: 0,\n tickDimensions: { height: 0, width: 0 },\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n }\n\n if (smartTicks) {\n tickDimensions = smartTick;\n } else {\n tickDimensions = { width: labelWidth, height: labelHeight };\n }\n tickDimensions = getRotatedSpaces(rotation, tickDimensions.width, tickDimensions.height);\n\n if (tickSize === 0) {\n tickDimensions = { width: 0, height: 0 };\n }\n\n return {\n allTickDimensions,\n tickSize,\n tickDimensions,\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getHorizontalAxisSpace = (context, axisDimensions, range) => {\n let width;\n let height;\n const domain = context.domain();\n const minTickDistance = context._minTickDistance.width;\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n width = range && range.length ? range[1] - range[0] : ((tickDimWidth + minTickDistance) * 3);\n\n height = 0;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n width = ((max - min) / Math.abs(minTickDiff)) * (tickDimWidth + context._minTickDistance.width);\n }\n if (!range || !range.length) {\n height = Math.max(tickDimWidth, tickDimHeight);\n } else {\n height = tickDimHeight;\n }\n\n height += (showAxisName ? axisDimHeight + axisNamePadding : 0) + tickSize;\n\n return {\n width,\n height\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getVerticalAxisSpace = (context, axisDimensions) => {\n let height;\n let width;\n const domain = context.domain();\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n height = 0;\n width = tickDimWidth;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n height = ((max - min) / Math.abs(minTickDiff)) * tickDimHeight;\n }\n width += (showAxisName ? axisDimHeight : 0) + tickSize + (tickValues ? axisNamePadding : 0);\n\n return {\n height,\n width\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateBandSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n\n const { orientation } = context.config();\n const { show } = context.renderConfig();\n const { largestTickDimensions, axisTicks, allTickDimensions } = axisDimensions;\n const { height: largestDimHeight } = largestTickDimensions;\n const minTickWidth = context._minTickDistance.width;\n if (orientation === TOP || orientation === BOTTOM) {\n let {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n\n if (!range || !range.length) {\n width = allTickDimensions.reduce((t, n) =>\n t + Math.min(n.width, n.height) + minTickWidth, 0);\n }\n\n if (show === false) {\n height = 0;\n width = 0;\n }\n return {\n width,\n height\n };\n }\n\n let {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n if (!height || height === 0) {\n height = axisTicks.length * (largestDimHeight + context._minTickDistance.height);\n }\n if (show === false) {\n width = 0;\n }\n return {\n width,\n height\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateContinousSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n const { orientation } = context.config();\n const { show, showAxisName } = context.renderConfig();\n const { axisNameDimensions } = axisDimensions;\n\n if (show === false) {\n return {\n width: 0,\n height: 0\n };\n }\n\n const { width: axisNameWidth } = axisNameDimensions;\n\n if (orientation === TOP || orientation === BOTTOM) {\n const {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n const axisWidth = Math.max(width, axisNameWidth);\n\n return {\n width: axisWidth,\n height\n };\n }\n const {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n const effHeight = Math.max(height, showAxisName ? axisNameWidth : 0);\n\n return {\n width,\n height: effHeight\n };\n};\n\n/**\n * Overwrites domain with user defined domain (if present)\n * @param {Object} context reference to current axes\n * @param {Array} domain default domain\n *\n * @return {Array} domain\n */\nexport const getValidDomain = (context, domain) => {\n const { domain: userDom } = context.config();\n\n if (userDom) {\n domain = userDom;\n }\n\n return defaultValue(domain, []);\n};\n\nexport const setContinousAxisDomain = (context, domain) => {\n const { nice } = context.config();\n const scale = context.scale.bind(context);\n\n scale().domain(domain);\n nice && scale().nice();\n context._domain = scale().domain();\n};\n\n/**\n * Checks if any of the properties have changed between two objects\n * @param {Object} obj first object\n * @param {Object} obj1 second object\n * @param {Array} properties properties to be compared between two objects\n *\n * @return {Boolean} boolean value\n */\nexport const hasAxesConfigChanged = (obj = {}, obj1 = {}, properties) => {\n if (!Object.keys(obj).length || !Object.keys(obj1).length) {\n return false;\n }\n return properties.some(key => obj[key] !== obj1[key]);\n};\n\nexport const resetTickInterval = (context, domain) => {\n const {\n orientation,\n isOffset\n } = context.config();\n\n const minDiff = context._minDiff;\n // Set available space on interaction\n if (context.range().length && (orientation === TOP || orientation === BOTTOM)) {\n context.applyTickSkipping();\n const {\n largestTickDimensions\n } = context.getAxisDimensions();\n\n const noOfTicks = context.getTickValues().length;\n\n const { width, height, padding } = context.availableSpace();\n const {\n left,\n right\n } = padding;\n // Get the Tick Interval\n const tickInterval = Math.min(largestTickDimensions.width,\n ((width - (noOfTicks - 1) * (context._minTickDistance.width)) / noOfTicks));\n\n context.maxTickSpaces({\n width: tickInterval\n });\n\n const adjustedRange = getAdjustedRange(minDiff, [tickInterval / 2,\n width - left - right - tickInterval / 2], domain, context.config());\n\n // set range for axis\n setAxisRange(context, 'y', adjustedRange, isOffset ? height : null);\n\n context.setTickConfig();\n }\n};\n\nexport const getSmartAxisName = (name, width, labelManager) => {\n const oriSize = labelManager.getOriSize(name);\n\n labelManager.useEllipsesOnOverflow(true);\n\n return labelManager.getSmartText(name, width, oriSize.height, true);\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { hasAxesConfigChanged } from './helper';\n\nexport const PROPS = {\n availableSpace: {},\n axisDimensions: {},\n axisComponentDimensions: {},\n config: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._config || {});\n const mockedOldConfig = mergeRecursive({}, oldConfig);\n value = mergeRecursive(mockedOldConfig, value);\n\n value.axisNamePadding = Math.max(value.axisNamePadding, 0);\n const shouldAxesScaleUpdate = hasAxesConfigChanged(\n value, oldConfig, ['interpolator', 'exponent', 'base', 'orientation']\n );\n const tickFormatter = context.sanitizeTickFormatter(value);\n\n if (shouldAxesScaleUpdate) {\n context._scale = context.createScale(value);\n context._axis = context.createAxis(value);\n }\n\n context._tickFormatter = ticks => tickFormatter(ticks);\n\n context.resetRenderConfig(value);\n return value;\n }\n },\n renderConfig: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._renderConfig || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n logicalSpace: {},\n mount: {\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.logicalSpace(null);\n return value;\n }\n },\n\n smartTicks: {},\n tickSize: {},\n maxTickSpaces: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._maxTickSpaces || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n valueParser: {\n defaultValue: val => val\n }\n};\n","import {\n mergeRecursive,\n getSmartComputedStyle,\n selectElement,\n generateGetterSetters,\n getUniqueId\n} from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { axisOrientationMap, BOTTOM, TOP } from '../enums/axis-orientation';\nimport { defaultConfig } from './default-config';\nimport { renderAxis } from '../axis-renderer';\nimport { spaceSetter } from './space-setter';\nimport {\n getAxisComponentDimensions,\n computeAxisDimensions,\n calculateContinousSpace,\n setOffset,\n getValidDomain,\n getSmartAxisName\n} from './helper';\nimport { PROPS } from './props';\n\nexport default class SimpleAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @memberof SimpleAxis\n */\n constructor (config, dependencies) {\n this._id = getUniqueId();\n\n this._dependencies = dependencies;\n this._mount = null;\n this._range = [];\n this._domain = [];\n this._domainLock = false;\n this._axisDimensions = {};\n this._smartTicks = [];\n\n const defCon = mergeRecursive({}, this.constructor.defaultConfig());\n const simpleConfig = mergeRecursive(defCon, config);\n\n const bodyElem = selectElement('body');\n const classPrefix = simpleConfig.classPrefix;\n this._tickLabelStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-ticks`);\n this._axisNameStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-axis-name`);\n\n dependencies.labelManager.setStyle(this._tickLabelStyle);\n const dist = dependencies.labelManager.getOriSize('w');\n\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n this._minTickSpace = dependencies.labelManager.getOriSize('www...');\n\n generateGetterSetters(this, PROPS);\n this.config(simpleConfig);\n\n this._scale = this.createScale(this._config);\n this._axis = this.createAxis(this._config);\n this._animationDonePromises = [];\n }\n\n /**\n * Returns the default configuration of simple axis\n * @return {Object} default configurations\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline () {\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n scale (...params) {\n if (params.length) {\n this._scale = params[0];\n return this;\n }\n return this._scale;\n }\n\n resetDomain () {\n this._domain = [];\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n axis (...params) {\n if (params.length) {\n this._axis = params[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n this.scale().domain(domainValue);\n this._domain = this.scale().domain();\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n setAxisComponentDimensions () {\n this.axisComponentDimensions(getAxisComponentDimensions(this));\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const scale = createScale({\n padding,\n interpolator,\n exponent,\n base,\n range,\n type: this.constructor.type()\n });\n\n return scale;\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat, numberFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(numberFormat(val), val, i, ticks);\n }\n\n return () => val => numberFormat(val);\n }\n\n resetRenderConfig (config) {\n const {\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n } = config;\n this.renderConfig({\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n });\n return this;\n }\n\n resetLogicalSpace () {\n this.logicalSpace(null);\n this.range([]);\n\n this.resetRenderConfig(this.config());\n }\n\n getFormattedText (text, index, axisTicks) {\n const formatter = this._tickFormatter;\n\n return formatter(axisTicks)(text, index);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createAxis (config) {\n const { orientation } = config;\n const axisClass = axisOrientationMap[orientation];\n\n if (axisClass) {\n const axis = axisClass(this.scale());\n return axis;\n }\n return null;\n }\n\n setTickValues (tickValues) {\n const renderConfig = this.renderConfig();\n this.config({ ...renderConfig, tickValues });\n this.tickValues = tickValues;\n this.axis().tickValues(tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (width = 0, height, padding, isOffset) {\n let labelConfig = {};\n const {\n orientation\n } = this.config();\n\n this.availableSpace({ width, height, padding });\n const type = this.constructor.type();\n\n if (orientation === TOP || orientation === BOTTOM) {\n labelConfig = spaceSetter(this, { isOffset })[type].x();\n } else {\n labelConfig = spaceSetter(this, { isOffset })[type].y();\n }\n\n // Set config\n this.renderConfig({\n labels: labelConfig\n });\n this.setTickConfig();\n this.setSmartAxisName();\n return this;\n }\n\n setSmartAxisName () {\n const { orientation, name } = this.config();\n const dimType = (orientation === TOP || orientation === BOTTOM) ? 'width' : 'height';\n const widthDim = this.availableSpace()[dimType];\n const labelManager = this.dependencies().labelManager;\n labelManager.setStyle(this._axisNameStyle);\n this.renderConfig({\n smartAxisName: getSmartAxisName(name, widthDim, labelManager)\n });\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n return this;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this.scale()(domainVal);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n return this.axis().tickSize();\n }\n\n /**\n * Gets the space occupied by the parts of an axis\n *\n * @return {Object} object with details about sizes of the axis.\n * @memberof SimpleAxis\n */\n getAxisDimensions (...params) {\n this.axisDimensions(computeAxisDimensions(this, ...params));\n return this.axisDimensions();\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateContinousSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n * Returns the value from the domain when given a value from the range.\n * @param {number} value Value from the range.\n * @return {number} Value\n */\n invert (value) {\n return this.scale().invert(value);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n *\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n return [v1, v2];\n }\n\n invertExtent (v1, v2) {\n return [this.invert(v1), this.invert(v2)];\n }\n\n getMinTickDifference () {\n return this.domain();\n }\n\n getFormattedTickValues (tickValues) {\n return tickValues;\n }\n\n /**\n * This method returns the width in pixels for one\n * unit along the axis. It is only applicable to band scale\n * and returns undefined for other scale type.\n *\n * @return {number} the width of one band along band scale axis\n * @memberof SimpleAxis\n */\n getUnitWidth () {\n return 0;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof SimpleAxis\n */\n serialize () {\n return {\n name: this.name,\n type: this.type,\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to render the axis inside\n * the supplied svg container.\n *\n * @param {SVGElement} svg the svg element in which to render the path\n * @memberof SimpleAxis\n */\n /* istanbul ignore next */render () {\n if (this.mount()) {\n this.setTickConfig();\n renderAxis(this);\n }\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n remove () {\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n unsubscribe () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n isReverse () {\n const range = this.range();\n return range[0] > range[1];\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getPixelToValueRatio () {\n const scale = this.scale();\n const range = scale.range();\n const domain = scale.domain();\n\n return Math.abs(range[1] - range[0]) / (domain[1] - domain[0]);\n }\n\n /**\n * Notifies when all animations/transitions of the axis are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n _getRawTickValue (data) {\n return data;\n }\n\n getTicksBasedOnData (tickData) {\n const allTicks = selectElement(this.mount()).selectAll('.tick');\n let elementToBeModified = null;\n let elementNotToBeModified = null;\n if (tickData) {\n elementToBeModified = allTicks.filter(tickValue => tickData === this._getRawTickValue(tickValue));\n elementNotToBeModified = allTicks.filter(tickValue => !(tickData === this._getRawTickValue(tickValue)));\n }\n return {\n selectionSet: elementToBeModified,\n rejectionSet: elementNotToBeModified || allTicks\n };\n }\n}\n","import { sanitizeDomainWhenEqual } from 'muze-utils';\nimport { scaleMap } from '../../scale-creator';\n\nexport default class LinearInterpolator {\n\n createScale (config) {\n const {\n range\n } = config;\n const scaleFactory = scaleMap.linear;\n this._scale = scaleFactory().range(range);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain.length) {\n domain = sanitizeDomainWhenEqual(domain);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class LogInterpolator {\n\n createScale (config) {\n const {\n range,\n base\n } = config;\n const scaleFactory = scaleMap.log;\n this._scale = scaleFactory().range(range).base(base);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n const scale = this._scale;\n if (domainVal <= 0) {\n return scale(scale.domain()[0]);\n }\n\n return scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain[0] <= 0) {\n domain[0] = Math.max(1, domain[0]);\n }\n if (domain[1] <= 0) {\n domain[1] = Math.max(1, domain[1]);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class PowInterpolator {\n\n createScale (config) {\n const {\n range,\n exponent\n } = config;\n const scaleFactory = scaleMap.pow;\n this._scale = scaleFactory().range(range).exponent(exponent);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n return domain;\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { LINEAR, LOG, POW } from '../enums/scale-type';\nimport { LogInterpolator, PowInterpolator, LinearInterpolator } from './interpolators';\nimport {\n getNumberOfTicks,\n getValidDomain,\n setContinousAxisDomain\n} from './helper';\n\nexport const interpolatorMap = {\n [LOG]: LogInterpolator,\n [POW]: PowInterpolator,\n [LINEAR]: LinearInterpolator\n};\n\nexport default class ContinousAxis extends SimpleAxis {\n constructor (config, dependencies) {\n config.tickFormat = config.tickFormat || (val => val);\n super(config, dependencies);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const InterpolatorCls = interpolatorMap[interpolator];\n\n this._interpolator = new InterpolatorCls();\n let scale = this._interpolator.createScale({\n padding,\n exponent,\n base,\n range\n });\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ContinousAxis\n */\n static type () {\n return LINEAR;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this._interpolator.getScaleValue(domainVal);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n\n return axis.tickSize();\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainVal = this._interpolator.sanitizeDomain(getValidDomain(this, domain[0]));\n setContinousAxisDomain(this, domainVal);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @param {*} tickValues\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n const {\n tickValues,\n showInnerTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n if (!showInnerTicks) {\n axis.tickValues([]);\n return this;\n }\n\n if (tickValues) {\n tickValues instanceof Array && this.axis().tickValues(tickValues);\n }\n const newTickValues = this.getTickValues();\n\n axis.tickValues(newTickValues);\n const smartLabel = this.dependencies().labelManager;\n smartLabel.setStyle(this._tickLabelStyle);\n const formatter = this._tickFormatter(newTickValues);\n const smartTicks = newTickValues.map((val, i) => {\n const text = formatter(val, i);\n const tickSpace = smartLabel.getOriSize(text);\n\n tickSpace.text = text;\n return tickSpace;\n });\n\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickValues () {\n let labelDim = 0;\n const {\n orientation\n\n } = this.config();\n const {\n tickValues\n } = this.renderConfig();\n const range = this.range();\n const axis = this.axis();\n\n const availableSpace = Math.abs(range[0] - range[1]);\n\n const labelProps = this.axisComponentDimensions().largestTickDimensions;\n\n if (tickValues) {\n return tickValues;\n }\n labelDim = labelProps[orientation === BOTTOM || orientation === TOP ? 'width' : 'height'];\n\n return getNumberOfTicks(availableSpace, labelDim, axis, this);\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.renderConfig().tickValues);\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline (tickText) {\n const {\n orientation\n } = this.config();\n const {\n labels\n } = this.renderConfig();\n\n const {\n rotation\n } = labels;\n const axis = this.axis();\n const ticks = axis.tickValues();\n const smartTicks = this.smartTicks();\n\n if (smartTicks && smartTicks.length) {\n const { width, height } = this.smartTicks()[0];\n\n axis.tickTransform((d) => {\n if (d === ticks[0]) {\n if ((orientation === LEFT || orientation === RIGHT)) {\n return `translate(0, -${(height) / 3}px)`;\n }\n\n if ((orientation === TOP || orientation === BOTTOM) && !rotation) {\n return `translate(${width / 2}px, ${0}px)`;\n }\n } return '';\n });\n }\n return tickText;\n }\n\n}\n","import SimpleAxis from './simple-axis';\nimport { BAND } from '../enums/scale-type';\nimport { calculateBandSpace, setOffset, getRotatedSpaces } from './helper';\n\nexport default class BandAxis extends SimpleAxis {\n /**\n *\n *\n * @static\n *\n * @memberof BandAxis\n */\n static type () {\n return BAND;\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks = '';\n let smartlabel;\n const domain = this.domain();\n const { labelManager } = this._dependencies;\n const { padding } = this.config();\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n tickValues && this.axis().tickValues(tickValues);\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n // Update padding between plots\n if (typeof padding === 'number') {\n const paddingNormalized = Math.min(1, Math.max(0, padding));\n this.scale().padding(paddingNormalized);\n }\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n *\n *\n * @memberof BandAxis\n */\n getTickValues () {\n return this.axis().scale().domain();\n }\n\n formatTickValue (val) {\n return this.valueParser()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(this.formatTickValue(val), val, i, ticks);\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n getUnitWidth () {\n return this.scale().bandwidth();\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n axis.tickSizeInner(showInnerTicks ? 6 : 0);\n axis.tickSizeOuter(showOuterTicks ? 6 : 0);\n return axis.tickSize();\n }\n\n invertExtent (v1, v2) {\n return this.scale().invertExtent(v1, v2);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n const scale = this.scale();\n const range = scale.range();\n const reverse = range[0] > range[1];\n\n const extent = this.invertExtent(v1, v2);\n const p1 = scale(reverse ? extent[extent.length - 1] : extent[0]);\n const p2 = scale(reverse ? extent[0] : extent[extent.length - 1]) + scale.bandwidth();\n return [p1, p2];\n }\n\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { TIME } from '../enums/scale-type';\nimport { calculateBandSpace, getRotatedSpaces, getValidDomain, setContinousAxisDomain, setOffset,\n resetTickInterval } from './helper';\nimport { applyTickSkipping } from './space-setter';\n\n/**\n *\n *\n * @export\n * @class TimeAxis\n * @extends {SimpleAxis}\n */\nexport default class TimeAxis extends SimpleAxis {\n\n constructor (...params) {\n super(...params);\n this._minDiff = Infinity;\n }\n\n /**\n *\n *\n * @param {*} range\n *\n * @memberof TimeAxis\n */\n createScale (range) {\n let scale = super.createScale(range);\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TimeAxis\n */\n static type () {\n return TIME;\n }\n\n formatTickValue (val) {\n return this.scale().tickFormat()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return (ticks) => {\n const rawTicks = ticks.map(t => t.getTime());\n return (val, i) => tickFormat(this.formatTickValue(val), val.getTime(), i, rawTicks);\n };\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n return super.getTickSize();\n }\n\n /**\n *\n *\n *\n * @memberof TimeAxis\n */\n getTickValues () {\n return this.renderConfig().tickValues || this.scale().ticks();\n }\n\n /**\n *\n *\n * @param {*} diff\n *\n * @memberof TimeAxis\n */\n minDiff (diff) {\n this._minDiff = Math.min(this._minDiff, diff);\n return this;\n }\n\n applyTickSkipping () {\n applyTickSkipping(this);\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n setContinousAxisDomain(this, domainValue);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n\n resetTickInterval(this, domainValue);\n return this;\n }\n return this._domain;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.config().tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @returns\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks;\n let smartlabel;\n\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { labelManager } = this._dependencies;\n const domain = this.getTickValues();\n\n tickValues && this.axis().tickValues(tickValues);\n\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n\n this.smartTicks(smartTicks);\n return this;\n }\n _getRawTickValue (data) {\n return (new Date(data)).getTime();\n }\n}\n","export const x11Colors = {\n Pink: { hex: 'ffc0cb', rgb: '255,192,203' },\n LightPink: { hex: 'ffb6c1', rgb: '255,182,193' },\n HotPink: { hex: 'ff69b4', rgb: '255,105,180' },\n DeepPink: { hex: 'ff1493', rgb: '255,20,147' },\n PaleVioletRed: { hex: 'db7093', rgb: '219,112,147' },\n MediumVioletRed: { hex: 'c71585', rgb: '199,21,133' },\n LightSalmon: { hex: 'ffa07a', rgb: '255,160,122' },\n Salmon: { hex: 'fa8072', rgb: '250,128,114' },\n DarkSalmon: { hex: 'e9967a', rgb: '233,150,122' },\n LightCoral: { hex: 'f08080', rgb: '240,128,128' },\n IndianRed: { hex: 'cd5c5c', rgb: '205,92,92' },\n Crimson: { hex: 'dc143c', rgb: '220,20,60' },\n FireBrick: { hex: 'b22222', rgb: '178,34,34' },\n DarkRed: { hex: '8b0000', rgb: '139,0,0' },\n Red: { hex: 'ff0000', rgb: '255,0,0' },\n OrangeRed: { hex: 'ff4500', rgb: '255,69,0' },\n Tomato: { hex: 'ff6347', rgb: '255,99,71' },\n Coral: { hex: 'ff7f50', rgb: '255,127,80' },\n DarkOrange: { hex: 'ff8c00', rgb: '255,140,0' },\n Orange: { hex: 'ffa500', rgb: '255,165,0' },\n Gold: { hex: 'ffd700', rgb: '255,215,0' },\n Yellow: { hex: 'ffff00', rgb: '255,255,0' },\n LightYellow: { hex: 'ffffe0', rgb: '255,255,224' },\n LemonChiffon: { hex: 'fffacd', rgb: '255,250,205' },\n LightGoldenrodYellow: { hex: 'fafad2', rgb: '250,250,210' },\n PapayaWhip: { hex: 'ffefd5', rgb: '255,239,213' },\n Moccasin: { hex: 'ffe4b5', rgb: '255,228,181' },\n PeachPuff: { hex: 'ffdab9', rgb: '255,218,185' },\n PaleGoldenrod: { hex: 'eee8aa', rgb: '238,232,170' },\n Khaki: { hex: 'f0e68c', rgb: '240,230,140' },\n DarkKhaki: { hex: 'bdb76b', rgb: '189,183,107' },\n Cornsilk: { hex: 'fff8dc', rgb: '255,248,220' },\n BlanchedAlmond: { hex: 'ffebcd', rgb: '255,235,205' },\n Bisque: { hex: 'ffe4c4', rgb: '255,228,196' },\n NavajoWhite: { hex: 'ffdead', rgb: '255,222,173' },\n Wheat: { hex: 'f5deb3', rgb: '245,222,179' },\n BurlyWood: { hex: 'deb887', rgb: '222,184,135' },\n Tan: { hex: 'd2b48c', rgb: '210,180,140' },\n RosyBrown: { hex: 'bc8f8f', rgb: '188,143,143' },\n SandyBrown: { hex: 'f4a460', rgb: '244,164,96' },\n Goldenrod: { hex: 'daa520', rgb: '218,165,32' },\n DarkGoldenrod: { hex: 'b8860b', rgb: '184,134,11' },\n Peru: { hex: 'cd853f', rgb: '205,133,63' },\n Chocolate: { hex: 'd2691e', rgb: '210,105,30' },\n SaddleBrown: { hex: '8b4513', rgb: '139,69,19' },\n Sienna: { hex: 'a0522d', rgb: '160,82,45' },\n Brown: { hex: 'a52a2a', rgb: '165,42,42' },\n Maroon: { hex: '800000', rgb: '128,0,0' },\n DarkOliveGreen: { hex: '556b2f', rgb: '85,107,47' },\n Olive: { hex: '808000', rgb: '128,128,0' },\n OliveDrab: { hex: '6b8e23', rgb: '107,142,35' },\n YellowGreen: { hex: '9acd32', rgb: '154,205,50' },\n LimeGreen: { hex: '32cd32', rgb: '50,205,50' },\n Lime: { hex: '00ff00', rgb: '0,255,0' },\n LawnGreen: { hex: '7cfc00', rgb: '124,252,0' },\n Chartreuse: { hex: '7fff00', rgb: '127,255,0' },\n GreenYellow: { hex: 'adff2f', rgb: '173,255,47' },\n SpringGreen: { hex: '00ff7f', rgb: '0,255,127' },\n MediumSpringGreen: { hex: '00fa9a', rgb: '0,250,154' },\n LightGreen: { hex: '90ee90', rgb: '144,238,144' },\n PaleGreen: { hex: '98fb98', rgb: '152,251,152' },\n DarkSeaGreen: { hex: '8fbc8f', rgb: '143,188,143' },\n MediumSeaGreen: { hex: '3cb371', rgb: '60,179,113' },\n SeaGreen: { hex: '2e8b57', rgb: '46,139,87' },\n ForestGreen: { hex: '228b22', rgb: '34,139,34' },\n Green: { hex: '008000', rgb: '0,128,0' },\n DarkGreen: { hex: '006400', rgb: '0,100,0' },\n MediumAquamarine: { hex: '66cdaa', rgb: '102,205,170' },\n Aqua: { hex: '00ffff', rgb: '0,255,255' },\n Cyan: { hex: '00ffff', rgb: '0,255,255' },\n LightCyan: { hex: 'e0ffff', rgb: '224,255,255' },\n PaleTurquoise: { hex: 'afeeee', rgb: '175,238,238' },\n Aquamarine: { hex: '7fffd4', rgb: '127,255,212' },\n Turquoise: { hex: '40e0d0', rgb: '64,224,208' },\n MediumTurquoise: { hex: '48d1cc', rgb: '72,209,204' },\n DarkTurquoise: { hex: '00ced1', rgb: '0,206,209' },\n LightSeaGreen: { hex: '20b2aa', rgb: '32,178,170' },\n CadetBlue: { hex: '5f9ea0', rgb: '95,158,160' },\n DarkCyan: { hex: '008b8b', rgb: '0,139,139' },\n Teal: { hex: '008080', rgb: '0,128,128' },\n LightSteelBlue: { hex: 'b0c4de', rgb: '176,196,222' },\n PowderBlue: { hex: 'b0e0e6', rgb: '176,224,230' },\n LightBlue: { hex: 'add8e6', rgb: '173,216,230' },\n SkyBlue: { hex: '87ceeb', rgb: '135,206,235' },\n LightSkyBlue: { hex: '87cefa', rgb: '135,206,250' },\n DeepSkyBlue: { hex: '00bfff', rgb: '0,191,255' },\n DodgerBlue: { hex: '1e90ff', rgb: '30,144,255' },\n CornflowerBlue: { hex: '6495ed', rgb: '100,149,237' },\n SteelBlue: { hex: '4682b4', rgb: '70,130,180' },\n RoyalBlue: { hex: '4169e1', rgb: '65,105,225' },\n Blue: { hex: '0000ff', rgb: '0,0,255' },\n MediumBlue: { hex: '0000cd', rgb: '0,0,205' },\n DarkBlue: { hex: '00008b', rgb: '0,0,139' },\n Navy: { hex: '000080', rgb: '0,0,128' },\n MidnightBlue: { hex: '191970', rgb: '25,25,112' },\n Lavender: { hex: 'e6e6fa', rgb: '230,230,250' },\n Thistle: { hex: 'd8bfd8', rgb: '216,191,216' },\n Plum: { hex: 'dda0dd', rgb: '221,160,221' },\n Violet: { hex: 'ee82ee', rgb: '238,130,238' },\n Orchid: { hex: 'da70d6', rgb: '218,112,214' },\n Fuchsia: { hex: 'ff00ff', rgb: '255,0,255' },\n Magenta: { hex: 'ff00ff', rgb: '255,0,255' },\n MediumOrchid: { hex: 'ba55d3', rgb: '186,85,211' },\n MediumPurple: { hex: '9370db', rgb: '147,112,219' },\n BlueViolet: { hex: '8a2be2', rgb: '138,43,226' },\n DarkViolet: { hex: '9400d3', rgb: '148,0,211' },\n DarkOrchid: { hex: '9932cc', rgb: '153,50,204' },\n DarkMagenta: { hex: '8b008b', rgb: '139,0,139' },\n Purple: { hex: '800080', rgb: '128,0,128' },\n Indigo: { hex: '4b0082', rgb: '75,0,130' },\n DarkSlateBlue: { hex: '483d8b', rgb: '72,61,139' },\n SlateBlue: { hex: '6a5acd', rgb: '106,90,205' },\n MediumSlateBlue: { hex: '7b68ee', rgb: '123,104,238' },\n White: { hex: 'ffffff', rgb: '255,255,255' },\n Snow: { hex: 'fffafa', rgb: '255,250,250' },\n Honeydew: { hex: 'f0fff0', rgb: '240,255,240' },\n MintCream: { hex: 'f5fffa', rgb: '245,255,250' },\n Azure: { hex: 'f0ffff', rgb: '240,255,255' },\n AliceBlue: { hex: 'f0f8ff', rgb: '240,248,255' },\n GhostWhite: { hex: 'f8f8ff', rgb: '248,248,255' },\n WhiteSmoke: { hex: 'f5f5f5', rgb: '245,245,245' },\n Seashell: { hex: 'fff5ee', rgb: '255,245,238' },\n Beige: { hex: 'f5f5dc', rgb: '245,245,220' },\n OldLace: { hex: 'fdf5e6', rgb: '253,245,230' },\n FloralWhite: { hex: 'fffaf0', rgb: '255,250,240' },\n Ivory: { hex: 'fffff0', rgb: '255,255,240' },\n AntiqueWhite: { hex: 'faebd7', rgb: '250,235,215' },\n Linen: { hex: 'faf0e6', rgb: '250,240,230' },\n LavenderBlush: { hex: 'fff0f5', rgb: '255,240,245' },\n MistyRose: { hex: 'ffe4e1', rgb: '255,228,225' },\n Gainsboro: { hex: 'dcdcdc', rgb: '220,220,220' },\n LightGray: { hex: 'd3d3d3', rgb: '211,211,211' },\n Silver: { hex: 'c0c0c0', rgb: '192,192,192' },\n DarkGrey: { hex: 'a9a9a9', rgb: '169,169,169' },\n Grey: { hex: '808080', rgb: '128,128,128' },\n DimGrey: { hex: '696969', rgb: '105,105,105' },\n LightSlateGrey: { hex: '778899', rgb: '119,136,153' },\n SlateGrey: { hex: '708090', rgb: '112,128,144' },\n DarkSlateGrey: { hex: '2f4f4f', rgb: '47,79,79' },\n Black: { hex: '000000', rgb: '0,0,0' }\n};\n","import {\n LINEAR\n} from '../enums/constants';\n/**\n * Set of default colors\n */\nexport const palette = [\n '#1f77b4',\n '#ff7f0e',\n '#2ca02c',\n '#d62728',\n '#9467bd',\n '#8c564b',\n '#e377c2',\n '#7f7f7f',\n '#bcbd22',\n '#17becf'\n];\n\nexport const DEFAULT_GRADIENT_COLOR = '#eaeaea';\n\nexport const DEFAULT_CONFIG = {\n range: palette,\n value: palette[0],\n step: false,\n stops: 5,\n type: LINEAR\n};\n","import { mergeRecursive, detectColor, hexToHsv, rgbToHsv, defaultValue } from 'muze-utils';\nimport { x11Colors } from './color-maps';\nimport { palette, DEFAULT_GRADIENT_COLOR, DEFAULT_CONFIG } from './defaults';\nimport { LINEAR, RGB, HEX, HSL, HSLA } from '../enums/constants';\n\nexport const getHslString = hslArr => `hsla(${hslArr[0] * 360},${hslArr[1] * 100}%,${hslArr[2] * 100}%,\\\n${hslArr[3] || 1})`;\n\nexport const convertToXllString = baseString => (baseString.split(' ') || [])\n .reduce((x, e) => `${x}${e.charAt(0).toUpperCase()}${e.slice(1)}`, '');\n\nexport const getActualHslColor = (e, paletteColor) => {\n let color = '';\n if (typeof e === 'string') {\n e = e.replace(/ /g, '');\n e = e.toLowerCase();\n if (detectColor(e) === HSL || detectColor(e) === HSLA) {\n color = e.match(/(\\d+(\\.\\d+)?)/g);\n color = [color[0] / 360, color[1] / 100, color[2] / 100, defaultValue(Number(color[3]), 1)];\n } else if (detectColor(e) === HEX) {\n color = hexToHsv(e);\n } else if (detectColor(e) === RGB) {\n const col = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')')).split(/,\\s*/);\n color = rgbToHsv(...col);\n } else if (x11Colors[convertToXllString(e)]) {\n color = rgbToHsv(...x11Colors[convertToXllString(e)].rgb.split(','));\n }\n } else if (!(e instanceof Array)) {\n color = rgbToHsv(paletteColor);\n } else {\n color = e;\n }\n return color;\n};\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => {\n const defCon = mergeRecursive({}, context.constructor.defaultConfig());\n if (config.type === LINEAR) {\n config.range = config.range || [defCon.range[0]];\n config.range = config.range.length > 1 ? config.range : [DEFAULT_GRADIENT_COLOR, ...config.range];\n }\n const oldConfig = mergeRecursive(defCon, context.config());\n const newConfig = mergeRecursive(oldConfig, config);\n\n if (newConfig.range instanceof Array) {\n newConfig.range = newConfig.range.map((e, i) => getActualHslColor(e, palette[i]));\n newConfig.stops = config.stops ?\n config.stops :\n config.range && config.range.length > 2 ?\n config.range.length :\n DEFAULT_CONFIG.stops;\n }\n newConfig.value = getActualHslColor(newConfig.value, newConfig.value);\n return newConfig;\n }\n },\n domain: {},\n scale: {},\n uniqueValues: {}\n};\n","import { InvalidAwareTypes, getObjProp } from 'muze-utils';\n\nexport const treatNullMeasures = (domainVal, scaledVal, minDomainScaledVal) => {\n if (domainVal instanceof InvalidAwareTypes) {\n return minDomainScaledVal;\n }\n return scaledVal;\n};\n\nexport const resolveAxisConfig = (propVal, defaultVal, context) => {\n const constructor = getObjProp(propVal, 'constructor');\n switch (constructor) {\n case Function:\n return propVal(defaultVal, context);\n case Array:\n return propVal;\n default:\n return defaultVal;\n }\n};\n\nexport const sanitiseConfigIntervals = (intervals) => {\n if (intervals) {\n return intervals;\n }\n return 5;\n};\n","import { piecewiseInterpolator,\n hslInterpolator,\n sanitizeDomainWhenEqual, getReadableTicks } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, SEQUENTIAL, ORDINAL, QUANTILE } from '../enums/scale-type';\nimport { getHslString } from './props';\nimport { treatNullMeasures } from '../helper';\n\nconst getStops = (domain, stops) => {\n let newStops = [];\n\n if (stops instanceof Array) {\n newStops = stops.slice().sort();\n newStops = [...new Set([domain[0], ...stops, domain[1]])].sort();\n } else {\n newStops = getReadableTicks(domain, stops);\n }\n return { domain, newStops };\n};\n\nconst rangeStops = (newStopsLength, range) => {\n let newRange = [];\n const maxRangeLength = Math.min(range.length, 18);\n\n if (newStopsLength > maxRangeLength) {\n const interpolator = piecewiseInterpolator()(hslInterpolator(), range.map(e => getHslString(e)));\n for (let i = 0; i < newStopsLength; i++) {\n newRange[i] = interpolator(i / (newStopsLength - 1));\n }\n } else {\n newRange = range.slice(0, newStopsLength);\n }\n return { newRange };\n};\n\n/**\n*\n*\n* @param {*} domain\n*\n*/\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomainMeasure = (domain, stops, range) => {\n const uniqueVals = domain;\n return { domain, uniqueVals, scaleDomain: [0, 1], range };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain, stops, range) => {\n const uniqueVals = domain;\n return { uniqueVals, domain, nice: true, range };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} stops\n *\n */\nconst steppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(domain, stops);\n const { newRange } = rangeStops(newStops.length - 1, range);\n\n return { uniqueVals, domain: newStops, nice: true, range: newRange };\n};\n\nconst continousSteppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(sanitizeDomainWhenEqual(domain), range.length - 1);\n const hslRange = range.map(e => getHslString(e));\n return { uniqueVals, domain: newStops, nice: true, range: hslRange };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst uniqueRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n return scale(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst indexedRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n\n return treatNullMeasures(domainValue, scale(numVal), scale(0));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) => treatNullMeasures(domainValue, scale(domainValue),\n scale(domain[0]));\n\n/**\n *\n *\n * @param {*} stops\n */\nconst strategies = () => ({\n [`${CONTINOUS}-${CONTINOUS}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${CONTINOUS}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${DISCRETE}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomain,\n value: () => uniqueRange\n },\n [`${DISCRETE}-${DISCRETE}-${ORDINAL}`]: {\n scale: ORDINAL,\n domainRange: () => normalDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${CONTINOUS}-${ORDINAL}`]: {\n scale: LINEAR,\n domainRange: () => continousSteppedDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${DISCRETE}-${ORDINAL}`]: {\n scale: QUANTILE,\n domainRange: () => steppedDomain,\n value: () => normalRange\n\n }\n});\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} stops\n */\nexport const strategyGetter = (domainType, rangeType, schemeType) =>\n strategies()[`${domainType}-${rangeType}-${schemeType || ''}`];\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters, rgbToHsv, defaultValue } from 'muze-utils';\nimport { createScale, getScheme, getSchemeType } from '../scale-creator';\nimport { CONTINOUS, DISCRETE, COLOR } from '../enums/constants';\nimport { strategyGetter } from './color-strategy';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { PROPS, getHslString, getActualHslColor } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ColorAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @param {Object | undefined} params.range Type of color range.\n * @param {string} params.name the label to show on axis.\n * @param {string} params.type The type of scale to handle.\n * @memberof ColorAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n this.config(config);\n\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = (this._config.type === 'linear' && !this._config.step) ? CONTINOUS : DISCRETE;\n\n this._schemeType = getSchemeType(this._config.range);\n\n this._colorStrategy = this.setColorStrategy(this._domainType, this._rangeType, this._schemeType);\n this._scale = this.createScale(this._colorStrategy);\n\n this._id = getUniqueId();\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return COLOR;\n }\n\n /**\n *\n *\n * @param {*} colorStrategy\n *\n * @memberof ColorAxis\n */\n createScale (colorStrategy) {\n const { range } = this.config();\n if (range && typeof (range) === 'string') {\n return getScheme(range);\n }\n return createScale({\n type: colorStrategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setColorStrategy (domainType, rangeType, schemeType) {\n return strategyGetter(domainType, rangeType, schemeType);\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getHslString (hslColorArray) {\n return getHslString(hslColorArray);\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getColor (domainVal) {\n return this.getHslString(this.getRawColor(domainVal));\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getRawColor (domainVal) {\n if (this.domain() && domainVal !== undefined) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const color = this._colorStrategy.value(range)(domainVal, scale, this.domain(), this.uniqueValues());\n if (color) {\n if (typeof color === 'string') {\n const col = color.substring(color.indexOf('(') + 1, color.lastIndexOf(')')).split(/,\\s*/);\n return rgbToHsv(...col);\n }\n return [...color];\n }\n }\n return [...this.config().value];\n }\n\n /**\n *\n *\n * @param {*} [domain=[]]\n *\n * @memberof ColorAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const domainRangeFn = this._colorStrategy.domainRange();\n const scaleInfo = domainRangeFn(domain, this.config().stops, range);\n\n this.domain(scaleInfo.domain);\n scaleInfo.range && this.scale().range(scaleInfo.range);\n this.uniqueValues(scaleInfo.uniqueVals);\n this.scale().domain(scaleInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n config: this.config()\n };\n }\n\n transformColor (color, transformationArr) {\n const h = color[0] * 360;\n const s = color[1] * 100;\n const l = color[2] * 100;\n const a = Math.min(defaultValue(color[3], 0), 1);\n const newH = h + transformationArr[0];\n const newS = s + transformationArr[1];\n const newL = l + transformationArr[2];\n const newA = Math.min(a + transformationArr[3] || 0, 1);\n\n return { color: `hsla(${newH},${newS}%,${newL}%,${newA})`, hsla: [newH / 360, newS / 100, newL / 100, newA] };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n\n getHslArray (color) {\n return getActualHslColor(color);\n }\n\n}\n","export const DEFAULT_CONFIG = {\n value: 51,\n range: [51, 1000]\n};\n","import { numberInterpolator, piecewiseInterpolator, getReadableTicks } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, THRESHOLD } from '../enums/scale-type';\nimport { treatNullMeasures } from '../helper';\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain) => {\n const uniqueVals = domain;\n return { uniqueVals, domain };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} intervals\n *\n */\nconst steppedDomain = (domain, intervals) => {\n let newIntervals = [];\n if (intervals instanceof Array) {\n newIntervals = intervals.slice().sort();\n } else {\n // const interpolator = numberInterpolator()(...domain);\n // for (let i = 0; i < intervals; i++) {\n // newIntervals[i] = interpolator(i / (intervals - 1));\n // }\n newIntervals = getReadableTicks(domain, intervals);\n }\n // if (newIntervals[0] < domain[0]) {\n // newIntervals.shift();\n // }\n const retDomain = newIntervals;\n return { uniqueVals: newIntervals, domain: retDomain, nice: true };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst discreteRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n const interpolator = numberInterpolator()(...scale.range());\n return treatNullMeasures(domainValue, interpolator(numVal), interpolator(domain[0]));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst pieceWiseRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n const fn = piecewiseInterpolator()(numberInterpolator(), [...scale.range()]);\n return fn(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) =>\n treatNullMeasures(domainValue, scale(domainValue), scale(domain[0]));\n\n/**\n *\n *\n * @param {*} intervals\n */\nconst strategies = {\n [`${DISCRETE}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: indexedDomain,\n range: pieceWiseRange\n },\n [`${CONTINOUS}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: normalDomain,\n range: normalRange\n },\n [`${CONTINOUS}-${DISCRETE}`]: {\n scale: THRESHOLD,\n domain: steppedDomain,\n range: discreteRange\n }\n};\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} intervals\n */\nexport const strategyGetter = (domainType, rangeType) =>\n strategies[`${domainType}-${rangeType}`];\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => {\n context._userRange = value.range;\n return mergeRecursive(context._config || {}, value);\n }\n },\n domain: {\n sanitization: (context, value) => {\n context.scale().domain(value);\n return value;\n }\n },\n range: {},\n scale: {},\n uniqueValues: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SIZE, CONTINOUS, DISCRETE } from '../enums/constants';\nimport { strategyGetter } from './size-strategy';\nimport { PROPS } from './props';\nimport { sanitiseConfigIntervals } from '../helper';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class SizeAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @memberof SizeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this.config(this.constructor.defaultConfig());\n this.config(config);\n // @todo: Will use configuration override using scale decorator\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n\n this._config.range = this._userRange ? this._userRange : this._config.range;\n\n this._config.stops = sanitiseConfigIntervals(this._config.stops);\n this._rangeType = this._config.type === 'linear' && !!this._config.stops ? DISCRETE : CONTINOUS;\n\n this._sizeStrategy = this.setStrategy(this._domainType, this._rangeType);\n this._scale = this.createScale(this._sizeStrategy);\n this._range = this._config.range;\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setStrategy (domainType, rangeType) {\n return strategyGetter(domainType, rangeType);\n }\n\n /**\n *\n *\n *\n * @memberof SizeAxis\n */\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SIZE;\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof SizeAxis\n */\n getSize (domainVal = 0) {\n let sizeVal = 1;\n const {\n value\n } = this.config();\n const scale = this.scale();\n const domain = this.domain() || [1, 1];\n\n if (!scale || domain[0] === domain[1]) {\n sizeVal = value;\n } else {\n return this._sizeStrategy.range(domainVal, scale, this.domain(), this.uniqueValues());\n }\n return sizeVal;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof SizeAxis\n */\n updateDomain (domain) {\n if (domain) {\n const domainFn = this._sizeStrategy.domain;\n\n const domainInfo = domainFn(domain, this.config().stops);\n\n this.domain(domainInfo.domain);\n this.uniqueValues(domainInfo.uniqueVals);\n\n this.scale().domain(domainInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","export const DEFAULT_CONFIG = {\n generator: null,\n value: 'circle',\n range: ['circle', 'diamond', 'star', 'cross', 'square', 'wye', 'triangle']\n};\n","export const PROPS = {\n config: {},\n domain: {},\n scale: {},\n uniqueValues: {},\n generator: {}\n};\n\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, getSymbol, generateGetterSetters, mergeRecursive, InvalidAwareTypes } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SHAPE } from '../enums/constants';\nimport { shapeGenerator } from './helper';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ShapeAxis {\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} params input parameters.\n * @param {Object | undefined} params.range Type of color scheme.\n * @memberof ShapeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(this._config, config);\n\n this._scale = createScale({\n type: 'ordinal',\n range: this._config.range\n });\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SHAPE;\n }\n\n /**\n *\n *\n * @param {*} value\n *\n * @memberof ShapeAxis\n */\n getShape (value) {\n if (!this.scale() || !this.domain() || !value || value instanceof InvalidAwareTypes) {\n return this.config().value;\n }\n\n if (this._generatedShapes) {\n return this._generatedShapes[value];\n }\n\n const shapeType = this.scale()(value);\n if (shapeType === 'string') {\n return getSymbol(shapeType);\n }\n\n return shapeType;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof ShapeAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n this.uniqueValues(domain);\n this.domain(domain);\n this.scale().domain(domain);\n\n if (this.config().generator) {\n this._generatedShapes = shapeGenerator(domain, this.config().generator);\n }\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.config().range,\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","/**\n *\n *\n * @param {*} domain\n * @param {*} generatorFn\n *\n */\nexport const shapeGenerator = (domain, generatorFn) => {\n const generatedShapes = {};\n domain.forEach((value) => {\n generatedShapes[value] = generatorFn(value);\n });\n return generatedShapes;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => mergeRecursive(context.config(), config),\n preset: (context, config) => {\n const { range, domain } = config;\n range && context.range(range);\n domain && context.domain(domain);\n }\n },\n domain: {},\n range: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, Symbols, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_ANGLE_DOMAIN } from '../enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst { pie } = Symbols;\n\nconst createAngleValues = (context) => {\n const angleData = context._angleFn(context._domain);\n angleData.forEach((v) => {\n v.startAngle -= Math.PI / 2;\n v.endAngle -= Math.PI / 2;\n });\n context._angleValues = angleData.reduce((values, d) => {\n const key = d.data;\n !values[key] && (values[key] = []);\n values[key].push(d);\n return values;\n }, {});\n};\n\n/**\n* This class is used to instantiate a AngleAxis.\n* @class AngleAxis\n*/\nexport default class AngleAxis {\n\n /**\n * Creates an instance of AngleAxis.\n * @param {Object} config input parameters.\n * @memberof AngleAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._range = [0, 360];\n this._angleFn = pie()\n .value(d => (typeof d === 'string' ? 1 : d))\n .sortValues(null);\n this._angleValues = {};\n }\n\n static defaultConfig () {\n return {};\n }\n\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n getScaleValue (domainVal) {\n return this._angleValues[domainVal];\n }\n\n padAngle (angle) {\n this._angleFn = this._angleFn.padAngle(angle);\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n const domain = domainVal[0].length ? domainVal[0] : DEFAULT_ANGLE_DOMAIN;\n this._domain = resolveAxisConfig(customDomain, domain, this);\n createAngleValues(this);\n return this;\n }\n return this._domain;\n }\n\n range (...range) {\n if (range.length) {\n const { range: customRange } = this.config();\n this._range = resolveAxisConfig(customRange, range[0], this);\n const domain = this.domain();\n const [startAngle, endAngle] = this._range;\n this._angleFn\n .startAngle((startAngle / 180) * Math.PI)\n .endAngle(Math.PI * endAngle / 180);\n if (domain && domain.length) {\n createAngleValues(this);\n }\n return this;\n }\n return this._range;\n }\n}\n","/**\n * This file exports constants that are used as enums in the\n * crosstab group implementation.\n */\n/**\n * Width of the crosstab.\n */\nexport const X = 'x';\n/**\n * Width of the crosstab.\n */\nexport const Y = 'y';\n/**\n * Width of the crosstab.\n */\nexport const WIDTH = 'width';\n\n/**\n * Height of the crosstab.\n */\nexport const HEIGHT = 'height';\n\n/**\n * Field referring to object storing measurement configuration.\n */\nexport const MEASUREMENT = 'measurement';\n\n/**\n * Field referring to object storing configuration properties.\n */\nexport const CONFIG = 'config';\n\n/**\n * Width of visual unit in crosstab.\n */\nexport const MIN_UNIT_WIDTH = 'minUnitWidth';\n\n/**\n * Height of visual unit.\n */\nexport const MIN_UNIT_HEIGHT = 'minUnitHeight';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSIONS = 'dimensions';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURES = 'measures';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSION = 'dimension';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURE = 'measure';\n\n/**\n * Flag to specify if model should be pivoted.\n */\nexport const PIVOT = 'pivot';\n\n/**\n * Flag to specify format\n */\nexport const FORMAT = 'format';\n\n/**\n * Mount point where the variable will be hosted\n */\nexport const MOUNT = 'mount';\n\n/**\n * Data update flag\n */\nexport const HAS_DATA_UPDATED = 'hasDataUpdated';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROWS = 'rows';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMNS = 'columns';\n\n/**\n * Field referring to object storing data\n */\nexport const DATA = 'data';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COL = 'col';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROW = 'row';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMN = 'column';\n\n/**\n * Field referring to object storing color field\n */\nexport const COLOR = 'color';\n\n/**\n * Field referring to object storing shape field\n */\nexport const SHAPE = 'shape';\n\n/**\n * Field referring to object storing size field\n */\nexport const SIZE = 'size';\n\n/**\n * Field referring to object storing detail field\n */\nexport const DETAIL = 'detail';\n\n/**\n * Field referring to object storing set of layers\n */\nexport const LAYERS = 'layers';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const TRANSFORM = 'transform';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const ORDINAL = 'ordinal';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const LINEAR = 'linear';\n/**\n * Field referring to object storing the transforms\n */\nexport const LEFT = 'left';\n/**\n * Field referring to object storing the transforms\n */\nexport const RIGHT = 'right';\n/**\n * Field referring to object storing the transforms\n */\nexport const TOP = 'top';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTTOM = 'bottom';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const RETINAL = 'retinal';\n/**\n * Field referring to object storing the transforms\n */\nexport const CELL = 'cell';\n/**\n * Field referring to object storing the transforms\n */\nexport const X_AXES = 'xAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const Y_AXES = 'yAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const ENTRY_CELLS = 'entryCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const INITIALIZED = 'initialized';\n/**\n * Field referring to object storing the transforms\n */\nexport const EXIT_CELLS = 'exitCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const AXIS = 'axis';\n/**\n * Field referring to object storing the transforms\n */\nexport const UNIT = 'unit';\n/**\n * Field referring to object storing the transforms\n */\nexport const UPDATED = 'updated';\n/**\n * Field referring to object storing the transforms\n */\nexport const BEFORE_UPDATE = 'beforeupdate';\n/**\n * Field referring to object storing the transforms\n */\nexport const VALUE_MATRIX = 'valueMatrix';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET_HEADERS = 'facet-headers';\n/**\n * Field referring to object storing the transforms\n */\nexport const RADIUS = 'radius';\n/**\n * Field referring to object storing the transforms\n */\nexport const ANGLE = 'angle';\n\nexport const ANGLE0 = 'angle0';\n/**\n * Field referring to object storing the transforms\n */\nexport const ARC = 'arc';\n/**\n * Field referring to object storing the transforms\n */\nexport const CATEGORICAL = 'categorical';\n/**\n * Field referring to object storing the transforms\n */\nexport const TEMPORAL = 'temporal';\n/**\n * Field referring to object storing the transforms\n */\nexport const BAR = 'bar';\n/**\n * Field referring to object storing the transforms\n */\nexport const LINE = 'line';\n/**\n * Field referring to object storing the transforms\n */\nexport const POINT = 'point';\n/**\n * Field referring to object storing the transforms\n */\nexport const PRIMARY = 'Primary';\n/**\n * Field referring to object storing the transforms\n */\nexport const SECONDARY = 'Secondary';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTH = 'both';\n/**\n * Field referring to object storing the transforms\n */\nexport const INTERACTION = 'interaction';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_LINES = 'gridLines';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_BANDS = 'gridBands';\n/**\n * Field referring to object storing the transforms\n */\nexport const HEADER = 'header';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET = 'facet';\nexport const DEFAULT = 'default';\n/**\n * Ordering type\n */\nexport const ASCENDING = 'asc';\n/**\n * Ordering type\n */\nexport const DESCENDING = 'desc';\n\nexport const DARK = 'dark';\nexport const NONE = 'none';\nexport const NORMAL = 'normal';\nexport const DARKER = 'darker';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, mergeRecursive, generateGetterSetters, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { LINEAR } from '../../../visual-group/src/enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst adjustDomain = (context) => {\n const minOuterRadius = context.config().minOuterRadius;\n const domain = context._domain;\n if (context._range.length) {\n const scale = context._scale;\n const value = scale.invert(minOuterRadius) - scale.invert(0);\n context._domain = [domain[0] - value, domain[1]];\n scale.domain(context._domain);\n }\n};\n\n/**\n* This class is used to instantiate a RadiusAxis.\n* @class RadiusAxis\n*/\nexport default class RadiusAxis {\n\n /**\n * Creates an instance of RadiusAxis.\n * @param {Object} config input parameters.\n * @memberof RadiusAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._range = [];\n this._radiusFactor = 1;\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._scale = this.createScale({\n scale: LINEAR\n });\n }\n\n static defaultConfig () {\n return {\n padding: [0, 1],\n minOuterRadius: 10\n };\n }\n\n config (...params) {\n if (params.length) {\n const config = mergeRecursive(this.config(), params[0]);\n this._config = config;\n return this;\n }\n return this._config;\n }\n\n createScale (strategy) {\n return createScale({\n type: strategy.scale,\n range: this.range()\n });\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n let domain = resolveAxisConfig(customDomain, domainVal[0], this);\n domain = sanitizeDomainWhenEqual(domain);\n this._scale.domain(domain);\n this._domain = domain;\n adjustDomain(this);\n }\n return this._domain;\n }\n\n getInnerRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[0];\n }\n return this._scale(domainVal);\n }\n\n getOuterRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[1];\n }\n const radius = this._scale(domainVal) * this._radiusFactor;\n return radius;\n }\n\n range (...range) {\n if (range.length) {\n const { padding, range: customRange } = this.config();\n const sanitizedRange = range[0].map((v, i) => v + (i ? -padding[i] : padding[i]));\n const rangeVal = resolveAxisConfig(customRange, sanitizedRange, this);\n this._range = rangeVal;\n this._scale.range(rangeVal);\n adjustDomain(this);\n }\n return this._range;\n }\n\n setRadiusFactor (val) {\n this._radiusFactor = val;\n return this;\n }\n}\n","import * as ScaleType from './enums/scale-type';\n\nconst DATA_TYPES = {\n DIMENSION: 'dimension',\n CATEGORICAL: 'categorical',\n MEASURE: 'measure',\n TEMPORAL: 'temporal'\n};\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [DATA_TYPES.DIMENSION]: ScaleType.BAND,\n [DATA_TYPES.MEASURE]: ScaleType.LINEAR,\n [DATA_TYPES.TEMPORAL]: ScaleType.TIME\n};\n\n","import { nestCollection, InvalidAwareTypes } from 'muze-utils';\n\n/**\n * Create multiple datasets from a single dataset by grouping the data using\n * a dimensional field.\n * @param {Array} schema Name and type of fields are stored in schema\n * @param {Array} data Data array\n * @param {Object} config Configuration object\n * @return {Array} Grouped data array\n */\nexport default (schema, data, config) => {\n const groupBy = config.groupBy instanceof Array ? config.groupBy : [config.groupBy];\n const groupByIndices = groupBy.map(fieldName => schema.findIndex(d => d.name === fieldName));\n\n if (groupByIndices.find(d => d === -1) !== undefined) {\n throw new Error(`Groupby field ${groupBy} not found in schema`);\n }\n\n const groupedData = nestCollection({\n keys: groupByIndices,\n data\n });\n\n groupedData.forEach((d) => {\n const key = d.key;\n if (InvalidAwareTypes.isInvalid(key)) {\n d.key = InvalidAwareTypes.getInvalidType(key);\n }\n });\n return groupedData;\n};\n","/**\n * @module Transform\n * This file exports a function that is used to implement\n * the identity transform\n */\n /* eslint no-unused-vars: 0 */\n /**\n * This function accepts data and returns the data unchanged.\n * @param {Object} schema The schema.\n * @param {Array} data The data array.\n * @param {Object} config The config object.\n * @return {Array} The unchanged data.\n */\n function identityTransform (schema, data, config) {\n return data;\n }\n\n export default identityTransform;\n","/**\n * @module Transform\n * This file exports the transform factory.\n */\nimport * as TransformType from '../enums/transform-type';\nimport identity from '../identity-transform';\nimport group from '../group-transform';\nimport stack from '../stack-transform';\n\n/* istanbul ignore next */\nconst transformMap = {\n [TransformType.IDENTITY]: identity,\n [TransformType.GROUP]: group,\n [TransformType.STACK]: stack\n};\n\n/**\n * This function is used to retirn a transform associated\n * with the given type.\n *\n * @param {string} type The type of the transform.\n * @return {Function} The transform function.\n */\nfunction transformFactory (type) {\n const transform = transformMap[type];\n if (typeof transform !== 'function') {\n throw new Error('Invalid transform type supplied.');\n }\n return transform;\n}\n\nexport default transformFactory;\n","/**\n * @module Transform\n * This module exports constants that are used to reference transforms in\n * a consistent manner throughout the project.\n */\n/* eslint one-var: 0 */\n export const IDENTITY = 'identity';\n export const GROUP = 'group';\n export const STACK = 'stack';\n export const FRACTURE = 'fracture';\n","import { stack, InvalidAwareTypes } from 'muze-utils';\n\nimport group from '../group-transform';\n/*\n Normalize the data to a form which can be given to d3 stack for stacking the data\n ['Product', 'Sales', 'Region'],\n 0 ['A', 2000, 'North'],\n 1 ['A', 3000, 'South'],\n 2 ['B', 3000, 'South'],\n 3 ['B', 2000, 'North'],\n 4 ['C', 3000, 'South'],\n 5 ['C', 2000, 'North']\n |\n |\n ['Product', 'North', 'South'],\n ['A', 2000, 3000],\n ['B', 2000, 3000],\n ['C', 2000, 3000]\n*/\n// eslint-disable-next-line require-jsdoc\nconst normalizeData = (data, schema, valueField, uniqueField, groupBy) => {\n const groupedData = group(schema, data, {\n groupBy: uniqueField\n });\n const uniqueFieldIndex = schema.findIndex(d => d.name === uniqueField);\n const valueFieldIndex = schema.findIndex(d => d.name === valueField);\n const seriesKeyIndex = schema.findIndex(d => d.name === groupBy);\n const seriesKeys = data.map(d => d[seriesKeyIndex]).filter((item, pos, arr) => arr.indexOf(item) === pos).sort();\n\n const fieldNames = schema.reduce((acc, obj, i) => {\n acc[i] = obj.name;\n return acc;\n }, {});\n const dataArr = groupedData.map((arr) => {\n const tuples = {};\n const rowObj = arr.values.reduce((acc, row) => {\n acc = row.reduce((obj, value, i) => {\n if (i === seriesKeyIndex) {\n if (row[valueFieldIndex] instanceof InvalidAwareTypes) {\n row[valueFieldIndex] = null;\n }\n obj[value] = row[valueFieldIndex];\n tuples[value] = row;\n } else if (i !== valueFieldIndex) {\n obj[fieldNames[i]] = value;\n }\n return obj;\n }, acc);\n return acc;\n }, {});\n rowObj._tuple = tuples;\n // Set missing values field to zero value\n seriesKeys.forEach((seriesKey) => {\n if (rowObj[seriesKey] === undefined) {\n rowObj[seriesKey] = 0;\n const newArr = new Array(arr.values[0].length);\n newArr[uniqueFieldIndex] = arr.key;\n newArr[seriesKeyIndex] = seriesKey;\n rowObj._tuple[seriesKey] = newArr;\n }\n });\n return rowObj;\n });\n\n return {\n data: dataArr,\n keys: seriesKeys\n };\n};\n\n/**\n * Generate a stacked representation of data\n * @param {Array} schema schema Array\n * @param {Array} data data array\n * @param {Object} config Configuration object\n * @return {Array} stacked data\n */\nexport default (schema, data, config) => {\n const { uniqueField, value: valueField, groupBy } = config;\n const sort = config.sort || 'descending';\n const normalizedData = normalizeData(data, schema, valueField, uniqueField, groupBy);\n const keys = normalizedData.keys;\n const map = {};\n const orderBy = config.orderBy;\n const orderIndex = schema.findIndex(d => d.name === orderBy);\n const groupByIndex = schema.findIndex(d => d.name === groupBy);\n\n if (orderIndex !== -1) {\n keys.forEach((key) => {\n const name = data.find(d => d[groupByIndex] === key);\n map[key] = name[orderIndex];\n });\n normalizedData.keys.sort((a, b) => map[a].localeCompare(map[b]));\n }\n\n const stackData = stack({\n keys: normalizedData.keys,\n offset: config.offset || 'diverging',\n order: sort,\n data: normalizedData.data\n });\n\n stackData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n dataObj.data = dataObj.data._tuple[seriesData.key];\n });\n });\n\n return stackData;\n};\n\n","import {\n FieldType,\n getDomainFromData,\n setStyles,\n easeFns,\n selectElement,\n DimensionSubtype,\n retrieveNearestGroupByReducers,\n getObjProp,\n COORD_TYPES,\n CommonProps,\n defaultValue,\n InvalidAwareTypes,\n isSimpleObject\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { transformFactory } from '@chartshq/transform';\nimport { IDENTITY, STACK, GROUP, COLOR, SHAPE, SIZE, ENCODING, AGG_FN_SUM, ASCENDING, TEXT } from '../enums/constants';\n\nconst BAND = ScaleType.BAND;\nconst { POLAR, CARTESIAN } = COORD_TYPES;\n\nexport const transformColor = (colorAxis, datum, styleType, intensity, interactionType) => {\n const meta = datum.meta;\n const stateColor = defaultValue(meta.currentState[interactionType][styleType], meta.originalState[styleType]);\n const colorInfo = colorAxis.transformColor(stateColor, intensity);\n\n // meta.stateColor[styleType] = colorInfo.hsla;\n meta.currentState[interactionType][styleType] = colorInfo.hsla;\n return colorInfo;\n};\n\nexport const applyInteractionStyle = (context, selectionSet, interactionStyles, config) => {\n const elements = context.getPlotElementsFromSet(selectionSet);\n const { apply, interactionType, reset } = config;\n const mountPoint = selectElement(context.mount()).select('.muze-overlay-paths').node();\n\n elements.forEach((elem) => {\n const options = { mountPoint, apply, reset };\n context.applyLayerStyle(elem, interactionType, interactionStyles, options);\n\n // const interactionStylesEntries = Object.entries(interactionStyles.style);\n\n // for (const [type, value] of interactionStylesEntries) {\n // const style = { type, value };\n // const options = { mountPoint, apply, reset };\n // context.applyLayerStyle(elem, interactionType, style, options);\n // }\n });\n};\n\nexport const retrieveEncodingInf = (encoding, fieldsConfig, encodingNames) => {\n const encodingInf = {};\n\n encodingNames\n .forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n encodingInf[`${e}FieldType`] = getObjProp(fieldsConfig, field, 'def', 'type');\n encodingInf[`${e}FieldSubType`] = getObjProp(fieldsConfig, field, 'def', 'subtype');\n });\n return encodingInf;\n};\n\nexport const encodingFieldInfRetriever = {\n [POLAR]: (encoding, fieldsConfig) => {\n const fields = [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT];\n return retrieveEncodingInf(encoding, fieldsConfig, fields);\n },\n [CARTESIAN]: (encoding, fieldsConfig) => {\n const fields = [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT];\n return retrieveEncodingInf(encoding, fieldsConfig, fields);\n }\n};\n\nexport const setNullsInStack = (transformedData, schema, value, setNulls) => {\n const uniqueFieldIndex = schema.findIndex(d => d.name === value);\n transformedData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n if (dataObj.data[uniqueFieldIndex] === null && !setNulls) {\n dataObj[0] = null;\n dataObj[1] = null;\n }\n });\n });\n return transformedData;\n};\nexport const setNulls = (transformedData, val) => transformedData.map((seriesData) => {\n if (val && (seriesData[val.index] instanceof InvalidAwareTypes)) {\n seriesData[val.index] = null;\n }\n return seriesData;\n});\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} config\n * @param {*} transformType\n *\n */\nexport const transformData = (dataModel, config, transformType, encodingFieldInf) => {\n const data = dataModel.getData({ withUid: true });\n const schema = data.schema;\n const { transform, connectNullData: setNullData } = config;\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = encodingFieldInf;\n const uniqueField = xFieldType === FieldType.MEASURE ? yField : xField;\n const value = yFieldType === FieldType.MEASURE ? yField : xField;\n let transformedData = transformFactory(transformType)(schema, data.data, {\n groupBy: transform.groupBy,\n uniqueField,\n sort: transform.sort || 'none',\n offset: transform.offset,\n orderBy: transform.orderBy,\n value\n }, data.uids);\n\n if (transformType === STACK) {\n transformedData = setNullsInStack(transformedData, schema, value, setNullData);\n } else {\n transformedData = setNulls(transformedData, dataModel.getFieldsConfig()[value]);\n }\n return transformedData;\n};\n\nexport const getIndividualClassName = (d, i, data, context) => {\n const className = context.config().individualClassName;\n let classNameStr = '';\n if (className instanceof Function) {\n classNameStr = className(d, i, data, context);\n }\n return classNameStr;\n};\n\nexport const dataNormalizers = {\n [POLAR]: (transformedData, encodingFieldInf, fieldsConfig) => {\n const {\n radiusFieldIndex,\n angleFieldIndex,\n radius0FieldIndex,\n angle0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map(data => data.map((d) => {\n const pointObj = {\n radius: d[radiusFieldIndex],\n angle: angleFieldIndex !== undefined ? d[angleFieldIndex] : 1,\n radius0: d[radius0FieldIndex],\n angle0: d[angle0FieldIndex]\n };\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n return pointObj;\n })).filter(d => d.length);\n },\n [CARTESIAN]: (transformedData, encodingFieldInf, fieldsConfig, transformType) => {\n const {\n xFieldType,\n xFieldIndex,\n yFieldIndex,\n x0FieldIndex,\n y0FieldIndex\n } = encodingFieldInf;\n const fieldsArr = Object.keys(fieldsConfig);\n const fieldsLen = fieldsArr.length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map((data) => {\n const values = transformType === GROUP ? data.values : data;\n return values.map((d) => {\n let pointObj = {};\n let tuple;\n if (transformType === STACK) {\n tuple = d.data || [];\n let y;\n let y0;\n let x;\n let x0;\n if (d[1] >= d[0]) {\n y = x0 = d[1];\n x = y0 = d[0];\n } else {\n y = x0 = d[0];\n x = y0 = d[1];\n }\n\n pointObj = xFieldType === FieldType.MEASURE ? {\n x,\n x0,\n y: tuple[yFieldIndex],\n y0: tuple[yFieldIndex]\n } : {\n x: tuple[xFieldIndex],\n x0: tuple[xFieldIndex],\n y,\n y0\n };\n pointObj.source = tuple;\n pointObj.rowId = tuple[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = tuple[encodingFieldInf[`${enc}FieldIndex`]];\n });\n } else {\n pointObj = {\n x: d[xFieldIndex],\n y: d[yFieldIndex],\n x0: d[x0FieldIndex],\n y0: d[y0FieldIndex]\n };\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n }\n const source = pointObj.source;\n pointObj.dataObj = fieldsArr.reduce((acc, name) => {\n acc[name] = source[fieldsConfig[name].index];\n return acc;\n }, {});\n return pointObj;\n });\n }).filter(d => d.length);\n }\n};\n/*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldsConfig field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n*/\nexport const getNormalizedData = (transformedData, context) => {\n const transformType = context.transformType();\n const transformedDataArr = transformType === IDENTITY ? [transformedData] : transformedData;\n const encodingFieldInf = context.encodingFieldsInf();\n const fieldsConfig = context.data().getFieldsConfig();\n return dataNormalizers[context.coord()](transformedDataArr, encodingFieldInf, fieldsConfig, transformType);\n};\n\nexport const domainCalculator = {\n [POLAR]: (data, layerInst) => {\n const config = layerInst.config();\n const { sort } = config;\n let angleValues = data[0];\n const radius0Field = getObjProp(config.encoding.radius0, 'field');\n if (sort) {\n angleValues = angleValues.sort((a, b) => (sort === ASCENDING ? a.radius - b.radius : b.radius - a.radius));\n }\n const radiusDomain = getDomainFromData(data, [ENCODING.RADIUS, radius0Field ?\n ENCODING.RADIUS0 : ENCODING.RADIUS]);\n return {\n radius: radiusDomain,\n angle: angleValues.map(d => d.angle),\n angle0: angleValues.map(d => d.angle0)\n };\n },\n [CARTESIAN]: (data, layerInst) => {\n const transformType = layerInst.transformType();\n const encodingFieldInf = layerInst.encodingFieldsInf();\n const {\n xFieldSubType,\n yFieldSubType,\n xField,\n yField,\n x0Field,\n y0Field\n } = encodingFieldInf;\n const domains = {};\n const yEnc = ENCODING.Y;\n const xEnc = ENCODING.X;\n if (xField) {\n domains.x = getDomainFromData(data, x0Field || transformType === STACK ? [xEnc, ENCODING.X0] : [xEnc, xEnc],\n xFieldSubType);\n }\n if (yField) {\n domains.y = getDomainFromData(data, y0Field || transformType === STACK ? [ENCODING.Y0, ENCODING.Y] :\n [yEnc, yEnc], yFieldSubType);\n }\n\n return domains;\n }\n};\n\nconst defFn = (d) => {\n const { x, y } = d.update;\n return {\n x,\n y\n };\n};\n\nexport const attachDataToVoronoi = (voronoi, points, accessor = defFn) => {\n voronoi.data([].concat(...points).filter(d => d.rowId !== undefined).map((d) => {\n const { x, y } = accessor(d);\n return {\n x,\n y,\n data: d\n };\n }));\n};\n\n/**\n *\n *\n * @param {*} target\n * @param {*} styles\n * @param {*} remove\n */\nexport const updateStyle = (target, styles, remove) => {\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n target.style(key, remove ? null : styles[key]);\n }\n }\n};\n\n/**\n *\n *\n * @param {*} mount\n * @param {*} context\n */\nexport const animateGroup = (mount, context) => {\n let groupTransition;\n let update;\n const { transition, groupAnimateStyle } = context;\n const { duration, effect, disabled } = transition;\n if (groupAnimateStyle) {\n setStyles(mount.node(), groupAnimateStyle.enter);\n update = groupAnimateStyle.update;\n if (!disabled) {\n groupTransition = mount.transition()\n .ease(easeFns[effect])\n .duration(duration)\n .on('end', function () {\n updateStyle(selectElement(this), update, true);\n });\n } else {\n groupTransition = mount;\n }\n updateStyle(groupTransition, update);\n }\n};\n\nexport const positionPoints = (context, points) => {\n const positioner = context.encodingTransform();\n if (positioner) {\n return positioner(points, context, { smartLabel: context._dependencies.smartLabel });\n }\n return points;\n};\n\n/**\n * Gets the width of each group. It gets the width from axis if it is available for\n * example when the scale is nominal else it calculates the width from the\n * range of the axis and number of data points.\n *\n * @param {SimpleAxis} axis instance of axis\n * @param {number} minDiff Minimum difference between data points\n * @return {number} width of each bar\n * @private\n*/\nexport const getGroupSpan = (axis, minDiff) => {\n let groupSpan;\n const width = axis.getUnitWidth();\n const scale = axis.scale();\n const range = scale.range();\n const domain = scale.domain();\n !width ? groupSpan = (Math.abs(range[1] - range[0]) / Math.abs(domain[1] - domain[0])) * minDiff :\n (groupSpan = width);\n\n return groupSpan;\n};\n\nexport const getPlotMeasurement = (context, dimensionalValues) => {\n const fieldInfo = context.encodingFieldsInf();\n const axes = context.axes();\n const transformType = context.transformType();\n const config = context.config();\n const bandScale = context._bandScale;\n\n return ['x', 'y'].map((type) => {\n let span = 0;\n let groupSpan = 0;\n let padding = 0;\n let offsetValues = [];\n if (fieldInfo[`${type}FieldType`] === FieldType.DIMENSION) {\n let actualGroupWidth;\n const isTemporal = fieldInfo[`${type}FieldSubType`] === DimensionSubtype.TEMPORAL;\n const timeDiff = isTemporal ? context.dataProps().timeDiffs[type] : 0;\n const axis = axes[type];\n const pad = config[`pad${type.toUpperCase()}`];\n const innerPadding = config.innerPadding;\n const keys = dimensionalValues;\n const scale = axis.scale();\n groupSpan = getGroupSpan(axis, timeDiff);\n const isAxisBandScale = axis.constructor.type() === BAND;\n const axisPadding = axis.config().padding;\n // If it is a grouped bar then the width of each bar in a grouping is retrieved from\n // a band scale. The band scale will have range equal to width of one group of bars and\n // the domain is set to series keys.\n if (transformType === 'group') {\n const groupPadding = isAxisBandScale ? 0 : axisPadding * groupSpan / 2;\n bandScale.range([groupPadding, groupSpan - groupPadding]).domain(keys).paddingInner(innerPadding);\n span = bandScale.bandwidth();\n actualGroupWidth = groupSpan - (isAxisBandScale ? 0 : axisPadding * groupSpan);\n offsetValues = keys.map(key => bandScale(key) - (isAxisBandScale ? 0 : (groupSpan / 2)));\n } else if (pad !== undefined) {\n let offset;\n if (isAxisBandScale) {\n const step = scale.step();\n offset = scale.padding() * step;\n span = scale.bandwidth() + offset;\n } else {\n span = groupSpan;\n }\n offsetValues = keys.map(() => (isAxisBandScale ? -(offset / 2) : -(span / 2)));\n } else {\n padding = isAxisBandScale ? 0 : axisPadding * groupSpan;\n span = groupSpan - padding;\n actualGroupWidth = span;\n offsetValues = keys.map(() => (isAxisBandScale ? 0 : -(span / 2)));\n }\n\n groupSpan = actualGroupWidth;\n padding = isAxisBandScale ? axisPadding * axis.scale().step() : axisPadding * groupSpan;\n }\n\n return {\n span,\n offsetValues,\n groupSpan,\n padding\n };\n });\n};\n\nexport const renderLayer = (context) => {\n const mount = context.mount();\n if (mount) {\n context.render(mount);\n context.dependencies().throwback.commit(CommonProps.ON_LAYER_DRAW, true, context.metaInf().parentNamespace);\n }\n};\n\nconst transformResolverPredicates = (encodingFieldInf, context, groupByField) => {\n const fieldsConfig = context.data().getFieldsConfig();\n const { xField, yField, xFieldType, yFieldType } = encodingFieldInf;\n const dimensionField = ['xField', 'yField'].find(type =>\n encodingFieldInf[`${type}Type`] === FieldType.DIMENSION);\n\n return [\n !xField,\n !yField,\n !groupByField,\n getObjProp(fieldsConfig[groupByField], 'def', 'type') === FieldType.MEASURE,\n xFieldType === FieldType.DIMENSION && yFieldType === FieldType.DIMENSION,\n dimensionField && encodingFieldInf[dimensionField] === groupByField\n ];\n};\n\nexport const resolveInvalidTransformType = (context) => {\n const encodingFieldInf = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n\n if (transformResolverPredicates(encodingFieldInf, context, groupByField).some(value => value)) {\n return IDENTITY;\n }\n return null;\n};\n\nexport const getValidTransform = context => resolveInvalidTransformType(context) || context.config().transform.type;\n\nexport const getValidTransformForAggFn = (context) => {\n const resolvedInvalidTransformType = resolveInvalidTransformType(context);\n if (resolvedInvalidTransformType) {\n return resolvedInvalidTransformType;\n }\n\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n const isCustomTransformTypeProvided = !!getObjProp(context._customConfig, 'transform', 'type');\n let transformType = context.config().transform.type;\n\n if (!isCustomTransformTypeProvided && groupByField && xFieldType !== yFieldType) {\n const measureField = xFieldType === FieldType.MEASURE ? xField : yField;\n const { [measureField]: aggFn } = retrieveNearestGroupByReducers(context.data(), measureField);\n transformType = aggFn === AGG_FN_SUM ? STACK : GROUP;\n }\n\n return transformType;\n};\n\nexport const getMarkId = (source, schema) => source.filter((val, i) => schema[i] &&\n schema[i].type === FieldType.DIMENSION).join();\n\nexport const resolveEncodingValues = (data, i, dataArr, layerInst) => {\n const transformedValues = {};\n const values = data.values;\n const encoding = layerInst.config().encoding;\n for (const key in values) {\n const value = getObjProp(encoding[key], 'value');\n if (value instanceof Function) {\n transformedValues[key] = value(values, i, dataArr, layerInst);\n } else {\n transformedValues[key] = values[key];\n }\n }\n return transformedValues;\n};\n\nexport const getColorMetaInf = (initialStyle, conf = {}) => ({\n originalStyle: Object.assign({}, {\n styles: initialStyle\n }, conf),\n currentState: new Map()\n});\n\nconst getCoordValue = (radius, trig, angle, offset) => radius * Math[trig](angle) + offset;\n\nconst coordValueGetter = (radius, angle, xOffset, yOffset) => ({\n x: getCoordValue(radius, 'cos', angle, xOffset),\n y: getCoordValue(radius, 'sin', angle, yOffset)\n});\n\nexport const toCartesianCoordinates = (points, measurement, rangePlot = false) => {\n const xOffset = measurement.width / 2;\n const yOffset = measurement.height / 2;\n for (let i = 0, len = points.length; i < len; i++) {\n const point = points[i];\n const { angle, radius, radius0, angle0 } = point.update;\n point.update = coordValueGetter(radius, angle, xOffset, yOffset);\n if (rangePlot) {\n const update = point.update = coordValueGetter(radius0, angle0, xOffset, yOffset);\n const { x: x0, y: y0 } = coordValueGetter(radius, angle, xOffset, yOffset);\n update.x0 = x0;\n update.y0 = y0;\n }\n }\n return points;\n};\n\nexport const sortData = (data, axes) => {\n const { x: xAxis, y: yAxis } = axes;\n const axisArr = [xAxis, yAxis];\n for (let i = 0, len = axisArr.length; i < len; i++) {\n const axis = axisArr[i];\n if (axis.constructor.type() === BAND) {\n const key = i ? 'y' : 'x';\n const dom = axis.domain();\n const indices = dom.reduce((acc, v, idx) => {\n acc[v] = idx;\n return acc;\n }, {});\n data.sort((a, b) => indices[a[key]] - indices[b[key]]);\n break;\n }\n }\n return data;\n};\n\nexport const getBoundBoxes = points => points.map((point) => {\n const { x, y } = point.update;\n const data = point.data;\n return {\n minX: x,\n maxX: x,\n minY: y,\n maxY: y,\n data\n };\n});\n\nexport const getDataFromEvent = (context, event) => {\n const dataPoint = selectElement(event.target).data()[0];\n if (isSimpleObject(dataPoint) && getObjProp(dataPoint, 'meta', 'layerId') === context.id()) {\n const values = dataPoint && dataPoint.source;\n let identifiers = null;\n if (values) {\n identifiers = context.getIdentifiersFromData(values, dataPoint.rowId);\n }\n return {\n dimensions: [dataPoint],\n id: identifiers,\n layerId: context.id()\n };\n }\n return null;\n};\n","import * as PROPS from '../enums/props';\n\nexport const localOptions = {\n [PROPS.DATA]: {\n value: null\n }\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nexport const listenerMap = [\n {\n props: [`${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}.${PROPS.DATA}`],\n type: 'registerImmediateListener',\n listener: (context, [prevData, data]) => {\n context.dataDidSet([prevData, data]);\n },\n namespace: context => context.metaInf().namespace\n }\n];\n","import { partition } from 'muze-utils';\n\nconst getLastItemInMap = map => Array.from(map)[map.size - 1];\n\nconst getPreviousStyle = (meta, interactionType) => {\n const { originalStyle, currentState } = meta;\n let stylesForCurrentLevel = Object.assign({}, originalStyle);\n\n if (currentState.size > 0) {\n interactionType = getLastItemInMap(currentState)[0];\n stylesForCurrentLevel = currentState.get(interactionType) || {};\n // const elemFill = elem.style('fill');\n // const newStyle = Object.assign({}, stylesForCurrentLevel, { fill: elemFill });\n }\n return stylesForCurrentLevel;\n};\n\nconst strokeProps = {\n 'stroke-width': 1,\n stroke: 1,\n 'stroke-opacity': 1\n};\n\nconst parseStyle = (value, { datum, datumStyle }, apply) => {\n if (typeof value === 'function') {\n if (isNaN(datumStyle)) {\n // const colorType = detectColor(datumStyle);\n const rgbaValues = datumStyle.replace(/[^\\d,.]/g, '').split(',').map(s => Number(s));\n value = value(rgbaValues, datum, apply);\n } else {\n const numValue = parseFloat(datumStyle, 10);\n value = value(numValue, datum, apply);\n }\n return value;\n }\n return value;\n};\n\nexport const applyStylesOnInteraction = (context, elem, interactionType, conf, options) => {\n const { mountPoint, apply, reset } = options;\n\n const d = elem.data()[0];\n let datum;\n\n if (Array.isArray(d)) {\n datum = d[0];\n } else {\n datum = Array.isArray(d.data) ? d.data[0] : d;\n }\n const { currentState, originalStyle } = datum.meta;\n\n let applicableStyles = {};\n\n const { style: styles, strokePosition } = conf;\n let applicableStrokePos = strokePosition;\n\n if (reset) {\n currentState.clear();\n }\n\n let applyStyle = true;\n\n if (apply) {\n const sanitizedStyles = {\n styles: {},\n strokePosition\n };\n for (const type in styles) {\n const parsedStyleVal = parseStyle(styles[type], {\n datum,\n datumStyle: elem.style(type)\n }, apply);\n\n sanitizedStyles.styles[type] = parsedStyleVal;\n }\n currentState.set(interactionType, sanitizedStyles);\n applicableStyles = sanitizedStyles.styles;\n } else if (!currentState.has(interactionType) && !reset) {\n applyStyle = false;\n } else {\n currentState.delete(interactionType);\n const currentStyle = getPreviousStyle(datum.meta, interactionType);\n applicableStyles = Object.assign({}, originalStyle.styles, currentStyle.styles);\n applicableStrokePos = currentStyle.strokePosition || originalStyle.strokePosition;\n }\n\n const styleKeys = Object.keys(applicableStyles);\n const [strokeStyles, otherStyles] = partition(styleKeys, v => v in strokeProps);\n\n applyStyle && context.applyStyles({\n strokeStyles,\n otherStyles,\n styleObj: applicableStyles,\n elem,\n datum,\n applicableStrokePos,\n mountPoint\n });\n};\n","import {\n getUniqueId,\n mergeRecursive,\n FieldType,\n selectElement,\n ReservedFields,\n DataModel,\n clone,\n generateGetterSetters,\n STATE_NAMESPACES,\n transactor,\n defaultValue,\n getObjProp,\n InvalidAwareTypes\n} from 'muze-utils';\nimport * as PROPS from '../enums/props';\nimport { props } from './props';\nimport {\n transformData,\n getNormalizedData,\n applyInteractionStyle,\n getValidTransform,\n domainCalculator,\n renderLayer,\n encodingFieldInfRetriever\n} from '../helpers';\nimport { localOptions } from './local-options';\nimport { listenerMap } from './listener-map';\nimport { BASE_LAYER, AREA_LAYER } from '../enums/constants';\nimport { applyStylesOnInteraction } from './helper';\n\nconst layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\nexport const BaseLayerMixin = superclass => class extends superclass {\n /**\n * Creates a layer using a configuration and data.\n *\n * @public\n * @constructor\n * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a\n * layer.\n * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from\n * value to px.\n * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators\n * @param {ShapeAxis} axes.shape Axis for providing a shape\n * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator\n * @param {LayerConfig} config Configuration of the layer\n * @param {Object} dependencies Dependencies of the layer\n * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance\n */\n constructor () {\n super();\n\n generateGetterSetters(this, this.constructor.getterSetters());\n this.axes({});\n this.alias(this.constructor.formalName() + getUniqueId());\n this._points = [];\n this._cachedData = [];\n this._id = getUniqueId();\n this._measurement = {};\n this._animationDonePromises = [];\n this._graphicElems = {};\n this._customConfig = null;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys(this.localOptions()).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getListeners () {\n return {\n store: [...listenerMap, {\n type: 'registerChangeListener',\n props: this.getRenderProps(),\n listener: (context) => {\n renderLayer(context);\n },\n subNamespace: (context) => {\n const { unitRowIndex, unitColIndex, namespace } = context.metaInf();\n return {\n [`${layerNs[1]}.${PROPS.DATA}`]: namespace,\n [`${groupNs}.domain.x`]: `${unitColIndex}0`,\n [`${groupNs}.domain.y`]: `${unitRowIndex}0`,\n [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}`\n };\n }\n }],\n throwback: []\n };\n }\n\n static getQualifiedStateProps () {\n const layerState = this.getState();\n return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`));\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { namespace } = this.metaInf();\n store.addSubNamespace(namespace, BASE_LAYER, this);\n\n transactor(this, this.constructor.localOptions(), store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}`\n });\n return this;\n }\n return this._store;\n }\n\n domain (...dom) {\n const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`;\n const store = this.store();\n if (dom.length) {\n const { parentNamespace, namespace } = this.metaInf();\n const domain = defaultValue(store.get(prop, parentNamespace), {});\n domain[namespace] = dom[0];\n this.store().commit(prop, domain, parentNamespace);\n return this;\n }\n return this.store().get(prop, this.metaInf().namespace);\n }\n\n /**\n * Creates a layer instance\n * @return {BaseLayer} Instance of a layer\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Default configuration of the layer. This configuration gets merged to the user passed configuration using a\n * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own\n * configuration.\n *\n * @public\n * @static\n *\n * @return {Object} Default configuration\n */\n static defaultConfig () {\n return {\n transform: {\n type: 'identity'\n }\n };\n }\n\n static getterSetters () {\n return props;\n }\n\n static localOptions () {\n return localOptions;\n }\n /**\n * Policy defines how user config gets merged to default config. The default policy here does a deep copy\n * operation.\n * Any policy which does more than deep copying should define the policy as a static member.\n *\n * @static\n * @public\n *\n * @param {LayerConfig} conf Configuration with which the user config will be merged\n * @param {LayerConfig} userConf Configuration given by the user\n *\n * @return {LayerConfig} Merged layer configuration\n */\n static defaultPolicy (conf, userConf) {\n return mergeRecursive(conf, userConf);\n }\n\n /**\n * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among\n * multiple layers of same type if one layer has to be referred, alias is used. If no alias is given then\n * `formalName` is set as the alias name.\n *\n *\n * If used as setter\n * @param {string} alias Name of the alias\n * @return {BaseLayer} Instance of current base layer\n *\n * If used as getter\n * @return {string} Alias of the current layer\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n this._alias = params[0];\n return this;\n }\n return this._alias || this.constructor.formalName();\n }\n\n enableCaching () {\n this._cacheEnabled = true;\n return this;\n }\n\n clearCaching () {\n this._cacheEnabled = false;\n return this.data(this._cachedData[0]);\n }\n\n /**\n * Serialize the schema. Merge config is used for serialization.\n *\n * @public\n *\n * @return {LayerConfig} Serialized schema\n */\n serialize () {\n return this.config();\n }\n\n /**\n * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema.\n *\n * @public\n *\n * @return {string} id of the layer\n */\n id () {\n return this._id;\n }\n\n /**\n * Returns the transformed data based on given transform type.\n * It first gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of DataModel\n * @param {Object} config Configuration for transforming data\n * @return {Array.} Transformed data.\n */\n getTransformedData (dataModel, config, transformType, encodingFieldsInf) {\n return transformData(dataModel, config, transformType, encodingFieldsInf);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a categorical field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @param {Object} fieldsConfig Configuration of fields\n * @return {Array} Domain values array.\n */\n calculateDomainFromData (data) {\n let domains = {};\n const isEmpty = this.data().isEmpty();\n\n if (!isEmpty) {\n domains = domainCalculator[this.coord()](data, this);\n }\n return domains;\n }\n\n static shouldDrawAnchors () {\n return false;\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getDataDomain (encodingType) {\n const { parentNamespace, namespace } = this.metaInf();\n const domains = getObjProp(this.store()\n .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace);\n return encodingType !== undefined ? domains[encodingType] || [] : domains;\n }\n\n getUidsFromPayload ({ model, uids }, targetData) {\n const targetFields = targetData[0];\n const targetVals = targetData.slice(1, targetData.length);\n const payloadMap = targetVals.reduce((acc, v) => {\n acc[v] = v;\n return acc;\n }, {});\n const measures = Object.keys(this.data().getFieldspace().getMeasure());\n\n const filterFn = (fields, i) => {\n const row = `${targetFields.map((field) => {\n let val;\n if (field === ReservedFields.MEASURE_NAMES) {\n val = measures;\n } else if (field === ReservedFields.ROW_ID) {\n val = i;\n } else {\n const currentField = fields[field];\n const isFieldInvalid = currentField instanceof InvalidAwareTypes;\n\n val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue;\n }\n return val;\n })}`;\n return row in payloadMap;\n };\n\n const dm = model.select(filterFn, {});\n\n // Need to find a better way to do this instead of iterating the full data\n const currentSetIds = this.data().select(filterFn, {\n saveChild: false\n }).getUids();\n\n const uidMap = currentSetIds.reduce((acc, v) => {\n acc[v] = true;\n return acc;\n }, {});\n\n return {\n model: dm,\n uids: uids.filter(d => uidMap[d[0]]),\n length: currentSetIds.length\n };\n }\n\n /**\n * Normalizes the transformed data and returns it.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getNormalizedData (transformedData) {\n return getNormalizedData(transformedData, this);\n }\n\n /**\n * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns\n * null.\n *\n * @public\n *\n * @param {number} x X Coordinate.\n * @param {number} y Y Coordinate.\n *\n * @return {Object} Information of the nearest point.\n * ```\n * {\n * // id property contains the field names and their corresponding values in a 2d array. This is the\n * data // associated with the nearest point.\n * id: // Example data: [['Origin'], ['USA']],\n * dimensions: // Physical dimensions of the point.\n * layerId: // Id of the layer instance.\n * }\n * ```\n */\n getNearestPoint () {\n return null;\n }\n\n applyInteractionStyle (interactionType, selectionSet, options) {\n const interactionConfig = this.config().interaction || {};\n const { apply, styles, reset } = options;\n\n let interactionStyles = interactionConfig[interactionType];\n interactionStyles = styles || interactionStyles;\n if (interactionStyles) {\n applyInteractionStyle(this, selectionSet, interactionStyles, {\n apply,\n interactionType,\n reset\n });\n }\n }\n\n resolveTransformType () {\n this._transformType = getValidTransform(this);\n }\n\n transformType () {\n return this._transformType;\n }\n\n /**\n * Renders the layer\n * @return {BaseLayer} Instance of the layer.\n */\n render () {\n return this;\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Disposes the entire layer.\n *\n * @return {BaseLayer} Instance of layer.\n */\n remove () {\n const { namespace, parentNamespace } = this.metaInf();\n const store = this.store();\n store.removeSubNamespace(namespace, BASE_LAYER);\n const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`);\n const unitDom = layersDomain[parentNamespace];\n unitDom && (delete unitDom[namespace]);\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n * Stores point in an object with key as the categorical value or temporal value\n *\n * @param {string} key categorical value or temporal value\n * @param {Object} data Information of the data point\n * @return {BarLayer} Instance of bar layer\n */\n cachePoint (key, data) {\n if (key === null) {\n return this;\n }\n const pointMap = this._pointMap;\n !pointMap[key] && (pointMap[key] = []);\n pointMap[key].push(data);\n return this;\n }\n\n getInteractionStyles () {\n return applyStylesOnInteraction;\n }\n\n addOverlayPath () {\n return null;\n }\n\n removeOverlayPath () {\n return null;\n }\n\n applyLayerStyle (elem, interactionType, style, options) {\n const interactionFn = this.getInteractionStyles();\n return interactionFn(this, elem, interactionType, style, options);\n }\n\n getIdentifiersFromData (data, rowId) {\n const schema = this.data().getSchema();\n const fieldsConfig = this.data().getFieldsConfig();\n const identifiers = [[], []];\n\n const allMeasures = schema.every(field => field.type === FieldType.MEASURE);\n schema.forEach((d, i) => {\n const name = d.name;\n const { type } = fieldsConfig[name].def;\n if (type === FieldType.DIMENSION) {\n identifiers[0].push(name);\n identifiers[1].push(data[i]);\n }\n });\n\n const measures = schema.filter(d => d.type === FieldType.MEASURE).map(d => d.name);\n if (measures.length) {\n identifiers[0].push(ReservedFields.MEASURE_NAMES);\n identifiers[1].push(measures.join());\n }\n\n if (allMeasures) {\n identifiers[0].push(...[ReservedFields.ROW_ID]);\n identifiers[1].push(...[rowId]);\n }\n\n return identifiers;\n }\n\n hasPlotSpan () {\n return false;\n }\n\n getPlotSpan () {\n return {\n x: 0,\n y: 0\n };\n }\n\n getPlotPadding () {\n return {\n x: 0,\n y: 0\n };\n }\n\n /**\n * Returns the information of the marks corresponding to the supplied identifiers.\n * Identifiers are a set of field names and their corresponding values in an array.\n * It can also be an instance of datamodel.\n *\n * For example,\n * ```\n * const identifiers = [\n * ['Origin', 'Cylinders'],\n * ['USA', '8']\n * ];\n * const points = barLayer.getPointsFromIdentifiers(identifiers);\n * ```\n * @public\n * @param {Array|DataModel} identifiers Identifiers of the marks.\n * @param {Object} config Optional configuration which describes how to get the information.\n * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only\n * the positions of the points.\n * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks.\n *\n * @return {Array} Array of points contains\n */\n getPointsFromIdentifiers (identifiers, config = {}) {\n const getAllAttrs = config.getAllAttrs;\n const getBBox = config.getBBox;\n if (!this.data()) {\n return [];\n }\n let fieldNames;\n let values;\n if (identifiers instanceof DataModel) {\n const dataObj = identifiers.getData();\n fieldNames = dataObj.schema.map(d => d.name);\n values = dataObj.data;\n } else {\n fieldNames = identifiers[0];\n values = identifiers.slice(1, identifiers.length);\n }\n\n const points = this._points;\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPoints = [].concat(...points).filter((point) => {\n const { source, rowId } = point;\n\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n return getAllAttrs ? filteredPoints : filteredPoints.map((d) => {\n const obj = clone(d);\n if (getBBox) {\n const update = obj.update || obj;\n if (obj.size !== undefined) {\n const sizeVal = Math.sqrt(obj.size / Math.PI) * 2;\n update.width = sizeVal;\n update.height = sizeVal;\n update.x -= sizeVal / 2;\n update.y -= sizeVal / 2;\n } else {\n if (update.width === undefined) {\n update.width = 2;\n }\n if (update.height === undefined) {\n update.height = 2;\n }\n }\n }\n\n return obj.update || obj;\n }).sort((a, b) => a.y - b.y);\n }\n\n getTransformedDataFromIdentifiers (identifiers, idx = 0) {\n const { data: identifierData, schema: identifierSchema } = identifiers.getData();\n const normalizedData = this._normalizedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const {\n yField,\n xField,\n yFieldType,\n xFieldType\n } = this.encodingFieldsInf();\n let measureIndex;\n let enc;\n if (xFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[xField].index;\n enc = 'x';\n } else if (yFieldType === FieldType.MEASURE) {\n const layerName = this.constructor.formalName();\n measureIndex = fieldsConfig[yField].index;\n enc = 'y';\n if (layerName === AREA_LAYER) {\n enc = (idx % 2 === 0) ? 'y' : 'y0';\n }\n }\n\n const transformedData = [];\n normalizedData.forEach((dataArr) => {\n dataArr.forEach((dataObj) => {\n const tupleArr = dataObj.source;\n const exist = identifierSchema.every((obj, i) =>\n identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1);\n if (exist) {\n const transformedVal = dataObj[enc] || 0;\n const row = dataObj.source;\n const tuple = {};\n for (const key in fieldsConfig) {\n const index = fieldsConfig[key].index;\n tuple[key] = row[index];\n if (index === measureIndex) {\n tuple[key] = transformedVal;\n }\n }\n transformedData.push(tuple);\n }\n });\n });\n\n return [transformedData, this.data().getSchema()];\n }\n\n /**\n * Returns the dom elements associated with the supplied set of row ids.\n * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids,\n * it returns all the elements which is mapped with those row ids.\n *\n * @public\n * @param {Array} set Array of row ids\n *\n * @return {Selection} D3 Selection of dom elements.\n */\n getPlotElementsFromSet (set) {\n const graphicElems = this._graphicElems;\n const elems = [];\n for (let i = 0, len = set.length; i < len; i++) {\n const elem = graphicElems[set[i]];\n if (elem) {\n elems.push(elem);\n }\n }\n return elems;\n }\n\n /**\n * Notifies when all animations/transitions of the layer are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n /**\n * Called when the layer datamodel is set.\n *\n * @param {Array} arr Old and new datamodel instance.\n * @param {DataModel} arr[0] Previous datamodel instance.\n * @param {DataModel} arr[1] Current datamodel instance.\n *\n * @return {BaseLayer} Instance of layer.\n */\n dataDidSet ([, data]) {\n const config = this.config();\n\n if (data && config) {\n if (this._cacheEnabled) {\n this._cachedData.push(data);\n } else {\n this._cachedData = [data];\n }\n const encodingValue = config.encoding;\n if (encodingValue) {\n const fieldsConfig = data.getFieldsConfig();\n const encodingFieldsInf = this.retrieveEncodingFields(encodingValue, this.coord(), data);\n this.encodingFieldsInf(encodingFieldsInf);\n this.resolveTransformType();\n this._transformedData = this.getTransformedData(data, config,\n this.transformType(), encodingFieldsInf);\n this._normalizedData = this.getNormalizedData(this._transformedData, fieldsConfig);\n if (config.calculateDomain !== false) {\n const domain = this.calculateDomainFromData(this._normalizedData,\n this.encodingFieldsInf(), this.data().getFieldsConfig());\n this.domain(domain);\n }\n }\n }\n return this;\n }\n\n retrieveEncodingFields (encoding, coord, data) {\n const fieldsConfig = data.getFieldsConfig();\n\n return encodingFieldInfRetriever[coord](encoding, fieldsConfig);\n }\n\n static getRenderProps () {\n return [`${layerNs[1]}.${PROPS.DATA}`, ...['x', 'y', 'radius'].map(type =>\n `${groupNs}.domain.${type}`)];\n }\n\n applyStyles ({ strokeStyles, otherStyles, styleObj, elem, mountPoint, applicableStrokePos, datum }) {\n strokeStyles.forEach((type) => {\n this.addOverlayPath(\n elem.node(),\n datum,\n { type, value: styleObj[type] },\n applicableStrokePos,\n mountPoint\n );\n });\n\n this.applyElementStyles(elem, otherStyles, styleObj);\n }\n\n applyElementStyles (elem, styles, styleObj) {\n styles.forEach((type) => {\n elem.style(type, styleObj[type]);\n });\n }\n\n getBoundBoxes () {\n return null;\n }\n};\n","import {\n mix\n} from 'muze-utils';\nimport { SimpleLayer } from '../simple-layer';\nimport { BaseLayerMixin } from './base-mixin';\nimport { BASE_LAYER } from '../enums/constants';\n\n/**\n * An abstract class which gives definition of common layer functionality like\n * - transforming data for various modes. Supported modes: identity, group and stack.\n * - calculating data domain\n * - linking dependent layers\n * - merging policy of configuration\n * - interaction sideffect helpers\n * - retrieving dom elements from data using id\n * - retrieving the physical dimensions of marks\n * - disposing layer\n *\n * Every layer has to extend base layer and give concrete definition.\n * This layer does not have any default visual. A new layer has to define the logic of `render` for rendering the\n * visuals\n *\n * @public\n * @class\n * @module BaseLayer\n */\nexport default class BaseLayer extends mix(SimpleLayer).with(BaseLayerMixin) {\n /**\n * Determines a name for a layer. This name of the layer is used in the input data to refer to this layer.\n * ```\n * .layers([\n * mark: 'bar',\n * encoding: { ... }\n * ])\n * ```\n *\n * @static\n * @public\n *\n * @return {string} name of layer\n */\n static formalName () {\n return BASE_LAYER;\n }\n}\n","import {\n selectElement,\n makeElement,\n pathInterpolators,\n Symbols,\n setStyles\n} from 'muze-utils';\nimport { updateStyle } from '../../helpers';\n\nconst line = Symbols.line;\n\nconst filterFn = (d) => {\n const { update } = d;\n return update.y !== null && update.x !== null;\n};\n\nconst containsNull = (elem) => {\n const { x, y } = elem ? elem.update : {};\n if (x === null || y === null) {\n return true;\n }\n return false;\n};\n\nconst settIndexPrevOrNext = (arr, index, indexesObj) => {\n const prevContainsNull = containsNull(arr[index - 1], index - 1);\n const nextContainsNull = containsNull(arr[index + 1], index + 1);\n\n !prevContainsNull && indexesObj.prevOfNull.push(index - 1);\n !nextContainsNull && indexesObj.nextOfNull.push(index + 1);\n};\n\nconst getborderIndexes = (arr) => {\n const indexes = {\n prevOfNull: [],\n nextOfNull: []\n };\n arr.forEach((value, index) => {\n const { update } = value;\n if (update.y === null || update.x === null) {\n settIndexPrevOrNext(arr, index, indexes);\n }\n });\n return indexes;\n};\n\nconst makeStartEndPair = (arr, borderIndexes) => {\n const pairArray = [];\n const { prevOfNull, nextOfNull } = borderIndexes;\n const length = prevOfNull.length;\n if (!length) {\n return pairArray;\n }\n\n for (let i = 0; i < length; i++) {\n const pair = [];\n const prevValue = arr[prevOfNull[i]];\n const nextValue = arr[nextOfNull[i]];\n if (prevValue) {\n pair.push(prevValue);\n }\n if (nextValue) {\n pair.push(nextValue);\n }\n pairArray.push(pair);\n }\n return pairArray;\n};\n\nconst sanitizeNullConfig = (arr) => {\n const borderIndexes = getborderIndexes(arr);\n return makeStartEndPair(arr, borderIndexes);\n};\n\nconst getElementsForLine = (params) => {\n const { mount, data, className, layer, strokeStyle, linepath, transition, updateFns } = params;\n let element = makeElement(mount, 'path', data.length ? [data] : [], className, updateFns);\n element.attr('class', (d, i) => d[i].className);\n setStyles(element, strokeStyle);\n if (!transition.disabled) {\n element = element.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n element.attr('d', linepath(data))\n .style('fill-opacity', 0);\n return element;\n};\n\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nexport const drawLine = (context) => {\n const { layer, container, points, interpolate, connectNullData, className, style, transition } = context;\n const containerSelection = selectElement(container);\n const strokeStyle = layer.config().nullDataLineStyle;\n const nullDataLineClass = layer.config().nullDataLineClass;\n const mount = containerSelection.attr('class', className);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(d => d.update.x)\n .y(d => d.update.y)\n .defined(filterFn);\n\n const graphicElems = layer._graphicElems;\n const updateFns = {\n update: (group, d) => {\n d.forEach((dd) => {\n graphicElems[dd.rowId] = containerSelection;\n });\n }\n };\n\n updateStyle(mount, style);\n\n const elementWithNullData = getElementsForLine({\n mount,\n data: points,\n strokeStyle: undefined,\n layer,\n linepath,\n transition,\n updateFns\n });\n const sanitizedPoints = sanitizeNullConfig(points);\n\n sanitizedPoints.map((d) => {\n if (connectNullData && d.length > 1) {\n getElementsForLine({\n mount,\n data: d,\n strokeStyle,\n className: `.${className}-${nullDataLineClass}`,\n layer,\n linepath,\n transition,\n updateFns\n });\n }\n return null;\n });\n return elementWithNullData;\n};\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-line',\n className: '',\n interpolate: 'linear',\n transform: {\n type: 'group'\n },\n interaction: {\n fade: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n focus: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n brushStroke: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n crossline: true,\n nearestPointThreshold: 20,\n encoding: {\n color: {},\n x: {},\n y: {},\n strokeOpacity: {\n value: 1\n },\n fillOpacity: {\n value: 0\n },\n strokeWidth: {\n value: '2px'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false,\n nullDataLineStyle: {},\n nullDataLineClass: 'null'\n};\n","import {\n Voronoi,\n getQualifiedClassName,\n selectElement,\n makeElement,\n FieldType,\n InvalidAwareTypes,\n getObjProp\n} from 'muze-utils';\nimport { drawLine } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n animateGroup,\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues,\n sortData,\n getBoundBoxes\n} from '../../helpers';\nimport './styles.scss';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport const LineLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of LineLayer.\n *\n * @param {*} args\n * @memberof LineLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n }\n\n static formalName () {\n return 'line';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Default configuration of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = super.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField && !transform.groupBy) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n * Returns the draw method for line\n * @return {Function} Draw method of line layer\n */\n getDrawFn () {\n return drawLine;\n }\n\n static shouldDrawAnchors () {\n return true;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @param {number} seriesIndex index of series\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const axes = this.axes();\n const encoding = this.config().encoding;\n const xAxis = axes.x;\n const yAxis = axes.y;\n const colorAxis = axes.color;\n const { xFieldType, yFieldType } = this.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n sortData(data, axes);\n points = data.map((d, i) => {\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2;\n const color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color\n },\n data: d\n }, i, data, this);\n\n const style = {\n stroke: resolvedEncodings.color,\n 'fill-opacity': encoding.fillOpacity.value,\n 'stroke-width': encoding.strokeWidth.value\n };\n\n const point = {\n enter: {},\n update: {\n x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x,\n y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y\n },\n style,\n rowId: d.rowId,\n source: d.source,\n data: d.dataObj,\n meta: getColorMetaInf(style)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n\n points = points.filter((point) => {\n const { update } = point;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n getTranslatedData (normalizedData, colorValFn, colorFieldIndex, axes) {\n return normalizedData.map((data, i) => {\n let color;\n const colorVal = data.find(d => d.source[colorFieldIndex] !== null &&\n d.source[colorFieldIndex] !== undefined);\n\n if (colorValFn) {\n color = colorValFn(data, i, normalizedData);\n } else {\n color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]);\n }\n\n return {\n data: this.translatePoints(data),\n style: this.getPathStyle(color)\n };\n });\n }\n\n /**\n * Renders the line plot\n * @param {SVGElement} container svg element\n * @return {LineLayer} instance of line layer\n */\n render (container) {\n const config = this.config();\n const {\n encoding,\n interpolate,\n className,\n defClassName,\n transition\n } = config;\n const normalizedData = this._normalizedData;\n const transformedData = this._transformedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const keys = transformedData.map(d => d.key);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n const colorField = encoding.color.field;\n const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index;\n\n this._points = [];\n this._pointMap = {};\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n\n const colorValFn = encoding.color.value;\n const translatedPoints = this.getTranslatedData(normalizedData, colorValFn, colorFieldIndex, axes);\n\n makeElement(container, 'g', translatedPoints, null, {\n enter: (group) => {\n animateGroup(group, {\n transition,\n groupAnimateStyle: {\n enter: {\n 'stroke-opacity': 0,\n 'fill-opacity': this.getPathStyle()['fill-opacity']\n },\n update: {\n 'stroke-opacity': encoding.strokeOpacity.value\n }\n }\n });\n },\n update: (group, dataArr, i) => {\n const points = dataArr.data;\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n const style = dataArr.style;\n\n this._points.push(points);\n this.getDrawFn()({\n layer: this,\n container: group.node(),\n interpolate,\n points,\n className: seriesClassName,\n transition,\n style: style || {},\n connectNullData: config.connectNullData\n });\n }\n }, d => d.data[0].source[colorFieldIndex] || d.data[0].rowId);\n\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n stroke: color,\n 'fill-opacity': '0'\n };\n }\n\n /**\n * Gets the nearest point closest to the given position\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point information\n */\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n const point = this._voronoi.find(x, y, searchRadius);\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n\n applyStyles ({ strokeStyles, otherStyles, styleObj, elem }) {\n [...otherStyles, ...strokeStyles].forEach((type) => {\n elem.style(type, styleObj[type]);\n });\n }\n\n getBoundBoxes () {\n return getBoundBoxes(this._points.flat());\n }\n};\n","import { CLASSPREFIX, STACK } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-area',\n className: '',\n interpolate: 'linear',\n transform: {\n type: STACK\n },\n interaction: {\n fade: {\n style: {\n 'fill-opacity': 0.7\n }\n },\n focus: {\n style: {\n 'fill-opacity': 0.7\n }\n },\n brushStroke: {\n style: {\n 'fill-opacity': 0.7\n }\n }\n },\n crossline: true,\n nearestPointThreshold: 10,\n encoding: {\n color: {},\n x: {},\n y: {},\n y0: {},\n strokeOpacity: {\n value: 1\n },\n fillOpacity: {\n value: 0.3\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n","import {\n easeFns,\n selectElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\n\nconst area = Symbols.area;\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nconst /* istanbul ignore next */ drawArea = (params) => {\n const { layer, container, points, style, transition, className, interpolate, connectNullData } = params;\n\n const graphicElems = layer._graphicElems;\n const { effect: easeEffect, duration } = transition;\n const mount = selectElement(container);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const selection = mount.selectAll('path').data(points.length ? [points] : []);\n const [enterAreaPath, updateAreaPath] = ['enter', 'update'].map(e => area().curve(curveInterpolatorFn)\n .x(d => d[e].x)\n .y1(d => d[e].y)\n .y0(d => d[e].y0)\n .defined(d => d[e].y !== undefined));\n\n mount.attr('class', className);\n\n let filteredPoints = points;\n if (connectNullData) {\n filteredPoints = filteredPoints.filter(d => d.update.y !== undefined);\n }\n const selectionEnter = selection\n .enter()\n .append('path')\n .attr('d', enterAreaPath(filteredPoints))\n .each((d) => {\n d.forEach((dd) => {\n if (dd.rowId) {\n graphicElems[dd.rowId] = mount.select('path');\n }\n });\n });\n\n selection.merge(selectionEnter).transition().ease(easeFns[easeEffect])\n .duration(duration)\n .on('end', layer.registerAnimationDoneHook())\n .attr('d', updateAreaPath(filteredPoints))\n .each(function () {\n const element = selectElement(this);\n Object.keys(style).forEach(key => element.style(key, style[key]));\n });\n};\n\nexport default drawArea;\n","import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport drawArea from './renderer';\nimport './styles.scss';\nimport { STACK, ENCODING } from '../../enums/constants';\nimport {\n positionPoints,\n getIndividualClassName,\n getValidTransformForAggFn,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport const AreaLayerMixin = superclass => class extends superclass {\n\n /** Default configuration of area layer\n *\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Calculates the domain from data. It calls its parent class's method which is line layer\n * to get the domain and overwrites the domain according to its need.\n * @return {Array} Domain values\n */\n calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) {\n const domains = super.calculateDomainFromData(data, fieldsConfig);\n [ENCODING.X, ENCODING.Y].forEach((type) => {\n const { [`${type}FieldType`]: fieldType } = encodingFieldsInf;\n if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) {\n domains[type][0] = Math.min(domains[type][0], 0);\n domains[type][1] = Math.max(0, domains[type][1]);\n }\n });\n return domains;\n }\n\n /**\n * Returns the drawing method of this layer\n * @return {Function} Draw method\n */\n getDrawFn () {\n return drawArea;\n }\n\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n let point = this._voronoi.find(x, y, searchRadius);\n let index;\n let nearestPoint = null;\n\n if (!point && config.dimValue && this._pointMap) {\n const pointArr = this._pointMap[config.dimValue[1][0]] || [];\n\n for (let i = 0, len = pointArr.length; i < len; i++) {\n const { y: pointY, y0: pointY0 } = pointArr[i].update;\n if (pointY < y && y < pointY0) {\n index = i;\n nearestPoint = pointArr[i];\n break;\n }\n }\n\n // Index is a number(0 or more)\n if (index !== undefined) {\n point = {\n index,\n data: {\n x,\n y,\n data: nearestPoint\n }\n };\n }\n }\n\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y0: dimensions.y0,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const transformType = this.transformType();\n const axes = this.axes();\n const colorAxis = axes.color;\n const config = this.config();\n const encoding = config.encoding;\n const fieldsConfig = this.data().getFieldsConfig();\n const { xField, yField, y0Field } = this.encodingFieldsInf();\n const { x: xAxis, y: yAxis } = axes;\n const classNameFn = config.individualClassName;\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const minYVal = yAxis.domain()[0];\n const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal);\n sortData(data, axes);\n points = data.map((d, i) => {\n let color;\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y);\n const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos;\n color = colorAxis.getColor(d.color);\n const invalidY = d.y instanceof InvalidAwareTypes;\n const invalidY0 = d.y0 instanceof InvalidAwareTypes;\n const resolvedValues = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, this);\n color = resolvedValues.color;\n const style = {\n fill: color,\n 'fill-opacity': encoding.fillOpacity.value\n };\n\n const point = {\n enter: {\n x: xPx,\n y: invalidY ? null : basePos,\n y0: invalidY0 ? null : basePos\n },\n update: {\n x: xPx,\n y: invalidY ? null : resolvedValues.y,\n y0: invalidY0 ? null : resolvedValues.y0\n },\n source: d.source,\n rowId: d.rowId,\n data: d.dataObj,\n className: classNameFn ? classNameFn(d, i, data, this) : '',\n style,\n meta: getColorMetaInf(style)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n points = points.filter((point) => {\n const update = point.update;\n return !isNaN(update.x);\n });\n return points;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n fill: color,\n 'fill-opacity': 0.30\n };\n }\n};\n","import { mix } from 'muze-utils';\nimport { AREA_LAYER } from '../../enums/constants';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { LineLayerMixin } from '../line/line-mixin';\nimport { AreaLayerMixin } from './area-mixin';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport default class AreaLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin, AreaLayerMixin) {\n static formalName () {\n return AREA_LAYER;\n }\n}\n\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-arc',\n padding: { top: 1, bottom: 1, left: 1, right: 1 },\n className: '',\n interaction: {\n highlight: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.1\n }, data, apply).color\n }\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n height: 100,\n width: 100,\n sort: '',\n colors: ['#F44336', 'blue', 'green', 'yellow', 'orange', 'purple'],\n transform: {\n type: 'identity'\n },\n encoding: {\n 'stroke-width': {\n value: '2px'\n },\n 'stroke-linejoin': {\n value: 'round'\n },\n angle: {\n value: '1'\n },\n radius: {\n value: '1'\n },\n opacity: {\n value: '1'\n },\n color: {\n value: '1'\n },\n shape: {\n value: '1'\n },\n size: {\n value: '1'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 500\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-arc-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-arc-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-arc-selected`\n }\n }\n};\n\n","import {\n makeElement,\n selectElement,\n getQualifiedClassName,\n isSimpleObject,\n Symbols,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers';\nimport { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper';\nimport './styles.scss';\n\nconst arc = Symbols.arc;\n\nexport const ArcLayerMixin = superclass => class extends superclass {\n constructor (data, axes, config, dependencies) {\n super(data, axes, config, dependencies);\n this._prevPieData = {};\n }\n\n /**\n * returns the default configuration of the layer\n *\n * @static\n * @return {Object} Default configuration for arc layer\n * @memberof ArcLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'arc';\n }\n\n elemType () {\n return 'path';\n }\n\n getNearestPoint (x, y, config = {}) {\n return this.getDataFromEvent(config.event);\n }\n\n getDataFromEvent (event) {\n const dataPoint = selectElement(event.target).data()[0];\n if (isSimpleObject(dataPoint)) {\n const { source, rowId } = dataPoint;\n return {\n id: this.getIdentifiersFromData(source, rowId),\n layerId: this.id()\n };\n }\n return null;\n }\n\n translatePoints (data) {\n const { angle, color: colorAxis, radius: radiusAxis } = this.axes();\n const pieIndex = {};\n const prevData = this._points[0] || [];\n const points = [];\n const angleV = {};\n\n this._prevPieData = {};\n prevData.forEach((e, index) => {\n this._prevPieData[e.rowId] = [e, index];\n pieIndex[e.index] = e;\n });\n data.forEach((d, i) => {\n const angles = angle.getScaleValue(d.angle);\n if (angles) {\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const uid = d.rowId;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n radius: radiusAxis.getOuterRadius(d.radius),\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color: colorAxis.getColor(d.color),\n angle0: startAngle,\n angle: endAngle,\n startAngle,\n endAngle,\n startAngle0: startAngle,\n endAngle0: endAngle\n },\n data: d\n }, i, data, this);\n const color = resolvedEncodings.color;\n points.push({\n source: d.source,\n index: i,\n enter: {},\n update: {\n angle0: resolvedEncodings.angle0,\n angle: resolvedEncodings.angle,\n radius0: resolvedEncodings.radius0,\n radius: resolvedEncodings.radius\n },\n color,\n meta: getColorMetaInf({\n fill: color\n }),\n rowId: uid,\n _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] :\n getPreviousPoint(pieIndex, i, this)\n });\n }\n });\n return points;\n }\n\n render (container) {\n const measurement = this.measurement();\n const {\n classPrefix,\n defClassName,\n cornerRadius,\n padAngle,\n padRadius,\n transition\n } = this.config();\n const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n // This returns a function that generates the arc path based on the datum provided\n const path = this._arcFn = arc()\n .cornerRadius(cornerRadius)\n .startAngle(d => d.update.angle0 + Math.PI / 2)\n .endAngle(d => d.update.angle + Math.PI / 2)\n .padAngle(padAngle)\n .padRadius(padRadius)\n .outerRadius(d => d.update.radius)\n .innerRadius(d => d.update.radius0);\n\n this._points = this._normalizedData.map(arr => this.translatePoints(arr));\n const graphicElems = this._graphicElems = {};\n // Creating the group that holds all the arcs\n const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`)\n .classed(`${qualClassName[1]}-group`, true)\n .attr('transform', `translate(${measurement.width / 2},\n ${measurement.height / 2})`);\n const tween = (elem) => {\n makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`)\n .style('fill', d => d.color)\n .each(function (d) {\n graphicElems[d.rowId] = selectElement(this);\n })\n .transition()\n .duration(transition.duration)\n .on('end', this.registerAnimationDoneHook())\n .attrTween('d', (...params) => tweenPie(path, params))\n .attr('class', (d, i) => {\n const individualClass = getIndividualClassName(d, i, this._points, this);\n return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index}\n ${individualClass}`;\n });\n };\n const consecutiveExits = [];\n let exitCounter = 0;\n const tweenExit = (elem, d) => {\n let exitArr = consecutiveExits[exitCounter];\n const oldExitCounter = exitCounter;\n if (!exitArr) {\n exitArr = [{ elem, datum: d }];\n } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) {\n exitArr.push({ elem, datum: d });\n } else {\n exitCounter++;\n }\n consecutiveExits[oldExitCounter] = exitArr;\n };\n // Creating groups for all the arcs present individually\n makeElement(g, 'g', d => d, `${qualClassName[0]}`,\n {\n update: tween,\n exit: tweenExit\n })\n .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`);\n tweenExitPie(consecutiveExits, transition, path);\n return this;\n }\n\n getPointsFromIdentifiers (identifiers) {\n if (!this.data()) {\n return [];\n }\n const fieldNames = identifiers[0];\n const values = identifiers.slice(1, identifiers.length);\n const pieSlices = selectElement(this.mount()).selectAll('path').data();\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPies = pieSlices.filter((tData) => {\n const { source, rowId } = tData;\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n\n const pieSliceInf = filteredPies[0];\n if (pieSliceInf) {\n const measurement = this.measurement();\n const centroid = this._arcFn.centroid(pieSliceInf);\n return [{\n x: centroid[0] + measurement.width / 2,\n y: centroid[1] + measurement.height / 2,\n width: 2,\n height: 2\n }];\n }\n return [];\n }\n};\n\n","import { getObjProp, interpolator, FieldType, selectElement } from 'muze-utils';\nimport { ANGLE, RADIUS, SIZE, COLOR } from '../../enums/constants';\n\nexport const getPreviousPoint = (prevData, currIndex, context) => {\n const prevArc = prevData[currIndex - 1];\n const nextArc = prevData[currIndex];\n const [startAngle, endAngle] = context.axes().angle.range();\n if (prevArc && nextArc) {\n return {\n update: {\n angle0: getObjProp(prevArc, 'update', 'angle'),\n angle: getObjProp(nextArc, 'update', 'angle0')\n }\n };\n } else if (!nextArc) {\n return {\n update: {\n angle0: (endAngle - 90) * Math.PI * 2 / 360,\n angle: (endAngle - 90) * Math.PI * 2 / 360\n }\n };\n }\n return {\n update: {\n angle0: (startAngle - 90) * Math.PI * 2 / 360,\n angle: (startAngle - 90) * Math.PI * 2 / 360\n }\n };\n};\n\nexport const tweenPie = (path, b) => {\n const datum = b[0];\n return function (t) {\n return path(interpolator()(datum._previousInfo, datum)(t));\n };\n};\n\nexport const tweenExitPie = (consecutiveExits, transition, path) => {\n if (consecutiveExits.length > 0) {\n consecutiveExits.forEach((consecutiveExitArr) => {\n const startAngle = consecutiveExitArr[0].datum.update.angle0;\n const endAngle = consecutiveExitArr[consecutiveExitArr.length - 1].datum.update.angle;\n const mid = (Math.PI * 2 * startAngle) / ((Math.PI * 2) + startAngle - endAngle);\n\n consecutiveExitArr.forEach((e) => {\n const { elem, datum } = e;\n\n elem.each(function () {\n const gElem = selectElement(this);\n gElem.selectAll('path')\n .transition()\n .duration(transition.duration)\n .attrTween('d', () => function (t) {\n return path(interpolator()(datum, {\n update: {\n angle0: mid,\n angle: mid,\n radius: datum.radius,\n radius0: datum.radius0\n }\n })(t));\n })\n .remove();\n gElem.remove();\n });\n });\n });\n }\n};\n\nexport const getFieldIndices = (encoding, fieldsConfig) => {\n const [angleField, radiusField, colorField, sizeField] = [ANGLE, RADIUS, COLOR, SIZE]\n .map(e => encoding[e].field);\n const [angleIndex, sizeIndex, radiusIndex] = [angleField, sizeField, radiusField]\n .map((e) => {\n const conf = fieldsConfig[e];\n if (conf && conf.def.type === FieldType.MEASURE) {\n return conf.index;\n }\n return null;\n });\n const colorIndex = getObjProp(fieldsConfig, colorField, 'index');\n return {\n angleIndex,\n sizeIndex,\n radiusIndex,\n colorIndex\n };\n};\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayerMixin, BaseLayer } from '../../base-layer';\nimport { ArcLayerMixin } from './arc-mixin';\n\n/**\n * Arc Layer creates a plot with polar coordinates.\n *\n * @public\n *\n * @class\n * @module ArcLayer\n * @extends BaseLayer\n */\nexport default class ArcLayer extends mix(BaseLayer).with(BaseLayerMixin, ArcLayerMixin) {\n static formalName () {\n return 'arc';\n }\n}\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { LineLayerMixin } from './line-mixin';\nimport { LINE_LAYER } from '../../enums/constants';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport default class LineLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin) {\n static formalName () {\n return LINE_LAYER;\n }\n}\n","import {\n setAttrs,\n setStyles,\n selectElement,\n makeElement,\n getSmartComputedStyle\n} from 'muze-utils';\n\n/**\n * Draws svg text in the specified container.\n * @param {SVGElement} container Container where labels will be appended.\n * @param {Array.} data Data of the elements.\n * @return {Selection} d3 selection of the elements.\n */\nconst drawText = (container, data, config, layerInst) => {\n const selection = selectElement(container).selectAll('g').data(data);\n const { smartLabel } = layerInst._dependencies;\n const graphicElems = layerInst._graphicElems;\n\n const selectionMerge = selection.enter().append('g')\n .each(function (dataObj) {\n setAttrs(this, dataObj.enter);\n })\n .merge(selection);\n const style = getSmartComputedStyle(selectElement(container), config.className);\n const fontSize = parseInt(style.fontSize, 10);\n\n smartLabel.setStyle(style);\n selectionMerge.each(function (dataObj) {\n const element = selectElement(this);\n graphicElems[dataObj.rowId] = element;\n const { update, text, color, textanchor, style: textStyle } = dataObj;\n const background = dataObj.background;\n let backgroundVal;\n if (backgroundVal = background.value) {\n const backgroundPadding = background.padding;\n let diff;\n const { width, height } = smartLabel.getOriSize(dataObj.text);\n const backgroundEl = makeElement(element, 'rect', [1]);\n\n if (textanchor === 'end') {\n diff = width;\n } else if (textanchor === 'start') {\n diff = 0;\n } else {\n diff = width / 2;\n }\n\n setAttrs(backgroundEl.node(), {\n x: update.x - diff - backgroundPadding / 2,\n y: update.y - fontSize - backgroundPadding / 2,\n width: width + backgroundPadding,\n height: height + backgroundPadding\n });\n background && setStyles(backgroundEl, {\n background: backgroundVal\n });\n }\n const textEl = makeElement(element, 'text', d => [d]).text(text);\n const textNode = textEl.node();\n textStyle && setStyles(textNode, textStyle);\n color && setStyles(textNode, {\n fill: color\n });\n dataObj.className && textEl.classed(dataObj.className, true);\n setAttrs(textNode, update);\n textEl.attr('text-anchor', textanchor);\n textEl.attr('alignment-baseline', dataObj['alignment-baseline']);\n textEl.attr('transform', `rotate(${dataObj.rotation} ${update.x} ${update.y})`);\n });\n selection.exit().remove();\n return selection;\n};\n\nexport default drawText;\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-text',\n classPrefix: CLASSPREFIX,\n className: '',\n transform: {\n type: 'identity'\n },\n interaction: {\n highlight: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: -15\n }, data, apply).color\n }\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n }\n },\n crossline: false,\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n color: {},\n size: {},\n radius: {},\n angle: {},\n text: {\n value: '',\n formatter: (val, i, data, context) => {\n const valueParser = context.valueParser();\n return valueParser(val);\n },\n background: {\n padding: 10\n }\n },\n rotation: {\n value: 0\n },\n 'alignment-baseline': {\n value: 'middle'\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-text-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-text-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-text-selected`\n }\n }\n};\n","import {\n getQualifiedClassName,\n selectElement,\n setStyles,\n createElements\n} from 'muze-utils';\nimport drawText from './renderer';\nimport { defaultConfig } from './default-config';\nimport {\n positionPoints,\n getIndividualClassName,\n resolveEncodingValues,\n getColorMetaInf,\n toCartesianCoordinates,\n getDataFromEvent\n} from '../../helpers';\nimport { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants';\n\nimport './styles.scss';\n\nconst defaultEncoding = defaultConfig.encoding;\nconst alignmentBaseLine = defaultEncoding['alignment-baseline'].value;\nconst defRotation = defaultEncoding.rotation.value;\n\nconst pointTranslators = {\n polar: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes;\n const { formatter: textFormatter } = textEncoding;\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const angleV = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const source = d.source;\n const text = d.text;\n\n const color = colorAxis.getColor(d.color);\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n\n const angle = (startAngle + endAngle) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n angle,\n radius,\n color,\n text,\n startAngle,\n endAngle,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n angle: resolvedVal.angle,\n radius: resolvedVal.radius\n },\n text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text,\n color: resolvedVal.color,\n rotation: resolvedVal.rotation,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedVal['alignment-baseline'],\n meta: { ...{ layerId: layerInst.id() },\n ...getColorMetaInf({\n fill: resolvedVal.color\n }) },\n style: {},\n source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement());\n\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n },\n cartesian: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const colorAxis = axes.color;\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { field: textField, value, formatter: textFormatter } = textEncoding;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1;\n const xEnc = ENCODING.X;\n const yEnc = ENCODING.Y;\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const row = d.source;\n const textValue = textField ? row[textFieldIndex] : value;\n\n const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) +\n axes[type].getUnitWidth() / 2 : 0));\n\n const color = colorAxis.getColor(d.color, colorAxis);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n text: textValue,\n color,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n },\n text: textFormatter(resolvedEncodings.text, i, data, layerInst),\n color: resolvedEncodings.color,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedEncodings['alignment-baseline'],\n rotation: resolvedEncodings.rotation,\n meta: { ...{ layerId: layerInst.id() },\n ...getColorMetaInf({\n fill: resolvedEncodings.color\n }) },\n style: {},\n source: d.source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = positionPoints(layerInst, points);\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n};\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport const TextLayerMixin = superclass => class extends superclass {\n /**\n * Returns the default configuration of the text layer\n * @return {Object} Default configuration of the text layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'text';\n }\n\n elemType () {\n return 'text';\n }\n\n getPointTranslator (val) {\n return pointTranslators[val];\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {textLayer} Instance of text layer\n */\n render (container) {\n const config = this.config();\n const normalizedData = this._normalizedData;\n const className = config.className;\n const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n\n containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true);\n this._graphicElems = {};\n\n createElements({\n data: normalizedData,\n append: 'g',\n selector: 'g',\n container,\n each: (dataArr, group) => {\n const node = group.node();\n const points = this.translatePoints(dataArr, {}, this);\n setStyles(node, {\n 'text-anchor': TEXT_ANCHOR_MIDDLE\n });\n drawText(node, points, {\n className: qualifiedClassName[0]\n }, this);\n }\n });\n return this;\n }\n\n getNearestPoint (x, y, { event }) {\n if (!this.data()) {\n return null;\n }\n return this.getDataFromEvent(event);\n }\n\n getDataFromEvent (event) {\n return getDataFromEvent(this, event);\n }\n};\n\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { TextLayerMixin } from './text-mixin';\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport default class TextLayer extends mix(BaseLayer).with(BaseLayerMixin, TextLayerMixin) {\n static formalName () {\n return 'text';\n }\n}\n","/* global Element, document */\nimport {\n makeElement,\n selectElement,\n easeFns,\n objectIterator,\n getSymbol,\n setStyles\n} from 'muze-utils';\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, groupElement) {\n const { shape, size, update, style } = d;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n createShape(d, groupElement);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n if (newShape.nodeName === 'path' || newShape.nodeName === 'image') {\n shapeElement.attr('transform', `scale(${size / 100})`);\n } else {\n shapeElement.attr('height', size);\n shapeElement.attr('width', size);\n }\n shapeElement.attr('x', -size / 2);\n shapeElement.attr('y', -size / 2);\n makeElement(groupElement, () => newShape, [1]);\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = getSymbol(shape).size(size)(update);\n }\n const pathEl = makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n setStyles(pathEl, style);\n } else {\n d.shape = 'circle';\n createShape(d, groupElement);\n }\n};\n\n/**\n * Draws symbols using d3 symbol api\n * @param {Object} params Contains the svg container, points and other symbol related attributes.\n */\n/* istanbul ignore next */ const drawSymbols = (params) => {\n const { layer, container, points, transition, className } = params;\n const { duration, effect, disabled } = transition;\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const { enter } = d;\n group.attr('transform', `translate(${enter.x},${enter.y})`);\n },\n update: (group, d) => {\n createShape(d, group);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n objectIterator(style, key => group.style(key, style[key]));\n group.attr('class', className);\n group.classed(d.className, true);\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n group.attr('transform', `translate(${update.x},${update.y})`);\n },\n exit: (exitGroup) => {\n if (!disabled) {\n exitGroup.transition().ease(easeFns[effect])\n .duration(duration)\n .on('end', () => exitGroup.remove())\n .style('fill-opacity', 0)\n .style('stroke-opacity', 0);\n } else {\n exitGroup.remove();\n }\n }\n }, params.keyFn);\n};\n\nexport default drawSymbols;\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-point',\n className: '',\n classPrefix: CLASSPREFIX,\n defColorStyle: 'stroke',\n interaction: {\n highlight: {\n className: 'highlight-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n // fill: 'red'\n },\n strokePosition: 'center'\n },\n focusStroke: {\n className: 'focus-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n commonDoubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n brushStroke: {\n className: 'brush-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n // fill: 'blue'\n },\n strokePosition: 'outside'\n },\n doubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n innerPadding: 0.1,\n nearestPointThreshold: 5,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n size: {\n value: 30\n },\n color: {},\n stroke: {\n value: '#000'\n },\n 'stroke-width': {\n value: 0\n },\n fill: {},\n shape: {\n value: 'circle'\n },\n x: {},\n y: {},\n 'stroke-opacity': {\n value: 1\n },\n 'fill-opacity': {\n value: 0.5\n },\n strokePosition: {\n value: 'center'\n },\n interaction: {\n anchors: 'highlight',\n 'persistent-anchors': 'focusStroke',\n 'brush-anchors': 'brushStroke'\n }\n },\n shapes: ['circle', 'cross', 'diamond', 'square', 'star', 'wye', 'triangle'],\n sizes: [20, 30, 40, 50, 60, 70]\n};\n","import { FieldType, COORD_TYPES } from 'muze-utils';\nimport { ENCODING } from '../../enums/constants';\nimport {\n getIndividualClassName,\n resolveEncodingValues,\n getColorMetaInf,\n positionPoints\n} from '../../helpers';\n\nexport const prepareDrawingInf = ({ data, datum, i, layerInst, xPx, yPx }) => {\n const axes = layerInst.axes();\n const { shape: shapeAxis, color: colorAxis, size: sizeAxis } = axes;\n let shape = shapeAxis.getShape(datum.shape);\n let size = sizeAxis.getSize(datum.size);\n let color = colorAxis.getColor(datum.color);\n const layerEncoding = layerInst.config().encoding;\n const stroke = layerEncoding.stroke.value;\n const strokeWidth = layerEncoding['stroke-width'].value;\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color,\n stroke,\n 'stroke-width': strokeWidth,\n size,\n shape,\n data: datum\n },\n data: datum\n }, i, data, layerInst);\n const { rowId, source } = datum;\n ({ shape, size, color } = resolvedEncodings);\n const style = {\n fill: color,\n stroke: resolvedEncodings.stroke,\n 'stroke-width': resolvedEncodings['stroke-width']\n };\n const { x, y } = resolvedEncodings;\n const pos = { x, y };\n return {\n enter: pos,\n update: pos,\n shape,\n source,\n rowId,\n style,\n data: datum.dataObj,\n meta: Object.assign({\n layerId: layerInst.id()\n }, getColorMetaInf(style, {\n strokePosition: layerEncoding.strokePosition.value\n })),\n size\n };\n};\n\nexport const pointTranslators = {\n [COORD_TYPES.CARTESIAN]: (data, config, layerInst) => {\n let points = [];\n const encoding = layerInst.config().encoding;\n const axes = layerInst.axes();\n const { x, y } = encoding;\n const xField = x.field;\n const yField = y.field;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const { x: offsetX, y: offsetY } = config.offset;\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n\n let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => {\n const value = d[type] === null ? undefined : d[type];\n const measure = type === ENCODING.X ? measurement.width : measurement.height;\n return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value);\n });\n\n xPx += offsetX;\n yPx += offsetY;\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = prepareDrawingInf({\n data,\n datum: d,\n i,\n layerInst,\n xPx,\n yPx\n });\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\nexport const getStrokeWidthByPosition = (position, radius) => {\n const strokeWidthWithOffsetMap = {\n center: -radius,\n inside: -(radius * Math.PI),\n outside: +(radius * Math.PI)\n };\n return strokeWidthWithOffsetMap[position];\n};\n","import {\n Voronoi,\n Scales,\n makeElement,\n getQualifiedClassName,\n selectElement,\n appendElement,\n getSymbol,\n pointWithinCircle\n} from 'muze-utils';\nimport drawSymbols from './renderer';\nimport { defaultConfig } from './default-config';\nimport {\n attachDataToVoronoi,\n getPlotMeasurement,\n getMarkId,\n getBoundBoxes\n} from '../../helpers';\nimport './styles.scss';\nimport { pointTranslators, getStrokeWidthByPosition } from './helper';\n\nexport const PointLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of PointLayer.\n * @param {*} args\n * @memberof PointLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n this._bandScale = Scales.band();\n this._overlayPath = {};\n this.formattedUids = [];\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Returns the default configuration of the point layer\n * @return {Object} Default configuration of the point layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = super.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n static drawFn () {\n return drawSymbols;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container.\n *\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {BarLayer} Instance of bar layer\n */\n render (container) {\n let maxSize = 0;\n let seriesClassName;\n const config = this.config();\n const keys = this._transformedData.map(d => d.key);\n const { transition, className, defClassName, classPrefix } = config;\n const normalizedData = this._normalizedData;\n const containerSelection = selectElement(container);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n this._points = [];\n this._pointMap = {};\n\n containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true);\n\n this._points = this.generateDataPoints(normalizedData, keys);\n this._graphicElems = {};\n\n const schema = this.data().getSchema();\n makeElement(container, 'g', this._points, null, {\n update: (group, points) => {\n maxSize = Math.max(maxSize, ...points.map(d => d.size || 0));\n seriesClassName = `${qualifiedClassName[0]}`;\n this.constructor.drawFn()({\n layer: this,\n container: group.node(),\n points,\n interpolate: config.interpolate,\n className: seriesClassName,\n transition,\n keyFn: v => getMarkId(v.source, schema)\n });\n }\n }, data => data[0].rowId);\n this._maxSize = Math.sqrt(maxSize / Math.PI) * 2;\n this.attachDataToVoronoi(this._points);\n return this;\n }\n\n attachDataToVoronoi (points) {\n attachDataToVoronoi(this._voronoi, points);\n }\n\n generateDataPoints (normalizedData, keys) {\n const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys);\n const offsetXValues = widthMetrics.offsetValues || [];\n const offsetYValues = heightMetrics.offsetValues || [];\n return normalizedData.map((dataArr, i) => {\n const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span,\n heightMetrics.span);\n return this.translatePoints(dataArr, measurementConf);\n }).filter(d => d.length);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0) + widthSpan / 2,\n y: (offsetY || 0) + heightSpan / 2\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n /**\n * Gets the nearest point from a position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Point details\n */\n getNearestPoint (x, y) {\n const nearestPointThreshold = this.config().nearestPointThreshold;\n const distanceLimit = Math.max(this._maxSize, nearestPointThreshold);\n\n if (!this.data()) {\n return null;\n }\n\n const point = this._voronoi.find(x, y, distanceLimit);\n const dimensions = point && point.data.data.update;\n const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0;\n\n if (point) {\n const insideShape = pointWithinCircle({\n x: dimensions.x,\n y: dimensions.y,\n r: radius + nearestPointThreshold\n }, { x, y });\n if (insideShape) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: radius,\n height: radius\n }],\n layerId: this.id()\n };\n }\n }\n return null;\n }\n\n addOverlayPath (refElement, data, style, strokePosition) {\n const container = refElement.parentElement;\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n pathElement = makeElement(container, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n if (style.type === 'stroke-width') {\n const position = strokePosition;\n // get radius as per stroke position\n let radius = Math.sqrt(data.size / Math.PI);\n radius = getStrokeWidthByPosition(position, radius);\n\n const size = data.size + radius;\n if (typeof data.shape === 'string') {\n const path = getSymbol(data.shape).size(size);\n pathElement.attr('d', path);\n }\n }\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(refElement, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n }\n }\n\n getBoundBoxes () {\n return getBoundBoxes(this._points.flat());\n }\n\n applyElementStyles (elem, styles, styleObj) {\n styles.forEach((type) => {\n elem.select('path').style(type, styleObj[type]);\n });\n }\n};\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { POINT_LAYER } from '../../enums/constants';\nimport { PointLayerMixin } from './point-mixin';\n\n/**\n * This layer is used to create various symbols for each data point. This is commonly used in\n * scatterplot visualizations. The mark type of this layer is ```point```.\n *\n * @public\n *\n * @class\n * @module PointLayer\n * @extends BaseLayer\n */\nexport default class PointLayer extends mix(BaseLayer).with(PointLayerMixin) {\n static formalName () {\n return POINT_LAYER;\n }\n}\n","import { makeElement, easeFns } from 'muze-utils';\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} datum\n * @param {*} index\n * @param {*} context\n */\nconst transitionBars = (layer, elem, datum, index, context) => {\n const { transition } = context;\n const { duration, disabled, effect } = transition;\n const selection = elem;\n\n const selTransition = disabled ? selection :\n selection.transition()\n .duration(duration)\n .ease(easeFns[effect])\n .on('end', layer.registerAnimationDoneHook());\n const update = datum.update || datum;\n const updateStyle = datum.style || {};\n datum.className && selection.classed(datum.className, true);\n Object.entries(update).forEach(attr => (!isNaN(attr[1]) && selTransition.attr(attr[0], attr[1])));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n};\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} d\n */\nconst barEnterFn = (elem, d) => {\n const selection = elem;\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n};\n\n/**\n * Draws rectangles by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Bar Selection\n */\n/* istanbul ignore next */ export const drawRects = (params) => {\n const { layer, points, container, keyFn, className } = params;\n const graphicElems = layer._graphicElems;\n const updateFns = {\n enter (elem, d) {\n barEnterFn(elem, d);\n },\n update (elem, d, i) {\n graphicElems[d.rowId] = elem;\n transitionBars(layer, elem, d, i, params);\n }\n };\n\n return makeElement(container, 'g', points, null, {\n update: (group, d) => {\n makeElement(group.node(), 'rect', data => [data], null, updateFns, keyFn);\n group.attr('class', `${className}-${d.rowId}`);\n group.classed(d.className, true);\n }\n }, keyFn);\n};\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-bar',\n className: '',\n interaction: {\n highlight: {\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'center'\n },\n focusStroke: {\n className: 'focus-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n brushStroke: {\n className: 'brush-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n doubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n commonDoubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.3\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n transform: {\n type: 'stack'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n innerPadding: 0.1,\n encoding: {\n color: {},\n x: {},\n y: {},\n x0: {},\n y0: {},\n stroke: {\n value: '#000'\n },\n strokeWidth: {\n value: '0px'\n },\n strokePosition: {\n value: 'center'\n }\n }\n};\n","import { MeasureSubtype, DimensionSubtype } from 'muze-utils';\nimport { STACK } from '../../enums/constants';\nimport {\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues\n} from '../../helpers';\n\nconst positionRetriever = {\n x: (xPx, isNegativeVal, barBasePos) => (isNegativeVal ? [xPx, barBasePos] : [barBasePos, xPx]),\n y: (yPx, isNegativeVal, barBasePos) => (isNegativeVal ? [barBasePos, yPx] : [yPx, barBasePos])\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fieldInfo\n * @param {*} config\n * @param {*} data\n *\n */\nconst resolveDimByField = (type, axesInfo, config, data) => {\n const spaceType = type === 'x' ? 'width' : 'height';\n const [fieldType, axis] = [config[`${type}FieldType`], axesInfo[`${type}Axis`]];\n const {\n transformType,\n sizeEncoding,\n sizeConfig,\n measurement\n } = config;\n\n const sizeValue = sizeEncoding.value;\n let enter = 0;\n let pos;\n let space = 0;\n let enterSpace = 0;\n if (fieldType !== undefined) {\n if (config[`${type}0Field`]) {\n const minVal = data[type];\n const maxVal = data[`${type}0`];\n let min;\n let max;\n if (minVal === null || maxVal === null) {\n return {\n enterSpace: undefined,\n enter: undefined,\n pos: undefined,\n space: undefined\n };\n } else if (fieldType === MeasureSubtype.CONTINUOUS || fieldType === DimensionSubtype.TEMPORAL) {\n min = Math.min(minVal, maxVal);\n max = Math.max(minVal, maxVal);\n } else {\n min = minVal;\n max = maxVal;\n }\n const scales = type === 'x' ? [min, max] : [max, min];\n pos = axis.getScaleValue(scales[0]) + axis.getUnitWidth() / 2;\n space = Math.abs(axis.getScaleValue(scales[1]) - pos) + axis.getUnitWidth() / 2;\n\n enter = pos;\n enterSpace = 0;\n } else if (fieldType === DimensionSubtype.CATEGORICAL || fieldType === DimensionSubtype.TEMPORAL) {\n pos = axis.getScaleValue(data[type]) +\n (sizeConfig[type === 'x' ? 'barWidthOffset' : 'barHeightOffset'] || 0);\n\n space = sizeConfig[type === 'x' ? 'barWidth' : 'barHeight'];\n if (sizeValue !== undefined) {\n const diffPx = sizeValue * space;\n space -= diffPx;\n pos += diffPx / 2;\n }\n enter = pos;\n enterSpace = space;\n } else {\n const minDomVal = axis.domain()[0];\n const barBasePos = minDomVal < 0 ? axis.getScaleValue(0) : axis.getScaleValue(minDomVal);\n pos = axis.getScaleValue(data[type]);\n let endPos = axis.getScaleValue(data[`${type}0`]);\n\n enterSpace = 0;\n const isNegativeVal = data[type] < 0;\n if (transformType !== STACK) {\n [pos, endPos] = positionRetriever[type](pos, isNegativeVal, barBasePos);\n }\n space = Math.abs(pos - endPos);\n enter = barBasePos;\n }\n } else {\n pos = 0;\n space = measurement[spaceType];\n }\n\n return {\n enterSpace,\n enter,\n pos,\n space\n };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} config\n * @param {*} axes\n *\n */\nconst resolveDimensions = (data, config, axes) => {\n const axesInfo = {\n xAxis: axes.x,\n yAxis: axes.y\n };\n const {\n enterSpace: enterWidth,\n enter: enterX,\n pos: xPos,\n space: width\n } = resolveDimByField('x', axesInfo, config, data);\n\n const {\n enterSpace: enterHeight,\n enter: enterY,\n pos: yPos,\n space: height\n } = resolveDimByField('y', axesInfo, config, data);\n return {\n enter: {\n x: enterX,\n y: enterY,\n width: enterWidth,\n height: enterHeight\n },\n update: {\n x: xPos,\n y: yPos,\n width,\n height\n }\n };\n};\n\nexport const strokeWidthPositionMap = ({ width, position }) => {\n const offset = width / 2;\n const strokeWidthWithOffsetMap = {\n center: {\n M: { x: 0, y: 0 },\n L1: { x: 0, y: 0 },\n L2: { x: 0, y: 0 },\n L3: { x: 0, y: 0 }\n },\n inside: {\n M: { x: +offset, y: +offset },\n L1: { x: -offset, y: +offset },\n L2: { x: -offset, y: -offset },\n L3: { x: +offset, y: -offset }\n },\n outside: {\n M: { x: -offset, y: -offset },\n L1: { x: +offset, y: -offset },\n L2: { x: +offset, y: +offset },\n L3: { x: -offset, y: +offset }\n }\n };\n return strokeWidthWithOffsetMap[position];\n};\n\n/**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\nexport const getTranslatedPoints = (context, data, sizeConfig) => {\n let points = [];\n const encoding = context.config().encoding;\n const axes = context.axes();\n const colorAxis = axes.color;\n const sizeEncoding = encoding.size || {};\n const {\n x0Field,\n y0Field,\n xFieldSubType,\n yFieldSubType\n } = context.encodingFieldsInf();\n const measurement = context.measurement();\n const isXDim = xFieldSubType === DimensionSubtype.CATEGORICAL || xFieldSubType === DimensionSubtype.TEMPORAL;\n const isYDim = yFieldSubType === DimensionSubtype.CATEGORICAL || yFieldSubType === DimensionSubtype.TEMPORAL;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const transformType = context.transformType();\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const dimensions = resolveDimensions(d, {\n xFieldType: xFieldSubType,\n yFieldType: yFieldSubType,\n x0Field,\n y0Field,\n transformType,\n measurement,\n sizeConfig,\n sizeEncoding\n }, axes);\n\n let color = colorAxis.getColor(d.color);\n\n const update = dimensions.update;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: update.x,\n y: update.y,\n width: update.width,\n height: update.height,\n color\n },\n data: d\n }, i, data, context);\n // const layerEncoding = layerInst.config().encoding;\n\n color = resolvedEncodings.color;\n const { x, y, width, height } = resolvedEncodings;\n const style = {\n fill: color,\n stroke: encoding.stroke.value,\n 'stroke-width': encoding.strokeWidth.value\n };\n const conf = {\n strokePosition: encoding.strokePosition.value\n };\n\n if (!isNaN(x) && !isNaN(y) && d.rowId !== undefined) {\n let point = null;\n point = {\n enter: dimensions.enter,\n update: {\n x,\n y,\n width,\n height\n },\n source: d.source,\n rowId: d.rowId,\n data: d.dataObj,\n style,\n meta: Object.assign({\n layerId: context.id()\n }, getColorMetaInf(style, conf))\n };\n point.className = getIndividualClassName(d, i, data, context);\n points.push(point);\n // Store each point in a hashmap with key as the dimensional or temporal field value\n context.cachePoint(d[key], point);\n }\n }\n\n points = positionPoints(context, points);\n return points;\n};\n","import {\n getQualifiedClassName,\n selectElement,\n createElements,\n clipElement,\n FieldType,\n Scales,\n getObjProp,\n makeElement,\n appendElement\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawRects } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { getPlotMeasurement, getValidTransformForAggFn, getDataFromEvent } from '../../helpers';\nimport './styles.scss';\nimport { getTranslatedPoints, strokeWidthPositionMap } from './bar-helper';\n\nconst { MEASURE } = FieldType;\n\nexport const BarLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of bar layer\n */\n constructor (...params) {\n super(...params);\n this._bandScale = Scales.band();\n this._plotPadding = {\n x: 0,\n y: 0\n };\n this._plotSpan = {\n x: 0,\n y: 0\n };\n this._pointMap = {};\n this._overlayPath = {};\n }\n\n elemType () {\n return 'rect';\n }\n\n /**\n * Returns the default configuration of the bar layer\n * @return {Object} Default configuration of the bar layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const colorField = encoding.color.field;\n const transform = config.transform;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n calculateDomainFromData (data, encodingFieldInf, fieldsConfig) {\n const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig);\n ['x', 'y'].forEach((d) => {\n if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) {\n if (encodingFieldInf[`${d}0Field`]) {\n domain[d] = domain[d].sort((a, b) => a - b);\n } else {\n domain[d][0] = Math.min(domain[d][0], 0);\n domain[d][1] = Math.max(0, domain[d][1]);\n }\n }\n });\n return domain;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\n translatePoints (data, sizeConfig) {\n return getTranslatedPoints(this, data, sizeConfig);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGGroup} container SVGGroup where plot will be rendered.\n * @return {BarLayer} Instance of bar layer.\n */\n render (container) {\n const config = this.config();\n const transition = config.transition;\n const normalizedDataArr = this._normalizedData;\n const transformedData = this._transformedData;\n const keys = transformedData.map(d => d.key);\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const height = axes.y && axes.y.scale().range()[0];\n const width = axes.x && axes.x.scale().range()[1];\n const defClassName = config.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const className = config.className;\n const containerSelection = selectElement(container);\n const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION)\n .map(e => e.index);\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n clipElement(container, {\n x: 0,\n y: 0,\n width,\n height\n }, `id-${this.id()}`);\n\n this._points = this.generateDataPoints(normalizedDataArr, keys);\n this._graphicElems = {};\n const paths = Object.keys(this._overlayPath);\n paths.forEach(path => this._overlayPath[path].remove());\n this._overlayPath = {};\n\n const barContainer = makeElement(containerSelection, 'g', [1], 'muze-layer-bars', {}, null);\n makeElement(containerSelection, 'g', [1], 'muze-overlay-paths', {}, null);\n createElements({\n data: this._points,\n container: barContainer.node(),\n selector: 'g',\n append: 'g',\n each: (points, group, i) => {\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n group.style('display', 'block');\n drawRects({\n layer: this,\n container: group.node(),\n points,\n className: seriesClassName,\n transition,\n style: {},\n keyFn: d => dimensions.map(key => d.source[key]).join('-')\n });\n }\n });\n\n return this;\n }\n\n generateDataPoints (normalizedData, keys) {\n const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys);\n const barWidthOffsets = barWidthMetrics.offsetValues || [];\n const barHeightOffsets = barHeightMetrics.offsetValues || [];\n this._plotSpan = {\n x: barWidthMetrics.groupSpan || 0,\n y: barHeightMetrics.groupSpan || 0\n };\n this._plotPadding = {\n x: barWidthMetrics.padding || 0,\n y: barHeightMetrics.padding || 0\n };\n\n this._pointMap = {};\n return normalizedData.map((data, i) => this.translatePoints(data,\n {\n barWidth: barWidthMetrics.span,\n barWidthOffset: barWidthOffsets[i] || 0,\n barHeight: barHeightMetrics.span,\n barHeightOffset: barHeightOffsets[i] || 0\n }));\n }\n\n getPlotPadding () {\n return this._plotPadding;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Gets the nearest point of the position passed.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point.\n */\n getNearestPoint (x, y, { event }) {\n if (!this.data()) {\n return null;\n }\n return this.getDataFromEvent(event);\n }\n\n getDataFromEvent (event) {\n return getDataFromEvent(this, event);\n }\n\n getPlotSpan () {\n return this._plotSpan;\n }\n\n hasPlotSpan () {\n return true;\n }\n\n addOverlayPath (refElement, data, style, strokePosition, mountPoint) {\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n const pathGroup = makeElement(mountPoint, 'g', [1], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement = makeElement(pathGroup, 'path', [data], null, {}, d => `${d.update.x} ${data.rowId}`);\n\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n if (style.type === 'stroke-width') {\n const { L1, L2, L3, M } = strokeWidthPositionMap({\n width: parseInt(style.value, 10),\n position: strokePosition\n });\n\n pathElement.attr('d', d => `M ${d.update.x + M.x} ${d.update.y + M.y}\n L ${d.update.x + d.update.width + L1.x} ${d.update.y + L1.y}\n L ${d.update.x + d.update.width + L2.x} ${d.update.y + d.update.height + L2.y}\n L${d.update.x + L3.x} ${d.update.y + d.update.height + L3.y} Z`);\n }\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(mountPoint, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n\n // Apply the path shape get the correct path position\n currentPath.attr('d', d => `M ${d.update.x} ${d.update.y}\n L ${d.update.x + d.update.width} ${d.update.y}\n L ${d.update.x + d.update.width} ${d.update.y + d.update.height}\n L${d.update.x} ${d.update.y + d.update.height} Z`);\n }\n }\n\n getBoundBoxes () {\n const points = this._points.flat();\n\n return points.map((point) => {\n const { x, y, width, height } = point.update;\n const data = point.data;\n return {\n minX: x,\n maxX: x + width,\n minY: y,\n maxY: y + height,\n data\n };\n });\n }\n};\n\n","import { mix } from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { BAR_LAYER } from '../../enums/constants';\nimport { BarLayerMixin } from './bar-mixin';\nimport { BaseLayerMixin } from '../../base-layer/base-mixin';\nimport './styles.scss';\n\n/**\n * Bar layer creates rectangle marks. The mark type of this layer is ```bar```. This layer can be used\n * to create stacked or grouped bars, range bars, heatmap plots and also reference bands by using\n * the encoding properties.\n *\n * @public\n *\n * @class\n * @module BarLayer\n * @extends BaseLayer\n */\nexport default class BarLayer extends mix(BaseLayer).with(BaseLayerMixin, BarLayerMixin) {\n static formalName () {\n return BAR_LAYER;\n }\n}\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-tick',\n className: '',\n classPrefix: CLASSPREFIX,\n nearestPointThreshold: 10,\n interaction: {\n fade: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n }\n },\n innerPadding: 0.1,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n interpolate: 'linear',\n encoding: {\n color: { },\n x: {},\n y: {},\n x0: {},\n y0: {},\n radius: {},\n radius0: {},\n angle: {},\n angle0: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-tick-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-tick-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-tick-selected`\n }\n }\n};\n\n","import {\n selectElement,\n Symbols,\n pathInterpolators,\n makeElement\n} from 'muze-utils';\n\nconst line = Symbols.line;\n\n/**\n * Draws ticks by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Ticks Selection\n */\nexport default /* istanbul ignore next */ (params) => {\n const { points, container, keyFn, className, interpolate, layer, transition } = params;\n const { disabled } = transition;\n\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && group.attr(attr[0], attr[1])));\n },\n update: (group, d) => {\n const pathElem = makeElement(group, 'path', [1]);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n group.attr('class', className);\n group.classed(d.className, true);\n\n const x0 = update.x0 !== undefined ? update.x0 : update.x;\n const y0 = update.y0 !== undefined ? update.y0 : update.y;\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(e => e[0])\n .y(e => e[1]);\n\n d.className && group.classed(d.className, true);\n pathElem.attr('d', linepath([[update.x, update.y], [x0, y0]]));\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n Object.entries(style).forEach(styleObj => group.style(styleObj[0], styleObj[1]));\n },\n exit: (exitGroup) => {\n exitGroup.remove();\n }\n }, keyFn);\n};\n","import { FieldType, makeElement, appendElement } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport drawTicks from './renderer';\nimport './styles.scss';\nimport { positionPoints, getIndividualClassName,\n getColorMetaInf, resolveEncodingValues, toCartesianCoordinates, attachDataToVoronoi } from '../../helpers';\nimport { strokeWidthPositionMap } from './helper';\n\nconst pointTranslators = {\n polar: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes;\n const measurement = layerInst.measurement();\n\n const colorAxis = axes.color;\n const angleV = {};\n const angle0V = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const color = colorAxis.getColor(d.color);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const angles0 = angle0Axis.getScaleValue(d.angle0);\n !angle0V[d.angle0] && (angle0V[d.angle0] = 0);\n const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++];\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angle = (startAngle + endAngle) / 2;\n const angle0 = (startAngle0 + endAngle0) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n radius,\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color,\n angle,\n angle0,\n startAngle,\n endAngle,\n startAngle0,\n endAngle0\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedVal.color\n };\n\n const point = {\n enter: {},\n update: {\n radius: resolvedVal.radius,\n radius0: resolvedVal.radius0,\n angle: resolvedVal.angle,\n angle0: resolvedVal.angle0\n },\n style,\n source: d.source,\n rowId: d.rowId,\n data: d,\n meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) }\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true);\n return points;\n },\n cartesian: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { x: xAxis, y: yAxis } = axes;\n const {\n xField,\n yField,\n x0Field,\n y0Field,\n xFieldType,\n yFieldType\n } = layerInst.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const { x: xSpan, y: ySpan } = config.span;\n for (let i = 0, len = data.length; i < len; i++) {\n let xPx;\n let x0Px;\n let y0Px;\n let yPx;\n const d = data[i];\n const row = d.source;\n if (xField) {\n xPx = xAxis.getScaleValue(d.x) + offsetX;\n x0Px = xPx + xSpan;\n }\n\n if (yField) {\n yPx = yAxis.getScaleValue(d.y) + offsetY;\n y0Px = yPx !== null ? yPx + ySpan : null;\n }\n\n if (!xField) {\n xPx = 0;\n x0Px = measurement.width;\n if (!isNaN(yPx)) {\n yPx += ySpan / 2;\n y0Px = yPx;\n }\n }\n\n if (!yField) {\n yPx = 0;\n y0Px = measurement.height;\n x0Px = xPx += xSpan / 2;\n }\n\n if (x0Field) {\n x0Px = xAxis.getScaleValue(d.x0) + xSpan;\n yPx += ySpan / 2;\n y0Px -= ySpan / 2;\n }\n\n if (y0Field) {\n y0Px = yAxis.getScaleValue(d.y0) + ySpan;\n xPx += xSpan / 2;\n x0Px -= xSpan / 2;\n }\n const color = colorAxis.getColor(d.color);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n x0: x0Px,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedEncodings.color\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y,\n x0: resolvedEncodings.x0,\n y0: resolvedEncodings.y0\n },\n style,\n source: row,\n rowId: d.rowId,\n data: d.dataObj,\n meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) }\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport const TickLayerMixin = superclass => class extends superclass {\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'tick';\n }\n\n static drawFn () {\n return drawTicks;\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n attachDataToVoronoi (points) {\n attachDataToVoronoi(this._voronoi, points, (d) => {\n const { x, x0, y, y0 } = d.update;\n\n return {\n x: x + (x0 - x) / 2,\n y: y + (y0 - y) / 2\n };\n });\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0),\n y: (offsetY || 0)\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n addOverlayPath (refElement, data, style, strokePosition) {\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n pathElement = makeElement(refElement, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n let offsetM = { x: 0, y: 0 };\n let offsetL = { x: 0, y: 0 };\n\n if (style.type === 'stroke-width') {\n const { L, M } = strokeWidthPositionMap({\n width: parseInt(style.value, 10),\n position: strokePosition\n });\n offsetM = M;\n offsetL = L;\n }\n\n pathElement.attr('d', (d) => {\n if (d.update) {\n return `M ${d.update.x + offsetM.x} ${d.update.y + offsetM.y}\n L ${d.update.x0 + offsetL.x} ${d.update.y0 + offsetL.y}`;\n }\n return `M ${d.x + offsetM.x} ${d.y + offsetM.y}\n L ${d.x0 + offsetL.x} ${d.y0 + offsetL.y}`;\n });\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(refElement, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n }\n }\n};\n","export const strokeWidthPositionMap = ({ width, position = 'center' }) => {\n const offset = width ? width / 2 : 1;\n const strokeWidthWithOffsetMap = {\n center: {\n M: { x: 0, y: 0 },\n L: { x: 0, y: 0 }\n },\n inside: {\n M: { x: +offset, y: +offset },\n L: { x: -offset, y: +offset }\n },\n outside: {\n M: { x: -offset, y: -offset },\n L: { x: +offset, y: -offset }\n }\n };\n return strokeWidthWithOffsetMap[position];\n};\n","import { mix } from 'muze-utils';\nimport { PointLayerMixin } from '../point';\nimport { BaseLayerMixin, BaseLayer } from '../../base-layer';\nimport { TickLayerMixin } from './tick-mixin';\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport default class TickLayer extends mix(BaseLayer).with(BaseLayerMixin, PointLayerMixin, TickLayerMixin) {\n static formalName () {\n return 'tick';\n }\n}\n","export const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { isSimpleObject, mergeRecursive, getObjProp } from 'muze-utils';\n\nconst parseLayerDefinition = (sink, definition, layerDef, layerType) => {\n for (const key in definition) {\n if (Object.hasOwnProperty.call(definition, key)) {\n let strs;\n let propValue;\n const def = definition[key];\n if (isSimpleObject(def)) {\n sink[key] = {};\n parseLayerDefinition(sink[key], def, layerDef, layerType);\n } else if (typeof def === 'string' && (strs = def.split('.')) && strs[0] === layerType) {\n propValue = getObjProp(layerDef, ...strs.slice(1, strs.length));\n if (propValue !== undefined) {\n sink[key] = propValue;\n }\n } else {\n sink[key] = def;\n }\n }\n }\n};\n\nconst sanitizeEncoding = (encoding) => {\n // Create object for each encoding value if encoding value is a string\n for (const key in encoding) {\n if (typeof encoding[key] === 'string') {\n encoding[key] = {\n field: encoding[key]\n };\n }\n }\n};\n\n/**\n * Layer Factory creates layers based on the layer type. All types of layers needs to register in\n * the layer factory. For getting a layer instance, getLayer method needs to invoked with the\n * layerType and other arguments. It also registers the definition of composite layers.\n *\n * @public\n *\n * @module LayerFactory\n */\nconst layerFactory = (() => {\n const compositeLayers = {};\n const factoryObj = {\n setLayerRegistry: (reg) => {\n factoryObj._layerRegistry = reg;\n },\n getSerializedConf: (mark, layerDef) => {\n let serializedDefs;\n const defs = compositeLayers[mark];\n const newConf = mergeRecursive({}, layerDef);\n\n // If it is a composite layer then resolve all the definitions of each unit layer\n if (defs) {\n serializedDefs = defs.map((unitLayerDef) => {\n const sDef = {};\n parseLayerDefinition(sDef, unitLayerDef, newConf, mark);\n sanitizeEncoding(sDef.encoding);\n return sDef;\n });\n } else {\n const encoding = newConf.encoding;\n // Create object for each encoding value if encoding value is a string\n sanitizeEncoding(encoding);\n serializedDefs = newConf;\n }\n\n return serializedDefs;\n },\n getLayerInstance: (layerDef, ...params) => {\n const layerRegistry = factoryObj._layerRegistry;\n layerDef = !(layerDef instanceof Array) ? [layerDef] : layerDef;\n const instances = layerDef.map((layerObj) => {\n const layerConstructor = layerRegistry[layerObj.mark];\n return layerConstructor.create(...params);\n });\n return instances.length === 1 ? instances[0] : instances;\n },\n getLayerClass: mark => factoryObj._layerRegistry[mark],\n /**\n * Registers a new composite layer definition in the layer factory.\n *\n * @public\n *\n * @param {string} layerType Mark type of the new composite layer.\n * @param {Array} layerDefs Layer definitions of the composite layer.\n */\n composeLayers: (layerType, layerDefs) => {\n compositeLayers[layerType] = layerDefs;\n },\n sanitizeLayerConfig: (layerDef) => {\n const newConf = mergeRecursive({}, layerDef);\n sanitizeEncoding(newConf.encoding);\n return newConf;\n }\n };\n return factoryObj;\n})();\n\nexport default layerFactory;\n","import layerFactory from './layer-factory';\n\nexport default layerFactory;\n","import { AreaLayer } from './layers/area';\nimport { ArcLayer } from './layers/arc';\nimport { LineLayer } from './layers/line';\nimport { TextLayer } from './layers/text';\nimport { PointLayer } from './layers/point';\nimport { BarLayer } from './layers/bar';\nimport { BaseLayer } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport { TickLayer } from './layers/tick';\n\nexport const DEFAULT_LAYERS = {\n [LAYER_TYPES.AREA_LAYER]: AreaLayer,\n [LAYER_TYPES.ARC_LAYER]: ArcLayer,\n [LAYER_TYPES.LINE_LAYER]: LineLayer,\n [LAYER_TYPES.TEXT_LAYER]: TextLayer,\n [LAYER_TYPES.POINT_LAYER]: PointLayer,\n [LAYER_TYPES.TICK_LAYER]: TickLayer,\n [LAYER_TYPES.BAR_LAYER]: BarLayer,\n [LAYER_TYPES.BASE_LAYER]: BaseLayer\n};\n","import { DEFAULT_LAYERS } from './defaults';\n\nexport default (layers = DEFAULT_LAYERS) => {\n const reg = Object.assign({}, layers);\n const regObj = {\n register: (def) => {\n const key = def.formalName();\n\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n return regObj;\n};\n","import { AreaLayer, AreaLayerMixin } from './layers/area';\nimport { ArcLayer, ArcLayerMixin } from './layers/arc';\nimport { LineLayer, LineLayerMixin } from './layers/line';\nimport { TextLayer, TextLayerMixin } from './layers/text';\nimport { PointLayer, PointLayerMixin } from './layers/point';\nimport { BarLayer, BarLayerMixin } from './layers/bar';\nimport { TickLayer, TickLayerMixin } from './layers/tick';\nimport { SimpleLayer } from './simple-layer';\nimport { BaseLayer, BaseLayerMixin } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport layerFactory from './layer-factory';\nimport layerRegistry from './layer-registry';\nimport { ENCODING } from './enums/constants';\nimport * as pointLayerHelpers from './layers/point/helper';\nimport * as commonHelpers from './helpers';\nimport * as enums from './enums';\n\nconst helpers = Object.assign(commonHelpers, {\n pointLayerHelpers\n});\n\nconst layerMixins = {\n BarLayerMixin,\n BaseLayerMixin,\n LineLayerMixin,\n AreaLayerMixin,\n PointLayerMixin,\n TextLayerMixin,\n TickLayerMixin,\n ArcLayerMixin\n};\n\nexport {\n BaseLayer,\n BarLayer,\n LineLayer,\n AreaLayer,\n PointLayer,\n ArcLayer,\n TextLayer,\n TickLayer,\n layerFactory,\n SimpleLayer,\n layerRegistry,\n LAYER_TYPES,\n ENCODING,\n helpers,\n enums,\n layerMixins\n};\n","import {\n FieldType,\n getDependencyOrder,\n getObjProp,\n defaultValue,\n objectIterator,\n unionDomain,\n makeElement,\n DimensionSubtype,\n toArray,\n MeasureSubtype,\n getNearestValue,\n RTree\n} from 'muze-utils';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\n\nexport const getDimensionMeasureMap = (layers, fieldsConfig) => {\n const retinalEncodingsAndMeasures = {};\n\n layers.forEach((layer) => {\n const {\n colorField,\n sizeField,\n shapeField,\n xField,\n yField\n } = layer.encodingFieldsInf();\n const measures = [xField, yField].filter(field => fieldsConfig[field] && fieldsConfig[field].def.type ===\n FieldType.MEASURE);\n [colorField, sizeField, shapeField].forEach((field) => {\n if (getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION && measures.length) {\n !retinalEncodingsAndMeasures[field] && (retinalEncodingsAndMeasures[field] = []);\n retinalEncodingsAndMeasures[field].push(...measures);\n }\n });\n });\n\n for (const key in retinalEncodingsAndMeasures) {\n if ({}.hasOwnProperty.call(retinalEncodingsAndMeasures, key)) {\n retinalEncodingsAndMeasures[key] = [...new Set(retinalEncodingsAndMeasures[key])];\n }\n }\n return retinalEncodingsAndMeasures;\n};\n\nexport const transformDataModels = (transform, dataModel) => {\n const dataModels = {};\n for (const key in transform) {\n if ({}.hasOwnProperty.call(transform, key)) {\n const transformVal = transform[key];\n dataModels[key] = transformVal(dataModel);\n }\n }\n\n return dataModels;\n};\n\nexport const getLayerFromDef = (context, definition, existingLayer, namespaces) => {\n let instances = existingLayer;\n const dependencies = context._dependencies;\n const metaInf = context.metaInf();\n if (!existingLayer) {\n instances = layerFactory.getLayerInstance(definition);\n toArray(instances).forEach((inst, i) => {\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: namespaces[i],\n parentNamespace: metaInf.namespace\n })\n .dependencies(dependencies)\n .store(context.store());\n });\n }\n const layers = {};\n const instanceArr = toArray(instances);\n definition = toArray(definition);\n definition.reduce((acc, def, idx) => {\n const instance = instanceArr[idx];\n instance.coord(context.coord());\n instance.config(def);\n instance.valueParser(context.valueParser());\n instance.dataProps({\n timeDiffs: context._timeDiffs\n });\n if (def.name) {\n instance.alias(def.name);\n }\n layers[instance.alias()] = instance;\n return acc;\n }, {});\n return layers;\n};\n\nexport const resolveEncodingTransform = (layerInst, store) => {\n const encodingTransform = layerInst.config().encodingTransform || {};\n const resolvable = encodingTransform.resolvable;\n let depArr = [];\n if (resolvable) {\n const resolved = resolvable(store);\n depArr = resolved.depArr;\n layerInst.encodingTransform(resolved.fn);\n } else if (encodingTransform instanceof Function) {\n layerInst.encodingTransform(encodingTransform);\n }\n return depArr;\n};\n\nexport const sanitizeLayerDef = (layerDefs) => {\n const sanitizedDefs = [];\n layerDefs.forEach((layerDef, i) => {\n const def = layerDef.def;\n const mark = layerDef.mark;\n if (!def) {\n const sConf = layerFactory.getSerializedConf(layerDef.mark, layerDef);\n if (!sConf.name) {\n sConf.name = `${mark}-${i}`;\n }\n sanitizedDefs.push({\n mark: layerDef.mark,\n def: sConf\n });\n } else {\n if (!def.name) {\n def.name = `${mark}-${i}`;\n }\n sanitizedDefs.push(layerDef);\n }\n });\n return sanitizedDefs;\n};\n\nexport const attachDataToLayers = (layers, dm, transformedDataModels) => {\n layers.forEach((layer) => {\n const dataSource = layer.config().source;\n const dataModel = dataSource instanceof Function ? dataSource(dm) :\n (transformedDataModels[dataSource] || dm);\n layer.data(dataModel);\n });\n};\n\nexport const attachAxisToLayers = (axes, layers, layerAxisIndex) => {\n layers.forEach((layer) => {\n const layerId = layer.id();\n const axesObj = {};\n\n objectIterator(axes, (key) => {\n const axisInf = layerAxisIndex[layerId];\n if (axisInf) {\n const axisArr = axes[key] || [];\n const axisIndex = axisInf[key] >= 0 ? axisInf[key] : axisArr.length - 1;\n axes[key] && (axesObj[key] = defaultValue(axes[key][axisIndex]));\n }\n });\n Object.keys(axesObj).length && layer.axes(axesObj);\n });\n};\n\nconst { X, Y, RADIUS, ANGLE, ANGLE0, RADIUS0 } = ENCODING;\n\nexport const getLayerAxisIndex = (layers, fields) => {\n const layerAxisIndex = {};\n layers.forEach((layer) => {\n const { axis, encoding } = layer.config();\n const id = layer.id();\n [X, Y, ANGLE, ANGLE0, RADIUS].forEach((type) => {\n let index;\n const specificField = getObjProp(encoding, type, 'field');\n const encodingField = type === RADIUS ? defaultValue(specificField, getObjProp(encoding, RADIUS0, 'field'))\n : getObjProp(encoding, type, 'field');\n const field = defaultValue(getObjProp(axis, type), encodingField);\n if (fields[type] && fields[type].length) {\n index = fields[type].findIndex(fieldInst => fieldInst.getMembers().indexOf(field) !== -1);\n } else {\n index = 0;\n }\n !layerAxisIndex[id] && (layerAxisIndex[id] = {});\n layerAxisIndex[id][type] = index;\n });\n });\n return layerAxisIndex;\n};\n\nconst getValidDomain = (domain, domain1, encodingType, fieldType) => {\n if (encodingType === ANGLE || encodingType === ANGLE0) {\n return domain.concat(domain1.filter(d => domain.indexOf(d) === -1));\n }\n return unionDomain([domain, domain1], fieldType);\n};\n\nexport const unionDomainFromLayers = (layers, axisFields, layerAxisIndex, fieldsConfig) => {\n let domains = {};\n layers = layers.filter(layer => layer.getDataDomain() !== null);\n layers.forEach((layer) => {\n let domainValues = {};\n const config = layer.config();\n // const encoding = config.encoding;\n const layerDomain = layer.getDataDomain();\n const layerId = layer.id();\n\n if (layerDomain !== null && config.calculateDomain !== false) {\n domainValues = Object.entries(layerDomain);\n domains = domainValues.reduce((fieldDomain, domain) => {\n const encodingType = domain[0];\n const axisIndex = layerAxisIndex[layerId][encodingType];\n const field = getObjProp(axisFields, encodingType, axisIndex);\n !fieldDomain[encodingType] && (fieldDomain[encodingType] = {});\n const encodingDomain = fieldDomain[encodingType];\n if (field) {\n const fieldStr = `${field}`;\n encodingDomain[fieldStr] = encodingDomain[fieldStr] || [];\n encodingDomain[fieldStr] = getValidDomain(encodingDomain[fieldStr],\n domain[1], encodingType, fieldsConfig[field.getMembers()[0]].def.subtype);\n }\n return fieldDomain;\n }, domains);\n }\n });\n return domains;\n};\n\nexport const renderLayers = (context, container, layers, measurement) => {\n context._lifeCycleManager.notify({ client: layers, action: 'beforedraw', formalName: 'layer' });\n const config = context.config();\n const classPrefix = config.classPrefix;\n const orderedLayers = layers.sort((a, b) => a.config().order - b.config().order);\n const layerParentGroup = makeElement(container, 'g', [1], `${classPrefix}-layer-group`);\n const layerDepOrder = getDependencyOrder(context._layerDepOrder);\n const groups = {};\n makeElement(layerParentGroup, 'g', orderedLayers, null, {\n update: (group, layer) => {\n groups[layer.alias()] = {\n group,\n layer\n };\n }\n });\n\n const layerSeq = layerDepOrder.map(name => groups[name]).filter(d => d !== undefined);\n layerSeq.forEach((o) => {\n const layer = o.layer;\n const group = o.group;\n layer.measurement(measurement);\n layer.dataProps({\n timeDiffs: context._timeDiffs\n });\n layer.config().render !== false && layer.mount(group.node());\n });\n return this;\n};\n\nexport const getNearestDimensionalValue = (context, position) => {\n const fields = context.fields();\n if (!fields.x.length || !fields.y.length) {\n return null;\n }\n const data = context.data();\n const axes = context.axes();\n const fieldsConfig = data.getFieldsConfig();\n const xField = getObjProp(fields, 'x', 0).getMembers()[0];\n const yField = getObjProp(fields, 'y', 0).getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n\n const entryVal = [['x', xFieldType, xField], ['y', yFieldType, yField]].find(entry =>\n entry[1] === DimensionSubtype.CATEGORICAL || entry[1] === DimensionSubtype.TEMPORAL);\n\n if (!entryVal || (xFieldType !== MeasureSubtype.CONTINUOUS && yFieldType !== MeasureSubtype.CONTINUOUS)) {\n return null;\n }\n const field = entryVal[2];\n const index = fieldsConfig[field].index;\n let key = axes[entryVal[0]][0].invert(position[entryVal[0]]);\n if (entryVal[1] === DimensionSubtype.TEMPORAL) {\n const filterData = [...new Set(data.getData().data.map(d => d[index]))];\n key = getNearestValue(filterData, key);\n }\n\n return key !== undefined ? [[field], [key]] : null;\n};\n\nexport const getLayersBy = (layers, searchBy, value) => layers.filter((layer) => {\n const name = searchBy === 'type' ? layer.constructor.formalName() : layer.alias();\n return name === value;\n});\n\nexport const removeLayersBy = (layers, searchBy, value) => {\n layers.filter((inst) => {\n const name = searchBy === 'type' ? inst.config().mark : inst.alias();\n if (name === value) {\n inst.remove();\n return false;\n }\n return true;\n });\n};\n\nexport const createSideEffectGroup = (container, className) => makeElement(container, 'g', [1], className).node();\n\nexport const createRenderPromise = (unit) => {\n const renderedPromise = unit._renderedPromise;\n renderedPromise.then(() => {\n unit._renderedPromise = new Promise((resolve) => {\n unit._renderedResolve = resolve;\n });\n createRenderPromise(unit);\n });\n};\n\nexport const getRadiusRange = (width, height, config = {}) => {\n const {\n innerRadius,\n outerRadius\n } = config;\n\n return [innerRadius || 0, outerRadius || Math.min(height,\n width) / 2];\n};\n\nexport const setAxisRange = (context) => {\n const axes = context.axes();\n const { radius: radiusAxes } = axes;\n if (radiusAxes) {\n radiusAxes.forEach((axis) => {\n axis.range(getRadiusRange(context.width(), context.height()));\n });\n }\n};\n\nexport const isXandYMeasures = (context) => {\n const { x: xFields, y: yFields } = context.fields();\n const [xMeasures, yMeasures] = [xFields, yFields].map(fields => fields\n .every(field => field.type() === FieldType.MEASURE));\n return xMeasures && yMeasures;\n};\n\nconst getKey = (arr, row) => {\n let key = row[arr[0]];\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${row[arr[i]]}`;\n }\n return key;\n};\n\nexport const getValuesMap = (model, context) => {\n const idValuesMap = {};\n const valuesIdMap = {};\n const { data: dataArr, schema, uids } = model.getData();\n const fieldsConfig = model.getFieldsConfig();\n const fieldIndices = isXandYMeasures(context) ? schema.map((d, i) => i) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldsConfig[d].index);\n dataArr.forEach((row, i) => {\n const key = getKey(fieldIndices, row);\n valuesIdMap[key] = uids[i];\n idValuesMap[uids[i]] = row;\n });\n return { valuesIdMap, idValuesMap, fieldsConfig };\n};\n\nexport const getSelectionRejectionModel = (model, propModel, measures, propValuesMap) => {\n let rejectionModel;\n const { data, schema } = propModel.getData();\n const entryRowIds = [];\n const exitRowIds = [];\n\n if (schema.length) {\n const fieldMap = model.getFieldsConfig();\n const { valuesIdMap } = propValuesMap;\n\n const rowIdsObj = {};\n const filteredSchema = measures ? schema.map((d, idx) => idx) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldMap[d].index);\n data.forEach((row) => {\n const key = getKey(filteredSchema, row);\n const id = valuesIdMap[key];\n if (key in valuesIdMap) {\n entryRowIds.push(id);\n rowIdsObj[id] = 1;\n }\n });\n rejectionModel = model.select((fields, i) => {\n if (!rowIdsObj[i]) {\n exitRowIds.push(i);\n return true;\n }\n return false;\n }, {\n saveChild: false\n });\n } else {\n rejectionModel = propModel;\n }\n\n return {\n model: [propModel, rejectionModel],\n entryRowIds,\n exitRowIds\n };\n};\n\nexport const createRTree = (context) => {\n const elements = [].concat(...context.layers().filter(layer => layer.config().interactive !== false)\n .map((layer) => {\n const points = layer.getBoundBoxes();\n return points;\n })).flat().filter(d => d !== null);\n\n const rtree = new RTree();\n rtree.load(elements);\n return rtree;\n};\n","export const CONFIG = 'config';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const MOUNT = 'mount';\nexport const TRANSFORM = 'transform';\nexport const TRANSFORMEDDATA = 'transformedData';\nexport const DATADOMAIN = 'dataDomain';\nexport const FIELDS = 'fields';\nexport const LAYERAXISINDEX = 'layerAxisIndex';\nexport const LAYERS = 'layers';\nexport const DOMAIN = 'domain';\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const GRID_LINE_PARENT_GROUP_CLASS = 'grid-lines';\nexport const GRID_BAND_PARENT_GROUP_CLASS = 'grid-bands';\nexport const GRID_PARENT_GROUP = 'grid-parent-group';\nexport const BAND = 'band';\nexport const TICK = 'tick';\nexport const GRID_BAND = 'gridBands';\nexport const GRID_LINE = 'gridLines';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const RETINAL_FIELDS = 'retinalFields';\nexport const PARENT_ALIAS = 'parentAlias';\nexport const LAYERS = 'layers';\nexport const CACHED_DATA = 'cachedData';\nexport const STORE = 'store';\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\nexport const LONGTOUCH = 'longtouch';\nexport const TOUCHDRAG = 'touchdrag';\nexport const ALL_ACTIONS = '*';\n","const SELECTION_NEW_ENTRY = 1;\nconst SELECTION_NEW_EXIT = -1;\nconst SELECTION_NULL = 0;\nconst SELECTION_OLD_ENTRY = 2;\nconst SELECTION_OLD_EXIT = -2;\n\nexport {\n SELECTION_NEW_ENTRY,\n SELECTION_NEW_EXIT,\n SELECTION_NULL,\n SELECTION_OLD_ENTRY,\n SELECTION_OLD_EXIT\n};\n","import SelectionSet from './selection-set';\n\nexport default SelectionSet;\n","import {\n SELECTION_NEW_ENTRY, SELECTION_NEW_EXIT, SELECTION_NULL, SELECTION_OLD_ENTRY, SELECTION_OLD_EXIT\n} from '../enums/selection';\n/* eslint-disable guard-for-in */\n\n/**\n * This component is used to keep track of the row tuples of the data which gets added and removed. This keeps\n * information of which rows are in previous and new entry set and previous and new exit set. This is initialized by\n * {@link Firebolt}.\n *\n * @public\n *\n * @class SelectionSet\n */\nclass SelectionSet {\n /**\n * Creates an instance of selection set\n *\n * @param {Array.} completeSet Set of unique ids.\n */\n constructor ({ keys, fields }, _volatile) {\n this.completeSet = keys;\n this._set = {};\n this._uidMap = {};\n this._measureNames = {};\n this._dimVals = {};\n\n for (const key in keys) {\n this._set[key] = SELECTION_NULL;\n this._uidMap[key] = keys[key].uid;\n this._measureNames[key] = keys[key].measureNames;\n this._dimVals[key] = keys[key].dims;\n }\n\n this._volatile = _volatile;\n this._completeSetCount = Object.keys(keys).length;\n this._lockedSelection = {};\n this._fieldIndices = fields.reduce((acc, v, i) => {\n acc[v] = i;\n return acc;\n }, {});\n this._fields = fields;\n this._resetted = true;\n }\n\n /**\n * Adds a set of ids to the selection set. This also moves the other rows to exit set.\n *\n * @public\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n add (ids) {\n this._resetted = false;\n\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n if (i in set) {\n set[i] = SELECTION_NEW_ENTRY;\n }\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_ENTRY && set[key] !== SELECTION_OLD_ENTRY) {\n set[key] = set[key] < 0 ? SELECTION_OLD_EXIT : SELECTION_NEW_EXIT;\n }\n }\n return this;\n }\n\n /**\n * Adds an array of ids to the old entry set.\n *\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n update (ids) {\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n if (i in set) {\n set[i] = SELECTION_OLD_ENTRY;\n }\n });\n\n return this;\n }\n\n /**\n * Moves all ids which in new entry set to old entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateEntry () {\n const set = this._set;\n\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_ENTRY ? SELECTION_OLD_ENTRY : set[key];\n }\n return this;\n }\n\n /**\n * Moves an array of ids which are in new exit set to old exit set.\n *\n * @public\n *\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateExit () {\n const set = this._set;\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_EXIT ? SELECTION_OLD_EXIT : set[key];\n }\n return this;\n }\n\n /**\n * Removes an array of ids from the selection set. It also moves the remaining row ids to entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set\n */\n remove (ids) {\n this._resetted = false;\n\n const set = this._set;\n ids.forEach((i) => {\n i in set && (set[i] = SELECTION_NEW_EXIT);\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_EXIT && set[key] !== SELECTION_OLD_EXIT) {\n set[key] = set[key] === 0 ? SELECTION_NEW_ENTRY : SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getSets (config = {}) {\n const set = this._set;\n const uidMap = this._uidMap;\n const retObj = {\n entrySet: [[], []],\n exitSet: [[], []],\n mergedEnter: [],\n mergedExit: [],\n completeSet: []\n };\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n const { keepDims = false, dimensions = this._fields } = config;\n const fieldIndices = this._fieldIndices;\n\n for (const key in set) {\n let val;\n const measureNamesArr = measureNames[key] || [];\n let dims = dimVals[key];\n\n if (keepDims) {\n if (measureNamesArr.length) {\n dims = dimensions.map(d => dims[fieldIndices[d]]);\n val = dims.length ? [...dims, `${measureNamesArr}`] : [uidMap[key], `${measureNamesArr}`];\n } else {\n val = dims.length ? [...dims] : [uidMap[key]];\n }\n } else {\n val = measureNamesArr.length ? [uidMap[key], measureNames[key], dims] : [uidMap[key]];\n }\n\n if (set[key] > 0) {\n [SELECTION_OLD_ENTRY, SELECTION_NEW_ENTRY].forEach((v, i) => {\n if (set[key] === v) {\n retObj.entrySet[i].push(val);\n }\n });\n if (set[key] === SELECTION_OLD_ENTRY || set[key] === SELECTION_NEW_ENTRY) {\n retObj.mergedEnter.push(val);\n }\n } else if (set[key] < 0) {\n [SELECTION_OLD_EXIT, SELECTION_NEW_EXIT].forEach((v, i) => {\n if (set[key] === v) {\n retObj.exitSet[i].push(val);\n }\n });\n if (set[key] === SELECTION_OLD_EXIT || set[key] === SELECTION_NEW_EXIT) {\n retObj.mergedExit.push(val);\n }\n }\n retObj.completeSet.push(val);\n }\n\n return retObj;\n }\n\n /**\n * Resets an array of ids in the selection set to initial state. It sets the value of every unique id value to\n * null in the selection set which means they are neither in entry set nor in exit set. If no ids are passed,\n * then it resets all the ids to null.\n *\n * @public\n *\n * @param {Array} ids Array of unique ids.\n * @return {SelectionSet} Instance of selection set.\n */\n reset (ids) {\n const set = this._set;\n if (ids) {\n ids.forEach((i) => {\n i in set && (set[i] = SELECTION_NULL);\n });\n } else {\n for (const key in set) {\n set[key] = SELECTION_NULL;\n }\n }\n this._resetted = true;\n return this;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n *\n * @public\n *\n * @return {Array.} Array of unique ids\n */\n getEntrySet () {\n const set = this._set;\n const addSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_ENTRY && addSet.push(key);\n }\n\n return addSet;\n }\n\n /**\n * Returns a set of unique ids which are already present in entry set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old entry set or new entry set\n */\n getExistingEntrySet (addSet) {\n const set = this._set;\n return addSet.filter(d => set[d] === SELECTION_NEW_ENTRY || set[d] === SELECTION_OLD_ENTRY);\n }\n\n /**\n * Returns a set of unique ids which are already present in exit set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old exit set or new exit set\n */\n getExistingExitSet (removeSet) {\n const set = this._set;\n return removeSet.filter(d => set[d] === SELECTION_NEW_EXIT || set[d] === SELECTION_OLD_EXIT);\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldEntry () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_ENTRY && updateSet.push(key);\n }\n return updateSet;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldExit () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_EXIT && updateSet.push(key);\n }\n\n return updateSet;\n }\n\n /**\n * Gets the array of ids which are in the exit set.\n *\n * @public\n * @return {Array.} Array of unique ids\n */\n getExitSet () {\n const set = this._set;\n const removeSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_EXIT && removeSet.push(key);\n }\n return removeSet;\n }\n\n /**\n * Gets all the ids which are either in exit or entry set.\n *\n * @public\n * @return {Array} Array of unique ids\n */\n getCompleteSet () {\n const set = this._set;\n const completeSet = [];\n\n for (const key in set) {\n completeSet.push(key);\n }\n\n return completeSet;\n }\n\n getCompleteSetCount () {\n return this._completeSetCount;\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Swaps the add set and remove set in the selection set.\n * @return {SelectionSet} Instance of selection set.\n */\n toggle () {\n const set = this._set;\n\n for (const key in set) {\n if (set[key] === SELECTION_NEW_ENTRY) {\n set[key] = SELECTION_NEW_EXIT;\n } else if (set[key] === SELECTION_NEW_EXIT) {\n set[key] = SELECTION_NEW_ENTRY;\n } else if (set[key] === SELECTION_OLD_ENTRY) {\n set[key] = SELECTION_OLD_EXIT;\n } else {\n set[key] = SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getMergedEntrySet (raw) {\n const set = this._set;\n const mergedEnter = [];\n const uidMap = this._uidMap;\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n\n for (const key in set) {\n const val = raw ? [...dimVals[key], `${measureNames[key]}`] :\n [uidMap[key], measureNames[key]];\n if (set[key] === SELECTION_NEW_ENTRY || set[key] === SELECTION_OLD_ENTRY) {\n mergedEnter.push(val);\n }\n }\n return mergedEnter;\n }\n\n getMergedExitSet (raw) {\n const set = this._set;\n const mergedExit = [];\n const uidMap = this._uidMap;\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n\n for (const key in set) {\n const val = raw ? [...dimVals[key], `${measureNames[key]}`] :\n [uidMap[key], measureNames[key]];\n if (set[key] === SELECTION_NEW_EXIT || set[key] === SELECTION_OLD_EXIT) {\n mergedExit.push(val);\n }\n }\n return mergedExit;\n }\n}\n\nexport default SelectionSet;\n","import { clone, unique, intersect } from 'muze-utils';\n\nexport const initializeSideEffects = (context, sideEffects) => {\n const sideEffectsMap = context._sideEffects;\n sideEffects = sideEffects instanceof Array ? sideEffects : Object.values(sideEffects);\n sideEffects.forEach((SideEffect) => {\n const formalName = SideEffect.formalName();\n const target = SideEffect.target();\n if (target === context.target() || target === 'all') {\n const sideEffectInstance = sideEffectsMap[formalName];\n sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context);\n }\n });\n return sideEffectsMap;\n};\n\nexport const setSideEffectConfig = (sideEffects, config) => {\n for (const key in sideEffects) {\n const sideEffect = sideEffects[key];\n const formalName = sideEffect.constructor.formalName();\n const sideEffectConf = config[formalName];\n\n sideEffectConf && sideEffect.config(sideEffectConf);\n }\n};\n\nexport const initializeBehaviouralActions = (context, actions) => {\n const dispatchableBehaviours = {};\n\n actions = actions instanceof Array ? actions : Object.values(actions);\n actions.forEach((Action) => {\n dispatchableBehaviours[Action.formalName()] = new Action(context);\n });\n return dispatchableBehaviours;\n};\n\nexport const initializePhysicalActions = (context, actions) => {\n const physicalActions = {};\n\n for (const name in actions) {\n if (!({}).hasOwnProperty.call(name, actions)) {\n physicalActions[name] = actions[name](context);\n }\n }\n return physicalActions;\n};\n\nexport const changeSideEffectAvailability = (context, fn, toEnable) => {\n const sideEffects = context.sideEffects();\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n let change = true;\n if (fn && fn(key) === false) {\n change = false;\n }\n if (change) {\n toEnable ? sideEffects[key].enable() : sideEffects[key].disable();\n }\n }\n }\n};\n\nexport const getMergedSet = set => [...new Set([...set[0], ...set[1]])];\n\nexport const getSourceFields = (propagationInf, criteria = {}) => {\n const sourceIdentifiers = propagationInf.sourceIdentifiers;\n let sourceFields;\n if (sourceIdentifiers) {\n sourceFields = sourceIdentifiers.fields.map(d => d.name);\n } else if (criteria instanceof Array) {\n sourceFields = criteria[0];\n } else {\n sourceFields = Object.keys(criteria || {});\n }\n return sourceFields;\n};\n\nexport const getSideEffects = (behaviour, behaviourEffectMap) => {\n const sideEffects = [];\n for (const key in behaviourEffectMap) {\n const behaviours = key.split(',');\n const found = behaviours.some(d => d === behaviour);\n if (found) {\n sideEffects.push({\n effects: behaviourEffectMap[key],\n behaviours\n });\n }\n }\n return sideEffects;\n};\n\nexport const unionSets = (firebolt, behaviours) => {\n let combinedSet = null;\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n const uidSet = {\n mergedEnter: [],\n mergedExit: []\n };\n\n behaviours.forEach((behaviour) => {\n const entryExitSet = firebolt._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const { model, uids } = entryExitSet[type];\n let existingModel = models[type];\n\n if (!existingModel) {\n existingModel = models[type] = model;\n uidSet[type] = uids;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n uidSet[type] = unique([...uidSet[type], ...uids]);\n models[type] = model.isEmpty() ? existingModel : existingModel.union(model);\n } else {\n existingModel = model;\n uidSet[type] = uids;\n }\n combinedSet[type].uids = uidSet[type];\n combinedSet[type].model = models[type];\n });\n }\n });\n\n return combinedSet;\n};\n\nexport const intersectSets = (firebolt, behaviours) => {\n let combinedSet = null;\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n const uidSet = {\n mergedEnter: [],\n mergedExit: []\n };\n\n behaviours.forEach((behaviour) => {\n const entryExitSet = firebolt._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const { model, uids } = entryExitSet[type];\n let existingModel = models[type];\n\n if (!existingModel) {\n existingModel = models[type] = model;\n uidSet[type] = uids;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n const commonSet = intersect(uidSet[type], uids, [id => id[0], id => id[0]]);\n uidSet[type] = [...commonSet];\n models[type] = model.isEmpty() ? existingModel : existingModel.union(model);\n }\n combinedSet[type].uids = unique(uidSet[type]);\n combinedSet[type].model = models[type];\n });\n }\n });\n\n return combinedSet;\n};\n","import {\n mergeRecursive,\n hasTouch,\n selectElement,\n isSimpleObject,\n getDataModelFromRange,\n ReservedFields,\n FieldType,\n defaultValue\n} from 'muze-utils';\nimport { ALL_ACTIONS } from './enums/actions';\nimport SelectionSet from './selection-set';\nimport {\n initializeBehaviouralActions,\n initializeSideEffects,\n changeSideEffectAvailability,\n initializePhysicalActions,\n unionSets,\n getSideEffects,\n setSideEffectConfig\n} from './helper';\n\nconst cloneObj = (behaviourEffectMap) => {\n const keys = Object.keys(behaviourEffectMap);\n\n return keys.reduce((acc, key) => {\n const value = behaviourEffectMap[key];\n const cloned = value.map((d) => {\n let clonedVal = d;\n if (isSimpleObject(d)) {\n clonedVal = mergeRecursive({}, d);\n }\n return clonedVal;\n });\n acc[key] = cloned;\n return acc;\n }, {});\n};\n\nconst getKeysFromCriteria = (criteria, firebolt) => {\n if (criteria) {\n const data = firebolt.data();\n const { dimensionsMap, dimensions: dimArr } = firebolt._metaData;\n\n let values = [];\n if (isSimpleObject(criteria)) {\n const dm = getDataModelFromRange(data, criteria);\n const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(dm.getFieldsConfig()).length,\n def: {\n name: ReservedFields.ROW_ID,\n type: FieldType.DIMENSION\n }\n }\n });\n dm.getData({ withUid: true }).data.forEach((row) => {\n const dimKey = `${dimArr.map(d => row[fieldsConfig[d].index])}`;\n const measures = criteria[ReservedFields.MEASURE_NAMES] || dimensionsMap[dimKey] || [[]];\n measures.forEach((measureArr) => {\n values.push(`${[dimKey, ...measureArr]}`);\n });\n });\n } else {\n values = criteria.slice(1, criteria.length).map(d => `${d}`);\n }\n return values;\n }\n return null;\n};\n\n/**\n * This class is responsible for dispatching behavioural actions and side effects. It also keeps the information of\n * registered physical actions, behavioural actions and side effects. Also, it keeps the map of physical and behavioural\n * actions and behavioural actions and side effects. Whenever any behavioural action is dispatched, it also propagates\n * the rows which got affected to the other datamodels. This class is initialized by {@link VisualUnit} and legend to\n * manage it's interaction.\n *\n * @public\n * @class Firebolt\n * @module Firebolt\n */\nexport default class Firebolt {\n constructor (context, actions, sideEffects, behaviourEffectMap) {\n this.context = context;\n this._sideEffectDefinitions = {};\n this._sideEffects = {};\n this._propagationInf = {};\n this._sourceSelectionSet = {};\n this._actions = {\n behavioural: {},\n physical: {}\n };\n this._selectionSet = {};\n this._volatileSelectionSet = {};\n this._propagationFields = {};\n this._sideEffectPolicies = {};\n this._propagationBehaviourMap = {};\n this._behaviourPolicies = {};\n this._actionBehaviourMap = {};\n this._config = {};\n this._behaviourEffectMap = {};\n this._entryExitSet = {};\n this._actionHistory = {};\n this._queuedSideEffects = {};\n this._handlers = {};\n this._payloadGenerators = {};\n this._payloads = {};\n\n this.mapSideEffects(cloneObj(behaviourEffectMap));\n this.registerBehaviouralActions(actions.behavioural);\n this.registerSideEffects(sideEffects);\n this.registerPhysicalBehaviouralMap(actions.physicalBehaviouralMap);\n this.registerPhysicalActions(actions.physical);\n }\n\n config (...config) {\n if (config.length) {\n this._config = mergeRecursive(this._config, config[0]);\n setSideEffectConfig(this.sideEffects(), this._config);\n return this;\n }\n return this._config;\n }\n\n mapSideEffects (behEffectMap) {\n const behaviourEffectMap = this._behaviourEffectMap;\n for (const key in behEffectMap) {\n if ({}.hasOwnProperty.call(behEffectMap, key)) {\n const sideEffects = behEffectMap[key] || [];\n let preventDefaultActions = false;\n let effectNames;\n if (isSimpleObject(sideEffects)) {\n effectNames = sideEffects.effects;\n preventDefaultActions = sideEffects.preventDefaultActions;\n } else {\n effectNames = sideEffects;\n }\n effectNames = effectNames.map((effect) => {\n if (!isSimpleObject(effect)) {\n return {\n name: effect\n };\n }\n return effect;\n });\n !behaviourEffectMap[key] && (behaviourEffectMap[key] = []);\n this._behaviourEffectMap[key] = [...new Set(preventDefaultActions ? effectNames :\n [...behaviourEffectMap[key], ...effectNames])];\n }\n }\n return this;\n }\n\n registerBehaviouralActions (actions) {\n const behaviours = initializeBehaviouralActions(this, actions);\n this.prepareSelectionSets(behaviours);\n Object.assign(this._actions.behavioural, behaviours);\n return this;\n }\n\n prepareSelectionSets () {\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n return this;\n }\n\n applySideEffects (sideEffects, selectionSet, payload) {\n const sideEffectStore = this.sideEffects();\n const actionHistory = this._actionHistory;\n const queuedSideEffects = this._queuedSideEffects;\n sideEffects.forEach((sideEffect) => {\n const effects = sideEffect.effects;\n const behaviours = sideEffect.behaviours;\n let combinedSet = this.mergeSelectionSets(behaviours);\n effects.forEach((effect) => {\n let options = {};\n let name;\n if (typeof effect === 'object') {\n name = effect.name;\n options = effect.options || {};\n } else {\n name = effect;\n }\n const set = options.set;\n if (set) {\n combinedSet = this.mergeSelectionSets(set);\n }\n const sideEffectInstance = sideEffectStore[name];\n if (sideEffectInstance && sideEffectInstance.isEnabled()) {\n if (!sideEffectInstance.constructor.mutates() &&\n Object.values(actionHistory).some(d => d.isMutableAction)) {\n queuedSideEffects[`${name}-${behaviours.join()}`] = {\n name,\n params: [combinedSet, payload, options]\n };\n } else {\n this.dispatchSideEffect(name, combinedSet, payload, options);\n }\n }\n });\n });\n return this;\n }\n\n dispatchSideEffect (name, selectionSet, payload, options = {}) {\n const sideEffectStore = this.sideEffects();\n const sideEffect = sideEffectStore[name];\n const { setTransform } = options;\n selectionSet = setTransform ? setTransform(selectionSet, payload, sideEffect) : selectionSet;\n sideEffect.apply(selectionSet, payload, options);\n }\n\n registerPropagationBehaviourMap (map) {\n this._propagationBehaviourMap = Object.assign(this._propagationBehaviourMap, map || {});\n return this;\n }\n\n dispatchBehaviour (behaviour, payload, propagationInfo = {}) {\n payload = this.sanitizePayload(payload);\n const propagate = propagationInfo.propagate !== undefined ? propagationInfo.propagate : true;\n const behaviouralActions = this._actions.behavioural;\n const action = behaviouralActions[behaviour];\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(behaviour, behaviourEffectMap);\n this._propagationInf = propagationInfo;\n this._payloads[behaviour] = payload;\n\n if (action) {\n action.dispatch(payload);\n this._entryExitSet[behaviour] = action.entryExitSet();\n const shouldApplySideEffects = this.shouldApplySideEffects(propagationInfo);\n\n if (propagate) {\n this.propagate(behaviour, payload, action.propagationIdentifiers(), { sideEffects });\n }\n\n if (shouldApplySideEffects) {\n const applicableSideEffects = this.getApplicableSideEffects(sideEffects, payload, propagationInfo);\n this.applySideEffects(applicableSideEffects, this.getEntryExitSet(behaviour), payload);\n }\n }\n\n return this;\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet.find(d => !d.sourceSelectionSet);\n }\n\n shouldApplySideEffects () {\n return true;\n }\n\n changeBehaviourStateOnPropagation (behaviour, value, key = 'default') {\n const behaviourConditions = this._behaviourPolicies[behaviour] || (this._behaviourPolicies[behaviour] = {});\n if (value instanceof Function) {\n behaviourConditions[key] = value;\n } else {\n behaviourConditions[key] = () => value;\n }\n return this;\n }\n\n changeSideEffectStateOnPropagation (sideEffect, value, key = 'default') {\n const sideEffectConditions = this._sideEffectPolicies[sideEffect] ||\n (this._sideEffectPolicies[sideEffect] = {});\n if (value instanceof Function) {\n sideEffectConditions[key] = value;\n } else {\n sideEffectConditions[key] = () => value;\n }\n }\n\n removeSideEffectPolicy (sideEffect, key) {\n delete this._sideEffectPolicies[sideEffect][key];\n return this;\n }\n\n removeBehaviourPolicy (behaviour, key) {\n delete this._behaviourPolicies[behaviour][key];\n return this;\n }\n\n propagate () {\n return this;\n }\n\n sideEffects (...sideEffects) {\n if (sideEffects.length) {\n this._sideEffects = sideEffects[0];\n return this;\n }\n return this._sideEffects;\n }\n\n enableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, true);\n return this;\n }\n\n disableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, false);\n return this;\n }\n\n dissociateBehaviour (behaviour, physicalAction) {\n const actionBehaviourMap = this._actionBehaviourMap;\n for (const key in actionBehaviourMap) {\n if (key === physicalAction) {\n const behaviourMap = actionBehaviourMap[key];\n behaviourMap.behaviours = behaviourMap.behaviours.filter(d => d !== behaviour);\n this.mapActionsAndBehaviour(key);\n }\n }\n\n return this;\n }\n\n dissociateSideEffect (sideEffect, behaviour) {\n const behaviourEffectMap = this._behaviourEffectMap;\n behaviourEffectMap[behaviour] = behaviourEffectMap[behaviour].filter(d => (d.name || d) !== sideEffect);\n return this;\n }\n\n getApplicableSideEffects (sideEffects) {\n return sideEffects;\n }\n\n attachPropagationListener (dataModel, handler = this.onDataModelPropagation()) {\n dataModel.unsubscribe('propagation');\n dataModel.on('propagation', handler);\n return this;\n }\n\n onDataModelPropagation () {\n return (propValue) => {\n const payload = propValue.payload;\n const action = payload.action;\n\n this.dispatchBehaviour(action, payload, {\n propagate: false\n });\n };\n }\n\n createSelectionSet (uniqueIds, behaviouralActions) {\n const behaviours = behaviouralActions || this._actions.behavioural;\n const selectionSet = this._selectionSet;\n const volatileSelectionSet = this._volatileSelectionSet;\n\n for (const key in behaviours) {\n if ({}.hasOwnProperty.call(behaviours, key)) {\n selectionSet[key] = new SelectionSet(uniqueIds);\n volatileSelectionSet[key] = new SelectionSet(uniqueIds, true);\n this._entryExitSet[key] = null;\n }\n }\n\n this._volatileSelectionSet = volatileSelectionSet;\n this.selectionSet(selectionSet);\n return this;\n }\n\n selectionSet (...selectionSet) {\n if (selectionSet.length) {\n this._selectionSet = selectionSet[0];\n return this;\n }\n return this._selectionSet;\n }\n\n initializeSideEffects () {\n const sideEffectDefinitions = this._sideEffectDefinitions;\n this.sideEffects(initializeSideEffects(this, sideEffectDefinitions));\n return this;\n }\n\n target () {\n return 'all';\n }\n\n registerPhysicalActions (actions, context = this) {\n const initedActions = initializePhysicalActions(context, actions);\n Object.assign(this._actions.physical, initedActions);\n return this;\n }\n\n /**\n * Allows to propagate the datamodel with only the supplied fields. When propagation is done, then the fields\n * which are supplied for the specified behavioural action is propagated.\n *\n * @public\n *\n * @param {string} action Name of behavioural action. If '*' is specified, then for all behavioural actions it is\n * applied.\n * @param {Array} fields Array of field names which will be propagated.\n * @param {boolean} append If true, then it is appended to the existing propagation data model fields else only\n * those fields are projected from propagation data model and propagated.\n *\n * @return {Firebolt} Instance of firebolt\n */\n propagateWith (action, fields, append = false) {\n const behaviouralActions = this._actions.behavioural;\n if (action === ALL_ACTIONS) {\n for (const key in behaviouralActions) {\n this._propagationFields[key] = {\n fields,\n append\n };\n }\n } else {\n this._propagationFields[action] = {\n fields,\n append\n };\n }\n return this;\n }\n\n /**\n * Map actions and behaviours\n * @return {Firebolt} Firebolt instance\n */\n mapActionsAndBehaviour (phyAction) {\n const initedPhysicalActions = this._actions.physical;\n const map = this._actionBehaviourMap;\n\n for (const action in map) {\n if (!({}).hasOwnProperty.call(action, map) && action === (phyAction || action)) {\n let target;\n const mapObj = map[action];\n target = mapObj.target;\n const touch = mapObj.touch;\n if (!target) {\n target = this.context.getDefaultTargetContainer();\n }\n const bind = hasTouch() ? touch === true || touch === undefined : !touch;\n bind && this.bindActionWithBehaviour(initedPhysicalActions[action],\n target, mapObj.behaviours);\n }\n }\n this.registerPhysicalActionHandlers();\n return this;\n }\n\n registerPhysicalBehaviouralMap (map) {\n this._actionBehaviourMap = mergeRecursive(this._actionBehaviourMap, map);\n return this;\n }\n\n /**\n * Binds a target element with an action.\n *\n * @param {Function} action Action method\n * @param {string} target Class name of element\n * @param {Array} behaviourList Array of behaviours\n * @return {FireBolt} Instance of firebolt\n */\n bindActionWithBehaviour (action, targets, behaviourList) {\n if (typeof (targets) === 'string') {\n targets = [targets];\n }\n targets.forEach((target) => {\n const mount = this.context.mount();\n const nodes = target.node instanceof Function ? target : selectElement(mount).selectAll(target);\n if (!nodes.empty()) {\n if (nodes instanceof Array) {\n nodes.forEach((node) => {\n action(selectElement(node), behaviourList);\n });\n } else {\n action(nodes, behaviourList);\n }\n }\n });\n return this;\n }\n\n getPropagationInf () {\n return this._propagationInf;\n }\n\n getAddSetFromCriteria (criteria, propagationInf = {}) {\n return {\n model: propagationInf.data ? propagationInf.data : null,\n uids: criteria ? getKeysFromCriteria(criteria, this) : null\n };\n }\n\n getSelectionSets (action) {\n const sourceId = this.id();\n const propagationInf = this._propagationInf || {};\n const propagationSource = propagationInf.sourceId;\n let applicableSelectionSets = [];\n if (propagationSource !== sourceId) {\n applicableSelectionSets = [this._volatileSelectionSet[action]];\n }\n\n if (propagationSource) {\n applicableSelectionSets.push(this.selectionSet()[action]);\n }\n return applicableSelectionSets;\n }\n\n getFullData () {\n return this.context.data();\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Returns the entry and exit set information of the specified behavioural action.\n *\n * @public\n *\n * @param {string} behaviour Name of behavioural action.\n *\n * @return {Object} Entry exit set information.\n */\n getEntryExitSet (behaviour) {\n return this._entryExitSet[behaviour];\n }\n\n mergeSelectionSets (behaviours) {\n return unionSets(this, behaviours);\n }\n\n data () {\n return this.context.data();\n }\n\n triggerPhysicalAction (event, payload) {\n const handlers = this._handlers[event] || [];\n const genericHandlers = this._handlers['*'];\n\n const allHandlers = [...Object.values(handlers), ...Object.values(genericHandlers)];\n allHandlers.forEach((fn) => {\n fn(event, payload);\n });\n\n return this;\n }\n\n onPhysicalAction (event, fn, namespace) {\n !this._handlers[event] && (this._handlers[event] = {});\n this._handlers[event][namespace] = fn;\n\n return this;\n }\n\n registerPhysicalActionHandlers () {\n this.onPhysicalAction('*', (event, payload) => {\n const { behaviours } = this._actionBehaviourMap[event];\n behaviours.forEach(beh => this.dispatchBehaviour(beh, payload));\n });\n }\n\n id () {\n return this.context.id();\n }\n\n getRangeFromIdentifiers (...params) {\n return this.context.getRangeFromIdentifiers(...params);\n }\n\n sanitizePayload (payload) {\n return payload;\n }\n\n payloadGenerators (...params) {\n if (params.length) {\n Object.assign(this._payloadGenerators, params[0]);\n }\n return this._payloadGenerators;\n }\n\n getPayloadGeneratorFor (action) {\n const defaultFn = this._payloadGenerators.__default;\n const fn = this._payloadGenerators[action];\n\n return defaultValue(fn, defaultFn);\n }\n\n getPayload (action) {\n return this._payloads[action];\n }\n\n actions () {\n return this._actions;\n }\n}\n","import {\n isSimpleObject,\n DimensionSubtype,\n partition,\n ReservedFields,\n retrieveNearestGroupByReducers\n} from 'muze-utils';\nimport { getMergedSet, getSourceFields } from '../../helper';\n\nexport const getIdentifiersFromSet = (set, context, { fields }) => {\n const data = [[]];\n\n if (fields.length) {\n data[0] = fields;\n set.forEach(id => data.push(id));\n }\n return data;\n};\n\n/**\n * This is the base class has all the common functionalities needed for all behavioural actions. Any other behavioural\n * action needs to extend this class.\n *\n * @public\n * @class GenericBehaviour\n * @module GenericBehaviour\n */\nexport default class GenericBehaviour {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n }\n\n /**\n * Returns entry and exit set information. This method is called by firebolt when ```dispatchBehaviour``` is called\n * dynamically or when any physical action is triggered on the chart.\n *\n * @param {Object} payload Payload information.\n * @param {Object|Array} payload.criteria Identifiers of data interacted with.\n *\n * @return {Array} Entry and exit set information.\n */\n dispatch (payload) {\n const criteria = payload.criteria;\n const firebolt = this.firebolt;\n const formalName = this.constructor.formalName();\n const selectionSets = firebolt.getSelectionSets(formalName);\n const {\n model: filteredDataModel,\n uids\n } = this.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf());\n this._payload = payload;\n\n selectionSets.forEach((selectionSet) => {\n this.setSelectionSet(uids, selectionSet, {\n filteredDataModel,\n payload\n });\n\n selectionSet._volatile && this.propagationIdentifiers(selectionSet, payload);\n this.entryExitSet(selectionSet, filteredDataModel, payload);\n });\n }\n\n getAddSetFromCriteria (...params) {\n return this.firebolt.getAddSetFromCriteria(...params);\n }\n\n /**\n * Updates the selection set by adding uids to the instance of {@link SelectionSet} or removing them.\n * {@link SelectionSet} keeps the information of which rows are in the entry set and exit set.\n *\n * @public\n * @param {Array} addSet Array of row ids which got affected during interaction.\n * @param {SelectionSet} selectionSet Instance of selection set.\n *\n * @return {GenericBehaviour} Instance of behaviour.\n */\n setSelectionSet () {\n return this;\n }\n\n entryExitSet (...params) {\n if (params.length) {\n const [selectionSet, filteredDataModel, payload] = params;\n const {\n entrySet,\n exitSet,\n completeSet\n } = selectionSet.getSets();\n const propagationInf = this.firebolt.getPropagationInf();\n\n this._entryExitSet = {\n entrySet: [this.getSetInfo('oldEntry', entrySet[0], filteredDataModel),\n this.getSetInfo('newEntry', entrySet[1], filteredDataModel)],\n exitSet: [this.getSetInfo('oldEntry', exitSet[0], filteredDataModel),\n this.getSetInfo('newExit', exitSet[1], filteredDataModel)],\n mergedEnter: this.getSetInfo('mergedEnter', getMergedSet(entrySet), filteredDataModel,\n selectionSet._fields),\n mergedExit: this.getSetInfo('mergedExit', getMergedSet(exitSet), filteredDataModel,\n selectionSet._fields),\n completeSet: this.getSetInfo('complete', completeSet, filteredDataModel, selectionSet._fields),\n fields: getSourceFields(propagationInf, payload.criteria)\n };\n\n return this;\n }\n return this._entryExitSet;\n }\n\n getSetInfo (type, set, filteredDataModel, setFields) {\n let model = null;\n const data = this.firebolt.data();\n\n if (type === 'mergedEnter') {\n model = filteredDataModel || null;\n } else if (type === 'mergedExit') {\n if (filteredDataModel) {\n const setKeys = new Set(set.map(d => d[0]));\n model = data.select((fields, i) => setKeys.has(setFields.map(field =>\n (field === ReservedFields.ROW_ID ? i : fields[field].value))), {\n saveChild: false\n });\n }\n model = filteredDataModel || null;\n }\n const aggFns = retrieveNearestGroupByReducers(model);\n\n return {\n uids: set,\n length: set.length,\n model,\n fields: setFields,\n aggFns\n };\n }\n\n propagationIdentifiers (...params) {\n if (params.length) {\n let propData = null;\n const [selectionSet, payload] = params;\n const fieldsConfig = this.firebolt.data().getFieldsConfig();\n const { criteria } = payload;\n const propagationFields = this._propagationFields;\n\n if (selectionSet.resetted() || criteria === null) {\n propData = null;\n } else if (isSimpleObject(criteria)) {\n const fields = Object.keys(criteria);\n const [, otherFields] =\n partition(fields, (d => (fieldsConfig[d] ? fieldsConfig[d].def.subtype ===\n DimensionSubtype.CATEGORICAL : d === ReservedFields.MEASURE_NAMES)));\n const allFields = selectionSet._fields.filter(d => d === ReservedFields.ROW_ID ||\n fieldsConfig[d].def.subtype ===\n DimensionSubtype.CATEGORICAL\n );\n const { mergedEnter } = selectionSet.getSets({ keepDims: true, dimensions: allFields });\n propData = {\n fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : {\n name: d\n })),\n range: this.firebolt.getRangeFromIdentifiers({\n criteria,\n entrySet: mergedEnter,\n fields: otherFields\n }),\n identifiers: [[...allFields, ReservedFields.MEASURE_NAMES], ...mergedEnter]\n };\n } else {\n const { mergedEnter } = selectionSet.getSets({ keepDims: true,\n dimensions: propagationFields });\n const fields = propagationFields ? [...propagationFields, ReservedFields.MEASURE_NAMES] :\n criteria[0];\n\n propData = {\n fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : {\n name: d\n })),\n identifiers: [fields, ...mergedEnter]\n };\n }\n this._propagationIdentifiers = propData;\n return this;\n }\n return this._propagationIdentifiers;\n }\n\n static mutates () {\n return false;\n }\n\n enable () {\n this._enabled = true;\n }\n\n disable () {\n this._enabled = false;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n propagateWith (...params) {\n this._propagationFields = params[0];\n\n return this;\n }\n}\n\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class VolatileBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n","import VolatileBehaviour from './volatile';\nimport { HIGHLIGHT } from '../../enums/behaviours';\n\nexport default class HighlightBehaviour extends VolatileBehaviour {\n static formalName () {\n return HIGHLIGHT;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport * as BEHAVIOURNAMES from '../../enums/behaviours';\n\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class BrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BEHAVIOURNAMES.BRUSH;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport { FILTER } from '../../enums/behaviours';\n\nexport default class FilterBehaviour extends VolatileBehaviour {\n static formalName () {\n return FILTER;\n }\n\n static mutates () {\n return true;\n }\n}\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class PersistentBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.sourceId) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n }\n\n return this;\n }\n}\n","import PersistentBehaviour from './persistent';\nimport { SELECT } from '../../enums/behaviours';\nimport { SELECTION } from '../..';\nimport { getMergedSet } from '../../helper';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return SELECT;\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.sourceId) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n // existing add set\n if (existingAddSet.length) {\n selectionSet.updateExit();\n selectionSet.remove(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n const { exitSet } = selectionSet.getSets({ keepDims: true });\n const mergedExitSet = getMergedSet(exitSet);\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n\n return this;\n }\n}\n\n","import { COORD_TYPES } from 'muze-utils';\n\nconst dragCriteriaRetriever = {\n [COORD_TYPES.CARTESIAN]: (firebolt, sourceInfo, { startPos, endPos }) => {\n if (startPos.x === endPos.x && startPos.y === endPos.y) {\n return {\n criteria: null\n };\n }\n const ranges = firebolt.context.getRangeFromPositions({\n startPos,\n endPos\n });\n const dimensions = {};\n dimensions.x = [startPos.x, endPos.x];\n dimensions.y = [startPos.y, endPos.y];\n return {\n criteria: ranges,\n dimensions\n };\n },\n [COORD_TYPES.POLAR]: () => ({\n criteria: null\n })\n};\n\n/**\n * Gets the drag action configuration\n * @param {VisualUnit} instance instance of visual unit\n * @param {Object} config x y positions\n * @return {Object} Payload of behaviour\n*/\n/* istanbul ignore next */ const getDragActionConfig = (firebolt, config) => {\n const context = firebolt.context;\n const sourceInfo = context.getSourceInfo();\n const coordType = context.coord();\n return dragCriteriaRetriever[coordType](firebolt, sourceInfo, config);\n};\n\nexport default getDragActionConfig;\n","import {\n getEvent,\n getD3Drag\n} from 'muze-utils';\nimport getDragActionConfig from './drag-action-config';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const attachDragEvent = (targetEl, action, firebolt, touch) => {\n let startPos = {};\n let endPos = {};\n let drawingInf;\n\n const d3Drag = getD3Drag();\n let touchStart;\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n drawingInf = firebolt.context.getDrawingContext();\n touchStart = new Date().getTime();\n }).on('drag', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n\n if (touch && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n const newStartPos = Object.assign({}, startPos);\n const newEndPos = Object.assign({}, endPos);\n if (startPos.x > endPos.x) {\n newStartPos.x = endPos.x;\n newEndPos.x = startPos.x;\n }\n\n if (startPos.y > endPos.y) {\n const y = startPos.y;\n newStartPos.y = endPos.y;\n newEndPos.y = y;\n }\n const payload = getDragActionConfig(firebolt, {\n startPos: newStartPos,\n endPos: newEndPos\n });\n payload.dragging = true;\n payload.dragDiff = Math.abs(startPos.x - endPos.x) + Math.abs(startPos.y - endPos.y);\n firebolt.triggerPhysicalAction(action, payload);\n }).on('end', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n const duration = new Date().getTime() - touchStart;\n\n if (touch && duration > 100 && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n if (startPos.x > endPos.x) {\n const x = startPos.x;\n startPos.x = endPos.x;\n endPos.x = x;\n }\n\n if (startPos.y > endPos.y) {\n const y = startPos.y;\n startPos.y = endPos.y;\n endPos.y = y;\n }\n\n const payload = getDragActionConfig(firebolt, {\n startPos,\n endPos\n });\n payload.dragEnd = true;\n firebolt.triggerPhysicalAction(action, payload);\n }));\n};\n\n","import { getClientPoint, getEvent } from 'muze-utils';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} instance instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const context = firebolt.context;\n const tooltipConf = context.config().interaction.tooltip;\n const mode = tooltipConf.mode;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n getAllPoints: true,\n data: args,\n event\n });\n const payload = {\n criteria: nearestPoint ? nearestPoint.id : null,\n getAllPoints: false,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos,\n mode\n };\n\n firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, payload);\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, {\n criteria: null\n });\n });\n};\n\nexport default hover;\n","import { getClientPoint } from 'muze-utils';\n\nexport const generatePayloadFromEvent = function (args, event, firebolt) {\n const context = firebolt.context;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event.touches ? event.touches[0] : event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n data: args,\n event\n });\n return {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos\n };\n};\n","import { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const click = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = generatePayloadFromEvent(args, event, firebolt);\n firebolt.triggerPhysicalAction(ACTION_NAMES.CLICK, payload);\n event.stopPropagation();\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport { longtouch } from './longtouch';\nimport { touchdrag } from './touch-drag';\nimport * as ACTION_NAMES from '../../enums/actions';\nimport click from './click';\n\nexport const physicalActions = {\n [ACTION_NAMES.DRAG]: drag,\n [ACTION_NAMES.HOVER]: hover,\n [ACTION_NAMES.CLICK]: click,\n [ACTION_NAMES.LONGTOUCH]: longtouch,\n [ACTION_NAMES.TOUCHDRAG]: touchdrag\n};\n\n","import { attachDragEvent } from './helpers/drag-event';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl) => {\n attachDragEvent(targetEl, ACTION_NAMES.DRAG, firebolt);\n};\n\nexport default drag;\n","/* global setTimeout */\nimport { getEvent } from 'muze-utils';\nimport * as ACTION_NAMES from '../../enums/actions';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nexport const longtouch = firebolt => (targetEl) => {\n let event;\n let touchEnd;\n const dispatchBehaviour = function (args) {\n const payload = generatePayloadFromEvent(args, event, firebolt);\n firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, payload);\n event.stopPropagation();\n };\n\n touchEnd = false;\n event = getEvent();\n targetEl.on('touchstart', (args) => {\n event = getEvent();\n touchEnd = false;\n setTimeout(() => {\n if (!touchEnd) {\n dispatchBehaviour(args);\n } else {\n firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, {\n criteria: null\n });\n }\n }, 100);\n }).on('touchend', () => {\n touchEnd = true;\n });\n};\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const touchdrag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt, true);\n};\n\n","const ANCHORS = 'anchors';\nconst TOOLTIP = 'tooltip';\nconst BRUSH_ANCHORS = 'brush-anchors';\nconst PERSISTENT_ANCHORS = 'persistent-anchors';\nconst FILTER = 'filter';\nconst HIGHLIGHTER = 'highlighter';\nconst CROSSLINE = 'crossline';\nconst FRAGMENTED_TOOLTIP = 'fragmented-tooltip';\nconst AXIS_LABEL_HIGHLIGHTER = 'axis-label-highlighter';\n\nexport {\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS,\n FILTER,\n HIGHLIGHTER,\n CROSSLINE,\n TOOLTIP,\n FRAGMENTED_TOOLTIP,\n AXIS_LABEL_HIGHLIGHTER\n};\n","export const PROPS = {\n valueParser: {\n defaultValue: val => val\n }\n};\n","import GenericSideEffect from './generic-sideeffect';\n\nexport default GenericSideEffect;\n","import { mergeRecursive, getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { PROPS } from './props';\n\n/**\n * This is the base class of all side effects. It contains all common methods like setting configuration, disabling,\n * enabling side effect, etc. Every new side effect has to inherit this class or {@link SpawnableSideEffect} or\n * {@link SurrogateSideEffect} class. All side effects are initialized by firebolt. The instance of firebolt is\n * passed on initialization. The firebolt instance contains ```context``` which is the instance of visual unit with\n * which the firebolt is attached.\n *\n * @public\n * @class\n * @module GenericSideEffect\n */\nexport default class GenericSideEffect {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n this._strategy = 'default';\n this._config = {};\n this._id = getUniqueId();\n this._strategies = {};\n generateGetterSetters(this, PROPS);\n this.config(this.constructor.defaultConfig());\n this.sourceInfo(() => this.firebolt.context.getSourceInfo());\n this.layers(() => this.firebolt.context.layers());\n this.plotPointsFromIdentifiers((...args) => this.firebolt.context.getPlotPointsFromIdentifiers(...args));\n }\n\n /**\n * Returns the default configuration of the side effect.\n *\n * @public\n * @return {Object} Default configuration of side effect.\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the formal name of a side effect. This method must be implemented by all side effects which changes\n * or adds any element in the visualization.\n *\n * @return {string} Formal name of side effect.\n */\n static formalName () {\n return 'generic';\n }\n\n static target () {\n return 'all';\n }\n\n /**\n * Returns true if the side effects mutates the data of chart.\n *\n * @public\n *\n * @return {boolean} If the side effect mutates the data of chart.\n */\n static mutates () {\n return false;\n }\n\n /**\n * Sets or gets the configuration of side effect.\n *\n * When setter,\n * @param {Object} config Configuration of side effect.\n * @return {GenericSideEffect} Side effect instance.\n *\n * When getter,\n * @return {Object} Side effect configuration.\n */\n config (...params) {\n if (params.length) {\n this._config = mergeRecursive(this._config, params[0]);\n return this;\n }\n return this._config;\n }\n\n disable () {\n this._enabled = false;\n return this;\n }\n\n enable () {\n this._enabled = true;\n return this;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n /**\n * Applies the interaction effect on the chart. This is where the implemntation of the side effect is defined.\n *\n * @param {Object} selectionSet Contains the entry and exit set of data which got affected during interaction.\n * @param {Object} selectionSet.mergedEnter Combined previous entry and new entry set.\n * @param {DataModel} selectionSet.mergedEnter.model Instance of data model containing all rows which got\n * affected during interaction.\n * @param {Array} selectionSet.mergedEnter.uids Ids of all rows which were affected during interaction.\n * @param {Object} selectionSet.mergedExit Combined previous exit and new exit set.\n * @param {DataModel} selectionSet.mergedExit.model Instance of data model containing rows which were not affected\n * during interaction.\n * @param {Array} selectionSet.mergedExit.uids Ids of all rows which were not affected during interaction.\n * @param {Object} selectionSet.entrySet Entry set information.\n * @param {Array} selectionSet.entrySet[0].uids All row ids which got affected during previous interaction.\n * @param {Array} selectionSet.entrySet[1].uids All row ids which got affected during current interaction.\n * @param {Array} selectionSet.exitSet[0].uids All row ids which were not affected during previous interaction.\n * @param {Array} selectionSet.exitSet[1].uids All row ids which were not affected during current interaction.\n * @param {Object} payload Payload information of the behavioural action on trigger of which this side effect\n * is applied.\n * @param {Object} options Optional information for side effect like strategy, etc.\n */\n apply () {\n return this;\n }\n\n /**\n * Adds a new strategy method for this side effect. The strategy method is implemented by side effect class.\n *\n * @param {string} name Name of the strategy.\n * @param {Function} fn Strategy method.\n *\n * @return {GenericSideEffect} Instance of side effect.\n */\n setStrategy (name, fn) {\n if (fn) {\n this._strategies[name] = fn;\n }\n return this;\n }\n\n sourceInfo (...sourceInfo) {\n if (sourceInfo.length) {\n this._sourceInfo = sourceInfo[0];\n return this;\n }\n return this._sourceInfo();\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers();\n }\n\n plotPointsFromIdentifiers (...params) {\n if (params.length && params[0] instanceof Function) {\n this._plotPointsFromIdentifiers = params[0];\n return this;\n }\n return this._plotPointsFromIdentifiers(...params);\n }\n}\n","import GenericSideEffect from './generic';\n\n/**\n * This class is inherited by all side effects which changes the look of any existing elements in the visualization.\n * For example, if a side effect wants to change the color of bar plots, then it is a surrogate side effect.\n *\n * To use this,\n * ```\n * const SurrogateSideEffect = muze.SideEffects.standards.SurrogateSideEffect;\n *\n * class BarColorChanger extends SurrogateSideEffect {\n * static formalName () {\n * return 'colorChanger';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n *\n * @module SurrogateSideEffect\n * @class\n * @extends GenericSideEffect\n */\nexport default class SurrogateSideEffect extends GenericSideEffect {\n /**\n * Applies or removes interaction styles from plot elements. An array of row ids needs to be passed\n * which identifies the plot elements and applies styles to them.\n *\n * To apply the interaction style,\n * ```\n * const entryRowIds = entrySet[0].uids;\n * const interactionStyle = [{\n * type: 'fill',\n * intensity: [0, 0, 15, 0] // hsla configuration\n * }];\n *\n * this.applyInteractionStyle(entryRowIds, interactionStyle, 'brighten', true);\n * ```\n * @public\n * @param {Array} set Array of row ids.\n * @param {Array} config Style configuration.\n * @param {Object} config[0] fill or stroke configuration.\n * @param {string} config[0].type Type of style - fill or stroke.\n * @param {Array} config[0].intensity hsla configuration.\n * @param {string} interactionType Type of interaction. This is needed for storing the styles for\n * each type of interaction in the plot elements.\n * @param {boolean} apply Whether to apply or remove the interaction style.\n *\n * @return {SurrogateSideEffect} Instance of surrogate side effect.\n */\n applyInteractionStyle (set, config = {}, layers) {\n const { interactionType, apply, reset = false } = config;\n const allLayers = layers || this.firebolt.context.layers();\n allLayers.forEach((layer) => {\n const { interactive } = layer.config();\n if (interactive !== false) {\n const layerFields = layer.data().getFieldsConfig();\n const filteredUids = set.uids.filter(([, measures = []]) => measures.every(m => m in layerFields))\n .map(d => d[0]);\n const options = { apply, reset, styles: null };\n layer.applyInteractionStyle(interactionType, filteredUids, options);\n }\n });\n return this;\n }\n}\n","import { makeElement } from 'muze-utils';\n\nimport GenericSideEffect from './generic';\n\n/**\n * Any side effect which will add any new element to the chart like drawing a rectangular box or any annotation over\n * the chart needs to inherit this class. This class has methods which returns the container where the dom elements\n * needs to be created.\n *\n * To use this,\n * ```\n * const SpawnableSideEffect = muze.SideEffects.standards.SpawnableSideEffect;\n *\n * class SelectionBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'selectionBox';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n * @class\n * @extends GenericSideEffect\n * @module SpawnableSideEffect\n */\nexport default class SpawnableSideEffect extends GenericSideEffect {\n /**\n * Creates a html or svg element in the container.\n *\n * @public\n * @param {SVGElement|HTMLElement} container Container where the dom element will be rendered.\n * @param {string} elemType Type of dom element.\n * @param {Array} data Array of objects with which the dom elements will be binded.\n * @param {string} className class name of the element.\n *\n * @return {Selection} D3 Selection of the element.\n */\n createElement (container, elemType, data, className, callbacks) {\n return makeElement(container, elemType, data, className, callbacks);\n }\n\n /**\n * Returns the drawing information for side effect like svg container, dimensions of the visual unit.\n *\n * @public\n * @return {Object} Drawing information for side effect.\n * ```\n * sideEffectGroup: // svg container where the side effect needs to be appended.\n * svgContainer: // svg container of the {@link VisualUnit}.\n * htmlContainer: // html div container of the {@link VisualUnit}.\n * width: // Width of the {@link VisualUnit}\n * height: // Height of the {@link VisualUnit}\n * ```\n */\n drawingContext (...drawingContext) {\n if (drawingContext.length) {\n this._drawingContext = drawingContext[0];\n return this;\n }\n return this._drawingContext();\n }\n\n show () {\n return this;\n }\n\n hide () {\n return this;\n }\n}\n","import { selectElement } from 'muze-utils';\n\nexport const getBoxDimensionsFromPayload = (payload, axes, axisFields) => {\n let x1;\n let x2;\n let y1;\n let y2;\n let xRange;\n let yRange;\n const criteria = payload.criteria;\n const dimensions = payload.dimensions || {};\n const { x: xDim, y: yDim } = dimensions;\n\n if (!criteria) return null;\n\n if (axes.x && axes.y) {\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const xLinear = xAxis.constructor.type() === 'linear';\n const yLinear = yAxis.constructor.type() === 'linear';\n const xField = `${axisFields.x[0]}`;\n const yField = `${axisFields.y[0]}`;\n const xCriteria = criteria[xField];\n const yCriteria = criteria[yField];\n\n if (xCriteria && xCriteria[0] instanceof Array) {\n xRange = xCriteria[0];\n yRange = xCriteria[1];\n } else {\n xRange = xCriteria || [];\n yRange = yCriteria || [];\n }\n\n if (xRange && xRange.length) {\n const domain = xAxis.domain();\n const bandScale = xAxis.constructor.type() === 'band';\n let x1Val = xRange[0];\n let x2Val = xRange[xRange.length - 1];\n\n if (bandScale) {\n let x1DomainIndex = domain.indexOf(xRange[0]);\n let x2DomainIndex = domain.indexOf(xRange[xRange.length - 1]);\n [x1DomainIndex, x2DomainIndex] = [x1DomainIndex, x2DomainIndex].sort((a, b) => a - b);\n x1Val = domain[x1DomainIndex];\n x2Val = domain[x2DomainIndex];\n }\n\n x1 = xAxis.getScaleValue(x1Val);\n x2 = xAxis.getScaleValue(x2Val);\n x2 += bandScale ? xAxis.getUnitWidth() : 0;\n }\n\n if (yRange && yRange.length) {\n const domain = yAxis.domain();\n const bandScale = yAxis.constructor.type() === 'band';\n let y1Val = yRange[0];\n let y2Val = yRange[yRange.length - 1];\n\n if (bandScale) {\n let y1DomainIndex = domain.indexOf(yRange[0]);\n let y2DomainIndex = domain.indexOf(yRange[yRange.length - 1]);\n [y1DomainIndex, y2DomainIndex] = [y1DomainIndex, y2DomainIndex].sort(((a, b) => b - a));\n y1Val = domain[y1DomainIndex];\n y2Val = domain[y2DomainIndex];\n }\n\n y1 = yAxis.getScaleValue(y1Val);\n y2 = yAxis.getScaleValue(y2Val);\n y2 += yAxis.constructor.type() === 'band' ? yAxis.getUnitWidth() : 0;\n }\n\n if ((yLinear && xLinear) || !payload.dragEnd) {\n if (xDim) {\n [x1, x2] = xDim;\n }\n if (yDim) {\n [y1, y2] = yDim;\n }\n }\n }\n\n return {\n dimension: {\n x1,\n x2,\n y1,\n y2\n },\n direction: 'both'\n };\n};\n\nexport const changeVisibility = (context, sideEffectGroup, visible) => {\n const config = context.config();\n const className = config.defClassName;\n const classPrefix = config.classPrefix;\n selectElement(sideEffectGroup).selectAll(`.${classPrefix}-${className}`)\n .style('display', visible ? 'block' : 'none');\n};\n","import {\n getQualifiedClassName,\n selectElement,\n makeElement,\n isValidValue\n} from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport './styles.scss';\nimport SpawnableSideEffect from '../spawnable';\nimport { selectionBoxDrag } from '../../actions/physical/selection-box-drag';\nimport { getBoxDimensionsFromPayload, changeVisibility } from './helper';\nimport { BEHAVIOURS } from '../..';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\nclass SelectionBox extends SpawnableSideEffect {\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n defClassName: 'selection-box-group',\n className: '',\n classPrefix: CLASSPREFIX,\n box: {\n defClassName: 'selection-box',\n className: ''\n },\n transition: {\n duration: 200\n },\n persistent: false\n };\n }\n\n static formalName () {\n return 'selectionBox';\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n * @param {Object} dimension Dimensions of the selection box.\n * @param {number} dimension.x1 Starting x position\n * @param {number} dimension.x2 Ending x position\n * @param {number} dimension.y1 Starting y position\n * @param {number} dimension.y2 Ending y position\n * @param {Object} conf Configuration needed to draw the selection box\n * @param {number} unitWidth Width of the visual unit.\n * @param {number} unitHeight Height of the visual unit.\n */\n apply (selectionSet, payload) {\n let x = 0;\n let y = 0;\n let width;\n let height;\n const config = this._config;\n const boxConf = config.box;\n const firebolt = this.firebolt;\n const drawingInf = this.drawingContext();\n const mountPoint = drawingInf.sideEffectGroup;\n const unitWidth = drawingInf.width;\n const unitHeight = drawingInf.height;\n const classPrefix = config.classPrefix;\n const selectionGroupClassName = config.defClassName;\n\n width = unitWidth;\n height = unitHeight;\n\n // Hide selection-box on dragEnd or when criteria is empty\n if (!payload.criteria || (payload.dragEnd && !config.persistent)) {\n this.hide(drawingInf);\n return this;\n }\n\n const sourceInf = this.sourceInfo();\n const { dimension, direction } =\n getBoxDimensionsFromPayload(payload, sourceInf.axes, sourceInf.fields);\n const transition = payload.dragEnd && config.transition;\n\n if (direction === 'both') {\n x = Math.min(dimension.x1, dimension.x2);\n y = Math.min(dimension.y1, dimension.y2);\n width = Math.abs(dimension.x2 - dimension.x1);\n height = Math.abs(dimension.y2 - dimension.y1);\n }\n\n this.show(drawingInf);\n // Create the data array for drawing the rectangle\n const points = [\n {\n x,\n y,\n width,\n height\n }\n ];\n // Create the container group for selection box.\n const selectionGroup = makeElement(selectElement(mountPoint), 'g', [1],\n `.${classPrefix}-${selectionGroupClassName}`);\n const sideEffect = this;\n const selection = selectionGroup.selectAll('rect').data(points);\n const selectionBox = selection.enter().append('rect')\n .each(function () {\n firebolt.registerPhysicalBehaviouralMap({\n selectiondrag: {\n behaviours: [BEHAVIOURS.BRUSH]\n }\n });\n selectionBoxDrag(firebolt)(selectElement(this), ['brush'], sideEffect);\n })\n .merge(selection)\n .each(function (attrs) {\n let element = selectElement(this);\n transition && (element = element.transition().duration(transition.duration));\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n isValidValue(attrs[key]) && element.attr(key, attrs[key]);\n }\n }\n });\n // Get the qualified class name for selection box rectangle\n const boxClassName = getQualifiedClassName(boxConf.defClassName, this._id, classPrefix);\n selectionBox.classed(boxClassName.join(' '), true);\n selectionBox.classed(boxConf.className, true);\n\n return this;\n }\n\n hide (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, false);\n }\n\n show (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, true);\n }\n}\n\nexport default SelectionBox;\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './helpers/drag-action-config';\nimport { ACTIONS } from '../..';\n\nexport const selectionBoxDrag = firebolt => (targetEl) => {\n let subject;\n let drawingInf;\n const context = firebolt.context;\n const onDrag = (payload) => {\n firebolt.triggerPhysicalAction(ACTIONS.SELECTIONDRAG, payload);\n };\n const d3Drag = getD3Drag();\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n drawingInf = context.getDrawingContext();\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n subject.x += event.dx;\n subject.y += event.dy;\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(firebolt, {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n });\n onDrag(payload);\n }\n }).on('end', () => {\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(firebolt, {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n });\n payload.dragEnd = true;\n onDrag(payload);\n }\n }));\n};\n","export const CLASSPREFIX = 'muze';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const NULL = 'null';\nexport const UNDEFINED = 'undefined';\n","import { CLASSPREFIX } from './constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'tooltip-box',\n parentClassName: 'tooltip-parent-container',\n connectorClassName: 'tooltip-connectors',\n className: '',\n row: {\n margin: 0\n },\n spacing: 5,\n content: {\n spacing: 5,\n iconContainerSize: 10,\n iconScale: 1,\n iconShape: 'circle',\n iconColor: '#ff0000',\n rowMargin: '4px 0 4px 0',\n margin: 10,\n separator: ':',\n className: 'tooltip-content-container',\n parentClassName: 'tooltip-content-parent-container'\n },\n arrow: {\n size: 10,\n disabled: false,\n defClassName: 'tooltip-arrow',\n className: '',\n color: 'rgba(195,195,195,0.85)'\n }\n};\n","export const CLASSPREFIX = 'muze';\nexport const ARROW_RIGHT = 'right';\nexport const ARROW_TOP = 'top';\nexport const ARROW_BOTTOM = 'bottom';\nexport const ARROW_LEFT = 'left';\nexport const TOOLTIP_LEFT = 'left';\nexport const TOOLTIP_RIGHT = 'right';\nexport const TOOLTIP_BOTTOM = 'bottom';\nexport const TOOLTIP_TOP = 'top';\nexport const INITIAL_STYLE = {\n position: 'absolute',\n width: 0,\n height: 0\n};\nexport const TABLE_FORMAT = 'table';\n","import {\n selectElement,\n mergeRecursive,\n makeElement,\n setAttrs,\n setStyles,\n getSymbol,\n isSimpleObject\n} from 'muze-utils';\nimport { TABLE_FORMAT } from './constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class is used to manage the content of tooltip.\n */\nexport default class Content {\n /**\n * Creates an instance of content.\n */\n constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n const config = defaultConfig.content;\n config.classPrefix = defaultConfig.classPrefix;\n return config;\n }\n\n config (...c) {\n if (c.length > 0) {\n this._config = mergeRecursive(this._config, c[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Update model. The format contains presentation strategy which determines how to show the content.\n * If no strategy is mentioned then default is to show key value pair\n */\n update (item) {\n this._model = item.model;\n this._formatter = item.formatter;\n return this;\n }\n\n context (ctx) {\n this._context = ctx;\n return this;\n }\n\n render (mount) {\n let data;\n const config = this._config;\n const iconContainerSize = config.iconContainerSize;\n const formatter = this._formatter;\n const rowMargin = config.rowMargin;\n const model = this._model;\n const { classPrefix } = config;\n\n this._mount = mount;\n if (model instanceof Array) {\n data = model;\n } else {\n data = formatter(this._model, this.config(), this._context);\n }\n\n if (data instanceof Function) {\n const mountHtmlTooltip = makeElement(mount, 'div', [1], `${classPrefix}-tooltip-html-container`);\n mountHtmlTooltip.html(data());\n } else {\n let content = data;\n let displayFormat = 'default';\n\n if (isSimpleObject(data)) {\n content = data.content;\n displayFormat = data.displayFormat;\n }\n\n const body = makeElement(mount, 'div', [displayFormat], `${classPrefix}-tooltip-content`, {},\n d => d);\n\n if (displayFormat === TABLE_FORMAT) {\n const table = makeElement(body, 'table', [1], `${classPrefix}-tooltip-table`);\n const tbody = makeElement(table, 'tbody', [1], `${classPrefix}-tooltip-table-tbody`);\n const rows = makeElement(tbody, 'tr', content, `${classPrefix}-tooltip-table-row`);\n rows.each(function (d, i) {\n selectElement(this).classed(`${classPrefix}-tooltip-table-row-${i}`, true);\n });\n const cells = makeElement(rows, 'td', d => d, `${classPrefix}-tooltip-table-cell`);\n cells.each(function (d) {\n selectElement(this).html(d);\n });\n } else {\n const rows = makeElement(body, 'div', content, '', {\n update: (elem, elemData) => elem.attr('class', elemData.className)\n });\n const cells = makeElement(rows, 'span', d => d.data, `${classPrefix}-tooltip-content`);\n cells.attr('class', `${classPrefix}-tooltip-content`);\n setStyles(rows, {\n margin: rowMargin\n });\n setStyles(cells, {\n display: 'inline-block' // 'margin-right': `${config.spacing}px`\n });\n\n cells.each(function (d) {\n const el = selectElement(this);\n el.html('');\n if (d instanceof Object) {\n if (d.type === 'icon') {\n const svg = makeElement(el, 'svg', [1]);\n const path = makeElement(svg, 'path', [1]);\n const shape = d.shape instanceof Function ? d.shape : getSymbol(d.shape);\n\n setAttrs(svg, {\n x: 0,\n y: 0,\n width: iconContainerSize,\n height: iconContainerSize\n });\n setAttrs(path, {\n d: shape.size(d.size)(),\n transform: `translate(${iconContainerSize / 2}, ${iconContainerSize / 2})`\n });\n setStyles(path, {\n fill: d.color\n });\n setStyles(svg, {\n width: `${iconContainerSize}px`,\n height: `${iconContainerSize}px`\n });\n } else {\n el.html(d.value);\n d.className && el.classed(d.className, true);\n setStyles(el, d.style);\n }\n } else {\n el.html(d);\n }\n });\n }\n }\n return this;\n }\n\n clear () {\n this._model = null;\n return this;\n }\n}\n","import {\n mergeRecursive,\n getQualifiedClassName,\n getUniqueId,\n selectElement,\n makeElement,\n getMaxPoint\n} from 'muze-utils';\nimport { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM,\n TOOLTIP_TOP } from './constants';\nimport { defaultConfig } from './default-config';\nimport { reorderContainers } from './helper';\nimport './styles.scss';\nimport Content from './content';\n\n/**\n * This component is responsible for creating a tooltip element. It appends the tooltip\n * in the body element.\n * @class Tooltip\n */\nexport default class Tooltip {\n /**\n * Initializes the tooltip with the container element and configuration\n * @param {HTMLElement} container container where the tooltip will be mounted.\n * @param {string} className Class name of the tooltip.\n */\n constructor (htmlContainer, svgContainer) {\n let connectorContainer = svgContainer;\n this._id = getUniqueId();\n this._config = {};\n this.config({});\n const tooltipConf = this._config;\n const classPrefix = tooltipConf.classPrefix;\n const contentClass = tooltipConf.content.parentClassName;\n const container = makeElement(htmlContainer, 'div', [1], `${classPrefix}-tooltip-container`);\n this._container = container;\n this._tooltipContainer = container.append('div').style('position', 'absolute');\n this._contentContainer = this._tooltipContainer.append('div').attr('class',\n `${classPrefix}-${tooltipConf.defClassName} ${classPrefix}-${contentClass}\n ${tooltipConf.className}`);\n\n if (!svgContainer) {\n connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none');\n }\n\n this._contents = {};\n this._tooltipConnectorContainer = selectElement(connectorContainer)\n .append('g')\n .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`);\n const id = this._id;\n const defClassName = tooltipConf.parentClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix);\n\n this.addClass(qualifiedClassName.join(' '));\n this.hide();\n }\n\n /**\n * Sets the configuration of tooltip.\n * @param {Object} config Configuration of tooltip\n * @return {Tooltip} Instance of tooltip\n */\n config (...config) {\n if (config.length > 0) {\n const defConf = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConf, config[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n return defaultConfig;\n }\n /**\n * Sets the class name of tooltip\n * @param {string} className tooltip class name\n * @return {Tooltip} Instance of tooltip.\n */\n addClass (className) {\n this._tooltipContainer.classed(className, true);\n return this;\n }\n\n context (...ctx) {\n if (ctx.length) {\n this._context = ctx[0];\n return this;\n }\n return this._context;\n }\n\n content (name, data, contentConfig = {}) {\n const config = this.config();\n const { classPrefix } = config;\n const contentClass = config.content.className;\n const formatter = config.formatter;\n const className = `${classPrefix}-${contentClass}-${name}`;\n const specificClass = `${classPrefix}-${contentConfig.className}`;\n const content = this._contents[name] = this._contents[name] || new Content();\n const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className);\n container.attr('class', `${classPrefix}-${contentClass} ${className} ${specificClass}`);\n reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`);\n const contentConf = config.content;\n contentConfig.classPrefix = this._config.classPrefix;\n content.config(contentConf);\n\n if (data === null) {\n content.clear();\n container.remove();\n delete this._contents[name];\n } else {\n content.update({\n model: data,\n formatter: contentConfig.formatter || formatter\n });\n content.context(this._context);\n content.render(container);\n }\n\n if (!Object.keys(this._contents).length) {\n this.hide();\n }\n return this;\n }\n\n getContents () {\n return Object.values(this._contents);\n }\n\n /**\n * Positions the tooltip at the given x and y position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Tooltip} Instance of tooltip.\n */\n position (x, y) {\n if (!Object.keys(this._contents).length) {\n this.hide();\n return this;\n }\n this.show();\n const target = this._target;\n\n if (target) {\n const node = this._tooltipContainer.node();\n const tooltipPos = this._orientation;\n const outsidePlot = tooltipPos === TOOLTIP_LEFT || tooltipPos === TOOLTIP_RIGHT ?\n (y + node.offsetHeight) < target.y || y > (target.y + target.height) :\n (x + node.offsetWidth) < target.x || x > (target.x + target.width);\n\n if (outsidePlot) {\n let path;\n this._tooltipConnectorContainer.style('display', 'block');\n const connector = this._tooltipConnectorContainer.selectAll('path').data([1]);\n const enter = connector.enter().append('path');\n if (tooltipPos === ARROW_LEFT) {\n path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}`\n + ` ${target.y + target.height / 2}`;\n } else if (tooltipPos === ARROW_RIGHT) {\n path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}`\n + ` L ${target.x} ${target.y + target.height / 2}`;\n } else if (tooltipPos === ARROW_BOTTOM) {\n path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}`\n + ` L ${target.x + target.width / 2} ${target.y}`;\n }\n enter.merge(connector).attr('d', path).style('display', 'block');\n } else {\n this._tooltipConnectorContainer.style('display', 'none');\n }\n }\n\n const offset = this._offset || {\n x: 0,\n y: 0\n };\n this._tooltipContainer.style('left', `${offset.x + x}px`).style('top',\n `${offset.y + y}px`);\n\n return this;\n }\n\n /**\n * Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the\n * boundaries.\n * @param {Object} dim Dimensions of the plot.\n */\n positionRelativeTo (dim, tooltipConf = {}) {\n let obj;\n const orientation = tooltipConf.orientation;\n this.show();\n if (!dim) {\n this.hide();\n return this;\n }\n\n const extent = this._extent;\n const contentContainer = this._contentContainer.node();\n this._tooltipContainer.style('top', '0px')\n .style('left', '0px')\n .style('width', '2000px')\n .style('height', '2000px');\n\n const offsetWidth = contentContainer.offsetWidth + 4;\n const offsetHeight = contentContainer.offsetHeight + 4;\n const config = this._config;\n const offset = this._offset;\n const spacing = config.spacing;\n const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true;\n const topSpace = dim.y;\n // When there is no space in right\n const dimX = dim.x + dim.width + offset.x;\n const rightSpace = extent.width - dimX;\n const leftSpace = dim.x + offset.x - extent.x;\n const bottomSpace = extent.height - (dim.y + dim.height + offset.y);\n const arrowSize = spacing;\n const tooltipHeight = offsetHeight + arrowSize;\n const tooltipWidth = offsetWidth + arrowSize;\n\n const spaces = [{\n position: 'top',\n value: topSpace - tooltipHeight\n }, {\n position: 'right',\n value: rightSpace - tooltipWidth\n }, {\n position: 'left',\n value: leftSpace - tooltipWidth\n }, {\n position: 'bottom',\n value: bottomSpace - tooltipHeight\n }];\n\n const positionHorizontal = (positionVal) => {\n let position;\n let x = dim.x + dim.width;\n let y = dim.y;\n\n if (positionVal === 'right') {\n position = TOOLTIP_LEFT;\n x += arrowSize;\n } else if (positionVal === 'left') {\n x = dim.x - offsetWidth;\n position = TOOLTIP_RIGHT;\n x -= arrowSize;\n }\n\n if (dim.height < offsetHeight) {\n y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2);\n }\n\n return {\n position,\n x,\n y\n };\n };\n\n const positionVertical = (positionVal) => {\n let position;\n let y;\n // Position tooltip at the center of plot\n let x = dim.x - offsetWidth / 2 + dim.width / 2;\n\n // Overflows to the right\n if ((extent.width - (dim.x + offset.x)) < offsetWidth) {\n x = extent.width - offsetWidth - offset.x;\n } else if ((x + offset.x) < extent.x) { // Overflows to the left\n x = extent.x;\n }\n\n if (positionVal === 'top') {\n y = dim.y - offsetHeight - arrowSize;\n position = TOOLTIP_BOTTOM;\n } else {\n y = dim.y + dim.height + arrowSize;\n position = TOOLTIP_TOP;\n }\n\n return {\n position,\n x,\n y\n };\n };\n\n this._target = dim;\n\n const hMax = getMaxPoint(spaces.filter(d => d.position === 'left' || d.position === 'right'),\n 'value');\n const vMax = getMaxPoint(spaces.filter(d => d.position === 'top' || d.position === 'bottom'),\n 'value');\n if (!orientation) {\n if (hMax.value > 0) {\n const position = hMax.position;\n obj = positionHorizontal(position);\n } else {\n const position = vMax.position;\n obj = positionVertical(position);\n }\n } else if (orientation === 'horizontal') {\n const position = hMax.position;\n obj = positionHorizontal(position);\n } else {\n const position = vMax.position;\n obj = positionVertical(position);\n }\n\n this._position = {\n x: obj.x,\n y: obj.y\n };\n\n this._tooltipContainer.style('height', `${offsetHeight}px`)\n .style('width', `${offsetWidth}px`);\n this._orientation = obj.position;\n draw && this.position(obj.x, obj.y);\n return this;\n }\n\n /**\n * Hides the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n hide () {\n this._tooltipContainer.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'none');\n return this;\n }\n\n /**\n * Shows the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n show () {\n this._tooltipContainer.style('display', 'block');\n return this;\n }\n\n extent (extent) {\n this._extent = extent;\n return this;\n }\n\n offset (offset) {\n this._offset = offset;\n return this;\n }\n\n remove () {\n this._tooltipContainer.remove();\n this._tooltipConnectorContainer.remove();\n return this;\n }\n}\n","export const reorderContainers = (parentContainer, className) => {\n parentContainer.selectAll(className).sort((a, b) => a - b);\n};\n","export const SELECTION_SUMMARY = 'selectionSummary';\nexport const HIGHLIGHT_SUMMARY = 'highlightSummary';\n","import {\n FieldType,\n GROUP_BY_FUNCTIONS,\n formatTemporal,\n DimensionSubtype,\n MeasureSubtype,\n DataModel,\n defaultValue,\n retrieveFieldDisplayName,\n nestCollection,\n getObjProp,\n intersect,\n ReservedFields\n} from 'muze-utils';\nimport { TABLE_FORMAT } from '@chartshq/muze-tooltip';\nimport { SELECTION_SUMMARY, HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\nimport { BAR } from '../../../../visual-group/src/enums/constants';\nimport { NULL, UNDEFINED } from '../../enums/constants';\n\nconst { SUM, COUNT } = GROUP_BY_FUNCTIONS;\nconst { InvalidAwareTypes } = DataModel;\nconst FIRST_VALUE_MARGIN = '10px';\nconst STACK = 'stack';\nconst SINGLE_DATA_MARGIN = 10;\nconst defNumberFormat = value => `${value % value.toFixed(0) === 0 ? value : value.toFixed(2)}`;\n\nconst formatters = (formatter, interval, valueParser) => ({\n [DimensionSubtype.TEMPORAL]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatTemporal(Number(value), interval)),\n [MeasureSubtype.CONTINUOUS]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatter(defNumberFormat(value))),\n [DimensionSubtype.CATEGORICAL]: value => valueParser(value)\n});\n\nconst getTabularData = (dataObj, fieldInf) => {\n const rows = [];\n const { data, schema } = dataObj;\n rows.push(schema.map(d => fieldInf[d.name].displayName));\n\n data.forEach((d) => {\n const row = [];\n schema.forEach((fieldObj, i) => {\n const value = fieldInf[fieldObj.name].fn(d[i]);\n row.push(value);\n });\n rows.push(row);\n });\n return rows;\n};\n\nconst isSingleValue = (dataLen, stackedSum) => dataLen === 1 && !stackedSum;\n\nconst getStackedKeyValue = (params) => {\n const { field, value, classPrefix } = params;\n return ({\n className: `${classPrefix}-tooltip-stacked-row`,\n data: [{\n value: field,\n className: `${classPrefix}-tooltip-stacked-row-key`\n }, {\n value: `${value}`,\n className: `${classPrefix}-tooltip-stacked-row-value`\n }]\n });\n};\n\nconst getKeyValue = (params) => {\n const { field, value, classPrefix, margin, isSelected, removeKey, stackedSum, isStackedBar } = params;\n let { stackedValue } = params;\n\n if (!removeKey) {\n const keyObj = {\n value: field,\n className: `${classPrefix}-tooltip-key`\n };\n const valueObj = {\n value,\n className: `${classPrefix}-tooltip-value`\n };\n\n if (stackedValue === NULL || stackedValue === UNDEFINED) {\n stackedValue = 0;\n }\n\n const stackedValueObj = {\n value: stackedSum ? `(${(stackedValue * 100 / stackedSum).toFixed(2)} %)` : undefined,\n className: `${classPrefix}-tooltip-stacked-percentage`\n };\n\n if (margin !== undefined) {\n keyObj.style = {\n 'margin-left': `${margin}px`\n };\n valueObj.style = {\n 'margin-left': `${margin}px`\n };\n stackedValueObj.style = {\n 'margin-left': `${margin}px`\n };\n }\n\n return ({\n className: isSelected ? `${classPrefix}-tooltip-row ${classPrefix}-tooltip-selected-row`\n : `${classPrefix}-tooltip-row`,\n data: stackedSum && isStackedBar ? [keyObj, stackedValueObj, valueObj] : [keyObj, valueObj]\n });\n }\n return ({\n data: [{\n className: '',\n value,\n style: {\n 'margin-left': FIRST_VALUE_MARGIN\n }\n }],\n className: `${classPrefix}-tooltip-first`\n });\n};\n\nexport const getStackedSum = (values, index) => values.reduce((a, b) => {\n if (b[index] instanceof InvalidAwareTypes) {\n return a + 0;\n }\n return a + b[index];\n}, 0);\n\nexport const isStackedChart = layers => layers.some(d => d.transformType() === STACK);\nexport const isStackedBarChart = layers => layers.some(d => d.transformType() === STACK && d.config().mark === BAR);\n\nconst generateRetinalFieldsValues = (valueArr, retinalFields, content, context) => {\n const {\n fieldsConfig,\n dimensionMeasureMap,\n axes,\n config,\n fieldInf,\n dataLen,\n target,\n stackedSum,\n isStackedBar\n } = context;\n const { classPrefix, margin, separator } = config;\n const colorAxis = axes.color[0];\n const shapeAxis = axes.shape[0];\n const sizeAxis = axes.size[0];\n const REF_VALUES_INDEX = 1;\n const REF_KEYS_INDEX = 0;\n\n for (const retField in retinalFields) {\n const retIndex = fieldsConfig[retField].index;\n const retinalFieldValue = valueArr[retIndex];\n const measuresArr = dimensionMeasureMap[retField];\n const icon = {\n type: 'icon',\n color: colorAxis.getColor(retinalFieldValue),\n size: sizeAxis.config().value,\n shape: shapeAxis.getShape(retinalFieldValue)\n };\n const { displayName, fn } = fieldInf[retField];\n const formattedRetinalValue = fn(retinalFieldValue);\n\n if (isSingleValue(dataLen, stackedSum)) {\n content.push(getKeyValue({\n field: displayName,\n value: formattedRetinalValue,\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n } else {\n const hasMultipleMeasures = measuresArr.length > 1;\n hasMultipleMeasures && (content.push({ data: [icon, formattedRetinalValue] }));\n const selectedContext = target && target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)];\n const isSelected = selectedContext === retinalFieldValue;\n\n measuresArr.forEach((measure) => {\n const measureIndex = fieldsConfig[measure].index;\n const { displayName: dName, fn: formatterFn } = fieldInf[measure];\n const currentMeasureValue = valueArr[measureIndex];\n const value = formatterFn(currentMeasureValue);\n const keyValue = getKeyValue({\n field: hasMultipleMeasures ? `${dName}${separator}` : formattedRetinalValue,\n value,\n classPrefix,\n margin: hasMultipleMeasures ? margin : undefined,\n isSelected,\n stackedSum,\n stackedValue: currentMeasureValue instanceof InvalidAwareTypes\n ? currentMeasureValue.value()\n : currentMeasureValue.toFixed(2),\n isStackedBar\n });\n\n if (!hasMultipleMeasures) {\n keyValue.data = [icon, ...keyValue.data];\n }\n content.push(keyValue);\n });\n }\n }\n};\n\nconst getFieldInf = (schema, dataModel, context) => {\n const { valueParser, timeDiffs } = context;\n const fieldsObj = dataModel.getFieldspace().fieldsObj();\n const defFormatter = formatters(null, null, valueParser)[DimensionSubtype.CATEGORICAL];\n\n return schema.reduce((inf, field) => {\n const { subtype, name, type } = field;\n const interval = subtype === DimensionSubtype.TEMPORAL ? timeDiffs[name] : 0;\n const nf = type === FieldType.MEASURE ? fieldsObj[name].numberFormat() : val => val;\n inf[name] = {\n fn: defaultValue(formatters(nf, interval, valueParser)[subtype], defFormatter),\n displayName: `${retrieveFieldDisplayName(dataModel, name)}`\n };\n return inf;\n }, {});\n};\n\nexport const buildTooltipData = (dataModel, config = {}, context) => {\n let nestedDataObj;\n let fieldValues = [];\n const { data, schema } = dataModel.getData();\n const fieldspace = dataModel.getFieldspace();\n const fieldsConfig = dataModel.getFieldsConfig();\n const { color, shape, size } = context.retinalFields;\n const detailFields = context.detailFields || [];\n const { showStackSum = true } = context.config || {};\n const { selectedMeasures = [] } = context.payload;\n const dimensions = schema.filter(d => d.type === FieldType.DIMENSION);\n const measures = schema.filter(d => d.type === FieldType.MEASURE);\n const containsDetailField = !!intersect(schema, detailFields).length;\n const dataLen = data.length;\n const {\n dimensionMeasureMap,\n axes\n } = context;\n const fieldInf = getFieldInf(schema, dataModel, context);\n\n let displayFormat;\n if (dataLen > 1 && containsDetailField) {\n fieldValues = getTabularData({\n data,\n schema,\n fieldspace\n }, fieldInf);\n displayFormat = TABLE_FORMAT;\n } else {\n const retinalFields = [color.field, shape.field, size.field].reduce((acc, field) => {\n field && fieldsConfig[field].def.type === FieldType.DIMENSION && (acc[field] = 1);\n return acc;\n }, {});\n const filteredDimensions = dimensions.filter(field => !retinalFields[field.name]);\n const indices = filteredDimensions.map(dim => fieldsConfig[dim.name].index);\n const allMeasures = [...new Set(...Object.values(dimensionMeasureMap))];\n const isStacked = isStackedChart(context.layers);\n const isStackedBar = isStackedBarChart(context.layers);\n const filteredMeasures = !isSingleValue(dataLen, isStacked)\n ? measures.filter(d => allMeasures.indexOf(d.name) === -1)\n : measures;\n\n nestedDataObj = nestCollection({\n data,\n keys: indices\n });\n\n nestedDataObj = !('key' in nestedDataObj[0]) ? [{\n values: nestedDataObj\n }] : nestedDataObj;\n\n const generateTooltipContent = (nestedData, index = 0, content = []) => {\n const { classPrefix, separator } = config;\n for (let i = 0, len = nestedData.length; i < len; i++) {\n const { values, key } = nestedData[i];\n const field = getObjProp(schema, indices[index], 'name');\n const margin = dataLen === 1 || Object.keys(retinalFields).length === 0\n ? SINGLE_DATA_MARGIN : undefined;\n if (field) {\n const { displayName, fn } = fieldInf[field];\n const formattedValue = fn(key);\n const removeKey = !isSingleValue(dataLen, isStacked);\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: formattedValue,\n classPrefix,\n margin,\n isSelected: undefined,\n removeKey\n }));\n }\n\n if (values[0] && values[0].key) {\n generateTooltipContent(values, index + 1, content);\n } else {\n let stackedSum = 0;\n if (isStacked && showStackSum) {\n stackedSum = getStackedSum(\n values,\n fieldsConfig[measures[0].name].index\n );\n const nf = measures[0].numberFormat;\n content.push(getStackedKeyValue({\n field: `${'Total'}${separator}`,\n value: nf ? nf(stackedSum.toFixed(2)) : stackedSum.toFixed(2),\n classPrefix\n }));\n }\n for (let j = 0, len2 = values.length; j < len2; j++) {\n const valueArr = values[j];\n generateRetinalFieldsValues(valueArr, retinalFields, content, {\n fieldInf,\n axes,\n config,\n fieldsConfig,\n dimensionMeasureMap,\n dataLen,\n target: context.payload.target,\n stackedSum,\n isStackedBar\n });\n filteredMeasures.forEach((measure) => {\n const { name } = measure;\n const { displayName, fn } = fieldInf[name];\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n isSelected: selectedMeasures.indexOf(name) !== -1,\n value: fn(valueArr[fieldsConfig[name].index]),\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n });\n }\n }\n }\n };\n generateTooltipContent(nestedDataObj, 0, fieldValues);\n }\n\n return {\n content: fieldValues,\n displayFormat\n };\n};\n\n/**\n * Calculate aggregated values of measures from entry set and datamodel.\n *\n * @param {DataModel} dm DataModel instance\n * @param {EntrySet} entrySet Entry set\n */\nconst getAggregatedValues = (dm, entrySet) => {\n const fields = entrySet.fields;\n const aggFns = entrySet.aggFns;\n // Create a map of all the dimensions and the measures\n const dimsMap = entrySet.uids.reduce((acc, v) => {\n const dims = v[2];\n\n !acc[dims] && (acc[dims] = []);\n acc[dims].push(v[1]);\n return acc;\n }, {});\n const aggMeasures = Object.keys(dm.getFieldspace().getMeasure());\n const aggregatedValues = {};\n aggMeasures.forEach((measure) => {\n // Filter all the rows which has this measure and dimensions and apply aggregation.\n const groupedDm = dm.select((dmFields, id) => {\n const row = `${fields.map(field => (field === ReservedFields.ROW_ID ? id :\n dmFields[field].internalValue))}`;\n const measures = dimsMap[row];\n if (measures) {\n return measures.find(arr => arr.indexOf(measure) !== -1);\n }\n return false;\n }, {\n saveChild: false\n }).groupBy([''], {\n [measure]: aggFns[measure] === COUNT ? SUM : aggFns[measure]\n }, {\n saveChild: false\n });\n const fieldsConfig = groupedDm.getFieldsConfig();\n if (!groupedDm.isEmpty()) {\n aggregatedValues[measure] = groupedDm.getData().data[0][fieldsConfig[measure].index];\n }\n });\n return aggregatedValues;\n};\n\nexport const strategies = {\n [SELECTION_SUMMARY]: (dm, config, context) => {\n const { selectionSet } = context;\n const { classPrefix } = config;\n const tooltipConf = context.config;\n const { showMultipleMeasures } = tooltipConf;\n const aggFns = selectionSet.mergedEnter.aggFns;\n const entryUids = selectionSet.mergedEnter.uids;\n const fieldsConf = dm.getFieldsConfig();\n const aggregatedValues = getAggregatedValues(dm, selectionSet.mergedEnter);\n const values = [{\n className: `${classPrefix}-tooltip-row`,\n data: [{\n value: `${entryUids.length}`,\n style: {\n 'font-weight': 'bold'\n }\n }, 'Items Selected']\n }];\n let measures = Object.keys(aggregatedValues);\n if (!showMultipleMeasures) {\n measures = measures.slice(0, 1);\n }\n // Prepare the tooltip content\n measures.forEach((measure) => {\n const { numberFormat = defNumberFormat } = fieldsConf[measure].def;\n const value = aggregatedValues[measure];\n const rowValues = value instanceof InvalidAwareTypes ? [] : [`(${aggFns[measure].toUpperCase()})`,\n `${retrieveFieldDisplayName(dm, measure)}:`,\n {\n value: numberFormat(value),\n style: {\n 'font-weight': 'bold'\n },\n className: `${classPrefix}-tooltip-value`\n }];\n if (showMultipleMeasures) {\n values.push({\n className: `${classPrefix}-tooltip-row`,\n data: rowValues\n });\n } else {\n values[0].data.push(...rowValues);\n }\n });\n\n return values;\n },\n [HIGHLIGHT_SUMMARY]: (data, config, context) => buildTooltipData(data, config, context)\n};\n","import { Tooltip as TooltipRenderer } from '@chartshq/muze-tooltip';\nimport { mergeRecursive, defaultValue } from 'muze-utils';\nimport { strategies } from './strategies';\nimport { TOOLTIP } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\nimport { HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst configResolvers = {\n [HIGHLIGHT_SUMMARY]: (specificConf, config) => defaultValue(specificConf, config),\n default: specificConf => defaultValue(specificConf, {})\n};\n\nconst sanitizeConfig = (config, context) => {\n const strategyObj = context._strategies;\n const sanitizedConf = Object.assign({}, config);\n for (const key in strategyObj) {\n sanitizedConf[key] = defaultValue(configResolvers[key], configResolvers.default)(config[key], config);\n }\n return sanitizedConf;\n};\n\nexport default class Tooltip extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._tooltips = {};\n this._strategies = mergeRecursive({}, strategies);\n this._strategy = HIGHLIGHT_SUMMARY;\n }\n\n static defaultConfig () {\n return {\n padding: 5,\n offset: {\n x: 0,\n y: 0\n },\n highlightSummary: {\n order: 1,\n dataTransform: (dm, fields) => (fields ? dm.project(fields, { saveChild: false }) : dm)\n },\n selectionSummary: {\n order: 0,\n dataTransform: dm => dm\n }\n };\n }\n\n static formalName () {\n return TOOLTIP;\n }\n\n config (...params) {\n if (params.length) {\n const config = this._config = mergeRecursive(this._config, sanitizeConfig(params[0], this));\n const strategyObj = this._strategies;\n for (const key in strategyObj) {\n const formatter = config[key].formatter;\n this.setStrategy(key, formatter);\n }\n return this;\n }\n return this._config;\n }\n\n apply (selectionSet, payload, options = {}) {\n const dataModel = selectionSet && selectionSet.mergedEnter.model;\n\n if ((payload.criteria === null || (dataModel && dataModel.isEmpty())) || selectionSet === null) {\n this.hide(options, null);\n return this;\n }\n\n const strategy = defaultValue(options.strategy, this._strategy);\n\n this.createTooltip(dataModel, Object.assign({}, {\n payload,\n selectionSet,\n strategy,\n options\n }), null, 0);\n\n return this;\n }\n\n static target () {\n return 'all';\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n const { orientation } = this.config();\n\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const tooltip = tooltips[key];\n const strategy = options.strategy || this._strategy;\n tooltip.content(strategy, null);\n if (!Object.keys(tooltip._contents).length) {\n tooltip.hide();\n } else {\n tooltip.positionRelativeTo(tooltip._target, {\n orientation\n });\n }\n }\n }\n }\n\n getPlotPointsFromIdentifiers (payload) {\n let target = payload.target;\n let targetFields = [];\n\n if (target) {\n targetFields = target[0] || [];\n const sourceFields = payload.sourceFields;\n const indices = [];\n for (let i = 0, len = targetFields.length; i < len; i++) {\n if (sourceFields.indexOf(targetFields[i]) !== -1) {\n indices.push(i);\n }\n }\n target = target.map(d => d.filter((v, i) => indices.indexOf(i) !== -1));\n }\n\n return super.plotPointsFromIdentifiers(target || payload.criteria, {\n getBBox: true\n });\n }\n\n createTooltip (dataModel, props = {}, plotDim, key) {\n const drawingInf = this.drawingContext();\n const sourceInf = this.sourceInfo();\n const config = this.config();\n const {\n strategy,\n payload,\n selectionSet\n } = props;\n plotDim = defaultValue(plotDim, this.getPlotPointsFromIdentifiers(payload));\n plotDim = plotDim && plotDim[0];\n const pad = config.padding;\n const { showInPosition, position: tooltipPos } = payload;\n const { fields: projectFields, dataTransform } = config[strategy];\n\n const strategyFn = this._strategies[strategy];\n const dt = dataTransform(dataModel, projectFields, this);\n const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf;\n const layoutBoundBox = layoutContainer.getBoundingClientRect();\n const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect();\n\n const offsetLeft = unitBoundBox.left - layoutBoundBox.left;\n const offsetTop = unitBoundBox.top - layoutBoundBox.top;\n const tooltipInst = this._tooltips[key] = this._tooltips[key] || new TooltipRenderer(layoutContainer,\n drawingInf.svgContainer);\n\n Object.assign(sourceInf, {\n payload,\n firebolt: this.firebolt,\n detailFields: [],\n timeDiffs: sourceInf.timeDiffs,\n valueParser: this.valueParser(),\n selectionSet,\n config: config[strategy]\n });\n\n tooltipInst.context(sourceInf);\n tooltipInst.content(strategy, dt, {\n formatter: strategyFn,\n order: config[strategy].order,\n className: config[strategy].className\n })\n .config(this.config())\n .extent({\n x: 0,\n y: 0,\n width: parentContainerDimensions.width,\n height: parentContainerDimensions.height\n })\n .offset({\n x: offsetLeft + (config.offset.x || 0),\n y: offsetTop + (config.offset.y || 0)\n });\n\n if (showInPosition) {\n tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad);\n } else if (plotDim) {\n tooltipInst.positionRelativeTo({\n x: plotDim.x,\n y: plotDim.y,\n width: plotDim.width || 0,\n height: plotDim.height || 0\n }, {\n orientation: config.orientation\n }\n );\n } else {\n tooltipInst.hide();\n }\n }\n}\n","import { FieldType } from 'muze-utils';\nimport { spaceOutBoxes } from '../helper';\nimport { FRAGMENTED_TOOLTIP } from '../../enums/side-effects';\nimport Tooltip from '../tooltip';\n\nexport default class FragmentedTooltip extends Tooltip {\n static formalName () {\n return FRAGMENTED_TOOLTIP;\n }\n\n createTooltip (dataModel, props) {\n let totalHeight = 0;\n let totalWidth = 0;\n const config = this.config();\n const { strategy } = props;\n const context = this.firebolt.context;\n const drawingInf = this.drawingContext();\n\n const tooltips = this._tooltips;\n const boundBox = {\n width: drawingInf.width,\n height: drawingInf.height\n };\n const pad = config.padding;\n const dataModels = [];\n const sourceInf = context.getSourceInfo();\n const fields = sourceInf.fields;\n const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false;\n const showVertically = !!xFieldDim;\n const boxes = [];\n const uids = dataModel.getUids();\n\n dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, {\n saveChild: false\n })));\n\n const enter = {};\n for (let i = 0, len = dataModels.length; i < len; i++) {\n const dm = dataModels[i];\n const dimensions = dm.getData().schema.filter(d => d.type === FieldType.DIMENSION).map(d => d.name);\n const plotDim = context.getPlotPointsFromIdentifiers(dm.project(dimensions), { getBBox: true });\n\n super.createTooltip(dm, props, plotDim, i);\n const tooltipInst = this._tooltips[i];\n enter[i] = this._tooltips[i];\n\n const position = tooltipInst._position;\n const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect();\n\n totalHeight += tooltipBoundBox.height + pad;\n totalWidth += tooltipBoundBox.width + pad;\n\n if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) {\n break;\n }\n\n position && boxes.push({\n x: position.x,\n y: position.y,\n width: tooltipBoundBox.width,\n height: tooltipBoundBox.height,\n tooltip: tooltipInst\n });\n }\n\n for (const key in tooltips) {\n if (!enter[key]) {\n const tooltip = tooltips[key];\n tooltip.content(strategy, null);\n if (!tooltip.getContents().length) {\n tooltip.remove();\n delete tooltips[key];\n }\n }\n }\n\n boxes.length && spaceOutBoxes(boxes, boundBox, showVertically);\n boxes.forEach(box => box.tooltip.position(box.x, box.y, {\n repositionArrow: true\n }));\n\n return this;\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const strategy = options.strategy || this._strategy;\n tooltips[key].content(strategy, null);\n tooltips[key].hide();\n }\n }\n }\n}\n","export const spaceOutBoxes = (boxes, extent, showVertically) => {\n let y;\n let height;\n let x;\n let width;\n let i;\n const pad = 5;\n const len = boxes.length;\n const spaceOutIfOverlap = (firstBox, secondBox, opposite) => {\n x = firstBox.x;\n width = firstBox.width;\n y = firstBox.y;\n height = firstBox.height;\n const bottom = y + height;\n const right = x + width;\n\n if (showVertically) {\n if (opposite ? y < (secondBox.y + secondBox.height) : bottom > secondBox.y) {\n secondBox.y = opposite ? firstBox.y - secondBox.height - pad :\n bottom + pad;\n }\n } else if (opposite ? x < (secondBox.x + secondBox.width) : right > secondBox.x) {\n secondBox.x = opposite ? firstBox.x - secondBox.width - pad :\n right + pad;\n }\n };\n\n boxes.sort((a, b) => (showVertically ? a.y - b.y : a.x - b.x));\n i = 0;\n\n for (i = 0; i < len - 1; i++) {\n spaceOutIfOverlap(boxes[i], boxes[i + 1]);\n }\n\n if ((boxes[i].y + boxes[i].height) > extent.height ||\n (boxes[i].x + boxes[i].width) > extent.width) {\n if (showVertically) {\n boxes[i].y -= (boxes[i].height + boxes[i].y) - extent.height;\n } else {\n boxes[i].x -= (boxes[i].width + boxes[i].x) - extent.width;\n }\n for (i = len - 1; i > 0; i--) {\n spaceOutIfOverlap(boxes[i], boxes[i - 1], true);\n }\n }\n return boxes;\n};\n","import { selectElement, FieldType } from 'muze-utils';\n\nimport './styles.scss';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { CROSSLINE } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nexport default class Crossline extends SpawnableSideEffect {\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-crossline-group`,\n bandClass: `${CLASSPREFIX}-crossband`,\n lineClass: `${CLASSPREFIX}-crossline`\n };\n }\n\n static formalName () {\n return CROSSLINE;\n }\n\n apply (selectionSet, payload) {\n let height;\n let bandWidth;\n let px;\n let width;\n const {\n className,\n bandClass,\n lineClass\n } = this.config();\n const dataModel = selectionSet.mergedEnter.model;\n const drawingInf = this.drawingContext();\n const isEmptyDataModel = dataModel && dataModel.isEmpty();\n if (payload.criteria && isEmptyDataModel) {\n this.hide();\n return this;\n }\n if (payload.criteria === null || !dataModel) {\n this.hide();\n return this;\n }\n\n const dataObj = dataModel.getData();\n const sourceInf = this.firebolt.context.getSourceInfo();\n const axes = sourceInf.axes;\n const axisFields = sourceInf.fields;\n const fields = selectionSet.fields;\n const data = dataObj.data;\n const fieldsConfig = dataModel.getFieldsConfig();\n const svgContainer = drawingInf.sideEffectGroup;\n\n const elemData = [];\n fields.forEach((field) => {\n const fieldIndex = fieldsConfig[field] && fieldsConfig[field].index;\n const dataArr = data.map(d => d[fieldIndex]);\n const axisIndex = [['x', 0], ['x', 1], ['y', 0], ['y', 1]].find((arr) => {\n const fieldInst = axisFields[arr[0]][arr[1]];\n return fieldInst && fieldInst.type() === FieldType.DIMENSION &&\n fieldInst.getMembers().indexOf(field) !== -1;\n });\n if (axisIndex !== undefined && data.length) {\n const type = axisIndex[0];\n const axis = axes[type][axisIndex[1]];\n const value = dataArr[0];\n bandWidth = axis.getUnitWidth() || 0;\n px = axis.getScaleValue(value) + bandWidth / 2 + drawingInf.xOffset;\n\n let layers = this.firebolt.context.layers();\n layers = layers.filter(layer => !!layer.config().crossline);\n\n if (layers.length) {\n const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type]));\n const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type]));\n height = drawingInf.height;\n width = drawingInf.width;\n const startPx = px - plotWidth / 2 - pad / 2;\n const endPx = px + plotWidth / 2 + pad / 2;\n const dataPoint = {};\n if (type === 'y') {\n dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`;\n } else {\n dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`;\n }\n dataPoint.className = plotWidth ? bandClass : lineClass;\n !isNaN(px) && elemData.push(dataPoint);\n }\n }\n });\n if (elemData.length) {\n const parentGroup = this.createElement(svgContainer, 'g', [1], className);\n const elem = this.createElement(parentGroup, 'path', elemData);\n elem.attr('d', d => d.d).style('pointer-events', 'none')\n .attr('class', d => d.className);\n }\n return this;\n }\n\n hide () {\n const className = this.config().className;\n const drawingInf = this.drawingContext();\n selectElement(drawingInf.sideEffectGroup).selectAll(`.${className}`).remove();\n }\n\n static target () {\n return 'visual-unit';\n }\n}\n","import { difference, intersect } from 'muze-utils';\nimport { intersectSets } from '../../helper';\n\n/**\n * @private\n * @param {Object} set Points set\n * @param {Array.} selectedPointsId array of id of selected points\n * @return {Object} Returns the set with the selected points removed\n */\nexport const getFormattedSet = (set, selectedPointsId, intersection = false) => {\n const fn = intersection ? intersect : difference;\n const formattedSet = fn(set.uids, selectedPointsId,\n [d => d[0], d => d[0]]);\n return {\n ...set,\n ...{\n uids: formattedSet,\n length: formattedSet.length\n }\n };\n};\n\nexport const highlightSelectIntersection = (firebolt) => {\n const selectEntrySet = firebolt.getEntryExitSet('select');\n const highlightEntrySet = firebolt.getEntryExitSet('highlight');\n\n if (selectEntrySet && highlightEntrySet) {\n const intersectSet = intersectSets(firebolt, ['select', 'highlight']);\n return intersectSet;\n }\n\n return null;\n};\n","import { intersect, difference } from 'muze-utils';\nimport { getFormattedSet } from './helper';\nimport { BEHAVIOURS } from '../..';\n\nconst fadeFn = (set, context) => {\n const { formattedSet } = set;\n const {\n mergedEnter,\n mergedExit,\n exitSet,\n completeSet\n } = formattedSet;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType: 'fade', apply: false });\n } else {\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n // Apply style only on the hovered layer\n if (layerName === 'area') {\n context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: true }, [layer]);\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);\n } else {\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: true }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: false }, [layer]);\n }\n });\n }\n};\n\nconst fadeOnBrushFn = (set, context, payload) => {\n const { formattedSet } = set;\n const {\n exitSet,\n mergedEnter,\n mergedExit,\n completeSet\n } = formattedSet;\n\n const { dragEnd } = payload;\n let interactionType = 'brushStroke';\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType, apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'doubleStroke', apply: false });\n } else {\n if (dragEnd) {\n interactionType = 'doubleStroke';\n // onDrag style\n context.applyInteractionStyle(completeSet, { interactionType: 'brushStroke', apply: false });\n }\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n // Apply style only on the hovered layer\n if (layerName === 'area') {\n if (dragEnd) {\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);\n mergedEnter.length &&\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]);\n }\n } else {\n // dragEnd style\n context.applyInteractionStyle(mergedExit, { interactionType, apply: false }, [layer]);\n if (!payload.dragEnd) {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]);\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]);\n }\n\n interactionType !== 'doubleStroke' &&\n context.applyInteractionStyle(mergedExit, { interactionType: 'doubleStroke', apply: false });\n context.applyInteractionStyle(mergedEnter, { interactionType, apply: true }, [layer]);\n }\n });\n }\n};\n\nexport const strategies = {\n fade: fadeFn,\n fadeOnBrush: fadeOnBrushFn,\n focus: (set, context) => {\n const { formattedSet } = set;\n const {\n entrySet,\n mergedEnter,\n mergedExit,\n completeSet\n } = formattedSet;\n const { firebolt } = context;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType: 'focus', apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'focusStroke', apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'commonDoubleStroke', apply: false });\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focusStroke', apply: false });\n context.applyInteractionStyle(entrySet, { interactionType: 'focusStroke', apply: true });\n\n const payload = firebolt.getPayload(BEHAVIOURS.HIGHLIGHT);\n const entryExitSet = firebolt.getEntryExitSet(BEHAVIOURS.HIGHLIGHT);\n const layers = firebolt.context.layers();\n\n if (payload.target && entryExitSet) {\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n if (layerName === 'area') {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]);\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false }, [layer]);\n }\n\n // get uids of only the currently highlighted point\n const actualPoint = layer.getUidsFromPayload(entryExitSet.mergedEnter, payload.target);\n\n const commonSet = intersect(mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n\n if (commonSet.length) {\n context.applyInteractionStyle({ uids: commonSet },\n { interactionType: 'commonDoubleStroke', apply: true },\n [layer]\n );\n } else {\n context.applyInteractionStyle({ uids: mergedExit.uids },\n { interactionType: 'commonDoubleStroke', apply: false },\n [layer]\n );\n }\n });\n }\n }\n },\n highlight: (set, context, payload, excludeSetIds) => {\n const { selectionSet } = set;\n\n if (!selectionSet.mergedEnter.length && !selectionSet.mergedExit.length) {\n // Remove focusStroke on selected but currently non-highlighted set\n context.applyInteractionStyle(selectionSet.completeSet, { interactionType: 'highlight', apply: false });\n context.applyInteractionStyle(selectionSet.completeSet,\n { interactionType: 'commonDoubleStroke', apply: false }\n );\n } else {\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n if (payload.target) {\n // get uids of only the currently highlighted point\n const actualPoint = layer.getUidsFromPayload(selectionSet.mergedEnter, payload.target);\n // get uids of only the currently highlighted point excluding the excludeSet ids\n const currentHighlightedSet = getFormattedSet(actualPoint, excludeSetIds);\n\n // Apply highlight on the currently hovered point\n context.applyInteractionStyle(currentHighlightedSet,\n { interactionType: 'highlight', apply: true },\n [layer]\n );\n\n context.applyInteractionStyle(selectionSet.mergedExit,\n { interactionType: 'highlight', apply: false },\n [layer]\n );\n\n const selectEntrySet = context.firebolt.getEntryExitSet('select');\n if (selectEntrySet) {\n const commonSet = intersect(selectEntrySet.mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n const diffSet = difference(selectEntrySet.mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n\n if (commonSet.length) {\n context.applyInteractionStyle({ uids: commonSet },\n { interactionType: 'commonDoubleStroke', apply: true },\n [layer]\n );\n }\n context.applyInteractionStyle({ uids: diffSet },\n { interactionType: 'commonDoubleStroke', apply: false },\n [layer]\n );\n }\n }\n });\n }\n },\n pseudoFocus: (set, context) => {\n const { formattedSet } = set;\n const {\n mergedEnter\n } = formattedSet;\n\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false });\n }\n};\n","import SurrogateSideEffect from '../surrogate';\nimport { strategies } from './strategy';\nimport { HIGHLIGHTER } from '../../enums/side-effects';\nimport { getFormattedSet } from './helper';\n\nexport default class PlotHighlighter extends SurrogateSideEffect {\n constructor (...params) {\n super(...params);\n this._strategy = 'highlight';\n this._strategies = strategies;\n }\n\n static formalName () {\n return HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n getExcludeSetIds (excludeSet = []) {\n // Get excludeSetIds if excludeSet is a function\n if (excludeSet instanceof Function) {\n return excludeSet(this.firebolt.getEntryExitSet);\n }\n // Get excludeSetIds if excludeSet is not a function\n return excludeSet.reduce((acc, behaviour) => {\n const selectedPoints = this.firebolt.getEntryExitSet(behaviour) || {};\n const selectedPointsIds = (selectedPoints.mergedEnter || {}).uids;\n if (selectedPointsIds) acc.push(...selectedPointsIds);\n return acc;\n }, []);\n }\n\n apply (selectionSet, payload, options = {}) {\n const currentStrategy = this._strategies[options.strategy || this._strategy];\n const excludeSetIds = this.getExcludeSetIds(options.excludeSet);\n\n // Get all sets except the excludeSet points\n const formattedSet = {\n ...selectionSet,\n completeSet: getFormattedSet(selectionSet.completeSet, excludeSetIds),\n entrySet: getFormattedSet(selectionSet.entrySet[1], excludeSetIds),\n exitSet: getFormattedSet(selectionSet.exitSet[1], excludeSetIds),\n mergedEnter: getFormattedSet(selectionSet.mergedEnter, excludeSetIds),\n mergedExit: getFormattedSet(selectionSet.mergedExit, excludeSetIds)\n };\n\n const totalSet = { selectionSet, formattedSet };\n\n currentStrategy(totalSet, this, payload, excludeSetIds);\n\n return this;\n }\n}\n","import SurrogateSideEffect from '../surrogate';\n\nexport default class FilterEffect extends SurrogateSideEffect {\n static formalName () {\n return 'filter';\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static mutates () {\n return true;\n }\n\n apply (selectionSet, payload) {\n const context = this.firebolt.context;\n const entryModel = selectionSet.mergedEnter.model;\n if (payload.criteria === null) {\n context.clearCaching().resetData();\n } else {\n context.enableCaching().data(entryModel);\n }\n return this;\n }\n}\n","import { DataModel, getObjProp, mergeRecursive, ReservedFields, dmMultipleSelection } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { ANCHORS } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\nimport './styles.scss';\n\nconst addLayer = (layerRegistry, context, sideEffect) => {\n context.addLayer((layerDefs) => {\n const layers = [];\n\n if (layerDefs) {\n layerDefs.forEach((layerDef) => {\n const mark = layerDef.mark;\n const layerCls = layerRegistry[mark];\n\n if (layerCls && layerCls.shouldDrawAnchors()) {\n const depLayerEncoding = layerDef.def.encoding;\n const encoding = {\n x: getObjProp(depLayerEncoding, 'x', 'field'),\n y: getObjProp(depLayerEncoding, 'y', 'field'),\n color: {\n field: getObjProp(depLayerEncoding, 'color', 'field'),\n value: getObjProp(depLayerEncoding, 'color', 'value')\n },\n size: {\n field: getObjProp(depLayerEncoding, 'size', 'field'),\n value: () => sideEffect.defaultSizeValue()\n }\n };\n const commonName = sideEffect.constructor.formalName();\n const layerOwner = layerDef.def.name;\n const name = `${layerOwner}-${commonName}`;\n const defaultClassName = `${sideEffect.constructor.defaultConfig().className}`;\n\n layers.push({\n name: `${name}-upper`,\n mark: 'point',\n groupId: `${commonName}-upper`,\n className: `${defaultClassName}-upper`,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n\n if (mark === 'area') {\n layers.push({\n name: `${name}-lower`,\n mark: 'point',\n groupId: `${commonName}-lower`,\n className: `${defaultClassName}-lower`,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n }\n }\n });\n }\n return layers;\n });\n};\n\nexport default class AnchorEffect extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._layersMap = {};\n this.addAnchorLayers();\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-anchors-group`\n };\n }\n\n static formalName () {\n return ANCHORS;\n }\n\n addAnchorLayers () {\n const context = this.firebolt.context;\n const layerRegistry = context.registry().layerRegistry;\n\n addLayer(layerRegistry, context, this);\n return this;\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n /**\n * Returns the default area value of the anchor point.\n * @return { number } Default area value of anchor.\n */\n defaultSizeValue () {\n return 70;\n }\n\n // Default offset by which anchor size is changed\n getAnchorSizeOnInteraction ({ dragEnd }) {\n if (dragEnd) {\n return 40;\n }\n return 0;\n }\n\n apply (selectionSet, payload) {\n const dataModel = selectionSet.mergedEnter.model;\n const formalName = this.constructor.formalName();\n const context = this.firebolt.context;\n const upperAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-upper`);\n const lowerAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-lower`);\n\n const { target, action } = payload;\n let targetObj = null;\n if (target) {\n targetObj = target[1].reduce((acc, v, i) => {\n const field = target[0][i];\n if (field !== ReservedFields.MEASURE_NAMES) {\n acc[field] = v;\n }\n return acc;\n }, {});\n }\n\n [...upperAnchors, ...lowerAnchors].forEach((layer, index) => {\n const layerConfig = layer.config();\n const linkedLayer = context.getLayerByName(layerConfig.owner);\n const linkedLayerName = linkedLayer.constructor.formalName();\n const groupId = layerConfig.groupId;\n const isUpperAnchor = groupId === `${formalName}-upper`;\n let transformedData = [];\n let schema = [];\n\n [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel, index);\n\n // Render both upper and lower anchors for area plot if hovered over an anchor\n if (linkedLayerName === 'area' && target && action === 'highlight') {\n const filterFn = dmMultipleSelection(target, dataModel);\n const dmFromPayload = dataModel.select(filterFn, {});\n\n if (!isUpperAnchor) {\n [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dmFromPayload, index);\n }\n }\n\n const transformedDataModel = new DataModel(transformedData, schema);\n const anchorSizeConfig = {\n encoding: {\n size: {\n value: () => this.defaultSizeValue() + this.getAnchorSizeOnInteraction(payload)\n },\n 'stroke-width': {\n value: this.getAnchorStroke(payload, targetObj)\n }\n }\n };\n const newConfig = mergeRecursive(layerConfig, anchorSizeConfig);\n\n layer\n .data(transformedDataModel)\n .config(newConfig);\n\n return this;\n });\n }\n\n getAnchorStroke (payload, targetObj) {\n return (d) => {\n const dataObj = d.data.dataObj;\n const matchingData = targetObj ? Object.keys(targetObj).every((key) => {\n const val = dataObj[key];\n return val === targetObj[key];\n }) : false;\n return matchingData ? '1px' : '0px';\n };\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { PERSISTENT_ANCHORS } from '../enums/side-effects';\n\nexport default class PersistentAnchors extends AnchorEffect {\n static formalName () {\n return PERSISTENT_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-persistent-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n setAnchorLayerStyle (layers) {\n const anchorLayers = layers.filter(l => l.config().groupId === PERSISTENT_ANCHORS);\n anchorLayers.forEach((anchor) => {\n // Execute focusStroke interaction of anchor point layer\n const ids = anchor.data().getUids();\n const layerName = this.constructor.formalName();\n const defaultInteractionLayerEncoding = anchor.config().encoding.interaction;\n anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true });\n });\n }\n\n // offset value by which anchor size is changed\n // Applied only on select interaction\n getAnchorSizeonInteraction () {\n return 50;\n }\n\n getAnchorStroke () {\n return '2px';\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { BRUSH_ANCHORS } from '../enums/side-effects';\n\nexport default class BrushAnchors extends AnchorEffect {\n static formalName () {\n return BRUSH_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-brush-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n setAnchorLayerStyle (layers) {\n const anchorLayers = layers.filter(l => l.config().groupId === BRUSH_ANCHORS);\n anchorLayers.forEach((anchor) => {\n // Execute focusStroke interaction of anchor point layer\n const ids = anchor.data().getUids();\n const layerName = this.constructor.formalName();\n const defaultInteractionLayerEncoding = anchor.config().encoding.interaction;\n anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true });\n });\n }\n\n getAnchorStroke (payload) {\n return payload.dragEnd ? '2px' : '1px';\n }\n}\n","import SurrogateSideEffect from '../surrogate';\nimport { AXIS_LABEL_HIGHLIGHTER } from '../../enums/side-effects';\nimport './styles.scss';\n\nexport default class AxisLabelHighLighter extends SurrogateSideEffect {\n static formalName () {\n return AXIS_LABEL_HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n apply (selectionSet) {\n const context = this.firebolt.context;\n const dataModel = selectionSet && selectionSet.mergedEnter.model;\n const selectedData = dataModel && dataModel.getData().data;\n const selectedDataValues = selectedData && selectedData.length ? selectedData[0] : [];\n const { x = [], y = [] } = context.axes();\n [...x, ...y].forEach((axis) => {\n const fieldMeta = dataModel ? dataModel.getFieldsConfig()[axis.config().field] : undefined;\n const selData = selectedDataValues[fieldMeta && fieldMeta.index !== undefined\n ? fieldMeta.index : undefined];\n const { selectionSet: selectedElements, rejectionSet } = axis.getTicksBasedOnData(selData);\n selectedElements && selectedElements.selectAll('text').classed('muze-axis-ticks-highlight', true);\n rejectionSet.selectAll('text').classed('muze-axis-ticks-highlight', false);\n });\n }\n}\n","import { intersect } from 'muze-utils';\nimport * as BEHAVIOURS from './enums/behaviours';\nimport * as SIDE_EFFECTS from './enums/side-effects';\nimport { unionSets } from './helper';\n\nconst nullDataTooltipMap = {\n area: true,\n arc: false,\n line: true,\n text: false,\n point: false,\n bar: false,\n tick: false\n};\n\nconst applySideEffectOnEmptyTarget = (sideEffect, { target }) => {\n const layers = sideEffect.layers();\n const showTooltipOnEmptyTarget = layers.some((l) => {\n const layerName = l.constructor.formalName();\n return nullDataTooltipMap[layerName];\n });\n return showTooltipOnEmptyTarget || target;\n};\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: ['selectionBox', {\n name: 'highlighter',\n options: {\n strategy: 'fadeOnBrush'\n }\n }, 'brush-anchors'],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: 'highlighter',\n options: {\n strategy: 'highlight'\n }\n }, 'crossline', {\n name: 'tooltip',\n options: {\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active) {\n return null;\n }\n if (applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return selectionSet;\n }\n return null;\n }\n }\n }, 'anchors', {\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary',\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active === true ||\n !applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return null;\n }\n const selectEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.SELECT);\n const brushEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.BRUSH);\n if (selectEntrySet || brushEntrySet) {\n const unionedSet = unionSets(sideEffect.firebolt, [BEHAVIOURS.SELECT, BEHAVIOURS.BRUSH]);\n const { uids } = unionedSet.mergedEnter;\n const { uids: highlightUids } = selectionSet.mergedEnter;\n\n if (intersect(uids, highlightUids, [id => id[0], id => id[0]]).length) {\n return unionedSet;\n }\n }\n\n return null;\n }\n }\n }, {\n name: SIDE_EFFECTS.AXIS_LABEL_HIGHLIGHTER,\n options: {\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active) {\n return null;\n }\n if (applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return selectionSet;\n }\n return null;\n }\n }\n }],\n [BEHAVIOURS.FILTER]: ['filter'],\n [BEHAVIOURS.SELECT]: [{\n name: 'highlighter',\n options: {\n strategy: 'focus'\n }\n }, 'persistent-anchors', {\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary'\n }\n }],\n pseudoSelect: [{\n name: 'highlighter',\n options: {\n strategy: 'pseudoFocus'\n }\n }]\n};\n","import { componentRegistry } from 'muze-utils';\nimport * as behaviours from './actions/behavioural';\nimport { physicalActions } from './actions/physical';\nimport * as sideEffects from './side-effects';\n\nconst convertToObj = (comps) => {\n const obj = {};\n\n for (const key in comps) {\n const val = comps[key];\n\n obj[val.formalName()] = val;\n }\n return obj;\n};\n\nexport const registry = {\n behaviours: componentRegistry(convertToObj(behaviours)),\n physicalActions: componentRegistry(physicalActions),\n sideEffects: componentRegistry(convertToObj(sideEffects))\n};\n","import { ReservedFields, FieldType, difference, isSimpleObject } from 'muze-utils';\n\nconst getRangeFromData = (instance, selectionDataModel, propConfig) => {\n const dataObj = selectionDataModel.getData();\n const { includeMeasures = true, sourceIdentifiers } = propConfig;\n const schema = dataObj.schema;\n const fieldMap = instance.data().getFieldsConfig();\n const selectionDataFields = selectionDataModel.getFieldspace().fieldsObj();\n let criteria = null;\n if (sourceIdentifiers !== null) {\n criteria = schema.reduce((ranges, obj) => {\n const field = obj.name;\n const fieldObj = fieldMap[field];\n\n if (!fieldObj) {\n return ranges;\n }\n\n ranges[field] = selectionDataFields[field].domain();\n return ranges;\n }, {});\n const measureNamesIdx = sourceIdentifiers.identifiers[0]\n .findIndex(field => field === ReservedFields.MEASURE_NAMES);\n if (measureNamesIdx !== undefined && includeMeasures) {\n const measureNames = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length)\n .map(d => d[measureNamesIdx]);\n criteria[ReservedFields.MEASURE_NAMES] = measureNames.map(d => [d]);\n }\n }\n return criteria;\n};\n\nexport const payloadGenerator = {\n brush: (instance, selectionDataModel, propConfig, facetByFields) => {\n const propPayload = propConfig.payload;\n let payload;\n if (isSimpleObject(propPayload.criteria)) {\n const criteria = getRangeFromData(instance, selectionDataModel, propConfig);\n payload = Object.assign({}, propPayload);\n payload.criteria = criteria;\n } else {\n payload = payloadGenerator.__default(instance, selectionDataModel, propConfig, facetByFields);\n }\n\n return payload;\n },\n\n __default: (instance, selectionDataModel, propConfig, facetByFields = []) => {\n const { payload: propPayload, sourceIdentifiers, excludeSelectedMeasures } = propConfig;\n const dataObj = selectionDataModel.getData({ withUid: true });\n const payload = Object.assign({}, propPayload);\n const data = dataObj.data;\n const fieldsConfig = Object.assign({}, selectionDataModel.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(selectionDataModel.getFieldsConfig()).length,\n def: {\n type: FieldType.DIMENSION\n }\n }\n });\n const selectionSet = instance._selectionSet[propConfig.action];\n const selectionSetFields = selectionSet._fields;\n if (sourceIdentifiers) {\n const [facetFields = [], facetValues = []] = facetByFields;\n const facetIndices = facetFields.reduce((acc, v, i) => {\n acc[v] = i;\n return acc;\n }, {});\n const identifierIdxMap = sourceIdentifiers.fields.reduce((acc, v, i) => {\n acc[v.name] = i;\n return acc;\n }, {});\n const identifiers = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length);\n const sourceIdentifierFields = sourceIdentifiers.fields.filter(d => d.name in fieldsConfig ||\n d.name in facetIndices || d.name === ReservedFields.ROW_ID);\n\n const identifierMap = identifiers.reduce((acc, v) => {\n const key = sourceIdentifierFields.map(d => v[identifierIdxMap[d.name]]);\n const measureNamesIdx = identifierIdxMap[ReservedFields.MEASURE_NAMES];\n if (measureNamesIdx) {\n !acc[key] && (acc[key] = []);\n acc[key].push([v[measureNamesIdx]]);\n }\n return acc;\n }, {});\n\n const dataArr = [];\n for (let i = 0, len = data.length; i < len; i++) {\n const row = data[i];\n const dims = [];\n selectionSetFields.forEach((field) => {\n if (fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n const idx = fieldsConfig[field].index;\n dims.push(row[idx]);\n }\n });\n\n const vals = `${sourceIdentifierFields.map((d) => {\n if (d.name in fieldsConfig) {\n return row[fieldsConfig[d.name].index];\n } else if (d.name in facetIndices) {\n return facetValues[facetIndices[d.name]];\n }\n return null;\n }).filter(d => d !== null)}`;\n\n if (vals in identifierMap) {\n const measures = identifierMap[vals];\n const allMeasures = instance._metaData.dimensionsMap[dims];\n\n if (excludeSelectedMeasures) {\n const fn = v => `${v}`;\n const diffMeasures = difference(allMeasures, measures, [fn, fn]);\n diffMeasures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n } else {\n measures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n }\n } else {\n let measures = instance._metaData.dimensionsMap[dims];\n measures = measures && measures.length ? measures : [[]];\n measures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n }\n }\n\n payload.criteria = [[...selectionSetFields, ReservedFields.MEASURE_NAMES], ...dataArr];\n } else {\n payload.criteria = null;\n }\n\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : [];\n return payload;\n },\n pseudoSelect: (instance, selectionDataModel, propConfig, facetByFields = []) =>\n payloadGenerator.__default(instance, selectionDataModel, Object.assign({}, {\n excludeSelectedMeasures: true\n }, propConfig), facetByFields)\n};\n\nexport const getPayloadGenerator = (action, criteria) => {\n if (criteria instanceof Array || !payloadGenerator[action]) {\n return payloadGenerator.__default;\n }\n\n return payloadGenerator[action];\n};\n","import { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { FieldType, ReservedFields, defaultValue, isSimpleObject, getObjProp } from 'muze-utils';\n\nexport const initSideEffects = (sideEffects, firebolt) => {\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n sideEffects[key] instanceof SpawnableSideEffect && sideEffects[key].drawingContext(() => {\n const context = firebolt.context;\n return context.getDrawingContext();\n });\n sideEffects[key].valueParser(firebolt.context.valueParser());\n }\n }\n};\n\nexport const clearActionHistory = (context) => {\n const actionHistory = context._actionHistory;\n for (const key in actionHistory) {\n if (actionHistory[key].isMutableAction) {\n delete context._actionHistory[key];\n }\n }\n};\n\nexport const dispatchQueuedSideEffects = (context) => {\n const queuedSideEffects = context._queuedSideEffects;\n Object.entries(queuedSideEffects).forEach((entry) => {\n const sideEffect = entry[1];\n context.dispatchSideEffect(sideEffect.name, ...sideEffect.params);\n });\n context._queuedSideEffects = {};\n};\n\nexport const isSideEffectEnabled = (firebolt, { se, propagationInf }) => {\n const sideEffectPolicies = firebolt._sideEffectPolicies;\n const sideEffectCheckers = Object.values(sideEffectPolicies[se.name || se] || {});\n const { sourceIdentifiers, data: propagationData } = propagationInf;\n return sideEffectCheckers.length ? sideEffectCheckers.every(checker =>\n checker(propagationInf.propPayload, firebolt, {\n sourceIdentifiers,\n propagationData\n })) : true;\n};\n\nconst getUniqueKeys = (data, dimensions, { layers, uids, keys = {}, dimensionsMap = {} }) => {\n data.forEach((row, i) => {\n const key = dimensions.length ? dimensions.map(d => row[d.index]) : [uids[i]];\n\n layers.forEach((layer) => {\n const measureNames = Object.keys(layer.data().getFieldspace().getMeasure());\n const mKey = `${[key, ...measureNames]}`;\n keys[mKey] = defaultValue(keys[mKey], {});\n keys[mKey] = {\n dims: key,\n measureNames,\n uid: uids[i]\n };\n dimensionsMap[key] = defaultValue(dimensionsMap[key], []);\n dimensionsMap[key].push(measureNames);\n });\n });\n\n return {\n keys,\n dimensionsMap\n };\n};\n\nexport const prepareSelectionSetMap = ({ data, uids, dimensions }, layers, maps = {}) => {\n const obj = getUniqueKeys(data, dimensions, {\n layers,\n uids,\n keys: maps.keys,\n dimensionsMap: maps.dimensionsMap\n });\n\n return {\n keys: obj.keys,\n dimensionsMap: obj.dimensionsMap\n };\n};\n\nexport const prepareSelectionSetData = (dataModel, unit) => {\n const { data, uids } = dataModel.getData();\n const dimensions = Object.values(dataModel.getFieldsConfig()).filter(d => d.def.type === FieldType.DIMENSION);\n const layers = unit.layers();\n const { keys, dimensionsMap } = prepareSelectionSetMap({ data, uids, dimensions }, layers);\n const dimensionFields = dimensions.length ? dimensions.map(d => d.def.name) : [ReservedFields.ROW_ID];\n const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length;\n const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : [];\n\n return {\n keys,\n dimensions: dimensionFields,\n dimensionsMap,\n allFields: [...dimensionFields, ...measureName]\n };\n};\n\nexport const sanitizePayloadCriteria = (data, propFields, { dm, dimensionsMap, dimsMapGetter }) => {\n const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(dm.getFieldsConfig()).length,\n def: {\n name: ReservedFields.ROW_ID,\n type: FieldType.DIMENSION\n }\n }\n });\n if (data === null) {\n return null;\n }\n\n if (isSimpleObject(data)) {\n return Object.keys(data).reduce((acc, v) => {\n if (v in fieldsConfig || v === ReservedFields.MEASURE_NAMES) {\n acc[v] = data[v];\n }\n return acc;\n }, {});\n }\n\n const criteriaFields = data[0];\n const fields = criteriaFields.length ? criteriaFields.map((d, i) => ({\n name: d,\n index: i\n })) : [];\n\n const fieldIndexMap = fields.reduce((acc, v, i) => {\n acc[v.name] = i;\n return acc;\n }, {});\n\n propFields = propFields || fields.map(d => d.name);\n const dataWithFacets = [\n propFields\n ];\n\n const measureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES);\n const propDims = fields.filter(d => d.name in fieldsConfig).map(d => d.name);\n\n const dimsMap = dimsMapGetter(propDims, fieldsConfig);\n\n for (let i = 1, len = data.length; i < len; i++) {\n const row = data[i];\n const dimKey = propDims.map(field => row[fieldIndexMap[field]]);\n const origRow = dimsMap[dimKey];\n if (origRow) {\n origRow.forEach((rowVal) => {\n const newRowVal = [];\n propFields.forEach((field) => {\n if (field in fieldIndexMap) {\n const idx = fieldIndexMap[field];\n newRowVal.push(row[idx]);\n } else {\n const idx = getObjProp(fieldsConfig[field], 'index');\n idx !== undefined && newRowVal.push(rowVal[idx]);\n }\n });\n if (!measureNameField) {\n const measuresArr = dimensionsMap[newRowVal].length ? dimensionsMap[newRowVal] : [[]];\n measuresArr.forEach((measures) => {\n dataWithFacets.push([...newRowVal, ...measures]);\n });\n } else {\n dataWithFacets.push(newRowVal);\n }\n });\n }\n }\n return dataWithFacets;\n};\n\nexport const dispatchSecondaryActions = (firebolt, { action, propagationData, config, propagationInf }) => {\n const context = firebolt.context;\n\n const secondaryActions = firebolt._connectedBehaviours[action] || [];\n\n secondaryActions.forEach((secAction) => {\n const payloadGeneratorFn = firebolt.getPayloadGeneratorFor(secAction);\n const generatedPayload = payloadGeneratorFn(firebolt, propagationData, config,\n context.facetByFields());\n firebolt.dispatchBehaviour(secAction, generatedPayload, propagationInf);\n });\n};\n\nexport const createMapByDimensions = (context, dm) => {\n let cacheMap = context._cacheMap = {};\n return (propDims, fieldsConfig) => {\n cacheMap = context._cacheMap;\n if (!cacheMap[propDims]) {\n cacheMap[propDims] = dm.getData({ withUid: true }).data.reduce((acc, row) => {\n const key = propDims.map(d => row[fieldsConfig[d].index]);\n acc[key] || (acc[key] = []);\n acc[key].push(row);\n return acc;\n }, {});\n }\n return cacheMap[propDims];\n };\n};\n","import { FieldType, intersect } from 'muze-utils';\nimport { Firebolt, SIDE_EFFECTS } from '@chartshq/muze-firebolt';\nimport { payloadGenerator } from './payload-generator';\nimport {\n isSideEffectEnabled,\n sanitizePayloadCriteria,\n dispatchSecondaryActions,\n createMapByDimensions\n} from './helper';\n\nconst sideEffectPolicy = (propPayload, firebolt, propagationInf) => {\n const { sourceIdentifiers, propagationData } = propagationInf;\n const fields = sourceIdentifiers.fields;\n const sourceIdentifierFields = Object.keys(fields).filter(field =>\n field.type !== FieldType.MEASURE);\n const propFields = Object.keys(propagationData.getFieldsConfig());\n const hasCommonCanvas = propPayload.sourceCanvas === firebolt.sourceCanvas();\n return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas;\n};\n\n/**\n * This class manages the interactions of visual unit. It associates physical actions with\n * behavioural actions. It also propagates the behavioural actions to other datamodels.\n */\nexport default class UnitFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n const {\n TOOLTIP,\n HIGHLIGHTER,\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS\n } = SIDE_EFFECTS;\n this._handlers = {};\n this._propagationIdentifiers = {};\n this._connectedBehaviours = {};\n this.payloadGenerators(payloadGenerator);\n this.sideEffects().tooltip.disable();\n const disabledSideEffects = [TOOLTIP, HIGHLIGHTER, ANCHORS, BRUSH_ANCHORS, PERSISTENT_ANCHORS];\n disabledSideEffects.forEach((sideEffect) => {\n this.changeSideEffectStateOnPropagation(sideEffect, sideEffectPolicy, 'sourceTargetPolicy');\n });\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n const context = this.context;\n const unitId = context.id();\n const aliasName = context.parentAlias();\n const propagationSourceCanvas = propagationInf.propPayload && propagationInf.propPayload.sourceCanvas;\n const sourceUnitId = propagationInf.propPayload && propagationInf.propPayload.sourceUnit;\n const sideEffectInstances = this.sideEffects();\n const actionOnSource = sourceUnitId ? sourceUnitId === unitId : true;\n\n const applicableSideEffects = payload.sideEffects ? [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }] : sideEffects;\n applicableSideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n const mutates = sideEffectInstances[se.name || se].constructor.mutates();\n if (mutates && propagationInf.isMutableAction === false) {\n return false;\n }\n if (!actionOnSource && payload.criteria !== null) {\n return isSideEffectEnabled(this, { se, propagationInf });\n }\n if (propagationSourceCanvas === aliasName || actionOnSource) {\n return se.applyOnSource !== false;\n }\n\n return true;\n });\n d.effects = mappedEffects;\n });\n return applicableSideEffects;\n }\n\n shouldApplySideEffects (propInf) {\n return propInf.propagate === false && propInf.applySideEffect !== false;\n }\n\n sanitizePayload (payload) {\n const { criteria } = payload;\n const { allFields: fields, dimensionsMap } = this._metaData;\n\n return Object.assign({}, payload,\n {\n criteria: sanitizePayloadCriteria(criteria, fields, {\n dm: this.data(),\n dimensionsMap,\n dimsMapGetter: this._dimsMapGetter\n })\n });\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n let isMutableAction = false;\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const propagationData = data;\n\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n\n const payloadFn = this.getPayloadGeneratorFor(action);\n const payload = payloadFn(this, propagationData, config, context.facetByFields());\n const behaviourPolicies = this._behaviourPolicies;\n const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, this, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled !== false;\n }\n\n if (enabled) {\n const effects = this._behaviourEffectMap[action];\n const sideEffectInstances = this.sideEffects();\n isMutableAction = config.groupId ?\n effects.some(d => sideEffectInstances[d.name || d].constructor.mutates()) : config.isMutableAction;\n\n const propagationInf = {\n propagate: false,\n data: propagationData,\n propPayload,\n sourceIdentifiers,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n this._actionHistory[action] = {\n payload,\n propagationInf,\n isMutableAction\n };\n\n this.dispatchBehaviour(action, payload, propagationInf);\n\n dispatchSecondaryActions(this, {\n action,\n propagationInf,\n propagationData,\n config\n });\n }\n };\n }\n\n target () {\n return 'visual-unit';\n }\n\n createSelectionSet (...params) {\n super.createSelectionSet(...params);\n\n this._dimsMapGetter = createMapByDimensions(this, this.data());\n\n return this;\n }\n\n remove () {\n this.context.cachedData()[0].unsubscribe('propagation');\n return this;\n }\n\n propagationIdentifiers (action, identifiers) {\n if (identifiers) {\n this._propagationIdentifiers = identifiers;\n }\n return this._propagationIdentifiers[action];\n }\n\n registerPhysicalActionHandlers () {\n return this;\n }\n\n id () {\n return this.context.id();\n }\n\n getPropagationSource () {\n return this.context.cachedData()[0];\n }\n\n sourceCanvas () {\n return this.context.parentAlias();\n }\n}\n\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: false\n },\n [ACTIONS.HOVER]: {\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.LONGTOUCH]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: true\n },\n [ACTIONS.TOUCHDRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: true\n },\n [ACTIONS.CLICK]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: false\n }\n};\n","import { VolatileBehaviour } from '@chartshq/muze-firebolt';\nimport { BRUSH } from '../../enums/behaviours';\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class UnitBrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BRUSH;\n }\n\n dispatch (...params) {\n this.active = params[0].dragging;\n this.start = params[0].dragStart;\n return super.dispatch(...params);\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const PSEUDO_SELECT = 'pseudoSelect';\n\n","import { getObjProp, defaultValue, makeElement, DimensionSubtype, DataModel, createSelection } from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { layerFactory, LAYER_TYPES } from '@chartshq/visual-layer';\nimport {\n GRID_BAND,\n GRID_LINE,\n GRID_BAND_PARENT_GROUP_CLASS,\n GRID_LINE_PARENT_GROUP_CLASS,\n GRID_PARENT_GROUP\n} from '../enums/constants';\n\nconst { BAR_LAYER, TICK_LAYER } = LAYER_TYPES;\n\nconst LINEAR = ScaleType.LINEAR;\n\nconst getLayerDefinition = (context, axes, type, orientation) => {\n let encoding;\n const config = context.config();\n const { classPrefix, gridLines, gridBands } = config;\n const gridLineColor = gridLines.color;\n const zeroLineColor = gridLines.zeroLineColor;\n const defClassName = type === GRID_BAND ? gridBands.defClassName : gridLines.defClassName;\n const gridBandColor = gridBands[orientation].color;\n const axis = axes[orientation][0];\n const isLinearScale = axis.constructor.type() === LINEAR;\n\n if (type === GRID_BAND && isLinearScale) {\n encoding = {\n [orientation]: `${orientation}value`,\n [`${orientation}0`]: `${orientation}value0`\n };\n } else {\n encoding = {\n [orientation]: isLinearScale ? `${orientation}value` : `${orientation}dim`\n };\n }\n encoding.color = {\n value: (data, i) => {\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (type === GRID_BAND) {\n return gridBandColor[i % 2];\n }\n return isNegativeDomain && data[orientation] === 0 ? zeroLineColor : gridLineColor;\n }\n };\n const { color, shape, size } = context.axes();\n return {\n definition: {\n defClassName: `${defClassName}-${orientation}`,\n className: config.className,\n name: orientation,\n calculateDomain: false,\n individualClassName: (data, i) => {\n let className;\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (isNegativeDomain && data.y === 0 && type !== GRID_BAND) {\n className = `${classPrefix}-axis-zero-line`;\n } else {\n className = `${classPrefix}-grid-${type}-${orientation}-${i % 2}`;\n }\n return className;\n },\n [`pad${orientation.toUpperCase()}`]: type === GRID_BAND ? 0 : undefined,\n encoding\n },\n axes: {\n [orientation]: axis,\n color: color[0],\n shape: shape[0],\n size: size[0]\n },\n interactive: false\n };\n};\n\nconst getDefaultVisibilty = (show, axis) => {\n if (axis.constructor.type() === LINEAR) {\n return show;\n }\n return false;\n};\n\nexport const getGridLayerDefinitions = (context, config, type) => ['x', 'y'].map((axisType) => {\n const axes = context.axes();\n if (!axes[axisType]) {\n return null;\n }\n const show = defaultValue(config[axisType] && config[axisType].show,\n getDefaultVisibilty(config.show, axes[axisType][0]));\n\n return show ? getLayerDefinition(context, axes, type, axisType) : null;\n}).filter(d => d !== null);\n\nconst dimensionSubTypes = Object.values(DimensionSubtype).reduce((acc, v) => {\n acc[v] = 1;\n return acc;\n}, {});\n\nconst getValidSubtype = subtype => (!dimensionSubTypes[subtype] ? DimensionSubtype.CATEGORICAL : subtype);\n\nexport const getGridLayerData = (axes, fields, fieldsConfig) => {\n const gridData = {};\n\n ['x', 'y'].forEach((type) => {\n let ticks = axes[type][0].getTickValues();\n const subtype = getObjProp(fieldsConfig, getObjProp(fields, type, 0).getMembers()[0], 'def', 'subtype');\n const jsonData = [];\n const schema = [\n {\n name: 'yvalue',\n type: 'measure'\n }, {\n name: 'xvalue',\n type: 'measure'\n },\n {\n name: 'yvalue0',\n type: 'measure'\n }, {\n name: 'xvalue0',\n type: 'measure'\n }, {\n name: 'xdim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }, {\n name: 'ydim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }\n ];\n const len = Math.max(ticks.length);\n ticks = subtype === DimensionSubtype.TEMPORAL ? ticks.map(d => d.getTime()) : ticks;\n for (let i = 0; i < len; i += 1) {\n jsonData.push({\n [`${type}value`]: ticks[i],\n [`${type}value0`]: ticks[i + 1],\n [`${type}dim`]: ticks[i],\n [`${type}dim`]: ticks[i]\n });\n }\n gridData[type] = new DataModel(jsonData, schema);\n });\n return gridData;\n};\n\nexport const createGridLineLayer = (context) => {\n const vuConf = context.config();\n const metaInf = context.metaInf();\n const store = context.store();\n const timeDiffs = context._timeDiffs;\n [GRID_BAND, GRID_LINE].forEach((type) => {\n let mark;\n let config;\n if (type === GRID_BAND) {\n mark = BAR_LAYER;\n config = vuConf.gridBands;\n } else {\n mark = TICK_LAYER;\n config = vuConf.gridLines;\n }\n const definitions = getGridLayerDefinitions(context, config, type);\n\n const sel = `_${type}Selection`;\n context[sel] = createSelection(context[sel], (atomicDef) => {\n const inst = layerFactory.getLayerInstance({ mark });\n inst.dependencies(context._dependencies);\n const name = atomicDef.definition.name;\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: `${metaInf.namespace}${type}${name}`,\n parentNamespace: metaInf.namespace\n })\n .store(store);\n return inst;\n }, definitions, atomicDef => atomicDef.definition.name);\n\n context[sel].each((layer, atomicDef) => {\n const definition = atomicDef.definition;\n const sConf = layerFactory.getSerializedConf(mark, definition);\n const axesObj = atomicDef.axes;\n layer.config(sConf)\n .dataProps({\n timeDiffs\n })\n .axes(axesObj);\n });\n context[`_${type}`] = context[sel].getObjects();\n });\n};\n\nexport const attachDataToGridLineLayers = (context) => {\n const axes = context.axes();\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n if (gridLines.length || gridBands.length) {\n const gridLayerData = getGridLayerData(axes, context.fields(), context.data().getFieldsConfig());\n [].concat(...gridBands, ...gridLines).forEach((inst) => {\n inst.data(inst.axes().x ? gridLayerData.x : gridLayerData.y);\n });\n }\n};\n\nexport const renderGridLineLayers = (context, container) => {\n const config = context.config();\n const classPrefix = config.classPrefix;\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n const measurement = {\n width: context.width(),\n height: context.height()\n };\n const gridLineParentGroup = makeElement(container, 'g', [1], `${classPrefix}-${GRID_PARENT_GROUP}`);\n\n [[gridLines, `${classPrefix}-${GRID_LINE_PARENT_GROUP_CLASS}`],\n [gridBands, `${classPrefix}-${GRID_BAND_PARENT_GROUP_CLASS}`]].forEach((entry) => {\n const [instances, parentGroupClass] = entry;\n const mountPoint = makeElement(gridLineParentGroup, 'g', [1], `.${parentGroupClass}`);\n const className = `${parentGroupClass}-group`;\n makeElement(mountPoint, 'g', instances, `.${className}`, {\n update: (group, instance) => {\n instance.dataProps({ timeDiffs: context._timeDiffs })\n .measurement(measurement)\n .mount(group.node());\n }\n });\n });\n};\n","import {\n STATE_NAMESPACES,\n temporalFields,\n getObjProp,\n defaultValue,\n isSimpleObject\n} from 'muze-utils';\nimport { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants';\nimport { TOOLTIP, FRAGMENTED_TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects';\nimport * as PROPS from './enums/reactive-props';\nimport {\n transformDataModels,\n getDimensionMeasureMap,\n attachDataToLayers,\n attachAxisToLayers\n} from './helper';\n\nimport { createGridLineLayer } from './helper/grid-lines';\nimport { prepareSelectionSetData } from './firebolt/helper';\n\nconst removeExitLayers = (layerDefs, context) => {\n const layersMap = context._layersMap;\n const markSet = {};\n layerDefs.forEach((layerDef, i) => {\n const id = defaultValue(layerDef.name, `${layerDef.mark}-${i}`);\n markSet[id] = true;\n });\n\n for (const key in layersMap) {\n if (!(key in markSet)) {\n layersMap[key].forEach(layer => layer.remove());\n delete layersMap[key];\n }\n }\n};\n\nexport const listenerMap = [\n {\n type: 'registerImmediateListener',\n props: [PROPS.LAYERDEFS],\n listener: (context, [, layerDefs]) => {\n const fieldsVal = context.fields();\n\n if (layerDefs && fieldsVal) {\n removeExitLayers(layerDefs, context);\n const queuedLayerDefs = context._queuedLayerDefs;\n let layerDefArr = layerDefs;\n queuedLayerDefs.forEach((defFn) => {\n layerDefArr = [...layerDefArr, ...defFn(layerDefs)];\n });\n context.addLayer(layerDefArr);\n\n const adjustRange = context.layers().some(inst => inst.hasPlotSpan());\n ['x', 'y'].forEach((type) => {\n const axisArr = defaultValue(getObjProp(context.axes(), type), []);\n axisArr.forEach((axis) => {\n axis.config({\n adjustRange\n });\n });\n });\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'initialized',\n formalName: 'layer'\n });\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA],\n listener: (context, [, dataModel]) => {\n if (dataModel) {\n const axesObj = context.axes();\n const timeDiffs = {};\n const timeDiffsByField = {};\n\n Object.entries(temporalFields(dataModel)).forEach(([fieldName, fieldObj]) => {\n timeDiffsByField[fieldName] = fieldObj.minimumConsecutiveDifference();\n });\n\n Object.entries(context.fields()).forEach(([type, [field]]) => {\n if (field) {\n const timeDiff = timeDiffsByField[`${field}`];\n if (timeDiff) {\n timeDiffs[type] = timeDiff;\n axesObj[type].forEach(axis => axis.minDiff(timeDiff));\n }\n }\n });\n\n context._timeDiffsByField = timeDiffsByField;\n context._timeDiffs = timeDiffs;\n const firebolt = context.firebolt();\n const originalData = context.cachedData()[0];\n const { keys, dimensionsMap, dimensions, allFields } = prepareSelectionSetData(context.data(), context);\n firebolt._metaData = {\n dimensionsMap,\n dimensions,\n allFields\n };\n firebolt.createSelectionSet({ keys, fields: dimensions });\n firebolt.attachPropagationListener(originalData);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.CONFIG],\n listener: (context, [, config]) => {\n if (config) {\n const firebolt = context.firebolt();\n const { interaction } = config;\n firebolt.config(interaction);\n const { mode } = interaction.tooltip;\n if (mode === FRAGMENTED) {\n const map = firebolt._behaviourEffectMap;\n for (const key in map) {\n const sideEffects = map[key];\n\n map[key] = sideEffects.map((val) => {\n let name = val;\n if (isSimpleObject(val)) {\n name = val.name;\n }\n if (name === TOOLTIP) {\n return FRAGMENTED_TOOLTIP;\n }\n return val;\n });\n }\n }\n createGridLineLayer(context);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA, PROPS.TRANSFORM],\n listener: (context, [, dataModel], [, transform]) => {\n if (dataModel) {\n const dataModels = transformDataModels(transform, dataModel);\n const metaInf = context.metaInf();\n context.store().commit(`${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}.${PROPS.TRANSFORMEDDATA}`,\n dataModels, metaInf.namespace);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.TRANSFORMEDDATA, PROPS.LAYERS],\n listener: (context, [, transformedData], [, layers]) => {\n const layerAxisIndexVal = context._layerAxisIndex;\n const axesVal = context.axes();\n const dataModel = context.data();\n if (transformedData && layers && axesVal && layerAxisIndexVal) {\n context._lifeCycleManager.notify({ client: layers, action: 'beforeupdate', formalName: 'layer' });\n attachDataToLayers(layers, dataModel, transformedData);\n context._dimensionMeasureMap = getDimensionMeasureMap(layers,\n dataModel.getFieldsConfig(), context.retinalFields());\n attachAxisToLayers(axesVal, layers, layerAxisIndexVal);\n context._lifeCycleManager.notify({ client: layers, action: 'updated', formalName: 'layer' });\n }\n }\n }\n];\n","import { mergeRecursive } from 'muze-utils';\nimport { FACET_BY_FIELDS, RETINAL_FIELDS, PARENT_ALIAS, CACHED_DATA } from './enums/constants';\n\nexport const PROPS = {\n [FACET_BY_FIELDS]: {\n onset: (context, facets) => {\n const facetKeys = facets[0].reduce((acc, v, i) => {\n acc[`${v}`] = facets[1][i];\n return acc;\n }, {});\n context.facetFieldsMap(facetKeys);\n }\n },\n facetFieldsMap: {},\n [RETINAL_FIELDS]: {},\n [PARENT_ALIAS]: {},\n [CACHED_DATA]: {},\n detailFields: {},\n axes: {\n defaultValue: {\n x: [],\n y: []\n }\n },\n fields: {\n defaultValue: {\n x: [],\n y: []\n },\n sanitization: (context, value) => mergeRecursive({\n x: [],\n y: []\n }, value)\n },\n metaInf: {},\n registry: {},\n parentContainerInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {}\n};\n","import { CLASSPREFIX, CONSOLIDATED } from './enums/constants';\n\n/**\n * Returns the default configuration of the visual unit\n * @return {Object} Default configuration of visual unit\n */\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'visual-unit',\n className: '',\n trackerClassName: 'visual-unit-tracker',\n minOuterRadius: 10,\n gridLines: {\n defClassName: 'axis-grid-lines',\n className: '',\n show: true,\n color: '#efefef',\n zeroLineColor: '#b6b6b6'\n },\n gridBands: {\n defClassName: 'axis-grid-bands',\n className: '',\n show: false,\n y: {\n color: ['#fff', '#fbfbfb']\n },\n x: {\n color: ['#fff', '#f9f9f9']\n }\n },\n arcLayerClassName: 'layer-arc',\n interaction: {\n tooltip: {\n mode: CONSOLIDATED\n }\n },\n sideEffectClassName: 'side-effect-container'\n};\n","import { mergeRecursive, DataModel } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { CONFIG, LAYERDEFS, TRANSFORM, DATA, LAYERS, TRANSFORMEDDATA } from './enums/reactive-props';\nimport { sanitizeLayerDef, getValuesMap } from './helper';\n\nexport default {\n [CONFIG]: {\n value: null,\n meta: {\n sanitization: (config, oldConfig) => (\n mergeRecursive(oldConfig || mergeRecursive({}, defaultConfig), config)\n )\n }\n },\n [LAYERDEFS]: {\n value: null,\n meta: {\n preset: layerDef => sanitizeLayerDef(layerDef)\n }\n },\n [TRANSFORM]: {\n value: null\n },\n [LAYERS]: {\n value: null\n },\n [DATA]: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel,\n preset: (data, context) => {\n context._cachedValuesMap = ((model) => {\n let valuesMap = null;\n return () => {\n if (valuesMap) {\n return valuesMap;\n }\n valuesMap = getValuesMap(model, context);\n return valuesMap;\n };\n })(data);\n if (context._cache) {\n const cachedData = context.cachedData();\n context.cachedData([...cachedData, data]);\n } else {\n const oldData = context.cachedData()[0];\n oldData && oldData.unsubscribe('propagation');\n context.cachedData([data]);\n }\n }\n }\n },\n [TRANSFORMEDDATA]: {\n value: null\n },\n width: {\n value: null\n },\n height: {\n value: null\n }\n};\n","import { VolatileBehaviour } from '@chartshq/muze-firebolt';\nimport { PSEUDO_SELECT } from '../../enums/behaviours';\n\nexport default class PseudoSelectBehaviour extends VolatileBehaviour {\n static formalName () {\n return PSEUDO_SELECT;\n }\n}\n\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n setAttrs,\n getUniqueId,\n getQualifiedClassName,\n selectElement,\n transactor,\n makeElement,\n generateGetterSetters,\n getDataModelFromIdentifiers,\n isSimpleObject,\n transposeArray,\n CommonProps,\n toArray,\n STATE_NAMESPACES,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { actionBehaviourMap } from './firebolt/action-behaviour-map';\nimport UnitBrushBehaviour from './firebolt/behaviours/brush';\nimport {\n renderLayers,\n getNearestDimensionalValue,\n removeLayersBy,\n getLayersBy,\n getLayerFromDef,\n getLayerAxisIndex,\n sanitizeLayerDef,\n createSideEffectGroup,\n resolveEncodingTransform,\n createRenderPromise,\n setAxisRange,\n unionDomainFromLayers,\n createRTree\n} from './helper';\nimport { renderGridLineLayers, attachDataToGridLineLayers } from './helper/grid-lines';\nimport { listenerMap } from './listener-map';\nimport { PROPS } from './props';\nimport UnitFireBolt from './firebolt';\nimport { initSideEffects, dispatchQueuedSideEffects, clearActionHistory } from './firebolt/helper';\nimport './styles.scss';\nimport localOptions from './local-options';\nimport { WIDTH, HEIGHT } from './enums/reactive-props';\nimport { REACTIVE_PROPS } from './enums';\nimport { PSEUDO_SELECT } from './enums/behaviours';\nimport PseudoSelectBehaviour from './firebolt/behaviours/pseudo-select';\n\nconst FORMAL_NAME = 'VisualUnit';\nconst unitNs = [STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * Visual Unit is hierarchical component created by {@link VisualGroup}. This component accepts layer definitions\n * and creates concrete layer instances from them, binds data and attaches axis to them. It also retreives the domain\n * from the layers and unions them and sets them on corresponding axis instances. This also creates the parent svg\n * groups for all the layers and delegates the rendering to all the layers.\n *\n * @public\n * @module VisualUnit\n * @class\n */\nexport default class VisualUnit {\n\n /**\n * Creates instance of visualization unit.\n *\n * @param {Object} registry Component registry\n * @param {Object} dependencies Dependencies required by visual unit.\n */\n constructor (registry, dependencies) {\n this._id = getUniqueId();\n this._dependencies = dependencies;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n createRenderPromise(this);\n this._lifeCycleManager = dependencies.lifeCycleManager;\n this._layersMap = {};\n this._gridLinesSelection = null;\n this._gridBandsSelection = null;\n this._gridLines = [];\n this._gridBands = [];\n this._layerAxisIndex = {};\n this._queuedLayerDefs = [];\n layerFactory.setLayerRegistry(registry.layerRegistry);\n generateGetterSetters(this, this.constructor.getterSetters());\n this.registry(registry);\n this.cachedData([]);\n }\n\n static formalName () {\n return FORMAL_NAME;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys((this.localOptions())).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getterSetters () {\n return PROPS;\n }\n\n static localOptions () {\n return localOptions;\n }\n\n static getQualifiedStateProps () {\n const unitState = VisualUnit.getState();\n return unitState.map((state, i) => Object.keys(state).map(prop => `${unitNs[i]}.${prop}`));\n }\n\n static getListeners () {\n return {\n store: [...listenerMap.map((d) => {\n const o = Object.assign({}, d);\n const localNs = unitNs[1];\n o.props = o.props.map(prop => `${localNs}.${prop}`);\n return o;\n }), {\n type: 'registerImmediateListener',\n props: [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`],\n listener: (context) => {\n const domain = context.calculateDomainFromData();\n context.dataDomain(domain);\n }\n }, {\n type: 'registerImmediateListener',\n props: [`${unitNs[1]}.${WIDTH}`,\n `${unitNs[1]}.${HEIGHT}`,\n ...['x', 'y'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context, [, width], [, height]) => {\n if (width && height) {\n attachDataToGridLineLayers(context);\n }\n },\n subNamespace: (context) => {\n const { rowIndex, colIndex, namespace } = context.metaInf();\n return {\n [`${unitNs[1]}.${WIDTH}`]: namespace,\n [`${unitNs[1]}.${HEIGHT}`]: namespace,\n [`${groupNs}.domain.x`]: `${colIndex}0`,\n [`${groupNs}.domain.y`]: `${rowIndex}0`\n };\n }\n }],\n throwback: [\n {\n type: 'registerChangeListener',\n props: [CommonProps.ON_LAYER_DRAW],\n listener: (context, [, drawn]) => {\n if (drawn) {\n context._rtree = createRTree(context);\n\n const firebolt = context.firebolt();\n dispatchQueuedSideEffects(firebolt);\n clearActionHistory(firebolt);\n }\n context._renderedResolve();\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'drawn',\n formalName: 'layer'\n });\n }\n }\n ]\n };\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n\n store.addSubNamespace(namespace, FORMAL_NAME, this);\n throwback.addSubNamespace(namespace, FORMAL_NAME, this);\n transactor(this, this.constructor.localOptions(), store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}`\n });\n this.createFireboltInstance();\n\n return this;\n }\n return this._store;\n }\n\n createFireboltInstance () {\n const { interactions } = this.registry();\n const { fireboltDeps } = this._dependencies;\n const Cls = this.getFireboltCls();\n\n this.firebolt(new Cls(this, {\n physical: Object.assign({}, interactions.physicalActions.get(), fireboltDeps.physicalActions),\n behavioural: Object.assign({}, interactions.behaviours.get(), {\n [UnitBrushBehaviour.formalName()]: UnitBrushBehaviour,\n [PSEUDO_SELECT]: PseudoSelectBehaviour\n }, fireboltDeps.behaviouralActions),\n physicalBehaviouralMap: this.getActionBehaviourMap()\n }, Object.assign({}, interactions.sideEffects.get(), fireboltDeps.sideEffects), this.getBehaviourEffectMap()));\n\n return this;\n }\n\n getFireboltCls () {\n return UnitFireBolt;\n }\n\n getBehaviourEffectMap () {\n return behaviourEffectMap;\n }\n\n getActionBehaviourMap () {\n return actionBehaviourMap;\n }\n\n /**\n * Static helper for creates a unit instance\n *\n * @param {Object} [id] optional unique identifier for a unit; , id is calculated internally\n * @param {DataModel} data instance of datamodel\n * @param {Array.} layers layer configuration\n * @param {Object} config configurtion for the visual unit\n * @return {VisualUnit} Instance of a unit\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Returns the instance of firebolt associated with this visual unit. Firebolt dispatches the behavioural actions\n * when any physical action happens on the elements of visual unit.\n *\n * @public\n *\n * @return {Firebolt} Instance of firebolt.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Returns the unique id of this visual unit.\n *\n * @public\n * @return {string} Unique identifier.\n */\n id () {\n return this._id;\n }\n\n lockModel () {\n this.store().lockModel();\n return this;\n }\n\n unlockModel () {\n this.store().unlockModel();\n return this;\n }\n\n timeDiffsByField (...params) {\n if (params.length) {\n return this;\n }\n return this._timeDiffsByField;\n }\n\n /**\n * Renders the visual unit. It creates the layout and renders the axes and layers.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n render (container) {\n this.createRootContainers(container);\n\n setAxisRange(this);\n this.renderLayers();\n const node = this._rootSvg.node();\n const { sideEffectClassName, classPrefix } = this.config();\n this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`);\n const firebolt = this.firebolt();\n initSideEffects(firebolt.sideEffects(), firebolt);\n return this;\n }\n\n createRootContainers (container) {\n const config = this.config();\n const { className, defClassName } = config;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const width = this.width();\n const height = this.height();\n const containerSelection = selectElement(container).style('position', 'relative');\n this._rootSvg = makeElement(containerSelection, 'svg', [null], className)\n .style('width', `${width}px`).style('height', `${height}px`);\n\n const node = this._rootSvg.node();\n\n setAttrs(node, {\n width,\n height,\n class: qualifiedClassName.join(' ')\n });\n return this;\n }\n\n renderLayers () {\n const width = this.width();\n const height = this.height();\n const node = this._rootSvg.node();\n\n renderGridLineLayers(this, node);\n renderLayers(this, node, this.layers(), {\n width,\n height\n });\n return this;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Caches all the datamodels in an array from the next `data()` call on visual unit until `clearCaching()` or\n * `resetData()` is called on it.\n *\n * @public\n * @return {VisualUnit} Instance of visual unit.\n */\n\n enableCaching () {\n this._cache = true;\n return this;\n }\n\n /**\n * Clears all the previous cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n clearCaching () {\n this._cache = false;\n this.cachedData([this.cachedData()[0]]);\n return this;\n }\n\n /**\n * Returns the drawing information from visual unit.Drawing context contains the dimensions of unit and the svg\n * container of the visual unit.\n *\n * @public\n *\n * @return {Object} Drawing information.\n * ```\n * {\n * htmlContainer: // Html container of svg container of the visual unit\n * svgContainer: // Root svg container\n * width: // Width of the visual unit\n * height: // Height of the visual unit\n * sideEffectGroup: // Svg group for drawing side effect elements.\n * parentContainer: // Parent html container of the visual unit.\n * xOffset: // x offset space from the starting x position of the container,\n * yOffset: // y offset space from the starting y position of the container\n * }\n * ```\n */\n getDrawingContext () {\n const rootSvg = this._rootSvg && this._rootSvg.node();\n const width = this.width();\n const height = this.height();\n const { el, dimensions } = this.parentContainerInf();\n return {\n htmlContainer: this.mount(),\n svgContainer: rootSvg,\n width,\n height,\n sideEffectGroup: this._sideEffectGroup,\n parentContainer: el,\n parentContainerDimensions: dimensions,\n xOffset: 0,\n yOffset: 0\n };\n }\n\n /**\n * Returns the serialized configuration of visual unit.\n *\n * @return {Object} serialized configuration\n */\n serialize () {\n return {\n layers: this.layers().map(layer => layer.serialize()),\n config: this.config(),\n axes: this.axes().map(axis => axis.serialize())\n };\n }\n\n mount (...mount) {\n if (mount.length) {\n this._mount = mount[0];\n this.render(mount[0]);\n return this;\n }\n return this._mount;\n }\n\n /**\n * Adds a new layer to the visual unit. It takes a layer definition and creates layer instances from them. It does\n * not render the layers. It returns the layer instances in an array. If the layer definition is a composite layer,\n * then multiple layer instances will be returned in the array.\n *\n * To add a layer in the unit,\n * ```\n * unit.addLayer({\n * name: 'bullet',\n * mark: 'bar',\n * encoding: {\n * x: 'Year',\n * y: 'Acceleration',\n * color: 'Origin'\n * }\n * });\n * ```\n * @public\n * @param {Object} layerDef Definition of new layer.\n *\n * @return {Array} Array of layer instances.\n */\n addLayer (layerDefinition) {\n if (layerDefinition instanceof Function) {\n this._queuedLayerDefs.push(layerDefinition);\n return this;\n }\n const layerDefinitions = sanitizeLayerDef(toArray(layerDefinition));\n\n const layersMap = this._layersMap;\n const markSet = {};\n const store = {\n layers: {},\n components: {\n unit: this\n }\n };\n let layerIndex = 0;\n const metaInf = this.metaInf();\n const layers = layerDefinitions.sort((a, b) => a.order - b.order).reduce((layersArr, layerDef) => {\n const definition = layerDef.def;\n const markId = definition.name;\n const defArr = toArray(definition);\n const namespaces = [];\n defArr.forEach((def) => {\n def.order = layerDef.order + layerIndex;\n const namespace = `${metaInf.namespace}-${def.mark}-${getUniqueId()}`;\n namespaces.push(namespace);\n });\n layerIndex += defArr.length;\n const instances = getLayerFromDef(this, definition, layersMap[markId], namespaces);\n store.layers = Object.assign(store.layers, instances);\n const instanceValues = Object.values(instances);\n layersArr = layersArr.concat(...instanceValues);\n layersMap[markId] = instanceValues;\n markSet[markId] = markId;\n return layersArr;\n }, []);\n\n store.unit = this;\n const layerdeps = {};\n const layersArr = [].concat(...Object.values(this._layersMap));\n layersArr.forEach((layer) => {\n const alias = layer.alias();\n store.layers[alias] = layer;\n layerdeps[alias] = [];\n });\n layers.forEach((layer) => {\n const depArr = resolveEncodingTransform(layer, store);\n layerdeps[layer.alias()] = depArr;\n });\n\n this._layerDepOrder = layerdeps;\n this._layerAxisIndex = Object.assign(this._layerAxisIndex, getLayerAxisIndex(layers, this.fields()));\n this.layers(layersArr);\n return layers;\n }\n\n remove () {\n const formalName = this.constructor.formalName();\n const { lifeCycleManager, throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n lifeCycleManager.notify({ client: this, action: 'beforeremove', formalName: 'unit' });\n const layers = this.layers();\n this.store().removeSubNamespace(namespace, formalName);\n throwback.removeSubNamespace(namespace, FORMAL_NAME);\n selectElement(this.mount()).remove();\n this.firebolt().remove();\n // Remove layers\n lifeCycleManager.notify({ client: layers, action: 'beforeremove', formalName: 'layer' });\n [...layers, ...this._gridLines, ...this._gridBands].forEach(layer => layer.remove());\n lifeCycleManager.notify({ client: layers, action: 'removed', formalName: 'layer' });\n lifeCycleManager.notify({ client: this, action: 'removed', formalName: 'unit' });\n return this;\n }\n\n /**\n *\n *\n * @param {*} identifiers\n *\n * @memberof VisualUnit\n */\n getDataModelFromIdentifiers (identifiers, mode, parentModel, hasBarLayer) {\n if (!identifiers) return null;\n const dataModel = parentModel || this.data();\n return getDataModelFromIdentifiers(dataModel, identifiers, mode, hasBarLayer);\n }\n\n /**\n * Resets the data of visual unit to original data model. It also clears the cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n resetData () {\n this.data(this.cachedData()[0]);\n return this;\n }\n\n getSourceInfo () {\n return {\n dimensionMeasureMap: this._dimensionMeasureMap,\n fields: this.fields(),\n data: this.data(),\n axes: this.axes(),\n retinalFields: this.retinalFields(),\n layers: this.layers(),\n timeDiffs: this.timeDiffsByField()\n };\n }\n\n dataDomain (...params) {\n const { namespace } = this.metaInf();\n const store = this.store();\n const prop = `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${REACTIVE_PROPS.DOMAIN}`;\n if (params.length) {\n const domain = params[0];\n store.commit(prop, domain, namespace);\n }\n return store.get(prop, namespace);\n }\n\n getDefaultTargetContainer () {\n const { classPrefix, defClassName } = this.config();\n return [`.${classPrefix}-${defClassName}`];\n }\n\n /**\n * Returns an array of layer instances which matches the supplied mark type.\n *\n * @public\n *\n * @param {string} type Mark type of layer.\n *\n * @return {Array} Array of layer instances.\n */\n getLayersByType (type) {\n const layers = getLayersBy(this.layers(), 'type', type);\n return layers;\n }\n\n /**\n * Returns the layer instance which matches the supplied layer name. If no layer is found, then it returns\n * undefined.\n *\n * @public\n * @param {string} name Name of layer.\n *\n * @return {VisualUnit} Layer instance.\n */\n getLayerByName (name) {\n const layers = getLayersBy(this.layers(), 'name', name);\n return layers[0];\n }\n\n /**\n * Returns the point located nearest to the supplied x and y position. It returns the unique identifiers of the\n * point. This function also accepts an additional configuration `getAllPoints` inside `config` object in the third\n * argument which if set to true, then it returns the identifiers of all the points which falls on the nearest\n * x value or y value if any one of the field is a dimension. Additionally, a target property is also returned\n * which contains the identifier of the nearest point. If no nearest point is found, then it returns identifier\n * as null.\n *\n * @public\n *\n * @param {number} x X Position of the point from where nearest point is to be found.\n * @param {number} y Y Position of the point from where nearest point is to be found.\n * @param {Object} config Additional configuration options.\n * @param {boolean} config.getAllPoints If true, then returns all the points nearest to the x value or y value if\n * it is dimension.\n * @param {Object} config.data Data associated with the nearest point.\n * @return {Object} Nearest point information\n * ```\n * {\n * id: [['Origin'], ['USA'], ['Japan']], // Identifiers of all the points closest to the x value.\n * target: [['Origin'], ['Japan']] // Identifier of the nearest point.\n * }\n * ```\n */\n getNearestPoint (x, y, config) {\n let pointObj = {\n id: null\n };\n const dimValue = getNearestDimensionalValue(this, {\n x,\n y\n });\n\n if (dimValue !== null && config.getAllPoints) {\n dimValue[0].push(ReservedFields.MEASURE_NAMES);\n pointObj.id = dimValue;\n const layers = this.layers();\n const pointInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue });\n layers.forEach((layer) => {\n const measures = layer.data().getSchema()\n .filter(d => d.type === FieldType.MEASURE).map(d => d.name);\n for (let i = 1, len = dimValue.length; i < len; i++) {\n dimValue[i].push(measures.join());\n }\n });\n pointObj.target = pointInf && pointInf.id ? pointInf.id : null;\n return pointObj;\n }\n\n const markInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue }) || { id: null };\n pointObj = Object.assign({}, markInf);\n\n pointObj.target = markInf.id;\n return pointObj;\n }\n\n getMarkInfFromLayers (x, y, args) {\n const layers = this.layers();\n const len = layers.length;\n let point = null;\n // Iterate through the layers array and fetch the nearest point from each layer. If a valid\n // nearest point is found from any layer, then return that point.\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n const config = layer.config();\n if (config.interactive !== false) {\n point = layer.getNearestPoint(x, y, args);\n }\n if (point) {\n return point;\n }\n }\n return point;\n }\n\n /**\n * Get the information of all the marks such as x, y position and size from supplied identifiers. It\n * returns an array of points whose data matches the given identifiers.\n *\n * @public\n *\n * @param {Array|Object} identifiers Field names and their corresponding values.\n * ```\n * identifiers can be given in an array of array,\n * ['Origin', 'Name'], // Names of the fields supplied in first array\n * ['USA', 'ford'], // Data values of each field supplied in rest of the arrays.\n * ['Japan', 'ford']\n * or in an object,\n * {\n * Origin: ['USA']\n * }\n * ```\n * @param {Object} config Optional configurations which decides which information of the mark will\n * be retrieved.\n * @param {boolean} [config.getAllAttrs = false] If true, then returns all the information of each mark.\n * @param {boolean} [config.getBBox = false] If true, then returns the bounding box of each mark.\n *\n * @return {Array} Array of objects containing the information of each point.\n * ```\n * By default, the method returns the array of points in this structure,\n * [\n * {\n * x: 20,\n * y: 100,\n * width: 200,\n * height: 100\n * }\n * ]\n * If 'config.getAllAttrs' is true, then it returns all the information of each mark,\n * [\n * // Positions of mark on initial state of transition.\n * enter: {\n * x: 0,\n * y: 0\n * },\n * // Final positions of the mark\n * update: {\n * x: 20,\n * y: 10\n * },\n * style: // css styles of each mark\n * source: [200, 'USA'] // Row information of each mark\n * id: 20 // Row id of each mark\n * ]\n * ```\n */\n getPlotPointsFromIdentifiers (identifiers, config = {}) {\n let points = [];\n let parsedIdentifiers = identifiers;\n if (identifiers === null) {\n return [];\n }\n const layers = this.layers();\n const len = layers.length;\n if (isSimpleObject(identifiers)) {\n parsedIdentifiers = [Object.keys(identifiers)];\n parsedIdentifiers = [...parsedIdentifiers, ...transposeArray(Object.values(identifiers))];\n }\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n if (layer.config().interactive !== false) {\n points = [...points, ...layer.getPointsFromIdentifiers(parsedIdentifiers, config)];\n }\n }\n return points;\n }\n\n /**\n * Removes the layer instance which matches the supplied layer name.\n *\n * @public\n * @param {string} name Name of layer\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayerByName (name) {\n removeLayersBy('name', name);\n return this;\n }\n\n /**\n * Removes all the layer instances which matches the supplied mark type.\n *\n * @public\n * @param {string} type Mark type of layer.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayersByType (type) {\n removeLayersBy('type', type);\n return this;\n }\n\n calculateDomainFromData () {\n const domain = unionDomainFromLayers(this.layers(), this.fields(), this._layerAxisIndex,\n this.data().getFieldsConfig());\n return domain;\n }\n\n getValueFromId (id, fields, fieldsConfig) {\n const { idValuesMap } = this._cachedValuesMap();\n const row = idValuesMap[id];\n const filteredRow = fields.map(d => (d === ReservedFields.ROW_ID ? id : row[fieldsConfig[d].index]));\n\n return filteredRow;\n }\n\n getRangeFromIdentifiers ({ criteria, fields }) {\n return fields.reduce((acc, v) => {\n acc[v] = criteria[v];\n return acc;\n }, {});\n }\n\n getRangeFromPositions ({ startPos, endPos }) {\n const { x, y } = this.fields();\n const axes = this.axes();\n const xField = x[0];\n const yField = y[0];\n const xFieldType = x[0].type();\n const yFieldType = y[0].type();\n const dimensions = Object.keys(this.data().getFieldspace().getDimension());\n\n if (xFieldType === FieldType.MEASURE && yFieldType === FieldType.MEASURE) {\n const dom = {\n x: axes.x[0].invertExtent(startPos.x, endPos.x).sort((a, b) => a - b),\n y: axes.y[0].invertExtent(startPos.y, endPos.y).sort((a, b) => a - b)\n };\n const range = {};\n if (`${xField}` === `${yField}`) {\n const xdom = dom.x;\n const ydom = dom.y;\n const min = xdom[0] > ydom[0] ? ydom : xdom;\n const max = min === ydom ? xdom : ydom;\n if (min[1] < max[0]) {\n range[xField] = [];\n } else {\n range[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]];\n }\n } else {\n range[xField] = dom.x;\n range[yField] = dom.y;\n }\n return range;\n } else if (xFieldType === FieldType.DIMENSION || yFieldType === FieldType.DIMENSION) {\n const points = this._rtree.search({\n minX: startPos.x,\n minY: startPos.y,\n maxX: endPos.x,\n maxY: endPos.y\n });\n\n const criteria = [[]];\n dimensions.forEach((field) => {\n criteria[0].push(`${field}`);\n });\n\n points.forEach((point) => {\n const data = point.data;\n const vals = [];\n dimensions.forEach((field) => {\n vals.push(data[field]);\n });\n criteria.push(vals);\n });\n return criteria;\n }\n return null;\n }\n}\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n *\n *\n * @export\n * @class Variable\n */\nexport default class Variable {\n\n /**\n *\n *\n * @memberof Variable\n */\n type () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof Variable\n */\n toString () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n}\n","import Variable from './variable';\n\n/**\n * This is a wrapper on top of multiple variables which are of same type but they are shown in the same axis.This is\n * required in case of range plots or ohlc plots where one plot is mapped to multiple measure fields. At that time,\n * we need to create a composed variable from multiple variables. This class just wraps them into one variable instance\n * and provides methods to get the type and other common functionalities which can be performed on a simple variable\n * instance.\n *\n * @public\n * @class ComposeVars\n */\nclass ComposedVars extends Variable {\n\n /**\n * Creates an instance of ComposeVars.\n *\n * @param {Array} vars Array of SimpleVars.\n */\n constructor (...vars) {\n super();\n this.vars(vars);\n }\n\n vars (...params) {\n if (params.length) {\n this._vars = params[0];\n return this;\n }\n return this._vars;\n }\n\n data (...dm) {\n if (dm.length) {\n this.vars().forEach(d => d.data(dm[0]));\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n /**\n * Get all the field names from composed variable instance.\n *\n * @public\n * @return {Array} Array of field names.\n */\n getMembers () {\n const vars = this.vars();\n return vars.map(member => member.getMembers()[0]);\n }\n\n /**\n * Type of field associated with this composed variable.\n *\n * @return {string} Type of variable (Measure/Dimension).\n */\n type () {\n return this.vars()[0].type();\n }\n\n toString () {\n return this.vars().map(d => d.toString()).join(',');\n }\n\n /**\n * Returns the number formatter function of the variable.\n *\n * @return {Function} Number formatter function of the variable.\n */\n numberFormat () {\n return this.vars()[0].numberFormat();\n }\n\n format (values) {\n return this.vars()[0].format(values);\n }\n\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.vars()[0]].def;\n }\n\n /**\n * Returns the subtype of the fields associated with this variable instance.\n *\n * @public\n * @return {string} Subtype of the variable.\n */\n subtype () {\n return this.vars()[0].subtype();\n }\n\n /**\n * Returns the consecutive minimum difference of the field values.\n *\n * @public\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n return this.vars()[0].getMinDiff();\n }\n\n /**\n * Returns the display name of the fields.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return this.vars().map(d => d.displayName()).join(',');\n }\n}\n\nexport default ComposedVars;\n","import { DateTimeFormatter, retrieveFieldDisplayName, DimensionSubtype } from 'muze-utils';\nimport Variable from './variable';\n\n/**\n * This is a wrapper on top of fields passed in rows or columns in canvas. This is used to get the type of field or\n * get min difference from the field values.\n *\n * @public\n * @class SimpleVariable\n */\nexport default class SimpleVariable extends Variable {\n\n /**\n * Creates an instance of simple variable instance.\n *\n * @param {string} name Field name.\n */\n constructor (name) {\n super();\n this.oneVar(name);\n }\n\n /**\n * Gets the field name associated with this variable instance.\n *\n * @public\n * @return {string} Name of the field.\n */\n oneVar (...oneV) {\n if (oneV.length) {\n this._oneVar = oneV[0];\n return this;\n }\n return this._oneVar;\n }\n\n data (...dm) {\n if (dm.length) {\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n toString () {\n return this.oneVar();\n }\n\n /**\n * Gets the number formatter function of this variable.\n *\n * @public\n * @return {Function} Number formatter function.\n */\n numberFormat () {\n if (this.type() === 'measure') {\n const formatter = this.data().getFieldspace().getMeasure()[this.oneVar()];\n return formatter.numberFormat();\n } return val => val;\n }\n\n format (values) {\n if (values && this.subtype() === 'temporal') {\n const formatter = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n const dtFormat = new DateTimeFormatter(formatter);\n values = values.map(e => dtFormat.getNativeDate(e));\n }\n return values;\n }\n\n /**\n * Returns a formatter function which transforms the input value to its original form.\n *\n * @public\n * @return {Function} Returns raw formatter function.\n */\n rawFormat () {\n if (this.subtype() === DimensionSubtype.TEMPORAL) {\n const dateFormat = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n return val => DateTimeFormatter.formatAs(val, dateFormat);\n }\n return val => val;\n }\n\n /**\n * Return the field names associated with this variable instance.\n *\n * @public\n * @return {Array} Array of fields.\n */\n getMembers () {\n return [this.oneVar()];\n }\n\n /**\n * Returns the type of the variable. Whether it is measure or dimension.\n *\n * @public\n * @return {string} Type of variable.\n */\n type () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.type;\n }\n\n /**\n * Returns the subtype of the variable. Subtype can be categorical or temporal. If no subtype is found, then it\n * returns the type of the variable.\n *\n * @public\n * @return {string} Subtype of variable.\n */\n subtype () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.subtype || fieldDef.type;\n }\n\n /**\n * Returns the minimum consecutive difference between the data values of this variable.\n *\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n const fieldSpace = this.data().getFieldspace();\n return fieldSpace.fieldsObj()[this.oneVar()].minimumConsecutiveDifference();\n }\n\n /**\n * Returns true if two variable instances are same.If both variable has the same field names, they are equal.\n *\n * @return {Boolean} Whether two variable instances are same.\n */\n equals (varInst) {\n return this.oneVar() === varInst.oneVar();\n }\n\n /**\n * Returns the display name of the field.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return retrieveFieldDisplayName(this.data(), this.oneVar());\n }\n\n /**\n * Returns the schema defination of the field.\n *\n * @return {Object} schema def\n */\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.oneVar()].def;\n }\n}\n","import { ComposedVars, SimpleVariable } from '../variable';\nimport { DIMENSION, COLUMNS, ROWS, TEMPORAL } from '../enums/constants';\n\n/**\n * Gets the list of fields in a sorted order by measurement and dimension\n *\n * @param {Array} fieldList List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields sorted by measurement and dimensions\n */\nconst orderFields = (fieldArray, type) => {\n const dimensionArr = [[], []];\n const measureArr = [[], []];\n const temporalArr = [[], []];\n const categoricalArr = [[], []];\n\n fieldArray.forEach((fieldList, index) => {\n fieldList.forEach((field) => {\n if (field.type() === DIMENSION) {\n dimensionArr[index].push(field);\n field.subtype() === TEMPORAL ? temporalArr[index].push(field) : categoricalArr[index].push(field);\n } else {\n measureArr[index].push(field);\n }\n });\n });\n\n const numOfMeasures = measureArr[0].length + (measureArr[1] ? measureArr[1].length : 0);\n\n // Single array of fields\n if (!fieldArray[1]) {\n // Push measures to bottom\n measureArr[1] = type === COLUMNS ? measureArr[0] : [];\n // Push measures to left\n measureArr[0] = type !== COLUMNS ? measureArr[0] : [];\n // Bottom and right dimensions empty\n dimensionArr[1] = [];\n // Left and top filled with dimensions\n dimensionArr[0] = dimensionArr[0];\n if (numOfMeasures === 0) {\n const allDimensions = [...dimensionArr[0], ...dimensionArr[1]];\n if (type === COLUMNS) {\n dimensionArr[1] = allDimensions[allDimensions.length - 1] ? [allDimensions[allDimensions.length - 1]]\n : [];\n allDimensions.splice(-1, 1);\n } else {\n dimensionArr[1] = [];\n }\n dimensionArr[0] = [...allDimensions];\n }\n }\n\n if (dimensionArr[0].length && dimensionArr[1].length && numOfMeasures > 0) {\n dimensionArr[0] = [...dimensionArr[0], ...dimensionArr[1]];\n dimensionArr[1] = [];\n }\n return {\n fields: dimensionArr.map((list, i) => (i === 1 ?\n measureArr[i].concat(dimensionArr[i]) : dimensionArr[i].concat(measureArr[i]))),\n dimensions: [...dimensionArr[0], ...dimensionArr[1]],\n measures: [...measureArr[0], ...measureArr[1]],\n temporal: [...temporalArr[0], ...temporalArr[1]],\n categorical: [...categoricalArr[0], ...categoricalArr[1]]\n };\n};\n\n/**\n * Gets the list of normalized fields\n *\n * @param {Array} fields List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields normalized by measurement and dimensions\n */\nconst normalizeFields = (config, type) => {\n const fieldsArr = [];\n const fields = config[type];\n\n if (!(fields[0] instanceof Array)) {\n fieldsArr[0] = fields;\n } else {\n fieldsArr[0] = fields[0] || [];\n fieldsArr[1] = fields[1] || [];\n }\n return fieldsArr;\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} datamodel\n *\n */\nconst convertToVar = (datamodel, fields) => {\n const vars = [];\n\n fields && fields.forEach((field) => {\n if (field instanceof ComposedVars) {\n vars.push(field);\n field.data(datamodel);\n } else {\n vars.push(new SimpleVariable(field).data(datamodel));\n }\n });\n return vars;\n};\n\n/**\n *\n *\n * @param {*} rows\n * @param {*} columns\n * @param {*} datamodel\n *\n */\nexport const transformFields = (datamodel, config) => {\n const [rowsInfo, columnsInfo] = [ROWS, COLUMNS].map((fields) => {\n const normalizedFields = normalizeFields(config, fields);\n const norFields = [convertToVar(datamodel, normalizedFields[0])];\n\n if (normalizedFields[1]) {\n norFields[1] = convertToVar(datamodel, normalizedFields[1]);\n }\n return orderFields(norFields, fields);\n });\n const {\n fields: rows,\n dimensions: rowDimensions,\n measures: rowMeasures,\n temporal: rowTemporalFields,\n categorical: rowCategoricalFields\n } = rowsInfo;\n const {\n fields: columns,\n dimensions: columnDimensions,\n measures: columnMeasures,\n temporal: columnTemporalFields,\n categorical: columnCategoricalFields\n } = columnsInfo;\n return {\n rows,\n rowDimensions,\n rowMeasures,\n rowTemporalFields,\n rowCategoricalFields,\n columns,\n columnTemporalFields,\n columnCategoricalFields,\n columnDimensions,\n columnMeasures\n };\n};\n","/**\n * This file exports variables that are used as defaults for the crosstab group.\n */\nexport const DATA_UPDATE_COUNTER = 0;\n\nexport const DEFAULT_LAYER_TYPE = 'cartesian';\n\nexport const BORDER_WIDTH = {\n default: 2,\n facet: 1\n};\n","import {\n DARK,\n NONE,\n LEFT,\n RIGHT,\n NORMAL,\n TOP,\n DARKER,\n BOTTOM\n} from '../enums/constants';\n\nconst handleBlankCell = (data) => {\n data.config().externalClassname.push(`${NONE}-${LEFT}`);\n data.config().externalClassname.push(`${NONE}-${RIGHT}`);\n};\n\nexport const sanitiseHeaderMatrix = (matrices, header) => {\n if (header) {\n for (let i = 0; i < matrices.length; i++) {\n if (i !== 0) {\n matrices[i].config({\n externalClassname: [`${DARK}`]\n });\n } else {\n matrices[i].config({\n externalClassname: [`${NONE}-${LEFT}`, `${DARK}`]\n });\n }\n }\n } else {\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [`${DARK}`]\n });\n }\n }\n }\n};\n\nexport const sanitiseGeomMatrix = (matrices, arr = {}) => {\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [`${NORMAL}`]\n });\n\n if (i === 0) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${TOP}`);\n } else if (i === matrices.length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n }\n\n if (j === matrices[i].length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARK}-${RIGHT}`);\n }\n\n if (arr[i]) {\n matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n }\n }\n};\n\nexport const sanitiseFacetValues = (matrices, type, blankCell) => {\n const normal = type === `${RIGHT}` ? `${DARK}` : `${NORMAL}`;\n const length = matrices.length;\n let latestSource = matrices[0][0].source();\n const lastSource = matrices[matrices.length - 1][0].source();\n const arr = {};\n\n // initialise the classname\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [normal]\n });\n }\n\n // seperate wrt the corner most facet\n if (matrices[i][0].source() !== latestSource) {\n arr[i] = i;\n latestSource = matrices[i][0].source();\n }\n }\n\n // add custom classname\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n if (j === 0) {\n matrices[i][0].config().externalClassname.push(`${NONE}-${type}`);\n if (matrices[i][j].source() === lastSource) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n } else {\n matrices[i][0].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n if (matrices[i][j] instanceof blankCell) {\n matrices[i][j].config().externalClassname.push(`${NONE}-${TOP}`);\n matrices[i][j].config().externalClassname.push(`${NONE}-${BOTTOM}`);\n }\n } else if (j !== matrices[i].length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARK}-${type}`);\n }\n\n if (i === 0) {\n matrices[0][j].config().externalClassname.push(`${DARKER}-${TOP}`);\n } else if (i === length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n }\n\n if (arr[i]) {\n matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n\n if (matrices[i][j] instanceof blankCell) {\n handleBlankCell(matrices[i][j], blankCell);\n }\n }\n }\n return arr;\n};\n\nexport const sanitiseBorderMatrix = (matrices, blankCell) => {\n const { leftMatrix, rightMatrix, topMatrix, bottomMatrix } = matrices;\n let bottomBorderObj = {};\n if (rightMatrix.length) {\n bottomBorderObj = sanitiseFacetValues(rightMatrix, `${RIGHT}`, blankCell);\n }\n if (leftMatrix.length) {\n bottomBorderObj = sanitiseFacetValues(leftMatrix, `${LEFT}`, blankCell);\n }\n topMatrix.length && sanitiseHeaderMatrix(topMatrix);\n bottomMatrix.length && sanitiseHeaderMatrix(bottomMatrix);\n return bottomBorderObj;\n};\n","import { Store, COORD_TYPES, getObjProp, DataModel } from 'muze-utils';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { DATA_UPDATE_COUNTER } from '../enums/defaults';\nimport { Variable } from '../variable';\nimport { PolarEncoder, CartesianEncoder } from '../encoder';\nimport { sanitiseHeaderMatrix } from './cell-border-applier';\nimport {\n DIMENSION,\n MEASURE,\n ORDINAL,\n LINEAR,\n ROW,\n COLUMN,\n COL,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n COLOR,\n SIZE,\n TEMPORAL,\n SHAPE,\n INTERACTION,\n GRID_LINES,\n GRID_BANDS,\n HEADER,\n FACET,\n X,\n Y,\n ARC,\n RADIUS,\n ANGLE\n} from '../enums/constants';\n\nconst POLAR = COORD_TYPES.POLAR;\n\n/**\n * Creates an instance of a store which contains the arguments to make the class reactive\n *\n * @return {Object} instance of store\n * @memberof VisualGroup\n */\nexport const initStore = () => new Store({\n [DATA_UPDATE_COUNTER]: DATA_UPDATE_COUNTER\n});\n\n/**\n *\n *\n * @param {*} arr\n */\nexport const isDistributionEqual = arr => [...arr[0], ...arr[1]].reduce((isEqual, row) => {\n const rowType = row.type();\n\n if (rowType === MEASURE || rowType === TEMPORAL) {\n isEqual = true;\n }\n return isEqual;\n}, false);\n\n/**\n *\n *\n */\nexport const initializeCacheMaps = () => ({\n cellMap: new Map(),\n xAxesMap: new Map(),\n yAxesMap: new Map(),\n entryCellMap: new Map(),\n exitCellMap: new Map()\n});\n\n/**\n *\n *\n * @param {*} axisName\n * @param {*} id\n */\nexport const getAxisKey = (axisName, ...params) => `${axisName}-axis-${params.join('-')}`;\n\n/**\n *\n *\n * @param {*} rowId\n * @param {*} columnId\n */\nexport const getCellKey = (rowId, columnId) => `cell-${rowId}-${columnId}`;\n\n/**\n *\n *\n * @param {*} config\n *\n */\nexport const extractUnitConfig = (config) => {\n const unitConfig = {};\n const attrNames = [INTERACTION, GRID_LINES, GRID_BANDS];\n\n attrNames.forEach((attr) => {\n if (config[attr] !== undefined) {\n unitConfig[attr] = config[attr];\n }\n });\n return unitConfig;\n};\n\nexport const hasOneField = (fields) => {\n let hasField = false;\n const keys = Object.keys(fields);\n hasField = keys.some(d => fields[d].length > 0);\n return hasField;\n};\n\n/**\n *\n *\n * @param {*} headers\n * @param {*} index\n * @param {*} rowLength\n *\n * @memberof MatrixResolver\n */\nexport const getHeaderText = (headers, index, rowLength) => {\n let header = '';\n\n if (index === rowLength - 1 && headers.length > rowLength) {\n for (let i = index; i < headers.length - 1; i++) {\n header += `${headers[i].toString()} / `;\n }\n header += headers[headers.length - 1].toString();\n return header;\n } else if (headers[index]) {\n return headers[index].toString();\n }\n return '';\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} fieldHeaders\n * @param {*} TextCell\n * @param {*} labelManager\n *\n */\nexport const headerCreator = (fields, fieldHeaders, TextCell, { classPrefix, labelManager }) => {\n const headers = fields.length > 0 ? fields[0].map((cell, i) => new TextCell({\n type: HEADER,\n className: `${classPrefix}-grid-headers`\n }, {\n labelManager\n }).source(getHeaderText(fieldHeaders, i, fields[0].length))\n .config({ show: cell.config().show })) : [];\n sanitiseHeaderMatrix(headers, true);\n return headers;\n};\n\n/**\n *\n *\n * @param {*} variable\n * @param {*} allFields\n *\n */\nexport const findInGroup = (variable, allFields) => {\n let channel = null;\n\n [COLOR, SIZE, SHAPE].forEach((e) => {\n if (this.store.get(e) && variable === this.store.get(e)[0]) {\n channel = e;\n }\n });\n\n if (channel) {\n return { channel };\n }\n [ROW, COL].forEach((facetType) => {\n allFields[`${facetType}Facets`].forEach((e) => {\n if (e.toString() === variable) {\n channel = { channel: FACET, type: facetType === COL ? COLUMN : ROW };\n }\n });\n });\n\n if (channel) {\n return channel;\n }\n\n [ROW, COL].forEach((projType) => {\n allFields[`${projType}Projections`].forEach((e) => {\n e.forEach((m) => {\n if (m.toString() === variable) {\n channel = projType === COL ? X : Y;\n }\n });\n });\n });\n\n if (channel) {\n return { channel };\n }\n return null;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} field\n */\nexport const getAxisType = (fieldsConfig, field) => {\n let fieldType = ORDINAL;\n\n if (field && fieldsConfig[field].def.type !== DIMENSION) {\n fieldType = LINEAR;\n }\n return fieldType;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} fieldName\n *\n */\nexport const retriveDomainFromData = (datamodel, fieldName) => {\n const field = datamodel.getFieldspace().fields.find(d => d.name() === fieldName.toString());\n return field.domain();\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n let xAxes = null;\n let yAxes = null;\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n\n xAxisSet && xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes = xAxes || [];\n xAxes.push(xAxis);\n });\n\n yAxisSet && yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes = yAxes || [];\n yAxes.push(yAxis);\n });\n\n return {\n xAxes, yAxes\n };\n};\n\nconst hasPolarEncodings = layerConf => layerConf.mark === ARC || [RADIUS, ANGLE].some(field =>\n getObjProp(layerConf.encoding, field));\n\n/**\n *\n *\n * @param {*} layers\n *\n */\nexport const getEncoder = (layers) => {\n let encoder = new CartesianEncoder();\n\n if (layers.length) {\n // Figuring out the kind of layers the group will have\n encoder = layers.some(layerConf => hasPolarEncodings(layerConf)) ? new PolarEncoder() : encoder;\n }\n return encoder;\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} userAxisFromConfig\n *\n */\nexport const getHeaderAxisFrom = (type, fields, userAxisFromConfig) => {\n let axisFrom = userAxisFromConfig[type];\n let headerFrom = '';\n const options = type === ROW ? [LEFT, RIGHT] : [BOTTOM, TOP];\n const [firstField, secondField] = fields;\n const firstFieldType = i => (firstField.length ? firstField[i].type() : null);\n const secondFieldType = i => (secondField.length ? secondField[i].type() : null);\n\n if (firstFieldType(firstField.length - 1) === DIMENSION && secondFieldType(0) === DIMENSION) {\n headerFrom = axisFrom ? options[1 - options.indexOf(axisFrom)] : options[1];\n\n if (type === COLUMN && (firstField[firstField.length - 1].toString() === secondField[0].toString())) {\n axisFrom = TOP;\n } else {\n axisFrom = axisFrom || options[0];\n }\n } else if (secondFieldType(secondField.length - 1) === DIMENSION) {\n headerFrom = type === ROW ? RIGHT : BOTTOM;\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else {\n headerFrom = type === ROW ? LEFT : TOP;\n axisFrom = type === ROW ? LEFT : TOP;\n }\n if (firstFieldType(firstField.length - 1) === MEASURE && secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n } else if (secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else if (firstFieldType(firstField.length - 1) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n }\n return [headerFrom, axisFrom];\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} layers\n *\n * @memberof MatrixResolver\n */\nexport const setFacetsAndProjections = (context, fieldInfo, encoder) => {\n const {\n fields,\n type\n } = fieldInfo;\n const { facets, projections } = encoder.simpleEncoder.getFacetsAndProjections(fields, type);\n\n context.facets({ [`${type}Facets`]: facets });\n context.projections({ [`${type}Projections`]: projections });\n\n return { facets, projections, fields };\n};\n\nconst getRowBorders = (left, right) => {\n const borders = {};\n borders.top = false;\n borders.bottom = false;\n if (left.length > 1 || right.length > 1) {\n borders.top = true;\n borders.bottom = true;\n }\n return borders;\n};\n\nconst getColumnsBorders = (top, bottom) => {\n const borders = {};\n borders.left = false;\n borders.right = false;\n if (top.length || bottom.length) {\n if ((top[0] && top[0].length > 1) || (bottom[0] && bottom[0].length > 1)) {\n borders.left = true;\n borders.right = true;\n }\n }\n return borders;\n};\n\nconst getValueBorders = (rows, columns) => {\n const borders = { top: true, left: true, bottom: true, right: true };\n const borderTypeRow = [LEFT, RIGHT];\n const borderTypeCol = [TOP, BOTTOM];\n rows.forEach((e, i) => {\n if (e[0] && e[0].length) {\n borders[borderTypeRow[i]] = true;\n } else {\n borders[borderTypeRow[i]] = false;\n }\n });\n columns.forEach((e, i) => {\n if (e.length) {\n borders[borderTypeCol[i]] = true;\n } else {\n borders[borderTypeCol[i]] = false;\n }\n });\n\n return borders;\n};\n\nexport const getBorders = (matrices, encoder) => {\n let showRowBorders = { top: false, bottom: false };\n let showColBorders = { left: false, right: false };\n let showValueBorders = { top: false, bottom: false, left: false, right: false };\n const {\n rows,\n columns,\n values: valueMatrix\n } = matrices;\n const [leftRows, rightRows] = rows;\n const [topColumns, bottomColumns] = columns;\n const {\n rowDimensions,\n columnDimensions,\n rowTemporalFields,\n columnTemporalFields,\n columnMeasures,\n rowMeasures\n } = encoder.fieldInfo();\n const allDimensionLength = rowDimensions.length + columnDimensions.length;\n const allMeasuresLength = rowMeasures.length + columnMeasures.length;\n const allTemporalFieldsLength = rowTemporalFields.length + columnTemporalFields.length;\n\n if (encoder.constructor.type() === POLAR) {\n if (!allDimensionLength) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n } else if (!allMeasuresLength && !allTemporalFieldsLength && allDimensionLength <= 2) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n\n showRowBorders = getRowBorders(leftRows, rightRows);\n showColBorders = getColumnsBorders(topColumns, bottomColumns);\n showValueBorders = getValueBorders([leftRows, rightRows], [topColumns, bottomColumns]);\n\n if (valueMatrix.length > 1) {\n showValueBorders.top = true;\n showValueBorders.bottom = true;\n }\n if (valueMatrix.length && valueMatrix[0].length > 1) {\n showValueBorders.left = true;\n showValueBorders.right = true;\n }\n return { showRowBorders, showColBorders, showValueBorders };\n};\n\nexport const getFieldsFromSuppliedLayers = (suppliedLayerConfig) => {\n const encodingArr = suppliedLayerConfig.map(conf => (conf.encoding || {}));\n const fields = [].concat(...encodingArr.map(enc => Object.values(enc).map(d => (typeof d === 'object' ?\n d.field : d))));\n return [...new Set(fields.filter(d => d))];\n};\n\nexport const extractFields = (facetsAndProjections, layerFields) => {\n const fields = Object.values(facetsAndProjections).map((arr) => {\n const flattenArray = [].concat(...arr);\n return [].concat(...flattenArray.map((field) => {\n if (field instanceof Variable) {\n return field.getMembers();\n }\n return field;\n }));\n });\n return [].concat(...fields, ...layerFields);\n};\n\n/**\n * This method sorts the facets fields inplace if field is of categorical type\n * @param {Object} facets Array of facets\n * @param {Array} keys Array of the facet field values\n * @param {Object} config configuration object\n * @return {Array} Returns sorted facets\n */\nexport const sortFacetFields = (facets, keys, config) => {\n /**\n * Check if the facet sorted by the user is plotted\n * If an incorrect field is sorted, return the keys as is\n */\n const schema = [];\n const facetNames = [];\n const sortInfo = [];\n const sortConfig = config.sort;\n\n facets.forEach((facet) => {\n const name = `${facet}`;\n facetNames.push(name);\n\n const facetSortConfig = sortConfig[name];\n\n if (facetSortConfig) {\n sortInfo.push([name, facetSortConfig]);\n } else {\n sortInfo.push([name, null]);\n }\n schema.push(facet.getSchemaDef());\n });\n\n return new DataModel([facetNames, ...keys], schema).getData({ sort: sortInfo }).data;\n};\n\nexport const removeExitCells = (resolver) => {\n const exitCells = resolver.cacheMaps().exitCellMap;\n const store = resolver.store();\n const qualifiedStateProps = [].concat(...VisualUnit.getQualifiedStateProps(),\n ...BaseLayer.getQualifiedStateProps());\n store.lockCommits(qualifiedStateProps);\n exitCells.forEach((placeholder) => {\n placeholder.remove();\n });\n store.unlockCommits(qualifiedStateProps);\n};\n","export const PROPS = {\n layers: {},\n data: {},\n globalConfig: {}\n};\n","import { ERROR_MSG, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { transformFields } from './field-sanitizer';\nimport { getHeaderAxisFrom, getFieldsFromSuppliedLayers, hasOneField } from '../group-helper/group-utils';\nimport { ROW, COLUMN } from '../enums/constants';\nimport { PROPS } from './props';\n\n/**\n *\n *\n * @export\n * @class VisualEncoder\n */\nexport default class VisualEncoder {\n\n constructor () {\n generateGetterSetters(this, PROPS);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n createAxis () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n setCommonDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n getLayerConfig () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n fieldInfo (...info) {\n if (info.length) {\n this._fieldInfo = mergeRecursive(this._fieldInfo || {}, info[0]);\n return this;\n }\n return this._fieldInfo;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof VisualEncoder\n */\n fieldSanitizer (datamodel, config) {\n this.fieldInfo(transformFields(datamodel, config));\n return this.fieldInfo();\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n axisFrom (...params) {\n if (params.length) {\n this._axisFrom = params[0];\n return this;\n }\n return this._axisFrom;\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n headerFrom (...params) {\n if (params.length) {\n this._headerFrom = params[0];\n return this;\n }\n return this.__headerFrom;\n }\n\n /**\n *\n *\n * @param {*} axisFrom\n *\n * @memberof CartesianEncoder\n */\n setAxisAndHeaders (axisFrom = {}, fields) {\n const [rowHeader, rowAxis] = getHeaderAxisFrom(ROW, fields.rows, axisFrom);\n const [colHeader, colAxis] = getHeaderAxisFrom(COLUMN, fields.columns, axisFrom);\n\n this.axisFrom({\n row: rowAxis,\n column: colAxis\n });\n this.headerFrom({\n row: rowHeader,\n column: colHeader\n });\n return this;\n }\n\n getProjectionFields (layers) {\n return getFieldsFromSuppliedLayers(layers);\n }\n\n hasMandatoryFields (fields) {\n return hasOneField(fields);\n }\n}\n","import { ContinousAxis, BandAxis, TimeAxis, ColorAxis, SizeAxis, ShapeAxis } from '@chartshq/muze-axis';\n\nexport const scaleMaps = {\n linear: ContinousAxis,\n band: BandAxis,\n temporal: TimeAxis,\n size: SizeAxis,\n color: ColorAxis,\n shape: ShapeAxis\n};\n","import { DataModel, mergeRecursive } from 'muze-utils';\nimport { sortFacetFields } from './group-utils';\nimport { BORDER_WIDTH } from '../enums/defaults';\nimport { FACET } from '../enums/constants';\n\n/**\n* Gets name of fields form the variables\n*\n* @param {*} fields1\n* @param {*} [fields2=[]]\n*\n*/\nconst getFieldNames = fieldVar => fieldVar.reduce((acc, d) => {\n acc = [...acc, ...d.getMembers()];\n return acc;\n}, []);\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareProjectionInfo = (fieldInfo) => {\n const {\n colProjections,\n rowProjections\n } = fieldInfo;\n const uniqueFields = [];\n let indices = [];\n let projections = [];\n\n rowProjections.forEach((rowProj, rIndex) => {\n const newRIndex = rIndex;\n colProjections.forEach((colProj, cIndex) => {\n const newCIndex = cIndex;\n const newRowProj = getFieldNames(rowProj);\n const newColProj = getFieldNames(colProj);\n\n uniqueFields.push([...newRowProj, ...newColProj]);\n indices.push({ rowIndex: newRIndex, colIndex: newCIndex });\n projections.push({ rowFields: rowProj, columnFields: colProj });\n });\n });\n indices = indices.length ? indices : [{ rowIndex: 0, colIndex: 0 }];\n projections = projections.length ? projections : [{ rowFields: [], columnFields: [] }];\n return { uniqueFields, indices, projections };\n};\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareFacetInfo = (fieldInfo) => {\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const rowFacetNames = getFieldNames(rowFacets);\n const colFacetNames = getFieldNames(colFacets);\n const allFacets = [...rowFacetNames, ...colFacetNames];\n\n return { rowFacetNames, colFacetNames, allFacets, rowFacets, colFacets };\n};\n\n/**\n*\n*\n* @param {*} context\n* @param {*} facetNames\n* @param {*} hashMap\n* @param {*} keys\n* @param {*} index\n* @returns\n*/\nconst prepareHashMaps = (context, facetNames, hashMap, keys, index) => {\n const rowKey = [];\n facetNames.forEach((name) => {\n const key = context._derivation[context._derivation.length - 1].meta.keys[name];\n\n rowKey.push(key);\n });\n\n const joinedRowKey = rowKey.join(',');\n\n if (hashMap[joinedRowKey] === undefined) {\n hashMap[joinedRowKey] = index++;\n keys.push(rowKey);\n }\n return rowKey;\n};\n\nconst createJoinedKeys = keys => keys.map(e => ({\n keyArr: e,\n joinedKey: e.join(',')\n}));\n\nconst setDefaultConfigForFacet = (facetInfo, projectionInfo, config) => {\n let conf = {};\n\n if (facetInfo.allFacets.length || projectionInfo.indices.length > 1) {\n const { facetsUserConfig, border } = config;\n const { isBorderPresent, isGridLinePresent } = facetsUserConfig;\n const gridLinesShowLength = Object.keys(isGridLinePresent).length;\n let borderWidth = border.width;\n let gridLines = {};\n\n if (!isBorderPresent) {\n borderWidth = BORDER_WIDTH[FACET];\n }\n if (gridLinesShowLength <= 0) {\n gridLines = {\n x: {\n show: false\n }\n };\n }\n conf = {\n border: {\n width: borderWidth\n },\n gridLines\n };\n }\n return conf;\n};\n\n/**\n*\n*\n* @param {*} splitModels\n* @param {*} facetInfo\n* @returns\n*/\nconst getSplitModelHashMap = (splitModels, facetInfo, config) => {\n const {\n rowFacetNames,\n colFacetNames,\n rowFacets,\n colFacets\n } = facetInfo;\n\n const rowKeyHashMap = {};\n const colKeyHashMap = {};\n\n const rowKeys = [];\n const colKeys = [];\n const rowIndex = 0;\n\n const splitModelsHashMap = {};\n\n splitModels.forEach((splitContext) => {\n const rowKey = prepareHashMaps(splitContext, rowFacetNames, rowKeyHashMap, rowKeys, rowIndex);\n const colKey = prepareHashMaps(splitContext, colFacetNames, colKeyHashMap, colKeys, 1);\n\n splitModelsHashMap[`${rowKey}-${colKey}`] = splitContext;\n });\n\n return {\n splitModelsHashMap,\n rowKeys: createJoinedKeys(sortFacetFields(rowFacets, rowKeys, config)),\n colKeys: createJoinedKeys(sortFacetFields(colFacets, colKeys, config))\n };\n};\n\n/**\n * Formats row or columns keys with the provided formatter.\n *\n * @param {Array} keys - The collection of row or column keys.\n * @param {Array} formatterList - The list of corresponding formatter.\n */\nconst formatKeys = (keys, formatterList) => {\n const formattedKeys = [];\n keys.forEach((rKeys, rIdx) => {\n formattedKeys[rIdx] = [];\n rKeys.forEach((key, idx) => {\n formattedKeys[rIdx][idx] = formatterList[idx](key);\n });\n });\n return formattedKeys;\n};\n\n/**\n*\n*\n* @param {Object} context\n* @param {Object} fieldInfo\n* @returns\n*/\nconst splitByColumn = (context, optionalProjections) => {\n const {\n matrix,\n dataModel,\n rowIndex,\n colIndex,\n facetInfo,\n projectionInfo,\n geomCellCreator\n } = context;\n const {\n indices,\n uniqueFields,\n projections\n } = projectionInfo;\n\n const commonFields = optionalProjections;\n\n dataModel.splitByColumn(uniqueFields, commonFields).forEach((model, i) => {\n let { rowIndex: row, colIndex: col } = indices[i];\n row += rowIndex;\n col += colIndex;\n\n matrix[row] = matrix[row] || [];\n\n const projectionIndexObject = {\n indices: {\n rowIndex: row,\n columnIndex: col\n },\n projections: projections[i]\n };\n\n matrix[row][col] = geomCellCreator(model, projectionIndexObject, facetInfo);\n });\n const lastIndex = indices[indices.length - 1];\n\n return {\n rowIndex: lastIndex.rowIndex + rowIndex,\n colIndex: lastIndex.colIndex + colIndex\n };\n};\n\nconst createColumnDataModels = (colContext, fieldInfo, sourceDM) => {\n let context = {};\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n const {\n rowKeyArr,\n rowKey,\n colKeyObj,\n newRowIndex,\n splitModelsHashMap,\n currentColumnIndex\n } = colContext;\n\n const { keyArr: colKeyArr, joinedKey: colKey } = colKeyObj;\n const hashMapKey = splitModelsHashMap[`${rowKey}-${colKey}`];\n\n if (hashMapKey) {\n context = { dataModel: hashMapKey };\n } else {\n const emptyDm = new DataModel([], sourceDM.getData().schema);\n context = { dataModel: emptyDm };\n }\n\n context = {\n ...context,\n ...colContext,\n facetInfo: {\n rowFacets: [rowFacets, rowKeyArr],\n colFacets: [colFacets, colKeyArr]\n },\n rowIndex: newRowIndex,\n colIndex: currentColumnIndex\n };\n const dataModels = splitByColumn(context, fieldInfo.optionalProjections);\n\n return {\n columnIndex: dataModels.colIndex + 1,\n rowIndex: dataModels.rowIndex\n };\n};\n\nconst createRowDataModels = (rowContext, fieldInfo, sourceDM) => {\n let currentColumnIndex = 0;\n let rowIndexForCurrentKey = 0;\n const {\n colKeys,\n rowKeyObj,\n currentRowIndex\n } = rowContext;\n const newRowIndex = currentRowIndex;\n const { keyArr: rowKeyArr, joinedKey: rowKey } = rowKeyObj;\n const colContext = {\n ...rowContext,\n rowKeyArr,\n rowKey,\n newRowIndex\n };\n rowIndexForCurrentKey = currentRowIndex;\n if (colKeys.length) {\n colKeys.forEach((colKeyObj) => {\n colContext.colKeyObj = colKeyObj;\n colContext.currentColumnIndex = currentColumnIndex;\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n });\n } else {\n colContext.colKeyObj = { keyArr: [], joinedKey: '' };\n colContext.currentColumnIndex = currentColumnIndex;\n\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n }\n return {\n rowIndex: ++rowIndexForCurrentKey\n };\n};\n\n/**\n* Gets Matrixes for corresponding datamodel, facets and projections\n*\n* @param {Object} dataModel input datamodel\n* @param {Object} fieldInfo Information about the fields\n* @param {Function} geomCellCreator Callback executed after datamodels are prepared after sel/proj\n* @return {Object} set of matrices with the corresponding row and column keys\n*/\nexport const getMatrixModel = (dataModel, fieldInfo, geomCellCreator, globalConfig) => {\n let currentRowIndex = 0;\n const matrix = [];\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const projectionInfo = prepareProjectionInfo(fieldInfo);\n const facetInfo = prepareFacetInfo(fieldInfo);\n const allSplitModels = dataModel.splitByRow(facetInfo.allFacets);\n\n const {\n splitModelsHashMap,\n rowKeys,\n colKeys\n } = getSplitModelHashMap(allSplitModels, facetInfo, globalConfig);\n\n const defaultConfig = setDefaultConfigForFacet(facetInfo, projectionInfo, globalConfig);\n globalConfig = mergeRecursive(globalConfig, defaultConfig);\n\n const generalContext = {\n matrix,\n geomCellCreator,\n projectionInfo,\n splitModelsHashMap,\n colKeys\n };\n if (rowKeys.length) {\n rowKeys.forEach((rowKeyObj) => {\n const rowContext = {\n ...generalContext,\n rowKeyObj,\n currentRowIndex\n };\n const { rowIndex } = createRowDataModels(rowContext, fieldInfo, dataModel);\n\n currentRowIndex = rowIndex;\n });\n } else if (colKeys.length) {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n\n colKeys.forEach((colKeyObj) => {\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj,\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n });\n } else {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj: { keyArr: [], joinedKey: '' },\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n }\n\n const formattedColKeys = formatKeys(colKeys.map(e => e.keyArr),\n colFacets.map(facetField => facetField.rawFormat()));\n const formattedRowKeys = formatKeys(rowKeys.map(e => e.keyArr),\n rowFacets.map(facetField => facetField.rawFormat()));\n\n // Getting column keys\n const transposedColKeys = formattedColKeys.length > 0 ? formattedColKeys[0].map((col, i) =>\n formattedColKeys.map(row => row[i])) : formattedColKeys;\n\n return { matrix, rowKeys: formattedRowKeys, columnKeys: transposedColKeys };\n};\n","import { AxisOrientation } from '@chartshq/muze-axis';\nimport {\n getObjProp,\n FieldType,\n retrieveNearestGroupByReducers,\n mergeRecursive,\n createSelection,\n DataModel\n} from 'muze-utils';\nimport { getMatrixModel } from './matrix-model';\nimport {\n getCellKey,\n isDistributionEqual,\n mutateAxesFromMap,\n getFieldsFromSuppliedLayers,\n extractFields,\n removeExitCells\n} from './group-utils';\nimport { ROW, ROWS, COLUMNS, COL, LEFT, RIGHT, TOP,\n BOTTOM, PRIMARY, SECONDARY, X, Y, TEMPORAL } from '../enums/constants';\nimport { SimpleVariable } from '../variable';\nimport { sanitiseBorderMatrix, sanitiseGeomMatrix } from './cell-border-applier';\n\n/**\n * Updates row and column cells with the geom cell corresponding to the facet keys\n *\n * @param {*} resolver\n * @param {*} facets\n */\nconst updateCells = (resolver, facets, geomCell) => {\n [ROW, COL].forEach((field) => {\n const cells = resolver[`${field}Cells`]();\n const facetKey = facets[`${field}Facets`][1].join();\n\n !cells[facetKey] && (cells[facetKey] = []);\n cells[facetKey].push(geomCell);\n resolver[`${field}Cells`](cells);\n });\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} datamodel\n * @param {*} fieldInfo\n * @param {*} facets\n *\n */\nexport const createValueCells = (context, datamodel, fieldInfo, facets) => {\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const {\n suppliedLayers,\n cell: GeomCell,\n resolver,\n config,\n encoder,\n detailFields\n } = context;\n const axes = resolver.axes();\n const cacheMaps = resolver.cacheMaps();\n const matrixLayers = resolver.matrixLayers();\n const labelManager = resolver.dependencies().smartlabel;\n const horizontalAxis = resolver.horizontalAxis();\n const verticalAxis = resolver.verticalAxis();\n const datamodelTransform = resolver.datamodelTransform();\n const sortedFields = config.sort;\n const {\n entryCellMap,\n exitCellMap\n } = cacheMaps;\n const layerConfigArr = encoder.getLayerConfig({ columnFields, rowFields }, suppliedLayers || [],\n context.retinalConfig);\n const axesCreators = { config, labelManager, axes, cacheMaps };\n\n fieldInfo.normalizedColumns = verticalAxis.fields;\n fieldInfo.normalizedRows = horizontalAxis.fields;\n\n const allFacets = [\n [...facets.rowFacets[0], ...facets.colFacets[0]],\n [...facets.rowFacets[1], ...facets.colFacets[1]]\n ];\n const facetFields = allFacets.slice();\n facetFields[0] = facetFields[0].map(facetField => facetField.oneVar());\n\n matrixLayers[rowIndex] = matrixLayers[rowIndex] ? matrixLayers[rowIndex] : [];\n matrixLayers[rowIndex][columnIndex] = layerConfigArr;\n\n // return from map if already there otherwise create and put in map\n const geomCellKey = getCellKey(rowIndex, columnIndex);\n const fields = {\n y: rowFields,\n x: columnFields\n };\n\n const geomCell = !exitCellMap.has(geomCellKey) ? new GeomCell() : exitCellMap.get(geomCellKey);\n\n // Sort datamodel if user has sorted a field\n const sortConfig = Object.keys(sortedFields).map(field => [field, sortedFields[field]]);\n if (sortConfig.length) {\n datamodel = datamodel.sort(sortConfig, { saveChild: true });\n }\n\n geomCell.data(datamodel)\n .fields(fields)\n .transform(datamodelTransform)\n .detailFields(detailFields)\n .facetByFields(allFacets);\n\n encoder.createAxis(axesCreators, fieldInfo, Object.assign({}, context, { geomCell, facetFields }));\n entryCellMap.set(geomCellKey, geomCell);\n exitCellMap.delete(geomCellKey);\n\n updateCells(resolver, facets, geomCell);\n\n return entryCellMap.get(geomCellKey);\n};\n\nconst extractAxisIndex = id => getObjProp(id.match(/^[0-9]*?(?=-)/g), 0);\n\n/**\n * Creates axis cells based on the set of axes\n *\n * @param {Selection} selection Contains a selection of the axis units\n * @param {Array} axes Actual axis units\n * @param {number} axisIndex 0-> primary axis, 1-> secondary axis(when dual axis is made)\n * @param {Object} cells Contains a collection of the cells\n * @return {Object} return either set of axis/blank cells depending on the config\n */\nconst createAxisCells = (selection, axes, axisIndex, cells) =>\n createSelection(selection, axis => axis, axes, (item, i) => i + item.reduce((e, n) => {\n const id = n.id + axisIndex;\n return `${e}-${id}`;\n }, '')).map((currObj, axis) => {\n if (axis && axis[axisIndex]) {\n const axisInst = axis[axisIndex];\n const { orientation, show } = axisInst.config();\n\n return new cells.AxisCell().source(axisInst).config({\n isOffset: orientation === AxisOrientation.LEFT || orientation === AxisOrientation.TOP,\n show\n });\n }\n return new cells.BlankCell().config({ show: false });\n }).sort((a, b) => extractAxisIndex(a[0]) - extractAxisIndex(b[0]));\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @retur\n */\nconst axisPlaceholderGn = (context, selObj, cells) => {\n const {\n matrices\n } = context;\n const {\n axesMatrix\n } = matrices;\n\n return (type, axisFrom) => {\n const axes = axesMatrix[`${type}`];\n\n if (axes && axes.length) {\n if (type === X || type === Y) {\n const fieldNames = type === Y ? ROWS : COLUMNS;\n\n [PRIMARY, SECONDARY].forEach((fieldType, index) => {\n const selObjProp = `${fieldNames}${fieldType}`;\n let axisIndex = index;\n let axesForDraw = axes;\n if (axisFrom === RIGHT || axisFrom === BOTTOM) {\n axisIndex = 1 - axisIndex;\n }\n if (!getObjProp(axes, 0, axisIndex)) {\n axesForDraw = [];\n }\n selObj[selObjProp] = createAxisCells(selObj[selObjProp], axesForDraw, axisIndex, cells);\n });\n } else {\n selObj.rowsPrimary = createAxisCells(selObj.rowPrime, axes.map(() => []), 0, cells);\n selObj.rowsSecondary = createAxisCells(selObj.rowSec, axes.map(() => []), 0, cells);\n selObj.columnsPrimary = createAxisCells(selObj.colPrime, axes[0], 0, cells);\n selObj.columnsSecondary = createAxisCells(selObj.colSec, axes[0], 0, cells);\n }\n }\n return selObj;\n };\n};\n\n/**\n * Creates header cells based on the set of headers\n *\n * @param {Object} selection Contains a selection of the header units\n * @param {string} headers Contains a list of the headers\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} return either set of header cells depending on the config\n */\nconst createTextCells = (selection, headers, cells, labelManager) => createSelection(selection,\n (label) => {\n const textCell = new cells.TextCell({}, { labelManager });\n textCell.source(label);\n return textCell;\n }, headers, (key, i) => key + i);\n\nconst extractFacetIndex = id => id.split('-').pop();\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @param {*} labelManager\n *\n */\nconst headerPlaceholderGn = (context, selectionObj, cells, labelManager) => {\n const {\n axis,\n keys,\n type,\n facet\n } = context;\n const counter = axis.length / keys.length;\n const selectionKeys = keys.length ? axis.map((d, i) => keys[Math.floor(i / counter)]) : [];\n\n const selObjUpdater = createSelection(selectionObj[`${type}Headers`], keySet => keySet, selectionKeys,\n (keySet, i) => `${keySet.join(',')}-${i}`)\n .sort((a, b) => extractFacetIndex(a[0]) - extractFacetIndex(b[0]));\n\n return selObjUpdater.map((keySet, data) => {\n let textCells = createTextCells(null, data, cells, labelManager);\n textCells = textCells.map((cell, k) => cell.source(k).config(facet));\n return textCells;\n });\n};\n\n/**\n * Creates a set of placeholders as a part of selection object\n *\n * @param {Array} normalizedOptions contains normalized rows and columns\n * @param {Array} matrices contains axis and value matrices\n * @param {aArrayny} projections contains set of row and column projections\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} Creates a set of placeholders as a part of selections\n */\nconst generatePlaceholders = (context, cells, labelManager) => {\n let selectionObj;\n const {\n matrices,\n fields,\n facetsAndProjections,\n selection,\n facet,\n encoders,\n resolver\n } = context;\n const {\n rows,\n columns\n } = fields;\n const {\n valuesMatrix\n } = matrices;\n const {\n rowProjections,\n colProjections\n } = facetsAndProjections;\n const {\n rowKeys,\n columnKeys\n } = valuesMatrix;\n const takeAxisFrom = encoders.simpleEncoder._axisFrom;\n const takeHeaderFrom = encoders.simpleEncoder._headerFrom;\n\n selectionObj = selection || {};\n\n ['pie', X, Y].forEach((axis) => {\n const axisFrom = axis === X ? takeAxisFrom.column : takeAxisFrom.row;\n selectionObj = axisPlaceholderGn(context, selectionObj, cells)(axis, axisFrom);\n });\n\n const {\n rowsPrimary,\n rowsSecondary,\n columnsPrimary,\n columnsSecondary\n } = selectionObj;\n\n const rowAxis = rowsPrimary && rowsPrimary.getObjects().length ? rowsPrimary.getObjects() :\n (rowsSecondary && rowsSecondary.getObjects().length ? rowsSecondary.getObjects() : []);\n const colAxis = columnsPrimary && columnsPrimary.getObjects().length ? columnsPrimary.getObjects() :\n (columnsSecondary && columnsSecondary.getObjects().length ? columnsSecondary.getObjects() : []);\n\n const headerConfig = [\n { type: LEFT, section: rows[0], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: RIGHT, section: rows[1], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: TOP, section: columns[0], axis: colAxis, headerFrom: takeHeaderFrom.column },\n { type: BOTTOM, section: columns[1], axis: colAxis, headerFrom: takeHeaderFrom.column }\n ];\n\n headerConfig.forEach((config, index) => {\n let keys;\n let length;\n const {\n type,\n section,\n axis,\n headerFrom\n } = config;\n\n if (index < 2) {\n keys = rowKeys;\n length = rowProjections.length > 0 ? rowProjections.length : 1;\n } else {\n keys = columnKeys;\n length = colProjections.length > 0 ? colProjections.length : 1;\n }\n keys = keys.map(arr => arr.map(val => resolver.valueParser()(val)));\n if (section.length && headerFrom === type && axis && keys.length) {\n const hContext = { axis, length, type };\n let headers = [];\n if (index < 2) {\n hContext.keys = keys;\n hContext.facet = facet.rows;\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n } else {\n hContext.facet = facet.columns;\n hContext.keys = keys[0].map((key, i) => keys.map(e => e[i]));\n\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n }\n selectionObj[`${type}Headers`] = headers;\n } else {\n selectionObj[`${type}Headers`] = null;\n }\n });\n return selectionObj;\n};\n\n/**\n * Generates matrices\n *\n * @param {Object} config Configuration to generate matrices\n * @param {Array} matrices Matrices containing the set of visual units and axes units\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} contains a collection of matrices\n */\nexport const generateMatrices = (context, matrices, cells, labelManager) => {\n const {\n unitHeight,\n unitWidth,\n facetsAndProjections,\n normalizedRows,\n normalizedColumns,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n } = context;\n const placeholderContext = {\n fields: {\n rows: normalizedRows,\n columns: normalizedColumns\n },\n matrices,\n facetsAndProjections,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n };\n // Generate placeholders for all matrices\n const selectionObj = generatePlaceholders(placeholderContext, cells, labelManager);\n const {\n columnsPrimary,\n columnsSecondary,\n rowsPrimary,\n rowsSecondary,\n leftHeaders,\n topHeaders,\n bottomHeaders,\n rightHeaders\n } = selectionObj;\n const [rowPrime, rowSec, colPrime, colSec] = [rowsPrimary, rowsSecondary, columnsPrimary, columnsSecondary]\n .map(d => (d ? d.getObjects() : []));\n const [leftFacets, rightFacets] = [leftHeaders, rightHeaders]\n .map(e => (e ? e.getObjects()\n .map(f => f.getObjects()) : []));\n let rowPriority = rowSec.length ? 1 : -1;\n rowPrime.length && rowPriority++;\n let colPriority = colSec.length ? 1 : -1;\n colPrime.length && colPriority++;\n\n // Compute left matrix using left headers and the axes on the rows\n let leftMatrix = leftFacets.length ? leftFacets.map((d, i) => {\n rowPrime[i] = rowPrime[i] ? [rowPrime[i]] : [];\n return [...d, ...rowPrime[i]];\n }) : (rowPrime ? rowPrime.map(d => [d]) : []);\n\n // Compute right matrix using right headers and the axes on the rows\n const rightMatrix = rowSec.length ? rowSec.map((d, i) => [d, ...(rightFacets[i] || [])]) : (rightFacets.length ?\n rightFacets.map(d => [...d]) : []);\n\n const topMatrix = [];\n if (topHeaders) {\n const headers = topHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n topMatrix[i] = topMatrix[i] || [];\n topMatrix[i].push(x);\n });\n });\n }\n // Compute top matrix using the top headers and axes on the columns\n if (colPrime.length) {\n topMatrix.push(colPrime);\n }\n\n // Bottom and right matrices are prepared using the user config.\n let bottomMatrix = [];\n if (colSec.length) {\n bottomMatrix.push(colSec);\n }\n const currentBottomLength = bottomMatrix.length;\n if (bottomHeaders) {\n const headers = bottomHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n bottomMatrix[i + currentBottomLength] = bottomMatrix[i + currentBottomLength] || [];\n bottomMatrix[i + currentBottomLength].push(x);\n });\n });\n }\n\n if (!leftMatrix.length && !rightMatrix.length) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n leftMatrix = [[cell]];\n }\n\n if (!topMatrix.length && (!bottomMatrix.length || !bottomMatrix[0].length)) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n bottomMatrix = [[cell]];\n }\n\n return {\n rows: [leftMatrix, rightMatrix],\n columns: [topMatrix, bottomMatrix],\n selectionObj,\n colPriority,\n rowPriority\n };\n};\n\nconst getAxisFields = (projections, fieldHolder = []) =>\n projections.reduce((acc, item) =>\n [...acc, ...item.reduce((ac, field) =>\n (field instanceof SimpleVariable ? [...ac, field.oneVar()] : ac), [])], fieldHolder);\n\nconst sortDmTemporalFields = (resolver, datamodel) => {\n let axisFields = [];\n const projections = resolver.projections();\n axisFields = getAxisFields(projections.rowProjections, getAxisFields(projections.colProjections));\n\n const fieldConfig = datamodel.getFieldsConfig();\n const temporalFields = axisFields.reduce((acc, field) =>\n ((fieldConfig[field].def.subtype === TEMPORAL) ? [...acc, [field]] : acc), []);\n return temporalFields.length ? datamodel.sort(temporalFields, { saveChild: true }) : datamodel;\n};\n\nconst transformDataModel = (dataModel, config, resolver) => {\n let groupedModel;\n\n const fieldsConfig = dataModel.getFieldsConfig();\n const resolvedData = resolver.data();\n const { groupBy, suppliedLayers, facetsAndProjections } = config;\n\n if (resolvedData instanceof DataModel) {\n resolvedData.dispose();\n }\n\n const fields = getFieldsFromSuppliedLayers(suppliedLayers).filter(field =>\n getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const allFields = extractFields(facetsAndProjections, fields);\n\n groupedModel = dataModel.project(allFields);\n resolver.data(groupedModel);\n if (!groupBy.disabled) {\n const newFieldsConfig = groupedModel.getFieldsConfig();\n const dimensions = allFields.filter(field =>\n getObjProp(newFieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const aggregationFns = groupBy.measures;\n const measureNames = Object.keys(groupedModel.getFieldspace().getMeasure());\n const nearestAggFns = retrieveNearestGroupByReducers(groupedModel, ...measureNames);\n const resolvedAggFns = mergeRecursive(nearestAggFns, aggregationFns);\n\n groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns);\n }\n // sort temporal fields if any in the given rows and columns\n groupedModel = sortDmTemporalFields(resolver, groupedModel);\n resolver.transformedData(groupedModel);\n return groupedModel;\n};\n\n/**\n * Computes matrices for a group\n *\n * @param {Object} datamodel on which the matrices are to be computed\n * @param {Object} config configuration of the matrices\n * @param {Object} layerRegistry contains the registered layers\n * @return {Object} conputed matrices\n * @memberof MatrixResolver\n */\nexport const computeMatrices = (resolverConfig) => {\n let placeholderInfo = {};\n const {\n datamodel,\n encoders,\n resolver,\n globalConfig,\n selection,\n transform,\n componentRegistry,\n groupBy,\n labelManager,\n fieldMap,\n layerConfig,\n registry,\n normalizedRows,\n normalizedColumns,\n otherEncodings,\n facetsAndProjections,\n simpleEncoder,\n config\n } = resolverConfig;\n\n const { rowFacets, colFacets, colProjections, rowProjections } = facetsAndProjections;\n const isProjection = rowProjections.length > 0 || colProjections.length > 0;\n const isFacet = rowFacets.length > 0 || colFacets.length > 0;\n\n if (isFacet) {\n globalConfig.isFacet = true;\n }\n const matrixGnContext = {\n // Configuration to be passed to generate the different matrices.\n // A common config is used for both value matrices and other matrices\n normalizedColumns,\n normalizedRows,\n facetsAndProjections,\n layers: layerConfig,\n fieldMap,\n otherEncodings,\n encoders,\n facet: globalConfig.facet || {},\n axisFrom: globalConfig.axisFrom || {},\n selection,\n resolver\n };\n const cells = {\n GeomCell: resolver.getCellDef(registry.cells.GeomCell),\n AxisCell: resolver.getCellDef(registry.cells.AxisCell),\n BlankCell: resolver.getCellDef(registry.cells.BlankCell),\n TextCell: resolver.getCellDef(registry.cells.TextCell)\n };\n const isRowSizeEqual = isDistributionEqual(normalizedRows);\n const isColumnSizeEqual = isDistributionEqual(normalizedColumns);\n\n resolver.colCells({});\n resolver.rowCells({});\n resolver.datamodelTransform(transform || {});\n\n // Cell creation begins here\n resolver.resetSimpleAxes();\n\n const {\n entryCellMap\n } = resolver.cacheMaps();\n const newCacheMap = {\n exitCellMap: entryCellMap,\n entryCellMap: new Map()\n };\n\n resolver.cacheMaps(newCacheMap);\n const valueCellContext = {\n config: globalConfig,\n suppliedLayers: simpleEncoder.serializeLayerConfig(resolver.layerConfig()),\n resolver,\n cell: cells.GeomCell,\n encoder: simpleEncoder,\n newCacheMap,\n detailFields: config.detail,\n retinalConfig: {\n color: config.color,\n size: config.size,\n shape: config.shape\n }\n };\n\n const groupedModel = transformDataModel(datamodel, {\n facetsAndProjections,\n suppliedLayers: valueCellContext.suppliedLayers,\n groupBy\n }, resolver);\n simpleEncoder.data(groupedModel);\n // return a callback function to create the cells from the matrix\n const cellCreator = resolver.valueCellsCreator(valueCellContext);\n // Creates value matrices from the datamodel and configs\n const valueMatrixInfo = getMatrixModel(groupedModel, facetsAndProjections, cellCreator, globalConfig);\n\n removeExitCells(resolver);\n resolver.cacheMaps().exitCellMap.clear();\n resolver.valueMatrix(valueMatrixInfo.matrix);\n\n const { xAxes, yAxes } = mutateAxesFromMap(resolver.cacheMaps(), resolver.axes());\n\n resolver.axes({\n x: xAxes,\n y: yAxes\n });\n\n resolver.createUnits(componentRegistry, config);\n\n const matrices = {\n valuesMatrix: valueMatrixInfo,\n axesMatrix: resolver.axes()\n };\n // Create all matrices\n const {\n rows,\n columns,\n selectionObj,\n rowPriority,\n colPriority\n } = generateMatrices(matrixGnContext, matrices, cells, labelManager);\n\n resolver.rowMatrix(rows);\n resolver.columnMatrix(columns);\n if (isFacet || isProjection) {\n const arr = sanitiseBorderMatrix({\n leftMatrix: rows[0],\n rightMatrix: rows[1],\n topMatrix: columns[0],\n bottomMatrix: columns[1]\n }, registry.cells.BlankCell);\n valueMatrixInfo.matrix = sanitiseGeomMatrix(valueMatrixInfo.matrix, arr);\n }\n\n placeholderInfo = {\n rows: resolver.rowMatrix(),\n columns: resolver.columnMatrix(),\n values: resolver.valueMatrix(),\n isColumnSizeEqual,\n isRowSizeEqual,\n priority: {\n row: rowPriority,\n col: colPriority\n },\n selection: selectionObj,\n dataModels: {\n groupedModel,\n parentModel: datamodel\n }\n };\n return placeholderInfo;\n};\n","export const RESOLVER_PROPS = {\n dependencies: {},\n units: {},\n datamodelTransform: {},\n layerConfig: {},\n matrixLayers: {},\n colCells: {},\n rowCells: {},\n rowMatrix: {},\n columnMatrix: {},\n valueMatrix: {},\n encoder: {},\n valueParser: {},\n data: {},\n transformedData: {},\n store: {}\n};\n","import { generateGetterSetters, STATE_NAMESPACES, getUniqueId } from 'muze-utils';\nimport {\n initializeCacheMaps,\n headerCreator,\n extractUnitConfig,\n setFacetsAndProjections\n} from './group-utils';\nimport {\n ROW, COL, LEFT, RIGHT, COLOR, SIZE, SHAPE, DETAIL, CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS, INITIALIZED,\n AXIS, UNIT, BEFORE_UPDATE, UPDATED, VALUE_MATRIX, FACET_HEADERS\n} from '../enums/constants';\nimport { createValueCells, computeMatrices } from './cell-creator';\nimport { RESOLVER_PROPS } from './resolver-props';\n\n/**\n * Resolves the matrices from configuration provided\n *\n * @export\n * @class MatrixResolver\n */\nexport default class MatrixResolver {\n\n /**\n * Creates an instance of MatrixResolver.\n * @param {Object} dependencies needed to run the resolver\n * @memberof MatrixResolver\n */\n constructor (dependencies) {\n this._registry = {};\n this._layerConfig = [];\n this._matrixLayers = [];\n this._dependencies = dependencies;\n this._rowMatrix = [];\n this._columnMatrix = [];\n this._valueMatrix = [];\n this._facets = { rowFacets: [], colFacets: [] };\n this._projections = { rowProjections: [], colProjections: [] };\n this._datamodelTransform = {};\n this._units = [];\n this._cacheMaps = {};\n this._fireboltDeps = {};\n this._axes = {\n x: {},\n y: {},\n color: [],\n size: [],\n shape: [],\n radius: [],\n angle: [],\n angle0: []\n };\n this._placeholderInfo = {};\n generateGetterSetters(this, this.constructor.getterSetters());\n\n this.cacheMaps(initializeCacheMaps());\n }\n\n static getterSetters () {\n return RESOLVER_PROPS;\n }\n /**\n * Set: Registers placeholders, Get: return {Object} those placeholders\n *\n * @param {Object} placeholders cells that will construct the group\n * @return {Object} Either current instance or the set of placeholders\n * @memberof MatrixResolver\n */\n registry (...placeholders) {\n if (placeholders.length) {\n Object.entries(placeholders[0]).forEach((val) => {\n this._registry[val[0]] = val[1];\n });\n return this;\n }\n return this._registry;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n cacheMaps (...maps) {\n if (maps.length) {\n [CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS].forEach((e) => {\n this._cacheMaps[`${e}Map`] = maps[0][`${e}Map`] || this._cacheMaps[`${e}Map`];\n });\n return this;\n }\n return this._cacheMaps;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n axes (...axes) {\n if (axes.length) {\n this._axes = Object.assign({}, this._axes, axes[0]);\n return this;\n }\n return this._axes;\n }\n\n facets (...facets) {\n if (facets.length) {\n Object.entries(facets[0]).forEach((e) => {\n this._facets[e[0]] = e[1];\n });\n return this;\n }\n return this._facets;\n }\n\n projections (...projections) {\n if (projections.length) {\n Object.entries(projections[0]).forEach((e) => {\n this._projections[e[0]] = e[1];\n });\n return this;\n }\n return this._projections;\n }\n\n optionalProjections (config, layerConfig, schema) {\n const otherEncodings = {};\n const optionalProjections = [];\n const otherEncodingTypes = [SIZE, COLOR, SHAPE];\n\n otherEncodingTypes.forEach((type) => {\n if (config[type] && config[type].field) {\n const enc = config[type];\n otherEncodings[type] = enc.field;\n optionalProjections.push(enc.field);\n }\n });\n\n if (config[DETAIL]) {\n optionalProjections.push(...config.detail);\n }\n\n const encoder = this.encoder();\n optionalProjections.push(...encoder.getProjectionFields(layerConfig, schema));\n this.projections({ optionalProjections });\n return otherEncodings;\n }\n\n /**\n * return the normalized set of rows and facets and projections\n *\n * @param {Object} rows parameters needed to set horizontal axis consisiting of rows\n * @return {Object} facets, projections and normalized rows\n * @memberof MatrixResolver\n */\n horizontalAxis (rows, encoder) {\n if (rows) {\n this._horizontalAxis = setFacetsAndProjections(this, { type: ROW, fields: rows }, encoder);\n return this;\n }\n return this._horizontalAxis;\n }\n\n /**\n * return the normalized set of columns and facets and projections\n *\n * @param {Object} columns parameters needed to set vertical axis consisiting of columns\n * @return {Object} facets, projections and normalized columns\n * @memberof MatrixResolver\n */\n verticalAxis (columns, encoder) {\n if (columns) {\n this._verticalAxis = setFacetsAndProjections(this, { type: COL, fields: columns }, encoder);\n return this;\n }\n return this._verticalAxis;\n }\n\n /**\n * Gets the class definition of a particular cell type(if the particular type has been extended, that particular\n * definition is returned)\n *\n * @param {Object} cell cell whose class definition is to be retrieved\n * @return {Object} cell definition\n * @memberof MatrixResolver\n */\n getCellDef (cell) {\n const registry = this.registry().cells;\n\n Object.values(registry).forEach((e) => {\n if (e.prototype instanceof cell) {\n cell = e;\n }\n });\n return cell;\n }\n\n /**\n * return a visual cell creator along with its axis information to be injected to the datamodel creation\n * function\n *\n * @param {Object} GeomCell Type of cell to be created\n * @return {Object} Created cell\n * @memberof MatrixResolver\n */\n valueCellsCreator (context) {\n // reset matrix layers\n this.matrixLayers([]);\n\n return (datamodel, fieldInfo, facets) => createValueCells(context, datamodel, fieldInfo, facets);\n }\n\n /**\n * Callback to be applied on each cell of a matrix of a particular type\n *\n * @param {string} matrixType type of matrix on which callback is to be applied\n * @param {Function} callback function to be applied to each cell\n * @memberof MatrixResolver\n */\n forEach (matrixType, callback) {\n this[matrixType]().forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n callback(rIndex, cIndex, col);\n });\n });\n }\n\n getAllFields () {\n const retObj = this.projections();\n\n Object.entries(this.facets()).forEach((e) => {\n retObj[e[0]] = e[1];\n });\n return retObj;\n }\n\n resetSimpleAxes () {\n return this.axes({\n x: new Set(),\n y: new Set(),\n radius: [],\n angle: [],\n angle0: [],\n pie: []\n });\n }\n\n setFireboltDependencies (prop, deps) {\n Object.assign(this._fireboltDeps, {\n [prop]: deps\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} componentRegistry\n * @param {*} config\n * @memberof MatrixResolver\n */\n createUnits (componentRegistry, config) {\n const {\n globalConfig,\n alias,\n coord\n } = config;\n const {\n layerRegistry,\n interactions\n } = componentRegistry;\n const {\n smartlabel: smartLabel,\n lifeCycleManager,\n throwback\n } = this.dependencies();\n const fireboltDeps = this._fireboltDeps;\n\n // Provide the source for the matrix\n const units = [[]];\n // Setting unit configuration\n const unitConfig = extractUnitConfig(globalConfig || {});\n const store = this.store();\n store.lockModel();\n const { VisualUnit } = this.registry();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n let unit = el.source();\n if (!unit) {\n const namespace = `unit${i}-${j}-${getUniqueId()}`;\n\n unit = VisualUnit.create({\n layerRegistry,\n interactions\n }, {\n smartLabel,\n lifeCycleManager,\n throwback,\n fireboltDeps\n });\n unit.metaInf({\n rowIndex: i,\n colIndex: j,\n namespace\n });\n unit.store(store);\n unit.coord(coord);\n el.source(unit);\n }\n !units[i] && (units[i] = []);\n units[i][j] = unit;\n unit.parentAlias(alias)\n .valueParser(this.valueParser())\n .coord(coord);\n el.config(unitConfig);\n });\n store.unlockModel();\n lifeCycleManager.notify({ client: units, action: INITIALIZED, formalName: UNIT });\n return this.units(units);\n }\n\n /**\n *\n *\n * @param {*} config\n * @memberof MatrixResolver\n */\n setRetinalAxisDomain (config, datamodel, encoders) {\n const {\n color,\n shape,\n size,\n globalConfig\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const {\n rowFacets,\n colFacets\n } = this.getAllFields();\n const encoding = {\n color,\n shape,\n size\n };\n const facetFields = [...rowFacets.map(e => e.toString()), ...colFacets.map(e => e.toString())];\n const retContext = {\n domains: encoders.simpleEncoder.getRetinalFieldsDomain(datamodel, encoding, facetFields, groupBy),\n axes: this.getRetinalAxes(),\n encoding\n };\n encoders.retinalEncoder.setCommonDomain(retContext);\n return this;\n }\n\n resetFacetsAndProjections () {\n this._facets = {};\n this._projections = {};\n return this;\n }\n\n getRetinalAxes () {\n const {\n color,\n shape,\n size\n } = this.axes();\n\n return {\n color: [...color],\n shape: [...shape],\n size: [...size]\n };\n }\n\n getSimpleAxes (type) {\n return this.axes()[`${type}`];\n }\n\n createRetinalAxes (fieldsConfig, config, encoders) {\n const retinalAxes = encoders.retinalEncoder.createAxis({\n fieldsConfig,\n config,\n axes: this.axes()\n });\n\n this.axes(retinalAxes);\n\n this.updateVisualUnit(config);\n\n return this;\n }\n\n createHeaders (placeholders, fieldNames, config) {\n let bottomLeft = [];\n let bottomRight = [];\n const {\n rows,\n columns\n } = placeholders;\n const {\n smartlabel: labelManager,\n lifeCycleManager\n } = this.dependencies();\n const {\n showHeaders,\n classPrefix\n } = config;\n const { TextCell, BlankCell } = this.registry().cells;\n const [leftRows, rightRows] = rows;\n const [topCols, bottomCols] = columns;\n const rowHeaders = fieldNames.rows;\n const blankCellCreator = cell => new BlankCell().config({ show: cell.config().show });\n\n // Headers and footers are created based on the rows. Thereafter, using the column information\n // they are tabularized into the current structure\n const headers = {\n left: headerCreator(leftRows, rowHeaders[0], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager }),\n right: headerCreator(rightRows, rowHeaders[1], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager })\n };\n const footers = {\n left: leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : [],\n right: rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []\n };\n const [topLeft, topRight] = [LEFT, RIGHT].map(type => topCols.map((col, i) => {\n if (i === topCols.length - 1) {\n return headers[type];\n }\n return footers[type];\n }));\n\n // Creating only bottom matrices if there is no information on the top\n if (topCols.length === 0) {\n [bottomLeft, bottomRight] = [LEFT, RIGHT].map(type => bottomCols.map((col, i) => {\n if (i === 0) {\n return headers[type];\n }\n return footers[type];\n }));\n } else {\n bottomLeft = bottomCols.map(() => (leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : []));\n bottomRight = bottomCols.map(() => (rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []));\n }\n\n lifeCycleManager.notify({\n client: [topLeft, topRight, bottomLeft, bottomRight],\n action: INITIALIZED,\n formalName: FACET_HEADERS\n });\n\n return { topLeft, topRight, bottomLeft, bottomRight };\n }\n\n updateVisualUnit (retinalConfig) {\n const retinalAxes = this.getRetinalAxes();\n\n const { lifeCycleManager } = this.dependencies();\n lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS });\n lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT });\n\n const units = [];\n const matrixLayers = this.matrixLayers();\n\n const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`,\n `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`];\n const store = this.store();\n store.lockCommits(props);\n store.lockModel();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n el.axes(Object.assign(el.axes(), retinalAxes));\n el.source() && el.source().retinalFields(retinalConfig);\n el.layerDef(matrixLayers[i][j]);\n el.updateModel();\n\n units.push(el.source());\n });\n\n store.unlockModel()\n .unlockCommits([props[0]])\n .unlockCommits([props[1]]);\n lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT });\n return this;\n }\n\n getMatrices (resolverConfig) {\n this._placeholderInfo = computeMatrices(resolverConfig);\n\n return this._placeholderInfo;\n }\n\n clear () {\n const cacheMaps = this._cacheMaps;\n\n for (const key in cacheMaps) {\n cacheMaps[key].clear();\n }\n }\n\n}\n","import { MeasureSubtype, DimensionSubtype, FieldType } from 'muze-utils';\n\nimport { ScaleType } from '@chartshq/muze-axis';\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [FieldType.DIMENSION]: ScaleType.BAND,\n [DimensionSubtype.CATEGORICAL]: ScaleType.BAND,\n [DimensionSubtype.TEMPORAL]: ScaleType.TIME,\n [FieldType.MEASURE]: ScaleType.LINEAR,\n [MeasureSubtype.CONTINUOUS]: ScaleType.LINEAR,\n [DimensionSubtype.BINNED]: ScaleType.BAND\n};\n","import { mergeRecursive, getObjProp } from 'muze-utils';\nimport { AxisOrientation } from '@chartshq/muze-axis';\nimport { ENCODING } from '@chartshq/visual-layer';\nimport { scaleMaps } from '../enums/scale-maps';\nimport { getAxisType, getAxisKey } from '../group-helper';\nimport { dataTypeScaleMap } from '../data-type-scale-map';\nimport { CATEGORICAL, TEMPORAL, BAR, LINE, POINT, BOTH, Y, COLOR, SHAPE, SIZE, ANGLE0 } from '../enums/constants';\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst getAxisConfig = (axisInfo, field, axesCreators, indices, facetFields) => {\n let axisOrientation;\n const { index, axisIndex, axisType } = axisInfo;\n const { config, position } = axesCreators;\n const { rowIndex, columnIndex } = indices;\n const rawUserAxisConfig = config.axes ? (config.axes[axisType] || {}) : {};\n\n // Change config object to a function if not already one\n const userAxisConfigFn = typeof rawUserAxisConfig !== 'function' ?\n () => rawUserAxisConfig : rawUserAxisConfig;\n const userAxisConfig = userAxisConfigFn(rowIndex, columnIndex, {\n axisFields: field.getMembers(),\n facetFields\n });\n\n // If current config does not specifes config for an axis, retain old config\n if (!userAxisConfig) {\n return {};\n }\n\n const {\n LEFT,\n RIGHT,\n TOP,\n BOTTOM\n } = AxisOrientation;\n const allOrientations = axisType === Y ? [LEFT, RIGHT] : [TOP, BOTTOM];\n\n if (position === BOTH) {\n axisOrientation = allOrientations[axisIndex];\n } else {\n axisOrientation = position;\n }\n const axisConfig = {\n id: `${axisType}-${index}-${axisIndex}`,\n name: field.displayName(),\n field: field.toString(),\n numberFormat: field.numberFormat(),\n orientation: axisOrientation,\n showAxisName: true,\n show: true,\n type: dataTypeScaleMap[field.subtype()]\n };\n userAxisConfig.tickValues = field.format(userAxisConfig.tickValues);\n userAxisConfig.domain = field.format(userAxisConfig.domain);\n\n return mergeRecursive(axisConfig, userAxisConfig);\n};\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst createSimpleAxis = (axisConfig, field, axesCreators) => {\n const { labelManager } = axesCreators;\n const Cls = scaleMaps[dataTypeScaleMap[field.subtype()]];\n const simpleAxis = new Cls(axisConfig, { labelManager });\n return simpleAxis;\n};\n\nexport const getAdjustedDomain = (max, min) => {\n const y1ratio = max[0] / (max[0] - min[0]);\n const y2ratio = max[1] / (max[1] - min[1]);\n\n // adjust min/max values for positive negative values zero line etc\n let allSameSign = false;\n\n // if all numbers are positive set floor to zero\n if (min[0] > 0 && min[1] > 0 && min[1] > 0 && max[1] > 0) {\n allSameSign = true;\n min[0] = 0;\n min[1] = 0;\n }\n\n // if all numbers are negative set ceiling to zero\n if (min[0] < 0 && min[1] < 0 && min[1] < 0 && max[1] < 0) {\n allSameSign = true;\n max[0] = 0;\n max[1] = 0;\n }\n\n // align zero line if necessary\n if (!allSameSign && y1ratio !== y2ratio) {\n if (y1ratio < y2ratio) {\n // adjust min[1]\n min[1] = min[0] / max[0] * max[1];\n } else {\n // adjust min[0]\n min[0] = min[1] / max[1] * max[0];\n }\n }\n return [\n [min[0], max[0]],\n [min[1], max[1]]\n ];\n};\n\n/**\n *\n *\n * @param {*} axisType\n * @param {*} fieldInfo\n * @param {*} axesCreators\n * @param {*} groupAxes\n *\n */\nexport const generateAxisFromMap = (axisType, fieldInfo, axesCreators, axesInfo, indices, facetFields) => {\n let axisKey;\n const { groupAxes, valueParser } = axesInfo;\n const currentAxes = [];\n const { fields, index } = fieldInfo;\n const { cacheMaps } = axesCreators;\n const map = cacheMaps[`${axisType}AxesMap`];\n\n const commonAxisKey = getAxisKey(axisType, index);\n fields.forEach((field, axisIndex) => {\n axisKey = getAxisKey(axisType, index, axisIndex, dataTypeScaleMap[field.subtype()]);\n const axisConfig = getAxisConfig({ index, axisIndex, axisType }, field, axesCreators, indices, facetFields);\n\n let axis;\n if (!map.has(axisKey)) {\n axis = createSimpleAxis(axisConfig, field, axesCreators);\n } else {\n axis = map.get(axisKey);\n axis._rotationLock = false;\n axis.config(axisConfig);\n }\n axis.valueParser(valueParser);\n currentAxes.push(axis);\n map.set(axisKey, axis);\n });\n\n if (currentAxes.length) {\n map.set(commonAxisKey, currentAxes);\n groupAxes.add(commonAxisKey);\n }\n\n return currentAxes;\n};\n\nexport const sanitizeIndividualLayerConfig = (encodingConfigs, def) => {\n [COLOR, SHAPE, SIZE].forEach((axis) => {\n if (encodingConfigs[axis] && encodingConfigs[axis].field) {\n def.forEach((conf) => {\n conf.encoding = conf.encoding || {};\n !conf.encoding[axis] && (conf.encoding[axis] = {});\n conf.encoding[axis].field = encodingConfigs[axis].field;\n });\n }\n });\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n const xAxes = [];\n const yAxes = [];\n\n xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes.push(xAxis);\n });\n yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes.push(yAxis);\n });\n return {\n xAxes, yAxes\n };\n};\n\n/**\n * return a default mark based on predefined set of rules of type and subtype of the fields\n *\n * @param {string} colFieldType dimension/measure - temporal/ordinal/nominal\n * @param {string} rowFieldType dimension/measure - temporal/ordinal/nominal\n * @return {Object} return mark type\n */\nexport const getDefaultMark = (colFieldType, rowFieldType) => {\n let mark;\n\n if (colFieldType === CATEGORICAL || rowFieldType === CATEGORICAL) {\n mark = BAR;\n } else if (colFieldType === TEMPORAL || rowFieldType === TEMPORAL) {\n mark = LINE;\n } else {\n mark = POINT;\n }\n\n return mark;\n};\n\n/**\n *\n *\n * @param {*} axesCreators\n * @param {*} [fieldInfo=[]]\n *\n */\nexport const createRetinalAxis = (axesCreators, fieldProps = {}) => {\n const { axisType, fieldsConfig } = axesCreators;\n const field = fieldProps.field;\n const axis = [];\n const Cls = scaleMaps[axisType];\n\n fieldProps.type = fieldProps.type ? fieldProps.type : getAxisType(fieldsConfig, field || null);\n axis.push(new Cls(fieldProps));\n return axis;\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} val\n *\n */\nexport const getIndex = (arr, val) => {\n let i = 0;\n let arrIndex = -1;\n\n while (arrIndex === -1 && i < arr.length) {\n if (arr[i].toString() === val.toString()) {\n arrIndex = i;\n }\n i++;\n }\n return arrIndex;\n};\n\n/**\n *\n *\n * @param {*} colFields\n * @param {*} rowFields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\nexport const getLayerConfFromFields = (colFields, rowFields, userLayerConfig) => userLayerConfig.filter((conf) => {\n const userConf = conf instanceof Array ? conf : [conf];\n const encodingArr = [].concat(...userConf.map(d => d.encoding).filter(d => d !== undefined));\n\n if (!encodingArr.length) {\n return true;\n }\n\n const xFields = [].concat(...encodingArr.map(d => [d.x && d.x.field, d.x0 && d.x0.field]))\n .filter(d => d !== undefined && d !== null);\n const yFields = [].concat(...encodingArr.map(d => [d.y && d.y.field, d.y0 && d.y0.field]))\n .filter(d => d !== undefined && d !== null);\n\n if (!xFields.length && !yFields.length) {\n return true;\n }\n\n const colFieldExist = xFields.length ? xFields.every(d => colFields.indexOf(d) !== -1) : false;\n const rowFieldExist = yFields.length ? yFields.every(d => rowFields.indexOf(d) !== -1) : false;\n if (xFields.length && yFields.length) {\n return colFieldExist && rowFieldExist;\n }\n return colFieldExist || rowFieldExist;\n});\n\nexport const resolveAxisConfig = (context, fieldInf, axisInfo) => {\n const { rowIndex, columnIndex, axesObj } = axisInfo;\n const { config, facetFields, resolver } = context;\n const resolverAxes = resolver.axes();\n const { RADIUS, ANGLE } = ENCODING;\n [RADIUS, ANGLE, ANGLE0].forEach((enc) => {\n const axesArr = resolverAxes[enc];\n if (!axesArr[rowIndex]) {\n axesArr[rowIndex] = [];\n }\n axesArr[rowIndex][columnIndex] = axesObj[enc];\n const axisConfig = getObjProp(config.axes, enc) || {};\n\n axesObj[enc].forEach((axis, i) => {\n let userConfig = axisConfig;\n if (axisConfig instanceof Function) {\n userConfig = axisConfig(rowIndex, columnIndex, {\n axisFields: [fieldInf[enc][i]],\n facetFields\n });\n }\n axis.config(userConfig);\n });\n });\n};\n\nexport const getSortingConfig = (context, currentFieldName, axesConfig) => {\n const config = context.config();\n const dataModel = context.data();\n\n let lastSortConfig = null;\n if (Object.keys(config.sort).length !== 0) {\n return config.sort[currentFieldName];\n }\n\n const operations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n\n while (lastSortConfig = operations.pop()) {\n if (lastSortConfig.op === 'sort') break;\n }\n if (lastSortConfig &&\n lastSortConfig.criteria.length &&\n lastSortConfig.criteria[0][0] === currentFieldName) {\n return lastSortConfig.criteria[0][1];\n }\n return axesConfig().defaultSort;\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n unionDomain,\n COORD_TYPES,\n toArray,\n sortCategoricalField\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport {\n generateAxisFromMap,\n getDefaultMark,\n getIndex,\n getLayerConfFromFields,\n getAdjustedDomain,\n sanitizeIndividualLayerConfig,\n getSortingConfig\n} from './encoder-helper';\nimport { retriveDomainFromData } from '../group-helper';\n\nimport { ROW, COLUMN, COL, LEFT, TOP, MEASURE, BOTH, X, Y } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\nconst CARTESIAN = COORD_TYPES.CARTESIAN;\n\n/**\n *\n *\n * @export\n * @class CartesianEncoder\n * @extends {VisualEncoder}\n */\nexport default class CartesianEncoder extends VisualEncoder {\n\n /**\n *\n *\n *\n * @memberof CartesianEncoder\n */\n static type () {\n return CARTESIAN;\n }\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof CartesianEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const geomCellAxes = {};\n const {\n axes\n } = axesCreators;\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const axisFields = [{\n fields: rowFields,\n index: rowIndex\n }, {\n fields: columnFields,\n index: columnIndex\n }];\n const { resolver, facetFields, geomCell } = context;\n const xAxes = axes.x || [];\n const yAxes = axes.y || [];\n\n [rowFields, columnFields].forEach((fields, i) => {\n const type = i === 0 ? ROW : COLUMN;\n const axis = i === 0 ? Y : X;\n\n if (fields.length > 1) {\n axesCreators.position = BOTH;\n } else {\n axesCreators.position = this.axisFrom()[type];\n }\n geomCellAxes[axis] = generateAxisFromMap(axis, axisFields[i], axesCreators, {\n groupAxes: axis === X ? xAxes : yAxes,\n valueParser: resolver.valueParser()\n }, indices, facetFields);\n });\n geomCell.axes(geomCellAxes);\n return geomCellAxes;\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n const resolver = context.resolver();\n const units = resolver.units();\n const domains = {\n 0: {},\n 1: {}\n };\n const fieldsObj = {\n 0: {},\n 1: {}\n };\n\n for (let rIdx = 0, len = units.length; rIdx < len; rIdx++) {\n const unitsArr = units[rIdx];\n for (let cIdx = 0, len2 = unitsArr.length; cIdx < len2; cIdx++) {\n const unit = unitsArr[cIdx];\n const axisFields = unit.fields();\n const encodingDomains = unit.dataDomain();\n ['x', 'y'].forEach((axisType, axisTypeIndex) => {\n const fieldArr = axisFields[axisType];\n fieldArr.forEach((field, axisIndex) => {\n const key = !axisTypeIndex ? `0${cIdx}${axisIndex}` : `${rIdx}0${axisIndex}`;\n const dom = encodingDomains[axisType];\n const typeOfField = field.subtype();\n fieldsObj[axisTypeIndex][key] = field;\n\n if (dom && Object.keys(dom).length !== 0) {\n domains[axisTypeIndex][key] = unionDomain([(domains[axisTypeIndex] &&\n domains[axisTypeIndex][key]) || [], dom[`${field}`]], typeOfField);\n }\n });\n });\n }\n }\n\n const { x: xAxes, y: yAxes } = resolver.axes();\n store.lockModel();\n [xAxes, yAxes].forEach((axesArr, axisType) => {\n axesArr.forEach((axes, idx) => {\n let key;\n let domain = [];\n let adjustedDomain = [];\n const min = [];\n const max = [];\n const typeOfAxis = axes[0].constructor.type();\n\n if (axes.length > 1 && typeOfAxis === ScaleType.LINEAR && axes[0].config().alignZeroLine) {\n axes.forEach((axis, i) => {\n key = !axisType ? `0${idx}${i}` : `${idx}0${i}`;\n domain = domains[axisType][key];\n min[i] = domain[0];\n max[i] = domain[1];\n });\n adjustedDomain = getAdjustedDomain(max, min);\n } else if (typeOfAxis === ScaleType.BAND) {\n /* Sort categorical fields to ensure consistency across all rows\n only if sorted by user */\n key = !axisType ? `0${idx}0` : `${idx}00`;\n const currentFieldName = fieldsObj[axisType][key].oneVar();\n const sortingOrder = getSortingConfig(context, currentFieldName, axes[0].config);\n if (sortingOrder && domains[axisType][key] instanceof Array) {\n domains[axisType][key].sort((a, b) => sortCategoricalField(sortingOrder, a, b));\n }\n }\n\n axes.forEach((axis, index) => {\n key = !axisType ? `0${idx}${index}` : `${idx}0${index}`;\n domain = adjustedDomain[index] || domains[axisType][key];\n\n domain && axis.domain(domain);\n const type = !axisType ? 'x' : 'y';\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${type}`, domain, `${idx}${index}`);\n });\n });\n });\n store.unlockModel();\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields, type) {\n let facets = [];\n let projections = [];\n let counter = 0;\n const primaryFacets = [];\n const secondaryFacets = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n const axisFrom = this.axisFrom();\n\n for (let i = 0; i < primaryLen; i++) {\n let projArr = [primaryFields[i]];\n const primaryField = primaryFields[i];\n\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter];\n if (secondaryField && secondaryField.type() === MEASURE) {\n counter++;\n projArr = [primaryField, secondaryField];\n }\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n primaryFacets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n secondaryFacets.push(secondaryField);\n }\n }\n }\n if ((primaryFacets.length || secondaryFacets.length) && !projections.length) {\n type = type === COL ? COLUMN : type;\n if ((axisFrom[type] === LEFT || axisFrom[type] === TOP) && primaryFacets.length) {\n const axisFromIndex = primaryFacets.length - 1;\n const facet = primaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(secondaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n secondaryFacets.splice(existIndex, 1);\n }\n primaryFacets.splice(axisFromIndex, 1);\n } else {\n const axisFromIndex = 0;\n const facet = secondaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(primaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n primaryFacets.splice(existIndex, 1);\n }\n secondaryFacets.splice(axisFromIndex, 1);\n }\n }\n\n facets = [...primaryFacets, ...secondaryFacets];\n facets = facets.filter((el, index, self) => index === self.findIndex(t => (t.toString() === el.toString())));\n return {\n facets,\n projections\n };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof CartesianEncoder\n */\n fieldSanitizer (datamodel, config) {\n return super.fieldSanitizer(datamodel, config);\n }\n\n /**\n *\n *\n * @param {*} datamodel\n *\n * @memberof CartesianEncoder\n */\n getRetinalFieldsDomain (dataModels, encoding) {\n const groupedModel = dataModels.groupedModel;\n const domains = {};\n for (const key in encoding) {\n if ({}.hasOwnProperty.call(encoding, key)) {\n const encodingObj = encoding[key];\n const field = encodingObj.field;\n if (!encodingObj.domain && field) {\n const domain = retriveDomainFromData(groupedModel, field);\n domains[field] = domain;\n }\n }\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n * @memberof CartesianEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n // let currentLayerIndex = 0;\n layerArray.length && layerArray.forEach((layer, i) => {\n const def = layerFactory.sanitizeLayerConfig(layer);\n def.order = i;\n serializedLayers.push(def);\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n const layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n\n // let currentLayerIndex = 0;\n columnFields.forEach((colField) => {\n const colFieldName = colField.toString();\n rowFields.forEach((rowField) => {\n let configs = [];\n const rowFieldName = rowField.toString();\n const encoding = {\n x: {\n field: colFieldName\n },\n y: {\n field: rowFieldName\n }\n };\n const rowFieldType = rowField.subtype();\n const colFieldType = colField.subtype();\n const mark = getDefaultMark(colFieldType, rowFieldType);\n\n const defConfigs = [{\n mark,\n def: {\n mark,\n encoding\n }\n }];\n\n const layerConfigs = getLayerConfFromFields(colField.getMembers(),\n rowField.getMembers(), userLayerConfig || []);\n if (layerConfigs.length) {\n configs = layerConfigs.map((layerConf) => {\n const mergedLayerConf = mergeRecursive(mergeRecursive({}, defConfigs[0].def), layerConf);\n const serializedLayerConfig = layerFactory.getSerializedConf(mergedLayerConf.mark,\n mergedLayerConf);\n return {\n mark: mergedLayerConf.mark,\n order: mergedLayerConf.order,\n def: serializedLayerConfig\n };\n });\n } else {\n configs = defConfigs;\n }\n\n layerConfig.push(...configs);\n });\n });\n return this.sanitizeLayerConfig(retinalConfig, layerConfig);\n }\n\n hasMandatoryFields (fields) {\n const { colProjections, rowProjections } = fields;\n const colFields = super.hasMandatoryFields({ colProjections });\n const rowFields = super.hasMandatoryFields({ rowProjections });\n return colFields && rowFields;\n }\n}\n","import { AngleAxis, RadiusAxis } from '@chartshq/muze-axis';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n GROUP_BY_FUNCTIONS,\n COORD_TYPES,\n toArray,\n getObjProp,\n defaultValue\n} from 'muze-utils';\nimport VisualEncoder from './visual-encoder';\nimport { SIZE, MEASURE, ARC, COLOR } from '../enums/constants';\nimport { sanitizeIndividualLayerConfig, resolveAxisConfig } from './encoder-helper';\nimport { SimpleVariable } from '../variable';\n\nconst POLAR = COORD_TYPES.POLAR;\nconst { RADIUS, ANGLE, ANGLE0 } = ENCODING;\n\nconst axesCls = {\n [RADIUS]: RadiusAxis,\n [ANGLE]: AngleAxis,\n [ANGLE0]: AngleAxis\n};\n\nconst getSizeMultiplier = (sizeVal, sizeAxis) => {\n const sizeAxisDomain = sizeAxis.domain();\n const sizeMultiplier = sizeAxis.getSize(sizeVal) / (sizeAxisDomain ? sizeAxis.range()[1] : sizeAxis.config().value);\n return sizeMultiplier;\n};\n\nconst setRadiusFactor = (context) => {\n const data = context.data();\n const sizeField = context.retinalFields().size.field;\n const { radius, size } = context.axes();\n\n if (sizeField && radius && radius.length) {\n const sizeFieldIndex = data.getFieldsConfig()[sizeField].index;\n const sizeVal = data.getData().data.reduce((acc, val) => acc + val[sizeFieldIndex], 1);\n const sizeMultiplier = getSizeMultiplier(sizeVal, size[0]);\n radius.forEach(axis => axis.setRadiusFactor(sizeMultiplier));\n }\n};\n\n/**\n *\n *\n * @export\n * @class PolarEncoder\n * @extends {VisualEncoder}\n */\nexport default class PolarEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof PolarEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const {\n axes\n } = axesCreators;\n const geomCellAxes = axes;\n const {\n indices\n } = fieldInfo;\n const {\n rowIndex,\n columnIndex\n } = indices;\n // Dummy axes for polar, to create blank cells\n const pieAxes = geomCellAxes.pie || [];\n\n pieAxes[rowIndex] = pieAxes[rowIndex] || [];\n pieAxes[rowIndex][columnIndex] = [];\n\n const axesObj = {};\n const { geomCell, resolver } = context;\n const layers = resolver.matrixLayers();\n const resolverAxes = resolver.axes();\n const cellLayers = layers[rowIndex][columnIndex];\n const fields = {\n radius: {},\n angle: {},\n angle0: {}\n };\n\n cellLayers.forEach((layerConf) => {\n const def = layerConf.def;\n [ANGLE, ANGLE0, RADIUS].forEach((enc) => {\n const field = getObjProp(def.encoding, enc, 'field');\n field && (fields[enc][field] = 0);\n });\n });\n const fieldInf = {};\n const varInstances = {};\n\n for (const encType in fields) {\n fieldInf[encType] = Object.keys(fields[encType]);\n axesObj[encType] = [];\n varInstances[encType] = [];\n fieldInf[encType].forEach((field, i) => {\n varInstances[encType][i] = new SimpleVariable(field);\n axesObj[encType][i] = new axesCls[encType]();\n });\n axesObj[encType][axesObj[encType].length] = new axesCls[encType]();\n }\n resolveAxisConfig(context, fieldInf, {\n axesObj,\n rowIndex,\n columnIndex\n });\n geomCell.axes(axesObj)\n .fields(Object.assign({}, varInstances, geomCell.fields()));\n resolverAxes.pie = pieAxes;\n return geomCellAxes;\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields) {\n let counter = 0;\n const facets = [];\n const projections = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n\n for (let i = 0; i < primaryLen; i++) {\n const primaryField = primaryFields[i];\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter++];\n const projArr = secondaryField ? [primaryField, secondaryField] : [primaryField];\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n }\n }\n }\n return {\n facets,\n projections\n };\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n store.lockModel();\n const domainProps = {\n radius: [],\n angle: [],\n angle0: []\n };\n const axes = context.resolver().axes();\n context.matrixInstance().value.each((cell, rIdx, cIdx) => {\n const unit = cell.valueOf();\n const unitDomains = unit.dataDomain();\n const fields = unit.fields();\n setRadiusFactor(unit);\n [RADIUS, ANGLE, ANGLE0].forEach((encType) => {\n const encodingFields = fields[encType];\n const domains = unitDomains[encType] || {};\n encodingFields.forEach((field, i) => {\n !domainProps[encType][rIdx] && (domainProps[encType][rIdx] = []);\n !domainProps[encType][rIdx][cIdx] && (domainProps[encType][rIdx][cIdx] = []);\n domainProps[encType][rIdx][cIdx][i] = domains[`${field}`] || [];\n });\n });\n });\n\n for (const key in domainProps) {\n const specificAxes = axes[key];\n specificAxes.forEach((axesArr, rIdx) => {\n axesArr.forEach((axisArr, cIdx) => {\n axisArr.forEach((axis, i) => {\n axis.domain(defaultValue(getObjProp(domainProps[key], rIdx, cIdx, i), []));\n\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${key}`, domainProps[key],\n `${rIdx}-${cIdx}`);\n });\n });\n });\n }\n store.unlockModel();\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n setCommonDomain () {\n // No domain to be set\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n static type () {\n return POLAR;\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof PolarEncoder\n */\n fieldSanitizer (datamodel, config) {\n let sanitizedRows = [[], []];\n let sanitizedColumns = [[], []];\n const fields = super.fieldSanitizer(datamodel, config);\n const {\n layers\n } = config;\n const {\n rows,\n columns\n } = fields;\n const layer = layers[0];\n const encoding = layer.encoding;\n const radius = encoding && encoding.radius ? encoding.radius.field : null;\n const angle = encoding && encoding.angle ? encoding.angle.field : null;\n const sanitizedFields = [sanitizedRows, sanitizedColumns];\n\n [rows, columns].forEach((fieldType, typeIndex) => {\n fieldType.forEach((fieldSet, i) => fieldSet.forEach((field) => {\n if (field.toString() !== radius && field.toString() !== angle && field.type() !== MEASURE) {\n sanitizedFields[typeIndex][i].push(field);\n }\n }));\n });\n sanitizedColumns = [...new Set(sanitizedColumns)];\n sanitizedRows = [...new Set(sanitizedRows)];\n this.fieldInfo({ rows: sanitizedRows, columns: sanitizedColumns });\n return this.fieldInfo();\n }\n\n getRetinalFieldsDomain (dataModels, encoding, facetFields, groupBy) {\n let sizeField;\n let colorField;\n const fields = [];\n const layers = this.layers();\n const dataModel = dataModels.groupedModel;\n const fieldsConfig = dataModel.getFieldsConfig();\n const domains = {};\n if (layers && layers[0]) {\n const layer = layers[0];\n const layerEncoding = layer.def.encoding || {};\n\n [RADIUS, ANGLE, SIZE, COLOR].forEach((encType) => {\n const field = layerEncoding[encType] ? layerEncoding[encType].field : '';\n const measureField = fieldsConfig[field] && fieldsConfig[field].def.type === MEASURE;\n if (encType === SIZE && measureField) {\n sizeField = field;\n }\n if (encType === COLOR) {\n colorField = field;\n }\n fieldsConfig[field] && !measureField && fields.push(field);\n });\n }\n\n if (sizeField) {\n domains[sizeField] = dataModel.groupBy(facetFields, {\n [sizeField]: GROUP_BY_FUNCTIONS.SUM\n }).getFieldspace().fieldsObj()[sizeField].domain();\n }\n\n if (colorField) {\n const dm = dataModel.groupBy([...facetFields, ...fields], groupBy.measures);\n domains[colorField] = dm.getFieldspace().fieldsObj()[colorField].domain();\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof PolarEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n let layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n const allFields = [...columnFields, ...rowFields];\n\n allFields.forEach(() => {\n const encoding = {};\n let config = {\n mark: ARC,\n def: {\n encoding\n }\n };\n if (userLayerConfig && userLayerConfig.length > 0) {\n config = mergeRecursive(config, userLayerConfig[0]);\n }\n layerConfig.push(config);\n });\n if (layerConfig.length === 0) {\n layerConfig = userLayerConfig;\n }\n const sanitizedConfig = this.sanitizeLayerConfig(retinalConfig, layerConfig);\n this.layers(sanitizedConfig);\n return sanitizedConfig;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n *\n * @memberof PolarEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n\n layerArray.length && layerArray.forEach((layer) => {\n const def = layerFactory.getSerializedConf(layer.mark, layer);\n serializedLayers.push({\n mark: layer.mark,\n def\n });\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n def.forEach((conf) => {\n const encoding = conf.encoding || (conf.encoding = {});\n !encoding.angle && (encoding.angle = {});\n const angleField = getObjProp(encoding.angle, 'field');\n const angle0Field = getObjProp(encoding.angle0, 'field');\n\n if (!angleField) {\n Object.assign(encoding.angle, {\n field: encodingConfigs.color && encodingConfigs.color.field\n });\n }\n if (!angle0Field) {\n !encoding.angle0 && (encoding.angle0 = {});\n Object.assign(encoding.angle0, {\n field: encoding.angle.field\n });\n }\n });\n\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n hasMandatoryFields (fields) {\n const { optionalProjections } = fields;\n return super.hasMandatoryFields({ optionalProjections });\n }\n}\n","import { createRetinalAxis } from './encoder-helper';\nimport { COLOR, SHAPE, SIZE } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\n/**\n *\n *\n * @export\n * @class RetinalEncoder\n * @extends {VisualEncoder}\n */\nexport default class RetinalEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n *\n * @memberof RetinalEncoder\n */\n createAxis (axesCreators) {\n const { fieldsConfig, config } = axesCreators;\n const newAxes = {};\n\n [COLOR, SHAPE, SIZE].forEach((axisType) => {\n newAxes[`${axisType}`] = createRetinalAxis({ axisType, fieldsConfig }, config[axisType]);\n });\n return newAxes;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof RetinalEncoder\n */\n static type () {\n return 'retinal';\n }\n\n /**\n *\n *\n * @param {*} context\n *\n * @memberof RetinalEncoder\n */\n setCommonDomain (context) {\n const { domains, axes, encoding } = context;\n\n Object.entries(encoding).forEach((enc) => {\n if (enc[1] && enc[1].field) {\n const encType = enc[0];\n const field = enc[1].field;\n\n if (field) {\n axes[encType].forEach((axis) => {\n const domain = domains[field];\n !enc[1].domain && axis.updateDomain(domain);\n });\n }\n }\n });\n\n return axes;\n }\n}\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Artboard.\n * Artboard merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module\n */\n\nexport default {\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * Interfaces for VisualGroup. Any new VisualGroup has to implement this class.\n * @class SimpleGroup\n */\nclass SimpleGroup {\n\n /**\n * This method is used to set or get the DataModel instance.\n *\n * @param {DataModel | undefined} dataModel Instance of datamodel.\n\n * @memberof SimpleGroup\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to set or get the group specific configuration\n * properties\n *\n * @param {Object | undefined} configObj The input configuration.\n * or instance of visual group.\n * @memberof SimpleGroup\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to return a serialized representation of the\n * instance's properties.\n *\n * @memberof SimpleGroup\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to get or set the measurement object which houses\n * layout properties like width and height.\n *\n * @param {Object | undefined} mObj The measurement properties.\n * @memberof SimpleGroup\n */\n measurement () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n\nexport default SimpleGroup;\n","/**\n * This is a wrapper class over the matrix of cells which gets created in visual group. Visual Group creates left,\n * right, bottom and top and center matrices and wraps them using this class.\n *\n * @public\n * @class ValueMatrix\n */\nclass ValueMatrix {\n\n /**\n * Creates an instance of ValueMatrix.\n *\n * @param {Array} matrixArr Matrix array.\n */\n constructor (matrixArr) {\n const instancesById = {};\n\n this.matrix(matrixArr || []);\n this.filter(() => true);\n\n this.each((el, rIdx, cIdx) => {\n const cellValue = el.valueOf();\n if (cellValue && cellValue.id) {\n const id = cellValue.id();\n instancesById[id] = {\n instance: cellValue,\n rowIndex: rIdx,\n colIndex: cIdx\n };\n }\n });\n\n this.instancesById(instancesById);\n }\n\n instancesById (...id) {\n if (id.length) {\n this._instancesById = id[0];\n return this;\n }\n return this._instancesById;\n }\n\n /**\n * Returns the array of matrices contained in this instance.\n *\n * @public\n * @return {Array} Array of matrices.\n */\n matrix (...matrix) {\n if (matrix.length) {\n this._matrix = matrix[0];\n return this;\n }\n return this._matrix;\n }\n\n /**\n * Sets a filter criteria. This filter criteria gets applied when each function is called.\n *\n * @public\n * @param {Function} fn Filter function.\n *\n * @return {ValueMatrix} Instance of value matrix.\n */\n filter (...fn) {\n if (fn.length) {\n this._filterFn = fn[0];\n return this;\n }\n return this._filterFn;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n width () {\n let rowWidth = 0;\n\n this.matrix().forEach((row) => {\n let currentRowWidth = 0;\n row.forEach((cell) => {\n currentRowWidth += cell.getLogicalSpace().width;\n });\n rowWidth = Math.max(rowWidth, currentRowWidth);\n });\n return rowWidth;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n height () {\n let rowHeight = 0;\n\n this.matrix().forEach((row) => {\n let currentRowHeight = 0;\n row.forEach((cell) => {\n currentRowHeight = Math.max(currentRowHeight, cell.getLogicalSpace().height);\n });\n rowHeight += currentRowHeight;\n });\n return rowHeight;\n }\n\n /**\n * Iterates through the two dimensional matrix array and calls the given callback function with the cell instance,\n * row index, column index and the matrix array.\n *\n * @param {Function} fn Callback function which will get called for every cell.\n * @return {ValueMatrix} Instance of the value matrix.\n */\n each (fn) {\n const matrix = this.matrix();\n const filterFn = this.filter();\n\n matrix.forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n if (filterFn(col)) {\n fn(col, rIndex, cIndex, matrix);\n }\n });\n });\n return this;\n }\n\n findPlaceHolderById (id) {\n return this.instancesById()[id];\n }\n\n clear () {\n this.each(cell => cell.remove());\n this.matrix([]);\n }\n\n data () {\n\n }\n}\n\nexport default ValueMatrix;\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { STATE_NAMESPACES, CommonProps, InvalidAwareTypes } from 'muze-utils';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { getBorders } from '../group-helper';\nimport { RetinalEncoder } from '../encoder';\nimport { registerDomainChangeListener, unsubscribeChangeListeners } from './change-listener';\nimport ValueMatrix from './value-matrix';\nimport { ROWS, COLUMNS, DATA } from '../enums/constants';\n\nexport const createUnitState = (context) => {\n const [globalState, localState] = VisualUnit.getState();\n const store = context.store();\n store.append(STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE, localState);\n};\n\nexport const initializeGlobalState = (context) => {\n const globalState = context.constructor.getState()[0];\n const store = context.store();\n store.append(STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE, globalState);\n};\n\nexport const createLayerState = (context) => {\n const [globalState, localState] = BaseLayer.getState();\n context.store().append(STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE, localState);\n};\n\nconst sanitizeRetinalConfig = (retinalConf) => {\n const conf = {};\n for (const key in retinalConf) {\n const confValue = retinalConf[key];\n if (typeof confValue === 'string' || !confValue) {\n conf[key] = {\n field: retinalConf[key]\n };\n } else {\n conf[key] = confValue;\n }\n }\n return conf;\n};\n\nexport const setMatrixInstances = (context, placeholder) => {\n let {\n values,\n rows,\n columns\n } = placeholder;\n values = values || [];\n rows = rows || [];\n columns = columns || [];\n context._composition.matrices = {\n value: new ValueMatrix(values),\n left: new ValueMatrix(rows[0]),\n right: new ValueMatrix(rows[1]),\n top: new ValueMatrix(columns[0]),\n bottom: new ValueMatrix(columns[1])\n };\n\n context._dependencies.throwback.commit(CommonProps.MATRIX_CREATED, true);\n return context;\n};\n\nconst hasValue = (val) => {\n let hasOneValue = false;\n for (let i = 0; i < val.length && !hasOneValue; i++) {\n for (let j = 0; j < val[i].length; j++) {\n if (!(val[i][j] instanceof InvalidAwareTypes)) {\n hasOneValue = true;\n break;\n }\n }\n }\n return hasOneValue;\n};\n\nexport const updateChecker = (context, props) => props.every((option) => {\n const val = context[option]();\n switch (option) {\n case ROWS:\n case COLUMNS:\n return val !== null;\n case DATA:\n return val && !val.isEmpty() && hasValue(val.getData().data);\n\n default:\n return true;\n }\n});\n\nexport const initializeFields = (context) => {\n const rows = context.rows();\n const columns = context.columns();\n const color = context.color();\n const datamodel = context.data();\n const size = context.size();\n const detail = context.detail();\n const layers = context.layers();\n const transform = context.transform();\n const config = context.config();\n const shape = context.shape();\n // Get the resolver for the matrices\n const resolver = context.resolver();\n\n resolver.store(context.store());\n resolver.valueParser(context.valueParser());\n\n // Prepare configuration for matrix preparation\n let matrixConfig = {\n selection: context.selection(),\n alias: context.alias(),\n globalConfig: config || {},\n rows,\n columns,\n detail,\n layers,\n transform\n };\n\n unsubscribeChangeListeners(context);\n\n const retinalConfig = sanitizeRetinalConfig({\n color,\n shape,\n size\n });\n\n matrixConfig = Object.assign(matrixConfig, retinalConfig);\n // Create the encoders for the group\n const encoders = {};\n encoders.retinalEncoder = new RetinalEncoder();\n encoders.simpleEncoder = context.createEncoderInstance();\n matrixConfig.coord = encoders.simpleEncoder.constructor.type();\n resolver.encoder(encoders.simpleEncoder);\n\n // Set the group type\n context.groupType(encoders.simpleEncoder.constructor.type());\n\n // Get sanitized fields as instances of the Vars Class\n const fields = encoders.simpleEncoder.fieldSanitizer(datamodel, matrixConfig);\n encoders.simpleEncoder.setAxisAndHeaders(config ? config.axisFrom : {}, fields);\n // Setting layers for the code\n layers && resolver.layerConfig(layers);\n // Set the row and column axes\n resolver.horizontalAxis(fields.rows, encoders).verticalAxis(fields.columns, encoders);\n\n return {\n rows,\n columns,\n color,\n datamodel,\n size,\n detail,\n layers,\n transform,\n config,\n shape,\n resolver,\n matrixConfig,\n retinalConfig,\n encoders,\n fields\n };\n};\n\nexport const createMatrices = (context, sanitizedConfig) => {\n const { groupConfig, resolverConfig } = sanitizedConfig;\n const {\n config,\n resolver,\n matrixConfig,\n encoders,\n retinalConfig,\n fields\n } = groupConfig;\n\n const placeholderInfo = resolver.getMatrices(resolverConfig);\n\n context._groupedDataModel = placeholderInfo.dataModels.groupedModel;\n // Set the selection object\n context.selection(placeholderInfo.selection);\n\n // Create retinal axes\n resolver.createRetinalAxes(placeholderInfo.dataModels.parentModel.getFieldsConfig(), retinalConfig,\n encoders);\n\n // Domains are evaluated for each of the axes for commonality\n resolver.setRetinalAxisDomain(matrixConfig, placeholderInfo.dataModels, encoders);\n\n // Create matrix instances\n setMatrixInstances(context, placeholderInfo);\n\n // Prepare corner matrices\n context.cornerMatrices(resolver.createHeaders(placeholderInfo, fields, config));\n\n // Set placeholder information\n context.placeholderInfo(placeholderInfo);\n\n context._composition.axes = resolver.axes();\n context.metaData({\n border: getBorders(placeholderInfo, encoders.simpleEncoder)\n });\n\n resolver.encoder().unionUnitDomains(context);\n\n registerDomainChangeListener(context);\n return context;\n};\n\nexport const initializeResolverFields = (context, config) => {\n const {\n datamodel,\n encoders,\n resolver,\n componentRegistry\n } = context;\n const {\n globalConfig,\n selection,\n transform\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const { smartlabel: labelManager } = resolver.dependencies();\n const fieldMap = datamodel.getFieldsConfig();\n const layerConfig = resolver.layerConfig();\n const registry = resolver.registry();\n const { fields: normalizedRows } = resolver.horizontalAxis();\n const { fields: normalizedColumns } = resolver.verticalAxis();\n const otherEncodings = resolver.optionalProjections(config, layerConfig, datamodel.getSchema());\n const facetsAndProjections = resolver.getAllFields();\n const { simpleEncoder } = encoders;\n const shouldRender = simpleEncoder.hasMandatoryFields(facetsAndProjections);\n return {\n datamodel,\n encoders,\n resolver,\n globalConfig,\n selection,\n transform,\n componentRegistry,\n groupBy,\n labelManager,\n fieldMap,\n layerConfig,\n registry,\n normalizedRows,\n normalizedColumns,\n otherEncodings,\n facetsAndProjections,\n simpleEncoder,\n shouldRender,\n config\n };\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\n\nexport const setupChangeListeners = (context) => {\n const store = context.store();\n const stores = {\n throwback: context._dependencies.throwback,\n store\n };\n\n ['x', 'y'].forEach((axisType) => {\n store.registerChangeListener([`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${axisType}`], () => {\n const groupAxes = context.resolver().axes();\n groupAxes[axisType].forEach(axes => axes.forEach((axis) => {\n axis.render();\n }));\n });\n });\n const { VisualUnit, layerRegistry } = context.registry();\n const { base: BaseLayer } = layerRegistry;\n [VisualUnit, BaseLayer].forEach((comp) => {\n const formalName = comp.formalName();\n ['store', 'throwback'].forEach((type) => {\n const listeners = comp.getListeners()[type];\n const storeInst = stores[type];\n listeners.forEach((listenerInf) => {\n storeInst[listenerInf.type](listenerInf.props, listenerInf.listener, false, {\n namespace: formalName,\n subNamespace: listenerInf.subNamespace\n });\n });\n });\n });\n};\n\nexport const registerDomainChangeListener = (context) => {\n const store = context.store();\n store.registerChangeListener([`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`], () => {\n context.resolver().encoder().unionUnitDomains(context);\n }, false, {\n key: 'unionDomain'\n });\n};\n\nexport const unsubscribeChangeListeners = (context) => {\n context.store().unsubscribe({\n key: 'unionDomain'\n });\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\nexport const PROPS = {\n alias: {},\n data: {},\n cornerMatrices: {\n defaultValue: {\n topLeft: [],\n topRight: [],\n bottomLeft: [],\n bottomRight: []\n }\n },\n groupType: {},\n\n metaData: {\n defaultValue: {\n border: {}\n }\n },\n placeholderInfo: {\n defaultValue: {}\n },\n resolver: {},\n valueParser: {\n defaultValue: val => val\n },\n registry: {\n sanitization: (context, value) => {\n if (context.resolver) {\n context.resolver().registry({\n cells: value.cellRegistry,\n VisualUnit: value.VisualUnit\n });\n }\n return value;\n }\n },\n selection: {},\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { generateGetterSetters } from 'muze-utils';\nimport localOptions from './local-options';\nimport { SimpleGroup } from '../simple-group';\nimport {\n MatrixResolver,\n findInGroup,\n getEncoder\n} from '../group-helper';\nimport {\n createUnitState,\n initializeGlobalState,\n setMatrixInstances,\n createMatrices,\n createLayerState,\n initializeResolverFields,\n initializeFields,\n updateChecker\n} from './helper';\nimport { setupChangeListeners } from './change-listener';\nimport { PROPS } from './props';\nimport {\n CONFIG,\n MOUNT,\n RETINAL,\n Y,\n ROWS,\n COLUMNS,\n DATA\n} from '../enums/constants';\n\n/**\n * VisualGroup is instantiated by canvas for creating {@link VisualUnit} and axes instances.It creates the\n * the matrix of visual units and axes. It also creates the layout instance which manages the allocation\n * of space of matrices.\n *\n * To get instance of visual group,\n * ```\n * const visualGroup = canvas.composition().visualGroup;\n * ```\n * @public\n *\n * @class VisualGroup\n */\nclass VisualGroup extends SimpleGroup {\n\n /**\n * Creates an instance of VisualGroup. Requires dependencies and other registry options for placeholders\n * and layers that create individual units.\n *\n * @param {Object} registry Key value pair of compostions for the group\n * @param {Object} dependencies Dependencies needed to run the group\n * @memberof VisualGroup\n */\n constructor (registry, dependencies) {\n super();\n\n const {\n components,\n componentSubRegistry,\n interactions\n } = registry;\n\n this._dependencies = dependencies;\n // Generate getter/setter methods for all properties of the class\n // One can get each property by calling the method and can set it\n // by passing paramaters for the same. Thus, one can chain setter\n // getter methods.\n generateGetterSetters(this, this.constructor.getterSetters());\n generateGetterSetters(this, this.constructor.localOptions());\n // Populate the store with default values\n // initialize group compositions\n this._composition = {};\n // store reference to data\n this._data = [];\n // store reference to mountpoint\n this._mount = null;\n // selection object that takes care of updating of components\n this._selection = {};\n // Create instance of matrix resolver\n this.createMatrixResolver();\n // matrix instance store each of the matrices\n setMatrixInstances(this, {});\n // Getting indiviual registered items\n this.registry({\n layerRegistry: componentSubRegistry.layers.get(),\n cellRegistry: componentSubRegistry.cells.get(),\n VisualUnit: components.VisualUnit,\n interactions\n });\n }\n\n static getState () {\n return [{\n domain: {\n x: null,\n y: null,\n radius: null,\n angle: null,\n angle0: null\n }\n }, {}];\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n initializeGlobalState(this);\n createUnitState(this);\n createLayerState(this);\n // Register listeners\n setupChangeListeners(this);\n return this;\n }\n return this._store;\n }\n\n static formalName () {\n return 'VisualGroup';\n }\n\n static localOptions () {\n return localOptions;\n }\n static getterSetters () {\n return PROPS;\n }\n\n /**\n * Return the instances of matrices created by the visual group.\n *\n * @return {Object} Instance of matrices.\n */\n matrixInstance (...matrices) {\n if (matrices.length) {\n return this;\n }\n return this.composition().matrices;\n }\n\n /**\n * Returns the composition of visual group.\n *\n * @public\n *\n * @return {Object} Composition of visual group. It contains instance of matrices {@link ValueMatrix}\n * and instances of axis.\n * ```\n * {\n * matrices: {\n * value: // Instance of center value matrix.\n * left: // Instance of left value matrix\n * right: // Instance of right value matrix\n * bottom: // Instance of bottom value matrix\n * top: // Instance of top value matrix.\n * },\n * axes: {\n * x: // Array of x axis.\n * y: // Array of y axis\n * color: // Array of color axis\n * shape: // Array of shape axis\n * size: // Array of size axis.\n * }\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n /**\n * Locks the model to prevent change listeners to be triggered until unlocked\n *\n * @return {Object} Instance of class VisualGroup\n * @memberof VisualGroup\n */\n lockModel () {\n this.store().model.lock();\n return this;\n }\n\n /**\n * Unlocks the model so that all change listeners can be triggered\n *\n * @return {Object} Instance of class VisualGroup\n */\n unlockModel () {\n this.store().model.unlock();\n return this;\n }\n\n /**\n * Returns the channel name of the variable. Channels are rows, columns, color, shape and size.\n *\n * @public\n * @param {string} variable Name of the variable.\n *\n * @return {string} Name of the channel.\n */\n where (variable) {\n return findInGroup(variable, this.resolver().getAllFields());\n }\n\n /**\n * Gets the axis instances of the visual group based on the given axis type.\n *\n * @public\n * @param {string} type Type of axis. X,Y or retinal axes.\n *\n * @return {Array} Array of axis instances.\n */\n getAxes (type) {\n if (type === RETINAL) {\n return this.resolver().getRetinalAxes();\n }\n return this.resolver().getSimpleAxes(type);\n }\n\n /**\n * Returns the instances of cells based on the given type. Type can be given as `row' or `col`.\n *\n * @public\n * @return {Array} Two dimensional array of cells.\n */\n getCells (type) {\n return this.resolver()[`${type}Cells`]();\n }\n\n getFieldsFromChannel (channel) {\n const {\n rowProjections,\n colProjections\n } = this.resolver().getAllFields();\n return channel === Y ? rowProjections : colProjections;\n }\n\n getCellsByFacetKey (facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey] || [];\n return cells;\n }\n\n getAxesByFacetKey (axisType, facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey];\n const axes = cells[0].valueOf().axes()[axisType] || [];\n\n return axes;\n }\n\n /**\n * This method is used to return a serialized representation of the instance's properties.\n *\n * @return {Object} Object with config proprties.\n * @memberof VisualGroup\n */\n serialize () {\n const store = this.store();\n\n return {\n [CONFIG]: store.get(CONFIG),\n [MOUNT]: store.get(MOUNT)\n };\n }\n\n /**\n * Returns the grouped datamodel prepared by visual group. If there is no group by performed, then it returns the\n * original data model passed to visual group.\n *\n * @return {DataModel} Grouped data model.\n */\n getGroupByData () {\n return this._groupedDataModel;\n }\n\n createMatrices (sanitizedConfig) {\n createMatrices(this, sanitizedConfig);\n }\n\n getMandatoryFields () {\n const updateProps = updateChecker(this, [ROWS, COLUMNS, DATA]);\n let sanitizedValue = {\n groupConfig: {},\n resolverConfig: {},\n shouldRender: false\n };\n if (updateProps) {\n const localFields = initializeFields(this);\n const {\n datamodel,\n encoders,\n resolver,\n matrixConfig\n } = localFields;\n const context = {\n datamodel,\n componentRegistry: this.registry(),\n encoders,\n resolver\n };\n const resolverFields = initializeResolverFields(context, matrixConfig);\n sanitizedValue = {\n groupConfig: localFields,\n resolverConfig: resolverFields,\n shouldRender: resolverFields.shouldRender\n };\n }\n return sanitizedValue;\n }\n\n remove () {\n this.matrixInstance().value.clear();\n this.resolver().clear();\n const info = this.placeholderInfo();\n info.rows = null;\n info.columns = null;\n info.values = null;\n }\n\n createEncoderInstance () {\n const layers = this.layers();\n\n return getEncoder(layers);\n }\n\n createMatrixResolver () {\n this.resolver(new MatrixResolver(this._dependencies));\n\n return this;\n }\n}\n\nexport default VisualGroup;\n","import { PersistentBehaviour, SELECTION } from '@chartshq/muze-firebolt';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return 'select';\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt._propagationInf;\n // new add set\n const existingRemoveSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_OLD_EXIT\n || selectionSet._set[d] === SELECTION.SELECTION_NEW_EXIT);\n\n if (propagationInf.sourceId) {\n selectionSet.reset();\n selectionSet.add(addSet);\n } else {\n // existing add set\n if (existingRemoveSet.length) {\n selectionSet.updateEntry();\n selectionSet.add(existingRemoveSet);\n } else {\n selectionSet.updateExit();\n selectionSet.remove(addSet);\n }\n const { exitSet } = selectionSet.getSets(true);\n const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])];\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n return this;\n }\n}\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nconst CLASSPREFIX = 'muze';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n target: `.${CLASSPREFIX}-gradient-rect`,\n behaviours: [BEHAVIOURS.BRUSH]\n },\n [ACTIONS.HOVER]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.CLICK]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.SELECT]\n }\n};\n\nexport const propagationBehaviourMap = {\n [BEHAVIOURS.SELECT]: BEHAVIOURS.FILTER,\n [BEHAVIOURS.BRUSH]: BEHAVIOURS.HIGHLIGHT\n};\n","import * as BEHAVIOURS from '../enums/behaviours';\nimport * as sideEffects from '../enums/side-effects';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: [sideEffects.SELECTIONBOX, {\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }]\n};\n\nexport const propagationSideEffects = {\n [BEHAVIOURS.BRUSH]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: ['filter']\n};\n\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n\n","export const SELECTIONBOX = 'selectionBox';\nexport const Highlighter = 'highlighter';\nexport const Marker = 'marker';\n\n","import { propagationBehaviourMap } from './action-behaviour-map';\nimport { propagationSideEffects } from './behaviour-effect-map';\n\nexport const propagate = (firebolt, action, identifiers) => {\n const context = firebolt.context;\n const data = context.metaData();\n\n const propPayload = {};\n propPayload.action = propagationBehaviourMap[action] || action;\n // @TODO: Change fade propagationSideEffect for area layer\n propPayload.sideEffects = propagationSideEffects[action];\n propPayload.sourceCanvas = context.canvasAlias();\n const isMutableAction = firebolt._actions.behavioural[propPayload.action].constructor.mutates();\n\n const propConfig = {\n sourceId: firebolt.id(),\n payload: propPayload,\n criteria: propPayload.criteria === null ? null : identifiers,\n isMutableAction,\n action: propPayload.action\n };\n\n data.propagate(identifiers, propConfig, true);\n};\n\nexport const payloadGenerator = {\n __default: (selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const dataObj = selectionDataModel.getData();\n let schema = dataObj.schema;\n const payload = Object.assign({}, propPayload);\n schema = dataObj.schema;\n const data = dataObj.data;\n const sourceFields = schema.map(d => d.name);\n payload.criteria = !sourceIdentifiers && selectionDataModel.isEmpty() ? null :\n [sourceFields, ...data];\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : [];\n return payload;\n },\n brush: (dm, propConfig) => {\n const { criteria } = propConfig;\n return {\n criteria: criteria ? criteria.range : criteria\n };\n }\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const CONFIG = 'config';\nexport const DATAMODEL = 'dataModel';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const MAXWIDTH = 'max-width';\nexport const HEIGHT = 'height';\nexport const MOUNTPOINT = 'mountPoint';\nexport const GRIDLINEPARENTGROUPCLASS = 'grid-lines';\nexport const TRANSFORM = 'transform';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const DEFAULTCOLOR = '#F44336';\nexport const DEFAULTSIZE = 50;\nexport const VERTICAL_BUFFER = 10;\nexport const HORIZONTAL_BUFFER = 2;\nexport const DEFAULTICONSIZE = { // approximately the (size needed) * Math.PI value\n circle: 64,\n square: 45.8,\n default: 42.8\n};\nexport const DEFAULTSHAPE = 'circle';\nexport const STEP = 'step';\nexport const GRADIENT = 'gradient';\nexport const ORDINAL = 'ordinal';\nexport const SCALE_FUNCTIONS = {\n size: 'getSize',\n shape: 'getShape',\n color: 'getColor'\n};\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const HORIZONTAL = 'horizontal';\nexport const VERTICAL = 'vertical';\nexport const CENTER = 'center';\nexport const VALUE = 'value';\nexport const PATH = 'path';\nexport const SHAPE = 'shape';\nexport const ICON = 'icon';\nexport const RECT = 'rect';\nexport const START = 'start';\nexport const UPPER = 'upper';\nexport const LOWER = 'lower';\nexport const END = 'end';\nexport const SIZE = 'size';\nexport const DISCRETE = 'discrete';\nexport const MEASURE = 'measure';\nexport const DEFAULT = 'default';\n\nexport const POSITION_ALIGNMENT_MAP = {\n [LEFT]: VERTICAL,\n [RIGHT]: VERTICAL,\n [TOP]: HORIZONTAL,\n [BOTTOM]: HORIZONTAL\n};\n\nexport const OPPOSITE_POSITION = {\n [LEFT]: RIGHT,\n [RIGHT]: LEFT\n};\n\n","import { Firebolt } from '@chartshq/muze-firebolt';\nimport { propagate, payloadGenerator } from './helper';\nimport { STEP, GRADIENT } from '../enums/constants';\nimport { HIGHLIGHT } from '../enums/behaviours';\n/**\n * This class manages the interactions of legend.\n * @export\n * @class LegendFireBolt\n * @extends {Firebolt}\n */\nexport class LegendFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.initializeSideEffects();\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet[0];\n }\n\n propagate (behaviourName, payload, selectionSet) {\n propagate(this, behaviourName, selectionSet, {\n payload\n });\n }\n\n getAddSetFromCriteria (criteria) {\n let values;\n let uniqueIds;\n const type = this.context.constructor.type();\n\n if (criteria === null) {\n uniqueIds = null;\n } else if (type === STEP) {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n } else if (type === GRADIENT) {\n uniqueIds = [];\n } else {\n values = criteria;\n if (values instanceof Array) {\n values = values.slice(1, criteria.length);\n uniqueIds = [...new Set([].concat(...values))];\n } else {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n }\n }\n return {\n uids: uniqueIds,\n model: null\n };\n }\n\n getFullData () {\n return null;\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const payloadFn = payloadGenerator[config.action] || payloadGenerator.__default;\n const payload = payloadFn(data, config);\n const { propagationSourceId } = config;\n const propagationInf = {\n propagate: false,\n data,\n sourceId: propagationSourceId\n };\n const isActionSourceSame = config.sourceId === this.id();\n if (!isActionSourceSame && config.action === HIGHLIGHT) {\n // @todo make it configurable\n this.dispatchBehaviour(HIGHLIGHT, payload, propagationInf);\n }\n };\n }\n\n data () {\n return this.context.metaData();\n }\n\n id () {\n return `legend-${this.context._id}`;\n }\n\n sourceCanvas () {\n return this.context.canvasAlias();\n }\n\n shouldApplySideEffects () {\n return true;\n }\n}\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\n/**\n * Adds dragging action to the target element.\n * @param {firebolt} firebolt firebolt\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let endPos = {};\n let payload;\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const boundingBox = context.measurement().gradientDimensions;\n const axisType = context.config().align === 'horizontal' ? 'x' : 'y';\n const axisScale = context.axis().source().scale();\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n }).on('drag', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }).on('end', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n if (startPos[axisType] === endPos[axisType]) {\n payload = {\n criteria: null\n };\n } else {\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n }\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }));\n};\n\nexport default drag;\n","import { getEvent } from 'muze-utils';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} Firebolt instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n firebolt.triggerPhysicalAction('hover', payload);\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n const event = getEvent();\n firebolt.triggerPhysicalAction('hover', {\n criteria: null\n });\n event.stopPropagation();\n });\n};\n\nexport default hover;\n","/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nconst click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\n\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport click from './click';\nimport * as ACTIONNAMES from '../../enums/actions';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click\n};\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\n","import {\n getMousePos,\n getEvent,\n getD3Drag\n } from 'muze-utils';\nimport { HEIGHT, WIDTH, HORIZONTAL } from '../../enums/constants';\n\nconst getSelectionCriteria = (subject, axis, measures) => {\n let criteria = [];\n const {\n axisScale,\n axisType\n } = axis;\n const {\n startPos,\n endPos,\n selectionBoxMeasure,\n drawingInfMeasure,\n offset\n } = measures;\n const subjectStartPoint = subject[axisType];\n\n if (startPos[axisType] === endPos[axisType]) {\n criteria = [];\n } else if (subjectStartPoint + selectionBoxMeasure >= drawingInfMeasure + offset) {\n criteria = [axisScale.invert(drawingInfMeasure + offset - selectionBoxMeasure),\n axisScale.invert(drawingInfMeasure + offset)];\n } else if (subjectStartPoint - offset < offset) {\n criteria = [axisScale.invert(offset * 2), axisScale.invert(selectionBoxMeasure + offset * 2)];\n } else {\n criteria = [axisScale.invert(subjectStartPoint), axisScale.invert(subjectStartPoint + selectionBoxMeasure)];\n }\n axisType === 'x' ? criteria : criteria.reverse();\n return criteria;\n};\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let payload;\n const endPos = {};\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const axisScale = context.axis().source().scale();\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n const drawingInfMeasure = context.measurement().gradientDimensions[axisType === 'x' ?\n WIDTH : HEIGHT];\n const offset = axisScale.range()[axisType === 'x' ? 0 : 1];\n const measures = {\n drawingInfMeasure,\n offset\n };\n let subject = {};\n\n targetEl.call(d3Drag().on('start', function () {\n const event = getEvent();\n startPos = getMousePos(this, event.sourceEvent);\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n\n subject.x += event.dx;\n subject.y += event.dy;\n\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(subject, { axisScale, axisType }, measures);\n\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }).on('end', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(event, { axisScale, axisType }, measures);\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true,\n config: {\n transition: {\n duration: 200\n }\n }\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }));\n};\n\n","import { getSymbol, mergeRecursive } from 'muze-utils';\nimport {\n CENTER,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\nexport const ALIGN = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical'\n};\n\nexport const DEFAULT_MEASUREMENT = {\n height: 30,\n width: 30,\n maxWidth: Infinity,\n maxHeight: Infinity,\n padding: 2,\n margin: 2,\n marginHorizontal: 3,\n paddingRight: 4,\n border: 1\n};\n\nexport const LEGEND_TITLE = {\n text: '',\n orientation: (pos) => {\n if (pos === LEFT || pos === RIGHT) {\n return LEFT;\n } return CENTER;\n }\n};\n\nexport const DEFAULT_CONFIG = {\n buffer: {\n [ALIGN.HORIZONTAL]: 10,\n [ALIGN.VERTICAL]: 10\n },\n classPrefix: 'muze',\n borderStyle: 'solid',\n borderColor: 'rgba(0,0,0,0)',\n formatter: {\n bounds: {\n lower: 'less than',\n upper: 'more than'\n }\n },\n item: {\n text: {\n orientation: 'right',\n width: 10,\n formatter: (val, i, data, context) => context.valueParser()(val)\n },\n icon: {\n className: 'legend-icon',\n height: 20,\n width: 20,\n color: 'rgba(192,192,192,0.6)',\n type: 'square'\n }\n }\n // stops: 5\n};\n\nconst tempConfig = mergeRecursive({}, DEFAULT_CONFIG);\n\nconst ITEM_FORMATTER = {\n item: {\n text: {\n formatter: val => `${val[0]} - ${val[1]}`\n }\n }\n};\n\nexport const STEP_DEFAULT_CONFIG = mergeRecursive(tempConfig, ITEM_FORMATTER);\n\n/**\n * Creates a map of pre defined icons\n *\n * @param {string} icon Accepts a icon name like 'square', 'cross', 'diamond' etc\n * @return {Object} icon object which can be used to draw the icons\n */\nexport const ICON_MAP = (icon) => {\n if (icon && typeof (icon) === 'string') {\n return getSymbol(icon);\n } return icon;\n};\n\nexport const LEGEND_MARKER_PROPS = {\n size: 8,\n ROTATE_HORIZONTAL: 180,\n ROTATE_VERTICAL: 90,\n shape: 'triangle'\n};\n","import { makeElement } from 'muze-utils';\nimport { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { CLASSPREFIX, HEIGHT, WIDTH, HORIZONTAL, RECT } from '../../../enums/constants';\nimport { SELECTIONBOX } from '../../../enums/side-effects';\nimport { selectionBoxDrag } from '../../physical/selection-box-drag';\nimport { LEGEND_MARKER_PROPS } from '../../../legend/defaults';\nimport './styles.scss';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\n/* istanbul ignore next */ class SelectionBox extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._graphicElems = {\n rect: null\n };\n }\n\n static formalName () {\n return SELECTIONBOX;\n }\n\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n className: 'legend-selection-box',\n classPrefix: CLASSPREFIX\n };\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n */\n /* istanbul ignore next */ apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const firebolt = this.firebolt;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n const className = `${config.classPrefix}-${config.className}`;\n const { criteria } = payload;\n const { rect } = this._graphicElems;\n\n if (criteria === null) {\n rect && rect.remove();\n return this;\n }\n\n const domain = criteria[firebolt.context.fieldName()];\n const axisScale = axis.scale();\n const range = domain ? [axis.getScaleValue(domain[0]), axis.getScaleValue(domain[1])] : [];\n\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n\n const gradientDimension = firebolt.context.measurement().gradientDimensions[axisType === 'x' ?\n HEIGHT : WIDTH];\n\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n const legendGradContainer = context.getDrawingContext().svgContainer;\n const legendSelGroup = makeElement(legendGradContainer, 'g', [1],\n `${config.classPrefix}-selection-box-group`);\n\n if (firebolt.context.config().align === HORIZONTAL) {\n x = range[0] - rangeShifter || 0;\n y = LEGEND_MARKER_PROPS.size + 4;\n width = range[1] - range[0] || 0;\n height = gradientDimension;\n } else {\n x = LEGEND_MARKER_PROPS.size + 4;\n y = range[1] - rangeShifter || 0;\n height = range[0] - range[1] || 0;\n width = gradientDimension;\n }\n const enterFn = function (el) {\n selectionBoxDrag(firebolt)(el, ['brush']);\n };\n\n const selBox = makeElement(legendSelGroup, RECT, [{ domain, x, y, width, height }], className,\n { enter: enterFn });\n selBox.attr('y', y)\n .attr('x', x)\n .attr(WIDTH, width)\n .attr(HEIGHT, height);\n this._graphicElems.rect = selBox;\n return this;\n }\n}\n\nexport default SelectionBox;\n\n","import { selectElement } from 'muze-utils';\n\nexport const strategies = (firebolt) => {\n const context = firebolt.context;\n const classed = (set, className, change) => {\n const classPrefix = context.config().classPrefix;\n const uids = set.uids.map(d => d[0]);\n selectElement(context.mount())\n .selectAll(`.${classPrefix}-legend-columns`)\n .filter(d => uids.indexOf(d.id) !== -1)\n .selectAll('div')\n .classed(className, change);\n };\n\n return {\n fade: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-fadeout`, false);\n } else {\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-fadeout`, true);\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-fadeout`, false);\n }\n },\n brighten: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-brighten`, false);\n } else {\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-brighten`, true);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n }\n }\n };\n};\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { strategies } from './strategies';\nimport { Highlighter } from '../../../enums/side-effects';\n\nexport default class LegendHighlighter extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._strategies = strategies(this.firebolt);\n this._strategy = 'brighten';\n }\n\n static formalName () {\n return Highlighter;\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this);\n }\n}\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { makeElement, getSymbol } from 'muze-utils';\nimport { Marker } from '../../../enums/side-effects';\nimport { CLASSPREFIX, HORIZONTAL } from '../../../enums/constants';\nimport { LEGEND_MARKER_PROPS } from '../../../legend/defaults';\nimport './styles.scss';\n\nconst SYMBOL_PADDING = (Math.sqrt(3) * 3);\nconst AXIS_STROKE = 1;\nconst MARKER_BUFFER = 10;\n\nconst createTextCell = (className, labelManagerRef, cells) => {\n const { TextCell } = cells;\n const cell = new TextCell(\n {\n type: 'text',\n className: `${className}-text`\n }, {\n labelManager: labelManagerRef()\n }).config({ maxLines: 1 });\n cell._minTickDiff = { height: 0, width: 0 };\n\n return cell;\n};\n\nconst getRelativePosition = (canvas, legendContainer) => ({\n top: legendContainer.getBoundingClientRect().top - canvas.getBoundingClientRect().top,\n left: legendContainer.getBoundingClientRect().left - canvas.getBoundingClientRect().left\n});\nexport default class LegendMarker extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._graphicElements = {\n markerElement: null,\n legendmarkerTextContainer: null,\n legendmarkerText: null\n };\n }\n\n static formalName () {\n return Marker;\n }\n\n /**\n * It returns the default configuration needed by legend-marker.\n * @return {Object} Default configuration of the legend-marker.\n */\n static defaultConfig () {\n return {\n className: 'legend-marker',\n classPrefix: CLASSPREFIX,\n size: LEGEND_MARKER_PROPS.size,\n shape: LEGEND_MARKER_PROPS.shape\n };\n }\n\n apply (selectionSet, payload) {\n const className = `${this.config().classPrefix}-${this.config().className}`;\n if (payload.criteria && payload.criteria.length === 2) {\n const physicalAction = function () {\n // Register physical action on marker gere\n };\n const firebolt = this.firebolt;\n const labelManager = firebolt.context.labelManager;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n\n const range = payload.criteria[0] ? axis.getScaleValue(payload.criteria[1]) : 0;\n\n const legendGradContainer = context.getDrawingContext().svgContainer;\n\n const isFractional = payload.criteria[1][0] % 1 !== 0;\n\n const lableConfig = {\n top: 0,\n left: 0,\n labelText: isFractional ? payload.criteria[1][0].toFixed(2) : payload.criteria[1][0]\n };\n\n const { top, left } = getRelativePosition(context._canvasMount, legendGradContainer.node());\n const { oriTextHeight, oriTextWidth } = labelManager().getSmartText(lableConfig.labelText);\n let x;\n let y;\n let rotateAngle;\n\n const { size, shape } = config;\n if (context.config().align === HORIZONTAL) {\n x = range - (Math.sqrt(size / SYMBOL_PADDING)) + AXIS_STROKE;\n y = 5;\n rotateAngle = LEGEND_MARKER_PROPS.ROTATE_HORIZONTAL;\n lableConfig.top = top + y - 3 * MARKER_BUFFER;\n lableConfig.left = x + left - (oriTextWidth / 2) - (MARKER_BUFFER / 2);\n } else {\n y = range + Math.sqrt(size / (2 * SYMBOL_PADDING)) - AXIS_STROKE;\n x = 5;\n rotateAngle = LEGEND_MARKER_PROPS.ROTATE_VERTICAL;\n lableConfig.top = top + y - (3 * MARKER_BUFFER - 2) + (oriTextHeight / 2);\n lableConfig.left = x + left - oriTextWidth - MARKER_BUFFER;\n }\n\n const legendmarkerGroup = makeElement(legendGradContainer,\n 'g',\n [1],\n `${config.classPrefix}-${config.className}-group`);\n\n if (!this._graphicElements.markerElement) {\n this._graphicElements.markerElement = makeElement(legendmarkerGroup,\n 'path', [{ value: null }], className, { enter: physicalAction });\n }\n\n if (!this._graphicElements.legendmarkerTextContainer) {\n this._graphicElements.legendmarkerTextContainer = makeElement(\n context._canvasMount,\n 'div',\n [1],\n `${className}-text-container`);\n this._graphicElements.legendmarkerText = makeElement(\n this._graphicElements.legendmarkerTextContainer,\n 'div',\n [1],\n `${className}-text`);\n }\n const textElement = createTextCell(className, labelManager, context._cells);\n this._graphicElements.markerElement\n .data([{ value: payload.criteria }])\n .attr('transform', `translate(${x},${y}) rotate(${rotateAngle})`)\n .attr('d', getSymbol(shape).size(size * size)())\n .classed(`${className}-show`, true)\n .classed(`${className}-hide`, false);\n textElement.source(lableConfig.labelText);\n textElement.render(this._graphicElements.legendmarkerText.node());\n this._graphicElements.legendmarkerText\n .attr('style', `top: ${lableConfig.top}px; left:${lableConfig.left}px`)\n .classed(`${className}-show`, true)\n .classed(`${className}-hide`, false);\n } else if (this._graphicElements.markerElement && this._graphicElements.legendmarkerText) {\n this._graphicElements.markerElement\n .data([{ value: null }])\n .classed(`${className}-show`, false)\n .classed(`${className}-hide`, true);\n this._graphicElements.legendmarkerText\n .classed(`${className}-show`, false)\n .classed(`${className}-hide`, true);\n }\n }\n\n}\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n data: {},\n fieldName: {},\n legendContainer: {},\n measurement: {\n sanitization: (context, value) => {\n const measurement = mergeRecursive(context._measurement, value);\n ['padding', 'border', 'margin'].forEach((space) => {\n measurement[space] = Math.min(measurement[space] > 0 ? measurement[space] : 0,\n measurement.maxWidth * 0.1, measurement.maxHeight * 0.1);\n });\n return measurement;\n }\n },\n logicalSpace: {},\n metaData: {\n onset: (context, value) => context.firebolt().attachPropagationListener(value)\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.resetLogicalSpace();\n context.store().commit('range', value);\n return value;\n }\n },\n scale: {},\n smartTicks: {},\n store: {},\n title: {\n sanitization: (context, value) => mergeRecursive(context._title || {}, value)\n },\n labelManager: {},\n minTickDistance: {},\n valueParser: {\n defaultValue: val => val\n }\n};\n","import { makeElement, FieldType, getReadableTicks } from 'muze-utils';\n\nimport {\n SCALE_FUNCTIONS,\n WIDTH,\n HEIGHT,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n MAXWIDTH,\n CENTER,\n HORIZONTAL,\n POSITION_ALIGNMENT_MAP\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} scale\n *\n */\nexport const getScaleInfo = (scale) => {\n const scaleType = scale.constructor.type();\n const domain = scale.uniqueValues();\n const steps = scale.config().stops || 1;\n const scaleFn = SCALE_FUNCTIONS[scaleType];\n\n return { scaleType, domain, steps, scaleFn };\n};\n\n/**\n * Function to recompute the stops in array in case to left and right alignment of legend.\n *\n * @param {string} param - parameter to measure\n * @param {Object} requiredMeasure - required measure parameters\n * @param {Object} availableMeasure - available meassure parameters\n * @param {Array} domainForLegend - array\n * @param {Object} smartLabelCalc - smartLabel Manager\n * @return {Array} - Array\n */\nconst getcomputedArray = (computationhelper, requiredMeasure, availableMeasure, domainForLegend) => {\n // declaring Current and Next Tick Value variable\n let currentTickValue;\n let nextTickValue;\n const upperBound = domainForLegend[domainForLegend.length - 1];\n const param = computationhelper.measureParam;\n const smartLabelCalc = computationhelper.smartLabelCalc;\n\n // calculating pixel required per Tick Values\n const pixelPerTick = (availableMeasure[param] / upperBound);\n\n // checking if available max width is smaller than required width for legend.\n if (availableMeasure[param] >= requiredMeasure[param]) {\n return domainForLegend;\n }\n\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[0]))[param]);\n for (let i = 1; i < domainForLegend.length - 1; i++) {\n nextTickValue = Math.floor((currentTickValue / pixelPerTick) + domainForLegend[i - 1]);\n if (domainForLegend[i] < nextTickValue) {\n domainForLegend.splice(i, 1);\n i -= 1;\n }\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[i]))[param]);\n }\n return domainForLegend;\n};\n\n/**\n * function to recompute the Stops Array provided to prevent the Overlapping of values\n * @param {Array} domainForLegend - Stops Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - modified Stops Array\n */\nexport const getInterpolatedArrayData = (domainForLegend, scaleParams) => {\n // defining param for height/width selector\n let measureParam;\n\n // declaring variable for required Width\n let requiredWidth;\n\n // declaring variable for required height\n let requiredHeight;\n\n // declaring the variable for upperbound\n let upperBound = domainForLegend[domainForLegend.length - 1];\n\n // Initializing Minimum Tick Difference Variable and checking if it's less than 1 or not\n let minTickDiff = Math.ceil(domainForLegend[1] - domainForLegend[0]);\n\n // calculating max tick difference\n const maxTickDiff = Math.ceil(upperBound - domainForLegend[0]);\n\n // gradient Alignment\n const { alignment } = scaleParams;\n\n // getting SmartLabel Manager to calculate tick Params\n const smartLabelCalc = scaleParams.smartLabel;\n\n // scale Measurements (i.e MaxWidth and MaxHeight available)\n const availableSpace = scaleParams.measures;\n\n // getting minimum Tick size (i.e height and width)\n const minimumTickSize = scaleParams.minTickDistance;\n\n // getting domain upperbound dimensions\n const { height: tickDimHeight, width: tickDimWidth } = smartLabelCalc.getOriSize((upperBound));\n\n /* Checking if UpperBound of Domain is Floating or Not.\n In case of floating constricting it to 2 decimals after point. */\n if (!Number.isInteger(upperBound)) {\n upperBound = ((upperBound).toFixed(2));\n }\n\n // Calculating minimum tick difference\n minTickDiff = minTickDiff < 1 ? 1 : minTickDiff;\n\n // required width to render legend\n requiredWidth = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * (tickDimWidth + (minimumTickSize.width));\n\n requiredWidth -= Math.abs(maxTickDiff);\n\n // require height to render legend\n requiredHeight = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * tickDimHeight;\n\n requiredHeight -= Math.abs(maxTickDiff);\n\n // checking the alignment of legend\n if (alignment === TOP || alignment === BOTTOM) {\n measureParam = WIDTH;\n } else {\n measureParam = HEIGHT;\n }\n\n // calculating computed array\n domainForLegend = getcomputedArray({\n smartLabelCalc,\n measureParam\n }, {\n height: requiredHeight,\n width: requiredWidth\n }, {\n height: availableSpace.maxHeight,\n width: availableSpace.maxWidth\n }, domainForLegend);\n\n return domainForLegend;\n};\n\n/**\n * function to recalculate steps on providing more number of stops than canvas can accomodate.\n * @param {Array} domain - Array\n * @param {Array} steps - Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - recalculated Step Array\n */\nexport const getInterpolatedData = (domain, steps, scaleParams) => {\n // declaring recomputeSteps Variable\n let recomputeSteps = 0;\n\n const getTickMeasure = scaleParams.smartLabel;\n const { maxWidth, maxHeight } = scaleParams.measures;\n const { alignment } = scaleParams;\n // getting tick measure(i.e height and width)\n const tickValue = getTickMeasure.getOriSize(domain[1].toFixed(2));\n\n // To round the floating values to Integer and checking if value is 1.\n steps = Math.round(steps);\n steps = steps < 1 ? (steps + 1) : steps;\n\n // checking alignment of the Axis\n if (alignment === TOP || alignment === BOTTOM) {\n recomputeSteps = Math.floor(maxWidth / (tickValue.width));\n } else {\n recomputeSteps = Math.floor(maxHeight / (tickValue.height));\n }\n steps = Math.min(steps, recomputeSteps);\n\n return getReadableTicks(domain, steps);\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} text\n * @param {*} measurement\n * @param {*} classPrefix\n */\nexport const titleCreator = (container, title, measurement, config) => {\n const { orientation } = config.item.text;\n let textAlign = LEFT;\n const { alignment, maxWidth, width, height, border, padding } = measurement;\n\n if (orientation === TOP || orientation === BOTTOM || alignment === HORIZONTAL) {\n textAlign = CENTER;\n }\n const titleWidth = Math.min(maxWidth, width);\n\n const titleContainer = makeElement(container, 'table', [1], `${config.classPrefix}-legend-title`)\n .style(WIDTH, `${titleWidth}px`)\n .style(HEIGHT, `${height}px`)\n .style('border-bottom', `${border}px ${config.borderStyle} ${config.borderColor}`)\n .style('text-align', title.orientation instanceof Function ?\n title.orientation(config.position) : title.orientation);\n return makeElement(titleContainer, 'td', [1], `${config.classPrefix}-legend-title-text`)\n .style(WIDTH, `${titleWidth}px`)\n .style(MAXWIDTH, `${maxWidth}px`)\n .style(HEIGHT, '100%')\n .style('line-height', 1)\n .style('padding', `${padding}px`)\n .text(title.text)\n .style('text-align', textAlign)\n .style('overflow-x', 'scroll')\n .node();\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getMaxMeasures = (data, prop, labelManager) => {\n let maxHeight = -Infinity;\n let maxWidth = -Infinity;\n\n data.forEach((item) => {\n const value = prop ? item[prop] : item;\n const space = labelManager.getOriSize(value);\n maxHeight = Math.max(space.height + 2, maxHeight);\n maxWidth = Math.max(space.width + 2, maxWidth);\n });\n\n return { height: maxHeight, width: maxWidth };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getItemMeasures = (context, prop, formatter) => {\n const space = [];\n const data = context.data();\n const labelManager = context._labelManager;\n\n data.forEach((item, index) => {\n const value = prop ? item[prop] : item;\n const formattedData = formatter(value, index, context.metaData(), context);\n const { height, width } = labelManager.getOriSize(formattedData);\n space[index] = { height, width };\n });\n return space;\n};\n\n/**\n *\n *\n * @param {*} textOrientation\n * @param {*} effPadding\n * @param {*} titleSpace\n *\n * @memberof Legend\n */\nexport const computeItemSpaces = (config, measures, data) => {\n let totalHeight = 0;\n let totalWidth = 0;\n let maxItemSpaces = {\n width: 0, height: 0\n };\n const {\n effPadding,\n titleWidth,\n labelSpaces,\n titleHeight,\n maxWidth\n } = measures;\n const {\n item,\n align\n } = config;\n const {\n icon,\n text\n } = item;\n const textOrientation = text.orientation;\n const itemSpaces = [];\n const iconSpaces = [];\n let maxIconWidth = 0;\n labelSpaces.forEach((labelSpace, i) => {\n const itemSpace = { width: 0, height: 0 };\n const iconSpace = { width: 0, height: 0 };\n const datum = data[i] || {};\n // Compute each legend item height/width\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n // Get label, icon and item widths\n labelSpace.width += effPadding;\n iconSpace.width = (datum.size ? 2 * Math.sqrt(datum.size / Math.PI) : icon.width) + effPadding;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n itemSpace.width = labelSpace.width + maxIconWidth;\n\n // Get label, icon and item heights\n labelSpace.height = Math.max(labelSpace.height, icon.height) + effPadding;\n iconSpace.height = labelSpace.height;\n itemSpace.height = labelSpace.height;\n } else {\n // Get label, icon and item widths\n labelSpace.width = Math.max(labelSpace.width, datum.size ? 2 * Math.sqrt(datum.size / Math.PI)\n : icon.width) + effPadding;\n iconSpace.width = labelSpace.width;\n itemSpace.width = labelSpace.width;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n\n // Get label, icon and item heights\n labelSpace.height += effPadding;\n iconSpace.height = icon.height + effPadding;\n itemSpace.height = labelSpace.height + iconSpace.height;\n }\n // Compute height and width of legend for each alignment\n if (align === 'horizontal') {\n totalHeight = Math.max(totalHeight, itemSpace.height);\n } else {\n totalHeight += itemSpace.height;\n totalWidth = Math.max(totalWidth, itemSpace.width, titleWidth);\n }\n maxItemSpaces = {\n width: Math.max(itemSpace.width, maxItemSpaces.width),\n height: Math.max(itemSpace.height, maxItemSpaces.height)\n };\n itemSpaces.push(itemSpace);\n iconSpaces.push(iconSpace);\n });\n\n itemSpaces.forEach((itemSpace, i) => {\n if (align === 'horizontal') {\n itemSpace.height = totalHeight;\n // iconSpaces[i].width = maxIconWidth;\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n labelSpaces[i].height = totalHeight;\n iconSpaces[i].height = totalHeight;\n itemSpaces[i].width = labelSpaces[i].width + iconSpaces[i].width + 2 * effPadding;\n } else {\n labelSpaces[i].width = iconSpaces[i].width;\n itemSpaces[i].width = iconSpaces[i].width;\n labelSpaces[i].width = iconSpaces[i].width;\n }\n totalWidth += itemSpaces[i].width;\n } else {\n itemSpace.width = Math.max(totalWidth, maxWidth);\n if (textOrientation === TOP || textOrientation === BOTTOM) {\n labelSpaces[i].width = totalWidth;\n iconSpaces[i].width = totalWidth;\n maxIconWidth = totalWidth;\n } else {\n const labelWidth = labelSpaces[i].width;\n const newLabelWidth = (maxItemSpaces.width - maxIconWidth);\n iconSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = labelWidth + maxIconWidth;\n labelSpaces[i].width = Math.max(labelWidth, newLabelWidth);\n totalWidth = Math.max(totalWidth, itemSpace.width);\n }\n }\n });\n totalWidth = Math.ceil(Math.max(totalWidth, titleWidth)) + effPadding;\n totalHeight += titleHeight + effPadding;\n totalHeight = Math.ceil(totalHeight);\n return { totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth };\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} scaleInfo\n * @param {*} domainInfo\n *\n */\nexport const getDomainBounds = (type, scaleInfo, domainInfo) => {\n const {\n scaleFn,\n scaleType,\n scale\n } = scaleInfo;\n const {\n domain,\n domainBounds,\n domainLeg,\n steps\n } = domainInfo;\n const ele = domain[type === 'lower' ? 0 : domain.length - 1];\n const step = steps[type === 'lower' ? 0 : steps.length - 1];\n\n return {\n [scaleType]: scaleType === 'size' ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value: domainBounds[type],\n id: type === 'lower' ? 0 : domainLeg.length + 2,\n range: [ele, step]\n };\n};\n\nexport const prepareSelectionSetData = (data, fieldName, dm) => {\n const fieldType = dm.getFieldsConfig()[fieldName].def.type;\n if (fieldType === FieldType.DIMENSION) {\n return {\n keys: data.reduce((acc, d) => {\n acc[d.rawVal] = {\n uid: d.id,\n dims: [d.rawVal]\n\n };\n return acc;\n }, {}),\n fields: [fieldName]\n };\n }\n return {\n keys: data.reduce((acc, d) => {\n acc[d.id] = {\n uid: d.id,\n dims: [d.id]\n };\n return acc;\n }, {}),\n fields: [fieldName]\n };\n};\n\nexport const calculateTitleWidth = (measures, titleWidth, config) => {\n const { maxItemSpaces, margin, itemSpaces } = measures;\n const { position, buffer } = config;\n const alignment = POSITION_ALIGNMENT_MAP[position];\n let width = 0;\n\n if (alignment === HORIZONTAL) {\n const localBuffer = buffer[alignment];\n width = itemSpaces.reduce((acc, cur) => acc + cur.width + localBuffer, 0);\n } else if (maxItemSpaces.width < titleWidth) {\n width = titleWidth + 2 * margin;\n } else {\n width = maxItemSpaces.width;\n }\n return width;\n};\n","import {\n makeElement,\n selectElement,\n getUniqueId,\n getSmartComputedStyle,\n generateGetterSetters,\n mergeRecursive\n} from 'muze-utils';\nimport * as legendBehaviours from '../firebolt/behavioural';\n\nimport { LegendFireBolt } from '../firebolt/legend-firebolt';\nimport { actionBehaviourMap } from '../firebolt/action-behaviour-map';\nimport { physicalActions } from '../firebolt/physical';\nimport * as sideEffects from '../firebolt/side-effects';\nimport { behaviourEffectMap } from '../firebolt/behaviour-effect-map';\nimport { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM, POSITION_ALIGNMENT_MAP } from '../enums/constants';\nimport { PROPS } from './props';\nimport { DEFAULT_MEASUREMENT, DEFAULT_CONFIG, LEGEND_TITLE } from './defaults';\nimport {\n getItemMeasures,\n titleCreator,\n computeItemSpaces,\n prepareSelectionSetData,\n calculateTitleWidth\n} from './legend-helper';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class SimpleLegend\n */\nexport default class SimpleLegend {\n\n /**\n * Creates an instance of Legend.\n * @param {Object} dependencies Set of dependencies required by the legend\n * @memberof Legend\n */\n constructor (dependencies) {\n const { interactions } = dependencies.registry;\n this._data = [];\n this._metaData = [];\n this._mount = null;\n this._fieldName = null;\n this._title = Object.assign({}, LEGEND_TITLE);\n this._metaData = null;\n this._labelManager = dependencies.labelManager;\n this._cells = dependencies.cells;\n this._id = getUniqueId();\n this._measurement = Object.assign({}, this.constructor.defaultMeasurement());\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n\n const dist = dependencies.labelManager.getOriSize('w');\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n\n generateGetterSetters(this, PROPS);\n this._computedStyle = getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-item-info`);\n\n this._firebolt = new LegendFireBolt(this, {\n behavioural: Object.assign({}, interactions.behaviours.get(), legendBehaviours),\n physical: physicalActions,\n physicalBehaviouralMap: actionBehaviourMap\n }, sideEffects, behaviourEffectMap);\n }\n\n id () {\n return this._id;\n }\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new SimpleLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENT;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleLegend\n */\n firebolt (...params) {\n if (params.length) {\n return this;\n }\n return this._firebolt;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return PATH;\n }\n\n canvasAlias (...alias) {\n if (alias.length) {\n this._canvasAlias = alias[0];\n return this;\n }\n return this._canvasAlias;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n mount (...params) {\n if (params.length) {\n this._mount = params[0];\n this.render();\n return this;\n }\n return this._mount;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n const {\n item,\n classPrefix\n } = this.config();\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${classPrefix}-legend-item-info`));\n return getItemMeasures(this, VALUE, item.text.formatter);\n }\n\n /**\n * Sets the height and width of a legend based on provided max\n * height and width and based on its contents\n *\n * @return {Instance} Current instance\n * @memberof Legend\n */\n setLegendMeasures () {\n const {\n width,\n height,\n maxWidth,\n maxHeight,\n padding,\n margin,\n border\n } = this.measurement();\n const {\n align\n } = this.config();\n\n // Effective padding, margin and padding\n const effPadding = padding * 2;\n const effBorder = border * 2;\n const effMargin = margin * 2;\n\n this.data(this.dataFromScale());\n // Get space occupied by title\n const titleSpace = this.getTitleSpace();\n const titleHeight = titleSpace.height > 0 ? titleSpace.height + effPadding : 0;\n const titleWidth = titleSpace.width + effPadding;\n\n // Get space occupied by labels\n const labelSpaces = this.getLabelSpaces(effPadding, align);\n const {\n totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth\n } = computeItemSpaces(this.config(),\n { effPadding, titleWidth, labelSpaces, titleHeight, maxWidth, maxHeight }, this.data());\n\n this.measurement({\n width: Math.max(totalWidth, width) + effMargin + effBorder,\n height: Math.max(totalHeight, height) + effMargin + effBorder,\n labelSpaces,\n iconSpaces,\n itemSpaces,\n maxItemSpaces,\n maxIconWidth,\n titleSpaces: {\n width: Math.min(maxWidth, this.measurement().width) - effMargin - effBorder,\n height: titleHeight\n }\n });\n return this;\n }\n\n /**\n * Returns the space occupied by the legend title\n *\n * @return {Object} Space occupied by title\n * @memberof Legend\n */\n getTitleSpace () {\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-title`));\n return this._labelManager.getOriSize(this.title().text ? this.title().text : '');\n }\n\n /**\n * Creates the title for the legend\n *\n * @param {DOM} container Container made for the title\n * @return {Selection} Title and it's node\n * @memberof Legend\n */\n renderTitle (container) {\n const { titleSpaces, border, padding, maxWidth } = this.measurement();\n\n const width = calculateTitleWidth(\n this.measurement(),\n this._labelManager.getOriSize(this._title.text).width,\n this.config()\n );\n const { borderStyle, borderColor } = this.config();\n return titleCreator(container, this.title(), {\n height: titleSpaces.height,\n width,\n maxWidth,\n border,\n padding,\n borderStyle,\n borderColor,\n alignment: POSITION_ALIGNMENT_MAP[this.config().position]\n }, this.config());\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const {\n classPrefix,\n borderStyle,\n borderColor,\n position\n } = this.config();\n const {\n border,\n marginHorizontal,\n maxHeight,\n height,\n width,\n maxWidth\n } = this.measurement();\n let {\n margin\n } = this.measurement();\n const legendContainer = makeElement(selectElement(this.mount()), 'div', [1], `${classPrefix}-legend-box`);\n let marginPosition;\n switch (position) {\n case TOP:\n marginPosition = `margin-${BOTTOM}`;\n margin = marginHorizontal;\n break;\n case LEFT:\n marginPosition = `margin-${RIGHT}`;\n break;\n case BOTTOM:\n marginPosition = `margin-${TOP}`;\n margin = marginHorizontal;\n break;\n default:\n marginPosition = `margin-${LEFT}`;\n }\n legendContainer.classed(`${classPrefix}-legend-box-${this._id}`, true);\n legendContainer.style('float', 'left');\n\n const widthBox = calculateTitleWidth(\n this.measurement(),\n this._labelManager.getOriSize(this._title.text).width,\n this.config()\n );\n\n const titleWidth = Math.min(maxWidth, widthBox);\n width < titleWidth ? selectElement(this.mount()).style('width', `${titleWidth}px`) : null;\n // set height and width\n legendContainer.style('width', `${titleWidth}px`)\n .style('height', `${Math.min(maxHeight, height)}px`)\n .style(`${marginPosition}`, `${margin}px`)\n .style('border', `${border}px ${borderStyle} ${borderColor}`);\n this.legendContainer(legendContainer.node());\n\n // create title\n this.renderTitle(legendContainer);\n firebolt.createSelectionSet(prepareSelectionSetData(this.data(), this.fieldName(), this.metaData()));\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n const type = this.metaData().getData().schema[0].type;\n if (type === 'measure') {\n return {\n [fieldName]: data.range\n };\n }\n return [[fieldName], [data.rawVal]];\n }\n\n getValueFromId (id, fields = []) {\n const data = this.data();\n if (fields.length) {\n id = Number(id);\n return [data.find(d => id === d.id).rawVal];\n }\n\n return [];\n }\n\n getRangeFromIdentifiers ({ fields, entrySet }) {\n const data = this.data();\n const idRangeMap = data.reduce((acc, v) => {\n acc[v.id] = v;\n return acc;\n }, {});\n\n return fields.reduce((acc, v) => {\n acc[v] = entrySet.reduce((ranges, id) => {\n if (id in idRangeMap) {\n ranges.push(idRangeMap[id].range);\n }\n return ranges;\n }, []);\n return acc;\n }, {});\n }\n\n setParentInfo (info) {\n this._canvasMount = info.canvasRoot;\n }\n}\n","import {\n LEFT,\n RIGHT,\n START,\n END,\n TOP,\n BOTTOM,\n HORIZONTAL,\n VERTICAL,\n CENTER,\n SHAPE,\n VALUE\n} from '../enums/constants';\n\nconst legendOrientation = {\n [HORIZONTAL]: {\n datasets: data => ({\n row: [1],\n column: data\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n itemSpaces,\n width\n } = measurement;\n const {\n buffer\n } = config;\n return {\n row: {\n width: `${width + itemSpaces.length * buffer[HORIZONTAL] || 1}px`,\n padding: `${0}px`\n },\n column: {\n width: (d, i) => `${itemSpaces[i].width + buffer[HORIZONTAL]}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, height } = measurement;\n return {\n iconHeight: height,\n iconWidth: maxItemSpaces.width,\n stepPadding: {\n horizontal: true,\n vertical: false\n }\n };\n }\n },\n [VERTICAL]: {\n datasets: data => ({\n row: data,\n column: d => [d]\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n width\n } = measurement;\n const { padding } = config;\n\n return {\n row: {\n width: `${width}px`,\n padding: `${padding}px`\n },\n column: {\n width: `${width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, width } = measurement;\n return {\n iconHeight: maxItemSpaces.height,\n iconWidth: width,\n stepPadding: {\n horizontal: false,\n vertical: true\n }\n };\n }\n }\n};\n\nexport const positionConfig = {\n [LEFT]: legendOrientation[VERTICAL],\n [RIGHT]: legendOrientation[VERTICAL],\n [TOP]: legendOrientation[HORIZONTAL],\n [BOTTOM]: legendOrientation[HORIZONTAL]\n};\n\nexport const alignmentMap = {\n [LEFT]: END,\n [RIGHT]: START,\n [TOP]: CENTER,\n [BOTTOM]: CENTER\n};\n\n// Reverses data for step legend\nexport const stepData = data => ({\n [LEFT]: data.reverse(),\n [RIGHT]: data.reverse(),\n [TOP]: data,\n [BOTTOM]: data\n});\n\n// Changes the item layout based on the position of the text\nexport const itemStack = {\n [LEFT]: [VALUE, SHAPE],\n [RIGHT]: [SHAPE, VALUE],\n [TOP]: [VALUE, SHAPE],\n [BOTTOM]: [SHAPE, VALUE]\n};\n","import { makeElement, selectElement, applyStyle } from 'muze-utils';\nimport { ICON_MAP } from './defaults';\nimport { positionConfig, alignmentMap, itemStack } from './position-config';\nimport {\n WIDTH,\n HEIGHT,\n CENTER,\n VALUE,\n RECT,\n LEFT,\n DEFAULTICONSIZE,\n VERTICAL_BUFFER,\n HORIZONTAL_BUFFER,\n HORIZONTAL,\n VERTICAL,\n DEFAULT,\n TOP,\n BOTTOM,\n OPPOSITE_POSITION\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} legendInstance\n * @param {*} align\n *\n */\nexport const getItemContainers = (container, data, legendInstance) => {\n const measurement = legendInstance.measurement();\n const config = legendInstance.config();\n const {\n itemSpaces\n } = measurement;\n const {\n classPrefix,\n position\n } = config;\n const positionObj = positionConfig[position];\n const datasets = positionObj.datasets(data);\n const measures = positionObj.itemContainerMeasures(measurement, config);\n\n const rows = makeElement(container, 'div', datasets.row, `${classPrefix}-legend-row`);\n rows.style(HEIGHT, (d, i) => `${itemSpaces[i].height}px`);\n rows.style(WIDTH, measures.row.width);\n rows.style('padding', measures.row.padding);\n\n const columns = makeElement(rows, 'div', datasets.column, `${classPrefix}-legend-columns`);\n columns.style(WIDTH, measures.column.width);\n columns.style('padding', measures.column.padding);\n\n return columns;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} classPrefix\n * @param {*} data\n *\n * @memberof DiscreteLegend\n */\nexport const createLegendSkeleton = (context, container, classPrefix, data) => {\n let gradWidth = 0;\n let gradHeight = 0;\n let maxGradHeight = 0;\n let maxGradWidth = 0;\n const measurement = context.measurement();\n const {\n margin,\n border,\n titleSpaces,\n width,\n height,\n maxWidth,\n maxHeight\n } = measurement;\n\n gradHeight = height - (titleSpaces.height + 2 * margin + 2 * border);\n gradWidth = width - (margin * 2 + border * 2);\n\n maxGradHeight = maxHeight - (titleSpaces.height + margin * 2 + border * 2);\n maxGradWidth = maxWidth - (margin * 2 + border * 2);\n\n let legendBody = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n\n legendBody.style(WIDTH, `${gradWidth}px`);\n\n legendBody.style(HEIGHT, `${gradHeight}px`);\n\n legendBody.select(`.${classPrefix}-legend-overflow`).remove();\n // Create a div with scroll when overflow\n if (maxGradWidth && maxGradWidth < gradWidth) {\n legendBody = legendBody.style(WIDTH, `${maxGradWidth}px`).style('overflow-x', 'scroll');\n }\n // Create a div with scroll when overflow\n if (maxGradHeight && maxGradHeight < gradHeight) {\n legendBody.style(HEIGHT, `${maxGradHeight}px`).style('overflow-y', 'scroll');\n }\n\n legendBody = makeElement(legendBody, 'div', [1], `${classPrefix}-legend-overflow`);\n\n const legendItem = getItemContainers(legendBody, data, context);\n return { legendItem };\n};\n\n/**\n * Creates legend item based on alignment and text orientation\n *\n * @param {Selection} container Point where items are to be mounted\n * @return {Instance} Current instance\n * @memberof Legend\n */\nexport const createItemSkeleton = (context, container) => {\n const {\n classPrefix,\n item\n } = context.config();\n const textOrientation = item.text.orientation;\n const stack = itemStack[textOrientation];\n const itemSkeleton = makeElement(container, 'div', (d, i) => stack.map(e => [e, d[e], d.color, d.size,\n d.value, context.fieldName(), i]), `${classPrefix}-legend-item-info`);\n\n const alignClass = alignmentMap[textOrientation];\n\n itemSkeleton.classed(alignClass, true);\n return { itemSkeleton };\n};\n\n/**\n *\n *\n * @param {*} measureType\n * @param {*} stepColorCheck\n */\nexport const applyItemStyle = (item, measureType, stepColorCheck, context) => {\n const {\n padding,\n labelSpaces,\n iconSpaces,\n maxIconWidth\n } = context.measurement();\n\n const { align } = context.config().align;\n\n const diff = stepColorCheck ? -padding * 2 : 0;\n\n if (item[0] === VALUE) {\n return `${labelSpaces[item[6]][measureType]}px`;\n }\n\n if (measureType === 'width' && !stepColorCheck && align === VERTICAL) {\n return `${maxIconWidth}px`;\n } else if (align === HORIZONTAL) {\n return `${maxIconWidth}px`;\n }\n return `${iconSpaces[item[6]][measureType] - diff}px`;\n};\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, elem, defaultIcon) {\n const groupElement = elem;\n // const { shape, size, update } = d;\n const shape = d[1] || defaultIcon;\n const defaultIconSize = DEFAULTICONSIZE[shape] || DEFAULTICONSIZE[DEFAULT];\n const size = d[3] || defaultIconSize * Math.PI;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n return createShape(d, elem);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n shapeElement.attr('transform', `scale(${size / 100})`);\n return selectElement(groupElement.node().appendChild(newShape));\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = ICON_MAP(shape).size(size)();\n }\n return makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n }\n d[1] = 'circle';\n return createShape(d, elem, 'circle');\n};\n\n/**\n * Returns the icon of the legend item\n *\n * @param {Object} datum Data property attached to the item\n * @param {number} width width of the item\n * @param {number} height height of the item\n * @return {Object|string} returns the path string or the string name of the icon\n * @memberof Legend\n */\nexport const getLegendIcon = (datum, width, height, defaultIcon) => {\n const icon = ICON_MAP(datum[1]);\n\n if (icon) {\n return icon.size(datum[3] || Math.min(width, height) * Math.PI);\n }\n return ICON_MAP(datum[3] ? 'circle' : defaultIcon).size(datum[3] || Math.min(width, height) * Math.PI);\n};\n\n/**\n *\n *\n */\nexport const renderIcon = (icon, container, datum, context) => {\n const {\n classPrefix,\n iconHeight,\n padding,\n color,\n iconWidth,\n align\n } = context;\n\n let { maxIconWidth } = context;\n\n if (align === HORIZONTAL) {\n maxIconWidth = iconWidth + 2 * padding;\n }\n const svg = makeElement(container, 'svg', f => [f], `${classPrefix}-legend-icon-svg`)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .style(WIDTH, `${Math.ceil(maxIconWidth)}px`)\n .style(HEIGHT, `${iconHeight}px`);\n\n const transalate = maxIconWidth / 2 - padding;\n\n if (icon !== RECT) {\n const group = makeElement(svg, 'g', [datum[1]], `${classPrefix}-legend-icon`);\n createShape(datum, group, icon)\n .attr('transform', `translate(${transalate} ${iconHeight / 2})`)\n .attr('fill', datum[2] || color)\n .attr('stroke', datum[2] || color);\n } else {\n makeElement(svg, RECT, [datum[1]], `${classPrefix}-legend-icon`)\n .attr('x', 0)\n .attr('y', 0)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .attr('fill', datum[2] || color);\n }\n};\n\n/**\n * Renders the items in the legend i.e, icon and text\n *\n * @param {DOM} container Point where item is to be mounted\n * @memberof Legend\n */\nexport const renderDiscreteItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n classPrefix,\n shape,\n align\n } = context.config();\n const {\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width: iconWidth,\n height: iconHeight,\n color,\n className\n } = item.icon;\n const textOrientation = item.text.orientation;\n const formatter = item.text.formatter;\n\n labelManager.useEllipsesOnOverflow(true);\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, false, context),\n height: d => applyItemStyle(d, HEIGHT, false, context),\n 'text-align': CENTER,\n padding: `${padding}px`\n });\n\n const marginHorizontalBuffer = HORIZONTAL_BUFFER;\n const marginVerticalBuffer = textOrientation === TOP || textOrientation === BOTTOM ? 0 : VERTICAL_BUFFER;\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = context.metaData();\n const position = OPPOSITE_POSITION[textOrientation] || LEFT;\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context))\n .style(`padding-${position}`, '0px')\n .style(`margin-${position}`, `${align === HORIZONTAL ? marginHorizontalBuffer : marginVerticalBuffer}px`);\n } else {\n // const icon = getLegendIcon(d, iconWidth, iconHeight, type);\n selectElement(this).classed(`${classPrefix}-${className}`, true);\n selectElement(this).classed(`${classPrefix}-${className}-${i}`, true);\n renderIcon(shape, selectElement(this), d, {\n classPrefix,\n // iconWidth,\n iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth,\n iconHeight,\n maxIconWidth,\n padding,\n color,\n align\n });\n }\n });\n};\n\n/**\n* Renders the items in the legend i.e, icon and text\n*\n* @param {DOM} container Point where item is to be mounted\n* @memberof Legend\n*/\nexport const renderStepItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n position,\n classPrefix\n } = context.config();\n const {\n maxItemSpaces,\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width,\n height,\n color\n } = item.icon;\n const {\n formatter\n } = item.text;\n\n labelManager.useEllipsesOnOverflow(true);\n const { iconHeight, iconWidth, stepPadding } = positionConfig[position].getStepSpacesInfo({\n maxItemSpaces, height, width\n });\n\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, stepPadding.horizontal, context),\n height: d => applyItemStyle(d, HEIGHT, stepPadding.vertical, context),\n 'text-align': 'center',\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = context.metaData();\n const data = context.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n const formattedData = formatter([data[d[6]].range[0], data[d[6]].range[1]], i, dataArr, context);\n selectElement(this).text(formattedData);\n } else {\n renderIcon(RECT, selectElement(this), d, {\n classPrefix,\n iconWidth,\n iconHeight,\n maxIconWidth,\n color\n });\n }\n });\n};\n","import {\n FieldType,\n DimensionSubtype,\n formatTemporal,\n getReadableTicks,\n InvalidAwareTypes\n} from 'muze-utils';\nimport SimpleLegend from './simple-legend';\nimport { DISCRETE, LEFT, SIZE } from '../enums/constants';\nimport { getScaleInfo } from './legend-helper';\nimport { createLegendSkeleton, createItemSkeleton, renderDiscreteItem } from './renderer';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class DiscreteLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new DiscreteLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof DiscreteLegend\n */\n static type () {\n return DISCRETE;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof DiscreteLegend\n */\n dataFromScale () {\n const scale = this.scale();\n const { scaleType, domain, scaleFn, steps } = getScaleInfo(scale);\n const field = this.metaData().getFieldspace().fields[0];\n const { type, subtype } = field.schema();\n let domainForLegend = [];\n if (scaleType === SIZE && type === FieldType.MEASURE) {\n domainForLegend = steps instanceof Array ? steps : getReadableTicks(domain, domain.length);\n } else if (subtype === DimensionSubtype.TEMPORAL) {\n domainForLegend = [...new Set(field.data())];\n } else {\n domainForLegend = [...new Set(domain)];\n }\n\n const len = domainForLegend.length;\n domainForLegend = domainForLegend.map((ele, i) => {\n let value = 0;\n let range = 0;\n const rawVal = domainForLegend[i];\n if (type === FieldType.MEASURE) {\n value = (+domainForLegend[i]).toFixed(0);\n const nextVal = domainForLegend[i + 1] ? +domainForLegend[i + 1] : +value;\n range = [value, i === len - 1 ? nextVal.toFixed(0) : nextVal.toFixed(0) - 1];\n } else {\n let domainVal = rawVal;\n if (subtype === DimensionSubtype.TEMPORAL) {\n domainVal = formatTemporal(domainForLegend[i], field.minimumConsecutiveDifference());\n }\n value = domainVal;\n range = [domainVal];\n }\n return {\n [scaleType]: scale[scaleFn](ele),\n value,\n id: i,\n range,\n rawVal\n };\n }).filter(d => d.value !== null);\n\n domainForLegend = scaleType === SIZE ? domainForLegend.sort((a, b) => a[scaleType] - b[scaleType])\n : domainForLegend.sort((a, b) => {\n const domainValue =\n !(a.value instanceof InvalidAwareTypes || a.value instanceof InvalidAwareTypes)\n ? a.value.localeCompare(b.value)\n : 1;\n return domainValue;\n });\n return domainForLegend;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const data = this.data();\n\n const { classPrefix } = this.config();\n const legendContainer = super.render(this.mount());\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n renderDiscreteItem(this, itemSkeleton);\n\n legendContainer.selectAll('div')\n .filter((datum, i, allSelections) => !allSelections[i].classList.contains(`${classPrefix}-legend-body`))\n .style('float', LEFT);\n\n firebolt.mapActionsAndBehaviour();\n return legendContainer;\n }\n}\n","import { makeElement, applyStyle } from 'muze-utils';\nimport { ContinousAxis } from '@chartshq/muze-axis';\nimport { BOTTOM, RIGHT } from '../enums/constants';\nimport { ALIGN, LEGEND_MARKER_PROPS } from './defaults';\nimport '../styles.scss';\n\n/**\n *\n *\n * @param {*} data\n *\n */\nexport const getGradientDomain = (data) => {\n if (typeof data[0].value === 'number') {\n return data.reduce((accumulator, currentValue) =>\n [Math.min(currentValue.value, accumulator[0]), Math.max(currentValue.value, accumulator[1])],\n [Number.MAX_VALUE, Number.MIN_VALUE]);\n }\n return data.map(e => e.value);\n};\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} domain\n *\n */\nexport const makeLinearGradient = (container, data, domain, id) => {\n const defs = makeElement(container, 'defs', [1]);\n const linearGradient = makeElement(defs, 'linearGradient', [1])\n .attr('id', `linear-gradient-${id}`)\n .attr('x1', '0%')\n .attr('y2', '0%');\n\n makeElement(linearGradient, 'stop', data, 'stop-gradient')\n .attr('offset', d => `${(d.value - domain[0]) * 100 / (domain[1] - domain[0]) || 1}%`)\n .attr('stop-color', d => d.color);\n return linearGradient;\n};\n\n/**\n * Creates an axis cell with a linear axis for computing space and\n * creating gradient legend\n *\n * @return {AxisCell} Instance of Axis Cell for the gradient axis\n * @memberof Legend\n */\nexport const createAxis = (context) => {\n const data = context.data();\n const { align } = context.config();\n const AxisCell = context._cells.AxisCell;\n const newAxis = new ContinousAxis({\n id: `legend-${context._id}`,\n orientation: align === ALIGN.VERTICAL ? RIGHT : BOTTOM,\n style: context._computedStyle,\n nice: false,\n showAxisName: false,\n tickValues: data.map(d => d.value),\n fixedBaseline: false,\n labels: {\n rotation: null\n }\n }, { labelManager: context._labelManager });\n\n newAxis.domain(getGradientDomain(data));\n newAxis.range([1, 1]);\n return new AxisCell().source(newAxis).config({\n margin: { left: 0, bottom: 0, top: 0, right: 0 }\n });\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} classPrefix\n *\n * @memberof GradientLegend\n */\nconst createLegendSkeleton = (container, classPrefix, data, id) => {\n const domain = getGradientDomain(data);\n const legendContainer = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n const legendGradSvg = makeElement(legendContainer, 'svg', [1], `${classPrefix}-gradient`);\n const legendGradCont = makeElement(legendGradSvg, 'g', [1], `${classPrefix}-gradient-group`);\n const linearGradient = makeLinearGradient(legendGradSvg, data, domain, id);\n const legendRect = makeElement(legendGradCont, 'rect', [1], `${classPrefix}-gradient-rect`);\n\n return {\n legendContainer,\n legendGradCont,\n legendGradSvg,\n linearGradient,\n legendRect\n };\n};\n\n/**\n * Renders the axis for the gradient\n *\n * @param {Selection} container Point where axis is to be mounted\n * @param {number} height Height for axis\n * @param {number} width Width for axis\n * @memberof Legend\n */\nexport const renderAxis = (context, container, height, width) => {\n const axis = context.axis();\n\n axis.source().config({\n tickFormat: (val, i) => context.config().item.text.formatter(val, i, context.metaData(), context)\n });\n axis.setAvailableSpace(width, height);\n axis.render(container.node());\n axis.source().render();\n};\n\n/**\n * Renders gradient legends\n *\n * @param {Selection} container Point where the legend is to be appended\n * @memberof GradientLegend\n */\nexport const renderGradient = (context, container) => {\n let gradHeight = 0;\n let gradWidth = 0;\n const {\n align,\n classPrefix,\n item\n } = context.config();\n const data = context.data();\n // Create the skeleton for the legend\n const {\n legendContainer,\n legendGradSvg,\n legendGradCont,\n linearGradient,\n legendRect\n } = createLegendSkeleton(container, classPrefix, data, context._id);\n const labelDim = context.axis().source().getAxisDimensions().tickDimensions;\n const {\n padding,\n margin,\n border,\n titleSpaces,\n maxItemSpaces,\n maxHeight,\n maxWidth,\n height,\n width\n } = context.measurement();\n const gradientDimensions = {};\n\n gradHeight = Math.floor(Math.min(height, maxHeight) - (titleSpaces.height + 2 * margin + 2 * border));\n gradWidth = Math.floor(Math.min(width, maxWidth) - (margin * 2 + border * 2));\n\n if (align === ALIGN.HORIZONTAL) {\n gradientDimensions.height = item.icon.height;\n gradientDimensions.width = gradWidth - 2 * padding - labelDim.width / 2;\n linearGradient.attr('x2', '100%').attr('y1', '0%');\n legendGradCont.attr('transform', `translate( ${labelDim.width / 2} ${LEGEND_MARKER_PROPS.size + 4})`);\n renderAxis(context, legendContainer, gradHeight - item.icon.height - padding, gradWidth - 2 * padding - 1);\n\n applyStyle(legendContainer, {\n height: `${maxItemSpaces.height + border + padding}px`,\n width: `${Math.min(width, maxWidth)}px`,\n padding: `${padding}px`\n });\n\n legendRect.attr('height', gradientDimensions.height);\n legendRect.attr('width', gradientDimensions.width - labelDim.width / 2);\n } else {\n gradientDimensions.height = gradHeight - 2 * padding - labelDim.height / 2;\n gradientDimensions.width = item.icon.width;\n linearGradient.attr('x2', '0%').attr('y1', '100%');\n legendGradCont.attr('transform', `translate(${LEGEND_MARKER_PROPS.size + 4} ${labelDim.height / 2})`);\n renderAxis(context, legendContainer, gradHeight - 2 * padding - 1, gradWidth - item.icon.width - padding * 2);\n\n applyStyle(legendContainer, {\n height: `${Math.min(height, maxHeight)}px`,\n width: `${maxWidth}px`,\n padding: `${padding}px`\n });\n legendRect.attr('height', gradientDimensions.height - labelDim.height / 2);\n legendRect.attr('width', gradientDimensions.width);\n }\n\n // Apply Styles to the legend plot area\n applyStyle(legendGradSvg, {\n height: `${gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4}px`,\n width: `${gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4}px`\n });\n\n // Apply styles to the legend rect\n applyStyle(legendRect, {\n fill: `url(#linear-gradient-${context._id})`\n });\n legendGradSvg.attr('height', gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4);\n legendGradSvg.attr('width', gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4);\n\n context.measurement({\n gradientDimensions\n });\n context._legendGradientSvg = legendGradSvg;\n return context;\n};\n","import SimpleLegend from './simple-legend';\nimport { getScaleInfo, getInterpolatedData, getInterpolatedArrayData } from './legend-helper';\nimport { GRADIENT, LEFT, SIZE } from '../enums/constants';\nimport { HIGHLIGHT } from '../enums/behaviours';\nimport { Marker } from '../enums/side-effects';\nimport { renderGradient, createAxis } from './gradient-helper';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class GradientLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new GradientLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof GradientLegend\n */\n static type () {\n return GRADIENT;\n }\n\n /**\n *\n *\n * @param {*} axis\n *\n * @memberof GradientLegend\n */\n axis (...axis) {\n if (axis.length) {\n this._axis = axis[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof GradientLegend\n */\n dataFromScale () {\n let domainForLegend = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainForLegend[0] = domain[0];\n }\n domainForLegend = [...domainForLegend, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainForLegend.push(domain[1]);\n }\n // Sorting the domain Array\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n domainForLegend = getInterpolatedArrayData(domainForLegend, scaleParams);\n } else {\n domainForLegend = getInterpolatedData(domain, steps - 1, scaleParams);\n }\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n return domainForLegend.map((ele, i) => {\n const value = domainForLegend[i];\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](ele),\n value: +value.toFixed(1),\n id: i\n };\n }).filter(d => d.value !== null);\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const axis = createAxis(this);\n const axisSpace = axis.getLogicalSpace();\n const space = { width: axisSpace.width - effPadding, height: axisSpace.height - effPadding };\n const axisDomainLength = axis.source().domain().length;\n const labelSpaces = new Array(axisDomainLength).fill(space);\n\n this.axis(axis);\n return labelSpaces;\n }\n\n /**\n *\n *\n *\n * @memberof GradientLegend\n */\n getDrawingContext () {\n return {\n svgContainer: this._legendGradientSvg\n };\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const legendContainer = super.render(this.mount());\n // create Legend\n renderGradient(this, legendContainer);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.mapSideEffects({\n [HIGHLIGHT]: [Marker]\n });\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n return [[this.fieldName()], [data.value]];\n }\n\n getRangeFromIdentifiers ({ fields, criteria }) {\n return fields.reduce((range, v) => {\n range[v] = criteria[v];\n return range;\n }, {});\n }\n}\n","import SimpleLegend from './simple-legend';\nimport {\n getScaleInfo,\n getInterpolatedData,\n getItemMeasures\n} from './legend-helper';\nimport {\n createLegendSkeleton,\n createItemSkeleton,\n renderStepItem\n} from './renderer';\nimport { STEP, RECT, LEFT, SIZE, HORIZONTAL } from '../enums/constants';\nimport { stepData } from './position-config';\nimport '../styles.scss';\nimport { STEP_DEFAULT_CONFIG, DEFAULT_MEASUREMENT } from './defaults';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class StepLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new StepLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static type () {\n return STEP;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static defaultConfig () {\n STEP_DEFAULT_CONFIG.buffer[HORIZONTAL] = 0;\n return STEP_DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof StepLegend\n */\n dataFromScale () {\n let domainLeg = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n const isFraction = ele => ele % 1 !== 0;\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainLeg[0] = domain[0];\n }\n domainLeg = [...domainLeg, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainLeg.push(domain[1]);\n }\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n } else {\n domainLeg = getInterpolatedData(domain, steps, scaleParams);\n }\n\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n domainLeg = domainLeg.map((ele, i) => {\n let value = null;\n let range;\n if (i < domainLeg.length - 1) {\n const left = isFraction(ele) ? ele.toFixed(1) : ele;\n\n const numRight = +domainLeg[i + 1];\n const right = isFraction(numRight) ? numRight.toFixed(1) : numRight;\n\n value = `${left} - ${right}`;\n range = [left, right];\n } else if (domainLeg.length === 1) {\n value = isFraction(ele) ? ele.toFixed(1) : ele;\n\n const numRight = +domainLeg[i + 1];\n const right = isFraction(numRight) ? numRight.toFixed(1) : numRight;\n range = [value, right];\n }\n\n return {\n [scaleType]: scaleType === SIZE\n ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](ele),\n value,\n id: i + 1,\n range\n };\n }).filter(d => d.value !== null);\n\n return domainLeg;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const {\n item\n } = this.config();\n const stepItemBuffer = DEFAULT_MEASUREMENT.padding * 2;\n return getItemMeasures(this, 'range', item.text.formatter, stepItemBuffer);\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return RECT;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const { classPrefix, position } = this.config();\n const data = stepData(this.data())[position];\n\n const legendContainer = super.render(this.mount());\n\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n\n renderStepItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n return legendContainer;\n }\n\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n return {\n [fieldName]: data.range\n };\n }\n}\n","import { GradientLegend, DiscreteLegend, StepLegend } from '@chartshq/muze-legend';\n\n/**\n * Contants to be used as attr\n */\nexport const ROWS = 'rows';\nexport const COLUMNS = 'columns';\nexport const DATA = 'data';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const DETAIL = 'detail';\nexport const LAYERS = 'layers';\nexport const TRANSFORM = 'transform';\nexport const INITIALIZED = 'isInitialized';\nexport const SOURCE = 'source';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const PADDING = 'padding';\nexport const BORDER = 'border';\nexport const MARGIN = 'margin';\nexport const CONFIG = 'config';\nexport const MOUNT = 'mount';\nexport const CANVAS_UPDATED = 'canvasUpdated';\nexport const CLASSPREFIX = 'classPrefix';\nexport const POLICIES = '_policies';\nexport const LEGEND = 'legend';\nexport const TITLE = 'title';\nexport const SUB_TITLE = 'subtitle';\nexport const RESOLVE = 'resolve';\nexport const DISCRETE = 'discrete';\nexport const STEP_COLOR = 'step-color';\nexport const GRADIENT = 'gradient';\nexport const LINEAR = 'linear';\nexport const ORDINAL = 'ordinal';\nexport const MUZE_PREFIX = 'muze';\n\nexport const TITLE_TEMPLATE_NOT_ALLOWED_TAGS = [\n 'script',\n 'style'\n];\n\nexport const ICON_SHAPES = {\n SQUARE: 'square',\n CIRCLE: 'circle'\n};\n\nexport const IS_POINT_MAP = {\n true: ICON_SHAPES.CIRCLE,\n false: ICON_SHAPES.SQUARE\n};\n\nexport const LEGEND_TYPE_MAP = {\n [`${ORDINAL}-${true}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SIZE}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${COLOR}`]: StepLegend,\n [`${LINEAR}-${false}-${COLOR}`]: GradientLegend\n};\n\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const GROUP = 'group';\nexport const LAYOUT = 'layout';\nexport const RETINAL = 'retinal';\nexport const DIMENSION = 'dimension';\nexport const MEASURE = 'measure';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const HORIZONTAL_CENTER = 'h-center';\nexport const VERTICAL_CENTER = 'v-center';\nexport const HIDDEN = 'hidden';\nexport const OVERFLOW = 'overflow';\nexport const OVERFLOW_X = 'overflow-x';\nexport const OVERFLOW_Y = 'overflow-y';\nexport const AUTO = 'auto';\nexport const VISIBLE = 'visible';\nexport const VERTICAL_SCROLL_BAR = 'verticalScrollBar';\nexport const HORIZONTAL_SCROLL_BAR = 'horizontalScrollBar';\nexport const GRID = 'grid';\nexport const POINT = 'point';\nexport const MESSAGE = 'message';\nexport const ERROR_MESSAGE = 'Insufficient data or incorrect configurations';\nexport const COMMON_INTERACTION = 'common';\nexport const INDIVIDUAL_INTERACTION = 'individual';\n","import { ComposedVars, SimpleVariable } from '@chartshq/visual-group';\nimport { TITLE_TEMPLATE_NOT_ALLOWED_TAGS } from './constants';\n\n/**\n * This method creates a new composed variable instance from multiple variables. This is required when we have multiple\n * variables on a single axis and the union of domain of all the variables needs to be set on the axis.\n *\n * To create a new composed variable from multiple fields,\n * ```\n * const sharedVar = share('open', 'high', 'low', 'close');\n * canvas.rows([sharedVar])\n * .columns(['date']);\n * ```\n *\n * @module Operators\n * @public\n * @function share\n * @param {Array} vars Variable names.\n *\n * @return {ComposedVars} Instance of composed variable\n */\nexport const share = (...vars) => new ComposedVars(...vars.map(variable => new SimpleVariable(variable)));\n\n/**\n *\n *\n * @param {*} node\n *\n */\nfunction treeShakeNode (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) { return; }\n\n if (TITLE_TEMPLATE_NOT_ALLOWED_TAGS.indexOf(node.tagName.toLowerCase()) !== -1) {\n node.parentNode.removeChild(node);\n } else {\n for (const childNode of node.childNodes) {\n treeShakeNode(childNode);\n }\n }\n}\n\n/**\n * A string template tagged function which sanitizes input html formatted string according to the allowed html tags.\n * This is used to render html in canvas components like title and tooltip.\n *\n * To render html in canvas components,\n * ```\n * canvas.title(html`TITLE`);\n * ```\n *\n * @public\n * @module Operators\n * @function html\n * @param {Array.} strings - The string parts of the template.\n * @param {Array} exps - The list of evaluated expression values.\n *\n * @return {Function} Returns a function which returns the sanitized html string.\n */\nexport function html (strings, ...exps) {\n let htmlCode = '';\n const expLn = exps.length;\n let i = 0;\n\n for (; i < expLn; ++i) {\n htmlCode += strings[i] + exps[i];\n }\n htmlCode += strings[i];\n\n const frag = document.createDocumentFragment();\n const wrapper = document.createElement('div');\n\n frag.appendChild(wrapper);\n wrapper.innerHTML = htmlCode;\n\n treeShakeNode(wrapper);\n const { innerHTML } = wrapper;\n\n return () => innerHTML;\n}\n","import { mergeRecursive, CommonProps } from 'muze-utils';\n\nconst defaultPolicy = (registrableComponents) => {\n const aliases = registrableComponents.map(comp => comp.alias());\n return {\n behaviours: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n },\n sideEffects: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n }\n };\n};\n\nconst listenerFn = (canvas, fn) => () => {\n const valueMatrix = canvas.composition().visualGroup.matrixInstance().value;\n valueMatrix.each(cell => fn(cell.valueOf().firebolt()));\n};\n\nconst canvasIterator = (canvases, iteratorFn, cFn) => {\n canvases.forEach((canvas) => {\n const matrix = canvas.composition().visualGroup.matrixInstance().value;\n matrix.each(cell => iteratorFn(cell.valueOf().firebolt()));\n cFn && cFn(canvas);\n // Also register actions on canvas update\n const throwback = canvas._throwback;\n\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED],\n listenerFn(canvas, iteratorFn));\n });\n};\n\nconst registerActions = (context, type, fnName, deps) => {\n const canvases = context._registrableComponents;\n\n canvases.forEach((canvas) => {\n const vGroup = canvas.composition().visualGroup;\n\n vGroup.resolver().setFireboltDependencies(type, deps);\n canvas.firebolt()[fnName](deps);\n });\n};\n\n/**\n * This class is initiated only once in lifecycle and is reponsible for regisration of physical and behavioural\n * actions and side effects and the mapping between them.\n *\n * To get the instance of action model\n * ```\n * const ActionModel = muze.ActionModel;\n * ```\n *\n * @public\n * @module ActionModel\n */\nclass ActionModel {\n constructor () {\n this._registrableComponents = [];\n }\n\n /**\n * Takes an array of canvases on which the physical and behavioural actions will get registered.\n *\n * @public\n * @param {Canvas} components Array of canvases\n *\n * @return {ActionModel} Instance of action model.\n */\n for (...components) {\n this._registrableComponents = components;\n return this;\n }\n\n /**\n * Registers physical actions on the canvases. It takes an object with key as the name of action and value having\n * the definition of the action.\n *\n * To register a {@link PhysicalAction},\n * ```\n * const ActionModel = muze.ActionModel;\n * ActionModel\n * // Physical actions will be registered on these canvases.\n * .for(canvas)\n * .registerPhysicalActions({\n * // Key is the name of physical action.\n * ctrlClick: (firebolt) => (targetEl, behaviours) => {\n * targetEl.on('click', function (data) {\n * const event = utils.getEvent();\n * const pos = utils.getClientPoint(event, this);\n * // Get the data point nearest to the mouse position.\n * const nearestPoint = firebolt.context.getNearestPoint(pos, {\n * data\n * });\n * // Prepare the payload\n * const payload = {\n * criteria: nearestPoint.id\n * };\n * behaviours.forEach((behaviour) => firebolt.dispatchBehaviour(behaviour, payload));\n * });\n * }\n * });\n * ```\n * @public\n *\n * @param {Object} action Names of physical actions and their definitions.\n *\n * @return {ActionModel} Instance of the action model.\n */\n registerPhysicalActions (action) {\n registerActions(this, 'physicalActions', 'registerPhysicalActions', action);\n\n return this;\n }\n\n /**\n * Registers behavioural actions on the canvases. It takes definitions of the behavioural actions and registers\n * them on the canvases. Every behavioural action must inherit the {@link GenericBehaviour} class.\n *\n * To register a behavioural action\n * ```\n * // Define a new behavioural action\n * class SingleSelectBehaviour extends GenericBehaviour {\n * static formalName () {\n * return 'singleSelect';\n * }\n *\n * setSelectionSet (addSet, selectionSet) {\n * if (addSet === null) {\n * selectionSet.reset();\n * } else if (addSet.length) {\n * const existingAddSet = selectionSet.getExistingEntrySet(addSet);\n * if (existingAddSet.length){\n * selectionSet.reset();\n * } else {\n * selectionSet.add(addSet);\n * }\n * } else {\n * selectionSet.reset();\n * }\n * }\n * }\n * muze.ActionModel.registerBehaviouralActions(SingleSelectBehaviour);\n * ```\n *\n * @public\n *\n * @param {GenericBehaviour} actions Definition of behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerBehaviouralActions (...actions) {\n registerActions(this, 'behaviouralActions', 'registerBehaviouralActions', actions);\n return this;\n }\n\n /**\n * Registers the mapping of physical and behavioural actions. This mapping is used to establish which behavioural\n * actions should be dispatched on any triggering of physical actions.\n *\n * To map physical actions with behavioural actions,\n * ```\n * muze.ActionModel.registerPhysicalBehaviouralMap({\n * ctrlClick: {\n * behaviours: ['select'] // This array must be the formal names of the behavioural actions.\n * }\n * });\n * ```\n *\n * @public\n * @param {Object} map Contains the physical and behavioural action map.\n * ```\n * {\n * // Name of the physical action\n * click: {\n * // Target element selector. This is an optional field. If not passed, then by default takes the\n * // container element of visual unit.\n * target: '.muze-layers-area path',\n * // Behaviours which should be dispatched on triggering of the mapped physical action.\n * behaviours: ['select']\n * }\n * }\n * ```\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPhysicalBehaviouralMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPhysicalBehaviouralMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPhysicalBehaviouralMap(map);\n });\n return this;\n }\n\n /**\n * Registers what behaviour to propagate on dispatch of a certain behavioural action. By default, when any\n * behavioural action is dispatched, then the same behavioural action gets propagated to all the other canvases.\n * This can be changed using this api.\n *\n * To register what behaviour should be propagated on dispatch of any behavioural action,\n * ```\n * ActionModel.for(canvas1, canvas2).registerPropagationBehaviourMap({\n * select: 'filter',\n * brush: 'filter'\n * });\n * ```\n *\n * @public\n * @param {Object} map Propagation behaviour map.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPropagationBehaviourMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPropagationBehaviourMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPropagationBehaviourMap(map);\n });\n\n return this;\n }\n\n /**\n * Registers the mapping of side effects and behavioural actions. It takes an object which contains key as the\n * name of behavioural action and the side effects which will be linked to it.\n *\n * To map side effects to select behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: ['infoBox'] // This array must be the formal names of the side effects\n * });\n * ```\n *\n * To map side effects to select behaviour, but disable all the default side effects attached with this behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: {\n * effects: ['infoBox'],\n * preventDefaultActions: true\n * }\n * });\n * @public\n * @param {Object} map Mapping of behavioural actions and side effects.\n * ```\n * {\n * select: ['infoBox']\n * }\n * ```\n * @return {ActionModel} Instance of action model.\n */\n mapSideEffects (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.mapSideEffects(map);\n }, (canvas) => {\n canvas.firebolt().mapSideEffects(map);\n });\n return this;\n }\n\n /**\n * Registers the side effects on the registered canvases. It takes definitions of side effects and registers them\n * on the canvases. Every side effect must inherit the base class {@link GenericSideEffect} or\n * {@link SpawnableSideEffect} or {@link SurrogateSideEffect} class.\n *\n * ```\n * // Define a custom side effect\n * class InfoBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'infoBox';\n * }\n *\n * apply (selectionSet) {\n * }\n * }\n * muze.ActionModel.registerSideEffects(InfoBox);\n * ```\n * @public\n * @param {GenericSideEffect} sideEffects Definition of side effects.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerSideEffects (...sideEffects) {\n registerActions(this, 'sideEffects', 'registerSideEffects', sideEffects);\n return this;\n }\n\n /**\n * Breaks the link between behavioural actions and physical actions. It takes an array of behavioural action\n * and it's physical action.\n *\n * To dissociate behavioural actions from physical actions\n * ```\n * muze.ActionModel.dissociateBehaviour(['select', 'click'], ['highlight', 'hover']);\n * ```\n * @public\n * @param {Array} maps Array of behavioural action and physical action.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateBehaviour (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateBehaviour(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateBehaviour(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * Breaks the link between side effects and behavioural actions. It takes an array of formal names of the side\n * effects and it's linked behavioural action.\n *\n * To dissociate side effects from behavioural actions\n * ```\n * muze.ActionModel.dissociateSideEffect(['crossline', 'highlight'], ['selectionBox', 'brush']);\n * ```\n * @public\n * @param {Array} maps Array of side effects and behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateSideEffect (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateSideEffect(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateSideEffect(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * By default cross interactivity is disabled between canvases. This enables cross interaction between the canvases\n * so that any action happening in one canvas gets dispatched on other canvases as well. An optional policy can also\n * be passed in this method. The policy can be used to control on which canvases the behavioural actions and\n * side effects gets dispatched.\n *\n * To just enable cross interactivity between two canvases,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity();\n * ```\n *\n * To enable cross interactivity but enable any behavioural action only when it is triggered from canvas1.\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * behaviours: {\n * // Here * stands for any behavioural action name. We can also give any name of behavioural action\n * // in place of this.\n * '*': (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n *\n * To enable cross interactivity but enable tooltip effect if the action is propagated from canvas1,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * sideEffects: {\n * tooltip: (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n * @public\n * @param {Object} policy Policy definition.\n *\n * @return {ActionModel} Instance of action model.\n */\n enableCrossInteractivity (policy = {}) {\n const registrableComponents = this._registrableComponents;\n const mergedPolicy = mergeRecursive(mergeRecursive({}, defaultPolicy(registrableComponents)), policy);\n\n registrableComponents.forEach((canvas) => {\n canvas.firebolt().crossInteractionPolicy(mergedPolicy);\n });\n\n return this;\n }\n}\n\nexport const actionModel = (() => new ActionModel())();\n","import { MUZE_PREFIX } from '../constants';\n\nexport const TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 4,\n className: `${MUZE_PREFIX}-title-container`\n};\n\nexport const SUB_TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 16,\n maxLines: 2,\n className: `${MUZE_PREFIX}-subtitle-container`\n};\n\nexport const MESSAGE_CONFIG = {\n className: `${MUZE_PREFIX}-message-container`,\n baseFontLimit: 16,\n upperFontLimit: 24,\n baseSizeLimit: 100,\n upperSizeLimit: 300,\n fractionImage: 0.8,\n fractionChild: 0.7\n};\n\nexport const CANVAS = 'canvas';\n","import { mergeRecursive } from 'muze-utils';\nimport {\n ROWS,\n COLUMNS,\n COLOR,\n SHAPE,\n SIZE,\n DETAIL,\n LAYERS,\n TRANSFORM,\n TITLE,\n SUB_TITLE\n} from '../constants';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG } from './defaults';\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Canvas.\n * Canvas merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module LocalOptions\n */\n\nexport const localOptions = {\n [ROWS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLUMNS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLOR]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SHAPE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SIZE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [DETAIL]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n\n [LAYERS]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [TRANSFORM]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object'\n }\n }\n};\n\nexport const canvasOptions = {\n [TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([title, titleConfig]) => {\n let t = title;\n if (typeof title === 'string' || !title) {\n t = () => title;\n }\n const defConfig = mergeRecursive({}, TITLE_CONFIG);\n return [t, mergeRecursive(defConfig, titleConfig)];\n }\n }\n },\n [SUB_TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([subtitle, subtitleConfig]) => {\n let sub = subtitle;\n if (typeof subtitle === 'string' || !subtitle) {\n sub = () => subtitle;\n }\n const defConfig = mergeRecursive({}, SUB_TITLE_CONFIG);\n return [sub, mergeRecursive(defConfig, subtitleConfig)];\n }\n }\n }\n};\n","export default class LayoutComponent {\n constructor (name, dimensions, seed) {\n this._seed = seed;\n this._boundBox = {\n height: dimensions.height,\n width: dimensions.width,\n top: null,\n left: null\n };\n this._renderAt = null;\n this._alignWith = null;\n this._alignment = null;\n this._target = null;\n this._position = null;\n this._componentName = name;\n this._className = null;\n }\n\n getLogicalSpace () {\n throw new Error('getLogicalSpace is not defined');\n }\n\n setSpatialConfig () {\n throw new Error('setSpatialSpace is not defined');\n }\n\n name (param) {\n if (param) {\n this._componentName = param;\n }\n return this._componentName;\n }\n\n target (param) {\n if (param) {\n this._target = param;\n }\n return this._target;\n }\n\n position (param) {\n if (param) {\n this._position = param;\n }\n return this._position;\n }\n\n alignment (param) {\n if (param) {\n this._alignment = param;\n }\n return this._alignment;\n }\n\n alignWith (param) {\n if (param) {\n this._alignWith = param;\n }\n return this._alignWith;\n }\n\n renderAt (param) {\n if (param) {\n this._renderAt = param;\n }\n return this._renderAt;\n }\n\n boundBox (param) {\n if (param) {\n Object.assign(this._boundBox, param);\n }\n return this._boundBox;\n }\n\n className (param) {\n if (param) {\n this._className = param;\n }\n return this._className;\n }\n\n draw () {\n throw new Error('draw is not defined');\n }\n\n attachListener () {\n return this;\n }\n }\n\n","import LayoutComponent from './layoutComponent';\n\nclass DummyComponent extends LayoutComponent {\n getLogicalSpace () {\n return {\n width: this.boundBox().width,\n height: this.boundBox().height\n };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n return this;\n }\n\n draw () {\n if (!this.component) {\n throw new Error(`Component not set for ${this.componentName}`);\n }\n this.component.mount(document.getElementById(this.renderAt)); // Change the draw method to component draw\n return this;\n }\n}\n\nexport default DummyComponent;\n","import { COMMON_INTERACTION } from './constants';\n\nexport const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n interaction: {\n sideEffects: {\n tooltip: COMMON_INTERACTION\n },\n behaviours: {\n highlight: COMMON_INTERACTION,\n select: COMMON_INTERACTION,\n brush: COMMON_INTERACTION\n },\n tooltip: {\n\n }\n },\n pagination: 'scroll',\n scrollBar: {\n thickness: 10,\n speed: 2,\n vertical: {\n align: 'right'\n },\n horizontal: {\n align: 'bottom'\n }\n },\n legend: {\n position: 'right',\n color: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n shape: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n size: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n }\n },\n showHeaders: false,\n minWidth: 100,\n minHeight: 100,\n facet: {\n rows: {\n minCharacters: 3\n },\n columns: {\n maxLines: 2,\n verticalAlign: 'middle',\n minCharacters: 1\n }\n },\n border: {\n style: 'solid',\n color: '#d6d6d6',\n width: 2,\n collapse: true,\n spacing: 0\n },\n autoGroupBy: {\n disabled: false\n },\n invalidValues: {},\n sort: {}\n};\n","import { DEFAULT_CONFIG } from '../../../../muze/src/defaults';\n\nconst DEFAULT_WIDTH = 600;\nconst DEFAULT_HEIGHT = 400;\nconst DEFAULT_CLASS_NAME = `${DEFAULT_CONFIG.classPrefix}-layout-container-component`;\nconst NODE_PREFIX = `${DEFAULT_CONFIG.classPrefix}-layout-container`;\n\nexport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT,\n DEFAULT_CLASS_NAME,\n NODE_PREFIX\n};\n","export default class DefinitionModel {\n constructor (config) {\n this._host = config.host || null;\n this._cut = config.cut || null;\n this._ratioWeight = config.ratioWeight === 0 ? 0 : config.ratioWeight || 1;\n this._preferred = config.preferred || false;\n this._lanes = config.lanes || [];\n this._remainingHeight = 0;\n this._remainingWidth = 0;\n }\n\n host (host) {\n if (host) {\n this._host = host;\n }\n return this._host;\n }\n\n preferred (preferred) {\n if (preferred) {\n this._preferred = preferred;\n }\n return this._preferred;\n }\n\n cut (cut) {\n if (cut) {\n this._cut = cut;\n }\n return this._cut;\n }\n\n ratioWeight (ratioWeight) {\n if (ratioWeight) {\n this._ratioWeight = ratioWeight;\n }\n return this._ratioWeight;\n }\n\n lanes (lanes) {\n if (lanes) {\n this._lanes = lanes;\n }\n return this._lanes;\n }\n\n remainingHeight (remainingHeight) {\n if (remainingHeight) {\n this._remainingHeight = remainingHeight;\n }\n return this._remainingHeight;\n }\n\n remainingWidth (remainingWidth) {\n if (remainingWidth) {\n this._remainingWidth = remainingWidth;\n }\n return this._remainingWidth;\n }\n}\n","import { NODE_PREFIX } from '../../constants/defaults';\nimport DefinitionModel from '../definition-manager/definitionModel';\nimport DummyComponent from '../../layout-component/dummy-component';\n/**\n * Compares two strings in lowercase\n *\n * @export\n * @param {string} value the value to be compared\n * @param {string} compareTo whom the value would be compared\n * @return {boolean} true if values are equal\n */\nexport function isEqual (value, compareTo) {\n if (typeof value !== 'string' || typeof compareTo !== 'string') {\n throw new TypeError('value and compareTo must be string');\n }\n return value.toLowerCase() === compareTo.toLowerCase();\n}\n\nexport const getNodeId = (() => {\n let _uid = 0;\n return () => `${NODE_PREFIX}-${++_uid}`;\n})();\n\nexport function yExtraSpace (node) {\n let smallestHeight = 0;\n if (node.getCutType() === 'v') {\n smallestHeight = smallestExtraHeightHorizontally(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'h') {\n node.children().forEach((child) => {\n smallestHeight += yExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerHeight = node.boundBox().height;\n const hostHeight = node.model().host().getLogicalSpace().height;\n\n smallestHeight = containerHeight - hostHeight;\n if (smallestHeight < 0) {\n smallestHeight = 0;\n }\n } else {\n smallestHeight = 0;\n }\n return smallestHeight;\n}\n\nexport function smallestExtraHeightHorizontally (node) {\n let smallestHeight = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const h = yExtraSpace(child);\n if (h < smallestHeight) {\n smallestHeight = h;\n }\n });\n return smallestHeight;\n}\n\nexport function xExtraSpace (node) {\n let smallestWidth = 0;\n if (node.getCutType() === 'h') {\n smallestWidth = smallestExtraWidthVertically(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'v') {\n node.children().forEach((child) => {\n smallestWidth += xExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerWidth = node.boundBox().width;\n const hostWidth = node.model().host().getLogicalSpace().width;\n smallestWidth = containerWidth - hostWidth;\n if (smallestWidth < 0) {\n smallestWidth = 0;\n }\n } else {\n smallestWidth = 0;\n }\n return smallestWidth;\n}\n\nexport function smallestExtraWidthVertically (node) {\n let smallestWidth = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const w = xExtraSpace(child);\n if (w < smallestWidth) {\n smallestWidth = w;\n }\n });\n return smallestWidth;\n}\n\nexport function determineBoundBox (bb, i, arr, instance) {\n if (i) {\n // if not first sibling, take boundbox from previous sibling\n const lastSibling = arr[i - 1];\n const { top: _top, left: _left, height: _height, width: _width } = lastSibling.boundBox();\n return {\n width: bb.width,\n height: bb.height,\n\n top: instance.parentCut() === 'h'\n ? _top + _height : _top,\n\n left: instance.parentCut() === 'h'\n ? _left : _left + _width\n };\n }\n // if first sibling, take boundbox from parent\n const { top: _top, left: _left } = instance.parent().boundBox();\n return {\n width: bb.width,\n height: bb.height,\n top: _top,\n left: _left\n };\n}\n\n// prepares the targetComponent Map for target Mapping ie. where a component should lie\nexport function prepareTargetComponentMap (context) {\n context.targetComponentMap(new Map());\n context.componentMap().forEach((value) => {\n if (context.targetComponentMap().has(value.target())) {\n context.targetComponentMap().get(value.target()).push(value);\n } else {\n const temp = [];\n temp.push(value);\n context.targetComponentMap().set(value.target(), temp);\n }\n });\n}\n\nexport function getComponent (canvasComponent, componentName) {\n const comp = canvasComponent.find(component => component.name() === componentName);\n return (comp && comp !== -1) ? comp : null;\n}\nexport function createPlaceHolderComponent (height, width, position) {\n const comp = new DummyComponent(0, { height, width });\n comp.name('placeHolder');\n comp.position(position);\n return comp;\n}\n\nexport function placeComponent (definitionModel, component, isPreferred = false, isGridComponent = false) {\n let cut = '';\n let componentRatioWidth = 1;\n let leftOvercomponentRationWidth = 1;\n let leftHeight = 0;\n let leftWidth = 0;\n\n if (!component) {\n return { first: definitionModel, second: definitionModel };\n }\n\n const { height: componentHeight, width: componentWidth } = component.getLogicalSpace();\n const position = component.position();\n if (position === 'top' || position === 'bottom') {\n cut = 'h';\n componentRatioWidth = componentHeight / definitionModel.remainingHeight();\n leftHeight = definitionModel.remainingHeight() - componentHeight;\n leftWidth = definitionModel.remainingWidth();\n } else {\n cut = 'v';\n componentRatioWidth = componentWidth / definitionModel.remainingWidth();\n leftWidth = definitionModel.remainingWidth() - componentWidth;\n leftHeight = definitionModel.remainingHeight();\n }\n leftOvercomponentRationWidth = 1 - componentRatioWidth;\n\n// update parentModel\n definitionModel.cut(cut);\n const firstLaneConfig = {\n host: component.name(),\n cut: null,\n ratioWeight: componentRatioWidth,\n preferred: isGridComponent ? false : isPreferred,\n lanes: []\n };\n const firstLane = new DefinitionModel(firstLaneConfig);\n firstLane.remainingHeight(componentHeight);\n firstLane.remainingWidth(componentWidth);\n\n const secondLaneConfig = {\n host: null,\n cut: null,\n ratioWeight: leftOvercomponentRationWidth,\n preferred: isGridComponent ? false : !isPreferred,\n lanes: []\n };\n const secondLane = new DefinitionModel(secondLaneConfig);\n secondLane.remainingHeight(leftHeight);\n secondLane.remainingWidth(leftWidth);\n if (isPreferred) {\n definitionModel.lanes([firstLane]);\n } else if (position === 'top' || position === 'left') {\n definitionModel.lanes([firstLane, secondLane]);\n } else {\n definitionModel.lanes([secondLane, firstLane]);\n }\n return { first: firstLane, second: secondLane };\n}\n\nexport function placeGridComponent (definitionModel, gridComponents) {\n let tempDefModel = definitionModel;\n const rows = gridComponents.length;\n const column = rows ? gridComponents[0].length : 0;\n const height = gridComponents.reduce((acc, val) => (acc + val[0].getLogicalSpace().height), 0);\n\n for (let i = 0; i < column; i++) {\n const iscolumnPreffered = i === column - 1;\n const columnPlaceHolderComponent = createPlaceHolderComponent(height,\n gridComponents[0][i].getLogicalSpace().width, 'left');\n const { first, second } = placeComponent(tempDefModel, columnPlaceHolderComponent, iscolumnPreffered);\n tempDefModel = first;\n for (let j = 0; j < rows; j++) {\n const rowpreffred = j === (rows - 1);\n tempDefModel = placeComponent(tempDefModel, gridComponents[j][i], rowpreffred, true).second;\n }\n tempDefModel = second;\n }\n return tempDefModel;\n}\n\nexport function negotiateDimension (node) {\n let preferred;\n let cumultiveExtraSpaceAmt = 0;\n let alteredDim;\n let nonAlteredDim;\n\n const childrenLength = node.children().length;\n\n for (let index = 0; index < childrenLength; index++) {\n let fn;\n let extraSpaceAmt;\n const child = node.children()[index];\n\n if (child.parentCut() === 'h') {\n fn = yExtraSpace;\n alteredDim = 'height';\n nonAlteredDim = 'width';\n } else {\n fn = xExtraSpace;\n alteredDim = 'width';\n nonAlteredDim = 'height';\n }\n // if vertical then get extra height from other node and push it to the preferred node.\n // for horizontal cut the same thing is to be done with width\n if (child.isPreferred()) {\n // push extra space in sink. Execute it when all non preferred space are computed.\n preferred = child;\n\n continue; // eslint-disable-line no-continue\n }\n // reduce own height and save it in a var\n cumultiveExtraSpaceAmt += (extraSpaceAmt = fn(child));\n child.boundBox()[alteredDim] -= extraSpaceAmt;\n // update nonaltered dim from parent for any change which happened during negotiation\n child.boundBox()[nonAlteredDim] = child.parent().boundBox()[nonAlteredDim];\n\n negotiateDimension(child);\n }\n\n if (preferred) {\n preferred.boundBox()[alteredDim] += cumultiveExtraSpaceAmt;\n preferred.boundBox()[nonAlteredDim] = preferred.parent().boundBox()[nonAlteredDim];\n negotiateDimension(preferred);\n }\n}\n\nexport function computePosition (node) {\n node.children().forEach((child, i, children) => {\n const boundBox = determineBoundBox(child.boundBox(), i, children, child);\n child.boundBox(boundBox);\n computePosition(child);\n });\n}\n\nexport function allocateBoundingBox (node) {\n const totalWeight = node.children()\n .map(child => child.model().ratioWeight())\n .reduce((carry, val) => carry + val, 0);\n\n node.children().forEach((child, i, children) => {\n const lastSibling = children[i - 1];\n const ratio = child.model().ratioWeight() / totalWeight;\n\n if (child.parentCut() === 'h') {\n child.boundBox({\n top: i ? lastSibling.boundBox().top + lastSibling.boundBox().height : 0,\n left: child.parent().boundBox().left,\n height: child.parent().boundBox().height * ratio,\n width: child.parent().boundBox().width\n });\n } else {\n child.boundBox({\n top: child.parent().boundBox().top,\n left: i ? lastSibling.boundBox().left + lastSibling.boundBox().width : 0,\n height: child.parent().boundBox().height,\n width: child.parent().boundBox().width * ratio\n });\n }\n allocateBoundingBox(child);\n });\n}\n\n","import { getNodeId } from '../helper';\nimport { LayoutComponent } from '../../layout-component';\n\nclass Node {\n constructor (data) {\n this._model = data;\n this._parent = null;\n this._children = [];\n this._parentCut = null;\n this._boundBox = {\n top: null,\n left: null,\n height: null,\n width: null\n };\n\n this._id = this._model.host() instanceof LayoutComponent && this._model.host().renderAt() ?\n this._model.host().renderAt() :\n getNodeId();\n }\n\n addChildren (entries) {\n this._children.push(...entries);\n entries.forEach((e) => { e.parent(this); });\n }\n\n isRoot () {\n return this._parent === null;\n }\n\n isLeaf () {\n return !this._children.length;\n }\n\n getCutType () {\n return this._model.cut();\n }\n\n isPreferred () {\n return !!this._model.preferred();\n }\n\n children (children) {\n if (children) {\n this._children = children;\n }\n return this._children;\n }\n\n parent (parent) {\n if (parent) {\n this._parent = parent;\n }\n return this._parent;\n }\n\n parentCut (parentCut) {\n if (parentCut) {\n this._parentCut = parentCut;\n }\n return this._parentCut;\n }\n\n id (id) {\n if (id) {\n this._id = id;\n }\n return this._id;\n }\n\n model (model) {\n if (model) {\n this._model = model;\n }\n return this._model;\n }\n\n boundBox (bound) {\n if (bound) {\n this._boundBox = {\n top: bound.top,\n left: bound.left,\n height: bound.height,\n width: bound.width\n };\n }\n return this._boundBox;\n }\n /**\n * function to search a node and update it with the config provided.\n * @param {Object} nodeconfig\n */\n updateNode (nodeconfig) {\n if (this._id === nodeconfig._id) {\n this._model.cut(nodeconfig.cut);\n this._model.ratioWeight(nodeconfig.ratioWeight);\n } else {\n this._children.forEach((node) => {\n if (node._id === nodeconfig._id) {\n node.model.cut(nodeconfig.cut);\n node.model.ratioWeight(nodeconfig.ratioWeight);\n return;\n }\n this.searchNode(node, nodeconfig);\n });\n }\n }\n\n // Recursive function to search a node\n searchNode (node, nodeconfig) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeconfig._id) {\n childNode.model().cut(nodeconfig.cut);\n childNode.model().ratioWeight(nodeconfig.ratioWeight);\n } else {\n this.searchNode(childNode, nodeconfig);\n }\n });\n }\n\n /**\n * function to delete a node from tree Structure.\n * @param {String} nodeId - node Id of the Node\n */\n delete (nodeId) {\n this._children.forEach((node) => {\n if (node.id() === nodeId) {\n const index = this._children.indexOf(node);\n this._model.lanes().splice(index, 1);\n }\n this.deleteSearchNode(node, nodeId);\n });\n }\n\n // Recursive function to search a node\n deleteSearchNode (node, nodeId) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeId) {\n const index = node.children().indexOf(childNode);\n node.model().lanes().splice(index, 1);\n } else {\n this.deleteSearchNode(childNode, nodeId);\n }\n });\n }\n}\n\nexport default Node;\n","import Node from '../tree';\nimport {\n allocateBoundingBox,\n negotiateDimension,\n computePosition\n} from '../helper';\n\nexport default class LayoutModel {\n constructor (measurements, config) {\n this._measurements = measurements;\n this._config = config;\n this._root = this.createTree(this._config, null);\n this.setBoundBox();\n }\n\n createTree (config, parent) {\n const node = new Node(config);\n if (parent) {\n node.parentCut(parent.getCutType());\n parent.addChildren([node]);\n } else {\n this._root = node;\n }\n for (const lane of config.lanes()) {\n this.createTree(lane, node);\n }\n\n return this._root;\n }\n\n setBoundBox () {\n this._root.boundBox({\n top: 0,\n left: 0,\n width: this._measurements.width,\n height: this._measurements.height\n });\n allocateBoundingBox(this._root);\n }\n\n setHostPosition (node) {\n node.children().forEach((child) => {\n LayoutModel.setHostSpatialConfig(child);\n this.setHostPosition(child);\n });\n }\n\n static setHostSpatialConfig (node) {\n const bb = node.boundBox();\n const host = node.model().host();\n if (host && host.setSpatialConfig) {\n const conf = {\n x: bb.left,\n y: bb.top,\n width: bb.width,\n height: bb.height,\n renderAt: node.id()\n };\n host.setSpatialConfig(conf);\n }\n }\n\n negotiate () {\n negotiateDimension(this._root);\n computePosition(this._root);\n return this;\n }\n\n broadcast () {\n this.setHostPosition(this._root);\n return this;\n }\n\n tree () {\n return this._root;\n }\n}\n","/**\n * This file exports constants that will be used to\n * create the state store of the table layout.\n */\n/**\n * The index of top, bottom and center in the matrix\n */\nexport const VIEW_INDEX = {\n top: 0,\n center: 1,\n bottom: 2\n};\n\nexport const ROW_MATRIX_INDEX = {\n 0: 'top',\n 1: 'center',\n 2: 'bottom'\n};\n\nexport const COLUMN_MATRIX_INDEX = {\n 0: 'left',\n 1: 'middle',\n 2: 'right'\n};\n\n/**\n * The width of the grid suppied by the user.\n */\nexport const GRID_WIDTH = 'width';\n\n/**\n * The height of the grid supplied by the user.\n */\nexport const GRID_HEIGHT = 'height';\n\n/**\n * The border for the grid\n */\nexport const BORDER = 'border';\n\n /**\n * The index of the first visible row in view matrix.\n */\nexport const ROW_POINTER = 'rowPointer';\n\n/**\n * The index of the first visible column in the view matrix.\n */\nexport const COLUMN_POINTER = 'columnPointer';\n\n/**\n * Flag to specify whether row sizes should be equal.\n */\nexport const ROW_SIZE_IS_EQUAL = 'isRowSizeEqual';\n\n/**\n * Flag to specify whether column sizes are equal.\n */\nexport const COLUMN_SIZE_IS_EQUAL = 'isColumnSizeEqual';\n\n/**\n * Field to store an array an of the widths of visible columns.\n * @computed\n */\nexport const COLUMN_WIDTHS = 'visibleColumnWidths';\n\n/**\n * Field to store an array of heights of visible rows.\n * @computed\n */\nexport const ROW_HEIGHTS = 'visibleRowHeights';\n\n/**\n * Field to store the width of the left matrix.\n * @computed\n */\nexport const LEFT_MATRIX_WIDTH = 'leftMatrixWidth';\n\n/**\n * Field to store the width of the right matrix.\n * @computed\n */\nexport const RIGHT_MATRIX_WIDTH = 'rightMatrixWidth';\n\n/**\n * Field to store the height of the top matrix.\n * @computed\n */\nexport const TOP_MATRIX_HEIGHT = 'topMatrixHeight';\n\n/**\n * Field to store the height of the bottom matrix.\n * @computed\n */\nexport const BOTTOM_MATRIX_HEIGHT = 'bottomMatrixHeight';\n\n/**\n * The dom element to render the layout inside.\n */\nexport const MOUNT_POINT = 'mount';\n\n/**\n * The id attribute of the left table element.\n */\nexport const LEFT_TABLE_ID = 'grid-left';\n\n/**\n * The id attribute of the right table element.\n */\nexport const RIGHT_TABLE_ID = 'grid-right';\n\n/**\n * The id attribute of the top table.\n */\nexport const TOP_TABLE_ID = 'grid-top';\n\n/**\n * The id attribute of the bottom table.\n */\nexport const BOTTOM_TABLE_ID = 'grid-bottom';\n\n/**\n * The id attribute of the center table.\n */\nexport const CENTER_TABLE_ID = 'grid-center';\n\n/**\n * The id attribute of the top div.\n */\nexport const TOP_DIV_ID = 'muze-div-top';\n\n/**\n * The id attribute of the bottom div.\n */\nexport const BOTTOM_DIV_ID = 'muze-div-bottom';\n\n/**\n * The id attribute of the center div.\n */\nexport const CENTER_DIV_ID = 'muze-div-center';\n\n/**\n * Field that indicates if the row configuration has changed\n */\nexport const HAVE_ROWS_CHANGED = 'haveRowsChanged';\n\n/**\n * Field that indicates if the column configuration has changed\n */\nexport const HAVE_COLUMNS_CHANGED = 'haveColumnsChanged';\n\n/**\n * Field that indicates if the values configuration for the center matrix has changed\n */\nexport const HAVE_VALUES_CHANGED = 'haveValuesChanged';\n\n/**\n * Field that indicates the width of row matrix\n */\nexport const ROW_MATRIX_WIDTH = 'rowMatrixWidth';\n\n/**\n * Field that indicates the height of row matrix\n */\nexport const COLUMN_MATRIX_HEIGHT = 'columnMatrixHeight';\n\n/**\n * Field that indicates the unit width of layout\n */\nexport const UNIT_WIDTH = 'unitWidth';\n\n/**\n * Field that indicates the unit height of layout\n */\nexport const UNIT_HEIGHT = 'unitHeight';\n\n/**\n * Field that indicates the style object\n */\nexport const STYLE = 'style';\n\n/**\n * Field that indicates the color configuration\n */\nexport const COLOR = 'color';\n\n/**\n * Field that indicates width\n */\nexport const WIDTH = 'width';\n\n/**\n * Field that indicates collpase property for border\n */\nexport const COLLAPSE = 'collapse';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SPACING = 'spacing';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const DISTRIBUTION = 'distribution';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const GUTTERSPACE = 'gutterSpace';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const BREAK_PAGE = 'breakPage';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_ROW_BORDERS = 'showRowBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_COL_BORDERS = 'showColBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_VALUE_BORDERS = 'showValueBorders';\n\nexport const HEIGHT = 'height';\nexport const COLUMN = 'column';\nexport const ROW = 'row';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const CENTER = 'center';\nexport const CLICK = 'click';\nexport const ROW_LEFT = 'rowLeft';\nexport const ROW_RIGHT = 'rowRight';\nexport const COLUMN_BOTTOM = 'colBottom';\nexport const COLUMN_TOP = 'colTop';\nexport const AUTO = 'auto';\nexport const ROW_SPAN = 'rowSpan';\nexport const COL_SPAN = 'colSpan';\nexport const ROW_ROOT = 'rowRoot';\nexport const COLUMN_ROOT = 'columnRoot';\nexport const PRIMARY = 'primary';\nexport const SECONDARY = 'secondary';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const GRID = 'grid';\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n\nexport const PAGINATION = 'pagination';\nexport const BUFFER = 'buffer';\nexport const HOLISTIC = 'holistic';\nexport const SCROLL = 'scroll';\nexport const MIDDLE = 'middle';\nexport const NO_BORDERS = null;\n\nexport const MAX_WIDTH_AVAIL_FOR_COL_MATRIX = 'maxWidthAvailableForColumnMatrix';\nexport const COLUMN_MATRIX = 'columnMatrix';\nexport const MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX = 'maxHeightAvailableForRowMatrix';\nexport const ROW_MATRIX = 'rowMatrix';\n","/* eslint no-undef: \"off\" */\n/* eslint default-case: \"off\" */\nexport class Utils {\n static isDOMElement (element) {\n return element instanceof Element;\n }\n\n static getID (element) {\n return element.id;\n }\n\n static getElement (id) {\n return document.getElementById(id);\n }\n\n static findContainer (data) {\n return data.filter(coordinate => coordinate.parent == null)[0];\n }\n /**\n * static method to remove the div\n * @param {} divId - div ID to be removed.\n */\n static removeDiv (divId) {\n if (document.getElementById(divId) !== null) { document.getElementById(divId).remove(); }\n }\n}\n","import { DEFAULT_CLASS_NAME } from '../constants/defaults';\nimport { LayoutComponent } from '../layout-component';\n\nexport default class DataPoint {\n constructor (node) {\n this._node = node;\n this._className = node.model().host() instanceof LayoutComponent ?\n node.model().host().className() : DEFAULT_CLASS_NAME;\n }\n\n node () {\n return this._node;\n }\n\n hasHost () {\n return this._node.model().host() instanceof LayoutComponent;\n }\n\n className () {\n return this._className || DEFAULT_CLASS_NAME;\n }\n}\n","import { getnodePoints } from './helper';\n\nexport class DataParser {\n constructor (data) {\n this._data = data;\n }\n\n defaultDataPointLogic () {\n const nodepoints = [];\n getnodePoints(this._data, nodepoints);\n return nodepoints;\n }\n\n}\n","import DataPoint from './data-point';\n\nexport const getnodePoints = (node, nodepoints) => {\n const datapoint = new DataPoint(node);\n nodepoints.push(datapoint);\n node.children().forEach((child) => {\n getnodePoints(child, nodepoints);\n });\n};\n","import { DataParser } from './data-parser';\n\nexport class HTMLDataAdapter extends DataParser {\n getCoordinates () {\n return super.defaultDataPointLogic();\n }\n}\n","export class Renderer {\n\n initRenderer (node, tree) {\n node.__logicalTree = tree;\n }\n}\n","import { HTMLDataAdapter } from '../data-adapters/html-data';\nimport { Utils } from '../utils';\nimport { Renderer } from './renderer';\n\nexport class HTMLRenderer extends Renderer {\n constructor (data) {\n super();\n this._data = data;\n this._coordinates = new HTMLDataAdapter(this._data).getCoordinates();\n }\n\n createhtml (mount, className) {\n const mainDiv = mount;\n super.initRenderer(mainDiv, this._data); // Initialise node with layout id\n this.parentDiv = this.createAndCustomiseParent(className);\n this._coordinates.forEach((node) => {\n if (node.hasHost()) {\n const host = node.node();\n this.parentDiv.appendChild(this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: node.className() }));\n }\n });\n mainDiv.appendChild(this.parentDiv);\n }\n\n createAndPositionDiv (config) {\n const { top, left, height, width, className, id } = config;\n const existingDiv = document.getElementById(id);\n const div = existingDiv || document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = `${left}px`;\n div.style.top = `${top}px`;\n div.style.height = `${height}px`;\n div.style.width = `${width}px`;\n div.id = id;\n div.className = className;\n return div;\n }\n\n createAndCustomiseParent (className) {\n const container = Utils.findContainer(this._coordinates);\n const host = container.node();\n const parentDiv = this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: container.className() });\n parentDiv.className = className;\n parentDiv.style.position = 'relative';\n return parentDiv;\n }\n\n coordinates () {\n return this._coordinates;\n }\n}\n","import { selectElement } from 'muze-utils';\nimport { HTMLRenderer } from '../renderers/html-renderer';\nimport { LayoutComponent } from '../layout-component';\n\nexport const getChildNode = (context, config) =>\n context.renderer().createAndPositionDiv(config);\n\nexport const findNode = (context, nodeID) =>\n context.renderer().coordinates().find(point => point.node().id() === nodeID);\n\nexport const renderHTML = (context) => {\n context.renderer(new HTMLRenderer(context.data()));\n context.renderer().createhtml(context.mount(), context.className());\n};\n\nexport const drawLayout = context => renderHTML(context);\n\nexport const drawComponent = (componentData) => {\n componentData.children().forEach((node) => {\n const host = node.model().host();\n if (host instanceof LayoutComponent) {\n host.draw();\n }\n drawComponent(node);\n });\n};\n\nexport const removeElement = (elemID) => {\n if (elemID) {\n selectElement(`#${elemID}`).remove();\n }\n};\n\nconst setAlignConfig = (alignment, params) => {\n let newNodeConfig = {};\n const { node, refNode } = params;\n switch (alignment) {\n case 'left':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(refNode.left - node.left))\n };\n break;\n\n case 'right':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(node.left + node.width - (refNode.left + refNode.width)))\n };\n break;\n\n case 'top':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: Math.abs(node.height - Math.abs(refNode.top - node.top)),\n width: node.width\n };\n break;\n\n case 'bottom':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: Math.abs(node.top - refNode.top + refNode.height),\n width: node.width\n };\n break;\n\n case 'h-center':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: refNode.width\n };\n break;\n\n case 'v-center':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: refNode.top,\n width: node.width\n };\n break;\n default:\n break;\n }\n return newNodeConfig;\n};\n\nexport const resolveAligment = (context, componentData) => {\n componentData.children().forEach((component) => {\n const host = component.model().host();\n\n if (host instanceof LayoutComponent && host.alignWith()) {\n const componentToAlign = context.componentMap().get(host.alignWith());\n\n if (componentToAlign) {\n const point = findNode(context, component.id()).node();\n const node = point.boundBox();\n const refNode = findNode(context, componentToAlign.renderAt())\n .node()\n .boundBox();\n const newNodeConfig = setAlignConfig(host.alignment(), { node, refNode });\n\n // check if model in parent component\n Object.assign(newNodeConfig, { id: point.id(), className: host.className() });\n context.renderer().createAndPositionDiv(newNodeConfig);\n context.componentMap().get(host.name()).setSpatialConfig({\n x: newNodeConfig.left,\n y: newNodeConfig.top,\n height: newNodeConfig.height,\n width: newNodeConfig.width\n\n });\n }\n }\n\n resolveAligment(context, component);\n });\n};\n","import { Utils } from '../utils';\nimport { drawLayout, resolveAligment, drawComponent } from './helper';\n\nexport class DrawingManager {\n constructor (data, renderer, container) {\n this._data = data.tree;\n this._componentMap = data.componentMap;\n this._layoutClassName = data.layoutClassName;\n this._renderer = renderer;\n this._mount = Utils.isDOMElement(container) ? container : Utils.getElement(container);\n }\n\n draw () {\n drawLayout(this);\n resolveAligment(this, this._data);\n drawComponent(this._data);\n return this;\n }\n\n data (data) {\n if (data) {\n this._data = data;\n }\n return this._data;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n className (param) {\n if (param) {\n this._layoutClassName = param;\n }\n return this._layoutClassName;\n }\n\n renderer (param) {\n if (param) {\n this._renderer = param;\n }\n return this._renderer;\n }\n\n mount (param) {\n if (param) {\n this._mount = param;\n }\n return this._mount;\n }\n}\n","import DefinitionModel from './definitionModel';\nimport { prepareTargetComponentMap, getComponent, placeComponent, placeGridComponent } from '../helper';\n\nexport default class DefinitionManager {\n constructor (componentMap, sequence, totalHeight, totalWidth) {\n this._componentMap = componentMap;\n this._prioritySequence = sequence;\n this._totalHeight = totalHeight;\n this._totalWidth = totalWidth;\n this._targetComponentMap = null;\n }\n\n // create the config model\n generateConfigModel () {\n prepareTargetComponentMap(this);\n const canvasComponent = this._targetComponentMap.get('canvas');\n const definitionModel = new DefinitionModel({});\n let tempDefModel = definitionModel;\n definitionModel.remainingHeight(this._totalHeight);\n definitionModel.remainingWidth(this._totalWidth);\n\n let componentRef = null;\n\n this._prioritySequence.forEach((name) => {\n componentRef = getComponent(canvasComponent, name);\n if (name !== 'grid') {\n tempDefModel = placeComponent(tempDefModel, componentRef).second;\n } else {\n tempDefModel = placeGridComponent(tempDefModel, componentRef.component);\n }\n });\n return definitionModel;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n targetComponentMap (param) {\n if (param) {\n this._targetComponentMap = param;\n }\n return this._targetComponentMap;\n }\n}\n","import { sanitizeConfig } from './helper';\n\nexport class LayoutDef {\n constructor () {\n this._componentMap = new Map();\n this._layoutDefinition = null;\n }\n\n addComponent (component) {\n this._componentMap.set(component.name(), component);\n }\n\n layoutDefinition (def) {\n if (def) {\n this._layoutDefinition = def;\n }\n return this._layoutDefinition;\n }\n\n addMultipleComponent (componentArray) {\n componentArray.forEach((comp) => {\n this.addComponent(comp);\n });\n }\n\n sanitizedDefinition () {\n sanitizeConfig(this, this._layoutDefinition);\n return this.layoutDefinition();\n }\n\n componentMap () {\n return this._componentMap;\n }\n resetComponentMap () {\n this._componentMap.clear();\n }\n}\n","import DefinitionManager from '../layout-definition/definition-manager';\n\nexport function sanitizeConfig (context, hostObj) {\n const hostID = hostObj.host();\n if (hostObj.lanes() && hostObj.lanes().length) {\n hostObj.lanes().forEach(childHost => sanitizeConfig(context, childHost));\n }\n if (hostID != null && typeof (hostID) === 'string') {\n if (context.componentMap().get(hostID) !== undefined) {\n hostObj.host(context.componentMap().get(hostID));\n }\n }\n}\n\nexport function calLayOutDef (context) {\n const { height, width } = context.dimension();\n const defManager = new DefinitionManager(context.layoutDef().componentMap(),\n context.prioritySequence(),\n height,\n width);\n const genLayoutdef = defManager.generateConfigModel();\n return genLayoutdef;\n}\n","import {\n LayoutModel\n} from '../layout-definition';\n\nimport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT\n} from '../constants/defaults';\n\nimport {\n GRID\n} from '../../enums/constants';\n\nimport { DrawingManager } from '../drawing-manager';\nimport { removeElement } from '../drawing-manager/helper';\nimport { Utils } from '../utils';\nimport { LayoutDef } from './layout-def';\nimport { calLayOutDef } from './helper';\n\nexport default class LayoutManager {\n constructor (conf) {\n this._renderAt = conf.renderAt;\n this._layoutClassName = conf.className;\n this._dimension = {\n width: conf.width || DEFAULT_WIDTH,\n height: conf.height || DEFAULT_HEIGHT\n };\n\n this._skeletonType = conf.skeletonType || 'html';\n this._layoutDefinition = null;\n this._layoutDef = new LayoutDef();\n this._drawingManager = null;\n this._prioritySequence = [];\n this.tree = null;\n this._rootNodeID = null;\n }\n\n layoutDef (param) {\n if (param) {\n this._layoutDef = param;\n }\n return this._layoutDef;\n }\n\n prioritySequence (param) {\n if (param) {\n this._prioritySequence = param;\n }\n return this._prioritySequence;\n }\n\n dimension (param) {\n if (param) {\n Object.assign(this._dimension, param);\n }\n return this._dimension;\n }\n\n addComponent (component) {\n this._layoutDef.addComponent(component);\n }\n\n addMultipleComponent (componentArray) {\n this._layoutDef.addMultipleComponent(componentArray);\n }\n\n resetNode (node) {\n if (this.con) {\n this.con.resetNode(node);\n }\n }\n\n /**\n * function to update the node and rerender the layout.\n * @param {} config - node configuration to change.\n */\n updateNode (config) {\n this.tree.updateNode(config);\n this._layoutDefinition = this.tree.model;\n this.compute();\n }\n\n compute () {\n //----\n if (Utils.isDOMElement(this._renderAt)) {\n this._renderAt._layout = this;\n } else {\n document.getElementById(this._renderAt)._layout = this;\n }\n //-----\n this._layoutDefinition = calLayOutDef(this);\n this._layoutDef.layoutDefinition(this._layoutDefinition);\n this._layoutDefinition = this._layoutDef.sanitizedDefinition();\n this._layout = new LayoutModel({\n width: this._dimension.width,\n height: this._dimension.height\n },\n this._layoutDefinition);\n this.tree = this._layout.negotiate().tree();\n this._layout.broadcast();\n this._drawingManager = new DrawingManager({\n tree: this.tree,\n componentMap: this._layoutDef.componentMap(),\n layoutClassName: this._layoutClassName\n }, this._skeletonType, this._renderAt);\n\n if (this._rootNodeID) {\n this.tree.id(this._rootNodeID);\n } else {\n this._rootNodeID = this.tree.id();\n }\n // this will draw all the components by calling their draw method\n this._drawingManager.draw();\n }\n\n getRootNodeId () {\n return this._rootNodeID;\n }\n\n /**\n * This function takes the LayoutComponents and Register them in component store\n * @param {Array} layoutComponents\n */\n registerComponents (layoutComponents) {\n this._prioritySequence.length = 0;\n this._layoutDef.resetComponentMap();\n layoutComponents.forEach((container) => {\n if (container) {\n this._prioritySequence.push(container.name());\n this.addComponent(container);\n if (container.name() === 'grid') {\n container.component.forEach((componentArr) => {\n componentArr.forEach((compo) => {\n this.addComponent(compo);\n });\n });\n }\n }\n });\n return this;\n }\n\n getComponent (componentName) {\n return this._layoutDef.componentMap().get(componentName);\n }\n\n deleteElement (component, elementName) {\n this._layoutDef.componentMap().delete(elementName);\n const deleteElementId = component.renderAt();\n return removeElement(deleteElementId);\n }\n\n removeComponent (name) {\n const component = this.getComponent(name);\n if (component) {\n if (name === GRID) {\n return component.component.map(comp => comp.map(\n co => this.deleteElement(co, co.name())\n ));\n }\n return this.deleteElement(component, name);\n }\n return this;\n }\n\n renderAt (mount) {\n if (mount) {\n this._renderAt = mount;\n }\n return this._renderAt;\n }\n}\n","import { isEqual, STATE_NAMESPACES, selectElement, getValueParser, FieldType } from 'muze-utils';\nimport { VisualGroup } from '@chartshq/visual-group';\nimport { BEHAVIOURS } from '@chartshq/muze-firebolt';\nimport { payloadGenerator } from '@chartshq/visual-unit';\nimport { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID, LEGEND }\n from '../constants';\nimport { canvasOptions } from './local-options';\nimport { LayoutManager } from '../../../layout/src/tree-layout';\n\n/**\n * Instantiate high level components. Canvas knows what all high level component it has.\n * @nice-to-have dynamic high level components.\n * - Is it even required ?\n * - Reactive to source (canvas) streaming ?\n * @param {*} context Canvas instance\n * @return {Object.} Arrays of Title, visualGroup, Legend\n */\nexport const initCanvas = (context) => {\n const reg = context._registry.components;\n\n return [new reg.VisualGroup(context._registry, Object.assign({\n throwback: context._throwback\n }, context.dependencies()))];\n};\n\nexport const fixFacetConfig = (config) => {\n if (config) {\n let isBorderPresent = false;\n const isGridLinePresent = {};\n\n if (config.border && config.border.width) {\n isBorderPresent = true;\n }\n if (config.gridLines) {\n isGridLinePresent.x = !!config.gridLines.x;\n isGridLinePresent.y = !!config.gridLines.y;\n }\n const facetsUserConfig = {\n isBorderPresent,\n isGridLinePresent\n };\n return {\n facetsUserConfig,\n isFacet: false\n };\n }\n return {};\n};\n\nexport const fixScrollBarConfig = (config) => {\n config.scrollBar.thickness = Math.min(50, Math.max(10, config.scrollBar.thickness));\n return config;\n};\n\nexport const setLayoutInfForUnits = (context) => {\n const layoutManager = context._layoutManager;\n const gridLayout = layoutManager.getComponent(GRID);\n const legend = layoutManager.getComponent(LEGEND);\n const boundBox = gridLayout && gridLayout.getBoundBox();\n const valueMatrix = context.composition().visualGroup.matrixInstance().value;\n const parentContainer = selectElement(`#${layoutManager.getRootNodeId()}`).node();\n if (legend) {\n legend.setComponentInfo({ rootNode: parentContainer });\n }\n valueMatrix.each((cell) => {\n cell.valueOf().parentContainerInf({\n el: parentContainer,\n dimensions: boundBox\n });\n });\n};\n\n/**\n *\n *\n * @memberof Canvas\n */\nexport const dispatchProps = (context) => {\n const lifeCycleManager = context.dependencies().lifeCycleManager;\n lifeCycleManager.notify({ client: context, action: 'beforeupdate' });\n const visualGroup = context.composition().visualGroup;\n\n const allOptions = context._allOptions;\n for (const key in allOptions) {\n const value = context[key]();\n if (value !== null) {\n visualGroup[key] && visualGroup[key](value);\n }\n }\n const { invalidValues } = context.config();\n\n visualGroup.valueParser(getValueParser(invalidValues));\n\n const sanitizedData = visualGroup.getMandatoryFields();\n if (sanitizedData.shouldRender) {\n visualGroup.createMatrices(sanitizedData);\n } else {\n visualGroup.remove();\n }\n context._cachedProps = {};\n lifeCycleManager.notify({ client: context, action: 'initialized' });\n lifeCycleManager.notify({ client: context, action: 'updated' });\n};\n\nconst equalityChecker = (props, params) => {\n let checker = () => false;\n return !props.every((option, i) => {\n switch (option) {\n case ROWS:\n case COLUMNS:\n case DETAIL:\n checker = isEqual('Array');\n break;\n\n case SHAPE:\n case SIZE:\n case COLOR:\n case DATA:\n case CONFIG:\n checker = isEqual('Object');\n break;\n default:\n checker = () => true;\n break;\n }\n const oldVal = params[i][0];\n const newVal = params[i][1];\n\n return checker(oldVal, newVal);\n });\n};\n\nexport const notifyAnimationEnd = (context) => {\n const viewInfo = context.layout().viewInfo();\n const centerMatrix = viewInfo && viewInfo.viewMatricesInfo.matrices.center[1] || [];\n const promises = [];\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n promises.push(cell.valueOf().done());\n });\n });\n const lifeCycleManager = context.lifeCycle();\n if (promises.length) {\n Promise.all(promises).then(() => {\n // Update life cycle\n lifeCycleManager.notify({ client: context, action: 'drawn' });\n const animDonePromises = [];\n\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n cell.valueOf().layers().forEach((layer) => {\n animDonePromises.push(layer.animationDone());\n });\n });\n });\n\n [context.xAxes(), context.yAxes()].forEach((axisArr) => {\n axisArr = axisArr || [];\n axisArr.forEach((axes) => {\n axes.forEach((axisInst) => {\n animDonePromises.push(axisInst.animationDone());\n });\n });\n });\n\n Promise.all(animDonePromises).then(() => {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n });\n });\n } else {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n }\n};\n\nexport const setupChangeListener = (context) => {\n const store = context._store;\n\n const allOptions = Object.keys(context._allOptions);\n const props = [...allOptions, ...Object.keys(canvasOptions)];\n const nameSpaceProps = [...allOptions, ...Object.keys(canvasOptions)].map(prop =>\n `${STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE}.${prop}`);\n store.registerChangeListener(nameSpaceProps, (...params) => {\n const equalityProps = equalityChecker(props, params);\n // inform attached board to rerender\n if (equalityProps && context.mount()) {\n dispatchProps(context);\n context.render();\n }\n notifyAnimationEnd(context);\n }, true);\n};\n\nconst applyPropagationPolicy = (firebolt, { behaviours, sideEffects }) => {\n for (const key in behaviours) {\n firebolt.changeBehaviourStateOnPropagation(key, behaviours[key]);\n }\n for (const key in sideEffects) {\n firebolt.changeSideEffectStateOnPropagation(key, sideEffects[key]);\n }\n};\n\nconst isMeasure = fields => fields.every(field => field.type() === FieldType.MEASURE);\n\nconst isSplom = (fields) => {\n const { rowProjections, colProjections } = fields;\n const colProj = colProjections.flat();\n const rowProj = rowProjections.flat();\n\n if (isMeasure(colProj) && isMeasure(rowProj)) {\n return true;\n }\n return false;\n};\n\nexport const applyInteractionPolicy = (firebolt) => {\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n if (visualGroup) {\n const splom = isSplom(visualGroup.resolver().getAllFields());\n const valueMatrix = visualGroup.matrixInstance().value;\n const interactionPolicy = firebolt._interactionPolicy;\n interactionPolicy(valueMatrix, firebolt);\n const crossInteractionPolicy = firebolt._crossInteractionPolicy;\n const behaviours = crossInteractionPolicy.behaviours;\n const sideEffects = crossInteractionPolicy.sideEffects;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n applyPropagationPolicy(unitFireBolt, { behaviours, sideEffects });\n if (splom) {\n unitFireBolt.payloadGenerators({\n [BEHAVIOURS.BRUSH]: (inst, dm, propConfig, facetFields) => payloadGenerator.brush(inst, dm,\n { ...propConfig, ...{ includeMeasures: false } }, facetFields)\n });\n unitFireBolt.sideEffects().selectionBox.config({\n persistent: true\n });\n } else {\n unitFireBolt.payloadGenerators({\n [BEHAVIOURS.BRUSH]: payloadGenerator.brush\n });\n unitFireBolt.sideEffects().selectionBox.config({\n persistent: false\n });\n }\n });\n applyPropagationPolicy(firebolt, { behaviours, sideEffects });\n }\n};\n\n/**\n * Sets the rotation for all x axes if any axis has the rotation config set in the\n * entire view\n *\n * @param {Array} columns Column cells that contain the axes cells\n */\nexport const setLabelRotationForAxes = (context) => {\n let rotation = 0;\n\n const xAxes = context.xAxes() || [];\n\n (() => {\n for (let i = 0; i < xAxes.length; i++) {\n for (let j = 0; j < xAxes[i].length; j++) {\n const rotationVal = xAxes[i][j].renderConfig().labels.rotation;\n if (rotationVal && rotationVal !== 0) {\n rotation = rotationVal;\n return;\n }\n }\n }\n })();\n\n if (rotation) {\n xAxes.forEach((axes) => {\n axes.forEach((axis) => {\n axis.renderConfig({ labels: { rotation } });\n axis.smartTicks(axis.setTickConfig());\n });\n });\n }\n};\n\nexport const createGroupState = (context) => {\n const [globalState, localState] = VisualGroup.getState();\n const store = context._store;\n store.append('app.group', globalState);\n store.append('local.group', localState);\n};\n\nexport const removeChild = (mount) => {\n while (mount.firstChild) {\n mount.removeChild(mount.firstChild);\n }\n};\n\nexport const createLayoutManager = () => {\n const layoutManager = new LayoutManager({\n className: 'muze-group-container'\n });\n return layoutManager;\n};\n","/**\n * This is the global options semantics based on which setters getters are created and reactivity is initiated.\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n * @module GlobalOptions\n */\n\nimport { intSanitizer, mergeRecursive, DataModel } from 'muze-utils';\nimport { fixScrollBarConfig, fixFacetConfig } from './canvas/helper';\nimport { DEFAULT_CONFIG } from './defaults';\n\nexport default {\n data: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel\n }\n },\n width: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n height: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitWidth: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitHeight: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n config: {\n value: [null, null],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n takesMultipleParams: true,\n sanitization: ([config, auxConfig = {}], oldConfig) => {\n // Stores additional config, if passed\n const { reset = false } = auxConfig;\n let oldConf = {};\n\n // handle the default cases for facet, as it is different to other charts\n const facetDefaultConfig = fixFacetConfig(config);\n config = mergeRecursive(config, facetDefaultConfig);\n\n if (!reset) {\n oldConf = mergeRecursive({}, config === null ? {} : oldConfig);\n }\n\n const defConfig = mergeRecursive(oldConf, DEFAULT_CONFIG);\n const newConf = mergeRecursive(defConfig, config);\n\n return fixScrollBarConfig(newConf);\n }\n\n }\n }\n};\n","import { sanitizeIP, mergeRecursive } from 'muze-utils';\nimport { TOP, CENTER, BOTTOM } from '../enums/constants';\n\n/*\n * This is the abstract implementation of the root layout. This takes care of common work which all the layouts\n * has to handle. The common work includes sanitizaion of inputs, update, rerender, dispose etc. This class can't be\n * used directly (as ofcourse this is an abstract implementaiton), the class which is implementing it has to implement\n * the necessary methods and gives its on visual.\n */\n\n/**\n * This class is used to create a generic layout. It can be extended to create layouts\n * of different types\n * @class GenericLayout\n */\nexport default class GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config configuration to be given for the layout\n * @param {Object} dependencies external dependencies.\n *\n * @memberof GenericLayout\n *\n */\n constructor (mountPoint, measurement, config, dependencies) {\n this._config = {};\n this._measurement = {};\n this._matrices = [];\n // External dependencies to be included for the layout. This includes the ext global dependencies like\n // smartlabel which has one single implementation of throughout the page or per isntance\n this._dependencies = dependencies;\n\n this.measurement(measurement);\n this.mountPoint(mountPoint);\n this.config(config);\n }\n\n /**\n * Returns an object which is used to recreate the layout.\n * @return {Object} the serialized components\n */\n serialize () {\n return {\n measurement: this.measurement(),\n config: this.config(),\n matrices: this.matrices()\n };\n }\n\n /**\n * Sets/Gets the config for the layout\n * @param {Object} config configuration for the layout\n * @return {Layout|Object} Gets the Config/ Returns this instance when set\n */\n config (config) {\n if (config) {\n this._config = mergeRecursive(this._config || {}, config);\n this._config.border.width = Math.max(0, this._config.border.width);\n return this;\n }\n return this._config;\n }\n\n /**\n * Sets/Gets the measurement for the layout\n * @param {Object} measurement measurement for the layout\n * @return {Layout|Object} Gets the measurement/ Returns this instance when set\n */\n measurement (measurement) {\n if (measurement) {\n this._measurement = mergeRecursive(this._measurement || {}, measurement);\n\n return this;\n }\n return this._measurement;\n }\n\n /**\n * Sets/Gets the matrices for the layout\n * @param {Object} matrices matrices for the layout\n * @return {Layout|Object} Gets the matrices/ Returns this instance when set\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = sanitizeIP.typeObj([TOP, CENTER, BOTTOM], matrices);\n\n return this;\n }\n return this._matrices;\n }\n\n /**\n * Sets/Gets the matrix for row\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n rowMatrix (matrix) {\n if (matrix) {\n this._rowMatrix = matrix;\n return this;\n }\n return this._rowMatrix;\n }\n\n /**\n * Sets/Gets the matrix for columns\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n columnMatrix (matrix) {\n if (matrix) {\n this._columnMatrix = matrix;\n return this;\n }\n return this._columnMatrix;\n }\n\n /**\n * Sets/Gets the matrix for value\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n centerMatrix (matrix) {\n if (matrix) {\n this._centerMatrix = matrix;\n return this;\n }\n return this._centerMatrix;\n }\n\n /**\n * Sets/Gets the mountPoint for the layout\n * @param {Object} mountPoint mountPoint for the layout\n * @return {Layout|Object} Gets the mountPoint/ Returns this instance when set\n */\n mountPoint (mountPoint) {\n if (mountPoint) {\n this._mountPoint = mountPoint;\n\n return this;\n }\n return this._mountPoint;\n }\n}\n","import * as FieldNames from '../enums/constants';\n\n/**\n * Default configuration of the layout\n * @return {Object} returns the default configuration\n */\nexport const DEFAULT_CONFIGURATION = {\n [FieldNames.BORDER]: {\n [FieldNames.STYLE]: 'solid',\n [FieldNames.COLOR]: '#d6d6d6',\n [FieldNames.WIDTH]: 2,\n [FieldNames.COLLAPSE]: true,\n [FieldNames.SPACING]: 0\n },\n [FieldNames.PAGINATION]: 'scroll',\n [FieldNames.BUFFER]: 20,\n [FieldNames.GUTTERSPACE]: { rows: [], columns: [] },\n [FieldNames.DISTRIBUTION]: { rows: [], columns: [] },\n [FieldNames.BREAK_PAGE]: { rows: [], columns: [] },\n [FieldNames.ROW_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_POINTER]: 0,\n [FieldNames.ROW_POINTER]: 0\n};\n\n/**\n * Default measurements for the layout\n * @return {Object} returns the default measurements\n */\nexport const DEFAULT_MEASUREMENTS = {\n [FieldNames.GRID_WIDTH]: 100,\n [FieldNames.GRID_HEIGHT]: 100,\n [FieldNames.UNIT_WIDTH]: 100,\n [FieldNames.UNIT_HEIGHT]: 100\n};\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n","/**\n * This file exports utility functions that are used across the layout module\n */\nimport { Symbols } from 'muze-utils';\nimport { PRIMARY, SECONDARY, HEIGHT, WIDTH } from '../enums/constants';\n\nconst nest = Symbols.nest;\n/**\n *\n *\n * @param {*} isTransposed\n *\n */\nconst getMeasureInfo = (isTransposed) => {\n if (isTransposed) {\n return {\n firstMeasure: HEIGHT,\n secondMeasure: WIDTH\n };\n }\n return {\n firstMeasure: WIDTH,\n secondMeasure: HEIGHT\n };\n};\n\n/**\n *\n *\n * @param {*} i\n * @param {*} page\n *\n */\nconst findInPage = (i, page) => {\n let count = 0;\n for (const x in page) {\n if (i < page[x]) {\n count = x;\n break;\n }\n }\n return count;\n};\n\n/**\n * Creates a single matrix from two matrices\n *\n * @param {Array} matrix Input matrix\n * @return {Array} Joined matrix\n * @memberof VisualMatrix\n */\nexport const combineMatrices = (matrix, config) => {\n const { isTransposed } = config;\n let joinedMatrix = matrix[0].length > 0 ? matrix[0] : matrix[1];\n if (isTransposed) {\n joinedMatrix = matrix[0].length > 0 ? [...matrix[0]] : [];\n joinedMatrix = matrix[1].length > 0 ? [...joinedMatrix, ...matrix[1]] : joinedMatrix;\n } else {\n joinedMatrix = joinedMatrix.map((row, rowIndex) => {\n let rowData = [];\n if (matrix[0].length > 0) {\n rowData = [...matrix[0][rowIndex]];\n }\n if (matrix[1].length > 0) {\n rowData = [...rowData, ...matrix[1][rowIndex]];\n }\n return rowData;\n });\n }\n return joinedMatrix;\n};\n\n/**\n * Creates a hirachical tree from the context\n *\n * @param {Object} context context for creating tree\n * @return {Object} nested tree\n */\nexport const createTree = (context) => {\n let matrixTree = {};\n let lastLevelKey = 0;\n let facet = PRIMARY;\n const nestFn = nest();\n const keys = [];\n const layoutMatrix = context._layoutMatrix;\n const primaryMatrix = context.primaryMatrix();\n const secondaryMatrix = context.secondaryMatrix();\n const { isTransposed, breakPage } = context.config();\n\n if (!isTransposed) {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix[0].length - 1; i++) {\n keys.push(i);\n }\n keys.push(primaryMatrix[0].length - 1);\n if (facet === SECONDARY || secondaryMatrix.length === 0) {\n lastLevelKey = primaryMatrix[0].length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const keyLength = primaryMatrix.length > 0 ? primaryMatrix[0].length : 0;\n for (let i = secondaryMatrix[0].length - 1; i > 0; i--) {\n keys.push(i + keyLength);\n }\n keys.push(keyLength);\n\n if (facet === PRIMARY) {\n lastLevelKey = keyLength;\n }\n } else {\n lastLevelKey = primaryMatrix.length > 0 ? primaryMatrix[0].length - 1 : 0;\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n matrixTree = nestFn.entries(layoutMatrix);\n } else {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix.length - 1; i++) {\n keys.push(i);\n }\n // if (facet === PRIMARY) {\n keys.push(primaryMatrix.length - 1);\n // } else {\n if (facet === SECONDARY) {\n lastLevelKey = primaryMatrix.length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const primaryMatrixLength = primaryMatrix.length;\n for (let i = secondaryMatrix.length - 1; i > 0; i--) {\n keys.push(i + primaryMatrixLength);\n }\n // if (facet === SECONDARY) {\n keys.push(primaryMatrixLength);\n // }\n if (facet === PRIMARY) {\n lastLevelKey = primaryMatrixLength;\n }\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n let newMatrix = [];\n newMatrix = layoutMatrix[0].map((col, colIndex) => layoutMatrix.map(row => row[colIndex]));\n matrixTree = nestFn.entries(newMatrix);\n }\n return { tree: matrixTree, lastLevelKey };\n};\n\n/**\n * Gives the min measues\n *\n * @param {boolean} isTransposed is column matrix\n * @param {Object} unitMeasures min measures to be given to cells\n * @return {Object} dimension min cell\n */\nexport const getMinMeasures = (isTransposed, unitMeasures) => {\n if (!isTransposed) {\n return {\n height: unitMeasures.height,\n width: 0\n };\n }\n return {\n height: 0,\n width: unitMeasures.width\n };\n};\n\n/**\n * Get the logical space from the tree\n *\n * @param {Node} item tree to be calculated\n * @param {number} measures width and height\n * @param {Array} minMeasures min measures for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} dimension\n */\nexport const getLogicalSpace = (item, measures, minMeasures, maxMeasure = []) => {\n const { firstMeasure, secondMeasure } = measures;\n let firstMeasureValue = 0;\n let secondMeasureValue = 0;\n item.values.forEach((valueArray) => {\n let fMeasure = 0;\n let sMeasure = 0;\n valueArray.forEach((placeholder, colIndex) => {\n placeholder.setAvailableSpace();\n const space = placeholder.getLogicalSpace();\n const minSecondMeasure = placeholder.getMinMeasures(minMeasures[secondMeasure]);\n\n sMeasure = Math.max(sMeasure, +space[secondMeasure], minSecondMeasure);\n maxMeasure[colIndex] = Math.max(maxMeasure[colIndex] || 0, space[firstMeasure]);\n fMeasure += +maxMeasure[colIndex];\n });\n secondMeasureValue += sMeasure;\n firstMeasureValue = Math.max(firstMeasureValue, fMeasure);\n item.space = {\n [secondMeasure]: Math.ceil(secondMeasureValue),\n [firstMeasure]: Math.ceil(firstMeasureValue)\n };\n });\n return {\n [secondMeasure]: secondMeasureValue,\n [firstMeasure]: firstMeasureValue\n };\n};\n\n/**\n * Computes the logical spcae taken by the matrix tree\n *\n * @param {*} [item={}] tree to be viewed\n * @param {boolean} [isTransposed=false] is column matrix\n * @param {*} unitMeasures min measues for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} logical space taken\n */\nexport const computeLogicalSpace = (item = {}, config, maxMeasures) => {\n const { isTransposed = false, unitMeasures } = config;\n const { firstMeasure, secondMeasure } = getMeasureInfo(isTransposed);\n const { values } = item;\n const minMeasures = getMinMeasures(isTransposed, unitMeasures);\n\n if (values[0].key) {\n const logicalSpace = { [firstMeasure]: 0, [secondMeasure]: 0 };\n\n values.forEach((valueItem) => {\n // Compute logical space for lowest level\n const space = computeLogicalSpace(valueItem, config, maxMeasures);\n // Set logical space for first measure\n logicalSpace[firstMeasure] = Math.max(logicalSpace[firstMeasure], space[firstMeasure],\n minMeasures[firstMeasure]);\n\n // Set logical space for second measure\n logicalSpace[secondMeasure] += +space[secondMeasure];\n });\n item.space = logicalSpace;\n return logicalSpace;\n }\n\n return getLogicalSpace(item, { firstMeasure, secondMeasure }, minMeasures, maxMeasures);\n};\n\n/**\n * Gives the space taken by a row\n *\n * @param {Array} row matrix array of rows\n * @return {Object} dimension of the row\n */\nexport const spaceTakenByRow = (row) => {\n let height = 0;\n let width = 0;\n row.forEach((col) => {\n const spaces = col.getLogicalSpace();\n height = Math.max(height, spaces.height);\n width += spaces.width;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Gives the space taken by a column\n *\n * @param {Array} matrix column matrix\n * @param {number} colIndex column index\n * @return {Object} dimension of the column\n */\nexport const spaceTakenByColumn = (matrix, colIndex) => {\n let height = 0;\n let width = 0;\n matrix.forEach((row) => {\n const col = row[colIndex];\n const spaces = col.getLogicalSpace();\n width = Math.max(width, spaces.width);\n height += spaces.height;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Creates different level matrices\n *\n * @param {Object} item matrix tree\n * @param {boolean} isTransposed is column matrix\n * @return {Object} matrix of each level\n */\nexport const createMatrixEachLevel = (item, isTransposed) => {\n if (item.values[0].key) {\n const arr = [];\n item.values.forEach((child) => {\n if (!isTransposed) {\n arr.push(...createMatrixEachLevel(child, isTransposed));\n } else {\n const eachLevel = createMatrixEachLevel(child, isTransposed);\n eachLevel.forEach((e, i) => {\n arr[i] = arr[i] || [];\n arr[i].push(...e);\n });\n }\n });\n item.matrix = arr;\n return arr;\n }\n if (!isTransposed) {\n item.matrix = item.values;\n } else {\n item.matrix = item.values[0].map((col, colIndex) => item.values.map(row => row[colIndex]));\n }\n return item.matrix;\n};\n\n/**\n * Breaks the matrix into two part\n *\n * @param {Array} matrix input matrix\n * @param {boolean} isTransposed is column matrix\n * @param {number} breakPointer point in matrix where it is to be broken\n * @return {Array} two broken matrix\n */\nexport const breakMatrix = (matrix, isTransposed, breakPointer) => {\n const primaryMatrix = [];\n const secondaryMatrix = [];\n if (isTransposed) {\n matrix.forEach((row, rowIndex) => {\n if (rowIndex >= breakPointer) {\n secondaryMatrix.push(row);\n } else {\n primaryMatrix.push(row);\n }\n });\n } else {\n matrix.forEach((row, rowIndex) => {\n row.forEach((column, columnIndex) => {\n if (columnIndex >= breakPointer) {\n secondaryMatrix[rowIndex] = secondaryMatrix[rowIndex] || [];\n secondaryMatrix[rowIndex].push(column);\n } else {\n primaryMatrix[rowIndex] = primaryMatrix[rowIndex] || [];\n primaryMatrix[rowIndex].push(column);\n }\n });\n });\n }\n return [primaryMatrix, secondaryMatrix];\n};\n\n/**\n * Distributed width returned\n *\n * @param {Object} context context for the width distibution\n * @return {number} distributed widths\n */\nexport const getDistributedWidth = (context, layoutConfig) => {\n const {\n availableWidth,\n width,\n row\n } = context;\n const {\n isDistributionEqual,\n isTransposed,\n distribution\n } = layoutConfig;\n let distSum = 0;\n if (distribution && distribution[0]) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n return row.map((col, colIndex) => {\n const space = col.getLogicalSpace().width;\n let distWidth = (space + (availableWidth - width) * (space / width));\n if (isTransposed) {\n if (distribution.length > 0) {\n distWidth = (availableWidth * distribution[colIndex] / distSum);\n } else if (isDistributionEqual || width === 0) {\n const rowLen = row.length;\n distWidth = (availableWidth / rowLen);\n }\n }\n return Math.floor(distWidth);\n });\n};\n\n/**\n * Distributeed heights returned\n *\n * @param {Object} context input for the height distribution\n * @return {Object} distribured heights\n */\nexport const getDistributedHeight = (context) => {\n let distSum = 0;\n let gutterSum = 0;\n let heightWithoutGutter = 0;\n const {\n isTransposed,\n distribution,\n availableHeight,\n height,\n isDistributionEqual,\n gutter,\n matrix,\n cIdx\n } = context;\n\n if (distribution && distribution[0] !== undefined) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n if (gutter && gutter[0] !== undefined) {\n gutterSum = gutter.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n heightWithoutGutter = availableHeight - Math.floor(availableHeight * gutterSum);\n\n const colLen = matrix.length;\n return matrix.map((row, rIdx) => {\n const col = row[cIdx];\n const space = col.getLogicalSpace().height;\n let distHeight = (space + (heightWithoutGutter - height) * (space / height));\n\n if (!isTransposed) {\n if (distribution.length > 0 && colLen === distribution.length) {\n distHeight = (heightWithoutGutter * distribution[rIdx] / distSum);\n } else if (isDistributionEqual || context.height === 0) {\n distHeight = (heightWithoutGutter / colLen);\n }\n }\n return Math.floor(distHeight);\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} beg\n * @param {*} end\n */\nexport const extraCellsRemover = (arr, beg, end) => arr.slice(beg, -end);\n\n/**\n * Creates matrix instancess\n *\n * @param {Array} [arr=[]] mutated arry\n * @param {number} depth depth of the tree\n * @param {Array} matrixInfo Details about the matrix(tree, etc) to be inserted\n * @param {boolean} layout Instance of layout\n */\nexport const createMatrixInstances = (arr = [], depth, matrixInfo, layout) => {\n const breakPointer = layout._breakPointer;\n const config = layout.config();\n const {\n isTransposed\n } = config;\n const {\n tree,\n layoutMatrix\n } = matrixInfo;\n\n if (depth === 0) {\n const brokenMatrix = breakMatrix(tree.matrix, isTransposed, breakPointer);\n arr.push({\n matrix: tree.matrix,\n primaryMatrix: brokenMatrix[0],\n secondaryMatrix: brokenMatrix[1],\n space: tree.space\n });\n return arr;\n }\n const nextLevel = depth - 1;\n tree.values.forEach((e) => {\n createMatrixInstances(arr, nextLevel, {\n tree: e,\n layoutMatrix\n }, layout);\n });\n return arr;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n maxMeasures: {},\n availableSpace: {},\n logicalSpace: {}\n};\n","import { PRIMARY } from '../enums/constants';\n/**\n *\n *\n */\nexport const defaultConfig = {\n distribution: [],\n classPrefix: 'muze',\n isDistributionEqual: true,\n unitMeasures: {\n height: 100,\n width: 100,\n border: 1\n },\n isTransposed: false,\n facet: PRIMARY,\n extraCellLengths: []\n};\n","import { mergeRecursive, generateGetterSetters, ERROR_MSG } from 'muze-utils';\nimport {\n createTree,\n combineMatrices,\n createMatrixInstances\n } from '../utils';\nimport { PROPS } from './props';\nimport { HEIGHT, WIDTH } from '../enums/constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n // Prepare matrices\n this._lastLevelKey = 0;\n this._primaryMatrix = matrix[0] || [];\n this._secondaryMatrix = matrix[1] || [];\n this._maxMeasures = [];\n this._availableSpace = {};\n\n // Store the config\n generateGetterSetters(this, PROPS);\n const defCon = Object.assign({}, this.constructor.defaultConfig());\n this.config(mergeRecursive(defCon, config));\n\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n computeViewableSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getPriorityDistribution () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @param {*} params\n * @returns\n * @memberof VisualMatrix\n */\n primaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._primaryMatrix;\n }\n\n secondaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._secondaryMatrix;\n }\n\n tree (...params) {\n if (params.length) {\n return this;\n }\n return this._tree;\n }\n\n static defaultConfig () {\n return defaultConfig;\n }\n\n createTree () {\n const { tree, lastLevelKey } = createTree(this);\n this._lastLevelKey = lastLevelKey;\n return tree;\n }\n\n /**\n * Returns the space taken by visual matrix\n *\n * @return {Object} space taken by the matrix\n * @memberof VisualMatrix\n */\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n /**\n * Sets the provied space to the visual matrix\n *\n * @param {number} width width provided\n * @param {number} height height provided\n * @memberof VisualMatrix\n */\n setAvailableSpace (width, height) {\n this.availableSpace({ width, height });\n const tree = this.tree();\n const heightMeasures = this.populateMaxMeasures(HEIGHT, tree);\n const widthMeasures = this.populateMaxMeasures(WIDTH, tree);\n const depth = this.calculateDepth(widthMeasures, heightMeasures);\n\n this.viewableMatrix = this.createViewPortMatrix(depth);\n this.viewableMeasures = this.redistributeSpaces(width, height);\n return this;\n }\n\n /**\n * Populate the max measures in the array\n *\n * @param {Array} measures array to be filled with max measures\n * @param {Object} matrixTree matrix tree of visual matrix\n * @param {number} measure width or height\n * @param {number} [depth=0] depth of the tree that to be calculated\n * @memberof VisualMatrix\n */\n populateMaxMeasures (type, matrixTree, depth = 0, measures = []) {\n measures[depth] = Math.max(measures[depth] || 0, matrixTree.space[type]);\n if (matrixTree.values) {\n const childDepth = depth + 1;\n matrixTree.values.forEach((child) => {\n if (child.space) {\n measures = this.populateMaxMeasures(type, child, childDepth, measures);\n }\n });\n }\n return measures;\n }\n\n /**\n * Gets the viewable measures for the current viewable matrix\n *\n * @return {Object} Set of viewable measures\n * @memberof VisualMatrix\n */\n getViewableSpaces () {\n return this.viewableMeasures;\n }\n\n /**\n * Returns the matrix that can be viewed in the current viewport\n *\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n getViewableMatrices () {\n return this.viewableMatrix;\n }\n\n /**\n * Creates the viewport that can be viewed together\n *\n * @param {number} depth maxDepth that can be viewed in the viewport\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n createViewPortMatrix (depth) {\n const arr = [];\n createMatrixInstances(arr, depth, this.removeExtraCells(), this);\n return arr;\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n combineMatrices,\n spaceTakenByColumn,\n getDistributedHeight,\n computeLogicalSpace,\n createMatrixEachLevel\n } from '../utils';\nimport { ROW_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class RowVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = (matrix[0].length > 0 ? matrix[0][0].length : 0);\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n\n // Create Tree\n this._tree = {\n key: ROW_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, false);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height\n } = measures;\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i };\n const { widths, rowHeights, columnWidths } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = [height, height];\n const columnMeasures = widths;\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n tree.matrix = extraCellsRemover(tree.matrix, begCellLen, endCellLen);\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n let remainingAvailWidth;\n let remainingWidth;\n let cWidths = [];\n let conditions = [];\n let maxPrioritySpace = 0;\n const {\n matrix,\n width: availableWidth,\n maxMeasures: maxWidths,\n maxWidth: currentWidth,\n height\n } = measures;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length ? this.primaryMatrix()[0].length : 0;\n\n const dist = [];\n\n remainingAvailWidth = availableWidth;\n remainingWidth = currentWidth;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n // divider = Math.min(2, matrixLen);\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n // divider = Math.min(1, matrixLen);\n }\n conditions.forEach((i) => {\n dist[i] = maxWidths[i];\n maxPrioritySpace += maxWidths[i];\n remainingAvailWidth -= dist[i];\n remainingWidth -= dist[i];\n });\n matrix[0].forEach((e, i) => {\n if (conditions.indexOf(i) === -1) {\n dist[i] = remainingAvailWidth * (maxWidths[i] / remainingWidth);\n }\n });\n matrix.forEach(row => row.forEach((col, cIdx) => {\n if (conditions.indexOf(cIdx) === -1) {\n col.setAvailableSpace(dist[cIdx], height);\n\n cWidths[cIdx] = Math.max(cWidths[cIdx] || 0, Math.floor(col.getLogicalSpace().width));\n } else {\n cWidths[cIdx] = 0;\n }\n }));\n\n const prioritySpace = availableWidth - cWidths.reduce((t, n) => t + n);\n if (prioritySpace < 0) {\n cWidths = cWidths.map(() => 0);\n } else {\n conditions.forEach((i) => {\n cWidths[i] = Math.floor(prioritySpace * (dist[i] / maxPrioritySpace || 1));\n });\n }\n return cWidths;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures, heightMeasures) {\n let i;\n const { height } = this.availableSpace();\n\n for (i = 0; i < heightMeasures.length; i++) {\n if (heightMeasures[i] <= height) break;\n }\n\n return Math.min(widthMeasures.length - 1, i);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n const maxMeasures = this.maxMeasures();\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n const logicalWidths = this.getPriorityDistribution({\n matrix: this._layoutMatrix,\n maxWidth,\n maxMeasures,\n width,\n height\n });\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths, logicalWidths };\n const measures = this.redistributeViewSpaces(options);\n maxWidths = measures.maxWidths;\n maxHeights = measures.maxHeights;\n });\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let cWidths = [];\n let rHeights = [];\n let mHeight = 0;\n const maxMeasures = this.maxMeasures();\n\n const {\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n } = this.config();\n const { matrix, height, maxHeights, maxWidths, logicalWidths } = measures;\n mHeight = spaceTakenByColumn(matrix, this._lastLevelKey).height;\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n measures.maxMeasures = maxMeasures;\n measures.maxWidth = maxWidth;\n if (maxWidth > 0) {\n cWidths = logicalWidths;\n } else {\n cWidths = maxMeasures.map(() => 0);\n }\n rHeights = getDistributedHeight({\n matrix,\n cIdx: this._lastLevelKey,\n height: mHeight,\n availableHeight: height,\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n });\n if (maxWidths.length > 0) {\n cWidths = cWidths.map((e, i) => Math.max(e, maxWidths[0][i] || 0));\n }\n maxWidths.push(cWidths);\n for (let x = 0; x < maxWidths.length; x++) {\n maxWidths[x] = cWidths;\n }\n maxHeights.push(rHeights);\n return { maxWidths, maxHeights };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = maxHeights[matrixIndex][rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth, colHeight - borderWidth);\n\n if (rIdx === 0 && cIdx < breakPointer) {\n columnWidths[0][cIdx] = colWidth;\n widths[0] = (widths[0] || 0) + colWidth;\n } else if (rIdx === 0 && cIdx >= breakPointer) {\n columnWidths[1][cIdx - breakPointer] = colWidth;\n widths[1] = (widths[1] || 0) + colWidth;\n }\n if (cIdx === this._lastLevelKey) {\n rowHeights[0][rIdx] = colHeight;\n rowHeights[1][rIdx] = colHeight;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n getDistributedWidth,\n spaceTakenByRow,\n createMatrixEachLevel,\n computeLogicalSpace\n } from '../utils';\nimport { COLUMN_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class ColumnVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = matrix[0].length;\n\n // Create Tree\n this._tree = {\n key: COLUMN_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, true);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height,\n width\n } = measures;\n\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i, height };\n const {\n heights,\n rowHeights,\n columnWidths\n } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = heights;\n const columnMeasures = [width, width];\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n\n tree.matrix = tree.matrix.map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n const {\n height,\n maxHeights\n } = measures;\n let remainingHeight = height;\n let heightDist = [];\n let conditions = [];\n let divider = 2;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n divider = 2;\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n divider = 1;\n }\n maxHeights.forEach((heights, index) => {\n if (conditions.indexOf(index) === -1) {\n heightDist[index] = heights;\n remainingHeight -= heights;\n }\n });\n if (remainingHeight < 0) {\n heightDist = heightDist.map(() => 0);\n } else {\n conditions.forEach((condition) => {\n heightDist[condition] = Math.min(maxHeights[condition], (remainingHeight) / divider);\n });\n }\n return heightDist;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures) {\n let j;\n const { width } = this.availableSpace();\n\n for (j = 0; j < widthMeasures.length; j++) {\n if (widthMeasures[j] <= width) break;\n }\n return Math.min(widthMeasures.length - 1, j);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths };\n const maxMeasures = this.redistributeViewSpaces(options);\n maxWidths = maxMeasures.maxWidths;\n maxHeights = maxMeasures.maxHeights;\n });\n\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space column wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let rHeights = [];\n const {\n matrix,\n width,\n maxHeights,\n maxWidths\n } = measures;\n const borderWidth = this.config().unitMeasures.border;\n\n const mWidth = spaceTakenByRow(matrix[this._lastLevelKey]).width;\n const cWidths = getDistributedWidth({\n row: matrix[this._lastLevelKey],\n width: mWidth,\n availableWidth: width\n }, this.config());\n\n matrix.forEach((row, rIdx) => row.forEach((col, cIdx) => {\n const oldLogicalSpace = col.getLogicalSpace();\n\n col.setAvailableSpace(cWidths[cIdx] - borderWidth, oldLogicalSpace.height);\n\n rHeights[rIdx] = Math.max(rHeights[rIdx] || 0, Math.floor(col.getLogicalSpace().height));\n }));\n if (maxHeights.length > 0) {\n rHeights = rHeights.map((e, i) => Math.max(e, maxHeights[0][i]));\n }\n maxHeights.push(rHeights);\n for (let x = 0; x < maxHeights.length; x++) {\n maxHeights[x] = rHeights;\n }\n maxWidths.push(cWidths);\n return { maxHeights, maxWidths };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, height, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n const heightDistribution = this.getPriorityDistribution({ height, maxHeights: maxHeights[0] || [] });\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = heightDistribution[rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth - borderWidth, colHeight);\n\n if (cIdx === 0 && rIdx < breakPointer) {\n rowHeights[0][rIdx] = colHeight;\n heights[0] = (heights[0] || 0) + colHeight;\n } else if (cIdx === 0 && rIdx >= breakPointer) {\n rowHeights[1][rIdx - breakPointer] = colHeight;\n heights[1] = (heights[1] || 0) + colHeight;\n }\n if (rIdx === this._lastLevelKey) {\n columnWidths[0][cIdx] = colWidth;\n columnWidths[1][cIdx] = colWidth;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import {\n HEIGHT, WIDTH, COLUMN, ROW, HORIZONTAL, VERTICAL, HOLISTIC,\n MAX_WIDTH_AVAIL_FOR_COL_MATRIX, COLUMN_MATRIX, MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX, ROW_MATRIX, SCROLL\n} from '../enums/constants';\n\n/**\n * Gets measurement for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @return {Object} Logical height/width of the matrix\n */\nexport function getMatrixMeasurement (matrix, type) {\n if (matrix) {\n return matrix.getLogicalSpace()[type];\n }\n return 0;\n}\n\n/**\n * Sets available space for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @param {number} value Value of measurement\n */\nexport function setMatrixMeasurement (matrix, type, value) {\n if (matrix) {\n const spaces = matrix.getLogicalSpace();\n if (value && spaces[type] !== value) {\n type === HEIGHT ? matrix.setAvailableSpace(spaces.width, value) :\n matrix.setAvailableSpace(value, spaces.height);\n }\n }\n}\n\nconst setAvailableSpace = (matrix, widths, heights) => {\n matrix.forEach((row, rIdx) => {\n row.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(widths[cIdx], heights[rIdx]);\n });\n });\n};\n\nconst setViewSpaces = (layout, pointerType, viewSpaces) => {\n let pointer = layout.config()[`${pointerType}Pointer`];\n if (viewSpaces.length - 1 < pointer) {\n pointer = 0;\n layout.config({ [`${pointerType}Pointer`]: pointer });\n }\n return pointer;\n};\n\nconst paginationDetailsMap = {\n column: {\n maxMeasure: MAX_WIDTH_AVAIL_FOR_COL_MATRIX,\n matrix: COLUMN_MATRIX,\n measureType: WIDTH,\n scrollType: HORIZONTAL\n },\n row: {\n maxMeasure: MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX,\n matrix: ROW_MATRIX,\n measureType: HEIGHT,\n scrollType: VERTICAL\n }\n};\n\n/**\n * This method provides the required width/height in the different pagination stages.\n * If the pagination is holistic, then only the max width/height will be provided for layouting\n * If scroll is enabled, then the entire width/height shall be provided for layouting\n * Note: width is required for scrolling the columns while height is required for scrolling rows\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {Object} measureDetails different measure details for row/column\n * @param {number} maxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst getMatrixMeasureForPagination = (layout, measureDetails, maxMeasure, buffer) => {\n const {\n pagination\n } = layout.config();\n const {\n matrix,\n measureType,\n scrollType\n } = measureDetails;\n\n switch (pagination) {\n case HOLISTIC:\n return maxMeasure;\n default: {\n const actualMeasure = getMatrixMeasurement(layout[matrix](), measureType) + buffer;\n\n if (actualMeasure > maxMeasure) {\n layout.scrollInfo({ [scrollType]: true });\n }\n return Math.max(maxMeasure, actualMeasure);\n }\n }\n};\n\n/**\n * This method uses the getMatrixMeasureForPagination function to calculate maximum measure\n * depending on the layouting algorithm used\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {string} matrixType row/column\n * @param {number} relatedMaxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst paginationMeasureGetter = (layout, matrixType, relatedMaxMeasure, buffer) =>\n getMatrixMeasureForPagination(layout, paginationDetailsMap[matrixType], relatedMaxMeasure, buffer);\n\nconst getMatrixWidthDetails = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const {\n width\n } = layout.measurement();\n const {\n border,\n buffer\n } = layout.config();\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get width of row matrix\n const rowMatrixWidth = getMatrixMeasurement(rowMatrix, WIDTH);\n\n // Get maximum width allowed for the row matrix\n const maxRowMatrixWidth = Math.min(rowMatrixWidth + buffer, width / 2);\n\n // Get maximum width available for the column matrix\n const maxWidthAvailableForColumnMatrix = width - maxRowMatrixWidth - borderWidth;\n\n // Set width for column matrix\n const columnMatrixWidth = paginationMeasureGetter(layout, COLUMN, maxWidthAvailableForColumnMatrix, 0);\n\n return {\n rowMatrixWidth,\n maxRowMatrixWidth,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n\nconst getHeightRequiredByColMatrix = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const columnMatrix = layout.columnMatrix();\n\n // Get maximum allowed height for colum matrix\n const maxColumnMatrixHeight = Math.min(columnMatrix.getLogicalSpace().height, height / 2);\n\n // Set the computed width and max height to column matrix to determine the actual height\n // that will be taken by the column matrix\n columnMatrix.setAvailableSpace(columnMatrixWidth, maxColumnMatrixHeight);\n\n // Get the set of pages column view\n const columnViewPages = columnMatrix.getViewableSpaces();\n\n // Figuring out total space needed by current view space\n const columnViewSpace = columnViewPages[layout.config().columnPointer];\n\n // Getting height of column matrix\n const columnMatrixHeight = columnViewSpace.height.primary + columnViewSpace.height.secondary;\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight\n };\n};\n\nconst getMatrixHeightDetails = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const {\n buffer\n } = layout.config();\n\n // Get actual height required by column matrix\n const { columnMatrixHeight, maxColumnMatrixHeight } = getHeightRequiredByColMatrix(layout, columnMatrixWidth);\n\n // Based on column height, compute max height available for row matrix\n const maxHeightAvailableForRowMatrix = height - Math.min(maxColumnMatrixHeight, columnMatrixHeight);\n\n // Get height for row matrix\n const rowMatrixHeight = paginationMeasureGetter(layout, ROW, maxHeightAvailableForRowMatrix, buffer);\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n };\n};\n\nconst setValueMatrixMeasurements = (layout, rowViewableSpaces, columnViewableSpaces) => {\n const centerMatrix = layout.centerMatrix();\n\n const {\n border\n } = layout.config();\n const matrices = layout.matrices();\n const {\n top,\n bottom\n } = matrices;\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get the heights for each cell in the row matrix\n const rowHeights = [].concat(...rowViewableSpaces.map(e => e.rowHeights.primary));\n\n // Get the widths for each of the row matrix cells(primary and secondary)\n const rowWidthsPrimary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.primary));\n const rowWidthsSecondary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.secondary));\n\n // Get the widths for each cell in the column matrix\n const columnWidths = [].concat(...columnViewableSpaces.map(e => e.columnWidths.primary));\n\n // Get the widths for each of the column matrix cells(primary and secondary)\n const columnHeightsPrimary = columnViewableSpaces[0].rowHeights.primary;\n const columnHeightsSecondary = [].concat(...columnViewableSpaces.map(e => e.rowHeights.secondary));\n\n // Setting the available space for each cell in the centre matrix computed throught the row and\n // column matrices\n centerMatrix.forEach((matrix, rIdx) => {\n matrix.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(columnWidths[cIdx] - borderWidth, rowHeights[rIdx] - borderWidth);\n });\n });\n\n // Set the heights and widths for the corner matrices namely:\n // TOP_LEFT\n setAvailableSpace(top[0], rowWidthsPrimary, columnHeightsPrimary);\n // TOP_RIGHT\n setAvailableSpace(top[2], rowWidthsSecondary, columnHeightsPrimary);\n // BOTTOM_LEFT\n setAvailableSpace(bottom[0], rowWidthsPrimary, columnHeightsSecondary);\n // BOTTOM_RIGHT\n setAvailableSpace(bottom[2], rowWidthsSecondary, columnHeightsSecondary);\n};\n\nconst bufferCondition = {\n isScroll: true,\n pagination: SCROLL\n};\n\nconst getBufferFromCondition = (layout, type) => {\n const scrollInfo = layout.scrollInfo();\n const {\n pagination\n } = layout.config();\n\n const currentBufferType = {\n pagination,\n isScroll: scrollInfo[type]\n };\n\n return Object.keys(bufferCondition).every(e => bufferCondition[e] === currentBufferType[e]);\n};\n\nconst getActualBufferFromConfig = (layout) => {\n const {\n buffer\n } = layout.config();\n const [horizontalBuffer, verticalBuffer] = [HORIZONTAL, VERTICAL].map((type) => {\n if (getBufferFromCondition(layout, type)) {\n return buffer;\n }\n return 0;\n });\n\n return {\n horizontalBuffer,\n verticalBuffer\n };\n};\n/**\n * Computes the measurements of space for all matrices in the\n * layout\n *\n * @param {Object} layout Instance of grid layout\n * @return {Object} set of measurements for the layout\n */\nexport const computeLayoutMeasurements = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n\n // Compute the widths of the row and column matrices\n const {\n rowMatrixWidth,\n maxRowMatrixWidth,\n maxWidthAvailableForColumnMatrix,\n columnMatrixWidth\n } = getMatrixWidthDetails(layout);\n\n // Compute the heights of the row and column matrices\n const {\n columnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n } = getMatrixHeightDetails(layout, columnMatrixWidth);\n\n const {\n horizontalBuffer,\n verticalBuffer\n } = getActualBufferFromConfig(layout);\n rowMatrix.setAvailableSpace(maxRowMatrixWidth - verticalBuffer, rowMatrixHeight - horizontalBuffer);\n\n // Get row and columns viewable spaces\n const rowViewableSpaces = rowMatrix.getViewableSpaces();\n const columnViewableSpaces = columnMatrix.getViewableSpaces();\n\n // Set view spaces for row and columns\n setViewSpaces(layout, ROW, rowViewableSpaces);\n setViewSpaces(layout, COLUMN, columnViewableSpaces);\n\n // Set measures for each cell of the value matrix\n setValueMatrixMeasurements(layout, rowViewableSpaces, columnViewableSpaces);\n\n return {\n rowMatrixHeight: rowMatrixHeight - horizontalBuffer,\n rowMatrixWidth: rowMatrixWidth - verticalBuffer,\n maxHeightAvailableForRowMatrix: maxHeightAvailableForRowMatrix - horizontalBuffer,\n\n columnMatrixHeight,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n","/**\n * Gets view matrices based on current pointers for row and column\n *\n * @param {Object} layout instance of layout\n * @param {number} rowPointer current row pointer\n * @param {number} columnPointer current column pointer\n * @return {Object} returns the view matrix and its relevant information\n */\nexport const getViewMatrices = (layout, rowPointer, columnPointer) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const centerMatrix = layout.centerMatrix();\n const matrices = layout.matrices();\n const rowMatrices = rowMatrix.getViewableMatrices();\n const columnMatrices = columnMatrix.getViewableMatrices();\n const centralMatrixPointer = {\n row: 0,\n column: 0\n };\n\n for (let i = rowPointer - 1; i >= 0; i--) {\n const length = Math.max(rowMatrices[i].primaryMatrix.length,\n rowMatrices[i].secondaryMatrix.length);\n centralMatrixPointer.row += length;\n }\n /* istanbul ignore next */\n for (let i = columnPointer - 1; i >= 0; i--) {\n const matrix = columnMatrices[i];\n const { primaryMatrix, secondaryMatrix } = matrix;\n const length = Math.max(primaryMatrix[0] ? primaryMatrix[0].length : 0,\n secondaryMatrix[0] ? secondaryMatrix[0].length : 0);\n centralMatrixPointer.column += length;\n }\n\n matrices.top[1] = columnMatrices[columnPointer].primaryMatrix;\n matrices.bottom[1] = columnMatrices[columnPointer].secondaryMatrix;\n\n matrices.center[0] = rowMatrices[rowPointer].primaryMatrix;\n matrices.center[2] = rowMatrices[rowPointer].secondaryMatrix;\n\n const rowMatrixLen = Math.max(matrices.center[0].length, matrices.center[2].length);\n /* istanbul ignore next */\n const columnMatrixLen = Math.max(matrices.top[1][0] ? matrices.top[1][0].length : 0, matrices.bottom[1][0] ?\n matrices.bottom[1][0].length : 0);\n matrices.center[1] = centerMatrix.slice(centralMatrixPointer.row, centralMatrixPointer.row + rowMatrixLen)\n .map(matrix => matrix.slice(centralMatrixPointer.column, centralMatrixPointer.column + columnMatrixLen));\n\n return {\n matrices,\n rowPages: rowMatrices.length,\n columnPages: columnMatrices.length\n };\n};\n\nconst measureSum = measureArr => measureArr.reduce((total, measure) => total + measure, 0);\n/**\n * Returns measurements of the cells of the current matrix\n *\n * @param {Object} layout instance of layout\n * @return {Object} returns the measurements for current view matrix\n */\nexport const getViewMeasurements = (layout, maxRowHeight, maxColWidth) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const {\n columnPointer,\n rowPointer\n } = layout.config();\n\n const rowSpaces = rowMatrix.getViewableSpaces()[rowPointer];\n const colSpaces = columnMatrix.getViewableSpaces()[columnPointer];\n\n const {\n rowHeights,\n width: rowMatrixWidth\n } = rowSpaces;\n const {\n columnWidths,\n height: columnMatrixHeight\n } = colSpaces;\n\n const { primary: leftWidth, secondary: rightWidth } = rowMatrixWidth;\n const { primary: topHeight, secondary: bottomHeight } = columnMatrixHeight;\n\n const centerHeight = measureSum(rowHeights.primary);\n const centerWidth = measureSum(columnWidths.primary);\n const viewWidth = [leftWidth, Math.min(centerWidth, maxColWidth), rightWidth];\n const viewHeight = [topHeight, Math.min(centerHeight, maxRowHeight), bottomHeight];\n\n return {\n viewWidth,\n viewHeight,\n actualCenterMeasures: {\n height: centerHeight,\n width: centerWidth\n },\n totalMeasures: {\n width: measureSum(viewWidth),\n height: measureSum(viewHeight)\n },\n unitHeights: rowHeights,\n unitWidths: columnWidths\n };\n};\n","/**\n * This file declares a table that can be extended to create a Datagrid, crosstab\n * and man other visualzations that require a tabular structure.\n */\n\nimport { getUniqueId, mergeRecursive } from 'muze-utils';\nimport GenericLayout from '../generic-layout';\nimport { DEFAULT_CONFIGURATION, DEFAULT_MEASUREMENTS } from './defaults';\nimport { generateVisualMatrices } from './layout-helper';\nimport { computeLayoutMeasurements } from './computations';\nimport { getViewMeasurements, getViewMatrices } from './view-info-getter';\n/**\n * This class is used to create a tabular structure that\n * can house charts and values.\n *\n * @class GridLayout\n */\nexport default class GridLayout extends GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} matrices Set of upto 9 matrices containing the cells to be rendered\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config external configurations.\n * @memberof GenericLayout\n */\n constructor (matrices, mountPoint, measurement, config) {\n super(mountPoint, measurement, config);\n this.matrices(matrices);\n this.config(this.constructor.defaultConfig());\n this._layoutId = getUniqueId();\n this._scrollInfo = { horizontal: false, vertical: false };\n }\n\n static defaultViewInfo () {\n return Object.assign({}, {\n layoutDimensions: {\n border: this.defaultConfig().border,\n viewHeight: [0, 0, 0],\n viewWidth: [0, 0, 0]\n },\n viewMatricesInfo: {\n columnPages: 0,\n rowPages: 0,\n matrices: { top: [], center: [], bottom: [] }\n }\n });\n }\n\n /**\n * Returns initial set of measurements for the grid layout\n *\n * @static\n * @return {Object} Returns initial set of measurements\n * @memberof GridLayout\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENTS;\n }\n\n /**\n * Returns initialconfiguration for grid layout\n *\n * @static\n * @return {Object} Returns initial configuration for grid layout\n * @memberof GridLayout\n */\n static defaultConfig () {\n return DEFAULT_CONFIGURATION;\n }\n\n /**\n * This function is used to return an instance of GridLayout\n *\n * @return {GridLayout} Instance of grid layout.\n * @static\n * @memberof GridLayout\n */\n static create () {\n return new GridLayout(null, null, this.defaultMeasurement(), this.defaultConfig());\n }\n\n /**\n * Sets/Gets the matrices for the layout\n *\n * @param {Array} matrices Set of matrices\n * @return {Object} Getter/Setter\n * @memberof GridLayout\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = generateVisualMatrices(this, matrices);\n return this;\n }\n return super.matrices(matrices);\n }\n\n /**\n * Triggers the computations for the layout based on the matrices available\n * This causes a reflow in the entire layout system.\n *\n * @return {Object} Layout instance\n * @memberof GridLayout\n */\n triggerReflow () {\n this.scrollInfo({ horizontal: false, vertical: false });\n const {\n maxHeightAvailableForRowMatrix,\n maxWidthAvailableForColumnMatrix\n } = computeLayoutMeasurements(this);\n\n this.setViewInformation(maxHeightAvailableForRowMatrix, maxWidthAvailableForColumnMatrix);\n return this;\n }\n\n gotoPage (type, pageNumber) {\n const pageType = type.toLowerCase();\n const { viewMatricesInfo } = this.viewInfo();\n const totalPages = viewMatricesInfo[`${pageType}Pages`];\n const pointer = Math.min(Math.max(1, pageNumber), totalPages);\n this.config({\n [`${pageType}Pointer`]: pointer - 1\n });\n this.setViewInformation();\n this.renderGrid();\n return this;\n }\n\n pages (type) {\n const { viewMatricesInfo } = this.viewInfo();\n const pageType = type.toLowerCase();\n return {\n totalPages: viewMatricesInfo[`${pageType}Pages`],\n currentPage: this.config()[`${pageType}Pointer`] + 1\n };\n }\n\n viewInfo (...viewInfo) {\n if (viewInfo.length) {\n this._viewInfo = viewInfo[0];\n return this;\n }\n return this._viewInfo;\n }\n\n scrollInfo (...scrollInfo) {\n if (scrollInfo.length) {\n this._scrollInfo = mergeRecursive(this._scrollInfo, scrollInfo[0]);\n return this;\n }\n return this._scrollInfo;\n }\n\n /**\n *\n *\n * @returns\n * @memberof GridLayout\n */\n setViewInformation (maxRowHeight, maxColWidth) {\n const {\n rowPointer,\n columnPointer,\n border\n } = this.config();\n const viewMatricesInfo = getViewMatrices(this, rowPointer, columnPointer);\n const layoutDimensions = getViewMeasurements(this, maxRowHeight, maxColWidth);\n layoutDimensions.border = border;\n this.viewInfo({\n viewMatricesInfo,\n layoutDimensions\n });\n return this;\n }\n}\n","import RowMatrix from '../visual-matrix/row-matrix';\nimport ColumnMatrix from '../visual-matrix/column-matrix';\n\nexport const generateVisualMatrices = (context, matrices) => {\n // Set of matrices for layout is generated starting with the left matrix\n let leftMatrix = [];\n let rightMatrix = [];\n let topMatrix = [];\n let bottomMatrix = [];\n let begColCells;\n let endColCells;\n const {\n isRowSizeEqual,\n isColumnSizeEqual,\n gutterSpace,\n distribution,\n border,\n breakPage,\n priority\n } = context.config();\n const {\n minUnitHeight,\n minUnitWidth\n } = context.measurement();\n const { top, center, bottom } = matrices;\n const [topLeft, topColumns, topRight] = top;\n const [leftRows, valueMatrix, rightRows] = center;\n const [bottomLeft, bottomColumns, bottomRight] = bottom;\n\n if (leftRows.length > 0) {\n // If no left matrix is present, context will be empty\n leftMatrix = [...topLeft, ...leftRows, ...bottomLeft];\n }\n if (rightRows.length > 0) {\n // If no right matrix is present, context will be empty\n rightMatrix = [...topRight, ...rightRows, ...bottomRight];\n }\n if (topColumns.length > 0 && topColumns[0].length > 0) {\n // If no top matrix is present, context will be empty\n topMatrix = topColumns.map((d, i) => [...topLeft[i], ...d, ...topRight[i]]);\n }\n if (bottomColumns.length > 0 && bottomColumns[0].length > 0) {\n // If no bottom matrix is present, context will be empty\n bottomMatrix = bottomColumns.map((d, i) => [...bottomLeft[i], ...d, ...bottomRight[i]]);\n }\n\n context.rowMatrix(new RowMatrix([leftMatrix, rightMatrix], {\n isDistributionEqual: isRowSizeEqual,\n distribution: distribution.rows,\n gutter: gutterSpace.rows,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.row,\n breakPage: breakPage.rows.map(e => e + Math.max(topLeft.length, topRight.length)),\n extraCellLengths: [topLeft.length, bottomLeft.length]\n }));\n\n if (topLeft.length > 0) {\n begColCells = topLeft[0].length;\n } else {\n begColCells = bottomLeft.length > 0 ? bottomLeft[0].length : 0;\n }\n\n if (topRight.length > 0) {\n endColCells = topRight[0].length;\n } else {\n endColCells = bottomRight.length > 0 ? bottomRight[0].length : 0;\n }\n\n context.columnMatrix(new ColumnMatrix([topMatrix, bottomMatrix], {\n isDistributionEqual: isColumnSizeEqual,\n distribution: distribution.columns,\n gutter: gutterSpace.columns,\n isTransposed: true,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.col,\n breakPage: breakPage.columns,\n extraCellLengths: [begColCells, endColCells]\n }));\n context.centerMatrix(valueMatrix);\n\n return matrices;\n};\n","import {\n TOP, BOTTOM, LEFT, RIGHT, CENTER, BLANK_BORDERS, COLUMN, ROW,\n VIEW_INDEX, ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, MIDDLE, NO_BORDERS\n} from '../enums/constants';\n\nconst borderMap = (isFacet, showHeaders) => ({\n [`${TOP}-${LEFT}`]: isFacet && showHeaders ? LEFT : NO_BORDERS,\n [`${TOP}-${MIDDLE}`]: COLUMN,\n [`${TOP}-${RIGHT}`]: isFacet && showHeaders ? RIGHT : NO_BORDERS,\n [`${CENTER}-${LEFT}`]: isFacet ? `${CENTER}${LEFT}` : ROW,\n [`${CENTER}-${MIDDLE}`]: CENTER,\n [`${CENTER}-${RIGHT}`]: isFacet ? `${CENTER}${RIGHT}` : ROW,\n [`${BOTTOM}-${LEFT}`]: NO_BORDERS,\n [`${BOTTOM}-${MIDDLE}`]: COLUMN,\n [`${BOTTOM}-${RIGHT}`]: NO_BORDERS\n});\n\nconst applySpecificBorder = (params) => {\n const { type, borderWidth, borderStyle, cells, isFacet, color } = params;\n if (!isFacet) {\n cells.style(`border-${type}`, `${borderWidth}px ${borderStyle} ${color}`);\n } else {\n cells.style(`border-${type}-width`, `${borderWidth}px`);\n cells.style(`border-${type}-style`, `${borderStyle}`);\n }\n};\n\nconst specificBorderApplier = (params) => {\n const { borderTypes, showBorders, cells, borderInfo, name, isFacet } = params;\n const {\n color,\n style,\n width\n } = borderInfo;\n borderTypes.forEach((borderType) => {\n applySpecificBorder({\n cells,\n color: showBorders[borderType] ? color : BLANK_BORDERS,\n type: borderType,\n borderWidth: width,\n borderStyle: style,\n name,\n isFacet\n });\n });\n};\n\nconst borderApplier = (cells, borderInfo, name, isFacet) => {\n const {\n showRowBorders,\n showColBorders,\n showValueBorders\n } = borderInfo;\n return {\n [ROW]: () => specificBorderApplier({\n borderTypes: [TOP, BOTTOM],\n showBorders: showRowBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [COLUMN]: () => specificBorderApplier({\n borderTypes: [LEFT, RIGHT],\n showBorders: showColBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [CENTER]: () => specificBorderApplier({\n borderTypes: [LEFT, RIGHT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [LEFT]: () => specificBorderApplier({\n borderTypes: [LEFT],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [RIGHT]: () => specificBorderApplier({\n borderTypes: [RIGHT],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [`${CENTER}${LEFT}`]: () => specificBorderApplier({\n borderTypes: [LEFT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [`${CENTER}${RIGHT}`]: () => specificBorderApplier({\n borderTypes: [RIGHT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n })\n };\n};\n\nexport const applyBorders = (params) => {\n const { cells, border, row, column, isFacet, showHeaders } = params;\n const name = `${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`;\n const borderApplierFn = borderApplier(cells, border, name, isFacet);\n const borderMapVal = borderMap(isFacet, showHeaders)[name];\n if (borderMapVal) {\n borderApplierFn[borderMapVal]();\n }\n};\n","import { selectElement } from 'muze-utils';\nimport {\n TOP, BOTTOM, ROW_SPAN, COL_SPAN, CENTER, ROW, COLUMN\n} from '../enums/constants';\n\nconst orderMaker = arr => Array.from(Array(arr.length).keys());\n\nconst nestByStack = (stack, updateArr, optionalParams = {}) => {\n let {\n order,\n keyFn\n } = optionalParams;\n const arr = updateArr.slice();\n const currStack = stack.slice();\n const prevStack = currStack.slice();\n // Order in which element are to be checked for nesting, default normal looping\n // Order is always in the order of nest, i.e., left to right\n order = order || Array.from(Array(arr.length).keys());\n\n // Key function, if array of objects\n keyFn = keyFn || (v => v);\n\n // Return same array if stack is empty\n if (currStack.length === 0) {\n const newArr = [];\n order.forEach((e) => {\n newArr.push(arr[e]);\n });\n return { prevStack, currStack: arr, arr: newArr };\n }\n\n let arrVal = '';\n let stackVal = '';\n const newArr = [];\n\n // Loop in order\n for (let i = order.length - 1; i >= 0; i--) {\n // Get current element index from the order given\n const currElemIndex = order[i];\n\n // Crete a hashmap for the hierarchy by joining strings of the array for both stack and input array\n arrVal += keyFn(arr[currElemIndex]);\n stackVal += keyFn(currStack[currElemIndex]);\n\n // If the current value and value in stack is same, convert it to null\n if (arrVal === stackVal) {\n newArr[currElemIndex] = null;\n } else {\n stackVal = '';\n // Loop from the current index in order to the last element in order to change the\n // whole hierarchy\n for (let j = i; j < order.length; j++) {\n const newElem = order[j];\n const arrElem = arr[newElem];\n\n newArr[newElem] = arrElem;\n\n // Reset stack to new stack\n currStack[newElem] = arrElem;\n stackVal = arrVal;\n }\n }\n }\n const returnArr = [];\n order.forEach((e) => {\n returnArr.push(newArr[e]);\n });\n return { prevStack, currStack, arr: returnArr };\n};\n\nconst spanCalculator = (colData, colIdx, matrix, rIdx) => {\n // if data is not header cell then rowspan\n // has to be 1\n if (!colData) {\n return () => null;\n }\n\n const conditions = {\n row: count => matrix[rIdx + count] && matrix[rIdx + count][colIdx],\n column: count => matrix[rIdx][colIdx + count]\n };\n\n return (type) => {\n let count = 1;\n let isNull = false;\n\n while (!isNull) {\n if (conditions[type](count) === null) {\n count += 1;\n } else {\n isNull = true;\n }\n }\n return count;\n };\n};\n\nconst maskCreator = (matrix, order) => ({\n row: () => {\n let stack = [];\n return matrix.map((e) => {\n const {\n currStack,\n arr\n } = nestByStack(stack, e, { keyFn: val => val.valueOf(), order });\n\n stack = currStack;\n return arr;\n });\n },\n column: () => {\n let stack = [];\n const viewMatrix = [];\n matrix.length && matrix[0].forEach((cell, colIndex) => {\n const hierarchy = [];\n matrix.forEach((row) => {\n hierarchy.push(row[colIndex]);\n });\n const {\n currStack,\n arr\n } = nestByStack(stack, hierarchy, { keyFn: val => val.valueOf(), order });\n stack = currStack;\n\n matrix.forEach((row, rowIndex) => {\n viewMatrix[rowIndex] = viewMatrix[rowIndex] || [];\n viewMatrix[rowIndex][colIndex] = arr[rowIndex];\n });\n });\n return viewMatrix;\n }\n});\n\nconst spanGenerator = viewMatrix => ({\n row: () => {\n const spans = [];\n viewMatrix.forEach((row, ridx) => {\n spans[ridx] = spans[ridx] || [];\n row.forEach((col, i) => {\n if (viewMatrix[ridx][i]) {\n const currSpan = spanCalculator(col, i, viewMatrix, ridx)('row');\n currSpan && spans[ridx].push(currSpan);\n }\n });\n });\n return spans;\n },\n column: () => viewMatrix.map((row, ridx) => row.map((col, i) => spanCalculator(col, i, viewMatrix, ridx)('column'))\n .filter(col => col !== null))\n});\n\nconst getOrder = () => ({\n row: matrix => orderMaker(matrix[0]),\n column: matrix => orderMaker(matrix)\n});\n\nconst matrixSpanGeneratorMap = {\n [`${TOP}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${BOTTOM}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${CENTER}-0`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n },\n [`${CENTER}-2`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n }\n};\n\nconst matrixSpanGenerator = (type) => {\n const generator = matrixSpanGeneratorMap[type];\n if (generator) {\n return generator;\n }\n return {\n orderGetter: () => null,\n viewMatrixMaker: matrix => () => matrix,\n spanMaker: () => () => null\n };\n};\n\n/**\n * This function is used to set the col and row spans\n * for the matrices based on repeated/hierarchichal data\n *\n * @export\n * @param {Array} matrix The 2d array for which filtering is to be done\n * @param {string} type Type of array (center, top, bottom)\n * @param {number} index Index of array in the row\n * @return {Object} containing the view matrix and their spans\n */\nexport function cellSpanMaker (matrix, type, index) {\n let spans = null;\n let viewMatrix = matrix;\n const {\n orderGetter,\n viewMatrixMaker,\n spanMaker\n } = matrixSpanGenerator(`${type}-${index}`);\n\n if (matrix.length) {\n const order = orderGetter(matrix);\n viewMatrix = viewMatrixMaker(matrix, order)();\n spans = spanMaker(viewMatrix)();\n }\n return { viewMatrix, spans };\n}\n\nconst spaceAllocationDueToSpan = (span = 1, placeholder, config, index) => {\n const height = placeholder.availHeight();\n const width = placeholder.availWidth();\n const borderWidth = config.border.width;\n const { unitWidths } = config.dimensions;\n const { col } = index;\n\n return {\n [ROW_SPAN] () {\n placeholder.setAvailableSpace(width, height * span);\n if (span === 1) {\n selectElement(this).style('height', `${height * span + borderWidth}px`);\n }\n },\n [COL_SPAN] () {\n const primaryUnitWidth = unitWidths.primary[col];\n if (span > 1) {\n let cumulativeWidth = 0;\n for (let i = col; i < col + span; i++) {\n cumulativeWidth += unitWidths.primary[i] - borderWidth;\n }\n placeholder.setAvailableSpace(cumulativeWidth + borderWidth, height);\n } else if (primaryUnitWidth) {\n placeholder.setAvailableSpace(primaryUnitWidth - borderWidth, height);\n }\n selectElement(this).style('height', `${height}px`);\n }\n };\n};\n\nconst spanApplier = (cells, spans, config, type) => {\n let cellCounter = 0;\n cells.attr(type, function (cell, colIndex) {\n if (colIndex === 0) {\n cellCounter = 0;\n }\n const span = spans[cell.rowIndex][colIndex];\n const placeholder = cell.placeholder;\n const index = {\n row: cell.rowIndex,\n col: cellCounter\n };\n\n spaceAllocationDueToSpan(span, placeholder, config, index)[type].bind(this)();\n cellCounter += span;\n return span;\n });\n};\n\nconst spanApplierMap = {\n [`${TOP}-0`]: null,\n [`${TOP}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${TOP}-2`]: null,\n [`${CENTER}-0`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${CENTER}-1`]: null,\n [`${CENTER}-2`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${BOTTOM}-0`]: null,\n [`${BOTTOM}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${BOTTOM}-2`]: null\n};\n\nexport const applySpans = (cells, spans, config, type) => {\n const applier = spanApplierMap[type];\n if (applier) {\n applier(cells, spans, config);\n }\n};\n","import { ERROR_MSG } from 'muze-utils';\n/**\n * An Interface to be implemented if the transaction support is necessary. This class ensures reactivity to\n * global properties.\n */\nexport default class TransactionSupport {\n /**\n * Property accessor for data member of the class. Data is passed to the system by calling this method.\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for width of the class. Width is passed as an integer.\n */\n width () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for height of the class. Height is passed as an integer.\n */\n height () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for config of the class. Config is passed as an object.\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n}\n","import { TOP, BOTTOM, LEFT, TITLE, SUB_TITLE, GROUP, LAYOUT, LEGEND } from '../constants';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const arrangeComponents = (context) => {\n const legendConfig = context.config().legend;\n const titleConfig = context.title()[1];\n const subtitleConfig = context.subtitle()[1];\n const titleLayouts = {\n [`${TOP}-${TOP}`]: [TITLE, SUB_TITLE, GROUP],\n [`${BOTTOM}-${BOTTOM}`]: [GROUP, SUB_TITLE, TITLE],\n [`${TOP}-${BOTTOM}`]: [TITLE, GROUP, SUB_TITLE],\n [`${BOTTOM}-${TOP}`]: [SUB_TITLE, GROUP, TITLE]\n };\n const legendLayouts = [\n [LEGEND, LAYOUT],\n [LAYOUT, LEGEND]\n ];\n const titlePosition = titleConfig.position || TOP;\n const subtitlePosition = subtitleConfig.position || TOP;\n\n return {\n headers: titleLayouts[`${titlePosition}-${subtitlePosition}`],\n legends: legendConfig.position === LEFT || legendConfig.position === TOP ?\n legendLayouts[0] : legendLayouts[1]\n };\n};\n","/**\n * Flag to specify whether direction is vertical.\n */\nexport const MARGIN = 'margin';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const SPACE_FIXER = 'spaceFixer';\nexport const CLASSPREFIX = 'muze';\nexport const VERTICAL_ALIGN = 'verticalAlign';\nexport const TEXT_ALIGN = 'textAlign';\nexport const IS_OFFSET = 'isOffset';\nexport const MIDDLE = 'middle';\nexport const BASELINE = 'baseline';\nexport const SHOW = 'show';\nexport const CENTER = 'center';\nexport const TEXT = 'text';\nexport const HEADER = 'header';\nexport const HEIGHT = 'height';\nexport const WIDTH = 'width';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const FIELDS = 'fields';\nexport const TRANSFORM = 'transform';\nexport const LAYER_DEF = 'layerDef';\nexport const CONFIG = 'config';\nexport const DETAIL_FIELDS = 'detailFields';\nexport const MAX_LINES = 'maxLines';\nexport const MIN_CHARS = 'minCharacters';\nexport const ROTATION = 'rotation';\n\nexport const TEXT_CELL = 'text-cell';\nexport const AXIS_CELL = 'axis-cell';\nexport const GEOM_CELL = 'geom-cell';\nexport const BLANK_CELL = 'blank-cell';\n\nexport const PADDING = 'padding';\nexport const HEADER_PADDING = 'headerPadding';\nexport const TITLE_PADDING = 'titlePadding';\n\nexport const TITLE = 'title';\nexport const SUBTITLE = 'subtitle';\n","// eneum to refer to simple cell\nexport const SIMPLE = 'simple';\n// eneum to refer to header cell\nexport const TEXT = 'text';\n// enum to refer to axis cell\nexport const AXIS = 'axis';\n// enum to refer to visual cell\nexport const GEOM = 'geom';\n// enum to refer blank cell\nexport const BLANK = 'blank';\n","import {\n ERROR_MSG,\n getUniqueId,\n mergeRecursive\n} from 'muze-utils';\nimport { SIMPLE } from './enums/cell-type';\nimport { SIMPLE_CELL } from './constants';\n\n/**\n * This file declares a class that is used as an interface to create new\n * SimpleCell elements.\n * @module SimpleCell\n */\n/**\n * Base class for all table cells.\n *\n * @interface\n * @class SimpleCell\n */\nclass SimpleCell {\n\n /**\n * Creates an instance of SimpleCell.\n *\n * @param {*} config The input configuration.\n * @memberof SimpleCell\n */\n constructor (config) {\n this._id = getUniqueId();\n\n const defConfig = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConfig, config || {});\n\n this._mount = null;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n */\n get type () {\n return SIMPLE;\n }\n\n static formalName () {\n return SIMPLE_CELL;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n * @return {Object} Default config for the placeholder\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the value contained by the SimpleCell.\n *\n * @memberof SimpleCell\n */\n valueOf () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a unique identifier for the instance used\n * to control selective rendering.\n *\n * @memberof SimpleCell\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized representation of the instance.\n *\n * @memberof SimpleCell\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns an object with width and height fields\n * specifying the space taken up by this metod.\n *\n * @memberof SimpleCell\n */\n getLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Method used to set the space available to render the SimpleCell\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @memberof SimpleCell\n */\n setAvailableSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n remove () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getMinMeasures (providedMinMeasure = 0) {\n return providedMinMeasure;\n }\n\n}\n\nexport default SimpleCell;\n","export const SIMPLE_CELL = 'SimpleCell';\nexport const TEXT_CELL = 'TextCell';\nexport const AXIS_CELL = 'AxisCell';\nexport const BLANK_CELL = 'BlankCell';\nexport const GEOM_CELL = 'GeomCell';\n\n","/**\n * This file exports variables that are used as defaults for\n * the placeholders\n */\nimport * as CONSTANTS from './constants';\n\n /**\n * Default Configuration for the cells\n * @return {Object} Default configuration\n */\nexport const DEFAULT_CONFIG = {\n [CONSTANTS.MARGIN]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.SPACE_FIXER]: 2,\n [CONSTANTS.IS_OFFSET]: false,\n [CONSTANTS.VERTICAL_ALIGN]: null,\n [CONSTANTS.TEXT_ALIGN]: CONSTANTS.CENTER,\n [CONSTANTS.SHOW]: true,\n [CONSTANTS.MAX_LINES]: 0,\n [CONSTANTS.MIN_CHARS]: 0,\n [CONSTANTS.ROTATION]: null,\n [CONSTANTS.PADDING]: {\n [CONSTANTS.LEFT]: 8,\n [CONSTANTS.RIGHT]: 8,\n [CONSTANTS.TOP]: 10,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.HEADER_PADDING]: {\n [CONSTANTS.LEFT]: 8,\n [CONSTANTS.RIGHT]: 5,\n [CONSTANTS.TOP]: 2,\n [CONSTANTS.BOTTOM]: 5\n },\n [CONSTANTS.TITLE_PADDING]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n }\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { GEOM, TEXT, AXIS, BLANK } from './enums/cell-type';\n\nconst DEFAULT_PROPS = {\n mount: {},\n availHeight: {},\n availWidth: {},\n config: {\n sanitization: (context, value) => mergeRecursive(context._config, value)\n },\n logicalSpace: {},\n minSpacing: {},\n source: {}\n};\n\nconst geomProps = {\n data: {},\n caption: {},\n config: {},\n axes: {},\n facetByFields: {},\n fields: {},\n transform: {},\n layerDef: {},\n detailFields: {}\n};\n\nconst textProps = {\n smartText: {}\n};\nexport const PROPS = {\n [GEOM]: mergeRecursive(geomProps, DEFAULT_PROPS),\n [TEXT]: mergeRecursive(textProps, DEFAULT_PROPS),\n [AXIS]: DEFAULT_PROPS,\n [BLANK]: DEFAULT_PROPS\n};\n","/**\n * This file declares a class that represents a table cell\n * used to house an axis.\n * @module VisualCell\n */\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport { CLASSPREFIX, HEIGHT, WIDTH, AXIS_CELL, BOTTOM, TOP } from './enums/constants';\nimport SimpleCell from './simple-cell';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { AXIS } from './enums/cell-type';\nimport { PROPS } from './props';\nimport * as CONSTANTS from './constants';\n\n/**\n * Computes the logical space of the an axis instance within an axis cell\n *\n * @param {Object} context Required to get the needed parameters to compute axis space\n * @return {Object} Returns the logical space for axis\n */\nconst computeAxisSpace = (context) => {\n let logicalWidth;\n let logicalHeight;\n const axis = context.source();\n const {\n spaceFixer,\n margin\n } = context.config();\n const {\n width,\n height\n } = axis.getLogicalSpace();\n const {\n show\n } = axis.config();\n if (show === true) {\n logicalHeight = Math.floor(height + margin.top + margin.bottom + spaceFixer);\n logicalWidth = Math.floor(width + margin.left + margin.right + spaceFixer);\n } else {\n [logicalWidth, logicalHeight] = [width, height];\n }\n return {\n width: logicalWidth,\n height: logicalHeight\n };\n};\n\n/**\n * Represents an axis cell.\n *\n * @class Axis\n */\nclass AxisCell extends SimpleCell {\n\n /**\n * Creates an instance of AxisCell.\n *\n * @param {Object} config The input config.\n * @memberof AxisCell\n */\n constructor (config) {\n super(config);\n\n this._axis = null;\n this._availHeight = null;\n this._availWidth = null;\n this._logicalSpace = null;\n\n generateGetterSetters(this, PROPS[AXIS]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof AxisCell\n */\n get type () {\n return AXIS;\n }\n\n /**\n * This method return the value conatined by this SimpleCell.\n *\n * @return {SimpleAxis | ColorAxis} Instance of SimpleAxis or ColorAxis.\n * @memberof AxisCell\n */\n valueOf () {\n return this.source().id;\n }\n\n /**\n * This method return the unique identififer of the axis\n *\n * @return {string} Id of the axis.\n * @memberof AxisCell\n */\n get id () {\n return this._id;\n }\n\n static formalName () {\n return CONSTANTS.AXIS_CELL;\n }\n\n /**\n * Retrns the serialized representation of this cell.\n *\n * @return {Object}Object with serializable props.\n * @memberof AxisCell\n */\n serialize () {\n return {\n type: AXIS,\n axis: this.source().serialize()\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof AxisCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * return the space taken up by an axis element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof AxisCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeAxisSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @return {Instance} Returns current Instance\n * @memberof AxisCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n const {\n margin,\n isOffset\n } = this.config();\n\n if (width || height) {\n this.source().setAvailableSpace(width, height, margin, isOffset);\n this.source().logicalSpace(null);\n } else {\n this.source().resetLogicalSpace();\n }\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the axis inside the axis cell.\n *\n * @param {HTMLElement} mount The mount point.\n * @return {Selection} node where axis mounted\n * @memberof AxisCell\n */\n /* istanbul ignore next */render (mount) {\n if (!mount) {\n return this;\n }\n let actualWidth = 0;\n let actualHeight = 0;\n const axis = this.source();\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const {\n margin\n } = this.config();\n const {\n top,\n bottom,\n left,\n right\n } = margin;\n const {\n show,\n orientation\n } = axis.config();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [this], `${CLASSPREFIX}-${AXIS_CELL}`);\n const selection = makeElement(wrapperDiv, 'svg', [1], `${CLASSPREFIX}-axis-container`);\n selection.classed(`${CLASSPREFIX}-axis-container-${orientation}`, true);\n\n this.mount(mount);\n if (!availWidth) {\n selection.attr(WIDTH, `${0}px`);\n }\n if (!availHeight) {\n selection.attr(HEIGHT, `${0}px`);\n }\n actualWidth = availWidth;\n actualHeight = availHeight;\n if (!show) {\n actualWidth = (orientation === TOP || orientation === BOTTOM) ? availWidth : 0;\n actualHeight = (orientation === TOP || orientation === BOTTOM) ? 0 : availHeight;\n }\n wrapperDiv.style(WIDTH, `${actualWidth}px`)\n .style(HEIGHT, `${actualHeight}px`)\n .style('margin-top', top)\n .style('margin-bottom', bottom)\n .style('margin-left', left)\n .style('margin-right', right);\n\n axis.mount(selection.node());\n return selection;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Current instance of AxisCell\n * @memberof AxisCell\n */\n remove () {\n this.source() && this.source().remove();\n this.mount() && this.mount().remove();\n return this;\n }\n}\n\nexport default AxisCell;\n\n","/**\n * This file declares a class that represents a BLANK element in a table.\n * @module VisualCell\n */\nimport {\n selectElement,\n makeElement,\n applyStyle,\n generateGetterSetters\n } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { CLASSPREFIX, BLANK_CELL } from './enums/constants';\nimport { BLANK } from './enums/cell-type';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { PROPS } from './props';\nimport * as CONSTANTS from './constants';\n\n/**\n * Represents a table haeder.\n *\n * @class BLANK\n */\nclass BlankCell extends SimpleCell {\n\n /**\n * Creates an instance of BLANK.\n * @param {Object} config The input configuration.\n * @memberof BLANK\n */\n constructor (config) {\n super(config);\n\n generateGetterSetters(this, PROPS[BLANK]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof BlankCell\n */\n get type () {\n return BLANK;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof BlankCell\n */\n valueOf () {\n return this.id;\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof BlankCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method is used to return a unique identifier for\n * the BLANK cell.\n *\n * @return {string} The unique identifier for the BLANK.\n * @memberof BlankCell\n */\n get id () {\n return this._id;\n }\n\n static formalName () {\n return CONSTANTS.BLANK_CELL;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof BLANK\n */\n serialize () {\n return {\n type: BLANK\n };\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof BLANK\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n return {\n width: this.width || 0,\n height: this.height || 0\n };\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the BLANK cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof BLANK\n */\n /* istanbul ignore next */render (mount) {\n if (mount) {\n const { style } = this.config();\n // append span element to mount point\n this.mount(mount);\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id]);\n elem.classed(`${CLASSPREFIX}-${BLANK_CELL}`, true);\n elem.style('width', `${this.availWidth()}px`);\n elem.style('height', `${this.availHeight()}px`);\n elem.html('');\n // apply style on the returned element\n if (style) {\n applyStyle(elem, style);\n }\n } return this;\n }\n\n /**\n * Removes the cell(Disposal)\n *\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n\n getMinMeasures () {\n return 0;\n }\n }\nexport default BlankCell;\n","import {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n HEADER,\n TITLE,\n SUBTITLE\n} from './enums/constants';\n\nexport const setSmartText = (context) => {\n const source = context.source();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n rotation\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const labelManager = context.dependencies().labelManager;\n\n labelManager.setStyle(context._computedStyle);\n\n !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false));\n rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true));\n\n return context;\n};\n\nexport const isTitleSubtitle = (subType) => {\n let returnVal = false;\n if (subType === `${TITLE}` || subType === `${SUBTITLE}`) {\n returnVal = true;\n }\n return returnVal;\n};\n\n/**\n* Computes the Logical Space for the text\n*\n* @param {Object} context Required to get the needed parameters to compute text space\n* @return {Object} Logical space taken up by text\n* @memberof TextCell\n*/\nexport const computeTextSpace = (context) => {\n const { labelManager } = context.dependencies();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n show,\n maxLines,\n minCharacters\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const source = context.source();\n const space = context.smartText();\n const minText = new Array(minCharacters).fill('W').join('');\n const _minTextSpace = labelManager.getOriSize(minText);\n\n context.config({ rotation: false });\n if (space.width > (availWidth || 0) && maxLines) {\n space.height = space.oriTextHeight * maxLines;\n }\n if (availWidth && availWidth < space.width) {\n space.width = _minTextSpace.width;\n }\n if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) {\n const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true);\n const { height: smHeight, width: smWidth } = smartSpace;\n space.width = smWidth;\n space.height = smHeight;\n context.config({ rotation: true });\n context.smartText(smartSpace);\n }\n\n const { subType, headerPadding } = context.config();\n if (!isTitleSubtitle(subType)) {\n space.width += headerPadding[LEFT] + headerPadding[RIGHT];\n }\n\n if (show) {\n return {\n width: Math.ceil(space.width) + paddedWidth,\n height: Math.ceil(space.height) + paddedHeight\n };\n } return {\n width: 0,\n height: 0\n };\n};\n\nexport const setPadding = (measures) => {\n const { elem, className, headerPadding, padding, type, titlePadding } = measures;\n let localPadding;\n if (isTitleSubtitle(className)) {\n localPadding = titlePadding;\n } else if (type === HEADER) {\n localPadding = headerPadding;\n } else {\n localPadding = padding;\n }\n [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => {\n elem.style(`padding-${position}`, `${localPadding[position]}px`);\n });\n return elem;\n};\n","/**\n * This file declares a class that represents a Text element in a table.\n * @module VisualCell\n */\n\nimport {\n selectElement,\n makeElement,\n getSmartComputedStyle,\n generateGetterSetters\n} from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { TEXT } from './enums/cell-type';\nimport { PROPS } from './props';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { CLASSPREFIX, TOP, BOTTOM, LEFT, RIGHT, HEADER, WIDTH, TEXT_CELL } from './enums/constants';\nimport './text-cell.scss';\nimport * as CONSTANTS from './constants';\nimport {\n setSmartText,\n computeTextSpace,\n setPadding\n} from './text-cell-helper';\n\n/**\n * Represents a table haeder.\n *\n * @class Text\n */\nclass TextCell extends SimpleCell {\n\n /**\n * Creates an instance of Text.\n * @param {Object} config The input configuration.\n * @param {string} dependencies Dependencies for the class(labelManager)\n * @memberof Text\n */\n constructor (config, dependencies) {\n super(config);\n\n this._dependencies = dependencies;\n this._className = this._config.className ||\n (this._config.type === HEADER ? `${CLASSPREFIX}-${HEADER}-cell` : `${CLASSPREFIX}-${TEXT}-cell`);\n this._computedStyle = getSmartComputedStyle(selectElement('body'), this._className);\n this._dependencies.labelManager.setStyle(this._computedStyle);\n generateGetterSetters(this, PROPS[TEXT]);\n const space = this._dependencies.labelManager.getOriSize('w');\n this.minSpacing({ width: Math.floor(space.width * 3 / 4), height: Math.floor(space.height / 2) });\n setSmartText(this);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof TextCell\n */\n get type () {\n return TEXT;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof TextCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return a unique identifier for\n * the Text cell.\n *\n * @return {string} The unique identifier for the Text.\n * @memberof TextCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Returns the dependencies of the instance\n *\n * @return {Object} Dependencies needed by the class\n * @memberof TextCell\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof TextCell\n */\n serialize () {\n return {\n text: this.source(),\n type: TEXT\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof TextCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n static formalName () {\n return CONSTANTS.TEXT_CELL;\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof Text\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeTextSpace(this));\n }\n const space = computeTextSpace(this);\n this.logicalSpace(space);\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n setSmartText(this);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the Text cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof Text\n */\n render (mount) {\n const availWidth = this.availWidth();\n const availHeight = this.availHeight();\n const {\n margin,\n show,\n verticalAlign,\n textAlign,\n rotation,\n padding,\n type,\n headerPadding,\n className,\n titlePadding\n } = this.config();\n\n this.mount(mount);\n if (show) {\n const container = selectElement(mount);\n let elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`);\n const vAlign = verticalAlign || rotation ? 'middle' : 'top';\n const {\n width,\n height\n } = this.smartText();\n const {\n height: minHeightSpace\n } = this.minSpacing();\n const translation = {\n top: width + minHeightSpace / 2,\n middle: width / 2 + minHeightSpace,\n bottom: minHeightSpace\n };\n\n container.style('vertical-align', vAlign);\n\n // Set class name\n elem.classed(this._className, true);\n\n // Apply styles\n elem.style('display', 'inline');\n elem.style('transform', rotation ? `translate(${height / 2}px,\n ${translation[vAlign]}px) rotate(-90deg)` : '');\n elem.style(WIDTH, availWidth ? `${availWidth}px` : '100%');\n\n [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => {\n container.style(`margin-${position}`, `${margin[position]}px`);\n });\n\n elem = setPadding({ elem, className, headerPadding, padding, type, titlePadding });\n if (this._className === 'muze-grid-headers') {\n elem.style('text-align', textAlign);\n }\n elem.style('display', 'inline');\n // set the text as the innerHTML\n this._dependencies.labelManager.setStyle(this._computedStyle);\n elem.html(this._dependencies.labelManager.getSmartText(this.source(), availWidth, availHeight, true).text);\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n }\n\nexport default TextCell;\n","/**\n * This file declares a class that is used to represent a table cell\n * that houses a visual unit.\n * @module VisualCell\n */\n\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { GEOM } from './enums/cell-type';\nimport { PROPS } from './props';\nimport {\n CLASSPREFIX, HEIGHT, WIDTH, DATA, AXES, FACET_BY_FIELDS, FIELDS, TRANSFORM, LAYER_DEF, CONFIG, GEOM_CELL,\n DETAIL_FIELDS\n} from './enums/constants';\nimport * as CONSTANTS from './constants';\nimport { DEFAULT_CONFIG } from './enums/defaults';\n\n/**\n * Calculates the logical space of the cell\n *\n * @param {Object} context Required to get the needed parameters to compute unit space\n * @return {Object} Logical space taken up by the unit\n * @memberof GeomCell\n */\nconst computeGeomSpace = (context) => {\n const config = context.source().config();\n const { width, height } = config;\n return {\n width: Math.ceil(width),\n height: Math.ceil(height + context.getCaptionSpace().height)\n };\n};\n\n /**\n * This class represents a SimpleCell for visual unit.\n *\n * @class GeomCell\n */\nclass GeomCell extends SimpleCell {\n\n /**\n * Creates an instance of GeomCell.\n * @param {Object} config The input configuration.\n * @memberof GeomCell\n */\n constructor (config) {\n super(config);\n\n this._unit = null;\n this._layers = null;\n this._axes = {};\n this._datamodel = {};\n this._facetByFields = {};\n this._fields = null;\n this._transform = null;\n this._caption = null;\n\n generateGetterSetters(this, PROPS[GEOM]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof GeomCell\n */\n get type () {\n return GEOM;\n }\n\n /**\n * This method return the value contained by this cell.\n *\n * @return {VisualUnit} Instance of visual unit contained by visual unit.\n * @memberof GeomCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return the id of the\n * visual unit housed by this cell.\n *\n * @return {string} The unique id of the visual unit.\n * @memberof GeomCell\n */\n get id () {\n return this.source().id();\n }\n\n static formalName () {\n return CONSTANTS.GEOM_CELL;\n }\n\n /**\n * This method return a serialized representation of\n * this instance.\n *\n * @return {Object} Object with serializable props.\n * @memberof GeomCell\n */\n serialize () {\n return {\n type: GEOM,\n unit: this.source().serialize(),\n caption: this.caption()\n };\n }\n\n /**\n * return the default configuration for the geom cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof GeomCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * Updates the model based on the changed parameters\n *\n * @return {Instance} return instance\n * @memberof GeomCell\n */\n updateModel () {\n const unit = this.source();\n unit.clearCaching();\n [LAYER_DEF, TRANSFORM, AXES, FIELDS, CONFIG, DATA, AXES, FACET_BY_FIELDS, DETAIL_FIELDS].forEach((prop) => {\n this[prop]() && unit[prop](this[prop]());\n });\n return this;\n }\n\n /**\n * It gives the space taken by the caption of the unit\n *\n * @return {Object} return the space taken by caption\n * @memberof GeomCell\n */\n getCaptionSpace () {\n const caption = this.caption();\n\n let captionSpace = { width: 0, height: 0 };\n if (caption) {\n captionSpace = caption.getLogicalSpace();\n }\n return captionSpace;\n }\n\n /**\n * return the space taken up by the element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof GeomCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeGeomSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space available to\n * render the SimpleCell.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n setAvailableSpace (width, height) {\n const unit = this.source();\n\n this.availWidth(width);\n this.availHeight(height);\n unit.lockModel()\n .width(width).height(height - this.getCaptionSpace().height)\n .unlockModel();\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * his method is used to render the visual unit inside the provided cell.\n *\n * @param {HTMLElement} mount The mountpoint in the table.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n render (mount) {\n if (mount) {\n this.mount(mount);\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const caption = this.caption();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [1], `${CLASSPREFIX}-${GEOM_CELL}`);\n\n if (caption) {\n const captionDom = makeElement(wrapperDiv, 'div', [caption], `${CLASSPREFIX}-unit-caption`).node();\n caption.render(captionDom);\n }\n const selection = makeElement(wrapperDiv, 'div', [1], `${CLASSPREFIX}-unit`);\n wrapperDiv.style(WIDTH, `${availWidth}px`).style(HEIGHT, `${availHeight}px`);\n selection.style(WIDTH, `${availWidth}px`)\n .style(HEIGHT, `${availHeight - this.getCaptionSpace().height}px`);\n this.source().mount(selection.node());\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Object} Current instance\n * @memberof GeomCell\n */\n remove () {\n this.mount() && this.mount().remove();\n this.source().remove();\n return this;\n }\n}\n\nexport default GeomCell;\n","import AxisCell from './axis-cell';\nimport BlankCell from './blank-cell';\nimport TextCell from './text-cell';\nimport GeomCell from './geom-cell';\nimport SimpleCell from './simple-cell';\n\nimport * as CONSTANTS from './constants';\n\nexport const DEFAULT_PLACEHOLDERS = {\n [CONSTANTS.SIMPLE_CELL]: SimpleCell,\n [CONSTANTS.TEXT_CELL]: TextCell,\n [CONSTANTS.AXIS_CELL]: AxisCell,\n [CONSTANTS.GEOM_CELL]: GeomCell,\n [CONSTANTS.BLANK_CELL]: BlankCell\n};\n","import { DEFAULT_PLACEHOLDERS } from './defaults';\n\n/**\n * Creates a registry for the cells, which can be used for\n * setting a new cell or getting the registered cells\n *\n * @return {Object} Setters and getters for registered cells\n */\nconst cellRegistry = () => {\n const reg = DEFAULT_PLACEHOLDERS;\n return {\n register: (def) => {\n const key = def.formalName();\n if (key in reg) {\n reg[key] = def;\n }\n return cellRegistry;\n },\n get: () => reg\n };\n};\nexport default cellRegistry;\n","import { TextCell } from '@chartshq/visual-cell';\nimport { escapeHTML } from 'muze-utils';\nimport { TOP } from '../constants';\n\n/**\n *\n *\n * @param {*} rawContent\n *\n */\nconst resolveTitleSubTitleContent = (rawContent) => {\n if (typeof rawContent === 'function' && !rawContent._sanitize) {\n return rawContent();\n }\n return escapeHTML(rawContent());\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} cellType\n * @param {*} labelManager\n * @param {*} prevCell\n *\n */\nconst headerCreator = (config, cellType, labelManager, prevCell) => {\n let margin = {};\n const {\n content,\n classPrefix,\n maxLines\n } = config;\n const cell = prevCell || new TextCell(\n {\n type: cellType === 'title' ? 'header' : 'text',\n className: `${classPrefix}-${cellType}-cell`,\n subType: cellType\n }, {\n labelManager\n })\n .config({ maxLines }).minSpacing({ width: 0, height: 0 });\n\n cell.source(content);\n cell._minTickDiff = { height: 0, width: 0 };\n\n if (config.position === TOP) {\n margin = { top: 0, bottom: config.padding };\n } else {\n margin = { top: config.padding, bottom: 0 };\n }\n cell.config({ margin });\n\n return {\n height: cell.getLogicalSpace().height,\n cell\n };\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} type\n * @param {*} labelManager\n * @param {*} cell\n *\n */\nconst createHeading = (config, type, labelManager, prevCell) => {\n if (!config) { return ''; }\n\n return headerCreator(\n config,\n type,\n labelManager,\n prevCell\n );\n};\n\n/**\n *\n *\n * @param {*} context\n */\nexport const createHeaders = (context, canvasHeight, canvasWidth) => {\n let headerHeight = 0;\n const headers = {};\n const subtitle = context.subtitle();\n const isSubtitle = resolveTitleSubTitleContent(subtitle[0]);\n\n canvasHeight >= 200 && canvasWidth >= 200 && ['title', 'subtitle'].forEach((type) => {\n const headerOptions = context[type]();\n const content = resolveTitleSubTitleContent(headerOptions[0]);\n if (content) {\n const config = headerOptions[1];\n\n config.width = context.width();\n config.height = context.height();\n config.classPrefix = context.config().classPrefix;\n config.content = content;\n config.padding = (type === 'title' && !isSubtitle.length) ? subtitle[1].padding : config.padding;\n\n const { height, cell } = createHeading(config, type, context.dependencies().smartlabel,\n context[`${type}Cell`]);\n\n headers[`${type}Cell`] = cell;\n context._composition[type] = cell;\n headerHeight += height;\n }\n });\n return { headerHeight, headers };\n};\n\n","import { TextCell, AxisCell } from '@chartshq/visual-cell';\nimport { getValueParser, retrieveFieldDisplayName, DataModel, getObjProp } from 'muze-utils';\nimport {\n VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING,\n BORDER, MARGIN, SIZE, COLOR, IS_POINT_MAP, POINT\n} from '../constants';\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n *\n */\nexport const legendCreator = (canvas) => {\n let LegendCls;\n const dataset = [];\n const axes = canvas.getRetinalAxes();\n\n Object.entries(axes).forEach((axisInfo) => {\n const scale = axisInfo[1][0];\n const scaleType = axisInfo[0];\n const scaleProps = canvas[scaleType]();\n\n if (scaleProps.field && scale) {\n const {\n type,\n step\n } = scale.config();\n\n const stepMapper = typeof step === 'boolean' ? step : false;\n LegendCls = LEGEND_TYPE_MAP[`${type}-${stepMapper}-${scaleType}`];\n dataset.push({\n scale,\n canvas,\n fieldName: scaleProps.field,\n title: retrieveFieldDisplayName(canvas.data(), scaleProps.field),\n LegendCls,\n scaleType\n });\n }\n });\n\n return dataset;\n};\n\n/**\n * @param {*} mark mark of the layers in the canvas\n * @param {*} scaleType type of the scale to draw the legend ie shape, size or color\n *\n */\nexport const legendIconShapeMapper = (layers, scaleType) => {\n const layerMarks = layers.map(el => el.mark);\n const shape = IS_POINT_MAP[(scaleType === COLOR || scaleType === SIZE)\n && layerMarks.includes(POINT)];\n return shape;\n};\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n * @param {*} measurement\n * @param {*} prevLegends\n *\n */\nexport const legendInitializer = (legendConfig, canvas, measurement, prevLegends) => {\n const legends = [];\n const {\n height,\n width,\n headerHeight\n } = measurement;\n const {\n position,\n align\n } = legendConfig;\n\n const legendInfo = legendCreator(canvas);\n const { invalidValues } = canvas.config();\n const interactionRegistry = canvas.registry().interactions;\n const parser = getValueParser(invalidValues);\n\n legendInfo.forEach((dataInfo, index) => {\n const legendMeasures = {};\n const {\n LegendCls,\n scale,\n fieldName,\n title: titleText,\n scaleType\n } = dataInfo;\n const config = legendConfig[scaleType] || {};\n const title = config.title || {};\n title.text = title.text || titleText;\n if (config.show) {\n config.position = position;\n config.align = align;\n let legend = getObjProp(prevLegends[scaleType], index);\n if (!legend) {\n legend = LegendCls.create({\n labelManager: canvas._dependencies.smartlabel,\n cells: {\n AxisCell, TextCell\n },\n registry: {\n interactions: interactionRegistry\n }\n });\n }\n legendMeasures.maxHeight = align === VERTICAL ? (height - headerHeight) : height * 0.2;\n legendMeasures.maxWidth = align === HORIZONTAL ? width : width * 0.2;\n legendMeasures.width = Math.min(legendMeasures.maxWidth, config.width);\n legendMeasures.height = Math.min(legendMeasures.maxHeight, config.height);\n\n [PADDING, BORDER, MARGIN].forEach((e) => {\n legendMeasures[e] = config[e];\n });\n const metaData = legend.metaData();\n if (metaData instanceof DataModel) {\n metaData.dispose();\n }\n\n const mark = canvas.composition().visualGroup.resolver().matrixLayers()[0][0];\n config.shape = legendIconShapeMapper(mark, scaleType);\n\n legend.scale(scale)\n .valueParser(parser)\n .title(title)\n .fieldName(fieldName)\n .config(config)\n .metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName]))\n .measurement(legendMeasures)\n .canvasAlias(canvas.alias())\n .setLegendMeasures();\n\n legends.push({ canvas, legend, scaleType });\n }\n });\n return legends;\n};\n\n/**\n *\n *\n * @param {*} legends\n * @param {*} legendConfig\n * @param {*} availableHeight\n * @param {*} availableWidth\n *\n */\nexport const getLegendSpace = (legends, legendConfig, availableHeight, availableWidth) => {\n const legendMeasures = legends.map(legendInfo => legendInfo.legend.measurement());\n const legendSpace = { width: 0, height: 0 };\n\n legendMeasures.forEach((space) => {\n let height = 0;\n let width = 0;\n width = Math.min(space.width, space.maxWidth);\n height = Math.min(space.height, space.maxHeight);\n\n if (legendConfig.align === HORIZONTAL) {\n if (legendSpace.width + width > availableWidth) {\n legendSpace.width = availableWidth;\n legendSpace.height += height;\n } else {\n legendSpace.width += width;\n legendSpace.height = Math.max(legendSpace.height, height);\n }\n } else if (legendSpace.height + height > availableHeight) {\n legendSpace.height = height;\n legendSpace.width += width;\n } else {\n legendSpace.height += height;\n legendSpace.width = Math.max(legendSpace.width, width);\n }\n });\n if (legendConfig.align === HORIZONTAL) {\n legendSpace.width = availableWidth;\n }\n return legendSpace;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} headerHeight\n *\n */\nexport const createLegend = (context, headerHeight, height, width) => {\n const measurement = {\n height,\n width,\n headerHeight\n };\n const { legend } = context.config();\n const { show, position } = legend;\n\n legend.classPrefix = context.config().classPrefix;\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n\n legend.show = show ? ((align === VERTICAL && width > 200) || (align === HORIZONTAL && height > 200)) : show;\n legend.align = align;\n return legendInitializer(legend, context, measurement, context.composition().legend || {});\n};\n","import { LayoutComponent } from '../../../../layout/src/tree-layout';\n\nexport default class MuzeComponent extends LayoutComponent {\n getLogicalSpace () {\n const { width, height } = this.boundBox();\n return { width, height };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n }\n\n getBoundBox () {\n return this.boundBox();\n }\n\n updateWrapper () {\n throw Error('Update is not implemented');\n }\n\n setParams () {\n throw Error('set params is not implemented');\n }\n\n setComponentInfo () {\n throw Error('setComponentInfo is not implemented');\n }\n}\n","import { selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { LEFT } from '../../constants';\n\nexport default class HeaderComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n renderHeader (container) {\n const layoutConfig = this.params.config;\n container = selectElement(container);\n const { align } = layoutConfig;\n const sel = container\n .selectAll(`.${layoutConfig.classPrefix}-inner-container`)\n .data([this.name]);\n sel.exit().remove();\n const selEnter = sel.enter().append('div');\n\n const cont = selEnter.merge(sel);\n cont.classed(`${layoutConfig.classPrefix}-inner-container`, true);\n const { height, width } = this.boundBox();\n this.component.setAvailableSpace(width, height);\n\n this.component && this.component.render(cont.node());\n\n cont.selectAll('div').classed(`${layoutConfig.classPrefix}-inner-content`, true);\n cont.style('width', `${100}%`);\n\n if (layoutConfig && this.component) {\n cont.style('float', LEFT)\n .style('text-align', align);\n // .style(`padding-${position === TOP ? BOTTOM : TOP}`, `${padding}px`);\n }\n }\n\n draw (container) {\n this.renderHeader(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.setParams(params);\n this.name(params.name);\n this.boundBox(params.component.getLogicalSpace());\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y,\n left: conf.x,\n width: conf.width,\n height: conf.height });\n this.renderAt(conf.renderAt);\n }\n}\n","import { makeElement, selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport {\n LEFT, RIGHT, VERTICAL, HORIZONTAL, TOP, BOTTOM, HORIZONTAL_CENTER, VERTICAL_CENTER\n} from '../../constants';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\n\nfunction defaultAlignmentHelper (position) {\n let alignment = null;\n const alignWith = `${ROW_MATRIX_INDEX[1]}-${COLUMN_MATRIX_INDEX[1]}`;\n switch (position) {\n case TOP:\n case BOTTOM:\n alignment = HORIZONTAL_CENTER;\n break;\n case LEFT:\n case RIGHT:\n alignment = VERTICAL_CENTER;\n break;\n default:\n alignment = VERTICAL_CENTER;\n }\n return { alignment, alignWith };\n}\nexport default class LegendComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.measurement.legendSpace, 0);\n this.setParams(params);\n }\n\n renderLegend (container) {\n container = selectElement(container);\n const sectionComponents = [];\n const { position, classPrefix } = this.params.config;\n const legendMount = makeElement(container, 'div', [this.components],\n `${classPrefix}-inner-content`, {}, d => d);\n legendMount.classed(`${classPrefix}-legend`, true);\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n const legWidth = this.newDimensions.width;\n const legHeight = this.newDimensions.height;\n\n [container, legendMount].forEach((elem) => {\n elem.style('width', `${Math.floor(legWidth)}px`)\n .style('height', `${legHeight}px`)\n .style('float', LEFT);\n });\n\n if (align === VERTICAL) {\n let sections = -1;\n let currHeight = legHeight;\n let currWidth = 0;\n\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n if (leg.measurement().height > currHeight) {\n sections++;\n currWidth = 0;\n currHeight = legHeight;\n } else {\n sections < 0 && sections++;\n }\n sectionComponents[sections] = sectionComponents[sections] || [];\n currHeight -= Math.min(leg.measurement().height, currHeight);\n currWidth = Math.max(Math.min(leg.measurement().width, leg.measurement().maxWidth), currWidth);\n sectionComponents[sections].push({\n legend: leg,\n legendHeight: legHeight,\n legendWidth: currWidth\n });\n });\n\n const mount = makeElement(legendMount, ['div'], sectionComponents, `${classPrefix}-legend-section`);\n // mount.each((d, i) => selectElement(this).classed(`${classPrefix}-legend-section-${i}`, true));\n mount.classed(`${classPrefix}-legend-vertical-section`, true)\n .style('width', d => `${d[0].legendWidth}px`);\n makeElement(mount, ['div'], d => d, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) {\n d.legend.mount(this);\n })\n .style('width', d => `${d.legendWidth}px`);\n } else {\n const mount = makeElement(legendMount, 'div', [1], `${classPrefix}-legend-section`);\n mount.classed(`${classPrefix}-legend-horizontal-section`, true);\n mount.classed(`${classPrefix}-legend-section-${0}`, true)\n .style('width', `${legWidth}px`);\n\n makeElement(mount, 'div', this.components, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .style('width', d => `${d.legend.measurement().width}px`)\n .each(function (d) { d.legend.mount(this); });\n }\n }\n\n draw (container) {\n this.renderLegend(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.measurement.legendSpace);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.components = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n const { alignWith, alignment } = defaultAlignmentHelper(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith || alignWith);\n this.alignment(params.config.alignment || alignment);\n }\n\n setComponentInfo (params) {\n const { rootNode } = params;\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n leg.setParentInfo({ canvasRoot: rootNode });\n });\n }\n\n}\n","import {\n selectElement,\n makeElement,\n getD3Drag,\n getEvent,\n getWindow,\n hasTouch\n} from 'muze-utils';\nimport './scroll-bar.scss';\nimport { WIDTH, HEIGHT } from '../../../constants';\n\nconst d3Drag = getD3Drag();\n\nconst arrowSizeMap = {\n left: WIDTH,\n right: WIDTH,\n top: HEIGHT,\n bottom: HEIGHT\n};\n\nexport const getUnitPositions = (unitMeasures, totalLength, viewLength) => {\n let currentLen = 0;\n const measures = unitMeasures.primary && unitMeasures.primary.length ?\n unitMeasures.primary : unitMeasures.secondary;\n\n return measures.map((e) => {\n const unitPosition = currentLen * 100 / (totalLength - viewLength);\n currentLen += e;\n return unitPosition;\n });\n};\n\nexport const createScrollBarArrow = (mount, type, config) => {\n const {\n classPrefix,\n thickness\n } = config;\n const arrow = makeElement(mount, 'div', [type], `${classPrefix}-scroll-arrow-${type}`);\n\n arrow.classed(`${classPrefix}-scroll-arrow`, true);\n arrow.style(arrowSizeMap[type], `${thickness}px`);\n\n const chevron = makeElement(arrow, 'div', [1], `${classPrefix}-scroll-arrow-chevron`);\n\n chevron.attr('id', `${classPrefix}-scroll-arrow-chevron-${type}`);\n\n return arrow;\n};\n\nexport const createScrollBarRect = (mount, config) => {\n const {\n classPrefix\n } = config;\n const rect = makeElement(mount, 'div', [1], `${classPrefix}-scroll-rect`);\n const mover = makeElement(rect, 'div', [1], `${classPrefix}-scroll-mover`);\n\n return { rect, mover };\n};\n\nexport const applyRectClick = (scrollMaker, moverRect) => {\n const {\n rect\n } = moverRect;\n\n rect.on('click', () => {\n const event = getEvent();\n scrollMaker.emptyScrollAreaClick(event);\n });\n};\n\nconst applyMoverDrag = (scrollMaker, moverRect) => {\n let startPos = {};\n let moverStartPos = 0;\n let rectStartPos = 0;\n let endPos = {};\n const {\n mover,\n rect\n } = moverRect;\n\n mover.call(d3Drag()\n .on('start', () => {\n const event = getEvent();\n\n moverStartPos = mover.node().getBoundingClientRect();\n rectStartPos = rect.node().getBoundingClientRect();\n startPos = {\n x: event.x,\n y: event.y\n };\n })\n .on('drag', () => {\n const event = getEvent();\n const window = getWindow();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n const distanceMoved = {\n x: endPos.x - startPos.x,\n y: endPos.y - startPos.y\n };\n const actualPosition = {\n x: moverStartPos.x + distanceMoved.x - rectStartPos.x + window.pageXOffset,\n y: moverStartPos.y + distanceMoved.y - rectStartPos.y + window.pageYOffset\n };\n\n scrollMaker.changeMoverPosition(actualPosition);\n }));\n};\n\nconst applyScrollMouseDownAction = (moverRect, scrollMaker, speed) => {\n const {\n mover,\n rect\n } = moverRect;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n scrollMaker.changeMoverPosition({ x: x - rectX + speed, y: y - rectY + speed });\n};\n\nconst registerListenerOnArrow = (scrollMaker, moverRect, arrowType, speed) => {\n let timer = '';\n const arrow = scrollMaker._components[arrowType];\n const isTouchDevice = hasTouch();\n\n arrow.on(isTouchDevice ? 'touchstart' : 'mousedown', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n timer = setInterval(() => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n }, 100);\n }).on(isTouchDevice ? 'touchend' : 'mouseup', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n clearInterval(timer);\n }).on('click', () => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n });\n};\n\nexport const registerListeners = (scrollMaker) => {\n const {\n moverRect\n } = scrollMaker._components;\n\n const speed = scrollMaker.config().speed;\n\n registerListenerOnArrow(scrollMaker, moverRect, 'prevArrow', -speed);\n applyMoverDrag(scrollMaker, moverRect);\n applyRectClick(scrollMaker, moverRect);\n registerListenerOnArrow(scrollMaker, moverRect, 'nextArrow', speed);\n};\n\nexport const scrollContainerHelper = (mountPoint, config, dimensions, type) => {\n const {\n classPrefix\n } = config;\n const scrollBarContainer = makeElement(selectElement(mountPoint), 'div', [1], `#${classPrefix}-scroll-bar-${type}`);\n\n scrollBarContainer.classed(`${classPrefix}-scroll-bar`, true);\n scrollBarContainer.style(WIDTH, `${dimensions.width}px`);\n scrollBarContainer.style(HEIGHT, `${dimensions.height}px`);\n return scrollBarContainer;\n};\n\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n\n config: {\n sanitization: (context, value) => {\n value = mergeRecursive(context._config, value);\n return value;\n }\n },\n manager: {},\n unitPositions: {},\n logicalSpace: {}\n};\n\n","import { ERROR_MSG, generateGetterSetters } from 'muze-utils';\nimport {\n scrollContainerHelper,\n registerListeners\n} from './helper';\nimport { PROPS } from './props';\n\nexport class ScrollMaker {\n\n constructor () {\n this._components = {};\n this._logicalSpace = {};\n this._attachedScrollAction = () => {};\n this._config = {\n thickness: 10,\n speed: 2\n };\n this._unitPositions = null;\n\n generateGetterSetters(this, PROPS);\n }\n\n static type () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n emptyScrollAreaClick () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n changeMoverPosition () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollDeltaTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n createScroll (mountPoint) {\n const config = this.config();\n\n return {\n scrollBarContainer: scrollContainerHelper(mountPoint, config, this.logicalSpace(), this.constructor.type())\n };\n }\n\n attachScrollAction (externalScrollAction) {\n this._attachedScrollAction = externalScrollAction;\n return this;\n }\n\n detachScrollAction () {\n this._attachedScrollAction = () => {};\n return this;\n }\n\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n registerListeners () {\n registerListeners(this);\n return this;\n }\n\n remove () {\n this._components.scrollBarContainer.remove();\n return this;\n }\n}\n\n","import MuzeComponent from './muze-chart-component';\nimport { HorizontalScrollMaker } from './scroll-bar-maker/horizontal-scroll-maker';\nimport { VerticalScrollMaker } from './scroll-bar-maker/vertical-scroll-maker';\n\nconst scrollMakerMap = {\n horizontal: HorizontalScrollMaker,\n vertical: VerticalScrollMaker\n};\n\n/**\n * Scroll Component acts as a wrapper over the scoll bars created using the respective Scroll Makers\n * This provides a consistent API for layouting using the tree layout system.\n *\n *\n * @class\n * @public\n * @module ScrollComponent\n */\nexport default class ScrollComponent extends MuzeComponent {\n\n constructor (params) {\n const ScrollMaker = scrollMakerMap[params.config.type];\n\n params.component = new ScrollMaker();\n params.component.config(params.config.scrollBarComponentConfig);\n params.component.logicalSpace(params.dimensions);\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n manager (...manager) {\n if (manager.length) {\n this.component.manager(manager[0]);\n return this;\n }\n return this.component.manager();\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollDeltaTo (delta) {\n this.component.scrollDeltaTo(delta);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollTo (scrollPercentage) {\n this.component.scrollTo(scrollPercentage);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page based on the unit index.\n * The input is provided as a number represting the index for the unit.\n * For vertical scroll, it's the row index that will be required.\n * For horizontal scroll, it's the column index that will be required\n *\n * @public\n *\n * @param {number} unitIndex Index of the unit appearing in the grid\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollToUnitIndex (unitIndex) {\n const unitPositions = this.component.unitPositions();\n const sanitizedUnitIndex = Math.min(Math.max(0, unitIndex), unitPositions.length - 1);\n this.component.scrollTo(unitPositions[sanitizedUnitIndex]);\n return this;\n }\n\n /**\n * Provides the positions of the units(either horizontal or vertical based on the type\n * of scroll bar it wraps) relative to it's container. The position of the first unit starts at 0\n *\n *\n * @public\n *\n * @return {Array} Positions of units either horizontal or vertical\n */\n getScrollPositionsForUnits () {\n return this.component.unitPositions();\n }\n\n draw (container) {\n this.component.createScroll(container || document.getElementById(this.renderAt()));\n return this;\n }\n\n /**\n * Can be used to attach a scroll action whenever scrolling occurs in the canvas\n *\n * @public\n * @param {number} externalAction Action to be attached during scroll\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n attachScrollAction (externalAction) {\n this.component.attachScrollAction(externalAction);\n return this;\n }\n\n /**\n * Can be used to detach the scroll action already bound to the scroll bar\n *\n * @public\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n detachScrollAction () {\n this.component.detachScrollAction();\n return this;\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.component.config(params.config.scrollBarComponentConfig);\n this.component.logicalSpace(params.dimensions);\n this.boundBox(this.component.getLogicalSpace());\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component || this.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n remove () {\n this.component.remove();\n }\n}\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { HORIZONTAL, HEIGHT, WIDTH, LEFT } from '../../../constants';\n\nexport class HorizontalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: horizontal\n */\n static type () {\n return HORIZONTAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, config, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'left', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'right', config);\n const {\n mover,\n rect\n } = moverRect;\n\n const { height, width, totalLength, viewLength, unitWidths } = this.logicalSpace();\n const scrollBarWithouArrowLength = width - height * 2;\n\n rect.style(WIDTH, `${dimensions.width - height * 2}px`);\n rect.style(HEIGHT, `${100}%`);\n mover.style(WIDTH, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(HEIGHT, `${100}%`);\n mover.style(LEFT, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n this.unitPositions(getUnitPositions(unitWidths, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n let positionAdjuster = speed * 10;\n if (event.x < x) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n const {\n totalLength\n } = this.logicalSpace();\n\n if (newPosition.x < 0) {\n currentPos = 0;\n } else if (newPosition.x + moverPos.width > rectStartPos.width) {\n currentPos = rectStartPos.width - moverPos.width;\n } else {\n currentPos = newPosition.x;\n }\n\n mover.style(LEFT, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: 0, x: moverPos.x - rectStartPos.x - delta });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {HorizontalScrollMaker} Instance of the HorizontalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.width)) / 100;\n\n this.changeMoverPosition({ y: 0, x: movement });\n return this;\n }\n\n}\n\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { VERTICAL, TOP, HEIGHT, WIDTH } from '../../../constants';\n\nexport class VerticalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: vertical\n */\n static type () {\n return VERTICAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'top', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'bottom', config);\n const {\n mover,\n rect\n } = moverRect;\n const { height, width, totalLength, viewLength, unitHeights } = this.logicalSpace();\n const scrollBarWithouArrowLength = height - width * 2;\n\n rect.style(HEIGHT, `${scrollBarWithouArrowLength}px`);\n rect.style(WIDTH, `${100}%`);\n mover.style(WIDTH, `${100}%`);\n mover.style(HEIGHT, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(TOP, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n\n this.unitPositions(getUnitPositions(unitHeights, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n let positionAdjuster = speed * 10;\n if (event.y < y) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const {\n totalLength\n } = this.logicalSpace();\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n\n if (newPosition.y < 0) {\n currentPos = 0;\n } else if (newPosition.y + moverPos.height > rectStartPos.height) {\n currentPos = rectStartPos.height - moverPos.height;\n } else {\n currentPos = newPosition.y;\n }\n mover.style(TOP, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: moverPos.y - rectStartPos.y - delta, x: 0 });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.height)) / 100;\n\n this.changeMoverPosition({ x: 0, y: movement });\n return this;\n }\n\n}\n","import { makeElement } from 'muze-utils';\nimport { cellSpanMaker, applySpans } from '../../../../layout/src/grid-layout/span-maker';\nimport { applyBorders } from '../../../../layout/src/grid-layout/border-helper';\nimport '../../border-applier.scss';\nimport {\n TOP, CENTER\n} from '../../../../layout/src/enums/constants';\nimport MuzeComponent from './muze-chart-component';\nimport { WIDTH, HEIGHT, HIDDEN, OVERFLOW, AUTO, VISIBLE } from '../../constants';\n\nconst renderPlaceholders = (cells) => {\n // Rendering content within placeholders\n cells.each(function (cell) {\n cell.placeholder.render(this);\n });\n};\n\nexport default class MatrixComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n this.className(params.config.className);\n }\n\n applyScroll (container) {\n const row = this.params.config.row;\n const column = this.params.config.column;\n const { horizontal, vertical } = this.params.config.scrollInfo;\n container.style(OVERFLOW, VISIBLE);\n container.style(WIDTH, AUTO);\n container.style(HEIGHT, AUTO);\n\n if (horizontal && column === 1) {\n container.style(OVERFLOW, HIDDEN);\n container.style(WIDTH, '100%');\n }\n\n if (vertical && row === CENTER) {\n container.style(OVERFLOW, HIDDEN);\n container.style(HEIGHT, '100%');\n }\n }\n\n renderMatrix (mountPoint) {\n const { classPrefix, row, column, dimensions, border, isFacet, showHeaders } = this.params.config;\n\n // Creating containers for each matrix individually\n const containerForMatrix = makeElement(mountPoint, 'div', [1], `${classPrefix}-grid-${row}-${column + 1}`)\n .classed(`${classPrefix}-grid-${row}`, true)\n .classed(`${classPrefix}-grid`, true);\n\n this.applyScroll(containerForMatrix);\n\n const {\n viewMatrix,\n spans\n } = cellSpanMaker(this.component, row, column);\n\n // Rendering the table components\n const { cells } = this.renderTable(containerForMatrix, `${classPrefix}-grid`, viewMatrix);\n\n applySpans(cells, spans, { dimensions, border }, `${row}-${column}`);\n renderPlaceholders(cells);\n\n cells.exit().each((cell) => {\n cell.placeholder.remove();\n });\n\n applyBorders({ cells, border, row, column, isFacet, showHeaders });\n }\n\n renderTable (mount, className, rowData) {\n const table = makeElement(mount, 'table', ['layout'], `${className}-table`);\n const body = makeElement(table, 'tbody', ['layout'], `${className}-body`);\n const rows = makeElement(body, 'tr', rowData, `${className}-tr`);\n const cells = makeElement(rows, 'td',\n (d, i) => d.filter(e => e !== null).map(e =>\n ({ placeholder: e, rowIndex: i })), `${className}-td`, {\n update: (elem, cell) => {\n const { externalClassname } = cell.placeholder.config();\n externalClassname && externalClassname.map(d => elem.classed(`${className}-${d}`, true));\n }\n }, key => key.placeholder.id);\n\n return { table, body, rows, cells };\n }\n\n draw (container) {\n this.renderMatrix(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(TOP);\n this.className(params.config.className);\n }\n}\n","import { selectElement, getEvent } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport MatrixComponent from './matrix-component';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\nimport { WHEEL_DELTA_MODIFIER } from '../../enums/constants';\n\n/**\n * Based on the type of scroll, it changes the scrollLeft/scrollTop property of the specific\n * elements based on the scroll distance provided\n *\n *\n */\nconst applyScrollAction = (elem, classPrefix, scollDistance, type) => {\n selectElement(elem)\n .selectAll(`.${classPrefix}-grid`)\n .property(type, scollDistance);\n};\n\n/**\n * Applies the action of the scroll by actually scrolling the respective matrices based on the\n * type of scroll. It returns a function which has both the scroll methods available\n *\n * @return {Object} contains the horizontal and vertical scroll actions on the grid component\n */\nconst scrollActionApplier = (movement, context) => {\n const classPrefix = context.params.config.classPrefix;\n\n return {\n horizontal: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[e][1].renderAt()}`, classPrefix, movement, 'scrollLeft'));\n },\n vertical: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[1][e].renderAt()}`, classPrefix, movement, 'scrollTop'));\n }\n };\n};\n\nexport default class GridComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.gridComponents = [];\n this.setParams(params);\n }\n\n sanitizeGrid () {\n let height = 0;\n let width = 0;\n const { viewMatricesInfo, layoutDimensions } = this.component.viewInfo();\n const scrollInfo = this.component.scrollInfo();\n const {\n viewHeight,\n viewWidth,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n\n for (let i = 0; i < 3; i++) {\n if (!(this.gridComponents.length && this.gridComponents[i] instanceof Array)) {\n this.gridComponents[i] = [];\n }\n for (let j = 0; j < 3; j++) {\n const matrixDim = {\n height: viewHeight[i],\n width: viewWidth[j],\n unitHeights,\n unitWidths\n };\n const matrix = viewMatricesInfo.matrices[`${ROW_MATRIX_INDEX[i]}`][j];\n const matrixName = `${ROW_MATRIX_INDEX[i]}-${COLUMN_MATRIX_INDEX[j]}`;\n const matrixConfig = {\n dimensions: matrixDim,\n border: layoutDimensions.border,\n classPrefix: this.params.config.classPrefix,\n scrollInfo,\n row: ROW_MATRIX_INDEX[i],\n column: j\n };\n if (this.gridComponents[i][j] instanceof MuzeComponent) {\n const { isFacet, showHeaders } = this.params.component.config();\n matrixConfig.isFacet = isFacet;\n matrixConfig.showHeaders = showHeaders;\n this.gridComponents[i][j].updateWrapper({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n } else {\n const { isFacet, showHeaders } = this.params.component.config();\n matrixConfig.isFacet = isFacet;\n matrixConfig.showHeaders = showHeaders;\n const matrixWrapper = new MatrixComponent({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n this.gridComponents[i].push(matrixWrapper);\n }\n if (i === 0) {\n width += matrixDim.width;\n }\n if (j === 0) {\n height += matrixDim.height;\n }\n }\n }\n this.boundBox({ height, width });\n\n this.component = this.gridComponents;\n this.allComponents = this.gridComponents;\n }\n\n scrollBarManager (...manager) {\n if (manager.length) {\n this._scrollBarManager = manager[0];\n return this;\n }\n return this._scrollBarManager;\n }\n\n /**\n * Attaches a mousewheel listener to the center matrix, based on which the scrolling can occur.\n * It uses the scroll component to change the position of the scroller, which ultimately scrolls the center matrix\n *\n *\n * @return {GridComponent} Instance of the GridComponent\n */\n attachScrollListener () {\n const scrollBarManager = this.scrollBarManager();\n selectElement(`#${this.component[1][1].renderAt()}`)\n .on('wheel', () => {\n const event = getEvent();\n const {\n wheelDeltaX,\n wheelDeltaY\n } = event;\n\n // Scrolling horizontally\n if (wheelDeltaX !== 0 && Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('horizontal', event)\n .triggerScrollBarAction('horizontal', wheelDeltaX / WHEEL_DELTA_MODIFIER);\n }\n\n // Scrolling Vertically\n if (wheelDeltaY !== 0 && Math.abs(wheelDeltaX) < Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('vertical', event)\n .triggerScrollBarAction('vertical', wheelDeltaY / WHEEL_DELTA_MODIFIER);\n }\n });\n return this;\n }\n\n performScrollAction (direction, movedView) {\n scrollActionApplier(movedView, this)[direction]();\n return this;\n }\n\n getBoundBox () {\n const { top, left } = this.component[0][0].boundBox();\n const { height, width } = this.boundBox();\n\n return {\n top,\n left,\n height,\n width\n };\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.className(params.config.className);\n this.sanitizeGrid();\n return this;\n }\n\n attachListener () {\n this.attachScrollListener();\n return this;\n }\n}\n","export const SIDE_EFFECT_COMMON = 'common';\nexport const SIDE_EFFECT_INDIVIDUAL = 'individual';\nexport const TOOLTIP_CONSOLIDATED = 'consolidated';\nexport const TOOLTIP_FRAGMENTED = 'fragmented';\nexport const WHEEL_DELTA_MODIFIER = 30;\n","import { selectElement, makeElement, applyStyle } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { incorrectMessageIcon } from './message-icon';\nimport { MESSAGE_CONFIG } from '../defaults';\n\nconst formatFontSize = (width, height) => {\n const { baseFontLimit, upperFontLimit, baseSizeLimit, upperSizeLimit } = MESSAGE_CONFIG;\n const fractionFont = (upperSizeLimit - baseSizeLimit) / (upperFontLimit - baseFontLimit);\n let fontSize = upperFontLimit;\n const dim = width < height && width !== 0 ? width : height;\n\n if (dim === 0) {\n fontSize = 0;\n } else if (dim <= baseSizeLimit) {\n fontSize = baseFontLimit;\n } else if (dim > baseSizeLimit && dim < upperSizeLimit) {\n fontSize = baseFontLimit + (upperSizeLimit - dim) / fractionFont;\n }\n return fontSize;\n};\n\nexport default class MessageComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n }\n\n render (container) {\n const parent = selectElement(container);\n\n const { config } = this.params;\n const { className } = config.classPrefix;\n\n const node = makeElement(parent, 'div', [1], className);\n const { height, width } = config.dimensions;\n const childHeight = height > MESSAGE_CONFIG.baseSizeLimit ? MESSAGE_CONFIG.fractionChild * height : 0;\n const { message } = config;\n\n applyStyle(node, { width: `${width}px`, height: `${height}px` });\n\n const childNode = makeElement(node, 'div', [1], `${className}-child`);\n const imageNode = makeElement(childNode, 'div', [1], `${className}-child-img`);\n const messageNode = makeElement(childNode, 'div', [1], `${className}-child-message`);\n\n applyStyle(childNode, { width, height: `${childHeight}px` });\n applyStyle(imageNode, { width, height: `${childHeight * MESSAGE_CONFIG.fractionImage}px` });\n\n imageNode.html(incorrectMessageIcon);\n\n const textElement = makeElement(messageNode, 'text', [1]);\n applyStyle(messageNode, { 'font-size': `${formatFontSize(width, height)}px` });\n\n textElement.html(message);\n }\n\n draw (container) {\n this.render(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n const { target, className } = params.config;\n this.component = params.component;\n this.params = params;\n this.target(target);\n this.className(className);\n this.position(params.config.position);\n return this;\n }\n}\n","export const incorrectMessageIcon = `\n\n\nGroup 23\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n","import {\n TITLE,\n SUB_TITLE,\n LEGEND, VERTICAL,\n HORIZONTAL,\n WIDTH,\n HEIGHT,\n TOP,\n LEFT,\n RIGHT,\n MESSAGE,\n GRID,\n ERROR_MESSAGE,\n HORIZONTAL_CENTER\n} from '../constants';\nimport HeaderComponent from './components/headerComponent';\nimport LegendComponent from './components/legendComponent';\nimport ScrollComponent from './components/scroll-component';\nimport GridComponent from './components/grid-component';\nimport MessageComponent from './components/message-component';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG, CANVAS, MESSAGE_CONFIG } from './defaults';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, CENTER } from '../../../layout/src/enums/constants';\n\n// Mapping between types of headers and their required configs for wrapper creation\nconst headerMap = {\n title: {\n headerCell: 'titleCell',\n configType: TITLE_CONFIG\n },\n subtitle: {\n headerCell: 'subtitleCell',\n configType: SUB_TITLE_CONFIG\n }\n};\n\n// Mapping of header alignment values\nconst headerAlignmentMap = {\n [LEFT]: LEFT,\n [RIGHT]: RIGHT,\n [CENTER]: HORIZONTAL_CENTER\n};\n\n/**\n * returns if data is Valid\n *\n *\n * @param {Object} params object where data has to be checked for validity\n * @return {Boolean} Returns true if all of the params are valid\n */\nconst checkParamsValidation = params => Object.keys(params).every((param => params[param]));\n\n/**\n * returns if message Component is needed or not\n *\n *\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Boolean} Returns if grid is present\n */\nconst isGridPresent = (renderDetails) => {\n const { rows, columns, values } = renderDetails.components;\n return checkParamsValidation({ rows, columns, values });\n};\n\n/**\n * Creates the wrapper for the header, i.e., title and subtitle to be used in the tree layout\n *\n *\n * @param {string} headerType type of header: title/subtite\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createHeaderWrapper = (headerType, layoutManager, renderDetails) => {\n let wrapper = null;\n\n const { components, layoutConfig } = renderDetails;\n const { headerCell, configType } = headerMap[headerType];\n const target = { target: CANVAS };\n\n if (components.headers && components.headers[headerCell]) {\n let headerConfig = layoutConfig[headerType];\n const header = components.headers[headerCell];\n\n headerConfig = Object.assign({}, headerConfig, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n alignWith: `${ROW_MATRIX_INDEX[0]}-${COLUMN_MATRIX_INDEX[1]}`,\n alignment: headerAlignmentMap[headerConfig.align],\n className: configType.className\n });\n\n const wrapperParams = {\n name: headerType,\n component: header,\n config: headerConfig\n };\n\n const existingComponent = layoutManager.getComponent(headerType);\n if (existingComponent) {\n wrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n wrapper = new HeaderComponent(wrapperParams);\n }\n }\n return wrapper;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} canvas canvas instance\n * @return {Instance} Returns the respective wrappers\n */\nconst createMessageWrapper = (layoutManager, renderDetails, renderGrid) => {\n const { components, measurement } = renderDetails;\n const headerValues = Object.values(components.headers);\n let sum = 0;\n let messageWrapper = null;\n\n for (const val of headerValues) {\n sum += val.logicalSpace().height;\n }\n\n if (!renderGrid) {\n const defaultDimensions = { height: measurement.canvasHeight - sum, width: measurement.canvasWidth };\n const gridComponent = layoutManager.getComponent(GRID);\n const { height, width } = (gridComponent && gridComponent.getBoundBox()) || defaultDimensions;\n const target = { target: CANVAS };\n const config = {\n ...target,\n dimensions: { height, width },\n message: ERROR_MESSAGE,\n classPrefix: MESSAGE_CONFIG,\n position: TOP\n };\n const wrapperParams = {\n name: MESSAGE,\n component: null,\n config\n };\n const existingComponent = layoutManager.getComponent(MESSAGE);\n\n if (existingComponent) {\n messageWrapper = existingComponent.updateWrapper(wrapperParams);\n } else {\n messageWrapper = new MessageComponent(wrapperParams);\n }\n return messageWrapper;\n }\n return null;\n};\n\n// Mapping between types of scrollBars and their required configs for wrapper creation\nconst scrollBarMap = config => ({\n vertical: {\n componentName: 'verticalScrollBar',\n width: 'thickness',\n height: 'layoutBasedMeasure',\n layoutBasedMeasure: HEIGHT,\n viewMeasure: 'viewHeight',\n rowAlign: 1,\n colAlign: config.align === 'right' ? 2 : 0,\n position: config.align,\n alignment: TOP\n },\n horizontal: {\n componentName: 'horizontalScrollBar',\n width: 'layoutBasedMeasure',\n layoutBasedMeasure: WIDTH,\n viewMeasure: 'viewWidth',\n height: 'thickness',\n rowAlign: config.align === 'top' ? 0 : 2,\n colAlign: 1,\n position: config.align,\n alignment: LEFT\n }\n});\n\n/**\n * Creates the wrapper for the scroller, i.e., horizontal and vertical to be used in the tree layout\n *\n *\n * @param {string} scrollBarType type of scrollbar: horizontal/vertical\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst createScrollBarWrapper = (scrollBarType, layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let scrollBarWrapper = null;\n const { layoutConfig } = renderDetails;\n const target = { target: CANVAS };\n const { scrollBar } = layoutConfig;\n const { layoutDimensions } = grid.viewInfo();\n const {\n actualCenterMeasures,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n const {\n componentName, layoutBasedMeasure, width, height, rowAlign, colAlign,\n viewMeasure, position, alignment\n } = scrollBarMap(scrollBar[scrollBarType])[scrollBarType];\n const dimensions = {\n thickness: scrollBar.thickness,\n layoutBasedMeasure: layoutDimensions[viewMeasure][1]\n };\n const isScroll = grid.scrollInfo()[scrollBarType];\n const totalLength = actualCenterMeasures[layoutBasedMeasure];\n const viewLength = layoutDimensions[viewMeasure][1];\n\n const scrollConfig = Object.assign({}, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n scrollBarComponentConfig: {\n ...scrollBar,\n classPrefix: layoutConfig.classPrefix\n },\n\n type: scrollBarType,\n alignWith: `${ROW_MATRIX_INDEX[rowAlign]}-${COLUMN_MATRIX_INDEX[colAlign]}`,\n alignment,\n position\n });\n\n const wrapperParams = {\n name: componentName,\n config: scrollConfig,\n dimensions: {\n width: dimensions[width],\n height: dimensions[height],\n totalLength,\n viewLength,\n unitHeights,\n unitWidths\n }\n };\n\n const existingComponent = layoutManager.getComponent(componentName);\n\n if (!isScroll) {\n existingComponent && existingComponent.remove();\n return null;\n }\n\n if (existingComponent) {\n scrollBarWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n scrollBarWrapper = new ScrollComponent(wrapperParams);\n }\n\n return scrollBarWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the legend to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createLegendWrapper = (layoutManager, renderDetails, renderGrid) => {\n if (renderGrid) {\n let legendWrapper = null;\n const { components, layoutConfig, measurement } = renderDetails;\n const target = { target: CANVAS };\n\n if (components.legends && components.legends.length) {\n const legendConfig = { ...layoutConfig.legend, ...target, measurement };\n const wrapperParams = {\n name: LEGEND,\n component: components.legends,\n config: legendConfig\n };\n\n const existingComponent = layoutManager.getComponent(LEGEND);\n\n if (existingComponent) {\n legendWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n legendWrapper = new LegendComponent(wrapperParams);\n }\n }\n return legendWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst gridLayoutWrapper = (layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let gridWrapper = null;\n const target = { target: CANVAS };\n const { layoutConfig } = renderDetails;\n\n const config = {\n ...target,\n pagination: layoutConfig.pagination,\n classPrefix: layoutConfig.classPrefix,\n dimensions: { height: 0, width: 0 }\n };\n const wrapperParams = {\n name: GRID,\n component: grid,\n config\n };\n const existingComponent = layoutManager.getComponent(GRID);\n if (existingComponent) {\n gridWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n gridWrapper = new GridComponent(wrapperParams);\n }\n return gridWrapper;\n }\n return null;\n};\n/**\n * Responsible for providing the wrapper creators for every component in Muze.\n * This function, when called, returns the set of components and their respective wrappers.\n *\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} grid Instance of the grid layout\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers for each component\n */\nexport const componentWrapperMaker = (canvas, grid, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const renderGrid = isGridPresent(renderDetails);\n return {\n title: createHeaderWrapper(TITLE, layoutManager, renderDetails),\n subtitle: createHeaderWrapper(SUB_TITLE, layoutManager, renderDetails),\n message: createMessageWrapper(layoutManager, renderDetails, renderGrid),\n legend: createLegendWrapper(layoutManager, renderDetails, renderGrid),\n grid: gridLayoutWrapper(layoutManager, renderDetails, grid, renderGrid),\n verticalScrollBar: createScrollBarWrapper(VERTICAL, layoutManager, renderDetails, grid, renderGrid),\n horizontalScrollBar: createScrollBarWrapper(HORIZONTAL, layoutManager, renderDetails, grid, renderGrid)\n };\n};\n","export class ScrollManager {\n\n constructor () {\n this._scrollBarComponents = {};\n this._attachedComponents = {};\n }\n\n scrollBarComponents (...sbc) {\n if (sbc.length) {\n this._scrollBarComponents = sbc[0];\n return this;\n }\n return this._scrollBarComponents;\n }\n\n attachedComponents (...abc) {\n if (abc.length) {\n this._attachedComponents = abc[0];\n return this;\n }\n return this._attachedComponents;\n }\n\n preventBrowserScroll (type, event) {\n if (this.scrollBarComponents()[type]) {\n // Prevent default behaviour and stop propagating\n event.preventDefault();\n event.stopPropagation();\n }\n return this;\n }\n\n performAttachedScrollFunction (type, movedViewLength) {\n Object.values(this.attachedComponents()).forEach((e) => {\n e.performScrollAction(type, movedViewLength);\n });\n return this;\n }\n\n triggerScrollBarAction (type, delta) {\n this.scrollBarComponents()[type] && this.scrollBarComponents()[type].scrollDeltaTo(delta);\n return this;\n }\n}\n","import { mergeRecursive } from 'muze-utils';\nimport { arrangeComponents } from './component-resolver';\nimport { createHeaders } from './title-maker';\nimport { createLegend, getLegendSpace } from './legend-maker';\nimport { componentWrapperMaker } from './component-wrapper-maker';\nimport {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n TITLE,\n SUB_TITLE,\n LEGEND,\n VERTICAL_SCROLL_BAR,\n HORIZONTAL_SCROLL_BAR,\n GRID,\n MESSAGE\n} from '../constants';\nimport { ScrollManager } from './scroll-manager';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const prepareLayout = (layout, renderDetails) => {\n const { components, layoutConfig, measurement } = renderDetails;\n const {\n rows,\n columns,\n values,\n cornerMatrices\n } = components;\n const {\n topLeft,\n topRight,\n bottomLeft,\n bottomRight\n } = cornerMatrices;\n if (rows && columns) {\n layout.measurement(measurement)\n .config(layoutConfig)\n .matrices({\n top: [topLeft, columns[0], topRight],\n center: [rows[0], values, rows[1]],\n bottom: [bottomLeft, columns[1], bottomRight]\n })\n .triggerReflow();\n }\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} mount\n *\n */\nexport const getRenderDetails = (context, mount) => {\n let layoutConfig = mergeRecursive({}, context.config());\n // Get height width of the mount point\n let { height, width } = mount.getBoundingClientRect();\n const heightAttr = context.height();\n const widthAttr = context.width();\n const visGroup = context.composition().visualGroup;\n const {\n isColumnSizeEqual,\n isRowSizeEqual,\n priority,\n rows,\n columns,\n values\n } = visGroup.placeholderInfo();\n const {\n minWidth,\n minHeight,\n classPrefix,\n showHeaders,\n legend,\n pagination,\n scrollBar\n } = context.config();\n\n // Get title configuration\n const titleConfig = context.title()[1];\n // Get subtitle configuration\n const subtitleConfig = context.subtitle()[1];\n // Get legend position\n const legendPosition = legend.position;\n // Arrange components according to config\n const layoutArrangement = arrangeComponents(context);\n\n height = Math.floor(height);\n width = Math.floor(width);\n\n const availableHeightForCanvas = Math.max(heightAttr > 0 ? heightAttr : height, minHeight);\n const availableWidthForCanvas = Math.max(widthAttr > 0 ? widthAttr : width, minWidth);\n\n // Create headers and determine header height\n const { headers, headerHeight } = createHeaders(context, availableHeightForCanvas, availableWidthForCanvas);\n\n // Create legends and determine legend space\n const legends = createLegend(context, headerHeight, availableHeightForCanvas, availableWidthForCanvas);\n context._composition.legend = {};\n legends.forEach((e) => {\n context._composition.legend[e.scaleType] = e.legend;\n });\n\n const legendSpace = getLegendSpace(legends, legend, availableHeightForCanvas, availableWidthForCanvas);\n const legendWidth = (legendPosition === LEFT || legendPosition === RIGHT) ? legendSpace.width : 0;\n const legendHeight = (legendPosition === TOP || legendPosition === BOTTOM) ? legendSpace.height : 0;\n\n // Set components for layouting\n const components = {\n headers,\n legends,\n canvases: [context],\n rows,\n columns,\n values,\n cornerMatrices: visGroup.cornerMatrices()\n };\n\n const measurement = {\n mountSpace: {\n height,\n width\n },\n headerHeight,\n legendSpace,\n canvasWidth: availableWidthForCanvas,\n canvasHeight: availableHeightForCanvas,\n width: availableWidthForCanvas - legendWidth,\n height: availableHeightForCanvas - headerHeight - legendHeight,\n minUnitHeight: context.minUnitHeight(),\n minUnitWidth: context.minUnitWidth()\n };\n layoutConfig = mergeRecursive(layoutConfig, {\n classPrefix,\n showHeaders,\n border: mergeRecursive(visGroup.metaData().border, context.config().border),\n layoutArrangement,\n legend,\n buffer: scrollBar.thickness,\n pagination,\n title: titleConfig,\n subtitle: subtitleConfig,\n isColumnSizeEqual,\n isRowSizeEqual,\n mount,\n priority\n });\n return {\n layoutConfig,\n components,\n measurement\n };\n};\n\nconst componentIndexes = {\n title: 0,\n subtitle: 1,\n legend: 2,\n verticalScrollBar: 3,\n horizontalScrollBar: 4,\n grid: 5,\n message: 6\n};\n\nconst componentNames = {\n 0: TITLE,\n 1: SUB_TITLE,\n 2: LEGEND,\n 3: VERTICAL_SCROLL_BAR,\n 4: HORIZONTAL_SCROLL_BAR,\n 5: GRID,\n 6: MESSAGE\n};\n\nconst attachListeners = (componentWrappers) => {\n componentWrappers.forEach((componentWrapper) => {\n if (componentWrapper) {\n componentWrapper.attachListener();\n }\n });\n};\n\n/**\n * Responsible for creating a scroll manager that manages interactions between the grid\n * component and the scroll bar components\n *\n * @param {Array} componentWrappers Contains the wrappers for all the components\n * @param {Canvas} canvas Instance of the current canvas\n * @return {Array} Positions of units either horizontal or vertical\n */\nconst createScrollManager = (componentWrappers, canvas) => {\n const {\n horizontalScrollBar,\n verticalScrollBar,\n grid\n } = componentIndexes;\n\n const horizontalScrollWrapper = componentWrappers[horizontalScrollBar];\n const verticalScrollWrapper = componentWrappers[verticalScrollBar];\n const gridWrapper = componentWrappers[grid];\n const scrollBarManager = new ScrollManager();\n const scrollBarComponents = {};\n\n verticalScrollWrapper && (scrollBarComponents.vertical = verticalScrollWrapper);\n horizontalScrollWrapper && (scrollBarComponents.horizontal = horizontalScrollWrapper);\n\n scrollBarManager\n .scrollBarComponents(scrollBarComponents)\n .attachedComponents({\n grid: gridWrapper\n });\n canvas.composition().hScrollBar = horizontalScrollWrapper;\n canvas.composition().vScrollBar = verticalScrollWrapper;\n\n [horizontalScrollWrapper, verticalScrollWrapper].forEach((wrapper) => {\n wrapper && wrapper.manager(scrollBarManager);\n });\n\n gridWrapper.scrollBarManager(scrollBarManager);\n};\n\nexport const renderLayout = (canvas, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const gridLayout = canvas.layout();\n const {\n\n grid\n } = componentIndexes;\n\n // Get the component wrappers\n const compWrappers = componentWrapperMaker(canvas, gridLayout, renderDetails);\n const componentWrappers = Object.keys(componentIndexes).map(e => compWrappers[e]);\n const gridWrapper = componentWrappers[grid];\n if (gridWrapper) {\n createScrollManager(componentWrappers, canvas);\n }\n\n componentWrappers.forEach((componentWrapper, index) => {\n if (!componentWrapper) {\n const deleteElementName = componentNames[index];\n layoutManager.removeComponent(deleteElementName);\n }\n });\n layoutManager.registerComponents(componentWrappers).compute();\n attachListeners(componentWrappers);\n};\n","import { isSimpleObject, ReservedFields, FieldType } from 'muze-utils';\nimport { getSideEffects, BEHAVIOURS } from '@chartshq/muze-firebolt';\nimport { PSEUDO_SELECT } from '@chartshq/visual-unit/src/enums/behaviours';\nimport { COMMON_INTERACTION } from '../../constants';\n\nexport const addFacetDataAndMeasureNames = (data, facetData, measureNames) => {\n if (data === null) {\n return data;\n }\n\n const facets = Object.keys(facetData);\n const facetVals = Object.values(facetData);\n\n if (isSimpleObject(data)) {\n return Object.assign({}, Object.keys(facetData).reduce((acc, v) => {\n acc[v] = [facetData[v]];\n return acc;\n }, {}), data, {\n [ReservedFields.MEASURE_NAMES]: measureNames\n });\n }\n const criteriaFields = data[0];\n const hasMeasureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES);\n const fieldsWithFacets = [...facets, ...criteriaFields,\n ...(hasMeasureNameField ? [] : [ReservedFields.MEASURE_NAMES])];\n\n const dataWithFacets = [\n fieldsWithFacets\n ];\n\n for (let i = 1, len = data.length; i < len; i++) {\n let measureNameArr = [];\n if (!hasMeasureNameField && measureNames) {\n measureNameArr = measureNames;\n }\n const row = [...facetVals, ...data[i], ...measureNameArr];\n dataWithFacets.push(row);\n }\n return dataWithFacets;\n};\n\nexport const propagateValues = (instance, action, config = {}) => {\n const { payload, identifiers, sourceUnitId, sourceCanvasId, propagationDataSource } = config;\n const dataModel = propagationDataSource;\n const sideEfffects = instance._sideEffectDefinitions;\n const behaviourEffectMap = instance._behaviourEffectMap;\n const propagationBehaviourMap = instance._propagationBehaviourMap;\n const propagationBehaviour = propagationBehaviourMap[action] || action;\n\n payload.sourceUnit = sourceUnitId;\n payload.action = action;\n payload.sourceCanvas = sourceCanvasId;\n\n const groupId = sourceCanvasId;\n\n const filterFn = (entry, propagationConf) => {\n const effects = behaviourEffectMap[entry.config.action];\n const mutates = entry.config.groupId ?\n (effects ? effects.some(d => sideEfffects[d.name || d].mutates()) : false) : true;\n return entry.config.groupId !== propagationConf.groupId && mutates;\n };\n\n const sourceBehaviour = instance._actions.behavioural[action];\n let isMutableAction = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false;\n const propConfig = {\n payload,\n action,\n criteria: identifiers,\n isMutableAction,\n groupId,\n sourceId: config.sourceId,\n filterFn,\n enabled: (propConf, firebolt) => (action !== propagationBehaviour ?\n propConf.payload.sourceCanvas === firebolt.sourceCanvas() : true)\n };\n\n dataModel.propagate(identifiers, propConfig, true);\n\n if (action !== propagationBehaviour) {\n const behaviourInstance = instance._actions.behavioural[propagationBehaviour];\n isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false;\n\n dataModel.propagate(identifiers, Object.assign({}, propConfig, {\n isMutableAction,\n applyOnSource: false,\n action: propagationBehaviour,\n sourceId: isMutableAction ? groupId : sourceUnitId,\n enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.sourceCanvas()\n }), true, {\n filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId\n });\n }\n};\n\nconst isDimension = fields => fields.some(field => field.type() === FieldType.DIMENSION);\n\nexport const isCrosstab = (fields) => {\n const { rowFacets, colFacets, rowProjections, colProjections } = fields;\n if (rowFacets.length || colFacets.length) {\n return true;\n }\n const colProj = colProjections.flat();\n const rowProj = rowProjections.flat();\n\n if ((isDimension(colProj) || isDimension(rowProj)) && (colProj.length > 1 || rowProj.length > 1)) {\n return true;\n }\n return false;\n};\n\nexport const addSelectedMeasuresInPayload = (firebolt, unit, payload) => {\n const groupFields = firebolt.context.composition().visualGroup.resolver().getAllFields();\n if (isCrosstab(groupFields)) {\n const { x, y } = unit.fields();\n let measureFields;\n\n if (x.length && y.length) {\n if (x[0].type() === FieldType.MEASURE) {\n measureFields = [`${x[0]}`];\n } else if (y[0].type() === FieldType.MEASURE) {\n measureFields = [`${y[0]}`];\n }\n payload.selectedMeasures = measureFields;\n }\n }\n};\n\nexport const dispatchBehaviours = (firebolt, { payload, unit, behaviours }) => {\n const { interaction: { behaviours: behaviourConfs = {} } } = firebolt.context.config();\n const unitFirebolt = unit.firebolt();\n\n behaviours.forEach((action) => {\n const mode = behaviourConfs[action];\n let targetFirebolt = unitFirebolt;\n if (mode === COMMON_INTERACTION) {\n targetFirebolt = firebolt;\n }\n\n const actions = targetFirebolt._actions.behavioural;\n payload.criteria = addFacetDataAndMeasureNames(payload.criteria, unit.facetFieldsMap(),\n unit.layers().map(layer => Object.keys(layer.data().getFieldspace().getMeasure())));\n\n targetFirebolt.dispatchBehaviour(action, payload, {\n propagate: false,\n applySideEffect: false\n });\n\n const identifiers = actions[action].propagationIdentifiers();\n\n firebolt.propagate(action, payload, identifiers, {\n sideEffects: getSideEffects(action, targetFirebolt._behaviourEffectMap),\n sourceUnitId: unit.id(),\n sourceId: targetFirebolt.id(),\n propagationDataSource: targetFirebolt.getPropagationSource()\n });\n });\n};\n\nexport const resetSelectAction = (firebolt, { unit, payload, behaviours }) => {\n if (behaviours[0] === BEHAVIOURS.BRUSH && payload.dragging && payload.dragDiff < 5) {\n dispatchBehaviours(firebolt, {\n behaviours: [BEHAVIOURS.SELECT],\n payload: {\n criteria: null\n },\n unit\n });\n }\n};\n\nexport const attachBehaviours = (group) => {\n const allFields = group.resolver().getAllFields();\n const valueMatrix = group.matrixInstance().value;\n const crosstab = isCrosstab(allFields);\n\n valueMatrix.each((cell) => {\n const unit = cell.valueOf();\n const firebolt = unit.firebolt();\n const behaviours = crosstab ? [PSEUDO_SELECT] : [];\n firebolt._connectedBehaviours[BEHAVIOURS.SELECT] = behaviours;\n });\n};\n","import {\n FieldType,\n mergeRecursive,\n CommonProps,\n ReservedFields\n} from 'muze-utils';\nimport { Firebolt, getSideEffects } from '@chartshq/muze-firebolt';\nimport { createMapByDimensions } from '@chartshq/visual-unit/src/firebolt/helper';\nimport {\n payloadGenerator,\n isSideEffectEnabled,\n sanitizePayloadCriteria,\n prepareSelectionSetMap\n} from '@chartshq/visual-unit';\nimport { TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects';\nimport { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants';\nimport { applyInteractionPolicy } from '../helper';\nimport {\n propagateValues,\n isCrosstab,\n addSelectedMeasuresInPayload,\n resetSelectAction,\n dispatchBehaviours,\n attachBehaviours\n} from './helper';\nimport { COMMON_INTERACTION } from '../../constants';\n\nconst setSideEffectConfig = (firebolt) => {\n const tooltipSideEffect = firebolt.sideEffects().tooltip;\n const allFields = firebolt.context.composition().visualGroup.resolver().getAllFields();\n\n if (isCrosstab(allFields)) {\n tooltipSideEffect.config({\n selectionSummary: {\n order: 1,\n className: 'tooltip-content-container-selectionSummary-crosstab',\n showMultipleMeasures: true\n },\n highlightSummary: {\n order: 0,\n className: 'tooltip-content-container-highlightSummary-crosstab'\n }\n });\n } else {\n tooltipSideEffect.config({\n selectionSummary: {\n order: 0,\n className: 'tooltip-content-container-selectionSummary-default',\n showMultipleMeasures: false\n },\n highlightSummary: {\n order: 1,\n className: 'tooltip-content-container-highlightSummary-default'\n }\n });\n }\n};\n\nconst prepareSelectionSetData = (group, dataModel) => {\n const valueMatrix = group.matrixInstance().value;\n const fieldsConfig = dataModel.getFieldsConfig();\n const dimensions = Object.values(fieldsConfig).filter(d => d.def.type === FieldType.DIMENSION);\n const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length;\n const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : [];\n const keys = {};\n const dimensionsMap = {};\n const unitDimsMap = {};\n\n valueMatrix.each((cell) => {\n const unit = cell.source();\n const dm = unit.data();\n const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name);\n const facetFields = Object.keys(unit.facetFieldsMap());\n\n unitDimsMap[unitDims] = {\n inst: unit,\n dims: [...facetFields, ...unitDims]\n };\n });\n\n const groupDataMap = {};\n\n dataModel.getData().data.forEach((row) => {\n for (const key in unitDimsMap) {\n const { dims } = unitDimsMap[key];\n const dimKey = dims.map(dim => row[fieldsConfig[dim].index]);\n groupDataMap[dimKey] = row;\n }\n });\n\n valueMatrix.each((cell) => {\n const unit = cell.source();\n const dm = unit.data();\n const layers = unit.layers();\n const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name);\n const facetMap = unit.facetFieldsMap();\n const facetFields = Object.keys(facetMap);\n const unitFieldsConfig = dm.getFieldsConfig();\n const linkedRows = [];\n\n dm.getData().data.forEach((row) => {\n const dimKey = [...facetFields.map(field => facetMap[field]), ...unitDims.map(d =>\n row[unitFieldsConfig[d].index])];\n const linkedRow = groupDataMap[dimKey];\n\n if (linkedRow) {\n linkedRows.push(linkedRow);\n }\n });\n\n prepareSelectionSetMap({\n data: linkedRows,\n uids: dm.getUids(),\n dimensions\n }, layers, {\n keys,\n dimensionsMap\n });\n });\n\n const dimensionFields = dimensions.length ? [...dimensions.map(d => d.def.name)] :\n [ReservedFields.ROW_ID];\n\n return {\n keys,\n dimensionsMap,\n dimensions: dimensionFields,\n allFields: [...dimensionFields, ...measureName]\n };\n};\n\nconst defaultCrossInteractionPolicy = {\n behaviours: {\n '*': (propagationPayload, firebolt) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = firebolt.sourceCanvas();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n }\n },\n sideEffects: {\n '*': (propagationPayload, firebolt) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = firebolt.sourceCanvas();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n },\n selectionBox: () => false\n }\n};\n\n/**\n * This class is responsible for dispatching any behavioural action to all the visual units housed by the canvas.\n * It is created by {@link Canvas}. This class does not handle any physical actions. Physical actions get triggered\n * in {@link VisualUnit} which is managed by it's own firebolt instance. The firebolt instance of canvas only\n * propagates the action to all the visual units in it's composition.\n *\n * To get the firebolt instance of {@link Canvas}\n * ```\n * const firebolt = canvas.firebolt();\n * ```\n *\n * @class GroupFireBolt\n * @public\n */\nexport default class GroupFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.payloadGenerators(payloadGenerator);\n this._interactionPolicy = this.constructor.defaultInteractionPolicy();\n this.crossInteractionPolicy(this.constructor.defaultCrossInteractionPolicy());\n }\n\n static defaultInteractionPolicy () {\n return () => {};\n }\n\n static defaultCrossInteractionPolicy () {\n return defaultCrossInteractionPolicy;\n }\n\n interactionPolicy (...policy) {\n if (policy.length) {\n this._interactionPolicy = policy[0] || this.constructor.defaultInteractionPolicy();\n return this;\n }\n return this._interactionPolicy;\n }\n\n crossInteractionPolicy (...policy) {\n if (policy.length) {\n const context = this.context;\n this._crossInteractionPolicy = mergeRecursive(mergeRecursive({},\n this.constructor.defaultCrossInteractionPolicy()), policy[0] || {});\n\n applyInteractionPolicy(this);\n const throwback = context._throwback;\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => {\n this.config(this.context.config().interaction);\n applyInteractionPolicy(this);\n const group = this.context.composition().visualGroup;\n if (group) {\n setSideEffectConfig(this);\n\n const { keys, dimensions, dimensionsMap, allFields } = prepareSelectionSetData(group,\n group.getGroupByData());\n this._metaData = {\n dimensionsMap,\n dimensions,\n allFields\n };\n this.createSelectionSet({ keys, fields: dimensions });\n group.getGroupByData().on('propagation', (data, config) => {\n this.handleDataModelPropagation(data, config);\n });\n // Dispatch pseudo select behaviour for highlighting measures with common dimensions in crosstab\n attachBehaviours(group);\n }\n });\n return this;\n }\n return this._crossInteractionPolicy;\n }\n\n handleDataModelPropagation (data, config) {\n const group = this.context.composition().visualGroup;\n const valueMatrix = group.matrixInstance().value;\n const units = group.resolver().units();\n const propagationData = data;\n // @todo refactor this code\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n const { interaction: { behaviours: behaviourConfs = {} } } = this.context.config();\n const mode = behaviourConfs[action];\n if (mode !== COMMON_INTERACTION) {\n return this;\n }\n\n const payloadFn = this.getPayloadGeneratorFor(action);\n const payload = payloadFn(this, propagationData, config);\n\n const behaviourPolicies = this._behaviourPolicies;\n const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, this, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled;\n }\n\n if (enabled) {\n const propagationInf = {\n propagate: false,\n data: propagationData,\n propPayload,\n sourceIdentifiers,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(action, behaviourEffectMap);\n const sideEffectInstances = this.sideEffects();\n const { instance: unit = units[0][0] } =\n valueMatrix.findPlaceHolderById(propPayload.sourceUnit) || {};\n\n sideEffects.forEach(({ effects }) => {\n effects.forEach((effect) => {\n const name = effect.name;\n const inst = sideEffectInstances[name];\n\n if (inst) {\n inst.sourceInfo(() => unit.getSourceInfo());\n inst.layers(() => unit.layers());\n inst.plotPointsFromIdentifiers((...params) =>\n unit.getPlotPointsFromIdentifiers(...params));\n inst.drawingContext(() => unit.getDrawingContext());\n inst.valueParser(unit.valueParser());\n }\n });\n });\n\n if (propPayload.sourceUnit) {\n addSelectedMeasuresInPayload(this, unit, payload);\n }\n\n this.dispatchBehaviour(action, payload, propagationInf);\n }\n\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n\n return this;\n }\n\n target () {\n return 'visual-group';\n }\n\n mapActionsAndBehaviour () {\n const unitMatrix = this.context.composition().visualGroup.matrixInstance().value;\n\n unitMatrix.each((unit) => {\n const firebolt = unit.source().firebolt();\n firebolt.mapActionsAndBehaviour();\n });\n\n this.registerPhysicalActionHandlers();\n }\n\n registerPhysicalActionHandlers () {\n const unitMatrix = this.context.composition().visualGroup.matrixInstance().value;\n\n unitMatrix.each((cell) => {\n const unit = cell.source();\n const firebolt = unit.firebolt();\n\n firebolt.onPhysicalAction('*', (event, payload) => {\n this.handlePhysicalAction(event, payload, unit);\n }, this.context.constructor.formalName());\n });\n\n return this;\n }\n\n handlePhysicalAction (event, payload, unit) {\n const firebolt = unit.firebolt();\n const { behaviours } = firebolt._actionBehaviourMap[event];\n dispatchBehaviours(this, { behaviours, payload, unit });\n // Reset select action when dragging is done. Remove this when brush and select will be unioned\n resetSelectAction(this, { behaviours, payload, unit });\n }\n\n sanitizePayload (payload) {\n const { criteria } = payload;\n const { allFields: fields, dimensionsMap } = this._metaData;\n\n return Object.assign({}, payload,\n {\n criteria: sanitizePayloadCriteria(criteria, fields, {\n dm: this.data(),\n dimensionsMap,\n dimsMapGetter: this._dimsMapGetter\n })\n });\n }\n\n createSelectionSet (...params) {\n super.createSelectionSet(...params);\n\n this._dimsMapGetter = createMapByDimensions(this, this.data());\n\n return this;\n }\n\n id () {\n return this.context.alias();\n }\n\n shouldApplySideEffects (propInf) {\n return propInf.applySideEffect !== false;\n }\n\n data () {\n return this.context.composition().visualGroup.getGroupByData();\n }\n\n getRangeFromIdentifiers ({ criteria, fields }) {\n return fields.reduce((acc, v) => {\n acc[v] = criteria[v];\n return acc;\n }, {});\n }\n\n propagate (behaviour, payload, identifiers, auxConfig = {}) {\n propagateValues(this, behaviour, Object.assign({\n payload,\n identifiers,\n propagationFields: this._propagationFields,\n sourceId: this.id(),\n sourceCanvasId: this.id(),\n propagationDataSource: this.data()\n }, auxConfig));\n }\n\n getPropagationSource () {\n return this.data();\n }\n\n sourceCanvas () {\n return this.context.alias();\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n if (payload.sideEffects) {\n return [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }];\n }\n const { mode } = this.context.config().interaction.tooltip;\n propagationInf.propPayload = propagationInf.propPayload || payload;\n sideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n if (se.name === TOOLTIP && mode === FRAGMENTED) {\n return false;\n }\n return isSideEffectEnabled(this, { se, propagationInf });\n });\n d.effects = mappedEffects;\n });\n return sideEffects;\n }\n}\n","import GroupFireBolt from './group-firebolt';\n\nexport default GroupFireBolt;\n","export const APP_INITIAL_STATE = {\n app: {\n group: {},\n units: {},\n layers: {},\n canvas: {}\n },\n local: {\n canvas: {},\n group: {},\n units: {},\n layers: {}\n }\n};\n\n","import { GridLayout } from '@chartshq/layout';\nimport { transactor, Store, getUniqueId, selectElement, STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport UnitBrushBehaviour from '@chartshq/visual-unit/src/firebolt/behaviours/brush';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { RETINAL } from '../constants';\nimport TransactionSupport from '../transaction-support';\nimport { getRenderDetails, prepareLayout, renderLayout } from './layout-maker';\nimport { localOptions, canvasOptions } from './local-options';\nimport GroupFireBolt from './firebolt';\nimport options from '../options';\nimport { APP_INITIAL_STATE } from './app-state';\nimport { initCanvas,\n setupChangeListener,\n setLabelRotationForAxes,\n createGroupState,\n createLayoutManager,\n setLayoutInfForUnits\n} from './helper';\n/**\n * Canvas is a logical component which houses a visualization by taking multiple variable in different encoding channel.\n * Canvas manages lifecycle of many other logical component and exposes one consistent interface for creation of chart.\n * Canvas is intialized from environment with settings from environment and singleton dependencies.\n *\n * To create an instance of canvas\n * ```\n * const env = Muze();\n * const canvas = env.canvas()\n * ```\n *\n *\n * @class\n * @public\n * @module Canvas\n */\nexport default class Canvas extends TransactionSupport {\n\n /**\n * Creates reactive property accessors.\n * - data\n * - height\n * - width\n * - config\n * This configs are retrieved from options.\n */\n constructor (globalDependencies) {\n super();\n\n this._allOptions = Object.assign({}, options, localOptions);\n this._registry = {};\n this._composition = {};\n this._cachedProps = {};\n this._alias = null;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n this._composition.layout = new GridLayout();\n this._store = new Store(APP_INITIAL_STATE);\n\n this._throwback = new Store({\n [CommonProps.MATRIX_CREATED]: false,\n [CommonProps.ON_LAYER_DRAW]: null,\n propagationInfo: null\n });\n\n // Setters and getters will be mounted on this. The object will be mutated.\n const namespace = STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE;\n const allOptions = Object.assign({}, options, localOptions, canvasOptions);\n\n transactor(this, allOptions, this._store, {\n namespace\n });\n\n this.dependencies(Object.assign({}, globalDependencies, this._dependencies));\n this.firebolt(new GroupFireBolt(this, {\n behavioural: Object.assign({}, behaviouralActions, {\n brush: UnitBrushBehaviour\n }),\n physical: physicalActions,\n physicalBehaviouralMap: {}\n }, sideEffects, behaviourEffectMap));\n this.alias(`canvas-${getUniqueId()}`);\n this.title('', {});\n this.subtitle('', {});\n this.legend({});\n this.color({});\n this.shape({});\n this.size({});\n setupChangeListener(this);\n // init layoutManager\n this._layoutManager = createLayoutManager();\n }\n\n /**\n * Retrieves an instance of layout which is responsible for layouting. Layout is responsible for creating faceted\n * presentation using table layout.\n *\n * @public\n *\n * @return {GridLayout} Instance of layout attached to canvas.\n */\n layout (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().layout;\n }\n\n /**\n * Retrieves the composition for a canvas\n *\n * @public\n *\n * @return {object} Instances of the components which canvas requires to draw the full visualization.\n * ```\n * {\n * layout: // Instance of {@link GridLayout}\n * legend: // Instance of {@link Legend}\n * subtitle: // Instance of {@link TextCell} using which the title is rendered\n * title: // Instance of {@link TextCell} using which the title is rendered\n * visualGroup: // Instance of {@link visualGroup}\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Sets or gets the alias of the canvas. Alias is a name by which the canvas can be referred.\n *\n * When setter\n * @param {string} alias Name of the alias.\n *\n * @return {Canvas} Instance of the canvas.\n *\n * When getter\n *\n * @return {string} Alias of canvas.\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n const visualGroup = this.composition().visualGroup;\n this._alias = params[0];\n visualGroup && visualGroup.alias(this.alias());\n return this;\n }\n return this._alias;\n }\n\n /**\n * Creates an instance initiated with given settings.\n *\n * @param {Object} initialSettings Initial settings to be populated in the model\n * @param {Object} regEntry newly created instance with the initial settings\n * @param {Object} globalDependencies dependencies which will be created only once in the page\n *\n * @return {Object} newly created instance with the initial settings\n */\n static withSettings (initialSettings, regEntry, globalDependencies) {\n const instance = new Canvas(globalDependencies);\n\n for (const key in initialSettings) {\n instance[key](initialSettings[key]);\n }\n // set registry for instance\n instance.registry(regEntry);\n return instance;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof Canvas\n */\n static formalName () {\n return 'canvas';\n }\n\n /**\n * Returns the instance of firebolt associated with this canvas. The firebolt instance can be used to dispatch a\n * behaviour dynamically on the canvas. This firebolt does not handle any physical actions. It is just used to\n * propagate the action to all the visual units in it's composition.\n *\n * @public\n *\n * @return {GroupFireBolt} Instance of firebolt associated with canvas.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Registry peoperty accessor\n *\n * @param {Object} reg plain old javascript object keyvalue pairs. Key containing module name and value contains\n * module definition class. The reg object has to be flat object of level 1.\n */\n registry (...params) {\n if (params.length) {\n const param = params[0];\n const components = Object.assign({}, param.components);\n const componentSubRegistry = Object.assign({}, param.componentSubRegistry);\n const interactionRegistry = Object.assign({}, param.interactions);\n\n this._registry = { components, componentSubRegistry, interactions: interactionRegistry };\n const initedComponents = initCanvas(this);\n // @todo is it okay to continue this tight behaviour? If not use a resolver to resolve diff component type.\n this._composition.visualGroup = initedComponents[0];\n createGroupState(this);\n this.composition().visualGroup.alias(this.alias()).store(this._store);\n return this;\n }\n return this._registry;\n }\n\n /*\n * Prepare dependencies for top level elements\n */\n dependencies (...param) {\n if (param.length) {\n this._dependencies = param[0];\n return this;\n }\n // @todo prepare dependencies here.\n return this._dependencies;\n }\n\n /**\n *\n *\n * @param {*} lifeCycles\n *\n * @memberof Canvas\n */\n lifeCycle (lifeCycles) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n if (lifeCycles) {\n lifeCycleManager.register(lifeCycles);\n return this;\n }\n return lifeCycleManager;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof Canvas\n */\n legend (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().legend;\n }\n\n /**\n * Returns a promise for various {@link LifecycleEvents} of the various components of canvas. The promise gets\n * resolved once the particular event gets completed.\n *\n * To use this,\n * ```\n * canvas.once('layer.drawn').then(() => {\n * // Do any post drawing work here.\n * });\n * ```\n * @public\n *\n * @param {string} eventName Name of the lifecycle event.\n *\n * @return {Promise} A pending promise waiting for resolve to be called.\n */\n once (eventName) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n return lifeCycleManager.retrieve(eventName);\n }\n\n /**\n * Internal function to trigger render, this method is cognizant of all the properties of the core modules and\n * establish a passive reactivity. Passive reactivity is not always a bad thing :)\n * @internal\n */\n render () {\n const mount = this.mount();\n // removeChild(mount);\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n // Get render details including arrangement and measurement\n const renderDetails = getRenderDetails(this, mount);\n lifeCycleManager.notify({ client: this, action: 'beforedraw' });\n // Prepare the layout by triggering the matrix calculation\n prepareLayout(this.layout(), renderDetails);\n\n this._layoutManager.dimension({\n height: renderDetails.measurement.canvasHeight,\n width: renderDetails.measurement.canvasWidth\n });\n\n this._layoutManager.renderAt(mount);\n\n // Render each component\n renderLayout(this, renderDetails);\n\n setLayoutInfForUnits(this);\n\n // setLabelRotation\n setLabelRotationForAxes(this);\n\n this.firebolt().mapActionsAndBehaviour();\n }\n\n /**\n * Returns the instances of x axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the top axis and the second element represents the bottom\n * // axis.\n * [\n * [X1, X2],\n * [X3, X4]\n * ]\n * ```\n * @public\n *\n * @return {Array.} Instances of x axis.\n */\n xAxes () {\n return this.composition().visualGroup.getAxes('x');\n }\n\n /**\n * Returns the instances of y axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the left axis and the second element represents the right\n * // axis.\n * [\n * [Y1, Y2],\n * [Y3, Y4]\n * ]\n * ```\n * @public\n * @return {Array.} Instances of y axis.\n */\n yAxes () {\n return this.composition().visualGroup.getAxes('y');\n }\n\n /**\n * Returns all the retinal axis of the canvas. Color, shape and size axis are combinedly called retinal axis.\n *\n * @public\n * @return {Object} Instances of retinal axis.\n * ```\n * {\n * color: [ColorAxis], // Array of color axis.\n * shape: [ShapeAxis], // Array of shape axis.\n * size: [SizeAxis] // Array of size axis.\n * }\n * ```\n */\n getRetinalAxes () {\n const visualGroup = this.composition().visualGroup;\n return visualGroup.getAxes(RETINAL);\n }\n\n mount (...params) {\n if (params.length) {\n let value = params[0];\n if (typeof params[0] === 'string') {\n value = selectElement(params[0]).node();\n }\n this._mount = value;\n return this;\n }\n return this._mount;\n }\n}\n","import { cellRegistry, SimpleCell } from '@chartshq/visual-cell';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { layerRegistry } from '@chartshq/visual-layer';\nimport { SimpleGroup, VisualGroup } from '@chartshq/visual-group';\nimport { registry as interactionRegistry } from '@chartshq/muze-firebolt';\n\nexport const COMPONENTS = {\n [VisualGroup.formalName()]: VisualGroup,\n [VisualUnit.formalName()]: VisualUnit\n};\n\nexport const SUBREGISTRIES = {\n cells: cellRegistry,\n layers: layerRegistry\n};\nexport const INTERFACES = {\n SimpleGroup,\n SimpleCell\n};\n\nconst componentRegistry = (components = COMPONENTS) => {\n const reg = Object.assign({}, components);\n\n return {\n register: (cls) => {\n const key = cls.formalName();\n reg[key] = cls;\n return componentRegistry;\n },\n get: () => reg\n };\n};\n\nexport const registry = {\n components: componentRegistry(COMPONENTS),\n cells: cellRegistry(),\n layers: layerRegistry(),\n interactions: interactionRegistry\n};\n","import * as utils from 'muze-utils';\n\nimport { VisualUnit, helpers as unitHelpers, enums as unitEnums, UnitFireBolt } from '@chartshq/visual-unit';\nimport { VisualGroup, Encoders, encoderHelpers, groupUtils, enums as groupEnums } from '@chartshq/visual-group';\nimport {\n SurrogateSideEffect,\n SpawnableSideEffect,\n sideEffects,\n PersistentBehaviour,\n GenericBehaviour,\n VolatileBehaviour,\n behaviouralActions,\n GenericSideEffect,\n Firebolt\n} from '@chartshq/muze-firebolt';\nimport {\n layerFactory,\n BaseLayer,\n LineLayer,\n TextLayer,\n TickLayer,\n PointLayer,\n helpers,\n enums,\n SimpleLayer,\n AreaLayer,\n ArcLayer,\n layerMixins\n} from '@chartshq/visual-layer';\nimport pkg from '../package.json';\nimport * as operators from './operators';\nimport { actionModel as ActionModel } from './action-model';\nimport options from './options';\nimport { Canvas } from './canvas';\nimport { registry as globalRegistry, SUBREGISTRIES } from './default-registry';\nimport './muze.scss';\n\nconst {\n transactor,\n Smartlabel,\n enableChainedTransaction,\n LifeCycleManager,\n DataModel,\n Store\n} = utils;\n\n// Cache singleton instances which should be included only once in a page\nconst globalCache = {};\nconst defaultRegistry = globalRegistry.components;\n\nconst overrideRegistryDefinitions = (overrideRegistry, registry) => {\n overrideRegistry.forEach((def) => {\n registry.register(def);\n });\n};\n\n/**\n * Entry point to renderer. Initializes an environment with settings and registries for canvas. This is a simple wrapper\n * over {@link Canvas} which enables common configuration passing to multiple such canvases.\n *\n * Everytime `muze()` is called it creates an environment. These environment supports subset of APIs of Canvas. If\n * common configuration is used to render multiple canvases then it can be set directly in the env. Like if data is\n * common across all the visulization then its better to set the data in env. When a canvas is created it receives all\n * those configuration from env.\n *\n * ```\n * // Creates an environment\n * const env = muze()\n * // Set data property in environment, so that all the canvas created from the same environment gets this data\n * // automatically\n * env.data(dm);\n * // Creates canvas, by default env pushes data to canvas instance\n * const canvas = env.canvas();\n * ```\n *\n * If a property is set on both environment and canvas instance, property set on canvas instance gets more priority.\n *\n * @public\n * @module muze\n * @namespace Muze\n *\n * @return {Env} Instance of an environment\n */\nconst muze = () => {\n // Setters and getters will be mounted on this. Object will be mutated.\n const [env, globalStore] = transactor({}, options);\n const components = Object.assign({}, globalRegistry.components.get());\n const componentSubRegistryDef = Object.assign({}, SUBREGISTRIES);\n\n const componentSubRegistry = {};\n\n for (const prop in componentSubRegistryDef) {\n componentSubRegistry[prop] = componentSubRegistryDef[prop](globalRegistry[prop].get());\n }\n\n // Apart form the setter getter, an instance method is injected to create real renderer instances\n env.canvas = () => {\n // Create a canvas instance with this settings\n const settings = globalStore.serialize();\n const canvas = Canvas.withSettings(settings, { /* registry */\n components,\n componentSubRegistry,\n interactions: globalRegistry.interactions\n }, env.globalDependencies());\n\n // Whenever settings is changed canvas is updated\n enableChainedTransaction(globalStore, canvas, Object.keys(settings));\n\n return canvas;\n };\n\n // Global dependencies for for compositions. Only one copy of the same should be in the page\n env.globalDependencies = () => {\n if (!globalCache.smartlabel) {\n globalCache.smartlabel = new Smartlabel(1, 'body');\n }\n return {\n smartlabel: globalCache.smartlabel,\n lifeCycleManager: new LifeCycleManager()\n };\n };\n\n // Retrieves global settings. This getter is readonly so that user can't change this as change should happen\n // only from setter to avoid unwanted sync issues.\n env.settings = () => globalStore.serialize();\n\n env.registry = (...overrideRegistry) => {\n // Selectively copy the properties from COMPONENTS\n if (overrideRegistry.length) {\n overrideRegistry.forEach((def) => {\n const prop = def.formalName();\n if (prop in defaultRegistry) {\n components[prop] = def;\n }\n });\n return env;\n }\n return components;\n };\n\n env.cellRegistry = (...overrideRegistry) => {\n const cellRegistry = componentSubRegistry.cellRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry, cellRegistry);\n return env;\n }\n return cellRegistry.get();\n };\n\n env.layerRegistry = (...overrideRegistry) => {\n const layerRegistry = componentSubRegistry.layerRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry, layerRegistry);\n return env;\n }\n return layerRegistry.get();\n };\n\n return env;\n};\n\nmuze.registry = globalRegistry;\n\nmuze.Components = {\n VisualLayer: {\n layers: {\n BaseLayer,\n LineLayer,\n TextLayer,\n TickLayer,\n PointLayer,\n SimpleLayer,\n AreaLayer,\n ArcLayer\n },\n helpers,\n enums,\n layerMixins\n },\n VisualUnit: {\n constructor: VisualUnit,\n helpers: unitHelpers,\n enums: unitEnums,\n UnitFireBolt\n },\n VisualGroup: {\n constructor: VisualGroup,\n Encoders,\n encoderHelpers,\n groupUtils,\n enums: groupEnums\n },\n Canvas: {\n constructor: Canvas\n },\n Firebolt: {\n constructor: Firebolt\n }\n};\n\nconst SideEffects = {\n sideEffects,\n standards: {\n SurrogateSideEffect,\n SpawnableSideEffect,\n GenericSideEffect\n }\n};\n\nconst Behaviours = {\n behaviouralActions,\n standards: {\n GenericBehaviour,\n PersistentBehaviour,\n VolatileBehaviour\n }\n};\n\nmuze.DataModel = DataModel;\nmuze.version = pkg.version;\nmuze.SideEffects = SideEffects;\nmuze.ActionModel = ActionModel;\nmuze.layerFactory = layerFactory;\nmuze.Operators = operators;\nmuze.Behaviours = Behaviours;\nmuze.utils = utils;\nmuze.Model = new Store().model.constructor;\n\nexport default muze;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/env-keys.js b/env-keys.js new file mode 100644 index 00000000..18195eda --- /dev/null +++ b/env-keys.js @@ -0,0 +1,15 @@ +const dotenv = require('dotenv'); +const fs = require('fs-extra'); + +module.exports = () => { + let env = {}; + + fs.pathExists('./.env.build').then((exists) => { + env = exists ? dotenv.config({ path: './.env.build' }).parsed : {}; + }); + + return Object.keys(env).reduce((prev, next) => { + prev[`process.env.${next}`] = JSON.stringify(env[next]); + return prev; + }, {}); +}; diff --git a/examples/data/areaData.csv b/examples/data/areaData.csv new file mode 100644 index 00000000..516d7e65 --- /dev/null +++ b/examples/data/areaData.csv @@ -0,0 +1,9 @@ +Year,Profit,Type +2013,1000,Sales +2013,400,Expense +2014,1170,Sales +2014,460,Expense +2015,-660,Sales +2015,1120,Expense +2016,1030,Sales +2016,540,Expense \ No newline at end of file diff --git a/examples/data/cars-with-null.json b/examples/data/cars-with-null.json new file mode 100644 index 00000000..7e368596 --- /dev/null +++ b/examples/data/cars-with-null.json @@ -0,0 +1,4886 @@ +[ + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle malibu", + "Miles_per_Gallon": 18, + "Cylinders": 8, + "Displacement": 307, + "Horsepower": 130, + "Weight_in_lbs": 3504, + "Acceleration": 12, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick skylark 320", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": -350, + "Horsepower": 165, + "Weight_in_lbs": 3693, + "Acceleration": 11.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth satellite", + "Miles_per_Gallon": 18, + "Cylinders": 8, + "Displacement": -318, + "Horsepower": 150, + "Weight_in_lbs": 3436, + "Acceleration": 11, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc rebel sst", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": -304, + "Horsepower": 150, + "Weight_in_lbs": 3433, + "Acceleration": 12, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford torino", + "Miles_per_Gallon": 17, + "Cylinders": 8, + "Displacement": -302, + "Horsepower": 140, + "Weight_in_lbs": 3449, + "Acceleration": 10.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford galaxie 500", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": -429, + "Horsepower": 198, + "Weight_in_lbs": 4341, + "Acceleration": 10, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet impala", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -454, + "Horsepower": 220, + "Weight_in_lbs": 4354, + "Acceleration": 9, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth fury iii", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -440, + "Horsepower": 215, + "Weight_in_lbs": 4312, + "Acceleration": 8.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac catalina", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -455, + "Horsepower": 225, + "Weight_in_lbs": 4425, + "Acceleration": 10, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc ambassador dpl", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": -390, + "Horsepower": 190, + "Weight_in_lbs": 3850, + "Acceleration": 8.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "citroen", + "Name": "citroen ds-21 pallas", + "Miles_per_Gallon": null, + "Cylinders": 4, + "Displacement": -133, + "Horsepower": 115, + "Weight_in_lbs": 3090, + "Acceleration": 17.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle concours (sw)", + "Miles_per_Gallon": null, + "Cylinders": 8, + "Displacement": -350, + "Horsepower": 165, + "Weight_in_lbs": 4142, + "Acceleration": 11.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford torino (sw)", + "Miles_per_Gallon": null, + "Cylinders": 8, + "Displacement": -351, + "Horsepower": 153, + "Weight_in_lbs": 4034, + "Acceleration": 11, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth satellite (sw)", + "Miles_per_Gallon": null, + "Cylinders": 8, + "Displacement": -383, + "Horsepower": 175, + "Weight_in_lbs": 4166, + "Acceleration": 10.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc rebel sst (sw)", + "Miles_per_Gallon": null, + "Cylinders": 8, + "Displacement": -360, + "Horsepower": 175, + "Weight_in_lbs": 3850, + "Acceleration": 11, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge challenger se", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": -383, + "Horsepower": 170, + "Weight_in_lbs": 3563, + "Acceleration": 10, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth 'cuda 340", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -340, + "Horsepower": 160, + "Weight_in_lbs": 3609, + "Acceleration": 8, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford mustang boss 302", + "Miles_per_Gallon": null, + "Cylinders": 8, + "Displacement": -302, + "Horsepower": 140, + "Weight_in_lbs": 3353, + "Acceleration": 8, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet monte carlo", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": -400, + "Horsepower": 150, + "Weight_in_lbs": 3761, + "Acceleration": 9.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick estate wagon (sw)", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -455, + "Horsepower": 225, + "Weight_in_lbs": 3086, + "Acceleration": 10, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corona mark ii", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": -113, + "Horsepower": 95, + "Weight_in_lbs": 2372, + "Acceleration": 15, + "Year": "1970-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth duster", + "Miles_per_Gallon": 22, + "Cylinders": 6, + "Displacement": -198, + "Horsepower": 95, + "Weight_in_lbs": 2833, + "Acceleration": 15.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc hornet", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": -199, + "Horsepower": 97, + "Weight_in_lbs": 2774, + "Acceleration": 15.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford maverick", + "Miles_per_Gallon": 21, + "Cylinders": 6, + "Displacement": -200, + "Horsepower": 85, + "Weight_in_lbs": 2587, + "Acceleration": 16, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun pl510", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": -97, + "Horsepower": 88, + "Weight_in_lbs": 2130, + "Acceleration": 14.5, + "Year": "1970-01-01", + "Origin": "Japan" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen 1131 deluxe sedan", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": -97, + "Horsepower": 46, + "Weight_in_lbs": 1835, + "Acceleration": 20.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "peugeot", + "Name": "peugeot 504", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": -110, + "Horsepower": 87, + "Weight_in_lbs": 2672, + "Acceleration": 17.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "audi", + "Name": "audi 100 ls", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": -107, + "Horsepower": 90, + "Weight_in_lbs": 2430, + "Acceleration": 14.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "saab", + "Name": "saab 99e", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": -104, + "Horsepower": 95, + "Weight_in_lbs": 2375, + "Acceleration": 17.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "bmw", + "Name": "bmw 2002", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": -121, + "Horsepower": 113, + "Weight_in_lbs": 2234, + "Acceleration": 12.5, + "Year": "1970-01-01", + "Origin": "European Union" + }, + { + "Maker": "amc", + "Name": "amc gremlin", + "Miles_per_Gallon": 21, + "Cylinders": 6, + "Displacement": -199, + "Horsepower": 90, + "Weight_in_lbs": 2648, + "Acceleration": 15, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford f250", + "Miles_per_Gallon": 10, + "Cylinders": 8, + "Displacement": -360, + "Horsepower": 215, + "Weight_in_lbs": 4615, + "Acceleration": 14, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevy", + "Name": "chevy c20", + "Miles_per_Gallon": 10, + "Cylinders": 8, + "Displacement": -307, + "Horsepower": 200, + "Weight_in_lbs": 4376, + "Acceleration": 15, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge d200", + "Miles_per_Gallon": 11, + "Cylinders": 8, + "Displacement": -318, + "Horsepower": 210, + "Weight_in_lbs": 4382, + "Acceleration": 13.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "hi", + "Name": "hi 1200d", + "Miles_per_Gallon": 9, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 193, + "Weight_in_lbs": 4732, + "Acceleration": 18.5, + "Year": "1970-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun pl510", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 88, + "Weight_in_lbs": 2130, + "Acceleration": 14.5, + "Year": "1971-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet vega 2300", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 90, + "Weight_in_lbs": 2264, + "Acceleration": 15.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corona", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": -113, + "Horsepower": 95, + "Weight_in_lbs": 2228, + "Acceleration": 14, + "Year": "1971-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": -98, + "Horsepower": null, + "Weight_in_lbs": 2046, + "Acceleration": 19, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen super beetle 117", + "Miles_per_Gallon": null, + "Cylinders": 4, + "Displacement": -97, + "Horsepower": 48, + "Weight_in_lbs": 1978, + "Acceleration": 20, + "Year": "1971-01-01", + "Origin": "European Union" + }, + { + "Maker": "amc", + "Name": "amc gremlin", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": -232, + "Horsepower": 100, + "Weight_in_lbs": 2634, + "Acceleration": 13, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth satellite custom", + "Miles_per_Gallon": 16, + "Cylinders": 6, + "Displacement": -225, + "Horsepower": 105, + "Weight_in_lbs": 3439, + "Acceleration": 15.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle malibu", + "Miles_per_Gallon": 17, + "Cylinders": 6, + "Displacement": -250, + "Horsepower": 100, + "Weight_in_lbs": 3329, + "Acceleration": 15.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford torino 500", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": -250, + "Horsepower": 88, + "Weight_in_lbs": 3302, + "Acceleration": 15.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": -232, + "Horsepower": 100, + "Weight_in_lbs": 3288, + "Acceleration": 15.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet impala", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -350, + "Horsepower": 165, + "Weight_in_lbs": 4209, + "Acceleration": 12, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac catalina brougham", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -400, + "Horsepower": 175, + "Weight_in_lbs": 4464, + "Acceleration": 11.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford galaxie 500", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -351, + "Horsepower": 153, + "Weight_in_lbs": 4154, + "Acceleration": 13.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth fury iii", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -318, + "Horsepower": 150, + "Weight_in_lbs": 4096, + "Acceleration": 13, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge monaco (sw)", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": -383, + "Horsepower": 180, + "Weight_in_lbs": 4955, + "Acceleration": 11.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford country squire (sw)", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": -400, + "Horsepower": 170, + "Weight_in_lbs": 4746, + "Acceleration": 12, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac safari (sw)", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": -400, + "Horsepower": 175, + "Weight_in_lbs": 5140, + "Acceleration": 12, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc hornet sportabout (sw)", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": -258, + "Horsepower": 110, + "Weight_in_lbs": 2962, + "Acceleration": 13.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet vega (sw)", + "Miles_per_Gallon": 22, + "Cylinders": 4, + "Displacement": -140, + "Horsepower": 72, + "Weight_in_lbs": 2408, + "Acceleration": 19, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac firebird", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": -250, + "Horsepower": 100, + "Weight_in_lbs": 3282, + "Acceleration": 15, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford mustang", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": -250, + "Horsepower": 88, + "Weight_in_lbs": 3139, + "Acceleration": 14.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury capri 2000", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": -122, + "Horsepower": 86, + "Weight_in_lbs": 2220, + "Acceleration": 14, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "opel", + "Name": "opel 1900", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": -116, + "Horsepower": 90, + "Weight_in_lbs": 2123, + "Acceleration": 14, + "Year": "1971-01-01", + "Origin": "European Union" + }, + { + "Maker": "peugeot", + "Name": "peugeot 304", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": -79, + "Horsepower": 70, + "Weight_in_lbs": 2074, + "Acceleration": 19.5, + "Year": "1971-01-01", + "Origin": "European Union" + }, + { + "Maker": "fiat", + "Name": "fiat 124b", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": -88, + "Horsepower": 76, + "Weight_in_lbs": 2065, + "Acceleration": 14.5, + "Year": "1971-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota corolla 1200", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": -71, + "Horsepower": 65, + "Weight_in_lbs": 1773, + "Acceleration": 19, + "Year": "1971-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 1200", + "Miles_per_Gallon": 35, + "Cylinders": 4, + "Displacement": -72, + "Horsepower": 69, + "Weight_in_lbs": 1613, + "Acceleration": 18, + "Year": "1971-01-01", + "Origin": "Japan" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen model 111", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": -97, + "Horsepower": 60, + "Weight_in_lbs": 1834, + "Acceleration": 19, + "Year": "1971-01-01", + "Origin": "European Union" + }, + { + "Maker": "plymouth", + "Name": "plymouth cricket", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": -91, + "Horsepower": 70, + "Weight_in_lbs": 1955, + "Acceleration": 20.5, + "Year": "1971-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corona hardtop", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": -113, + "Horsepower": 95, + "Weight_in_lbs": 2278, + "Acceleration": 15.5, + "Year": "1972-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge colt hardtop", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": -97.5, + "Horsepower": 80, + "Weight_in_lbs": 2126, + "Acceleration": 17, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen type 3", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": -97, + "Horsepower": 54, + "Weight_in_lbs": 2254, + "Acceleration": 23.5, + "Year": "1972-01-01", + "Origin": "European Union" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet vega", + "Miles_per_Gallon": 20, + "Cylinders": 4, + "Displacement": -140, + "Horsepower": 90, + "Weight_in_lbs": 2408, + "Acceleration": 19.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford pinto runabout", + "Miles_per_Gallon": 21, + "Cylinders": 4, + "Displacement": -122, + "Horsepower": 86, + "Weight_in_lbs": 2226, + "Acceleration": 16.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet impala", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": -350, + "Horsepower": 165, + "Weight_in_lbs": 4274, + "Acceleration": 12, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac catalina", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": -400, + "Horsepower": 175, + "Weight_in_lbs": 4385, + "Acceleration": 12, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth fury iii", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4135, + "Acceleration": 13.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford galaxie 500", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 153, + "Weight_in_lbs": 4129, + "Acceleration": 13, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc ambassador sst", + "Miles_per_Gallon": 17, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 150, + "Weight_in_lbs": 3672, + "Acceleration": 11.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury marquis", + "Miles_per_Gallon": 11, + "Cylinders": 8, + "Displacement": 429, + "Horsepower": 208, + "Weight_in_lbs": 4633, + "Acceleration": 11, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick lesabre custom", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 155, + "Weight_in_lbs": 4502, + "Acceleration": 13.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile delta 88 royale", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 160, + "Weight_in_lbs": 4456, + "Acceleration": 13.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler newport royal", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 190, + "Weight_in_lbs": 4422, + "Acceleration": 12.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "mazda", + "Name": "mazda rx2 coupe", + "Miles_per_Gallon": 19, + "Cylinders": 3, + "Displacement": 70, + "Horsepower": 97, + "Weight_in_lbs": 2330, + "Acceleration": 13.5, + "Year": "1972-01-01", + "Origin": "Japan" + }, + { + "Maker": "amc", + "Name": "amc matador (sw)", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 150, + "Weight_in_lbs": 3892, + "Acceleration": 12.5, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle concours (sw)", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 307, + "Horsepower": 130, + "Weight_in_lbs": 4098, + "Acceleration": 14, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford gran torino (sw)", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 140, + "Weight_in_lbs": 4294, + "Acceleration": 16, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth satellite custom (sw)", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4077, + "Acceleration": 14, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "volvo", + "Name": "volvo 145e (sw)", + "Miles_per_Gallon": 18, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 112, + "Weight_in_lbs": 2933, + "Acceleration": 14.5, + "Year": "1972-01-01", + "Origin": "European Union" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen 411 (sw)", + "Miles_per_Gallon": 22, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 76, + "Weight_in_lbs": 2511, + "Acceleration": 18, + "Year": "1972-01-01", + "Origin": "European Union" + }, + { + "Maker": "peugeot", + "Name": "peugeot 504 (sw)", + "Miles_per_Gallon": 21, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 87, + "Weight_in_lbs": 2979, + "Acceleration": 19.5, + "Year": "1972-01-01", + "Origin": "European Union" + }, + { + "Maker": "renault", + "Name": "renault 12 (sw)", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 96, + "Horsepower": 69, + "Weight_in_lbs": 2189, + "Acceleration": 18, + "Year": "1972-01-01", + "Origin": "European Union" + }, + { + "Maker": "ford", + "Name": "ford pinto (sw)", + "Miles_per_Gallon": 22, + "Cylinders": 4, + "Displacement": 122, + "Horsepower": 86, + "Weight_in_lbs": 2395, + "Acceleration": 16, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 510 (sw)", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 92, + "Weight_in_lbs": 2288, + "Acceleration": 17, + "Year": "1972-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyouta", + "Name": "toyouta corona mark ii (sw)", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 97, + "Weight_in_lbs": 2506, + "Acceleration": 14.5, + "Year": "1972-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge colt (sw)", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 80, + "Weight_in_lbs": 2164, + "Acceleration": 15, + "Year": "1972-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corolla 1600 (sw)", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 88, + "Weight_in_lbs": 2100, + "Acceleration": 16.5, + "Year": "1972-01-01", + "Origin": "Japan" + }, + { + "Maker": "buick", + "Name": "buick century 350", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 175, + "Weight_in_lbs": 4100, + "Acceleration": 13, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 150, + "Weight_in_lbs": 3672, + "Acceleration": 11.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet malibu", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 145, + "Weight_in_lbs": 3988, + "Acceleration": 13, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford gran torino", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 137, + "Weight_in_lbs": 4042, + "Acceleration": 14.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge coronet custom", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 3777, + "Acceleration": 12.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury marquis brougham", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": 429, + "Horsepower": 198, + "Weight_in_lbs": 4952, + "Acceleration": 11.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet caprice classic", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 150, + "Weight_in_lbs": 4464, + "Acceleration": 12, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford ltd", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 158, + "Weight_in_lbs": 4363, + "Acceleration": 13, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth fury gran sedan", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4237, + "Acceleration": 14.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler new yorker brougham", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 440, + "Horsepower": 215, + "Weight_in_lbs": 4735, + "Acceleration": 11, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick electra 225 custom", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": 455, + "Horsepower": 225, + "Weight_in_lbs": 4951, + "Acceleration": 11, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc ambassador brougham", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 360, + "Horsepower": 175, + "Weight_in_lbs": 3821, + "Acceleration": 11, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth valiant", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 105, + "Weight_in_lbs": 3121, + "Acceleration": 16.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet nova custom", + "Miles_per_Gallon": 16, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 100, + "Weight_in_lbs": 3278, + "Acceleration": 18, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc hornet", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 100, + "Weight_in_lbs": 2945, + "Acceleration": 16, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford maverick", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 88, + "Weight_in_lbs": 3021, + "Acceleration": 16.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth duster", + "Miles_per_Gallon": 23, + "Cylinders": 6, + "Displacement": 198, + "Horsepower": 95, + "Weight_in_lbs": 2904, + "Acceleration": 16, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen super beetle", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 46, + "Weight_in_lbs": 1950, + "Acceleration": 21, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet impala", + "Miles_per_Gallon": 11, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 150, + "Weight_in_lbs": 4997, + "Acceleration": 14, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford country", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 167, + "Weight_in_lbs": 4906, + "Acceleration": 12.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth custom suburb", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 360, + "Horsepower": 170, + "Weight_in_lbs": 4654, + "Acceleration": 13, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile vista cruiser", + "Miles_per_Gallon": 12, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 180, + "Weight_in_lbs": 4499, + "Acceleration": 12.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc gremlin", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 100, + "Weight_in_lbs": 2789, + "Acceleration": 15, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota carina", + "Miles_per_Gallon": 20, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 88, + "Weight_in_lbs": 2279, + "Acceleration": 19, + "Year": "1973-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet vega", + "Miles_per_Gallon": 21, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 72, + "Weight_in_lbs": 2401, + "Acceleration": 19.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 610", + "Miles_per_Gallon": 22, + "Cylinders": 4, + "Displacement": 108, + "Horsepower": 94, + "Weight_in_lbs": 2379, + "Acceleration": 16.5, + "Year": "1973-01-01", + "Origin": "Japan" + }, + { + "Maker": "maxda", + "Name": "maxda rx3", + "Miles_per_Gallon": 18, + "Cylinders": 3, + "Displacement": 70, + "Horsepower": 90, + "Weight_in_lbs": 2124, + "Acceleration": 13.5, + "Year": "1973-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 19, + "Cylinders": 4, + "Displacement": 122, + "Horsepower": 85, + "Weight_in_lbs": 2310, + "Acceleration": 18.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury capri v6", + "Miles_per_Gallon": 21, + "Cylinders": 6, + "Displacement": 155, + "Horsepower": 107, + "Weight_in_lbs": 2472, + "Acceleration": 14, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "fiat", + "Name": "fiat 124 sport coupe", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 90, + "Weight_in_lbs": 2265, + "Acceleration": 15.5, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet monte carlo s", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 145, + "Weight_in_lbs": 4082, + "Acceleration": 13, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac grand prix", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 230, + "Weight_in_lbs": 4278, + "Acceleration": 9.5, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "fiat", + "Name": "fiat 128", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 68, + "Horsepower": 49, + "Weight_in_lbs": 1867, + "Acceleration": 19.5, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "opel", + "Name": "opel manta", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 116, + "Horsepower": 75, + "Weight_in_lbs": 2158, + "Acceleration": 15.5, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "audi", + "Name": "audi 100ls", + "Miles_per_Gallon": 20, + "Cylinders": 4, + "Displacement": 114, + "Horsepower": 91, + "Weight_in_lbs": 2582, + "Acceleration": 14, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "volvo", + "Name": "volvo 144ea", + "Miles_per_Gallon": 19, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 112, + "Weight_in_lbs": 2868, + "Acceleration": 15.5, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "dodge", + "Name": "dodge dart custom", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 3399, + "Acceleration": 11, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "saab", + "Name": "saab 99le", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 110, + "Weight_in_lbs": 2660, + "Acceleration": 14, + "Year": "1973-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota mark ii", + "Miles_per_Gallon": 20, + "Cylinders": 6, + "Displacement": 156, + "Horsepower": 122, + "Weight_in_lbs": 2807, + "Acceleration": 13.5, + "Year": "1973-01-01", + "Origin": "Japan" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile omega", + "Miles_per_Gallon": 11, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 180, + "Weight_in_lbs": 3664, + "Acceleration": 11, + "Year": "1973-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth duster", + "Miles_per_Gallon": 20, + "Cylinders": 6, + "Displacement": 198, + "Horsepower": 95, + "Weight_in_lbs": 3102, + "Acceleration": 16.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford maverick", + "Miles_per_Gallon": 21, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": null, + "Weight_in_lbs": 2875, + "Acceleration": 17, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc hornet", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 100, + "Weight_in_lbs": 2901, + "Acceleration": 16, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet nova", + "Miles_per_Gallon": 15, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 100, + "Weight_in_lbs": 3336, + "Acceleration": 17, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun b210", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 79, + "Horsepower": 67, + "Weight_in_lbs": 1950, + "Acceleration": 19, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 122, + "Horsepower": 80, + "Weight_in_lbs": 2451, + "Acceleration": 16.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corolla 1200", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 71, + "Horsepower": 65, + "Weight_in_lbs": 1836, + "Acceleration": 21, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet vega", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 75, + "Weight_in_lbs": 2542, + "Acceleration": 17, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle malibu classic", + "Miles_per_Gallon": 16, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 100, + "Weight_in_lbs": 3781, + "Acceleration": 17, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador", + "Miles_per_Gallon": 16, + "Cylinders": 6, + "Displacement": 258, + "Horsepower": 110, + "Weight_in_lbs": 3632, + "Acceleration": 18, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth satellite sebring", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 105, + "Weight_in_lbs": 3613, + "Acceleration": 16.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford gran torino", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 140, + "Weight_in_lbs": 4141, + "Acceleration": 14, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick century luxus (sw)", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 150, + "Weight_in_lbs": 4699, + "Acceleration": 14.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge coronet custom (sw)", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4457, + "Acceleration": 13.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford gran torino (sw)", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 140, + "Weight_in_lbs": 4638, + "Acceleration": 16, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador (sw)", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 150, + "Weight_in_lbs": 4257, + "Acceleration": 15.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "audi", + "Name": "audi fox", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 83, + "Weight_in_lbs": 2219, + "Acceleration": 16.5, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen dasher", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 79, + "Horsepower": 67, + "Weight_in_lbs": 1963, + "Acceleration": 15.5, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "opel", + "Name": "opel manta", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 78, + "Weight_in_lbs": 2300, + "Acceleration": 14.5, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota corona", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 76, + "Horsepower": 52, + "Weight_in_lbs": 1649, + "Acceleration": 16.5, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 710", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 83, + "Horsepower": 61, + "Weight_in_lbs": 2003, + "Acceleration": 19, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge colt", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 75, + "Weight_in_lbs": 2125, + "Acceleration": 14.5, + "Year": "1974-01-01", + "Origin": "Holland" + }, + { + "Maker": "fiat", + "Name": "fiat 128", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 75, + "Weight_in_lbs": 2108, + "Acceleration": 15.5, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "fiat", + "Name": "fiat 124 tc", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 116, + "Horsepower": 75, + "Weight_in_lbs": 2246, + "Acceleration": 14, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda civic", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 97, + "Weight_in_lbs": 2489, + "Acceleration": 15, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Name": "subaru", + "Maker": "subaru", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 108, + "Horsepower": 93, + "Weight_in_lbs": 2391, + "Acceleration": 15.5, + "Year": "1974-01-01", + "Origin": "Japan" + }, + { + "Maker": "fiat", + "Name": "fiat x1.9", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 79, + "Horsepower": 67, + "Weight_in_lbs": 2000, + "Acceleration": 16, + "Year": "1974-01-01", + "Origin": "European Union" + }, + { + "Maker": "plymouth", + "Name": "plymouth valiant custom", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 95, + "Weight_in_lbs": 3264, + "Acceleration": 16, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet nova", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 105, + "Weight_in_lbs": 3459, + "Acceleration": 16, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury monarch", + "Miles_per_Gallon": 15, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 72, + "Weight_in_lbs": 3432, + "Acceleration": 21, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford maverick", + "Miles_per_Gallon": 15, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 72, + "Weight_in_lbs": 3158, + "Acceleration": 19.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac catalina", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 170, + "Weight_in_lbs": 4668, + "Acceleration": 11.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet bel air", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 145, + "Weight_in_lbs": 4440, + "Acceleration": 14, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth grand fury", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4498, + "Acceleration": 14.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford ltd", + "Miles_per_Gallon": 14, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 148, + "Weight_in_lbs": 4657, + "Acceleration": 13.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick century", + "Miles_per_Gallon": 17, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 110, + "Weight_in_lbs": 3907, + "Acceleration": 21, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevroelt", + "Name": "chevroelt chevelle malibu", + "Miles_per_Gallon": 16, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 105, + "Weight_in_lbs": 3897, + "Acceleration": 18.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador", + "Miles_per_Gallon": 15, + "Cylinders": 6, + "Displacement": 258, + "Horsepower": 110, + "Weight_in_lbs": 3730, + "Acceleration": 19, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth fury", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 95, + "Weight_in_lbs": 3785, + "Acceleration": 19, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick skyhawk", + "Miles_per_Gallon": 21, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 110, + "Weight_in_lbs": 3039, + "Acceleration": 15, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet monza 2+2", + "Miles_per_Gallon": 20, + "Cylinders": 8, + "Displacement": 262, + "Horsepower": 110, + "Weight_in_lbs": 3221, + "Acceleration": 13.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford mustang ii", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 129, + "Weight_in_lbs": 3169, + "Acceleration": 12, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corolla", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 75, + "Weight_in_lbs": 2171, + "Acceleration": 16, + "Year": "1975-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 83, + "Weight_in_lbs": 2639, + "Acceleration": 17, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc gremlin", + "Miles_per_Gallon": 20, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 100, + "Weight_in_lbs": 2914, + "Acceleration": 16, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac astro", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 78, + "Weight_in_lbs": 2592, + "Acceleration": 18.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corona", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 134, + "Horsepower": 96, + "Weight_in_lbs": 2702, + "Acceleration": 13.5, + "Year": "1975-01-01", + "Origin": "Japan" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen dasher", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 71, + "Weight_in_lbs": 2223, + "Acceleration": 16.5, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "datsun", + "Name": "datsun 710", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 97, + "Weight_in_lbs": 2545, + "Acceleration": 17, + "Year": "1975-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 171, + "Horsepower": 97, + "Weight_in_lbs": 2984, + "Acceleration": 14.5, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen rabbit", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 70, + "Weight_in_lbs": 1937, + "Acceleration": 14, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "amc", + "Name": "amc pacer", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 90, + "Weight_in_lbs": 3211, + "Acceleration": 17, + "Year": "1975-01-01", + "Origin": "Holland" + }, + { + "Maker": "audi", + "Name": "audi 100ls", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 115, + "Horsepower": 95, + "Weight_in_lbs": 2694, + "Acceleration": 15, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "peugeot", + "Name": "peugeot 504", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 88, + "Weight_in_lbs": 2957, + "Acceleration": 17, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "volvo", + "Name": "volvo 244dl", + "Miles_per_Gallon": 22, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 98, + "Weight_in_lbs": 2945, + "Acceleration": 14.5, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "saab", + "Name": "saab 99le", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 115, + "Weight_in_lbs": 2671, + "Acceleration": 13.5, + "Year": "1975-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda civic cvcc", + "Miles_per_Gallon": 33, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 53, + "Weight_in_lbs": 1795, + "Acceleration": 17.5, + "Year": "1975-01-01", + "Origin": "Japan" + }, + { + "Maker": "fiat", + "Name": "fiat 131", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 107, + "Horsepower": 86, + "Weight_in_lbs": 2464, + "Acceleration": 15.5, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "opel", + "Name": "opel 1900", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": 116, + "Horsepower": 81, + "Weight_in_lbs": 2220, + "Acceleration": 16.9, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "capri", + "Name": "capri ii", + "Miles_per_Gallon": 25, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 92, + "Weight_in_lbs": 2572, + "Acceleration": 14.9, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge colt", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 79, + "Weight_in_lbs": 2255, + "Acceleration": 17.7, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "renault", + "Name": "renault 12tl", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 101, + "Horsepower": 83, + "Weight_in_lbs": 2202, + "Acceleration": 15.3, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevelle malibu classic", + "Miles_per_Gallon": 17.5, + "Cylinders": 8, + "Displacement": 305, + "Horsepower": 140, + "Weight_in_lbs": 4215, + "Acceleration": 13, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge coronet brougham", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 4190, + "Acceleration": 13, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc matador", + "Miles_per_Gallon": 15.5, + "Cylinders": 8, + "Displacement": 304, + "Horsepower": 120, + "Weight_in_lbs": 3962, + "Acceleration": 13.9, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford gran torino", + "Miles_per_Gallon": 14.5, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 152, + "Weight_in_lbs": 4215, + "Acceleration": 12.8, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth valiant", + "Miles_per_Gallon": 22, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 100, + "Weight_in_lbs": 3233, + "Acceleration": 15.4, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet nova", + "Miles_per_Gallon": 22, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 105, + "Weight_in_lbs": 3353, + "Acceleration": 14.5, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford maverick", + "Miles_per_Gallon": 24, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 81, + "Weight_in_lbs": 3012, + "Acceleration": 17.6, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc hornet", + "Miles_per_Gallon": 22.5, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 90, + "Weight_in_lbs": 3085, + "Acceleration": 17.6, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevette", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 52, + "Weight_in_lbs": 2035, + "Acceleration": 22.2, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet woody", + "Miles_per_Gallon": 24.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 60, + "Weight_in_lbs": 2164, + "Acceleration": 22.1, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "vw", + "Name": "vw rabbit", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 70, + "Weight_in_lbs": 1937, + "Acceleration": 14.2, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda civic", + "Miles_per_Gallon": 33, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 53, + "Weight_in_lbs": 1795, + "Acceleration": 17.4, + "Year": "1976-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge aspen se", + "Miles_per_Gallon": 20, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 100, + "Weight_in_lbs": 3651, + "Acceleration": 17.7, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford granada ghia", + "Miles_per_Gallon": 18, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 78, + "Weight_in_lbs": 3574, + "Acceleration": 21, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac ventura sj", + "Miles_per_Gallon": 18.5, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 110, + "Weight_in_lbs": 3645, + "Acceleration": 16.2, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc pacer d/l", + "Miles_per_Gallon": 17.5, + "Cylinders": 6, + "Displacement": 258, + "Horsepower": 95, + "Weight_in_lbs": 3193, + "Acceleration": 17.8, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen rabbit", + "Miles_per_Gallon": 29.5, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 71, + "Weight_in_lbs": 1825, + "Acceleration": 12.2, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "datsun", + "Name": "datsun b-210", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 70, + "Weight_in_lbs": 1990, + "Acceleration": 17, + "Year": "1976-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyota", + "Name": "toyota corolla", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 75, + "Weight_in_lbs": 2155, + "Acceleration": 16.4, + "Year": "1976-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford pinto", + "Miles_per_Gallon": 26.5, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 72, + "Weight_in_lbs": 2565, + "Acceleration": 13.6, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "volvo", + "Name": "volvo 245", + "Miles_per_Gallon": 20, + "Cylinders": 4, + "Displacement": 130, + "Horsepower": 102, + "Weight_in_lbs": 3150, + "Acceleration": 15.7, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "plymouth", + "Name": "plymouth volare premier v8", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 3940, + "Acceleration": 13.2, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "peugeot", + "Name": "peugeot 504", + "Miles_per_Gallon": 19, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 88, + "Weight_in_lbs": 3270, + "Acceleration": 21.9, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota mark ii", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": 156, + "Horsepower": 108, + "Weight_in_lbs": 2930, + "Acceleration": 15.5, + "Year": "1976-01-01", + "Origin": "Japan" + }, + { + "Name": "mercedes-benz 280s", + "Maker": "mercedes", + "Miles_per_Gallon": 16.5, + "Cylinders": 6, + "Displacement": 168, + "Horsepower": 120, + "Weight_in_lbs": 3820, + "Acceleration": 16.7, + "Year": "1976-01-01", + "Origin": "European Union" + }, + { + "Maker": "cadillac", + "Name": "cadillac seville", + "Miles_per_Gallon": 16.5, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 180, + "Weight_in_lbs": 4380, + "Acceleration": 12.1, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevy", + "Name": "chevy c10", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 145, + "Weight_in_lbs": 4055, + "Acceleration": 12, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford f108", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 130, + "Weight_in_lbs": 3870, + "Acceleration": 15, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge d100", + "Miles_per_Gallon": 13, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 150, + "Weight_in_lbs": 3755, + "Acceleration": 14, + "Year": "1976-01-01", + "Origin": "Holland" + }, + { + "Maker": "honda", + "Name": "honda Accelerationord cvcc", + "Miles_per_Gallon": 31.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 68, + "Weight_in_lbs": 2045, + "Acceleration": 18.5, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "buick", + "Name": "buick opel isuzu deluxe", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": 111, + "Horsepower": 80, + "Weight_in_lbs": 2155, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "renault", + "Name": "renault 5 gtl", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 79, + "Horsepower": 58, + "Weight_in_lbs": 1825, + "Acceleration": 18.6, + "Year": "1977-01-01", + "Origin": "European Union" + }, + { + "Maker": "plymouth", + "Name": "plymouth arrow gs", + "Miles_per_Gallon": 25.5, + "Cylinders": 4, + "Displacement": 122, + "Horsepower": 96, + "Weight_in_lbs": 2300, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun f-10 hatchback", + "Miles_per_Gallon": 33.5, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 70, + "Weight_in_lbs": 1945, + "Acceleration": 16.8, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet caprice classic", + "Miles_per_Gallon": 17.5, + "Cylinders": 8, + "Displacement": 305, + "Horsepower": 145, + "Weight_in_lbs": 3880, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile cutlass supreme", + "Miles_per_Gallon": 17, + "Cylinders": 8, + "Displacement": 260, + "Horsepower": 110, + "Weight_in_lbs": 4060, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge monaco brougham", + "Miles_per_Gallon": 15.5, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 145, + "Weight_in_lbs": 4140, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury cougar brougham", + "Miles_per_Gallon": 15, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 130, + "Weight_in_lbs": 4295, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet concours", + "Miles_per_Gallon": 17.5, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 110, + "Weight_in_lbs": 3520, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick skylark", + "Miles_per_Gallon": 20.5, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 105, + "Weight_in_lbs": 3425, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth volare custom", + "Miles_per_Gallon": 19, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 100, + "Weight_in_lbs": 3630, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford granada", + "Miles_per_Gallon": 18.5, + "Cylinders": 6, + "Displacement": 250, + "Horsepower": 98, + "Weight_in_lbs": 3525, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac grand prix lj", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 180, + "Weight_in_lbs": 4220, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet monte carlo landau", + "Miles_per_Gallon": 15.5, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 170, + "Weight_in_lbs": 4165, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler cordoba", + "Miles_per_Gallon": 15.5, + "Cylinders": 8, + "Displacement": 400, + "Horsepower": 190, + "Weight_in_lbs": 4325, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford thunderbird", + "Miles_per_Gallon": 16, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 149, + "Weight_in_lbs": 4335, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen rabbit custom", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 78, + "Weight_in_lbs": 1940, + "Acceleration": 0, + "Year": "1977-01-01", + "Origin": "European Union" + }, + { + "Maker": "pontiac", + "Name": "pontiac sunbird coupe", + "Miles_per_Gallon": 24.5, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 88, + "Weight_in_lbs": 2740, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corolla liftback", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 75, + "Weight_in_lbs": 2265, + "Acceleration": 0, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "ford", + "Name": "ford mustang ii 2+2", + "Miles_per_Gallon": 25.5, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 89, + "Weight_in_lbs": 2755, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevette", + "Miles_per_Gallon": 30.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 63, + "Weight_in_lbs": 2051, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge colt m/m", + "Miles_per_Gallon": 33.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 83, + "Weight_in_lbs": 2075, + "Acceleration": null, + "Year": "1977-01-01", + "Origin": "Holland" + }, + { + "Maker": "subaru", + "Name": "subaru dl", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 67, + "Weight_in_lbs": 1985, + "Acceleration": 16.4, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen dasher", + "Miles_per_Gallon": 30.5, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 78, + "Weight_in_lbs": 2190, + "Acceleration": 14.1, + "Year": "1977-01-01", + "Origin": "European Union" + }, + { + "Maker": "datsun", + "Name": "datsun 810", + "Miles_per_Gallon": 22, + "Cylinders": 6, + "Displacement": 146, + "Horsepower": 97, + "Weight_in_lbs": 2815, + "Acceleration": 14.5, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "bmw", + "Name": "bmw 320i", + "Miles_per_Gallon": 21.5, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 110, + "Weight_in_lbs": 2600, + "Acceleration": 12.8, + "Year": "1977-01-01", + "Origin": "European Union" + }, + { + "Maker": "mazda", + "Name": "mazda rx-4", + "Miles_per_Gallon": 21.5, + "Cylinders": 3, + "Displacement": 80, + "Horsepower": 110, + "Weight_in_lbs": 2720, + "Acceleration": 13.5, + "Year": "1977-01-01", + "Origin": "Japan" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen rabbit custom diesel", + "Miles_per_Gallon": 43.1, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 48, + "Weight_in_lbs": 1985, + "Acceleration": 21.5, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "ford", + "Name": "ford fiesta", + "Miles_per_Gallon": 36.1, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 66, + "Weight_in_lbs": 1800, + "Acceleration": 14.4, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "mazda", + "Name": "mazda glc deluxe", + "Miles_per_Gallon": 32.8, + "Cylinders": 4, + "Displacement": 78, + "Horsepower": 52, + "Weight_in_lbs": 1985, + "Acceleration": 19.4, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun b210 gx", + "Miles_per_Gallon": 39.4, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 70, + "Weight_in_lbs": 2070, + "Acceleration": 18.6, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "honda", + "Name": "honda civic cvcc", + "Miles_per_Gallon": 36.1, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 60, + "Weight_in_lbs": 1800, + "Acceleration": 16.4, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile cutlass salon brougham", + "Miles_per_Gallon": 19.9, + "Cylinders": 8, + "Displacement": 260, + "Horsepower": 110, + "Weight_in_lbs": 3365, + "Acceleration": 15.5, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge diplomat", + "Miles_per_Gallon": 19.4, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 140, + "Weight_in_lbs": 3735, + "Acceleration": 13.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury monarch ghia", + "Miles_per_Gallon": 20.2, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 139, + "Weight_in_lbs": 3570, + "Acceleration": 12.8, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac phoenix lj", + "Miles_per_Gallon": 19.2, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 105, + "Weight_in_lbs": 3535, + "Acceleration": 19.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet malibu", + "Miles_per_Gallon": 20.5, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 95, + "Weight_in_lbs": 3155, + "Acceleration": 18.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford fairmont (auto)", + "Miles_per_Gallon": 20.2, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 85, + "Weight_in_lbs": 2965, + "Acceleration": 15.8, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford fairmont (man)", + "Miles_per_Gallon": 25.1, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 88, + "Weight_in_lbs": 2720, + "Acceleration": 15.4, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth volare", + "Miles_per_Gallon": 20.5, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 100, + "Weight_in_lbs": 3430, + "Acceleration": 17.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc concord", + "Miles_per_Gallon": 19.4, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 90, + "Weight_in_lbs": 3210, + "Acceleration": 17.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick century special", + "Miles_per_Gallon": 20.6, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 105, + "Weight_in_lbs": 3380, + "Acceleration": 15.8, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury zephyr", + "Miles_per_Gallon": 20.8, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 85, + "Weight_in_lbs": 3070, + "Acceleration": 16.7, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge aspen", + "Miles_per_Gallon": 18.6, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 110, + "Weight_in_lbs": 3620, + "Acceleration": 18.7, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc concord d/l", + "Miles_per_Gallon": 18.1, + "Cylinders": 6, + "Displacement": 258, + "Horsepower": 120, + "Weight_in_lbs": 3410, + "Acceleration": 15.1, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet monte carlo landau", + "Miles_per_Gallon": 19.2, + "Cylinders": 8, + "Displacement": 305, + "Horsepower": 145, + "Weight_in_lbs": 3425, + "Acceleration": 13.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick regal sport coupe (turbo)", + "Miles_per_Gallon": 17.7, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 165, + "Weight_in_lbs": 3445, + "Acceleration": 13.4, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford futura", + "Miles_per_Gallon": 18.1, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 139, + "Weight_in_lbs": 3205, + "Acceleration": 11.2, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge magnum xe", + "Miles_per_Gallon": 17.5, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 140, + "Weight_in_lbs": 4080, + "Acceleration": 13.7, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevette", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 68, + "Weight_in_lbs": 2155, + "Acceleration": 16.5, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota corona", + "Miles_per_Gallon": 27.5, + "Cylinders": 4, + "Displacement": 134, + "Horsepower": 95, + "Weight_in_lbs": 2560, + "Acceleration": 14.2, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 510", + "Miles_per_Gallon": 27.2, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 97, + "Weight_in_lbs": 2300, + "Acceleration": 14.7, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge omni", + "Miles_per_Gallon": 30.9, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 75, + "Weight_in_lbs": 2230, + "Acceleration": 14.5, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota celica gt liftback", + "Miles_per_Gallon": 21.1, + "Cylinders": 4, + "Displacement": 134, + "Horsepower": 95, + "Weight_in_lbs": 2515, + "Acceleration": 14.8, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth sapporo", + "Miles_per_Gallon": 23.2, + "Cylinders": 4, + "Displacement": 156, + "Horsepower": 105, + "Weight_in_lbs": 2745, + "Acceleration": 16.7, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile starfire sx", + "Miles_per_Gallon": 23.8, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 85, + "Weight_in_lbs": 2855, + "Acceleration": 17.6, + "Year": "1978-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 200-sx", + "Miles_per_Gallon": 23.9, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 97, + "Weight_in_lbs": 2405, + "Acceleration": 14.9, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "audi", + "Name": "audi 5000", + "Miles_per_Gallon": 20.3, + "Cylinders": 5, + "Displacement": 131, + "Horsepower": 103, + "Weight_in_lbs": 2830, + "Acceleration": 15.9, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "volvo", + "Name": "volvo 264gl", + "Miles_per_Gallon": 17, + "Cylinders": 6, + "Displacement": 163, + "Horsepower": 125, + "Weight_in_lbs": 3140, + "Acceleration": 13.6, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "saab", + "Name": "saab 99gle", + "Miles_per_Gallon": 21.6, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 115, + "Weight_in_lbs": 2795, + "Acceleration": 15.7, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "peugeot", + "Name": "peugeot 604sl", + "Miles_per_Gallon": 16.2, + "Cylinders": 6, + "Displacement": 163, + "Horsepower": 133, + "Weight_in_lbs": 3410, + "Acceleration": 15.8, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen scirocco", + "Miles_per_Gallon": 31.5, + "Cylinders": 4, + "Displacement": 89, + "Horsepower": 71, + "Weight_in_lbs": 1990, + "Acceleration": 14.9, + "Year": "1978-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda Accelerationord lx", + "Miles_per_Gallon": 29.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 68, + "Weight_in_lbs": 2135, + "Acceleration": 16.6, + "Year": "1978-01-01", + "Origin": "Japan" + }, + { + "Maker": "pontiac", + "Name": "pontiac lemans v6", + "Miles_per_Gallon": 21.5, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 115, + "Weight_in_lbs": 3245, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury zephyr 6", + "Miles_per_Gallon": 19.8, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 85, + "Weight_in_lbs": 2990, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford fairmont 4", + "Miles_per_Gallon": 22.3, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 88, + "Weight_in_lbs": 2890, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc concord dl 6", + "Miles_per_Gallon": 20.2, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 90, + "Weight_in_lbs": 3265, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge aspen 6", + "Miles_per_Gallon": 20.6, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 110, + "Weight_in_lbs": 3360, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet caprice classic", + "Miles_per_Gallon": 17, + "Cylinders": 8, + "Displacement": 305, + "Horsepower": 130, + "Weight_in_lbs": 3840, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford ltd landau", + "Miles_per_Gallon": 17.6, + "Cylinders": 8, + "Displacement": 302, + "Horsepower": 129, + "Weight_in_lbs": 3725, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury grand marquis", + "Miles_per_Gallon": 16.5, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 138, + "Weight_in_lbs": 3955, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge st. regis", + "Miles_per_Gallon": 18.2, + "Cylinders": 8, + "Displacement": 318, + "Horsepower": 135, + "Weight_in_lbs": 3830, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick estate wagon (sw)", + "Miles_per_Gallon": 16.9, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 155, + "Weight_in_lbs": 4360, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford country squire (sw)", + "Miles_per_Gallon": 15.5, + "Cylinders": 8, + "Displacement": 351, + "Horsepower": 142, + "Weight_in_lbs": 4054, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet malibu classic (sw)", + "Miles_per_Gallon": 19.2, + "Cylinders": 8, + "Displacement": 267, + "Horsepower": 125, + "Weight_in_lbs": 3605, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler lebaron town @ country (sw)", + "Miles_per_Gallon": 18.5, + "Cylinders": 8, + "Displacement": 360, + "Horsepower": 150, + "Weight_in_lbs": 3940, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "vw", + "Name": "vw rabbit custom", + "Miles_per_Gallon": 31.9, + "Cylinders": 4, + "Displacement": 89, + "Horsepower": 71, + "Weight_in_lbs": 1925, + "Acceleration": 14, + "Year": "1979-01-01", + "Origin": "European Union" + }, + { + "Maker": "maxda", + "Name": "maxda glc deluxe", + "Miles_per_Gallon": 34.1, + "Cylinders": 4, + "Displacement": 86, + "Horsepower": 65, + "Weight_in_lbs": 1975, + "Acceleration": 15.2, + "Year": "1979-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge colt hatchback custom", + "Miles_per_Gallon": 35.7, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 80, + "Weight_in_lbs": 1915, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc spirit dl", + "Miles_per_Gallon": 27.4, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 80, + "Weight_in_lbs": 2670, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercedes", + "Name": "mercedes benz 300d", + "Miles_per_Gallon": 25.4, + "Cylinders": 5, + "Displacement": 183, + "Horsepower": 77, + "Weight_in_lbs": 3530, + "Acceleration": 20.1, + "Year": "1979-01-01", + "Origin": "European Union" + }, + { + "Maker": "cadillac", + "Name": "cadillac eldorado", + "Miles_per_Gallon": 23, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 125, + "Weight_in_lbs": 3900, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "peugeot", + "Name": "peugeot 504", + "Miles_per_Gallon": 27.2, + "Cylinders": 4, + "Displacement": 141, + "Horsepower": 71, + "Weight_in_lbs": 3190, + "Acceleration": 24.8, + "Year": "1979-01-01", + "Origin": "European Union" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile cutlass salon brougham", + "Miles_per_Gallon": 23.9, + "Cylinders": 8, + "Displacement": 260, + "Horsepower": 90, + "Weight_in_lbs": 3420, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth horizon", + "Miles_per_Gallon": 34.2, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 70, + "Weight_in_lbs": 2200, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth horizon tc3", + "Miles_per_Gallon": 34.5, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 70, + "Weight_in_lbs": 2150, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 210", + "Miles_per_Gallon": 31.8, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 65, + "Weight_in_lbs": 2020, + "Acceleration": 19.2, + "Year": "1979-01-01", + "Origin": "Japan" + }, + { + "Maker": "fiat", + "Name": "fiat strada custom", + "Miles_per_Gallon": 37.3, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 69, + "Weight_in_lbs": 2130, + "Acceleration": 14.7, + "Year": "1979-01-01", + "Origin": "European Union" + }, + { + "Maker": "buick", + "Name": "buick skylark limited", + "Miles_per_Gallon": 28.4, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 2670, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet citation", + "Miles_per_Gallon": 28.8, + "Cylinders": 6, + "Displacement": 173, + "Horsepower": 115, + "Weight_in_lbs": 2595, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile omega brougham", + "Miles_per_Gallon": 26.8, + "Cylinders": 6, + "Displacement": 173, + "Horsepower": 115, + "Weight_in_lbs": 2700, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac phoenix", + "Miles_per_Gallon": 33.5, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 2556, + "Acceleration": null, + "Year": "1979-01-01", + "Origin": "Holland" + }, + { + "Maker": "vw", + "Name": "vw rabbit", + "Miles_per_Gallon": 41.5, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 76, + "Weight_in_lbs": 2144, + "Acceleration": 14.7, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota corolla tercel", + "Miles_per_Gallon": 38.1, + "Cylinders": 4, + "Displacement": 89, + "Horsepower": 60, + "Weight_in_lbs": 1968, + "Acceleration": 18.8, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet chevette", + "Miles_per_Gallon": 32.1, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 70, + "Weight_in_lbs": 2120, + "Acceleration": 15.5, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 310", + "Miles_per_Gallon": 37.2, + "Cylinders": 4, + "Displacement": 86, + "Horsepower": 65, + "Weight_in_lbs": 2019, + "Acceleration": 16.4, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet citation", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 2678, + "Acceleration": 16.5, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford fairmont", + "Miles_per_Gallon": 26.4, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 88, + "Weight_in_lbs": 2870, + "Acceleration": 18.1, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc concord", + "Miles_per_Gallon": 24.3, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 3003, + "Acceleration": 20.1, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge aspen", + "Miles_per_Gallon": 19.1, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 90, + "Weight_in_lbs": 3381, + "Acceleration": 18.7, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "audi", + "Name": "audi 4000", + "Miles_per_Gallon": 34.3, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 78, + "Weight_in_lbs": 2188, + "Acceleration": 15.8, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota corona liftback", + "Miles_per_Gallon": 29.8, + "Cylinders": 4, + "Displacement": 134, + "Horsepower": 90, + "Weight_in_lbs": 2711, + "Acceleration": 15.5, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda 626", + "Miles_per_Gallon": 31.3, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 75, + "Weight_in_lbs": 2542, + "Acceleration": 17.5, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 510 hatchback", + "Miles_per_Gallon": 37, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 92, + "Weight_in_lbs": 2434, + "Acceleration": 15, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyota", + "Name": "toyota corolla", + "Miles_per_Gallon": 32.2, + "Cylinders": 4, + "Displacement": 108, + "Horsepower": 75, + "Weight_in_lbs": 2265, + "Acceleration": 15.2, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda glc", + "Miles_per_Gallon": 46.6, + "Cylinders": 4, + "Displacement": 86, + "Horsepower": 65, + "Weight_in_lbs": 2110, + "Acceleration": 17.9, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge colt", + "Miles_per_Gallon": 27.9, + "Cylinders": 4, + "Displacement": 156, + "Horsepower": 105, + "Weight_in_lbs": 2800, + "Acceleration": 14.4, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "datsun", + "Name": "datsun 210", + "Miles_per_Gallon": 40.8, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 65, + "Weight_in_lbs": 2110, + "Acceleration": 19.2, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "vw", + "Name": "vw rabbit c (diesel)", + "Miles_per_Gallon": 44.3, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 48, + "Weight_in_lbs": 2085, + "Acceleration": 21.7, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "vw", + "Name": "vw dasher (diesel)", + "Miles_per_Gallon": 43.4, + "Cylinders": 4, + "Displacement": 90, + "Horsepower": 48, + "Weight_in_lbs": 2335, + "Acceleration": 23.7, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "audi", + "Name": "audi 5000s (diesel)", + "Miles_per_Gallon": 36.4, + "Cylinders": 5, + "Displacement": 121, + "Horsepower": 67, + "Weight_in_lbs": 2950, + "Acceleration": 19.9, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Name": "mercedes-benz 240d", + "Maker": "mercedes", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": 146, + "Horsepower": 67, + "Weight_in_lbs": 3250, + "Acceleration": 21.8, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda civic 1500 gl", + "Miles_per_Gallon": 44.6, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 67, + "Weight_in_lbs": 1850, + "Acceleration": 13.8, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "renault", + "Name": "renault lecar deluxe", + "Miles_per_Gallon": 40.9, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": null, + "Weight_in_lbs": 1835, + "Acceleration": 17.3, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "subaru", + "Name": "subaru dl", + "Miles_per_Gallon": 33.8, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 67, + "Weight_in_lbs": 2145, + "Acceleration": 18, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "vokswagen", + "Name": "vokswagen rabbit", + "Miles_per_Gallon": 29.8, + "Cylinders": 4, + "Displacement": 89, + "Horsepower": 62, + "Weight_in_lbs": 1845, + "Acceleration": 15.3, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "datsun", + "Name": "datsun 280-zx", + "Miles_per_Gallon": 32.7, + "Cylinders": 6, + "Displacement": 168, + "Horsepower": 132, + "Weight_in_lbs": 2910, + "Acceleration": 11.4, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda rx-7 gs", + "Miles_per_Gallon": 23.7, + "Cylinders": 3, + "Displacement": 70, + "Horsepower": 100, + "Weight_in_lbs": 2420, + "Acceleration": 12.5, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "triumph", + "Name": "triumph tr7 coupe", + "Miles_per_Gallon": 35, + "Cylinders": 4, + "Displacement": 122, + "Horsepower": 88, + "Weight_in_lbs": 2500, + "Acceleration": 15.1, + "Year": "1980-01-01", + "Origin": "European Union" + }, + { + "Maker": "ford", + "Name": "ford mustang cobra", + "Miles_per_Gallon": 23.6, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": null, + "Weight_in_lbs": 2905, + "Acceleration": 14.3, + "Year": "1980-01-01", + "Origin": "Holland" + }, + { + "Maker": "honda", + "Name": "honda Accelerationord", + "Miles_per_Gallon": 32.4, + "Cylinders": 4, + "Displacement": 107, + "Horsepower": 72, + "Weight_in_lbs": 2290, + "Acceleration": 17, + "Year": "1980-01-01", + "Origin": "Japan" + }, + { + "Maker": "honda", + "Name": "honda Accelerationord", + "Miles_per_Gallon": 32.4, + "Cylinders": 4, + "Displacement": 107, + "Horsepower": 72, + "Weight_in_lbs": 2290, + "Acceleration": 17, + "Year": "1981-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth reliant", + "Miles_per_Gallon": 27.2, + "Cylinders": 4, + "Displacement": 135, + "Horsepower": 84, + "Weight_in_lbs": 2490, + "Acceleration": 15.7, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "buick", + "Name": "buick skylark", + "Miles_per_Gallon": 26.6, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 84, + "Weight_in_lbs": 2635, + "Acceleration": 16.4, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge aries wagon (sw)", + "Miles_per_Gallon": 25.8, + "Cylinders": 4, + "Displacement": 156, + "Horsepower": 92, + "Weight_in_lbs": 2620, + "Acceleration": 14.4, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet citation", + "Miles_per_Gallon": 23.5, + "Cylinders": 6, + "Displacement": 173, + "Horsepower": 110, + "Weight_in_lbs": 2725, + "Acceleration": 12.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "plymouth", + "Name": "plymouth reliant", + "Miles_per_Gallon": 30, + "Cylinders": 4, + "Displacement": 135, + "Horsepower": 84, + "Weight_in_lbs": 2385, + "Acceleration": 12.9, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota starlet", + "Miles_per_Gallon": 39.1, + "Cylinders": 4, + "Displacement": 79, + "Horsepower": 58, + "Weight_in_lbs": 1755, + "Acceleration": 16.9, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth champ", + "Miles_per_Gallon": 39, + "Cylinders": 4, + "Displacement": 86, + "Horsepower": 64, + "Weight_in_lbs": 1875, + "Acceleration": 16.4, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "honda", + "Name": "honda civic 1300", + "Miles_per_Gallon": 35.1, + "Cylinders": 4, + "Displacement": 81, + "Horsepower": 60, + "Weight_in_lbs": 1760, + "Acceleration": 16.1, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Name": "subaru", + "Maker": "subaru", + "Miles_per_Gallon": 32.3, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 67, + "Weight_in_lbs": 2065, + "Acceleration": 17.8, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 210", + "Miles_per_Gallon": 37, + "Cylinders": 4, + "Displacement": 85, + "Horsepower": 65, + "Weight_in_lbs": 1975, + "Acceleration": 19.4, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyota", + "Name": "toyota tercel", + "Miles_per_Gallon": 37.7, + "Cylinders": 4, + "Displacement": 89, + "Horsepower": 62, + "Weight_in_lbs": 2050, + "Acceleration": 17.3, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda glc 4", + "Miles_per_Gallon": 34.1, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 68, + "Weight_in_lbs": 1985, + "Acceleration": 16, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth horizon 4", + "Miles_per_Gallon": 34.7, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 63, + "Weight_in_lbs": 2215, + "Acceleration": 14.9, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford escort 4w", + "Miles_per_Gallon": 34.4, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 65, + "Weight_in_lbs": 2045, + "Acceleration": 16.2, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford escort 2h", + "Miles_per_Gallon": 29.9, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 65, + "Weight_in_lbs": 2380, + "Acceleration": 20.7, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen jetta", + "Miles_per_Gallon": 33, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 74, + "Weight_in_lbs": 2190, + "Acceleration": 14.2, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "renault", + "Name": "renault 18i", + "Miles_per_Gallon": 34.5, + "Cylinders": 4, + "Displacement": 100, + "Horsepower": null, + "Weight_in_lbs": 2320, + "Acceleration": 15.8, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "honda", + "Name": "honda prelude", + "Miles_per_Gallon": 33.7, + "Cylinders": 4, + "Displacement": 107, + "Horsepower": 75, + "Weight_in_lbs": 2210, + "Acceleration": 14.4, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyota", + "Name": "toyota corolla", + "Miles_per_Gallon": 32.4, + "Cylinders": 4, + "Displacement": 108, + "Horsepower": 75, + "Weight_in_lbs": 2350, + "Acceleration": 16.8, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 200sx", + "Miles_per_Gallon": 32.9, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 100, + "Weight_in_lbs": 2615, + "Acceleration": 14.8, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda 626", + "Miles_per_Gallon": 31.6, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 74, + "Weight_in_lbs": 2635, + "Acceleration": 18.3, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "peugeot", + "Name": "peugeot 505s turbo diesel", + "Miles_per_Gallon": 28.1, + "Cylinders": 4, + "Displacement": 141, + "Horsepower": 80, + "Weight_in_lbs": 3230, + "Acceleration": 20.4, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "saab", + "Name": "saab 900s", + "Miles_per_Gallon": null, + "Cylinders": 4, + "Displacement": 121, + "Horsepower": 110, + "Weight_in_lbs": 2800, + "Acceleration": 15.4, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "volvo", + "Name": "volvo diesel", + "Miles_per_Gallon": 30.7, + "Cylinders": 6, + "Displacement": 145, + "Horsepower": 76, + "Weight_in_lbs": 3160, + "Acceleration": 19.6, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "toyota", + "Name": "toyota cressida", + "Miles_per_Gallon": 25.4, + "Cylinders": 6, + "Displacement": 168, + "Horsepower": 116, + "Weight_in_lbs": 2900, + "Acceleration": 12.6, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 810 maxima", + "Miles_per_Gallon": 24.2, + "Cylinders": 6, + "Displacement": 146, + "Horsepower": 120, + "Weight_in_lbs": 2930, + "Acceleration": 13.8, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "buick", + "Name": "buick century", + "Miles_per_Gallon": 22.4, + "Cylinders": 6, + "Displacement": 231, + "Horsepower": 110, + "Weight_in_lbs": 3415, + "Acceleration": 15.8, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile cutlass ls", + "Miles_per_Gallon": 26.6, + "Cylinders": 8, + "Displacement": 350, + "Horsepower": 105, + "Weight_in_lbs": 3725, + "Acceleration": 19, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford granada gl", + "Miles_per_Gallon": 20.2, + "Cylinders": 6, + "Displacement": 200, + "Horsepower": 88, + "Weight_in_lbs": 3060, + "Acceleration": 17.1, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler lebaron salon", + "Miles_per_Gallon": 17.6, + "Cylinders": 6, + "Displacement": 225, + "Horsepower": 85, + "Weight_in_lbs": 3465, + "Acceleration": 16.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet cavalier", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 112, + "Horsepower": 88, + "Weight_in_lbs": 2605, + "Acceleration": 19.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet cavalier wagon", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 112, + "Horsepower": 88, + "Weight_in_lbs": 2640, + "Acceleration": 18.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet cavalier 2-door", + "Miles_per_Gallon": 34, + "Cylinders": 4, + "Displacement": 112, + "Horsepower": 88, + "Weight_in_lbs": 2395, + "Acceleration": 18, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac j2000 se hatchback", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 112, + "Horsepower": 85, + "Weight_in_lbs": 2575, + "Acceleration": 16.2, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "dodge", + "Name": "dodge aries se", + "Miles_per_Gallon": 29, + "Cylinders": 4, + "Displacement": 135, + "Horsepower": 84, + "Weight_in_lbs": 2525, + "Acceleration": 16, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "pontiac", + "Name": "pontiac phoenix", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 2735, + "Acceleration": 18, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford fairmont futura", + "Miles_per_Gallon": 24, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 92, + "Weight_in_lbs": 2865, + "Acceleration": 16.4, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "amc", + "Name": "amc concord dl", + "Miles_per_Gallon": 23, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": null, + "Weight_in_lbs": 3035, + "Acceleration": 20.5, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "volkswagen", + "Name": "volkswagen rabbit l", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 74, + "Weight_in_lbs": 1980, + "Acceleration": 15.3, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "mazda", + "Name": "mazda glc custom l", + "Miles_per_Gallon": 37, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 68, + "Weight_in_lbs": 2025, + "Acceleration": 18.2, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "mazda", + "Name": "mazda glc custom", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 68, + "Weight_in_lbs": 1970, + "Acceleration": 17.6, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "plymouth", + "Name": "plymouth horizon miser", + "Miles_per_Gallon": 38, + "Cylinders": 4, + "Displacement": 105, + "Horsepower": 63, + "Weight_in_lbs": 2125, + "Acceleration": 14.7, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "mercury", + "Name": "mercury lynx l", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 98, + "Horsepower": 70, + "Weight_in_lbs": 2125, + "Acceleration": 17.3, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "nissan", + "Name": "nissan stanza xe", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 88, + "Weight_in_lbs": 2160, + "Acceleration": 14.5, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "honda", + "Name": "honda Accelerationord", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 107, + "Horsepower": 75, + "Weight_in_lbs": 2205, + "Acceleration": 14.5, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "toyota", + "Name": "toyota corolla", + "Miles_per_Gallon": 34, + "Cylinders": 4, + "Displacement": 108, + "Horsepower": 70, + "Weight_in_lbs": 2245, + "Acceleration": 16.9, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "honda", + "Name": "honda civic", + "Miles_per_Gallon": 38, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 67, + "Weight_in_lbs": 1965, + "Acceleration": 15, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "honda", + "Name": "honda civic (auto)", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 67, + "Weight_in_lbs": 1965, + "Acceleration": 15.7, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "datsun", + "Name": "datsun 310 gx", + "Miles_per_Gallon": 38, + "Cylinders": 4, + "Displacement": 91, + "Horsepower": 67, + "Weight_in_lbs": 1995, + "Acceleration": 16.2, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "buick", + "Name": "buick century limited", + "Miles_per_Gallon": 25, + "Cylinders": 6, + "Displacement": 181, + "Horsepower": 110, + "Weight_in_lbs": 2945, + "Acceleration": 16.4, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "oldsmobile", + "Name": "oldsmobile cutlass ciera (diesel)", + "Miles_per_Gallon": 38, + "Cylinders": 6, + "Displacement": 262, + "Horsepower": 85, + "Weight_in_lbs": 3015, + "Acceleration": 17, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chrysler", + "Name": "chrysler lebaron medallion", + "Miles_per_Gallon": 26, + "Cylinders": 4, + "Displacement": 156, + "Horsepower": 92, + "Weight_in_lbs": 2585, + "Acceleration": 14.5, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford granada l", + "Miles_per_Gallon": 22, + "Cylinders": 6, + "Displacement": 232, + "Horsepower": 112, + "Weight_in_lbs": 2835, + "Acceleration": 14.7, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "toyota", + "Name": "toyota celica gt", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 144, + "Horsepower": 96, + "Weight_in_lbs": 2665, + "Acceleration": 13.9, + "Year": "1982-01-01", + "Origin": "Japan" + }, + { + "Maker": "dodge", + "Name": "dodge charger 2.2", + "Miles_per_Gallon": 36, + "Cylinders": 4, + "Displacement": 135, + "Horsepower": 84, + "Weight_in_lbs": 2370, + "Acceleration": 13, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevrolet", + "Name": "chevrolet camaro", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 151, + "Horsepower": 90, + "Weight_in_lbs": 2950, + "Acceleration": -17.3, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford mustang gl", + "Miles_per_Gallon": 27, + "Cylinders": 4, + "Displacement": 140, + "Horsepower": 86, + "Weight_in_lbs": 2790, + "Acceleration": 15.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "vw", + "Name": "vw pickup", + "Miles_per_Gallon": 44, + "Cylinders": 4, + "Displacement": 97, + "Horsepower": 52, + "Weight_in_lbs": 2130, + "Acceleration": 24.6, + "Year": "1982-01-01", + "Origin": "European Union" + }, + { + "Maker": "dodge", + "Name": "dodge rampage", + "Miles_per_Gallon": 32, + "Cylinders": 4, + "Displacement": 135, + "Horsepower": 84, + "Weight_in_lbs": 2295, + "Acceleration": 11.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "ford", + "Name": "ford ranger", + "Miles_per_Gallon": 28, + "Cylinders": 4, + "Displacement": 120, + "Horsepower": 79, + "Weight_in_lbs": 2625, + "Acceleration": -18.6, + "Year": "1982-01-01", + "Origin": "Holland" + }, + { + "Maker": "chevy", + "Name": "chevy s-10", + "Miles_per_Gallon": 31, + "Cylinders": 4, + "Displacement": 119, + "Horsepower": 82, + "Weight_in_lbs": 2720, + "Acceleration": -19.4, + "Year": "1982-01-01", + "Origin": "Holland" + } +] \ No newline at end of file diff --git a/examples/data/heatmap.csv b/examples/data/heatmap.csv new file mode 100644 index 00000000..95d871a7 --- /dev/null +++ b/examples/data/heatmap.csv @@ -0,0 +1,85 @@ +Month,Name,Sales +Jan,Michael,"44238" +Feb,Michael,"37640" +Mar,Michael,"47380" +Apr,Michael,"34874" +May,Michael,"22413" +Jun,Michael,"23191" +Jul,Michael,"20112" +Aug,Michael,"28223" +Sep,Michael,"13796" +Oct,Michael,"7651" +Nov,Michael,"5630" +Dec,Michael,"2528" +Jan,Jim,"45673" +Feb,Jim,"36500" +Mar,Jim,"32708" +Apr,Jim,"45677" +May,Jim,"22459" +Jun,Jim,"14571" +Jul,Jim,"37642" +Aug,Jim,"18885" +Sep,Jim,"41365" +Oct,Jim,"35781" +Nov,Jim,"48651" +Dec,Jim,"39571" +Jan,Dwight,"39800" +Feb,Dwight,"48897" +Mar,Dwight,"47654" +Apr,Dwight,"49876" +May,Dwight,"32590" +Jun,Dwight,"17987" +Jul,Dwight,"38786" +Aug,Dwight,"38765" +Sep,Dwight,"39675" +Oct,Dwight,"34981" +Nov,Dwight,"19670" +Dec,Dwight,"16650" +Jan,Phyllis,"19500" +Feb,Phyllis,"34243" +Mar,Phyllis,"43890" +Apr,Phyllis,"41389" +May,Phyllis,"31189" +Jun,Phyllis,"23376" +Jul,Phyllis,"26787" +Aug,Phyllis,"19621" +Sep,Phyllis,"36600" +Oct,Phyllis,"38078" +Nov,Phyllis,"5666" +Dec,Phyllis,"17900" +Jan,Stanley,"44770" +Feb,Stanley,"43900" +Mar,Stanley,"32476" +Apr,Stanley,"43131" +May,Stanley,"21143" +Jun,Stanley,"32632" +Jul,Stanley,"29548" +Aug,Stanley,"24554" +Sep,Stanley,"22854" +Oct,Stanley,"38960" +Nov,Stanley,"37880" +Dec,Stanley,"39870" +Jan,Packer,"11634" +Feb,Packer,"4818" +Mar,Packer,"24329" +Apr,Packer,"21013" +May,Packer,"20134" +Jun,Packer,"22562" +Jul,Packer,"3467" +Aug,Packer,"30597" +Sep,Packer,"12322" +Oct,Packer,"9812" +Nov,Packer,"8832" +Dec,Packer,"7423" +Jan,Andy,"47840" +Feb,Andy,"29720" +Mar,Andy,"38520" +Apr,Andy,"28900" +May,Andy,"27999" +Jun,Andy,"36636" +Jul,Andy,"26957" +Aug,Andy,"29822" +Sep,Andy,"25677" +Oct,Andy,"36400" +Nov,Andy,"27350" +Dec,Andy,"18840" \ No newline at end of file diff --git a/examples/data/seattle-weather.csv b/examples/data/seattle-weather.csv index e1ce62d0..f614a0c2 100644 --- a/examples/data/seattle-weather.csv +++ b/examples/data/seattle-weather.csv @@ -1,4 +1,4 @@ -date,precipitation,temp_max,temp_min,wind,weather +Date,Precipitation,temp_max,temp_min,wind,weather 2012/01/01,0.0,12.8,5.0,4.7,drizzle 2012/01/02,10.9,10.6,2.8,4.5,rain 2012/01/03,0.8,11.7,7.2,2.3,rain diff --git a/examples/data/well-being-index.csv b/examples/data/well-being-index.csv new file mode 100644 index 00000000..b0530cc1 --- /dev/null +++ b/examples/data/well-being-index.csv @@ -0,0 +1,51 @@ +No.,State,Well-being Index,Purpose Rank,Social Rank,Financial Rank,Community Rank,Physical Rank,State Codes,Latitude,Longitude +2,Alaska,64,5,1,2,6,15,AK,63.588753,-154.493062 +23,Washington,62.5,37,23,9,25,23,WA,47.751074,-120.740139 +16,North Dakota,62.8,16,37,4,7,34,ND,47.551493,-101.002012 +8,Montana,63.2,10,28,13,3,33,MT,46.879682,-110.362566 +9,Minnesota,63.2,24,44,6,9,11,MN,46.729553,-94.6859 +4,Maine,63.6,23,18,10,11,4,ME,45.253783,-69.445469 +6,Vermont,63.5,30,5,39,8,2,VT,44.558803,-72.577841 +39,Michigan,61.4,42,35,35,34,37,MI,44.314844,-85.602364 +18,Idaho,62.7,17,25,44,4,38,ID,44.068202,-114.742041 +3,South Dakota,63.7,8,29,3,2,16,SD,43.969515,-99.901813 +24,Oregon,62.5,41,11,18,18,19,OR,43.804133,-120.554201 +28,Wisconsin,62.3,39,39,7,15,31,WI,43.78444,-88.787868 +33,New York,61.8,46,22,29,43,14,NY,43.299428,-74.217933 +22,New Hampshire,62.6,38,17,26,16,21,NH,43.193852,-71.572395 +12,Wyoming,63,15,33,15,5,32,WY,43.075968,-107.290284 +14,Massachusetts,63,40,10,11,23,5,MA,42.407211,-71.382437 +19,Iowa,62.6,22,42,5,12,35,IA,41.878003,-93.097702 +5,Colorado,63.5,18,21,19,14,3,CO,41.603221,-73.087749 +42,Rhode Island,61.3,49,50,43,50,18,RI,41.580095,-71.477429 +15,Nebraska,62.9,7,32,8,10,30,NE,41.492537,-99.901813 +30,Pennsylvania,62.1,27,13,12,32,29,PA,41.203322,-77.194525 +37,Illinois,61.6,36,26,28,46,24,IL,40.633125,-89.398528 +47,Indiana,60.5,47,49,30,38,44,IN,40.551217,-85.602364 +45,Ohio,60.9,43,40,31,39,42,OH,40.417287,-82.907123 +25,New Jersey,62.5,29,4,21,40,7,NJ,40.058324,-74.405661 +17,Utah,62.8,19,27,22,13,27,UT,39.32098,-111.093731 +31,Maryland,62,33,20,16,44,12,MD,39.045755,-76.641271 +32,Kansas,61.8,20,38,17,26,40,KS,39.011902,-98.484246 +35,Connecticut,61.7,45,19,37,48,13,CT,38.910832,-75.52767 +40,Delaware,61.4,48,15,24,45,22,DE,38.905985,-77.033418 +34,Nevada,61.8,34,34,33,47,26,NV,38.80261,-116.419389 +50,West Virginia,58.9,50,45,50,49,50,WV,38.597626,-80.454903 +36,Missouri,61.7,31,31,25,30,36,MO,37.964253,-91.831833 +49,Kentucky,60.5,44,41,40,29,49,KY,37.839333,-84.270018 +21,Virginia,62.6,21,12,14,27,20,VA,37.431573,-78.656894 +13,California,63,13,14,20,35,6,CA,36.778261,-119.417932 +26,North Carolina,62.4,14,9,41,22,28,NC,35.759573,-79.0193 +38,Tennessee,61.5,26,36,36,21,43,TN,35.517491,-86.580447 +46,Arkansas,60.8,32,47,45,31,47,AR,35.20105,-91.831833 +48,Oklahoma,60.5,35,48,46,33,48,OK,35.007752,-97.092877 +20,New Mexico,62.6,9,24,27,41,9,NM,34.97273,-105.032363 +7,Arizona,63.4,2,3,23,19,10,AZ,34.048928,-111.093731 +27,South Carolina,62.3,4,6,38,17,39,SC,33.836081,-81.163725 +41,Mississippi,61.3,3,16,49,37,45,MS,32.354668,-89.398528 +44,Alabama,61,28,43,47,28,46,AL,32.318231,-86.902298 +29,Georgia,62.3,11,7,42,36,25,GA,32.157435,-82.907123 +10,Texas,63.1,1,8,32,20,17,TX,31.968599,-99.901813 +43,Louisiana,61,25,30,48,42,41,LA,31.244823,-92.145024 +11,Florida,63.1,6,2,34,24,8,FL,27.664827,-81.515754 +1,Hawaii,65.2,12,46,1,1,1,HI,19.898682,-155.665857 \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 8db90f3e..4865bbbc 100644 --- a/examples/index.html +++ b/examples/index.html @@ -9,10 +9,26 @@ @@ -22,7 +38,6 @@
-
@@ -30,8 +45,22 @@
+
- - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/js/Untitled-1 b/examples/js/Untitled-1 deleted file mode 100644 index d826af3d..00000000 --- a/examples/js/Untitled-1 +++ /dev/null @@ -1,351 +0,0 @@ -import { - mergeRecursive, - getQualifiedClassName, - getUniqueId, - selectElement, - setStyles, - makeElement -} from 'muze-utils'; -import { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM, - INITIAL_STYLE } from './constants'; -import { defaultConfig } from './default-config'; -import { getArrowPos, placeArrow, reorderContainers } from './helper'; -import './styles.scss'; -import Content from './content'; - -/** - * This component is responsible for creating a tooltip element. It appends the tooltip - * in the body element. - * @class Tooltip - */ -export default class Tooltip { - /** - * Initializes the tooltip with the container element and configuration - * @param {HTMLElement} container container where the tooltip will be mounted. - * @param {string} className Class name of the tooltip. - */ - constructor (htmlContainer, svgContainer) { - let connectorContainer = svgContainer; - this._id = getUniqueId(); - this._config = {}; - this._container = selectElement(htmlContainer); - this.config({}); - const tooltipConf = this._config; - const classPrefix = tooltipConf.classPrefix; - const contentClass = tooltipConf.content.parentClassName; - this._tooltipContainer = this._container.append('div').style('position', 'absolute'); - this._contentContainer = this._tooltipContainer.append('div').attr('class', `${classPrefix}-${contentClass}`); - this._tooltipBackground = this._tooltipContainer.append('div').style('position', 'relative'); - this._tooltipArrow = this._tooltipContainer.append('div'); - - if (!svgContainer) { - connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none'); - } - this._contents = {}; - this._tooltipConnectorContainer = selectElement(connectorContainer) - .append('g') - .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`); - const id = this._id; - const defClassName = tooltipConf.defClassName; - const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix); - - setStyles(this._tooltipArrow, INITIAL_STYLE); - setStyles(this._tooltipBackground, INITIAL_STYLE); - this.addClass(qualifiedClassName.join(' ')); - this.addClass(tooltipConf.className); - this.hide(); - } - - /** - * Sets the configuration of tooltip. - * @param {Object} config Configuration of tooltip - * @return {Tooltip} Instance of tooltip - */ - config (...config) { - if (config.length > 0) { - const defConf = mergeRecursive({}, this.constructor.defaultConfig()); - this._config = mergeRecursive(defConf, config[0]); - return this; - } - return this._config; - } - - /** - * Returns the default configuration of tooltip - * @return {Object} Configuration of tooltip. - */ - static defaultConfig () { - return defaultConfig; - } - /** - * Sets the class name of tooltip - * @param {string} className tooltip class name - * @return {Tooltip} Instance of tooltip. - */ - addClass (className) { - this._tooltipContainer.classed(className, true); - return this; - } - - context (...ctx) { - if (ctx.length) { - this._context = ctx[0]; - return this; - } - return this._context; - } - - content (name, data, contentConfig = {}) { - const config = this.config(); - const { classPrefix } = config; - const contentClass = config.content.className; - const formatter = config.formatter; - const className = contentConfig.className || `${classPrefix}-${contentClass}-${name}`; - const content = this._contents[name] = this._contents[name] || new Content(); - const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className); - container.attr('class', `${classPrefix}-${contentClass} ${className}`); - reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`); - const contentConf = config.content; - contentConfig.classPrefix = this._config.classPrefix; - content.config(contentConf); - - if (data === null) { - content.clear(); - container.remove(); - delete this._contents[name]; - } else { - content.update({ - model: data, - formatter: contentConfig.formatter || formatter - }); - content.context(this._context); - content.render(container); - } - - if (!Object.keys(this._contents).length) { - this.hide(); - } - return this; - } - - getContents () { - return Object.values(this._contents); - } - - /** - * Positions the tooltip at the given x and y position. - * @param {number} x x position - * @param {number} y y position - * @return {Tooltip} Instance of tooltip. - */ - position (x, y, conf = {}) { - if (!Object.keys(this._contents).length) { - this.hide(); - return this; - } - this.show(); - const target = this._target; - const repositionArrow = conf.repositionArrow; - - if (target && repositionArrow) { - const node = this._tooltipContainer.node(); - const config = this._config; - const arrowDisabled = config.arrow.disabled; - const arrowWidth = arrowDisabled ? 0 : config.arrow.size; - const arrowOrient = this._arrowOrientation; - const outsidePlot = arrowOrient === ARROW_LEFT || arrowOrient === ARROW_RIGHT ? - (y + node.offsetHeight - arrowWidth) < target.y || y > (target.y + target.height) : - (x + node.offsetWidth - arrowWidth) < target.x || x > (target.x + target.width); - if (outsidePlot) { - let path; - this._tooltipArrow.style('display', 'none'); - this._tooltipBackground.style('display', 'none'); - this._tooltipConnectorContainer.style('display', 'block'); - const connector = this._tooltipConnectorContainer.selectAll('path').data([1]); - const enter = connector.enter().append('path'); - if (arrowOrient === ARROW_LEFT) { - path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}` - + ` ${target.y + target.height / 2}`; - } else if (arrowOrient === ARROW_RIGHT) { - path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}` - + ` L ${target.x} ${target.y + target.height / 2}`; - } else if (arrowOrient === ARROW_BOTTOM) { - path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}` - + ` L ${target.x + target.width / 2} ${target.y}`; - } - enter.merge(connector).attr('d', path).style('display', 'block'); - } else { - const arrowPos = getArrowPos(arrowOrient, target, { - x, - y, - boxHeight: node.offsetHeight, - boxWidth: node.offsetWidth - }, this._config); - - placeArrow(this, this._arrowOrientation, arrowPos); - this._tooltipConnectorContainer.style('display', 'none'); - } - } - - const offset = { - x: 0, - y: 0 - }; - - this._tooltipContainer.style('left', `${offset.x + x}px`).style('top', `${offset.y + y}px`); - - return this; - } - - /** - * Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the - * boundaries. - * @param {Object} dim Dimensions of the plot. - */ - positionRelativeTo (dim, tooltipConf = {}) { - let obj; - let orientation = tooltipConf.orientation; - this.show(); - if (!dim) { - this.hide(); - return this; - } - - const extent = this._extent; - const node = this._tooltipContainer.node(); - // document.body.appendChild(node); -// - const offsetWidth = node.offsetWidth + 2; - const offsetHeight = node.offsetHeight + 2; - const offset = this._offset; - // this._container.node().appendChild(node); - const config = this._config; - const arrowDisabled = config.arrow.disabled; - const arrowSize = config.arrow.size; - const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true; - const topSpace = dim.y; - const positionHorizontal = () => { - let position; - let x = (dim.x + offset.x) + dim.width; - let y = dim.y + offset.y; - // When there is no space in right - const rightSpace = extent.width - x; - const leftSpace = (dim.x + offset.x) - extent.x; - if (rightSpace >= offsetWidth + arrowSize) { - position = TOOLTIP_LEFT; - x += arrowSize; - } else if (leftSpace >= offsetWidth + arrowSize) { - x = (dim.x + offset.x) - offsetWidth; - position = TOOLTIP_RIGHT; - x -= arrowSize; - } else { - position = 'left'; - x += arrowSize; - } - if (dim.height < offsetHeight) { - y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2) + offset.y; - } - - const arrowPos = getArrowPos(position, dim, { - x, - y, - boxHeight: offsetHeight, - boxWidth: offsetWidth - }, this._config); - - return { - position, - arrowPos, - x, - y - }; - }; - const positionVertical = () => { - let position; - // Position tooltip at the center of plot - let x = dim.x - offsetWidth / 2 + dim.width / 2 + offset.x; - const y = dim.y - offsetHeight - arrowSize + offset.y; - // Overflows to the right - if ((extent.width - (dim.x + offset.x)) < offsetWidth) { - x = (extent.width - offsetWidth) + offset.x; - } else if (x < extent.x) { // Overflows to the left - x = extent.x + offset.x; - } - - const arrowPos = getArrowPos(position, dim, { - x, - y, - boxHeight: offsetHeight, - boxWidth: offsetWidth - }, this._config, this._offset); - - position = TOOLTIP_BOTTOM; - return { - position, - arrowPos, - x, - y - }; - }; - - this._target = dim; - if (!orientation) { - orientation = topSpace > (offsetHeight + arrowSize) ? 'vertical' : 'horizontal'; - } - console.log(orientation); - if (orientation === 'horizontal') { - obj = positionHorizontal(); - } else if (orientation === 'vertical') { - obj = positionVertical(); - } - - this._position = { - x: obj.x, - y: obj.y - }; - - this._arrowPos = obj.arrowPos; - if (!arrowDisabled) { - placeArrow(this, obj.position, obj.arrowPos); - } - this._arrowOrientation = obj.position; - draw && this.position(obj.x, obj.y); - return this; - } - - /** - * Hides the tooltip element. - * @return {Tooltip} Instance of tooltip. - */ - hide () { - this._tooltipContainer.style('display', 'none'); - this._tooltipConnectorContainer.style('display', 'none'); - return this; - } - - /** - * Shows the tooltip element. - * @return {Tooltip} Instance of tooltip. - */ - show () { - this._tooltipContainer.style('display', 'block'); - return this; - } - - extent (extent) { - this._extent = extent; - return this; - } - - offset (offset) { - this._offset = offset; - return this; - } - - remove () { - this._tooltipContainer.remove(); - this._tooltipBackground.remove(); - this._tooltipConnectorContainer.remove(); - return this; - } -} diff --git a/examples/js/Untitled-1.tsv b/examples/js/Untitled-1.tsv deleted file mode 100644 index 762f0150..00000000 --- a/examples/js/Untitled-1.tsv +++ /dev/null @@ -1,2001 +0,0 @@ -leaidC newname nyt_abbrev ses totavg mnav3poolgcs mnav8poolgcs mngrdpoolgcs stfips countyid inc50all growth_pctile_for_subgroup lat lon -3620580 New York City Public Schools N.Y. -0.8876 70986 2.993 7.578 0.917 36 36061 41888 35 40.696 -73.866 -0622710 Los Angeles Unified Calif. -0.595 49398 1.939 6.309 0.874 06 06037 40928 23 34.12 -118.391 -1709930 City of Chicago Ill. -1.2862 29007 1.664 7.622 1.192 17 17031 38036 97 41.838 -87.689 -1200390 Dade Fla. -0.5289 26421 3.407 7.608 0.84 12 12086 44846 16 25.613 -80.572 -3200060 Clark County School District Nev. 0.0122 24468 2.52 7.566 1.009 32 32003 58901 64 36.215 -115.014 -1200180 Broward Fla. -0.0591 19164 3.681 7.96 0.856 12 12011 56779 19 26.152 -80.491 -4823640 Houston Tex. -0.8436 16229 2.677 7.384 0.941 48 48201 35505 42 29.724 -95.392 -1200870 Hillsborough Fla. -0.1819 14677 3.477 7.612 0.827 12 12057 53565 14 27.931 -82.306 -4218990 Philadelphia City Pa. -1.8208 14393 1.853 6.386 0.907 42 42101 33429 32 40.008 -75.134 -1500030 Hawaii Department of Education Hawaii 0.4943 13645 2.757 7.565 0.962 15 15003 71322 49 19.598 -155.506 -1201440 Orange Fla. -0.2132 13263 3.481 7.714 0.847 12 12095 50719 18 28.514 -81.323 -4816230 Dallas Tex. -1.0883 13087 2.185 6.844 0.932 48 48113 31634 39 32.736 -96.744 -1201500 Palm Beach Fla. -0.0597 13055 3.552 8.052 0.9 12 12099 56399 30 26.647 -80.477 -1302550 Gwinnett County Ga. 0.3352 12933 3.644 8.747 1.021 13 13135 63318 68 33.957 -84.024 -5101260 Fairfax Co. Public Schools Va. 1.5955 12637 4.229 9.086 0.971 51 51059 116358 52 38.838 -77.278 -3704720 Wake County Schools N.C. 0.7493 11906 4.171 8.846 0.935 37 37183 77289 40 35.79 -78.65 -3702970 Charlotte-Mecklenburg Schools N.C. -0.0485 11239 3.548 8.284 0.947 37 37119 57010 44 35.247 -80.833 -2400480 Montgomery County Public Schools Md. 1.2183 10503 4.078 9.03 0.99 24 24031 99755 58 39.136 -77.204 -0634320 San Diego Unified Calif. 0.1474 9627 2.555 7.577 1.004 06 06073 55e3 63 32.813 -117.147 -1200480 Duval Fla. -0.3895 9108 3.356 7.335 0.796 12 12031 51586 10 30.326 -81.69 -2400510 Prince George's County Public Schools Md. 0.1889 8829 2.439 6.751 0.862 24 24033 71292 21 38.83 -76.847 -1301290 Cobb County Ga. 0.5962 8303 3.463 8.551 1.018 13 13067 75323 67 33.941 -84.577 -4816110 Cypress-Fairbanks Tex. 0.8133 8276 3.465 8.752 1.057 48 48201 73884 78 29.923 -95.644 -4702940 Memphis City School District Tenn. -2.0633 7977 1.021 6.065 1.009 47 47157 31076 64 35.105 -89.977 -2400120 Baltimore County Public Schools Md. 0.4317 7673 3.807 7.942 0.827 24 24005 68698 14 39.468 -76.646 -2612000 Detroit City School District Mich. -3.2371 7627 0.852 5.421 0.914 26 26163 26982 34 42.385 -83.104 -1201560 Pinellas Fla. -0.0888 7522 3.448 7.574 0.825 12 12103 52253 14 27.937 -82.726 -4833120 Northside Tex. 0.3629 7479 3.155 8.316 1.032 48 48029 60874 71 29.558 -98.692 -1301740 Dekalb County Ga. -0.6892 7390 2.337 6.59 0.85 13 13089 46937 18 33.772 -84.222 -3500060 Albuquerque Public Schools N.M. -0.1651 7289 2.224 7.153 0.986 35 35001 48886 57 35.058 -106.686 -2102990 Jefferson County Ky. -0.7313 7197 2.615 7.252 0.927 21 21111 46814 38 38.187 -85.659 -1201590 Polk Fla. -0.4149 7109 3.135 7.06 0.785 12 12105 47663 8 27.949 -81.698 -1302280 Fulton County Ga. 0.5523 7023 3.679 8.349 0.934 13 13121 78200 40 33.608 -84.612 -4808940 Austin Tex. -0.3685 6476 2.957 7.969 1.002 48 48453 44325 62 30.261 -97.798 -4819700 Fort Worth Tex. -1.0328 6292 2.068 6.834 0.953 48 48439 35202 46 32.721 -97.37 -0622500 Long Beach Unified Calif. -0.4965 6214 2.357 7.103 0.949 06 06037 49042 45 33.382 -118.419 -5103130 Prince Wm Co. Public Schools Va. 1.1002 6181 3.646 8.499 0.971 51 51153 92771 52 38.719 -77.485 -0804800 Jefferson County School District No. R-1 Colo. 0.753 6171 4.147 9.102 0.991 08 08059 78941 59 39.588 -105.25 -1201080 Lee Fla. -0.1532 6121 3.639 7.792 0.831 12 12071 50959 15 26.581 -81.788 -0803360 School District No. 1 In The County Of Denver And State Of C Colo. -0.4215 6066 2.491 7.423 0.987 08 08031 42291 57 39.761 -104.877 -5509600 Milwaukee School District Wis. -1.8662 5916 1.3 5.87 0.914 55 55079 32072 34 43.064 -87.967 -4703180 Davidson County Tenn. -0.839 5823 1.82 6.975 1.031 47 47037 41745 71 36.169 -86.785 -2400090 Baltimore City Public Schools Md. -1.6172 5719 2.314 5.499 0.637 24 24510 35630 1 39.308 -76.616 -3701920 Guilford County Schools N.C. -0.3979 5683 3.395 7.862 0.893 37 37081 50777 28 36.079 -79.789 -4900030 Alpine District Utah 1.1315 5679 3.453 9.007 1.111 49 49049 77638 89 40.315 -111.852 -2400060 Anne Arundel County Public Schools Md. 0.958 5642 4.43 8.55 0.824 24 24003 89181 14 39.002 -76.609 -0404970 Mesa Unified District Ariz. 0.1074 5625 2.773 7.967 1.039 04 04013 56160 73 33.453 -111.727 -0614550 Fresno Unified Calif. -1.7505 5612 1.46 6.11 0.93 06 06019 35052 39 36.774 -119.783 -4900210 Davis District Utah 1.0211 5475 3.425 8.495 1.014 49 49011 76243 66 40.991 -112.111 -4502310 Greenville S.C. -0.156 5460 3.004 7.937 0.987 45 45045 53734 57 34.884 -82.364 -4900360 Granite District Utah 0.16 5447 2.372 6.917 0.909 49 49035 56059 33 40.743 -111.944 -4819650 Fort Bend Tex. 0.8763 5381 3.427 9.013 1.117 48 48157 76737 90 29.578 -95.579 -4832940 North East Tex. 0.4193 5269 3.103 8.538 1.087 48 48029 63630 84 29.577 -98.452 -1200150 Brevard Fla. 0.1406 5177 4.116 8.433 0.863 12 12009 60072 21 28.206 -80.765 -5103840 Va Beach City Va. 0.7248 5117 3.581 8.32 0.948 51 51810 70279 45 36.757 -76.06 -1201530 Pasco Fla. -0.077 5044 3.338 7.786 0.89 12 12101 56288 27 28.309 -82.387 -5102250 Loudoun Co. Public Schools Va. 1.8504 4985 4.135 8.823 0.938 51 51107 134058 41 39.091 -77.636 -3200480 Washoe County School District Nev. 0.2228 4947 2.812 8.199 1.077 32 32031 62211 82 40.665 -119.664 -4808700 Arlington Tex. -0.224 4882 2.447 7.89 1.089 48 48439 49861 84 32.713 -97.111 -4825170 Katy Tex. 1.2127 4871 4.015 9.378 1.073 48 48157 89183 81 29.797 -95.768 -4807710 Aldine Tex. -1.2855 4841 2.642 7.189 0.909 48 48201 35289 33 29.944 -95.377 -0803450 Douglas County School District, No. Re Colo. 1.6862 4808 4.764 9.685 0.984 08 08035 113895 56 39.336 -104.92 -1201710 Seminole Fla. 0.4761 4767 4.341 8.595 0.851 12 12117 66884 19 28.717 -81.236 -0612330 Elk Grove Unified Calif. 0.2799 4732 2.61 7.526 0.983 06 06067 69564 56 38.44 -121.277 -0408800 Tucson Unified District Ariz. -0.609 4640 1.842 6.936 1.019 04 04019 43286 67 32.211 -110.962 -4900420 Jordan District Utah 1.1251 4608 3.092 8.447 1.071 49 49035 81343 81 40.537 -112.042 -1100030 District of Columbia Public Schools D.C. -1.3674 4604 1.455 6.552 1.019 11 11001 38766 67 38.905 -77.016 -4818300 El Paso Tex. -1.0172 4601 3.055 7.632 0.916 48 48141 35989 35 31.869 -106.41 -1201920 Volusia Fla. -0.081 4564 3.554 7.425 0.774 12 12127 54124 7 29.059 -81.201 -0102370 Mobile County Ala. -1.1084 4497 3.025 6.526 0.7 01 01097 39954 3 30.796 -88.207 -3904380 Columbus City Ohio -1.9036 4413 1.654 5.989 0.867 39 39049 30591 22 39.986 -82.966 -4820340 Garland Tex. 0.0725 4387 3.45 7.823 0.875 48 48113 55842 24 32.912 -96.598 -2502790 Boston Mass. -1.2203 4327 2.741 7.878 1.027 25 25025 38058 70 42.318 -71.087 -4702220 Knox County School District Tenn. 0.26 4327 2.915 8.092 1.035 47 47093 58453 72 35.993 -83.937 -0635310 Santa Ana Unified Calif. -0.3185 4299 1.788 6.333 0.909 06 06059 48222 33 33.721 -117.875 -5100840 Chesterfield Co. Public Schools Va. 0.8971 4293 3.907 8.319 0.882 51 51041 79845 26 37.379 -77.587 -3701500 Forsyth County Schools N.C. -0.187 4230 3.433 7.634 0.84 37 37067 53065 16 36.13 -80.256 -4838730 San Antonio Tex. -1.7931 4197 1.802 6.576 0.955 48 48029 29304 47 29.42 -98.471 -4835100 Plano Tex. 1.2873000000000001 4182 4.045 9.733 1.138 48 48085 99049 92 33.036 -96.723 -0634170 San Bernardino City Unified Calif. -1.2268 4139 1.096 6.27 1.035 06 06071 38023 72 34.206 -117.337 -0607440 Capistrano Unified Calif. 1.3987 4055 3.418 8.994 1.115 06 06059 110745 89 33.531 -117.615 -0802910 Cherry Creek, School District No. 5, In The County Of Arapah Colo. 1.0924 4036 4.446 9.15 0.941 08 08005 85875 42 39.615 -104.784 -1301230 Clayton County Ga. -1.0733 4034 2.113 6.538 0.885 13 13063 42494 26 33.542 -84.358 -4827300 Lewisville Tex. 1.1865 4018 3.724 9.139 1.083 48 48121 92467 83 33.05 -96.991 -4834320 Pasadena Tex. -0.6487 4018 2.677 7.512 0.967 48 48201 42953 51 29.646 -95.207 -1201470 Osceola Fla. -0.4048 4016 3.098 7.266 0.834 12 12097 46209 15 28.063 -81.149 -0634410 San Francisco Unified Calif. 0.3832 4013 2.612 7.804 1.038 06 06075 62520 73 37.75 -122.43 -0609850 Corona-Norco Unified Calif. 0.7646 4011 2.923 7.855 0.986 06 06065 87349 57 33.846 -117.538 -4815000 Conroe Tex. 0.844 3961 3.858 9.217 1.072 48 48339 78287 81 30.252 -95.402 -3904378 Cleveland Municipal Ohio -3.0248 3932 1.296 5.738 0.888 39 39035 24473 27 41.477 -81.679 -3700011 Cumberland County Schools N.C. -0.6797 3910 3.182 7.439 0.851 37 37051 44294 19 35.038 -78.805 -2400420 Howard County Public Schools Md. 1.5999 3843 4.762 9.648 0.977 24 24027 117852 54 39.251 -76.931 -1300120 Atlanta Public Schools Ga. -1.8434 3833 2.522 6.528 0.801 13 13121 29662 10 33.763 -84.423 -4811680 Brownsville Tex. -1.7594 3805 2.738 7.472 0.947 48 48061 28230 44 25.946 -97.494 -3174820 Omaha Public Schools Neb. -0.5809 3662 2.143 6.504 0.872 31 31055 43559 23 41.29 -96.013 -5101890 Henrico Co. Public Schools Va. 0.4067 3653 4.051 7.967 0.783 51 51087 69072 8 37.538 -77.406 -0614880 Garden Grove Unified Calif. -0.0087 3641 2.496 8.164 1.134 06 06059 58123 92 33.766 -117.956 -0628050 Oakland Unified Calif. -0.7897 3633 1.97 6.267 0.859 06 06001 40845 20 37.797 -122.213 -4703810 Shelby County School District Tenn. 0.8846 3629 3.54 8.368 0.966 47 47157 82112 50 35.306 -89.852 -0200180 Anchorage School District Alaska 0.5663 3614 2.779 8.002 1.045 02 02020 80728 74 61.152 -149.107 -0633840 Sacramento City Unified Calif. -0.965 3612 1.964 6.97 1.001 06 06067 41294 62 38.526 -121.453 -4807830 Alief Tex. -0.9977 3570 2.467 7.617 1.03 48 48201 35391 70 29.704 -95.608 -3411340 Newark N.J. -1.9198 3547 2.171 6.864 0.939 34 34013 34047 41 40.725 -74.174 -4838080 Round Rock Tex. 0.9242 3494 4.013 9.484 1.094 48 48491 85677 86 30.497 -97.709 -4825740 Klein Tex. 0.8817 3490 3.484 8.76 1.055 48 48201 79430 77 30.043 -95.524 -2012990 Wichita Kan. -0.7376 3460 2.52 6.629 0.822 20 20173 42027 13 37.699 -97.31 -2200540 East Baton Rouge Parish La. -1.1696 3415 1.616 6.633 1.003 22 22033 36456 63 30.441 -91.107 -2200840 Jefferson Parish La. -0.7894 3412 2.003 7.081 1.016 22 22051 43226 66 29.79 -90.129 -2733840 St. Paul Public School District Minn. -0.8625 3412 2.316 7.003 0.937 27 27123 42500 41 44.948 -93.104 -5307710 Seattle Public Schools Wash. 0.6729 3411 3.625 9.344 1.144 53 53033 73336 93 47.624 -122.324 -0403400 Gilbert Unified District Ariz. 0.9556 3384 3.646 8.967 1.064 04 04013 84586 79 33.348 -111.728 -0634620 San Juan Unified Calif. 0.0408 3374 2.52 7.224 0.941 06 06067 64280 42 38.648 -121.305 -0401870 Chandler Unified District Ariz. 0.9354 3359 3.499 9.345 1.169 04 04013 83199 95 33.258 -111.809 -1201230 Manatee Fla. -0.095 3324 3.098 7.507 0.882 12 12081 54257 25 27.47 -82.294 -0608610 Chula Vista Elementary Calif. 0.2851 3309 2.896 8.38 1.097 06 06073 65833 86 32.626 -116.964 -4110040 Portland 1J Ore. 0.0662 3299 3.414 8.813 1.08 41 41051 59953 83 45.559 -122.722 -3704620 Union County Public Schools N.C. 0.6173 3265 4.208 9.403 1.039 37 37179 73232 73 34.988 -80.531 -4820010 Frisco Tex. 1.5295 3251 4.683 10.327 1.129 48 48085 105733 91 33.151 -96.811 -1200330 Collier Fla. 0.0274 3250 3.203 8.058 0.971 12 12021 52350 52 26.123 -81.332 -4501440 Charleston 01 S.C. -0.3932 3234 2.888 7.931 1.009 45 45019 47534 64 32.733 -80.167 -4701590 Hamilton County School Distrct Tenn. -0.5334 3228 2.531 7.593 1.012 47 47065 48822 65 35.181 -85.165 -0407750 Deer Valley Unified District Ariz. 0.9567 3227 3.466 8.881 1.083 04 04013 85003 83 33.841 -112.127 -2200300 Caddo Parish La. -1.2406 3225 2.016 6.464 0.89 22 22017 37433 27 32.58 -93.882 -4846680 Ysleta Tex. -1.4753 3220 2.927 7.663 0.947 48 48141 31424 44 31.732 -106.334 -4840710 Socorro Tex. -0.428 3179 2.89 8 1.022 48 48141 43908 68 31.79 -106.245 -1302820 Henry County Ga. 0.32 3178 3.008 7.68 0.934 13 13151 70878 40 33.453 -84.154 -0806900 Adams 12 Five Star Schools Colo. 0.5486 3170 3.503 8.2 0.94 08 08001 72906 42 39.928 -104.99 -4843650 United Tex. -0.5493 3152 2.218 7.296 1.016 48 48479 42525 66 27.85 -99.439 -0633150 Riverside Unified Calif. 0.1042 3136 2.266 7.597 1.066 06 06065 60958 80 33.926 -117.376 -4022770 Oklahoma City Okla. -1.3332 3128 1.785 6.175 0.878 40 40109 30773 25 35.496 -97.526 -1301110 Cherokee County Ga. 0.8102 3102 3.83 8.769 0.988 13 13057 76803 58 34.244 -84.476 -0638010 Stockton Unified Calif. -1.4691 3098 0.703 5.96 1.051 06 06077 37500 76 37.956 -121.269 -1201680 Sarasota Fla. -0.0316 3095 4.166 8.817 0.93 12 12115 56269 39 27.18 -82.318 -2721240 Minneapolis Public School Dist. Minn. -1.0214 3089 2.049 7.234 1.037 27 27053 38362 72 44.964 -93.268 -1201260 Marion Fla. -0.6498 3081 3.518 7.19 0.734 12 12083 44399 4 29.21 -82.057 -1201050 Lake Fla. -0.0123 3062 3.559 7.465 0.781 12 12069 53399 8 28.761 -81.711 -0603630 Bakersfield City Calif. -1.7596 3059 1.135 6.056 0.984 06 06029 32964 56 35.415 -118.878 -1302220 Forsyth County Ga. 1.2536 3047 4.774 10.172 1.08 13 13117 98468 83 34.226 -84.125 -0406250 Peoria Unified School District Ariz. 0.5006 3027 2.909 8.547 1.127 04 04013 70220 91 33.723 -112.289 -2201170 Orleans Parish La. -1.9255 3018 1.331 7.015 1.137 22 22071 29662 92 30.034 -89.922 -0613920 Fontana Unified Calif. -0.3608 3014 1.734 6.376 0.928 06 06071 51030 38 34.108 -117.459 -1713710 SD U-46 Ill. 0.4864 3005 2.71 8.158 1.089 17 17089 64791 85 42.006 -88.244 -4815270 Corpus Christi Tex. -0.7482 3005 2.72 7.106 0.877 48 48355 45331 24 27.733 -97.403 -1804770 Indianapolis Public Schools Ind. -2.4981 2982 2.193 6.605 0.882 18 18097 26252 26 39.793 -86.136 -4030240 Tulsa Okla. -1.3035 2964 2.094 5.921 0.765 40 40143 34443 7 36.163 -95.945 -2400330 Frederick County Public Schools Md. 1.1857 2961 3.91 8.947 1.007 24 24021 98415 64 39.472 -77.398 -4110820 Salem-Keizer 24J Ore. -0.5715 2961 2.328 8.03 1.14 41 41047 50064 93 44.945 -123.027 -4502490 Horry S.C. -0.5806 2955 3.325 7.952 0.925 45 45051 44374 37 33.921 -78.997 -4830390 Mesquite Tex. -0.0681 2954 2.856 7.792 0.987 48 48113 49735 57 32.758 -96.594 -0609030 Clovis Unified Calif. 0.7428 2952 3.997 8.526 0.906 06 06019 83847 32 36.875 -119.632 -4703690 Rutherford County School Dist. Tenn. 0.2689 2951 3.395 8.544 1.03 47 47149 61497 70 35.843 -86.417 -1200510 Escambia Fla. -0.6986 2949 3.381 7.027 0.729 12 12033 42897 4 30.716 -87.38 -4825660 Killeen Tex. -0.3713 2942 2.667 7.82 1.031 48 48027 44826 71 31.129 -97.759 -4814280 Clear Creek Tex. 1.0753 2938 3.873 9.247 1.075 48 48167 88357 81 29.545 -95.106 -2703180 Anoka-Hennepin Public School Dist. Minn. 0.8391 2927 4.054 9.006 0.99 27 27003 80402 58 45.219 -93.335 -1201770 St. Lucie Fla. -0.5501 2917 3.056 7.224 0.834 12 12111 45735 15 27.376 -80.487 -4101920 Beaverton 48J Ore. 0.6304 2906 4.008 9.025 1.003 41 41067 76994 63 45.496 -122.826 -1602100 Meridian Joint District Idaho 0.9358 2890 3.311 8.621 1.062 16 16001 74523 79 43.55 -116.311 -0802340 Aurora, Joint District No. 28 Of The Counties Of Adams And A Colo. -0.6907 2876 2.215 6.684 0.894 08 08005 41088 28 39.719 -104.733 -5100810 Chesapeake City Va. 0.7432 2874 3.726 8.232 0.901 51 51550 78518 30 36.678 -76.302 -2400390 Harford County Public Schools Md. 0.936 2854 3.668 9.096 1.086 24 24025 89795 84 39.568 -76.321 -2101860 Fayette County Ky. 0.0323 2850 4.095 8.393 0.86 21 21067 56700 20 38.042 -84.459 -3605850 Buffalo City School District N.Y. -2.4637 2834 1.525 5.559 0.807 36 36029 25382 11 42.9 -78.851 -2201650 St. Tammany Parish La. 0.3195 2799 3.347 8.14 0.958 22 22103 67691 48 30.459 -89.948 -4837020 Richardson Tex. -0.0942 2789 3.632 8.605 0.995 48 48113 49269 60 32.936 -96.735 -0101920 Jefferson County Ala. 0.1545 2773 2.603 6.583 0.796 01 01073 59257 10 33.687 -86.851 -4823910 Humble Tex. 1.1021 2763 3.276 8.687 1.082 48 48201 91359 83 30.002 -95.202 -3701260 Durham Public Schools N.C. -0.1944 2750 2.513 6.949 0.887 37 37063 48420 27 36.036 -78.876 -4841220 Spring Tex. -0.419 2741 2.456 6.836 0.876 48 48201 49457 24 30.065 -95.394 -0625800 Moreno Valley Unified Calif. -0.3381 2728 1.515 6.189 0.935 06 06065 51373 40 33.933 -117.216 -0602610 Anaheim City Calif. -0.6114 2721 1.507 6.682 1.035 06 06059 44816 72 33.827 -117.917 -3172840 Lincoln Public Schools Neb. 0.3353 2719 4.104 8.727 0.925 31 31109 63010 37 40.796 -96.709 -0405930 Paradise Valley Unified District Ariz. 0.74 2703 3.361 8.625 1.053 04 04013 77775 76 33.652 -111.982 -1301020 Chatham County Ga. -0.5699 2676 2.368 6.711 0.869 13 13051 39596 22 32.035 -81.158 -0409060 Washington Elementary School District Ariz. -0.6934 2668 1.762 7.237 1.095 04 04013 43072 86 33.587 -112.113 -3904375 Cincinnati City Ohio -1.9573 2668 1.957 7.134 1.035 39 39061 28375 72 39.146 -84.502 -3702370 Johnston County Schools N.C. -0.076 2664 3.713 8.218 0.901 37 37101 55703 30 35.518 -78.366 -1200300 Clay Fla. 0.3671 2639 4.113 8.203 0.818 12 12019 65071 13 29.983 -81.858 -4824420 Irving Tex. -0.839 2636 2.119 7.263 1.029 48 48113 36849 70 32.832 -96.963 -0600028 Temecula Valley Unified Calif. 0.8225 2607 3.492 8.271 0.956 06 06065 85631 47 33.521 -117.05 -4825260 Keller Tex. 1.2886 2583 3.9 9.349 1.09 48 48439 94889 85 32.92 -97.252 -0631530 Poway Unified Calif. 1.5 2576 4.47 9.279 0.962 06 06073 112023 49 32.982 -117.06 -3701620 Gaston County Schools N.C. -0.7007 2574 3.256 7.562 0.861 37 37071 46103 21 35.294 -81.18 -4818180 Edinburg CISD Tex. -1.4465 2571 3.02 7.453 0.887 48 48215 34547 26 26.537 -98.188 -4827030 Leander Tex. 1.0956 2553 3.758 9.472 1.143 48 48491 88249 93 30.518 -97.886 -0626370 Mt. Diablo Unified Calif. 0.7084 2547 2.829 7.367 0.908 06 06013 83433 32 37.953 -121.977 -4900630 Nebo District Utah 0.9886 2540 3.371 8.163 0.958 49 49049 66352 48 39.998 -111.562 -2929280 St. Louis City Mo. -2.5325 2523 1.089 5.953 0.973 29 29510 26818 53 38.636 -90.245 -0634590 San Jose Unified Calif. 0.4299 2504 2.788 7.432 0.929 06 06085 75276 38 37.263 -121.868 -2801320 Desoto Co. School District Miss. 0.1437 2502 3.236 7.729 0.899 28 28033 62278 29 34.875 -89.992 -4901200 Weber District Utah 0.8436 2492 2.709 7.744 1.007 49 49057 71213 64 41.27 -111.913 -4834860 Pharr-San Juan-Alamo Tex. -1.8006 2482 2.666 6.685 0.804 48 48215 30921 11 26.181 -98.163 -0102430 Montgomery County Ala. -0.9939 2479 2.361 5.384 0.605 01 01101 41262 1 32.22 -86.208 -0628470 Ontario-Montclair Elementary Calif. -0.5573 2477 1.62 6.592 0.994 06 06071 50126 60 34.062 -117.658 -0614400 Fremont Unified Calif. 1.3731 2476 4.543 10.144 1.12 06 06001 104869 90 37.527 -121.989 -4900142 Canyons District Utah 1.0076 2471 3.557 8.803 1.049 49 49035 81371 76 40.585 -111.756 -4828920 Mansfield Tex. 0.6937 2466 3.503 8.503 1 48 48439 78958 61 32.582 -97.143 -2200330 Calcasieu Parish La. -0.5774 2454 2.762 7.295 0.907 22 22019 53166 32 30.229 -93.358 -4841100 Spring Branch Tex. 0.208 2447 2.792 7.818 1.005 48 48201 53196 63 29.792 -95.536 -3624750 Rochester City School District N.Y. -2.3459 2436 1.592 4.499 0.581 36 36055 25759 1 43.17 -77.614 -1201110 Leon Fla. 0.06 2422 3.842 8.177 0.867 12 12073 59013 22 30.458 -84.278 -4704530 Williamson County School Dist. Tenn. 1.6511 2414 4.555 10.157 1.12 47 47187 109494 90 35.894 -86.899 -1301500 Coweta County Ga. 0.4291 2397 2.984 7.813 0.966 13 13077 66917 51 33.353 -84.763 -1304380 Richmond County Ga. -1.479 2377 1.794 6.025 0.846 13 13245 36008 18 33.36 -82.074 -1201740 St. Johns Fla. 0.7708 2373 4.553 9.312 0.952 12 12109 82029 46 29.889 -81.454 -1303870 Muscogee County Ga. -1.0035 2362 2.176 6.878 0.94 13 13215 42841 42 32.528 -84.911 -4808130 Amarillo Tex. -0.4017 2361 3.019 7.998 0.996 48 48375 44648 60 35.206 -101.848 -3700530 Cabarrus County Schools N.C. 0.2663 2358 3.563 8.401 0.968 37 37025 68910 51 35.383 -80.55 -0608460 Chino Valley Unified Calif. 0.9479 2344 3.26 8.114 0.971 06 06071 88674 52 33.97 -117.695 -0601332 Twin Rivers Unified Calif. -1.2648 2341 1.682 6.31 0.926 06 06067 40433 37 38.684 -121.429 -1803630 Fort Wayne Community Schools Ind. -0.879 2333 2.923 7.777 0.971 18 18003 41428 52 41.068 -85.142 -0632550 West Contra Costa Unified Calif. -0.0441 2331 1.576 6.136 0.912 06 06013 58825 33 37.954 -122.3 -0622230 Lodi Unified Calif. -0.151 2325 1.641 7.074 1.087 06 06077 57560 84 38.122 -121.296 -5102670 Norfolk City Va. -1.0621 2323 2.777 6.866 0.818 51 51710 39447 13 36.89 -76.249 -0402690 Dysart Unified District Ariz. 0.3786 2320 2.832 7.96 1.026 04 04013 63009 69 33.628 -112.417 -0625470 Montebello Unified Calif. -0.5385 2316 1.341 6.112 0.954 06 06037 43669 47 34.007 -118.129 -0635130 San Ramon Valley Unified Calif. 1.9453 2299 4.903 10.009 1.021 06 06013 154132 68 37.805 -121.94 -2200870 Lafayette Parish La. -0.2896 2297 2.571 7.509 0.988 22 22055 50192 58 30.207 -92.064 -0633860 Saddleback Valley Unified Calif. 1.2685 2291 3.526 8.604 1.016 06 06059 100764 66 33.646 -117.584 -0629580 Palmdale Elementary Calif. -0.817 2290 1.229 6.363 1.027 06 06037 45040 69 34.579 -118.084 -4703030 Montgomery County Schools Tenn. -0.1943 2285 3.059 7.871 0.963 47 47125 53753 50 36.483 -87.36 -0404230 Kyrene Elementary District Ariz. 0.932 2276 3.971 9.235 1.053 04 04013 82954 76 33.284 -111.997 -1908970 Des Moines Independent Comm School District Iowa -0.5306 2268 2.192 6.812 0.924 19 19153 46456 37 41.573 -93.618 -4501170 Berkeley 01 S.C. -0.3517 2268 2.976 7.519 0.909 45 45015 50925 33 33.202 -79.951 -3407830 Jersey City N.J. -0.885 2265 2.387 7.468 1.016 34 34017 41773 66 40.715 -74.066 -1304020 Paulding County Ga. 0.3115 2253 3.171 7.692 0.904 13 13223 65792 31 33.921 -84.867 -0401680 Cartwright Elementary District Ariz. -1.2485 2245 1.533 6.732 1.04 04 04013 35842 73 33.485 -112.198 -1741690 Indian Prairie Ill. 1.7017 2241 4.783 9.922 1.028 17 17043 118171 70 41.75 -88.21 -4818000 Ector County Tex. -0.4509 2238 2.289 6.633 0.869 48 48135 49634 22 31.869 -102.543 -2634470 Utica Community Schools Mich. 0.6565 2234 3.294 8.549 1.051 26 26099 84645 76 42.646 -83.024 -2802190 Jackson Public School Dist. Miss. -1.8476 2232 2.052 5.796 0.749 28 28049 31427 5 32.318 -90.215 -1731740 Plainfield Ill. 1.1388 2229 3.364 8.947 1.117 17 17197 88818 89 41.611 -88.202 -0628650 Orange Unified Calif. 0.6665 2227 2.666 8.076 1.082 06 06059 80397 83 33.783 -117.695 -4826130 La Joya Tex. -2.0008 2211 2.269 6.821 0.91 48 48215 26020 33 26.313 -98.438 -0100270 Baldwin County Ala. 0.1515 2207 3.523 7.435 0.782 01 01003 54735 8 30.739 -87.726 -0611110 Desert Sands Unified Calif. -0.056 2206 2.523 7.268 0.949 06 06065 53161 45 33.83 -116.111 -0802490 Boulder Valley School District No. Re2 Colo. 1.3738 2205 4.77 9.789 1.004 08 08013 100416 63 39.998 -105.395 -3904490 Toledo City Ohio -2.1586 2195 2.044 6.042 0.8 39 39095 31041 10 41.651 -83.582 -0803060 Colorado Springs, School District No. 11, In The County Of E Colo. -0.1867 2194 3.738 8.1 0.872 08 08041 51975 23 38.871 -104.796 -0684500 Irvine Unified Calif. 1.5764 2180 4.865 10.467 1.12 06 06059 109596 90 33.675 -117.767 -4828500 Lubbock Tex. -0.4798 2175 2.499 7.389 0.978 48 48303 43948 54 33.58 -101.863 -0631320 Pomona Unified Calif. -0.265 2170 1.476 6.283 0.961 06 06037 50825 49 34.048 -117.776 -0805370 St. Vrain Valley School District No. Re1J Colo. 0.8617 2168 3.913 8.817 0.981 08 08013 77525 55 40.171 -105.176 -4821420 Grand Prairie Tex. -0.4292 2166 2.651 7.4 0.95 48 48113 47329 45 32.725 -96.996 -0612880 Escondido Union Calif. 0.1592 2161 1.524 6.675 1.03 06 06073 48714 70 33.134 -117.087 -4704020 Sumner County School District Tenn. 0.1667 2157 3.105 8.255 1.03 47 47165 63778 70 36.469 -86.46 -5308250 Spokane School District Wash. -0.5755 2156 3.361 8.426 1.013 53 53063 44975 65 47.664 -117.399 -0641160 Visalia Unified Calif. -0.3735 2125 1.565 7.396 1.166 06 06107 52950 95 36.366 -119.322 -3412690 Paterson N.J. -1.5725 2122 1.749 6.781 1.006 34 34031 31892 64 40.915 -74.162 -1201380 Okaloosa Fla. 0.2425 2115 4.205 8.613 0.882 12 12091 60671 25 30.719 -86.598 -5308700 Tacoma School District Wash. -0.4925 2115 2.639 7.351 0.942 53 53053 49954 43 47.242 -122.459 -5102640 Newport News City Va. -0.3855 2100 2.86 7.263 0.881 51 51700 49334 25 37.102 -76.516 -0803990 Poudre School District R-1 Colo. 0.8353 2095 4.571 9.51 0.988 08 08069 76700 58 40.773 -105.487 -0407570 Scottsdale Unified District Ariz. 1.1562 2089 4.105 9.137 1.006 04 04013 91675 64 33.582 -111.887 -0609620 Compton Unified Calif. -1.056 2085 1.624 5.17 0.709 06 06037 43303 3 33.892 -118.231 -4901140 Washington District Utah 0.4269 2076 2.985 9.017 1.206 49 49053 56227 98 37.28 -113.505 -2010140 Olathe Kan. 1.2847 2071 4.379 9.329 0.99 20 20091 89160 58 38.902 -94.814 -5400600 Kanawha County Schools W.Va. -0.2053 2061 2.939 7.413 0.895 54 54039 48292 29 38.337 -81.528 -1302610 Hall County Ga. 0.1818 2060 2.568 7.575 1.001 13 13139 56620 62 34.318 -83.819 -2732390 Rosemount-Apple Valley-Eagan Minn. 1.2426 2057 4.52 9.252 0.946 27 27037 96332 44 44.754 -93.123 -0103030 Shelby County Ala. 0.7149 2052 3.022 8.046 1.005 01 01117 73538 63 33.259 -86.657 -3700450 Buncombe County Schools N.C. 0.1449 2050 3.836 8.474 0.928 37 37021 52045 38 35.611 -82.53 -0632370 Rialto Unified Calif. -0.5583 2048 1.66 6.073 0.882 06 06071 48908 26 34.189 -117.449 -5303960 Kent School District Wash. 0.3626 2048 2.977 8.836 1.172 53 53033 71412 96 47.383 -122.161 -4813050 Carrollton-Farmers Branch Tex. 0.3768 2044 3.403 7.981 0.916 48 48113 55876 35 32.946 -96.913 -1302880 Houston County Ga. -0.0069 2042 3.55 7.938 0.878 13 13153 62299 24 32.454 -83.669 -0509000 Little Rock School District Ark. -1.0644 2039 1.978 6.628 0.93 05 05119 35899 39 34.721 -92.349 -0610290 Cupertino Union Calif. 2.0073 2037 5.914 11.379 1.093 06 06085 149865 85 37.31 -122.074 -1734510 Rockford Ill. -1.3651 2031 1.912 6.632 0.944 17 17201 38768 43 42.263 -89.046 -2511130 Springfield Mass. -2.3221 2017 2.977 6.133 0.631 25 25013 30523 1 42.115 -72.54 -2011640 Shawnee Mission Pub Sch Kan. 0.9035 2011 3.962 9.007 1.009 20 20091 75912 64 38.989 -94.7 -2400210 Carroll County Public Schools Md. 1.2415 2010 4.136 9.276 1.028 24 24013 102554 70 39.563 -77.023 -5103660 Stafford Co. Public Schools Va. 1.317 1994 3.61 8.748 1.027 51 51179 104725 70 38.396 -77.461 -4219170 Pittsburgh Pa. -1.0893 1992 2.594 6.909 0.863 42 42003 37412 21 40.44 -79.977 -1600360 Boise Independent District Idaho 0.3016 1991 3.508 8.636 1.026 16 16001 60241 69 43.431 -116.122 -5302700 Evergreen School District (Clark) Wash. 0.0892 1982 2.985 8.581 1.119 53 53011 62653 90 45.648 -122.509 -1200030 Alachua Fla. -0.162 1980 3.522 7.959 0.887 12 12001 48432 27 29.675 -82.358 -4503390 Richland 02 S.C. 0.3494 1972 3.075 7.368 0.859 45 45079 67012 20 34.155 -80.902 -1301860 Douglas County Ga. -0.1577 1968 2.889 7.325 0.887 13 13097 58510 27 33.702 -84.768 -4900870 Salt Lake District Utah 0.0937 1966 2.523 7.795 1.055 49 49035 49242 77 40.778 -111.93 -4829670 Mcallen Tex. -0.9733 1943 3.105 7.619 0.903 48 48215 36043 31 26.217 -98.239 -4826580 Lamar CISD Tex. 0.5733 1932 3.525 8.701 1.035 48 48157 67752 72 29.55 -95.808 -2201020 Livingston Parish La. 0.1944 1928 3.211 7.964 0.951 22 22063 64159 45 30.44 -90.728 -2916400 Kansas City Mo. -2.2311 1923 1.555 6.252 0.94 29 29095 27337 42 39.064 -94.543 -2400270 Charles County Public Schools Md. 0.7578 1922 3.165 8.058 0.979 24 24017 94405 55 38.516 -76.991 -3703330 New Hanover County Schools N.C. -0.0162 1921 3.757 8.639 0.976 37 37129 57314 54 34.263 -77.895 -0100390 Birmingham City Ala. -2.1001 1916 1.591 5.611 0.804 01 01073 29858 11 33.529 -86.796 -1201650 Santa Rosa Fla. 0.122 1915 4.528 8.57 0.808 12 12113 59829 11 30.732 -87.018 -4816740 Denton Tex. 0.5064 1903 3.383 8.432 1.01 48 48121 65079 65 33.213 -97.094 -0615240 Glendale Unified Calif. 0.3023 1899 3.377 8.469 1.018 06 06037 59395 67 34.193 -118.243 -0630660 Placentia-Yorba Linda Unified Calif. 1.1185 1899 3.522 8.768 1.049 06 06059 94623 76 33.885 -117.801 -4829850 Mckinney Tex. 1.0985 1899 3.835 9.313 1.096 48 48085 88884 86 33.216 -96.615 -1200090 Bay Fla. -0.0377 1895 3.694 7.775 0.816 12 12005 54018 12 30.31 -85.626 -5304230 Lake Washington School District Wash. 1.5734 1884 4.821 10.311 1.098 53 53033 113562 86 47.676 -122.112 -1301410 Columbia County Ga. 0.804 1876 3.753 8.605 0.97 13 13073 71860 52 33.544 -82.264 -0606810 Cajon Valley Union Elementary Calif. -0.4317 1871 2.195 7.479 1.057 06 06073 50192 78 32.789 -116.907 -0641190 Vista Unified Calif. 0.3089 1870 2.301 7.477 1.035 06 06073 59765 72 33.204 -117.239 -0606390 Panama-Buena Vista Union Calif. 0.0865 1864 2.194 6.983 0.958 06 06029 61023 48 35.261 -119.114 -1300420 Bibb County Ga. -1.3743 1859 1.922 6.036 0.823 13 13021 35995 13 32.806 -83.697 -3703450 Onslow County Schools N.C. -0.2641 1859 3.34 7.653 0.863 37 37133 50017 21 34.762 -77.456 -3631920 Yonkers City School District N.Y. -0.5054 1852 2.602 6.072 0.694 36 36119 48095 3 40.947 -73.867 -0609390 Colton Joint Unified Calif. -0.2806 1848 1.548 6.312 0.953 06 06071 50069 46 34.041 -117.329 -4500720 Aiken S.C. -0.4272 1848 2.653 7.185 0.906 45 45003 47197 32 33.594 -81.634 -2513230 Worcester Mass. -0.9564 1847 3.013 7.562 0.91 25 25027 41261 33 42.271 -71.808 -3700030 Alamance-Burlington Schools N.C. -0.5054 1840 3.204 7.579 0.875 37 37001 49466 24 36.044 -79.399 -3702310 Iredell-Statesville Schools N.C. 0.226 1829 3.714 8.468 0.951 37 37097 62053 46 35.822 -80.879 -3501500 Las Cruces Public Schools N.M. -0.5126 1822 2.188 7.021 0.967 35 35013 43202 51 32.365 -106.838 -2928860 Springfield R-XII Mo. -0.2627 1818 3.375 7.922 0.909 29 29077 49319 33 37.209 -93.272 -4834830 Pflugerville Tex. 0.2927 1815 3.068 8.307 1.048 48 48453 62918 75 30.438 -97.588 -3703930 Robeson County Schools N.C. -1.7366 1812 2.319 6.325 0.801 37 37155 29345 10 34.64 -79.104 -0629550 Palm Springs Unified Calif. -0.2725 1809 1.987 6.172 0.837 06 06065 43048 16 33.806 -116.468 -2201290 Rapides Parish La. -0.7104 1808 2.591 6.815 0.845 22 22079 42318 17 31.199 -92.533 -4502010 Dorchester 02 S.C. 0.2051 1799 3.642 8.308 0.933 45 45035 61857 40 32.951 -80.262 -0623610 Manteca Unified Calif. 0.1054 1791 1.752 6.696 0.989 06 06077 65296 58 37.808 -121.242 -4826790 Laredo Tex. -2.3667 1791 1.807 6.361 0.911 48 48479 24504 33 27.51 -99.489 -5508520 Madison Metropolitan School District Wis. 0.224 1791 2.995 7.99 0.999 55 55025 61300 61 43.071 -89.387 -4502700 Lexington 01 S.C. 0.4746 1785 3.507 8.285 0.956 45 45063 69719 47 33.89 -81.304 -0640150 Tustin Unified Calif. 0.9387 1783 3.412 8.538 1.025 06 06059 81250 69 33.743 -117.799 -4400900 Providence R.I. -1.9895 1777 1.62 5.962 0.869 44 44007 30611 22 41.823 -71.419 -3700012 Pitt County Schools N.C. -0.6531 1771 2.758 7.629 0.974 37 37147 44711 53 35.594 -77.375 -5103640 Spotsylvania Co. Public Schools Va. 0.7931 1768 3.515 8.316 0.96 51 51177 83223 49 38.185 -77.656 -3904348 Akron City Ohio -1.7679 1766 2.13 6.504 0.875 39 39153 33985 24 41.077 -81.52 -4503360 Richland 01 S.C. -1.0994 1755 2.03 6.721 0.938 45 45079 37165 41 33.951 -80.864 -3173740 Millard Public Schools Neb. 1.3974 1748 4.729 9.149 0.884 31 31055 91164 26 41.214 -96.152 -0801920 Academy, School District No. 20, In The County Of El Paso An Colo. 1.5533 1736 4.781 9.62 0.968 08 08041 104219 51 38.992 -104.789 -4810230 Birdville Tex. 0.1524 1736 2.921 8.106 1.037 48 48439 57387 72 32.837 -97.236 -2611600 Dearborn City School District Mich. -0.7452 1735 2.029 7.695 1.133 26 26163 43886 92 42.315 -83.216 -4830570 Midland Tex. 0.0266 1734 2.207 7.252 1.009 48 48329 55167 64 31.847 -102.06 -0629220 Oxnard Elementary Calif. -0.2352 1728 1.217 5.918 0.94 06 06111 53443 42 34.199 -119.234 -0101800 Huntsville City Ala. -0.3426 1727 2.631 7.473 0.968 01 01089 51280 51 34.686 -86.601 -0639420 Torrance Unified Calif. 1.1238 1721 3.555 8.708 1.031 06 06037 84987 71 33.835 -118.341 -0600014 Hesperia Unified Calif. -0.6294 1711 1.986 6.461 0.895 06 06071 51401 29 34.364 -117.33 -0616740 Hayward Unified Calif. -0.21560000000000001 1705 0.87 6.538 1.134 06 06001 57817 92 37.644 -122.081 -4824990 Judson Tex. -0.0414 1703 2.427 7.417 0.998 48 48029 53045 61 29.541 -98.346 -4020250 Moore Okla. 0.6617 1684 3.6 8.588 0.998 40 40027 65691 61 35.337 -97.504 -1200810 Hernando Fla. -0.4335 1683 3.626 7.673 0.809 12 12053 50779 11 28.552 -82.419 -4824060 Hurst-Euless-Bedford Tex. 0.3749 1681 3.391 9.083 1.138 48 48439 59999 93 32.825 -97.124 -1803450 Evansville-Vanderburgh Ind. -0.3467 1678 2.786 7.61 0.965 18 18163 50980 50 38.025 -87.586 -2926850 Rockwood R-VI Mo. 1.7199 1678 4.887 9.256 0.874 29 29189 117759 23 38.56 -90.626 -5309270 Vancouver School District Wash. -0.5302 1671 2.814 8.138 1.065 53 53011 54348 79 45.675 -122.677 -0600027 Lake Elsinore Unified Calif. 0.1925 1669 2.66 6.797 0.827 06 06065 67821 14 33.673 -117.353 -2400660 Washingtion County Public Schools Md. 0.1341 1669 3.636 8.293 0.931 24 24043 66598 39 39.604 -77.814 -0611460 Downey Unified Calif. 0.0767 1668 2.14 7.157 1.003 06 06037 59750 63 33.936 -118.135 -2012000 Blue Valley - Overland Park Kan. 2.0065 1667 5.005 10.208 1.041 20 20091 126750 73 38.833 -94.67 -2725200 Osseo Public School District Minn. 0.6997 1666 3.259 8.629 1.074 27 27053 82414 81 45.108 -93.429 -0600029 Murrieta Valley Unified Calif. 0.8877 1661 3.138 7.946 0.962 06 06065 91920 49 33.532 -117.298 -0901920 Hartford School District Conn. -2.7974 1659 1.397 6.172 0.955 09 09003 27065 47 41.766 -72.683 -0804350 Mesa County Valley School District No. Colo. 0.4891 1658 3.462 8.294 0.967 08 08077 64089 51 38.958 -108.698 -0900450 Bridgeport School District Conn. -1.38 1654 1.352 6.109 0.951 09 09001 40173 46 41.187 -73.195 -0616920 Hemet Unified Calif. -0.6611 1649 1.959 6.466 0.901 06 06065 48296 30 33.608 -116.785 -0625130 Modesto City Elementary Calif. -1.4932 1642 1.544 6.123 0.916 06 06099 37549 35 37.629 -121.005 -0400600 Alhambra Elementary District Ariz. -1.8863 1633 2.069 6.455 0.877 04 04013 30244 24 33.509 -112.137 -5302820 Federal Way School District Wash. 0.0992 1631 3.357 7.804 0.889 53 53033 64250 27 47.317 -122.317 -3404590 Elizabeth N.J. -0.7307 1630 2.82 7.647 0.965 34 34039 42217 50 40.666 -74.195 -0627240 Newport-Mesa Unified Calif. 0.7964 1625 3.064 7.935 0.974 06 06059 75669 53 33.633 -117.882 -5103240 Richmond City Va. -2.0235 1624 3.309 5.551 0.448 51 51760 28940 1 37.529 -77.476 -5507320 Kenosha School District Wis. -0.1804 1624 3.074 7.749 0.935 55 55059 59599 40 42.581 -87.883 -0613360 Fairfield-Suisun Unified Calif. 0.1914 1621 2.325 7.187 0.972 06 06095 68954 53 38.229 -122.062 -0620880 Lancaster Elementary Calif. -0.8533 1619 0.728 6.002 1.055 06 06037 41596 77 34.735 -118.129 -4821150 Goose Creek CISD Tex. -0.2815 1617 2.683 7.791 1.022 48 48201 52186 68 29.775 -94.962 -2200270 Bossier Parish La. -0.1165 1615 2.758 7.648 0.978 22 22015 60030 54 32.679 -93.605 -0632070 Redlands Unified Calif. 0.5114 1596 2.87 7.711 0.968 06 06071 75951 51 34.084 -117.072 -4666270 Sioux Falls School District 49-5 S.D. 0.4328 1596 3.098 8.789 1.138 46 46099 64880 92 43.558 -96.74 -5306960 Puyallup School District Wash. 0.4896 1596 3.749 9.108 1.072 53 53053 73281 81 47.17 -122.303 -1302130 Fayette County Ga. 1.2393 1595 4.346 9.193 0.969 13 13113 94241 52 33.414 -84.494 -4010590 Edmond Okla. 1.2247 1595 4.021 9.295 1.055 40 40109 87209 77 35.673 -97.447 -3904480 South-Western City Ohio -0.2328 1593 2.868 8.236 1.074 39 39049 54912 81 39.885 -83.13 -4820250 Galena Park Tex. -0.5286 1592 2.934 7.821 0.977 48 48201 41586 54 29.769 -95.187 -3701140 Davidson County Schools N.C. 0.263 1588 3.664 8.276 0.922 37 37057 61677 37 35.793 -80.213 -3628590 Syracuse City School District N.Y. -1.9247 1587 1.249 4.498 0.65 36 36067 26840 2 43.041 -76.144 -1000200 Christina School District Del. -0.087 1580 3.278 7.238 0.792 10 10003 57108 9 39.664 -75.729 -4205310 Central Bucks Pa. 1.6504 1578 4.864 10.762 1.179 42 42017 121452 96 40.315 -75.118 -2200090 Ascension Parish La. 0.2014 1563 2.64 8.429 1.158 22 22005 70515 94 30.204 -90.911 -0616325 Hacienda La Puente Unified Calif. 0.5085 1555 2.494 7.615 1.024 06 06037 63267 69 34.012 -117.965 -0623340 Madera Unified Calif. -1.002 1552 1.608 6.177 0.914 06 06039 41078 34 36.942 -120.124 -0634880 San Marcos Unified Calif. 0.5799 1541 3.674 8.344 0.934 06 06073 64421 40 33.145 -117.181 -1810650 Hamilton Southeastern Schools Ind. 1.5731 1541 4.61 10.04 1.086 18 18057 102918 84 39.999 -85.939 -4100023 Hillsboro 1J Ore. 0.3441 1541 2.892 7.781 0.978 41 41067 65342 54 45.554 -122.983 -0601620 Abc Unified Calif. 0.6086 1536 3.089 8.517 1.086 06 06037 72703 84 33.864 -118.068 -3704050 Rowan-Salisbury Schools N.C. -0.2973 1535 3.02 6.911 0.778 37 37159 50097 8 35.641 -80.524 -0613140 Evergreen Elementary Calif. 1.0805 1534 4.027 8.848 0.964 06 06085 107924 50 37.297 -121.758 -0804410 Greeley,School District No. 6, In The County Of Weld And Sta Colo. -0.241 1531 2.942 6.958 0.803 08 08123 46340 11 40.407 -104.7 -0602430 Alvord Unified Calif. -0.1328 1530 1.85 6.882 1.006 06 06065 53085 64 33.902 -117.485 -0629490 Pajaro Valley Unified Calif. -0.3594 1529 1.045 6.639 1.119 06 06087 49066 90 36.948 -121.766 -5100270 Arlington Co. Public Schools Va. 1.5224 1529 4.199 8.905 0.941 51 51013 109349 42 38.879 -77.101 -1708550 Cusd 300 Ill. 0.7538 1528 2.889 8.304 1.083 17 17089 75944 83 42.116 -88.391 -1734740 Schaumburg CCSD Ill. 0.7684 1528 4.132 10.142 1.202 17 17031 73412 98 42.028 -88.088 -2100510 Boone Co. Ky. 0.7272 1525 3.803 8.615 0.962 21 21015 76735 49 38.984 -84.736 -0691135 Val Verde Unified Calif. -0.4433 1522 2.441 6.803 0.872 06 06065 55295 23 33.843 -117.258 -0605580 Santa Maria-Bonita Calif. -0.6566 1520 0.894 6.287 1.079 06 06083 43055 82 34.944 -120.449 -0627690 Norwalk-La Mirada Unified Calif. 0.2246 1518 2.338 6.875 0.907 06 06037 66395 32 33.904 -118.046 -3702010 Harnett County Schools N.C. -0.5051 1517 2.692 7.063 0.874 37 37085 45112 24 35.369 -78.869 -0619260 Jurupa Unified Calif. -0.3563 1516 1.875 6.58 0.941 06 06065 54642 42 34.004 -117.472 -0609640 Conejo Valley Unified Calif. 1.3077 1513 3.735 8.944 1.042 06 06111 111212 74 34.18 -118.887 -0614730 Fullerton Elementary Calif. 0.4569 1511 3.175 8.554 1.076 06 06059 60965 82 33.883 -117.931 -0902790 New Haven School District Conn. -1.7082 1510 1.713 6.696 0.997 09 09009 34849 60 41.313 -72.926 -0628250 Oceanside Unified Calif. -0.0238 1505 2.075 7.171 1.019 06 06073 54606 67 33.255 -117.358 -4501110 Beaufort S.C. -0.1295 1502 2.646 7.627 0.996 45 45013 46574 60 32.474 -80.668 -4807890 Allen Tex. 1.4151 1499 4.486 10.357 1.174 48 48085 103618 96 33.108 -96.669 -0408170 Sunnyside Unified District Ariz. -1.5434 1498 1.747 6 0.851 04 04019 32300 18 32.098 -110.975 -0629940 Pasadena Unified Calif. 0.2149 1498 2.576 6.366 0.758 06 06037 55999 6 34.196 -118.095 -0512660 Springdale School District Ark. -0.1826 1496 2.832 7.646 0.963 05 05143 45312 50 36.183 -94.125 -3904384 Dayton City Ohio -2.5716 1496 1.278 5.606 0.866 39 39113 27749 22 39.768 -84.204 -1303930 Newton County Ga. -0.3974 1495 2.469 7.056 0.917 13 13217 51773 35 33.555 -83.85 -2201200 Ouachita Parish La. -0.0687 1494 3.095 7.565 0.894 22 22073 52274 29 32.478 -92.155 -0612960 Etiwanda Elementary Calif. 1.029 1491 3.538 8.691 1.031 06 06071 99551 71 34.161 -117.515 -2803830 Rankin Co. School District Miss. 0.3476 1490 2.789 8.048 1.052 28 28121 60826 76 32.264 -89.946 -0102220 Madison County Ala. 0.7816 1489 3.442 8.162 0.944 01 01089 77150 43 34.802 -86.512 -2628560 Plymouth-Canton Community Schools Mich. 1.3047 1489 4.124 9.669 1.109 26 26163 103898 88 42.347 -83.509 -5101800 Hampton City Va. -0.4511 1489 2.649 7.292 0.929 51 51650 51121 38 37.05 -76.369 -3704880 Wayne County Public Schools N.C. -0.8133 1488 2.785 7.317 0.906 37 37191 41399 32 35.364 -78.004 -0609070 Coachella Valley Unified Calif. -1.3982 1483 0.769 5.665 0.979 06 06065 33035 55 33.563 -115.911 -0613890 Folsom-Cordova Unified Calif. 0.3394 1473 3.18 8.174 0.999 06 06067 77333 61 38.617 -121.183 -2201680 Tangipahoa Parish La. -0.9256 1471 1.67 6.569 0.98 22 22105 47309 55 30.641 -90.413 -5512360 Racine School District Wis. -0.4322 1471 2.296 6.542 0.849 55 55101 51607 18 42.754 -87.87 -5302400 Edmonds School District Wash. 0.3868 1470 3.437 8.704 1.054 53 53061 71162 77 47.821 -122.304 -0407080 Roosevelt Elementary District Ariz. -1.1926 1464 0.883 6.45 1.114 04 04013 36120 89 33.388 -112.066 -0511850 Pulaski Co. Spec. School Dist. Ark. 0.0128 1464 2.821 6.593 0.754 05 05119 55335 6 34.773 -92.303 -0403420 Glendale Elementary District Ariz. -1.3505 1462 1.102 6.506 1.081 04 04013 37454 83 33.539 -112.196 -0602310 Alum Rock Union Elementary Calif. -0.2579 1462 1.795 6.598 0.96 06 06085 55595 49 37.356 -121.731 -2007950 Kansas City Kan. -1.4174 1461 1.728 5.593 0.773 20 20209 33363 7 39.123 -94.697 -0636840 Simi Valley Unified Calif. 0.9847 1459 3.269 7.715 0.889 06 06111 90854 27 34.287 -118.732 -3703780 Randolph County Schools N.C. -0.322 1458 3.373 7.37 0.799 37 37151 46140 10 35.71 -79.806 -4834440 Pearland Tex. 1.3179 1457 4.137 9.3 1.033 48 48039 97460 71 29.555 -95.306 -5305910 Northshore School District Wash. 1.3162 1455 4.436 10.103 1.133 53 53061 106280 92 47.769 -122.157 -4843470 Tyler Tex. -0.6644 1454 2.513 7.248 0.947 48 48423 43030 44 32.329 -95.372 -0641040 Victor Elementary Calif. -1.1712 1453 2.289 6.085 0.759 06 06071 45968 6 34.518 -117.316 -0635970 Saugus Union Elementary Calif. 1.2452 1450 3.577 8.08 0.901 06 06037 102833 30 34.505 -118.489 -4809670 Beaumont Tex. -1.0414 1450 2.932 6.906 0.795 48 48245 39221 10 30.05 -94.146 -1810290 South Bend Community Ind. -1.1043 1441 2.206 7.279 1.015 18 18141 39863 66 41.662 -86.313 -1710200 Cicero Ill. -0.8114 1418 1.078 6.226 1.03 17 17031 43246 70 41.844 -87.759 -2616440 Grand Rapids Public Schools Mich. -1.9935 1410 1.213 5.512 0.86 26 26081 31350 20 42.964 -85.657 -5302670 Everett School District Wash. 0.2899 1408 3.731 9.607 1.175 53 53061 71221 96 47.932 -122.195 -5505820 Green Bay Area School District Wis. -0.1109 1406 2.897 7.547 0.93 55 55009 52948 39 44.513 -87.942 -2908370 Ft. Zumwalt R-II Mo. 1.1009 1404 3.32 8.906 1.117 29 29183 86414 90 38.843 -90.705 -2913830 Hazelwood Mo. -0.3929 1402 2.501 7.223 0.944 29 29189 55367 43 38.81 -90.3 -0602850 Antioch Unified Calif. -0.0566 1397 1.643 6.34 0.939 06 06013 70261 42 37.978 -121.806 -1001300 Red Clay Consolidated School District Del. 0.1153 1394 2.886 8.041 1.031 10 10003 63229 71 39.766 -75.639 -2922800 North Kansas City Mo. 0.3418 1390 3.384 7.948 0.913 29 29047 61836 34 39.21 -94.528 -4814730 Comal Tex. 0.9989 1390 3.668 8.829 1.032 48 48091 84555 71 29.811 -98.296 -4202280 Allentown City Pa. -1.594 1385 2.254 5.88 0.725 42 42077 33563 4 40.596 -75.472 -4503870 York 03 S.C. -0.4786 1383 2.819 7.651 0.966 45 45091 55624 51 34.909 -81.026 -0620250 La Mesa-Spring Valley Calif. 0.1927 1379 2.348 7.57 1.044 06 06073 61985 74 32.75 -117 -4822530 Harlingen CISD Tex. -0.9795 1377 2.837 7.474 0.927 48 48061 35602 38 26.218 -97.719 -4844960 Weslaco Tex. -2.1552 1377 2.904 7.304 0.88 48 48215 27739 25 26.185 -97.979 -2201740 Terrebonne Parish La. -0.635 1375 2.599 7.16 0.912 22 22109 51044 34 29.456 -90.834 -0408310 Tempe School District Ariz. -0.7144 1373 2.214 7.284 1.014 04 04013 40934 66 33.407 -111.938 -0103390 Tuscaloosa County Ala. 0.3512 1367 2.51 6.9 0.878 01 01125 64537 25 33.29 -87.525 -0640980 Ventura Unified Calif. 0.4267 1365 2.462 7.792 1.066 06 06111 68241 80 34.35 -119.298 -1730420 Palatine CCSD Ill. 0.821 1362 3.984 9.312 1.066 17 17031 78458 79 42.105 -88.057 -5300480 Bethel School District Wash. 0.319 1362 2.912 8.033 1.024 53 53053 67334 69 47.028 -122.381 -4808090 Alvin Tex. 0.3885 1361 3.479 7.996 0.903 48 48039 68606 31 29.406 -95.31 -0904830 Waterbury School District Conn. -1.7689 1358 2.4 5.691 0.658 09 09009 34617 2 41.558 -73.036 -0626640 Napa Valley Unified Calif. 0.5708 1352 2.212 7.334 1.025 06 06055 69714 69 38.345 -122.272 -1740070 Valley View 365U Ill. 0.4764 1352 2.56 7.761 1.04 17 17197 71303 73 41.662 -88.088 -3703270 Nash-Rocky Mount Schools N.C. -0.77 1349 2.937 6.862 0.785 37 37127 44290 8 35.967 -77.985 -5101830 Hanover Co. Public Schools Va. 1.3269 1348 4.753 8.618 0.773 51 51085 96970 7 37.76 -77.491 -4025290 Putnam City Okla. -0.0495 1346 2.866 7.459 0.919 40 40109 49865 36 35.526 -97.626 -2733810 South Washington County School Dist. Minn. 1.3021 1344 4.193 9.712 1.104 27 27163 99099 87 44.853 -92.932 -4833180 Northwest Tex. 1.0904 1341 3.557 9.173 1.123 48 48121 82437 90 33.033 -97.35 -5303750 Issaquah School District Wash. 1.608 1340 4.939 10.265 1.065 53 53033 124215 79 47.519 -122.023 -3904676 Olentangy Local Ohio 1.9772 1338 4.519 10.468 1.19 39 39041 121533 97 40.207 -83.02 -3904611 Lakota Local - Liberty Township Ohio 1.3466 1335 4.589 9.948 1.072 39 39017 97900 81 39.367 -84.413 -2918300 Lee's Summit R-VII Mo. 1.0824 1330 4.053 8.735 0.936 29 29095 86643 41 38.906 -94.331 -4817700 Eagle Mt-Saginaw Tex. 0.5378 1327 3.071 8.269 1.04 48 48439 68464 73 32.892 -97.417 -1727710 Naperville Ill. 1.6834 1322 4.779 10.168 1.078 17 17043 122125 82 41.764 -88.124 -4220040 Reading Pa. -2.6258 1322 2.221 5.612 0.678 42 42011 26573 2 40.34 -75.927 -1200930 Indian River Fla. -0.3633 1321 3.574 7.624 0.81 12 12061 48923 11 27.692 -80.626 -3700690 Catawba County Schools N.C. 0.1079 1316 3.419 8.358 0.988 37 37035 55261 58 35.658 -81.205 -5400060 Berkeley County Schools W.Va. 0.1847 1316 2.68 7.356 0.935 54 54003 64735 40 39.464 -78.028 -1730270 Oswego Ill. 1.2107 1315 4.178 8.828 0.93 17 17093 92846 39 41.655 -88.315 -4817390 Donna Tex. -2.6002 1314 1.725 6.496 0.954 48 48215 23636 47 26.158 -98.067 -4900120 Cache District Utah 0.9666 1313 4.34 9.335 0.999 49 49005 66531 61 41.722 -111.744 -2602820 Ann Arbor Public Schools Mich. 1.1979 1311 4.643 9.823 1.036 26 26161 96126 72 42.287 -83.734 -0802580 Brighton School District No. 27J Colo. 0.8473 1310 3.663 7.597 0.787 08 08001 76967 8 39.937 -104.713 -1201290 Martin Fla. 0.2041 1310 4.006 8.321 0.863 12 12085 65115 21 27.07 -80.448 -5300390 Bellevue School District Wash. 1.4439 1305 4.496 10.477 1.196 53 53033 102895 97 47.607 -122.174 -3500010 Rio Rancho Public Schools N.M. 0.646 1295 3.26 8.184 0.985 35 35043 66910 57 35.299 -106.735 -0404380 Litchfield Elementary District Ariz. 0.6181 1294 2.885 8.831 1.189 04 04013 76177 97 33.506 -112.417 -1602340 Nampa School District Idaho -0.2633 1293 2.804 7.668 0.973 16 16027 50406 53 43.525 -116.592 -2923580 Parkway C-2 Mo. 1.5931 1286 4.161 9.604 1.089 29 29189 102468 84 38.645 -90.499 -4502820 Lexington 05 S.C. 0.8256 1284 3.845 8.935 1.018 45 45079 77195 67 34.128 -81.27 -5303540 Highline School District Wash. -0.4785 1283 2.175 7.996 1.164 53 53033 50569 95 47.456 -122.321 -2928950 Francis Howell R-III Mo. 1.164 1282 4.195 8.991 0.959 29 29183 86257 48 38.702 -90.751 -3416230 Toms River Regional N.J. 0.753 1282 4.194 8.867 0.935 34 34029 83256 40 39.988 -74.184 -0806120 Pueblo, School District No. 60, In The County Of Pueblo And Colo. -1.002 1276 3.667 6.909 0.648 08 08101 38893 2 38.252 -104.644 -0200510 Matanuska-Susitna Borough School District Alaska 0.3141 1275 3.125 8.223 1.02 02 02170 75222 68 62.316 -149.57 -4104740 Eugene 4J Ore. 0.1581 1268 3.454 8.696 1.048 41 41039 59575 75 44.055 -123.12 -0400680 Amphitheater Unified District Ariz. 0.0995 1266 3.128 8.334 1.041 04 04019 55260 74 32.411 -110.965 -4005490 Broken Arrow Okla. 0.8732 1265 3.458 7.601 0.828 40 40143 68423 14 36.042 -95.745 -1801200 Carmel Clay Schools Ind. 1.843 1256 5.397 10.735 1.068 18 18057 117908 80 39.965 -86.146 -2609570 Chippewa Valley Schools Mich. 0.6227 1256 2.962 8.155 1.039 26 26099 84837 73 42.627 -82.933 -4108830 North Clackamas Ore. 0.1085 1255 3.105 8.025 0.984 41 41005 61746 56 45.424 -122.558 -4503330 Pickens S.C. -0.0012 1253 3.285 7.691 0.881 45 45077 54733 25 34.888 -82.725 -3605280 Brentwood Union Free School District N.Y. 0.2959 1250 2.482 6.788 0.861 36 36103 69005 21 40.775 -73.26 -0627810 Oak Grove Elementary Calif. 0.544 1249 2.496 7.435 0.988 06 06085 83077 58 37.248 -121.794 -2901000 Columbia 93 Mo. 0.3969 1248 3.138 7.748 0.922 29 29019 59909 36 38.951 -92.344 -2400600 St. Mary's County Public Schools Md. 0.7058 1246 4.004 8.674 0.934 24 24037 84335 40 38.304 -76.606 -0618390 Inglewood Unified Calif. -0.6528 1240 2.102 5.884 0.756 06 06037 42759 6 33.962 -118.348 -2400150 Calvert County Public Schools Md. 1.1184 1235 4.581 8.952 0.874 24 24009 103822 24 38.549 -76.567 -1741250 Waukegan Ill. -0.6023 1234 1.805 6.345 0.908 17 17097 42761 32 42.379 -87.854 -2503090 Brockton Mass. -0.7998 1229 2.682 7.406 0.945 25 25023 50996 44 42.082 -71.024 -4800010 Hays CISD Tex. 0.6379 1229 2.669 7.882 1.043 48 48209 68052 74 30.039 -97.884 -4807440 Abilene Tex. -0.5015 1224 2.806 7.91 1.021 48 48441 42823 68 32.475 -99.754 -3700900 Cleveland County Schools N.C. -0.9885 1215 3.983 7.817 0.767 37 37045 43871 7 35.334 -81.556 -4203570 Bethlehem Area Pa. -0.109 1215 3.343 7.806 0.893 42 42095 55e3 28 40.645 -75.354 -4844280 Waco Tex. -1.713 1214 2.111 6.286 0.835 48 48309 28742 15 31.543 -97.156 -0633750 Rowland Unified Calif. 0.4303 1207 2.344 7.653 1.062 06 06037 61e3 79 33.991 -117.894 -1301830 Dougherty County Ga. -2.0366 1207 2.126 6.308 0.836 13 13095 29870 16 31.533 -84.216 -2731800 Rochester Public School District Minn. 0.9757 1207 4.148 8.817 0.934 27 27109 79790 40 44.056 -92.441 -1304410 Rockdale County Ga. -0.383 1206 3.244 7.494 0.85 13 13247 56950 18 33.654 -84.027 -4811790 Bryan Tex. -0.8031 1200 2.57 7.134 0.913 48 48041 39465 34 30.747 -96.328 -0629850 Paramount Unified Calif. -0.7305 1198 1.654 6.775 1.024 06 06037 43932 69 33.893 -118.161 -2635190 Warren Consolidated Schools Mich. 0.0904 1197 2.549 6.777 0.845 26 26099 63998 17 42.535 -83.044 -0623160 Lynwood Unified Calif. -0.6461 1195 1.338 5.747 0.882 06 06037 42956 25 33.924 -118.2 -0603690 Baldwin Park Unified Calif. -0.4136 1191 1.769 6.833 1.013 06 06037 50080 65 34.089 -117.969 -4831040 Mission CISD Tex. -1.6571 1191 2.543 7.303 0.952 48 48215 31586 46 26.246 -98.32 -4101980 Bend-Lapine Administrative Ore. 0.2292 1190 3.757 8.773 1.003 41 41017 64442 63 43.835 -121.416 -3402640 Camden City N.J. -3.0477 1186 0.827 5.431 0.921 34 34007 24528 36 39.936 -75.107 -4502130 Florence 01 S.C. -0.6939 1181 2.722 7.396 0.935 45 45041 44429 40 34.153 -79.72 -0640740 Vallejo City Unified Calif. -0.278 1180 1.704 5.754 0.81 06 06095 57800 11 38.124 -122.216 -5303930 Kennewick School District Wash. -0.0633 1180 3.203 7.605 0.88 53 53005 58303 25 46.077 -119.259 -0600047 Tracy Joint Unified Calif. 0.2327 1178 1.98 6.855 0.975 06 06077 73629 53 37.884 -121.458 -1906540 Cedar Rapids Comm School District Iowa 0.1118 1172 3.146 8.051 0.981 19 19113 59890 55 42.021 -91.725 -0409600 Yuma Elementary District Ariz. -0.9032 1171 1.967 6.981 1.003 04 04027 39612 62 32.476 -113.968 -0624600 Merced City Elementary Calif. -1.2381 1171 1.692 6.19 0.9 06 06047 35533 30 37.369 -120.445 -4815910 Crowley Tex. 0.4616 1170 2.41 7.179 0.954 48 48439 66842 47 32.601 -97.4 -1805670 M S D Lawrence Township Ind. 0.4871 1167 2.632 8.182 1.11 18 18097 69178 88 39.882 -86.005 -1200240 Charlotte Fla. -0.2678 1163 3.912 7.628 0.743 12 12015 50092 5 26.91 -81.843 -2400240 Cecil County Public Schools Md. 0.374 1162 3.128 7.679 0.91 24 24015 72576 33 39.581 -75.938 -0803870 Falcon, School District No. 49, In The County Of El Paso And Colo. 1.0248 1158 4.212 8.414 0.84 08 08041 77818 16 38.95 -104.605 -2621840 Livonia Public Schools Mich. 0.6819 1158 3.852 8.571 0.944 26 26163 83333 43 42.388 -83.376 -5306570 Pasco School District Wash. -0.7029 1158 1.689 7.565 1.175 53 53021 42066 96 46.34 -119.063 -3904504 Westerville City Ohio 1.0352 1157 4.167 8.802 0.927 39 39049 82562 38 40.116 -82.909 -0600153 Alhambra Unified Calif. 0.1149 1156 3.188 8.442 1.051 06 06037 50753 76 34.074 -118.137 -2635160 Walled Lake Consolidated Schools Mich. 1.0007 1156 4.375 8.824 0.89 26 26125 91316 27 42.557 -83.473 -0607970 Central Unified Calif. -0.0356 1154 2.234 6.763 0.906 06 06019 57201 31 36.765 -119.931 -1812090 Vigo County Ind. -0.3251 1154 3.514 8.158 0.929 18 18167 48853 38 39.431 -87.39 -3904701 Hilliard City Ohio 1.0837 1154 3.996 9.602 1.121 39 39049 85e3 90 40.022 -83.176 -1812810 M S D Wayne Township Ind. -0.7434 1153 2.723 7.432 0.942 18 18097 44208 43 39.762 -86.276 -0634920 San Mateo-Foster City Elementary Calif. 1.3385 1152 3.223 8.425 1.041 06 06081 105682 73 37.547 -122.305 -0406210 Pendergast Elementary District Ariz. -0.2665 1151 1.676 7.67 1.199 04 04013 51963 97 33.502 -112.276 -0635430 Santa Clara Unified Calif. 0.7344 1151 3.087 7.615 0.906 06 06085 80064 31 37.401 -121.973 -2201560 St. Landry Parish La. -1.5663 1149 2.066 6.619 0.911 22 22097 32905 33 30.599 -92.006 -0511970 Rogers School District Ark. 0.2412 1148 3.657 8.458 0.96 05 05007 54250 49 36.345 -94.012 -0805400 Thompson School District R-2J Colo. 0.591 1147 4.16 8.551 0.878 08 08069 74003 25 40.412 -105.184 -1720580 Joliet PSD Ill. -1.5213 1144 2.002 7.401 1.08 17 17197 34517 83 41.527 -88.078 -1908580 Davenport Comm School District Iowa -0.5344 1136 2.821 7.075 0.851 19 19163 46785 19 41.547 -90.697 -0503060 Bentonville School District Ark. 0.8136 1135 4.007 9.297 1.058 05 05007 75056 78 36.368 -94.254 -0904320 Stamford School District Conn. 0.4367 1135 3.244 7.844 0.92 09 09001 70400 36 41.106 -73.559 -3003870 Billings Elem. Mont. 0.2007 1135 3.187 8.476 1.058 30 30111 56573 78 45.813 -108.591 -4704550 Wilson County School District Tenn. 0.8386 1134 2.954 8.639 1.137 47 47189 73754 92 36.155 -86.298 -2629940 Rochester Community School District Mich. 1.3891 1130 5.217 10.372 1.031 26 26125 116774 71 42.709 -83.146 -2507020 Lowell Mass. -0.899 1127 2.849 7.743 0.979 25 25017 46656 55 42.639 -71.322 -3625350 Sachem Central School District N.Y. 1.0783 1125 3.935 9.197 1.052 36 36103 96819 76 40.816 -73.067 -0600020 Pleasanton Unified Calif. 1.69 1124 4.588 10.194 1.121 06 06001 135814 90 37.663 -121.887 -4838700 San Angelo Tex. -0.4782 1122 3.07 7.487 0.883 48 48451 46158 26 31.407 -100.537 -1200270 Citrus Fla. -0.4895 1119 3.98 8.087 0.821 12 12017 48898 13 28.851 -82.458 -0606450 Burbank Unified Calif. 0.7048 1116 3.102 7.973 0.974 06 06037 72265 53 34.188 -118.323 -0614370 Franklin-Mckinley Elementary Calif. -0.39 1116 1.886 7.19 1.061 06 06085 51036 78 37.302 -121.845 -4901050 Tooele District Utah 0.683 1113 2.864 7.87 1.001 49 49045 66428 62 40.449 -113.131 -3502370 Santa Fe Public Schools N.M. -0.0982 1112 1.997 6.559 0.912 35 35049 44889 34 35.554 -105.97 -3404500 Edison Township N.J. 1.3019 1107 5.216 10.871 1.131 34 34023 99236 92 40.536 -74.369 -1300840 Carroll County Ga. -0.1903 1103 3.006 7.144 0.828 13 13045 55088 14 33.582 -85.079 -4817730 Eagle Pass Tex. -1.429 1102 2.712 7.977 1.053 48 48323 32560 76 28.744 -100.314 -3703310 Craven County Schools N.C. -0.6902 1098 3.65 7.922 0.854 37 37049 44973 19 35.234 -77.173 -1300330 Bartow County Ga. 0.0959 1097 3.328 7.261 0.787 13 13015 57351 8 34.243 -84.843 -4030600 Union Okla. 0.4559 1097 2.922 7.702 0.956 40 40143 60243 47 36.065 -95.856 -5103000 Portsmouth City Va. -0.8615 1096 3.132 7.291 0.832 51 51740 41619 15 36.815 -76.343 -5305430 Mukilteo School District Wash. -0.0422 1095 3.446 9.086 1.128 53 53061 58544 91 47.904 -122.276 -2103090 Kenton County Ky. 0.791 1094 3.588 8.51 0.984 21 21117 70478 56 38.923 -84.532 -4817640 Duncanville Tex. -0.26 1094 2.578 7.431 0.971 48 48113 46979 52 32.656 -96.927 -4837650 Rockwall Tex. 1.0259 1094 3.898 9.274 1.075 48 48397 84919 81 32.888 -96.439 -4900810 Provo District Utah 0.5302 1094 3.841 8.688 0.97 49 49049 57822 52 40.246 -111.645 -4017250 Lawton Okla. -0.7949 1092 2.995 7.626 0.926 40 40031 39695 38 34.648 -98.377 -4703780 Sevier County School District Tenn. -0.1796 1090 2.604 7.205 0.92 47 47155 48766 36 35.785 -83.524 -0600017 Apple Valley Unified Calif. -0.4023 1087 2.311 6.986 0.935 06 06071 51500 40 34.474 -117.142 -5500390 Appleton Area School District Wis. 0.6033 1087 3.364 8.639 1.055 55 55087 69439 77 44.278 -88.413 -0805310 Littleton, School District No. 6, In The County Of Arapahoe Colo. 1.0552 1086 4.822 9.721 0.98 08 08005 83968 55 39.595 -104.989 -0633600 Roseville City Elementary Calif. 0.6259 1083 3.678 8.345 0.934 06 06061 88052 40 38.784 -121.336 -1737080 Springfield 186 Ill. -1.2057 1083 2.18 7.201 1.004 17 17167 36881 63 39.798 -89.655 -1704680 Aurora East USD Ill. -0.9957 1082 0.901 6.383 1.097 17 17089 42033 86 41.759 -88.291 -0601950 Alisal Union Calif. -1.1769 1079 0.796 6.183 1.077 06 06053 35670 82 36.676 -121.522 -1808820 M S D Perry Township Ind. -0.145 1075 3.791 8.3 0.902 18 18097 53819 30 39.674 -86.158 -4822470 Harlandale Tex. -1.4629 1075 2.278 7.024 0.949 48 48029 35844 45 29.352 -98.501 -3904702 Dublin City Ohio 1.4891 1073 4.703 10.483 1.156 39 39049 109178 94 40.127 -83.142 -5307230 Renton School District Wash. 0.0571 1071 2.899 8.313 1.083 53 53033 59738 83 47.481 -122.2 -2905310 Blue Springs R-IV Mo. 0.9086 1069 4.503 9.044 0.908 29 29095 81952 32 39.022 -94.304 -4021720 Norman Okla. 0.5427 1068 3.566 8.461 0.979 40 40027 65580 55 35.226 -97.405 -5310110 Yakima School District Wash. -1.4406 1066 1.524 6.808 1.057 53 53077 37624 77 46.589 -120.527 -5305850 North Thurston Public Schools Wash. 0.272 1065 3.473 8.36 0.977 53 53067 68376 54 47.044 -122.777 -0506330 Fort Smith School District Ark. -0.941 1063 2.507 7.643 1.027 05 05131 33704 70 35.35 -94.365 -2200720 Iberia Parish La. -1.0186 1063 2.559 7.056 0.899 22 22045 45532 30 29.969 -91.698 -2801770 Harrison Co. School District Miss. -0.5136 1063 3.18 7.984 0.961 28 28047 51239 49 30.546 -89.107 -2506660 Lawrence Mass. -1.6665 1062 2.799 7.069 0.854 25 25009 31178 19 42.7 -71.163 -3703990 Rockingham County Schools N.C. -0.8742 1062 2.984 7.424 0.888 37 37157 42585 27 36.396 -79.775 -5103710 Suffolk City Va. 0.1401 1062 3.248 7.732 0.897 51 51800 70409 29 36.692 -76.642 -3304590 Manchester School District N.H. -0.2744 1061 2.869 7.175 0.861 33 33011 52905 20 42.984 -71.445 -0200600 Fairbanks North Star Borough School District Alaska 0.7147 1060 3.066 7.996 0.986 02 02090 80372 57 64.809 -146.563 -0624540 Menifee Union Elementary Calif. 0.3728 1059 2.835 7.603 0.954 06 06065 71104 47 33.665 -117.175 -1737170 St Charles Ill. 1.6311 1057 4.53 10.013 1.097 17 17089 117775 86 41.939 -88.349 -0612090 El Monte City Elementary Calif. -0.3241 1056 1.441 7.407 1.193 06 06037 43341 97 34.083 -118.029 -4844150 Victoria Tex. -0.6495 1055 2.631 6.922 0.858 48 48469 46906 20 28.812 -96.998 -1803870 Gary Community Ind. -2.9861 1054 2.49 5.637 0.629 18 18089 26473 1 41.598 -87.339 -4900720 Ogden District Utah -0.7124 1054 1.846 6.811 0.993 49 49057 41904 59 41.228 -111.968 -1804320 School City of Hammond Ind. -1.158 1050 2.314 6.813 0.9 18 18089 38984 30 41.62 -87.492 -2915480 Independence Mo. -0.5375 1050 2.958 7.287 0.866 29 29095 48539 22 39.083 -94.403 -5103330 Roanoke Co. Public Schools Va. 1.0007 1050 4.093 8.988 0.979 51 51161 78242 55 37.271 -80.052 -0642150 Westminster Elementary Calif. -0.1213 1048 2.54 7.972 1.086 06 06059 58378 84 33.756 -118.008 -3501080 Gadsden Independent Schools N.M. -1.7373 1048 2.093 7.216 1.024 35 35013 26241 69 31.991 -106.883 -4019950 Midwest City-Del City Okla. -0.5742 1048 3.124 7.317 0.839 40 40109 44745 16 35.408 -97.359 -4845780 Wichita Falls Tex. -0.262 1048 2.749 7.9 1.03 48 48485 45916 70 33.888 -98.517 -3702100 Henderson County Schools N.C. 0.1071 1047 3.895 8.734 0.968 37 37089 55390 51 35.336 -82.48 -2200900 Lafourche Parish La. -0.2433 1046 2.169 7.402 1.047 22 22057 55824 75 29.577 -90.435 -2400690 Wicomico County Public Schools Md. -0.3252 1045 3.285 7.527 0.848 24 24045 52069 18 38.376 -75.616 -2621150 Lansing Public School District Mich. -1.4033 1042 2.121 4.985 0.573 26 26065 37054 1 42.739 -84.551 -3705020 Wilson County Schools N.C. -1 1040 3.188 7.475 0.857 37 37195 38380 20 35.705 -77.919 -5300300 Auburn School District Wash. -0.2548 1040 3.781 7.885 0.821 53 53033 59971 13 47.293 -122.163 -2600015 Wayne-Westland Community School District Mich. -0.8221 1038 2.037 6.311 0.855 26 26163 50150 19 42.295 -83.401 -2507110 Lynn Mass. -1.0772 1036 3.196 7.35 0.831 25 25009 40093 15 42.475 -70.961 -2711370 Elk River Public School District Minn. 1.1045 1036 3.614 9.34 1.145 27 27141 87664 93 45.326 -93.572 -0641280 Walnut Valley Unified Calif. 1.4528 1035 4.56 9.915 1.071 06 06037 96496 81 33.995 -117.834 -0604440 Bellflower Unified Calif. 0.1713 1033 2.278 6.963 0.937 06 06037 62210 41 33.879 -118.124 -4225290 West Chester Area Pa. 1.6372 1033 4.954 9.713 0.952 42 42029 116468 46 39.968 -75.588 -0406300 Phoenix Elementary District Ariz. -2.2182 1032 1.039 7.235 1.239 04 04013 22297 99 33.452 -112.079 -2102490 Hardin County Ky. -0.0989 1032 2.984 7.94 0.991 21 21093 51522 59 37.662 -85.976 -2632310 Southfield Public School District Mich. -0.3114 1031 1.979 6.242 0.853 26 26125 61636 19 42.477 -83.261 -1305390 Walton County Ga. 0.1563 1028 3.392 8.012 0.924 13 13297 61043 37 33.788 -83.735 -0404630 Marana Unified District Ariz. 0.5722 1026 3.149 8.143 0.999 04 04019 65582 61 32.373 -111.29 -2105730 Warren County Ky. 0.1232 1026 3.115 8.388 1.055 21 21227 55704 77 36.994 -86.424 -5601980 Laramie County School District #1 Wyo. 0.38 1026 3.522 8.219 0.939 56 56021 61481 42 41.324 -104.942 -0100007 Hoover City Ala. 1.2898 1024 3.337 9.105 1.153 01 01073 91103 94 33.363 -86.845 -0622110 Livermore Valley Joint Unified Calif. 1.0772 1024 3.422 8.158 0.947 06 06001 101434 44 37.652 -121.685 -0627180 Newhall Elementary Calif. 0.838 1024 3.992 9.515 1.105 06 06037 88135 87 34.37 -118.581 -1305700 Whitfield County Ga. -0.2073 1024 2.591 7.054 0.893 13 13313 48005 28 34.806 -84.967 -3416290 Trenton N.J. -1.9208 1023 1.22 5.652 0.886 34 34021 33343 26 40.224 -74.764 -2931650 Wentzville R-IV Mo. 1.0645 1022 3.839 9 1.032 29 29183 82904 71 38.801 -90.866 -4821660 Grapevine-Colleyville Tex. 1.2459 1022 4.311 9.317 1.001 48 48439 106760 62 32.917 -97.086 -0628140 Ocean View Calif. 0.6227 1020 3.19 8.502 1.062 06 06059 79366 79 33.719 -118.017 -0643470 Yuba City Unified Calif. -0.2887 1019 2.508 7.263 0.951 06 06101 53159 46 39.037 -121.656 -3700420 Brunswick County Schools N.C. -0.3433 1018 3.598 7.754 0.831 37 37019 48322 15 34.078 -78.251 -3700480 Burke County Schools N.C. -0.4349 1017 3.748 8.454 0.941 37 37023 47417 42 35.75 -81.705 -4659820 Rapid City Area School District 51-4 S.D. 0.1187 1015 2.731 7.72 0.998 46 46103 55999 61 44.005 -103.209 -3702680 Lincoln County Schools N.C. -0.2914 1012 3.884 8.828 0.989 37 37109 51176 58 35.486 -81.224 -2508430 New Bedford Mass. -1.7409 1011 3.281 7.021 0.748 25 25005 34306 5 41.671 -70.944 -2619950 Kalamazoo Public School District Mich. -1.6975 1011 1.795 6.488 0.939 26 26077 33817 41 42.278 -85.637 -0639870 Tulare City Elementary Calif. -0.538 1010 1.946 6.559 0.923 06 06107 45532 37 36.172 -119.304 -3703090 Moore County Schools N.C. 0.0915 1010 3.539 8.419 0.976 37 37125 57384 54 35.311 -79.481 -3418120 Woodbridge Township N.J. 0.9534 1009 4.936 8.926 0.798 34 34023 85881 10 40.561 -74.294 -4846530 Wylie Tex. 0.9471 1004 3.518 9.183 1.133 48 48085 79496 92 33.019 -96.536 -0611850 East Whittier City Elementary Calif. 0.6106 1003 2.922 7.639 0.943 06 06037 72907 43 33.953 -118.009 -5300380 Battle Ground School District Wash. 0.6774 998 2.936 8.741 1.161 53 53011 73477 95 45.85 -122.419 -1731230 Peoria Ill. -1.3328 997 2.193 6.302 0.822 17 17143 36643 13 40.725 -89.615 -1728620 Mclean County USD Ill. 0.8857 996 4.13 8.554 0.885 17 17113 83767 26 40.539 -88.976 -0600158 Turlock Unified Calif. -0.0545 986 1.727 7.083 1.071 06 06099 49969 81 37.489 -120.828 -0642120 Westside Union Elementary Calif. 0.6828 986 2.461 7.822 1.072 06 06037 80335 81 34.72 -118.368 -2012260 Topeka Public Schools Kan. -1.2853 986 2.325 6.691 0.873 20 20177 32766 23 39.038 -95.688 -0638670 Sylvan Union Elementary Calif. -0.1808 985 2.754 7.307 0.911 06 06099 58439 33 37.697 -120.958 -1742180 Cusd 200 Ill. 1.0476 985 4.669 9.552 0.977 17 17043 101795 54 41.849 -88.136 -1926400 Sioux City Comm School District Iowa -0.2985 984 2.563 7.532 0.994 19 19193 47794 59 42.506 -96.388 -4839480 Schertz-Cibolo-U City Tex. 1.0064 984 3.317 8.826 1.102 48 48187 81543 87 29.551 -98.232 -5101470 Frederick Co. Public Schools Va. 0.8028 984 3.468 7.47 0.8 51 51840 72007 10 39.204 -78.261 -0637380 South Bay Union Elementary Calif. -0.7191 982 1.37 7.798 1.286 06 06073 40851 100 32.569 -117.1 -0608370 Chico Unified Calif. -0.1564 981 1.925 7.674 1.15 06 06007 55078 94 39.809 -121.814 -1300290 Barrow County Ga. -0.141 981 2.827 7.585 0.952 13 13013 55067 46 33.993 -83.713 -2100750 Bullitt Co. Ky. 0.0288 980 3.16 7.966 0.961 21 21029 61922 49 37.978 -85.668 -1602640 Pocatello District Idaho 0.1779 977 3.35 8.614 1.053 16 16005 56910 76 42.913 -112.393 -5301110 Central Valley School District Wash. 0.4177 977 3.57 9.145 1.115 53 53063 65443 89 47.629 -117.159 -5401620 Wood County Schools W.Va. -0.3268 975 2.705 7.434 0.946 54 54107 50263 44 39.211 -81.515 -1200540 Flagler Fla. 9e-4 969 3.661 8.048 0.878 12 12035 52229 24 29.459 -81.317 -4217280 North Penn Pa. 1.3528 969 4.609 9.757 1.03 42 42091 96940 70 40.245 -75.285 -0608130 Ceres Unified Calif. -0.7294 964 2.206 6.67 0.893 06 06099 48124 28 37.565 -121.031 -3700580 Caldwell County Schools N.C. -0.5619 963 3.508 8.14 0.926 37 37027 47749 38 35.953 -81.547 -0632130 Redwood City Elementary Calif. 0.3846 962 2.034 7.086 1.01 06 06081 57468 65 37.487 -122.232 -5103300 Roanoke City Va. -1.4196 962 3.067 7.714 0.929 51 51770 33183 39 37.278 -79.958 -3406540 Hamilton Township N.J. 0.8685 959 3.293 8.099 0.961 34 34021 82310 49 40.205 -74.676 -4840950 Southwest Tex. -1.2691 958 2.315 6.765 0.89 48 48029 32184 27 29.303 -98.673 -1803270 Elkhart Community Schools Ind. -1.1426 955 2.106 7.931 1.165 18 18039 43588 95 41.72 -85.929 -1704710 Aurora West USD Ill. -0.1376 954 2.506 6.881 0.875 17 17089 55304 24 41.78 -88.356 -2731780 Robbinsdale Public School District Minn. 0.4837 954 3.057 7.188 0.826 27 27053 67461 14 45.029 -93.378 -4112240 Tigard-Tualatin 23J Ore. 0.6002 954 3.808 8.625 0.963 41 41067 74543 50 45.405 -122.786 -0605910 Brentwood Union Elementary Calif. 1.0511 953 2.736 8.306 1.114 06 06013 99518 89 37.907 -121.749 -1302400 Glynn County Ga. -0.1845 953 3.127 8.037 0.982 13 13127 58677 56 31.247 -81.564 -4209300 Erie City Pa. -1.7431 952 2.419 6.268 0.77 42 42049 31146 7 42.118 -80.078 -4702580 Jackson-Madison Consolidated Tenn. -1.1583 951 2.397 6.122 0.745 47 47113 39292 5 35.608 -88.838 -3412540 Passaic City N.J. -1.5236 950 1.881 6.699 0.964 34 34031 27500 50 40.857 -74.128 -4816530 Deer Park Tex. 0.5026 950 3.385 8.381 0.999 48 48201 70512 61 29.709 -95.12 -4207710 Downingtown Area Pa. 1.8522 947 4.837 10.058 1.044 42 42029 121804 74 40.041 -75.708 -4500900 Anderson 05 S.C. -0.8069 947 3.101 7.88 0.956 45 45007 47217 47 34.51 -82.691 -5100090 Albemarle Co. Public Schools Va. 1.1944 947 4.12 8.524 0.881 51 51540 81051 25 38.023 -78.556 -5604510 Natrona County School District #1 Wyo. 0.5643 945 3.56 8.137 0.915 56 56025 68177 35 42.962 -106.798 -0633930 Salinas City Elementary Calif. -0.611 944 1.104 6.356 1.05 06 06053 42063 76 36.679 -121.648 -1711350 Crystal Lake CCSD Ill. 1.2521 944 3.817 9.288 1.094 17 17111 91812 86 42.243 -88.336 -1300001 Troup County Ga. -0.879 943 2.993 7.382 0.878 13 13285 43333 25 33.034 -85.028 -2104530 Oldham County Ky. 1.1356 942 3.99 9.319 1.066 21 21185 95434 80 38.399 -85.448 -0616050 Greenfield Union Calif. -0.9153 940 1.752 6.336 0.917 06 06029 40617 35 35.271 -118.997 -1000230 Colonial School District Del. -0.1739 940 2.731 7.249 0.904 10 10003 57752 31 39.622 -75.608 -0610050 Covina-Valley Unified Calif. 0.3447 938 2.197 7.188 0.998 06 06037 70484 61 34.08 -117.887 -4108040 Medford 549C Ore. -0.3438 937 2.823 7.732 0.982 41 41029 49166 56 42.179 -122.997 -2802790 Madison Co. School District Miss. 1.0071 935 3.532 8.53 1 28 28089 80632 61 32.636 -90.024 -2614520 Flint City School District Mich. -3.3695 934 1.038 5.52 0.897 26 26049 22299 29 43.029 -83.688 -0626910 New Haven Unified Calif. 0.7617 933 2.529 7.024 0.899 06 06001 82735 30 37.6 -122.039 -5104150 York Co. Public Schools Va. 1.3695 932 4.514 8.912 0.88 51 51199 92038 25 37.24 -76.567 -4703150 Murfreesboro City Elem. School District Tenn. -0.2422 931 2.981 8.115 1.027 47 47149 52886 70 35.851 -86.409 -0601710 Adelanto Elementary Calif. -0.7098 930 1.602 5.559 0.791 06 06071 55206 9 34.649 -117.528 -4811190 Brazosport Tex. 0.2454 929 3.04 7.23 0.838 48 48039 64717 16 28.989 -95.393 -0640590 Vacaville Unified Calif. 0.4785 927 2.434 7.291 0.971 06 06095 74499 52 38.386 -121.989 -0616680 Hawthorne Calif. -0.6666 926 1.859 6.578 0.944 06 06037 40029 43 33.916 -118.346 -1001240 Brandywine School District Del. 0.4221 926 3.364 7.722 0.872 10 10003 72954 23 39.794 -75.505 -0600036 Natomas Unified Calif. 0.4307 925 2.127 7.308 1.036 06 06067 65250 72 38.664 -121.558 -3629880 Wappingers Central School District N.Y. 1.1784 923 3.698 8.202 0.901 36 36027 91012 30 41.57 -73.845 -1914700 Iowa City Comm School District Iowa 0.8383 922 3.507 8.964 1.091 19 19103 78078 85 41.648 -91.56 -0600013 Rocklin Unified Calif. 1.2498 921 3.751 9.264 1.103 06 06061 99869 87 38.807 -121.252 -5400180 Cabell County Schools W.Va. -0.7191 921 2.767 6.951 0.837 54 54011 44256 16 38.42 -82.242 -2614610 Forest Hills Public Schools Mich. 1.6043 919 4.436 9.81 1.075 26 26081 109868 81 42.958 -85.519 -0402860 Flagstaff Unified District Ariz. 0.5047 917 2.359 7.653 1.059 04 04005 59963 78 35.154 -111.351 -1811340 Tippecanoe Ind. 0.7575 916 3.735 8.766 1.006 18 18157 67887 63 40.378 -86.876 -4224320 Upper Darby Pa. -0.2186 913 3.037 7.107 0.814 42 42045 52793 12 39.948 -75.289 -4838790 San Benito CISD Tex. -1.7883 913 2.303 7.248 0.989 48 48061 29955 58 26.091 -97.674 -1200840 Highlands Fla. -0.5964 912 3.232 7.344 0.822 12 12055 38879 13 27.343 -81.341 -2634260 Troy School District Mich. 1.5547 912 5.035 10.563 1.105 26 26125 113772 88 42.583 -83.145 -4206960 Council Rock Pa. 1.7663 911 4.471 9.798 1.065 42 42017 131180 79 40.25 -74.966 -2508610 Newton Mass. 1.9178 909 5.753 11.309 1.111 25 25017 147012 89 42.332 -71.208 -3904463 Parma City Ohio 0.2812 909 3.327 8.021 0.939 39 39035 61139 42 41.384 -81.724 -0604800 Berryessa Union Elementary Calif. 0.5649 908 3.023 7.929 0.981 06 06085 82703 55 37.399 -121.848 -1301170 Clarke County Ga. -0.9005 908 2.34 6.825 0.897 13 13059 35937 29 33.951 -83.367 -0600016 Upland Unified Calif. 0.28 905 3.014 7.791 0.955 06 06071 68693 47 34.147 -117.657 -4828740 Magnolia Tex. 0.5163 905 3.338 8.109 0.954 48 48339 74031 47 30.204 -95.701 -4106000 Gresham-Barlow 10J Ore. 0.0193 903 2.531 7.607 1.015 41 41051 66757 66 45.466 -122.39 -4704080 Tipton County School District Tenn. -0.711 903 2.608 8.181 1.115 47 47167 52087 89 35.501 -89.739 -3700720 Chapel Hill-Carrboro Schools N.C. 1.2512 898 5.556 10.376 0.964 37 37135 100886 50 35.922 -79.074 -5100120 Alexandria City Va. 0.5427 898 3.297 7.109 0.762 51 51510 61439 6 38.818 -77.086 -0403780 Higley Unified School District Ariz. 1.0209 897 3.485 9.307 1.164 04 04013 82981 95 33.292 -111.704 -0629610 Palo Alto Unified Calif. 2.2319 897 5.194 11.256 1.212 06 06085 191548 98 37.41 -122.152 -1812360 M S D Warren Township Ind. -0.7262 897 3.308 7.528 0.844 18 18097 42936 17 39.771 -86.01 -0623430 Magnolia Elementary Calif. -0.3345 890 2.049 7.664 1.123 06 06059 47899 90 33.823 -117.975 -4502580 Lancaster S.C. -1.044 890 2.606 7.549 0.989 45 45057 39742 58 34.687 -80.705 -4702760 Maury County School District Tenn. -0.2369 889 2.348 7.034 0.937 47 47119 54015 41 35.617 -87.077 -5401230 Raleigh County Schools W.Va. -0.2501 889 2.865 7.362 0.899 54 54081 50592 30 37.771 -81.249 -5515780 Waukesha School District Wis. 0.6953 889 3.317 8.349 1.006 55 55133 73456 63 42.995 -88.254 -1807410 New Albany-Floyd Co Con Sch Ind. 0.0123 888 3.413 8.823 1.082 18 18043 60765 83 38.319 -85.907 -3304980 Nashua School District N.H. 0.6946 888 4.014 8.267 0.851 33 33011 82214 18 42.749 -71.491 -4815210 Coppell Tex. 1.768 886 4.628 10.338 1.142 48 48113 118492 93 32.949 -96.993 -5301410 Clover Park School District Wash. -0.6301 884 2.396 7.999 1.121 53 53053 39478 90 47.103 -122.584 -2912300 Fox C-6 Mo. 0.3912 883 4.159 8.92 0.952 29 29099 71708 46 38.404 -90.443 -4218840 Pennsbury Pa. 1.2533 882 4.376 9.201 0.965 42 42017 100061 50 40.193 -74.818 -2912010 Ferguson-Florissant R-II Mo. -1.4204 878 2.265 6.541 0.855 29 29189 37647 19 38.763 -90.319 -5103390 Rockingham Co. Public Schools Va. 0.5511 876 3.682 8.378 0.939 51 51660 58442 42 38.511 -78.876 -3612630 Greece Central School District N.Y. 0.2856 875 3.502 8.247 0.949 36 36055 63139 45 43.236 -77.68 -0401710 Casa Grande Elementary District Ariz. -0.5804 874 2.166 7.579 1.083 04 04021 43967 83 32.837 -111.791 -2504830 Fall River Mass. -1.5217 874 2.883 7.672 0.958 25 25005 36147 48 41.714 -71.101 -0617850 Hueneme Elementary Calif. -0.3083 873 0.987 6.341 1.071 06 06111 49084 80 34.137 -119.223 -4703600 Robertson County School Dist. Tenn. -0.0282 873 2.439 7.939 1.1 47 47147 55655 87 36.525 -86.871 -4700300 Blount County School District Tenn. -0.0202 872 2.447 8.01 1.113 47 47009 55274 89 35.679 -83.921 -0630990 Pleasant Valley Calif. 1.1506 871 3.268 8.369 1.02 06 06111 98372 68 34.214 -119.007 -0804530 Harrison, School District No. 2, In The County Of El Paso An Colo. -1.114 871 3.641 7.958 0.863 08 08041 35883 21 38.792 -104.773 -4842960 Tomball Tex. 1.1432 871 3.588 9.714 1.225 48 48201 85172 99 30.09 -95.644 -2621870 L'Anse Creuse Public Schools Mich. -0.0923 870 3.417 8.389 0.994 26 26099 74234 60 42.626 -82.848 -3403000 Cherry Hill Township N.J. 1.5027 868 5.001 9.673 0.934 34 34007 110245 40 39.903 -74.995 -4818150 Edgewood - San Antonio Tex. -1.8857 867 1.9 6.32 0.884 48 48029 30706 26 29.411 -98.573 -0634710 San Lorenzo Unified Calif. -0.0632 865 1.531 6.494 0.993 06 06001 59574 59 37.677 -122.133 -2927060 St. Joseph Mo. -0.4899 864 3.17 7.556 0.877 29 29021 47822 24 39.751 -94.798 -3905045 Mason City Ohio 1.6957 864 5.398 10.97 1.114 39 39165 114883 89 39.351 -84.314 -0408850 Vail Unified District Ariz. 1.2448 862 4.254 9.525 1.054 04 04019 81369 77 32.016 -110.687 -0610890 Delano Union Elementary Calif. -1.1652 862 1.335 6.213 0.976 06 06029 34687 54 35.704 -119.067 -1301980 Effingham County Ga. 0.3426 861 3.477 8.369 0.978 13 13103 62960 55 32.367 -81.341 -4205400 Central Dauphin Pa. 0.7169 861 3.811 8.037 0.845 42 42043 70401 17 40.353 -76.826 -5304860 Marysville School District Wash. 0.3833 859 2.705 7.639 0.987 53 53061 72240 57 48.08 -122.192 -0607500 Carlsbad Unified Calif. 1.0324 857 4.33 8.951 0.924 06 06073 99912 37 33.137 -117.301 -1808910 M S D Pike Township Ind. -0.2529 857 2.887 7.397 0.902 18 18097 49046 30 39.876 -86.268 -3403300 Clifton N.J. 0.5831 857 2.966 7.697 0.946 34 34031 67771 44 40.863 -74.158 -1600930 Bonneville Joint District Idaho 0.6225 856 3.499 8.564 1.013 16 16019 63155 65 43.443 -111.783 -4110520 Reynolds Ore. -1.0023 856 1.529 6.523 0.999 41 41051 44211 61 45.552 -122.453 -2103720 Madison County Ky. -0.1757 854 3.504 8.092 0.918 21 21151 51742 35 37.72 -84.278 -0629700 Palos Verdes Peninsula Unified Calif. 2.123 853 5.156 9.87 0.943 06 06037 159153 43 33.763 -118.368 -4900090 Box Elder District Utah 0.6979 852 3.013 8.59 1.115 49 49003 64909 89 41.521 -113.082 -0615180 Gilroy Unified Calif. 0.264 851 2.269 7.64 1.074 06 06085 69402 81 37.036 -121.509 -2918540 Liberty 53 Mo. 1.2419 851 4.522 8.879 0.871 29 29047 86712 23 39.254 -94.398 -4814430 Clint Tex. -1.145 851 2.328 7.269 0.988 48 48141 32011 58 31.775 -106.103 -0626190 Mountain View Elementary Calif. -1.0604 850 1.463 6.216 0.951 06 06037 35404 45 34.056 -118.022 -3627060 Smithtown Central School District N.Y. 1.6588 850 4.603 9.671 1.014 36 36103 124694 66 40.873 -73.181 -4503900 York 04 S.C. 1.0447 846 4.294 9.419 1.025 45 45091 90898 69 35.023 -80.949 -5301080 Central Kitsap School District Wash. 0.6374 844 3.32 8.699 1.076 53 53035 71424 82 47.608 -122.79 -4817850 East Central Tex. -0.2999 843 2.44 6.965 0.905 48 48029 49772 31 29.363 -98.3 -4832400 New Caney Tex. -0.0905 841 3.154 7.609 0.891 48 48339 59337 28 30.133 -95.228 -0101290 Elmore County Ala. 0.0612 840 2.736 7.062 0.865 01 01051 56958 21 32.606 -86.184 -2717780 Lakeville Public School District Minn. 1.4904 840 4.585 9.917 1.066 27 27037 107918 80 44.634 -93.293 -3620700 Newburgh City School District N.Y. -0.1496 840 2.282 6.354 0.814 36 36071 57259 12 41.514 -74.049 -1600780 Coeur D Alene District Idaho -0.0568 838 3.6 9.092 1.098 16 16055 55919 86 47.678 -116.697 -1201350 Nassau Fla. 0.1488 835 4.246 8.234 0.798 12 12089 63446 10 30.609 -81.832 -1812720 M S D Washington Township Ind. 0.0555 834 3.478 8.071 0.919 18 18097 49911 36 39.884 -86.143 -5307320 Richland School District Wash. 0.7981 834 3.761 8.633 0.974 53 53005 87361 53 46.49 -119.485 -0635250 Sanger Unified Calif. -0.375 833 2.81 7.524 0.943 06 06019 54647 43 36.758 -119.516 -4820600 Georgetown Tex. 0.8033 832 3.691 8.552 0.972 48 48491 72700 53 30.671 -97.674 -1000080 Appoquinimink School District Del. 1.2493 831 3.848 9.116 1.054 10 10003 100712 77 39.454 -75.693 -5101320 Fauquier Co. Public Schools Va. 1.1336 831 3.751 8.06 0.862 51 51061 95088 21 38.74 -77.811 -0625530 Monterey Peninsula Unified Calif. 0.1152 830 1.685 6.666 0.996 06 06053 56588 60 36.612 -121.812 -0635700 Santa Monica-Malibu Unified Calif. 1.0606 830 4.124 8.761 0.927 06 06037 98979 38 34.057 -118.776 -3501110 Gallup-Mckinley Cty Schools N.M. -1.2428 830 0.996 5.943 0.989 35 35031 34307 58 35.63 -108.211 -4703990 Sullivan County School Distrct Tenn. -0.0342 830 2.811 7.736 0.985 47 47163 60066 57 36.512 -82.24 -3406030 Gloucester Township N.J. 0.5673 829 3.495 8.468 0.994 34 34007 78545 60 39.792 -75.036 -4816620 Del Valle Tex. -0.7776 829 1.861 6.988 1.025 48 48453 42222 69 30.175 -97.634 -2635310 Waterford School District Mich. -0.0966 827 2.665 7.04 0.875 26 26125 64161 24 42.659 -83.394 -3800014 Bismarck N.D. 0.8525 826 3.546 8.556 1.002 38 38015 74244 62 46.856 -100.759 -1300930 Catoosa County Ga. 0.1544 825 3 8.012 1.002 13 13047 56348 62 34.904 -85.138 -1201620 Putnam Fla. -1.2104 824 3.302 6.648 0.669 12 12107 36904 2 29.609 -81.744 -2614070 Farmington Public School District Mich. 1.2075 822 3.896 8.46 0.913 26 26125 91952 34 42.486 -83.376 -2742160 Wayzata Public School District Minn. 1.7277 821 5.591 10.591 1 27 27053 127708 61 45.013 -93.498 -2101470 Daviess County Ky. 0.0968 819 4.134 8.563 0.886 21 21059 54818 26 37.731 -87.087 -0621000 Las Virgenes Unified Calif. 1.7475 818 4.302 9.12 0.964 06 06037 150672 50 34.124 -118.729 -2705790 Bloomington Public School District Minn. 0.6081 818 4.121 8.838 0.943 27 27053 72055 43 44.83 -93.314 -1800630 Monroe County Com Ind. 0.2197 816 3.706 9.363 1.131 18 18105 53737 92 39.141 -86.501 -2633870 Traverse City Area Public Schools Mich. 0.1641 815 2.923 8.217 1.059 26 26055 61177 78 44.712 -85.633 -2628830 Port Huron Area School District Mich. -1.0648 814 2.263 7 0.947 26 26147 49965 44 43.02 -82.537 -0903090 Norwalk School District Conn. 0.6241 812 3.447 7.748 0.86 09 09001 78540 20 41.116 -73.421 -1800360 Bartholomew Con Ind. 0.3479 812 3.362 8.622 1.052 18 18005 63838 76 39.173 -85.903 -3500990 Farmington Municipal Schools N.M. 0.2523 810 2.296 6.928 0.926 35 35045 57190 38 36.624 -108.222 -4501860 Darlington S.C. -0.9794 810 2.331 7.053 0.944 45 45031 41892 44 34.332 -79.958 -0611490 Dry Creek Joint Elementary Calif. 1.0768 808 3.421 7.879 0.892 06 06061 87379 28 38.743 -121.337 -0901530 Fairfield School District Conn. 1.8647 808 4.961 9.893 0.986 09 09001 157857 57 41.176 -73.273 -3602460 Albany City School District N.Y. -1.4451 804 2.476 5.98 0.701 36 36001 33068 3 42.666 -73.798 -5100300 Augusta Co. Public Schools Va. 0.4847 804 3.498 7.935 0.888 51 51015 59881 27 38.163 -79.129 -1803940 Greater Clark County Schools Ind. -0.4612 803 3.266 7.836 0.914 18 18019 50043 34 38.477 -85.62 -4213140 Lancaster Pa. -1.6542 803 2.111 6.205 0.819 42 42071 33584 13 40.033 -76.311 -4703480 Putnam County School District Tenn. -0.2684 803 2.923 7.779 0.971 47 47141 44637 52 36.141 -85.495 -4807350 College Station Tex. 1.0088 802 4.096 9.169 1.015 48 48041 77448 66 30.551 -96.283 -0600064 Porterville Unified Calif. -2.0646 799 1.819 6.26 0.888 06 06107 31091 27 36.02 -118.61 -4103940 David Douglas Ore. -1.2226 798 1.957 7.998 1.208 41 41051 40365 98 45.497 -122.538 -0607200 Campbell Union Elementary Calif. 0.4832 797 3.101 7.867 0.953 06 06085 66800 46 37.289 -121.956 -3904689 Pickerington Local Ohio 1.2211 797 4.312 8.957 0.929 39 39045 93600 38 39.891 -82.747 -1302520 Spalding County Ga. -0.9338 796 2.445 6.601 0.831 13 13255 46141 15 33.261 -84.284 -5104020 Williamsburg-James City Va. 0.1838 796 4.069 8.937 0.974 51 51095 59999 53 37.269 -76.707 -0642000 West Covina Unified Calif. 0.6101 794 3.123 7.626 0.901 06 06037 71718 30 34.06 -117.925 -2920670 Mehlville R-IX Mo. 0.9614 794 3.663 8.306 0.929 29 29189 8e4 38 38.475 -90.332 -3613290 Half Hollow Hills Central School District N.Y. 1.8786 794 4.478 10.128 1.13 36 36103 139564 91 40.788 -73.377 -4219500 Pocono Mountain Pa. -0.3992 794 3.453 7.868 0.883 42 42089 57476 26 41.124 -75.393 -4400240 Cranston R.I. 0.3588 794 3.598 8.332 0.947 44 44007 66867 44 41.766 -71.482 -4503060 Oconee S.C. -0.3425 794 2.805 7.744 0.988 45 45073 54097 58 34.754 -83.066 -5300420 Bellingham School District Wash. 0.4012 794 3.477 9.58 1.221 53 53073 63771 98 48.732 -122.429 -0612750 Encinitas Union Elementary Calif. 1.5356 793 4.176 10.296 1.224 06 06073 123932 99 33.062 -117.281 -1808760 Penn-Harris-Madison Ind. 1.0455 793 4.3 10.01 1.142 18 18141 84039 93 41.614 -86.128 -3631470 Williamsville Central School District N.Y. 1.5412 793 4.508 10.273 1.153 36 36029 100919 94 43.019 -78.731 -4503630 Spartanburg 06 S.C. -0.1145 793 2.667 7.595 0.986 45 45083 52683 57 34.861 -81.939 -0807230 Westminster, School District No. 50, In The County Of Adams Colo. -0.6821 792 2.047 6.46 0.882 08 08001 45543 26 39.831 -105.029 -3704950 Wilkes County Schools N.C. -0.5311 791 3.461 7.878 0.883 37 37193 44959 26 36.206 -81.163 -0630600 Pittsburg Unified Calif. -0.3546 790 1.495 6.256 0.952 06 06013 51434 46 37.998 -121.892 -4111670 Springfield 19 Ore. -0.5882 790 3.012 7.179 0.833 41 41039 44306 15 44.085 -122.837 -4502550 Kershaw S.C. -0.3618 790 2.781 7.761 0.996 45 45055 46958 60 34.339 -80.59 -4015720 Jenks Okla. 1.2432 789 3.694 8.891 1.04 40 40143 87308 73 36.027 -95.969 -0503750 Cabot School District Ark. 0.292 788 3.776 8.186 0.882 05 05085 60401 25 34.967 -91.968 -0635360 Santa Barbara Elementary Calif. 0.057 788 2.259 7.409 1.03 06 06083 51458 70 NA NA -1743110 Woodland CCSD Ill. 1.0611 788 3.698 8.727 1.006 17 17097 92586 63 42.365 -87.963 -3175270 Papillion-La Vista Public Schs. Neb. 1.0802 788 3.488 9.197 1.142 31 31153 80701 93 41.157 -96.048 -4837140 Rio Grande City CISD Tex. -1.8377 788 2.556 6.997 0.888 48 48427 30278 27 26.455 -98.677 -3404230 East Orange N.J. -1.9936 787 2.812 6.221 0.682 34 34013 36360 2 40.765 -74.212 -3410110 Middletown Township N.J. 1.3538 787 4.179 9.58 1.08 34 34025 113108 83 40.378 -74.106 -3620490 New Rochelle City School District N.Y. 0.44 787 4.19 7.813 0.725 36 36119 66923 4 40.931 -73.784 -4211700 Hazleton Area Pa. -0.2883 787 3.525 6.97 0.689 42 42079 47781 2 40.968 -76.017 -1302190 Floyd County Ga. -0.2762 786 2.961 7.511 0.91 13 13115 46629 33 34.263 -85.214 -2923550 Park Hill Mo. 0.8756 786 4.14 9.282 1.028 29 29165 79166 70 39.224 -94.699 -0623080 Lucia Mar Unified Calif. 0.4974 785 2.79 7.865 1.015 06 06079 64528 66 35.116 -120.401 -3806780 Fargo N.D. 0.7894 785 3.827 8.627 0.96 38 38017 70996 49 46.835 -96.819 -4812180 Burleson Tex. 0.8163 785 3.14 8.595 1.091 48 48251 72736 85 32.529 -97.296 -4838900 San Felipe-Del Rio CISD Tex. -0.7533 785 2.307 6.699 0.878 48 48465 38991 25 29.698 -100.828 -3626670 Shenendehowa Central School District N.Y. 1.4177 783 4.041 9.545 1.101 36 36091 99214 87 42.865 -73.787 -3416380 Union City N.J. -1.2833 782 3.383 8.028 0.929 34 34017 37172 38 40.767 -74.032 -0603600 Azusa Unified Calif. -0.0213 781 1.35 6.181 0.966 06 06037 54434 51 34.263 -117.852 -3704080 Rutherford County Schools N.C. -1.0489 781 3.68 7.741 0.812 37 37161 41682 12 35.402 -81.92 -5100360 Bedford Co. Public Schools Va. 0.5741 780 3.196 8.054 0.972 51 51019 68600 52 37.315 -79.524 -1909480 Dubuque Comm School District Iowa 0.3667 777 3.562 8.086 0.905 19 19061 59950 31 42.475 -90.72 -1303390 Lowndes County Ga. 0.0517 776 3.796 8.394 0.92 13 13185 51579 36 30.834 -83.268 -3619200 Middle Country Central School District N.Y. 1.1325 776 3.758 8.731 0.995 36 36103 90760 60 40.867 -73.066 -4700001 Hamblen County School District Tenn. -0.6504 775 2.449 8.152 1.141 47 47063 44090 93 36.217 -83.267 -0400960 Avondale Elementary District Ariz. -0.1986 774 1.59 7.251 1.132 04 04013 60743 92 33.431 -112.391 -0618030 Huntington Beach City Elementary Calif. 1.2766 773 4.02 9.1 1.016 06 06059 108789 66 33.661 -118.034 -1601530 Idaho Falls District Idaho 0.3215 773 2.833 7.991 1.032 16 16019 58150 71 43.524 -112.266 -0643080 Woodland Joint Unified Calif. 0.0753 772 1.638 6.977 1.068 06 06113 59660 80 38.721 -121.77 -4839930 Sharyland Tex. 0.4981 771 3.588 9.011 1.085 48 48215 64588 84 26.243 -98.278 -4700330 Bradley County School District Tenn. -0.2585 770 2.938 7.498 0.912 47 47011 47193 34 35.154 -84.86 -0901020 Danbury School District Conn. 0.6004 768 3.363 7.536 0.835 09 09001 66721 15 41.402 -73.471 -0102070 Lee County Ala. -0.1749 766 2.345 7.258 0.983 01 01081 55708 56 32.588 -85.334 -1812390 Warrick County Ind. 0.9065 766 4.068 9.199 1.026 18 18173 78453 69 38.092 -87.272 -0100240 Autauga County Ala. 0.3556 764 3.142 8.323 1.036 01 01001 65988 72 32.535 -86.643 -0634440 San Jacinto Unified Calif. -0.6692 764 1.376 6.445 1.014 06 06065 47415 66 33.841 -117.001 -0638220 Sulphur Springs Union Elementary Calif. 0.4683 764 2.626 7.717 1.018 06 06037 74683 67 34.425 -118.401 -1805450 Lake Central Ind. 1.1428 764 4.129 8.605 0.895 18 18089 87500 29 41.477 -87.461 -5400510 Harrison County Schools W.Va. -0.4634 764 2.93 7.403 0.895 54 54033 47738 29 39.284 -80.38 -5400930 Monongalia County Schools W.Va. 0.8096 763 3.043 8.321 1.056 54 54061 68516 77 39.63 -80.047 -0103360 Tuscaloosa City Ala. -0.727 762 1.966 6.608 0.929 01 01125 42321 38 33.23 -87.524 -0403960 Isaac Elementary District Ariz. -1.6643 762 1.019 6.085 1.013 04 04013 27758 65 33.467 -112.144 -0904920 West Hartford School District Conn. 1.412 761 4.711 9.318 0.921 09 09003 100085 36 41.767 -72.754 -4828290 Los Fresnos CISD Tex. -0.7582 761 3.204 8.418 1.043 48 48061 36094 74 26.155 -97.455 -0624090 Marysville Joint Unified Calif. -1.1825 759 2.002 6.343 0.868 06 06115 45548 22 39.331 -121.352 -0624500 Milpitas Unified Calif. 0.9248 758 3.127 9.059 1.186 06 06085 92028 97 37.446 -121.715 -1303300 Liberty County Ga. -0.4821 756 2.827 7.023 0.839 13 13179 48105 16 31.768 -81.429 -4840680 South San Antonio Tex. -1.3917 756 1.86 6.682 0.964 48 48029 37523 50 29.354 -98.568 -3013040 Great Falls Elem. Mont. -0.0556 755 4.039 8.51 0.894 30 30013 48041 29 47.568 -111.282 -3502250 Roswell Independent Schools N.M. -0.8273 755 2.562 7.339 0.955 35 35005 39040 47 33.64 -104.345 -0101020 Cullman County Ala. -0.0177 754 3.158 7.149 0.798 01 01043 50233 10 34.132 -86.868 -0612180 El Rancho Unified Calif. 0.2231 754 1.483 6.958 1.095 06 06037 66387 86 33.988 -118.092 -3407560 Howell Township N.J. 1.2017 754 4.505 9.348 0.969 34 34025 105274 51 40.182 -74.197 -4401110 Warwick R.I. 0.6365 753 3.927 8.092 0.833 44 44003 71419 15 41.704 -71.437 -3417700 West Windsor-Plainsboro R N.J. 1.8781 752 5.679 12.061 1.276 34 34021 156652 100 40.305 -74.614 -0402430 Creighton Elementary District Ariz. -1.4791 751 1.203 6.592 1.078 04 04013 24404 82 33.493 -112.015 -2618990 Huron Valley Schools Mich. 0.6434 750 3.597 8.867 1.054 26 26125 85217 77 42.616 -83.593 -3402220 Brick Township N.J. 0.7638 750 3.532 9.173 1.128 34 34029 83683 91 40.067 -74.119 -2616350 Grand Blanc Community Schools Mich. 0.6457 749 3.569 8.605 1.007 26 26049 81651 64 42.921 -83.637 -3702560 Lee County Schools N.C. -0.6107 749 3.482 7.556 0.815 37 37105 44928 12 35.475 -79.171 -3904610 Fairfield City Ohio 0.4167 749 3.911 8.411 0.9 39 39017 70461 30 39.356 -84.528 -3603270 Arlington Central School District N.Y. 1.1006 748 3.77 8.131 0.872 36 36027 92883 23 41.675 -73.768 -5308160 South Kitsap School District Wash. 0.5035 748 3.785 8.465 0.936 53 53035 72070 41 47.481 -122.664 -1000680 Indian River School District Del. -0.1002 747 4.144 8.77 0.925 10 10005 57299 37 38.585 -75.28 -1930480 Waterloo Comm School District Iowa -0.9615 747 1.844 7.044 1.04 19 19013 42061 73 42.462 -92.319 -0601770 Alameda City Unified Calif. 0.4199 746 3.69 8.412 0.944 06 06001 75557 44 37.773 -122.266 -4503510 Spartanburg 02 S.C. 0.1638 746 3.251 8.199 0.99 45 45083 58577 58 35.097 -81.943 -5504050 Eau Claire Area School District Wis. 0.4703 745 3.506 8.593 1.017 55 55035 68756 67 44.762 -91.51 -0622410 Lompoc Unified Calif. -0.0447 744 1.639 7.024 1.077 06 06083 50882 82 34.634 -120.461 -2723850 North St Paul-Maplewood School Dist. Minn. 0.4696 744 3.805 8.286 0.896 27 27123 75743 29 44.983 -92.984 -4502280 Georgetown S.C. -1.0009 743 2.675 7.191 0.903 45 45043 44797 31 33.443 -79.337 -0902670 New Britain School District Conn. -1.4902 742 0.952 5.318 0.873 09 09003 36974 23 41.676 -72.786 -2633540 Taylor School District Mich. -1.5209 742 1.712 6.826 1.023 26 26163 44142 68 42.224 -83.27 -1200360 Columbia Fla. -0.6975 741 3.702 7.3 0.72 12 12023 46453 4 30.224 -82.622 -3200120 Elko County School District Nev. 0.9785 740 2.42 7.117 0.939 32 32007 76990 42 41.146 -115.358 -0622740 Los Banos Unified Calif. -0.3908 739 1.644 6.476 0.966 06 06047 59659 51 36.994 -120.929 -2711040 Duluth Public School District Minn. -0.0762 739 3.68 8.209 0.906 27 27137 57422 31 46.989 -92.061 -2722950 Mounds View Public School District Minn. 0.9566 739 4.44 9.864 1.085 27 27123 86655 84 45.082 -93.157 -2008400 Lawrence Kan. 0.6467 738 4.004 8.762 0.952 20 20045 66084 46 38.931 -95.291 -0100540 Calhoun County Ala. -0.4579 737 3.177 6.938 0.752 01 01015 47e3 6 33.782 -85.844 -2714220 Eden Prairie Public School District Minn. 1.3696 736 4.543 10.142 1.12 27 27053 110140 90 44.847 -93.458 -3407740 Jackson Township N.J. 1.0101 736 4.302 9.201 0.98 34 34029 96628 55 40.098 -74.358 -0643560 Yucaipa-Calimesa Joint Unified Calif. 0.3948 735 2.187 7.589 1.08 06 06071 77736 83 34.05 -117.017 -1300630 Bulloch County Ga. -0.3506 734 2.818 7.712 0.979 13 13031 50103 55 32.397 -81.743 -1807650 Noblesville Schools Ind. 1.2094 734 4.471 9.362 0.978 18 18057 85090 55 40.051 -86.024 -2200030 Acadia Parish La. -1.0042 734 2.257 7.109 0.971 22 22001 40324 52 30.291 -92.412 -3904371 Canton City Ohio -2.1795 732 2.099 6.245 0.829 39 39151 28848 14 40.804 -81.376 -3626010 Schenectady City School District N.Y. -1.1457 731 2.095 5.446 0.67 36 36093 37636 2 42.803 -73.928 -1719830 Cons Ill. 1.3456 730 3.982 9.462 1.096 17 17111 101953 86 42.179 -88.436 -2201620 St. Mary Parish La. -1.258 729 2.647 7.211 0.913 22 22101 42232 34 29.724 -91.447 -3702610 Lenoir County Public Schools N.C. -1.0095 729 2.861 6.924 0.813 37 37107 38525 12 35.239 -77.641 -3409270 Old Bridge Township N.J. 1.2061 728 4.109 9.203 1.019 34 34023 99202 67 40.399 -74.314 -0625830 Morgan Hill Unified Calif. 0.5996 727 2.572 7.518 0.989 06 06085 84201 58 37.177 -121.618 -3629370 Utica City School District N.Y. -2.0327 725 2.445 5.72 0.655 36 36065 29391 2 43.096 -75.226 -2708190 Eastern Carver County Public School Minn. 1.3105 724 4.284 9.674 1.078 27 27019 101396 82 44.801 -93.634 -3701200 Duplin County Schools N.C. -0.9742 724 2.736 7.054 0.863 37 37061 37446 21 34.936 -77.933 -4218510 Parkland Pa. 1.4066 724 4.419 9.792 1.075 42 42077 95592 81 40.624 -75.588 -4500780 Anderson 01 S.C. 0.3445 723 3.605 8.56 0.991 45 45007 65680 59 34.67 -82.532 -0504590 Conway School District Ark. 0.1191 719 4.012 8.528 0.903 05 05045 60852 31 35.069 -92.429 -0619700 Kings Canyon Joint Unified Calif. -1.0081 719 1.547 7.254 1.141 06 06019 36219 93 36.738 -119.039 -3621210 North Syracuse Central School District N.Y. 0.7425 719 3.332 7.959 0.926 36 36067 71020 37 43.163 -76.105 -3904736 Northwest Local - Cincinnati Ohio 0.2295 719 3.388 7.377 0.798 39 39061 58759 10 39.247 -84.622 -0602160 Alta Loma Elementary Calif. 1.1117 718 3.434 8.151 0.943 06 06071 100804 43 34.171 -117.595 -3412930 Perth Amboy N.J. -0.7356 718 2.75 6.128 0.676 34 34023 44236 2 40.523 -74.279 -3416800 Vineland City N.J. -0.498 718 2.789 7.771 0.996 34 34011 56627 60 39.465 -74.998 -4809860 Belton Tex. 0.4928 718 3.108 8.514 1.081 48 48027 63454 83 31.126 -97.512 -0605610 Bonita Unified Calif. 0.9851 717 3.697 8.158 0.892 06 06037 86561 28 34.145 -117.788 -2802160 Jackson Co. School District Miss. -0.0024 717 3.022 7.386 0.873 28 28059 55935 23 30.598 -88.667 -5401200 Putnam County Schools W.Va. 0.6983 717 3.739 8.409 0.934 54 54079 70771 40 38.509 -81.909 -2103210 Laurel County Ky. -0.6239 716 3.38 8.435 1.011 21 21125 42862 65 37.111 -84.118 -5102520 Montgomery Co. Public Schools Va. 0.659 716 3.905 8.579 0.935 51 51121 65735 40 37.174 -80.387 -0101230 Dothan City Ala. -0.7798 715 2.983 7.207 0.845 01 01069 39999 17 31.234 -85.407 -0404500 Madison Elementary District Ariz. 0.3457 715 3.455 8.772 1.063 04 04013 67325 79 33.526 -112.046 -0642450 Whittier City Elementary Calif. -0.2649 715 1.807 6.704 0.979 06 06037 54662 55 34.002 -118.037 -1714460 Evanston CCSD Ill. 0.9689 715 4.509 9.77 1.052 17 17031 92905 76 42.046 -87.697 -2201440 St. Charles Parish La. -0.1806 715 2.883 8.384 1.1 22 22089 61377 87 29.889 -90.362 -2201830 Vernon Parish La. -0.1964 715 3.166 8.196 1.006 22 22115 45519 63 31.108 -93.184 -2733510 St. Cloud Public School District Minn. -0.1443 715 3.17 7.924 0.951 27 27145 59090 45 45.497 -94.165 -3103810 Bellevue Public Schools Neb. 0.886 715 2.506 8.545 1.208 31 31153 74636 98 41.134 -95.918 -3402280 Bridgewater-Raritan Regio N.J. 1.6474 715 4.983 10.507 1.105 34 34035 126051 87 40.592 -74.61 -0101380 Etowah County Ala. 0.2769 713 3.197 7.194 0.799 01 01055 55714 10 34.045 -86.034 -0602970 Arcadia Unified Calif. 1.3252 713 5.481 10.455 0.995 06 06037 84731 60 34.145 -118.036 -2707290 Burnsville Public School District Minn. 0.8671 712 3.73 8.063 0.867 27 27037 84060 22 44.781 -93.306 -0402400 Crane Elementary District Ariz. -0.8783 711 2.035 8.052 1.203 04 04027 46e3 98 32.673 -114.689 -0404290 Laveen Elementary District Ariz. 0.2968 711 1.69 7.507 1.164 04 04013 54600 95 33.363 -112.162 -0614220 Fountain Valley Elementary Calif. 1.2615 711 3.95 9.149 1.04 06 06059 105255 73 33.696 -117.959 -3616230 Kenmore-Tonawanda Union Free School District N.Y. 0.3067 711 3.432 7.953 0.904 36 36029 62828 31 42.98 -78.874 -5304920 Mead School District Wash. 0.8701 711 4.18 8.985 0.961 53 53063 79412 49 47.82 -117.32 -2201800 Vermilion Parish La. -0.4652 710 2.598 7.359 0.952 22 22113 51896 46 29.849 -92.322 -5507020 Janesville School District Wis. -0.4635 710 3.36 8.417 1.011 55 55105 57844 65 42.659 -89.034 -1742210 Wheeling CCSD Ill. 0.7355 709 2.566 8.173 1.122 17 17031 64620 90 42.132 -87.935 -0626670 National Elementary Calif. -1.1762 708 1.863 7.381 1.104 06 06073 35763 87 32.667 -117.098 -0635880 Santee Elementary Calif. 0.7168 708 3.243 8.004 0.952 06 06073 73306 46 32.857 -116.998 -0806150 Pueblo County School District Colo. 0.4669 707 3.98 8.336 0.871 08 08101 65170 23 38.199 -104.599 -4900390 Iron District Utah 0.1581 706 3.47 8.248 0.956 49 49021 50545 47 37.859 -113.289 -3904513 Worthington City Ohio 1.377 705 4.285 9.155 0.974 39 39049 90511 53 40.11 -83.029 -5308020 Snohomish School District Wash. 1.0939 705 3.514 8.428 0.983 53 53061 90380 56 47.936 -122.026 -0622590 Los Alamitos Unified Calif. 1.5164 704 4.705 9.699 0.999 06 06059 116735 61 33.771 -118.069 -3415210 South Brunswick Township N.J. 1.7496 704 4.792 10.909 1.224 34 34023 122136 99 40.384 -74.525 -1305370 Walker County Ga. -0.5085 703 2.956 7.404 0.89 13 13295 44191 27 34.735 -85.301 -4812810 Canyon Tex. 0.982 702 3.835 8.734 0.98 48 48381 78817 55 34.976 -101.911 -0625860 Morongo Unified Calif. -0.5286 701 2.022 7.357 1.067 06 06071 44966 80 34.214 -116.182 -4809570 Bastrop Tex. -0.1065 701 2.522 7.404 0.976 48 48021 48807 54 30.103 -97.371 -1903690 Ankeny Comm School District Iowa 1.4262 700 4.172 9.851 1.136 19 19153 93610 92 41.734 -93.61 -2738190 Stillwater Area Public School Dist. Minn. 1.3721 700 4.746 9.663 0.983 27 27163 103497 56 45.038 -92.835 -4400840 Pawtucket R.I. -1.071 700 2.359 6.912 0.911 44 44007 38392 33 41.874 -71.374 -4816860 Desoto Tex. -0.0507 700 2.532 6.777 0.849 48 48113 56712 18 32.582 -96.862 -3100016 Grand Island Public Schools Neb. -0.0684 699 2.769 8.005 1.047 31 31079 48529 75 40.923 -98.359 -3904410 Hamilton City Ohio -1.4997 698 2.966 7.265 0.86 39 39017 37467 20 39.394 -84.569 -4221090 Scranton Pa. -0.7511 698 3.375 6.958 0.717 42 42069 42553 4 41.404 -75.665 -3401260 Bayonne N.J. -0.2438 697 3.676 8.353 0.935 34 34017 53791 40 40.673 -74.108 -3700750 Chatham County Schools N.C. 0.2335 697 3.327 8.388 1.012 37 37037 61530 65 35.703 -79.255 -5511190 Oshkosh Area School District Wis. 0.3933 697 3.451 8.673 1.044 55 55139 62074 74 43.979 -88.583 -0506120 Fayetteville School District Ark. 0.2025 696 3.543 8.976 1.086 05 05143 56139 84 36.083 -94.103 -4021000 Mustang Okla. 0.8053 696 2.932 8.336 1.081 40 40017 69303 83 35.395 -97.734 -5306690 Peninsula School District Wash. 1.1137 696 3.946 9.243 1.059 53 53053 91413 78 47.318 -122.692 -1802850 East Allen County Schools Ind. 0.1575 695 3.231 8.138 0.981 18 18003 59098 56 41.086 -84.942 -2620340 Kentwood Public Schools Mich. -0.2795 695 3.46 7.488 0.806 26 26081 56071 11 42.871 -85.608 -4828890 Manor Tex. -0.2954 695 1.776 7.339 1.113 48 48453 46234 89 30.331 -97.558 -1705050 Barrington Ill. 1.7034 694 5.219 9.999 0.956 17 17097 132666 47 42.147 -88.169 -3409720 Marlboro Township N.J. 1.9503 694 4.989 10.594 1.121 34 34025 149431 90 40.343 -74.257 -1713770 Comm Cons Ill. 0.5092 693 3.69 7.943 0.851 17 17031 59999 18 42.024 -87.977 -0101140 Dekalb County Ala. -0.6821 692 2.062 6.461 0.88 01 01049 40051 25 34.46 -85.813 -0642140 Western Placer Unified Calif. 0.695 692 2.447 7.679 1.046 06 06061 78084 75 38.93 -121.314 -4023280 Owasso Okla. 0.9296 692 3.905 8.589 0.937 40 40143 77898 41 36.282 -95.823 -5400840 Mercer County Schools W.Va. -0.6656 692 2.329 7.21 0.976 54 54055 39850 54 37.406 -81.111 -4817070 Dickinson Tex. -0.1737 691 2.979 7.656 0.935 48 48167 53219 41 29.454 -95.026 -4101120 Greater Albany Public 8J Ore. 0.1663 690 2.584 7.784 1.04 41 41043 61462 73 44.619 -123.079 -3704320 Stanly County Schools N.C. 0.007 689 3.216 8.1 0.977 37 37167 58749 54 35.312 -80.251 -2802400 Lamar County School District Miss. 0.4605 688 3.172 8.047 0.975 28 28073 65021 53 31.231 -89.518 -4208850 Easton Area Pa. 0.1654 687 3.873 7.987 0.823 42 42095 67380 13 40.712 -75.237 -0606900 Calexico Unified Calif. -1.2839 686 0.788 5.933 1.029 06 06025 38648 70 32.688 -115.518 -5102940 Pittsylvania Co. Public Schools Va. -0.4408 686 3.414 8.191 0.955 51 51143 51308 47 36.821 -79.397 -0100008 Madison City Ala. 1.3939 685 3.991 9.856 1.173 01 01089 103228 96 34.711 -86.763 -1803750 Franklin Township Com Ind. 0.8203 685 3.956 9.279 1.065 18 18097 73082 79 39.68 -86.015 -3620340 Clarkstown Central School District N.Y. 1.8072 685 4.058 9.535 1.095 36 36087 127917 86 41.142 -73.967 -1300780 Camden County Ga. -0.1826 684 3.45 8.162 0.942 13 13039 57190 43 30.938 -81.702 -1800270 Avon Community Ind. 1.0294 684 4.298 9.393 1.019 18 18063 79712 67 39.759 -86.392 -3618690 William Floyd Union Free School District N.Y. 0.4212 684 3.763 7.244 0.696 36 36103 81059 3 40.791 -72.847 -4835400 Port Arthur Tex. -1.752 684 1.684 6.981 1.059 48 48245 29979 78 29.897 -93.969 -5513650 Sheboygan Area School District Wis. 0.1106 683 3.395 8.064 0.934 55 55117 62812 40 43.746 -87.744 -0630180 Perris Elementary Calif. -1.6367 682 0.987 7.196 1.242 06 06065 37102 99 33.772 -117.292 -1709420 Champaign Ill. 0.2135 681 3.559 7.593 0.807 17 17019 61386 11 40.128 -88.284 -0806480 School District No. 3 In The County Of El Paso And State Of Colo. 0.3552 679 3.362 8.113 0.95 08 08041 62981 45 38.761 -104.683 -3701530 Franklin County Schools N.C. -0.3887 679 3.23 7.398 0.834 37 37069 49671 15 36.083 -78.286 -0102100 Limestone County Ala. 0.3861 678 2.457 6.674 0.843 01 01083 56136 17 34.815 -86.984 -0621690 Lincoln Unified Calif. 0.0145 678 2.111 7.567 1.091 06 06077 69264 85 37.998 -121.358 -2101150 Christian County Ky. -1.2895 678 3.331 7.086 0.751 21 21047 39553 5 36.901 -87.489 -4501500 Cherokee S.C. -1.1704 677 2.168 7.012 0.969 45 45021 39356 52 35.044 -81.613 -0637530 South San Francisco Unified Calif. 0.9594 676 2.684 7.723 1.008 06 06081 83738 64 37.654 -122.416 -4502340 Greenwood 50 S.C. -1.0406 676 2.531 7.286 0.951 45 45047 38749 46 34.133 -82.158 -0638460 Sunnyvale Calif. 0.8123 675 2.826 7.877 1.01 06 06085 80020 65 37.389 -122.026 -1301380 Colquitt County Ga. -1.1504 675 2.74 6.596 0.771 13 13071 34731 7 31.188 -83.769 -3417280 Wayne Township N.J. 1.5712 675 4.209 9.87 1.132 34 34031 129615 92 40.948 -74.245 -0402920 Florence Unified School District Ariz. 0.5493 674 1.569 7.434 1.173 04 04021 61656 96 32.944 -111.224 -0604290 Beaumont Unified Calif. 0.4988 674 2.57 7.312 0.948 06 06065 66451 45 33.949 -117.015 -1930930 West Des Moines Comm School District Iowa 1.2098 673 3.881 9.248 1.073 19 19153 91626 81 41.565 -93.756 -2104800 Pike County Ky. -0.7058 673 3.655 7.446 0.758 21 21195 39545 6 37.469 -82.396 -4205550 Chambersburg Area Pa. 0.3192 673 2.998 7.845 0.969 42 42055 59718 52 39.986 -77.654 -0607800 Castro Valley Unified Calif. 1.0764 672 4.38 8.55 0.834 06 06001 99502 15 37.723 -122.044 -2628740 Pontiac City School District Mich. -2.2229 672 1.06 5.172 0.823 26 26125 30037 13 42.66 -83.279 -2630390 Saginaw City School District Mich. -3.0163 672 1.473 5.586 0.822 26 26145 24589 13 43.457 -83.957 -3619230 Longwood Central School District N.Y. 0.6253 672 3.335 8.002 0.933 36 36103 79489 40 40.873 -72.93 -4704380 Washington County School Dist. Tenn. 0.0808 670 2.826 8.624 1.16 47 47179 49179 95 36.274 -82.526 -3501260 Hobbs Municipal Schools N.M. -0.3367 669 1.602 6.342 0.948 35 35025 43851 45 32.652 -103.408 -5601470 Campbell County School District #1 Wyo. 0.8302 669 3.419 8.307 0.978 56 56005 80952 54 44.248 -105.548 -0618870 Jefferson Elementary Calif. 0.6166 667 1.991 7.267 1.055 06 06081 73907 77 37.686 -122.506 -2711670 Minnetonka Public School District Minn. 1.9463 667 5.208 10.844 1.127 27 27053 132216 91 44.909 -93.548 -4216410 Neshaminy Pa. 1.0743 667 4.17 8.946 0.955 42 42017 87113 47 40.172 -74.927 -2804470 Vicksburg Warren School Dist. Miss. -0.7456 666 1.763 6.204 0.888 28 28149 38978 27 32.357 -90.852 -0200390 Kenai Peninsula Borough School District Alaska 0.3184 665 3.364 8.563 1.04 02 02122 70231 73 60.193 -150.282 -3700630 Carteret County Public Schools N.C. -0.2665 665 4.08 8.686 0.921 37 37031 49958 36 34.825 -76.698 -4502730 Lexington 02 S.C. -0.5941 665 2.294 7.322 1.006 45 45063 45808 63 33.918 -81.108 -4113170 West Linn-Wilsonville 3J Ore. 1.2923 664 4.308 9.372 1.013 41 41005 98626 65 45.338 -122.709 -0102010 Lauderdale County Ala. 0.0962 663 3.121 7.608 0.897 01 01077 52602 29 34.901 -87.654 -0103062 St Clair County Ala. 0.2181 663 2.517 7.43 0.983 01 01115 59506 56 33.772 -86.311 -1603240 Twin Falls District Idaho -0.0321 663 3.237 8.058 0.964 16 16083 48320 50 42.512 -114.471 -3701800 Granville County Schools N.C. -0.0857 662 2.803 7.054 0.85 37 37077 56704 18 36.304 -78.653 -3404110 East Brunswick Township N.J. 1.6245 661 5.005 10.454 1.09 34 34023 116548 85 40.428 -74.418 -3501680 Los Lunas Public Schools N.M. -0.6149 661 2.498 7.074 0.915 35 35061 41610 35 34.775 -106.898 -0608070 Centralia Elementary Calif. 0.3735 660 2.946 8.707 1.152 06 06059 70450 94 33.841 -118.013 -1711850 Decatur Ill. -1.2536 660 2.232 6.162 0.786 17 17115 36875 8 39.848 -88.937 -2926070 Raytown C-2 Mo. -0.2961 660 2.662 6.917 0.851 29 29095 53228 19 39.005 -94.462 -5400570 Jefferson County Schools W.Va. 0.6413 660 3.065 7.697 0.926 54 54037 69115 38 39.308 -77.863 -0100420 Blount County Ala. -0.1732 659 2.455 6.684 0.846 01 01009 51966 18 33.981 -86.567 -3704140 Sampson County Schools N.C. -0.6737 658 3.081 7.746 0.933 37 37163 41614 40 34.992 -78.372 -3630360 Webster Central School District N.Y. 1.2474 657 3.853 9.298 1.089 36 36055 86711 85 43.213 -77.445 -4819560 Forney Tex. 0.8615 657 3.878 8.635 0.951 48 48257 81087 46 32.738 -96.447 -1705790 Belvidere Ill. 0.1598 656 2.88 7.769 0.978 17 17007 64829 54 42.263 -88.83 -2201080 City of Monroe School District La. -2.6431 656 2.811 6.016 0.641 22 22073 25367 1 32.521 -92.077 -2802280 Jones Co. School District Miss. -0.1309 656 2.29 7.3 1.002 28 28067 42433 62 31.623 -89.169 -3620100 Mount Vernon City School District N.Y. -0.8784 656 3.577 5.5 0.385 36 36119 45625 1 40.914 -73.829 -0901710 Greenwich School District Conn. 1.8741 655 4.838 10.19 1.07 09 09001 170419 80 41.069 -73.639 -2711250 Edina Public School District Minn. 2.0167 653 5.28 10.53 1.05 27 27053 141678 76 44.891 -93.357 -3417070 Washington Township - Sewell N.J. 1.0478 653 4.108 9.224 1.023 34 34015 100391 68 39.747 -75.072 -3703570 Pender County Schools N.C. -0.1036 653 3.454 8.009 0.911 37 37141 54291 33 34.529 -77.913 -2604260 Bay City School District Mich. -0.3764 652 2.745 7.347 0.921 26 26017 52054 36 43.608 -83.971 -3704410 Surry County Schools N.C. -0.3908 652 4.014 8.379 0.873 37 37171 43353 23 36.418 -80.683 -5307920 Shoreline School District Wash. 1.0598 652 4.169 9.978 1.162 53 53033 89248 95 47.756 -122.335 -0604740 Berkeley Unified Calif. 0.7248 650 3.124 8.435 1.062 06 06001 72461 79 37.872 -122.275 -4813590 Channelview Tex. -0.3746 650 2.545 7.56 1.003 48 48201 51699 62 29.793 -95.119 -0634680 San Leandro Unified Calif. 0.0534 648 1.809 6.229 0.884 06 06001 57905 26 37.71 -122.157 -4208550 East Penn Pa. 1.1717 648 4.196 8.658 0.892 42 42077 89333 28 40.515 -75.545 -0400295 Kingman Unified School District Ariz. -0.8762 646 2.519 6.989 0.894 04 04015 46554 29 35.602 -114.193 -2504980 Framingham Mass. 0.5875 646 3.812 8.654 0.968 25 25017 73022 51 42.309 -71.437 -2509720 Plymouth Mass. 0.7225 646 4.616 9.002 0.877 25 25023 85349 24 41.886 -70.632 -2628950 Portage Public Schools Mich. 0.8252 646 4.022 8.839 0.963 26 26077 83649 50 42.207 -85.586 -3200300 Lyon County School District Nev. -0.1348 646 2.977 7.905 0.986 32 32019 56299 57 39.02 -119.189 -3904426 Lorain City Ohio -2.772 645 1.548 6.182 0.927 39 39093 25649 38 41.449 -82.166 -2105260 Scott County Ky. -0.1696 644 3.838 8.115 0.855 21 21209 64473 19 38.292 -84.584 -2400030 Allegany County Public Schools Md. -0.2502 644 3.727 7.792 0.813 24 24001 50524 12 39.621 -78.699 -0101170 Decatur City Ala. -0.6766 643 2.687 7.133 0.889 01 01103 49422 27 34.578 -86.985 -0510680 N. Little Rock School District Ark. -1.4169 643 2.379 6.369 0.798 05 05119 35215 10 34.781 -92.253 -0503690 Bryant School District Ark. 0.3332 642 4.039 8.291 0.85 05 05125 65867 18 34.729 -92.729 -2509870 Quincy Mass. 0.5035 641 4.106 9.02 0.983 25 25021 78326 56 42.247 -71.024 -0600032 Redondo Beach Unified Calif. 1.3144 640 4.08 8.835 0.951 06 06037 106556 46 33.856 -118.378 -4503690 Sumter 17 S.C. -1.3543 640 2.541 6.495 0.791 45 45085 39055 9 NA NA -4701020 Dickson County School District Tenn. 0.0789 639 3.25 8.364 1.023 47 47043 55990 68 36.149 -87.357 -4842330 Temple Tex. -0.1854 639 2.091 6.874 0.957 48 48027 45916 47 31.093 -97.347 -0612030 El Centro Elementary Calif. -1.6472 638 1.6 6.644 1.009 06 06025 32500 64 32.796 -115.562 -4813230 Cedar Hill Tex. 0.2939 637 2.691 7.302 0.922 48 48113 71352 36 32.587 -96.973 -1303510 Marietta City Ga. -0.3662 636 2.957 7.482 0.905 13 13067 39030 31 33.953 -84.537 -3500570 Clovis Municipal Schools N.M. -0.5489 636 2.518 7.508 0.998 35 35009 38735 61 34.474 -103.28 -3904635 West Clermont Local Ohio 0.5524 636 4.073 8.006 0.787 39 39025 64185 8 39.057 -84.241 -2605850 Birmingham City School District Mich. 1.8062 635 4.84 10.111 1.054 26 26125 133005 77 42.54 -83.257 -5306180 Olympia School District Wash. 0.6741 635 4.045 9.623 1.116 53 53067 74496 89 47.035 -123.029 -0636970 Snowline Joint Unified Calif. 0.1808 633 2.005 7.501 1.099 06 06071 70826 87 34.404 -117.584 -2635910 West Ottawa Public School District Mich. -0.0151 632 3.327 8.531 1.041 26 26139 60506 73 42.854 -86.135 -2916190 Jefferson City Mo. 0.1543 632 3.812 7.502 0.738 29 29051 58749 5 38.595 -92.18 -4828550 Lufkin Tex. -0.7604 631 2.661 8.129 1.094 48 48005 37049 85 31.333 -94.677 -0403240 Gadsden Elementary District Ariz. -2.3408 630 0.621 6.79 1.234 04 04027 30690 99 32.534 -114.77 -0404440 Littleton Elementary District Ariz. -0.3628 630 1.194 7.432 1.248 04 04013 54354 99 33.409 -112.316 -0404720 Maricopa Unified School District Ariz. 0.6366 629 2.555 7.165 0.922 04 04021 63584 36 33.038 -112.083 -2623820 Midland Public Schools Mich. 0.7093 629 3.873 9.25 1.075 26 26111 79365 82 43.676 -84.238 -4217010 North Allegheny Pa. 1.9898 629 4.89 10.573 1.136 42 42003 123150 92 40.607 -80.077 -4828110 Longview Tex. -0.7879 629 2.457 7.347 0.978 48 48183 37022 54 32.497 -94.727 -0610620 Davis Joint Unified Calif. 1.3817 628 3.801 9.593 1.158 06 06113 106962 94 38.498 -121.693 -1600600 Vallivue School District Idaho -0.4448 628 3.298 8.239 0.988 16 16027 46309 58 43.6 -116.703 -2625740 Grosse Pointe Public Schools Mich. 1.2545 628 4.405 9.559 1.031 26 26163 107627 71 42.418 -82.913 -3618630 Massapequa Union Free School District N.Y. 1.7212 628 4.749 9.878 1.026 36 36059 123628 69 40.674 -73.457 -3702250 Hoke County Schools N.C. -0.6341 628 2.649 7.152 0.901 37 37093 47735 30 34.963 -79.242 -0610740 Del Mar Union Elementary Calif. 2.106 627 5.509 11.607 1.22 06 06073 154040 98 32.949 -117.255 -0621210 Lawndale Elementary Calif. -0.3279 627 2.071 7.079 1.002 06 06037 43976 62 33.891 -118.348 -1908220 Council Bluffs Comm School District Iowa -0.2124 627 2.843 7.242 0.88 19 19155 54883 25 41.32 -95.865 -2505970 Haverhill Mass. -0.0952 627 3.361 7.916 0.911 25 25009 65210 33 42.784 -71.087 -3409390 Manalapan-Englishtown Reg. N.J. 1.5899 625 4.196 10.252 1.211 34 34025 115533 98 40.28 -74.344 -1728140 New Lenox Ill. 1.3778 624 3.568 8.55 0.996 17 17197 98730 60 41.514 -87.962 -2511520 Taunton Mass. -0.2686 624 4.197 8.063 0.773 25 25005 60720 7 41.904 -71.094 -0402320 Coolidge Unified District Ariz. -0.287 623 2.268 6.635 0.873 04 04021 49582 23 33.037 -111.598 -0103450 Walker County Ala. -0.8359 622 2.375 7.077 0.94 01 01127 41649 42 33.803 -87.297 -1809150 Portage Township Schools Ind. -0.2845 622 3.934 8.372 0.888 18 18127 57277 27 41.577 -87.175 -4222560 Spring-Ford Area Pa. 1.375 621 4.279 10.574 1.259 42 42091 105714 99 40.202 -75.515 -2618720 Howell Public Schools Mich. 0.7789 620 3.922 8.582 0.932 26 26093 84627 39 42.621 -83.934 -5304200 Lake Stevens School District Wash. 0.5013 619 3.744 9.116 1.074 53 53061 70991 81 48.018 -122.081 -0616470 Hanford Elementary Calif. -0.9951 618 1.633 7.253 1.124 06 06031 36120 91 36.331 -119.651 -0900510 Bristol School District Conn. 0.1975 618 3.336 8.149 0.962 09 09003 69483 49 41.681 -72.941 -4207110 Cumberland Valley Pa. 1.5333 617 4.701 9.994 1.059 42 42041 98800 78 40.229 -77.067 -4503720 Sumter 02 S.C. -1.1763 617 2.472 6.544 0.814 45 45085 36839 12 NA NA -4700180 Bedford County School District Tenn. -0.8145 615 2.579 7.292 0.943 47 47003 45851 43 35.514 -86.459 -0614940 Garvey Elementary Calif. -0.2302 614 2.313 8.013 1.14 06 06037 47500 93 34.06 -118.096 -1713970 Elmhurst Ill. 1.4673 614 4.939 9.872 0.987 17 17043 111783 57 41.898 -87.941 -1730220 Orland Ill. 1.161 614 4.688 9.019 0.866 17 17031 92319 22 41.609 -87.867 -4109330 Oregon City Ore. -0.1096 614 3.115 8.281 1.033 41 41005 62483 71 45.335 -122.511 -4832370 New Braunfels Tex. 0.5319 614 3.642 8.458 0.963 48 48091 66780 50 29.72 -98.176 -1000180 Caesar Rodney School District Del. 0.4117 613 4.065 8.444 0.876 10 10001 70975 24 39.091 -75.567 -3411220 New Brunswick N.J. -0.7506 613 1.701 6.106 0.881 34 34023 42213 25 40.487 -74.445 -0617340 Hollister Calif. -0.1962 612 1.681 6.611 0.986 06 06069 66274 57 36.832 -121.397 -2201590 St. Martin Parish La. -1.0558 611 2.381 6.652 0.854 22 22099 41810 19 30.228 -91.727 -4819830 Frenship Tex. 0.4765 611 3.803 9.148 1.069 48 48303 70271 80 33.525 -102.02 -5308610 Sumner School District Wash. 0.5099 611 3.657 8.754 1.02 53 53053 81159 67 47.176 -122.202 -1800150 Anderson Community Ind. -0.9669 609 2.74 7.108 0.874 18 18095 41333 23 40.121 -85.65 -2742360 White Bear Lake School District Minn. 0.9101 609 4.041 8.953 0.982 27 27123 85849 56 45.102 -93.026 -3622470 Patchogue-Medford Union Free School District N.Y. 0.8807 609 2.551 7.448 0.979 36 36103 88911 55 40.789 -73.001 -3904373 Centerville City Ohio 1.2454 609 4.464 9.915 1.09 39 39113 94055 85 39.625 -84.16 -0102480 Morgan County Ala. 0.2846 608 2.732 7.142 0.882 01 01103 57499 25 34.44 -86.836 -1300570 Bryan County Ga. 0.3773 608 3.691 8.372 0.936 13 13029 72315 41 32.153 -81.555 -0633480 Rosedale Union Elementary Calif. 1.1164 606 2.625 7.584 0.992 06 06029 97812 59 35.397 -119.163 -3200390 Carson City School District Nev. -0.1931 606 2.81 7.905 1.019 32 32510 55421 67 39.151 -119.747 -4202340 Altoona Area Pa. -0.4834 606 3.442 8.117 0.935 42 42013 46785 40 40.525 -78.397 -2104950 Pulaski County Ky. -0.5716 605 3.729 8.383 0.931 21 21199 42500 39 37.104 -84.577 -3904510 Willoughby-Eastlake City Ohio 0.4563 605 4.123 8.467 0.869 39 39085 64732 22 41.622 -81.426 -0100660 Chilton County Ala. -0.7691 604 2.763 6.488 0.745 01 01021 42651 5 32.848 -86.719 -3904516 Youngstown City Schools Ohio -2.9793 604 1.539 5.222 0.737 39 39099 22568 5 41.099 -80.621 -3904549 Mentor Exempted Village Ohio 0.7832 604 4.379 8.94 0.912 39 39085 77588 34 41.683 -81.331 -3404560 Egg Harbor Township N.J. 0.6526 603 3.153 8.326 1.035 34 34001 71071 71 39.386 -74.625 -5102340 Lynchburg City Va. -0.9543 603 3.226 6.699 0.695 51 51680 38820 3 37.4 -79.191 -0103180 Talladega County Ala. -0.582 602 2.631 6.56 0.786 01 01121 46538 8 33.378 -86.17 -1729250 Oak Park ESD Ill. 1.1919 602 4.726 9.578 0.97 17 17031 99271 52 41.887 -87.79 -2511880 Wachusett Mass. 1.5322 601 5.213 10.246 1.007 25 25027 108333 64 42.399 -71.88 -2609900 Clarkston Community School District Mich. 0.8317 601 4.322 8.723 0.88 26 26125 90517 25 42.74 -83.427 -5516260 West Allis School District Wis. -0.3156 601 3.42 7.867 0.889 55 55079 53565 27 43.005 -88.029 -3614010 Haverstraw-Stony Point CSD (North Rockland) N.Y. 0.841 600 3.267 7.511 0.849 36 36087 87847 18 41.251 -74.017 -4225830 West Shore Pa. 0.9807 600 4.039 7.743 0.741 42 42133 76130 5 40.169 -76.856 -5305220 Moses Lake School District Wash. -0.5103 599 3.033 7.872 0.968 53 53025 49272 51 47.138 -119.307 -0627720 Novato Unified Calif. 0.9551 598 3.55 7.98 0.886 06 06041 99336 26 38.107 -122.565 -1801020 Brownsburg Community Ind. 1.3389 597 4.318 10.325 1.201 18 18063 89400 98 39.861 -86.381 -1801440 Center Grove Com Ind. 1.3745 597 4.4 9.604 1.041 18 18081 97405 73 39.576 -86.194 -0621420 Lennox Elementary Calif. -0.9042 595 1.757 6.661 0.981 06 06037 34017 55 33.939 -118.358 -3704650 Vance County Schools N.C. -1.7281 595 2.917 6.784 0.773 37 37181 31562 7 36.365 -78.408 -0801950 School District N. 14 In The County Of Adams & State Of Colo Colo. -0.8389 594 1.836 6.676 0.968 08 08001 38049 51 39.837 -104.875 -4813020 Carroll Tex. 2.3105 594 5.779 10.988 1.042 48 48439 193932 74 32.952 -97.147 -0610440 Cypress Elementary Calif. 1.1137 592 3.634 8.899 1.053 06 06059 86833 76 33.821 -118.041 -3405490 Franklin Township - Hillsborough N.J. 1.1698 592 3.165 8.35 1.037 34 34035 96229 72 40.476 -74.552 -3608130 Commack Union Free School District N.Y. 1.8833 592 4.328 9.395 1.013 36 36103 127120 65 40.839 -73.286 -5100600 Campbell Co. Public Schools Va. -0.0671 591 3.26 7.625 0.873 51 51031 51614 23 37.206 -79.096 -0902400 Meriden School District Conn. -0.6739 590 2.574 6.618 0.809 09 09009 46078 11 41.537 -72.794 -1201320 Monroe Fla. 0.388 590 3.88 8.071 0.838 12 12087 57615 16 25.512 -81.032 -2712270 Forest Lake Public School District Minn. 0.7632 590 3.643 8.896 1.051 27 27163 78552 76 45.273 -92.995 -3703870 Richmond County Schools N.C. -1.4766 590 2.437 7.098 0.932 37 37153 32254 39 35.006 -79.748 -3413140 Plainfield N.J. -0.8826 588 1.846 6.532 0.937 34 34039 44478 41 40.615 -74.416 -0627060 Newark Unified Calif. 0.4938 587 1.946 7.555 1.122 06 06001 79005 90 37.52 -122.031 -0620190 La Habra City Elementary Calif. 0.2866 586 1.991 6.036 0.809 06 06059 56758 11 33.928 -117.941 -3627810 East Ramapo Central School District (Spring Valley) N.Y. 0.2851 586 2.377 6.132 0.751 36 36087 63592 5 41.143 -74.06 -3628200 Three Village Central School District N.Y. 1.8954 586 4.436 9.741 1.061 36 36103 138495 78 40.917 -73.11 -3702040 Haywood County Schools N.C. 0.0806 586 4.125 8.286 0.832 37 37087 53500 15 35.556 -82.982 -1304980 Tift County Ga. -0.9682 585 2.9 7.144 0.849 13 13277 40392 18 31.457 -83.527 -1802490 Crown Point Community Ind. 0.9739 585 4.41 9.388 0.995 18 18089 78354 60 41.391 -87.324 -2620730 Lake Orion Community Schools Mich. 1.0051 585 4.4 9.565 1.033 26 26125 96381 71 42.765 -83.259 -3904724 Beavercreek City Ohio 1.3602 585 4.452 9.781 1.066 39 39057 93309 80 39.728 -84.039 -1704140 Arlington Heights Ill. 1.7927 584 5.214 10.289 1.015 17 17031 106045 66 42.093 -87.981 -3703480 Orange County Schools N.C. 0.0862 584 3.902 8.513 0.922 37 37135 52769 36 36.087 -79.129 -0606360 Buena Park Elementary Calif. -0.0363 583 2.41 7.337 0.985 06 06059 47941 57 33.87 -118.002 -3904737 Oak Hills Local Ohio 0.8985 583 4.142 9.072 0.986 39 39061 78676 57 39.142 -84.648 -1301350 Coffee County Ga. -0.7574 582 3.016 7.225 0.842 13 13069 37229 17 31.549 -82.849 -4503600 Spartanburg 05 S.C. 0.4879 582 3.29 8.026 0.947 45 45083 66206 44 34.914 -82.127 -4826190 La Porte Tex. 0.6138 582 3.383 8.51 1.025 48 48201 80069 69 29.657 -95.055 -2730060 Prior Lake-Savage Area Schools Minn. 1.4134 581 4.483 9.95 1.093 27 27139 107320 85 44.702 -93.416 -4830600 Midlothian Tex. 0.9912 581 3.776 9.221 1.089 48 48139 90073 84 32.474 -96.998 -0804080 Fountain, School District No. 8, In The County Of El Paso An Colo. 0.2674 580 3.843 8.073 0.846 08 08041 52535 18 38.669 -104.737 -4838970 San Marcos CISD Tex. -0.2999 580 2.764 7.53 0.953 48 48209 44374 46 29.859 -97.935 -5101050 Culpeper Co. Public Schools Va. 0.6389 580 3.487 7.916 0.886 51 51047 74499 26 38.486 -77.956 -0641580 Washington Unified Calif. -0.3576 578 1.937 6.788 0.97 06 06113 49675 52 38.56 -121.561 -2507170 Malden Mass. -0.2526 578 3.414 8.878 1.093 25 25017 55166 85 42.43 -71.058 -2630030 Rockford Public Schools Mich. 1.1837 578 3.948 9.131 1.037 26 26081 85869 72 43.103 -85.527 -3904734 Forest Hills Local Ohio 1.515 578 4.881 10.096 1.043 39 39061 96013 74 39.09 -84.353 -4844800 Weatherford Tex. 0.2597 578 3.224 8.43 1.041 48 48367 57951 74 32.73 -97.765 -5515900 Wausau School District Wis. 0.2718 578 3.378 8.296 0.984 55 55073 65042 56 45.03 -89.621 -1201800 Sumter Fla. -0.5064 577 4.078 8.014 0.787 12 12119 41847 8 28.705 -82.081 -2103030 Jessamine County Ky. -0.0984 577 3.261 7.984 0.945 21 21113 50755 44 37.872 -84.581 -3411460 North Bergen N.J. -0.2539 577 3.11 8.182 1.014 34 34017 55733 66 40.794 -74.025 -5400720 Marion County Schools W.Va. -0.1829 577 3.112 7.622 0.902 54 54049 50661 30 39.51 -80.243 -0805550 Mapleton, School District No. 1, In The County Of Adams & St Colo. -0.1683 576 2.497 6.84 0.869 08 08001 44422 22 39.834 -104.969 -2507740 Methuen Mass. 0.6412 576 3.584 8.023 0.888 25 25009 76179 27 42.734 -71.189 -4226820 York City Pa. -2.9353 576 1.899 5.107 0.642 42 42133 24618 1 39.965 -76.732 -1303840 Murray County Ga. -0.4561 575 3.28 7.25 0.794 13 13213 43642 10 34.788 -84.748 -4218750 Pennridge Pa. 1.0794 575 4.165 9.34 1.035 42 42017 92196 72 40.384 -75.256 -2916350 Joplin R-VIII Mo. -0.7694 574 3.323 7.539 0.843 29 29097 39845 17 37.064 -94.504 -1304200 Polk County Ga. -1.0284 573 2.582 7.002 0.884 13 13233 38113 26 34.002 -85.188 -1725110 Maywood-Melrose Park-Broadview Ill. -0.9542 573 1.646 6.423 0.955 17 17031 47074 47 41.884 -87.844 -3904438 Medina City Ohio 0.89 573 4.389 8.899 0.902 39 39103 83291 30 41.132 -81.837 -4826470 Lake Travis Tex. 1.6203 573 4.785 10.319 1.107 48 48453 111993 88 30.35 -98.01 -5308760 Tahoma School District Wash. 1.3693 573 4.698 9.458 0.952 53 53033 111283 46 47.396 -121.924 -0403870 Humboldt Unified District Ariz. -0.2315 572 3.387 7.631 0.849 04 04025 50127 18 34.58 -112.174 -3416500 Union Township N.J. 0.8373 572 3.381 8.33 0.99 34 34039 82564 58 40.695 -74.27 -3904481 Springfield City Ohio -1.8765 572 1.748 6.644 0.979 39 39023 31009 55 39.929 -83.801 -4215330 Millcreek Township Pa. 0.874 572 3.406 9.388 1.196 42 42049 76633 97 42.077 -80.121 -4208670 East Stroudsburg Area Pa. -0.0161 571 3.591 7.967 0.875 42 42089 63158 24 41.139 -75.086 -4501560 Chesterfield S.C. -1.2772 571 2.482 7.063 0.916 45 45025 38088 35 34.64 -80.159 -4702130 Johnson City School District Tenn. -0.4907 571 3.705 9.766 1.212 47 47179 46944 98 36.339 -82.381 -1305310 Valdosta City Ga. -1.7646 570 2.494 6.697 0.841 13 13185 31494 16 30.849 -83.279 -1930510 Waukee Comm School District Iowa 1.637 570 4.473 9.753 1.056 19 19049 107211 77 41.599 -93.862 -2400540 Queen Anne's County Public Schools Md. 0.9578 570 4.187 8.569 0.876 24 24035 86111 24 39.096 -75.972 -2632250 South Lyon Community Schools Mich. 0.826 570 4.321 9.678 1.071 26 26125 87103 81 42.447 -83.637 -3700330 Beaufort County Schools N.C. -0.4838 570 3.241 7.33 0.818 37 37013 46730 13 35.498 -76.866 -0613500 Fallbrook Union Elementary Calif. 0.3303 569 2.156 7.979 1.164 06 06073 49452 95 33.383 -117.399 -2625980 Northville Public Schools Mich. 1.8629 569 4.577 10.058 1.096 26 26163 144834 86 42.425 -83.511 -4222440 Seneca Valley Pa. 1.4381 569 4.416 9.83 1.083 42 42019 99502 83 40.78 -80.085 -4817760 Eanes Tex. 2.1939 569 5.032 10.801 1.154 48 48453 160750 94 30.307 -97.835 -5309660 Wenatchee School District Wash. 0.0681 569 2.577 7.84 1.053 53 53007 53125 76 47.385 -120.336 -0406810 Queen Creek Unified District Ariz. 0.9967 568 3.713 8.817 1.021 04 04013 83898 68 33.27 -111.627 -3407230 Hillsborough Township N.J. 1.6086 568 4.684 10.451 1.153 34 34035 122107 94 40.499 -74.673 -4702100 Jefferson County School Dist. Tenn. -0.4667 568 1.844 7.682 1.168 47 47089 46595 95 36.051 -83.446 -3609840 East Meadow Union Free School District N.Y. 1.6291 567 4.797 9.52 0.945 36 36059 111156 44 40.726 -73.56 -4226300 Wilkes-Barre Area Pa. -1.1021 567 2.89 6.594 0.741 42 42079 38428 5 41.202 -75.757 -4844730 Waxahachie Tex. -0.0099 567 3.119 8.201 1.016 48 48139 64014 66 32.353 -96.858 -0606270 Buckeye Union Elementary Calif. 1.3794 566 4.011 8.803 0.958 06 06017 116713 48 38.645 -120.974 -1201980 Walton Fla. -0.2818 566 3.925 8.118 0.838 12 12131 51183 16 30.658 -86.163 -3610620 Elmont Union Free School District N.Y. 0.86240000000000006 565 3.384 8.819 1.087 36 36059 88188 84 40.703 -73.707 -4204590 Butler Area Pa. 0.1864 565 3.736 8.453 0.943 42 42019 61530 43 40.875 -79.878 -2007890 Geary County Schools Kan. -0.1393 564 3.973 7.316 0.669 20 20061 44406 2 39.063 -96.753 -3617520 Liverpool Central School District N.Y. 0.6591 563 3.3 8.688 1.078 36 36067 69677 82 43.136 -76.208 -3819410 West Fargo N.D. 0.8047 563 3.408 8.698 1.058 38 38017 68571 78 46.874 -96.916 -1734990 Round Lake Ill. -0.4629 562 1.581 6.6 1.004 17 17097 50345 63 42.362 -88.093 -3904366 Brunswick City Ohio 0.7095 562 4.304 8.735 0.886 39 39103 77181 26 41.241 -81.828 -4214160 Lower Merion Pa. 1.9794 562 5.795 10.782 0.997 42 42091 152410 60 40.028 -75.28 -1302940 Jackson County Ga. 0.0696 561 3.624 8.042 0.884 13 13157 57378 26 34.131 -83.57 -3617160 Levittown Union Free School District N.Y. 1.4097 561 4.503 8.447 0.789 36 36059 109527 9 40.714 -73.514 -3619650 Monroe-Woodbury Central School District N.Y. 1.679 560 3.67 9.384 1.143 36 36071 111773 93 41.299 -74.172 -4202040 Abington Pa. 1.0839 560 4.556 9.638 1.016 42 42091 91017 66 40.11 -75.114 -4831260 Montgomery Tex. 0.9048 560 3.974 9.062 1.018 48 48339 75980 67 30.404 -95.692 -4815240 Copperas Cove Tex. -0.2057 559 2.857 8.417 1.112 48 48099 47999 89 31.147 -97.921 -4839990 Sheldon Tex. -0.648 559 2.196 7.283 1.017 48 48201 46875 67 29.871 -95.167 -4033480 Yukon Okla. 0.511 558 3.264 8.175 0.982 40 40017 63967 56 35.524 -97.749 -2503660 Chicopee Mass. -0.8891 557 3.492 8.155 0.932 25 25013 51049 40 42.176 -72.572 -2718780 Mankato Public School District Minn. 0.456 557 4.207 9.242 1.007 27 27013 64586 64 44.184 -93.975 -3904487 Sylvania City Ohio 0.9347 557 4.192 9.423 1.046 39 39095 86885 75 41.695 -83.713 -0635220 San Ysidro Elementary Calif. -0.3459 556 1.931 6.778 0.969 06 06073 44017 52 32.57 -116.967 -1713530 Edwardsville Ill. 1.1115 556 4.4 9.404 1.001 17 17119 92317 62 38.871 -89.931 -2733000 Shakopee Public School District Minn. 1.1559 556 4.051 9.023 0.994 27 27139 88513 60 44.756 -93.514 -3412480 Parsippany-Troy Hills Tow N.J. 1.4785 553 4.482 10.159 1.135 34 34027 112321 92 40.86 -74.424 -4503660 Spartanburg 07 S.C. -1.2613 553 2.26 7.21 0.99 45 45083 36596 58 34.949 -81.9 -4701740 Hawkins County School District Tenn. -0.9476 553 2.428 7.422 0.999 47 47073 39139 61 36.44 -82.947 -4836660 Red Oak Tex. 0.6085 553 3.15 8.263 1.022 48 48139 69357 68 32.515 -96.811 -1301620 Dalton City Ga. -0.6272 552 2.845 7.162 0.863 13 13313 34736 21 34.771 -84.976 -3000005 Helena Elem. Mont. 0.7694 551 3.031 8.678 1.129 30 30049 65e3 91 46.679 -112.01 -4700900 Cumberland County School Dist. Tenn. -0.2866 551 2.441 8.512 1.214 47 47035 43505 98 35.95 -84.998 -4703590 Roane County School District Tenn. -0.2303 551 2.335 7.922 1.117 47 47145 47500 90 35.837 -84.545 -0100210 Auburn City Ala. 0.7491 550 4.055 8.931 0.975 01 01081 72109 53 32.607 -85.49 -1712540 Downers Grove GSD Ill. 1.5054 550 4.584 9.406 0.964 17 17043 106124 50 41.798 -88.015 -5101440 Franklin Co. Public Schools Va. -0.3928 550 3.996 8.522 0.905 51 51067 46643 31 36.992 -79.881 -5103900 Washington Co. Public Schools Va. -0.1324 550 3.832 8.27 0.888 51 51191 44717 27 36.724 -81.96 -3701320 Edgecombe County Schools N.C. -1.2563 549 2.039 5.995 0.791 37 37065 39126 9 35.913 -77.596 -4203330 Bensalem Township Pa. 0.3498 549 3.19 8.202 1.002 42 42017 67564 62 40.109 -74.943 -2804320 Tupelo Public School Dist. Miss. -0.402 548 2.668 7.757 1.018 28 28081 52407 67 34.268 -88.734 -3404890 Evesham Township N.J. 1.5262 548 4.109 9.245 1.027 34 34005 107851 70 39.86 -74.895 -4203960 Boyertown Area Pa. 1.0132 548 4.44 9.546 1.021 42 42011 82795 68 40.335 -75.611 -4830640 Midway Tex. 1.0975 548 4.221 8.837 0.923 48 48309 73530 37 31.501 -97.269 -5302940 Franklin Pierce School District Wash. -0.5857 548 2.864 8.211 1.07 53 53053 45757 80 47.153 -122.399 -0635810 Santa Rosa Elementary Calif. 0.1134 547 1.96 7.557 1.119 06 06097 53105 90 38.457 -122.719 -0640320 Union Elementary Calif. 1.4981 547 4.573 9.688 1.023 06 06085 124797 68 37.242 -121.917 -1000190 Capital School District Del. -0.7596 547 2.895 7.1 0.841 10 10001 45250 16 39.182 -75.565 -3904418 Kettering City Ohio 0.1562 547 3.818 9.366 1.11 39 39113 53763 88 39.698 -84.161 -5101920 Henry Co. Public Schools Va. -0.9988 547 3.705 7.616 0.782 51 51089 39784 8 36.683 -79.874 -0401380 Buckeye Elementary District Ariz. 0.2023 546 1.678 7.113 1.087 04 04013 60226 84 33.266 -112.596 -0600019 Dublin Unified Calif. 1.4536 544 4.019 9.509 1.098 06 06001 118534 86 37.715 -121.91 -5401500 Wayne County Schools W.Va. -0.2926 544 3.049 6.627 0.716 54 54099 45439 3 38.146 -82.427 -0904440 Stratford School District Conn. 0.6026 543 3.743 7.861 0.824 09 09001 79827 14 41.209 -73.131 -3904696 Gahanna-Jefferson City Ohio 1.1877 543 3.946 9.048 1.02 39 39049 83786 68 40.026 -82.842 -4206240 Coatesville Area Pa. 0.2346 543 3.436 7.37 0.787 42 42029 66155 8 40 -75.84 -4211580 Harrisburg City Pa. -2.5684 542 0.763 5.113 0.87 42 42043 24338 23 40.275 -76.884 -4222770 State College Area Pa. 1.2186 542 4.585 10.015 1.086 42 42027 85584 84 40.776 -77.897 -1302310 Gainesville City Ga. -0.747 541 2.371 6.842 0.894 13 13139 36574 29 34.29 -83.83 -4839690 Seguin Tex. -0.5565 541 2.491 7.023 0.906 48 48187 42692 32 29.545 -97.89 -2006390 Garden City Kan. 0.3218 540 2.839 7.044 0.841 20 20055 51470 17 38.047 -100.734 -3407680 Irvington Township N.J. -1.5685 540 2.05 5.847 0.759 34 34013 40677 6 40.724 -74.232 -0615270 Glendora Unified Calif. 1.0751 539 3.929 8.499 0.914 06 06037 91729 34 34.162 -117.842 -0634800 San Luis Coastal Unified Calif. 0.8414 539 3.215 8.356 1.028 06 06079 79303 70 35.291 -120.727 -1718240 Harlem Ud Ill. -0.0649 539 2.819 7.277 0.892 17 17201 59473 28 42.352 -89.026 -2714260 Hopkins Public School District Minn. 0.9219 539 4.054 8.997 0.989 27 27053 88059 58 44.937 -93.418 -1302580 Habersham County Ga. -0.2251 537 2.821 8.115 1.059 13 13137 46770 78 34.631 -83.531 -1726400 Moline USD Ill. 0.0867 537 3.098 7.234 0.827 17 17161 53896 14 41.466 -90.488 -1812420 Warsaw Community Schools Ind. -0.0082 537 3.701 8.902 1.04 18 18085 55333 73 41.221 -85.862 -2005490 De Soto Kan. 1.5769 537 4.253 9.876 1.125 20 20091 100711 91 38.96 -94.928 -1800030 M S D Southwest Allen County Ind. 1.4938 536 4.521 9.409 0.977 18 18003 99120 54 41.003 -85.281 -4221870 Souderton Area Pa. 1.5083 536 4.661 9.542 0.976 42 42091 97336 54 40.299 -75.391 -0607950 Central Elementary Calif. 0.3009 535 2.759 7.344 0.917 06 06071 68325 35 34.111 -117.595 -0902520 Milford School District Conn. 1.011 535 3.998 8.942 0.989 09 09009 96263 58 41.224 -73.061 -3413050 Piscataway Township N.J. 1.0937 535 4.368 9.121 0.951 34 34023 92960 45 40.547 -74.463 -4810710 Boerne Tex. 1.6403 535 4.071 9.642 1.114 48 48259 106375 89 29.82 -98.691 -4826670 Lancaster Tex. -0.4906 535 1.859 7.099 1.048 48 48113 52428 75 32.59 -96.772 -0622650 Los Altos Elementary Calif. 2.3369 534 6.249 11.345 1.019 06 06085 205340 67 37.356 -122.13 -1805400 Lafayette School Corporation Ind. -0.9916 534 3.251 7.846 0.919 18 18157 40741 36 40.411 -86.864 -2634560 Van Buren Public Schools Mich. -0.2479 534 2.857 7.142 0.857 26 26163 63291 20 42.209 -83.488 -1716920 Glenview CCSD Ill. 1.7085 533 5.035 9.801 0.953 17 17031 135909 46 42.078 -87.823 -2802550 Lee County School District Miss. -0.6064 533 2.142 7.252 1.022 28 28081 38422 68 34.296 -88.685 -3630780 West Seneca Central School District N.Y. 0.52 533 4.373 8.549 0.835 36 36029 65244 15 42.839 -78.753 -4205860 Chester-Upland Pa. -3.0908 533 1.57 4.955 0.677 42 42045 23845 2 39.847 -75.377 -4211790 Hempfield Pa. 0.9197 533 4.415 9.507 1.018 42 42071 82430 67 40.07 -76.421 -4701470 Greene County School District Tenn. -0.4934 533 2.227 7.469 1.048 47 47059 44761 75 36.175 -82.846 -0621930 Little Lake City Elementary Calif. 0.3075 532 2.459 7.401 0.988 06 06037 68734 58 33.934 -118.082 -2103960 Mccracken County Ky. 0.2678 532 3.678 8.803 1.025 21 21145 59382 69 37.054 -88.713 -4202790 Avon Grove Pa. 1.2894 531 4.137 9.807 1.134 42 42029 106097 92 39.792 -75.834 -2011370 Salina Kan. 0.0233 530 3.309 7.901 0.918 20 20169 54360 36 38.861 -97.607 -3904394 Elyria City Schools Ohio -0.935 530 2.741 7.414 0.935 39 39093 46403 40 41.384 -82.121 -1725290 Mchenry CCSD Ill. 0.2885 529 3.203 8.201 1 17 17111 76217 61 42.333 -88.269 -4833060 North Forest Tex. -1.5785 528 1.739 6.601 0.972 48 48201 35803 53 29.863 -95.272 -4702190 Kingsport City School District Tenn. -0.4059 526 3.337 9.033 1.139 47 47163 48726 93 36.525 -82.548 -5501770 Elmbrook School District Wis. 1.8246 526 4.926 10.329 1.081 55 55133 116562 83 43.064 -88.12 -2505010 Franklin Mass. 1.3677 525 5.663 10.119 0.891 25 25021 106594 28 42.086 -71.411 -2803480 Pascagoula School Dist. Miss. -1.3364 525 2.164 6.899 0.947 28 28059 40189 44 30.403 -88.588 -0628080 Oakley Union Elementary Calif. 0.4214 524 2.424 6.764 0.868 06 06013 73644 22 38.034 -121.653 -3417760 Westfield N.J. 2.1094 524 5.322 10.755 1.087 34 34039 157292 84 40.652 -74.343 -0904620 Trumbull School District Conn. 1.8198 523 5.285 9.946 0.932 09 09001 127688 39 41.26 -73.208 -4823250 Highland Park - Dallas Tex. 2.3034 523 6.001 10.869 0.974 48 48113 205457 53 32.845 -96.796 -4901080 Uintah District Utah 0.4878 522 3.02 7.469 0.89 49 49047 69579 27 40.125 -109.518 -0904230 Southington School District Conn. 1.2611 521 4.874 9.322 0.89 09 09003 99449 27 41.605 -72.88 -2102710 Henderson County Ky. -0.3028 521 3.989 8.365 0.875 21 21101 50964 24 37.796 -87.573 -0901620 Glastonbury School District Conn. 1.7108 520 4.811 10.273 1.092 09 09003 129798 85 41.692 -72.547 -2102860 Hopkins County Ky. -0.9539 520 3.235 8.177 0.988 21 21107 43109 58 37.31 -87.54 -2711820 Farmington Public School District Minn. 1.1839 520 4.184 9.088 0.981 27 27037 91061 55 44.63 -93.127 -2630210 Roseville Community Schools Mich. -1.0413 519 1.884 6.472 0.918 26 26099 47727 35 42.506 -82.936 -3625770 Saratoga Springs City School District N.Y. 1.3407 519 4.268 9.711 1.088 36 36091 99171 84 43.109 -73.832 -1303960 Oconee County Ga. 1.1423 518 4.853 9.285 0.886 13 13219 87200 26 33.835 -83.437 -2201890 Webster Parish La. -1.2024 518 1.692 6.724 1.006 22 22119 38648 63 32.713 -93.335 -2802430 Lauderdale Co. School District Miss. -0.2214 518 2.453 7.59 1.027 28 28075 49299 70 32.404 -88.663 -3410560 Montclair N.J. 1.3326 518 4.792 9.726 0.987 34 34013 125906 57 40.826 -74.211 -3619320 Middletown City School District N.Y. -0.4106 518 1.946 6.832 0.977 36 36071 55454 54 41.458 -74.424 -5504680 Fond Du Lac School District Wis. 0.0475 518 3.071 8.415 1.069 55 55039 61315 80 43.773 -88.393 -1808250 Northwest Allen County Schools Ind. 1.2145 517 4.21 9.281 1.014 18 18003 84911 66 41.192 -85.222 -2201140 Natchitoches Parish La. -1.486 517 1.486 6.938 1.09 22 22069 33244 85 31.724 -93.096 -2009140 Maize Kan. 1.3448 516 4.232 9.167 0.987 20 20173 95067 57 37.764 -97.454 -3018570 Missoula Elem. Mont. 0.1539 516 4.265 9.194 0.986 30 30063 52897 57 46.836 -113.958 -0615510 Goleta Union Elementary Calif. 1.2812 515 3.166 8.705 1.108 06 06083 94382 88 34.447 -119.889 -1809690 Merrillville Community School Ind. -0.1697 515 3.139 7.478 0.868 18 18089 55773 22 41.475 -87.311 -3704380 Stokes County Schools N.C. -0.4019 515 3.579 8.12 0.908 37 37169 49888 32 36.402 -80.24 -5102360 Manassas City Va. 0.4398 515 2.772 7.866 1.019 51 51683 71856 67 38.748 -77.484 -1807320 Muncie Community Schools Ind. -1.6709 514 2.954 7.116 0.832 18 18035 34006 15 40.191 -85.386 -0803540 Eagle County School District No. Re Colo. 0.9815 513 3.779 8.527 0.95 08 08037 69698 45 39.713 -106.813 -2503270 Cambridge Mass. 0.3424 513 3.968 9.094 1.025 25 25017 53939 69 42.376 -71.118 -4110350 Redmond 2J Ore. -0.4055 513 2.918 8.028 1.022 41 41017 53797 68 44.213 -121.371 -1302430 Gordon County Ga. -0.1871 512 2.832 7.954 1.024 13 13129 49299 69 34.503 -84.876 -3701170 Davie County Schools N.C. 0.3056 512 3.947 8.788 0.968 37 37059 59513 51 35.929 -80.544 -4503840 York 02 S.C. 0.1094 512 3.953 8.795 0.968 45 45091 64298 51 35.105 -81.21 -4704350 Warren County School District Tenn. -0.7497 512 2.023 7.676 1.131 47 47177 41369 92 35.679 -85.778 -1200960 Jackson Fla. -0.2321 510 3.836 7.639 0.761 12 12063 50597 6 30.795 -85.215 -1713320 East St Louis Ill. -3.5642 510 2.286 4.129 0.369 17 17163 21342 1 38.616 -90.106 -3608160 Connetquot Central School District N.Y. 1.2262 510 3.895 8.355 0.892 36 36103 96961 28 40.774 -73.127 -3628560 Syosset Central School District N.Y. 2.2114 510 5.24 10.345 1.021 36 36059 167269 68 40.818 -73.493 -3631260 White Plains City School District N.Y. 0.6438 510 3.138 8.424 1.057 36 36119 62411 78 41.022 -73.755 -4845900 Willis Tex. -0.2446 510 3.036 7.49 0.891 48 48339 50714 28 30.44 -95.437 -1917220 Linn-Mar Comm School District Iowa 1.1494 509 4.472 9.135 0.933 19 19113 86649 40 42.065 -91.57 -2636485 Woodhaven-Brownstown School District Mich. 0.0996 509 2.579 7.462 0.977 26 26163 78830 54 42.151 -83.268 -5514490 Stevens Point Area School District Wis. 0.7678 509 3.791 8.785 0.999 55 55097 70150 61 44.546 -89.604 -0403060 Fowler Elementary District Ariz. -0.9364 508 1.744 6.846 1.02 04 04013 41969 68 33.434 -112.215 -0625690 Moorpark Unified Calif. 1.439 507 3.375 8.353 0.996 06 06111 103193 60 34.312 -118.873 -1200780 Hendry Fla. -1.5493 507 3.27 6.551 0.656 12 12051 32123 2 26.553 -81.166 -2616380 Grand Haven Area Public Schools Mich. 0.5165 507 3.974 8.79 0.963 26 26139 66165 50 43.011 -86.161 -3904440 Middletown City Ohio -1.315 507 2.231 6.691 0.892 39 39017 38483 28 39.502 -84.375 -3904823 Washington Local Ohio -0.9964 507 3.38 8.142 0.952 39 39095 51377 46 41.712 -83.568 -4107230 Lake Oswego 7J Ore. 1.5069 507 5.604 10.247 0.929 41 41005 107303 38 45.41 -122.701 -4814310 Cleburne Tex. -0.5068 507 2.455 7.257 0.96 48 48251 49930 49 32.309 -97.463 -4840080 Sherman Tex. -0.5633 507 2.775 7.851 1.015 48 48181 44041 66 33.641 -96.591 -0628710 Orcutt Union Elementary Calif. 0.7133 506 2.542 7.347 0.961 06 06083 77439 49 34.812 -120.451 -2506840 Lexington Mass. 2.1425 506 6.186 12.48 1.259 25 25017 162684 99 42.446 -71.231 -4010920 Enid Okla. -0.5469 506 2.786 7.056 0.854 40 40047 35375 19 36.393 -97.918 -4702340 Lawrence County School Distrct Tenn. -0.3074 506 3.123 8.728 1.121 47 47099 43999 90 35.217 -87.396 -4820280 Galveston Tex. -1.039 506 2.232 7.153 0.984 48 48167 32277 56 29.246 -94.894 -5515990 Wauwatosa School District Wis. 1.2014 506 4.546 9.39 0.969 55 55079 81967 52 43.062 -88.035 -0103430 Vestavia Hills City Ala. 1.9553 505 5.249 9.933 0.937 01 01073 122806 41 33.433 -86.784 -0625770 Moreland Elementary Calif. 0.9302 505 3.797 9.06 1.053 06 06085 100284 76 37.296 -121.981 -1712120 CCSD 62 Ill. 0.5396 505 3.4 8.125 0.945 17 17031 57672 44 42.033 -87.892 -3620820 Niagara Falls City School District N.Y. -1.2615 505 3.057 6.645 0.718 36 36063 37743 4 43.096 -79.007 -3808130 Grand Forks N.D. 0.467 505 3.687 8.582 0.979 38 38035 70967 55 47.9 -97.093 -0608760 Claremont Unified Calif. 1.1076 504 3.352 8.305 0.99 06 06037 89583 58 34.206 -117.709 -3904697 Groveport Madison Local Ohio -0.692 504 2.573 6.816 0.849 39 39049 50549 18 39.862 -82.886 -4223640 Tredyffrin-Easttown Pa. 2.2207 504 5.063 10.83 1.153 42 42029 157644 94 40.055 -75.45 -1813080 Westfield-Washington Schools Ind. 1.1723 503 4.545 9.378 0.967 18 18057 89967 51 40.05 -86.166 -3415330 South Orange-Maplewood N.J. 1.6489 503 4.67 10.083 1.083 34 34013 121163 83 40.74 -74.267 -3610560 Elmira City School District N.Y. -1.0174 503 2.697 6.205 0.702 36 36015 40417 3 42.062 -76.807 -3813030 Minot N.D. 0.586 503 3.278 8.309 1.006 38 38101 56124 63 48.255 -101.259 -4700090 Anderson County School Distrct Tenn. -0.2761 503 2.04 7.978 1.188 47 47001 54807 97 36.138 -84.191 -5514640 Sun Prairie Area School District Wis. 0.5905 503 4.051 8.963 0.982 55 55025 70546 56 43.188 -89.206 -2105320 Shelby County Ky. 0.2169 502 3.451 7.878 0.885 21 21211 61781 26 38.215 -85.195 -2200150 Avoyelles Parish La. -1.2908 502 2.054 6.111 0.812 22 22009 35992 12 31.076 -92.001 -2512840 Weymouth Mass. 0.539 502 4.746 8.133 0.677 25 25021 78895 2 42.193 -70.948 -2732430 Roseville Public School District Minn. 0.5822 502 3.958 8.424 0.893 27 27123 64967 28 45.012 -93.132 -4700570 Cheatham County School Distrct Tenn. 0.3083 502 2.492 7.912 1.084 47 47021 59999 83 36.261 -87.087 -5304470 Longview School District Wash. -0.7926 502 2.512 7.705 1.038 53 53015 47500 73 46.235 -123.09 -0101770 Houston County Ala. -0.2135 501 2.805 7.553 0.95 01 01069 48181 45 31.14 -85.285 -0603420 Atwater Elementary Calif. -1.073 501 2.135 6.94 0.961 06 06047 38060 49 37.362 -120.611 -0626280 Mountain View Whisman Calif. 1.0426 501 3.264 8.34 1.015 06 06085 67045 66 37.419 -122.071 -3170110 Elkhorn Public Schools Neb. 1.6429 501 3.977 10.404 1.285 31 31055 108207 100 41.286 -96.234 -3405640 Freehold Township N.J. 1.5242 501 4.531 9.951 1.084 34 34025 117187 84 40.225 -74.298 -3417610 West Orange N.J. 1.0851 501 4.088 8.827 0.948 34 34013 96547 45 40.789 -74.263 -3610890 Fairport Central School District N.Y. 1.5185 501 3.772 9.491 1.144 36 36055 104074 93 43.084 -77.423 -4216980 Norristown Area Pa. -0.4853 501 2.844 7.317 0.895 42 42091 48222 29 40.136 -75.354 -0636270 Selma Unified Calif. -0.9057 500 1.986 7.205 1.044 06 06019 41649 74 36.562 -119.625 -0101320 Enterprise City Ala. -0.1407 499 3.481 8.283 0.96 01 01031 49558 49 31.328 -85.846 -0102700 Phenix City Ala. -1.5906 499 2.133 6.562 0.886 01 01113 31923 26 32.459 -85.025 -1201410 Okeechobee Fla. -0.8177 499 3.023 6.831 0.762 12 12093 39439 6 27.386 -80.889 -2309930 Portland Public Schools Me. -0.2428 499 2.911 8.555 1.129 23 23005 54487 91 43.678 -70.289 -3617380 Lindenhurst Union Free School District N.Y. 1.1334 499 4.098 8.111 0.803 36 36103 94827 11 40.692 -73.373 -2501950 Andover Mass. 1.7467 498 5.692 10.92 1.046 25 25009 147844 75 42.647 -71.165 -0632760 Rio Elementary Calif. 0.2941 497 1.004 6.051 1.009 06 06111 65027 64 34.223 -119.141 -1301890 Laurens County Ga. -0.2446 497 3.224 7.443 0.844 13 13175 43624 17 32.464 -82.922 -3616290 Kingston City School District N.Y. 0.3049 497 2.986 6.924 0.788 36 36111 64828 9 41.922 -74.025 -3621270 Northport-East Northport Union Free School District N.Y. 1.465 497 4.259 9.341 1.017 36 36103 117126 66 40.889 -73.324 -3904360 Berea City Ohio -0.0476 497 3.869 8.476 0.921 39 39035 65442 36 41.381 -81.831 -4204230 Bristol Township Pa. 0.101 497 3.173 7.478 0.861 42 42017 57142 20 40.121 -74.867 -4821390 Granbury Tex. 0.3093 497 3.329 8.1 0.954 48 48221 67429 47 32.454 -97.75 -2606870 Brighton Area Schools Mich. 1.2077 496 4.171 9.076 0.981 26 26093 106638 55 42.516 -83.759 -3702940 Mcdowell County Schools N.C. -0.5108 496 3.41 7.931 0.904 37 37111 46187 31 35.681 -82.049 -5400300 Fayette County Schools W.Va. -0.6925 496 2.115 6.339 0.845 54 54019 39356 17 38.029 -81.081 -5501050 Beloit School District Wis. -1.3919 496 2.162 6.73 0.913 55 55105 43333 34 42.523 -89.02 -0901260 East Hartford School District Conn. -0.7709 495 1.93 6.29 0.872 09 09003 51767 23 41.763 -72.615 -1730840 Park Ridge CCSD Ill. 1.6001 495 4.645 9.746 1.02 17 17031 109302 68 42.014 -87.843 -2914340 Hickman Mills C-1 Mo. -1.0942 495 2.11 5.706 0.719 29 29095 39499 4 38.933 -94.507 -3700960 Columbus County Schools N.C. -1.0818 495 2.504 7.245 0.948 37 37047 39313 45 34.256 -78.647 -5516290 West Bend School District Wis. 0.4216 495 3.962 8.604 0.928 55 55131 74676 38 43.395 -88.151 -2619620 Jackson Public Schools Mich. -1.3067 494 2 6.423 0.885 26 26075 38046 26 42.215 -84.421 -0400001 Cave Creek Unified District Ariz. 1.8768 493 4.193 9.387 1.039 04 04013 128529 73 33.782 -111.851 -1802640 M S D Decatur Township Ind. -0.1201 493 3.3 7.476 0.835 18 18097 54041 15 39.68 -86.275 -4827720 Little Elm Tex. 0.5322 493 3.319 7.848 0.906 48 48121 64781 31 33.151 -96.947 -3904395 Euclid City Ohio -1.3403 492 1.95 6.098 0.83 39 39035 39733 14 41.587 -81.518 -4108010 Mcminnville Ore. -0.4478 492 3.216 8.587 1.074 41 41071 49545 81 45.205 -123.256 -0902310 Manchester School District Conn. 0.3517 491 3.385 7.236 0.77 09 09003 66352 7 41.775 -72.524 -1717280 Granite City Ill. -0.663 491 2.567 6.574 0.801 17 17119 48937 10 38.732 -90.116 -3417580 West New York N.J. -0.9781 491 3.235 8.015 0.956 34 34017 36066 47 40.786 -74.009 -3904550 Milford Exempted Village Ohio 0.9253 491 4.549 9.552 1.001 39 39025 80966 62 39.184 -84.252 -1600510 Caldwell District Idaho -1.2888 490 2.591 6.752 0.832 16 16027 33982 15 43.657 -116.693 -2708100 Centennial Public School District Minn. 1.2467 490 4.711 9.362 0.93 27 27003 94377 39 45.155 -93.113 -0404280 Lake Havasu Unified District Ariz. -0.124 489 3.524 8.455 0.986 04 04015 46439 57 34.545 -114.302 -2706090 Brainerd Public School District Minn. 0.2982 489 4.346 9.083 0.947 27 27035 59095 44 46.325 -94.142 -1805580 Laporte Community Ind. -0.1149 488 4.092 8.609 0.903 18 18091 60392 31 41.558 -86.672 -2626130 Novi Community School District Mich. 1.8213 488 5.068 10.413 1.069 26 26125 125368 80 42.475 -83.485 -4102800 Centennial 28J Ore. -0.6569 488 1.466 7.729 1.253 41 41051 52820 99 45.476 -122.481 -1700119 North Shore Ill. 1.5668 487 4.874 9.23 0.871 17 17097 132430 23 42.185 -87.81 -2617910 Hartland Consolidated Schools Mich. 1.0444 487 3.975 8.733 0.952 26 26093 93591 46 42.66 -83.772 -3200090 Douglas County School District Nev. 0.6237 487 3.225 8.395 1.034 32 32005 75662 71 38.912 -119.616 -4842480 Texarkana Tex. -1.2509 487 2.849 7.464 0.923 48 48037 38379 37 33.452 -94.095 -1303270 Lee County Ga. 0.4252 486 3.412 7.854 0.888 13 13177 71642 27 31.78 -84.141 -1803930 Goshen Community Schools Ind. -0.5816 486 2.268 7.725 1.092 18 18039 39895 85 41.566 -85.829 -2635820 West Bloomfield School District Mich. 1.5486 486 4.438 8.558 0.824 26 26125 122957 14 42.577 -83.377 -0401460 Sierra Vista Unified District Ariz. 0.468 485 2.614 7.95 1.067 04 04003 61154 80 31.523 -110.231 -1915450 Johnston Comm School District Iowa 1.3068 485 4.548 10.47 1.184 19 19153 98999 96 41.697 -93.733 -1926820 Southeast Polk Comm School District Iowa 0.9742 485 3.608 8.409 0.96 19 19153 80827 49 41.587 -93.413 -1733000 Quincy Ill. -0.1215 483 2.923 7.096 0.835 17 17001 51912 15 39.943 -91.363 -2510050 Revere Mass. -0.3773 483 3.943 8.53 0.918 25 25025 51953 35 42.419 -70.995 -4832090 Nacogdoches Tex. -1.0963 483 1.534 7.09 1.111 48 48347 34317 89 31.597 -94.67 -1802800 Duneland School Corporation Ind. 0.7744 482 4.079 8.992 0.982 18 18127 81530 56 41.587 -87.038 -2005460 Derby Kan. 0.5718 482 3.58 8.172 0.918 20 20173 68134 35 37.58 -97.253 -2602790 Anchor Bay School District Mich. 0.7167 482 3.361 8.066 0.941 26 26147 86752 42 42.706 -82.736 -2922890 Northwest R-I Mo. 0.2284 482 3.95 7.918 0.794 29 29099 60996 9 38.394 -90.621 -0600048 Paso Robles Joint Unified Calif. 0.2253 481 2.375 7.56 1.037 06 06079 62796 72 35.658 -120.707 -0610260 Culver City Unified Calif. 1.2924 481 3.194 8.431 1.047 06 06037 91527 75 34.005 -118.394 -2926670 Riverview Gardens Mo. -2.5738 481 0.934 4.925 0.798 29 29189 29772 10 38.75 -90.238 -3629280 Uniondale Union Free School District N.Y. 0.6088 481 2.924 7.402 0.896 36 36059 82128 29 40.714 -73.597 -5305760 North Kitsap School District Wash. 0.8058 481 3.913 8.729 0.963 53 53035 74349 50 47.791 -122.592 -4503210 Orangeburg 05 S.C. -2.0816 480 1.543 6.23 0.937 45 45075 28626 41 33.495 -80.853 -4900600 Murray District Utah 0.6946 480 3.157 8.206 1.01 49 49035 76448 65 40.651 -111.896 -0620790 Lakeside Union Elementary Calif. 0.4356 479 2.314 7.336 1.004 06 06073 67031 63 32.908 -116.884 -0904740 Wallingford School District Conn. 0.858 479 4.009 8.554 0.909 09 09009 87411 33 41.459 -72.804 -1739510 Troy CCSD 30C Ill. 0.8018 479 3.115 8.079 0.993 17 17197 81347 59 41.51 -88.186 -3410470 Monroe Township - Williamstown N.J. 0.7674 479 3.839 8.364 0.905 34 34015 92229 31 39.66 -74.972 -3904700 Reynoldsburg City Ohio -0.0898 479 4.233 8.074 0.768 39 39049 58584 7 39.957 -82.799 -1705220 Batavia USD Ill. 1.2234 478 4.693 9.411 0.944 17 17089 109782 43 41.838 -88.319 -5103090 Prince George Co. Public Schools Va. 0.606 478 3.8 8.088 0.857 51 51149 65299 20 37.187 -77.224 -1811970 Valparaiso Community Schools Ind. 0.6432 477 4.619 9.165 0.909 18 18127 80754 33 41.478 -87.075 -5308040 Snoqualmie Valley School District Wash. 1.2854 477 4.342 10.31 1.194 53 53033 100096 97 47.499 -121.657 -2201530 St. John the Baptist Parish La. -1.1021 475 1.951 7.07 1.024 22 22095 41323 69 30.096 -90.537 -3410950 Mount Laurel Township N.J. 1.3399 475 4.484 9.927 1.088 34 34005 107083 84 39.948 -74.905 -3904445 Newark City Ohio -1.1875 475 3.35 8.211 0.972 39 39089 38467 53 40.075 -82.423 -5103810 Tazewell Co. Public Schools Va. -0.3772 475 3.62 7.819 0.84 51 51185 42314 16 37.125 -81.561 -0904950 West Haven School District Conn. -0.1323 474 2.713 7.244 0.906 09 09009 54541 32 41.274 -72.967 -3904484 Strongsville City Ohio 1.3705 474 4.093 9.119 1.005 39 39035 100514 63 41.312 -81.832 -3616680 Lancaster Central School District N.Y. 0.9859 473 4.363 9.177 0.963 36 36029 83364 50 42.911 -78.651 -4107020 Klamath County Ore. -0.5442 473 1.901 7.522 1.124 41 41035 50291 91 42.686 -121.65 -1001620 Smyrna School District Del. 0.4201 472 3.664 7.735 0.814 10 10001 66211 12 39.294 -75.609 -2621180 Lapeer Community Schools Mich. 0.0808 472 3.115 7.568 0.891 26 26087 64634 28 43.032 -83.319 -3612510 Great Neck Union Free School District N.Y. 1.7594 472 5.348 10.32 0.994 36 36059 120084 60 40.793 -73.724 -1710650 Collinsville Ill. -0.1243 471 2.926 7.375 0.89 17 17119 54882 27 38.685 -90.001 -3500300 Carlsbad Municipal Schools N.M. -0.153 471 2.736 6.677 0.788 35 35015 51236 9 32.289 -104.283 -3606870 Central Islip Union Free School District N.Y. -0.1177 471 2.239 5.195 0.591 36 36103 63289 1 40.787 -73.192 -5300810 Camas School District Wash. 1.0782 471 4.11 10.695 1.317 53 53011 91485 100 45.648 -122.372 -1806570 Michigan City Area Schools Ind. -1.2398 470 2.761 7.496 0.947 18 18091 37944 44 41.687 -86.857 -2502670 Billerica Mass. 1.0396 470 4.253 8.963 0.942 25 25017 91738 43 42.559 -71.267 -2510770 Shrewsbury Mass. 1.7546 470 6.439 10.839 0.88 25 25027 118014 25 42.284 -71.715 -3704200 Scotland County Schools N.C. -2.054 470 3.28 7.438 0.832 37 37165 29057 15 34.841 -79.48 -1743330 Woodstock Ill. 0.4146 469 2.764 7.758 0.999 17 17111 74166 61 42.33 -88.453 -1801890 Clark-Pleasant Com Ind. 0.5241 469 3.907 9.06 1.031 18 18081 70363 71 39.583 -86.036 -1805370 Kokomo-Center Twp Con Ind. -1.4615 469 3.298 7.025 0.745 18 18067 38333 5 40.483 -86.136 -2400720 Worcester County Public Schools Md. 0.2707 469 4.783 9.576 0.959 24 24047 64841 48 38.223 -75.375 -4207230 Dallastown Area Pa. 0.8685 469 4.229 9.285 1.011 42 42133 78731 65 39.878 -76.693 -4845540 White Settlement Tex. -0.2438 469 2.884 7.886 1 48 48439 51322 62 32.768 -97.499 -5308670 Sunnyside School District Wash. -1.7956 469 1.642 7.265 1.125 53 53077 36770 91 46.389 -119.997 -0600025 Manhattan Beach Unified Calif. 2.299 468 5.483 10.052 0.914 06 06037 184523 34 33.89 -118.399 -4103480 Corvallis 509J Ore. 0.4649 468 3.493 9.581 1.218 41 41003 67596 98 44.552 -123.292 -4808310 Angleton Tex. -0.1197 468 3.507 8.269 0.952 48 48039 54800 46 29.221 -95.381 -4900510 Logan District Utah 0.1298 468 3.71 7.971 0.852 49 49005 49422 19 41.741 -111.842 -5104080 Wise Co. Public Schools Va. -0.6448 468 3.729 8.758 1.006 51 51195 38055 63 36.974 -82.621 -0403010 Flowing Wells Unified District Ariz. -0.69 466 2.469 7.757 1.058 04 04019 37892 78 32.298 -111.027 -0609940 Cotati-Rohnert Park Unified Calif. 0.5061 466 2.244 6.813 0.914 06 06097 71421 34 38.339 -122.706 -2503150 Brookline Mass. 1.8292 466 5.498 11.349 1.17 25 25021 145832 96 42.324 -71.141 -2801620 Greenville Public Schools Miss. -2.9545 466 1.394 5.785 0.878 28 28151 23657 25 33.406 -91.092 -2930450 Troy R-III Mo. -0.2921 466 2.834 7.637 0.961 29 29113 59017 49 38.987 -91.012 -3610980 Farmingdale Union Free School District N.Y. 1.4758 466 3.936 8.147 0.842 36 36059 108058 17 40.722 -73.438 -4211760 Hempfield Area Pa. 0.7771 466 4.099 9.079 0.996 42 42129 71934 60 40.282 -79.584 -4824030 Huntsville Tex. -0.4606 466 2.74 7.2 0.892 48 48471 40298 28 30.761 -95.584 -5507530 La Crosse School District Wis. 0.0501 465 3.091 8.032 0.988 55 55063 59022 58 43.788 -91.199 -1719290 Hinsdale CCSD Ill. 2.5666 464 5.801 10.93 1.026 17 17043 214874 69 41.798 -87.932 -2506270 Holyoke Mass. -2.4895 464 1.517 6.448 0.986 25 25013 26521 57 42.213 -72.641 -3611550 Freeport Union Free School District N.Y. 0.0392 464 3.604 6.947 0.669 36 36059 68303 2 40.65 -73.583 -3623160 Pittsford Central School District N.Y. 1.9472 464 4.936 10.899 1.192 36 36055 127107 97 43.064 -77.516 -0513410 Van Buren School District Ark. -0.4493 463 2.566 7.396 0.966 05 05033 43488 51 35.439 -94.302 -2506780 Leominster Mass. -0.0818 463 3.965 8.551 0.917 25 25027 63e3 35 42.521 -71.772 -2926640 Ritenour Mo. -0.7311 463 2.565 6.572 0.801 29 29189 44856 10 38.71 -90.368 -3614130 Hempstead Union Free School District N.Y. -1.1915 463 2.764 4.939 0.435 36 36059 44516 1 40.704 -73.624 -4819950 Friendswood Tex. 1.9093 463 4.383 10.271 1.178 48 48167 129579 96 29.504 -95.203 -5510320 Neenah School District Wis. 0.968 463 3.909 9.095 1.037 55 55139 76833 72 44.185 -88.522 -1734410 Rock Island Ill. -0.603 462 1.854 6.587 0.947 17 17161 45476 44 41.463 -90.575 -2501710 Acton-Boxborough Mass. 1.9752 462 5.461 11.499 1.208 25 25017 157192 98 NA NA -3413830 Ridgewood Village N.J. 2.3067 462 5.84 11.261 1.084 34 34003 178282 84 40.982 -74.113 -3616620 Lakeland Central School District N.Y. 1.1129 462 4.074 8.913 0.968 36 36119 104934 51 41.321 -73.869 -2923730 Raymore-Peculiar R-II Mo. 0.8759 461 3.783 8.737 0.991 29 29037 78320 58 38.747 -94.457 -3627300 South Huntington Union Free School District N.Y. 1.2456 461 3.404 8.631 1.045 36 36103 84285 75 40.827 -73.409 -4218930 Perkiomen Valley Pa. 1.2634 461 4.855 9.959 1.021 42 42091 105085 68 40.233 -75.449 -4501830 Colleton S.C. -1.4166 461 1.897 6.358 0.892 45 45029 35341 28 32.873 -80.675 -0640300 Ukiah Unified Calif. -0.5916 460 1.045 6.403 1.072 06 06045 44954 81 39.111 -123.194 -2200180 Beauregard Parish La. -0.3652 460 2.953 6.921 0.794 22 22011 51304 9 30.648 -93.343 -4110710 Douglas County Ore. -0.7221 460 2.146 7.976 1.166 41 41019 49807 95 43.283 -123.484 -1703150 Addison Ill. 0.0855 459 2.438 7.247 0.962 17 17043 57083 49 41.93 -88.003 -1716380 Geneva Ill. 1.733 459 4.598 9.775 1.035 17 17089 127174 72 41.879 -88.342 -2200630 Evangeline Parish La. -1.2242 459 2.526 7.153 0.925 22 22039 39499 37 30.729 -92.406 -2600005 Battle Creek Public Schools Mich. -2.0378 459 1.801 5.678 0.776 26 26025 33450 7 42.332 -85.231 -5101110 Danville City Va. -2.0119 459 2.795 7.202 0.882 51 51590 29218 25 36.583 -79.409 -1703600 Alton Ill. -0.6855 458 2.247 6.658 0.882 17 17119 42439 25 38.948 -90.163 -2733790 St. Michael-Albertville School Dist. Minn. 1.1834 458 4.089 9.563 1.095 27 27171 86728 86 45.221 -93.681 -2802910 Meridian Public School Dist. Miss. -2.6749 458 1.583 5.797 0.843 28 28075 21607 17 32.385 -88.69 -3178660 Westside Community Schools Neb. 0.8809 458 4.221 9.174 0.99 31 31055 71452 58 41.243 -96.053 -3410500 Monroe Township N.J. 1.5881 458 4.56 10.213 1.131 34 34023 126149 92 40.32 -74.429 -5103510 Shenandoah Co. Public Schools Va. 0.2303 458 3.277 7.922 0.929 51 51171 59614 38 38.858 -78.571 -3411490 North Brunswick Township N.J. 0.9713 457 4.134 8.89 0.951 34 34023 89828 46 40.45 -74.48 -3905042 Springboro Community City Ohio 1.5509 457 4.673 9.786 1.023 39 39165 105876 68 39.534 -84.204 -4837740 Roma Tex. -2.102 457 3.22 7.25 0.806 48 48427 24592 11 26.612 -98.902 -5305130 Monroe School District Wash. 1.0178 457 2.796 7.974 1.035 53 53061 87682 72 47.833 -121.972 -0405530 Nogales Unified District Ariz. -1.8868 456 2.344 7.898 1.111 04 04023 27745 88 31.422 -111.15 -1717520 Grayslake CCSD Ill. 1.4017 456 3.611 8.724 1.023 17 17097 97282 68 42.351 -88.057 -3408820 Livingston Township N.J. 2.3079 456 5.222 11.065 1.169 34 34013 156818 95 40.786 -74.329 -0632310 Rescue Union Elementary Calif. 1.3851 455 3.77 9.08 1.062 06 06017 111805 79 38.719 -121.014 -1802830 Zionsville Community Schools Ind. 1.9619 455 4.978 10.372 1.079 18 18011 128390 82 39.997 -86.292 -2102010 Franklin County Ky. -0.213 455 3.181 7.585 0.881 21 21073 53163 25 38.239 -84.877 -2618840 Hudsonville Public School District Mich. 1.3088 455 4.494 9.362 0.974 26 26139 76673 53 42.854 -85.875 -2624150 Monroe Public Schools Mich. -0.5392 455 2.121 7.082 0.992 26 26115 56999 59 41.932 -83.441 -2801860 Hinds Co. School District Miss. -0.3656 455 2.098 6.795 0.939 28 28049 49786 42 32.227 -90.499 -3500390 Central Consolidated Schools N.M. -0.8052 455 1.741 6.93 1.038 35 35045 35500 73 36.478 -108.672 -3904420 Lancaster City Ohio -0.4815 455 3.402 8.395 0.999 39 39045 48076 61 39.712 -82.615 -1711790 Danville CCSD Ill. -1.9614 454 1.915 6.507 0.918 17 17183 32586 35 40.135 -87.617 -2101950 Floyd County Ky. -1.3847 454 3.888 8.03 0.829 21 21071 29553 14 37.557 -82.746 -4819380 Flour Bluff Tex. -0.5589 454 3.14 8.491 1.07 48 48355 48947 80 27.625 -97.335 -0604020 Barstow Unified Calif. -0.5223 453 2.058 6.623 0.913 06 06071 54571 34 35.068 -117.183 -1721900 Lake Zurich Ill. 1.8089 453 4.653 9.61 0.991 17 17097 124721 59 42.2 -88.081 -2503030 Bridgewater-Raynham Mass. 1.0364 453 4.271 9.605 1.067 25 25023 95398 80 41.955 -71.004 -3414640 Sayreville N.J. 0.6961 453 3.869 8.9 1.006 34 34023 75798 63 40.465 -74.325 -4842510 Texas City Tex. -0.3903 453 2.644 7.313 0.934 48 48167 50135 40 29.38 -94.915 -5309100 Tumwater School District Wash. 0.5708 453 4.251 9.686 1.087 53 53067 74566 84 46.956 -122.98 -5400690 Logan County Schools W.Va. -0.7121 453 2.644 6.404 0.752 54 54045 42647 6 37.832 -81.935 -4205490 Central York Pa. 1.1945 452 4.21 9.621 1.082 42 42133 83458 83 40.005 -76.718 -4214580 Manheim Township Pa. 0.9835 452 4.696 9.535 0.968 42 42071 84034 51 40.095 -76.298 -5509510 Middleton-Cross Plains School District Wis. 1.4799 452 4.747 10.388 1.128 55 55025 97649 91 43.116 -89.578 -2504770 Everett Mass. -0.2067 451 3.343 7.907 0.913 25 25017 55282 34 42.406 -71.054 -3300017 Exeter Region Coop School District N.H. 1.6101 451 4.178 10.173 1.199 33 33015 114569 97 NA NA -3401650 Bernards Township N.J. 2.2292 451 5.919 11.445 1.105 34 34035 184451 88 40.677 -74.568 -3904875 Huber Heights City Ohio 0.4597 451 3.437 7.464 0.805 39 39113 65589 11 39.855 -84.115 -5305400 Mount Vernon School District Wash. -0.3574 451 2.244 7.828 1.117 53 53057 51148 90 48.419 -122.352 -3703630 Person County Schools N.C. -0.6811 450 3.612 7.746 0.827 37 37145 46538 14 36.39 -78.972 -4105160 Forest Grove Ore. -0.711 450 2.278 7.555 1.056 41 41067 52357 77 45.559 -123.259 -4701290 Franklin County School Distrct Tenn. -0.3469 450 2.766 7.058 0.858 47 47051 48605 20 35.155 -86.092 -0901860 Hamden School District Conn. 0.8518 449 3.17 7.915 0.949 09 09009 85076 45 41.396 -72.922 -1201830 Suwannee Fla. -0.7256 449 3.252 6.945 0.738 12 12121 41293 5 30.196 -82.991 -2201410 St. Bernard Parish La. -0.8135 449 2.956 7.727 0.954 22 22087 36666 47 29.871 -89.664 -3401830 Bloomfield Township N.J. 0.6813 449 4.184 8.324 0.828 34 34013 70752 14 40.81 -74.187 -4226580 Wilson Pa. 0.7375 449 4.72 9.712 0.998 42 42011 70687 61 40.328 -76.035 -0600065 Dinuba Unified Calif. -1.043 448 1.86 6.127 0.853 06 06107 38584 19 36.517 -119.393 -1802880 School City of East Chicago Ind. -2.5077 448 2.645 5.887 0.648 18 18089 27500 2 41.641 -87.46 -3703540 Pasquotank County Schools N.C. -0.6865 448 2.9 6.9 0.8 37 37139 45114 10 36.314 -76.309 -4102040 Bethel Ore. -0.4037 448 2.854 7.395 0.908 41 41039 55070 32 44.098 -123.208 -4503030 Newberry S.C. -0.7378 448 2.024 7.364 1.068 45 45071 42434 80 34.29 -81.6 -5510830 Oak Creek-Franklin School District Wis. 0.9641 448 3.355 8.634 1.056 55 55079 89801 77 42.88 -87.91 -0101830 Jackson County Ala. -0.4012 447 3.106 7.174 0.814 01 01071 45865 12 34.779 -85.999 -1305430 Ware County Ga. -0.6796 447 3.089 7.864 0.955 13 13299 43304 47 31.054 -82.424 -2005580 Dodge City Kan. 0.1352 447 2.915 6.526 0.722 20 20057 50625 4 37.751 -100.003 -3603870 Baldwinsville Central School District N.Y. 0.9129 447 3.912 8.75 0.968 36 36067 76054 51 43.168 -76.361 -3703120 Mooresville City Schools N.C. 0.1445 447 4.271 8.874 0.921 37 37097 60652 36 35.575 -80.787 -0805820 Lewis-Palmer Consolidated, School District No. 38, In The Co Colo. 1.9078 446 4.809 9.87 1.012 08 08041 126875 65 39.082 -104.858 -0905040 Westport School District Conn. 2.3049 446 5.436 10.883 1.089 09 09001 201946 85 41.135 -73.346 -2509360 Peabody Mass. 0.6402 446 4.265 8.381 0.823 25 25009 81465 13 42.534 -70.972 -3500030 Alamogordo Public Schools N.M. 0.0089 446 2.85 7.873 1.005 35 35035 48982 63 32.389 -105.748 -3904985 Jackson Local Ohio 1.2181 446 4.875 10.346 1.094 39 39151 86718 86 40.866 -81.484 -3408610 Linden N.J. -0.08 445 2.649 7.395 0.949 34 34039 57083 45 40.625 -74.238 -4809200 Azle Tex. -0.1034 445 3.39 7.79 0.88 48 48439 62213 25 32.884 -97.564 -0406730 Prescott Unified District Ariz. 0.3759 444 3.31 8.822 1.102 04 04025 59218 87 34.563 -112.484 -4020970 Muskogee Okla. -1.5133 444 2.506 6.951 0.889 40 40101 29898 27 35.725 -95.391 -0614790 Galt Joint Union Elementary Calif. 0.0953 442 2.538 7.375 0.967 06 06067 63848 51 38.256 -121.314 -2502190 Attleboro Mass. 0.5174 442 4.42 9.177 0.951 25 25005 83556 46 41.931 -71.295 -2618480 Holt Public Schools Mich. 0.3262 442 3.347 7.753 0.881 26 26065 65473 25 42.644 -84.578 -3414670 Scotch Plains-Fanwood N.J. 1.8551 442 5.004 10.553 1.11 34 34039 141014 88 40.634 -74.375 -3621570 Oceanside Union Free School District N.Y. 1.7107 442 4.512 8.653 0.828 36 36059 115376 14 40.631 -73.649 -4702520 Loudon County School District Tenn. 0.1159 441 2.442 8.462 1.204 47 47105 49582 98 35.735 -84.311 -1712000 Dekalb Ill. 0.2821 440 3.155 7.631 0.895 17 17037 66953 29 41.917 -88.798 -2801710 Gulfport School Dist. Miss. -0.9929 440 3.368 7.178 0.762 28 28047 38999 6 30.388 -89.066 -3705040 Yadkin County Schools N.C. -0.089 440 3.318 8.083 0.953 37 37197 47500 46 36.161 -80.665 -3904493 Upper Arlington City Ohio 1.887 440 4.297 10.625 1.265 39 39049 125412 100 40.027 -83.071 -3904993 Plain Local Ohio -0.0857 440 3.815 9.013 1.04 39 39151 58268 73 40.861 -81.359 -2502940 Braintree Mass. 0.799 439 4.928 10.565 1.127 25 25021 96349 91 42.204 -71.002 -3200360 Nye County School District Nev. -0.856 439 2.195 6.962 0.953 32 32023 49999 46 38.042 -116.472 -4205190 Centennial Pa. 0.9652 439 3.702 8.56 0.972 42 42017 90325 52 40.192 -75.07 -2918690 Lindbergh R-VIII Mo. 1.1568 438 5.18 9.879 0.94 29 29189 85866 42 38.53 -90.395 -2931440 Waynesville R-VI Mo. 0.337 438 3.418 8.288 0.974 29 29169 58571 53 37.764 -92.155 -4220100 Red Lion Area Pa. 0.6001 438 3.483 8.821 1.068 42 42133 72845 80 39.863 -76.495 -0625320 Monrovia Unified Calif. 0.3765 437 2.587 7.763 1.035 06 06037 63994 72 34.165 -117.999 -0630030 Patterson Joint Unified Calif. -0.0776 437 1.844 6.033 0.838 06 06099 62500 16 37.456 -121.356 -3604080 Bay Shore Union Free School District N.Y. 0.8384 437 3.397 8.177 0.956 36 36103 88999 47 40.72 -73.258 -4502610 Laurens 55 S.C. -0.6433 437 2.21 7.194 0.997 45 45059 44666 60 34.522 -82.082 -2707200 Buffalo Public School District Minn. 0.9266 436 3.998 9.076 1.016 27 27171 81545 66 45.149 -93.813 -3400960 Atlantic City N.J. -1.7602 436 2.416 6.91 0.899 34 34001 33146 29 39.388 -74.471 -4401200 Woonsocket R.I. -1.3882 436 2.389 6.457 0.814 44 44007 36296 12 42.001 -71.499 -0805790 Montrose County School District Re-1J Colo. 0.0419 435 3.358 8.06 0.94 08 08085 48537 42 38.439 -107.968 -2003200 Auburn Washburn Kan. 1.2685 435 4.459 9.262 0.961 20 20177 84770 49 38.953 -95.791 -2507320 Marlborough Mass. 0.6993 435 4.122 9.268 1.029 25 25017 76516 70 42.349 -71.547 -2922530 Nixa R-II Mo. 0.4462 435 4.136 9.539 1.08 29 29043 60900 83 37.03 -93.322 -0631710 Ramona City Unified Calif. 0.7182 434 2.761 7.767 1.001 06 06073 78373 62 33.036 -116.833 -1304440 Rome City Ga. -1.0575 434 2.644 7.941 1.059 13 13115 37454 78 34.268 -85.188 -1602670 Post Falls District Idaho -0.3861 434 3.386 8.151 0.953 16 16055 47321 46 47.699 -116.958 -0605880 Brea-Olinda Unified Calif. 1.0845 433 3.771 8.87 1.02 06 06059 92417 68 33.929 -117.848 -0100006 Marshall County Ala. -0.2497 432 2.889 7.106 0.843 01 01095 46291 17 34.377 -86.314 -0632040 Redding Elementary Calif. -0.7528 432 2.418 7.704 1.057 06 06089 50555 78 40.553 -122.401 -3623010 Pine Bush Central School District N.Y. 0.8592 432 3.588 7.343 0.751 36 36071 83685 5 41.584 -74.357 -3904421 Lebanon City Ohio 0.4548 432 4.055 9.368 1.063 39 39165 75885 79 39.44 -84.213 -4901110 Wasatch District Utah 1.0648 432 3.356 8.578 1.044 49 49051 70435 74 40.33 -111.168 -0404320 Liberty Elementary District Ariz. 0.6147 431 2.386 7.822 1.087 04 04013 75744 84 33.272 -112.427 -0508040 West Memphis School District Ark. -3.0704 431 3.039 6.607 0.714 05 05035 22388 3 35.102 -90.271 -4202590 Armstrong Pa. -0.1304 431 3.732 8.176 0.889 42 42005 51464 27 40.802 -79.421 -4818540 Ennis Tex. -0.601 431 3.11 7.594 0.897 48 48139 43361 29 32.318 -96.58 -4824100 Hutto Tex. 0.3109 431 2.513 8.041 1.106 48 48491 60968 88 30.556 -97.54 -4830250 Mercedes Tex. -2.4998 431 1.789 6.748 0.992 48 48215 23187 59 26.147 -97.894 -1200600 Gadsden Fla. -1.7151 430 2.901 6.461 0.712 12 12039 29622 3 30.579 -84.614 -4211670 Haverford Township Pa. 1.7017 430 4.9 10.115 1.043 42 42045 98872 74 39.987 -75.316 -4700420 Campbell County School Distrct Tenn. -0.8376 430 1.968 6.883 0.983 47 47013 39744 56 36.404 -84.149 -4700510 Carter County School District Tenn. -0.8071 430 2.254 7.008 0.951 47 47019 43204 46 36.291 -82.124 -2200810 Jefferson Davis Parish La. -0.4667 429 3.2 7.156 0.791 22 22053 52187 9 30.268 -92.814 -2200990 Lincoln Parish La. -1.1093 429 2.215 7.466 1.05 22 22061 42656 76 32.602 -92.665 -2512630 Westfield Mass. 0.2378 429 4.003 8.195 0.838 25 25013 71412 16 42.138 -72.756 -2636630 School District of Ypsilanti Mich. -1.4124 429 1.75 6.732 0.996 26 26161 37500 60 42.249 -83.627 -2803360 Ocean Springs School Dist. Miss. 0.5912 429 3.422 7.83 0.882 28 28059 72532 25 30.396 -88.746 -3604870 Binghamton City School District N.Y. -1.5722 429 2.433 6.552 0.824 36 36007 30933 14 42.101 -75.909 -4105910 Grants Pass Ore. -0.746 429 3.161 7.972 0.962 41 41033 49166 49 42.429 -123.345 -4812780 Canutillo Tex. -0.594 429 2.713 7.563 0.97 48 48141 37388 52 31.932 -106.546 -4815330 Corsicana Tex. -0.9756 429 2.994 7.462 0.894 48 48349 36170 28 32.042 -96.452 -5309450 Walla Walla School District Wash. -0.6163 429 2.543 7.529 0.997 53 53071 43942 60 46.101 -118.333 -5605302 Sweetwater County School District #1 Wyo. 0.6041 429 2.921 8.109 1.038 56 56037 77336 72 41.816 -108.594 -1300210 Baldwin County Ga. -0.9103 428 2.332 6.267 0.787 13 13009 39999 8 33.069 -83.25 -1804710 Huntington Co Com Ind. -0.0796 428 3.437 8.878 1.088 18 18069 55061 84 40.829 -85.488 -2009180 Manhattan-Ogden Kan. 0.8022 428 3.893 9.27 1.075 20 20161 61926 82 39.133 -96.557 -3418060 Winslow Township N.J. 0.5665 428 2.83 7.097 0.853 34 34007 76420 19 39.703 -74.903 -4217370 Northampton Area Pa. 0.902 428 3.956 8.337 0.876 42 42095 74337 24 40.754 -75.467 -1743960 Yorkville Ill. 1.1632 427 3.606 8.149 0.908 17 17093 87500 32 41.617 -88.433 -0407300 Sahuarita Unified District Ariz. 0.8264 426 3.05 8.119 1.014 04 04019 74249 66 31.814 -111.135 -0636990 Solana Beach Elementary Calif. 2.0656 426 5.136 10.821 1.137 06 06073 144753 92 32.99 -117.24 -1710470 CCSD 93 Ill. 0.4771 426 3.694 8.737 1.009 17 17043 74999 64 41.934 -88.129 -1726310 Minooka CCSD Ill. 0.9342 426 3.869 8.55 0.936 17 17063 85975 41 41.479 -88.298 -3407890 Kearny N.J. 0.0355 426 3.14 8.082 0.988 34 34017 60369 58 40.753 -74.12 -4003630 Bartlesville Okla. 0.1944 426 3.921 8.828 0.981 40 40147 60802 55 36.718 -95.903 -0400790 Apache Junction Unified District Ariz. -0.0973 425 2.306 7.242 0.987 04 04021 52337 57 33.379 -111.425 -1303150 Jones County Ga. -0.0887 425 2.954 7.674 0.944 13 13169 52712 43 33.025 -83.561 -1741550 West Chicago ESD Ill. 0.2551 425 1.474 7.405 1.186 17 17043 58586 97 41.874 -88.212 -2616470 Grandville Public Schools Mich. 0.8233 425 4.161 8.858 0.939 26 26081 77425 42 42.925 -85.779 -4219290 Pleasant Valley Pa. 0.6939 425 3.603 8.107 0.901 42 42089 70796 30 40.912 -75.436 -5309180 University Place School District Wash. 0.3019 425 3.994 9.451 1.091 53 53053 65755 85 47.218 -122.545 -0904050 Shelton School District Conn. 1.1514 424 4.116 9.349 1.047 09 09001 98265 75 41.306 -73.138 -2508370 Needham Mass. 2.0901 424 5.322 11.133 1.162 25 25021 152812 95 42.281 -71.241 -3904379 Cleveland Heights-University Heights City Ohio -0.1895 424 2.538 6.919 0.876 39 39035 61907 24 41.507 -81.558 -3904439 Miamisburg City Ohio 0.337 424 3.966 8.59 0.925 39 39113 63607 37 39.629 -84.268 -0635090 San Rafael City Elementary Calif. 0.5933 423 2.601 7.366 0.953 06 06041 47e3 46 37.981 -122.483 -0403990 J O Combs Unified School District Ariz. 0.4032 422 2.401 7.526 1.025 04 04021 68333 69 33.25 -111.485 -0631860 Ravenswood City Elementary Calif. -0.2613 422 1.14 5.589 0.89 06 06081 53879 27 37.486 -122.136 -1721270 Kirby Ill. 1.1166 422 3.78 8.836 1.011 17 17031 91937 65 41.578 -87.827 -2611430 Davison Community Schools Mich. 0.1289 422 3.861 8.404 0.908 26 26049 67411 32 43.028 -83.513 -4844430 Waller Tex. -0.228 422 3.295 8.153 0.972 48 48473 49068 52 30.082 -95.898 -5101620 Gloucester Co. Public Schools Va. 0.7852 422 3.926 8.384 0.891 51 51073 63922 28 37.435 -76.542 -5506690 Hudson School District Wis. 1.1916 422 4.155 9.535 1.076 55 55109 101308 82 44.992 -92.703 -0804260 Roaring Fork School District No. Re-1 Colo. 0.8715 421 3.655 7.999 0.869 08 08045 70299 22 39.391 -107.1 -2509630 Pittsfield Mass. -0.4409 421 3.963 8.173 0.842 25 25003 48719 17 42.452 -73.261 -2636660 Zeeland Public Schools Mich. 0.4254 421 3.173 8.72 1.109 26 26139 68624 88 42.847 -85.995 -4835070 Plainview Tex. -0.6739 421 2.712 7.268 0.911 48 48189 37031 33 34.19 -101.746 -0902910 Newtown School District Conn. 1.8519 420 5.227 10.099 0.974 09 09001 130077 53 41.399 -73.293 -2923430 Ozark R-VI Mo. 0.7387 420 3.902 8.734 0.966 29 29043 63068 51 36.989 -93.197 -3302610 Derry School District N.H. 0.5997 420 4.228 8.531 0.861 33 33015 82628 20 42.889 -71.28 -3904499 Warren City Ohio -2.2562 419 1.347 5.862 0.903 39 39155 28888 31 41.234 -80.82 -4829160 Marshall Tex. -0.8991 419 2.199 6.765 0.913 48 48203 41111 34 32.518 -94.355 -5513170 D C Everest Area School District Wis. 0.8042 419 3.611 8.576 0.993 55 55073 70086 59 44.916 -89.48 -0608190 Charter Oak Unified Calif. 0.4552 418 2.89 7.427 0.907 06 06037 74499 32 34.1 -117.855 -1201140 Levy Fla. -1.1273 418 3.084 7.224 0.828 12 12075 37926 14 29.323 -82.736 -1718570 Hawthorn CCSD Ill. 1.4615 418 4.311 9.583 1.054 17 17097 97180 77 42.246 -87.957 -3405730 Galloway Township N.J. 0.7055 418 3.193 8.754 1.112 34 34001 77102 89 39.49 -74.474 -0903810 Ridgefield School District Conn. 2.3809 417 5.427 10.659 1.047 09 09001 191944 75 41.306 -73.502 -1742600 Wilmette Ill. 2.5197 417 5.363 11.069 1.141 17 17031 189333 93 42.076 -87.724 -4215290 Mifflin County Pa. -0.1799 417 3.382 7.435 0.81 42 42087 49541 12 40.637 -77.59 -5302310 Eastmont School District Wash. 0.0074 417 3.158 7.933 0.955 53 53017 54313 47 47.453 -120.184 -0638980 Temple City Unified Calif. 0.6133 416 4.235 9.483 1.049 06 06037 72812 76 34.108 -118.065 -1601770 Kuna Joint District Idaho 0.6451 416 2.652 7.893 1.048 16 16001 59999 75 43.392 -116.36 -3700090 Alexander County Schools N.C. -0.262 416 3.843 7.736 0.778 37 37003 51231 8 35.921 -81.177 -0621330 Lemon Grove Calif. -0.2695 415 1.844 6.707 0.973 06 06073 54047 53 32.735 -117.037 -2612450 East Detroit Public Schools Mich. -1.4104 415 1.515 4.782 0.654 26 26099 42906 2 42.466 -82.957 -3904872 Northmont City Ohio 0.6829 415 4.13 8.621 0.898 39 39113 65209 29 39.884 -84.354 -0508280 Jonesboro School District Ark. -1.472 414 2.579 6.898 0.864 05 05031 34654 21 35.862 -90.714 -1706090 Berwyn South Ill. -0.2669 414 2.508 7.061 0.911 17 17031 54367 33 41.836 -87.791 -2721420 Moorhead Public School District Minn. 0.5238 414 3.314 8.854 1.108 27 27027 65386 88 46.895 -96.725 -3413650 Randolph Township N.J. 2.2205 414 4.709 10.555 1.169 34 34027 191192 95 40.843 -74.582 -5310140 Yelm School District Wash. 0.4093 414 3.844 8.21 0.873 53 53067 70199 23 46.869 -122.521 -2512660 Westford Mass. 1.9598 413 5.808 11.999 1.238 25 25017 137840 99 42.586 -71.44 -4220370 Ridley Pa. 0.3321 413 3.261 8.05 0.958 42 42045 70576 48 39.879 -75.329 -4702670 Marshall County School Distrct Tenn. -0.5896 413 2.3 8.051 1.15 47 47117 51186 94 35.469 -86.765 -0634425 San Gabriel Unified Calif. 0.5307 412 3.194 8.011 0.963 06 06037 65625 50 34.1 -118.096 -0901470 Enfield School District Conn. 0.6156 412 4.132 8.045 0.783 09 09003 80460 8 41.984 -72.555 -2503540 Chelsea Mass. -1.4703 412 3.217 7.084 0.773 25 25025 34506 7 42.396 -71.032 -2632340 Southgate Community School District Mich. 0.3123 412 2.869 7.063 0.839 26 26163 64205 16 42.206 -83.206 -4219890 Quakertown Community Pa. 1.046 412 4.898 9.482 0.917 42 42017 80383 35 40.449 -75.342 -0903120 Norwich School District Conn. -0.4894 411 2.228 6.754 0.905 09 09011 54740 31 41.549 -72.088 -5101770 Halifax Co. Public Schools Va. -0.9397 411 3.539 7.182 0.729 51 51083 39549 4 36.767 -78.937 -2201860 Washington Parish La. -1.6402 410 2.054 6.934 0.976 22 22117 34027 54 30.854 -90.043 -2636570 Wyoming Public Schools Mich. -1.0294 410 2.754 7.038 0.857 26 26081 39148 20 42.899 -85.707 -2606090 Bloomfield Hills School District Mich. 1.7872 409 4.838 9.908 1.014 26 26125 132932 66 42.58 -83.278 -2630090 Romeo Community Schools Mich. 0.2068 409 2.796 8.303 1.101 26 26099 81346 87 42.794 -83.029 -5506630 Howard-Suamico School District Wis. 0.825 409 4.205 9.438 1.046 55 55009 83692 75 44.614 -88.078 -0627450 Norris Elementary Calif. 1.3077 408 3.199 7.88 0.936 06 06029 91103 41 35.432 -119.119 -0636800 Sierra Sands Unified Calif. -0.1248 408 2.432 7.139 0.941 06 06029 56011 42 35.562 -117.777 -2101200 Clark County Ky. -0.505 408 3.144 8.146 1 21 21049 51417 62 37.971 -84.147 -2503510 Chelmsford Mass. 1.5328 408 5.198 10.658 1.092 25 25017 124805 85 42.6 -71.363 -3004560 Bozeman Elem. Mont. 0.9899 408 4.593 9.561 0.994 30 30031 76236 59 45.702 -111.047 -3625170 Rush-Henrietta Central School District N.Y. 0.8369 408 3.915 8.991 1.015 36 36055 74099 66 43.032 -77.653 -4702820 Mcminn County School District Tenn. -0.2534 408 2.072 7.919 1.169 47 47107 48238 95 35.425 -84.617 -3412870 Pennsauken Township N.J. 0.0977 407 2.618 7.802 1.037 34 34007 61188 72 39.965 -75.057 -3904419 Lakewood City Ohio -0.5539 407 3.625 8.491 0.973 39 39035 46041 53 41.482 -81.801 -0606570 Burton Elementary Calif. 0.1003 406 2.195 6.143 0.79 06 06107 61534 9 36.082 -119.074 -1200750 Hardee Fla. -1.1239 406 3.554 6.501 0.589 12 12049 37857 1 27.493 -81.81 -2923700 Pattonville R-III Mo. 0.1481 406 3.681 7.966 0.857 29 29189 59673 20 38.733 -90.435 -3904483 Stow-Munroe Falls City Ohio 1.0128 406 4.174 9.226 1.01 39 39153 87718 65 41.174 -81.433 -3904547 Marysville Exempted Village Ohio 0.8277 406 3.908 9.181 1.055 39 39159 78483 77 40.288 -83.406 -3910000 Findlay City Ohio -0.1764 406 3.526 8.628 1.02 39 39063 49935 68 41.032 -83.614 -4113530 Woodburn Ore. -0.787 406 0.852 6.497 1.129 41 41047 48026 91 45.144 -122.858 -3405190 Flemington-Raritan Region N.J. 1.4194 405 4.837 10.354 1.104 34 34019 13e4 87 40.507 -74.866 -3410590 Montgomery Township N.J. 2.3026 405 4.923 11.625 1.34 34 34035 178636 100 40.426 -74.678 -4501530 Chester 01 S.C. -1.8048 405 1.686 6.529 0.969 45 45023 33333 51 34.692 -81.16 -0101620 Gadsden City Ala. -1.7193 404 2.144 6.32 0.835 01 01055 29778 15 34.009 -86.015 -0605790 Brawley Elementary Calif. -1.3521 404 1.674 6.453 0.956 06 06025 49890 47 32.994 -115.559 -3621000 North Colonie CSD N.Y. NA 404 3.682 10.036 1.271 36 36001 NA 100 NA NA -3621900 Orchard Park Central School District N.Y. 1.5631 404 4.542 9.377 0.967 36 36029 99667 51 42.742 -78.736 -0401500 Bullhead City School District Ariz. -2.0604 403 1.831 7.458 1.125 04 04015 30517 91 35.362 -114.533 -2704440 Bemidji Public School District Minn. 0.126 403 3.284 8.815 1.106 27 27007 59716 88 47.523 -94.925 -3702430 Kannapolis City Schools N.C. -1.2112 403 2.99 7.008 0.804 37 37025 39347 11 35.495 -80.616 -5300240 Arlington School District Wash. 0.6782 403 3.44 9.158 1.144 53 53061 76562 93 48.218 -122.047 -1301710 Decatur County Ga. -1.1343 402 2.941 6.622 0.736 13 13087 36812 4 30.878 -84.579 -1305550 Wayne County Ga. -0.5841 402 2.469 6.915 0.889 13 13305 42155 27 31.551 -81.917 -1706480 Bloomington Ill. 0.2676 402 3.612 7.556 0.789 17 17113 63117 9 40.477 -88.973 -4222860 Stroudsburg Area Pa. 0.8219 402 3.704 8.638 0.987 42 42089 74619 57 40.964 -75.253 -1304890 Thomas County Ga. -0.5424 401 2.966 6.649 0.737 13 13275 44051 5 30.864 -83.919 -3404320 East Windsor Regional N.J. 1.086 401 3.957 9.589 1.126 34 34021 98280 91 40.261 -74.529 -3614340 Hicksville Union Free School District N.Y. 1.1272 401 4.047 8.839 0.958 36 36059 96614 48 40.763 -73.525 -3904475 Shaker Heights City Ohio 0.6646 401 4.696 8.491 0.759 39 39035 76059 6 41.475 -81.552 -1600660 Cassia County Joint District Idaho 0.1178 400 3.039 7.642 0.92 16 16031 46887 36 42.269 -113.593 -3405760 Garfield N.J. -0.5314 400 3.464 8.458 0.999 34 34003 48263 61 40.879 -74.108 -3630690 West Islip Union Free School District N.Y. 1.3714 400 3.792 8.825 1.007 36 36103 109488 64 40.709 -73.298 -4028680 Stillwater Okla. 0.5746 400 3.217 9.257 1.208 40 40119 59399 98 36.125 -97.082 -4217940 Norwin Pa. 1.1031 400 4.728 9.668 0.988 42 42129 81287 58 40.329 -79.733 -4218270 Owen J Roberts Pa. 1.3592 400 4.551 10.023 1.094 42 42029 104690 86 40.168 -75.679 -4226390 William Penn Pa. -1.1695 399 1.582 6.292 0.942 42 42045 43350 43 39.93 -75.266 -4701260 Franklin City Elementary Tenn. 0.6104 399 4.144 9.121 0.996 47 47187 70808 60 35.925 -86.854 -5305940 Oak Harbor School District Wash. 0.124 399 3.201 8.315 1.023 53 53029 52019 68 48.326 -122.634 -1806510 M S D Martinsville Schools Ind. -0.2335 398 3.713 8.143 0.886 18 18109 59084 26 39.438 -86.442 -2502310 Barnstable Mass. 0.7142 398 4.831 8.726 0.779 25 25001 74249 8 41.668 -70.361 -2618420 Holland City School District Mich. -0.1276 398 2.783 7.783 1 26 26139 49673 61 42.773 -86.122 -3500690 Deming Public Schools N.M. -1.9633 398 1.064 6.289 1.045 35 35029 25380 75 32.183 -107.75 -3603840 Baldwin Union Free School District N.Y. 1.3474 398 4.177 7.916 0.748 36 36059 106673 5 40.653 -73.608 -4216110 Mt Lebanon Pa. 1.9324 398 5.064 10.799 1.147 42 42003 122029 93 40.375 -80.049 -4226460 Williamsport Area Pa. -0.659 398 3.3 8.234 0.987 42 42081 43683 57 41.33 -77.072 -4400330 East Providence R.I. -0.01 398 2.992 7.886 0.979 44 44007 62599 55 41.801 -71.358 -0639630 Travis Unified Calif. 0.9833 397 2.45 8.173 1.144 06 06095 85648 93 38.281 -121.918 -1719500 Homer CCSD 33C Ill. 1.3461 397 3.678 9.258 1.116 17 17197 96846 89 41.591 -87.958 -3904486 Sycamore Community City Ohio 1.4685 397 5.516 10.547 1.006 39 39061 116627 63 39.252 -84.356 -4818060 Edcouch-Elsa Tex. -2.4791 397 2.083 6.631 0.91 48 48215 27307 33 26.283 -97.965 -4818810 Everman Tex. -1.1605 397 2.503 7.038 0.907 48 48439 41827 32 32.624 -97.281 -5102010 Isle of Wight Co. Public Schools Va. 0.4934 397 3.871 8.396 0.905 51 51093 63197 31 36.891 -76.726 -2504890 Fitchburg Mass. -0.7412 396 2.876 7.547 0.934 25 25027 50673 40 42.591 -71.816 -2802730 Lowndes Co. School District Miss. -0.5419 396 3.053 7.582 0.906 28 28087 43499 31 33.466 -88.446 -4214250 Methacton Pa. 1.7758 396 5.021 9.932 0.982 42 42091 123324 56 40.17 -75.389 -4218630 Penn Manor Pa. 0.9104 396 3.4 9.071 1.134 42 42071 70215 92 39.943 -76.365 -4700690 Cleveland City School District Tenn. -0.7904 396 2.542 7.814 1.054 47 47011 42619 77 35.182 -84.871 -0405670 Osborn Elementary District Ariz. -1.844 395 1.296 7.382 1.217 04 04013 27037 98 33.496 -112.078 -1720760 Kankakee Ill. -1.8454 395 2.273 6.168 0.779 17 17091 33172 8 41.099 -87.814 -1738220 Summit Hill Ill. 1.3893 395 4.081 8.681 0.92 17 17197 102308 36 41.532 -87.82 -2607620 Caledonia Community Schools Mich. 1.1613 395 4.078 9.129 1.01 26 26081 80331 65 42.814 -85.509 -3700390 Bladen County Schools N.C. -1.3909 395 2.759 6.545 0.757 37 37017 36207 6 34.614 -78.563 -3904829 Austintown Local Ohio -0.0866 395 3.556 8.203 0.929 39 39099 56983 39 41.097 -80.761 -4807800 Alice Tex. -0.9875 395 2.185 6.496 0.862 48 48249 38306 21 27.823 -98.109 -0607740 Castaic Union Elementary Calif. 1.0699 394 2.741 7.896 1.031 06 06037 87239 71 34.532 -118.649 -0613080 Eureka Union Calif. 1.7805 394 4.038 9.223 1.037 06 06061 133173 72 38.738 -121.187 -1716800 Glen Ellyn Ill. 1.5184 394 4.789 10.092 1.061 17 17043 116454 78 41.885 -88.062 -2400180 Caroline County Public Schools Md. 0.1231 394 3.499 8.46 0.992 24 24011 62403 59 38.872 -75.832 -2630660 Saline Area Schools Mich. 1.667 394 4.615 9.921 1.061 26 26161 112752 78 42.164 -83.818 -3611670 Frontier Central School District N.Y. 0.973 394 4.172 9.132 0.992 36 36029 78738 59 42.749 -78.879 -4111290 Sherwood 88J Ore. 1.2995 394 4.041 9.621 1.116 41 41067 102551 89 45.354 -122.846 -4702700 Maryville City School District Tenn. 0.3194 394 4.13 9.474 1.069 47 47009 71103 80 35.747 -83.977 -5103870 Warren Co. Public Schools Va. 0.5564 394 3.201 8.13 0.986 51 51187 68193 57 38.909 -78.207 -5309720 West Valley School District (Yakima) Wash. 0.5784 394 3.613 8.363 0.95 53 53077 69731 45 46.543 -121.015 -2614820 Fraser Public Schools Mich. -0.0515 393 3.65 7.792 0.828 26 26099 65759 14 42.546 -82.948 -1729760 O Fallon CCSD Ill. 0.8887 392 4.052 8.799 0.95 17 17163 86500 45 38.616 -89.902 -1807860 North Lawrence Com. Schools Ind. -0.305 392 3.352 7.739 0.877 18 18093 41951 24 38.888 -86.471 -2512270 Wellesley Mass. 2.1715 392 5.427 11.075 1.13 25 25021 200376 91 42.304 -71.285 -4004500 Bixby Okla. 1.4283 392 3.392 9.429 1.208 40 40143 93055 98 35.939 -95.877 -4836000 Prosper Tex. 1.8248 392 4.084 10.179 1.219 48 48085 115517 98 33.243 -96.789 -0637560 South Whittier Elementary Calif. 0.0254 391 1.644 6.258 0.923 06 06037 55603 37 33.933 -118.046 -2600016 Crestwood School District Mich. -0.1211 391 2.654 7.777 1.025 26 26163 54473 69 42.336 -83.294 -2916770 Kirkwood R-VII Mo. 1.5573 391 5.13 9.83 0.94 29 29189 101491 42 38.587 -90.42 -0612810 Enterprise Elementary Calif. -0.9888 390 2.477 7.296 0.964 06 06089 37934 50 40.567 -122.342 -1706510 Cook County Ill. -1.2933 390 2.033 6.999 0.993 17 17031 46125 59 41.657 -87.714 -2006540 Goddard Kan. 1.1452 390 4.307 9.479 1.034 20 20173 82684 71 37.64 -97.54 -2604470 Bedford Public Schools Mich. 0.8145 390 3.615 8.349 0.947 26 26115 81690 44 41.776 -83.593 -0402530 Douglas Unified District Ariz. -1.5075 389 1.126 6.454 1.066 04 04003 29021 79 31.441 -109.325 -0512060 Russellville School District Ark. -0.4472 389 3.596 7.845 0.85 05 05115 47241 18 35.316 -93.164 -1920130 Muscatine Comm School District Iowa -0.3169 389 4.078 7.204 0.625 19 19139 55e3 1 41.455 -91.047 -2800630 Biloxi Public School Dist. Miss. -0.4013 389 3.262 8.06 0.96 28 28047 48124 48 30.418 -88.952 -3613080 Guilderland Central School District N.Y. 1.4503 389 4.446 9.594 1.029 36 36001 99776 70 42.707 -73.955 -3904387 Delaware City Ohio 0.5065 389 4.061 8.47 0.882 39 39041 68965 25 40.318 -83.07 -4400210 Coventry R.I. 0.483 389 4.024 8.538 0.903 44 44003 81730 30 41.693 -71.661 -4503810 York 01 S.C. -0.8088 389 2.302 7.908 1.121 45 45091 44511 90 34.947 -81.31 -1809510 Richmond Community Schools Ind. -1.3112 388 2.778 7.819 1.008 18 18177 42500 64 39.814 -84.874 -2100081 Muhlenberg County Ky. -0.5565 388 3.83 8.078 0.85 21 21177 44354 18 37.216 -87.142 -2200039 Zachary Community School District La. 0.3819 388 3.961 9.008 1.009 22 22033 67636 64 30.647 -91.204 -3618120 Mahopac Central School District N.Y. 1.6898 388 3.897 8.522 0.925 36 36079 125858 37 41.381 -73.741 -4106300 Hermiston Ore. -0.5182 388 2.022 7.909 1.177 41 41059 49166 96 45.864 -119.22 -4207530 Delaware Valley Pa. 0.4399 388 4.973 8.889 0.783 42 42103 64638 8 41.337 -74.891 -4225950 Wyoming Valley West Pa. -0.3684 388 3.346 6.9 0.711 42 42079 50534 3 41.272 -75.908 -0600062 Oakdale Joint Unified Calif. 0.2294 387 2.791 7.16 0.874 06 06099 69937 23 37.755 -120.778 -0635730 Santa Paula Elementary Calif. -0.9653 387 2.072 6.829 0.951 06 06111 41250 46 34.366 -119.073 -3408220 Lakewood Township N.J. -0.9823 387 2.341 5.926 0.717 34 34029 41067 4 40.077 -74.203 -4210590 Garnet Valley Pa. 1.8133 387 5.078 9.995 0.983 42 42045 144470 56 39.869 -75.503 -4821720 Greenville Tex. -0.9489 387 2.282 7.411 1.026 48 48231 35128 69 33.135 -96.092 -2508730 North Attleborough Mass. 0.9303 386 4.862 9.8 0.988 25 25005 92429 58 41.97 -71.335 -2617520 Hamtramck Public Schools Mich. -2.4137 386 1.01 6.687 1.135 26 26163 25375 92 42.395 -83.056 -2733540 St. Francis Public School District Minn. 0.6782 386 3.858 8.826 0.994 27 27003 82615 59 45.378 -93.324 -3172390 Kearney Public Schools Neb. 0.5047 386 3.569 8.388 0.964 31 31019 59499 50 40.719 -99.105 -3607590 Clarence Central School District N.Y. 1.5334 386 4.66 9.767 1.022 36 36029 97623 68 43.009 -78.62 -3623220 Plainview-Old Bethpage Central School District N.Y. 1.8575 386 4.766 9.869 1.021 36 36059 135655 68 40.775 -73.465 -3624900 Rome City School District N.Y. -0.1447 386 2.54 7.096 0.911 36 36065 51354 33 43.263 -75.487 -4108720 Newberg 29J Ore. 0.719 386 3.458 8.491 1.007 41 41071 71015 64 45.32 -122.982 -4815750 Crosby Tex. 0.3169 386 2.652 7.744 1.018 48 48201 64358 67 29.917 -95.053 -4840920 Southside Tex. -0.8002 386 2.184 6.913 0.946 48 48029 42692 44 29.216 -98.451 -2925450 Poplar Bluff R-I Mo. -0.9193 385 3.537 7.55 0.803 29 29023 36908 11 36.797 -90.447 -3615570 Ithaca City School District N.Y. 1.105 385 3.787 8.906 1.024 36 36109 77923 69 42.408 -76.47 -3630630 West Genesee Central School District N.Y. 0.982 385 3.839 8.937 1.02 36 36067 79978 68 43.058 -76.293 -4007620 Choctaw/Nicoma Park Okla. 0.592 385 3.386 7.82 0.887 40 40109 64698 26 35.455 -97.265 -3618240 Mamaroneck Union Free School District N.Y. 2.0583 384 4.573 10.495 1.184 36 36119 183333 96 40.942 -73.749 -4224820 Warren County Pa. 0.1407 384 3.179 8.355 1.035 42 42123 53680 72 41.812 -79.23 -4400270 Cumberland R.I. 1.2161 384 3.556 9.063 1.101 44 44007 94963 87 41.97 -71.42 -4703000 Monroe County School District Tenn. -0.4408 384 2.314 7.053 0.948 47 47123 46356 45 35.426 -84.232 -4900750 Park City District Utah 1.8683 384 4.278 9.327 1.01 49 49043 116346 65 40.707 -111.543 -0600034 Windsor Unified Calif. 0.862 383 2.433 7.084 0.93 06 06097 78095 39 38.549 -122.798 -2003360 Andover Kan. 1.5347 383 4.432 10.056 1.125 20 20015 101374 91 37.708 -97.127 -3410320 Millville N.J. -1.7553 383 1.924 7.094 1.034 34 34011 37282 71 39.39 -75.056 -3604710 Bethlehem Central School District N.Y. 1.7309 383 4.219 9.896 1.135 36 36001 104545 92 42.595 -73.878 -4211610 Hatboro-Horsham Pa. 1.3764 383 5.157 9.661 0.901 42 42091 92697 30 40.199 -75.166 -4832280 Nederland Tex. 0.4435 383 3.962 7.702 0.748 48 48245 77008 5 29.979 -94.006 -0632640 Rincon Valley Union Elementary Calif. 0.2059 382 3.828 8.415 0.917 06 06097 72832 35 38.49 -122.627 -1806840 School City of Mishawaka Ind. -0.4881 382 3.771 8.131 0.872 18 18141 47999 23 41.662 -86.16 -2508340 Natick Mass. 1.806 382 5.638 10.209 0.914 25 25017 114873 34 42.285 -71.35 -2616410 Grand Ledge Public Schools Mich. 0.7857 382 3.151 7.758 0.922 26 26045 80588 36 42.762 -84.75 -3410980 Mount Olive Township N.J. 1.2815 382 4.587 10.192 1.121 34 34027 109125 90 40.866 -74.743 -3623580 Port Washington Union Free School District N.Y. 1.7507 382 4.612 10.196 1.117 36 36059 151860 90 40.837 -73.692 -3904467 Princeton City Ohio 0.0852 382 3.282 7.823 0.908 39 39061 51691 32 39.276 -84.429 -4204890 Canon-Mcmillan Pa. 0.7843 382 4.934 9.035 0.82 42 42125 73055 13 40.27 -80.172 -0102040 Lawrence County Ala. -0.2562 381 2.864 6.773 0.782 01 01079 42962 8 34.522 -87.311 -2733330 Spring Lake Park Public Schools Minn. 0.3457 381 3.685 8.473 0.957 27 27003 67282 48 45.145 -93.221 -4503480 Spartanburg 01 S.C. -0.1068 381 3.53 8.695 1.033 45 45083 50096 71 35.113 -82.147 -5102820 Orange Co. Public Schools Va. 0.0833 381 3.452 7.792 0.868 51 51137 60112 22 38.246 -78.013 -5400390 Greenbrier County Schools W.Va. -0.3821 381 3.06 7.14 0.816 54 54025 43481 12 37.947 -80.453 -0902490 Middletown School District Conn. 0.326 380 3.629 7.704 0.815 09 09007 69654 12 41.548 -72.655 -2006420 Gardner Edgerton Kan. 0.9687 380 4.475 9.614 1.028 20 20091 73913 70 38.802 -94.962 -4816410 Dayton Tex. -0.0077 380 2.326 7.169 0.969 48 48291 62524 51 30.039 -94.918 -0641250 Walnut Creek Elementary Calif. 1.4838 379 4.41 9.226 0.963 06 06013 105754 50 37.887 -122.055 -0807350 Weld County Reorganized School District No. Re-4 Colo. 1.3421 379 4.269 9.344 1.015 08 08123 87500 66 40.501 -104.877 -2707410 Cambridge-Isanti Public School Dist. Minn. 0.3177 379 3.544 9.133 1.118 27 27059 66593 90 45.545 -93.261 -3904660 Solon City Ohio 1.5316 379 5.196 11.622 1.285 39 39035 119894 100 41.383 -81.443 -0901050 Darien School District Conn. 2.3246000000000002 378 5.044 11.377 1.267 09 09001 210909 100 41.081 -73.483 -1201950 Wakulla Fla. 0.3006 378 4.108 8.085 0.796 12 12129 62656 10 30.171 -84.404 -1803690 Franklin Community Ind. 0.194 378 3.469 8.572 1.021 18 18081 62127 68 39.481 -86.096 -1808970 Plainfield Community Ind. 0.5118 378 4.696 9.377 0.936 18 18063 63750 41 39.675 -86.382 -2104050 Meade County Ky. -0.2567 378 3.55 8.88 1.066 21 21163 49223 80 37.973 -86.234 -3410200 Millburn Township N.J. 2.39 378 5.53 11.522 1.198 34 34013 204699 97 40.739 -74.324 -3615630 Jamestown City School District N.Y. -1.5214 378 2.438 6.801 0.872 36 36013 37378 23 42.081 -79.229 -1302700 Harris County Ga. 0.5269 377 3.514 8.058 0.909 13 13145 71802 33 32.736 -84.909 -1705610 Belleville Ill. -0.8959 377 3.801 7.58 0.756 17 17163 41774 6 38.505 -90.003 -1713140 East Maine Ill. 0.8907 377 2.854 8.485 1.126 17 17031 72499 91 42.048 -87.834 -2007050 Haysville Kan. -0.0899 377 3.537 7.774 0.847 20 20173 56022 18 37.583 -97.379 -2201230 Plaquemines Parish La. 0.0626 377 3.486 8.128 0.928 22 22075 64648 38 29.445 -89.608 -3608400 Corning City School District N.Y. 0.5228 377 3.431 8.413 0.996 36 36101 65959 60 42.146 -77.059 -5100420 Botetourt Co. Public Schools Va. 1.0188 377 3.752 9.152 1.08 51 51023 74429 83 37.557 -79.812 -2200510 Desoto Parish La. -1.0468 376 1.597 7.518 1.184 22 22031 39184 96 32.055 -93.737 -3625950 Scarsdale Union Free School District N.Y. 2.6639 376 4.962 11.013 1.21 36 36119 225838 98 40.989 -73.776 -3627210 South Colonie Central School District N.Y. 0.9259 376 3.625 8.433 0.962 36 36001 79371 49 42.733 -73.836 -1721030 Kildeer Countryside CCSD Ill. 2.2436 375 5.592 11.117 1.105 17 17097 155968 88 42.187 -88.006 -3701110 Dare County Schools N.C. 0.2736 375 3.999 8.591 0.918 37 37055 54489 35 35.764 -75.864 -5302850 Ferndale School District Wash. 0.2183 375 3.149 8.677 1.106 53 53073 64717 88 48.877 -122.629 -5401050 Ohio County Schools W.Va. -0.3167 375 3.694 8.117 0.884 54 54069 49374 26 40.097 -80.619 -1731080 Pekin PSD Ill. -0.462 374 3.36 7.418 0.812 17 17179 54090 12 40.568 -89.6 -2501980 Arlington Mass. 1.5023 374 5.672 10.948 1.055 25 25017 106250 77 42.419 -71.164 -3624690 Riverhead Central School District N.Y. 0.0607 374 3.274 7.62 0.869 36 36103 58529 22 40.927 -72.692 -4206660 Connellsville Area Pa. -1.0172 374 2.904 7.183 0.856 42 42051 36892 19 40.01 -79.501 -1601570 Jefferson County Joint Dist. Idaho 0.5043 373 3.692 8.199 0.901 16 16051 59467 30 43.708 -112.134 -1802400 Concord Community Schools Ind. -0.3369 373 2.804 7.988 1.037 18 18039 52250 72 41.643 -85.936 -2508700 North Andover Mass. 1.725 373 4.6 10.246 1.129 25 25009 137828 91 42.671 -71.087 -3620910 North Babylon Union Free School District N.Y. 0.8808 373 3.818 7.613 0.759 36 36103 91136 6 40.73 -73.334 -0401760 Catalina Foothills Unified District Ariz. 1.8474 372 4.752 9.782 1.006 04 04019 116139 63 32.315 -110.884 -0620310 Lafayette Elementary Calif. 2.1318 372 4.856 9.809 0.991 06 06013 171319 58 37.896 -122.116 -0900750 Cheshire School District Conn. 1.7981 372 4.854 10.087 1.047 09 09009 127954 75 41.511 -72.904 -1736810 Burbank Ill. 0.2353 372 2.518 7.612 1.019 17 17031 66148 67 41.752 -87.771 -2501680 Acton Mass. 2.0924 372 5.483 11.607 1.225 25 25017 148653 99 42.484 -71.438 -3410810 Morris School District N.J. 1.1623000000000001 372 4.16 9.442 1.056 34 34027 112745 77 40.796 -74.492 -4107500 Lincoln County Ore. -0.3469 372 2.538 7.181 0.929 41 41041 50568 38 44.605 -123.876 -4827870 Lockhart Tex. -0.4547 372 3.175 7.24 0.813 48 48055 50185 12 29.887 -97.612 -0904110 Simsbury School District Conn. 2.0866 371 5.46 10.339 0.976 09 09003 143281 54 41.873 -72.826 -1711250 Crete Monee 201U Ill. -0.263 371 2.489 7.173 0.937 17 17197 66440 41 41.426 -87.657 -2912290 Fort Osage R-I Mo. -0.1802 371 3.344 7.37 0.805 29 29095 59999 11 39.147 -94.253 -4205010 Carlisle Area Pa. 0.6664 371 3.994 8.909 0.983 42 42041 68357 56 40.154 -77.234 -4838220 Royse City Tex. 0.6625 371 3.39 8.243 0.971 48 48397 73770 52 32.942 -96.314 -5517070 Wisconsin Rapids School District Wis. 0.2621 371 3.668 8.38 0.942 55 55141 59422 43 44.409 -89.813 -0500026 Pine Bluff School District Ark. -2.1882 370 0.982 5.652 0.934 05 05069 32295 40 34.156 -91.911 -1200060 Baker Fla. -0.1219 370 3.849 7.683 0.767 12 12003 53196 7 30.331 -82.285 -1601860 Lewiston Independent District Idaho 0.1165 370 2.904 8.389 1.097 16 16069 59110 86 46.334 -116.935 -1601920 Madison District Idaho 0.5006 370 4.527 8.785 0.852 16 16065 54756 19 43.752 -111.636 -2630300 School District of the City of Royal Oak Mich. 0.8289 370 3.731 8.98 1.05 26 26125 71506 76 42.509 -83.153 -3416830 Voorhees Township N.J. 1.2651 370 4.604 9.933 1.066 34 34007 108871 79 39.845 -74.955 -3700240 Asheboro City Schools N.C. -1.4584 370 2.67 7.226 0.911 37 37151 32999 33 35.711 -79.814 -3910014 Riverside Local - Painesville Ohio 0.8838 370 4.125 8.448 0.865 39 39085 80042 21 41.693 -81.195 -4807590 Alamo Heights Tex. 1.4358 370 3.772 9.423 1.13 48 48029 105792 91 29.494 -98.468 -0502960 Benton School District Ark. 0.2828 369 3.841 8.845 1.001 05 05125 62550 62 34.566 -92.695 -3617670 Lockport City School District N.Y. -0.6677 369 3.214 7.174 0.792 36 36063 49106 9 43.163 -78.688 -5100060 Accomack Co. Public Schools Va. -0.6687 369 3.08 7.661 0.916 51 51001 44520 35 37.769 -75.662 -5515330 Verona Area School District Wis. 1.2321 369 3.865 8.994 1.026 55 55025 93412 69 42.983 -89.538 -3904427 Loveland City Ohio 1.5424 368 4.539 9.764 1.045 39 39061 108477 74 39.258 -84.266 -5508610 Manitowoc School District Wis. 0.0613 368 2.803 8.344 1.108 55 55071 58064 88 44.083 -87.714 -0607900 Center Joint Unified Calif. 0.2146 367 2.677 6.602 0.785 06 06067 61514 8 38.742 -121.403 -0611910 Eastside Union Elementary Calif. -0.7781 367 0.641 5.608 0.993 06 06037 46428 59 34.736 -117.889 diff --git a/examples/js/Untitled-2 b/examples/js/Untitled-2 deleted file mode 100644 index 5be33d2a..00000000 --- a/examples/js/Untitled-2 +++ /dev/null @@ -1,20 +0,0 @@ -A00-B99 (Certain infectious and parasitic diseases) -C00-D48 (Neoplasms) -D50-D89 (Diseases of the blood and blood-forming organs and certain disorders involving the immune mechanism) -E00-E88 (Endocrine, nutritional and metabolic diseases) -F01-F99 (Mental and behavioural disorders) -G00-G98 (Diseases of the nervous system) -H00-H57 (Diseases of the eye and adnexa) -H60-H93 (Diseases of the ear and mastoid process) -I00-I99 (Diseases of the circulatory system) -J00-J98 (Diseases of the respiratory system) -K00-K92 (Diseases of the digestive system) -L00-L98 (Diseases of the skin and subcutaneous tissue) -M00-M99 (Diseases of the musculoskeletal system and connective tissue) -N00-N98 (Diseases of the genitourinary system) -O00-O99 (Pregnancy, childbirth and the puerperium) -P00-P96 (Certain conditions originating in the perinatal period) -Q00-Q99 (Congenital malformations, deformations and chromosomal abnormalities) -R00-R99 (Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified) -U00-U99 (Codes for special purposes) -V01-Y89 (External causes of morbidity and mortality) diff --git a/examples/js/Untitled-4 b/examples/js/Untitled-4 deleted file mode 100644 index 7bdeeb84..00000000 --- a/examples/js/Untitled-4 +++ /dev/null @@ -1,52 +0,0 @@ -const res = `Media,Year,value, -Youtube,2015,null, -Youtube,2018,85, -Instagram,2018,72, -Instagram,2015,52, -Snapchat,2018,69, -Snapchat,2015,41, -Facebook,2018,51, -Facebook,2015,71, -Twitter,2018,32, -Twitter,2015,33, -Tumblr,2018,9, -Tumblr,2015,14, -Reddit,2018,7, -Reddit,2015,null, -Vine,2015,24, -Vine,2018,null,`; - -const env = muze(); -const canvas = env.canvas(); -const DataModel = muze.DataModel; - -const schema = [ - { name: 'Media', type: 'dimension' }, - { name: 'Year', type: 'dimension', subtype: 'temporal', format: '%Y' }, - { name: 'value', type: 'measure' } -]; - -const dm = new DataModel(res, schema); -canvas - .data(dm) - .width(600) - .height(400) - .config({ - axes: { y: { name: 'Value in percentage' } } - }) - .rows(['value']) /* Plots against y-axis + provides panel split */ - .columns(['Year']) /* Plots against x-axis */ - .color({ - field: 'Media', - range: ['red', 'orange', 'yellow', '#33b5e91', '#31a6ea', 'grey', 'red', 'green'] - }) - .layers([ - { - mark: 'line', - connectNullData: true - }, - { mark: 'point' } - ]) - .title('Shifts of teenagers in social media usage') - .mount('#chart-container'); - diff --git a/examples/js/aa.js b/examples/js/aa.js index b9a953b6..658dd0be 100644 --- a/examples/js/aa.js +++ b/examples/js/aa.js @@ -4,61 +4,62 @@ let env = window.muze(); const DataModel = window.muze.DataModel; - d3.json('/data/cars.json', (data) => { + d3.csv('/data/weather.csv', (data) => { + const share = muze.Operators.share; const schema = [{ - name: 'Name', - type: 'dimension' - }, { - name: 'Maker', - type: 'dimension' - }, { - name: 'Miles_per_Gallon', - type: 'measure' - }, { - name: 'Displacement', - type: 'measure' - }, { - name: 'Horsepower', - type: 'measure' - }, { - name: 'Weight_in_lbs', + name: 'maxDays', type: 'measure' }, { - name: 'Acceleration', + name: 'minDays', type: 'measure' }, { - name: 'Origin', - type: 'dimension' - }, { - name: 'Cylinders', - type: 'dimension' - }, { - name: 'Year', + name: 'time', type: 'dimension', - // subtype: 'temporal', - // format: '%Y-%m-%d' }]; let rootData = new DataModel(data, schema) - rootData.sort([ - ['Cylinders', 'asc'], - ['Maker', 'desc'], - ]) + rootData = rootData.calculateVariable({ + name: "date", + type: "dimension", + subtype: "temporal", + format: "%Y-%m-%d" + }, ["Year", function (d) { + return d; + }]); + + env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + var rows = ['Cylinders', 'Horsepower'], + columns = ['Origin', 'Year']; + canvas = canvas.rows(rows).columns(columns).height(800).color('Origin') + //{initProps} + .mount(mountPoint); - const canvas = env.canvas(); - - canvas - .data(rootData) - .columns(['Cylinders', 'Horsepower']) - .rows(['Acceleration']) - .color('Maker') - .mount('#chart') - .height(500) - .title('Charts'); - setTimeout(() => { - canvas.data(canvas.data().select(() => false)) - }, 1000); + canvas.rows(['Horsepower', 'Acceleration']).columns(['Acceleration', 'Horsepower']).color('Horsepower').size('Cylinders').detail(['Maker']).width(300).height(300); + canvas.once('canvas.animationend').then(function (client) { + var element = document.getElementById('chart'); + element.classList.add('animateon'); + }); + }, 3000); + + // const canvas = env.canvas(); + + // canvas + // .data(rootData) + // // .rows(['maxDays']) + // .rows([share('maxDays', 'minDays')]) + // .columns(['time']) + // .layers([{ mark: 'tick', encoding: { y: 'maxDays', y0: 'minDays' } } ]) + // // .layers([{ + // // mark: 'area' + // // }]) + // // .detail(['Name']) + // .mount('#chart') + // .height(500) + // .width(900) + // .title('Charts'); }) })(); \ No newline at end of file diff --git a/examples/js/band-axis-facets.js b/examples/js/band-axis-facets.js index acd4ebcf..c1452cae 100644 --- a/examples/js/band-axis-facets.js +++ b/examples/js/band-axis-facets.js @@ -1,5 +1,5 @@ /* eslint-disable */ -const env = muze(); +// const env = muze(); const DataModel = muze.DataModel; function shuffleArray(array) { @@ -56,31 +56,34 @@ d3.json('../../data/cars.json', (data) => { { name: 'Year', type: 'dimension', - subtype: 'temporal', - format: '%Y-%m-%d' + // subtype: 'temporal', + // format: '%Y-%m-%d' }]; - window.rootData = new DataModel(jsonData, schema) + var rootData = new DataModel(jsonData, schema); + rootData = rootData.calculateVariable({ + name: "date", + type: "dimension", + subtype: "temporal", + format: "%Y-%m-%d" + }, ["Year", function (d) { + return d; + }]); - const rows = ['Origin']; - const columns = rows.reverse(); + env = muze().data(rootData).minUnitHeight(40).minUnitWidth(40); + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + var rows = ['Cylinders', 'Horsepower'], + columns = ['Origin', 'Year']; + canvas = canvas.rows(rows).columns(columns).height(800).color('Origin') + //{initProps} + .mount(mountPoint); - const canvas = env - .canvas() - .columns(['Maker', 'Cylinders', 'Acceleration']) - .rows(columns) - .data(rootData) - .height(800) - .width(1500) - .detail(['Maker', 'Cylinders']) - .title('The car acceleration respective to origin', { position: 'bottom', align: 'center' }) - .color({ field: 'Origin' }) - .mount('#chart') - .config({ - sort:{ - Maker: 'asc', - Cylinders: (a, b) => a - b, - Origin: (a, b) => b.localeCompare(a), - } - }) -}); \ No newline at end of file + // setTimeout(() => { + // canvas.rows(['Horsepower', 'Acceleration']).columns(['Acceleration', 'Horsepower']).color('Horsepower').size('Cylinders').detail(['Maker']).width(600).height(600); + // // canvas.once('canvas.animationend').then(function (client) { + // // var element = document.getElementById('chart'); + // // element.classList.add('animateon'); + // // }); + // }, 2000); +}); diff --git a/examples/js/bug.js b/examples/js/bug.js new file mode 100644 index 00000000..52d521f1 --- /dev/null +++ b/examples/js/bug.js @@ -0,0 +1,29 @@ +const env = window.muze(); +const DataModel = window.muze.DataModel; +const mountPoint = document.getElementById('chart'); + +const schema = [{ + name: 'Horsepower', + type: 'measure' +}, { + name: 'Acceleration', + type: 'measure' +}, { + name: 'Origin', + type: 'dimension' +}]; + +// const data = [{ Origin:'USA', Horsepower:1, Acceleration:2 },{Origin:'China', Horsepower:2}]; +const data1 = [{ Origin: '1' }, { Origin: '2' }]; +const rootData = new DataModel(data1, schema, { dataFormat: "FlatJSON" } ); +const canvas = env.canvas(); +const rows = [[], ['Acceleration']]; +const columns = ['Origin']; +canvas.mount(mountPoint).data(rootData).rows(rows).height(400) +.columns(columns) +.layers([{ + mark: 'point' +}]) +.color({ + field: 'Origin' +}); diff --git a/examples/js/coffee.js b/examples/js/coffee.js index 2ec499ff..a17ee821 100644 --- a/examples/js/coffee.js +++ b/examples/js/coffee.js @@ -1,43 +1,44 @@ d3.csv('/data/coffee.csv', (data) => { // load data and schema from url const schema = [{ - "name": "Market", - "type": "dimension" - }, - { - "name": "Product", - "type": "dimension" - }, - { - "name": "Product Type", - "type": "dimension" - }, + name: 'Market', + type: 'dimension' + }, + { + name: 'Product', + type: 'dimension' + }, + { + name: 'Product Type', + type: 'dimension' + }, - { - "name": "Revenue", - "type": "measure" - }, - { - "name": "Expense", - "type": "measure" - }, - { - "name": "Profit", - "type": "measure" - }, - { - "name": "Order Count", - "type": "measure" - }]; + { + name: 'Revenue', + type: 'measure' + }, + { + name: 'Expense', + type: 'measure' + }, + { + name: 'Profit', + type: 'measure' + }, + { + name: 'Order Count', + type: 'measure' + }]; const env = window.muze(); const DataModel = window.muze.DataModel; const rootData = new DataModel(data, schema); /* data and schema is global */ const canvas = env.canvas(); canvas .rows(['Product Type', 'Product']) - .columns(['Market', 'Revenue', 'Expense']) + .columns(['Market']) .data(rootData) .width(1000) .height(800) + .color('Profit') .config({ showHeaders: true, /* show the headers of fields used in faceting */ facetConfig: { rows: { verticalAlign: 'middle' } }, /* dimensional values are placed in middle */ @@ -46,22 +47,21 @@ d3.csv('/data/coffee.csv', (data) => { // load data and schema from url x: { tickFormat: (d) => { if (d < 1000) return d; - if (d > 1000 && d < 1000000) return `${d / 1000}K` - if (d > 1000000) return `${d / 1000}M` - return d + if (d > 1000 && d < 1000000) return `${d / 1000}K`; + if (d > 1000000) return `${d / 1000}M`; + return d; } } } }) - //.title('Visual Crosstab') - .title('The car acceleration respective to origin',{ position: 'bottom',align:'center'}) + // .title('Visual Crosstab') + .title('The car acceleration respective to origin', { position: 'bottom', align: 'center' }) .subtitle('Revenue and Expense by Product type and Market') .mount('#chart'); - canvas.once('canvas.animationend').then((client) => { - - const element = document.getElementById('chart'); - element.classList.add('animateon'); - }); + canvas.once('canvas.animationend').then((client) => { + const element = document.getElementById('chart'); + element.classList.add('animateon'); }); +}); diff --git a/examples/js/composite-layer.js b/examples/js/composite-layer.js index 63a8f6d7..ab7bc150 100644 --- a/examples/js/composite-layer.js +++ b/examples/js/composite-layer.js @@ -1,3 +1,4 @@ +/* eslint-disable */ let env = muze(); const DataModel = muze.DataModel; const DateTimeFormatter = muze.utils.DateTimeFormatter; @@ -58,219 +59,218 @@ d3.csv('../data/twitter-data.csv', (data) => { let rootData = new DataModel(data, schema); env = env.data(rootData) - .minUnitHeight(40) - .minUnitWidth(40) - .width(550) - .height(300) - .config({ - autoGroupBy: { - disabled: true - }, - axes: { - y: { - showAxisName: false + .minUnitHeight(40) + .minUnitWidth(40) + .width(550) + .height(300) + .config({ + autoGroupBy: { + disabled: true }, - x: { - showAxisName: false - } - }, - legend: { - color: { - show: false + axes: { + y: { + showAxisName: false + }, + x: { + showAxisName: false + } + }, + legend: { + color: { + show: false + } } - } - }); - - rootData = rootData.sort([['time', 'asc']]); + }); - rootData = rootData.calculateVariable({ - name: 'date', - type: 'dimension', - subtype: 'temporal' - }, ['time', (time) => { - const date = new Date(time); - return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime(); - }]); + rootData = rootData.sort([['time', 'asc']]); - rootData = rootData.calculateVariable({ - name: 'count', - type: 'measure', - defAggFn: 'count' - }, ['retweets', () => 0]); + rootData = rootData.calculateVariable({ + name: 'date', + type: 'dimension', + subtype: 'temporal' + }, ['time', (time) => { + const date = new Date(time); + return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime(); + }]); + + rootData = rootData.calculateVariable({ + name: 'count', + type: 'measure', + defAggFn: 'count' + }, ['retweets', () => 0]); - rootData = rootData.calculateVariable({ - name: 'day', - type: 'dimension' - }, ['date', date => DateTimeFormatter.formatAs(date, '%a')]); + rootData = rootData.calculateVariable({ + name: 'day', + type: 'dimension' + }, ['date', date => DateTimeFormatter.formatAs(date, '%a')]); - const tweetGroupByDate = rootData.groupBy(['date']); - const tweetsGroupByDay = rootData.groupBy(['day']); - const canvases = []; + const tweetGroupByDate = rootData.groupBy(['date']); + const tweetsGroupByDay = rootData.groupBy(['day']); + const canvases = []; - let tweetsByDay; - let tweetsByDate; + let tweetsByDay; + let tweetsByDate; - canvases.push( - tweetsByDate = env.canvas() - .data(tweetGroupByDate) - .rows(['count']) - .columns(['date']) - .layers([{ - mark: 'bar' - }]) - .title('Tweets') - .subtitle('Drag to filter by time') - .mount('#chart'), - - tweetsByDay = env.canvas() - .rows(['day']) - .columns(['count']) - .color('day') - .data(tweetsGroupByDay) - .subtitle('Select day to filter') - .title('Tweets In Day of Week') - .layers([{ - mark: 'bar', - name: 'barLayer', - className: 'muze-tweetsByDay' - }]) - .mount('#chart2'), + canvases.push( + tweetsByDate = env.canvas() + .data(tweetGroupByDate) + .rows(['count']) + .columns(['date']) + .layers([{ + mark: 'bar' + }]) + .title('Tweets') + .subtitle('Drag to filter by time') + .mount('#chart1'), - env.canvas() - .rows(['impressions']) - .columns(['date']) - .data(tweetGroupByDate) - .title('Impressions') - .mount('#chart3'), + tweetsByDay = env.canvas() + .rows(['day']) + .columns(['count']) + .color('day') + .data(tweetsGroupByDay) + .subtitle('Select day to filter') + .title('Tweets In Day of Week') + .layers([{ + mark: 'bar', + name: 'barLayer', + className: 'muze-tweetsByDay', + transform: { + type: 'identity' + } + }]) + .mount('#chart2'), - env.canvas() - .rows(['engagements']) - .columns(['date']) - .data(tweetGroupByDate) - .title('Engagements') - .mount('#chart4'), + env.canvas() + .rows(['impressions']) + .columns(['date']) + .data(tweetGroupByDate) + .title('Impressions') + .mount('#chart3'), - env.canvas() - .rows(['retweets']) - .columns(['date']) - .data(tweetGroupByDate) - .title('Retweets') - .mount('#chart5'), + env.canvas() + .rows(['engagements']) + .columns(['date']) + .data(tweetGroupByDate) + .title('Engagements') + .mount('#chart4'), - env.canvas() - .rows(['favorites']) - .columns(['date']) - .data(tweetGroupByDate) - .title('Favorites') - .mount('#chart6'), + env.canvas() + .rows(['retweets']) + .columns(['date']) + .data(tweetGroupByDate) + .title('Retweets') + .mount('#chart5'), - env.canvas() - .rows(['user profile clicks']) - .columns(['date']) - .data(tweetGroupByDate) - .title('User Profile Clicks') - .mount('#chart7'), + env.canvas() + .rows(['favorites']) + .columns(['date']) + .data(tweetGroupByDate) + .title('Favorites') + .mount('#chart6'), - env.canvas() - .rows(['hashtag clicks']) - .columns(['date']) - .data(tweetGroupByDate) - .title('Hashtag Clicks') - .mount('#chart8') - ); + env.canvas() + .rows(['user profile clicks']) + .columns(['date']) + .data(tweetGroupByDate) + .title('User Profile Clicks') + .mount('#chart7'), - muze.ActionModel.for(...canvases).enableCrossInteractivity() - .for(tweetsByDay, tweetsByDate) - .registerPropagationBehaviourMap({ - select: 'filter', - brush: 'filter' - }) - .for(tweetsByDay) - .registerSideEffects( - class ContributionLayer extends SpawnableSideEffect { - constructor(...params) { - super(...params); - const visualUnit = this.firebolt.context; - const xField = visualUnit.fields().x[0]; - const yField = visualUnit.fields().y[0]; - this._layers = []; - const encoding = { - x: xField.getMembers()[0], - y: yField.getMembers()[0], - color: { - value: () => '#000' - }, - size: { - value: 0.7 - } - }; - const barLayers = visualUnit.addLayer({ - name: 'contributionLayer', - mark: 'bar', - className: 'muze-contributionLayer', - encoding, - render: false, - source: dm => dm.select(() => false, { - saveChild: false - }) - }); - - this._layers = [...barLayers, ...visualUnit.addLayer({ - name: 'label', - mark: 'text', - className: 'textLayer', - encoding: { - x: xField.getMembers()[0], - y: yField.getMembers()[0], - color: { - value: () => '#fff' - }, - text: xField.getMembers()[0] - }, - render: false, - source: (dm) => dm.select(() => false, { - saveChild: false - }), - encodingTransform: require('layers', ['barLayer', (barLayer) => { - return (points, layerInst) => { - const fieldsConfig = layerInst.data().getFieldsConfig(); - const yField = layerInst.config().encoding.y.field; - const xField = layerInst.config().encoding.x.field; - const xFieldIndex = fieldsConfig[xField].index; - const yFieldIndex = fieldsConfig[yField].index; - const barData = barLayer.data().getData().data; - const sourceYFieldIndex = barLayer.data().getFieldsConfig()[yField].index; - const sourceXFieldIndex = barLayer.data().getFieldsConfig()[xField].index; - points.forEach((point) => { - const source = point.source; - const totalValue = barData.find(d => d[sourceYFieldIndex] === source[yFieldIndex])[sourceXFieldIndex]; - point.text = `${((point.source[xFieldIndex] / totalValue) * 100).toFixed(2)}%`; - point.update.x += 3; - }); - return points; - } - }]) - })]; - } - - static formalName() { - return 'contribution'; - } + env.canvas() + .rows(['hashtag clicks']) + .columns(['date']) + .data(tweetGroupByDate) + .title('Hashtag Clicks') + .mount('#chart8') + ); + + muze.ActionModel.for(...canvases).enableCrossInteractivity() + .for(tweetsByDay, tweetsByDate) + .registerPropagationBehaviourMap({ + select: 'filter', + brush: 'filter' + }) + .for(tweetsByDay) + .registerSideEffects( + class ContributionLayer extends SpawnableSideEffect { + constructor(...params) { + super(...params); + const visualUnit = this.firebolt.context; + visualUnit.addLayer((layerDefs) => { + const xField = visualUnit.fields().x[0]; + const yField = visualUnit.fields().y[0]; + const encoding = { + x: xField.getMembers()[0], + y: yField.getMembers()[0], + color: { + value: () => '#000' + }, + size: { + value: 0.7 + } + }; - apply(selectionSet) { - const mergedModel = selectionSet.mergedEnter.model; - const sideEffectGroup = this.drawingContext().sideEffectGroup; - const dynamicMarkGroup = this.createElement(sideEffectGroup, 'g', this._layers, '.contribution-layer'); + return [ + { + name: 'contributionLayer', + mark: 'bar', + groupId: 'contribution', + className: 'muze-contributionLayer', + source: (dm) => dm.select(() => false), + encoding + }, + { + name: 'label', + mark: 'text', + groupId: 'contribution', + className: 'textLayer', + encoding: { + x: xField.getMembers()[0], + y: yField.getMembers()[0], + color: { + value: () => '#fff' + }, + text: xField.getMembers()[0] + }, + source: (dm) => dm.select(() => false), + encodingTransform: require('layers', ['barLayer', (barLayer) => { + return (points, layerInst) => { + const fieldsConfig = layerInst.data().getFieldsConfig(); + const yField = layerInst.config().encoding.y.field; + const xField = layerInst.config().encoding.x.field; + const xFieldIndex = fieldsConfig[xField].index; + const yFieldIndex = fieldsConfig[yField].index; + const barData = barLayer.data().getData().data; + const sourceYFieldIndex = barLayer.data().getFieldsConfig()[yField].index; + const sourceXFieldIndex = barLayer.data().getFieldsConfig()[xField].index; + points.forEach((point) => { + const source = point.source; + const totalValue = barData.find(d => d[sourceYFieldIndex] === source[yFieldIndex])[sourceXFieldIndex]; + point.text = `${((point.source[xFieldIndex] / totalValue) * 100).toFixed(2)}%`; + point.update.x += 3; + }); + return points; + } + }]) + }]; + }); + } + + static formalName() { + return 'contribution'; + } - dynamicMarkGroup.each(function (layer) { - layer.mount(this).data(mergedModel); - }); - } - }).mapSideEffects({ - filter: { - effects: ['contribution'], - preventDefaultActions: true - } - }) - .dissociateSideEffect(['anchors', 'highlight']); + apply(selectionSet) { + const mergedModel = selectionSet.mergedEnter.model; + const layers = this.firebolt.context.layers().filter(layer => layer.config().groupId === + 'contribution'); + layers.forEach((layer) => { + layer.data(mergedModel); + }); + } + }).mapSideEffects({ + filter: { + effects: ['contribution'], + preventDefaultActions: true + } + }) }); \ No newline at end of file diff --git a/examples/js/composite-layers.js b/examples/js/composite-layers.js index bd72c332..94f0fbed 100644 --- a/examples/js/composite-layers.js +++ b/examples/js/composite-layers.js @@ -120,7 +120,7 @@ d3.json('../data/cars.json', (data) => { simpleTick, simplePoint ]); - const rows = [['Horsepower'], ['Acceleration']]; + const rows = [['Horsepower']]; env.canvas() .data(rootData) .width(600) @@ -149,19 +149,14 @@ d3.json('../data/cars.json', (data) => { // } // } // }) - .rows(rows) + .rows(['Horsepower']) .columns(['Year']) .color('Origin') .layers([{ - mark: 'bar', + mark: 'tick', encoding: { y: 'Horsepower' } - }, { - mark: 'compositePoint', - encoding: { - y: 'Acceleration' - } }]) // .detail(['Maker']) .mount('#chart'); diff --git a/examples/js/crosstab.js b/examples/js/crosstab.js index 8adad27f..9e7e708e 100644 --- a/examples/js/crosstab.js +++ b/examples/js/crosstab.js @@ -25,8 +25,8 @@ d3.csv('/data/coffee.csv', function (data) { var env = window.muze(); var DataModel = window.muze.DataModel; var rootData = new DataModel(data, schema); - // console.log('-----------------> 1 ', rootData.getData()); - /* data and schema is global */ + + /* data and schema is global */ var canvas = env.canvas(); canvas.rows(['Market', 'Product Type']).columns([['Revenue', 'Expense'], ['Revenue', 'Expense']]).data(rootData).width(650).height(800).config({ showHeaders: true, /* show the headers of fields used in faceting */ diff --git a/examples/js/design-changes/bar-select.js b/examples/js/design-changes/bar-select.js new file mode 100644 index 00000000..80359996 --- /dev/null +++ b/examples/js/design-changes/bar-select.js @@ -0,0 +1,89 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .rows(['Acceleration']) + .columns(['Maker']) + .layers([{ + mark: 'bar' + }]) + // .size('Maker') + .color('Origin') + .size('Acceleration') + .mount('#chart') + .height(450) + .width(650) + .title('Charts'); + + setTimeout(() => { + var element = document.getElementById('chart'); + canvas.firebolt().dispatchBehaviour('select', { + criteria: { + // Acceleration: [400, 500], + Maker: ['ford', 'toyota', 'mercury'] + } + }); + canvas.firebolt().dispatchBehaviour('highlight', { + criteria: { + // Acceleration: [400, 500], + Maker: ['volkswagen'] + } + }); + element.classList.add('animateon'); + }, 2000); + }) +})(); \ No newline at end of file diff --git a/examples/js/design-changes/brush-area.js b/examples/js/design-changes/brush-area.js new file mode 100644 index 00000000..9684f77b --- /dev/null +++ b/examples/js/design-changes/brush-area.js @@ -0,0 +1,81 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .rows(['Acceleration']) + .columns(['Maker']) + .layers([{ + mark: 'area' + }]) + // .color('Origin') + // .detail(['Name']) + .mount('#chart') + .height(450) + .width(650) + .title('Charts'); + + setTimeout(() => { + var element = document.getElementById('chart'); + canvas.firebolt().dispatchBehaviour('brush', { + criteria: { + Acceleration: [200, 700] + } + }); + element.classList.add('animateon'); + }, 2000); + }) +})(); \ No newline at end of file diff --git a/examples/js/design-changes/brush-bar.js b/examples/js/design-changes/brush-bar.js new file mode 100644 index 00000000..efbf17b8 --- /dev/null +++ b/examples/js/design-changes/brush-bar.js @@ -0,0 +1,81 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .rows(['Horsepower']) + .columns(['Maker']) + .layers([{ + mark: 'bar' + }]) + // .color('Origin') + // .detail(['Name']) + .mount('#chart') + .height(450) + .width(650) + .title('Charts'); + + setTimeout(() => { + var element = document.getElementById('chart'); + canvas.firebolt().dispatchBehaviour('brush', { + criteria: { + Horsepower: [500, 2000] + } + }); + element.classList.add('animateon'); + }, 2000); + }) +})(); \ No newline at end of file diff --git a/examples/js/design-changes/brush-line.js b/examples/js/design-changes/brush-line.js new file mode 100644 index 00000000..57072531 --- /dev/null +++ b/examples/js/design-changes/brush-line.js @@ -0,0 +1,81 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .rows(['Displacement']) + .columns(['Maker']) + .layers([{ + mark: 'line' + }]) + // .color('Origin') + // .detail(['Name']) + .mount('#chart') + .height(450) + .width(650) + .title('Charts'); + + setTimeout(() => { + var element = document.getElementById('chart'); + canvas.firebolt().dispatchBehaviour('brush', { + criteria: { + Displacement: [0, 400] + } + }); + element.classList.add('animateon'); + }, 2000); + }) +})(); \ No newline at end of file diff --git a/examples/js/design-changes/scatter-select.js b/examples/js/design-changes/scatter-select.js new file mode 100644 index 00000000..e108ac78 --- /dev/null +++ b/examples/js/design-changes/scatter-select.js @@ -0,0 +1,84 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .rows(['Acceleration']) + .columns(['Maker']) + .layers([{ + mark: 'point' + }]) + // .size('Maker') + // .color('Origin') + .size('Acceleration') + .mount('#chart') + .height(450) + .width(650) + .title('Charts'); + + setTimeout(() => { + var element = document.getElementById('chart'); + canvas.firebolt().dispatchBehaviour('select', { + criteria: { + Acceleration: [400, 500], + Maker: ['amc'] + } + }); + element.classList.add('animateon'); + }, 2000); + + }) +})(); \ No newline at end of file diff --git a/examples/js/heatmap-sample.js b/examples/js/heatmap-sample.js index a0b37f03..8f665f78 100644 --- a/examples/js/heatmap-sample.js +++ b/examples/js/heatmap-sample.js @@ -4,7 +4,7 @@ // share = muze.operators.share, // html = muze.operators.html, // actionModel = muze.ActionModel; - layerFactory = muze.layerFactory; + layerFactory = muze.layerFactory; const SpawnableSideEffect = muze.SideEffects.SpawnableSideEffect; d3.json('../../data/cars.json', (data) => { @@ -23,6 +23,7 @@ type: 'dimension' }, { + name: 'Maker', type: 'dimension' }, @@ -41,7 +42,7 @@ }, { name: 'Weight_in_lbs', - type: 'measure', + type: 'measure' }, { name: 'Acceleration', @@ -57,10 +58,10 @@ }, { name: 'Year', - type: 'dimension', + type: 'dimension' // subtype: 'temporal', // format: '%Y-%m-%d' - }, + } ]; layerFactory.composeLayers('heatMapText', [ @@ -71,7 +72,7 @@ y: 'heatMapText.encoding.y', x: 'heatMapText.encoding.x', color: 'heatMapText.encoding.color' - }, + } }, { name: 'text', @@ -80,9 +81,9 @@ x: 'heatMapText.encoding.x', y: 'heatMapText.encoding.y', text: 'heatMapText.encoding.text', - color: 'heatMapText.encoding.color', - }, - }, + color: 'heatMapText.encoding.color' + } + } ]); let rootData = new DataModel(jsonData, schema); @@ -96,14 +97,20 @@ window.canvas = env.canvas(); const canvas2 = env.canvas(); const canvas3 = env.canvas(); - let rows = ['Cylinders'], + let rows = ['Acceleration'], columns = [['Year']]; canvas = canvas .rows(rows) .columns(columns) .data(rootData) + .color('Cylinders') .width(1200) .height(600) + // .color({ + // field: 'Acceleration', // A measure in color encoding channel creates gradient legend + // stops: 10 + // // step:true + // }) .layers([{ mark: 'heatMapText', encoding: { @@ -112,7 +119,7 @@ color: { value: () => 'red' } - }, + } } }]) @@ -126,7 +133,7 @@ .config({ border: { - width: 2, + width: 2 }, axes: { x: { @@ -141,6 +148,13 @@ // name: 'Acceleration per year', axisNamePadding: 20 } + }, + legend: { + position: 'bottom', + // steps:true + text: { + // orientation:'left' + } } }); @@ -151,10 +165,10 @@ text: { position: 'right' } - }, + } }) - .title('The Muze Project', { position: 'top', align: 'left', }) + .title('The Muze Project', { position: 'top', align: 'left' }) .subtitle('Composable visualisations with a data first approach', { position: 'top', align: 'left' }) .mount(document.getElementsByTagName('body')[0]); }); diff --git a/examples/js/interactive-layers.js b/examples/js/interactive-layers.js new file mode 100644 index 00000000..1c582418 --- /dev/null +++ b/examples/js/interactive-layers.js @@ -0,0 +1,101 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.csv('/data/seattle-weather.csv', (data) => { + const schema = [ + { + "name": "Date", + "type": "dimension", + "subtype": "temporal", + "format": "%Y/%m/%d" + }, + { + "name": "Precipitation", + "type": "measure", + "defAggFn": "avg" + }, + { + "name": "wind", + "type": "measure" + }, + { + "name": "weather", + "type": "dimension" + } + ]; + + const SurrogateSideEffect = muze.SideEffects.standards.SurrogateSideEffect; + const env = muze(); + const DataModel = muze.DataModel; + const html = muze.Operators.html; + + let rootData = new DataModel(data, schema); + + const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' + ]; + + rootData = rootData.calculateVariable({ + name: 'Month', + type: 'dimension' + }, ['Date', date => (monthNames[new Date(date).getMonth()])]); + + const canvas = window.canvas = env.canvas() + .width(1000) + .height(400) + .data(rootData) + .rows(['Precipitation']) + .columns(['Month']) + .layers([{ + mark: 'bar' + }, { + mark: 'tick', + name: 'averageLine', + className: 'averageLine', + encoding: { + x: { + field: null + }, + y: 'Precipitation', + color: { + value: () => '#f71616' + } + }, + calculateDomain: false, + source: dt => dt.groupBy(['']), + interactive: false + }]) + .title('Amount of precipitation for every month in the year with their average', { + align: 'left' + }) + .subtitle(html`Selecting individual months will give the average for those months`, { + align: 'left' + }) + .mount('#chart'); + + muze.ActionModel.for(canvas) + .registerSideEffects( + class AverageLine extends SurrogateSideEffect { + static formalName() { + return 'averageLine'; + } + + apply(selectionSet) { + const model = selectionSet.mergedEnter.model; + const groupedModel = model.groupBy(['']); + const layer = this.firebolt.context.getLayerByName('averageLine'); + if (!model.isEmpty()) { + layer.enableCaching().data(groupedModel); + } else { + layer.clearCaching(); + } + } + } + ).mapSideEffects({ + 'brush,select': ['averageLine'] + }); + }) +})(); diff --git a/examples/js/legend-samples/area.js b/examples/js/legend-samples/area.js new file mode 100644 index 00000000..f17b8c93 --- /dev/null +++ b/examples/js/legend-samples/area.js @@ -0,0 +1,40 @@ +/* eslint-disable*/ +/* eslint-disable*/ +d3.csv('/data/areaData.csv', (data) => { + const schema = [{ + name: 'Profit', + type: 'measure' + }, { + name: 'Type', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension' + }];; + // Create an instance of DataModel using the data and schema. + let dm = new DataModel(data, schema); + + // Get a canvas instance from Muze where the chart will be rendered. + let canvas = env.canvas(); + const chartConf = { + axes: { + x: { + nice: false, + name: 'Date' + } + } + }; + +canvas.rows(['Profit']) + .columns(['Year']) + .width(800) + .height(600) + .data(dm) + .color('Type') + .layers([{ + mark: 'area' + }]) + .config(chartConf) + .mount('#chart3'); +}); + diff --git a/examples/js/legend-samples/bar.js b/examples/js/legend-samples/bar.js new file mode 100644 index 00000000..5c6318f4 --- /dev/null +++ b/examples/js/legend-samples/bar.js @@ -0,0 +1,55 @@ +var env = window.muze(); +var DataModel = window.muze.DataModel; +var mountPoint = document.getElementById('chart'); + +var schema = [{ + name: 'Horsepower', + type: 'measure' +}, { + name: 'Acceleration', + type: 'measure' +}, { + name: 'Origin', + type: 'dimension' +}]; + +var data = [{ + "Horsepower": 130, + "Acceleration": null, + "Origin": "USA" +}, { + "Horsepower": 115, + "Acceleration": 17.5, + "Origin": "Europe" +}, { + "Horsepower": null, + "Acceleration": 15, + "Origin": "Japan" +}, { + "Horsepower": 120, + "Acceleration": 13.9, + "Origin": "India" +}, { + "Horsepower": 102, + "Acceleration": 15.7, + "Origin": null +}]; +var rootData = new DataModel(data, schema, null, { dataFormat: "FlatJSON" }); + +var canvas = env.canvas(); +var rows = ["Acceleration"]; +var columns = []; +canvas.mount(mountPoint).width(600).data(rootData).rows(columns).height(500).columns(rows).layers([{ + mark: 'arc' +}]).color({ + field: 'Origin' +}).config({ + axes: { + x: { + showAxisName: true + }, + y: { + showAxisName: true + } + } +}) \ No newline at end of file diff --git a/examples/js/legend-samples/line-dashed.js b/examples/js/legend-samples/line-dashed.js new file mode 100644 index 00000000..5ac04dfb --- /dev/null +++ b/examples/js/legend-samples/line-dashed.js @@ -0,0 +1,58 @@ +var env = window.muze(); +var DataModel = window.muze.DataModel; + +d3.json('/data/cars-with-null.json', function (data) { + var schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension' + }]; + // Create an instance of DataModel using the data and schema. + var rootData = new DataModel(data, schema); + + // Get a canvas instance from Muze where the chart will be rendered. + var canvas = env.canvas(); + + canvas = canvas.rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Year']).color('Origin').layers([{ + mark: 'line', + connectNullData: true, + nullDataLineStyle: { + 'stroke-dasharray': '8,4', + 'stroke-width': 5, + 'stroke': 'pink' + } + },{ + mark: 'point' + }]).width(500).height(500).data(rootData).title('Line missing data').mount('#chart').once('canvas.animationend').then(function (client) { + var element = document.getElementById('chart'); + element.classList.add('animateon'); + }); +}); + diff --git a/examples/js/legend-samples/line.js b/examples/js/legend-samples/line.js new file mode 100644 index 00000000..a4e84312 --- /dev/null +++ b/examples/js/legend-samples/line.js @@ -0,0 +1,53 @@ +/* eslint-disable*/ +let env = muze(); +const DataModel = muze.DataModel; +const data = [{ + Acceleration: 2344, + Year: 1970 +}, { + Acceleration: 2844, + Year: 1971 +}, +{ + Acceleration: 2439, + Year: 1972 +}, +{ + Acceleration: null, + Year: 1973 +}, +{ + Acceleration: 2439, + Year: 1974 +} +]; +const schema = [{ + name: 'Acceleration', + type: 'measure' + }, { + name: 'Year', + type: 'dimension' + }]; + // Create an instance of DataModel using the data and schema. + let rootData = new DataModel(data, schema); + + // Get a canvas instance from Muze where the chart will be rendered. + let canvas = env.canvas(); + + canvas = canvas + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Year']) + .layers([{ + mark: 'line', + connectNullData: true, + nullDataLineStyle:{ + 'stroke-dasharray' : ("8,4"), + 'stroke-width': 4, + 'stroke': 'pink' + } + }]) + .width(500) + .height(500) + .data(rootData) + .title('Line Chart With Connected Null Data', { position: 'top', align: 'left' }) + .mount('#chart'); \ No newline at end of file diff --git a/examples/js/legend-samples/point.js b/examples/js/legend-samples/point.js new file mode 100644 index 00000000..4d9ce586 --- /dev/null +++ b/examples/js/legend-samples/point.js @@ -0,0 +1,98 @@ +d3.json('/data/word-freq-bubble.json', (data) => { + const schema = [{ + name: 'f', + type: 'measure' + }, { + name: 'index', + type: 'dimension' + }, { + name: 'word', + type: 'dimension' + }, { + name: 'x', + type: 'measure' + }, { + name: 'y', + type: 'measure' + }]; + const env = window.muze(); + const DataModel = window.muze.DataModel; + const html = muze.Operators.html; + + let rootData = new DataModel(data, schema); + + rootData = rootData.calculateVariable({ + name: 'Used More', + type: 'dimension' + }, ['x', function (x) { + return x > 0 ? 'Female' : 'Male'; + }]); + + rootData = rootData.calculateVariable({ + name: 'displayWord', + type: 'dimension' + }, ['f', 'word', function (f, word) { + return f > 15000 ? word : ''; + }]); + + const canvas = env.canvas().rows(['y']).columns(['x']).data(rootData).detail(['word']).width(900).height(600).color({ + field: 'Used More', + range: ['#a9d3f2', '#f4a4c7'] + }).size({ + field: 'f', + range: [1, 2450] + + }).layers([{ + mark: 'point' + }, { + mark: 'text', + encoding: { + text: 'displayWord', + color: { value: function value () { + return 'black'; + } } + } + }]).config({ + border: { + showValueBorders: { + left: false, + bottom: false + } + }, + axes: { + y: { + show: false + }, + x: { + show: false + } + } + }).config({ + legend: { + position: 'bottom', + size: { + show: false + } + }, + interaction: { + tooltip: { + formatter: function formatter (dataModel, context) { + const tooltipData = dataModel.getData().data; + const fieldConfig = dataModel.getFieldsConfig(); + + let tooltipContent = ''; + tooltipData.forEach((dataArray, i) => { + const usedMore = dataArray[fieldConfig['Used More'].index]; + const word = dataArray[fieldConfig.word.index]; + const freq = dataArray[fieldConfig.f.index]; + + tooltipContent += `

The word ${word} has been used more by ${usedMore}s \n and its frequency of usage is ${freq}

`; + }); + return html`${tooltipContent}`; + } + } + } + }) + .title('Frequency of usage of words by males and females', { align: 'center' }) + .mount('#chart'); +}); diff --git a/examples/js/legends/discrete-config.js b/examples/js/legends/discrete-config.js new file mode 100644 index 00000000..8f248b71 --- /dev/null +++ b/examples/js/legends/discrete-config.js @@ -0,0 +1,144 @@ +/* eslint-disable */ + +var env = muze(); + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + + rootData = rootData.groupBy(['Year', 'Origin'], { + + Horsepower: 'mean', + + Acceleration: 'mean' + + }); + + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + var rows = [['Acceleration']], + + columns = [['Year']]; + + + env.canvas() + + .height(650) + + .rows(['Acceleration']) + + .columns(['Year']) + + .color('Origin') + + .rows(['Acceleration']) + + .columns(['Year']) + + .config({ + + legend: { + + color: { + + item: { + + text: { + + formatter: (val, i) => { + + return `${val}$`; + + } + + } + + } + + } + + } + + }) + .title('Discrete Config') + + .mount('#chart1') + +}); \ No newline at end of file diff --git a/examples/js/legends/discrete.js b/examples/js/legends/discrete.js new file mode 100644 index 00000000..93c34349 --- /dev/null +++ b/examples/js/legends/discrete.js @@ -0,0 +1,134 @@ +/* eslint-disable */ + +var env = muze(); + + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension', + + //{subtype} + + // subtype: 'temporal', + + // format: '%Y-%m-%d' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + + + window.canvas = env.canvas(); + + window.canvas1 = env; + + + rootData = rootData.groupBy(['Year', 'Origin'], { + + Horsepower: 'mean', + + Acceleration: 'mean' + + }); + + + window.canvas = env.canvas(); + + var rows = [['Acceleration']], + + columns = [['Year']]; + + + env.canvas() + + .rows(rows) + + .columns(columns) + + .data(rootData) + + .layers([{ + + mark: 'bar' + + }]) + + .width(800) + + .height(600) + + .color({ + + field: 'Origin' + + }) + .title('Discrete') + + .mount('#chart2') + +}); \ No newline at end of file diff --git a/examples/js/legends/gradient-config.js b/examples/js/legends/gradient-config.js new file mode 100644 index 00000000..088fb3b6 --- /dev/null +++ b/examples/js/legends/gradient-config.js @@ -0,0 +1,138 @@ +/* eslint-disable */ + +var env = muze(); + + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension', + + //{subtype} + + // subtype: 'temporal', + + // format: '%Y-%m-%d' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + window.canvas1 = env; + + + rootData = rootData.groupBy(['Year', 'Origin'], { + + Horsepower: 'mean', + + Acceleration: 'mean' + + }); + + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + var rows = [['Acceleration']], + + columns = [['Year']]; + + + env.canvas() + + .rows(rows) + + .columns(columns) + + .data(rootData) + + .layers([{ + + mark: 'bar' + + }]) + + .width(800) + + .height(600) + + .color({ + + field: 'Origin' + + }) + .title('Gradient Config') + + + .mount('#chart3') + +}); \ No newline at end of file diff --git a/examples/js/legends/gradient.js b/examples/js/legends/gradient.js new file mode 100644 index 00000000..31d53c67 --- /dev/null +++ b/examples/js/legends/gradient.js @@ -0,0 +1,117 @@ +/* eslint-disable */ + +var env = muze(); + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension', + + //{subtype} + + // subtype: 'temporal', + + // format: '%Y-%m-%d' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + window.canvas = env.canvas(); + + env.canvas() + .rows(["Maker"]) + .height(400) + .columns(['Acceleration']) + .data(rootData) + .color({ + field: 'Acceleration', + stops: 3 + }) + .config({ + legend: { + position: 'bottom' + } + }) + .mount('#chart1') + + env.canvas() + .rows(["Maker"]) + .height(400) + .columns(['Acceleration']) + .data(rootData) + .color({ + field: 'Acceleration', + stops: 3 + }) + .config({ + legend: { + position: 'left' + } + }) + .mount('#chart2') + +}); \ No newline at end of file diff --git a/examples/js/legends/grouped-bar.js b/examples/js/legends/grouped-bar.js new file mode 100644 index 00000000..b8205ef8 --- /dev/null +++ b/examples/js/legends/grouped-bar.js @@ -0,0 +1,73 @@ + +/* eslint-disable */ +var env = muze(); + +var DataModel = muze.DataModel; +d3.json('../data/cars.json', function (data) { + var jsonData = data, + schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension', + //{subtype} + // subtype: 'temporal', + // format: '%Y-%m-%d' + }]; + var rootData = new DataModel(jsonData, schema); + + env = env.data(rootData) + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + window.canvas1 = env; + + rootData = rootData.groupBy(['Year', 'Origin'], { + Horsepower: 'mean', + Acceleration: 'mean' + }); + + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + var rows = [['Acceleration']], + columns = [['Year']]; + + env.canvas() + .rows(rows) + .columns(columns) + .data(rootData) + .layers([{ + mark: 'bar', + transform: { type: 'group' } // Specify if its group bar or stack bar + }]) + .width(800) + .height(600) + .color({ + field: 'Origin' + }) + .mount('#chart2') +}); \ No newline at end of file diff --git a/examples/js/legends/interval-range.js b/examples/js/legends/interval-range.js new file mode 100644 index 00000000..6962e93f --- /dev/null +++ b/examples/js/legends/interval-range.js @@ -0,0 +1,147 @@ +/* eslint-disable */ +var env = muze(); +var DataModel = muze.DataModel; +d3.json('../data/cars.json', function (data) { + var jsonData = data, + schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension' + //{subtype} + // subtype: 'temporal', + // format: '%Y-%m-%d' + }]; + var rootData = new DataModel(jsonData, schema); + + env = env.data(rootData) + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + env.canvas() + .data(rootData) + .width(600) + .height(400) + .rows(['Weight_in_lbs']) + .columns(['Horsepower']) + .detail(['Name']) + .size('Cylinders') + .subtitle('size: dimension') + .mount(mountPoint) + + env.canvas() + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Horsepower']) // Displacement goes in Y axis + .detail(['Maker']) + .size({ + field: 'Displacement', // Size retinal encoding with Cylinders + range: [0,1000] + }) + .data(rootData) + .layers([{ + mark: 'point' + }]) + .width(500) + .height(500) + .subtitle('size: measure + range') + .mount('#chart1') + + env.canvas() + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Horsepower']) // Displacement goes in Y axis + .detail(['Maker']) + .size({ + field: 'Displacement', // Size retinal encoding with Cylinders + // intervals: 5 + }) + .data(rootData) + .layers([{ + mark: 'point' + }]) + .width(500) + .height(500) + .subtitle('default') + .mount('#chart2') + + env.canvas() + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Year']) // Displacement goes in Y axis + .size({ + field: 'Displacement' + }) + .data(rootData) + .layers([{ + mark: 'point' + }]) + .config({ + legend: { + position: 'bottom' + } + }) + .width(700) + .height(700) + .mount('#chart3') + + env.canvas() + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Year']) // Displacement goes in Y axis + .size({ + field: 'Displacement', + intervals: 15 + }) + .data(rootData) + .layers([{ + mark: 'point' + }]) + .config({ + legend: { + position: 'bottom' + } + }) + .width(700) + .height(700) + .mount('#chart3') + env.canvas() + .rows(['Acceleration']) // Acceleration goes in X axis + .columns(['Year']) // Displacement goes in Y axis + .size({ + field: 'Displacement', + intervals: 15 + }) + .data(rootData) + .layers([{ + mark: 'point' + }]) + .config({ + legend: { + position: 'bottom' + } + }) + .width(1000) + .height(1000) + .mount('#chart4') +}); \ No newline at end of file diff --git a/examples/js/legends/negative-legend.js b/examples/js/legends/negative-legend.js new file mode 100644 index 00000000..615aeed1 --- /dev/null +++ b/examples/js/legends/negative-legend.js @@ -0,0 +1,83 @@ +/* eslint-disable */ +var env = muze(); +var DataModel = muze.DataModel; +d3.json('../data/cars.json', function (data) { + var jsonData = data, + schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension' + //{subtype} + // subtype: 'temporal', + // format: '%Y-%m-%d' + }]; + var rootData = new DataModel(jsonData, schema); + + env = env.data(rootData) + var mountPoint = document.getElementById('chart'); + + env.canvas() + .rows(['Acceleration']) + .columns(['Year']) + .detail(['Maker']) + .color({ + field: 'Displacement', + step: true, + stops: 5 + }) + .data(rootData) + .width(500) + .height(500) + .mount(mountPoint) + + env.canvas() + .height(650) + .rows(['Acceleration']) + .columns(['Year']) + .color({ + field: 'Acceleration', + step: true, + stops: 5 + }) + .config({ + legend: { + position: 'bottom', + color: { + item: { + text: { + formatter: (val, i) => { + return `${val[0]}$ - ${val[1]}$`; + } + } + } + } + } + }) + .mount('#chart5') +}); \ No newline at end of file diff --git a/examples/js/legends/step-config.js b/examples/js/legends/step-config.js new file mode 100644 index 00000000..a9c49463 --- /dev/null +++ b/examples/js/legends/step-config.js @@ -0,0 +1,148 @@ +/* eslint-disable */ + +var env = muze(); + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + + rootData = rootData.groupBy(['Year', 'Origin'], { + + Horsepower: 'mean', + + Acceleration: 'mean' + + }); + + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + var rows = [['Acceleration']], + + columns = [['Year']]; + + + env.canvas() + + .height(650) + + .rows(['Acceleration']) + + .columns(['Year']) + + .color({ + + field: 'Acceleration', + + step: true, + + stops: 5 + + }) + + // .config({ + + // legend: { + + // color: { + + // item: { + + // text: { + + // formatter: (val, i) => { + + // return `${val[0]}$ - ${val[1]}$`; + + // } + + // } + + // } + + // } + + // } + + // }) + .title('Step Config') + + .mount('#chart5') + +}); \ No newline at end of file diff --git a/examples/js/legends/step.js b/examples/js/legends/step.js new file mode 100644 index 00000000..6a9e78a7 --- /dev/null +++ b/examples/js/legends/step.js @@ -0,0 +1,137 @@ +/* eslint-disable */ + +var env = muze(); + +var DataModel = muze.DataModel; + +d3.json('../data/cars.json', function (data) { + + var jsonData = data, + + schema = [{ + + name: 'Name', + + type: 'dimension' + + }, { + + name: 'Maker', + + type: 'dimension' + + }, { + + name: 'Miles_per_Gallon', + + type: 'measure' + + }, { + + name: 'Displacement', + + type: 'measure' + + }, { + + name: 'Horsepower', + + type: 'measure' + + }, { + + name: 'Weight_in_lbs', + + type: 'measure' + + }, { + + name: 'Acceleration', + + type: 'measure' + + }, { + + name: 'Origin', + + type: 'dimension' + + }, { + + name: 'Cylinders', + + type: 'dimension' + + }, { + + name: 'Year', + + type: 'dimension', + + //{subtype} + + // subtype: 'temporal', + + // format: '%Y-%m-%d' + + }]; + + var rootData = new DataModel(jsonData, schema); + + + env = env.data(rootData) + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + + rootData = rootData.groupBy(['Year', 'Origin'], { + + Horsepower: 'mean', + + Acceleration: 'mean' + + }); + + + var mountPoint = document.getElementById('chart'); + + window.canvas = env.canvas(); + + var rows = [['Acceleration']], + + columns = [['Year']]; + + + env.canvas() + + .rows(rows) + + .columns(columns) + + .data(rootData) + + .layers([{ + + mark: 'bar' + + }]) + + .width(800) + + .height(600) + + .color({ + + field: 'Horsepower', + + stops:5, + + step:true + + }) + .title('Step') + .mount('#chart6') + +}); \ No newline at end of file diff --git a/examples/js/pie-to-stackBar.js b/examples/js/pie-to-stackBar.js new file mode 100644 index 00000000..fb1fbae0 --- /dev/null +++ b/examples/js/pie-to-stackBar.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +// const env = muze(); +const DataModel = muze.DataModel; + +function shuffleArray(array) { + for (var i = array.length - 1; i > 0; i--) { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } +} + +d3.json('../../data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + numberFormat: (val) => "$" + val + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + // subtype: 'temporal', + // format: '%Y-%m-%d' + }]; + + var rootData = new DataModel(data, schema); + rootData = rootData.calculateVariable({ + name: "date", + type: "dimension", + subtype: "temporal", + format: "%Y-%m-%d" + }, ["Year", function (d) { + return d; + }]); + + var env = muze().data(rootData).minUnitHeight(40).minUnitWidth(40); + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + canvas = canvas.rows([]).columns([]).height(600).width(650).color('Origin').layers([{ + mark: 'arc', + encoding: { + angle: 'Year' + } + }]).mount(mountPoint); + + setTimeout(() => { + canvas.layers([]).rows(['Acceleration']).columns(['Year']); + + // canvas.height(600).width(650).color('Origin').mount(mountPoint); + }, 3000); +}); \ No newline at end of file diff --git a/examples/js/reference-lines.js b/examples/js/reference-lines.js index a7f91373..c7fe9d1d 100644 --- a/examples/js/reference-lines.js +++ b/examples/js/reference-lines.js @@ -1,139 +1,242 @@ /* eslint-disable */ -(function () { - let env = muze.Muze(); - let DataTable = muze.DataTable, - share = muze.operators.share, - html = muze.operators.html, - layerFactory = muze.layerFactory, - Board = muze.Board; - window.board = new Board(); +// (function () { +// let env = window.muze(); +// var DataModel = window.muze.DataModel; +// var layerFactory = muze.layerFactory; +// var groupBy = DataModel.Operators.groupBy; +// var sort = DataModel.Operators.sort; - layerFactory.composeLayers('compositeBar', [ - { - name: 'simplebar', - mark: 'bar', - encoding: { - x: 'compositeBar.encoding.x', - y: 'compositeBar.encoding.y', - color: 'compositeBar.encoding.color', - }, +// layerFactory.composeLayers('compositeBar', [ +// { +// name: 'simplebar', +// mark: 'bar', +// encoding: { +// x: 'compositeBar.encoding.x', +// y: 'compositeBar.encoding.y', +// color: 'compositeBar.encoding.color', +// }, +// }, +// { +// name: 'averageLine', +// mark: 'point', +// dataSource: 'averageLine', +// encoding: { +// shape: { +// value: 'line' +// }, +// y: 'compositeBar.encoding.y' +// } +// }, +// { +// name: 'averageText', +// mark: 'text', +// dataSource: 'averageLine', +// encoding: { +// y: 'compositeBar.encoding.y', +// text: { +// field: 'compositeBar.encoding.y.field', +// formatter: (value) => { +// return `Average Horsepower: ${Math.round(value)}`; +// } +// }, +// background: { +// enabled: true +// } +// }, +// positioner: (points, store, layerInst) => { +// let width = store.visualunit.width(); +// let smartLabel = layerInst.dependencies().smartLabel; +// for (let i = 0; i < points.length; i++) { +// let size = smartLabel.getOriSize(points[i].text); +// points[i].update.x = width; +// points[i].textanchor = 'end'; +// points[i].update.y -= size.height / 2; +// } +// return points; +// } +// } +// ]); +// d3.json('../../data/cars.json', (data) => { +// const jsonData = data, +// schema = [{ +// name: 'Name', +// type: 'dimension' +// }, +// { +// name: 'Maker', +// type: 'dimension' +// }, +// { +// name: 'Miles_per_Gallon', +// type: 'measure' +// }, + +// { +// name: 'Displacement', +// type: 'measure' +// }, +// { +// name: 'Horsepower', +// type: 'measure' +// }, +// { +// name: 'Weight_in_lbs', +// type: 'measure', +// }, +// { +// name: 'Acceleration', +// type: 'measure' +// }, +// { +// name: 'Origin', +// type: 'dimension' +// }, +// { +// name: 'Cylinders', +// type: 'dimension' +// }, +// { +// name: 'Year', +// type: 'dimension' +// }, + +// ]; +// let rootData = new DataModel(jsonData, schema); + +// rootData = rootData.groupBy(['Year'], { +// Horsepower: 'avg', +// Acceleration: 'avg' +// }); + +// env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); +// let mountPoint = document.getElementById('chart'); +// window.canvas = env.canvas(); +// let canvas2 = env.canvas(); +// let canvas3 = env.canvas(); +// let rows = ['Horsepower'], +// columns = ['Year']; +// canvas = canvas +// .rows(rows) +// .columns(columns) +// .data(rootData) +// // .color('Displacement') +// .transform([ +// ['averageLine', [(dt) => dt.groupBy([''], { Horsepower: 'avg'})]] +// ]) +// .layers({ +// Horsepower: { +// mark: 'compositeBar', +// } +// }) +// .width(800) +// .height(400) +// .mount(mountPoint); +// }) + +// })() + +d3.json('../../data/cars.json', function (data) { + // load data and schema from url + // Retrieves the DataModel from muze namespace. Muze recognizes DataModel as a first class source of data. + var DataModel = window.muze.DataModel; + // Get the factory to compose new layers + var layerFactory = muze.layerFactory; + // Import the reference to the DataModel operator + var groupBy = DataModel.Operators.groupBy; + var sort = DataModel.Operators.sort; + + // Compose layers to draw the bars as well as the reference line and text + layerFactory.composeLayers('compositeBar', [{ + name: 'simplebar', + mark: 'bar', + encoding: { + x: 'compositeBar.encoding.x', + y: 'compositeBar.encoding.y', + color: 'compositeBar.encoding.color' + } + }, { + name: 'averageLine', + mark: 'tick', + source: 'averageLine', + className: 'averageLine', + encoding: { + y: 'compositeBar.encoding.y', + x: null }, - { - name: 'averageLine', - mark: 'point', - dataSource: 'averageLine', - encoding: { - shape: { - value: 'line' - }, - y: 'compositeBar.encoding.y' + calculateDomain: false + }, { + name: 'averageText', + mark: 'text', + source: 'averageLine', + className: 'averageText', + encoding: { + y: 'compositeBar.encoding.y', + text: 'compositeBar.encoding.text', + background: { + enabled: true } }, - { - name: 'averageText', - mark: 'text', - dataSource: 'averageLine', - encoding: { - y: 'compositeBar.encoding.y', - text: { - field: 'compositeBar.encoding.y.field', - formatter: (value) => { - return `Average Horsepower: ${Math.round(value)}`; - } - }, - background: { - enabled: true - } - }, - positioner: (points, store, layerInst) => { - let width = store.visualunit.width(); - let smartLabel = layerInst.dependencies().smartLabel; - for (let i = 0; i < points.length; i++) { - let size = smartLabel.getOriSize(points[i].text); - points[i].update.x = width; - points[i].textanchor = 'end'; - points[i].update.y -= size.height / 2; - } - return points; + encodingTransform: function encodingTransform(points, layer, dependencies) { + // Transforms the test after the physical dimension is resolved so that it comes in the middle of the background + var width = layer.measurement().width; + var smartLabel = dependencies.smartLabel; + for (var i = 0; i < points.length; i++) { + var size = smartLabel.getOriSize(points[i].text); + points[i].update.x = width - 5; + points[i].textanchor = 'end'; + points[i].update.y -= size.height / 2; + points[i].color = '#000'; } - } - ]); - d3.json('../../data/cars.json', (data) => { - const jsonData = data, - schema = [{ - name: 'Name', - type: 'dimension' - }, - { - name: 'Maker', - type: 'dimension' - }, - { - name: 'Miles_per_Gallon', - type: 'measure' - }, + return points; + }, + calculateDomain: false + }]); - { - name: 'Displacement', - type: 'measure' - }, - { - name: 'Horsepower', - type: 'measure' - }, - { - name: 'Weight_in_lbs', - type: 'measure', - }, - { - name: 'Acceleration', - type: 'measure' - }, - { - name: 'Origin', - type: 'dimension' - }, - { - name: 'Cylinders', - type: 'dimension' - }, - { - name: 'Year', - type: 'dimension' - }, + // Schema for the data + var schema = [{ name: 'Name', type: 'dimension' }, { name: 'Maker', type: 'dimension' }, { name: 'Miles_per_Gallon', type: 'measure', defAggFn: 'max' }, { name: 'Displacement', type: 'measure', defAggFn: 'max' }, { name: 'Horsepower', type: 'measure', defAggFn: 'avg' }, { name: 'Weight_in_lbs', type: 'measure', defAggFn: 'min' }, { name: 'Acceleration', type: 'measure', defAggFn: 'avg' }, { name: 'Origin', type: 'dimension' }, { name: 'Cylinders', type: 'dimension' }, { name: 'Year', type: 'dimension' }]; - ]; - let rootData = new DataTable(jsonData, schema); + var rootData = new DataModel(data, schema); - rootData = rootData.groupBy(['Year'], { - Horsepower: 'avg', - Acceleration: 'avg' - }); + // Apply groupBy and sorting from outside muze. Muze internally perfoms gouping of data to eliminate duplicate data. Sorting followed by groupBy does not + // ensure retention of the order of data defined by sorting. Hence we do grouping and sorting from outside the visualizaiton. + rootData = groupBy(['Year'], { + Horsepower: 'max', + Acceleration: 'avg' + })(rootData); + rootData = sort([['Horsepower', 'DESC']])(rootData); - env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); - let mountPoint = document.getElementById('chart'); - window.canvas = env.canvas(); - let canvas2 = env.canvas(); - let canvas3 = env.canvas(); - let rows = ['Horsepower'], - columns = ['Year']; - canvas = canvas - .rows(rows) - .columns(columns) - .data(rootData) - // .color('Displacement') - .transform([ - ['averageLine', [(dt) => dt.groupBy([''], { Horsepower: 'avg'})]] - ]) - .layers({ - Horsepower: { - mark: 'compositeBar', + // Create an environment for future rendering + var env = window.muze(); + // Create an instance of canvas which houses the visualization + var canvas = env.canvas(); + + canvas = canvas.rows(['Horsepower']) // Horsepower goes in Y-Axis + .columns(['Year']) // Year goes in X-Axis + .data(rootData).transform({ // Create different sources (data) from the root source (data). Layers can access these sources and draw any visualization + 'averageLine': function averageLine(dt) { + return dt.groupBy([''], { Horsepower: 'avg' }); + } // Removes all the dim and aggregate the measures + }).layers([{ + mark: 'compositeBar', + encoding: { + text: { + field: 'Horsepower', + formatter: function formatter(value) { + return 'Average Horsepower: ' + Math.round(value); } - }) - .width(800) - .height(400) - .mount(mountPoint); - }) + } + } + }]).config({ + autoGroupBy: { // Dont perform groupBy internally, as sorting order was specified + disabled: true + } + }).width(600).height(400) + //.title('Sorted bar with trendline', { position: "top", align: "left", }) + .title('The car acceleration respective to origin', { position: 'bottom', align: 'center' }).subtitle('Average horsepower per year with average horsepower of all time marked as reference', { position: "top", align: "left" }).mount(document.getElementById('chart')); -})() + canvas.once('canvas.animationend').then(function (client) { + var element = document.getElementById('chart'); + element.classList.add('animateon'); + }); +}); diff --git a/examples/js/sample3.js b/examples/js/sample3.js index aacea5a6..61a3c7b5 100644 --- a/examples/js/sample3.js +++ b/examples/js/sample3.js @@ -1,5 +1,5 @@ /* eslint-disable */ -const env = muze(); +let env = muze(); const DataModel = muze.DataModel; function shuffleArray(array) { @@ -61,74 +61,87 @@ d3.json('../../data/cars.json', (data) => { // format: '%Y-%m-%d' } ]; - jsonData = [ - { - Origin: 'USA', - Cylinders: 5, - Name: 'x', - Horsepower: 12 - }, + // jsonData = [ + // { + // Origin: 'USA', + // Cylinders: 5, + // Name: 'x', + // Horsepower: 12 + // }, - { - Origin: 'Japan', - Cylinders: 3, - Name: 'z', - Horsepower: 12 - }, - { - Origin: 'Japan', - Cylinders: 3, - Name: 'k', - Horsepower: 12 - }, - { - Origin: 'Japan', - Cylinders: 5, - Name: 'x', - Horsepower: 12 - }, - { - Origin: 'Europe', - Cylinders: 3, - Name: 'x', - Horsepower: 12 - }, - { - Origin: 'Europe', - Cylinders: 3, - Name: 'r', - Horsepower: 12 - }, - { - Origin: 'Europe', - Cylinders: 5, - Name: 'x', - Horsepower: 12 - }, - ] + // { + // Origin: 'Japan', + // Cylinders: 3, + // Name: 'z', + // Horsepower: 12 + // }, + // { + // Origin: 'Japan', + // Cylinders: 3, + // Name: 'k', + // Horsepower: 12 + // }, + // { + // Origin: 'Japan', + // Cylinders: 5, + // Name: 'x', + // Horsepower: 12 + // }, + // { + // Origin: 'Europe', + // Cylinders: 3, + // Name: 'x', + // Horsepower: 12 + // }, + // { + // Origin: 'Europe', + // Cylinders: 3, + // Name: 'r', + // Horsepower: 12 + // }, + // { + // Origin: 'Europe', + // Cylinders: 5, + // Name: 'x', + // Horsepower: 12 + // }, + // ] - let rootData = new DataModel(jsonData, schema) - console.log(rootData.sort([ - ['Cylinders', null], - ['Origin', 'desc'], - ['Name', 'asc'] - ]).getData().data); + var rootData = new DataModel(jsonData, schema); + rootData = rootData.calculateVariable({ + name: "date", + type: "dimension", + subtype: "temporal", + format: "%Y-%m-%d" + }, ["Year", function (d) { + return d; + }]); + env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); + var mountPoint = document.getElementById('chart'); + window.canvas = env.canvas(); + var rows = ['Cylinders', 'Horsepower', 'Acceleration'], + columns = ['Origin', 'Year']; + canvas = canvas.rows(rows).columns(columns).height(800).color('Origin').width(500) + //{initProps} + .mount('#chart'); - const canvas = env.canvas(); - canvas - .data(rootData) - .width(850) - .height(550) - .rows(["Cylinders", "Origin", "Name"]) - .columns(["Horsepower"]) - .mount("#chart") - .config({ - showHeaders: true, - sort: { - Origin: "asc", - Name: "asc" - } - }) + var rows = ['Horsepower', 'Acceleration'], + columns = ['Cylinders']; + window.canvas2 = env.canvas().rows(rows).columns(columns).height(800).width(500) + //{initProps} + .mount('#chart2'); + + // muze.ActionModel.for(canvas, canvas2).enableCrossInteractivity() + // .registerPropagationBehaviourMap({ + // select: 'filter' + // }) + // canvas.once('canvas.animationend').then(function (client) { + // canvas.rows(['Horsepower', 'Acceleration']).columns(['Acceleration', 'Horsepower']).color('Horsepower').size('Cylinders').detail(['Maker']).width(300).height(300); + // canvas.once('canvas.animationend').then(function (client) { + // var element = document.getElementById('chart'); + // element.classList.add('animateon'); + // }); + // }); }); diff --git a/examples/js/simple-bar.js b/examples/js/simple-bar.js new file mode 100644 index 00000000..14a5c05d --- /dev/null +++ b/examples/js/simple-bar.js @@ -0,0 +1,49 @@ +d3.json('/data/cars.json', (data) => { + // load data and schema from url + const schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension', + subtype: 'temporal', + format: '%Y-%m-%d' + }]; + const DataModel = window.muze.DataModel; + const dm = new DataModel(data, schema); + const html = muze.Operators.html; + const env = window.muze(); + const canvas = env.canvas(); + canvas.data(dm).width(600).height(400).rows(['Horsepower']).columns(['Weight_in_lbs']).color({ + field: 'Miles_per_Gallon', + stops: [15, 30, 45, 60] + }).detail(['Name']).mount('#chart').title('The car acceleration respective to origin', { position: 'bottom', align: 'left' }); + canvas.once('canvas.animationend').then((client) => { + const element = document.getElementById('chart'); + element.classList.add('animateon'); + }); +}); diff --git a/examples/js/simple-scatter.js b/examples/js/simple-scatter.js new file mode 100644 index 00000000..71d17957 --- /dev/null +++ b/examples/js/simple-scatter.js @@ -0,0 +1,73 @@ +/* eslint-disable */ + +(function () { + let env = window.muze(); + const DataModel = window.muze.DataModel; + + d3.json('/data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure' + }, + { + name: 'Acceleration', + type: 'measure', + }, + { + name: 'Origin', + type: 'dimension', + displayName: "Origin2" + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + subtype: 'temporal', + format: '%Y-%m-%d' + } + ]; + + let rootData = new DataModel(data, schema) + const canvas = env.canvas(); + + canvas + .data(rootData) + .columns(['Acceleration']) + .rows(['Year']) + .layers([{ + mark: 'point' + }]) + .color('Origin') + .size('Horsepower') + // .shape('Origin') + // .detail(['Name']) + .mount('#chart') + .height(700) + .width(1000) + .title('Charts'); + }) +})(); \ No newline at end of file diff --git a/examples/js/stackBar.js b/examples/js/stackBar.js index 708ce4cb..61852acf 100644 --- a/examples/js/stackBar.js +++ b/examples/js/stackBar.js @@ -69,13 +69,13 @@ d3.json('../../data/cars.json', (data) => { const canvas = env.canvas(); canvas - .rows(['CountVehicle']) // CountVehicle goes in y axis + .rows(['Horsepower']) // CountVehicle goes in y axis .columns(['Cylinders']) // Cylinders goes in x-axis .color('Origin') // Colors encoding using the Origin field .config({ legend: { - position: 'bottom' - } + position: 'bottom' + } }) .data(dmWithCount) .layers({ // Draw a bar plot, by default stack transform is used @@ -87,5 +87,5 @@ d3.json('../../data/cars.json', (data) => { .height(400) .title('Stacked bar chart', { position: 'top', align: 'right' }) .subtitle('Count of cars per cylinder per origin', { position: 'top', align: 'right' }) - .mount('#chart-container'); // Set the chart mount point + .mount('#chart'); // Set the chart mount point }); diff --git a/examples/js/tooltips/area.js b/examples/js/tooltips/area.js index f24659c4..065eee4f 100644 --- a/examples/js/tooltips/area.js +++ b/examples/js/tooltips/area.js @@ -1,35 +1,9 @@ /* eslint-disable */ -const env = muze(); -const DataModel = muze.DataModel; -d3.json('../../data/cars.json', (data) => { + +d3.json('../../data/cars-with-null.json', (data) => { let jsonData = data; const schema = [{ - name: 'Name', - type: 'dimension' - }, - { - name: 'Maker', - type: 'dimension' - }, - { - name: 'Miles_per_Gallon', - type: 'measure' - }, - - { - name: 'Displacement', - type: 'measure' - }, - { - name: 'Horsepower', - type: 'measure' - }, - { - name: 'Weight_in_lbs', - type: 'measure' - }, - { name: 'Acceleration', type: 'measure' }, @@ -37,31 +11,67 @@ d3.json('../../data/cars.json', (data) => { name: 'Origin', type: 'dimension' }, - { - name: 'Cylinders', - type: 'dimension' - }, { name: 'Year', type: 'dimension' } ]; + const env = muze(); + const DataModel = muze.DataModel; let rootData = new DataModel(jsonData, schema); - let canvas = env.canvas(); + // const filtered = rootData.select((tuples) => { + // return tuples.Origin.value === 'Holland'; + // }); - canvas = canvas - .rows(['Acceleration']) // Acceleration goes in Y-Axis - .columns(['Year']) // Horsepower goes in Y-Axis - .data(rootData) - .layers([{ - mark : 'area', - interpolate: 'catmullRom' /* spline */ - }]) - .width(450) - .height(250) - .rows(['Weight_in_lbs']) - .columns(['Year']) - .title('Area') - .mount("#chart1"); + env.canvas() + .rows(['Acceleration']) // Acceleration goes in Y-Axis + .columns(['Year']) // Horsepower goes in Y-Axis + .data(rootData) + .color('Origin') + .width(550) + .height(650) + .title('Area') + .mount("#chart1"); + + // env.canvas() + // .rows(['Acceleration']) // Acceleration goes in Y-Axis + // .columns(['Year']) // Horsepower goes in Y-Axis + // .data(rootData) + // .layers([{ + // mark : 'area', + // connectNullData: true + // }]) + // .color('Origin') + // .width(850) + // .height(650) + // .title('Area') + // .mount("#chart1"); + + // env.canvas() + // .rows(['Acceleration']) // Acceleration goes in Y-Axis + // .columns(['Year']) // Horsepower goes in Y-Axis + // .data(filtered) + // .layers([{ + // mark : 'area', + // connectNullData: false + // }]) + // .color('Origin') + // .width(850) + // .height(650) + // .title('Area') + // .mount("#chart1"); + // env.canvas() + // .rows(['Acceleration']) // Acceleration goes in Y-Axis + // .columns(['Year']) // Horsepower goes in Y-Axis + // .data(filtered) + // .layers([{ + // mark : 'area', + // connectNullData: true + // }]) + // .color('Origin') + // .width(850) + // .height(650) + // .title('Area') + // .mount("#chart1"); }); diff --git a/examples/js/tooltips/composition-of-layer.js b/examples/js/tooltips/composition-of-layer.js index d6bf6f7e..9116c8ab 100644 --- a/examples/js/tooltips/composition-of-layer.js +++ b/examples/js/tooltips/composition-of-layer.js @@ -1,6 +1,6 @@ /* eslint-disable */ let env8 = muze(); -const DataModel8 = muze.DataModel8; +const DataModel = muze.DataModel; const share8 = muze.Operators.share; const DateTimeFormatter8 = muze.utils.DateTimeFormatter; @@ -189,5 +189,5 @@ d3.csv('../../data/weather.csv', (data8) => { }]) .subtitle('Days at or above 32°C per year from the time you were born') .title('Composition of layers') - .mount('#chart8'); + .mount('#chart'); }); \ No newline at end of file diff --git a/examples/js/tooltips/crosstab.js b/examples/js/tooltips/crosstab.js index 1d0f1a09..8967311d 100644 --- a/examples/js/tooltips/crosstab.js +++ b/examples/js/tooltips/crosstab.js @@ -37,25 +37,41 @@ d3.csv('../../data/coffee.csv', (data) => { let canvas7 = env7.canvas(); canvas7 = canvas7 - .rows(['Market', 'Product Type']) + .rows([['Market', 'Product Type', 'Product']]) .columns([['Revenue', 'Expense'], ['Revenue', 'Expense']]) .data(rootData7) - .width(550) - .height(300) + .width(750) + .height(1300) .config({ - showHeaders: true, /* show the headers of fields used in faceting */ - facetConfig: { rows: { verticalAlign: 'middle' } }, /* dimensional values are placed in middle */ - axes: { - y: { showAxisName: false }, /* dont show axis name as we are showing headers, its redundant information */ - x: { - tickFormat: (d) => { - if (d < 1000) return d; - if (d > 1000 && d < 1000000) return `${d / 1000}K` - if (d > 1000000) return `${d / 1000}M` - return d - } - } - } + showHeaders: true, /* show the headers of fields used in faceting */ + axes: { + y: { showAxisName: false }, /* dont show axis name as we are showing headers, its redundant information */ + x: { + tickFormat: (d) => { + if (d < 1000) return d; + if (d > 1000 && d < 1000000) return `${d / 1000}K` + if (d > 1000000) return `${d / 1000}M` + return d + } + } + }, + facetConfig: { rows: { verticalAlign: 'bottom' } }, /* dimensional values are placed in middle */ + border:{ + showRowBorders: { + top: true, + bottom: true, + }, + showColBorders:{ + left: true, + right: true + }, + showValueBorders: { + top: true, + bottom: true, + left: true, + right: true + } + }, }) .title('Visual Crosstab') .subtitle('Revenue and Expense by Product type and Market') diff --git a/examples/js/tooltips/line.js b/examples/js/tooltips/line.js index 900ff2af..5fab9305 100644 --- a/examples/js/tooltips/line.js +++ b/examples/js/tooltips/line.js @@ -46,7 +46,18 @@ d3.json('../../data/cars.json', (data) => { } ]; let rootData1 = new DataModel1(jsonData1, schema1); - let canvas1 = env1.canvas(); - canvas1 = canvas1.data(rootData1).width(600).height(400).columns(['Cylinders']).size('Weight_in_lbs').color('Weight_in_lbs').rows(['Horsepower']).detail(['Maker']).layers([{ mark: 'point' }]).title('The car acceleration respective to origin', { position: 'bottom', align: 'left' }).mount("#chart2"); + env1.canvas().data(rootData1).width(600).height(400).rows(['Horsepower']).columns(['Origin']) + .layer([{ + mark: 'point' + }]) + .config({ + legend: { + color: { + item: { + text: { orientation: 'bottom' } + } + } + } + }).color('Origin').mount('#chart2').title('The car acceleration respective to origin', { position: 'bottom', align: 'left' }); }); diff --git a/examples/js/tooltips/scatter-plot.js b/examples/js/tooltips/scatter-plot.js index 96deacb3..58ae7d16 100644 --- a/examples/js/tooltips/scatter-plot.js +++ b/examples/js/tooltips/scatter-plot.js @@ -52,15 +52,16 @@ d3.json('../../data/cars.json', (data) => { rootData2 = rootData2.select(fields => makers.indexOf(fields.Maker.value) > -1); canvas2 = canvas2 - .rows(['Acceleration']) // Acceleration goes in Y-Axis - .columns(['Horsepower']) // Horsepower goes in Y-Axis - .color('Origin') // Color the points from using Origin - .shape('Maker') // Use maker for shape encoding - .detail(['Name']) // Use Name to add granurality of the points - .data(rootData2) - .width(450) - .height(350) - .title('Scatter with shape and color legend') - .mount("#chart3"); + .rows(['Horsepower']) // Acceleration goes in Y-Axis + .columns(['Year']) // Horsepower goes in Y-Axis + .size('Acceleration') // Use maker for shape encoding + .data(rootData2) + .width(450) + .height(350) + .layers([{ + mark: 'point' + }]) + .title('Scatter with shape and color legend') + .mount("#chart3"); }); diff --git a/examples/js/tooltips/simple-bar.js b/examples/js/tooltips/simple-bar.js index ee8241b5..53231be0 100644 --- a/examples/js/tooltips/simple-bar.js +++ b/examples/js/tooltips/simple-bar.js @@ -1,10 +1,10 @@ /* eslint-disable */ -const env3 = muze(); -const DataModel3= muze.DataModel; +const env = muze(); +const DataModel = muze.DataModel; d3.json('../../data/cars.json', (data) => { - let jsonData3 = data; - const schema3 = [{ + let jsonData = data; + const schema = [{ name: 'Name', type: 'dimension' }, @@ -46,16 +46,19 @@ d3.json('../../data/cars.json', (data) => { type: 'dimension' } ]; - let rootData3 = new DataModel3(jsonData3, schema3); - let canvas3 = env3.canvas(); - - canvas3 = canvas3 - .rows([['Acceleration'], ['Horsepower']]) // Acceleration goes in Y-Axis - .columns(['Year']) // Horsepower goes in Y-Axis - .data(rootData3) - .width(650) - .height(550) - .color('Origin') - .mount(chart3) -}); + var rootData = new DataModel(data, schema, { dataFormat: "FlatJSON" }); + var canvas = env.canvas(); + var rows = ["Acceleration"]; + var columns = ["Origin"]; + canvas + .mount('#chart1') + .width(600) + .data(rootData) + .rows(rows) + .height(500) + .columns(columns) + .color({ + field: 'Maker' + }) +}); diff --git a/examples/js/tooltips/stacked-bar.js b/examples/js/tooltips/stacked-bar.js index 5a8695de..40fddc2f 100644 --- a/examples/js/tooltips/stacked-bar.js +++ b/examples/js/tooltips/stacked-bar.js @@ -16,7 +16,6 @@ d3.json('../../data/cars.json', (data) => { name: 'Miles_per_Gallon', type: 'measure' }, - { name: 'Displacement', type: 'measure' @@ -54,8 +53,9 @@ d3.json('../../data/cars.json', (data) => { .columns(['Year']) // Horsepower goes in Y-Axis .color('Origin') // Color the points from using Origin .data(rootData4) - .width(450) - .height(350) + .width(750) + .height(550) + .detail('Cylinders') .title('Stacked Bar Chart') .mount("#chart5"); }); diff --git a/examples/js/untitled.js b/examples/js/untitled.js deleted file mode 100644 index a5602b79..00000000 --- a/examples/js/untitled.js +++ /dev/null @@ -1,69 +0,0 @@ - -function hull (points) { - const sortedPoints = points.sort((a, b) => b.y - a.y); - const minPoint = sortedPoints[0]; - let angles = []; - for (let i = 1; i < sortedPoints.length; i++) { - let p1 = sortedPoints[i]; - let p2 = minPoint; - let addAngle = 0; - if (p1.x < p2.x) { - addAngle = 90; - } - let angle = Math.atan(Math.abs(p1.y - p2.y) / Math.abs(p1.x - p2.x)) * (180 / Math.PI); - if (angle >= 0) { - angle = addAngle + (addAngle - angle); - } - angles.push({ - point: p1, - angle - }); - } - - console.log(angles); - angles = angles.sort((a, b) => a.angle - b.angle).map(d => d.point); - angles.unshift(minPoint); - const hullPoints = []; - for (let i = 0; i < angles.length; i++) { - if (i - 2 < 0) { - hullPoints.push(angles[i]); - } else { - let p1 = angles[i - 2]; - let p2 = angles[i - 1]; - let p3 = angles[i]; - const dt = (p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x); - if (dt > 0) { - hullPoints.pop(); - } - hullPoints.push(p3); - } - } - console.log(hullPoints); - hullPoints.push(angles[0]); - d3.select('svg').append('path').attr('d', d3.line().x(d => d.x).y(d => d.y)(hullPoints)) - .style('stroke-width', '2px').style('stroke', '#000').style('fill-opacity', 0) -} - - -function createEnv () { - d3.selectAll('svg').remove(); - d3.select('body').append('svg').attr('width', 500).attr('height', 500).style('background', '#ff0000'); - let points = []; - d3.select('body').append('button').on('click', () => { - hull(points.map(d => ({ - x: d[0], - y: d[1] - }))); - }).attr('value', 'click') - d3.select('svg').on('click', function () { - const x = d3.event.x; - const y = d3.event.y; - const point = d3.mouse(this); - points.push(point); - d3.select('svg').selectAll('circle').data(points) - .enter() - .append('circle').attr('cx', d => d[0]).attr('cy', d => d[1]).attr('r', 2).style('stroke', '#000') - .style('stroke-width', '1px'); - }); -} -createEnv(); \ No newline at end of file diff --git a/examples/js/well-being-index.js b/examples/js/well-being-index.js new file mode 100644 index 00000000..f0f67400 --- /dev/null +++ b/examples/js/well-being-index.js @@ -0,0 +1,262 @@ +/* eslint-disable */ +const style = `body, +html { + font-family: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif; + width: 100%; + height: 100%; +} + +.muze-layer-text text { + alignment-baseline: central; +} + +.muze-layer-point { + fill-opacity: 1 !important; +} + +.smiley circle, +ellipse { + stroke: #937702 !important; + stroke-width: .5; + stroke-opacity: .4; +} + +.smiley-expression line, +.smiley-expression path { + fill: none; + stroke: #000 !important; + stroke-width: .5; +} + +#chart-container { + overflow-y: auto !important; + text-align: center; + padding: 0px 10px 10px 10px; + height: auto; + min-height: 350px; +} + +ellipse.st1 { + fill: #000 !important; + fill-opacity: 1 !important; +}`; + +const node = document.createElement('style'); +node.innerHTML = style; +document.body.appendChild(node); + +d3.csv('/data/well-being-index.csv', (data) => { // load data and schema from url + const schema = [ + { + name: 'State', + type: 'dimension' + }, + { + name: 'State Codes', + type: 'dimension' + }, + { + name: 'Well-being Index', + type: 'measure', + defAggFn: 'max' + }, + { + name: 'Latitude', + type: 'measure', + defAggFn: 'avg' + }, + { + name: 'Longitude', + type: 'measure', + defAggFn: 'avg' + } + ]; + const env = window.muze(); + const DataModel = window.muze.DataModel; + const html = muze.Operators.html; + const smileys = { + smiley1: '', + smiley2: '', + smiley3: '', + smiley4: '', + smiley5: '' + }; + + let rootData = new DataModel(data, schema); + + const stateGrid = [ + [null, null, null, null, null, 'WI', null, null, null, 'VT', 'ME'], + ['WA', 'ID', 'MT', 'ND', 'MN', 'IL', 'MI', null, 'NY', 'MA', 'NH'], + ['OR', 'NV', 'WY', 'SD', 'IN', 'IA', 'OH', 'PA', 'NJ', 'CT', 'RI'], + ['CA', 'UT', 'CO', 'NE', 'MO', 'KY', 'WV', 'VA', 'MD', 'DE', null], + [null, 'AZ', 'NM', 'KS', 'AR', 'TN', 'NC', 'SC', null, null, null], + [null, null, null, 'OK', 'LA', 'MS', 'AL', 'GA', null, null, null], + ['HI', 'AK', null, 'TX', null, null, null, null, 'FL', null, null] + ]; + const alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']; + rootData = rootData.calculateVariable( + { + name: 'Latiudinal-Dimension', + type: 'dimension' + }, + ['State Codes', (state) => { + let x = -1; + stateGrid.forEach((e, i) => { + if (e.indexOf(state) > -1) { + x = `${i}`; + } + }); + return alphabets[x]; + }] + ); + rootData = rootData.calculateVariable( + { + name: 'Longitudinal-Dimension', + type: 'dimension' + }, + ['State Codes', (state) => { + let x = -1; + stateGrid.forEach((e) => { + if (e.indexOf(state) > -1) { + x = `${e.indexOf(state)}`; + } + }); + return alphabets[x]; + }] + ); + + rootData = rootData.sort([['Well-being Index']]); + let wellBeingArray = []; + + DataModel.Reducers.register('aggFn', (arr) => { + wellBeingArray = arr; + return 1; + }); + const max = rootData.groupBy([''], { + 'Well-being Index': 'aggFn' + }); + const quantiles = Math.round(wellBeingArray.length / 5); + rootData = rootData.calculateVariable( + { + name: 'Well-being-quantile', + type: 'dimension' + }, + ['Well-being Index', (wbIndex) => { + const index = wellBeingArray.indexOf(wbIndex); + return Math.floor(index / quantiles); + }] + ); + rootData = rootData.sort([ + ['Longitudinal-Dimension', 'asc'], + ['Latiudinal-Dimension', 'asc'] + + ]); + + window.canvas = env.canvas() + .rows(['Latiudinal-Dimension']) + .columns(['Longitudinal-Dimension']) + .shape({ + field: 'Well-being-quantile', + domain: ['0', '1', '2', '3', '4'], + generator: (val, i) => { + const pathVar = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + pathVar.innerHTML = smileys[`smiley${+val + 1}`]; + pathVar.setAttribute('class', 'smiley-icon'); + return pathVar; + } + }) + .detail(['State Codes', 'State', 'Well-being Index']) + .data(rootData) + .width(830) + .height(650) + .layers([{ + mark: 'point' + }, { + mark: 'text', + encoding: { + text: 'State Codes', + color: { + value: () => 'rgba(0,0,0,.4)' + } + }, + encodingTransform: (points) => { + points.forEach((e) => { + e.update.y += 30; + }); + return points; + } + }]) + .config({ + gridLines: { + y: { + show: true + } + }, + border: { + showValueBorders: { + left: false, + bottom: false + } + }, + axes: { + y: { + domain: ['a', 'b', 'c', 'd', 'e', 'f', 'g'].reverse(), + show: false + }, + x: { + show: false + } + } + }) + .config({ + gridLines: { + y: { + show: false + } + }, + interaction: { + tooltip: { + formatter: (dataModel, context) => { + const tooltipData = dataModel.getData().data; + const fieldConfig = dataModel.getFieldsConfig(); + + let tooltipContent = ''; + tooltipData.forEach((dataArray, i) => { + const state = dataArray[fieldConfig.State.index]; + const wellBeing = dataArray[fieldConfig['Well-being Index'].index]; + const quant = dataArray[fieldConfig['Well-being-quantile'].index]; + const wellBeingTypes = ['Poor', 'Less Than Average', 'Average', 'Above Average', 'Excellent']; + + tooltipContent += `

The state of ${state} has a well being score of ${wellBeing} + providing a ${wellBeingTypes[quant]} quality of life

`; + }); + return html`${tooltipContent}`; + } + } + }, + legend: { + position: 'bottom', + shape: { + title: { text: 'Well Being Score' }, + item: { + icon: { + height: 50, + width: 50 + }, + text: { + formatter: () => '', + orientation: 'bottom' + } + } + } + } + }) + // .title('Where to find the good life in USA?', {align: 'center'}) + // {title} + .subtitle('An example of Custom Shapes provided in Shape Encoding', { align: 'center' }) + .mount('#chart'); + canvas.once('canvas.animationend').then((client) => { + const element = document.getElementById('chart'); + element.classList.add('animateon'); + }); +}); diff --git a/examples/js/wildfire.js b/examples/js/wildfire.js index 4bacbdd0..8cdbb165 100644 --- a/examples/js/wildfire.js +++ b/examples/js/wildfire.js @@ -5,20 +5,20 @@ const html = muze.Operators.html; d3.csv('../data/wildfires.csv', (data) => { const schema = [ { - 'name': 'year', + name: 'year', type: 'dimension' }, { name: 'gis_acres', - 'type': 'measure', + type: 'measure', defAggFn: 'avg' }, { name: 'fire_name', - 'type': 'dimension' + type: 'dimension' }, { - 'name': 'alarm_date', + name: 'alarm_date', type: 'dimension' } ]; @@ -45,57 +45,57 @@ d3.csv('../data/wildfires.csv', (data) => { .detail(['fire_name']) .color({ value: 'rgba(255, 156, 25, 0.5)' }) .size({ - field: 'gis_acres', - range: [1, 450] - }) + field: 'gis_acres', + range: [1, 450] + }) .layers([{ mark: 'point' }]) .title('Wildfires over the year for different months') .subtitle('Use data operators to transform data and visualize it and size (retinal) encoding channel to encode more information') .config({ - autoGroupBy: { disabled: true }, - gridLines: { - y: { show: true } - }, - border: { - showValueBorders: { left: false, bottom: false } - }, - axes: { - y: { - tickValues: [1950, 1970, 1990, 2010], - showAxisName: false - }, - x: { - tickFormat: val => months[new Date(val).getMonth()], - showInnerTicks: false, - showAxisName: false - } - }, - interaction: { - tooltip: { - formatter: (dataModel, context) => { - const tooltipData = dataModel.getData().data; - const fieldConfig = dataModel.getFieldsConfig(); + autoGroupBy: { disabled: true }, + gridLines: { + y: { show: true } + }, + border: { + showValueBorders: { left: false, bottom: false } + }, + axes: { + y: { + tickValues: [1950, 1970, 1990, 2010], + showAxisName: false + }, + x: { + tickFormat: val => months[new Date(val).getMonth()], + showInnerTicks: false, + showAxisName: false + } + }, + interaction: { + tooltip: { + formatter: (dataModel, context) => { + const tooltipData = dataModel.getData().data; + const fieldConfig = dataModel.getFieldsConfig(); - let tooltipContent = ''; - tooltipData.forEach((dataArray, i) => { - const fireName = dataArray[fieldConfig.fire_name.index]; - const monthsOfFire = new Date(dataArray[fieldConfig['Months of Fire'].index]); - const year = dataArray[fieldConfig.year.index]; - const acres = dataArray[fieldConfig.gis_acres.index]; + let tooltipContent = ''; + tooltipData.forEach((dataArray, i) => { + const fireName = dataArray[fieldConfig.fire_name.index]; + const monthsOfFire = new Date(dataArray[fieldConfig['Months of Fire'].index]); + const year = dataArray[fieldConfig.year.index]; + const acres = dataArray[fieldConfig.gis_acres.index]; - const date = monthsOfFire.getDate(); - const month = months[monthsOfFire.getMonth()]; + const date = monthsOfFire.getDate(); + const month = months[monthsOfFire.getMonth()]; - tooltipContent += `

The ${fireName} fire on ${date} ${month}, ${year} + tooltipContent += `

The ${fireName} fire on ${date} ${month}, ${year} affected ${acres.toFixed(2)} acres of land

`; - }); - return html`${tooltipContent}`; - } - } - }, - legend: { - size: { show: false } - } - }) - .mount('#chart-container'); + }); + return html`${tooltipContent}`; + } + } + }, + legend: { + size: { show: false } + } + }) + .mount('#chart'); }); diff --git a/examples/samples/design-samples/scatter-shape.js b/examples/samples/design-samples/scatter-shape.js index 03889756..1f252640 100644 --- a/examples/samples/design-samples/scatter-shape.js +++ b/examples/samples/design-samples/scatter-shape.js @@ -1,129 +1,69 @@ /* eslint-disable */ - -(function () { - let env = muze.Muze(); - let DataTable = muze.DataTable, - share = muze.operators.share, - html = muze.operators.html, - Board = muze.Board; - window.board = new Board(); - - - d3.json('../../../data/cars.json', (data) => { - const jsonData = data, - schema = [{ - name: 'Name', - type: 'dimension' - }, - { - name: 'Maker', - type: 'dimension' - }, - { - name: 'Miles_per_Gallon', - type: 'measure' - }, - - { - name: 'Displacement', - type: 'measure' - }, - { - name: 'Horsepower', - type: 'measure' - }, - { - name: 'Weight_in_lbs', - type: 'measure', - }, - { - name: 'Acceleration', - type: 'measure' - }, - { - name: 'Origin', - type: 'dimension' - }, - { - name: 'Cylinders', - type: 'dimension' - }, - { - name: 'Year', - type: 'dimension', - subtype: 'temporal', - format: '%Y-%m-%d' - }, - - ]; - let rootData = new DataTable(jsonData, schema); - - rootData = rootData.groupBy([ 'Year','Origin', 'Maker'], { - Horsepower: 'mean', - Acceleration: 'mean' - }); - const makers = ['bmw', 'ford', 'toyota', 'amc'] - rootData = rootData.select(fields=>makers.indexOf(fields.Maker.value)>-1) - - env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); - let mountPoint = document.getElementById('chart'); - window.canvas = env.canvas(); - let canvas2 = env.canvas(); - let canvas3 = env.canvas(); - let rows = [[ 'Acceleration']], - columns = [['Horsepower']]; - canvas = canvas - .rows(rows) - .columns(columns) - .color('Origin') - .shape('Maker') - .data(rootData) - .layers({ - 'Horsepower':{ - mark: 'point', - } - }) - .width(900) - .height(600) - .config({ - border:{ - width: 2, - showRowBorders: false, - showColBorders:false, - showValueBorders: { - top: false, - bottom: true, - left: true, - right: false - } - }, - axes:{ - x:{ - showAxisName: true, - - - }, y:{ - showAxisName: true, - // name: 'Acceleration per year', - axisNamePadding: 12 - } - } - }) - - canvas.legend({ - align:'vertical', - title: [''], - item:{ - text:{ - position:'right' - } - }, - steps: 6 - }) - - .title('The Muze Project', { position: "top", align: "left", }) - .subtitle('Composable visualisations with a data first approach', { position: "top", align: "left" }) - .mount(document.getElementsByTagName('body')[0]); - }) - -})() +d3.json('../../../data/cars.json', (data) => { + const schema = [{ + name: 'Name', + type: 'dimension' + }, + { + name: 'Maker', + type: 'dimension' + }, + { + name: 'Miles_per_Gallon', + type: 'measure' + }, + { + name: 'Displacement', + type: 'measure', + // defAggFn: 'min' + }, + { + name: 'Horsepower', + type: 'measure' + }, + { + name: 'Weight_in_lbs', + type: 'measure', + }, + { + name: 'Acceleration', + type: 'measure' + }, + { + name: 'Origin', + type: 'dimension' + }, + { + name: 'Cylinders', + type: 'dimension' + }, + { + name: 'Year', + type: 'dimension', + subtype: 'temporal', + format: '%Y-%m-%d' + }, + ]; + let DataModel = muze.DataModel; + let dm = new DataModel(data, schema); + // dm = dm.select(d => d.Year.internalValue === -19800000 || d.Year.internalValue === 31516200000); + // dm = dm.select(d => d.Origin.value !== 'European Union'); + // const makers = ['bmw', 'ford', 'toyota', 'amc']; + // rootData = rootData.select(fields => makers.indexOf(fields.Maker.value) > -1); + + let env = muze(); + + canvas = env.canvas(); + canvas + .data(dm) + .width(850) + .height(650) + .rows(["Acceleration"]) + .columns(["Year"]) + .color("Origin") + // .size('Horsepower') + .layers([{ + mark: 'area', + }]) + .mount(document.getElementById('chart')); +}) \ No newline at end of file diff --git a/examples/samples/design-samples/simple-bar-horizontal.js b/examples/samples/design-samples/simple-bar-horizontal.js index ed646fb0..1a650fca 100644 --- a/examples/samples/design-samples/simple-bar-horizontal.js +++ b/examples/samples/design-samples/simple-bar-horizontal.js @@ -1,12 +1,12 @@ /* eslint-disable */ (function () { - let env = muze.Muze(); - let DataTable = muze.DataTable, - share = muze.operators.share, - html = muze.operators.html, - Board = muze.Board; - window.board = new Board(); + let env = window.muze(); + let DataModel = muze.DataModel; + // share = muze.operators.share, + // html = muze.operators.html, + // Board = muze.Board; + // window.board = new Board(); d3.json('../../../data/cars.json', (data) => { @@ -56,7 +56,7 @@ }, ]; - let rootData = new DataTable(jsonData, schema); + let rootData = new DataModel(jsonData, schema); rootData = rootData.groupBy(['Year'], { Horsepower: 'mean', diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 281ea2eb..00000000 --- a/package-lock.json +++ /dev/null @@ -1,19476 +0,0 @@ -{ - "name": "muze-monorepo", - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/cli": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.6.0.tgz", - "integrity": "sha512-1CTDyGUjQqW3Mz4gfKZ04KGOckyyaNmKneAMlABPS+ZyuxWv3FrVEVz7Ag08kNIztVx8VaJ8YgvYLSNlMKAT5Q==", - "dev": true, - "requires": { - "chokidar": "^2.1.8", - "commander": "^2.8.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.13", - "mkdirp": "^0.5.1", - "output-file-sync": "^2.0.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - } - }, - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/core": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.0.tgz", - "integrity": "sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.0", - "@babel/helpers": "^7.6.0", - "@babel/parser": "^7.6.0", - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.0", - "@babel/types": "^7.6.0", - "convert-source-map": "^1.1.0", - "debug": "^4.1.0", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.0.tgz", - "integrity": "sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA==", - "dev": true, - "requires": { - "@babel/types": "^7.6.0", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", - "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz", - "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-call-delegate": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz", - "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.4.4", - "@babel/traverse": "^7.4.4", - "@babel/types": "^7.4.4" - } - }, - "@babel/helper-define-map": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz", - "integrity": "sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.5.5", - "lodash": "^4.17.13" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz", - "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==", - "dev": true, - "requires": { - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz", - "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz", - "integrity": "sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5" - } - }, - "@babel/helper-module-imports": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", - "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-module-transforms": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz", - "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/template": "^7.4.4", - "@babel/types": "^7.5.5", - "lodash": "^4.17.13" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", - "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", - "dev": true - }, - "@babel/helper-regex": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz", - "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==", - "dev": true, - "requires": { - "lodash": "^4.17.13" - } - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", - "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-wrap-function": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-replace-supers": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz", - "integrity": "sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" - } - }, - "@babel/helper-simple-access": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", - "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", - "dev": true, - "requires": { - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4" - } - }, - "@babel/helper-wrap-function": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", - "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.2.0" - } - }, - "@babel/helpers": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.0.tgz", - "integrity": "sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ==", - "dev": true, - "requires": { - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.0", - "@babel/types": "^7.6.0" - } - }, - "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz", - "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==", - "dev": true - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", - "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0", - "@babel/plugin-syntax-async-generators": "^7.2.0" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz", - "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", - "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.2.0" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz", - "integrity": "sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz", - "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", - "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", - "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", - "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", - "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", - "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", - "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz", - "integrity": "sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", - "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.0.tgz", - "integrity": "sha512-tIt4E23+kw6TgL/edACZwP1OUKrjOTyMrFMLoT5IOFrfMRabCgekjqFd5o6PaAMildBu46oFkekIdMuGkkPEpA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "lodash": "^4.17.13" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz", - "integrity": "sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-define-map": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5", - "@babel/helper-split-export-declaration": "^7.4.4", - "globals": "^11.1.0" - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz", - "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz", - "integrity": "sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz", - "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz", - "integrity": "sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", - "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz", - "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz", - "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz", - "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz", - "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz", - "integrity": "sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0", - "babel-plugin-dynamic-import-node": "^2.3.0" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz", - "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.4.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", - "babel-plugin-dynamic-import-node": "^2.3.0" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz", - "integrity": "sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.4.4", - "@babel/helper-plugin-utils": "^7.0.0", - "babel-plugin-dynamic-import-node": "^2.3.0" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", - "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.0.tgz", - "integrity": "sha512-jem7uytlmrRl3iCAuQyw8BpB4c4LWvSpvIeXKpMb+7j84lkx4m4mYr5ErAcmN5KM7B6BqrAvRGjBIbbzqCczew==", - "dev": true, - "requires": { - "regexp-tree": "^0.1.13" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz", - "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz", - "integrity": "sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz", - "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==", - "dev": true, - "requires": { - "@babel/helper-call-delegate": "^7.4.4", - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz", - "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz", - "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.0" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz", - "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", - "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz", - "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz", - "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz", - "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz", - "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz", - "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" - } - }, - "@babel/preset-env": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.0.tgz", - "integrity": "sha512-1efzxFv/TcPsNXlRhMzRnkBFMeIqBBgzwmZwlFDw5Ubj0AGLeufxugirwZmkkX/ayi3owsSqoQ4fw8LkfK9SYg==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", - "@babel/plugin-proposal-dynamic-import": "^7.5.0", - "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", - "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-syntax-async-generators": "^7.2.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/plugin-syntax-json-strings": "^7.2.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", - "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.5.0", - "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.6.0", - "@babel/plugin-transform-classes": "^7.5.5", - "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/plugin-transform-duplicate-keys": "^7.5.0", - "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.4.4", - "@babel/plugin-transform-literals": "^7.2.0", - "@babel/plugin-transform-member-expression-literals": "^7.2.0", - "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.6.0", - "@babel/plugin-transform-modules-systemjs": "^7.5.0", - "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", - "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/plugin-transform-object-super": "^7.5.5", - "@babel/plugin-transform-parameters": "^7.4.4", - "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.4.5", - "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.2.0", - "@babel/plugin-transform-sticky-regex": "^7.2.0", - "@babel/plugin-transform-template-literals": "^7.4.4", - "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.4.4", - "@babel/types": "^7.6.0", - "browserslist": "^4.6.0", - "core-js-compat": "^3.1.1", - "invariant": "^2.2.2", - "js-levenshtein": "^1.1.3", - "semver": "^5.5.0" - } - }, - "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" - } - }, - "@babel/traverse": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.0.tgz", - "integrity": "sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.0", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz", - "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "@evocateur/libnpmaccess": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", - "integrity": "sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "aproba": "^2.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "npm-package-arg": "^6.1.0" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - } - } - }, - "@evocateur/libnpmpublish": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz", - "integrity": "sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "aproba": "^2.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "lodash.clonedeep": "^4.5.0", - "normalize-package-data": "^2.4.0", - "npm-package-arg": "^6.1.0", - "semver": "^5.5.1", - "ssri": "^6.0.1" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - } - } - }, - "@evocateur/npm-registry-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", - "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", - "dev": true, - "requires": { - "JSONStream": "^1.3.4", - "bluebird": "^3.5.1", - "figgy-pudding": "^3.4.1", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "npm-package-arg": "^6.1.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "@evocateur/pacote": { - "version": "9.6.5", - "resolved": "https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz", - "integrity": "sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "bluebird": "^3.5.3", - "cacache": "^12.0.3", - "chownr": "^1.1.2", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.1.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "minimatch": "^3.0.4", - "minipass": "^2.3.5", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "normalize-package-data": "^2.5.0", - "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.4.4", - "npm-pick-manifest": "^3.0.0", - "osenv": "^0.1.5", - "promise-inflight": "^1.0.1", - "promise-retry": "^1.1.1", - "protoduck": "^5.0.1", - "rimraf": "^2.6.3", - "safe-buffer": "^5.2.0", - "semver": "^5.7.0", - "ssri": "^6.0.1", - "tar": "^4.4.10", - "unique-filename": "^1.1.1", - "which": "^1.3.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "@lerna/add": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.16.2.tgz", - "integrity": "sha512-RAAaF8aODPogj2Ge9Wj3uxPFIBGpog9M+HwSuq03ZnkkO831AmasCTJDqV+GEpl1U2DvnhZQEwHpWmTT0uUeEw==", - "dev": true, - "requires": { - "@evocateur/pacote": "^9.6.3", - "@lerna/bootstrap": "3.16.2", - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "npm-package-arg": "^6.1.0", - "p-map": "^2.1.0", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/batch-packages": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/batch-packages/-/batch-packages-3.16.0.tgz", - "integrity": "sha512-7AdMkANpubY/FKFI01im01tlx6ygOBJ/0JcixMUWoWP/7Ds3SWQF22ID6fbBr38jUWptYLDs2fagtTDL7YUPuA==", - "dev": true, - "requires": { - "@lerna/package-graph": "3.16.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/bootstrap": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.16.2.tgz", - "integrity": "sha512-I+gs7eh6rv9Vyd+CwqL7sftRfOOsSzCle8cv/CGlMN7/p7EAVhxEdAw8SYoHIKHzipXszuqqy1Y3opyleD0qdA==", - "dev": true, - "requires": { - "@lerna/batch-packages": "3.16.0", - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/has-npm-version": "3.16.0", - "@lerna/npm-install": "3.16.0", - "@lerna/package-graph": "3.16.0", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/rimraf-dir": "3.14.2", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-parallel-batches": "3.16.0", - "@lerna/symlink-binary": "3.16.2", - "@lerna/symlink-dependencies": "3.16.2", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "get-port": "^4.2.0", - "multimatch": "^3.0.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0", - "p-waterfall": "^1.0.0", - "read-package-tree": "^5.1.6", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/changed": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.16.4.tgz", - "integrity": "sha512-NCD7XkK744T23iW0wqKEgF4R9MYmReUbyHCZKopFnsNpQdqumc3SOIvQUAkKCP6hQJmYvxvOieoVgy/CVDpZ5g==", - "dev": true, - "requires": { - "@lerna/collect-updates": "3.16.0", - "@lerna/command": "3.16.0", - "@lerna/listable": "3.16.0", - "@lerna/output": "3.13.0", - "@lerna/version": "3.16.4" - } - }, - "@lerna/check-working-tree": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.14.2.tgz", - "integrity": "sha512-7safqxM/MYoAoxZxulUDtIJIbnBIgo0PB/FHytueG+9VaX7GMnDte2Bt1EKa0dz2sAyQdmQ3Q8ZXpf/6JDjaeg==", - "dev": true, - "requires": { - "@lerna/collect-uncommitted": "3.14.2", - "@lerna/describe-ref": "3.14.2", - "@lerna/validation-error": "3.13.0" - } - }, - "@lerna/child-process": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.14.2.tgz", - "integrity": "sha512-xnq+W5yQb6RkwI0p16ZQnrn6HkloH/MWTw4lGE1nKsBLAUbmSU5oTE93W1nrG0X3IMF/xWc9UYvNdUGMWvZZ4w==", - "dev": true, - "requires": { - "chalk": "^2.3.1", - "execa": "^1.0.0", - "strong-log-transformer": "^2.0.0" - } - }, - "@lerna/clean": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.16.0.tgz", - "integrity": "sha512-5P9U5Y19WmYZr7UAMGXBpY7xCRdlR7zhHy8MAPDKVx70rFIBS6nWXn5n7Kntv74g7Lm1gJ2rsiH5tj1OPcRJgg==", - "dev": true, - "requires": { - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/prompt": "3.13.0", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/rimraf-dir": "3.14.2", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0", - "p-waterfall": "^1.0.0" - } - }, - "@lerna/cli": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-3.13.0.tgz", - "integrity": "sha512-HgFGlyCZbYaYrjOr3w/EsY18PdvtsTmDfpUQe8HwDjXlPeCCUgliZjXLOVBxSjiOvPeOSwvopwIHKWQmYbwywg==", - "dev": true, - "requires": { - "@lerna/global-options": "3.13.0", - "dedent": "^0.7.0", - "npmlog": "^4.1.2", - "yargs": "^12.0.1" - } - }, - "@lerna/collect-uncommitted": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.14.2.tgz", - "integrity": "sha512-4EkQu4jIOdNL2BMzy/N0ydHB8+Z6syu6xiiKXOoFl0WoWU9H1jEJCX4TH7CmVxXL1+jcs8FIS2pfQz4oew99Eg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "chalk": "^2.3.1", - "figgy-pudding": "^3.5.1", - "npmlog": "^4.1.2" - } - }, - "@lerna/collect-updates": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.16.0.tgz", - "integrity": "sha512-HwAIl815X2TNlmcp28zCrSdXfoZWNP7GJPEqNWYk7xDJTYLqQ+SrmKUePjb3AMGBwYAraZSEJLbHdBpJ5+cHmQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/describe-ref": "3.14.2", - "minimatch": "^3.0.4", - "npmlog": "^4.1.2", - "slash": "^2.0.0" - } - }, - "@lerna/command": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.16.0.tgz", - "integrity": "sha512-u7tE4GC4/gfbPA9eQg+0ulnoJ+PMoMqomx033r/IxqZrHtmJR9+pF/37S0fsxJ2hX/RMFPC7c9Q/i8NEufSpdQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/package-graph": "3.16.0", - "@lerna/project": "3.16.0", - "@lerna/validation-error": "3.13.0", - "@lerna/write-log-file": "3.13.0", - "dedent": "^0.7.0", - "execa": "^1.0.0", - "is-ci": "^2.0.0", - "lodash": "^4.17.14", - "npmlog": "^4.1.2" - } - }, - "@lerna/conventional-commits": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.16.4.tgz", - "integrity": "sha512-QSZJ0bC9n6FVaf+7KDIq5zMv8WnHXnwhyL5jG1Nyh3SgOg9q2uflqh7YsYB+G6FwaRfnPaKosh6obijpYg0llA==", - "dev": true, - "requires": { - "@lerna/validation-error": "3.13.0", - "conventional-changelog-angular": "^5.0.3", - "conventional-changelog-core": "^3.1.6", - "conventional-recommended-bump": "^5.0.0", - "fs-extra": "^8.1.0", - "get-stream": "^4.0.0", - "lodash.template": "^4.5.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "pify": "^4.0.1", - "semver": "^6.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/create": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.16.0.tgz", - "integrity": "sha512-OZApR1Iz7awutbmj4sAArwhqCyKgcrnw9rH0aWAUrkYWrD1w4TwkvAcYAsfx5GpQGbLQwoXhoyyPwPfZRRWz3Q==", - "dev": true, - "requires": { - "@evocateur/pacote": "^9.6.3", - "@lerna/child-process": "3.14.2", - "@lerna/command": "3.16.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/validation-error": "3.13.0", - "camelcase": "^5.0.0", - "dedent": "^0.7.0", - "fs-extra": "^8.1.0", - "globby": "^9.2.0", - "init-package-json": "^1.10.3", - "npm-package-arg": "^6.1.0", - "p-reduce": "^1.0.0", - "pify": "^4.0.1", - "semver": "^6.2.0", - "slash": "^2.0.0", - "validate-npm-package-license": "^3.0.3", - "validate-npm-package-name": "^3.0.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/create-symlink": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz", - "integrity": "sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==", - "dev": true, - "requires": { - "@zkochan/cmd-shim": "^3.1.0", - "fs-extra": "^8.1.0", - "npmlog": "^4.1.2" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/describe-ref": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.14.2.tgz", - "integrity": "sha512-qa5pzDRK2oBQXNjyRmRnN7E8a78NMYfQjjlRFB0KNHMsT6mCiL9+8kIS39sSE2NqT8p7xVNo2r2KAS8R/m3CoQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "npmlog": "^4.1.2" - } - }, - "@lerna/diff": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.16.0.tgz", - "integrity": "sha512-QUpVs5TPl8vBIne10/vyjUxanQBQQp7Lk3iaB8MnCysKr0O+oy7trWeFVDPEkBTCD177By7yPGyW5Yey1nCBbA==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/command": "3.16.0", - "@lerna/validation-error": "3.13.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/exec": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.16.0.tgz", - "integrity": "sha512-mH3O5NXf/O88jBaBBTUf+d56CUkxpg782s3Jxy7HWbVuSUULt3iMRPTh+zEXO5/555etsIVVDDyUR76meklrJA==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/run-topologically": "3.16.0", - "@lerna/validation-error": "3.13.0", - "p-map": "^2.1.0" - } - }, - "@lerna/filter-options": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.16.0.tgz", - "integrity": "sha512-InIi1fF8+PxpCwir9bIy+pGxrdE6hvN0enIs1eNGCVS1TTE8osNgiZXa838bMQ1yaEccdcnVX6Z03BNKd56kNg==", - "dev": true, - "requires": { - "@lerna/collect-updates": "3.16.0", - "@lerna/filter-packages": "3.16.0", - "dedent": "^0.7.0" - } - }, - "@lerna/filter-packages": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.16.0.tgz", - "integrity": "sha512-eGFzQTx0ogkGDCnbTuXqssryR6ilp8+dcXt6B+aq1MaqL/vOJRZyqMm4TY3CUOUnzZCi9S2WWyMw3PnAJOF+kg==", - "dev": true, - "requires": { - "@lerna/validation-error": "3.13.0", - "multimatch": "^3.0.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/get-npm-exec-opts": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz", - "integrity": "sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/get-packed": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz", - "integrity": "sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==", - "dev": true, - "requires": { - "fs-extra": "^8.1.0", - "ssri": "^6.0.1", - "tar": "^4.4.8" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/github-client": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.16.0.tgz", - "integrity": "sha512-IVJjcKjkYaUEPJsDyAblHGEFFNKCRyMagbIDm14L7Ab94ccN6i4TKOqAFEJn2SJHYvKKBdp3Zj2zNlASOMe3DA==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@octokit/plugin-enterprise-rest": "^3.6.1", - "@octokit/rest": "^16.28.4", - "git-url-parse": "^11.1.2", - "npmlog": "^4.1.2" - } - }, - "@lerna/gitlab-client": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz", - "integrity": "sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==", - "dev": true, - "requires": { - "node-fetch": "^2.5.0", - "npmlog": "^4.1.2", - "whatwg-url": "^7.0.0" - } - }, - "@lerna/global-options": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz", - "integrity": "sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==", - "dev": true - }, - "@lerna/has-npm-version": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.0.tgz", - "integrity": "sha512-TIY036dA9J8OyTrZq9J+it2DVKifL65k7hK8HhkUPpitJkw6jwbMObA/8D40LOGgWNPweJWqmlrTbRSwsR7DrQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/import": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.16.0.tgz", - "integrity": "sha512-trsOmGHzw0rL/f8BLNvd+9PjoTkXq2Dt4/V2UCha254hMQaYutbxcYu8iKPxz9x86jSPlH7FpbTkkHXDsoY7Yg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/command": "3.16.0", - "@lerna/prompt": "3.13.0", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "fs-extra": "^8.1.0", - "p-map-series": "^1.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/init": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.16.0.tgz", - "integrity": "sha512-Ybol/x5xMtBgokx4j7/Y3u0ZmNh0NiSWzBFVaOs2NOJKvuqrWimF67DKVz7yYtTYEjtaMdug64ohFF4jcT/iag==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/command": "3.16.0", - "fs-extra": "^8.1.0", - "p-map": "^2.1.0", - "write-json-file": "^3.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/link": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.16.2.tgz", - "integrity": "sha512-eCPg5Lo8HT525fIivNoYF3vWghO3UgEVFdbsiPmhzwI7IQyZro5HWYzLtywSAdEog5XZpd2Bbn0CsoHWBB3gww==", - "dev": true, - "requires": { - "@lerna/command": "3.16.0", - "@lerna/package-graph": "3.16.0", - "@lerna/symlink-dependencies": "3.16.2", - "p-map": "^2.1.0", - "slash": "^2.0.0" - } - }, - "@lerna/list": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.16.0.tgz", - "integrity": "sha512-TkvstoPsgKqqQ0KfRumpsdMXfRSEhdXqOLq519XyI5IRWYxhoqXqfi8gG37UoBPhBNoe64japn5OjphF3rOmQA==", - "dev": true, - "requires": { - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/listable": "3.16.0", - "@lerna/output": "3.13.0" - } - }, - "@lerna/listable": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-3.16.0.tgz", - "integrity": "sha512-mtdAT2EEECqrJSDm/aXlOUFr1MRE4p6hppzY//Klp05CogQy6uGaKk+iKG5yyCLaOXFFZvG4HfO11CmoGSDWzw==", - "dev": true, - "requires": { - "@lerna/query-graph": "3.16.0", - "chalk": "^2.3.1", - "columnify": "^1.5.4" - } - }, - "@lerna/log-packed": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz", - "integrity": "sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==", - "dev": true, - "requires": { - "byte-size": "^5.0.1", - "columnify": "^1.5.4", - "has-unicode": "^2.0.1", - "npmlog": "^4.1.2" - } - }, - "@lerna/npm-conf": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz", - "integrity": "sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==", - "dev": true, - "requires": { - "config-chain": "^1.1.11", - "pify": "^4.0.1" - } - }, - "@lerna/npm-dist-tag": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.16.0.tgz", - "integrity": "sha512-MQrBkqJJB9+eNphuj9w90QPMOs4NQXMuSRk9NqzeFunOmdDopPCV0Q7IThSxEuWnhJ2n3B7G0vWUP7tNMPdqIQ==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "@lerna/otplease": "3.16.0", - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/npm-install": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.0.tgz", - "integrity": "sha512-APUOIilZCzDzce92uLEwzt1r7AEMKT/hWA1ThGJL+PO9Rn8A95Km3o2XZAYG4W0hR+P4O2nSVuKbsjQtz8CjFQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/get-npm-exec-opts": "3.13.0", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "signal-exit": "^3.0.2", - "write-pkg": "^3.1.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/npm-publish": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.16.2.tgz", - "integrity": "sha512-tGMb9vfTxP57vUV5svkBQxd5Tzc+imZbu9ZYf8Mtwe0+HYfDjNiiHLIQw7G95w4YRdc5KsCE8sQ0uSj+f2soIg==", - "dev": true, - "requires": { - "@evocateur/libnpmpublish": "^1.2.2", - "@lerna/otplease": "3.16.0", - "@lerna/run-lifecycle": "3.16.2", - "figgy-pudding": "^3.5.1", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "pify": "^4.0.1", - "read-package-json": "^2.0.13" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/npm-run-script": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.14.2.tgz", - "integrity": "sha512-LbVFv+nvAoRTYLMrJlJ8RiakHXrLslL7Jp/m1R18vYrB8LYWA3ey+nz5Tel2OELzmjUiemAKZsD9h6i+Re5egg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "@lerna/get-npm-exec-opts": "3.13.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/otplease": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-3.16.0.tgz", - "integrity": "sha512-uqZ15wYOHC+/V0WnD2iTLXARjvx3vNrpiIeyIvVlDB7rWse9mL4egex/QSgZ+lDx1OID7l2kgvcUD9cFpbqB7Q==", - "dev": true, - "requires": { - "@lerna/prompt": "3.13.0", - "figgy-pudding": "^3.5.1" - } - }, - "@lerna/output": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz", - "integrity": "sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/pack-directory": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz", - "integrity": "sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==", - "dev": true, - "requires": { - "@lerna/get-packed": "3.16.0", - "@lerna/package": "3.16.0", - "@lerna/run-lifecycle": "3.16.2", - "figgy-pudding": "^3.5.1", - "npm-packlist": "^1.4.4", - "npmlog": "^4.1.2", - "tar": "^4.4.10", - "temp-write": "^3.4.0" - } - }, - "@lerna/package": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz", - "integrity": "sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==", - "dev": true, - "requires": { - "load-json-file": "^5.3.0", - "npm-package-arg": "^6.1.0", - "write-pkg": "^3.1.0" - }, - "dependencies": { - "load-json-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "@lerna/package-graph": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.16.0.tgz", - "integrity": "sha512-A2mum/gNbv7zCtAwJqoxzqv89As73OQNK2MgSX1SHWya46qoxO9a9Z2c5lOFQ8UFN5ZxqWMfFYXRCz7qzwmFXw==", - "dev": true, - "requires": { - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/validation-error": "3.13.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/prerelease-id-from-version": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz", - "integrity": "sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==", - "dev": true, - "requires": { - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/project": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.16.0.tgz", - "integrity": "sha512-NrKcKK1EqXqhrGvslz6Q36+ZHuK3zlDhGdghRqnxDcHxMPT01NgLcmsnymmQ+gjMljuLRmvKYYCuHrknzX8VrA==", - "dev": true, - "requires": { - "@lerna/package": "3.16.0", - "@lerna/validation-error": "3.13.0", - "cosmiconfig": "^5.1.0", - "dedent": "^0.7.0", - "dot-prop": "^4.2.0", - "glob-parent": "^5.0.0", - "globby": "^9.2.0", - "load-json-file": "^5.3.0", - "npmlog": "^4.1.2", - "p-map": "^2.1.0", - "resolve-from": "^4.0.0", - "write-json-file": "^3.2.0" - }, - "dependencies": { - "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "load-json-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, - "@lerna/prompt": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-3.13.0.tgz", - "integrity": "sha512-P+lWSFokdyvYpkwC3it9cE0IF2U5yy2mOUbGvvE4iDb9K7TyXGE+7lwtx2thtPvBAfIb7O13POMkv7df03HJeA==", - "dev": true, - "requires": { - "inquirer": "^6.2.0", - "npmlog": "^4.1.2" - }, - "dependencies": { - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } - } - } - } - }, - "@lerna/publish": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.16.4.tgz", - "integrity": "sha512-XZY+gRuF7/v6PDQwl7lvZaGWs8CnX6WIPIu+OCcyFPSL/rdWegdN7HieKBHskgX798qRQc2GrveaY7bNoTKXAw==", - "dev": true, - "requires": { - "@evocateur/libnpmaccess": "^3.1.2", - "@evocateur/npm-registry-fetch": "^4.0.0", - "@evocateur/pacote": "^9.6.3", - "@lerna/check-working-tree": "3.14.2", - "@lerna/child-process": "3.14.2", - "@lerna/collect-updates": "3.16.0", - "@lerna/command": "3.16.0", - "@lerna/describe-ref": "3.14.2", - "@lerna/log-packed": "3.16.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/npm-dist-tag": "3.16.0", - "@lerna/npm-publish": "3.16.2", - "@lerna/otplease": "3.16.0", - "@lerna/output": "3.13.0", - "@lerna/pack-directory": "3.16.4", - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/prompt": "3.13.0", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-topologically": "3.16.0", - "@lerna/validation-error": "3.13.0", - "@lerna/version": "3.16.4", - "figgy-pudding": "^3.5.1", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-pipe": "^1.2.0", - "semver": "^6.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/pulse-till-done": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz", - "integrity": "sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/query-graph": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.16.0.tgz", - "integrity": "sha512-p0RO+xmHDO95ChJdWkcy9TNLysLkoDARXeRHzY5U54VCwl3Ot/2q8fMCVlA5UeGXDutEyyByl3URqEpcQCWI7Q==", - "dev": true, - "requires": { - "@lerna/package-graph": "3.16.0", - "figgy-pudding": "^3.5.1" - } - }, - "@lerna/resolve-symlink": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz", - "integrity": "sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==", - "dev": true, - "requires": { - "fs-extra": "^8.1.0", - "npmlog": "^4.1.2", - "read-cmd-shim": "^1.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/rimraf-dir": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.14.2.tgz", - "integrity": "sha512-eFNkZsy44Bu9v1Hrj5Zk6omzg8O9h/7W6QYK1TTUHeyrjTEwytaNQlqF0lrTLmEvq55sviV42NC/8P3M2cvq8Q==", - "dev": true, - "requires": { - "@lerna/child-process": "3.14.2", - "npmlog": "^4.1.2", - "path-exists": "^3.0.0", - "rimraf": "^2.6.2" - } - }, - "@lerna/run": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.16.0.tgz", - "integrity": "sha512-woTeLlB1OAAz4zzjdI6RyIxSGuxiUPHJZm89E1pDEPoWwtQV6HMdMgrsQd9ATsJ5Ez280HH4bF/LStAlqW8Ufg==", - "dev": true, - "requires": { - "@lerna/command": "3.16.0", - "@lerna/filter-options": "3.16.0", - "@lerna/npm-run-script": "3.14.2", - "@lerna/output": "3.13.0", - "@lerna/run-topologically": "3.16.0", - "@lerna/timer": "3.13.0", - "@lerna/validation-error": "3.13.0", - "p-map": "^2.1.0" - } - }, - "@lerna/run-lifecycle": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz", - "integrity": "sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==", - "dev": true, - "requires": { - "@lerna/npm-conf": "3.16.0", - "figgy-pudding": "^3.5.1", - "npm-lifecycle": "^3.1.2", - "npmlog": "^4.1.2" - } - }, - "@lerna/run-parallel-batches": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/run-parallel-batches/-/run-parallel-batches-3.16.0.tgz", - "integrity": "sha512-2J/Nyv+MvogmQEfC7VcS21ifk7w0HVvzo2yOZRPvkCzGRu/rducxtB4RTcr58XCZ8h/Bt1aqQYKExu3c/3GXwg==", - "dev": true, - "requires": { - "p-map": "^2.1.0", - "p-map-series": "^1.0.0" - } - }, - "@lerna/run-topologically": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.16.0.tgz", - "integrity": "sha512-4Hlpv4zDtKWa5Z0tPkeu0sK+bxZEKgkNESMGmWrUCNfj7xwvAJurcraK8+a2Y0TFYwf0qjSLY/MzX+ZbJA3Cgw==", - "dev": true, - "requires": { - "@lerna/query-graph": "3.16.0", - "figgy-pudding": "^3.5.1", - "p-queue": "^4.0.0" - } - }, - "@lerna/symlink-binary": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.16.2.tgz", - "integrity": "sha512-kz9XVoFOGSF83gg4gBqH+mG6uxfJfTp8Uy+Cam40CvMiuzfODrGkjuBEFoM/uO2QOAwZvbQDYOBpKUa9ZxHS1Q==", - "dev": true, - "requires": { - "@lerna/create-symlink": "3.16.2", - "@lerna/package": "3.16.0", - "fs-extra": "^8.1.0", - "p-map": "^2.1.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/symlink-dependencies": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.16.2.tgz", - "integrity": "sha512-wnZqGJQ+Jvr1I3inxrkffrFZfmQI7Ta8gySw/UWCy95QtZWF/f5yk8zVIocCAsjzD0wgb3jJE3CFJ9W5iwWk1A==", - "dev": true, - "requires": { - "@lerna/create-symlink": "3.16.2", - "@lerna/resolve-symlink": "3.16.0", - "@lerna/symlink-binary": "3.16.2", - "fs-extra": "^8.1.0", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, - "@lerna/timer": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz", - "integrity": "sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==", - "dev": true - }, - "@lerna/validation-error": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz", - "integrity": "sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/version": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.16.4.tgz", - "integrity": "sha512-ikhbMeIn5ljCtWTlHDzO4YvTmpGTX1lWFFIZ79Vd1TNyOr+OUuKLo/+p06mCl2WEdZu0W2s5E9oxfAAQbyDxEg==", - "dev": true, - "requires": { - "@lerna/check-working-tree": "3.14.2", - "@lerna/child-process": "3.14.2", - "@lerna/collect-updates": "3.16.0", - "@lerna/command": "3.16.0", - "@lerna/conventional-commits": "3.16.4", - "@lerna/github-client": "3.16.0", - "@lerna/gitlab-client": "3.15.0", - "@lerna/output": "3.13.0", - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/prompt": "3.13.0", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-topologically": "3.16.0", - "@lerna/validation-error": "3.13.0", - "chalk": "^2.3.1", - "dedent": "^0.7.0", - "minimatch": "^3.0.4", - "npmlog": "^4.1.2", - "p-map": "^2.1.0", - "p-pipe": "^1.2.0", - "p-reduce": "^1.0.0", - "p-waterfall": "^1.0.0", - "semver": "^6.2.0", - "slash": "^2.0.0", - "temp-write": "^3.4.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/write-log-file": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz", - "integrity": "sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==", - "dev": true, - "requires": { - "npmlog": "^4.1.2", - "write-file-atomic": "^2.3.0" - } - }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "dev": true, - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", - "dev": true - }, - "@octokit/endpoint": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.3.5.tgz", - "integrity": "sha512-f8KqzIrnzPLiezDsZZPB+K8v8YSv6aKFl7eOu59O46lmlW4HagWl1U6NWl6LmT8d1w7NsKBI3paVtzcnRGO1gw==", - "dev": true, - "requires": { - "is-plain-object": "^3.0.0", - "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - } - } - }, - "@octokit/plugin-enterprise-rest": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-3.6.2.tgz", - "integrity": "sha512-3wF5eueS5OHQYuAEudkpN+xVeUsg8vYEMMenEzLphUZ7PRZ8OJtDcsreL3ad9zxXmBbaFWzLmFcdob5CLyZftA==", - "dev": true - }, - "@octokit/request": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.1.0.tgz", - "integrity": "sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg==", - "dev": true, - "requires": { - "@octokit/endpoint": "^5.1.0", - "@octokit/request-error": "^1.0.1", - "deprecation": "^2.0.0", - "is-plain-object": "^3.0.0", - "node-fetch": "^2.3.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - } - } - }, - "@octokit/request-error": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz", - "integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==", - "dev": true, - "requires": { - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/rest": { - "version": "16.29.0", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.29.0.tgz", - "integrity": "sha512-t01+Hz6sUJx2/HzY4KSgmST5n7KcTYr8i6+UwqS6TkgyjyA6YmeTxVhZrQUobEXaDdQFxs1dRhh1hgmOo6OF9Q==", - "dev": true, - "requires": { - "@octokit/request": "^5.0.0", - "@octokit/request-error": "^1.0.2", - "atob-lite": "^2.0.0", - "before-after-hook": "^2.0.0", - "btoa-lite": "^1.0.0", - "deprecation": "^2.0.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" - } - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "12.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", - "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", - "dev": true - }, - "@types/q": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", - "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", - "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", - "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", - "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", - "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", - "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.8.5" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", - "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", - "dev": true - }, - "@webassemblyjs/helper-module-context": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", - "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "mamacro": "^0.0.3" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", - "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", - "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", - "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", - "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", - "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", - "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/helper-wasm-section": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-opt": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "@webassemblyjs/wast-printer": "1.8.5" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", - "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", - "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-buffer": "1.8.5", - "@webassemblyjs/wasm-gen": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", - "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-wasm-bytecode": "1.8.5", - "@webassemblyjs/ieee754": "1.8.5", - "@webassemblyjs/leb128": "1.8.5", - "@webassemblyjs/utf8": "1.8.5" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", - "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/floating-point-hex-parser": "1.8.5", - "@webassemblyjs/helper-api-error": "1.8.5", - "@webassemblyjs/helper-code-frame": "1.8.5", - "@webassemblyjs/helper-fsm": "1.8.5", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", - "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/wast-parser": "1.8.5", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "@zkochan/cmd-shim": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", - "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", - "dev": true, - "requires": { - "is-windows": "^1.0.0", - "mkdirp-promise": "^5.0.1", - "mz": "^2.5.0" - } - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "accepts": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", - "dev": true, - "requires": { - "mime-types": "~2.1.11", - "negotiator": "0.6.1" - } - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, - "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } - }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", - "dev": true - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - }, - "dependencies": { - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - } - } - }, - "agentkeepalive": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", - "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", - "dev": true, - "requires": { - "humanize-ms": "^1.2.1" - } - }, - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "dev": true, - "requires": { - "co": "^4.6.0", - "json-stable-stringify": "^1.0.1" - } - }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, - "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", - "dev": true - }, - "alphanum-sort": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", - "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", - "dev": true - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-colors": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", - "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", - "dev": true - }, - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true - }, - "ansi-html": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", - "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "append-transform": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", - "dev": true, - "requires": { - "default-require-extensions": "^1.0.0" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "aria-query": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz", - "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=", - "dev": true, - "requires": { - "ast-types-flow": "0.0.7", - "commander": "^2.11.0" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-differ": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true - }, - "array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "dev": true - }, - "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" - } - }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "arraybuffer.slice": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", - "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", - "dev": true - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "async-foreach": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", - "dev": true - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "atob-lite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", - "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", - "dev": true - }, - "autoprefixer": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.1.tgz", - "integrity": "sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw==", - "dev": true, - "requires": { - "browserslist": "^4.6.3", - "caniuse-lite": "^1.0.30000980", - "chalk": "^2.4.2", - "normalize-range": "^0.1.2", - "num2fraction": "^1.2.2", - "postcss": "^7.0.17", - "postcss-value-parser": "^4.0.0" - } - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "axios": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz", - "integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==", - "dev": true, - "requires": { - "follow-redirects": "1.5.10", - "is-buffer": "^2.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", - "dev": true - } - } - }, - "axobject-query": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz", - "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=", - "dev": true, - "requires": { - "ast-types-flow": "0.0.7" - } - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "babel-eslint": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz", - "integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - } - } - }, - "babel-loader": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", - "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", - "dev": true, - "requires": { - "find-cache-dir": "^2.0.0", - "loader-utils": "^1.0.2", - "mkdirp": "^0.5.1", - "pify": "^4.0.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", - "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - }, - "dependencies": { - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - } - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "backo2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", - "dev": true - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, - "base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", - "dev": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", - "dev": true - }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "dev": true, - "requires": { - "callsite": "1.0.0" - } - }, - "bfj-node4": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/bfj-node4/-/bfj-node4-5.3.1.tgz", - "integrity": "sha512-SOmOsowQWfXc7ybFARsK3C4MCOWzERaOMV/Fl3Tgjs+5dJWyzo3oa127jL44eMbQiAN17J7SvAs2TRxEScTUmg==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "check-types": "^7.3.0", - "tryer": "^1.0.0" - } - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "blob": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", - "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", - "dev": true - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - } - }, - "bonjour": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", - "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", - "dev": true, - "requires": { - "array-flatten": "^2.1.0", - "deep-equal": "^1.0.1", - "dns-equal": "^1.0.0", - "dns-txt": "^2.0.2", - "multicast-dns": "^6.0.1", - "multicast-dns-service-types": "^1.1.0" - }, - "dependencies": { - "array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", - "dev": true - }, - "deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", - "integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", - "dev": true, - "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - } - } - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "browserslist": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz", - "integrity": "sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30000989", - "electron-to-chromium": "^1.3.247", - "node-releases": "^1.1.29" - } - }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", - "dev": true - }, - "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dev": true, - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-indexof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", - "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "builtins": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", - "dev": true - }, - "byline": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", - "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", - "dev": true - }, - "byte-size": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", - "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", - "dev": true - }, - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - }, - "cacache": { - "version": "12.0.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", - "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", - "dev": true - }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "dev": true, - "requires": { - "callsites": "^2.0.0" - }, - "dependencies": { - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - } - } - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true - }, - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "caniuse-api": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", - "integrity": "sha1-tTTnxzTE+B7F++isoq0kNUuWLGw=", - "dev": true, - "requires": { - "browserslist": "^1.3.6", - "caniuse-db": "^1.0.30000529", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - }, - "dependencies": { - "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", - "dev": true, - "requires": { - "caniuse-db": "^1.0.30000639", - "electron-to-chromium": "^1.2.7" - } - } - } - }, - "caniuse-db": { - "version": "1.0.30000995", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000995.tgz", - "integrity": "sha512-25ew/vPIVU0g/OjeZay2IfcljWAmNVy1TSmeoozFrJzEOqnka0ZSusJFS+4iGZKVIJ4RHOZB4NyilpwNcsh8tA==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30000989", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz", - "integrity": "sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "catharsis": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", - "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "chai": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", - "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", - "dev": true, - "requires": { - "assertion-error": "^1.0.1", - "deep-eql": "^0.1.3", - "type-detect": "^1.0.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "check-types": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/check-types/-/check-types-7.4.0.tgz", - "integrity": "sha512-YbulWHdfP99UfZ73NcUDlNJhEIDgm9Doq9GhpyXbF+7Aegi3CVV7qqMCKTTqJxlvEvnQBp9IA+dxsGN6xK/nSg==", - "dev": true - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, - "clap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", - "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", - "dev": true, - "requires": { - "chalk": "^1.1.3" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", - "dev": true, - "requires": { - "restore-cursor": "^1.0.1" - } - }, - "cli-spinners": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.2.0.tgz", - "integrity": "sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==", - "dev": true - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "coa": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/coa/-/coa-1.0.4.tgz", - "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=", - "dev": true, - "requires": { - "q": "^1.1.2" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz", - "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", - "dev": true, - "requires": { - "clone": "^1.0.2", - "color-convert": "^1.3.0", - "color-string": "^0.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "color-string": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", - "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", - "dev": true, - "requires": { - "color-name": "^1.0.0" - } - }, - "colormin": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colormin/-/colormin-1.1.2.tgz", - "integrity": "sha1-6i90IKcrlogaOKrlnsEkpvcpgTM=", - "dev": true, - "requires": { - "color": "^0.11.0", - "css-color-names": "0.0.4", - "has": "^1.0.1" - } - }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, - "columnify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", - "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", - "dev": true, - "requires": { - "strip-ansi": "^3.0.0", - "wcwidth": "^1.0.0" - } - }, - "combine-lists": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", - "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", - "dev": true, - "requires": { - "lodash": "^4.5.0" - } - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "compare-func": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", - "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", - "dev": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - }, - "dependencies": { - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - } - } - }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", - "dev": true - }, - "compressible": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", - "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", - "dev": true, - "requires": { - "mime-db": ">= 1.40.0 < 2" - } - }, - "compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", - "dev": true, - "requires": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - }, - "dependencies": { - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - } - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "dev": true, - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - } - }, - "connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", - "dev": true - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true - }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "dev": true - }, - "conventional-changelog-angular": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.3.tgz", - "integrity": "sha512-YD1xzH7r9yXQte/HF9JBuEDfvjxxwDGGwZU1+ndanbY0oFgA+Po1T9JDSpPLdP0pZT6MhCAsdvFKC4TJ4MTJTA==", - "dev": true, - "requires": { - "compare-func": "^1.3.1", - "q": "^1.5.1" - } - }, - "conventional-changelog-core": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", - "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", - "dev": true, - "requires": { - "conventional-changelog-writer": "^4.0.6", - "conventional-commits-parser": "^3.0.3", - "dateformat": "^3.0.0", - "get-pkg-repo": "^1.0.0", - "git-raw-commits": "2.0.0", - "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^2.0.3", - "lodash": "^4.2.1", - "normalize-package-data": "^2.3.5", - "q": "^1.5.1", - "read-pkg": "^3.0.0", - "read-pkg-up": "^3.0.0", - "through2": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - }, - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", - "dev": true, - "requires": { - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-changelog-preset-loader": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz", - "integrity": "sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ==", - "dev": true - }, - "conventional-changelog-writer": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz", - "integrity": "sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw==", - "dev": true, - "requires": { - "compare-func": "^1.3.1", - "conventional-commits-filter": "^2.0.2", - "dateformat": "^3.0.0", - "handlebars": "^4.1.2", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.2.1", - "meow": "^4.0.0", - "semver": "^6.0.0", - "split": "^1.0.0", - "through2": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", - "dev": true, - "requires": { - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-commits-filter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz", - "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==", - "dev": true, - "requires": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.0" - } - }, - "conventional-commits-parser": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz", - "integrity": "sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg==", - "dev": true, - "requires": { - "JSONStream": "^1.0.4", - "is-text-path": "^2.0.0", - "lodash": "^4.2.1", - "meow": "^4.0.0", - "split2": "^2.0.0", - "through2": "^3.0.0", - "trim-off-newlines": "^1.0.0" - }, - "dependencies": { - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", - "dev": true, - "requires": { - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-recommended-bump": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz", - "integrity": "sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==", - "dev": true, - "requires": { - "concat-stream": "^2.0.0", - "conventional-changelog-preset-loader": "^2.1.1", - "conventional-commits-filter": "^2.0.2", - "conventional-commits-parser": "^3.0.3", - "git-raw-commits": "2.0.0", - "git-semver-tags": "^2.0.3", - "meow": "^4.0.0", - "q": "^1.5.1" - }, - "dependencies": { - "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - }, - "core-js-compat": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.2.1.tgz", - "integrity": "sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A==", - "dev": true, - "requires": { - "browserslist": "^4.6.6", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-env": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.1.tgz", - "integrity": "sha512-1yHhtcfAd1r4nwQgknowuUNfIT9E8dOMMspC36g45dN+iD1blloi7xp8X/xAIDnjHWyt1uQ8PHk2fkNaym7soQ==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.5" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "css-color-names": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", - "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", - "dev": true - }, - "css-declaration-sorter": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", - "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", - "dev": true, - "requires": { - "postcss": "^7.0.1", - "timsort": "^0.3.0" - } - }, - "css-loader": { - "version": "0.28.11", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", - "integrity": "sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "css-selector-tokenizer": "^0.7.0", - "cssnano": "^3.10.0", - "icss-utils": "^2.1.0", - "loader-utils": "^1.0.2", - "lodash.camelcase": "^4.3.0", - "object-assign": "^4.1.1", - "postcss": "^5.0.6", - "postcss-modules-extract-imports": "^1.2.0", - "postcss-modules-local-by-default": "^1.2.0", - "postcss-modules-scope": "^1.1.0", - "postcss-modules-values": "^1.3.0", - "postcss-value-parser": "^3.3.0", - "source-list-map": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "css-select": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.0.2.tgz", - "integrity": "sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^2.1.2", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true - }, - "css-selector-tokenizer": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", - "integrity": "sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==", - "dev": true, - "requires": { - "cssesc": "^0.1.0", - "fastparse": "^1.1.1", - "regexpu-core": "^1.0.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "regexpu-core": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", - "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - } - } - }, - "css-tree": { - "version": "1.0.0-alpha.33", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.33.tgz", - "integrity": "sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w==", - "dev": true, - "requires": { - "mdn-data": "2.0.4", - "source-map": "^0.5.3" - } - }, - "css-unit-converter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", - "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=", - "dev": true - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "cssesc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", - "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", - "dev": true - }, - "cssnano": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", - "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=", - "dev": true, - "requires": { - "autoprefixer": "^6.3.1", - "decamelize": "^1.1.2", - "defined": "^1.0.0", - "has": "^1.0.1", - "object-assign": "^4.0.1", - "postcss": "^5.0.14", - "postcss-calc": "^5.2.0", - "postcss-colormin": "^2.1.8", - "postcss-convert-values": "^2.3.4", - "postcss-discard-comments": "^2.0.4", - "postcss-discard-duplicates": "^2.0.1", - "postcss-discard-empty": "^2.0.1", - "postcss-discard-overridden": "^0.1.1", - "postcss-discard-unused": "^2.2.1", - "postcss-filter-plugins": "^2.0.0", - "postcss-merge-idents": "^2.1.5", - "postcss-merge-longhand": "^2.0.1", - "postcss-merge-rules": "^2.0.3", - "postcss-minify-font-values": "^1.0.2", - "postcss-minify-gradients": "^1.0.1", - "postcss-minify-params": "^1.0.4", - "postcss-minify-selectors": "^2.0.4", - "postcss-normalize-charset": "^1.1.0", - "postcss-normalize-url": "^3.0.7", - "postcss-ordered-values": "^2.1.0", - "postcss-reduce-idents": "^2.2.2", - "postcss-reduce-initial": "^1.0.0", - "postcss-reduce-transforms": "^1.0.3", - "postcss-svgo": "^2.1.1", - "postcss-unique-selectors": "^2.0.2", - "postcss-value-parser": "^3.2.3", - "postcss-zindex": "^2.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "autoprefixer": { - "version": "6.7.7", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", - "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", - "dev": true, - "requires": { - "browserslist": "^1.7.6", - "caniuse-db": "^1.0.30000634", - "normalize-range": "^0.1.2", - "num2fraction": "^1.2.2", - "postcss": "^5.2.16", - "postcss-value-parser": "^3.2.3" - } - }, - "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", - "dev": true, - "requires": { - "caniuse-db": "^1.0.30000639", - "electron-to-chromium": "^1.2.7" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "cssnano-preset-default": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", - "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", - "dev": true, - "requires": { - "css-declaration-sorter": "^4.0.1", - "cssnano-util-raw-cache": "^4.0.1", - "postcss": "^7.0.0", - "postcss-calc": "^7.0.1", - "postcss-colormin": "^4.0.3", - "postcss-convert-values": "^4.0.1", - "postcss-discard-comments": "^4.0.2", - "postcss-discard-duplicates": "^4.0.2", - "postcss-discard-empty": "^4.0.1", - "postcss-discard-overridden": "^4.0.1", - "postcss-merge-longhand": "^4.0.11", - "postcss-merge-rules": "^4.0.3", - "postcss-minify-font-values": "^4.0.2", - "postcss-minify-gradients": "^4.0.2", - "postcss-minify-params": "^4.0.2", - "postcss-minify-selectors": "^4.0.2", - "postcss-normalize-charset": "^4.0.1", - "postcss-normalize-display-values": "^4.0.2", - "postcss-normalize-positions": "^4.0.2", - "postcss-normalize-repeat-style": "^4.0.2", - "postcss-normalize-string": "^4.0.2", - "postcss-normalize-timing-functions": "^4.0.2", - "postcss-normalize-unicode": "^4.0.1", - "postcss-normalize-url": "^4.0.1", - "postcss-normalize-whitespace": "^4.0.2", - "postcss-ordered-values": "^4.1.2", - "postcss-reduce-initial": "^4.0.3", - "postcss-reduce-transforms": "^4.0.2", - "postcss-svgo": "^4.0.2", - "postcss-unique-selectors": "^4.0.1" - }, - "dependencies": { - "caniuse-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", - "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - } - }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "dev": true, - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - } - }, - "color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", - "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", - "dev": true, - "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.2" - } - }, - "color-string": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", - "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", - "dev": true, - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "cssesc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", - "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==", - "dev": true - }, - "csso": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz", - "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==", - "dev": true, - "requires": { - "css-tree": "1.0.0-alpha.29" - }, - "dependencies": { - "css-tree": { - "version": "1.0.0-alpha.29", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz", - "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==", - "dev": true, - "requires": { - "mdn-data": "~1.1.0", - "source-map": "^0.5.3" - } - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "is-svg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", - "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", - "dev": true, - "requires": { - "html-comment-regex": "^1.1.0" - } - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "mdn-data": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", - "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", - "dev": true - }, - "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", - "dev": true - }, - "postcss-calc": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz", - "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==", - "dev": true, - "requires": { - "css-unit-converter": "^1.1.1", - "postcss": "^7.0.5", - "postcss-selector-parser": "^5.0.0-rc.4", - "postcss-value-parser": "^3.3.1" - } - }, - "postcss-colormin": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", - "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "color": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-convert-values": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", - "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", - "dev": true, - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-discard-comments": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", - "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-duplicates": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", - "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-empty": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", - "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-overridden": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", - "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-merge-longhand": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", - "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", - "dev": true, - "requires": { - "css-color-names": "0.0.4", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "stylehacks": "^4.0.0" - } - }, - "postcss-merge-rules": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", - "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "caniuse-api": "^3.0.0", - "cssnano-util-same-parent": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0", - "vendors": "^1.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "postcss-minify-font-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", - "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", - "dev": true, - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-minify-gradients": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", - "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", - "dev": true, - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "is-color-stop": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-minify-params": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", - "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.0", - "browserslist": "^4.0.0", - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "uniqs": "^2.0.0" - } - }, - "postcss-minify-selectors": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", - "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "postcss-normalize-charset": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", - "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-normalize-url": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", - "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", - "dev": true, - "requires": { - "is-absolute-url": "^2.0.0", - "normalize-url": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-ordered-values": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", - "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", - "dev": true, - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-reduce-initial": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", - "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "caniuse-api": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0" - } - }, - "postcss-reduce-transforms": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", - "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", - "dev": true, - "requires": { - "cssnano-util-get-match": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - } - }, - "postcss-selector-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", - "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", - "dev": true, - "requires": { - "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - }, - "postcss-svgo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", - "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", - "dev": true, - "requires": { - "is-svg": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "svgo": "^1.0.0" - } - }, - "postcss-unique-selectors": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", - "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.0", - "postcss": "^7.0.0", - "uniqs": "^2.0.0" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "svgo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.0.tgz", - "integrity": "sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.33", - "csso": "^3.5.1", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - } - } - } - }, - "cssnano-util-get-arguments": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", - "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=", - "dev": true - }, - "cssnano-util-get-match": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", - "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=", - "dev": true - }, - "cssnano-util-raw-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", - "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", - "dev": true, - "requires": { - "postcss": "^7.0.0" - } - }, - "cssnano-util-same-parent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", - "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==", - "dev": true - }, - "csso": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/csso/-/csso-2.3.2.tgz", - "integrity": "sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U=", - "dev": true, - "requires": { - "clap": "^1.0.9", - "source-map": "^0.5.3" - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true - }, - "cycle": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", - "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", - "dev": true - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "damerau-levenshtein": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz", - "integrity": "sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA==", - "dev": true - }, - "dargs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", - "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "debuglog": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - } - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", - "dev": true - }, - "deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", - "dev": true, - "requires": { - "type-detect": "0.1.1" - }, - "dependencies": { - "type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", - "dev": true - } - } - }, - "deep-equal": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", - "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "default-gateway": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", - "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "ip-regex": "^2.1.0" - } - }, - "default-require-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", - "dev": true, - "requires": { - "strip-bom": "^2.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - } - } - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "del": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", - "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "globby": "^6.1.0", - "is-path-cwd": "^2.0.0", - "is-path-in-cwd": "^2.0.0", - "p-map": "^2.0.0", - "pify": "^4.0.1", - "rimraf": "^2.6.3" - }, - "dependencies": { - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "dev": true - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", - "dev": true - }, - "dezalgo": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", - "dev": true, - "requires": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, - "di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true - }, - "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", - "dev": true, - "requires": { - "path-type": "^3.0.0" - }, - "dependencies": { - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "dns-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", - "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", - "dev": true - }, - "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", - "dev": true, - "requires": { - "ip": "^1.1.0", - "safe-buffer": "^5.0.1" - } - }, - "dns-txt": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", - "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", - "dev": true, - "requires": { - "buffer-indexof": "^1.0.0" - } - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", - "dev": true, - "requires": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" - } - }, - "dom-serializer": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.1.tgz", - "integrity": "sha512-sK3ujri04WyjwQXVoK4PU3y8ula1stq10GJZpqHIUgoGZdsGzAGu65BnU3d08aTVSvO7mGPZUc0wTEDL+qGE0Q==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - }, - "dependencies": { - "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", - "dev": true - }, - "entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", - "dev": true - } - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "dotenv": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz", - "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==", - "dev": true - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "ejs": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.1.tgz", - "integrity": "sha512-kS/gEPzZs3Y1rRsbGX4UOSjtP/CeJP0CxSNZHYxGfVM/VgLcv0ZqM7C45YyTj2DI2g7+P9Dd24C+IMIg6D0nYQ==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.262", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.262.tgz", - "integrity": "sha512-YFr53qZWr2pWkiTUorWEhAweujdf0ALiUp8VkNa0WGtbMVR+kZ8jNy3VTCemLsA4sT6+srCqehNn8TEAD0Ngrw==", - "dev": true - }, - "elliptic": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", - "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emoji-regex": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", - "dev": true - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "engine.io": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.3.tgz", - "integrity": "sha1-jef5eJXSDTm4X4ju7nd7K9QrE9Q=", - "dev": true, - "requires": { - "accepts": "1.3.3", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "2.3.3", - "engine.io-parser": "1.3.2", - "ws": "1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", - "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - } - } - }, - "engine.io-client": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.3.tgz", - "integrity": "sha1-F5jtk0USRkU9TG9jXXogH+lA1as=", - "dev": true, - "requires": { - "component-emitter": "1.2.1", - "component-inherit": "0.0.3", - "debug": "2.3.3", - "engine.io-parser": "1.3.2", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parsejson": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "1.1.2", - "xmlhttprequest-ssl": "1.5.3", - "yeast": "0.1.2" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "debug": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", - "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - } - } - }, - "engine.io-parser": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", - "integrity": "sha1-k3sHnwAH0Ik+xW1GyyILjLQ1Igo=", - "dev": true, - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "0.0.6", - "base64-arraybuffer": "0.1.5", - "blob": "0.0.4", - "has-binary": "0.1.7", - "wtf-8": "1.0.0" - } - }, - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" - } - }, - "ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", - "dev": true - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "env-paths": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", - "dev": true - }, - "err-code": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", - "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", - "dev": true - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz", - "integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.0", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-inspect": "^1.6.0", - "object-keys": "^1.1.1", - "string.prototype.trimleft": "^2.0.0", - "string.prototype.trimright": "^2.0.0" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es5-ext": { - "version": "0.10.51", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz", - "integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-set": "~0.1.5", - "es6-symbol": "~3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true - }, - "es6-promisify": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.0.2.tgz", - "integrity": "sha512-eO6vFm0JvqGzjWIQA6QVKjxpmELfhWbDUWHm1rPfIbn55mhKPiAa5xpLmQWJrNa629ZIeQ8ZvMAi13kvrjK6Mg==", - "dev": true - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "~0.3.5" - }, - "dependencies": { - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - } - } - }, - "es6-symbol": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.2.tgz", - "integrity": "sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ==", - "dev": true, - "requires": { - "d": "^1.0.1", - "es5-ext": "^0.10.51" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "^0.1.3", - "es6-weak-map": "^2.0.1", - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", - "dev": true, - "requires": { - "babel-code-frame": "^6.16.0", - "chalk": "^1.1.3", - "concat-stream": "^1.5.2", - "debug": "^2.1.1", - "doctrine": "^2.0.0", - "escope": "^3.6.0", - "espree": "^3.4.0", - "esquery": "^1.0.0", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "glob": "^7.0.3", - "globals": "^9.14.0", - "ignore": "^3.2.0", - "imurmurhash": "^0.1.4", - "inquirer": "^0.12.0", - "is-my-json-valid": "^2.10.0", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.5.1", - "json-stable-stringify": "^1.0.0", - "levn": "^0.3.0", - "lodash": "^4.0.0", - "mkdirp": "^0.5.0", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.1", - "pluralize": "^1.2.1", - "progress": "^1.1.8", - "require-uncached": "^1.0.2", - "shelljs": "^0.7.5", - "strip-bom": "^3.0.0", - "strip-json-comments": "~2.0.1", - "table": "^3.7.8", - "text-table": "~0.2.0", - "user-home": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "shelljs": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "eslint-config-airbnb": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-15.1.0.tgz", - "integrity": "sha512-m0q9fiMBzDAIbirlGnpJNWToIhdhJmXXnMG+IFflYzzod9231ZhtmGKegKg8E9T8F1YuVaDSU1FnCm5b9iXVhQ==", - "dev": true, - "requires": { - "eslint-config-airbnb-base": "^11.3.0" - } - }, - "eslint-config-airbnb-base": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.3.2.tgz", - "integrity": "sha512-/fhjt/VqzBA2SRsx7ErDtv6Ayf+XLw9LIOqmpBuHFCVwyJo2EtzGWMB9fYRFBoWWQLxmNmCpenNiH0RxyeS41w==", - "dev": true, - "requires": { - "eslint-restricted-globals": "^0.1.1" - } - }, - "eslint-import-resolver-node": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", - "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "resolve": "^1.5.0" - } - }, - "eslint-module-utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", - "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", - "dev": true, - "requires": { - "debug": "^2.6.8", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - } - } - }, - "eslint-plugin-import": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", - "dev": true, - "requires": { - "builtin-modules": "^1.1.1", - "contains-path": "^0.1.0", - "debug": "^2.6.8", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.1", - "eslint-module-utils": "^2.1.1", - "has": "^1.0.1", - "lodash.cond": "^4.3.0", - "minimatch": "^3.0.3", - "read-pkg-up": "^2.0.0" - }, - "dependencies": { - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - } - } - }, - "eslint-plugin-jsx-a11y": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz", - "integrity": "sha512-5I9SpoP7gT4wBFOtXT8/tXNPYohHBVfyVfO17vkbC7r9kEIxYJF12D3pKqhk8+xnk12rfxKClS3WCFpVckFTPQ==", - "dev": true, - "requires": { - "aria-query": "^0.7.0", - "array-includes": "^3.0.3", - "ast-types-flow": "0.0.7", - "axobject-query": "^0.1.0", - "damerau-levenshtein": "^1.0.0", - "emoji-regex": "^6.1.0", - "jsx-ast-utils": "^1.4.0" - } - }, - "eslint-plugin-react": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.3.0.tgz", - "integrity": "sha512-7L6QEOxm7XhcDoe+U9Qt7GJjU6KeQOX9jCLGE8EPGF6FQbwZ9LgcBzsjXIZv9oYvNQlvQZmLjJs76xEeWsI4QA==", - "dev": true, - "requires": { - "doctrine": "^2.0.0", - "has": "^1.0.1", - "jsx-ast-utils": "^2.0.0", - "prop-types": "^15.5.10" - }, - "dependencies": { - "jsx-ast-utils": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz", - "integrity": "sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ==", - "dev": true, - "requires": { - "array-includes": "^3.0.3", - "object.assign": "^4.1.0" - } - } - } - }, - "eslint-restricted-globals": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz", - "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=", - "dev": true - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true - }, - "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", - "dev": true, - "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" - } - }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "eventemitter3": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", - "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==", - "dev": true - }, - "events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", - "dev": true - }, - "eventsource": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", - "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", - "dev": true, - "requires": { - "original": "^1.0.0" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", - "dev": true - }, - "expand-braces": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", - "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", - "dev": true, - "requires": { - "array-slice": "^0.2.3", - "array-unique": "^0.2.1", - "braces": "^0.1.2" - }, - "dependencies": { - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", - "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", - "dev": true, - "requires": { - "expand-range": "^0.1.0" - } - }, - "expand-range": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", - "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", - "dev": true, - "requires": { - "is-number": "^0.1.1", - "repeat-string": "^0.2.2" - } - }, - "is-number": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", - "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", - "dev": true - }, - "repeat-string": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", - "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", - "dev": true - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - }, - "dependencies": { - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "dev": true, - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "dev": true - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extract-text-webpack-plugin": { - "version": "4.0.0-beta.0", - "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-4.0.0-beta.0.tgz", - "integrity": "sha512-Hypkn9jUTnFr0DpekNam53X47tXn3ucY08BQumv7kdGgeVUBLq3DJHJTi6HNxv4jl9W+Skxjz9+RnK0sJyqqjA==", - "dev": true, - "requires": { - "async": "^2.4.1", - "loader-utils": "^1.1.0", - "schema-utils": "^0.4.5", - "webpack-sources": "^1.1.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastparse": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", - "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", - "dev": true - }, - "faye-websocket": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", - "dev": true - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", - "dev": true, - "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "^7.0.3", - "minimatch": "^3.0.3" - } - }, - "filesize": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", - "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", - "dev": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" - }, - "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "flatten": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", - "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", - "dev": true - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "dev": true, - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", - "dev": true, - "requires": { - "null-check": "^1.0.0" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "dev": true - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dev": true, - "requires": { - "is-property": "^1.0.2" - } - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } - }, - "genfun": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", - "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-pkg-repo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", - "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "meow": "^3.3.0", - "normalize-package-data": "^2.3.0", - "parse-github-repo-url": "^1.3.0", - "through2": "^2.0.0" - }, - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - } - } - }, - "get-port": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz", - "integrity": "sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "git-raw-commits": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", - "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", - "dev": true, - "requires": { - "dargs": "^4.0.1", - "lodash.template": "^4.0.2", - "meow": "^4.0.0", - "split2": "^2.0.0", - "through2": "^2.0.0" - } - }, - "git-remote-origin-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", - "dev": true, - "requires": { - "gitconfiglocal": "^1.0.0", - "pify": "^2.3.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "git-semver-tags": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", - "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", - "dev": true, - "requires": { - "meow": "^4.0.0", - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "git-up": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.1.tgz", - "integrity": "sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "parse-url": "^5.0.0" - } - }, - "git-url-parse": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.1.2.tgz", - "integrity": "sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ==", - "dev": true, - "requires": { - "git-up": "^4.0.0" - } - }, - "gitconfiglocal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", - "dev": true, - "requires": { - "ini": "^1.3.2" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", - "dev": true - }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - } - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "globby": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", - "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" - }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } - } - }, - "globule": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", - "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", - "dev": true, - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - } - }, - "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", - "dev": true - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, - "gzip-size": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-4.1.0.tgz", - "integrity": "sha1-iuCWJX6r59acRb4rZ8RIEk/7UXw=", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "handle-thing": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz", - "integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==", - "dev": true - }, - "handlebars": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.0.tgz", - "integrity": "sha512-Kb4xn5Qh1cxAKvQnzNWZ512DhABzyFNmsaJf3OAkWNa4NkaqWcNI8Tao8Tasi0/F4JD9oyG0YxuFyvyR57d+Gw==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - } - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-binary": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", - "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hex-color-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", - "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", - "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", - "dev": true - }, - "hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - } - }, - "hsl-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz", - "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=", - "dev": true - }, - "hsla-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", - "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=", - "dev": true - }, - "html-comment-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", - "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", - "dev": true - }, - "html-entities": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", - "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=", - "dev": true - }, - "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", - "dev": true - }, - "http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", - "dev": true - }, - "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "http-parser-js": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", - "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", - "dev": true - }, - "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "http-proxy-middleware": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", - "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", - "dev": true, - "requires": { - "http-proxy": "^1.17.0", - "is-glob": "^4.0.0", - "lodash": "^4.17.11", - "micromatch": "^3.1.10" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "http-status-codes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-1.3.2.tgz", - "integrity": "sha512-nDUtj0ltIt08tGi2VWSpSzNNFye0v3YSe9lX3lIqLTuVvvRiYCvs4QQBSHo0eomFYw1wlUuofurUAlTm+vHnXg==", - "dev": true - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", - "dev": true, - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", - "dev": true, - "requires": { - "ms": "^2.0.0" - } - }, - "i": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", - "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, - "icss-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", - "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", - "dev": true, - "requires": { - "postcss": "^6.0.1" - }, - "dependencies": { - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true - }, - "ignore-walk": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.2.tgz", - "integrity": "sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw==", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "import-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", - "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", - "dev": true, - "requires": { - "import-from": "^2.1.0" - } - }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - }, - "dependencies": { - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "dev": true, - "requires": { - "caller-callsite": "^2.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "import-from": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", - "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "init-package-json": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz", - "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", - "dev": true, - "requires": { - "glob": "^7.1.1", - "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", - "promzard": "^0.3.0", - "read": "~1.0.1", - "read-package-json": "1 || 2", - "semver": "2.x || 3.x || 4 || 5", - "validate-npm-package-license": "^3.0.1", - "validate-npm-package-name": "^3.0.0" - } - }, - "inquirer": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", - "dev": true, - "requires": { - "ansi-escapes": "^1.1.0", - "ansi-regex": "^2.0.0", - "chalk": "^1.0.0", - "cli-cursor": "^1.0.1", - "cli-width": "^2.0.0", - "figures": "^1.3.5", - "lodash": "^4.3.0", - "readline2": "^1.0.1", - "run-async": "^0.1.0", - "rx-lite": "^3.1.2", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "internal-ip": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", - "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", - "dev": true, - "requires": { - "default-gateway": "^4.2.0", - "ipaddr.js": "^1.9.0" - } - }, - "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "dev": true - }, - "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", - "dev": true - }, - "is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-color-stop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz", - "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=", - "dev": true, - "requires": { - "css-color-names": "^0.0.4", - "hex-color-regex": "^1.1.0", - "hsl-regex": "^1.0.0", - "hsla-regex": "^1.0.0", - "rgb-regex": "^1.0.1", - "rgba-regex": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", - "dev": true - }, - "is-my-json-valid": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.0.tgz", - "integrity": "sha512-XTHBZSIIxNsIsZXg7XB5l8z/OBFosl1Wao4tXLpeC7eKU4Vm/kdop2azkPqULwnfGQjmeDIyey9g7afMMtdWAA==", - "dev": true, - "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true - }, - "is-path-in-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", - "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", - "dev": true, - "requires": { - "is-path-inside": "^2.1.0" - } - }, - "is-path-inside": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", - "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", - "dev": true, - "requires": { - "path-is-inside": "^1.0.2" - } - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, - "is-ssh": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz", - "integrity": "sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg==", - "dev": true, - "requires": { - "protocols": "^1.1.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-svg": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz", - "integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=", - "dev": true, - "requires": { - "html-comment-regex": "^1.1.0" - } - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-text-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", - "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", - "dev": true, - "requires": { - "text-extensions": "^2.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isbinaryfile": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", - "dev": true, - "requires": { - "buffer-alloc": "^1.2.0" - } - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-api": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.7.tgz", - "integrity": "sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA==", - "dev": true, - "requires": { - "async": "^2.1.4", - "fileset": "^2.0.2", - "istanbul-lib-coverage": "^1.2.1", - "istanbul-lib-hook": "^1.2.2", - "istanbul-lib-instrument": "^1.10.2", - "istanbul-lib-report": "^1.1.5", - "istanbul-lib-source-maps": "^1.2.6", - "istanbul-reports": "^1.5.1", - "js-yaml": "^3.7.0", - "mkdirp": "^0.5.1", - "once": "^1.4.0" - } - }, - "istanbul-instrumenter-loader": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-3.0.1.tgz", - "integrity": "sha512-a5SPObZgS0jB/ixaKSMdn6n/gXSrK2S6q/UfRJBT3e6gQmVjwZROTODQsYW5ZNwOu78hG62Y3fWlebaVOL0C+w==", - "dev": true, - "requires": { - "convert-source-map": "^1.5.0", - "istanbul-lib-instrument": "^1.7.3", - "loader-utils": "^1.1.0", - "schema-utils": "^0.3.0" - }, - "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - }, - "schema-utils": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", - "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", - "dev": true, - "requires": { - "ajv": "^5.0.0" - } - } - } - }, - "istanbul-lib-coverage": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", - "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz", - "integrity": "sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw==", - "dev": true, - "requires": { - "append-transform": "^0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", - "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", - "dev": true, - "requires": { - "babel-generator": "^6.18.0", - "babel-template": "^6.16.0", - "babel-traverse": "^6.18.0", - "babel-types": "^6.18.0", - "babylon": "^6.18.0", - "istanbul-lib-coverage": "^1.2.1", - "semver": "^5.3.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz", - "integrity": "sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^1.2.1", - "mkdirp": "^0.5.1", - "path-parse": "^1.0.5", - "supports-color": "^3.1.2" - }, - "dependencies": { - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz", - "integrity": "sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.2.1", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "source-map": "^0.5.3" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz", - "integrity": "sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw==", - "dev": true, - "requires": { - "handlebars": "^4.0.3" - } - }, - "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", - "dev": true - }, - "js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz", - "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^2.6.0" - } - }, - "js2xmlparser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", - "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", - "dev": true, - "requires": { - "xmlcreate": "^2.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdoc": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.3.tgz", - "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", - "dev": true, - "requires": { - "@babel/parser": "^7.4.4", - "bluebird": "^3.5.4", - "catharsis": "^0.8.11", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.0", - "klaw": "^3.0.0", - "markdown-it": "^8.4.2", - "markdown-it-anchor": "^5.0.2", - "marked": "^0.7.0", - "mkdirp": "^0.5.1", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.0.1", - "taffydb": "2.6.2", - "underscore": "~1.9.1" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, - "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", - "dev": true - } - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json2yaml": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/json2yaml/-/json2yaml-1.1.0.tgz", - "integrity": "sha1-VBTZB/mBZYa4DFE+wuOusquBmmw=", - "dev": true, - "requires": { - "remedial": "1.x" - } - }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "jsx-ast-utils": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", - "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", - "dev": true - }, - "karma": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", - "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", - "dev": true, - "requires": { - "bluebird": "^3.3.0", - "body-parser": "^1.16.1", - "chokidar": "^1.4.1", - "colors": "^1.1.0", - "combine-lists": "^1.0.0", - "connect": "^3.6.0", - "core-js": "^2.2.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.0", - "expand-braces": "^0.1.1", - "glob": "^7.1.1", - "graceful-fs": "^4.1.2", - "http-proxy": "^1.13.0", - "isbinaryfile": "^3.0.0", - "lodash": "^3.8.0", - "log4js": "^0.6.31", - "mime": "^1.3.4", - "minimatch": "^3.0.2", - "optimist": "^0.6.1", - "qjobs": "^1.1.4", - "range-parser": "^1.2.0", - "rimraf": "^2.6.0", - "safe-buffer": "^5.0.1", - "socket.io": "1.7.3", - "source-map": "^0.5.3", - "tmp": "0.0.31", - "useragent": "^2.1.12" - }, - "dependencies": { - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", - "dev": true - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "karma-chai": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", - "integrity": "sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o=", - "dev": true - }, - "karma-chrome-launcher": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.1.1.tgz", - "integrity": "sha1-IWh5xorATY1RQOmWGboEtZr9Rs8=", - "dev": true, - "requires": { - "fs-access": "^1.0.0", - "which": "^1.2.1" - } - }, - "karma-coverage-istanbul-reporter": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-1.4.3.tgz", - "integrity": "sha1-O13/RmT6W41RlrmInj9hwforgNk=", - "dev": true, - "requires": { - "istanbul-api": "^1.3.1", - "minimatch": "^3.0.4" - } - }, - "karma-mocha": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-1.3.0.tgz", - "integrity": "sha1-7qrH/8DiAetjxGdEDStpx883eL8=", - "dev": true, - "requires": { - "minimist": "1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "karma-sourcemap-loader": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz", - "integrity": "sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2" - } - }, - "karma-spec-reporter": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/karma-spec-reporter/-/karma-spec-reporter-0.0.31.tgz", - "integrity": "sha1-SDDccUihVcfXoYbmMjOaDYD63sM=", - "dev": true, - "requires": { - "colors": "^1.1.2" - } - }, - "karma-webpack": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-3.0.5.tgz", - "integrity": "sha512-nRudGJWstvVuA6Tbju9tyGUfXTtI1UXMXoRHVmM2/78D0q6s/Ye2IC157PKNDC15PWFGR0mVIRtWLAdcfsRJoA==", - "dev": true, - "requires": { - "async": "^2.0.0", - "babel-runtime": "^6.0.0", - "loader-utils": "^1.0.0", - "lodash": "^4.0.0", - "source-map": "^0.5.6", - "webpack-dev-middleware": "^2.0.6" - } - }, - "killable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", - "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "last-call-webpack-plugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz", - "integrity": "sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w==", - "dev": true, - "requires": { - "lodash": "^4.17.5", - "webpack-sources": "^1.1.0" - } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "lerna": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.16.4.tgz", - "integrity": "sha512-0HfwXIkqe72lBLZcNO9NMRfylh5Ng1l8tETgYQ260ZdHRbPuaLKE3Wqnd2YYRRkWfwPyEyZO8mZweBR+slVe1A==", - "dev": true, - "requires": { - "@lerna/add": "3.16.2", - "@lerna/bootstrap": "3.16.2", - "@lerna/changed": "3.16.4", - "@lerna/clean": "3.16.0", - "@lerna/cli": "3.13.0", - "@lerna/create": "3.16.0", - "@lerna/diff": "3.16.0", - "@lerna/exec": "3.16.0", - "@lerna/import": "3.16.0", - "@lerna/init": "3.16.0", - "@lerna/link": "3.16.2", - "@lerna/list": "3.16.0", - "@lerna/publish": "3.16.4", - "@lerna/run": "3.16.0", - "@lerna/version": "3.16.4", - "import-local": "^2.0.0", - "npmlog": "^4.1.2" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true - }, - "loader-utils": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", - "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^2.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true, - "requires": { - "lodash._basecopy": "^3.0.0", - "lodash.keys": "^3.0.0" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.cond": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", - "dev": true - }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true, - "requires": { - "lodash._baseassign": "^3.0.0", - "lodash._basecreate": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" - } - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - } - }, - "lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", - "dev": true - }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", - "dev": true - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, - "log4js": { - "version": "0.6.38", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", - "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", - "dev": true, - "requires": { - "readable-stream": "~1.0.2", - "semver": "~4.3.3" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "loglevel": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.4.tgz", - "integrity": "sha512-p0b6mOGKcGa+7nnmKbpzR6qloPbrgLcnio++E+14Vo/XffOGwZtRpUhr8dTH/x2oCMmEoIU0Zwm3ZauhvYD17g==", - "dev": true - }, - "loglevelnext": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/loglevelnext/-/loglevelnext-1.0.5.tgz", - "integrity": "sha512-V/73qkPuJmx4BcBF19xPBr+0ZRVBhc4POxvZTZdMeXpJ4NItXSJ/MSwuFT0kQJlCbXvdlZoQQ/418bS1y9Jh6A==", - "dev": true, - "requires": { - "es6-symbol": "^3.1.1", - "object.assign": "^4.1.0" - } - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", - "dev": true - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "make-fetch-happen": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz", - "integrity": "sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA==", - "dev": true, - "requires": { - "agentkeepalive": "^3.4.1", - "cacache": "^12.0.0", - "http-cache-semantics": "^3.8.1", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "node-fetch-npm": "^2.0.2", - "promise-retry": "^1.1.1", - "socks-proxy-agent": "^4.0.0", - "ssri": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "markdown-it": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", - "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "entities": "~1.1.1", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - } - }, - "markdown-it-anchor": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.4.tgz", - "integrity": "sha512-n8zCGjxA3T+Mx1pG8HEgbJbkB8JFUuRkeTZQuIM8iPY6oQ8sWOPRZJDFC9a/pNg2QkHEjjGkhBEl/RSyzaDZ3A==", - "dev": true - }, - "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", - "dev": true - }, - "math-expression-evaluator": { - "version": "1.2.17", - "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", - "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=", - "dev": true - }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", - "dev": true - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", - "dev": true - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - } - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - } - } - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", - "dev": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "dev": true - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, - "requires": { - "mime-db": "1.40.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mini-css-extract-plugin": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.5.tgz", - "integrity": "sha512-dqBanNfktnp2hwL2YguV9Jh91PFX7gu7nRLs4TGsbAfAG6WOtlynFRYzwDwmmeSb5uIwHo9nx1ta0f7vAZVp2w==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "schema-utils": "^1.0.0", - "webpack-sources": "^1.1.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - } - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "minipass": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.5.tgz", - "integrity": "sha512-ewSKOPFH9blOLXx0YSE+mbrNMBFPS+11a2b03QZ+P4LVrUHW/GAlqeYC7DBknDyMWkHzrzTpDhUvy7MUxqyrPA==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "dependencies": { - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "minizlib": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.2.tgz", - "integrity": "sha512-hR3At21uSrsjjDTWrbu0IMLTpnkpv8IIMFDFaoz43Tmu4LkmAXfH44vNNzpTnf+OAQQCHrb91y/wc2J4x5XgSQ==", - "dev": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", - "dev": true, - "requires": { - "mkdirp": "*" - } - }, - "mocha": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.2.tgz", - "integrity": "sha1-0O9NMyEm2/GNDWQMmzgt1IvpdZQ=", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.0", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - }, - "dependencies": { - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, - "debug": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", - "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "mocha-webpack": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/mocha-webpack/-/mocha-webpack-0.7.0.tgz", - "integrity": "sha1-065ax93PKc+UfosO7Xc/pCKODM4=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "fs-extra": "^0.30.0", - "glob-parent": "^2.0.0", - "interpret": "^1.0.1", - "invariant": "^2.2.0", - "is-glob": "^2.0.1", - "loader-utils": "^0.2.13", - "lodash": "^4.3.0", - "normalize-path": "^2.0.1", - "object-hash": "^1.1.2", - "webpack-info-plugin": "^0.1.0", - "webpack-sources": "^0.1.1", - "yargs": "^4.8.0" - }, - "dependencies": { - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", - "dev": true, - "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0", - "object-assign": "^4.0.1" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "source-list-map": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", - "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "webpack-sources": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.5.tgz", - "integrity": "sha1-qh86vw8NdNtxEcQOUAuE+WZkB1A=", - "dev": true, - "requires": { - "source-list-map": "~0.1.7", - "source-map": "~0.5.3" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "dev": true, - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - } - } - }, - "modify-values": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", - "dev": true - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "multicast-dns": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", - "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", - "dev": true, - "requires": { - "dns-packet": "^1.3.1", - "thunky": "^1.0.2" - } - }, - "multicast-dns-service-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", - "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", - "dev": true - }, - "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", - "dev": true, - "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", - "minimatch": "^3.0.4" - } - }, - "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", - "dev": true - }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "ncp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", - "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=", - "dev": true - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true - }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", - "dev": true - }, - "node-fetch-npm": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", - "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "json-parse-better-errors": "^1.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node-forge": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", - "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==", - "dev": true - }, - "node-gyp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.0.3.tgz", - "integrity": "sha512-z/JdtkFGUm0QaQUusvloyYuGDub3nUbOo5de1Fz57cM++osBTvQatBUSTlF1k/w8vFHPxxXW6zxGvkxXSpaBkQ==", - "dev": true, - "requires": { - "env-paths": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^4.4.8", - "which": "1" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true - } - } - }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, - "node-releases": { - "version": "1.1.32", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.32.tgz", - "integrity": "sha512-VhVknkitq8dqtWoluagsGPn3dxTvN9fwgR59fV3D7sLBHe0JfDramsMI8n8mY//ccq/Kkrf8ZRHRpsyVZ3qw1A==", - "dev": true, - "requires": { - "semver": "^5.3.0" - } - }, - "node-sass": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", - "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", - "dev": true, - "requires": { - "async-foreach": "^0.1.3", - "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", - "gaze": "^1.0.0", - "get-stdin": "^4.0.1", - "glob": "^7.0.3", - "in-publish": "^2.0.0", - "lodash": "^4.17.11", - "meow": "^3.7.0", - "mkdirp": "^0.5.1", - "nan": "^2.13.2", - "node-gyp": "^3.8.0", - "npmlog": "^4.0.0", - "request": "^2.88.0", - "sass-graph": "^2.2.4", - "stdout-stream": "^1.4.0", - "true-case-path": "^1.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "dev": true, - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - } - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", - "dev": true - }, - "normalize-url": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", - "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "prepend-http": "^1.0.0", - "query-string": "^4.1.0", - "sort-keys": "^1.0.0" - } - }, - "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", - "dev": true - }, - "npm-lifecycle": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.4.tgz", - "integrity": "sha512-tgs1PaucZwkxECGKhC/stbEgFyc3TGh2TJcg2CDr6jbvQRdteHNhmMeljRzpe4wgFAXQADoy1cSqqi7mtiAa5A==", - "dev": true, - "requires": { - "byline": "^5.0.0", - "graceful-fs": "^4.1.15", - "node-gyp": "^5.0.2", - "resolve-from": "^4.0.0", - "slide": "^1.1.6", - "uid-number": "0.0.6", - "umask": "^1.1.0", - "which": "^1.3.1" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "npm-packlist": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", - "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", - "dev": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npm-pick-manifest": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", - "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.0.0", - "semver": "^5.4.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, - "null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", - "dev": true - }, - "num2fraction": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", - "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", - "dev": true - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", - "dev": true - }, - "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", - "dev": true - }, - "object-is": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", - "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", - "function-bind": "^1.1.1", - "has": "^1.0.3" - } - }, - "obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", - "dev": true - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true - }, - "opener": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", - "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", - "dev": true - }, - "opn": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", - "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", - "dev": true, - "requires": { - "is-wsl": "^1.1.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "optimize-css-assets-webpack-plugin": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.3.tgz", - "integrity": "sha512-q9fbvCRS6EYtUKKSwI87qm2IxlyJK5b4dygW1rKUBT6mMDhdG5e5bZT63v6tnJR9F9FB/H5a0HTmtw+laUBxKA==", - "dev": true, - "requires": { - "cssnano": "^4.1.10", - "last-call-webpack-plugin": "^3.0.0" - }, - "dependencies": { - "cssnano": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", - "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", - "dev": true, - "requires": { - "cosmiconfig": "^5.0.0", - "cssnano-preset-default": "^4.0.7", - "is-resolvable": "^1.0.0", - "postcss": "^7.0.0" - } - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "options": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", - "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", - "dev": true - }, - "ora": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz", - "integrity": "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-spinners": "^2.0.0", - "log-symbols": "^2.2.0", - "strip-ansi": "^5.2.0", - "wcwidth": "^1.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "original": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", - "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", - "dev": true, - "requires": { - "url-parse": "^1.4.3" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "dev": true, - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "output-file-sync": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", - "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "is-plain-obj": "^1.1.0", - "mkdirp": "^0.5.1" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - }, - "p-limit": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", - "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "p-map-series": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz", - "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", - "dev": true, - "requires": { - "p-reduce": "^1.0.0" - } - }, - "p-pipe": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz", - "integrity": "sha1-SxoROZoRUgpneQ7loMHViB1r7+k=", - "dev": true - }, - "p-queue": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz", - "integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==", - "dev": true, - "requires": { - "eventemitter3": "^3.1.0" - }, - "dependencies": { - "eventemitter3": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", - "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", - "dev": true - } - } - }, - "p-reduce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", - "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", - "dev": true - }, - "p-retry": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", - "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", - "dev": true, - "requires": { - "retry": "^0.12.0" - }, - "dependencies": { - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "dev": true - } - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "p-waterfall": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz", - "integrity": "sha1-ftlLPOszMngjU69qrhGqn8I1uwA=", - "dev": true, - "requires": { - "p-reduce": "^1.0.0" - } - }, - "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-github-repo-url": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", - "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", - "dev": true - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parse-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.1.tgz", - "integrity": "sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "protocols": "^1.4.0" - } - }, - "parse-url": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.1.tgz", - "integrity": "sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "normalize-url": "^3.3.0", - "parse-path": "^4.0.0", - "protocols": "^1.4.0" - }, - "dependencies": { - "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", - "dev": true - } - } - }, - "parsejson": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", - "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } - }, - "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } - }, - "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true - }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pkginfo": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", - "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", - "dev": true - }, - "pluralize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", - "dev": true - }, - "portfinder": { - "version": "1.0.24", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.24.tgz", - "integrity": "sha512-ekRl7zD2qxYndYflwiryJwMioBI7LI7rVXg3EnLK3sjkouT5eOuhS3gS255XxBksa30VG8UPZYZCdgfGOfkSUg==", - "dev": true, - "requires": { - "async": "^1.5.2", - "debug": "^2.2.0", - "mkdirp": "0.5.x" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "postcss": { - "version": "7.0.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.18.tgz", - "integrity": "sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "postcss-calc": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", - "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", - "dev": true, - "requires": { - "postcss": "^5.0.2", - "postcss-message-helpers": "^2.0.0", - "reduce-css-calc": "^1.2.6" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-colormin": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-2.2.2.tgz", - "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=", - "dev": true, - "requires": { - "colormin": "^1.0.5", - "postcss": "^5.0.13", - "postcss-value-parser": "^3.2.3" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-convert-values": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz", - "integrity": "sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0=", - "dev": true, - "requires": { - "postcss": "^5.0.11", - "postcss-value-parser": "^3.1.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-discard-comments": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", - "integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=", - "dev": true, - "requires": { - "postcss": "^5.0.14" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-discard-duplicates": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz", - "integrity": "sha1-uavye4isGIFYpesSq8riAmO5GTI=", - "dev": true, - "requires": { - "postcss": "^5.0.4" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-discard-empty": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz", - "integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=", - "dev": true, - "requires": { - "postcss": "^5.0.14" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-discard-overridden": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz", - "integrity": "sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg=", - "dev": true, - "requires": { - "postcss": "^5.0.16" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-discard-unused": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz", - "integrity": "sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM=", - "dev": true, - "requires": { - "postcss": "^5.0.14", - "uniqs": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-filter-plugins": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz", - "integrity": "sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ==", - "dev": true, - "requires": { - "postcss": "^5.0.4" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-load-config": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", - "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", - "dev": true, - "requires": { - "cosmiconfig": "^5.0.0", - "import-cwd": "^2.0.0" - } - }, - "postcss-loader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz", - "integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "postcss": "^7.0.0", - "postcss-load-config": "^2.0.0", - "schema-utils": "^1.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - } - } - }, - "postcss-merge-idents": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", - "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=", - "dev": true, - "requires": { - "has": "^1.0.1", - "postcss": "^5.0.10", - "postcss-value-parser": "^3.1.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-merge-longhand": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz", - "integrity": "sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg=", - "dev": true, - "requires": { - "postcss": "^5.0.4" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-merge-rules": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz", - "integrity": "sha1-0d9d+qexrMO+VT8OnhDofGG19yE=", - "dev": true, - "requires": { - "browserslist": "^1.5.2", - "caniuse-api": "^1.5.2", - "postcss": "^5.0.4", - "postcss-selector-parser": "^2.2.2", - "vendors": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", - "dev": true, - "requires": { - "caniuse-db": "^1.0.30000639", - "electron-to-chromium": "^1.2.7" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-message-helpers": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz", - "integrity": "sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4=", - "dev": true - }, - "postcss-minify-font-values": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", - "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "postcss": "^5.0.4", - "postcss-value-parser": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-minify-gradients": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", - "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", - "dev": true, - "requires": { - "postcss": "^5.0.12", - "postcss-value-parser": "^3.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-minify-params": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", - "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.1", - "postcss": "^5.0.2", - "postcss-value-parser": "^3.0.2", - "uniqs": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-minify-selectors": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz", - "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.2", - "has": "^1.0.1", - "postcss": "^5.0.14", - "postcss-selector-parser": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-modules-extract-imports": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz", - "integrity": "sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw==", - "dev": true, - "requires": { - "postcss": "^6.0.1" - }, - "dependencies": { - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "postcss-modules-local-by-default": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", - "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", - "dev": true, - "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" - }, - "dependencies": { - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "postcss-modules-scope": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", - "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", - "dev": true, - "requires": { - "css-selector-tokenizer": "^0.7.0", - "postcss": "^6.0.1" - }, - "dependencies": { - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "postcss-modules-values": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", - "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", - "dev": true, - "requires": { - "icss-replace-symbols": "^1.1.0", - "postcss": "^6.0.1" - }, - "dependencies": { - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "postcss-normalize-charset": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz", - "integrity": "sha1-757nEhLX/nWceO0WL2HtYrXLk/E=", - "dev": true, - "requires": { - "postcss": "^5.0.5" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-normalize-display-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", - "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", - "dev": true, - "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-positions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", - "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", - "dev": true, - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-repeat-style": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", - "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", - "dev": true, - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-string": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", - "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", - "dev": true, - "requires": { - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-timing-functions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", - "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", - "dev": true, - "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-unicode": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", - "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-normalize-url": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz", - "integrity": "sha1-EI90s/L82viRov+j6kWSJ5/HgiI=", - "dev": true, - "requires": { - "is-absolute-url": "^2.0.0", - "normalize-url": "^1.4.0", - "postcss": "^5.0.14", - "postcss-value-parser": "^3.2.3" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-normalize-whitespace": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", - "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", - "dev": true, - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - } - } - }, - "postcss-ordered-values": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz", - "integrity": "sha1-7sbCpntsQSqNsgQud/6NpD+VwR0=", - "dev": true, - "requires": { - "postcss": "^5.0.4", - "postcss-value-parser": "^3.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-reduce-idents": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", - "integrity": "sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM=", - "dev": true, - "requires": { - "postcss": "^5.0.4", - "postcss-value-parser": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-reduce-initial": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", - "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", - "dev": true, - "requires": { - "postcss": "^5.0.4" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-reduce-transforms": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", - "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=", - "dev": true, - "requires": { - "has": "^1.0.1", - "postcss": "^5.0.8", - "postcss-value-parser": "^3.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-selector-parser": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz", - "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", - "dev": true, - "requires": { - "flatten": "^1.0.2", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - }, - "postcss-svgo": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", - "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=", - "dev": true, - "requires": { - "is-svg": "^2.0.0", - "postcss": "^5.0.14", - "postcss-value-parser": "^3.2.3", - "svgo": "^0.7.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-unique-selectors": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", - "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=", - "dev": true, - "requires": { - "alphanum-sort": "^1.0.1", - "postcss": "^5.0.4", - "uniqs": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "postcss-value-parser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz", - "integrity": "sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ==", - "dev": true - }, - "postcss-zindex": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", - "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=", - "dev": true, - "requires": { - "has": "^1.0.1", - "postcss": "^5.0.4", - "uniqs": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "dependencies": { - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "postcss": { - "version": "5.2.18", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "js-base64": "^2.1.9", - "source-map": "^0.5.6", - "supports-color": "^3.2.3" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "dev": true - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "promise-retry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", - "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", - "dev": true, - "requires": { - "err-code": "^1.0.0", - "retry": "^0.10.0" - } - }, - "prompt": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz", - "integrity": "sha1-jlcSPDlquYiJf7Mn/Trtw+c15P4=", - "dev": true, - "requires": { - "colors": "^1.1.2", - "pkginfo": "0.x.x", - "read": "1.0.x", - "revalidator": "0.1.x", - "utile": "0.3.x", - "winston": "2.1.x" - } - }, - "promzard": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", - "dev": true, - "requires": { - "read": "1" - } - }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "dev": true, - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "dev": true - }, - "protocols": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.7.tgz", - "integrity": "sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg==", - "dev": true - }, - "protoduck": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", - "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", - "dev": true, - "requires": { - "genfun": "^5.0.0" - } - }, - "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", - "dev": true, - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" - } - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", - "dev": true - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "dev": true - }, - "query-string": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", - "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", - "dev": true, - "requires": { - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", - "dev": true - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "react-is": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", - "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", - "dev": true - }, - "read": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", - "dev": true, - "requires": { - "mute-stream": "~0.0.4" - } - }, - "read-cmd-shim": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.4.tgz", - "integrity": "sha512-Pqpl3qJ/QdOIjRYA0q5DND/gLvGOfpIz/fYVDGYpOXfW/lFrIttmLsBnd6IkyK10+JHU9zhsaudfvrQTBB9YFQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2" - } - }, - "read-package-json": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.0.tgz", - "integrity": "sha512-KLhu8M1ZZNkMcrq1+0UJbR8Dii8KZUqB0Sha4mOx/bknfKI/fyrQVrG/YIt2UOtG667sD8+ee4EXMM91W9dC+A==", - "dev": true, - "requires": { - "glob": "^7.1.1", - "graceful-fs": "^4.1.2", - "json-parse-better-errors": "^1.0.1", - "normalize-package-data": "^2.0.0", - "slash": "^1.0.0" - }, - "dependencies": { - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - } - } - }, - "read-package-tree": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", - "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", - "dev": true, - "requires": { - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "util-promisify": "^2.1.0" - } - }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdir-scoped-modules": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", - "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", - "dev": true, - "requires": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "mute-stream": "0.0.5" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "reduce-css-calc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz", - "integrity": "sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=", - "dev": true, - "requires": { - "balanced-match": "^0.4.2", - "math-expression-evaluator": "^1.2.14", - "reduce-function-call": "^1.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true - } - } - }, - "reduce-function-call": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/reduce-function-call/-/reduce-function-call-1.0.3.tgz", - "integrity": "sha512-Hl/tuV2VDgWgCSEeWMLwxLZqX7OK59eU1guxXsRKTAyeYimivsKdtcV4fu3r710tpG5GmDKDhQ0HSZLExnNmyQ==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", - "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regenerator-transform": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", - "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", - "dev": true, - "requires": { - "private": "^0.1.6" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexp-tree": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.13.tgz", - "integrity": "sha512-hwdV/GQY5F8ReLZWO+W1SRoN5YfpOKY6852+tBFcma72DKBIcHjPRIlIvQN35bCOljuAfP2G2iB0FC/w236mUw==", - "dev": true - }, - "regexp.prototype.flags": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", - "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2" - } - }, - "regexpu-core": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", - "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.1.0", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", - "dev": true - }, - "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "remedial": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/remedial/-/remedial-1.0.8.tgz", - "integrity": "sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg==", - "dev": true - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - } - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, - "requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - } - } - }, - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", - "dev": true, - "requires": { - "exit-hook": "^1.0.0", - "onetime": "^1.0.0" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "retry": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", - "dev": true - }, - "revalidator": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", - "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", - "dev": true - }, - "rgb-regex": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", - "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=", - "dev": true - }, - "rgba-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", - "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", - "dev": true - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", - "dev": true, - "requires": { - "once": "^1.3.0" - } - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", - "dev": true - }, - "rxjs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", - "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", - "dev": true, - "requires": { - "glob": "^7.0.0", - "lodash": "^4.0.0", - "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - } - }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", - "dev": true, - "requires": { - "camelcase": "^3.0.0" - } - } - } - }, - "sass-loader": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.3.1.tgz", - "integrity": "sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.0.1", - "neo-async": "^2.5.0", - "pify": "^4.0.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "schema-utils": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", - "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - } - } - }, - "scss-tokenizer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", - "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", - "dev": true, - "requires": { - "js-base64": "^2.1.8", - "source-map": "^0.4.2" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", - "dev": true - }, - "selfsigned": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.6.tgz", - "integrity": "sha512-i3+CeqxL7DpAazgVpAGdKMwHuL63B5nhJMh9NQ7xmChGkA3jNFflq6Jyo1LLJYcr3idWiNOPWHCrm4zMayLG4w==", - "dev": true, - "requires": { - "node-forge": "0.8.2" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "serialize-javascript": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", - "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", - "dev": true - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "dependencies": { - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shelljs": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", - "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "dev": true, - "requires": { - "is-arrayish": "^0.3.1" - }, - "dependencies": { - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "dev": true - } - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true - }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, - "smart-buffer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", - "integrity": "sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "socket.io": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.3.tgz", - "integrity": "sha1-uK+cq6AJSeVo42nxMn6pvp6iRhs=", - "dev": true, - "requires": { - "debug": "2.3.3", - "engine.io": "1.8.3", - "has-binary": "0.1.7", - "object-assign": "4.1.0", - "socket.io-adapter": "0.5.0", - "socket.io-client": "1.7.3", - "socket.io-parser": "2.3.1" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", - "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - }, - "object-assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", - "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", - "dev": true - } - } - }, - "socket.io-adapter": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", - "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", - "dev": true, - "requires": { - "debug": "2.3.3", - "socket.io-parser": "2.3.1" - }, - "dependencies": { - "debug": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", - "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - } - } - }, - "socket.io-client": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.3.tgz", - "integrity": "sha1-sw6GqhDV7zVGYBwJzeR2Xjgdo3c=", - "dev": true, - "requires": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "2.3.3", - "engine.io-client": "1.8.3", - "has-binary": "0.1.7", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseuri": "0.0.5", - "socket.io-parser": "2.3.1", - "to-array": "0.1.4" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "debug": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", - "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - } - } - }, - "socket.io-parser": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", - "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", - "dev": true, - "requires": { - "component-emitter": "1.1.2", - "debug": "2.2.0", - "isarray": "0.0.1", - "json3": "3.3.2" - }, - "dependencies": { - "component-emitter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", - "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", - "dev": true - }, - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", - "dev": true, - "requires": { - "ms": "0.7.1" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", - "dev": true - } - } - }, - "sockjs": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", - "integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==", - "dev": true, - "requires": { - "faye-websocket": "^0.10.0", - "uuid": "^3.0.1" - } - }, - "sockjs-client": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz", - "integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==", - "dev": true, - "requires": { - "debug": "^3.2.5", - "eventsource": "^1.0.7", - "faye-websocket": "~0.11.1", - "inherits": "^2.0.3", - "json3": "^3.3.2", - "url-parse": "^1.4.3" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "faye-websocket": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", - "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", - "dev": true, - "requires": { - "websocket-driver": ">=0.5.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "socks": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz", - "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", - "dev": true, - "requires": { - "ip": "^1.1.5", - "smart-buffer": "4.0.2" - } - }, - "socks-proxy-agent": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", - "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", - "dev": true, - "requires": { - "agent-base": "~4.2.1", - "socks": "~2.3.2" - }, - "dependencies": { - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - } - } - }, - "sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "spdy": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.1.tgz", - "integrity": "sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "requires": { - "through": "2" - } - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "^2.0.2" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - }, - "stdout-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", - "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "function-bind": "^1.1.1" - } - }, - "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "function-bind": "^1.1.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "strong-log-transformer": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", - "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "minimist": "^1.2.0", - "through": "^2.3.4" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "style-loader": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.21.0.tgz", - "integrity": "sha512-T+UNsAcl3Yg+BsPKs1vd22Fr8sVT+CJMtzqc6LEw9bbJZb43lm9GoeIfUcDEefBSWC0BhYbcdupV1GtI4DGzxg==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0", - "schema-utils": "^0.4.5" - } - }, - "stylehacks": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", - "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", - "dev": true, - "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "dev": true, - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "svgo": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", - "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", - "dev": true, - "requires": { - "coa": "~1.0.1", - "colors": "~1.1.2", - "csso": "~2.3.1", - "js-yaml": "~3.7.0", - "mkdirp": "~0.5.1", - "sax": "~1.2.1", - "whet.extend": "~0.9.9" - } - }, - "table": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", - "dev": true, - "requires": { - "ajv": "^4.7.0", - "ajv-keywords": "^1.0.0", - "chalk": "^1.1.1", - "lodash": "^4.0.0", - "slice-ansi": "0.0.4", - "string-width": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, - "tar": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.11.tgz", - "integrity": "sha512-iI4zh3ktLJKaDNZKZc+fUONiQrSn9HkCFzamtb7k8FFmVilHVob7QsLX/VySAW8lAviMzMbFw4QtFb4errwgYA==", - "dev": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.6.4", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "dependencies": { - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - } - } - }, - "temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", - "dev": true - }, - "temp-write": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz", - "integrity": "sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "is-stream": "^1.1.0", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.0.1" - }, - "dependencies": { - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "terser": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.1.tgz", - "integrity": "sha512-pnzH6dnFEsR2aa2SJaKb1uSCl3QmIsJ8dEkj0Fky+2AwMMcC9doMqLOQIH6wVTEKaVfKVvLSk5qxPBEZT9mywg==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "terser-webpack-plugin": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz", - "integrity": "sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg==", - "dev": true, - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "text-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.0.0.tgz", - "integrity": "sha512-F91ZqLgvi1E0PdvmxMgp+gcf6q8fMH7mhdwWfzXnl1k+GbpQDmi8l7DzLC5JTASKbwpY3TfxajAUzAXcv2NmsQ==", - "dev": true - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", - "dev": true, - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dev": true, - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "thunky": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.0.3.tgz", - "integrity": "sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow==", - "dev": true - }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "timsort": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", - "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", - "dev": true - }, - "tmp": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.1" - } - }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", - "dev": true - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "transform-runtime": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/transform-runtime/-/transform-runtime-0.0.0.tgz", - "integrity": "sha1-5xTZtpIR3ZU3k51Q46pXiMRCuFw=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "true-case-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", - "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", - "dev": true, - "requires": { - "glob": "^7.1.2" - } - }, - "tryer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", - "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", - "dev": true - }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz", - "integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", - "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", - "dev": true - }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "uglifyjs-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==", - "dev": true, - "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "schema-utils": "^0.4.5", - "serialize-javascript": "^1.4.0", - "source-map": "^0.6.1", - "uglify-es": "^3.3.4", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" - }, - "dependencies": { - "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^5.2.4", - "unique-filename": "^1.1.0", - "y18n": "^4.0.0" - } - }, - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^2.0.1", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.1" - } - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - } - } - } - }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "dev": true - }, - "ultron": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", - "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", - "dev": true - }, - "umask": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", - "dev": true - }, - "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", - "dev": true - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", - "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", - "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", - "dev": true - }, - "uniqs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", - "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", - "dev": true - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "universal-user-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", - "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "url-join": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", - "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", - "dev": true - }, - "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dev": true, - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "user-home": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0" - } - }, - "useragent": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", - "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", - "dev": true, - "requires": { - "lru-cache": "4.1.x", - "tmp": "0.0.x" - } - }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "util-promisify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", - "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "utile": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", - "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", - "dev": true, - "requires": { - "async": "~0.9.0", - "deep-equal": "~0.2.1", - "i": "0.3.x", - "mkdirp": "0.x.x", - "ncp": "1.0.x", - "rimraf": "2.x.x" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - } - } - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true - }, - "v8-compile-cache": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", - "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "validate-npm-package-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", - "dev": true, - "requires": { - "builtins": "^1.0.3" - } - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true - }, - "vendors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz", - "integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "dev": true - }, - "void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", - "dev": true - }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "dev": true, - "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - } - }, - "wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "dev": true, - "requires": { - "minimalistic-assert": "^1.0.0" - } - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "webpack": { - "version": "4.40.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.40.2.tgz", - "integrity": "sha512-5nIvteTDCUws2DVvP9Qe+JPla7kWPPIDFZv55To7IycHWZ+Z5qBdaBYPyuXWdhggTufZkQwfIK+5rKQTVovm2A==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/wasm-edit": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "acorn": "^6.2.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.1", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.1", - "watchpack": "^1.6.0", - "webpack-sources": "^1.4.1" - }, - "dependencies": { - "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", - "dev": true - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - } - } - }, - "webpack-bundle-analyzer": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", - "integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==", - "dev": true, - "requires": { - "acorn": "^5.3.0", - "bfj-node4": "^5.2.0", - "chalk": "^2.3.0", - "commander": "^2.13.0", - "ejs": "^2.5.7", - "express": "^4.16.2", - "filesize": "^3.5.11", - "gzip-size": "^4.1.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "opener": "^1.4.3", - "ws": "^4.0.0" - }, - "dependencies": { - "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0" - } - } - } - }, - "webpack-cli": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.9.tgz", - "integrity": "sha512-xwnSxWl8nZtBl/AFJCOn9pG7s5CYUYdZxmmukv+fAHLcBIHM36dImfpQg3WfShZXeArkWlf6QRw24Klcsv8a5A==", - "dev": true, - "requires": { - "chalk": "2.4.2", - "cross-spawn": "6.0.5", - "enhanced-resolve": "4.1.0", - "findup-sync": "3.0.0", - "global-modules": "2.0.0", - "import-local": "2.0.0", - "interpret": "1.2.0", - "loader-utils": "1.2.3", - "supports-color": "6.1.0", - "v8-compile-cache": "2.0.3", - "yargs": "13.2.4" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" - } - }, - "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "webpack-dev-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-2.0.6.tgz", - "integrity": "sha512-tj5LLD9r4tDuRIDa5Mu9lnY2qBBehAITv6A9irqXhw/HQquZgTx3BCd57zYbU2gMDnncA49ufK2qVQSbaKJwOw==", - "dev": true, - "requires": { - "loud-rejection": "^1.6.0", - "memory-fs": "~0.4.1", - "mime": "^2.1.0", - "path-is-absolute": "^1.0.0", - "range-parser": "^1.0.3", - "url-join": "^2.0.2", - "webpack-log": "^1.0.1" - }, - "dependencies": { - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - } - } - }, - "webpack-dev-server": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.8.1.tgz", - "integrity": "sha512-9F5DnfFA9bsrhpUCAfQic/AXBVHvq+3gQS+x6Zj0yc1fVVE0erKh2MV4IV12TBewuTrYeeTIRwCH9qLMvdNvTw==", - "dev": true, - "requires": { - "ansi-html": "0.0.7", - "bonjour": "^3.5.0", - "chokidar": "^2.1.8", - "compression": "^1.7.4", - "connect-history-api-fallback": "^1.6.0", - "debug": "^4.1.1", - "del": "^4.1.1", - "express": "^4.17.1", - "html-entities": "^1.2.1", - "http-proxy-middleware": "^0.19.1", - "import-local": "^2.0.0", - "internal-ip": "^4.3.0", - "ip": "^1.1.5", - "is-absolute-url": "^3.0.2", - "killable": "^1.0.1", - "loglevel": "^1.6.4", - "opn": "^5.5.0", - "p-retry": "^3.0.1", - "portfinder": "^1.0.24", - "schema-utils": "^1.0.0", - "selfsigned": "^1.10.6", - "semver": "^6.3.0", - "serve-index": "^1.9.1", - "sockjs": "0.3.19", - "sockjs-client": "1.4.0", - "spdy": "^4.0.1", - "strip-ansi": "^3.0.1", - "supports-color": "^6.1.0", - "url": "^0.11.0", - "webpack-dev-middleware": "^3.7.1", - "webpack-log": "^2.0.0", - "ws": "^6.2.1", - "yargs": "12.0.5" - }, - "dependencies": { - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "is-absolute-url": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.2.tgz", - "integrity": "sha512-+5g/wLlcm1AcxSP7014m6GvbPHswDx980vD/3bZaap8aGV9Yfs7Q6y6tfaupgZ5O74Byzc8dGrSCJ+bFXx0KdA==", - "dev": true - }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "webpack-dev-middleware": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.1.tgz", - "integrity": "sha512-5MWu9SH1z3hY7oHOV6Kbkz5x7hXbxK56mGHNqHTe6d+ewxOwKUxoUJBs7QIaJb33lPjl9bJZ3X0vCoooUzC36A==", - "dev": true, - "requires": { - "memory-fs": "^0.4.1", - "mime": "^2.4.4", - "mkdirp": "^0.5.1", - "range-parser": "^1.2.1", - "webpack-log": "^2.0.0" - } - }, - "webpack-log": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", - "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", - "dev": true, - "requires": { - "ansi-colors": "^3.0.0", - "uuid": "^3.3.2" - } - }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, - "webpack-info-plugin": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/webpack-info-plugin/-/webpack-info-plugin-0.1.0.tgz", - "integrity": "sha1-3/56qI/LlsWcxFCXZCHq+YzbeQE=", - "dev": true, - "requires": { - "chalk": "^1.1.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "webpack-log": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-1.2.0.tgz", - "integrity": "sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqT4lwWwoMHdQWwEKw736fCHEekokTEKHA==", - "dev": true, - "requires": { - "chalk": "^2.1.0", - "log-symbols": "^2.1.0", - "loglevelnext": "^1.0.1", - "uuid": "^3.1.0" - } - }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "websocket-driver": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", - "integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", - "dev": true, - "requires": { - "http-parser-js": ">=0.4.0 <0.4.11", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", - "dev": true - }, - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "whet.extend": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", - "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", - "dev": true - }, - "windows-release": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", - "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", - "dev": true, - "requires": { - "execa": "^1.0.0" - } - }, - "winston": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.1.1.tgz", - "integrity": "sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=", - "dev": true, - "requires": { - "async": "~1.0.0", - "colors": "1.0.x", - "cycle": "1.0.x", - "eyes": "0.1.x", - "isstream": "0.1.x", - "pkginfo": "0.3.x", - "stack-trace": "0.0.x" - }, - "dependencies": { - "async": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", - "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", - "dev": true - }, - "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", - "dev": true - }, - "pkginfo": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", - "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=", - "dev": true - } - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "write-json-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", - "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.15", - "make-dir": "^2.1.0", - "pify": "^4.0.1", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.4.2" - }, - "dependencies": { - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - } - } - }, - "write-pkg": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", - "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", - "dev": true, - "requires": { - "sort-keys": "^2.0.0", - "write-json-file": "^2.2.0" - }, - "dependencies": { - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "write-json-file": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", - "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - } - } - } - }, - "ws": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", - "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", - "dev": true, - "requires": { - "options": ">=0.0.5", - "ultron": "1.0.x" - } - }, - "wtf-8": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", - "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=", - "dev": true - }, - "xmlcreate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", - "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==", - "dev": true - }, - "xmlhttprequest-ssl": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", - "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=", - "dev": true - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yamljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz", - "integrity": "sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "glob": "^7.0.5" - } - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } - }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", - "dev": true - } - } -} diff --git a/package.json b/package.json index 1fea8772..0fa03557 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,37 @@ { "name": "muze-monorepo", "private": true, + "scripts": { + "test": "npm run lint && npm run ut", + "ut": "./scripts/test-runner.sh '*'", + "ut:layout": "./scripts/test-runner.sh layout", + "ut:muze": "./scripts/test-runner.sh muze", + "ut:axis": "./scripts/test-runner.sh muze-axis", + "ut:firebolt": "./scripts/test-runner.sh muze-firebolt", + "ut:legend": "./scripts/test-runner.sh muze-legend", + "ut:tooltip": "./scripts/test-runner.sh muze-tooltip", + "ut:utils": "./scripts/test-runner.sh muze-utils", + "ut:transform": "./scripts/test-runner.sh transform", + "ut:cell": "./scripts/test-runner.sh visual-cell", + "ut:group": "./scripts/test-runner.sh visual-group", + "ut:layer": "./scripts/test-runner.sh visual-layer", + "ut:unit": "./scripts/test-runner.sh visual-unit", + "clean": "rimraf ./dist", + "build:prod": "npm run clean && webpack --mode production", + "build:dev": "npm run clean && webpack --mode development", + "build": "npm run build:prod", + "start:prod": "webpack-dev-server --host 0.0.0.0 --open --mode production --config webpack.config.js", + "start:dev": "webpack-dev-server --host 0.0.0.0 --mode development --config webpack.config.dev.js", + "start": "npm run start:dev", + "lint": "eslint ./packages", + "lint-errors": "eslint --quiet ./packages", + "docs": "rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json", + "autotest:prod": "node scripts/run-autotest.js --mode production", + "autotest:dev": "node scripts/run-autotest.js --mode development", + "autotest": "npm run autotest:dev", + "upload": "node scripts/upload-build.js", + "postinstall": "lerna bootstrap" + }, "devDependencies": { "@babel/cli": "^7.2.3", "@babel/core": "^7.2.2", @@ -46,6 +77,7 @@ "ora": "^3.2.0", "postcss-loader": "^3.0.0", "prompt": "^1.0.0", + "prompts": "^2.2.1", "rimraf": "^2.6.2", "sass-loader": "^7.0.1", "semver": "^5.6.0", @@ -54,44 +86,11 @@ "transform-runtime": "0.0.0", "uglifyjs-webpack-plugin": "^1.2.7", "uuid": "^3.3.2", - "webpack": "^4.12.0", "webpack-bundle-analyzer": "^2.13.1", - "webpack-cli": "^3.0.7", "webpack-dev-server": "^3.1.14", - "yamljs": "^0.3.0" - }, - "scripts": { - "test": "npm run lint && npm run ut", - "ut": "./scripts/test-runner.sh '*'", - "ut:layout": "./scripts/test-runner.sh layout", - "ut:muze": "./scripts/test-runner.sh muze", - "ut:axis": "./scripts/test-runner.sh muze-axis", - "ut:firebolt": "./scripts/test-runner.sh muze-firebolt", - "ut:legend": "./scripts/test-runner.sh muze-legend", - "ut:tooltip": "./scripts/test-runner.sh muze-tooltip", - "ut:utils": "./scripts/test-runner.sh muze-utils", - "ut:transform": "./scripts/test-runner.sh transform", - "ut:cell": "./scripts/test-runner.sh visual-cell", - "ut:group": "./scripts/test-runner.sh visual-group", - "ut:layer": "./scripts/test-runner.sh visual-layer", - "ut:unit": "./scripts/test-runner.sh visual-unit", - "clean": "rimraf ./dist", - "copy-dist": "cp -R dist packages/muze/npm/", - "copy-rdm": "cp README.md packages/muze/ && cp README.md packages/muze/npm/", - "build:prod": "npm run clean && webpack --mode production && npm run copy-dist && npm run copy-rdm", - "build:dev": "npm run clean && webpack --mode development && npm run copy-dist && npm run copy-rdm", - "build": "npm run build:prod", - "start:prod": "webpack-dev-server --host 0.0.0.0 --open --mode production --config webpack.config.js", - "start:dev": "webpack-dev-server --host 0.0.0.0 --mode development --config webpack.config.dev.js", - "start": "npm run start:dev", - "lint": "eslint ./packages", - "lint-errors": "eslint --quiet ./packages", - "docs": "rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json", - "autotest:prod": "node scripts/run-autotest.js --mode production", - "autotest:dev": "node scripts/run-autotest.js --mode development", - "autotest": "npm run autotest:dev", - "upload": "node scripts/upload-build.js", - "postinstall": "lerna bootstrap" + "yamljs": "^0.3.0", + "webpack": "^4.20.2", + "webpack-cli": "^3.1.1" }, "browserslist": [ "last 10 major versions", diff --git a/packages/layout/src/grid-layout/border-helper.js b/packages/layout/src/grid-layout/border-helper.js index 02ded483..37e3248a 100644 --- a/packages/layout/src/grid-layout/border-helper.js +++ b/packages/layout/src/grid-layout/border-helper.js @@ -3,51 +3,119 @@ import { VIEW_INDEX, ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, MIDDLE, NO_BORDERS } from '../enums/constants'; -const borderMap = { - [`${TOP}-${LEFT}`]: NO_BORDERS, +const borderMap = (isFacet, showHeaders) => ({ + [`${TOP}-${LEFT}`]: isFacet && showHeaders ? LEFT : NO_BORDERS, [`${TOP}-${MIDDLE}`]: COLUMN, - [`${TOP}-${RIGHT}`]: NO_BORDERS, - [`${CENTER}-${LEFT}`]: ROW, + [`${TOP}-${RIGHT}`]: isFacet && showHeaders ? RIGHT : NO_BORDERS, + [`${CENTER}-${LEFT}`]: isFacet ? `${CENTER}${LEFT}` : ROW, [`${CENTER}-${MIDDLE}`]: CENTER, - [`${CENTER}-${RIGHT}`]: ROW, + [`${CENTER}-${RIGHT}`]: isFacet ? `${CENTER}${RIGHT}` : ROW, [`${BOTTOM}-${LEFT}`]: NO_BORDERS, [`${BOTTOM}-${MIDDLE}`]: COLUMN, [`${BOTTOM}-${RIGHT}`]: NO_BORDERS -}; +}); -const applySpecificBorder = (cells, color, type, style) => { - cells.style(`border-${type}`, `${style} ${color}`); +const applySpecificBorder = (params) => { + const { type, borderWidth, borderStyle, cells, isFacet, color } = params; + if (!isFacet) { + cells.style(`border-${type}`, `${borderWidth}px ${borderStyle} ${color}`); + } else { + cells.style(`border-${type}-width`, `${borderWidth}px`); + cells.style(`border-${type}-style`, `${borderStyle}`); + } }; -const specificBorderApplier = (borderTypes, showBorders, cells, borderInfo) => { +const specificBorderApplier = (params) => { + const { borderTypes, showBorders, cells, borderInfo, name, isFacet } = params; const { color, - width, - style + style, + width } = borderInfo; - const borderStyle = `${width}px ${style}`; - borderTypes.forEach((borderType) => { - applySpecificBorder(cells, showBorders[borderType] ? color : BLANK_BORDERS, borderType, borderStyle); + applySpecificBorder({ + cells, + color: showBorders[borderType] ? color : BLANK_BORDERS, + type: borderType, + borderWidth: width, + borderStyle: style, + name, + isFacet + }); }); }; -const borderApplier = (cells, borderInfo) => { +const borderApplier = (cells, borderInfo, name, isFacet) => { const { - showRowBorders, - showColBorders, - showValueBorders - } = borderInfo; + showRowBorders, + showColBorders, + showValueBorders + } = borderInfo; return { - row: () => specificBorderApplier([TOP, BOTTOM], showRowBorders, cells, borderInfo), - column: () => specificBorderApplier([LEFT, RIGHT], showColBorders, cells, borderInfo), - center: () => specificBorderApplier([LEFT, RIGHT, TOP, BOTTOM], showValueBorders, cells, borderInfo) + [ROW]: () => specificBorderApplier({ + borderTypes: [TOP, BOTTOM], + showBorders: showRowBorders, + cells, + borderInfo, + name, + isFacet + }), + [COLUMN]: () => specificBorderApplier({ + borderTypes: [LEFT, RIGHT], + showBorders: showColBorders, + cells, + borderInfo, + name, + isFacet + }), + [CENTER]: () => specificBorderApplier({ + borderTypes: [LEFT, RIGHT, TOP, BOTTOM], + showBorders: showValueBorders, + cells, + borderInfo, + name, + isFacet + }), + [LEFT]: () => specificBorderApplier({ + borderTypes: [LEFT], + showBorders: showValueBorders, + cells, + borderInfo, + name, + isFacet + }), + [RIGHT]: () => specificBorderApplier({ + borderTypes: [RIGHT], + showBorders: showValueBorders, + cells, + borderInfo, + name, + isFacet + }), + [`${CENTER}${LEFT}`]: () => specificBorderApplier({ + borderTypes: [LEFT, TOP, BOTTOM], + showBorders: showValueBorders, + cells, + borderInfo, + name, + isFacet + }), + [`${CENTER}${RIGHT}`]: () => specificBorderApplier({ + borderTypes: [RIGHT, TOP, BOTTOM], + showBorders: showValueBorders, + cells, + borderInfo, + name, + isFacet + }) }; }; -export const applyBorders = (cells, border, row, column) => { - const borderApplierFn = borderApplier(cells, border); - const borderMapVal = borderMap[`${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`]; +export const applyBorders = (params) => { + const { cells, border, row, column, isFacet, showHeaders } = params; + const name = `${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`; + const borderApplierFn = borderApplier(cells, border, name, isFacet); + const borderMapVal = borderMap(isFacet, showHeaders)[name]; if (borderMapVal) { borderApplierFn[borderMapVal](); } diff --git a/packages/muze-axis/src/axis-renderer.js b/packages/muze-axis/src/axis-renderer.js index e6cc5dc7..075324b6 100644 --- a/packages/muze-axis/src/axis-renderer.js +++ b/packages/muze-axis/src/axis-renderer.js @@ -80,8 +80,8 @@ const rotateAxis = (instance, tickText, labelManager) => { .attr('transform', `translate(${xShift - tickSize} ${yShift + tickSize}) rotate(${rotation})`); } - selectElement(this).transition() - .duration(1000).text(datum); + // selectElement(this).transition() + // .duration(1000).text(datum); }); return tickText; }; @@ -215,24 +215,9 @@ const setAxisNamePos = (textNode, orientation, measures) => { * @param {SVGElement} axisInstance.container the container in which to render */ export function renderAxis (axisInstance) { - const config = axisInstance.config(); const renderConfig = axisInstance.renderConfig(); - const labelManager = axisInstance.dependencies().labelManager; - const mount = axisInstance.mount(); - const range = axisInstance.range(); - const axis = axisInstance.axis(); - const scale = axisInstance.scale(); - const { - _tickLabelStyle: tickLabelStyle, - _tickFormatter: axisTickFormatter - } = axisInstance; - const { - orientation, - axisNamePadding, - className, - id, - classPrefix - } = config; + const config = axisInstance.config(); + const { show, xOffset, @@ -241,52 +226,75 @@ export function renderAxis (axisInstance) { labels, smartAxisName } = renderConfig; + const mount = axisInstance.mount(); + + const { + orientation, + axisNamePadding, + className, + id, + classPrefix + } = config; if (!show) { return; } - const tickSize = axisInstance.getTickSize(); - const selectContainer = makeElement(selectElement(mount), 'g', [axisInstance], `${className}`, {}, - key => key.config().id); + key => key.config().id); + selectContainer.attr('transform', `translate(${xOffset},${yOffset})`); - // Set style for tick labels - labelManager.setStyle(tickLabelStyle); + let availableSpace; + let labelProps; + let tickSize; + if (axisInstance.domain().length > 0) { + const labelManager = axisInstance.dependencies().labelManager; + const range = axisInstance.range(); + const axis = axisInstance.axis(); + const scale = axisInstance.scale(); - const labelFunc = scale.ticks || scale.quantile || scale.domain; + const { + _tickLabelStyle: tickLabelStyle, + _tickFormatter: axisTickFormatter + } = axisInstance; - const ticks = axis.tickValues() || labelFunc(); + tickSize = axisInstance.getTickSize(); - axis.tickFormat(axisTickFormatter(ticks)); + // Set style for tick labels + labelManager.setStyle(tickLabelStyle); - // Get range(length of range) - const availableSpace = Math.abs(range[0] - range[1]); + const labelFunc = scale.ticks || scale.quantile || scale.domain; - // Get width and height taken by axis labels - const labelProps = axisInstance.axisComponentDimensions().largestTickDimensions; + const ticks = axis.tickValues() || labelFunc(); - // Draw axis ticks - selectContainer.attr('transform', `translate(${xOffset},${yOffset})`); - setFixedBaseline(axisInstance); - if (labels.smartTicks === false || tickSize === 0) { - selectContainer.transition() - .duration(1000) - .on('end', axisInstance.registerAnimationDoneHook()) - .call(axis); - } else { - selectContainer.call(axis); - } - selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true); - selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true); + axis.tickFormat(axisTickFormatter(ticks)); - // Set classes for ticks - const tickText = selectContainer.selectAll('.tick text'); - tickText.classed(`${classPrefix}-ticks`, true) - .classed(`${classPrefix}-ticks-${id}`, true); + // Get range(length of range) + availableSpace = Math.abs(range[0] - range[1]); + + // Get width and height taken by axis labels + labelProps = axisInstance.axisComponentDimensions().largestTickDimensions; + + // Draw axis ticks + setFixedBaseline(axisInstance); + if (!labels.rotation && labels.smartTicks === false) { + selectContainer.transition() + .duration(1000) + .on('end', axisInstance.registerAnimationDoneHook()) + .call(axis); + } else { + selectContainer.call(axis); + changeTickOrientation(selectContainer, axisInstance, tickSize); + } - changeTickOrientation(selectContainer, axisInstance, tickSize); + selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true); + selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true); + // Set classes for ticks + const tickText = selectContainer.selectAll('.tick text'); + tickText.classed(`${classPrefix}-ticks`, true) + .classed(`${classPrefix}-ticks-${id}`, true); + } // Create axis name const textNode = makeElement(selectContainer, 'text', [smartAxisName], `${classPrefix}-axis-name`) .attr('text-anchor', 'middle') diff --git a/packages/muze-axis/src/cartesian-axis/band-axis.js b/packages/muze-axis/src/cartesian-axis/band-axis.js index d89862e6..c15fef4c 100644 --- a/packages/muze-axis/src/cartesian-axis/band-axis.js +++ b/packages/muze-axis/src/cartesian-axis/band-axis.js @@ -141,4 +141,5 @@ export default class BandAxis extends SimpleAxis { const p2 = scale(reverse ? extent[0] : extent[extent.length - 1]) + scale.bandwidth(); return [p1, p2]; } + } diff --git a/packages/muze-axis/src/cartesian-axis/default-config.js b/packages/muze-axis/src/cartesian-axis/default-config.js index c0bbe342..b39095dd 100644 --- a/packages/muze-axis/src/cartesian-axis/default-config.js +++ b/packages/muze-axis/src/cartesian-axis/default-config.js @@ -11,7 +11,7 @@ export const defaultConfig = { axisName: { defClassName: 'axis-name' }, - axisNamePadding: 12, + axisNamePadding: 7, base: 10, classPrefix: CLASSPREFIX, className: `${CLASSPREFIX}-axis`, @@ -37,6 +37,7 @@ export const defaultConfig = { tickFormat: null, tickValues: null, xOffset: 0, - yOffset: 0 + yOffset: 0, + defaultSort: 'asc' }; diff --git a/packages/muze-axis/src/cartesian-axis/helper.js b/packages/muze-axis/src/cartesian-axis/helper.js index d13ca56e..1dbc0e12 100644 --- a/packages/muze-axis/src/cartesian-axis/helper.js +++ b/packages/muze-axis/src/cartesian-axis/helper.js @@ -30,6 +30,7 @@ export const setOffset = (context) => { if (orientation === TOP) { y = yOffset === undefined ? logicalSpace.height : yOffset; } + context.renderConfig({ xOffset: x, yOffset: y }); }; @@ -120,6 +121,7 @@ export const computeAxisDimensions = (context) => { let tickDimensions = {}; const { labels } = context.renderConfig(); const { smartTicks, rotation } = labels; + const { largestTickDimensions, axisTicks, @@ -135,7 +137,14 @@ export const computeAxisDimensions = (context) => { // const angle = ((rotation || 0) * Math.PI) / 180; if (domain.length === 0) { - return null; + return { + allTickDimensions, + tickSize: 0, + tickDimensions: { height: 0, width: 0 }, + axisNameDimensions, + largestTickDimensions, + axisTicks + }; } if (smartTicks) { @@ -148,6 +157,7 @@ export const computeAxisDimensions = (context) => { if (tickSize === 0) { tickDimensions = { width: 0, height: 0 }; } + return { allTickDimensions, tickSize, @@ -232,7 +242,7 @@ export const getVerticalAxisSpace = (context, axisDimensions) => { height = ((max - min) / Math.abs(minTickDiff)) * tickDimHeight; } - width += (showAxisName ? axisDimHeight : 0) + tickSize + axisNamePadding; + width += (showAxisName ? axisDimHeight : 0) + tickSize + (tickValues ? axisNamePadding : 0); return { height, diff --git a/packages/muze-axis/src/cartesian-axis/simple-axis.js b/packages/muze-axis/src/cartesian-axis/simple-axis.js index ed487ee6..c399dc6d 100644 --- a/packages/muze-axis/src/cartesian-axis/simple-axis.js +++ b/packages/muze-axis/src/cartesian-axis/simple-axis.js @@ -489,5 +489,22 @@ export default class SimpleAxis { resolveFn(); }; } -} + _getRawTickValue (data) { + return data; + } + + getTicksBasedOnData (tickData) { + const allTicks = selectElement(this.mount()).selectAll('.tick'); + let elementToBeModified = null; + let elementNotToBeModified = null; + if (tickData) { + elementToBeModified = allTicks.filter(tickValue => tickData === this._getRawTickValue(tickValue)); + elementNotToBeModified = allTicks.filter(tickValue => !(tickData === this._getRawTickValue(tickValue))); + } + return { + selectionSet: elementToBeModified, + rejectionSet: elementNotToBeModified || allTicks + }; + } +} diff --git a/packages/muze-axis/src/cartesian-axis/space-setter.js b/packages/muze-axis/src/cartesian-axis/space-setter.js index 04e63290..5f090f27 100644 --- a/packages/muze-axis/src/cartesian-axis/space-setter.js +++ b/packages/muze-axis/src/cartesian-axis/space-setter.js @@ -97,12 +97,14 @@ export const spaceSetter = (context, spaceConfig) => { axisNamePadding, tickValues } = config; + const { tickDimensions, allTickDimensions, axisNameDimensions, tickSize } = context.getAxisDimensions(); + const { height: tickDimHeight, width: tickDimWidth @@ -270,11 +272,9 @@ export const spaceSetter = (context, spaceConfig) => { context.renderConfig({ showInnerTicks: true, showAxisName: false - }); } } - if (availHeight < axisNameHeight) { context.renderConfig({ show: false }); } @@ -282,7 +282,7 @@ export const spaceSetter = (context, spaceConfig) => { }, y: () => { labelConfig.smartTicks = false; - const tickShifter = tickDimensions.height / 2; + const tickShifter = tickDimHeight / 2; const baseline = fixedBaseline ? 1 : tickShifter; setAxisRange(context, 'x', [availHeight - bottom - baseline, tickShifter + top], diff --git a/packages/muze-axis/src/cartesian-axis/time-axis.js b/packages/muze-axis/src/cartesian-axis/time-axis.js index 7433e77e..572efc3a 100644 --- a/packages/muze-axis/src/cartesian-axis/time-axis.js +++ b/packages/muze-axis/src/cartesian-axis/time-axis.js @@ -194,4 +194,7 @@ export default class TimeAxis extends SimpleAxis { this.smartTicks(smartTicks); return this; } + _getRawTickValue (data) { + return (new Date(data)).getTime(); + } } diff --git a/packages/muze-axis/src/color-axis/color-axis.js b/packages/muze-axis/src/color-axis/color-axis.js index eba195cb..f8acce47 100644 --- a/packages/muze-axis/src/color-axis/color-axis.js +++ b/packages/muze-axis/src/color-axis/color-axis.js @@ -114,6 +114,7 @@ export default class ColorAxis { getColor (domainVal) { return this.getHslString(this.getRawColor(domainVal)); } + /** * * diff --git a/packages/muze-axis/src/color-axis/color-strategy.js b/packages/muze-axis/src/color-axis/color-strategy.js index fe499bef..ac8ac8d7 100644 --- a/packages/muze-axis/src/color-axis/color-strategy.js +++ b/packages/muze-axis/src/color-axis/color-strategy.js @@ -1,4 +1,6 @@ -import { numberInterpolator, piecewiseInterpolator, hslInterpolator, sanitizeDomainWhenEqual } from 'muze-utils'; +import { piecewiseInterpolator, + hslInterpolator, + sanitizeDomainWhenEqual, getReadableTicks } from 'muze-utils'; import { CONTINOUS, DISCRETE } from '../enums/constants'; import { LINEAR, SEQUENTIAL, ORDINAL, QUANTILE } from '../enums/scale-type'; import { getHslString } from './props'; @@ -11,14 +13,7 @@ const getStops = (domain, stops) => { newStops = stops.slice().sort(); newStops = [...new Set([domain[0], ...stops, domain[1]])].sort(); } else { - const interpolator = numberInterpolator()(...domain); - for (let i = 0; i <= stops; i++) { - newStops[i] = interpolator(i / stops); - } - } - - if (newStops[0] < domain[0]) { - newStops.shift(); + newStops = getReadableTicks(domain, stops); } return { domain, newStops }; }; diff --git a/packages/muze-axis/src/color-axis/defaults.js b/packages/muze-axis/src/color-axis/defaults.js index 0ca93ff3..52d6e673 100644 --- a/packages/muze-axis/src/color-axis/defaults.js +++ b/packages/muze-axis/src/color-axis/defaults.js @@ -5,12 +5,16 @@ import { * Set of default colors */ export const palette = [ - '#086bb6', - '#f37d45', - '#f5ce02', - '#67bda0', - '#c54e4e', - '#ae70af' + '#1f77b4', + '#ff7f0e', + '#2ca02c', + '#d62728', + '#9467bd', + '#8c564b', + '#e377c2', + '#7f7f7f', + '#bcbd22', + '#17becf' ]; export const DEFAULT_GRADIENT_COLOR = '#eaeaea'; diff --git a/packages/muze-axis/src/color-axis/props.js b/packages/muze-axis/src/color-axis/props.js index 48b5603a..b2eb2d50 100644 --- a/packages/muze-axis/src/color-axis/props.js +++ b/packages/muze-axis/src/color-axis/props.js @@ -1,6 +1,6 @@ import { mergeRecursive, detectColor, hexToHsv, rgbToHsv, defaultValue } from 'muze-utils'; import { x11Colors } from './color-maps'; -import { palette, DEFAULT_GRADIENT_COLOR } from './defaults'; +import { palette, DEFAULT_GRADIENT_COLOR, DEFAULT_CONFIG } from './defaults'; import { LINEAR, RGB, HEX, HSL, HSLA } from '../enums/constants'; export const getHslString = hslArr => `hsla(${hslArr[0] * 360},${hslArr[1] * 100}%,${hslArr[2] * 100}%,\ @@ -46,7 +46,11 @@ export const PROPS = { if (newConfig.range instanceof Array) { newConfig.range = newConfig.range.map((e, i) => getActualHslColor(e, palette[i])); - newConfig.stops = config.stops || newConfig.range.length; + newConfig.stops = config.stops ? + config.stops : + config.range && config.range.length > 2 ? + config.range.length : + DEFAULT_CONFIG.stops; } newConfig.value = getActualHslColor(newConfig.value, newConfig.value); return newConfig; diff --git a/packages/muze-axis/src/helper.js b/packages/muze-axis/src/helper.js index 9ce80a33..15c287f4 100644 --- a/packages/muze-axis/src/helper.js +++ b/packages/muze-axis/src/helper.js @@ -18,3 +18,10 @@ export const resolveAxisConfig = (propVal, defaultVal, context) => { return defaultVal; } }; + +export const sanitiseConfigIntervals = (intervals) => { + if (intervals) { + return intervals; + } + return 5; +}; diff --git a/packages/muze-axis/src/size-axis/defaults.js b/packages/muze-axis/src/size-axis/defaults.js index b39d4de0..5c2f4c85 100644 --- a/packages/muze-axis/src/size-axis/defaults.js +++ b/packages/muze-axis/src/size-axis/defaults.js @@ -1,4 +1,4 @@ export const DEFAULT_CONFIG = { - value: 36, - range: [36, 1000] + value: 51, + range: [51, 1000] }; diff --git a/packages/muze-axis/src/size-axis/props.js b/packages/muze-axis/src/size-axis/props.js index 22b68b12..e47ac656 100644 --- a/packages/muze-axis/src/size-axis/props.js +++ b/packages/muze-axis/src/size-axis/props.js @@ -1,5 +1,12 @@ +import { mergeRecursive } from 'muze-utils'; + export const PROPS = { - config: {}, + config: { + sanitization: (context, value) => { + context._userRange = value.range; + return mergeRecursive(context._config || {}, value); + } + }, domain: { sanitization: (context, value) => { context.scale().domain(value); diff --git a/packages/muze-axis/src/size-axis/size-axis.js b/packages/muze-axis/src/size-axis/size-axis.js index c4d8147c..8d46adb2 100644 --- a/packages/muze-axis/src/size-axis/size-axis.js +++ b/packages/muze-axis/src/size-axis/size-axis.js @@ -9,6 +9,7 @@ import { DEFAULT_CONFIG } from './defaults'; import { SIZE, CONTINOUS, DISCRETE } from '../enums/constants'; import { strategyGetter } from './size-strategy'; import { PROPS } from './props'; +import { sanitiseConfigIntervals } from '../helper'; /** * This class is used to instantiate a SimpleAxis. @@ -25,10 +26,15 @@ export default class SizeAxis { generateGetterSetters(this, PROPS); this._id = getUniqueId(); - this._config = Object.assign({}, this.constructor.defaultConfig(), config); + this.config(this.constructor.defaultConfig()); + this.config(config); // @todo: Will use configuration override using scale decorator this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE; - this._rangeType = CONTINOUS; + + this._config.range = this._userRange ? this._userRange : this._config.range; + + this._config.stops = sanitiseConfigIntervals(this._config.stops); + this._rangeType = this._config.type === 'linear' && !!this._config.stops ? DISCRETE : CONTINOUS; this._sizeStrategy = this.setStrategy(this._domainType, this._rangeType); this._scale = this.createScale(this._sizeStrategy); @@ -121,7 +127,7 @@ export default class SizeAxis { if (domain) { const domainFn = this._sizeStrategy.domain; - const domainInfo = domainFn(domain, this.config().intervals); + const domainInfo = domainFn(domain, this.config().stops); this.domain(domainInfo.domain); this.uniqueValues(domainInfo.uniqueVals); diff --git a/packages/muze-axis/src/size-axis/size-strategy.js b/packages/muze-axis/src/size-axis/size-strategy.js index dfd23d85..d961931f 100644 --- a/packages/muze-axis/src/size-axis/size-strategy.js +++ b/packages/muze-axis/src/size-axis/size-strategy.js @@ -1,4 +1,4 @@ -import { numberInterpolator, piecewiseInterpolator } from 'muze-utils'; +import { numberInterpolator, piecewiseInterpolator, getReadableTicks } from 'muze-utils'; import { CONTINOUS, DISCRETE } from '../enums/constants'; import { LINEAR, THRESHOLD } from '../enums/scale-type'; import { treatNullMeasures } from '../helper'; @@ -38,14 +38,15 @@ const steppedDomain = (domain, intervals) => { if (intervals instanceof Array) { newIntervals = intervals.slice().sort(); } else { - const interpolator = numberInterpolator()(...domain); - for (let i = 0; i < intervals; i++) { - newIntervals[i] = interpolator(i / (intervals - 1)); - } - } - if (newIntervals[0] < domain[0]) { - newIntervals.shift(); + // const interpolator = numberInterpolator()(...domain); + // for (let i = 0; i < intervals; i++) { + // newIntervals[i] = interpolator(i / (intervals - 1)); + // } + newIntervals = getReadableTicks(domain, intervals); } + // if (newIntervals[0] < domain[0]) { + // newIntervals.shift(); + // } const retDomain = newIntervals; return { uniqueVals: newIntervals, domain: retDomain, nice: true }; }; diff --git a/packages/muze-firebolt/src/actions/behavioural/generic.js b/packages/muze-firebolt/src/actions/behavioural/generic.js index 19f34f27..7f94b352 100644 --- a/packages/muze-firebolt/src/actions/behavioural/generic.js +++ b/packages/muze-firebolt/src/actions/behavioural/generic.js @@ -1,4 +1,21 @@ -import { getSetInfo, getMergedSet, getSourceFields } from '../../helper'; +import { + isSimpleObject, + DimensionSubtype, + partition, + ReservedFields, + retrieveNearestGroupByReducers +} from 'muze-utils'; +import { getMergedSet, getSourceFields } from '../../helper'; + +export const getIdentifiersFromSet = (set, context, { fields }) => { + const data = [[]]; + + if (fields.length) { + data[0] = fields; + set.forEach(id => data.push(id)); + } + return data; +}; /** * This is the base class has all the common functionalities needed for all behavioural actions. Any other behavioural @@ -31,13 +48,22 @@ export default class GenericBehaviour { const { model: filteredDataModel, uids - } = this.firebolt.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf()); - const entryExitSets = selectionSets.map((selectionSet) => { - this.setSelectionSet(uids, selectionSet); - return this.getEntryExitSet(selectionSet, filteredDataModel, payload); + } = this.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf()); + this._payload = payload; + + selectionSets.forEach((selectionSet) => { + this.setSelectionSet(uids, selectionSet, { + filteredDataModel, + payload + }); + + selectionSet._volatile && this.propagationIdentifiers(selectionSet, payload); + this.entryExitSet(selectionSet, filteredDataModel, payload); }); + } - return entryExitSets; + getAddSetFromCriteria (...params) { + return this.firebolt.getAddSetFromCriteria(...params); } /** @@ -54,34 +80,111 @@ export default class GenericBehaviour { return this; } - getEntryExitSet (selectionSet, filteredDataModel, payload) { - const { - entrySet, - exitSet, - completeSet - } = selectionSet.getSets(); - const propagationInf = this.firebolt.getPropagationInf(); - const dataModel = this.firebolt.getFullData(); - const setConfig = { - dataModel, - filteredDataModel, - propagationData: propagationInf.data, - selectionSet - }; + entryExitSet (...params) { + if (params.length) { + const [selectionSet, filteredDataModel, payload] = params; + const { + entrySet, + exitSet, + completeSet + } = selectionSet.getSets(); + const propagationInf = this.firebolt.getPropagationInf(); + + this._entryExitSet = { + entrySet: [this.getSetInfo('oldEntry', entrySet[0], filteredDataModel), + this.getSetInfo('newEntry', entrySet[1], filteredDataModel)], + exitSet: [this.getSetInfo('oldEntry', exitSet[0], filteredDataModel), + this.getSetInfo('newExit', exitSet[1], filteredDataModel)], + mergedEnter: this.getSetInfo('mergedEnter', getMergedSet(entrySet), filteredDataModel, + selectionSet._fields), + mergedExit: this.getSetInfo('mergedExit', getMergedSet(exitSet), filteredDataModel, + selectionSet._fields), + completeSet: this.getSetInfo('complete', completeSet, filteredDataModel, selectionSet._fields), + fields: getSourceFields(propagationInf, payload.criteria) + }; + + return this; + } + return this._entryExitSet; + } + + getSetInfo (type, set, filteredDataModel, setFields) { + let model = null; + const data = this.firebolt.data(); + + if (type === 'mergedEnter') { + model = filteredDataModel || null; + } else if (type === 'mergedExit') { + if (filteredDataModel) { + const setKeys = new Set(set.map(d => d[0])); + model = data.select((fields, i) => setKeys.has(setFields.map(field => + (field === ReservedFields.ROW_ID ? i : fields[field].value))), { + saveChild: false + }); + } + model = filteredDataModel || null; + } + const aggFns = retrieveNearestGroupByReducers(model); return { - entrySet: [getSetInfo('oldEntry', entrySet[0], setConfig), - getSetInfo('newEntry', entrySet[1], setConfig)], - exitSet: [getSetInfo('oldEntry', exitSet[0], setConfig), - getSetInfo('newExit', exitSet[1], setConfig)], - mergedEnter: getSetInfo('mergedEnter', getMergedSet(entrySet), setConfig), - mergedExit: getSetInfo('mergedExit', getMergedSet(exitSet), setConfig), - completeSet: getSetInfo('complete', completeSet, setConfig), - fields: getSourceFields(propagationInf, payload.criteria), - sourceSelectionSet: selectionSet._volatile === true + uids: set, + length: set.length, + model, + fields: setFields, + aggFns }; } + propagationIdentifiers (...params) { + if (params.length) { + let propData = null; + const [selectionSet, payload] = params; + const fieldsConfig = this.firebolt.data().getFieldsConfig(); + const { criteria } = payload; + const propagationFields = this._propagationFields; + + if (selectionSet.resetted() || criteria === null) { + propData = null; + } else if (isSimpleObject(criteria)) { + const fields = Object.keys(criteria); + const [, otherFields] = + partition(fields, (d => (fieldsConfig[d] ? fieldsConfig[d].def.subtype === + DimensionSubtype.CATEGORICAL : d === ReservedFields.MEASURE_NAMES))); + const allFields = selectionSet._fields.filter(d => d === ReservedFields.ROW_ID || + fieldsConfig[d].def.subtype === + DimensionSubtype.CATEGORICAL + ); + const { mergedEnter } = selectionSet.getSets({ keepDims: true, dimensions: allFields }); + propData = { + fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : { + name: d + })), + range: this.firebolt.getRangeFromIdentifiers({ + criteria, + entrySet: mergedEnter, + fields: otherFields + }), + identifiers: [[...allFields, ReservedFields.MEASURE_NAMES], ...mergedEnter] + }; + } else { + const { mergedEnter } = selectionSet.getSets({ keepDims: true, + dimensions: propagationFields }); + const fields = propagationFields ? [...propagationFields, ReservedFields.MEASURE_NAMES] : + criteria[0]; + + propData = { + fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : { + name: d + })), + identifiers: [fields, ...mergedEnter] + }; + } + this._propagationIdentifiers = propData; + return this; + } + return this._propagationIdentifiers; + } + static mutates () { return false; } @@ -97,5 +200,11 @@ export default class GenericBehaviour { isEnabled () { return this._enabled; } + + propagateWith (...params) { + this._propagationFields = params[0]; + + return this; + } } diff --git a/packages/muze-firebolt/src/actions/behavioural/persistent.js b/packages/muze-firebolt/src/actions/behavioural/persistent.js index d6bb5f65..340ce814 100644 --- a/packages/muze-firebolt/src/actions/behavioural/persistent.js +++ b/packages/muze-firebolt/src/actions/behavioural/persistent.js @@ -6,35 +6,21 @@ export default class PersistentBehaviour extends GenericBehaviour { setSelectionSet (addSet, selectionSet) { if (addSet === null) { selectionSet.reset(); - } else if (addSet.length) { + } else { const propagationInf = this.firebolt.getPropagationInf(); // new add set const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY); - if (propagationInf.propagate === false) { + if (propagationInf.sourceId) { selectionSet.updateExit(); - const { entrySet } = selectionSet.getSets(); + const { entrySet } = selectionSet.getSets({ keepDims: true }); selectionSet.reset(getMergedSet(entrySet)); selectionSet.add(addSet); selectionSet.update(existingAddSet); } else { - // existing add set - if (existingAddSet.length) { - selectionSet.updateExit(); - selectionSet.remove(existingAddSet); - } else { - selectionSet.updateEntry(); - selectionSet.add(addSet); - } - const { exitSet } = selectionSet.getSets(); - const mergedExitSet = getMergedSet(exitSet); - const completeSetCount = selectionSet.getCompleteSet().length; - if (mergedExitSet.length === completeSetCount) { - selectionSet.reset(); - } + selectionSet.updateEntry(); + selectionSet.add(addSet); } - } else { - selectionSet.remove(selectionSet.getCompleteSet()); } return this; diff --git a/packages/muze-firebolt/src/actions/behavioural/select.js b/packages/muze-firebolt/src/actions/behavioural/select.js index 7f4f3468..ea173a25 100644 --- a/packages/muze-firebolt/src/actions/behavioural/select.js +++ b/packages/muze-firebolt/src/actions/behavioural/select.js @@ -1,9 +1,48 @@ import PersistentBehaviour from './persistent'; import { SELECT } from '../../enums/behaviours'; +import { SELECTION } from '../..'; +import { getMergedSet } from '../../helper'; export default class SelectBehaviour extends PersistentBehaviour { static formalName () { return SELECT; } + + setSelectionSet (addSet, selectionSet) { + if (addSet === null) { + selectionSet.reset(); + } else if (addSet.length) { + const propagationInf = this.firebolt.getPropagationInf(); + // new add set + const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY + || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY); + if (propagationInf.sourceId) { + selectionSet.updateExit(); + const { entrySet } = selectionSet.getSets({ keepDims: true }); + selectionSet.reset(getMergedSet(entrySet)); + selectionSet.add(addSet); + selectionSet.update(existingAddSet); + } else { + // existing add set + if (existingAddSet.length) { + selectionSet.updateExit(); + selectionSet.remove(existingAddSet); + } else { + selectionSet.updateEntry(); + selectionSet.add(addSet); + } + const { exitSet } = selectionSet.getSets({ keepDims: true }); + const mergedExitSet = getMergedSet(exitSet); + const completeSetCount = selectionSet.getCompleteSet().length; + if (mergedExitSet.length === completeSetCount) { + selectionSet.reset(); + } + } + } else { + selectionSet.remove(selectionSet.getCompleteSet()); + } + + return this; + } } diff --git a/packages/muze-firebolt/src/actions/behavioural/volatile.js b/packages/muze-firebolt/src/actions/behavioural/volatile.js index 2a7988d2..02532ed9 100644 --- a/packages/muze-firebolt/src/actions/behavioural/volatile.js +++ b/packages/muze-firebolt/src/actions/behavioural/volatile.js @@ -11,7 +11,7 @@ export default class VolatileBehaviour extends GenericBehaviour { const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY); selectionSet.updateExit(); - const { entrySet } = selectionSet.getSets(); + const { entrySet } = selectionSet.getSets({ keepDims: true }); selectionSet.reset(getMergedSet(entrySet)); selectionSet.add(addSet); selectionSet.update(existingAddSet); diff --git a/packages/muze-firebolt/src/actions/physical/click.js b/packages/muze-firebolt/src/actions/physical/click.js index ee4a8349..aabe6f2f 100644 --- a/packages/muze-firebolt/src/actions/physical/click.js +++ b/packages/muze-firebolt/src/actions/physical/click.js @@ -1,5 +1,6 @@ import { getEvent } from 'muze-utils'; import { generatePayloadFromEvent } from './helpers'; +import * as ACTION_NAMES from '../../enums/actions'; /** * Adds mouse interactions to target element. @@ -7,11 +8,11 @@ import { generatePayloadFromEvent } from './helpers'; * @param {SVGElement} targetEl Element on which the event listeners will be attached. * @param {Array} behaviours Array of behaviours */ -/* istanbul ignore next */ const click = firebolt => (targetEl, behaviours) => { +/* istanbul ignore next */ const click = firebolt => (targetEl) => { const dispatchBehaviour = function (args) { const event = getEvent(); const payload = generatePayloadFromEvent(args, event, firebolt); - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload)); + firebolt.triggerPhysicalAction(ACTION_NAMES.CLICK, payload); event.stopPropagation(); }; diff --git a/packages/muze-firebolt/src/actions/physical/drag.js b/packages/muze-firebolt/src/actions/physical/drag.js index 44b66d5b..8b504ac8 100644 --- a/packages/muze-firebolt/src/actions/physical/drag.js +++ b/packages/muze-firebolt/src/actions/physical/drag.js @@ -1,4 +1,5 @@ import { attachDragEvent } from './helpers/drag-event'; +import * as ACTION_NAMES from '../../enums/actions'; /** * Adds dragging action to the target element. @@ -6,8 +7,8 @@ import { attachDragEvent } from './helpers/drag-event'; * @param {SVGElement} targetEl Element on which brushing action is needed. * @param {Array} behaviours Array of behaviours */ -/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => { - attachDragEvent(targetEl, behaviours, firebolt); +/* istanbul ignore next */ const drag = firebolt => (targetEl) => { + attachDragEvent(targetEl, ACTION_NAMES.DRAG, firebolt); }; export default drag; diff --git a/packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js b/packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js index 9d82d106..ed12b0f5 100644 --- a/packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js +++ b/packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js @@ -1,86 +1,40 @@ -import { DimensionSubtype, MeasureSubtype } from 'muze-utils'; +import { COORD_TYPES } from 'muze-utils'; + +const dragCriteriaRetriever = { + [COORD_TYPES.CARTESIAN]: (firebolt, sourceInfo, { startPos, endPos }) => { + if (startPos.x === endPos.x && startPos.y === endPos.y) { + return { + criteria: null + }; + } + const ranges = firebolt.context.getRangeFromPositions({ + startPos, + endPos + }); + const dimensions = {}; + dimensions.x = [startPos.x, endPos.x]; + dimensions.y = [startPos.y, endPos.y]; + return { + criteria: ranges, + dimensions + }; + }, + [COORD_TYPES.POLAR]: () => ({ + criteria: null + }) +}; + /** * Gets the drag action configuration * @param {VisualUnit} instance instance of visual unit * @param {Object} config x y positions * @return {Object} Payload of behaviour */ -/* istanbul ignore next */ const getDragActionConfig = (sourceInfo, config, fieldsConfig) => { - if (!(sourceInfo.axes.x || sourceInfo.axes.y)) { - return { - criteria: null - }; - } - - const axes = sourceInfo.axes; - const xAxis = axes.x[0]; - const yAxis = axes.y[0]; - const axisFields = sourceInfo.fields; - const xField = axisFields.x[0].getMembers()[0]; - const yField = axisFields.y[0].getMembers()[0]; - const xFieldType = fieldsConfig[xField].def.subtype; - const yFieldType = fieldsConfig[yField].def.subtype; - const dimensions = {}; - const stPos = config.startPos; - const endPos = config.endPos; - - if (stPos.x === endPos.x && stPos.y === endPos.y) { - return { - criteria: null - }; - } - - const dragDim = xFieldType === MeasureSubtype.CONTINUOUS ? (yFieldType === MeasureSubtype.CONTINUOUS ? - ['x', 'y'] : ['y']) : ['x']; - const criteria = {}; - const isXDimension = xFieldType === DimensionSubtype.CATEGORICAL; - const isYDimension = yFieldType === DimensionSubtype.CATEGORICAL; - const xRange = xAxis.invertExtent(stPos.x, endPos.x); - const yRange = yAxis.invertExtent(stPos.y, endPos.y); - const selectedDomains = { - x: stPos.x === endPos.x ? [] : (isXDimension ? xRange : xRange.sort((a, b) => a - b)), - y: stPos.y === endPos.y ? [] : (isYDimension ? yRange : yRange.sort((a, b) => a - b)) - }; - const rangeObj = {}; - - if (dragDim.length === 2) { - rangeObj[xField] = selectedDomains.x; - rangeObj[yField] = selectedDomains.y; - if (xField === yField) { - const xdom = selectedDomains.x; - const ydom = selectedDomains.y; - const min = xdom[0] > ydom[0] ? ydom : xdom; - const max = min === ydom ? xdom : ydom; - if (min[1] < max[0]) { - rangeObj[xField] = []; - } else { - rangeObj[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]]; - } - dimensions.x = [stPos.x, endPos.x]; - dimensions.y = [stPos.y, endPos.y]; - } - } else { - criteria[dragDim[0]] = selectedDomains[dragDim[0]] || []; - - if (dragDim[0] === 'x') { - rangeObj[xField] = criteria.x; - if (xFieldType === DimensionSubtype.CATEGORICAL) { - dimensions.x = (config.snap && stPos.x !== endPos.x) ? xAxis.getNearestRange(stPos.x, endPos.x) : - [stPos.x, endPos.x]; - } - } else { - rangeObj[yField] = criteria.y; - if (yFieldType === DimensionSubtype.CATEGORICAL) { - dimensions.y = (config.snap && stPos.y !== endPos.y) ? yAxis.getNearestRange(stPos.y, endPos.y) : - [stPos.y, endPos.y]; - } - } - } - - return { - criteria: rangeObj, - dimensions - }; +/* istanbul ignore next */ const getDragActionConfig = (firebolt, config) => { + const context = firebolt.context; + const sourceInfo = context.getSourceInfo(); + const coordType = context.coord(); + return dragCriteriaRetriever[coordType](firebolt, sourceInfo, config); }; export default getDragActionConfig; diff --git a/packages/muze-firebolt/src/actions/physical/helpers/drag-event.js b/packages/muze-firebolt/src/actions/physical/helpers/drag-event.js index 15cd9e81..618ffe13 100644 --- a/packages/muze-firebolt/src/actions/physical/helpers/drag-event.js +++ b/packages/muze-firebolt/src/actions/physical/helpers/drag-event.js @@ -1,8 +1,7 @@ import { getEvent, getD3Drag - } from 'muze-utils'; - +} from 'muze-utils'; import getDragActionConfig from './drag-action-config'; /** @@ -11,7 +10,7 @@ import getDragActionConfig from './drag-action-config'; * @param {SVGElement} targetEl Element on which brushing action is needed. * @param {Array} behaviours Array of behaviours */ -export const attachDragEvent = (targetEl, behaviours, firebolt, touch) => { +export const attachDragEvent = (targetEl, action, firebolt, touch) => { let startPos = {}; let endPos = {}; let drawingInf; @@ -32,17 +31,31 @@ export const attachDragEvent = (targetEl, behaviours, firebolt, touch) => { x: event.x, y: event.y }; + if (touch && Math.abs(startPos.x - endPos.x) <= 5) { return; } endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width)); endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height)); + const newStartPos = Object.assign({}, startPos); + const newEndPos = Object.assign({}, endPos); + if (startPos.x > endPos.x) { + newStartPos.x = endPos.x; + newEndPos.x = startPos.x; + } - const payload = getDragActionConfig(firebolt.context.getSourceInfo(), { - startPos, - endPos - }, firebolt.context.data().getFieldsConfig()); - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload)); + if (startPos.y > endPos.y) { + const y = startPos.y; + newStartPos.y = endPos.y; + newEndPos.y = y; + } + const payload = getDragActionConfig(firebolt, { + startPos: newStartPos, + endPos: newEndPos + }); + payload.dragging = true; + payload.dragDiff = Math.abs(startPos.x - endPos.x) + Math.abs(startPos.y - endPos.y); + firebolt.triggerPhysicalAction(action, payload); }).on('end', () => { const event = getEvent(); endPos = { @@ -56,14 +69,24 @@ export const attachDragEvent = (targetEl, behaviours, firebolt, touch) => { } endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width)); endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height)); + if (startPos.x > endPos.x) { + const x = startPos.x; + startPos.x = endPos.x; + endPos.x = x; + } - const payload = getDragActionConfig(firebolt.context.getSourceInfo(), { + if (startPos.y > endPos.y) { + const y = startPos.y; + startPos.y = endPos.y; + endPos.y = y; + } + + const payload = getDragActionConfig(firebolt, { startPos, - endPos, - snap: true - }, firebolt.context.data().getFieldsConfig()); + endPos + }); payload.dragEnd = true; - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload)); + firebolt.triggerPhysicalAction(action, payload); })); }; diff --git a/packages/muze-firebolt/src/actions/physical/hover.js b/packages/muze-firebolt/src/actions/physical/hover.js index a1166800..5628c302 100644 --- a/packages/muze-firebolt/src/actions/physical/hover.js +++ b/packages/muze-firebolt/src/actions/physical/hover.js @@ -1,5 +1,5 @@ import { getClientPoint, getEvent } from 'muze-utils'; -import { CONSOLIDATED, FRAGMENTED } from '../../enums/constants'; +import * as ACTION_NAMES from '../../enums/actions'; /** * Adds mouse interactions to target element. @@ -7,7 +7,7 @@ import { CONSOLIDATED, FRAGMENTED } from '../../enums/constants'; * @param {SVGElement} targetEl Element on which the event listeners will be attached. * @param {Array} behaviours Array of behaviours */ -/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => { +/* istanbul ignore next */ const hover = firebolt => (targetEl) => { const dispatchBehaviour = function (args) { const event = getEvent(); const context = firebolt.context; @@ -15,28 +15,29 @@ import { CONSOLIDATED, FRAGMENTED } from '../../enums/constants'; const mode = tooltipConf.mode; const pos = getClientPoint(context.getDrawingContext().svgContainer, event); const nearestPoint = context.getNearestPoint(pos.x, pos.y, { - getAllPoints: mode === CONSOLIDATED || mode === FRAGMENTED, + getAllPoints: true, data: args, event }); const payload = { criteria: nearestPoint ? nearestPoint.id : null, + getAllPoints: false, showInPosition: nearestPoint.showInPosition, target: nearestPoint.target, position: pos, mode }; - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload)); + firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, payload); event.stopPropagation(); }; targetEl.on('mouseover', dispatchBehaviour) .on('mousemove', dispatchBehaviour) .on('mouseout', () => { - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, { + firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, { criteria: null - })); + }); }); }; diff --git a/packages/muze-firebolt/src/actions/physical/index.js b/packages/muze-firebolt/src/actions/physical/index.js index 524d66f3..cf2644f3 100644 --- a/packages/muze-firebolt/src/actions/physical/index.js +++ b/packages/muze-firebolt/src/actions/physical/index.js @@ -2,14 +2,14 @@ import drag from './drag'; import hover from './hover'; import { longtouch } from './longtouch'; import { touchdrag } from './touch-drag'; -import * as ACTIONNAMES from '../../enums/actions'; +import * as ACTION_NAMES from '../../enums/actions'; import click from './click'; export const physicalActions = { - [ACTIONNAMES.DRAG]: drag, - [ACTIONNAMES.HOVER]: hover, - [ACTIONNAMES.CLICK]: click, - [ACTIONNAMES.LONGTOUCH]: longtouch, - [ACTIONNAMES.TOUCHDRAG]: touchdrag + [ACTION_NAMES.DRAG]: drag, + [ACTION_NAMES.HOVER]: hover, + [ACTION_NAMES.CLICK]: click, + [ACTION_NAMES.LONGTOUCH]: longtouch, + [ACTION_NAMES.TOUCHDRAG]: touchdrag }; diff --git a/packages/muze-firebolt/src/actions/physical/longtouch.js b/packages/muze-firebolt/src/actions/physical/longtouch.js index 4141905e..b233d555 100644 --- a/packages/muze-firebolt/src/actions/physical/longtouch.js +++ b/packages/muze-firebolt/src/actions/physical/longtouch.js @@ -1,5 +1,6 @@ /* global setTimeout */ import { getEvent } from 'muze-utils'; +import * as ACTION_NAMES from '../../enums/actions'; import { generatePayloadFromEvent } from './helpers'; /** @@ -8,12 +9,12 @@ import { generatePayloadFromEvent } from './helpers'; * @param {SVGElement} targetEl Element on which the event listeners will be attached. * @param {Array} behaviours Array of behaviours */ -export const longtouch = firebolt => (targetEl, behaviours) => { +export const longtouch = firebolt => (targetEl) => { let event; let touchEnd; const dispatchBehaviour = function (args) { const payload = generatePayloadFromEvent(args, event, firebolt); - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload)); + firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, payload); event.stopPropagation(); }; @@ -26,9 +27,9 @@ export const longtouch = firebolt => (targetEl, behaviours) => { if (!touchEnd) { dispatchBehaviour(args); } else { - behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, { + firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, { criteria: null - })); + }); } }, 100); }).on('touchend', () => { diff --git a/packages/muze-firebolt/src/actions/physical/selection-box-drag.js b/packages/muze-firebolt/src/actions/physical/selection-box-drag.js index 66a0b7e4..d67e5331 100644 --- a/packages/muze-firebolt/src/actions/physical/selection-box-drag.js +++ b/packages/muze-firebolt/src/actions/physical/selection-box-drag.js @@ -4,13 +4,14 @@ import { } from 'muze-utils'; import getDragActionConfig from './helpers/drag-action-config'; +import { ACTIONS } from '../..'; -export const selectionBoxDrag = firebolt => (targetEl, behaviours) => { +export const selectionBoxDrag = firebolt => (targetEl) => { let subject; let drawingInf; const context = firebolt.context; const onDrag = (payload) => { - behaviours.forEach(action => firebolt.dispatchBehaviour(action, payload)); + firebolt.triggerPhysicalAction(ACTIONS.SELECTIONDRAG, payload); }; const d3Drag = getD3Drag(); @@ -30,7 +31,7 @@ export const selectionBoxDrag = firebolt => (targetEl, behaviours) => { const x2 = x + subject.width; if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) { - const payload = getDragActionConfig(context.getSourceInfo(), { + const payload = getDragActionConfig(firebolt, { startPos: { x, y @@ -39,7 +40,7 @@ export const selectionBoxDrag = firebolt => (targetEl, behaviours) => { x: x2, y: y2 } - }, context.data().getFieldsConfig()); + }); onDrag(payload); } }).on('end', () => { @@ -51,7 +52,7 @@ export const selectionBoxDrag = firebolt => (targetEl, behaviours) => { const x2 = x + subject.width; if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) { - const payload = getDragActionConfig(context.getSourceInfo(), { + const payload = getDragActionConfig(firebolt, { startPos: { x, y @@ -59,9 +60,8 @@ export const selectionBoxDrag = firebolt => (targetEl, behaviours) => { endPos: { x: x2, y: y2 - }, - snap: true - }, context.data().getFieldsConfig()); + } + }); payload.dragEnd = true; onDrag(payload); } diff --git a/packages/muze-firebolt/src/behaviour-effect-map.js b/packages/muze-firebolt/src/behaviour-effect-map.js index f5a3bc91..9fbaccf5 100644 --- a/packages/muze-firebolt/src/behaviour-effect-map.js +++ b/packages/muze-firebolt/src/behaviour-effect-map.js @@ -1,20 +1,34 @@ +import { intersect } from 'muze-utils'; import * as BEHAVIOURS from './enums/behaviours'; +import * as SIDE_EFFECTS from './enums/side-effects'; +import { unionSets } from './helper'; + +const nullDataTooltipMap = { + area: true, + arc: false, + line: true, + text: false, + point: false, + bar: false, + tick: false +}; + +const applySideEffectOnEmptyTarget = (sideEffect, { target }) => { + const layers = sideEffect.layers(); + const showTooltipOnEmptyTarget = layers.some((l) => { + const layerName = l.constructor.formalName(); + return nullDataTooltipMap[layerName]; + }); + return showTooltipOnEmptyTarget || target; +}; export const behaviourEffectMap = { [BEHAVIOURS.BRUSH]: ['selectionBox', { name: 'highlighter', options: { - strategy: 'fade' + strategy: 'fadeOnBrush' } }, 'brush-anchors'], - [`${BEHAVIOURS.BRUSH},${BEHAVIOURS.SELECT}`]: [{ - name: 'tooltip', - options: { - strategy: 'selectionSummary', - order: 0, - filter: context => context.config().mode === 'fragmented' - } - }], [BEHAVIOURS.HIGHLIGHT]: [{ name: 'highlighter', options: { @@ -23,14 +37,70 @@ export const behaviourEffectMap = { }, 'crossline', { name: 'tooltip', options: { - order: 9999 + setTransform: (selectionSet, payload, sideEffect) => { + if (sideEffect.firebolt._actions.behavioural.brush.active) { + return null; + } + if (applySideEffectOnEmptyTarget(sideEffect, payload)) { + return selectionSet; + } + return null; + } } - }, 'anchors'], + }, 'anchors', { + name: 'tooltip', + options: { + strategy: 'selectionSummary', + setTransform: (selectionSet, payload, sideEffect) => { + if (sideEffect.firebolt._actions.behavioural.brush.active === true || + !applySideEffectOnEmptyTarget(sideEffect, payload)) { + return null; + } + const selectEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.SELECT); + const brushEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.BRUSH); + if (selectEntrySet || brushEntrySet) { + const unionedSet = unionSets(sideEffect.firebolt, [BEHAVIOURS.SELECT, BEHAVIOURS.BRUSH]); + const { uids } = unionedSet.mergedEnter; + const { uids: highlightUids } = selectionSet.mergedEnter; + + if (intersect(uids, highlightUids, [id => id[0], id => id[0]]).length) { + return unionedSet; + } + } + + return null; + } + } + }, { + name: SIDE_EFFECTS.AXIS_LABEL_HIGHLIGHTER, + options: { + setTransform: (selectionSet, payload, sideEffect) => { + if (sideEffect.firebolt._actions.behavioural.brush.active) { + return null; + } + if (applySideEffectOnEmptyTarget(sideEffect, payload)) { + return selectionSet; + } + return null; + } + } + }], [BEHAVIOURS.FILTER]: ['filter'], [BEHAVIOURS.SELECT]: [{ name: 'highlighter', options: { strategy: 'focus' } - }, 'persistent-anchors'] + }, 'persistent-anchors', { + name: 'tooltip', + options: { + strategy: 'selectionSummary' + } + }], + pseudoSelect: [{ + name: 'highlighter', + options: { + strategy: 'pseudoFocus' + } + }] }; diff --git a/packages/muze-firebolt/src/enums/constants.js b/packages/muze-firebolt/src/enums/constants.js index ed6135ff..5b3e9f40 100644 --- a/packages/muze-firebolt/src/enums/constants.js +++ b/packages/muze-firebolt/src/enums/constants.js @@ -1,4 +1,5 @@ export const CLASSPREFIX = 'muze'; export const CONSOLIDATED = 'consolidated'; export const FRAGMENTED = 'fragmented'; - +export const NULL = 'null'; +export const UNDEFINED = 'undefined'; diff --git a/packages/muze-firebolt/src/enums/side-effects.js b/packages/muze-firebolt/src/enums/side-effects.js index db6c2698..71e58af5 100644 --- a/packages/muze-firebolt/src/enums/side-effects.js +++ b/packages/muze-firebolt/src/enums/side-effects.js @@ -5,6 +5,8 @@ const PERSISTENT_ANCHORS = 'persistent-anchors'; const FILTER = 'filter'; const HIGHLIGHTER = 'highlighter'; const CROSSLINE = 'crossline'; +const FRAGMENTED_TOOLTIP = 'fragmented-tooltip'; +const AXIS_LABEL_HIGHLIGHTER = 'axis-label-highlighter'; export { ANCHORS, @@ -13,5 +15,7 @@ export { FILTER, HIGHLIGHTER, CROSSLINE, - TOOLTIP + TOOLTIP, + FRAGMENTED_TOOLTIP, + AXIS_LABEL_HIGHLIGHTER }; diff --git a/packages/muze-firebolt/src/firebolt.js b/packages/muze-firebolt/src/firebolt.js index 1e091c5b..e6c69db2 100644 --- a/packages/muze-firebolt/src/firebolt.js +++ b/packages/muze-firebolt/src/firebolt.js @@ -2,7 +2,11 @@ import { mergeRecursive, hasTouch, selectElement, - isSimpleObject + isSimpleObject, + getDataModelFromRange, + ReservedFields, + FieldType, + defaultValue } from 'muze-utils'; import { ALL_ACTIONS } from './enums/actions'; import SelectionSet from './selection-set'; @@ -16,6 +20,55 @@ import { setSideEffectConfig } from './helper'; +const cloneObj = (behaviourEffectMap) => { + const keys = Object.keys(behaviourEffectMap); + + return keys.reduce((acc, key) => { + const value = behaviourEffectMap[key]; + const cloned = value.map((d) => { + let clonedVal = d; + if (isSimpleObject(d)) { + clonedVal = mergeRecursive({}, d); + } + return clonedVal; + }); + acc[key] = cloned; + return acc; + }, {}); +}; + +const getKeysFromCriteria = (criteria, firebolt) => { + if (criteria) { + const data = firebolt.data(); + const { dimensionsMap, dimensions: dimArr } = firebolt._metaData; + + let values = []; + if (isSimpleObject(criteria)) { + const dm = getDataModelFromRange(data, criteria); + const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), { + [ReservedFields.ROW_ID]: { + index: Object.keys(dm.getFieldsConfig()).length, + def: { + name: ReservedFields.ROW_ID, + type: FieldType.DIMENSION + } + } + }); + dm.getData({ withUid: true }).data.forEach((row) => { + const dimKey = `${dimArr.map(d => row[fieldsConfig[d].index])}`; + const measures = criteria[ReservedFields.MEASURE_NAMES] || dimensionsMap[dimKey] || [[]]; + measures.forEach((measureArr) => { + values.push(`${[dimKey, ...measureArr]}`); + }); + }); + } else { + values = criteria.slice(1, criteria.length).map(d => `${d}`); + } + return values; + } + return null; +}; + /** * This class is responsible for dispatching behavioural actions and side effects. It also keeps the information of * registered physical actions, behavioural actions and side effects. Also, it keeps the map of physical and behavioural @@ -33,6 +86,7 @@ export default class Firebolt { this._sideEffectDefinitions = {}; this._sideEffects = {}; this._propagationInf = {}; + this._sourceSelectionSet = {}; this._actions = { behavioural: {}, physical: {} @@ -40,17 +94,20 @@ export default class Firebolt { this._selectionSet = {}; this._volatileSelectionSet = {}; this._propagationFields = {}; - this._sourceSideEffects = {}; + this._sideEffectPolicies = {}; this._propagationBehaviourMap = {}; - this._sourceBehaviours = {}; + this._behaviourPolicies = {}; this._actionBehaviourMap = {}; this._config = {}; this._behaviourEffectMap = {}; this._entryExitSet = {}; this._actionHistory = {}; this._queuedSideEffects = {}; + this._handlers = {}; + this._payloadGenerators = {}; + this._payloads = {}; - this.mapSideEffects(behaviourEffectMap); + this.mapSideEffects(cloneObj(behaviourEffectMap)); this.registerBehaviouralActions(actions.behavioural); this.registerSideEffects(sideEffects); this.registerPhysicalBehaviouralMap(actions.physicalBehaviouralMap); @@ -79,6 +136,14 @@ export default class Firebolt { } else { effectNames = sideEffects; } + effectNames = effectNames.map((effect) => { + if (!isSimpleObject(effect)) { + return { + name: effect + }; + } + return effect; + }); !behaviourEffectMap[key] && (behaviourEffectMap[key] = []); this._behaviourEffectMap[key] = [...new Set(preventDefaultActions ? effectNames : [...behaviourEffectMap[key], ...effectNames])]; @@ -111,21 +176,24 @@ export default class Firebolt { const actionHistory = this._actionHistory; const queuedSideEffects = this._queuedSideEffects; sideEffects.forEach((sideEffect) => { - let options; - let name; const effects = sideEffect.effects; const behaviours = sideEffect.behaviours; - const combinedSet = unionSets(this, behaviours, selectionSet); + let combinedSet = this.mergeSelectionSets(behaviours); effects.forEach((effect) => { + let options = {}; + let name; if (typeof effect === 'object') { name = effect.name; - options = effect.options; + options = effect.options || {}; } else { name = effect; } - + const set = options.set; + if (set) { + combinedSet = this.mergeSelectionSets(set); + } const sideEffectInstance = sideEffectStore[name]; - if (sideEffectInstance.isEnabled()) { + if (sideEffectInstance && sideEffectInstance.isEnabled()) { if (!sideEffectInstance.constructor.mutates() && Object.values(actionHistory).some(d => d.isMutableAction)) { queuedSideEffects[`${name}-${behaviours.join()}`] = { @@ -144,11 +212,9 @@ export default class Firebolt { dispatchSideEffect (name, selectionSet, payload, options = {}) { const sideEffectStore = this.sideEffects(); const sideEffect = sideEffectStore[name]; - let disable = false; - if (options.filter && options.filter(sideEffect)) { - disable = true; - } - !disable && sideEffectStore[name].apply(selectionSet, payload, options); + const { setTransform } = options; + selectionSet = setTransform ? setTransform(selectionSet, payload, sideEffect) : selectionSet; + sideEffect.apply(selectionSet, payload, options); } registerPropagationBehaviourMap (map) { @@ -157,25 +223,27 @@ export default class Firebolt { } dispatchBehaviour (behaviour, payload, propagationInfo = {}) { + payload = this.sanitizePayload(payload); const propagate = propagationInfo.propagate !== undefined ? propagationInfo.propagate : true; const behaviouralActions = this._actions.behavioural; const action = behaviouralActions[behaviour]; const behaviourEffectMap = this._behaviourEffectMap; const sideEffects = getSideEffects(behaviour, behaviourEffectMap); this._propagationInf = propagationInfo; + this._payloads[behaviour] = payload; if (action) { - const selectionSet = action.dispatch(payload); - const propagationSelectionSet = this.getPropagationSelectionSet(selectionSet); - this._entryExitSet[behaviour] = propagationSelectionSet; - const shouldApplySideEffects = this.shouldApplySideEffects(propagate); + action.dispatch(payload); + this._entryExitSet[behaviour] = action.entryExitSet(); + const shouldApplySideEffects = this.shouldApplySideEffects(propagationInfo); if (propagate) { - this.propagate(behaviour, payload, selectionSet.find(d => d.sourceSelectionSet), sideEffects); + this.propagate(behaviour, payload, action.propagationIdentifiers(), { sideEffects }); } + if (shouldApplySideEffects) { const applicableSideEffects = this.getApplicableSideEffects(sideEffects, payload, propagationInfo); - this.applySideEffects(applicableSideEffects, propagationSelectionSet, payload); + this.applySideEffects(applicableSideEffects, this.getEntryExitSet(behaviour), payload); } } @@ -191,7 +259,7 @@ export default class Firebolt { } changeBehaviourStateOnPropagation (behaviour, value, key = 'default') { - const behaviourConditions = this._sourceBehaviours[behaviour] || (this._sourceBehaviours[behaviour] = {}); + const behaviourConditions = this._behaviourPolicies[behaviour] || (this._behaviourPolicies[behaviour] = {}); if (value instanceof Function) { behaviourConditions[key] = value; } else { @@ -201,7 +269,8 @@ export default class Firebolt { } changeSideEffectStateOnPropagation (sideEffect, value, key = 'default') { - const sideEffectConditions = this._sourceSideEffects[sideEffect] || (this._sourceSideEffects[sideEffect] = {}); + const sideEffectConditions = this._sideEffectPolicies[sideEffect] || + (this._sideEffectPolicies[sideEffect] = {}); if (value instanceof Function) { sideEffectConditions[key] = value; } else { @@ -210,12 +279,12 @@ export default class Firebolt { } removeSideEffectPolicy (sideEffect, key) { - delete this._sourceSideEffects[sideEffect][key]; + delete this._sideEffectPolicies[sideEffect][key]; return this; } removeBehaviourPolicy (behaviour, key) { - delete this._sourceBehaviours[behaviour][key]; + delete this._behaviourPolicies[behaviour][key]; return this; } @@ -264,9 +333,9 @@ export default class Firebolt { return sideEffects; } - attachPropagationListener (dataModel) { + attachPropagationListener (dataModel, handler = this.onDataModelPropagation()) { dataModel.unsubscribe('propagation'); - dataModel.on('propagation', this.onDataModelPropagation()); + dataModel.on('propagation', handler); return this; } @@ -293,6 +362,7 @@ export default class Firebolt { this._entryExitSet[key] = null; } } + this._volatileSelectionSet = volatileSelectionSet; this.selectionSet(selectionSet); return this; @@ -312,8 +382,12 @@ export default class Firebolt { return this; } - registerPhysicalActions (actions) { - const initedActions = initializePhysicalActions(this, actions); + target () { + return 'all'; + } + + registerPhysicalActions (actions, context = this) { + const initedActions = initializePhysicalActions(context, actions); Object.assign(this._actions.physical, initedActions); return this; } @@ -372,6 +446,7 @@ export default class Firebolt { target, mapObj.behaviours); } } + this.registerPhysicalActionHandlers(); return this; } @@ -413,18 +488,14 @@ export default class Firebolt { } getAddSetFromCriteria (criteria, propagationInf = {}) { - const context = this.context; - const filteredDataModel = propagationInf.data ? propagationInf.data : - context.getDataModelFromIdentifiers(criteria, 'all'); return { - model: filteredDataModel, - uids: criteria === null ? null : (propagationInf.data ? propagationInf.entryRowIds : - filteredDataModel[0].getUids()) + model: propagationInf.data ? propagationInf.data : null, + uids: criteria ? getKeysFromCriteria(criteria, this) : null }; } getSelectionSets (action) { - const sourceId = this.context.id(); + const sourceId = this.id(); const propagationInf = this._propagationInf || {}; const propagationSource = propagationInf.sourceId; let applicableSelectionSets = []; @@ -458,4 +529,72 @@ export default class Firebolt { getEntryExitSet (behaviour) { return this._entryExitSet[behaviour]; } + + mergeSelectionSets (behaviours) { + return unionSets(this, behaviours); + } + + data () { + return this.context.data(); + } + + triggerPhysicalAction (event, payload) { + const handlers = this._handlers[event] || []; + const genericHandlers = this._handlers['*']; + + const allHandlers = [...Object.values(handlers), ...Object.values(genericHandlers)]; + allHandlers.forEach((fn) => { + fn(event, payload); + }); + + return this; + } + + onPhysicalAction (event, fn, namespace) { + !this._handlers[event] && (this._handlers[event] = {}); + this._handlers[event][namespace] = fn; + + return this; + } + + registerPhysicalActionHandlers () { + this.onPhysicalAction('*', (event, payload) => { + const { behaviours } = this._actionBehaviourMap[event]; + behaviours.forEach(beh => this.dispatchBehaviour(beh, payload)); + }); + } + + id () { + return this.context.id(); + } + + getRangeFromIdentifiers (...params) { + return this.context.getRangeFromIdentifiers(...params); + } + + sanitizePayload (payload) { + return payload; + } + + payloadGenerators (...params) { + if (params.length) { + Object.assign(this._payloadGenerators, params[0]); + } + return this._payloadGenerators; + } + + getPayloadGeneratorFor (action) { + const defaultFn = this._payloadGenerators.__default; + const fn = this._payloadGenerators[action]; + + return defaultValue(fn, defaultFn); + } + + getPayload (action) { + return this._payloads[action]; + } + + actions () { + return this._actions; + } } diff --git a/packages/muze-firebolt/src/helper/index.js b/packages/muze-firebolt/src/helper/index.js index 8b5f11ee..bcdb0fda 100644 --- a/packages/muze-firebolt/src/helper/index.js +++ b/packages/muze-firebolt/src/helper/index.js @@ -1,13 +1,15 @@ -import { clone, retrieveNearestGroupByReducers } from 'muze-utils'; -import * as SELECTION from '../enums/selection'; +import { clone, unique, intersect } from 'muze-utils'; export const initializeSideEffects = (context, sideEffects) => { const sideEffectsMap = context._sideEffects; sideEffects = sideEffects instanceof Array ? sideEffects : Object.values(sideEffects); sideEffects.forEach((SideEffect) => { const formalName = SideEffect.formalName(); - const sideEffectInstance = sideEffectsMap[formalName]; - sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context); + const target = SideEffect.target(); + if (target === context.target() || target === 'all') { + const sideEffectInstance = sideEffectsMap[formalName]; + sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context); + } }); return sideEffectsMap; }; @@ -64,7 +66,7 @@ export const getSourceFields = (propagationInf, criteria = {}) => { const sourceIdentifiers = propagationInf.sourceIdentifiers; let sourceFields; if (sourceIdentifiers) { - sourceFields = sourceIdentifiers.getSchema().map(d => d.name); + sourceFields = sourceIdentifiers.fields.map(d => d.name); } else if (criteria instanceof Array) { sourceFields = criteria[0]; } else { @@ -73,43 +75,6 @@ export const getSourceFields = (propagationInf, criteria = {}) => { return sourceFields; }; -const conditionsMap = { - mergedEnter: [SELECTION.SELECTION_NEW_ENTRY, SELECTION.SELECTION_OLD_ENTRY], - mergedExit: [SELECTION.SELECTION_NEW_EXIT, SELECTION.SELECTION_OLD_EXIT], - complete: [] -}; - -export const getModelFromSet = (type, model, set) => { - const conditions = conditionsMap[type]; - if (model && conditions) { - return model.select((fields, i) => - (conditions.some(condition => set[i] === condition)), { - saveChild: false - }); - } - return null; -}; - -export const getSetInfo = (type, set, config) => { - let model = null; - const filteredDataModel = config.filteredDataModel; - const selectionSet = config.selectionSet; - if (!config.propagationData) { - if (selectionSet.resetted()) { - model = null; - } else if (type === 'mergedEnter') { - model = getModelFromSet(type, config.dataModel, config.selectionSet._set); - } - } else if (filteredDataModel) { - model = type === 'mergedEnter' ? filteredDataModel[0] : filteredDataModel[1]; - } - return { - uids: set, - length: set.length, - model - }; -}; - export const getSideEffects = (behaviour, behaviourEffectMap) => { const sideEffects = []; for (const key in behaviourEffectMap) { @@ -125,33 +90,78 @@ export const getSideEffects = (behaviour, behaviourEffectMap) => { return sideEffects; }; -export const unionSets = (context, behaviours) => { - let combinedSet = {}; +export const unionSets = (firebolt, behaviours) => { + let combinedSet = null; const models = { mergedEnter: null, mergedExit: null }; + const uidSet = { + mergedEnter: [], + mergedExit: [] + }; + behaviours.forEach((behaviour) => { - const entryExitSet = context._entryExitSet[behaviour]; + const entryExitSet = firebolt._entryExitSet[behaviour]; if (entryExitSet) { - combinedSet = Object.assign(combinedSet, clone(entryExitSet)); + combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet)); ['mergedEnter', 'mergedExit'].forEach((type) => { - const model = entryExitSet[type].model; + const { model, uids } = entryExitSet[type]; let existingModel = models[type]; - let aggFns = retrieveNearestGroupByReducers(model); + if (!existingModel) { existingModel = models[type] = model; + uidSet[type] = uids; } else if (`${model.getSchema().map(d => d.name).sort()}` === `${existingModel.getSchema().map(d => d.name).sort()}`) { - aggFns = Object.assign({}, retrieveNearestGroupByReducers(existingModel)); - existingModel = models[type] = model.union(existingModel); + uidSet[type] = unique([...uidSet[type], ...uids]); + models[type] = model.isEmpty() ? existingModel : existingModel.union(model); } else { existingModel = model; + uidSet[type] = uids; + } + combinedSet[type].uids = uidSet[type]; + combinedSet[type].model = models[type]; + }); + } + }); + + return combinedSet; +}; + +export const intersectSets = (firebolt, behaviours) => { + let combinedSet = null; + const models = { + mergedEnter: null, + mergedExit: null + }; + const uidSet = { + mergedEnter: [], + mergedExit: [] + }; + + behaviours.forEach((behaviour) => { + const entryExitSet = firebolt._entryExitSet[behaviour]; + if (entryExitSet) { + combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet)); + ['mergedEnter', 'mergedExit'].forEach((type) => { + const { model, uids } = entryExitSet[type]; + let existingModel = models[type]; + + if (!existingModel) { + existingModel = models[type] = model; + uidSet[type] = uids; + } else if (`${model.getSchema().map(d => d.name).sort()}` === + `${existingModel.getSchema().map(d => d.name).sort()}`) { + const commonSet = intersect(uidSet[type], uids, [id => id[0], id => id[0]]); + uidSet[type] = [...commonSet]; + models[type] = model.isEmpty() ? existingModel : existingModel.union(model); } - combinedSet[type].model = existingModel; - combinedSet[type].aggFns = aggFns; + combinedSet[type].uids = unique(uidSet[type]); + combinedSet[type].model = models[type]; }); } }); + return combinedSet; }; diff --git a/packages/muze-firebolt/src/index.js b/packages/muze-firebolt/src/index.js index 0eee2720..27594114 100644 --- a/packages/muze-firebolt/src/index.js +++ b/packages/muze-firebolt/src/index.js @@ -14,8 +14,11 @@ import GenericSideEffect from './side-effects/generic'; import * as sideEffects from './side-effects'; import SelectionSet from './selection-set'; import { behaviourEffectMap } from './behaviour-effect-map'; +import { registry } from './registry'; +import { initializePhysicalActions, getSideEffects } from './helper'; export { + initializePhysicalActions, behaviouralActions, VolatileBehaviour, GenericBehaviour, @@ -27,9 +30,11 @@ export { sideEffects, SelectionSet, behaviourEffectMap, + getSideEffects, SurrogateSideEffect, SpawnableSideEffect, GenericSideEffect, SELECTION, - SIDE_EFFECTS + SIDE_EFFECTS, + registry }; diff --git a/packages/muze-firebolt/src/registry.js b/packages/muze-firebolt/src/registry.js new file mode 100644 index 00000000..b228c20f --- /dev/null +++ b/packages/muze-firebolt/src/registry.js @@ -0,0 +1,21 @@ +import { componentRegistry } from 'muze-utils'; +import * as behaviours from './actions/behavioural'; +import { physicalActions } from './actions/physical'; +import * as sideEffects from './side-effects'; + +const convertToObj = (comps) => { + const obj = {}; + + for (const key in comps) { + const val = comps[key]; + + obj[val.formalName()] = val; + } + return obj; +}; + +export const registry = { + behaviours: componentRegistry(convertToObj(behaviours)), + physicalActions: componentRegistry(physicalActions), + sideEffects: componentRegistry(convertToObj(sideEffects)) +}; diff --git a/packages/muze-firebolt/src/selection-set/selection-set.js b/packages/muze-firebolt/src/selection-set/selection-set.js index accf5d9e..8601fbef 100644 --- a/packages/muze-firebolt/src/selection-set/selection-set.js +++ b/packages/muze-firebolt/src/selection-set/selection-set.js @@ -18,15 +18,28 @@ class SelectionSet { * * @param {Array.} completeSet Set of unique ids. */ - constructor (completeSet, _volatile) { - this.completeSet = completeSet; - this._set = completeSet.reduce((obj, key) => { - obj[key] = SELECTION_NULL; - return obj; - }, {}); + constructor ({ keys, fields }, _volatile) { + this.completeSet = keys; + this._set = {}; + this._uidMap = {}; + this._measureNames = {}; + this._dimVals = {}; + + for (const key in keys) { + this._set[key] = SELECTION_NULL; + this._uidMap[key] = keys[key].uid; + this._measureNames[key] = keys[key].measureNames; + this._dimVals[key] = keys[key].dims; + } + this._volatile = _volatile; - this._completeSetCount = completeSet.length; + this._completeSetCount = Object.keys(keys).length; this._lockedSelection = {}; + this._fieldIndices = fields.reduce((acc, v, i) => { + acc[v] = i; + return acc; + }, {}); + this._fields = fields; this._resetted = true; } @@ -44,7 +57,9 @@ class SelectionSet { const set = this._set; // from exitset to entryset ids.forEach((i) => { - set[i] = SELECTION_NEW_ENTRY; + if (i in set) { + set[i] = SELECTION_NEW_ENTRY; + } }); for (const key in set) { @@ -66,7 +81,9 @@ class SelectionSet { const set = this._set; // from exitset to entryset ids.forEach((i) => { - set[i] = SELECTION_OLD_ENTRY; + if (i in set) { + set[i] = SELECTION_OLD_ENTRY; + } }); return this; @@ -121,7 +138,7 @@ class SelectionSet { const set = this._set; ids.forEach((i) => { - set[i] = SELECTION_NEW_EXIT; + i in set && (set[i] = SELECTION_NEW_EXIT); }); for (const key in set) { @@ -133,30 +150,59 @@ class SelectionSet { return this; } - getSets () { + getSets (config = {}) { const set = this._set; + const uidMap = this._uidMap; const retObj = { entrySet: [[], []], exitSet: [[], []], + mergedEnter: [], + mergedExit: [], completeSet: [] }; + const measureNames = this._measureNames; + const dimVals = this._dimVals; + const { keepDims = false, dimensions = this._fields } = config; + const fieldIndices = this._fieldIndices; for (const key in set) { + let val; + const measureNamesArr = measureNames[key] || []; + let dims = dimVals[key]; + + if (keepDims) { + if (measureNamesArr.length) { + dims = dimensions.map(d => dims[fieldIndices[d]]); + val = dims.length ? [...dims, `${measureNamesArr}`] : [uidMap[key], `${measureNamesArr}`]; + } else { + val = dims.length ? [...dims] : [uidMap[key]]; + } + } else { + val = measureNamesArr.length ? [uidMap[key], measureNames[key], dims] : [uidMap[key]]; + } + if (set[key] > 0) { - set[key] === SELECTION_OLD_ENTRY && retObj.entrySet[0].push(key); - set[key] === SELECTION_NEW_ENTRY && retObj.entrySet[1].push(key); + [SELECTION_OLD_ENTRY, SELECTION_NEW_ENTRY].forEach((v, i) => { + if (set[key] === v) { + retObj.entrySet[i].push(val); + } + }); + if (set[key] === SELECTION_OLD_ENTRY || set[key] === SELECTION_NEW_ENTRY) { + retObj.mergedEnter.push(val); + } } else if (set[key] < 0) { - set[key] === SELECTION_OLD_EXIT && retObj.exitSet[0].push(key); - set[key] === SELECTION_NEW_EXIT && retObj.exitSet[1].push(key); + [SELECTION_OLD_EXIT, SELECTION_NEW_EXIT].forEach((v, i) => { + if (set[key] === v) { + retObj.exitSet[i].push(val); + } + }); + if (set[key] === SELECTION_OLD_EXIT || set[key] === SELECTION_NEW_EXIT) { + retObj.mergedExit.push(val); + } } - retObj.completeSet.push(key); + retObj.completeSet.push(val); } - ['entrySet', 'exitSet'].forEach((type) => { - retObj[type] = retObj[type].map(e => e.map(Number)); - }); - retObj.completeSet = retObj.completeSet.map(Number); - return retObj; } @@ -174,14 +220,11 @@ class SelectionSet { const set = this._set; if (ids) { ids.forEach((i) => { - set[i] = SELECTION_NULL; + i in set && (set[i] = SELECTION_NULL); }); } else { - const lockedSel = this._lockedSelection; for (const key in set) { - if (!(key in lockedSel)) { - set[key] = SELECTION_NULL; - } + set[key] = SELECTION_NULL; } } this._resetted = true; @@ -323,6 +366,40 @@ class SelectionSet { return this; } + + getMergedEntrySet (raw) { + const set = this._set; + const mergedEnter = []; + const uidMap = this._uidMap; + const measureNames = this._measureNames; + const dimVals = this._dimVals; + + for (const key in set) { + const val = raw ? [...dimVals[key], `${measureNames[key]}`] : + [uidMap[key], measureNames[key]]; + if (set[key] === SELECTION_NEW_ENTRY || set[key] === SELECTION_OLD_ENTRY) { + mergedEnter.push(val); + } + } + return mergedEnter; + } + + getMergedExitSet (raw) { + const set = this._set; + const mergedExit = []; + const uidMap = this._uidMap; + const measureNames = this._measureNames; + const dimVals = this._dimVals; + + for (const key in set) { + const val = raw ? [...dimVals[key], `${measureNames[key]}`] : + [uidMap[key], measureNames[key]]; + if (set[key] === SELECTION_NEW_EXIT || set[key] === SELECTION_OLD_EXIT) { + mergedExit.push(val); + } + } + return mergedExit; + } } export default SelectionSet; diff --git a/packages/muze-firebolt/src/side-effects/anchors/index.js b/packages/muze-firebolt/src/side-effects/anchors/index.js index 8cdd40c6..4c272b46 100644 --- a/packages/muze-firebolt/src/side-effects/anchors/index.js +++ b/packages/muze-firebolt/src/side-effects/anchors/index.js @@ -1,8 +1,7 @@ -import { DataModel, getObjProp } from 'muze-utils'; +import { DataModel, getObjProp, mergeRecursive, ReservedFields, dmMultipleSelection } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; import { ANCHORS } from '../../enums/side-effects'; import SpawnableSideEffect from '../spawnable'; - import './styles.scss'; const addLayer = (layerRegistry, context, sideEffect) => { @@ -19,20 +18,25 @@ const addLayer = (layerRegistry, context, sideEffect) => { const encoding = { x: getObjProp(depLayerEncoding, 'x', 'field'), y: getObjProp(depLayerEncoding, 'y', 'field'), - color: getObjProp(depLayerEncoding, 'color', 'field'), + color: { + field: getObjProp(depLayerEncoding, 'color', 'field'), + value: getObjProp(depLayerEncoding, 'color', 'value') + }, size: { field: getObjProp(depLayerEncoding, 'size', 'field'), - value: sideEffect.defaultSizeValue() + value: () => sideEffect.defaultSizeValue() } }; const commonName = sideEffect.constructor.formalName(); - const name = `${layerDef.def.name}-${commonName}`; + const layerOwner = layerDef.def.name; + const name = `${layerOwner}-${commonName}`; + const defaultClassName = `${sideEffect.constructor.defaultConfig().className}`; layers.push({ - name, + name: `${name}-upper`, mark: 'point', - groupId: commonName, - className: sideEffect.constructor.defaultConfig().className, + groupId: `${commonName}-upper`, + className: `${defaultClassName}-upper`, encoding, transform: { type: 'identity' @@ -45,6 +49,26 @@ const addLayer = (layerRegistry, context, sideEffect) => { interactive: false, owner: layerDef.def.name }); + + if (mark === 'area') { + layers.push({ + name: `${name}-lower`, + mark: 'point', + groupId: `${commonName}-lower`, + className: `${defaultClassName}-lower`, + encoding, + transform: { + type: 'identity' + }, + calculateDomain: false, + transition: sideEffect.getTransitionConfig(), + source: dm => dm.select(() => false, { + saveChild: false + }), + interactive: false, + owner: layerDef.def.name + }); + } } }); } @@ -92,23 +116,86 @@ export default class AnchorEffect extends SpawnableSideEffect { * @return { number } Default area value of anchor. */ defaultSizeValue () { - return 100; + return 70; + } + + // Default offset by which anchor size is changed + getAnchorSizeOnInteraction ({ dragEnd }) { + if (dragEnd) { + return 40; + } + return 0; } - apply (selectionSet) { + apply (selectionSet, payload) { const dataModel = selectionSet.mergedEnter.model; const formalName = this.constructor.formalName(); - const context = this.firebolt.context; - const layers = context.layers().filter(layer => layer.config().groupId === formalName); + const upperAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-upper`); + const lowerAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-lower`); + + const { target, action } = payload; + let targetObj = null; + if (target) { + targetObj = target[1].reduce((acc, v, i) => { + const field = target[0][i]; + if (field !== ReservedFields.MEASURE_NAMES) { + acc[field] = v; + } + return acc; + }, {}); + } + + [...upperAnchors, ...lowerAnchors].forEach((layer, index) => { + const layerConfig = layer.config(); + const linkedLayer = context.getLayerByName(layerConfig.owner); + const linkedLayerName = linkedLayer.constructor.formalName(); + const groupId = layerConfig.groupId; + const isUpperAnchor = groupId === `${formalName}-upper`; + let transformedData = []; + let schema = []; + + [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel, index); + + // Render both upper and lower anchors for area plot if hovered over an anchor + if (linkedLayerName === 'area' && target && action === 'highlight') { + const filterFn = dmMultipleSelection(target, dataModel); + const dmFromPayload = dataModel.select(filterFn, {}); + + if (!isUpperAnchor) { + [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dmFromPayload, index); + } + } - layers.forEach((layer) => { - const linkedLayer = context.getLayerByName(layer.config().owner); - const [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel); const transformedDataModel = new DataModel(transformedData, schema); + const anchorSizeConfig = { + encoding: { + size: { + value: () => this.defaultSizeValue() + this.getAnchorSizeOnInteraction(payload) + }, + 'stroke-width': { + value: this.getAnchorStroke(payload, targetObj) + } + } + }; + const newConfig = mergeRecursive(layerConfig, anchorSizeConfig); - layer.data(transformedDataModel); + layer + .data(transformedDataModel) + .config(newConfig); + + return this; }); - return this; + } + + getAnchorStroke (payload, targetObj) { + return (d) => { + const dataObj = d.data.dataObj; + const matchingData = targetObj ? Object.keys(targetObj).every((key) => { + const val = dataObj[key]; + return val === targetObj[key]; + }) : false; + return matchingData ? '1px' : '0px'; + }; } } diff --git a/packages/muze-firebolt/src/side-effects/anchors/styles.scss b/packages/muze-firebolt/src/side-effects/anchors/styles.scss index 7fe33c9e..f280d7df 100644 --- a/packages/muze-firebolt/src/side-effects/anchors/styles.scss +++ b/packages/muze-firebolt/src/side-effects/anchors/styles.scss @@ -2,4 +2,34 @@ .#{$prefix}anchors-group { pointer-events: none; -} \ No newline at end of file + .#{$prefix}layer-point { + fill-opacity: 1; + } +} + +.#{$prefix}persistent-anchors { + .#{$prefix}layer-point { + fill-opacity: 1; + } +} + +.#{$prefix}persistent-anchors-lower, +.#{$prefix}persistent-anchors-upper { + .#{$prefix}layer-point { + fill-opacity: 1; + } +} + +.#{$prefix}anchors-group-lower, +.#{$prefix}anchors-group-upper { + .#{$prefix}layer-point { + fill-opacity: 1; + } +} + +.#{$prefix}brush-anchors-lower, +.#{$prefix}brush-anchors-upper { + .#{$prefix}layer-point { + fill-opacity: 1; + } +} diff --git a/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/index.js b/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/index.js new file mode 100644 index 00000000..8c1510c4 --- /dev/null +++ b/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/index.js @@ -0,0 +1,29 @@ +import SurrogateSideEffect from '../surrogate'; +import { AXIS_LABEL_HIGHLIGHTER } from '../../enums/side-effects'; +import './styles.scss'; + +export default class AxisLabelHighLighter extends SurrogateSideEffect { + static formalName () { + return AXIS_LABEL_HIGHLIGHTER; + } + + static target () { + return 'visual-unit'; + } + + apply (selectionSet) { + const context = this.firebolt.context; + const dataModel = selectionSet && selectionSet.mergedEnter.model; + const selectedData = dataModel && dataModel.getData().data; + const selectedDataValues = selectedData && selectedData.length ? selectedData[0] : []; + const { x = [], y = [] } = context.axes(); + [...x, ...y].forEach((axis) => { + const fieldMeta = dataModel ? dataModel.getFieldsConfig()[axis.config().field] : undefined; + const selData = selectedDataValues[fieldMeta && fieldMeta.index !== undefined + ? fieldMeta.index : undefined]; + const { selectionSet: selectedElements, rejectionSet } = axis.getTicksBasedOnData(selData); + selectedElements && selectedElements.selectAll('text').classed('muze-axis-ticks-highlight', true); + rejectionSet.selectAll('text').classed('muze-axis-ticks-highlight', false); + }); + } +} diff --git a/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/styles.scss b/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/styles.scss new file mode 100644 index 00000000..5ecda558 --- /dev/null +++ b/packages/muze-firebolt/src/side-effects/axis-labels-highlighter/styles.scss @@ -0,0 +1,11 @@ +@import '../../prefix.scss'; + +.#{$prefix}axis-ticks-highlight { + font-weight: bold; + fill: #595959; +} + +.#{$prefix}axis-ticks-unhighlight { + font-weight: 400; + fill: #858585; +} diff --git a/packages/muze-firebolt/src/side-effects/brush-anchors.js b/packages/muze-firebolt/src/side-effects/brush-anchors.js index 54045a24..1190f515 100644 --- a/packages/muze-firebolt/src/side-effects/brush-anchors.js +++ b/packages/muze-firebolt/src/side-effects/brush-anchors.js @@ -18,4 +18,19 @@ export default class BrushAnchors extends AnchorEffect { disabled: true }; } + + setAnchorLayerStyle (layers) { + const anchorLayers = layers.filter(l => l.config().groupId === BRUSH_ANCHORS); + anchorLayers.forEach((anchor) => { + // Execute focusStroke interaction of anchor point layer + const ids = anchor.data().getUids(); + const layerName = this.constructor.formalName(); + const defaultInteractionLayerEncoding = anchor.config().encoding.interaction; + anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true }); + }); + } + + getAnchorStroke (payload) { + return payload.dragEnd ? '2px' : '1px'; + } } diff --git a/packages/muze-firebolt/src/side-effects/crossline/index.js b/packages/muze-firebolt/src/side-effects/crossline/index.js index bdcaeb2c..781e14a5 100644 --- a/packages/muze-firebolt/src/side-effects/crossline/index.js +++ b/packages/muze-firebolt/src/side-effects/crossline/index.js @@ -30,7 +30,9 @@ export default class Crossline extends SpawnableSideEffect { } = this.config(); const dataModel = selectionSet.mergedEnter.model; const drawingInf = this.drawingContext(); - if (payload.criteria && dataModel && dataModel.isEmpty()) { + const isEmptyDataModel = dataModel && dataModel.isEmpty(); + if (payload.criteria && isEmptyDataModel) { + this.hide(); return this; } if (payload.criteria === null || !dataModel) { @@ -62,21 +64,26 @@ export default class Crossline extends SpawnableSideEffect { const value = dataArr[0]; bandWidth = axis.getUnitWidth() || 0; px = axis.getScaleValue(value) + bandWidth / 2 + drawingInf.xOffset; - const layers = this.firebolt.context.layers(); - const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type])); - const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type])); - height = drawingInf.height; - width = drawingInf.width; - const startPx = px - plotWidth / 2 - pad / 2; - const endPx = px + plotWidth / 2 + pad / 2; - const dataPoint = {}; - if (type === 'y') { - dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`; - } else { - dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`; + + let layers = this.firebolt.context.layers(); + layers = layers.filter(layer => !!layer.config().crossline); + + if (layers.length) { + const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type])); + const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type])); + height = drawingInf.height; + width = drawingInf.width; + const startPx = px - plotWidth / 2 - pad / 2; + const endPx = px + plotWidth / 2 + pad / 2; + const dataPoint = {}; + if (type === 'y') { + dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`; + } else { + dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`; + } + dataPoint.className = plotWidth ? bandClass : lineClass; + !isNaN(px) && elemData.push(dataPoint); } - dataPoint.className = plotWidth ? bandClass : lineClass; - !isNaN(px) && elemData.push(dataPoint); } }); if (elemData.length) { @@ -93,4 +100,8 @@ export default class Crossline extends SpawnableSideEffect { const drawingInf = this.drawingContext(); selectElement(drawingInf.sideEffectGroup).selectAll(`.${className}`).remove(); } + + static target () { + return 'visual-unit'; + } } diff --git a/packages/muze-firebolt/src/side-effects/fragmented-tooltip/index.js b/packages/muze-firebolt/src/side-effects/fragmented-tooltip/index.js new file mode 100644 index 00000000..15e340b7 --- /dev/null +++ b/packages/muze-firebolt/src/side-effects/fragmented-tooltip/index.js @@ -0,0 +1,95 @@ +import { FieldType } from 'muze-utils'; +import { spaceOutBoxes } from '../helper'; +import { FRAGMENTED_TOOLTIP } from '../../enums/side-effects'; +import Tooltip from '../tooltip'; + +export default class FragmentedTooltip extends Tooltip { + static formalName () { + return FRAGMENTED_TOOLTIP; + } + + createTooltip (dataModel, props) { + let totalHeight = 0; + let totalWidth = 0; + const config = this.config(); + const { strategy } = props; + const context = this.firebolt.context; + const drawingInf = this.drawingContext(); + + const tooltips = this._tooltips; + const boundBox = { + width: drawingInf.width, + height: drawingInf.height + }; + const pad = config.padding; + const dataModels = []; + const sourceInf = context.getSourceInfo(); + const fields = sourceInf.fields; + const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false; + const showVertically = !!xFieldDim; + const boxes = []; + const uids = dataModel.getUids(); + + dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, { + saveChild: false + }))); + + const enter = {}; + for (let i = 0, len = dataModels.length; i < len; i++) { + const dm = dataModels[i]; + const dimensions = dm.getData().schema.filter(d => d.type === FieldType.DIMENSION).map(d => d.name); + const plotDim = context.getPlotPointsFromIdentifiers(dm.project(dimensions), { getBBox: true }); + + super.createTooltip(dm, props, plotDim, i); + const tooltipInst = this._tooltips[i]; + enter[i] = this._tooltips[i]; + + const position = tooltipInst._position; + const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect(); + + totalHeight += tooltipBoundBox.height + pad; + totalWidth += tooltipBoundBox.width + pad; + + if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) { + break; + } + + position && boxes.push({ + x: position.x, + y: position.y, + width: tooltipBoundBox.width, + height: tooltipBoundBox.height, + tooltip: tooltipInst + }); + } + + for (const key in tooltips) { + if (!enter[key]) { + const tooltip = tooltips[key]; + tooltip.content(strategy, null); + if (!tooltip.getContents().length) { + tooltip.remove(); + delete tooltips[key]; + } + } + } + + boxes.length && spaceOutBoxes(boxes, boundBox, showVertically); + boxes.forEach(box => box.tooltip.position(box.x, box.y, { + repositionArrow: true + })); + + return this; + } + + hide (options) { + const tooltips = this._tooltips; + for (const key in tooltips) { + if ({}.hasOwnProperty.call(tooltips, key)) { + const strategy = options.strategy || this._strategy; + tooltips[key].content(strategy, null); + tooltips[key].hide(); + } + } + } +} diff --git a/packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js b/packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js index 6fbb3d51..c578634a 100644 --- a/packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js +++ b/packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js @@ -22,6 +22,9 @@ export default class GenericSideEffect { this._strategies = {}; generateGetterSetters(this, PROPS); this.config(this.constructor.defaultConfig()); + this.sourceInfo(() => this.firebolt.context.getSourceInfo()); + this.layers(() => this.firebolt.context.layers()); + this.plotPointsFromIdentifiers((...args) => this.firebolt.context.getPlotPointsFromIdentifiers(...args)); } /** @@ -130,4 +133,28 @@ export default class GenericSideEffect { } return this; } + + sourceInfo (...sourceInfo) { + if (sourceInfo.length) { + this._sourceInfo = sourceInfo[0]; + return this; + } + return this._sourceInfo(); + } + + layers (...layers) { + if (layers.length) { + this._layers = layers[0]; + return this; + } + return this._layers(); + } + + plotPointsFromIdentifiers (...params) { + if (params.length && params[0] instanceof Function) { + this._plotPointsFromIdentifiers = params[0]; + return this; + } + return this._plotPointsFromIdentifiers(...params); + } } diff --git a/packages/muze-firebolt/src/side-effects/helper/index.js b/packages/muze-firebolt/src/side-effects/helper/index.js index 7cd32133..78453fed 100644 --- a/packages/muze-firebolt/src/side-effects/helper/index.js +++ b/packages/muze-firebolt/src/side-effects/helper/index.js @@ -44,5 +44,4 @@ export const spaceOutBoxes = (boxes, extent, showVertically) => { } } return boxes; -} -; +}; diff --git a/packages/muze-firebolt/src/side-effects/index.js b/packages/muze-firebolt/src/side-effects/index.js index 79513bb8..9aae5fda 100644 --- a/packages/muze-firebolt/src/side-effects/index.js +++ b/packages/muze-firebolt/src/side-effects/index.js @@ -1,8 +1,10 @@ export { default as SelectionBox } from './selection-box'; export { default as Tooltip } from './tooltip'; +export { default as FragmentedTooltip } from './fragmented-tooltip'; export { default as Crossline } from './crossline'; export { default as PlotHighlighter } from './plot-highlighter'; export { default as FilterEffect } from './filter'; export { default as PersistentAnchors } from './persistent-anchors'; export { default as BrushAnchors } from './brush-anchors'; export { default as AnchorEffect } from './anchors'; +export { default as AxisLabelHighLighter } from './axis-labels-highlighter'; diff --git a/packages/muze-firebolt/src/side-effects/persistent-anchors.js b/packages/muze-firebolt/src/side-effects/persistent-anchors.js index 35d06a2e..0d82c5f4 100644 --- a/packages/muze-firebolt/src/side-effects/persistent-anchors.js +++ b/packages/muze-firebolt/src/side-effects/persistent-anchors.js @@ -18,4 +18,25 @@ export default class PersistentAnchors extends AnchorEffect { disabled: true }; } + + setAnchorLayerStyle (layers) { + const anchorLayers = layers.filter(l => l.config().groupId === PERSISTENT_ANCHORS); + anchorLayers.forEach((anchor) => { + // Execute focusStroke interaction of anchor point layer + const ids = anchor.data().getUids(); + const layerName = this.constructor.formalName(); + const defaultInteractionLayerEncoding = anchor.config().encoding.interaction; + anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true }); + }); + } + + // offset value by which anchor size is changed + // Applied only on select interaction + getAnchorSizeonInteraction () { + return 50; + } + + getAnchorStroke () { + return '2px'; + } } diff --git a/packages/muze-firebolt/src/side-effects/plot-highlighter/helper.js b/packages/muze-firebolt/src/side-effects/plot-highlighter/helper.js new file mode 100644 index 00000000..21a2814d --- /dev/null +++ b/packages/muze-firebolt/src/side-effects/plot-highlighter/helper.js @@ -0,0 +1,33 @@ +import { difference, intersect } from 'muze-utils'; +import { intersectSets } from '../../helper'; + +/** + * @private + * @param {Object} set Points set + * @param {Array.} selectedPointsId array of id of selected points + * @return {Object} Returns the set with the selected points removed + */ +export const getFormattedSet = (set, selectedPointsId, intersection = false) => { + const fn = intersection ? intersect : difference; + const formattedSet = fn(set.uids, selectedPointsId, + [d => d[0], d => d[0]]); + return { + ...set, + ...{ + uids: formattedSet, + length: formattedSet.length + } + }; +}; + +export const highlightSelectIntersection = (firebolt) => { + const selectEntrySet = firebolt.getEntryExitSet('select'); + const highlightEntrySet = firebolt.getEntryExitSet('highlight'); + + if (selectEntrySet && highlightEntrySet) { + const intersectSet = intersectSets(firebolt, ['select', 'highlight']); + return intersectSet; + } + + return null; +}; diff --git a/packages/muze-firebolt/src/side-effects/plot-highlighter/index.js b/packages/muze-firebolt/src/side-effects/plot-highlighter/index.js index 350eed01..cbb06476 100644 --- a/packages/muze-firebolt/src/side-effects/plot-highlighter/index.js +++ b/packages/muze-firebolt/src/side-effects/plot-highlighter/index.js @@ -1,6 +1,7 @@ import SurrogateSideEffect from '../surrogate'; import { strategies } from './strategy'; import { HIGHLIGHTER } from '../../enums/side-effects'; +import { getFormattedSet } from './helper'; export default class PlotHighlighter extends SurrogateSideEffect { constructor (...params) { @@ -17,10 +18,37 @@ export default class PlotHighlighter extends SurrogateSideEffect { return 'visual-unit'; } + getExcludeSetIds (excludeSet = []) { + // Get excludeSetIds if excludeSet is a function + if (excludeSet instanceof Function) { + return excludeSet(this.firebolt.getEntryExitSet); + } + // Get excludeSetIds if excludeSet is not a function + return excludeSet.reduce((acc, behaviour) => { + const selectedPoints = this.firebolt.getEntryExitSet(behaviour) || {}; + const selectedPointsIds = (selectedPoints.mergedEnter || {}).uids; + if (selectedPointsIds) acc.push(...selectedPointsIds); + return acc; + }, []); + } + apply (selectionSet, payload, options = {}) { - const strategy = this._strategies[options.strategy || this._strategy]; + const currentStrategy = this._strategies[options.strategy || this._strategy]; + const excludeSetIds = this.getExcludeSetIds(options.excludeSet); + + // Get all sets except the excludeSet points + const formattedSet = { + ...selectionSet, + completeSet: getFormattedSet(selectionSet.completeSet, excludeSetIds), + entrySet: getFormattedSet(selectionSet.entrySet[1], excludeSetIds), + exitSet: getFormattedSet(selectionSet.exitSet[1], excludeSetIds), + mergedEnter: getFormattedSet(selectionSet.mergedEnter, excludeSetIds), + mergedExit: getFormattedSet(selectionSet.mergedExit, excludeSetIds) + }; + + const totalSet = { selectionSet, formattedSet }; - strategy(selectionSet, this, options.strategy || this._strategy); + currentStrategy(totalSet, this, payload, excludeSetIds); return this; } diff --git a/packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js b/packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js index 90cd1bfb..62de19f4 100644 --- a/packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js +++ b/packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js @@ -1,47 +1,202 @@ -const fadeFn = (set, context, strategy) => { +import { intersect, difference } from 'muze-utils'; +import { getFormattedSet } from './helper'; +import { BEHAVIOURS } from '../..'; + +const fadeFn = (set, context) => { + const { formattedSet } = set; const { mergedEnter, mergedExit, exitSet, completeSet - } = set; + } = formattedSet; if (!mergedEnter.length && !mergedExit.length) { - context.applyInteractionStyle(completeSet, {}, strategy, false); + context.applyInteractionStyle(completeSet, { interactionType: 'fade', apply: false }); } else { - context.applyInteractionStyle(exitSet[1], {}, strategy, true); - context.applyInteractionStyle(mergedEnter, {}, strategy, false); + const layers = context.firebolt.context.layers(); + + layers.forEach((layer) => { + const layerName = layer.constructor.formalName(); + + // Apply style only on the hovered layer + if (layerName === 'area') { + context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: true }, [layer]); + context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]); + } else { + context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: true }, [layer]); + context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: false }, [layer]); + } + }); + } +}; + +const fadeOnBrushFn = (set, context, payload) => { + const { formattedSet } = set; + const { + exitSet, + mergedEnter, + mergedExit, + completeSet + } = formattedSet; + + const { dragEnd } = payload; + let interactionType = 'brushStroke'; + + if (!mergedEnter.length && !mergedExit.length) { + context.applyInteractionStyle(completeSet, { interactionType, apply: false }); + context.applyInteractionStyle(completeSet, { interactionType: 'doubleStroke', apply: false }); + } else { + if (dragEnd) { + interactionType = 'doubleStroke'; + // onDrag style + context.applyInteractionStyle(completeSet, { interactionType: 'brushStroke', apply: false }); + } + const layers = context.firebolt.context.layers(); + + layers.forEach((layer) => { + const layerName = layer.constructor.formalName(); + + // Apply style only on the hovered layer + if (layerName === 'area') { + if (dragEnd) { + context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]); + mergedEnter.length && + context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]); + } + } else { + // dragEnd style + context.applyInteractionStyle(mergedExit, { interactionType, apply: false }, [layer]); + if (!payload.dragEnd) { + context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]); + } else { + context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]); + } + + interactionType !== 'doubleStroke' && + context.applyInteractionStyle(mergedExit, { interactionType: 'doubleStroke', apply: false }); + context.applyInteractionStyle(mergedEnter, { interactionType, apply: true }, [layer]); + } + }); } }; export const strategies = { fade: fadeFn, + fadeOnBrush: fadeOnBrushFn, focus: (set, context) => { + const { formattedSet } = set; const { + entrySet, mergedEnter, mergedExit, completeSet - } = set; + } = formattedSet; + const { firebolt } = context; + if (!mergedEnter.length && !mergedExit.length) { - context.applyInteractionStyle(completeSet, {}, 'focus', false); + context.applyInteractionStyle(completeSet, { interactionType: 'focus', apply: false }); + context.applyInteractionStyle(completeSet, { interactionType: 'focusStroke', apply: false }); + context.applyInteractionStyle(completeSet, { interactionType: 'commonDoubleStroke', apply: false }); } else { - context.applyInteractionStyle(mergedExit, {}, 'focus', true); - context.applyInteractionStyle(mergedEnter, {}, 'focus', false); + context.applyInteractionStyle(mergedExit, { interactionType: 'focusStroke', apply: false }); + context.applyInteractionStyle(entrySet, { interactionType: 'focusStroke', apply: true }); + + const payload = firebolt.getPayload(BEHAVIOURS.HIGHLIGHT); + const entryExitSet = firebolt.getEntryExitSet(BEHAVIOURS.HIGHLIGHT); + const layers = firebolt.context.layers(); + + if (payload.target && entryExitSet) { + layers.forEach((layer) => { + const layerName = layer.constructor.formalName(); + + if (layerName === 'area') { + context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]); + context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]); + } else { + context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]); + context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false }, [layer]); + } + + // get uids of only the currently highlighted point + const actualPoint = layer.getUidsFromPayload(entryExitSet.mergedEnter, payload.target); + + const commonSet = intersect(mergedEnter.uids, actualPoint.uids, + [v => v[0], v => v[0]]); + + if (commonSet.length) { + context.applyInteractionStyle({ uids: commonSet }, + { interactionType: 'commonDoubleStroke', apply: true }, + [layer] + ); + } else { + context.applyInteractionStyle({ uids: mergedExit.uids }, + { interactionType: 'commonDoubleStroke', apply: false }, + [layer] + ); + } + }); + } } }, - highlight: (set, context) => { - const { - mergedEnter, - mergedExit, - entrySet, - exitSet, - completeSet - } = set; - if (!mergedEnter.length && !mergedExit.length) { - context.applyInteractionStyle(completeSet, {}, 'highlight', false); + highlight: (set, context, payload, excludeSetIds) => { + const { selectionSet } = set; + + if (!selectionSet.mergedEnter.length && !selectionSet.mergedExit.length) { + // Remove focusStroke on selected but currently non-highlighted set + context.applyInteractionStyle(selectionSet.completeSet, { interactionType: 'highlight', apply: false }); + context.applyInteractionStyle(selectionSet.completeSet, + { interactionType: 'commonDoubleStroke', apply: false } + ); } else { - context.applyInteractionStyle(entrySet[1], {}, 'highlight', true); - context.applyInteractionStyle(exitSet[1], {}, 'highlight', false); + const layers = context.firebolt.context.layers(); + + layers.forEach((layer) => { + if (payload.target) { + // get uids of only the currently highlighted point + const actualPoint = layer.getUidsFromPayload(selectionSet.mergedEnter, payload.target); + // get uids of only the currently highlighted point excluding the excludeSet ids + const currentHighlightedSet = getFormattedSet(actualPoint, excludeSetIds); + + // Apply highlight on the currently hovered point + context.applyInteractionStyle(currentHighlightedSet, + { interactionType: 'highlight', apply: true }, + [layer] + ); + + context.applyInteractionStyle(selectionSet.mergedExit, + { interactionType: 'highlight', apply: false }, + [layer] + ); + + const selectEntrySet = context.firebolt.getEntryExitSet('select'); + if (selectEntrySet) { + const commonSet = intersect(selectEntrySet.mergedEnter.uids, actualPoint.uids, + [v => v[0], v => v[0]]); + const diffSet = difference(selectEntrySet.mergedEnter.uids, actualPoint.uids, + [v => v[0], v => v[0]]); + + if (commonSet.length) { + context.applyInteractionStyle({ uids: commonSet }, + { interactionType: 'commonDoubleStroke', apply: true }, + [layer] + ); + } + context.applyInteractionStyle({ uids: diffSet }, + { interactionType: 'commonDoubleStroke', apply: false }, + [layer] + ); + } + } + }); } + }, + pseudoFocus: (set, context) => { + const { formattedSet } = set; + const { + mergedEnter + } = formattedSet; + + context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false }); } }; diff --git a/packages/muze-firebolt/src/side-effects/selection-box/helper.js b/packages/muze-firebolt/src/side-effects/selection-box/helper.js index c5ca29f9..a7b95115 100644 --- a/packages/muze-firebolt/src/side-effects/selection-box/helper.js +++ b/packages/muze-firebolt/src/side-effects/selection-box/helper.js @@ -7,92 +7,75 @@ export const getBoxDimensionsFromPayload = (payload, axes, axisFields) => { let y2; let xRange; let yRange; - let direction; const criteria = payload.criteria; const dimensions = payload.dimensions || {}; - const xDim = dimensions.x; - const yDim = dimensions.y; + const { x: xDim, y: yDim } = dimensions; - if (criteria === null) { - return null; - } + if (!criteria) return null; - const xAxis = axes.x[0]; - const yAxis = axes.y[0]; - const xLinear = xAxis.constructor.type() === 'linear'; - const yLinear = yAxis.constructor.type() === 'linear'; - const xField = `${axisFields.x[0]}`; - const yField = `${axisFields.y[0]}`; - const xCriteria = criteria[xField]; - const yCriteria = criteria[yField]; + if (axes.x && axes.y) { + const xAxis = axes.x[0]; + const yAxis = axes.y[0]; + const xLinear = xAxis.constructor.type() === 'linear'; + const yLinear = yAxis.constructor.type() === 'linear'; + const xField = `${axisFields.x[0]}`; + const yField = `${axisFields.y[0]}`; + const xCriteria = criteria[xField]; + const yCriteria = criteria[yField]; - if (xCriteria && xCriteria[0] instanceof Array) { - xRange = xCriteria[0]; - yRange = xCriteria[1]; - } else { - xRange = xCriteria || []; - yRange = yCriteria || []; - } - direction = xCriteria && yCriteria ? 'both' : (xCriteria ? 'vertical' : 'horizontal'); - if (xRange && xRange.length) { - if ((yAxis.constructor.type() === 'band' && xLinear)) { - x1 = x2 = undefined; - direction = 'horizontal'; + if (xCriteria && xCriteria[0] instanceof Array) { + xRange = xCriteria[0]; + yRange = xCriteria[1]; } else { + xRange = xCriteria || []; + yRange = yCriteria || []; + } + + if (xRange && xRange.length) { const domain = xAxis.domain(); const bandScale = xAxis.constructor.type() === 'band'; - let x1Val; - let x2Val; + let x1Val = xRange[0]; + let x2Val = xRange[xRange.length - 1]; + if (bandScale) { let x1DomainIndex = domain.indexOf(xRange[0]); let x2DomainIndex = domain.indexOf(xRange[xRange.length - 1]); [x1DomainIndex, x2DomainIndex] = [x1DomainIndex, x2DomainIndex].sort((a, b) => a - b); x1Val = domain[x1DomainIndex]; x2Val = domain[x2DomainIndex]; - } else { - x1Val = xRange[0]; - x2Val = xRange[xRange.length - 1]; } + x1 = xAxis.getScaleValue(x1Val); x2 = xAxis.getScaleValue(x2Val); x2 += bandScale ? xAxis.getUnitWidth() : 0; } - } else { - x1 = x2 = undefined; - } - if (yRange && yRange.length) { - if ((xAxis.constructor.type() === 'band' && yLinear)) { - y1 = y2 = undefined; - direction = 'vertical'; - } else { + + if (yRange && yRange.length) { const domain = yAxis.domain(); const bandScale = yAxis.constructor.type() === 'band'; - let y1Val; - let y2Val; + let y1Val = yRange[0]; + let y2Val = yRange[yRange.length - 1]; + if (bandScale) { let y1DomainIndex = domain.indexOf(yRange[0]); let y2DomainIndex = domain.indexOf(yRange[yRange.length - 1]); [y1DomainIndex, y2DomainIndex] = [y1DomainIndex, y2DomainIndex].sort(((a, b) => b - a)); y1Val = domain[y1DomainIndex]; y2Val = domain[y2DomainIndex]; - } else { - y1Val = yRange[0]; - y2Val = yRange[yRange.length - 1]; } + y1 = yAxis.getScaleValue(y1Val); y2 = yAxis.getScaleValue(y2Val); y2 += yAxis.constructor.type() === 'band' ? yAxis.getUnitWidth() : 0; } - } else { - y1 = y2 = undefined; - } - if ((yLinear && xLinear) || !payload.dragEnd) { - if (xDim) { - [x1, x2] = xDim; - } - if (yDim) { - [y1, y2] = yDim; + if ((yLinear && xLinear) || !payload.dragEnd) { + if (xDim) { + [x1, x2] = xDim; + } + if (yDim) { + [y1, y2] = yDim; + } } } @@ -103,7 +86,7 @@ export const getBoxDimensionsFromPayload = (payload, axes, axisFields) => { y1, y2 }, - direction + direction: 'both' }; }; diff --git a/packages/muze-firebolt/src/side-effects/selection-box/index.js b/packages/muze-firebolt/src/side-effects/selection-box/index.js index 2685b0b2..1b59295a 100644 --- a/packages/muze-firebolt/src/side-effects/selection-box/index.js +++ b/packages/muze-firebolt/src/side-effects/selection-box/index.js @@ -9,6 +9,7 @@ import './styles.scss'; import SpawnableSideEffect from '../spawnable'; import { selectionBoxDrag } from '../../actions/physical/selection-box-drag'; import { getBoxDimensionsFromPayload, changeVisibility } from './helper'; +import { BEHAVIOURS } from '../..'; /** * This class is used to create a selection box which is used by visual unit for brushing and @@ -31,7 +32,8 @@ class SelectionBox extends SpawnableSideEffect { }, transition: { duration: 200 - } + }, + persistent: false }; } @@ -51,8 +53,8 @@ class SelectionBox extends SpawnableSideEffect { * @param {number} unitHeight Height of the visual unit. */ apply (selectionSet, payload) { - let x; - let y; + let x = 0; + let y = 0; let width; let height; const config = this._config; @@ -65,30 +67,27 @@ class SelectionBox extends SpawnableSideEffect { const classPrefix = config.classPrefix; const selectionGroupClassName = config.defClassName; - if (payload.criteria === null) { + width = unitWidth; + height = unitHeight; + + // Hide selection-box on dragEnd or when criteria is empty + if (!payload.criteria || (payload.dragEnd && !config.persistent)) { this.hide(drawingInf); return this; } - const sourceInf = firebolt.context.getSourceInfo(); - const { dimension, direction } = getBoxDimensionsFromPayload(payload, sourceInf.axes, - sourceInf.fields); + const sourceInf = this.sourceInfo(); + const { dimension, direction } = + getBoxDimensionsFromPayload(payload, sourceInf.axes, sourceInf.fields); const transition = payload.dragEnd && config.transition; - if (direction === 'both' || direction === 'vertical') { + if (direction === 'both') { x = Math.min(dimension.x1, dimension.x2); - width = Math.abs(dimension.x2 - dimension.x1); - } else { - x = 0; - width = unitWidth; - } - if (direction === 'both' || direction === 'horizontal') { y = Math.min(dimension.y1, dimension.y2); + width = Math.abs(dimension.x2 - dimension.x1); height = Math.abs(dimension.y2 - dimension.y1); - } else { - height = unitHeight; - y = 0; } + this.show(drawingInf); // Create the data array for drawing the rectangle const points = [ @@ -106,6 +105,11 @@ class SelectionBox extends SpawnableSideEffect { const selection = selectionGroup.selectAll('rect').data(points); const selectionBox = selection.enter().append('rect') .each(function () { + firebolt.registerPhysicalBehaviouralMap({ + selectiondrag: { + behaviours: [BEHAVIOURS.BRUSH] + } + }); selectionBoxDrag(firebolt)(selectElement(this), ['brush'], sideEffect); }) .merge(selection) @@ -136,4 +140,3 @@ class SelectionBox extends SpawnableSideEffect { } export default SelectionBox; - diff --git a/packages/muze-firebolt/src/side-effects/surrogate.js b/packages/muze-firebolt/src/side-effects/surrogate.js index 043a9879..dac321cf 100644 --- a/packages/muze-firebolt/src/side-effects/surrogate.js +++ b/packages/muze-firebolt/src/side-effects/surrogate.js @@ -51,10 +51,19 @@ export default class SurrogateSideEffect extends GenericSideEffect { * * @return {SurrogateSideEffect} Instance of surrogate side effect. */ - applyInteractionStyle (set, config = {}, interactionType, apply) { - const layers = this.firebolt.context.layers(); - layers.forEach(layer => layer.config().interactive !== false && - layer.applyInteractionStyle(interactionType, set.uids, apply)); + applyInteractionStyle (set, config = {}, layers) { + const { interactionType, apply, reset = false } = config; + const allLayers = layers || this.firebolt.context.layers(); + allLayers.forEach((layer) => { + const { interactive } = layer.config(); + if (interactive !== false) { + const layerFields = layer.data().getFieldsConfig(); + const filteredUids = set.uids.filter(([, measures = []]) => measures.every(m => m in layerFields)) + .map(d => d[0]); + const options = { apply, reset, styles: null }; + layer.applyInteractionStyle(interactionType, filteredUids, options); + } + }); return this; } } diff --git a/packages/muze-firebolt/src/side-effects/tooltip/index.js b/packages/muze-firebolt/src/side-effects/tooltip/index.js index 31279851..5b6e43bd 100644 --- a/packages/muze-firebolt/src/side-effects/tooltip/index.js +++ b/packages/muze-firebolt/src/side-effects/tooltip/index.js @@ -1,8 +1,6 @@ import { Tooltip as TooltipRenderer } from '@chartshq/muze-tooltip'; -import { FieldType, mergeRecursive, defaultValue } from 'muze-utils'; -import { spaceOutBoxes } from '../helper'; +import { mergeRecursive, defaultValue } from 'muze-utils'; import { strategies } from './strategies'; -import { FRAGMENTED } from '../../enums/constants'; import { TOOLTIP } from '../../enums/side-effects'; import SpawnableSideEffect from '../spawnable'; @@ -39,19 +37,12 @@ export default class Tooltip extends SpawnableSideEffect { y: 0 }, highlightSummary: { - dataTransform: (dt, fields) => (fields ? dt.project(fields, { saveChild: false }) : dt - ) + order: 1, + dataTransform: (dm, fields) => (fields ? dm.project(fields, { saveChild: false }) : dm) }, selectionSummary: { - dataTransform: (dt, fields) => { - const fieldspace = dt.getFieldspace(); - const dimensions = Object.keys(fieldspace.getDimension()); - const measures = Object.keys(fieldspace.getMeasure()); - const projectedFields = defaultValue(fields, measures.length ? [measures[0]] : []); - return dt.project([...dimensions, ...projectedFields], { - saveChild: false - }); - } + order: 0, + dataTransform: dm => dm } }; } @@ -74,44 +65,53 @@ export default class Tooltip extends SpawnableSideEffect { } apply (selectionSet, payload, options = {}) { - let totalHeight = 0; - let totalWidth = 0; - const dataModel = selectionSet.mergedEnter.model; - const context = this.firebolt.context; - const drawingInf = this.drawingContext(); - if ((dataModel.isEmpty() || payload.criteria === null)) { + const dataModel = selectionSet && selectionSet.mergedEnter.model; + + if ((payload.criteria === null || (dataModel && dataModel.isEmpty())) || selectionSet === null) { this.hide(options, null); return this; } + const strategy = defaultValue(options.strategy, this._strategy); + + this.createTooltip(dataModel, Object.assign({}, { + payload, + selectionSet, + strategy, + options + }), null, 0); + + return this; + } + + static target () { + return 'all'; + } + + hide (options) { const tooltips = this._tooltips; - const config = this.config(); - const boundBox = { - width: drawingInf.width, - height: drawingInf.height - }; - const showInPosition = payload.showInPosition; - const pad = config.padding; - const dataModels = []; - const fragmented = config.mode === FRAGMENTED; - const sourceInf = context.getSourceInfo(); - const fields = sourceInf.fields; - const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false; - const showVertically = !!xFieldDim; - const tooltipPos = payload.position; - const boxes = []; - const enter = {}; - const uids = dataModel.getData().uids; - if (fragmented) { - dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, { - saveChild: false - }))); - } else { - dataModels.push(dataModel); + const { orientation } = this.config(); + + for (const key in tooltips) { + if ({}.hasOwnProperty.call(tooltips, key)) { + const tooltip = tooltips[key]; + const strategy = options.strategy || this._strategy; + tooltip.content(strategy, null); + if (!Object.keys(tooltip._contents).length) { + tooltip.hide(); + } else { + tooltip.positionRelativeTo(tooltip._target, { + orientation + }); + } + } } + } + getPlotPointsFromIdentifiers (payload) { let target = payload.target; let targetFields = []; + if (target) { targetFields = target[0] || []; const sourceFields = payload.sourceFields; @@ -124,123 +124,79 @@ export default class Tooltip extends SpawnableSideEffect { target = target.map(d => d.filter((v, i) => indices.indexOf(i) !== -1)); } - const plotDimensions = context.getPlotPointsFromIdentifiers(target || payload.criteria, { + return super.plotPointsFromIdentifiers(target || payload.criteria, { getBBox: true }); - - const strategy = defaultValue(options.strategy, this._strategy); - const strategyConf = config[strategy]; - const { dataTransform, fields: projectFields } = strategyConf; - const strategyObj = this._strategies; - // Show tooltip for each datamodel - for (let i = 0; i < dataModels.length; i++) { - let plotDim = plotDimensions[i]; - if (fragmented) { - const dimensions = dataModels[i].getData().schema.filter(d => d.type === FieldType.DIMENSION) - .map(d => d.name); - plotDim = context.getPlotPointsFromIdentifiers(dataModels[i].project(dimensions), { getBBox: true }); - plotDim = plotDim && plotDim[0]; - } - - const dt = dataTransform(dataModels[i], projectFields, this); - - enter[i] = true; - const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf; - const layoutBoundBox = layoutContainer.getBoundingClientRect(); - const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect(); - - const offsetLeft = unitBoundBox.left - layoutBoundBox.left; - const offsetTop = unitBoundBox.top - layoutBoundBox.top; - const tooltipInst = tooltips[i] = tooltips[i] || new TooltipRenderer(layoutContainer, - drawingInf.svgContainer); - - sourceInf.payload = payload; - sourceInf.firebolt = this.firebolt; - sourceInf.detailFields = context.detailFields(); - sourceInf.timeDiffs = context.timeDiffsByField(); - sourceInf.valueParser = context.valueParser(); - sourceInf.selectionSet = selectionSet; - tooltipInst.context(sourceInf); - const strategyFn = strategyObj[strategy]; - tooltipInst.content(strategy, dt, { - formatter: strategyFn, - order: options.order - }) - .config(this.config()) - .extent({ - x: 0, - y: 0, - width: parentContainerDimensions.width, - height: parentContainerDimensions.height - }) - .offset({ - x: offsetLeft + (config.offset.x || 0), - y: offsetTop + (config.offset.y || 0) - }); - - if (showInPosition) { - tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad); - } else if (plotDim) { - tooltipInst.positionRelativeTo({ - x: plotDim.x, - y: plotDim.y, - width: plotDim.width || 0, - height: plotDim.height || 0 - }, { - orientation: fragmented ? - (showVertically ? 'horizontal' : 'vertical') : undefined - }); - } else { - tooltipInst.hide(); - break; - } - - if (fragmented) { - const position = tooltipInst._position; - const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect(); - - totalHeight += tooltipBoundBox.height + pad; - totalWidth += tooltipBoundBox.width + pad; - if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) { - break; - } - boxes.push({ - x: position.x, - y: position.y, - width: tooltipBoundBox.width, - height: tooltipBoundBox.height, - tooltip: tooltipInst - }); - } - } - - for (const key in tooltips) { - if (!enter[key]) { - const tooltip = tooltips[key]; - tooltip.content(payload.action, null); - if (!tooltip.getContents().length) { - tooltip.remove(); - delete tooltips[key]; - } - } - } - if (fragmented) { - spaceOutBoxes(boxes, boundBox, showVertically); - boxes.forEach(box => box.tooltip.position(box.x, box.y, { - repositionArrow: true - })); - } - return this; } - hide (options) { - const tooltips = this._tooltips; - for (const key in tooltips) { - if ({}.hasOwnProperty.call(tooltips, key)) { - const strategy = options.strategy || this._strategy; - tooltips[key].content(strategy, null); - tooltips[key].hide(); + createTooltip (dataModel, props = {}, plotDim, key) { + const drawingInf = this.drawingContext(); + const sourceInf = this.sourceInfo(); + const config = this.config(); + const { + strategy, + payload, + selectionSet + } = props; + plotDim = defaultValue(plotDim, this.getPlotPointsFromIdentifiers(payload)); + plotDim = plotDim && plotDim[0]; + const pad = config.padding; + const { showInPosition, position: tooltipPos } = payload; + const { fields: projectFields, dataTransform } = config[strategy]; + + const strategyFn = this._strategies[strategy]; + const dt = dataTransform(dataModel, projectFields, this); + const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf; + const layoutBoundBox = layoutContainer.getBoundingClientRect(); + const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect(); + + const offsetLeft = unitBoundBox.left - layoutBoundBox.left; + const offsetTop = unitBoundBox.top - layoutBoundBox.top; + const tooltipInst = this._tooltips[key] = this._tooltips[key] || new TooltipRenderer(layoutContainer, + drawingInf.svgContainer); + + Object.assign(sourceInf, { + payload, + firebolt: this.firebolt, + detailFields: [], + timeDiffs: sourceInf.timeDiffs, + valueParser: this.valueParser(), + selectionSet, + config: config[strategy] + }); + + tooltipInst.context(sourceInf); + tooltipInst.content(strategy, dt, { + formatter: strategyFn, + order: config[strategy].order, + className: config[strategy].className + }) + .config(this.config()) + .extent({ + x: 0, + y: 0, + width: parentContainerDimensions.width, + height: parentContainerDimensions.height + }) + .offset({ + x: offsetLeft + (config.offset.x || 0), + y: offsetTop + (config.offset.y || 0) + }); + + if (showInPosition) { + tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad); + } else if (plotDim) { + tooltipInst.positionRelativeTo({ + x: plotDim.x, + y: plotDim.y, + width: plotDim.width || 0, + height: plotDim.height || 0 + }, { + orientation: config.orientation } + ); + } else { + tooltipInst.hide(); } } } diff --git a/packages/muze-firebolt/src/side-effects/tooltip/strategies.js b/packages/muze-firebolt/src/side-effects/tooltip/strategies.js index 463ee433..d3ae2116 100644 --- a/packages/muze-firebolt/src/side-effects/tooltip/strategies.js +++ b/packages/muze-firebolt/src/side-effects/tooltip/strategies.js @@ -9,21 +9,26 @@ import { retrieveFieldDisplayName, nestCollection, getObjProp, - intersect + intersect, + ReservedFields } from 'muze-utils'; import { TABLE_FORMAT } from '@chartshq/muze-tooltip'; import { SELECTION_SUMMARY, HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies'; +import { BAR } from '../../../../visual-group/src/enums/constants'; +import { NULL, UNDEFINED } from '../../enums/constants'; const { SUM, COUNT } = GROUP_BY_FUNCTIONS; const { InvalidAwareTypes } = DataModel; const FIRST_VALUE_MARGIN = '10px'; +const STACK = 'stack'; const SINGLE_DATA_MARGIN = 10; +const defNumberFormat = value => `${value % value.toFixed(0) === 0 ? value : value.toFixed(2)}`; const formatters = (formatter, interval, valueParser) => ({ [DimensionSubtype.TEMPORAL]: value => (value instanceof InvalidAwareTypes ? valueParser(value) : formatTemporal(Number(value), interval)), [MeasureSubtype.CONTINUOUS]: value => (value instanceof InvalidAwareTypes ? valueParser(value) : - formatter(value.toFixed(2))), + formatter(defNumberFormat(value))), [DimensionSubtype.CATEGORICAL]: value => valueParser(value) }); @@ -43,8 +48,25 @@ const getTabularData = (dataObj, fieldInf) => { return rows; }; +const isSingleValue = (dataLen, stackedSum) => dataLen === 1 && !stackedSum; + +const getStackedKeyValue = (params) => { + const { field, value, classPrefix } = params; + return ({ + className: `${classPrefix}-tooltip-stacked-row`, + data: [{ + value: field, + className: `${classPrefix}-tooltip-stacked-row-key` + }, { + value: `${value}`, + className: `${classPrefix}-tooltip-stacked-row-value` + }] + }); +}; + const getKeyValue = (params) => { - const { field, value, classPrefix, margin, isSelected, removeKey } = params; + const { field, value, classPrefix, margin, isSelected, removeKey, stackedSum, isStackedBar } = params; + let { stackedValue } = params; if (!removeKey) { const keyObj = { @@ -55,6 +77,16 @@ const getKeyValue = (params) => { value, className: `${classPrefix}-tooltip-value` }; + + if (stackedValue === NULL || stackedValue === UNDEFINED) { + stackedValue = 0; + } + + const stackedValueObj = { + value: stackedSum ? `(${(stackedValue * 100 / stackedSum).toFixed(2)} %)` : undefined, + className: `${classPrefix}-tooltip-stacked-percentage` + }; + if (margin !== undefined) { keyObj.style = { 'margin-left': `${margin}px` @@ -62,14 +94,16 @@ const getKeyValue = (params) => { valueObj.style = { 'margin-left': `${margin}px` }; + stackedValueObj.style = { + 'margin-left': `${margin}px` + }; } return ({ className: isSelected ? `${classPrefix}-tooltip-row ${classPrefix}-tooltip-selected-row` : `${classPrefix}-tooltip-row`, - data: [keyObj, valueObj] - } - ); + data: stackedSum && isStackedBar ? [keyObj, stackedValueObj, valueObj] : [keyObj, valueObj] + }); } return ({ data: [{ @@ -83,8 +117,28 @@ const getKeyValue = (params) => { }); }; +export const getStackedSum = (values, index) => values.reduce((a, b) => { + if (b[index] instanceof InvalidAwareTypes) { + return a + 0; + } + return a + b[index]; +}, 0); + +export const isStackedChart = layers => layers.some(d => d.transformType() === STACK); +export const isStackedBarChart = layers => layers.some(d => d.transformType() === STACK && d.config().mark === BAR); + const generateRetinalFieldsValues = (valueArr, retinalFields, content, context) => { - const { fieldsConfig, dimensionMeasureMap, axes, config, fieldInf, dataLen, target } = context; + const { + fieldsConfig, + dimensionMeasureMap, + axes, + config, + fieldInf, + dataLen, + target, + stackedSum, + isStackedBar + } = context; const { classPrefix, margin, separator } = config; const colorAxis = axes.color[0]; const shapeAxis = axes.shape[0]; @@ -99,13 +153,13 @@ const generateRetinalFieldsValues = (valueArr, retinalFields, content, context) const icon = { type: 'icon', color: colorAxis.getColor(retinalFieldValue), - shape: shapeAxis.getShape(retinalFieldValue), - size: sizeAxis.getSize(retinalFieldValue) * config.iconScale + size: sizeAxis.config().value, + shape: shapeAxis.getShape(retinalFieldValue) }; const { displayName, fn } = fieldInf[retField]; const formattedRetinalValue = fn(retinalFieldValue); - if (dataLen === 1) { + if (isSingleValue(dataLen, stackedSum)) { content.push(getKeyValue({ field: displayName, value: formattedRetinalValue, @@ -115,19 +169,27 @@ const generateRetinalFieldsValues = (valueArr, retinalFields, content, context) } else { const hasMultipleMeasures = measuresArr.length > 1; hasMultipleMeasures && (content.push({ data: [icon, formattedRetinalValue] })); - const selectedContext = target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)]; + const selectedContext = target && target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)]; const isSelected = selectedContext === retinalFieldValue; + measuresArr.forEach((measure) => { const measureIndex = fieldsConfig[measure].index; const { displayName: dName, fn: formatterFn } = fieldInf[measure]; - const value = formatterFn(valueArr[measureIndex]); + const currentMeasureValue = valueArr[measureIndex]; + const value = formatterFn(currentMeasureValue); const keyValue = getKeyValue({ field: hasMultipleMeasures ? `${dName}${separator}` : formattedRetinalValue, value, classPrefix, margin: hasMultipleMeasures ? margin : undefined, - isSelected + isSelected, + stackedSum, + stackedValue: currentMeasureValue instanceof InvalidAwareTypes + ? currentMeasureValue.value() + : currentMeasureValue.toFixed(2), + isStackedBar }); + if (!hasMultipleMeasures) { keyValue.data = [icon, ...keyValue.data]; } @@ -160,8 +222,10 @@ export const buildTooltipData = (dataModel, config = {}, context) => { const { data, schema } = dataModel.getData(); const fieldspace = dataModel.getFieldspace(); const fieldsConfig = dataModel.getFieldsConfig(); - const { color, shape, size } = context.firebolt.context.retinalFields(); + const { color, shape, size } = context.retinalFields; const detailFields = context.detailFields || []; + const { showStackSum = true } = context.config || {}; + const { selectedMeasures = [] } = context.payload; const dimensions = schema.filter(d => d.type === FieldType.DIMENSION); const measures = schema.filter(d => d.type === FieldType.MEASURE); const containsDetailField = !!intersect(schema, detailFields).length; @@ -188,7 +252,11 @@ export const buildTooltipData = (dataModel, config = {}, context) => { const filteredDimensions = dimensions.filter(field => !retinalFields[field.name]); const indices = filteredDimensions.map(dim => fieldsConfig[dim.name].index); const allMeasures = [...new Set(...Object.values(dimensionMeasureMap))]; - const filteredMeasures = dataLen > 1 ? measures.filter(d => allMeasures.indexOf(d.name) === -1) : measures; + const isStacked = isStackedChart(context.layers); + const isStackedBar = isStackedBarChart(context.layers); + const filteredMeasures = !isSingleValue(dataLen, isStacked) + ? measures.filter(d => allMeasures.indexOf(d.name) === -1) + : measures; nestedDataObj = nestCollection({ data, @@ -209,7 +277,7 @@ export const buildTooltipData = (dataModel, config = {}, context) => { if (field) { const { displayName, fn } = fieldInf[field]; const formattedValue = fn(key); - const removeKey = values.length > 1; + const removeKey = !isSingleValue(dataLen, isStacked); content.push(getKeyValue({ field: `${displayName}${separator}`, value: formattedValue, @@ -223,6 +291,19 @@ export const buildTooltipData = (dataModel, config = {}, context) => { if (values[0] && values[0].key) { generateTooltipContent(values, index + 1, content); } else { + let stackedSum = 0; + if (isStacked && showStackSum) { + stackedSum = getStackedSum( + values, + fieldsConfig[measures[0].name].index + ); + const nf = measures[0].numberFormat; + content.push(getStackedKeyValue({ + field: `${'Total'}${separator}`, + value: nf ? nf(stackedSum.toFixed(2)) : stackedSum.toFixed(2), + classPrefix + })); + } for (let j = 0, len2 = values.length; j < len2; j++) { const valueArr = values[j]; generateRetinalFieldsValues(valueArr, retinalFields, content, { @@ -232,14 +313,16 @@ export const buildTooltipData = (dataModel, config = {}, context) => { fieldsConfig, dimensionMeasureMap, dataLen, - target: context.payload.target + target: context.payload.target, + stackedSum, + isStackedBar }); - filteredMeasures.forEach((measure) => { const { name } = measure; const { displayName, fn } = fieldInf[name]; content.push(getKeyValue({ field: `${displayName}${separator}`, + isSelected: selectedMeasures.indexOf(name) !== -1, value: fn(valueArr[fieldsConfig[name].index]), classPrefix, margin: SINGLE_DATA_MARGIN @@ -258,44 +341,97 @@ export const buildTooltipData = (dataModel, config = {}, context) => { }; }; +/** + * Calculate aggregated values of measures from entry set and datamodel. + * + * @param {DataModel} dm DataModel instance + * @param {EntrySet} entrySet Entry set + */ +const getAggregatedValues = (dm, entrySet) => { + const fields = entrySet.fields; + const aggFns = entrySet.aggFns; + // Create a map of all the dimensions and the measures + const dimsMap = entrySet.uids.reduce((acc, v) => { + const dims = v[2]; + + !acc[dims] && (acc[dims] = []); + acc[dims].push(v[1]); + return acc; + }, {}); + const aggMeasures = Object.keys(dm.getFieldspace().getMeasure()); + const aggregatedValues = {}; + aggMeasures.forEach((measure) => { + // Filter all the rows which has this measure and dimensions and apply aggregation. + const groupedDm = dm.select((dmFields, id) => { + const row = `${fields.map(field => (field === ReservedFields.ROW_ID ? id : + dmFields[field].internalValue))}`; + const measures = dimsMap[row]; + if (measures) { + return measures.find(arr => arr.indexOf(measure) !== -1); + } + return false; + }, { + saveChild: false + }).groupBy([''], { + [measure]: aggFns[measure] === COUNT ? SUM : aggFns[measure] + }, { + saveChild: false + }); + const fieldsConfig = groupedDm.getFieldsConfig(); + if (!groupedDm.isEmpty()) { + aggregatedValues[measure] = groupedDm.getData().data[0][fieldsConfig[measure].index]; + } + }); + return aggregatedValues; +}; + export const strategies = { [SELECTION_SUMMARY]: (dm, config, context) => { const { selectionSet } = context; + const { classPrefix } = config; + const tooltipConf = context.config; + const { showMultipleMeasures } = tooltipConf; const aggFns = selectionSet.mergedEnter.aggFns; - const dataObj = dm.getData(); - const measures = dataObj.schema.filter(d => d.type === FieldType.MEASURE); - const aggregatedModel = dm.groupBy([''], measures.reduce((acc, v) => { - acc[v.name] = aggFns[v.name] === COUNT ? SUM : aggFns[v.name]; - return acc; - }, { - saveChild: false - })); - const fieldsConf = aggregatedModel.getFieldsConfig(); - let values = [[{ - value: `${dataObj.data.length}`, - style: { - 'font-weight': 'bold' - } - }, 'Items Selected']]; - const measureNames = measures.map(d => d.name); - const data = aggregatedModel.getData().data; - measureNames.forEach((measure) => { - const value = data[0][fieldsConf[measure].index]; - value instanceof InvalidAwareTypes ? values.push([]) : values.push([`(${aggFns[measure].toUpperCase()})`, - `${retrieveFieldDisplayName(dm, measure)}`, + const entryUids = selectionSet.mergedEnter.uids; + const fieldsConf = dm.getFieldsConfig(); + const aggregatedValues = getAggregatedValues(dm, selectionSet.mergedEnter); + const values = [{ + className: `${classPrefix}-tooltip-row`, + data: [{ + value: `${entryUids.length}`, + style: { + 'font-weight': 'bold' + } + }, 'Items Selected'] + }]; + let measures = Object.keys(aggregatedValues); + if (!showMultipleMeasures) { + measures = measures.slice(0, 1); + } + // Prepare the tooltip content + measures.forEach((measure) => { + const { numberFormat = defNumberFormat } = fieldsConf[measure].def; + const value = aggregatedValues[measure]; + const rowValues = value instanceof InvalidAwareTypes ? [] : [`(${aggFns[measure].toUpperCase()})`, + `${retrieveFieldDisplayName(dm, measure)}:`, { - value: `${value.toFixed(2)}`, + value: numberFormat(value), style: { 'font-weight': 'bold' - } - }]); + }, + className: `${classPrefix}-tooltip-value` + }]; + if (showMultipleMeasures) { + values.push({ + className: `${classPrefix}-tooltip-row`, + data: rowValues + }); + } else { + values[0].data.push(...rowValues); + } }); - if (measureNames.length === 1) { - values = [[...values[0], ...values[1]]]; - } - return ([{ - data: values[0] - }]); + + return values; }, [HIGHLIGHT_SUMMARY]: (data, config, context) => buildTooltipData(data, config, context) }; diff --git a/packages/muze-firebolt/src/side-effects/tooltip/strategy.spec.js b/packages/muze-firebolt/src/side-effects/tooltip/strategy.spec.js index 12ca2898..ceba33cf 100644 --- a/packages/muze-firebolt/src/side-effects/tooltip/strategy.spec.js +++ b/packages/muze-firebolt/src/side-effects/tooltip/strategy.spec.js @@ -1,33 +1,65 @@ /* global describe, it */ import { expect } from 'chai'; -import { DataModel } from 'muze-utils'; -import { strategies } from './strategies'; +import { + getStackedSum, + isStackedBar +} from './strategies'; describe('#tooltipstrategy', () => { - it('Should not throw error when sub type is incorrect', () => { - const dm = new DataModel([{ - dim: 'A', - measure: 200 - }, { - dim: 'B', - measure: 400 - }], [{ - name: 'dim', - type: 'dimension', - subtype: 'datetime' - }, { - name: 'measure', - type: 'measure' - }]); - const strategy = strategies.highlightSummary; - expect(() => strategy.keyValue(dm, {}, { - dimensionMeasureMap: {}, - axes: { - color: [], - shape: [], - size: [] - } - })).to.not.throw(); + // FAULTY TESTCASE + // it('Should not throw error when sub type is incorrect', () => { + // const dm = new DataModel([{ + // dim: 'A', + // measure: 200 + // }, { + // dim: 'B', + // measure: 400 + // }], [{ + // name: 'dim', + // type: 'dimension', + // subtype: 'datetime' + // }, { + // name: 'measure', + // type: 'measure' + // }]); + // const strategy = strategies.highlightSummary; + // expect(() => strategy.keyValue(dm, {}, { + // dimensionMeasureMap: {}, + // axes: { + // color: [], + // shape: [], + // size: [] + // } + // })).to.not.throw(); + // }); + it('# getStackedSum', () => { + const array = [ + [ + 315.5, + '1970-01-01', + 'USA' + ], + [ + 100, + '1970-01-01', + 'European Union' + ], + [ + 29.5, + '1970-01-01', + 'Japan' + ] + ]; + let sum = 0; + array.map((a) => { + sum += a[0]; + return a; + }); + expect(getStackedSum(array, 0)).to.equals(sum); + }); + it('#isStackedBar', () => { + const transformType = () => 'stack'; + expect(isStackedBar([{ transformType }])).to.equals(true); }); }); diff --git a/packages/muze-firebolt/src/side-effects/tooltip/styles.scss b/packages/muze-firebolt/src/side-effects/tooltip/styles.scss index 4f7a70bc..9702d8ac 100644 --- a/packages/muze-firebolt/src/side-effects/tooltip/styles.scss +++ b/packages/muze-firebolt/src/side-effects/tooltip/styles.scss @@ -1,8 +1,33 @@ @import '../../prefix.scss'; -.#{$prefix}tooltip-content-container { - border-bottom: 1px solid #E9E9E9;; -} .#{$prefix}tooltip-content-parent-container :last-child { border-bottom: none; } + +.#{$prefix}tooltip-content-parent-container { + display: inline-block; +} + +.#{$prefix}tooltip-content-container-highlightSummary { + border-right: 1px solid #E9E9E9; +} + +.#{$prefix}tooltip-content-container-selectionSummary-crosstab { + // border-bottom: 1px solid #E9E9E9; + display: inline-block; +} + +.#{$prefix}tooltip-content-container-selectionSummary-default { + border-bottom: 1px solid #E9E9E9; +} + +.#{$prefix}tooltip-content-container-highlightSummary-crosstab { + float: left; +} + +.#{$prefix}tooltip-content-container-selectionSummary { + .#{$prefix}tooltip-content { + margin-left: 3px; + margin-right: 3px; + } +} \ No newline at end of file diff --git a/packages/muze-legend/src/enums/constants.js b/packages/muze-legend/src/enums/constants.js index 131b56a0..3dbf3eb8 100644 --- a/packages/muze-legend/src/enums/constants.js +++ b/packages/muze-legend/src/enums/constants.js @@ -14,6 +14,13 @@ export const CONSOLIDATED = 'consolidated'; export const FRAGMENTED = 'fragmented'; export const DEFAULTCOLOR = '#F44336'; export const DEFAULTSIZE = 50; +export const VERTICAL_BUFFER = 10; +export const HORIZONTAL_BUFFER = 2; +export const DEFAULTICONSIZE = { // approximately the (size needed) * Math.PI value + circle: 64, + square: 45.8, + default: 42.8 +}; export const DEFAULTSHAPE = 'circle'; export const STEP = 'step'; export const GRADIENT = 'gradient'; @@ -42,4 +49,17 @@ export const END = 'end'; export const SIZE = 'size'; export const DISCRETE = 'discrete'; export const MEASURE = 'measure'; +export const DEFAULT = 'default'; + +export const POSITION_ALIGNMENT_MAP = { + [LEFT]: VERTICAL, + [RIGHT]: VERTICAL, + [TOP]: HORIZONTAL, + [BOTTOM]: HORIZONTAL +}; + +export const OPPOSITE_POSITION = { + [LEFT]: RIGHT, + [RIGHT]: LEFT +}; diff --git a/packages/muze-legend/src/enums/side-effects.js b/packages/muze-legend/src/enums/side-effects.js index f08a552e..612163f1 100644 --- a/packages/muze-legend/src/enums/side-effects.js +++ b/packages/muze-legend/src/enums/side-effects.js @@ -1,3 +1,4 @@ export const SELECTIONBOX = 'selectionBox'; export const Highlighter = 'highlighter'; +export const Marker = 'marker'; diff --git a/packages/muze-legend/src/firebolt/behaviour-effect-map.js b/packages/muze-legend/src/firebolt/behaviour-effect-map.js index d06bb8ab..6db61089 100644 --- a/packages/muze-legend/src/firebolt/behaviour-effect-map.js +++ b/packages/muze-legend/src/firebolt/behaviour-effect-map.js @@ -8,8 +8,7 @@ export const behaviourEffectMap = { strategy: 'fade' } }], - [BEHAVIOURS.HIGHLIGHT]: [sideEffects.Highlighter], - select: [{ + [BEHAVIOURS.SELECT]: [{ name: sideEffects.Highlighter, options: { strategy: 'fade' diff --git a/packages/muze-legend/src/firebolt/behavioural/select.js b/packages/muze-legend/src/firebolt/behavioural/select.js index f05b7731..d71870d7 100644 --- a/packages/muze-legend/src/firebolt/behavioural/select.js +++ b/packages/muze-legend/src/firebolt/behavioural/select.js @@ -9,22 +9,29 @@ export default class SelectBehaviour extends PersistentBehaviour { if (addSet === null) { selectionSet.reset(); } else if (addSet.length) { + const propagationInf = this.firebolt._propagationInf; // new add set const existingRemoveSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_OLD_EXIT || selectionSet._set[d] === SELECTION.SELECTION_NEW_EXIT); - // existing add set - if (existingRemoveSet.length) { - selectionSet.updateEntry(); - selectionSet.add(existingRemoveSet); - } else { - selectionSet.updateExit(); - selectionSet.remove(addSet); - } - const { exitSet } = selectionSet.getSets(); - const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])]; - const completeSetCount = selectionSet.getCompleteSet().length; - if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) { + + if (propagationInf.sourceId) { selectionSet.reset(); + selectionSet.add(addSet); + } else { + // existing add set + if (existingRemoveSet.length) { + selectionSet.updateEntry(); + selectionSet.add(existingRemoveSet); + } else { + selectionSet.updateExit(); + selectionSet.remove(addSet); + } + const { exitSet } = selectionSet.getSets(true); + const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])]; + const completeSetCount = selectionSet.getCompleteSet().length; + if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) { + selectionSet.reset(); + } } } else { selectionSet.remove(selectionSet.getCompleteSet()); diff --git a/packages/muze-legend/src/firebolt/helper.js b/packages/muze-legend/src/firebolt/helper.js index f54c56e8..afdc8521 100644 --- a/packages/muze-legend/src/firebolt/helper.js +++ b/packages/muze-legend/src/firebolt/helper.js @@ -1,70 +1,48 @@ -import { assembleModelFromIdentifiers, getDataModelFromRange } from 'muze-utils'; import { propagationBehaviourMap } from './action-behaviour-map'; import { propagationSideEffects } from './behaviour-effect-map'; -import { STEP, GRADIENT, DISCRETE, MEASURE } from '../enums/constants'; -export const propagate = (firebolt, action, selectionSet, config = {}) => { - let propagationData; +export const propagate = (firebolt, action, identifiers) => { const context = firebolt.context; - const type = context.constructor.type(); - const payload = config.payload; - const data = context.data(); - const metaData = context.metaData(); - const fieldType = metaData.getData().schema[0].type; + const data = context.metaData(); const propPayload = {}; - const sourceId = context._id; propPayload.action = propagationBehaviourMap[action] || action; + // @TODO: Change fade propagationSideEffect for area layer propPayload.sideEffects = propagationSideEffects[action]; propPayload.sourceCanvas = context.canvasAlias(); const isMutableAction = firebolt._actions.behavioural[propPayload.action].constructor.mutates(); - if (payload.criteria === null) { - propagationData = null; - } else { - const entrySet = selectionSet.mergedEnter; - let values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.rawVal); - if (type === STEP || (type === DISCRETE && fieldType === MEASURE)) { - const field = Object.keys(payload.criteria || {})[0]; - values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.range); - propagationData = values.length ? metaData.select((fields) => { - let check = false; - for (let i = 0; i < values.length; i++) { - check = fields[field].internalValue >= values[i][0] && fields[field].internalValue <= values[i][1]; - if (check === true) { - break; - } - } - return check; - }, { - saveChild: false - }) : null; - } else if (type === GRADIENT) { - propagationData = getDataModelFromRange(metaData, payload.criteria); - } else if (values.length) { - propagationData = assembleModelFromIdentifiers(metaData, [payload.criteria[0], ...values.map(d => [d])]); - } else { - propPayload.criteria = null; - propagationData = metaData.select(() => true, { - saveChild: false - }); - } - } - - let propagateInterpolatedValues = false; - - if (propagationData) { - const schema = propagationData.getSchema(); - propagateInterpolatedValues = schema.every(d => d.type === MEASURE); - } const propConfig = { - sourceId: `legend-${sourceId}`, + sourceId: firebolt.id(), payload: propPayload, - criteria: propPayload.criteria === null ? null : propagationData, + criteria: propPayload.criteria === null ? null : identifiers, isMutableAction, - propagateInterpolatedValues, action: propPayload.action }; - metaData.propagate(propagationData, propConfig, true); + data.propagate(identifiers, propConfig, true); }; + +export const payloadGenerator = { + __default: (selectionDataModel, propConfig) => { + const propPayload = propConfig.payload; + const sourceIdentifiers = propConfig.sourceIdentifiers; + const dataObj = selectionDataModel.getData(); + let schema = dataObj.schema; + const payload = Object.assign({}, propPayload); + schema = dataObj.schema; + const data = dataObj.data; + const sourceFields = schema.map(d => d.name); + payload.criteria = !sourceIdentifiers && selectionDataModel.isEmpty() ? null : + [sourceFields, ...data]; + payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : []; + return payload; + }, + brush: (dm, propConfig) => { + const { criteria } = propConfig; + return { + criteria: criteria ? criteria.range : criteria + }; + } +}; + diff --git a/packages/muze-legend/src/firebolt/legend-firebolt.js b/packages/muze-legend/src/firebolt/legend-firebolt.js index 1c94ee6e..72568eeb 100644 --- a/packages/muze-legend/src/firebolt/legend-firebolt.js +++ b/packages/muze-legend/src/firebolt/legend-firebolt.js @@ -1,7 +1,7 @@ import { Firebolt } from '@chartshq/muze-firebolt'; -import { propagate } from './helper'; +import { propagate, payloadGenerator } from './helper'; import { STEP, GRADIENT } from '../enums/constants'; - +import { HIGHLIGHT } from '../enums/behaviours'; /** * This class manages the interactions of legend. * @export @@ -37,9 +37,10 @@ export class LegendFireBolt extends Firebolt { } else if (type === GRADIENT) { uniqueIds = []; } else { - values = criteria[1]; - if (values) { - uniqueIds = this.context.data().filter(d => values.indexOf(d.rawVal) !== -1).map(d => d.id); + values = criteria; + if (values instanceof Array) { + values = values.slice(1, criteria.length); + uniqueIds = [...new Set([].concat(...values))]; } else { values = Object.values(criteria); uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id); @@ -54,4 +55,42 @@ export class LegendFireBolt extends Firebolt { getFullData () { return null; } + + onDataModelPropagation () { + return (data, config) => { + const context = this.context; + if (!context.mount()) { + return; + } + const payloadFn = payloadGenerator[config.action] || payloadGenerator.__default; + const payload = payloadFn(data, config); + const { propagationSourceId } = config; + const propagationInf = { + propagate: false, + data, + sourceId: propagationSourceId + }; + const isActionSourceSame = config.sourceId === this.id(); + if (!isActionSourceSame && config.action === HIGHLIGHT) { + // @todo make it configurable + this.dispatchBehaviour(HIGHLIGHT, payload, propagationInf); + } + }; + } + + data () { + return this.context.metaData(); + } + + id () { + return `legend-${this.context._id}`; + } + + sourceCanvas () { + return this.context.canvasAlias(); + } + + shouldApplySideEffects () { + return true; + } } diff --git a/packages/muze-legend/src/firebolt/physical/drag.js b/packages/muze-legend/src/firebolt/physical/drag.js index 5af81158..f213a479 100644 --- a/packages/muze-legend/src/firebolt/physical/drag.js +++ b/packages/muze-legend/src/firebolt/physical/drag.js @@ -54,7 +54,7 @@ import { endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height)); if (startPos[axisType] === endPos[axisType]) { payload = { - criteria: {} + criteria: null }; } else { payload = { diff --git a/packages/muze-legend/src/firebolt/physical/hover.js b/packages/muze-legend/src/firebolt/physical/hover.js index 09e0876d..e50b15a6 100644 --- a/packages/muze-legend/src/firebolt/physical/hover.js +++ b/packages/muze-legend/src/firebolt/physical/hover.js @@ -6,13 +6,13 @@ import { getEvent } from 'muze-utils'; * @param {SVGElement} targetEl Element on which the event listeners will be attached. * @param {Array} behaviours Array of behaviours */ -/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => { +/* istanbul ignore next */ const hover = firebolt => (targetEl) => { const dispatchBehaviour = function (args) { const event = getEvent(); const payload = { criteria: firebolt.context.getCriteriaFromData(args) }; - behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload)); + firebolt.triggerPhysicalAction('hover', payload); event.stopPropagation(); }; @@ -20,9 +20,9 @@ import { getEvent } from 'muze-utils'; .on('mousemove', dispatchBehaviour) .on('mouseout', () => { const event = getEvent(); - behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, { + firebolt.triggerPhysicalAction('hover', { criteria: null - })); + }); event.stopPropagation(); }); }; diff --git a/packages/muze-legend/src/firebolt/side-effects/index.js b/packages/muze-legend/src/firebolt/side-effects/index.js index 2111bd57..bb13e1e9 100644 --- a/packages/muze-legend/src/firebolt/side-effects/index.js +++ b/packages/muze-legend/src/firebolt/side-effects/index.js @@ -1,8 +1,10 @@ import SelectionBox from './selection-box'; import LegendHighlighter from './legend-highlighter'; +import LegendMarker from './legend-marker'; export { SelectionBox, - LegendHighlighter + LegendHighlighter, + LegendMarker }; diff --git a/packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js b/packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js index 4ec7991d..cdc7fff1 100644 --- a/packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js +++ b/packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js @@ -4,9 +4,10 @@ export const strategies = (firebolt) => { const context = firebolt.context; const classed = (set, className, change) => { const classPrefix = context.config().classPrefix; + const uids = set.uids.map(d => d[0]); selectElement(context.mount()) .selectAll(`.${classPrefix}-legend-columns`) - .filter(d => set.uids.indexOf(d.id) !== -1) + .filter(d => uids.indexOf(d.id) !== -1) .selectAll('div') .classed(className, change); }; diff --git a/packages/muze-legend/src/firebolt/side-effects/legend-marker/index.js b/packages/muze-legend/src/firebolt/side-effects/legend-marker/index.js new file mode 100644 index 00000000..b6a2effb --- /dev/null +++ b/packages/muze-legend/src/firebolt/side-effects/legend-marker/index.js @@ -0,0 +1,148 @@ +import { GenericSideEffect } from '@chartshq/muze-firebolt'; +import { makeElement, getSymbol } from 'muze-utils'; +import { Marker } from '../../../enums/side-effects'; +import { CLASSPREFIX, HORIZONTAL } from '../../../enums/constants'; +import { LEGEND_MARKER_PROPS } from '../../../legend/defaults'; +import './styles.scss'; + +const SYMBOL_PADDING = (Math.sqrt(3) * 3); +const AXIS_STROKE = 1; +const MARKER_BUFFER = 10; + +const createTextCell = (className, labelManagerRef, cells) => { + const { TextCell } = cells; + const cell = new TextCell( + { + type: 'text', + className: `${className}-text` + }, { + labelManager: labelManagerRef() + }).config({ maxLines: 1 }); + cell._minTickDiff = { height: 0, width: 0 }; + + return cell; +}; + +const getRelativePosition = (canvas, legendContainer) => ({ + top: legendContainer.getBoundingClientRect().top - canvas.getBoundingClientRect().top, + left: legendContainer.getBoundingClientRect().left - canvas.getBoundingClientRect().left +}); +export default class LegendMarker extends GenericSideEffect { + constructor (...params) { + super(...params); + this._graphicElements = { + markerElement: null, + legendmarkerTextContainer: null, + legendmarkerText: null + }; + } + + static formalName () { + return Marker; + } + + /** + * It returns the default configuration needed by legend-marker. + * @return {Object} Default configuration of the legend-marker. + */ + static defaultConfig () { + return { + className: 'legend-marker', + classPrefix: CLASSPREFIX, + size: LEGEND_MARKER_PROPS.size, + shape: LEGEND_MARKER_PROPS.shape + }; + } + + apply (selectionSet, payload) { + const className = `${this.config().classPrefix}-${this.config().className}`; + if (payload.criteria && payload.criteria.length === 2) { + const physicalAction = function () { + // Register physical action on marker gere + }; + const firebolt = this.firebolt; + const labelManager = firebolt.context.labelManager; + const context = firebolt.context; + const config = this.config(); + const axis = context.axis().source(); + + const range = payload.criteria[0] ? axis.getScaleValue(payload.criteria[1]) : 0; + + const legendGradContainer = context.getDrawingContext().svgContainer; + + const isFractional = payload.criteria[1][0] % 1 !== 0; + + const lableConfig = { + top: 0, + left: 0, + labelText: isFractional ? payload.criteria[1][0].toFixed(2) : payload.criteria[1][0] + }; + + const { top, left } = getRelativePosition(context._canvasMount, legendGradContainer.node()); + const { oriTextHeight, oriTextWidth } = labelManager().getSmartText(lableConfig.labelText); + let x; + let y; + let rotateAngle; + + const { size, shape } = config; + if (context.config().align === HORIZONTAL) { + x = range - (Math.sqrt(size / SYMBOL_PADDING)) + AXIS_STROKE; + y = 5; + rotateAngle = LEGEND_MARKER_PROPS.ROTATE_HORIZONTAL; + lableConfig.top = top + y - 3 * MARKER_BUFFER; + lableConfig.left = x + left - (oriTextWidth / 2) - (MARKER_BUFFER / 2); + } else { + y = range + Math.sqrt(size / (2 * SYMBOL_PADDING)) - AXIS_STROKE; + x = 5; + rotateAngle = LEGEND_MARKER_PROPS.ROTATE_VERTICAL; + lableConfig.top = top + y - (3 * MARKER_BUFFER - 2) + (oriTextHeight / 2); + lableConfig.left = x + left - oriTextWidth - MARKER_BUFFER; + } + + const legendmarkerGroup = makeElement(legendGradContainer, + 'g', + [1], + `${config.classPrefix}-${config.className}-group`); + + if (!this._graphicElements.markerElement) { + this._graphicElements.markerElement = makeElement(legendmarkerGroup, + 'path', [{ value: null }], className, { enter: physicalAction }); + } + + if (!this._graphicElements.legendmarkerTextContainer) { + this._graphicElements.legendmarkerTextContainer = makeElement( + context._canvasMount, + 'div', + [1], + `${className}-text-container`); + this._graphicElements.legendmarkerText = makeElement( + this._graphicElements.legendmarkerTextContainer, + 'div', + [1], + `${className}-text`); + } + const textElement = createTextCell(className, labelManager, context._cells); + this._graphicElements.markerElement + .data([{ value: payload.criteria }]) + .attr('transform', `translate(${x},${y}) rotate(${rotateAngle})`) + .attr('d', getSymbol(shape).size(size * size)()) + .classed(`${className}-show`, true) + .classed(`${className}-hide`, false); + textElement.source(lableConfig.labelText); + textElement.render(this._graphicElements.legendmarkerText.node()); + this._graphicElements.legendmarkerText + .attr('style', `top: ${lableConfig.top}px; left:${lableConfig.left}px`) + .classed(`${className}-show`, true) + .classed(`${className}-hide`, false); + } else if (this._graphicElements.markerElement && this._graphicElements.legendmarkerText) { + this._graphicElements.markerElement + .data([{ value: null }]) + .classed(`${className}-show`, false) + .classed(`${className}-hide`, true); + this._graphicElements.legendmarkerText + .classed(`${className}-show`, false) + .classed(`${className}-hide`, true); + } + } + +} diff --git a/packages/muze-legend/src/firebolt/side-effects/legend-marker/styles.scss b/packages/muze-legend/src/firebolt/side-effects/legend-marker/styles.scss new file mode 100644 index 00000000..45cd80fd --- /dev/null +++ b/packages/muze-legend/src/firebolt/side-effects/legend-marker/styles.scss @@ -0,0 +1,28 @@ +$prefix: muze-; +.#{$prefix}legend-marker{ + stroke: #E2E2E2; + stroke-width: 1px; + fill: #797474; +} + +.#{$prefix}legend-marker-show{ + display: block; +} + + +.#{$prefix}legend-marker-hide{ + display: none; +} + +.#{$prefix}legend-marker-text-container{ + position: relative; +} + +.#{$prefix}legend-marker-text{ + position: absolute; +} + +.#{$prefix}legend-marker-text div{ + text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; + pointer-events: none; +} \ No newline at end of file diff --git a/packages/muze-legend/src/firebolt/side-effects/selection-box/index.js b/packages/muze-legend/src/firebolt/side-effects/selection-box/index.js index 5449128c..35d78c69 100644 --- a/packages/muze-legend/src/firebolt/side-effects/selection-box/index.js +++ b/packages/muze-legend/src/firebolt/side-effects/selection-box/index.js @@ -3,6 +3,7 @@ import { SpawnableSideEffect } from '@chartshq/muze-firebolt'; import { CLASSPREFIX, HEIGHT, WIDTH, HORIZONTAL, RECT } from '../../../enums/constants'; import { SELECTIONBOX } from '../../../enums/side-effects'; import { selectionBoxDrag } from '../../physical/selection-box-drag'; +import { LEGEND_MARKER_PROPS } from '../../../legend/defaults'; import './styles.scss'; /** @@ -11,6 +12,13 @@ import './styles.scss'; * @class SelectionBox */ /* istanbul ignore next */ class SelectionBox extends SpawnableSideEffect { + constructor (...params) { + super(...params); + this._graphicElems = { + rect: null + }; + } + static formalName () { return SELECTIONBOX; } @@ -39,8 +47,15 @@ import './styles.scss'; const config = this.config(); const axis = context.axis().source(); const className = `${config.classPrefix}-${config.className}`; + const { criteria } = payload; + const { rect } = this._graphicElems; - const domain = payload.criteria[firebolt.context.fieldName()]; + if (criteria === null) { + rect && rect.remove(); + return this; + } + + const domain = criteria[firebolt.context.fieldName()]; const axisScale = axis.scale(); const range = domain ? [axis.getScaleValue(domain[0]), axis.getScaleValue(domain[1])] : []; @@ -51,15 +66,16 @@ import './styles.scss'; const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1]; const legendGradContainer = context.getDrawingContext().svgContainer; - const legendSelGroup = makeElement(legendGradContainer, 'g', [1], `${config.classPrefix}-selection-box-group`); + const legendSelGroup = makeElement(legendGradContainer, 'g', [1], + `${config.classPrefix}-selection-box-group`); if (firebolt.context.config().align === HORIZONTAL) { x = range[0] - rangeShifter || 0; - y = 0; + y = LEGEND_MARKER_PROPS.size + 4; width = range[1] - range[0] || 0; height = gradientDimension; } else { - x = 0; + x = LEGEND_MARKER_PROPS.size + 4; y = range[1] - rangeShifter || 0; height = range[0] - range[1] || 0; width = gradientDimension; @@ -67,12 +83,15 @@ import './styles.scss'; const enterFn = function (el) { selectionBoxDrag(firebolt)(el, ['brush']); }; + const selBox = makeElement(legendSelGroup, RECT, [{ domain, x, y, width, height }], className, { enter: enterFn }); selBox.attr('y', y) .attr('x', x) .attr(WIDTH, width) .attr(HEIGHT, height); + this._graphicElems.rect = selBox; + return this; } } diff --git a/packages/muze-legend/src/legend/defaults.js b/packages/muze-legend/src/legend/defaults.js index 6cb9bfb9..7315988b 100644 --- a/packages/muze-legend/src/legend/defaults.js +++ b/packages/muze-legend/src/legend/defaults.js @@ -1,4 +1,4 @@ -import { getSymbol } from 'muze-utils'; +import { getSymbol, mergeRecursive } from 'muze-utils'; import { CENTER, LEFT, @@ -17,6 +17,8 @@ export const DEFAULT_MEASUREMENT = { maxHeight: Infinity, padding: 2, margin: 2, + marginHorizontal: 3, + paddingRight: 4, border: 1 }; @@ -30,6 +32,10 @@ export const LEGEND_TITLE = { }; export const DEFAULT_CONFIG = { + buffer: { + [ALIGN.HORIZONTAL]: 10, + [ALIGN.VERTICAL]: 10 + }, classPrefix: 'muze', borderStyle: 'solid', borderColor: 'rgba(0,0,0,0)', @@ -49,12 +55,25 @@ export const DEFAULT_CONFIG = { className: 'legend-icon', height: 20, width: 20, - color: 'rgba(0,0,0,.5)', + color: 'rgba(192,192,192,0.6)', type: 'square' } } + // stops: 5 }; +const tempConfig = mergeRecursive({}, DEFAULT_CONFIG); + +const ITEM_FORMATTER = { + item: { + text: { + formatter: val => `${val[0]} - ${val[1]}` + } + } +}; + +export const STEP_DEFAULT_CONFIG = mergeRecursive(tempConfig, ITEM_FORMATTER); + /** * Creates a map of pre defined icons * @@ -66,3 +85,10 @@ export const ICON_MAP = (icon) => { return getSymbol(icon); } return icon; }; + +export const LEGEND_MARKER_PROPS = { + size: 8, + ROTATE_HORIZONTAL: 180, + ROTATE_VERTICAL: 90, + shape: 'triangle' +}; diff --git a/packages/muze-legend/src/legend/discrete-legend.js b/packages/muze-legend/src/legend/discrete-legend.js index 9ad0d33e..3c68d633 100644 --- a/packages/muze-legend/src/legend/discrete-legend.js +++ b/packages/muze-legend/src/legend/discrete-legend.js @@ -1,7 +1,9 @@ import { FieldType, DimensionSubtype, - formatTemporal + formatTemporal, + getReadableTicks, + InvalidAwareTypes } from 'muze-utils'; import SimpleLegend from './simple-legend'; import { DISCRETE, LEFT, SIZE } from '../enums/constants'; @@ -49,11 +51,19 @@ export default class DiscreteLegend extends SimpleLegend { */ dataFromScale () { const scale = this.scale(); - const { scaleType, domain, scaleFn } = getScaleInfo(scale); - let domainForLegend = [...new Set(domain)]; + const { scaleType, domain, scaleFn, steps } = getScaleInfo(scale); const field = this.metaData().getFieldspace().fields[0]; const { type, subtype } = field.schema(); + let domainForLegend = []; + if (scaleType === SIZE && type === FieldType.MEASURE) { + domainForLegend = steps instanceof Array ? steps : getReadableTicks(domain, domain.length); + } else if (subtype === DimensionSubtype.TEMPORAL) { + domainForLegend = [...new Set(field.data())]; + } else { + domainForLegend = [...new Set(domain)]; + } + const len = domainForLegend.length; domainForLegend = domainForLegend.map((ele, i) => { let value = 0; let range = 0; @@ -61,7 +71,7 @@ export default class DiscreteLegend extends SimpleLegend { if (type === FieldType.MEASURE) { value = (+domainForLegend[i]).toFixed(0); const nextVal = domainForLegend[i + 1] ? +domainForLegend[i + 1] : +value; - range = [value, nextVal.toFixed(0)]; + range = [value, i === len - 1 ? nextVal.toFixed(0) : nextVal.toFixed(0) - 1]; } else { let domainVal = rawVal; if (subtype === DimensionSubtype.TEMPORAL) { @@ -80,7 +90,13 @@ export default class DiscreteLegend extends SimpleLegend { }).filter(d => d.value !== null); domainForLegend = scaleType === SIZE ? domainForLegend.sort((a, b) => a[scaleType] - b[scaleType]) - : domainForLegend; + : domainForLegend.sort((a, b) => { + const domainValue = + !(a.value instanceof InvalidAwareTypes || a.value instanceof InvalidAwareTypes) + ? a.value.localeCompare(b.value) + : 1; + return domainValue; + }); return domainForLegend; } @@ -94,15 +110,19 @@ export default class DiscreteLegend extends SimpleLegend { render () { const firebolt = this.firebolt(); const data = this.data(); + const { classPrefix } = this.config(); const legendContainer = super.render(this.mount()); // create Legend const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data); const { itemSkeleton } = createItemSkeleton(this, legendItem); renderDiscreteItem(this, itemSkeleton); - legendContainer.selectAll('div').style('float', LEFT); + + legendContainer.selectAll('div') + .filter((datum, i, allSelections) => !allSelections[i].classList.contains(`${classPrefix}-legend-body`)) + .style('float', LEFT); + firebolt.mapActionsAndBehaviour(); - firebolt.createSelectionSet(this.data().map(d => d.id)); return legendContainer; } } diff --git a/packages/muze-legend/src/legend/gradient-helper.js b/packages/muze-legend/src/legend/gradient-helper.js index 629db997..21967f5b 100644 --- a/packages/muze-legend/src/legend/gradient-helper.js +++ b/packages/muze-legend/src/legend/gradient-helper.js @@ -1,7 +1,7 @@ import { makeElement, applyStyle } from 'muze-utils'; import { ContinousAxis } from '@chartshq/muze-axis'; import { BOTTOM, RIGHT } from '../enums/constants'; -import { ALIGN } from './defaults'; +import { ALIGN, LEGEND_MARKER_PROPS } from './defaults'; import '../styles.scss'; /** @@ -18,7 +18,6 @@ export const getGradientDomain = (data) => { } return data.map(e => e.value); }; - /** * * @@ -27,10 +26,10 @@ export const getGradientDomain = (data) => { * @param {*} domain * */ -export const makeLinearGradient = (container, data, domain) => { +export const makeLinearGradient = (container, data, domain, id) => { const defs = makeElement(container, 'defs', [1]); const linearGradient = makeElement(defs, 'linearGradient', [1]) - .attr('id', 'linear-gradient') + .attr('id', `linear-gradient-${id}`) .attr('x1', '0%') .attr('y2', '0%'); @@ -80,12 +79,12 @@ export const createAxis = (context) => { * * @memberof GradientLegend */ -const createLegendSkeleton = (container, classPrefix, data) => { +const createLegendSkeleton = (container, classPrefix, data, id) => { const domain = getGradientDomain(data); const legendContainer = makeElement(container, 'div', [1], `${classPrefix}-legend-body`); const legendGradSvg = makeElement(legendContainer, 'svg', [1], `${classPrefix}-gradient`); const legendGradCont = makeElement(legendGradSvg, 'g', [1], `${classPrefix}-gradient-group`); - const linearGradient = makeLinearGradient(legendGradSvg, data, domain); + const linearGradient = makeLinearGradient(legendGradSvg, data, domain, id); const legendRect = makeElement(legendGradCont, 'rect', [1], `${classPrefix}-gradient-rect`); return { @@ -108,6 +107,9 @@ const createLegendSkeleton = (container, classPrefix, data) => { export const renderAxis = (context, container, height, width) => { const axis = context.axis(); + axis.source().config({ + tickFormat: (val, i) => context.config().item.text.formatter(val, i, context.metaData(), context) + }); axis.setAvailableSpace(width, height); axis.render(container.node()); axis.source().render(); @@ -135,7 +137,7 @@ export const renderGradient = (context, container) => { legendGradCont, linearGradient, legendRect - } = createLegendSkeleton(container, classPrefix, data); + } = createLegendSkeleton(container, classPrefix, data, context._id); const labelDim = context.axis().source().getAxisDimensions().tickDimensions; const { padding, @@ -157,7 +159,7 @@ export const renderGradient = (context, container) => { gradientDimensions.height = item.icon.height; gradientDimensions.width = gradWidth - 2 * padding - labelDim.width / 2; linearGradient.attr('x2', '100%').attr('y1', '0%'); - legendGradCont.attr('transform', `translate( ${labelDim.width / 2} 0)`); + legendGradCont.attr('transform', `translate( ${labelDim.width / 2} ${LEGEND_MARKER_PROPS.size + 4})`); renderAxis(context, legendContainer, gradHeight - item.icon.height - padding, gradWidth - 2 * padding - 1); applyStyle(legendContainer, { @@ -172,7 +174,7 @@ export const renderGradient = (context, container) => { gradientDimensions.height = gradHeight - 2 * padding - labelDim.height / 2; gradientDimensions.width = item.icon.width; linearGradient.attr('x2', '0%').attr('y1', '100%'); - legendGradCont.attr('transform', `translate(0 ${labelDim.height / 2})`); + legendGradCont.attr('transform', `translate(${LEGEND_MARKER_PROPS.size + 4} ${labelDim.height / 2})`); renderAxis(context, legendContainer, gradHeight - 2 * padding - 1, gradWidth - item.icon.width - padding * 2); applyStyle(legendContainer, { @@ -186,16 +188,16 @@ export const renderGradient = (context, container) => { // Apply Styles to the legend plot area applyStyle(legendGradSvg, { - height: `${gradientDimensions.height}px`, - width: `${gradientDimensions.width}px` + height: `${gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4}px`, + width: `${gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4}px` }); - // Apply styles to the legend rect + // Apply styles to the legend rect applyStyle(legendRect, { - fill: 'url(#linear-gradient)' + fill: `url(#linear-gradient-${context._id})` }); - legendGradSvg.attr('height', gradientDimensions.height); - legendGradSvg.attr('width', gradientDimensions.width); + legendGradSvg.attr('height', gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4); + legendGradSvg.attr('width', gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4); context.measurement({ gradientDimensions diff --git a/packages/muze-legend/src/legend/gradient-legend.js b/packages/muze-legend/src/legend/gradient-legend.js index 73c7dd15..d1a99bb7 100644 --- a/packages/muze-legend/src/legend/gradient-legend.js +++ b/packages/muze-legend/src/legend/gradient-legend.js @@ -1,6 +1,8 @@ import SimpleLegend from './simple-legend'; import { getScaleInfo, getInterpolatedData, getInterpolatedArrayData } from './legend-helper'; import { GRADIENT, LEFT, SIZE } from '../enums/constants'; +import { HIGHLIGHT } from '../enums/behaviours'; +import { Marker } from '../enums/side-effects'; import { renderGradient, createAxis } from './gradient-helper'; import '../styles.scss'; @@ -91,8 +93,8 @@ export default class GradientLegend extends SimpleLegend { const value = domainForLegend[i]; return { [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor() - : scale[scaleFn](Math.floor(ele)), - value: +value.toFixed(2), + : scale[scaleFn](ele), + value: +value.toFixed(1), id: i }; }).filter(d => d.value !== null); @@ -150,10 +152,13 @@ export default class GradientLegend extends SimpleLegend { renderGradient(this, legendContainer); legendContainer.selectAll('div').style('float', LEFT); firebolt.mapActionsAndBehaviour(); - firebolt.createSelectionSet(this.data().map(d => d.id)); + firebolt.mapSideEffects({ + [HIGHLIGHT]: [Marker] + }); return legendContainer; } - /** + + /** * * * @param {*} data @@ -163,4 +168,11 @@ export default class GradientLegend extends SimpleLegend { getCriteriaFromData (data) { return [[this.fieldName()], [data.value]]; } + + getRangeFromIdentifiers ({ fields, criteria }) { + return fields.reduce((range, v) => { + range[v] = criteria[v]; + return range; + }, {}); + } } diff --git a/packages/muze-legend/src/legend/legend-helper.js b/packages/muze-legend/src/legend/legend-helper.js index 96534f29..07ce55c8 100644 --- a/packages/muze-legend/src/legend/legend-helper.js +++ b/packages/muze-legend/src/legend/legend-helper.js @@ -1,4 +1,4 @@ -import { makeElement, numberInterpolator } from 'muze-utils'; +import { makeElement, FieldType, getReadableTicks } from 'muze-utils'; import { SCALE_FUNCTIONS, @@ -8,7 +8,10 @@ import { RIGHT, TOP, BOTTOM, - MAXWIDTH + MAXWIDTH, + CENTER, + HORIZONTAL, + POSITION_ALIGNMENT_MAP } from '../enums/constants'; /** @@ -159,9 +162,6 @@ export const getInterpolatedData = (domain, steps, scaleParams) => { const getTickMeasure = scaleParams.smartLabel; const { maxWidth, maxHeight } = scaleParams.measures; const { alignment } = scaleParams; - const domainForLegend = []; - const interpolatedFn = numberInterpolator()(domain[0], domain[1]); - // getting tick measure(i.e height and width) const tickValue = getTickMeasure.getOriSize(domain[1].toFixed(2)); @@ -177,11 +177,7 @@ export const getInterpolatedData = (domain, steps, scaleParams) => { } steps = Math.min(steps, recomputeSteps); - // scaling the axis based on steps provided - for (let i = 0; i <= steps; i++) { - domainForLegend[i] = interpolatedFn(i / steps); - } - return domainForLegend; + return getReadableTicks(domain, steps); }; /** @@ -193,21 +189,29 @@ export const getInterpolatedData = (domain, steps, scaleParams) => { * @param {*} classPrefix */ export const titleCreator = (container, title, measurement, config) => { - const titleWidth = Math.min(measurement.maxWidth, measurement.width); + const { orientation } = config.item.text; + let textAlign = LEFT; + const { alignment, maxWidth, width, height, border, padding } = measurement; + + if (orientation === TOP || orientation === BOTTOM || alignment === HORIZONTAL) { + textAlign = CENTER; + } + const titleWidth = Math.min(maxWidth, width); const titleContainer = makeElement(container, 'table', [1], `${config.classPrefix}-legend-title`) .style(WIDTH, `${titleWidth}px`) - .style(HEIGHT, `${measurement.height}px`) - .style('border-bottom', `${measurement.border}px ${config.borderStyle} ${config.borderColor}`) + .style(HEIGHT, `${height}px`) + .style('border-bottom', `${border}px ${config.borderStyle} ${config.borderColor}`) .style('text-align', title.orientation instanceof Function ? title.orientation(config.position) : title.orientation); return makeElement(titleContainer, 'td', [1], `${config.classPrefix}-legend-title-text`) .style(WIDTH, `${titleWidth}px`) - .style(MAXWIDTH, `${titleWidth}px`) + .style(MAXWIDTH, `${maxWidth}px`) .style(HEIGHT, '100%') .style('line-height', 1) - .style('padding', `${measurement.padding}px`) + .style('padding', `${padding}px`) .text(title.text) + .style('text-align', textAlign) .style('overflow-x', 'scroll') .node(); }; @@ -249,8 +253,9 @@ export const getItemMeasures = (context, prop, formatter) => { data.forEach((item, index) => { const value = prop ? item[prop] : item; - const { height, width } = labelManager.getOriSize(formatter(value, index, data, context)); - space[index] = { height: height + 1, width: width + 1 }; + const formattedData = formatter(value, index, context.metaData(), context); + const { height, width } = labelManager.getOriSize(formattedData); + space[index] = { height, width }; }); return space; }; @@ -332,20 +337,21 @@ export const computeItemSpaces = (config, measures, data) => { itemSpaces.push(itemSpace); iconSpaces.push(iconSpace); }); + itemSpaces.forEach((itemSpace, i) => { if (align === 'horizontal') { itemSpace.height = totalHeight; - iconSpaces[i].width = maxIconWidth; + // iconSpaces[i].width = maxIconWidth; if (textOrientation === LEFT || textOrientation === RIGHT) { labelSpaces[i].height = totalHeight; iconSpaces[i].height = totalHeight; - itemSpaces[i].width = labelSpaces[i].width + maxIconWidth; + itemSpaces[i].width = labelSpaces[i].width + iconSpaces[i].width + 2 * effPadding; } else { - labelSpaces[i].width = maxIconWidth; - itemSpaces[i].width = maxIconWidth; - labelSpaces[i].width = maxIconWidth; + labelSpaces[i].width = iconSpaces[i].width; + itemSpaces[i].width = iconSpaces[i].width; + labelSpaces[i].width = iconSpaces[i].width; } - totalWidth = Math.max(totalWidth + itemSpaces[i].width); + totalWidth += itemSpaces[i].width; } else { itemSpace.width = Math.max(totalWidth, maxWidth); if (textOrientation === TOP || textOrientation === BOTTOM) { @@ -356,7 +362,7 @@ export const computeItemSpaces = (config, measures, data) => { const labelWidth = labelSpaces[i].width; const newLabelWidth = (maxItemSpaces.width - maxIconWidth); iconSpaces[i].width = maxIconWidth; - itemSpaces[i].width = labelSpaces[i].width + maxIconWidth; + itemSpaces[i].width = labelWidth + maxIconWidth; labelSpaces[i].width = Math.max(labelWidth, newLabelWidth); totalWidth = Math.max(totalWidth, itemSpace.width); } @@ -398,3 +404,47 @@ export const getDomainBounds = (type, scaleInfo, domainInfo) => { range: [ele, step] }; }; + +export const prepareSelectionSetData = (data, fieldName, dm) => { + const fieldType = dm.getFieldsConfig()[fieldName].def.type; + if (fieldType === FieldType.DIMENSION) { + return { + keys: data.reduce((acc, d) => { + acc[d.rawVal] = { + uid: d.id, + dims: [d.rawVal] + + }; + return acc; + }, {}), + fields: [fieldName] + }; + } + return { + keys: data.reduce((acc, d) => { + acc[d.id] = { + uid: d.id, + dims: [d.id] + }; + return acc; + }, {}), + fields: [fieldName] + }; +}; + +export const calculateTitleWidth = (measures, titleWidth, config) => { + const { maxItemSpaces, margin, itemSpaces } = measures; + const { position, buffer } = config; + const alignment = POSITION_ALIGNMENT_MAP[position]; + let width = 0; + + if (alignment === HORIZONTAL) { + const localBuffer = buffer[alignment]; + width = itemSpaces.reduce((acc, cur) => acc + cur.width + localBuffer, 0); + } else if (maxItemSpaces.width < titleWidth) { + width = titleWidth + 2 * margin; + } else { + width = maxItemSpaces.width; + } + return width; +}; diff --git a/packages/muze-legend/src/legend/position-config.js b/packages/muze-legend/src/legend/position-config.js index 5315827d..cdfed723 100644 --- a/packages/muze-legend/src/legend/position-config.js +++ b/packages/muze-legend/src/legend/position-config.js @@ -18,18 +18,21 @@ const legendOrientation = { row: [1], column: data }), - itemContainerMeasures: (measurement) => { + itemContainerMeasures: (measurement, config) => { const { itemSpaces, width } = measurement; + const { + buffer + } = config; return { row: { - width: `${width}px`, + width: `${width + itemSpaces.length * buffer[HORIZONTAL] || 1}px`, padding: `${0}px` }, column: { - width: (d, i) => `${itemSpaces[i].width}px`, + width: (d, i) => `${itemSpaces[i].width + buffer[HORIZONTAL]}px`, padding: `${0}px` } }; diff --git a/packages/muze-legend/src/legend/props.js b/packages/muze-legend/src/legend/props.js index ef9764d8..c6f51e34 100644 --- a/packages/muze-legend/src/legend/props.js +++ b/packages/muze-legend/src/legend/props.js @@ -18,7 +18,9 @@ export const PROPS = { } }, logicalSpace: {}, - metaData: {}, + metaData: { + onset: (context, value) => context.firebolt().attachPropagationListener(value) + }, range: { sanitization: (context, value) => { context.scale().range(value); diff --git a/packages/muze-legend/src/legend/renderer.js b/packages/muze-legend/src/legend/renderer.js index 16af2518..758b51c0 100644 --- a/packages/muze-legend/src/legend/renderer.js +++ b/packages/muze-legend/src/legend/renderer.js @@ -8,7 +8,15 @@ import { VALUE, RECT, LEFT, - RIGHT + DEFAULTICONSIZE, + VERTICAL_BUFFER, + HORIZONTAL_BUFFER, + HORIZONTAL, + VERTICAL, + DEFAULT, + TOP, + BOTTOM, + OPPOSITE_POSITION } from '../enums/constants'; /** @@ -78,6 +86,11 @@ export const createLegendSkeleton = (context, container, classPrefix, data) => { maxGradWidth = maxWidth - (margin * 2 + border * 2); let legendBody = makeElement(container, 'div', [1], `${classPrefix}-legend-body`); + + legendBody.style(WIDTH, `${gradWidth}px`); + + legendBody.style(HEIGHT, `${gradHeight}px`); + legendBody.select(`.${classPrefix}-legend-overflow`).remove(); // Create a div with scroll when overflow if (maxGradWidth && maxGradWidth < gradWidth) { @@ -90,9 +103,6 @@ export const createLegendSkeleton = (context, container, classPrefix, data) => { legendBody = makeElement(legendBody, 'div', [1], `${classPrefix}-legend-overflow`); - legendBody.style(WIDTH, `${gradWidth}px`); - legendBody.style(HEIGHT, `${gradHeight}px`); - const legendItem = getItemContainers(legendBody, data, context); return { legendItem }; }; @@ -110,7 +120,6 @@ export const createItemSkeleton = (context, container) => { item } = context.config(); const textOrientation = item.text.orientation; - const stack = itemStack[textOrientation]; const itemSkeleton = makeElement(container, 'div', (d, i) => stack.map(e => [e, d[e], d.color, d.size, d.value, context.fieldName(), i]), `${classPrefix}-legend-item-info`); @@ -134,12 +143,21 @@ export const applyItemStyle = (item, measureType, stepColorCheck, context) => { iconSpaces, maxIconWidth } = context.measurement(); + + const { align } = context.config().align; + const diff = stepColorCheck ? -padding * 2 : 0; if (item[0] === VALUE) { return `${labelSpaces[item[6]][measureType]}px`; } - return `${measureType === 'width' && !stepColorCheck ? maxIconWidth : iconSpaces[item[6]][measureType] - diff}px`; + + if (measureType === 'width' && !stepColorCheck && align === VERTICAL) { + return `${maxIconWidth}px`; + } else if (align === HORIZONTAL) { + return `${maxIconWidth}px`; + } + return `${iconSpaces[item[6]][measureType] - diff}px`; }; /** @@ -161,11 +179,12 @@ const checkPath = (str) => { * @param {*} d * @param {*} elem */ -const createShape = function (d, elem, defaultIcon, width, height) { +const createShape = function (d, elem, defaultIcon) { const groupElement = elem; // const { shape, size, update } = d; - const size = d[3] || Math.min(width, height) * Math.PI; const shape = d[1] || defaultIcon; + const defaultIconSize = DEFAULTICONSIZE[shape] || DEFAULTICONSIZE[DEFAULT]; + const size = d[3] || defaultIconSize * Math.PI; if (shape instanceof Promise) { shape.then((res) => { @@ -222,22 +241,31 @@ export const renderIcon = (icon, container, datum, context) => { const { classPrefix, iconHeight, - iconWidth, - maxIconWidth, padding, - color + color, + iconWidth, + align } = context; + + let { maxIconWidth } = context; + + if (align === HORIZONTAL) { + maxIconWidth = iconWidth + 2 * padding; + } const svg = makeElement(container, 'svg', f => [f], `${classPrefix}-legend-icon-svg`) .attr(WIDTH, maxIconWidth) .attr(HEIGHT, iconHeight) - .style(WIDTH, `${maxIconWidth}px`) + .style(WIDTH, `${Math.ceil(maxIconWidth)}px`) .style(HEIGHT, `${iconHeight}px`); + const transalate = maxIconWidth / 2 - padding; + if (icon !== RECT) { const group = makeElement(svg, 'g', [datum[1]], `${classPrefix}-legend-icon`); - createShape(datum, group, datum[3] ? 'circle' : 'square', iconWidth, iconHeight) - .attr('transform', `translate(${maxIconWidth / 2 - padding} ${iconHeight / 2})`) - .attr('fill', datum[2] || color); + createShape(datum, group, icon) + .attr('transform', `translate(${transalate} ${iconHeight / 2})`) + .attr('fill', datum[2] || color) + .attr('stroke', datum[2] || color); } else { makeElement(svg, RECT, [datum[1]], `${classPrefix}-legend-icon`) .attr('x', 0) @@ -258,7 +286,9 @@ export const renderDiscreteItem = (context, container) => { const labelManager = context._labelManager; const { item, - classPrefix + classPrefix, + shape, + align } = context.config(); const { maxIconWidth, @@ -270,7 +300,6 @@ export const renderDiscreteItem = (context, container) => { color, className } = item.icon; - const textOrientation = item.text.orientation; const formatter = item.text.formatter; @@ -282,24 +311,30 @@ export const renderDiscreteItem = (context, container) => { padding: `${padding}px` }); + const marginHorizontalBuffer = HORIZONTAL_BUFFER; + const marginVerticalBuffer = textOrientation === TOP || textOrientation === BOTTOM ? 0 : VERTICAL_BUFFER; + labelManager.setStyle(context._computedStyle); - const dataArr = container.data(); + const dataArr = context.metaData(); + const position = OPPOSITE_POSITION[textOrientation] || LEFT; container.each(function (d, i) { if (d[0] === VALUE) { selectElement(this).text(formatter(d[1], i, dataArr, context)) - .style(`padding-${textOrientation === RIGHT ? LEFT : RIGHT}`, '0px'); + .style(`padding-${position}`, '0px') + .style(`margin-${position}`, `${align === HORIZONTAL ? marginHorizontalBuffer : marginVerticalBuffer}px`); } else { // const icon = getLegendIcon(d, iconWidth, iconHeight, type); selectElement(this).classed(`${classPrefix}-${className}`, true); selectElement(this).classed(`${classPrefix}-${className}-${i}`, true); - renderIcon('circle', selectElement(this), d, { + renderIcon(shape, selectElement(this), d, { classPrefix, - iconWidth, - // iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth, + // iconWidth, + iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth, iconHeight, maxIconWidth, padding, - color + color, + align }); } }); @@ -345,10 +380,12 @@ export const renderStepItem = (context, container) => { }); labelManager.setStyle(context._computedStyle); - const dataArr = container.data(); + const dataArr = context.metaData(); + const data = context.data(); container.each(function (d, i) { if (d[0] === VALUE) { - selectElement(this).text(formatter(d[1], i, dataArr, context)); + const formattedData = formatter([data[d[6]].range[0], data[d[6]].range[1]], i, dataArr, context); + selectElement(this).text(formattedData); } else { renderIcon(RECT, selectElement(this), d, { classPrefix, diff --git a/packages/muze-legend/src/legend/simple-legend.js b/packages/muze-legend/src/legend/simple-legend.js index 093dbfeb..7d00c002 100644 --- a/packages/muze-legend/src/legend/simple-legend.js +++ b/packages/muze-legend/src/legend/simple-legend.js @@ -6,7 +6,6 @@ import { generateGetterSetters, mergeRecursive } from 'muze-utils'; -import { behaviouralActions } from '@chartshq/muze-firebolt'; import * as legendBehaviours from '../firebolt/behavioural'; import { LegendFireBolt } from '../firebolt/legend-firebolt'; @@ -14,10 +13,16 @@ import { actionBehaviourMap } from '../firebolt/action-behaviour-map'; import { physicalActions } from '../firebolt/physical'; import * as sideEffects from '../firebolt/side-effects'; import { behaviourEffectMap } from '../firebolt/behaviour-effect-map'; -import { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM } from '../enums/constants'; +import { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM, POSITION_ALIGNMENT_MAP } from '../enums/constants'; import { PROPS } from './props'; import { DEFAULT_MEASUREMENT, DEFAULT_CONFIG, LEGEND_TITLE } from './defaults'; -import { getItemMeasures, titleCreator, computeItemSpaces } from './legend-helper'; +import { + getItemMeasures, + titleCreator, + computeItemSpaces, + prepareSelectionSetData, + calculateTitleWidth +} from './legend-helper'; /** * Creates a Legend from the axes of a canvas @@ -33,6 +38,7 @@ export default class SimpleLegend { * @memberof Legend */ constructor (dependencies) { + const { interactions } = dependencies.registry; this._data = []; this._metaData = []; this._mount = null; @@ -53,7 +59,7 @@ export default class SimpleLegend { `${this.config().classPrefix}-legend-item-info`); this._firebolt = new LegendFireBolt(this, { - behavioural: Object.assign({}, behaviouralActions, legendBehaviours), + behavioural: Object.assign({}, interactions.behaviours.get(), legendBehaviours), physical: physicalActions, physicalBehaviouralMap: actionBehaviourMap }, sideEffects, behaviourEffectMap); @@ -235,7 +241,13 @@ export default class SimpleLegend { * @memberof Legend */ renderTitle (container) { - const { titleSpaces, border, padding, width, maxWidth } = this.measurement(); + const { titleSpaces, border, padding, maxWidth } = this.measurement(); + + const width = calculateTitleWidth( + this.measurement(), + this._labelManager.getOriSize(this._title.text).width, + this.config() + ); const { borderStyle, borderColor } = this.config(); return titleCreator(container, this.title(), { height: titleSpaces.height, @@ -244,7 +256,8 @@ export default class SimpleLegend { border, padding, borderStyle, - borderColor + borderColor, + alignment: POSITION_ALIGNMENT_MAP[this.config().position] }, this.config()); } @@ -264,48 +277,63 @@ export default class SimpleLegend { position } = this.config(); const { - maxWidth, + border, + marginHorizontal, maxHeight, - width, height, - margin, - border + width, + maxWidth + } = this.measurement(); + let { + margin } = this.measurement(); const legendContainer = makeElement(selectElement(this.mount()), 'div', [1], `${classPrefix}-legend-box`); let marginPosition; switch (position) { case TOP: marginPosition = `margin-${BOTTOM}`; + margin = marginHorizontal; break; case LEFT: marginPosition = `margin-${RIGHT}`; break; case BOTTOM: marginPosition = `margin-${TOP}`; + margin = marginHorizontal; break; default: marginPosition = `margin-${LEFT}`; } legendContainer.classed(`${classPrefix}-legend-box-${this._id}`, true); legendContainer.style('float', 'left'); + + const widthBox = calculateTitleWidth( + this.measurement(), + this._labelManager.getOriSize(this._title.text).width, + this.config() + ); + + const titleWidth = Math.min(maxWidth, widthBox); + width < titleWidth ? selectElement(this.mount()).style('width', `${titleWidth}px`) : null; // set height and width - legendContainer.style('width', `${Math.min(maxWidth, width) - margin * 2}px`) - .style('height', `${Math.min(maxHeight, height) - margin * 2}px`) + legendContainer.style('width', `${titleWidth}px`) + .style('height', `${Math.min(maxHeight, height)}px`) .style(`${marginPosition}`, `${margin}px`) .style('border', `${border}px ${borderStyle} ${borderColor}`); this.legendContainer(legendContainer.node()); // create title this.renderTitle(legendContainer); - firebolt.createSelectionSet(this.data().map(d => d.id)); + firebolt.createSelectionSet(prepareSelectionSetData(this.data(), this.fieldName(), this.metaData())); return legendContainer; } - /** + + /** * * * @param {*} data * - * @memberof StepLegend + * @memberof SimpleLegend */ getCriteriaFromData (data) { const fieldName = this.fieldName(); @@ -317,4 +345,36 @@ export default class SimpleLegend { } return [[fieldName], [data.rawVal]]; } + + getValueFromId (id, fields = []) { + const data = this.data(); + if (fields.length) { + id = Number(id); + return [data.find(d => id === d.id).rawVal]; + } + + return []; + } + + getRangeFromIdentifiers ({ fields, entrySet }) { + const data = this.data(); + const idRangeMap = data.reduce((acc, v) => { + acc[v.id] = v; + return acc; + }, {}); + + return fields.reduce((acc, v) => { + acc[v] = entrySet.reduce((ranges, id) => { + if (id in idRangeMap) { + ranges.push(idRangeMap[id].range); + } + return ranges; + }, []); + return acc; + }, {}); + } + + setParentInfo (info) { + this._canvasMount = info.canvasRoot; + } } diff --git a/packages/muze-legend/src/legend/step-legend.js b/packages/muze-legend/src/legend/step-legend.js index d603081e..831a2930 100644 --- a/packages/muze-legend/src/legend/step-legend.js +++ b/packages/muze-legend/src/legend/step-legend.js @@ -2,16 +2,17 @@ import SimpleLegend from './simple-legend'; import { getScaleInfo, getInterpolatedData, - getDomainBounds + getItemMeasures } from './legend-helper'; import { createLegendSkeleton, createItemSkeleton, renderStepItem } from './renderer'; -import { STEP, RECT, LEFT, SIZE, UPPER, LOWER } from '../enums/constants'; +import { STEP, RECT, LEFT, SIZE, HORIZONTAL } from '../enums/constants'; import { stepData } from './position-config'; import '../styles.scss'; +import { STEP_DEFAULT_CONFIG, DEFAULT_MEASUREMENT } from './defaults'; /** * Creates a Legend from the axes of a canvas @@ -44,6 +45,18 @@ export default class StepLegend extends SimpleLegend { return STEP; } + /** + * + * + * @static + * + * @memberof StepLegend + */ + static defaultConfig () { + STEP_DEFAULT_CONFIG.buffer[HORIZONTAL] = 0; + return STEP_DEFAULT_CONFIG; + } + /** * * @@ -55,11 +68,7 @@ export default class StepLegend extends SimpleLegend { let domainLeg = []; const scale = this.scale(); const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale); - - const { formatter } = this.config(); - const domainBounds = { - lower: null, upper: null - }; + const isFraction = ele => ele % 1 !== 0; // defining scaleParams const scaleParams = { @@ -71,12 +80,13 @@ export default class StepLegend extends SimpleLegend { if (steps instanceof Array) { if (domain[0] < steps[0]) { - domainBounds.lower = [`${formatter.bounds.lower} ${steps[0]}`]; + domainLeg[0] = domain[0]; } domainLeg = [...domainLeg, ...steps]; if (domain[domain.length - 1] > steps[steps.length - 1]) { - domainBounds.upper = [`${formatter.bounds.upper} ${steps[steps.length - 1]}`]; + domainLeg.push(domain[1]); } + domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b); } else { domainLeg = getInterpolatedData(domain, steps, scaleParams); } @@ -84,30 +94,33 @@ export default class StepLegend extends SimpleLegend { domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b); domainLeg = domainLeg.map((ele, i) => { let value = null; + let range; if (i < domainLeg.length - 1) { - value = `${(ele.toFixed(1))} - ${(+domainLeg[i + 1].toFixed(1))}`; + const left = isFraction(ele) ? ele.toFixed(1) : ele; + + const numRight = +domainLeg[i + 1]; + const right = isFraction(numRight) ? numRight.toFixed(1) : numRight; + + value = `${left} - ${right}`; + range = [left, right]; } else if (domainLeg.length === 1) { - value = ele.toFixed(1); + value = isFraction(ele) ? ele.toFixed(1) : ele; + + const numRight = +domainLeg[i + 1]; + const right = isFraction(numRight) ? numRight.toFixed(1) : numRight; + range = [value, right]; } + return { - [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele), + [scaleType]: scaleType === SIZE + ? scale[scaleFn](ele) * scale.getScaleFactor() + : scale[scaleFn](ele), value, id: i + 1, - range: [ele, domainLeg[i + 1]] + range }; }).filter(d => d.value !== null); - if (domainBounds.lower) { - const lowerBounds = getDomainBounds(LOWER, { scale, scaleFn, scaleType }, - { domain, steps, domainBounds }); - domainLeg = [lowerBounds, ...domainLeg]; - } - if (domainBounds.upper) { - const upperBounds = getDomainBounds(UPPER, { scale, scaleFn, scaleType }, - { domain, steps, domainBounds, domainLeg }); - domainLeg = [...domainLeg, upperBounds]; - } - return domainLeg; } @@ -119,7 +132,7 @@ export default class StepLegend extends SimpleLegend { * * @memberof Legend */ - getLabelSpaces (effPadding, align) { + getLabelSpaces () { this.config({ item: { text: { @@ -127,7 +140,11 @@ export default class StepLegend extends SimpleLegend { } } }); - return super.getLabelSpaces(effPadding, align); + const { + item + } = this.config(); + const stepItemBuffer = DEFAULT_MEASUREMENT.padding * 2; + return getItemMeasures(this, 'range', item.text.formatter, stepItemBuffer); } /** @@ -161,17 +178,9 @@ export default class StepLegend extends SimpleLegend { renderStepItem(this, itemSkeleton); legendContainer.selectAll('div').style('float', LEFT); firebolt.mapActionsAndBehaviour(); - firebolt.createSelectionSet(this.data().map(d => d.id)); return legendContainer; } - /** - * - * - * @param {*} data - * - * @memberof StepLegend - */ getCriteriaFromData (data) { const fieldName = this.fieldName(); return { diff --git a/packages/muze-legend/src/styles.scss b/packages/muze-legend/src/styles.scss index 3ddb7124..43fcebe9 100644 --- a/packages/muze-legend/src/styles.scss +++ b/packages/muze-legend/src/styles.scss @@ -48,7 +48,11 @@ $prefix: muze-; .#{$prefix}legend-fadeout { fill-opacity: 0.3; - opacity: 0.3; + + path { + stroke-width: 1px; + fill-opacity:0; + } } .#{$prefix}legend-brighten { diff --git a/packages/muze-tooltip/src/default-config.js b/packages/muze-tooltip/src/default-config.js index fb2a2f51..ad3688cc 100644 --- a/packages/muze-tooltip/src/default-config.js +++ b/packages/muze-tooltip/src/default-config.js @@ -3,11 +3,13 @@ import { CLASSPREFIX } from './constants'; export const defaultConfig = { classPrefix: CLASSPREFIX, defClassName: 'tooltip-box', + parentClassName: 'tooltip-parent-container', connectorClassName: 'tooltip-connectors', className: '', row: { margin: 0 }, + spacing: 5, content: { spacing: 5, iconContainerSize: 10, diff --git a/packages/muze-tooltip/src/helper.js b/packages/muze-tooltip/src/helper.js index 43022d16..9bf0e0cd 100644 --- a/packages/muze-tooltip/src/helper.js +++ b/packages/muze-tooltip/src/helper.js @@ -1,81 +1,3 @@ -import { getQualifiedClassName } from 'muze-utils'; -import { TOOLTIP_LEFT, TOOLTIP_RIGHT, ARROW_RIGHT, ARROW_LEFT, TOOLTIP_BOTTOM } from './constants'; - -export const getArrowPos = (orient, dim, measurement, config) => { - let arrowPos; - const { x, y, boxHeight, boxWidth } = measurement; - const arrowDisabled = config.arrow.disabled; - const arrowWidth = arrowDisabled ? 0 : config.arrow.size; - - if (orient === ARROW_LEFT || orient === ARROW_RIGHT) { - let start = 0; - let diff = boxHeight / 2; - const plotBottom = dim.y + dim.height; - const boxBottom = y + boxHeight; - - if (dim.y > y) { - start = dim.y - y; - diff = (plotBottom >= boxBottom ? (boxBottom - dim.y) : dim.height) / 2; - } else if (boxBottom > plotBottom) { - diff = Math.abs(y - (dim.y + dim.height)) / 2; - } - arrowPos = start + diff - arrowWidth / 2; - } else { - let start = 0; - let diff = boxWidth / 2; - const plotRight = dim.x + dim.width; - const boxRight = x + boxWidth; - - if (dim.x > x) { - start = dim.x - x; - diff = (plotRight >= boxRight ? (boxRight - dim.x) : dim.width) / 2; - } else if (boxRight > plotRight) { - diff = Math.abs(x - (dim.x + dim.width)) / 2; - } - arrowPos = start + diff - arrowWidth / 2; - } - return arrowPos; -}; - -/** - * Places the arrow in the specified arrow position. It also applies appropriate arrow - * class name to the arrow element. - * @param {string} position Left, bottom or right position of the arrow; - * @param {number} arrowPos position of arrow in pixels - * @return {Tooltip} Instance of tooltip. - */ -export const placeArrow = (context, position, arrowPos) => { - const tooltipArrow = context._tooltipArrow; - const tooltipBackground = context._tooltipBackground; - const config = context._config; - const classPrefix = config.classPrefix; - const arrowConf = config.arrow; - const className = getQualifiedClassName(arrowConf.defClassName, context._id, config.classPrefix); - - tooltipArrow.style('display', 'block'); - tooltipArrow.attr('class', `${className.join(' ')}`); - if (position === TOOLTIP_LEFT || position === TOOLTIP_RIGHT) { - tooltipArrow.style('top', `${arrowPos}px`); - tooltipArrow.style('left', ''); - tooltipBackground.style('top', `${arrowPos}px`); - tooltipBackground.style('left', ''); - } else { - position === TOOLTIP_BOTTOM ? tooltipArrow.style('top', '100%') : tooltipArrow.style('top', - `-${arrowConf.size}px`); - tooltipArrow.style('left', `${arrowPos}px`); - position === TOOLTIP_BOTTOM ? tooltipBackground.style('top', '100%') : tooltipBackground.style('top', - `-${arrowConf.size + 3}px`); - tooltipBackground.style('left', `${arrowPos}px`); - } - tooltipArrow.classed(`${classPrefix}-tooltip-arrow`, true); - tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${context._arrowOrientation}`, false); - tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${position}`, true); - tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow`, true); - tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${context._arrowOrientation}`, false); - tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${position}`, true); - return this; -}; - export const reorderContainers = (parentContainer, className) => { parentContainer.selectAll(className).sort((a, b) => a - b); }; diff --git a/packages/muze-tooltip/src/styles.scss b/packages/muze-tooltip/src/styles.scss index d9718ad8..587013c4 100644 --- a/packages/muze-tooltip/src/styles.scss +++ b/packages/muze-tooltip/src/styles.scss @@ -1,7 +1,7 @@ @import './prefix.scss'; .#{$prefix}tooltip-box { - opacity: 0.9; + opacity: 1; border: 1px solid rgba(151,151,151,.19); background: #fbfbfb; box-shadow: 2px 2px 3px 0px rgba(211,211,211,.5); @@ -20,17 +20,50 @@ padding-top: 2px; overflow: auto; } + +.#{$prefix}tooltip-parent-container { + pointer-events: none; + z-index: 9999999999; +} + +.#{$prefix}tooltip-stacked-row{ + color:#828282; + margin-left: 10px; + font-size: 12px ; + font-weight: 600; + line-height: '15px' +} + +.#{$prefix}tooltip-stacked-row-key{ + margin-left: 10px; +} + +.#{$prefix}tooltip-stacked-row-value{ + margin-left: 2px; +} + +.#{$prefix}tooltip-stacked-percentage{ + font-size: 10px; + color:#828282; + margin-left: -20px; + margin-right: 20px; + float: right; + line-height: 17px; +} .#{$prefix}tooltip-selected-row{ background-color:#ebebeb } + .#{$prefix}tooltip-row:last-child{ padding-bottom: 4px; } + .#{$prefix}tooltip-value{ color:#5F5F5F; float: right; margin-left: 10px; } + .#{$prefix}tooltip-connectors path { stroke-width: 2px; stroke: #c7c7be; @@ -38,66 +71,6 @@ stroke-linecap: round; } -.#{$prefix}tooltip-arrow-bottom { - border-top: 10px solid #fbfbfb; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - right: 0; -}; -.#{$prefix}tooltip-arrow-right { - border-left: 10px solid #fbfbfb; - border-top: 5px solid transparent; - border-bottom: 5px solid transparent; - // left: 0; - right: -10px; -}; -.#{$prefix}tooltip-arrow-left { - border-right: 10px solid #fbfbfb; - border-top: 5px solid transparent; - border-bottom: 5px solid transparent; - right: 0; - left: -10px; -}; -.#{$prefix}tooltip-arrow-top { - border-bottom: 10px solid #fbfbfb; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - right: 0; -}; - - -.#{$prefix}tooltip-background-arrow-top { - border-bottom: 12px solid rgba(151,151,151,.19); - border-left: 6px solid transparent; - border-right: 6px solid transparent; - top: 0%; - right: 0; -}; -.#{$prefix}tooltip-background-arrow-bottom { - border-top: 12px solid rgba(151,151,151,.19); - border-left: 6px solid transparent; - border-right: 6px solid transparent; - top: 102%; - right: 0; -}; -.#{$prefix}tooltip-background-arrow-right { - border-left: 12px solid rgba(151,151,151,.19); - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - // left: 0; - right: -12px; -}; -.#{$prefix}tooltip-background-arrow-left { - border-right: 12px solid rgba(151,151,151,.19); - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - right: 0; - left: -12px; -}; - -.#{$prefix}tooltip-content-container { - float: none !important; -} .#{$prefix}tooltip-html-container { margin-left: 10px; margin-right: 10px; @@ -110,13 +83,6 @@ } } -.#{$prefix}tooltip-content-container-selectionSummary{ - .#{$prefix}tooltip-content { - margin-left: 3px; - margin-right: 3px; - } -} - .#{$prefix}tooltip-value { margin-right: 24px; margin-left: 24px; diff --git a/packages/muze-tooltip/src/tooltip.js b/packages/muze-tooltip/src/tooltip.js index b0476a08..7d8d5eea 100644 --- a/packages/muze-tooltip/src/tooltip.js +++ b/packages/muze-tooltip/src/tooltip.js @@ -3,13 +3,13 @@ import { getQualifiedClassName, getUniqueId, selectElement, - setStyles, - makeElement + makeElement, + getMaxPoint } from 'muze-utils'; -import { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM, TOOLTIP_TOP, - INITIAL_STYLE } from './constants'; +import { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM, + TOOLTIP_TOP } from './constants'; import { defaultConfig } from './default-config'; -import { getArrowPos, placeArrow, reorderContainers } from './helper'; +import { reorderContainers } from './helper'; import './styles.scss'; import Content from './content'; @@ -35,25 +35,23 @@ export default class Tooltip { const container = makeElement(htmlContainer, 'div', [1], `${classPrefix}-tooltip-container`); this._container = container; this._tooltipContainer = container.append('div').style('position', 'absolute'); - this._contentContainer = this._tooltipContainer.append('div').attr('class', `${classPrefix}-${contentClass}`); - this._tooltipBackground = this._tooltipContainer.append('div').style('position', 'relative'); - this._tooltipArrow = this._tooltipContainer.append('div'); + this._contentContainer = this._tooltipContainer.append('div').attr('class', + `${classPrefix}-${tooltipConf.defClassName} ${classPrefix}-${contentClass} + ${tooltipConf.className}`); if (!svgContainer) { connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none'); } + this._contents = {}; this._tooltipConnectorContainer = selectElement(connectorContainer) .append('g') .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`); const id = this._id; - const defClassName = tooltipConf.defClassName; + const defClassName = tooltipConf.parentClassName; const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix); - setStyles(this._tooltipArrow, INITIAL_STYLE); - setStyles(this._tooltipBackground, INITIAL_STYLE); this.addClass(qualifiedClassName.join(' ')); - this.addClass(tooltipConf.className); this.hide(); } @@ -101,10 +99,11 @@ export default class Tooltip { const { classPrefix } = config; const contentClass = config.content.className; const formatter = config.formatter; - const className = contentConfig.className || `${classPrefix}-${contentClass}-${name}`; + const className = `${classPrefix}-${contentClass}-${name}`; + const specificClass = `${classPrefix}-${contentConfig.className}`; const content = this._contents[name] = this._contents[name] || new Content(); const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className); - container.attr('class', `${classPrefix}-${contentClass} ${className}`); + container.attr('class', `${classPrefix}-${contentClass} ${className} ${specificClass}`); reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`); const contentConf = config.content; contentConfig.classPrefix = this._config.classPrefix; @@ -139,55 +138,39 @@ export default class Tooltip { * @param {number} y y position * @return {Tooltip} Instance of tooltip. */ - position (x, y, conf = {}) { + position (x, y) { if (!Object.keys(this._contents).length) { this.hide(); return this; } this.show(); const target = this._target; - const repositionArrow = conf.repositionArrow; - if (target && repositionArrow) { + if (target) { const node = this._tooltipContainer.node(); - const config = this._config; - const arrowDisabled = config.arrow.disabled; - const arrowWidth = arrowDisabled ? 0 : config.arrow.size; - const arrowOrient = this._arrowOrientation; - const outsidePlot = arrowOrient === ARROW_LEFT || arrowOrient === ARROW_RIGHT ? - (y + node.offsetHeight - arrowWidth) < target.y || y > (target.y + target.height) : - (x + node.offsetWidth - arrowWidth) < target.x || x > (target.x + target.width); - - if (!arrowDisabled) { - if (outsidePlot) { - let path; - this._tooltipArrow.style('display', 'none'); - this._tooltipBackground.style('display', 'none'); - this._tooltipConnectorContainer.style('display', 'block'); - const connector = this._tooltipConnectorContainer.selectAll('path').data([1]); - const enter = connector.enter().append('path'); - if (arrowOrient === ARROW_LEFT) { - path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}` - + ` ${target.y + target.height / 2}`; - } else if (arrowOrient === ARROW_RIGHT) { - path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}` - + ` L ${target.x} ${target.y + target.height / 2}`; - } else if (arrowOrient === ARROW_BOTTOM) { - path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}` - + ` L ${target.x + target.width / 2} ${target.y}`; - } - enter.merge(connector).attr('d', path).style('display', 'block'); - } else { - const arrowPos = getArrowPos(arrowOrient, target, { - x, - y, - boxHeight: node.offsetHeight, - boxWidth: node.offsetWidth - }, this._config); - - placeArrow(this, this._arrowOrientation, arrowPos); - this._tooltipConnectorContainer.style('display', 'none'); + const tooltipPos = this._orientation; + const outsidePlot = tooltipPos === TOOLTIP_LEFT || tooltipPos === TOOLTIP_RIGHT ? + (y + node.offsetHeight) < target.y || y > (target.y + target.height) : + (x + node.offsetWidth) < target.x || x > (target.x + target.width); + + if (outsidePlot) { + let path; + this._tooltipConnectorContainer.style('display', 'block'); + const connector = this._tooltipConnectorContainer.selectAll('path').data([1]); + const enter = connector.enter().append('path'); + if (tooltipPos === ARROW_LEFT) { + path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}` + + ` ${target.y + target.height / 2}`; + } else if (tooltipPos === ARROW_RIGHT) { + path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}` + + ` L ${target.x} ${target.y + target.height / 2}`; + } else if (tooltipPos === ARROW_BOTTOM) { + path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}` + + ` L ${target.x + target.width / 2} ${target.y}`; } + enter.merge(connector).attr('d', path).style('display', 'block'); + } else { + this._tooltipConnectorContainer.style('display', 'none'); } } @@ -208,7 +191,7 @@ export default class Tooltip { */ positionRelativeTo (dim, tooltipConf = {}) { let obj; - let orientation = tooltipConf.orientation; + const orientation = tooltipConf.orientation; this.show(); if (!dim) { this.hide(); @@ -216,62 +199,68 @@ export default class Tooltip { } const extent = this._extent; - const node = this._tooltipContainer.node(); - + const contentContainer = this._contentContainer.node(); this._tooltipContainer.style('top', '0px') - .style('left', '0px'); - const offsetWidth = node.offsetWidth + 2; - const offsetHeight = node.offsetHeight + 2; + .style('left', '0px') + .style('width', '2000px') + .style('height', '2000px'); + + const offsetWidth = contentContainer.offsetWidth + 4; + const offsetHeight = contentContainer.offsetHeight + 4; const config = this._config; const offset = this._offset; - const arrowDisabled = config.arrow.disabled; - const arrowSize = arrowDisabled ? 0 : config.arrow.size; + const spacing = config.spacing; const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true; const topSpace = dim.y; // When there is no space in right const dimX = dim.x + dim.width + offset.x; const rightSpace = extent.width - dimX; const leftSpace = dim.x + offset.x - extent.x; - const positionTop = topSpace > (offsetHeight + arrowSize); - const positionRight = rightSpace >= offsetWidth + arrowSize; - const positionLeft = leftSpace >= offsetWidth + arrowSize; - - const positionHorizontal = () => { + const bottomSpace = extent.height - (dim.y + dim.height + offset.y); + const arrowSize = spacing; + const tooltipHeight = offsetHeight + arrowSize; + const tooltipWidth = offsetWidth + arrowSize; + + const spaces = [{ + position: 'top', + value: topSpace - tooltipHeight + }, { + position: 'right', + value: rightSpace - tooltipWidth + }, { + position: 'left', + value: leftSpace - tooltipWidth + }, { + position: 'bottom', + value: bottomSpace - tooltipHeight + }]; + + const positionHorizontal = (positionVal) => { let position; let x = dim.x + dim.width; let y = dim.y; - if (positionRight) { + if (positionVal === 'right') { position = TOOLTIP_LEFT; x += arrowSize; - } else if (positionLeft) { + } else if (positionVal === 'left') { x = dim.x - offsetWidth; position = TOOLTIP_RIGHT; x -= arrowSize; - } else { - position = 'left'; - x += arrowSize; } + if (dim.height < offsetHeight) { y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2); } - const arrowPos = getArrowPos(position, dim, { - x, - y, - boxHeight: offsetHeight, - boxWidth: offsetWidth - }, this._config); - return { position, - arrowPos, x, y }; }; - const positionVertical = () => { + const positionVertical = (positionVal) => { let position; let y; // Position tooltip at the center of plot @@ -284,7 +273,7 @@ export default class Tooltip { x = extent.x; } - if (positionTop) { + if (positionVal === 'top') { y = dim.y - offsetHeight - arrowSize; position = TOOLTIP_BOTTOM; } else { @@ -292,36 +281,33 @@ export default class Tooltip { position = TOOLTIP_TOP; } - const arrowPos = getArrowPos(position, dim, { - x, - y, - boxHeight: offsetHeight, - boxWidth: offsetWidth - }, this._config); - return { position, - arrowPos, x, y }; }; this._target = dim; + + const hMax = getMaxPoint(spaces.filter(d => d.position === 'left' || d.position === 'right'), + 'value'); + const vMax = getMaxPoint(spaces.filter(d => d.position === 'top' || d.position === 'bottom'), + 'value'); if (!orientation) { - if (positionTop) { - orientation = 'vertical'; - } else if (positionRight || positionLeft) { - orientation = 'horizontal'; + if (hMax.value > 0) { + const position = hMax.position; + obj = positionHorizontal(position); } else { - orientation = 'vertical'; + const position = vMax.position; + obj = positionVertical(position); } - } - - if (orientation === 'horizontal') { - obj = positionHorizontal(); - } else if (orientation === 'vertical') { - obj = positionVertical(); + } else if (orientation === 'horizontal') { + const position = hMax.position; + obj = positionHorizontal(position); + } else { + const position = vMax.position; + obj = positionVertical(position); } this._position = { @@ -329,14 +315,9 @@ export default class Tooltip { y: obj.y }; - this._arrowPos = obj.arrowPos; - if (!arrowDisabled) { - placeArrow(this, obj.position, obj.arrowPos); - } else { - this._tooltipArrow.style('display', 'none'); - this._tooltipBackground.style('display', 'none'); - } - this._arrowOrientation = obj.position; + this._tooltipContainer.style('height', `${offsetHeight}px`) + .style('width', `${offsetWidth}px`); + this._orientation = obj.position; draw && this.position(obj.x, obj.y); return this; } @@ -372,7 +353,6 @@ export default class Tooltip { remove () { this._tooltipContainer.remove(); - this._tooltipBackground.remove(); this._tooltipConnectorContainer.remove(); return this; } diff --git a/packages/muze-utils/package.json b/packages/muze-utils/package.json index f53d6407..0a0dc868 100644 --- a/packages/muze-utils/package.json +++ b/packages/muze-utils/package.json @@ -56,7 +56,7 @@ "d3-time": "^1.0.11", "d3-transition": "^1.1.1", "d3-voronoi": "^1.1.2", - "datamodel": "^2.2.2", + "datamodel": "^2.3.0", "fusioncharts-smartlabel": "^1.0.2", "hyperdis": "^1.0.1" } diff --git a/packages/muze-utils/src/common-utils.js b/packages/muze-utils/src/common-utils.js index bb363595..9a11ebfd 100644 --- a/packages/muze-utils/src/common-utils.js +++ b/packages/muze-utils/src/common-utils.js @@ -1,5 +1,6 @@ /* global window, requestAnimationFrame, cancelAnimationFrame */ import { FieldType, DimensionSubtype, DateTimeFormatter, DM_DERIVATIVES, default as DataModel } from 'datamodel'; + import { axisLeft, axisRight, @@ -52,13 +53,14 @@ import { easeElastic } from 'd3-ease'; import { - color, - rgb, - hsl + color, + rgb, + hsl } from 'd3-color'; import { voronoi } from 'd3-voronoi'; import { dataSelect } from './DataSystem'; -import { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING } from './enums'; +import * as scales from './scales'; +import { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING, ReservedFields } from './enums'; import * as STACK_CONFIG from './enums/stack-config'; const { CATEGORICAL, TEMPORAL } = DimensionSubtype; @@ -168,6 +170,7 @@ const getDomainFromData = (data, fields, fieldType) => { let domain; const domArr = []; data = data[0] instanceof Array ? data : [data]; + switch (fieldType) { case CATEGORICAL: domain = [].concat(...data.map(arr => arr.map(d => d[fields[0]]).filter(d => d !== undefined))); @@ -360,7 +363,13 @@ const capitalizeFirst = (text) => { * * @param {*} arr */ -const unique = arr => ([...new Set(arr)]); +const unique = (arr, fn = d => d) => { + const vals = arr.reduce((acc, v) => { + acc[fn(v)] = v; + return acc; + }, {}); + return Object.values(vals); +}; /** * Gets the minimum difference between two consecutive numbers in an array. @@ -776,17 +785,17 @@ function hue2rgb (p, q, t) { return p; } - /** - * Converts an HSL color value to RGB. Conversion formula - * adapted from http://en.wikipedia.org/wiki/HSL_color_space. - * Assumes h, s, and l are contained in the set [0, 1] and - * returns r, g, and b in the set [0, 255]. - * - * @param Number h The hue - * @param Number s The saturation - * @param Number l The lightness - * @return Array The RGB representation - */ +/** + * Converts an HSL color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes h, s, and l are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + * + * @param Number h The hue + * @param Number s The saturation + * @param Number l The lightness + * @return Array The RGB representation + */ const hslToRgb = (h, s, l, a = 1) => { let r; let g; @@ -806,17 +815,17 @@ const hslToRgb = (h, s, l, a = 1) => { return [r * 255, g * 255, b * 255, a]; }; - /** - * Converts an RGB color value to HSV. Conversion formula - * adapted from http://en.wikipedia.org/wiki/HSV_color_space. - * Assumes r, g, and b are contained in the set [0, 255] and - * returns h, s, and v in the set [0, 1]. - * - * @param Number r The red color value - * @param Number g The green color value - * @param Number b The blue color value - * @return Array The HSV representation - */ +/** + * Converts an RGB color value to HSV. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSV_color_space. + * Assumes r, g, and b are contained in the set [0, 255] and + * returns h, s, and v in the set [0, 1]. + * + * @param Number r The red color value + * @param Number g The green color value + * @param Number b The blue color value + * @return Array The HSV representation + */ const rgbToHsv = (r, g, b, a = 1) => { r = +r; g = +g; b = +b; a = +a; r /= 255; g /= 255; b /= 255; @@ -842,17 +851,17 @@ const rgbToHsv = (r, g, b, a = 1) => { return [h, s, l, a]; }; - /** - * Converts an HSV color value to RGB. Conversion formula - * adapted from http://en.wikipedia.org/wiki/HSV_color_space. - * Assumes h, s, and v are contained in the set [0, 1] and - * returns r, g, and b in the set [0, 255]. - * - * @param Number h The hue - * @param Number s The saturation - * @param Number v The value - * @return Array The RGB representation - */ +/** + * Converts an HSV color value to RGB. Conversion formula + * adapted from http://en.wikipedia.org/wiki/HSV_color_space. + * Assumes h, s, and v are contained in the set [0, 1] and + * returns r, g, and b in the set [0, 255]. + * + * @param Number h The hue + * @param Number s The saturation + * @param Number v The value + * @return Array The RGB representation + */ const hsvToRgb = (h, s, v, a = 1) => { let r; let g; @@ -885,14 +894,26 @@ const hexToHsv = (hex) => { return result ? rgbToHsv(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : ''; }; +const RGBAtoRGB = (r, g, b, a, r2 = 255, g2 = 255, b2 = 255) => { + const r3 = Math.round(((1 - a) * r2) + (a * r)); + const g3 = Math.round(((1 - a) * g2) + (a * g)); + const b3 = Math.round(((1 - a) * b2) + (a * b)); + return `rgb(${r3},${g3},${b3})`; +}; + +const hslaToRgb = (h, s, l, a) => { + const [r, g, b, a1] = hslToRgb(h, s, l, a); + return RGBAtoRGB(r, g, b, a1); +}; + const detectColor = (col) => { const matchRgb = /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/; const matchHsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g; // Source : https://gist.github.com/sethlopezme/d072b945969a3cc2cc11 - // eslint-disable-next-line + // eslint-disable-next-line const matchRgba = /rgba?\(((25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,\s*?){2}(25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,?\s*([01]\.?\d*?)?\)/; - // eslint-disable-next-line + // eslint-disable-next-line const matchHsla = /^hsla\(([\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/; const matchHex = /^#([0-9a-f]{3}){1,2}$/i; @@ -905,6 +926,51 @@ const detectColor = (col) => { } return col; }; +function RGBAToHexA (rgba) { + const sep = rgba.indexOf(',') > -1 ? ',' : ' '; + rgba = rgba.substr(5).split(')')[0].split(sep); + + // Strip the slash if using space-separated syntax + if (rgba.indexOf('/') > -1) { rgba.splice(3, 1); } + + for (const R in rgba) { + const r = rgba[R]; + if (r.indexOf('%') > -1) { + const p = r.substr(0, r.length - 1) / 100; + + if (R < 3) { + rgba[R] = Math.round(p * 255); + } else { + rgba[R] = p; + } + } + } + + let r = (+rgba[0]).toString(16); + let g = (+rgba[1]).toString(16); + let b = (+rgba[2]).toString(16); + let a = Math.round(+rgba[3] * 255).toString(16); + + if (r.length === 1) { r = `0${r}`; } + if (g.length === 1) { g = `0${g}`; } + if (b.length === 1) { b = `0${b}`; } + if (a.length === 1) { a = `0${a}`; } + + return `#${r}${g}${b}${a}`; +} + +const transformToHex = (datumStyle, colorType) => { + if (colorType === 'rgb') { + const [r, g, b, a] = datumStyle.replace(/[^\d,]/g, '').split(','); + const aa = a || 1; + + const rgbaString = `rgba(${r}, ${g}, ${b}, ${aa})`; + return RGBAToHexA(rgbaString); + } + // Add methods to handle hsl and hex conversion + return null; +}; + const assembleModelFromIdentifiers = (model, identifiers) => { let schema = []; let data; @@ -945,18 +1011,24 @@ const assembleModelFromIdentifiers = (model, identifiers) => { * @param {*} criteria * */ -const getDataModelFromRange = (dataModel, criteria, mode) => { - if (criteria === null) { - return null; - } - const selFields = Object.keys(criteria); +const getDataModelFromRange = (dataModel, criteria, mode, criteriaFields) => { + if (criteria === null) return null; + const fieldsConfig = dataModel.getFieldsConfig(); + const selFields = criteriaFields || Object.keys(criteria).filter(d => d in fieldsConfig); const selFn = fields => selFields.every((field) => { - const val = fields[field].internalValue; + const fieldValue = fields[field].internalValue; const range = criteria[field][0] instanceof Array ? criteria[field][0] : criteria[field]; + if (typeof range[0] === STRING) { - return range.find(d => d === val) !== undefined; + return range.find(d => d === fieldValue) !== undefined; } - return range ? val >= range[0] && val <= range[1] : true; + + if (range) { + // Check if the selected bar value lies insid e the selection box + return fieldValue >= range[0] && fieldValue <= range[1]; + } + + return false; }); return dataModel.select(selFn, { @@ -965,6 +1037,10 @@ const getDataModelFromRange = (dataModel, criteria, mode) => { }); }; +const getArrayIndexMap = arr => arr.reduce((acc, value, i) => { + acc[value] = i; + return acc; +}, {}); /** * * @@ -972,7 +1048,7 @@ const getDataModelFromRange = (dataModel, criteria, mode) => { * @param {*} identifiers * */ -const getDataModelFromIdentifiers = (dataModel, identifiers, mode) => { +const getDataModelFromIdentifiers = (dataModel, identifiers, mode, hasBarLayer) => { let filteredDataModel; if (identifiers instanceof Array) { const fieldsConfig = dataModel.getFieldsConfig(); @@ -981,11 +1057,11 @@ const getDataModelFromIdentifiers = (dataModel, identifiers, mode) => { if (identifiers instanceof Function) { filteredDataModel = identifiers(dataModel, {}, false); } else if (identifiers instanceof Array && identifiers[0].length) { - const filteredSchema = identifiers[0].filter(d => d in fieldsConfig); - filteredDataModel = dataModel.select((fields) => { + const filteredSchema = identifiers[0].filter(d => d in fieldsConfig || d === ReservedFields.ROW_ID); + filteredDataModel = dataModel.select((fields, rowId) => { let include = true; filteredSchema.forEach((propField, idx) => { - const value = fields[propField].internalValue; + const value = propField === ReservedFields.ROW_ID ? rowId : fields[propField].internalValue; const index = dataArr.findIndex(d => d[idx] === value); include = include && index !== -1; }); @@ -1001,7 +1077,7 @@ const getDataModelFromIdentifiers = (dataModel, identifiers, mode) => { }); } } else { - filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode); + filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode, hasBarLayer); } return filteredDataModel; }; @@ -1106,14 +1182,16 @@ const concatModels = (dm1, dm2) => { } else { const dm1Key = dim1Values.join(); const dm2Key = dim2Values.join(); - if (!commonTuples[dm1Key] && !commonTuples[dm2Key]) { - !tuples1[dm1Key] && (tuples1[dm1Key] = {}); - !tuples2[dm2Key] && (tuples2[dm2Key] = {}); + if (!commonTuples[dm1Key]) { + !commonTuples[dm1Key] && (commonTuples[dm1Key] = {}); row1.forEach((value, idx) => { - tuples1[dm1Key][schema1[idx].name] = value; + commonTuples[dm1Key][schema1[idx].name] = value; }); + } + if (!commonTuples[dm2Key]) { + !commonTuples[dm2Key] && (commonTuples[dm2Key] = {}); row2.forEach((value, idx) => { - tuples2[dm2Key][schema2[idx].name] = value; + commonTuples[dm2Key][schema2[idx].name] = value; }); } } @@ -1141,7 +1219,7 @@ const stackOffsets = { // eslint-disable-next-line require-jsdoc const stack = params => d3Stack().keys(params.keys).offset(stackOffsets[params.offset]) - .order(stackOrders[params.order])(params.data); + .order(stackOrders[params.order])(params.data); /** * Groups the data into a hierarchical tree structure based on one or more fields. @@ -1156,6 +1234,14 @@ const nestCollection = (params) => { return nestFn.entries(params.data); }; +/** + * Returns array difference, elements in array A, not in Array B + * @param { Array. } arr Data which needs to be grouped + * @param { Array. } arr1 Field indices by which the data will be grouped + * @return { Array. } Returns the array difference (A - B) + */ +const getArrayDiff = (arr, arr1) => arr.filter(el => arr1.indexOf(el) < 0); + const pathInterpolators = { curveLinear, curveStepAfter, @@ -1294,12 +1380,19 @@ const nearestSortingDetails = (dataModel) => { return nearestSortDerivation ? nearestSortDerivation.criteria : null; }; +const sortingOrder = (a, b) => { + const sortOrder = !(a instanceof InvalidAwareTypes || a instanceof InvalidAwareTypes) + ? a.localeCompare(b) + : 1; + return sortOrder; +}; + /** * Map containing key, value sortingOrder pairs */ const sortOrderMap = { - [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => firstVal.localeCompare(secondVal), - [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => secondVal.localeCompare(firstVal) + [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => sortingOrder(firstVal, secondVal), + [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => sortingOrder(secondVal, firstVal) }; /** @@ -1327,22 +1420,203 @@ const intersect = (arr1, arr2, accessors = [v => v, v => v]) => { return arr1.filter(value => set.has(fn1(value))); }; +const difference = (arr1, arr2, accessors = [v => v, v => v]) => { + const [fn1, fn2] = accessors; + const set = new Set(arr2.map(v => fn2(v))); + return arr1.filter(value => !set.has(fn1(value))); +}; + +const partition = (array, filterFn) => array.reduce((acc, v, i) => { + const pass = filterFn(v, i, array); + + pass ? acc[0].push(v) : acc[1].push(v); + return acc; +}, [[], []]); + +const mix = superclass => ({ + with: (...mixins) => mixins.reduce((cls, mixin) => mixin(cls), superclass) +}); + +const componentRegistry = (comps) => { + const reg = Object.assign({}, comps); + const regObj = { + register: (def, customKey) => { + const key = customKey || def.formalName(); + + reg[key] = def; + return regObj; + }, + get: () => reg + }; + + return regObj; +}; + +const getReadableTicks = (domain, steps) => { + // scaling the axis based on steps provided + const orderedDomain = [Math.min(...domain), Math.max(...domain)]; + if (steps < 3) { + return orderedDomain; + } + + const tempScale = scales.scaleQuantize().domain(orderedDomain).nice(); + let tempAxis = null; + let legendTicks = null; + + tempAxis = Symbols.axisBottom().scale(tempScale); + + legendTicks = tempAxis.scale().ticks(steps); + + if (Math.max(...legendTicks) < orderedDomain[1]) { + // legendTicks.pop(); + legendTicks.push(orderedDomain[1]); + } + if (Math.min(...legendTicks) > orderedDomain[0]) { + // legendTicks.shift(); + legendTicks.unshift(orderedDomain[0]); + } + return legendTicks; +}; + +const RGBAToHSLA = (r, g, b, a = 1) => { + // Make r, g, and b fractions of 1 + r /= 255; + g /= 255; + b /= 255; + + // Find greatest and smallest channel values + const cmin = Math.min(r, g, b); + const cmax = Math.max(r, g, b); + const delta = cmax - cmin; + let h = 0; + let s = 0; + let l = 0; + + // Calculate hue + // No difference + if (delta === 0) { + h = 0; + } else if (cmax === r) { + // Red is max + h = ((g - b) / delta) % 6; + } else if (cmax === g) { + // Green is max + h = (b - r) / delta + 2; + } else { + // Blue is max + h = (r - g) / delta + 4; + } + h = Math.round(h * 60); + + // Make negative hues positive behind 360° + if (h < 0) { h += 360; } + // Calculate lightness + l = (cmax + cmin) / 2; + // Calculate saturation + s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)); + // Multiply l and s by 100 + s = +(s * 100).toFixed(1); + l = +(l * 100).toFixed(1); + + return { + color: `hsla(${h},${s}%,${l}%,${a})`, + code: [h, s, l, a] + }; +}; + +const transformColor = (rgbaValues, { h = 0, s = 0, l = 0, a }, datum, apply) => { + const [origH, origS, origL, origA] = RGBAToHSLA(...rgbaValues).code; + const sanitizedA = parseFloat(a || origA, 10); + const newH = origH + h; + const newS = origS + s; + const newL = origL + l; + let newA = sanitizedA + 1; + + if (!apply) { + newA = sanitizedA - 1; + } + + const finalcolor = { + color: `hsla(${newH},${newS}%,${newL}%,${newA})`, + hsla: [newH, newS, newL, newA] + }; + return finalcolor; +}; + +const pointWithinCircle = (c, point) => { + const { x: cx, y: cy, r } = c; + const { x, y } = point; + + const dist = Math.sqrt((cx - x) ** 2 + (cy - y) ** 2); + return dist <= r; +}; + +/** + * Generates a function which performs an intersection (dataModel select) + * operation for multiple fields + * @param {Array} targetData - Nested array with field and values in the format: + * [ + * [field1, field2] + * [val1, val2] + * ] + * @param {Object} dm - The dataModel instance + * @return {Function} filter function + */ +const dmMultipleSelection = (targetData, dm) => { + const targetFields = targetData[0]; + const targetVals = targetData.slice(1, targetData.length); + const payloadMap = targetVals.reduce((acc, v) => { + acc[v] = v; + return acc; + }, {}); + const measures = Object.keys(dm.getFieldspace().getMeasure()); + + const filterFn = (fields, i) => { + const row = `${targetFields.map((field) => { + let val; + if (field === ReservedFields.MEASURE_NAMES) { + val = measures; + } else if (field === ReservedFields.ROW_ID) { + val = i; + } else { + const currentField = fields[field]; + const isFieldInvalid = currentField instanceof InvalidAwareTypes; + + val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue; + } + return val; + })}`; + return row in payloadMap; + }; + return filterFn; +}; + export { + arraysEqual, + componentRegistry, + mix, + partition, + getArrayIndexMap, getValueParser, require, intersect, + difference, Scales, Symbols, pathInterpolators, stack, nestCollection, + getArrayDiff, getSymbol, + transformColor, transformColors, detectColor, hexToHsv, hslToRgb, rgbToHsv, + transformToHex, hsvToRgb, + hslaToRgb, concatModels, toArray, angleToRadian, @@ -1368,6 +1642,7 @@ export { unionDomain, symbolFns, easeFns, + unique, clone, isEqual, interpolateArray, @@ -1405,5 +1680,8 @@ export { temporalFields, retrieveFieldDisplayName, sanitizeDomainWhenEqual, - sortCategoricalField + sortCategoricalField, + getReadableTicks, + dmMultipleSelection, + pointWithinCircle }; diff --git a/packages/muze-utils/src/enums/reserved-fields.js b/packages/muze-utils/src/enums/reserved-fields.js index 21e5de38..202b7984 100644 --- a/packages/muze-utils/src/enums/reserved-fields.js +++ b/packages/muze-utils/src/enums/reserved-fields.js @@ -1,5 +1,6 @@ const ReservedFields = { - ROW_ID: '__id__' + ROW_ID: '__id__', + MEASURE_NAMES: '__measure_names__' }; export default ReservedFields; diff --git a/packages/muze-utils/src/index.js b/packages/muze-utils/src/index.js index 089a3e61..3f463224 100644 --- a/packages/muze-utils/src/index.js +++ b/packages/muze-utils/src/index.js @@ -2,6 +2,7 @@ import { default as DataModel } from 'datamodel'; import * as scales from './scales'; import * as colorSchemes from './color-schemes'; import * as STATE_NAMESPACES from './enums/namespace'; +import RTree from './r-tree'; const InvalidAwareTypes = DataModel.InvalidAwareTypes; @@ -26,12 +27,14 @@ export { export { getNearestValue, getValueParser, + transformColor, transformColors, detectColor, hslToRgb, rgbToHsv, hexToHsv, hsvToRgb, + hslaToRgb, escapeHTML, angleToRadian, generateGetterSetters, @@ -101,7 +104,18 @@ export { retrieveFieldDisplayName, sanitizeDomainWhenEqual, sortCategoricalField, - intersect + intersect, + partition, + mix, + componentRegistry, + getArrayDiff, + difference, + getArrayIndexMap, + arraysEqual, + getReadableTicks, + unique, + dmMultipleSelection, + pointWithinCircle } from './common-utils'; export { @@ -155,3 +169,7 @@ export { GROUP_BY_FUNCTIONS } from 'datamodel'; +export { + RTree +}; + diff --git a/packages/muze-utils/src/quick-select.js b/packages/muze-utils/src/quick-select.js new file mode 100644 index 00000000..85d5649b --- /dev/null +++ b/packages/muze-utils/src/quick-select.js @@ -0,0 +1,78 @@ +const swap = (arr, i, j) => { + const tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +}; + +const defaultCompare = (a, b) => { + if (a > b) { + return -1; + } + return a > b ? 1 : 0; +}; + +const quickselectStep = (arr, k, left, right, compare) => { + while (right > left) { + if (right - left > 600) { + const n = right - left + 1; + const m = k - left + 1; + const z = Math.log(n); + const s = 0.5 * Math.exp(2 * z / 3); + const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + const newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + quickselectStep(arr, k, newLeft, newRight, compare); + } + + const t = arr[k]; + let i = left; + let j = right; + + swap(arr, left, k); + if (compare(arr[right], t) > 0) swap(arr, left, right); + + while (i < j) { + swap(arr, i, j); + i++; + j--; + while (compare(arr[i], t) < 0) i++; + while (compare(arr[j], t) > 0) j--; + } + + if (compare(arr[left], t) === 0) swap(arr, left, j); + else { + j++; + swap(arr, j, right); + } + + if (j <= k) left = j + 1; + if (k <= j) right = j - 1; + } +}; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the + * (k - left + 1)-th smallest value in [left, right]. + * array: the array to partially sort (in place) + * k: middle index for partial sorting (as defined above) + * left: left index of the range to sort (0 by default) + * right: right index (last index of the array by default) + * compareFn: compare function + * + * Ref: https://github.com/mourner/quickselect + * Example: + * var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39]; + * quickselect(arr, 8); + * arr is [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95] + * ^^ middle index + * @param {Array} arr the array to partially sort (in place) + * @param {Number} k middle index for partial sorting (as defined above) + * @param {Number} left left index of the range to sort (0 by default) + * @param {Number} right right index (last index of the array by default) + * @param {Function} compare compare function + */ +const quickselect = (arr, k, left, right, compare) => { + quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare); +}; + +export default quickselect; diff --git a/packages/muze-utils/src/r-tree.js b/packages/muze-utils/src/r-tree.js new file mode 100644 index 00000000..e27f71db --- /dev/null +++ b/packages/muze-utils/src/r-tree.js @@ -0,0 +1,472 @@ +import quickselect from './quick-select'; + +const createNode = children => ({ + children, + height: 1, + leaf: true, + minX: Infinity, + minY: Infinity, + maxX: -Infinity, + maxY: -Infinity +}); + +const extend = (a, b) => { + a.minX = Math.min(a.minX, b.minX); + a.minY = Math.min(a.minY, b.minY); + a.maxX = Math.max(a.maxX, b.maxX); + a.maxY = Math.max(a.maxY, b.maxY); + return a; +}; + +// min bounding rectangle of node children from k to p-1 +const distBBox = (node, k, p, toBBox, destNode) => { + if (!destNode) destNode = createNode(null); + destNode.minX = Infinity; + destNode.minY = Infinity; + destNode.maxX = -Infinity; + destNode.maxY = -Infinity; + + for (let i = k; i < p; i++) { + const child = node.children[i]; + extend(destNode, node.leaf ? toBBox(child) : child); + } + + return destNode; +}; + +// calculate node's bbox from bboxes of its children +const calcBBox = (node, toBBox) => { + distBBox(node, 0, node.children.length, toBBox, node); +}; + +const compareNodeMinX = (a, b) => a.minX - b.minX; +const compareNodeMinY = (a, b) => a.minY - b.minY; + +const bboxArea = a => (a.maxX - a.minX) * (a.maxY - a.minY); + +const bboxMargin = a => (a.maxX - a.minX) + (a.maxY - a.minY); + +const enlargedArea = (a, b) => (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) * + (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY)); + +const intersectionArea = (a, b) => { + const minX = Math.max(a.minX, b.minX); + const minY = Math.max(a.minY, b.minY); + const maxX = Math.min(a.maxX, b.maxX); + const maxY = Math.min(a.maxY, b.maxY); + + return Math.max(0, maxX - minX) * + Math.max(0, maxY - minY); +}; + +const contains = (a, b) => a.minX <= b.minX && + a.minY <= b.minY && + b.maxX <= a.maxX && + b.maxY <= a.maxY; + +const intersects = (a, b) => b.minX <= a.maxX && + b.minY <= a.maxY && + b.maxX >= a.minX && + b.maxY >= a.minY; + +const findItem = (item, items, equalsFn) => { + if (!equalsFn) return items.indexOf(item); + + for (let i = 0; i < items.length; i++) { + if (equalsFn(item, items[i])) return i; + } + return -1; +}; + +// sort an array so that items come in groups of n unsorted items, with groups sorted between each other; +// combines selection algorithm with binary divide & conquer approach + +const multiSelect = (arr, left, right, n, compare) => { + const stack = [left, right]; + + while (stack.length) { + right = stack.pop(); + left = stack.pop(); + + if (right - left <= n) continue; + + const mid = left + Math.ceil((right - left) / n / 2) * n; + quickselect(arr, mid, left, right, compare); + + stack.push(left, mid, mid, right); + } +}; + +const all = (node, result) => { + const nodesToSearch = []; + while (node) { + if (node.leaf) result.push(...node.children); + else nodesToSearch.push(...node.children); + + node = nodesToSearch.pop(); + } + return result; +}; + +export default class RTree { + constructor (maxEntries = 9) { + // max entries in a node is 9 by default; min node fill is 40% for best performance + this._maxEntries = Math.max(4, maxEntries); + this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)); + this.clear(); + } + + all () { + return all(this.data, []); + } + + search (bbox) { + let node = this.data; + const result = []; + + if (!intersects(bbox, node)) return result; + + const toBBox = this.toBBox; + const nodesToSearch = []; + + while (node) { + for (const child of node.children) { + const childBBox = node.leaf ? toBBox(child) : child; + + if (intersects(bbox, childBBox)) { + if (node.leaf) result.push(child); + else if (contains(bbox, childBBox)) all(child, result); + else nodesToSearch.push(child); + } + } + + node = nodesToSearch.pop(); + } + + return result; + } + + load (data) { + if (!(data && data.length)) return this; + + if (data.length < this._minEntries) { + for (let i = 0; i < data.length; i++) { + this.insert(data[i]); + } + return this; + } + + // recursively build the tree with the given data from scratch using OMT algorithm + let node = this.build(data.slice(), 0, data.length - 1, 0); + + if (!this.data.children.length) { + // save as is if tree is empty + this.data = node; + } else if (this.data.height === node.height) { + // split root if trees have the same height + this.splitRoot(this.data, node); + } else { + if (this.data.height < node.height) { + // swap trees if inserted one is bigger + const tmpNode = this.data; + this.data = node; + node = tmpNode; + } + + // insert the small tree into the large tree at appropriate level + this.insertSingleItem(node, this.data.height - node.height - 1, true); + } + + return this; + } + + insert (item) { + if (item) this.insertSingleItem(item, this.data.height - 1); + return this; + } + + clear () { + this.data = createNode([]); + return this; + } + + remove (item, equalsFn) { + if (!item) return this; + + let i; + let parent; + let goingUp; + let node = this.data; + const bbox = this.toBBox(item); + const path = []; + const indexes = []; + + // depth-first iterative tree traversal + while (node || path.length) { + if (!node) { // go up + node = path.pop(); + parent = path[path.length - 1]; + i = indexes.pop(); + goingUp = true; + } + + if (node.leaf) { // check current node + const index = findItem(item, node.children, equalsFn); + + if (index !== -1) { + // item found, remove the item and condense tree upwards + node.children.splice(index, 1); + path.push(node); + this.condense(path); + return this; + } + } + + if (!goingUp && !node.leaf && contains(node, bbox)) { // go down + path.push(node); + indexes.push(i); + i = 0; + parent = node; + node = node.children[0]; + } else if (parent) { // go right + i++; + node = parent.children[i]; + goingUp = false; + } else node = null; // nothing found + } + + return this; + } + + toJSON () { return this.data; } + + fromJSON (data) { + this.data = data; + return this; + } + + toBBox (item) { return item; } + + compareMinX (a, b) { return a.minX - b.minX; } + compareMinY (a, b) { return a.minY - b.minY; } + + build (items, left, right, height) { + const N = right - left + 1; + let M = this._maxEntries; + let node; + + if (N <= M) { + // reached leaf level; return leaf + node = createNode(items.slice(left, right + 1)); + calcBBox(node, this.toBBox); + return node; + } + + if (!height) { + // target height of the bulk-loaded tree + height = Math.ceil(Math.log(N) / Math.log(M)); + + // target number of root entries to maximize storage utilization + M = Math.ceil(N / (M ** (height - 1))); + } + + node = createNode([]); + node.leaf = false; + node.height = height; + + // split the items into M mostly square tiles + + const N2 = Math.ceil(N / M); + const N1 = N2 * Math.ceil(Math.sqrt(M)); + + multiSelect(items, left, right, N1, this.compareMinX); + + for (let i = left; i <= right; i += N1) { + const right2 = Math.min(i + N1 - 1, right); + + multiSelect(items, i, right2, N2, this.compareMinY); + + for (let j = i; j <= right2; j += N2) { + const right3 = Math.min(j + N2 - 1, right2); + + // pack each entry recursively + node.children.push(this.build(items, j, right3, height - 1)); + } + } + + calcBBox(node, this.toBBox); + + return node; + } + + chooseSubtree (bbox, node, level, path) { + while (true) { + path.push(node); + + if (node.leaf || path.length - 1 === level) break; + + let minArea = Infinity; + let minEnlargement = Infinity; + let targetNode; + + for (const child of node.children) { + const area = bboxArea(child); + const enlargement = enlargedArea(bbox, child) - area; + + // choose entry with the least area enlargement + if (enlargement < minEnlargement) { + minEnlargement = enlargement; + minArea = area < minArea ? area : minArea; + targetNode = child; + } else if (enlargement === minEnlargement) { + // otherwise choose one with the smallest area + if (area < minArea) { + minArea = area; + targetNode = child; + } + } + } + + node = targetNode || node.children[0]; + } + + return node; + } + + insertSingleItem (item, level, isNode) { + const bbox = isNode ? item : this.toBBox(item); + const insertPath = []; + + // find the best node for accommodating the item, saving all nodes along the path too + const node = this.chooseSubtree(bbox, this.data, level, insertPath); + + // put the item into the node + node.children.push(item); + extend(node, bbox); + + // split on node overflow; propagate upwards if necessary + while (level >= 0) { + if (insertPath[level].children.length > this._maxEntries) { + this.split(insertPath, level); + level--; + } else break; + } + + // adjust bboxes along the insertion path + this.adjustParentBoxes(bbox, insertPath, level); + } + + // split overflowed node into two + split (insertPath, level) { + const node = insertPath[level]; + const M = node.children.length; + const m = this._minEntries; + + this.chooseSplitAxis(node, m, M); + + const splitIndex = this.chooseSplitIndex(node, m, M); + + const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex)); + newNode.height = node.height; + newNode.leaf = node.leaf; + + calcBBox(node, this.toBBox); + calcBBox(newNode, this.toBBox); + + if (level) insertPath[level - 1].children.push(newNode); + else this.splitRoot(node, newNode); + } + + splitRoot (node, newNode) { + // split root node + this.data = createNode([node, newNode]); + this.data.height = node.height + 1; + this.data.leaf = false; + calcBBox(this.data, this.toBBox); + } + + chooseSplitIndex (node, m, M) { + let index; + let minOverlap = Infinity; + let minArea = Infinity; + + for (let i = m; i <= M - m; i++) { + const bbox1 = distBBox(node, 0, i, this.toBBox); + const bbox2 = distBBox(node, i, M, this.toBBox); + + const overlap = intersectionArea(bbox1, bbox2); + const area = bboxArea(bbox1) + bboxArea(bbox2); + + // choose distribution with minimum overlap + if (overlap < minOverlap) { + minOverlap = overlap; + index = i; + + minArea = area < minArea ? area : minArea; + } else if (overlap === minOverlap) { + // otherwise choose distribution with minimum area + if (area < minArea) { + minArea = area; + index = i; + } + } + } + + return index || M - m; + } + + // sorts node children by the best axis for split + chooseSplitAxis (node, m, M) { + const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX; + const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY; + const xMargin = this.allDistMargin(node, m, M, compareMinX); + const yMargin = this.allDistMargin(node, m, M, compareMinY); + + // if total distributions margin value is minimal for x, sort by minX, + // otherwise it's already sorted by minY + if (xMargin < yMargin) node.children.sort(compareMinX); + } + + // total margin of all possible split distributions where each node is at least m full + allDistMargin (node, m, M, compare) { + node.children.sort(compare); + + const toBBox = this.toBBox; + const leftBBox = distBBox(node, 0, m, toBBox); + const rightBBox = distBBox(node, M - m, M, toBBox); + let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox); + + for (let i = m; i < M - m; i++) { + const child = node.children[i]; + extend(leftBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(leftBBox); + } + + for (let i = M - m - 1; i >= m; i--) { + const child = node.children[i]; + extend(rightBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(rightBBox); + } + + return margin; + } + + adjustParentBoxes (bbox, path, level) { + // adjust bboxes along the given tree path + for (let i = level; i >= 0; i--) { + extend(path[i], bbox); + } + } + + condense (path) { + // go through the path, removing empty nodes and updating bboxes + for (let i = path.length - 1, siblings; i >= 0; i--) { + if (path[i].children.length === 0) { + if (i > 0) { + siblings = path[i - 1].children; + siblings.splice(siblings.indexOf(path[i]), 1); + } else this.clear(); + } else calcBBox(path[i], this.toBBox); + } + } +} diff --git a/packages/muze-utils/src/renderer-utils.js b/packages/muze-utils/src/renderer-utils.js index d785ef2f..c94a52f9 100644 --- a/packages/muze-utils/src/renderer-utils.js +++ b/packages/muze-utils/src/renderer-utils.js @@ -191,17 +191,14 @@ const setStyles = (element, styles) => { const createElements = (params) => { const container = select(params.container); let data; - let sel; data = params.data; if (typeof data === 'number') { data = Array(data).fill().map((d, i) => i); } - sel = container.selectAll(params.selector).data(data); - - sel = container.selectAll(params.selector).filter(function () { + const sel = container.selectAll(params.selector).filter(function () { return this.parentNode === container.node(); - }).data(params.data); + }).data(data); const selectionMerge = sel.enter().append(params.append).merge(sel).each(function (d, i) { params.each(d, select(this), i); diff --git a/packages/muze/example/data/iris.cleared.json b/packages/muze/example/data/iris.cleared.json index 6a16eebb..5d6016fa 100644 --- a/packages/muze/example/data/iris.cleared.json +++ b/packages/muze/example/data/iris.cleared.json @@ -5,7 +5,8 @@ "maxValue": 2.5, "meanValue": 1.199333333333334, "quarter": 0.6496666666666671, - "thirdQuarter": 1.849666666666667 + "thirdQuarter": 1.849666666666667, + "outlier": 0.05 }, { "organ": "petalLength", @@ -13,7 +14,8 @@ "maxValue": 6.9, "meanValue": 3.7580000000000027, "quarter": 2.3790000000000013, - "thirdQuarter": 5.3290000000000015 + "thirdQuarter": 5.3290000000000015, + "outlier": 4 }, { "organ": "sepalWidth", @@ -21,7 +23,8 @@ "maxValue": 4.4, "meanValue": 3.057333333333334, "quarter": 2.528666666666667, - "thirdQuarter": 3.7286666666666672 + "thirdQuarter": 3.7286666666666672, + "outlier": 3 }, { "organ": "sepalLength", @@ -29,6 +32,7 @@ "maxValue": 7.9, "meanValue": 5.843333333333335, "quarter": 5.071666666666667, - "thirdQuarter": 6.871666666666668 + "thirdQuarter": 6.871666666666668, + "outlier": 1 } ] \ No newline at end of file diff --git a/packages/muze/example/js/box-plot.js b/packages/muze/example/js/box-plot.js index 8375aa4f..19f16179 100644 --- a/packages/muze/example/js/box-plot.js +++ b/packages/muze/example/js/box-plot.js @@ -49,6 +49,9 @@ layerFactory.composeLayers('boxMark', [ encoding: { x0: 'boxMark.encoding.meanValue', x: 'boxMark.encoding.quarter', + color: { + value: () => 'rgba(30,119,180,0.75)' + } }, transform: { type: 'identity' @@ -64,6 +67,9 @@ layerFactory.composeLayers('boxMark', [ encoding: { x: 'boxMark.encoding.thirdQuarter', x0: 'boxMark.encoding.meanValue', + color: { + value: () => 'rgba(30,119,180,0.35)' + } }, transform: { type: 'identity' @@ -152,6 +158,6 @@ d3.json('../data/iris.cleared.json', (data) => { type: 'identity' }, }]) -.color('organ') +// .color('organ') .mount(document.getElementsByClassName('chart')[0]); }); diff --git a/packages/muze/example/js/reference-lines.js b/packages/muze/example/js/reference-lines.js index a7f91373..90ee943c 100644 --- a/packages/muze/example/js/reference-lines.js +++ b/packages/muze/example/js/reference-lines.js @@ -28,7 +28,8 @@ value: 'line' }, y: 'compositeBar.encoding.y' - } + }, + interactive: false, }, { name: 'averageText', @@ -45,7 +46,8 @@ background: { enabled: true } - }, + }, + interactive: false, positioner: (points, store, layerInst) => { let width = store.visualunit.width(); let smartLabel = layerInst.dependencies().smartLabel; diff --git a/packages/muze/example/samples/design-samples/scatter-shape.js b/packages/muze/example/samples/design-samples/scatter-shape.js index 4f144777..5c87b60b 100644 --- a/packages/muze/example/samples/design-samples/scatter-shape.js +++ b/packages/muze/example/samples/design-samples/scatter-shape.js @@ -68,8 +68,6 @@ env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); let mountPoint = document.getElementById('chart'); window.canvas = env.canvas(); - let canvas2 = env.canvas(); - let canvas3 = env.canvas(); let rows = [[ 'Acceleration']], columns = [['Horsepower']]; canvas = canvas diff --git a/packages/muze/example/samples/design-samples/simple-bar.js b/packages/muze/example/samples/design-samples/simple-bar.js index 34dc626d..1edc0b27 100644 --- a/packages/muze/example/samples/design-samples/simple-bar.js +++ b/packages/muze/example/samples/design-samples/simple-bar.js @@ -1,126 +1,49 @@ -/* eslint-disable */ - -(function () { - let env = muze.Muze(); - let DataTable = muze.DataTable, - share = muze.operators.share, - html = muze.operators.html, - Board = muze.Board; - window.board = new Board(); - - - d3.json('../../../data/cars.json', (data) => { - const jsonData = data, - schema = [{ - name: 'Name', - type: 'dimension' - }, - { - name: 'Maker', - type: 'dimension' - }, - { - name: 'Miles_per_Gallon', - type: 'measure' - }, - - { - name: 'Displacement', - type: 'measure' - }, - { - name: 'Horsepower', - type: 'measure' - }, - { - name: 'Weight_in_lbs', - type: 'measure', - }, - { - name: 'Acceleration', - type: 'measure' - }, - { - name: 'Origin', - type: 'dimension' - }, - { - name: 'Cylinders', - type: 'dimension' - }, - { - name: 'Year', - type: 'dimension', - // subtype: 'temporal', - // format: '%Y-%m-%d' - }, - - ]; - let rootData = new DataTable(jsonData, schema); - - rootData = rootData.groupBy(['Year'], { - Horsepower: 'mean', - Acceleration: 'mean' - }); - - env = env.data(rootData).minUnitHeight(40).minUnitWidth(40); - let mountPoint = document.getElementById('chart'); - window.canvas = env.canvas(); - let canvas2 = env.canvas(); - let canvas3 = env.canvas(); - let rows = [[ 'Acceleration']], - columns = [['Year']]; - canvas = canvas - .rows(rows) - .columns(columns) - .data(rootData) - .layers({ - Acceleration:{ - mark: 'bar', - // transform: {type:'group'} - } - }) - .width(900) - .height(600) - .config({ - border:{ - width: 2, - showRowBorders: false, - showColBorders:false, - showValueBorders: { - top: false, - bottom: true, - left: true, - right: false - } - }, - axes:{ - x:{ - showAxisName: true, - - - }, y:{ - showAxisName: true, - // name: 'Acceleration per year', - axisNamePadding: 12 - } - } - }) - - canvas.legend({ - align:'horizontal', - title: [''], - item:{ - text:{ - position:'right' - } - }, - steps: 6 - }) - - .title('The Muze Project', { position: "top", align: "left", }) - .subtitle('Composable visualisations with a data first approach', { position: "top", align: "left" }) - .mount(document.getElementsByTagName('body')[0]); - }) - -})() +d3.json('/data/cars.json', (data) => { + // load data and schema from url + const schema = [{ + name: 'Name', + type: 'dimension' + }, { + name: 'Maker', + type: 'dimension' + }, { + name: 'Miles_per_Gallon', + type: 'measure' + }, { + name: 'Displacement', + type: 'measure' + }, { + name: 'Horsepower', + type: 'measure' + }, { + name: 'Weight_in_lbs', + type: 'measure' + }, { + name: 'Acceleration', + type: 'measure' + }, { + name: 'Origin', + type: 'dimension' + }, { + name: 'Cylinders', + type: 'dimension' + }, { + name: 'Year', + type: 'dimension', + subtype: 'temporal', + format: '%Y-%m-%d' + }]; + const DataModel = window.muze.DataModel; + const dm = new DataModel(data, schema); + const html = muze.Operators.html; + const env = window.muze(); + const canvas = env.canvas(); + canvas.data(dm).width(600).height(400).rows(['Horsepower']).columns(['Weight_in_lbs']).color({ + field: 'Miles_per_Gallon' + // stops: [15, 30, 45, 60] + }).detail(['Name']).mount('#chart').title('The car acceleration respective to origin', { position: 'bottom', align: 'left' }); + canvas.once('canvas.animationend').then((client) => { + const element = document.getElementById('chart'); + element.classList.add('animateon'); + }); +}); \ No newline at end of file diff --git a/packages/muze/npm/dist/muze.css b/packages/muze/npm/dist/muze.css deleted file mode 100644 index 395d455d..00000000 --- a/packages/muze/npm/dist/muze.css +++ /dev/null @@ -1 +0,0 @@ -.muze-selection-box-group{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-tooltip-box{opacity:.9;border:1px solid hsla(0,0%,59.2%,.19);background:#fbfbfb;-webkit-box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);font-size:12px;color:#5f5f5f;-webkit-border-radius:1px;border-radius:1px;padding-top:4px;display:inline-block;pointer-events:none;z-index:9999999999;text-align:left}.muze-tooltip-row{padding-bottom:2px;padding-top:2px;overflow:auto}.muze-tooltip-selected-row{background-color:#ebebeb}.muze-tooltip-row:last-child{padding-bottom:4px}.muze-tooltip-value{color:#5f5f5f;float:right;margin-left:10px}.muze-tooltip-connectors path{stroke-width:2px;stroke:#c7c7be;stroke-linejoin:round;stroke-linecap:round}.muze-tooltip-arrow-bottom{border-top:10px solid #fbfbfb;border-left:5px solid transparent;border-right:5px solid transparent;right:0}.muze-tooltip-arrow-right{border-left:10px solid #fbfbfb;right:-10px}.muze-tooltip-arrow-left,.muze-tooltip-arrow-right{border-top:5px solid transparent;border-bottom:5px solid transparent}.muze-tooltip-arrow-left{border-right:10px solid #fbfbfb;right:0;left:-10px}.muze-tooltip-arrow-top{border-bottom:10px solid #fbfbfb;border-left:5px solid transparent;border-right:5px solid transparent;right:0}.muze-tooltip-background-arrow-top{border-bottom:12px solid hsla(0,0%,59.2%,.19);top:0}.muze-tooltip-background-arrow-bottom,.muze-tooltip-background-arrow-top{border-left:6px solid transparent;border-right:6px solid transparent;right:0}.muze-tooltip-background-arrow-bottom{border-top:12px solid hsla(0,0%,59.2%,.19);top:102%}.muze-tooltip-background-arrow-right{border-left:12px solid hsla(0,0%,59.2%,.19);border-top:6px solid transparent;border-bottom:6px solid transparent;right:-12px}.muze-tooltip-background-arrow-left{border-right:12px solid hsla(0,0%,59.2%,.19);border-top:6px solid transparent;border-bottom:6px solid transparent;right:0;left:-12px}.muze-tooltip-content-container{float:none!important}.muze-tooltip-html-container{margin-left:10px;margin-right:10px}.muze-tooltip-content svg{margin-left:10px;margin-right:5px}.muze-tooltip-content-container-selectionSummary .muze-tooltip-content{margin-left:3px;margin-right:3px}.muze-tooltip-value{margin-right:24px;margin-left:24px}.muze-tooltip-first{font-weight:600;font-size:15px;margin-left:15px}.muze-tooltip-table-tbody td{padding:3px}.muze-tooltip-table-row-0{font-weight:700}.muze-tooltip-content-container{border-bottom:1px solid #e9e9e9}.muze-tooltip-content-parent-container :last-child{border-bottom:none}.muze-crossband{stroke-opacity:0;fill:grey;fill-opacity:.2}.muze-crossline{stroke:#979797;stroke-dasharray:5,7;fill:#979797;opacity:.65}.muze-anchors-group{pointer-events:none}.muze-simple-axis text{text-align:center;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-ticks{font-style:"normal";fill:#858585}.muze-tick-lines,.muze-ticks{font-size:12px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-tick-lines{stroke:#efefef}.muze-axis-name{font-size:14px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;fill:#5f5f5f}.muze-axis-name.hidden{display:none}.muze-fadeout-interaction{stroke-opacity:.3}.muze-layer-line{stroke-linejoin:round;stroke-width:2px;stroke:#086bb6}.muze-layer-area{stroke-linejoin:round;fill:#086bb6;fill-opacity:.7}.muze-layer-arc-highlight{fill:#7f7f7f!important}.muze-layer-arc-fadeout{fill-opacity:.3!important}.muze-layer-arc-selected{fill:#e6e6e6!important}.muze-layer-arc{fill:#086bb6}.muze-layer-text text{font-size:12px;fill:#000}.muze-layer-text rect{fill:#7f7f7f;fill-opacity:.3}.muze-layer-text-highlight{fill-opacity:1}.muze-layer-text-fadeout{fill-opacity:.3!important}.muze-layer-text-selected{fill:#000!important}.muze-layer-point{fill-opacity:.5;stroke-opacity:.5;fill:#086bb6;stroke:#086bb6}.muze-layer-point-highlight{stroke-width:2px!important;fill-opacity:0;stroke-opacity:1}.muze-layer-point-fadeout{fill-opacity:.3!important;fill:#7f7f7f!important;stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-point-selected{fill:#000!important}.muze-layer-bar,.muze-layer-bar-highlight{fill-opacity:1}.muze-layer-bar-fadeout{fill-opacity:.2!important}.muze-layer-bar-selected{fill:#4682b4!important}.muze-layer-tick{stroke-opacity:.7;stroke:#f44336}.muze-layer-tick-highlight{stroke-opacity:1}.muze-layer-tick-fadeout{stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-tick-selected{stroke:#000!important}.muze-visual-unit{background:transparent}.muze-axis-zero-line{stroke-width:1px}.muze-grid-band-x-0,.muze-grid-band-y-0{fill-opacity:0}.muze-unit{-webkit-touch-callout:none;-webkit-user-select:none}.muze-legend-box,.muze-legend-item-info,.muze-legend-title{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-legend-box{line-height:10px!important;height:100px;display:inline-block}.muze-legend-title{display:table;-webkit-box-align:center;-webkit-align-items:center;align-items:center;float:left;text-align:left;font-size:14px;height:30px;fill:#5f5f5f;font-weight:600}.muze-legend-title-text{display:table-cell;vertical-align:middle}.muze-legend-overflow{text-align:center}.muze-legend-icon,.muze-legend-icon-svg{cursor:pointer}.muze-overflow-y{overflow-y:scroll}.muze-overflow-x{overflow-x:scroll}.muze-legend-fadeout{fill-opacity:.3;opacity:.3}.muze-legend-brighten{fill-opacity:1}.muze-legend-item-info{float:left;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;cursor:pointer;font-size:12px}.muze-legend-item-info.center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.muze-legend-item-info.start{-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.muze-legend-item-info.end{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.muze-legend-selection-box{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-text-cell{font-size:14px;text-align:center;color:#5f5f5f;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap;-webkit-transform-origin:0 0;transform-origin:0 0}.muze-header-cell{font-size:16px}.muze-header-cell,.muze-subheader-cell{text-align:center;color:#858585;font-weight:800;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap}.muze-subheader-cell{font-size:15px}.muze-scroll-bar{background:#f8f8f8;position:relative;font-size:10px}.muze-scroll-arrow{float:left;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background:#a2a2a2;color:#fff}.muze-scroll-arrow-left{height:100%;width:20px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-right{height:100%;width:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.muze-scroll-arrow-right,.muze-scroll-arrow-top{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.muze-scroll-arrow-top{width:100%;height:20px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-bottom{width:100%;height:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.muze-scroll-rect{float:left;position:relative}.muze-scroll-mover{position:absolute;-webkit-border-radius:3px;background:#a2a2a2;cursor:-webkit-grab;border-radius:3px}.muze-scroll-mover:active{cursor:-webkit-grabbing}.muze-scroll-arrow-chevron{position:relative;text-align:center;padding:1px;margin-bottom:0}.muze-scroll-arrow-chevron:after,.muze-scroll-arrow-chevron:before{content:"";position:absolute;background:#fff}#muze-scroll-arrow-chevron-bottom,#muze-scroll-arrow-chevron-top{height:1px;width:6px}#muze-scroll-arrow-chevron-left,#muze-scroll-arrow-chevron-right{width:1px;height:6px}#muze-scroll-arrow-chevron-bottom:before{top:0;left:0;height:100%;width:51%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-bottom:after{right:0;width:50%}#muze-scroll-arrow-chevron-bottom:after,#muze-scroll-arrow-chevron-top:before{top:0;height:100%;-webkit-transform:skew(0deg,-35deg);transform:skew(0deg,-35deg)}#muze-scroll-arrow-chevron-top:before{left:0;width:51%}#muze-scroll-arrow-chevron-top:after{top:0;right:0;height:100%;width:50%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-right:before{top:0;left:0;height:51%;width:100%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-right:after{bottom:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}#muze-scroll-arrow-chevron-left:before{bottom:0;left:0;width:100%;height:51%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-left:after{top:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkido18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7qsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7jsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7rsDJB9cme_xc.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7ksDJB9cme_xc.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7osDJB9cme_xc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7psDJB9cme_xc.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDJB9cme.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklyds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.muze-group-container,.muze-subtitle-cell,.muze-title-cell{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-group-container{font-size:14px;-webkit-tap-highlight-color:rgba(0,0,0,0);line-height:1.42857143;color:#333;background-color:transparent;margin:0}.muze-group-container *,.muze-group-container :after,.muze-group-container :before{-webkit-box-sizing:border-box;box-sizing:border-box}.muze-group-container .muze-table-arrow{margin:5px;width:0;height:0;position:absolute;opacity:.5;z-index:10;cursor:pointer}.muze-group-container .muze-table-arrow:hover{opacity:1}.muze-group-container .muze-table-arrow-right{left:100%;border-left:15px solid #4682b4}.muze-group-container .muze-table-arrow-left,.muze-group-container .muze-table-arrow-right{top:-webkit-calc(50% - 25px);top:calc(50% - 25px);border-top:20px solid transparent;border-bottom:20px solid transparent}.muze-group-container .muze-table-arrow-left{right:100%;border-right:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom{top:100%;border-top:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom,.muze-group-container .muze-table-arrow-top{left:-webkit-calc(50% - 25px);left:calc(50% - 25px);border-left:20px solid transparent;border-right:20px solid transparent}.muze-group-container .muze-table-arrow-top{bottom:100%;border-bottom:15px solid #4682b4}.muze-group-container .table-row-nested{visibility:hidden;border-top:none}.muze-group-container svg{display:block;width:inherit;height:inherit;float:left;vertical-align:top}.muze-group-container .axisName.hidden{opacity:0}.muze-group-container .axisName{opacity:1}.muze-group-container .grid-td svg{max-width:100%;max-height:100%}.muze-group-container .domain{opacity:0}.muze-board{float:left}.muze-layout-container{float:left;position:relative}.muze-board-legend,.muze-legend-section{text-align:center;float:left}.muze-legend-horizontal-section{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.muze-legend-components{text-align:center;float:left}.muze-grid-layout,.muze-grid-layout-container,.muze-grid-layout-row{float:left;position:relative}.muze-grid-table{background-color:transparent;border-spacing:0;table-layout:fixed}.muze-grid-td,.muze-grid-th{padding:0}.muze-table-header{width:inherit;height:inherit}.muze-grid-layout,.muze-layout-grid-container{float:left;position:relative}.muze-grid div{float:left}.muze-grid div,.muze-grid table{border-collapse:collapse}.muze-title-cell{font-size:24px;font-weight:700;color:#5f5f5f}.muze-grid-headers{font-size:14px;font-weight:700}.muze-subtitle-cell{font-size:16px;font-weight:400;color:#b1b1b1}.domain{opacity:0}.muze-group-container,.muze-layout-container,.muze-legend-container{float:left}.muze-message-container{background-color:#f1f1f1;display:table;border:1px solid #c3c9d0}.muze-message-container-child{vertical-align:middle;text-align:center;font-size:18px;color:#8c8d8e;display:table-cell}.hidden{display:none} \ No newline at end of file diff --git a/packages/muze/npm/dist/muze.js b/packages/muze/npm/dist/muze.js deleted file mode 100644 index 620b574a..00000000 --- a/packages/muze/npm/dist/muze.js +++ /dev/null @@ -1,2 +0,0 @@ -!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("muze",[],factory):"object"==typeof exports?exports.muze=factory():root.muze=factory()}(window,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=7)}([function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"name":"datamodel","description":"Relational algebra compliant in-memory tabular data store","homepage":"https://github.com/chartshq/datamodel","version":"2.2.3","license":"MIT","main":"dist/datamodel.js","keywords":["datamodel","data","relational","algebra","model","muze","fusioncharts","table","tabular","operation"],"author":"Muzejs.org (https://muzejs.org/)","repository":{"type":"git","url":"https://github.com/chartshq/datamodel.git"},"contributors":[{"name":"Akash Goswami","email":"akashgoswami90s@gmail.com"},{"name":"Subhash Haldar"},{"name":"Rousan Ali","email":"rousanali786@gmail.com","url":"https://rousan.io"},{"name":"Ujjal Kumar Dutta","email":"duttaujjalkumar@live.com"},{"name":"Ranajit Banerjee","email":"ranajit.113124@gmail.com"},{"name":"Adarsh Lilha","email":"adarshlilha@gmail.com"}],"dependencies":{"d3-dsv":"^1.0.8"},"devDependencies":{"babel-cli":"6.26.0","babel-core":"^6.26.3","babel-eslint":"6.1.2","babel-loader":"^7.1.4","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-flow":"^6.23.0","chai":"3.5.0","cross-env":"^5.0.5","eslint":"3.19.0","eslint-config-airbnb":"15.1.0","eslint-plugin-import":"2.7.0","eslint-plugin-jsx-a11y":"5.1.1","eslint-plugin-react":"7.3.0","istanbul-instrumenter-loader":"^3.0.0","jsdoc":"3.5.5","json2yaml":"^1.1.0","karma":"1.7.1","karma-chai":"0.1.0","karma-chrome-launcher":"2.1.1","karma-coverage-istanbul-reporter":"^1.3.0","karma-mocha":"1.3.0","karma-spec-reporter":"0.0.31","karma-webpack":"2.0.3","marked":"^0.5.0","mocha":"3.4.2","mocha-webpack":"0.7.0","transform-runtime":"0.0.0","webpack":"^4.12.0","webpack-cli":"^3.0.7","webpack-dev-server":"^3.1.4"},"scripts":{"test":"npm run lint && npm run ut","ut":"karma start karma.conf.js","utd":"karma start --single-run false --browsers Chrome karma.conf.js ","build":"npm run build:prod","build:dev":"webpack --mode development","build:prod":"webpack --mode production","start":"webpack-dev-server --config webpack.config.dev.js --mode development --open","lint":"eslint ./src","lint-errors":"eslint --quiet ./src","docs":"rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json"}}')},function(e,t,n){var r=n(2);e.exports=r.default?r.default:r},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"DataFormat",function(){return o}),n.d(r,"DimensionSubtype",function(){return u}),n.d(r,"MeasureSubtype",function(){return c}),n.d(r,"FieldType",function(){return f}),n.d(r,"FilteringMode",function(){return l}),n.d(r,"GROUP_BY_FUNCTIONS",function(){return s});var a={};n.r(a),n.d(a,"DSVArr",function(){return rt}),n.d(a,"DSVStr",function(){return mt}),n.d(a,"FlatJSON",function(){return yt}),n.d(a,"Auto",function(){return bt});var i={};n.r(i),n.d(i,"sum",function(){return un}),n.d(i,"avg",function(){return cn}),n.d(i,"min",function(){return fn}),n.d(i,"max",function(){return ln}),n.d(i,"first",function(){return sn}),n.d(i,"last",function(){return dn}),n.d(i,"count",function(){return pn}),n.d(i,"sd",function(){return hn});var o={FLAT_JSON:"FlatJSON",DSV_STR:"DSVStr",DSV_ARR:"DSVArr",AUTO:"Auto"},u={CATEGORICAL:"categorical",TEMPORAL:"temporal",GEO:"geo",BINNED:"binned"},c={CONTINUOUS:"continuous"},f={MEASURE:"measure",DIMENSION:"dimension"},l={NORMAL:"normal",INVERSE:"inverse",ALL:"all"},s={SUM:"sum",AVG:"avg",MIN:"min",MAX:"max",FIRST:"first",LAST:"last",COUNT:"count",STD:"std"};function d(e){return e instanceof Date?e:new Date(e)}function p(e){return e<10?"0"+e:e}function h(e){this.format=e,this.dtParams=void 0,this.nativeDate=void 0}RegExp.escape=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},h.TOKEN_PREFIX="%",h.DATETIME_PARAM_SEQUENCE={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6},h.defaultNumberParser=function(e){return function(t){var n;return isFinite(n=parseInt(t,10))?n:e}},h.defaultRangeParser=function(e,t){return function(n){var r,a=void 0;if(!n)return t;var i=n.toLowerCase();for(a=0,r=e.length;aa.getFullYear()&&(t=""+(i-1)+r),d(t).getFullYear()},formatter:function formatter(e){var t=d(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:"Y",index:0,extract:function extract(){return"(\\d{4})"},parser:h.defaultNumberParser(),formatter:function formatter(e){return d(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function t(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[i+1],-1!==r.indexOf(o)&&a.push({index:i,token:o});return a},h.formatAs=function(e,t){var n,r=d(e),a=h.findTokens(t),i=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=a.length;l=0;d--)(f=i[d].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(d=0;d0&&e.split(",").forEach(function(e){var n=e.split("-"),r=+n[0],a=+(n[1]||n[0]);if(a>=r)for(var i=r;i<=a;i+=1)t(i)})}var R=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U.CROSS,i=[],o=[],u=n||H,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,d=c.name+"."+f.name,p=Y(c,f);if(l===s)throw new Error("DataModels must have different alias names");return c.fields.forEach(function(e){var t=_({},e.schema());-1===p.indexOf(t.name)||r||(t.name=c.name+"."+t.name),i.push(t)}),f.fields.forEach(function(e){var t=_({},e.schema());-1!==p.indexOf(t.name)?r||(t.name=f.name+"."+t.name,i.push(t)):i.push(t)}),T(e._rowDiffset,function(n){var d=!1,h=void 0;T(t._rowDiffset,function(v){var m=[],y={};y[l]={},y[s]={},c.fields.forEach(function(e){m.push(e.partialField.data[n]),y[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}}),f.fields.forEach(function(e){-1!==p.indexOf(e.schema().name)&&r||m.push(e.partialField.data[v]),y[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}});var g=At(y[l]),b=At(y[s]);if(u(g,b,function(){return e.detachedRoot()},function(){return t.detachedRoot()},{})){var w={};m.forEach(function(e,t){w[i[t].name]=e}),d&&U.CROSS!==a?o[h]=w:(o.push(w),d=!0,h=n)}else if((a===U.LEFTOUTER||a===U.RIGHTOUTER)&&!d){var O={},_=c.fields.length-1;m.forEach(function(e,t){O[i[t].name]=t<=_?e:null}),d=!0,h=n,o.push(O)}})}),new on(o,i,{name:d})}function J(e,t){var n=""+e,r=""+t;return nr?1:0}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J;return e.length>1&&function e(t,n,r,a){if(r===n)return t;var i=n+Math.floor((r-n)/2);return e(t,n,i,a),e(t,i+1,r,a),function(e,t,n,r,a){for(var i=e,o=[],u=t;u<=r;u+=1)o[u]=i[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(i[l]=o[f],f+=1):f>r?(i[l]=o[c],c+=1):a(o[c],o[f])<=0?(i[l]=o[c],c+=1):(i[l]=o[f],f+=1)}(t,n,i,r,a),t}(e,0,e.length-1,t),e}var K=function K(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function W(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=""+e)==(t=""+t)?0:e>t?-1:1}}return n}(e.type,n)}function q(e,t){var n=new Map,r=[];return e.forEach(function(e){var a=e[t];n.has(a)?r[n.get(a)][1].push(e):(r.push([a,[e]]),n.set(a,r.length-1))}),r}function Z(e,t,n){var r={label:e[0]};return t.reduce(function(t,r,a){return t[r]=e[1].map(function(e){return e[n[a].index]}),t},r),r}function $(e,t,n){for(var r=void 0,a=void 0,i=void 0,o=n.length-1;o>=0;o--)r=n[o][0],a=n[o][1],(i=Ht(t,r))&&("function"==typeof a?z(e,function(e,t){return a(e[i.index],t[i.index])}):E(a)?function(){var n=q(e,i.index),r=a[a.length-1],o=a.slice(0,a.length-1),u=o.map(function(e){return Ht(t,e)});n.forEach(function(e){e.push(Z(e,o,u))}),z(n,function(e,t){var n=e[2],a=t[2];return r(n,a)}),e.length=0,n.forEach(function(t){e.push.apply(e,W(t[1]))})}():function(){var t=X(i,a);z(e,function(e,n){return t(e[i.index],n[i.index])})}())}var Q,ee=function e(t,n,r,a){if(0===t.length)return n;var i=t[0],o=new Map;n.reduce(function(e,t){var n=t[i.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e},o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var d=l.value,p=K(d,2),h=p[0],v=p[1],m=e(t.slice(1),v,r,a);o.set(h,m),Array.isArray(m)&&$(m,r,a)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function ne(e,t,n,r,a){var i={schema:[],data:[],uids:[]},o=(a=Object.assign({},{addUid:!1,columnWise:!1},a)).addUid,u=r&&r.length>0,c=[];if(n.split(",").forEach(function(t){for(var n=0;nn&&(n=a))}),[t,n]}}]),t}(),He=function(){function e(e,t){for(var n=0;n=i?c=!0:(r=e.charCodeAt(o++))===ut?f=!0:r===ct&&(f=!0,e.charCodeAt(o)===ut&&++o),e.slice(a+1,t-1).replace(/""/g,'"')}for(;o9999?"+"+st(t,6):st(t,4))+"-"+st(e.getUTCMonth()+1,2)+"-"+st(e.getUTCDate(),2)+(i?"T"+st(n,2)+":"+st(r,2)+":"+st(a,2)+"."+st(i,3)+"Z":a?"T"+st(n,2)+":"+st(r,2)+":"+st(a,2)+"Z":r||n?"T"+st(n,2)+":"+st(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function parse(e,t){var n,a,i=r(e,function(e,r){if(n)return n(e,r-1);a=e,n=t?function(e,t){var n=ft(e);return function(r,a){return t(n(r),a,e)}}(e,t):ft(e)});return i.columns=a||[],i},parseRows:r,format:function format(t,n){return null==n&&(n=lt(t)),[n.map(o).join(e)].concat(a(t,n)).join("\n")},formatBody:function formatBody(e,t){return null==t&&(t=lt(e)),a(e,t).join("\n")},formatRows:function formatRows(e){return e.map(i).join("\n")}}},ht=pt(","),vt=(ht.parse,ht.parseRows,ht.format,ht.formatBody,ht.formatRows,pt("\t"));vt.parse,vt.parseRows,vt.format,vt.formatBody,vt.formatRows;var gt,mt=function mt(e,t,n){n=Object.assign({},{firstRowHeader:!0,fieldSeparator:","},n);var r=pt(n.fieldSeparator);return rt(r.parseRows(e),t,n)},yt=function yt(e,t){if(!Array.isArray(t))throw new Error("Schema missing or is in an unsupported format");var n={},r=0,a=void 0,i=[],o=v(i),u=t.map(function(e){return e.name});return e.forEach(function(e){var t=[];u.forEach(function(i){i in n?a=n[i]:(n[i]=r++,a=r-1),t[a]=e[i]}),o.apply(void 0,t)}),[Object.keys(n),i]},bt=function bt(e,t,n){var r={FlatJSON:yt,DSVStr:mt,DSVArr:rt},a=D(e);if(!a)throw new Error("Couldn't detect the data format");return r[a](e,t,n)},wt=function wt(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,_t(a))):e._derivation.push({op:t,meta:r,criteria:a})})(t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},arguments[4]),function Dt(e,t){var n;(n=t._ancestorDerivation).push.apply(n,_t(e._ancestorDerivation).concat(_t(e._derivation)))}(e,t)},Nt=(Ot(gt={},l.NORMAL,{diffIndex:["rowDiffset"],calcDiff:[!0,!1]}),Ot(gt,l.INVERSE,{diffIndex:["rejectRowDiffset"],calcDiff:[!1,!0]}),Ot(gt,l.ALL,{diffIndex:["rowDiffset","rejectRowDiffset"],calcDiff:[!0,!0]}),gt),kt=function kt(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split("-")[0]+"-"+t}else e.push(""+t)},Tt=function Tt(e,t,n){var r=[],a=[],i=wt(Nt[n].calcDiff,2),o=i[0],u=i[1];return T(e,function(e){var n=t(e);n&&o&&kt(r,e,-1),!n&&u&&kt(a,e,-1)}),{rowDiffset:r.join(","),rejectRowDiffset:a.join(",")}},Ct=function Ct(e,t,n,r,a){var i={},o=function o(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e.getPartialFieldspace().fields,l=f.map(function(e){return e.formattedData()}),s=f.map(function(e){return e.data()});return a(c,function(e){return t(Et(f,l,s,e),e,o,i)},u)},It=function It(e,t,n){for(var r=n(e,t,0),a=1,i=e.length;a2&&void 0!==arguments[2]?arguments[2]:{},r=[],a=n.operation||"and",i=n.filterByMeasure||!1,o=function Mt(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map(function(e){return e.name()}).join(","),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t}(e),u=o.getFieldsConfig();return r=t.length?t.map(function(e){return n=void 0,r=(t=e).getData(),a=t.getFieldsConfig(),o=Object.keys(t.getFieldspace().getDimension()).filter(function(e){return e in u}),c=o.length,f=o.map(function(e){return a[e].index}),l=Object.keys(t.getFieldspace().getMeasure()).filter(function(e){return e in u}),s=t.getFieldspace().fieldsObj(),d=r.data,p=l.reduce(function(e,t){return e[t]=s[t].domain(),e},{}),h={},n=function n(e,t,_n){return t[e[_n]]},c&&d.forEach(function(e){var t=It(f,e,n);h[t]=1}),n=function n(e,t,_n2){return t[e[_n2]].internalValue},d.length?function(e){var t=!c||h[It(o,e,n)];return i?l.every(function(t){return e[t].internalValue>=p[t][0]&&e[t].internalValue<=p[t][1]})&&t:t}:function(){return!1};var t,n,r,a,o,c,f,l,s,d,p,h}):[function(){return!1}],"and"===a?o.select(function(e){return r.every(function(t){return t(e)})},{saveChild:!1}):o.select(function(e){return r.some(function(t){return t(e)})},{saveChild:!1})},xt=function xt(e,t,n,r,a){e._rowDiffset=t,e.__calculateFieldspace().calculateFieldsConfig(),Ft(n,e,L.SELECT,{config:r},a)},Lt=function Lt(e,t,n,r){var a=e.clone(n.saveChild),i=t;return n.mode===l.INVERSE&&(i=r.filter(function(e){return-1===t.indexOf(e)})),a._colIdentifier=i.join(","),a.__calculateFieldspace().calculateFieldsConfig(),Ft(e,a,L.PROJECT,{projField:t,config:n,actualProjField:i},null),a},Vt=function Vt(e){if((e=_({},e)).type||(e.type=f.DIMENSION),!e.subtype)switch(e.type){case f.MEASURE:e.subtype=c.CONTINUOUS;break;default:case f.DIMENSION:e.subtype=u.CATEGORICAL}return e},Bt=function Bt(e){return e.map(function(e){return function(e){var t=[c.CONTINUOUS],n=[u.CATEGORICAL,u.BINNED,u.TEMPORAL,u.GEO],r=e.type,a=e.subtype,i=e.name;switch(r){case f.DIMENSION:if(-1===n.indexOf(a))throw new Error("DataModel doesn't support dimension field subtype "+a+" used for "+i+" field");break;case f.MEASURE:if(-1===t.indexOf(a))throw new Error("DataModel doesn't support measure field subtype "+a+" used for "+i+" field");break;default:throw new Error("DataModel doesn't support field type "+r+" used for "+i+" field")}}(e=Vt(e)),e})},Yt=function Yt(e,t,n,r){n=Bt(n),r=Object.assign(Object.assign({},nt),r);var i=a[r.dataFormat];if(!i||"function"!=typeof i)throw new Error("No converter function found for "+r.dataFormat+" format");var u=i(t,n,r),c=wt(u,2),f=c[0],l=c[1];!function(e,t){n.forEach(function(e){var n=e.as;if(n){var r=t.indexOf(e.name);t[r]=n,e.name=n,delete e.as}})}(0,f);var s=tt(l,n,f),d=F.createNamespace(s,r.name);e._partialFieldspace=d,e._rowDiffset=l.length&&l[0].length?"0-"+(l[0].length-1):"";var p=[],h=d.fields,v=h.map(function(e){return e.data()}),m=h.map(function(e){return e.formattedData()});return T(e._rowDiffset,function(e){p[e]=Et(h,m,v,e)}),d._cachedValueObjects=p,e._colIdentifier=n.map(function(e){return e.name}).join(),e._dataFormat=r.dataFormat===o.AUTO?D(t):r.dataFormat,e},Ht=function Ht(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=a.nonTraversingModel,o=a.excludeModels||[];t!==i&&((!o.length||-1===o.indexOf(t))&&t.handlePropagation(n,r),t._children.forEach(function(t){var i=Gt(n,t);e(t,i,r,a)}))},Xt=function Xt(e,t,n,r){var a=void 0,i=void 0,o=n.propagationNameSpace,u=n.propagateToSource,c=n.sourceId,f=r.propagateInterpolatedValues,l=[];if(null===e&&!0!==r.persistent)l=[{criteria:[]}],a=[];else{var s,d=Object.values(o.mutableActions);!1!==u&&(d=d.filter(function(e){return e.config.sourceId!==c}));var p=d.filter(function(e){return(r.filterFn||function(){return!0})(e,r)}).map(function(e){return e.config.criteria}),h=[];if(!1!==u){var v=Object.values(o.mutableActions);v.forEach(function(e){var t=e.config;!1===t.applyOnSource&&t.action===r.action&&t.sourceId!==c&&(h.push(e.model),(a=v.filter(function(t){return t!==e}).map(function(e){return e.config.criteria})).length&&l.push({criteria:a,models:e.model,path:function Wt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t}(e.model)}))})}a=(s=[]).concat.apply(s,[].concat(_t(p),[e])).filter(function(e){return null!==e}),l.push({criteria:a,excludeModels:[].concat(h,_t(r.excludeModels||[]))})}var m=t.model,y=Object.assign({sourceIdentifiers:e,propagationSourceId:c},r),g=t.groupByModel;f&&g&&(i=Pt(g,a,{filterByMeasure:f}),Jt(g,i,y)),l.forEach(function(e){var t=Pt(m,e.criteria),n=e.path;if(n){var r=function(e,t){for(var n=0,r=t.length;n1?(a=e.clone(r.saveChild),xt(a,u[c[1]],e,n,t),[o,a]):o}(this,e,t,{saveChild:t.saveChild})}},{key:"isEmpty",value:function value(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:"clone",value:function value(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:"project",value:function value(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),a=Object.keys(r),i=t.mode,o=$t(e,a,r);return i===l.ALL?[Lt(this,o,{mode:l.NORMAL,saveChild:t.saveChild},a),Lt(this,o,{mode:l.INVERSE,saveChild:t.saveChild},a)]:Lt(this,o,t,a)}},{key:"getFieldsConfig",value:function value(){return this._fieldConfig}},{key:"calculateFieldsConfig",value:function value(){return this._fieldConfig=this._fieldspace.fields.reduce(function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e},{}),this}},{key:"dispose",value:function value(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach(function(e){e._parent=null}),this._children=[]}},{key:"removeChild",value:function value(e){var t=this._children.findIndex(function(t){return t===e});-1===t||this._children.splice(t,1)}},{key:"setParent",value:function value(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:"getParent",value:function value(){return this._parent}},{key:"getChildren",value:function value(){return this._children}},{key:"getDerivations",value:function value(){return this._derivation}},{key:"getAncestorDerivations",value:function value(){return this._ancestorDerivation}}]),e}(),nn=function nn(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},rn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=""+e.join(),i=function Ae(e,t,n,r){var a=function(e,t){var n=[],r=e.getFieldspace().getDimension();return Object.entries(r).forEach(function(e){var r=Ee(e,1)[0];t&&t.length?-1!==t.indexOf(r)&&n.push(r):n.push(r)}),n}(e,t),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),a=_e.defaultReducer();return Object.keys(r).forEach(function(e){"string"!=typeof t[e]&&(t[e]=r[e].defAggFn());var i=_e.resolve(t[e]);i?n[e]=i:(n[e]=a,t[e]=ge)}),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],d=[],p={},h=[],v=void 0;Object.entries(u).forEach(function(e){var t=Ee(e,2),n=t[0],r=t[1];if(-1!==a.indexOf(n)||i[n])switch(d.push(_({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}});var m=0;T(e._rowDiffset,function(e){var t="";l.forEach(function(n){t=t+"-"+u[n].partialField.data[e]}),void 0===p[t]?(p[t]=m,h.push({}),l.forEach(function(t){h[m][t]=u[t].partialField.data[e]}),s.forEach(function(t){h[m][t]=[u[t].partialField.data[e]]}),m+=1):s.forEach(function(n){h[p[t]][n].push(u[n].partialField.data[e])})});var y={},g=function g(){return e.detachedRoot()};return h.forEach(function(e){var t=e;s.forEach(function(n){t[n]=i[n](e[n],g,y)})}),r?(r.__calculateFieldspace(),v=r):v=new yn(h,d,{name:c}),v}.apply(void 0,[this,e,t]);return Ft(this,i,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:_e.defaultReducer()},t),n.saveChild?i.setParent(this):i.setParent(null),i}},{key:"sort",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:"row",sort:e}),a=[n.schema.map(function(e){return e.name})].concat(n.data),i=new this.constructor(a,n.schema,{dataFormat:"DSVArr"});return Ft(this,i,L.SORT,t,e),t.saveChild?i.setParent(this):i.setParent(null),i}},{key:"serialize",value:function value(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:","},t);var n=this.getFieldspace().fields,r=n.map(function(e){return e.formattedData()}),a=r[0].length,i=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(i=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach(function(t,n){t[e.name()]=new k(a[n],i[n],e)});return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:"calculateVariable",value:function value(e,t,n){var r=this;e=Vt(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var a=this.getFieldsConfig(),i=t.slice(0,t.length-1),o=t[t.length-1];if(a[e.name]&&!n.replaceVar)throw new Error(e.name+" field already exists in datamodel");var u=i.map(function(e){var t=a[e];if(!t)throw new Error(e+" is not a valid column name.");return t.index}),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map(function(e){return f[e]}),s={},d=function d(){return r.detachedRoot()},p=[];T(c._rowDiffset,function(e){var t=l.map(function(t){return t.partialField.data[e]});p[e]=o.apply(void 0,an(t).concat([e,d,s]))});var h=tt([p],[e],[e.name]),v=nn(h,1)[0];return c.addField(v),Ft(this,c,L.CAL_VAR,{config:e,fields:i},o),c}},{key:"propagate",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.isMutableAction,i=t.sourceId,o=t.payload,u=function Kt(e){for(;e._parent;)e=e._parent;return e}(this),c=u._propagationNameSpace,l={groupByModel:function zt(e){for(;e._parent&&e._derivation.find(function(e){return e.op!==L.GROUPBY});)e=e._parent;return e}(this),model:u};return n&&function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,a=t.isMutableAction,i=t.criteria,o=t.action+"-"+t.sourceId;r=a?e.mutableActions:e.immutableActions,null===i?delete r[o]:r[o]={model:n,config:t}}(c,t,this),Xt(e,l,{propagationNameSpace:c,sourceId:i},Object.assign({payload:o},t)),a&&function qt(e,t,n){var r=e.immutableActions;for(var a in r){var i=r[a].config,o=n.config.sourceId,u=!n.propConfig.filterImmutableAction||n.propConfig.filterImmutableAction(i,n.config);if(i.sourceId!==o&&u){var c=i.criteria;Xt(c,t,{propagationNameSpace:e,propagateToSource:!1,sourceId:o},i)}}}(c,l,{config:t,propConfig:r}),this}},{key:"on",value:function value(e,t){switch(e){case"propagation":this._onPropagation.push(t)}return this}},{key:"unsubscribe",value:function value(e){switch(e){case"propagation":this._onPropagation=[]}return this}},{key:"handlePropagation",value:function value(e,t){var n=this;this._onPropagation.forEach(function(r){return r.call(n,e,t)})}},{key:"bin",value:function value(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error("Field "+e+" doesn't exist");var r=t.name||e+"_binned";if(n[r])throw new Error("Field "+r+" already exists");var a=function(e,t,n){var r=n.buckets,a=n.binsCount,i=n.binSize,o=n.start,u=n.end,f=function I(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.domain(),2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var d=[],p=0;p=(i=e[a=n+Math.floor((r-n)/2)]).start&&t=i.end?n=a+1:t2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],a=r.saveChild,i=e.getFieldspace().fieldsObj(),o=Ct(e.clone(a),n,r,e,function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},a=this.getFieldsConfig(),i=Object.keys(a),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach(function(e,n){o[n]=$t([].concat(an(e),an(t)),i,a)}),function Ut(e,t,n,r){return t.map(function(t){return Lt(e,t,n,r)})}(this,o,n,i)}}],[{key:"configureInvalidAwareTypes",value:function value(e){return M.invalidAwareVals(e)}},{key:"Reducers",get:function get(){return _e}}]),t}(),un=ye.sum,cn=ye.avg,fn=ye.min,ln=ye.max,sn=ye.first,dn=ye.last,pn=ye.count,hn=ye.std,vn={compose:function compose(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,a=void 0,i=[];return t.forEach(function(e){r=e(r),i.push.apply(i,function B(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t/gi),smartlabel},SmartLabelManager.store={},SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(!this._init)return!1;var size,csArr,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,container=this._container,style=this.style||{},cache=this._advancedCache||(this._advancedCache={}),advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]),cacheName=text+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||""),cacheInitName=text+"init"+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||"");return htmlSplCharSpace[text]&&(text=htmlSplCharSpace[text]),calculateDifference?void 0===(asymmetricDifference=cache[cacheInitName])&&(container.innerHTML=text.repeat?text.repeat(length):Array(length+1).join(text),tw=container.offsetWidth,container.innerHTML=text,twi=container.offsetWidth,asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1),advancedCacheKey.push(cacheInitName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()]):asymmetricDifference=0,(cachedStyle=cache[cacheName])?(csArr=cachedStyle.split(","),{width:parseFloat(csArr[0],10),height:parseFloat(csArr[1],10)}):(container.innerHTML=text,size={height:container.offsetHeight,width:container.offsetWidth+asymmetricDifference},cache[cacheName]=size.width+","+size.height,advancedCacheKey.push(cacheName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()],size)},SmartLabelManager.prototype._getWidthFn=function(){var contObj=this._containerObj,container=this._container,svgText=contObj.svgText;return svgText?function(str){var bbox,width;return svgText.textContent=str,(width=(bbox=svgText.getBBox()).width-SVG_BBOX_CORRECTION)<1&&(width=bbox.width),width}:function(str){return container.innerHTML=str,container.offsetWidth}},SmartLabelManager.prototype.setStyle=function(style){return this._init?style!==this.style||this._styleNotSet?(style||(style=this.style),slLib.setLineHeight(style),this.style=style,this._containerObj=sCont=this._containerManager.get(style),this._containerObj?(this._container=sCont.node,this._context=sCont.context,this._cache=sCont.charCache,this._lineHeight=sCont.lineHeight,this._styleNotSet=!1):this._styleNotSet=!0,this):void 0:this;var sCont},SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){return this._init?(this._showNoEllipses=!useEllipses,this):this},SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init)return!1;void 0===text||null===text?text="":"string"!=typeof text&&(text=text.toString());var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=!1,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],i=0,ellipsesStr=this._showNoEllipses?"":"...",lineHeight=this._lineHeight,context=this._context,container=this._container,sCont=this._containerObj,ellipsesWidth=sCont.ellipsesWidth,dotWidth=sCont.dotWidth,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,fastTrim=function fastTrim(str){for(var ws=/\s/,i=(str=str.replace(/^\s\s*/,"")).length;ws.test(str.charAt(i-=1)););return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:!1};if(getWidth=this._getWidthFn(),maxHeight===lineHeight&&(maxHeight*=1.2),container){if(!documentSupport.isBrowserLess){if((hasHTMLTag=slLib.xmlTagRegEx.test(text))?(container.innerHTML=text,smartLabel.oriTextWidth=oriWidth=container.offsetWidth,smartLabel.oriTextHeight=oriHeight=container.offsetHeight):(tmpText=text.replace(slLib.ltgtRegex,function(match){return"<"===match?"<":">"}),getOriSizeImproveObj=this.getOriSize(tmpText,!0),smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width,smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height),oriHeight<=maxHeight&&oriWidth<=maxWidth)return smartLabel.width=smartLabel.oriTextWidth=oriWidth,smartLabel.height=smartLabel.oriTextHeight=oriHeight,smartLabel;if(lineHeight>maxHeight)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=0,smartLabel.height=smartLabel.oriTextHeight=0,smartLabel}if(text=fastTrim(text).replace(/(\s+)/g," "),maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth,!hasHTMLTag){if(len=(oriTextArr=text.split("")).length,trimStr="",tempArr=[],tempChar=oriTextArr[0],this._cache[tempChar]?minWidth=this._cache[tempChar].width:(minWidth=getWidth(tempChar),this._cache[tempChar]={width:minWidth}),maxWidthWithEll>minWidth)i=(tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")).length;else{if(minWidth>maxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;ellipsesStr&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr=""))}if(strWidth=getWidth(tempArr.join("")),strHeight=this._lineHeight,noWrap){for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth))return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=getWidth(smartLabel.text),smartLabel.height=this._lineHeight,smartLabel;return smartLabel.text=tempArr.join(""),smartLabel.width=strWidth,smartLabel.height=this._lineHeight,smartLabel}for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth)){if(lastSpace=text.substr(0,tempArr.length).lastIndexOf(" "),lastDash=text.substr(0,tempArr.length).lastIndexOf("-"),lastSpace>lastIndexBroken?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastSpace,1,"
"),lastIndexBroken=lastSpace,newCharIndex=lastSpace+1):lastDash>lastIndexBroken?(lastDash===tempArr.length-1?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"
-")):(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"-
")),lastIndexBroken=lastDash,newCharIndex=lastDash+1):(tempArr.splice(tempArr.length-1,1,"
"+oriTextArr[i]),lastLineBreak=tempArr.length-2,strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join("")),lastIndexBroken=lastLineBreak,newCharIndex=i),(strHeight+=this._lineHeight)>maxHeight)return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=maxWidth,smartLabel.height=strHeight-this._lineHeight,smartLabel;maxStrWidth=max(maxStrWidth,strWidth),trimStr=null,nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this),strWidth=getWidth(text.substr(newCharIndex,nearestChar||1)),tempArr.length)/g,'$1'),container.innerHTML=text,x=0,y=(spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString)).length;xmaxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;if(minWidth>maxWidthWithEll&&!this._showNoEllipses&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr="")),initialLeft=characterArr[0].elem.offsetLeft,initialTop=characterArr[0].elem.offsetTop,noWrap)for(;imaxWidthWithEll&&(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),container.offsetWidth>maxWidth&&(removeFromIndex=i,i=len));else for(;imaxWidthWithEll?(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),elemRightMostPoint>maxWidth&&(lastSpace=characterArr[i].spaceIdx,lastDash=characterArr[i].dashIdx,lastSpace>lastIndexBroken?(characterArr[lastSpace].elem.innerHTML="
",lastIndexBroken=lastSpace):lastDash>lastIndexBroken?(characterArr[lastDash].elem.innerHTML=lastDash===i?"
-":"-
",lastIndexBroken=lastDash):elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem),elem.offsetHeight+elem.offsetTop>maxHeight?(lastBR?lastBR.parentNode.removeChild(lastBR):lastIndexBroken===lastDash?characterArr[lastDash].elem.innerHTML="-":characterArr[lastSpace].elem.innerHTML=" ",removeFromIndex=i,i=len):removeFromIndexForEllipses=null)):elemLowestPoint>maxHeight&&(removeFromIndex=i,i=len);if(removeFromIndex=removeFromIndexForEllipses;i-=1)(elem=characterArr[i].elem).parentNode.removeChild(elem);for(;i>=0;i-=1)elem=characterArr[i].elem,slLib.classNameBrReg.test(elem.className)?elem.parentNode.removeChild(elem):i=0}return smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&\;/g,"&"),smartLabel.isTruncated&&(smartLabel.text+=ellipsesStr,smartLabel.tooltext=toolText),smartLabel.height=container.offsetHeight,smartLabel.width=container.offsetWidth,smartLabel}return smartLabel.error=new Error("Body Tag Missing!"),smartLabel},SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag){if(!this._init)return!1;var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,indiSizeStore={};if(!detailedCalculationFlag)return this._calCharDimWithCache(text);for(i=0,l=(textArr=text.split("")).length;i]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1$2',spanRemovalRegx:new RegExp("\\]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),ltgtRegex:/<|>/g,brReplaceRegex://gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;return doc.getElementsByClassName?(childRetriverFn="getElementsByClassName",childRetriverString=classNameWithTag,noClassTesting=!0):(childRetriverFn="getElementsByTagName",childRetriverString="span",noClassTesting=!1),{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild)return containerParent.appendChild(container=doc.createElement("DIV")),container.className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),container}else if((body=doc.getElementsByTagName("body")[0])&&body.appendChild)return(container=doc.createElement("DIV")).className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),1,body.appendChild(container),container},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length)return 0;var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;if(difference=maxWidth,charLen=ceil(maxWidth/avgWidth),oriWidthtext.length&&(difference=maxWidth-oriWidth,charLen=text.length);difference>0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}for(;difference<0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}return charLen},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize=styleObj.fontSize||"12px";return styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||1.2*parseInt(fSize,10)+"px",styleObj}}}};exports.default=lib,module.exports=exports.default},function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function value(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"next",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"lock",value:function value(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function value(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:"prop",value:function value(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function value(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i5?maxContainers:5)<20?maxContainers:20,this.maxContainers=maxContainers,this.first=null,this.last=null,this.containers={},this.length=0,this.rootNode=parentContainer,isBrowserLess&&((svg=doc.createElementNS("http://www.w3.org/2000/svg","svg")).setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"),svg.setAttributeNS("http://www.w3.org/2000/svg","height","0"),svg.setAttributeNS("http://www.w3.org/2000/svg","width","0"),this.svgRoot=svg,this.rootNode.appendChild(svg))}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle)void 0!==style[key]&&(keyStr+=slLib.supportedStyle[key]+":"+style[key]+";");if(!keyStr)return!1;if(containerObj=containers[keyStr])this.first!==containerObj&&(containerObj.prev&&(containerObj.prev.next=containerObj.next),containerObj.next&&(containerObj.next.prev=containerObj.prev),containerObj.next=this.first,containerObj.next.prev=containerObj,this.last===containerObj&&(this.last=containerObj.prev),containerObj.prev=null,this.first=containerObj);else{if(len>=max)for(diff=len-max+1;diff--;)this.removeContainer(this.last);containerObj=this.addContainer(keyStr)}return containerObj},ContainerManager.prototype.addContainer=function(keyStr){var node,container;return this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}},container.next=this.first,container.next&&(container.next.prev=container),this.first=container,this.last||(this.last=container),this.length+=1,node=container.node=doc.createElement("div"),this.rootNode.appendChild(node),documentSupport.isIE&&!documentSupport.hasSVG?node.style.setAttribute("cssText",keyStr):node.setAttribute("style",keyStr),node.setAttribute("aria-hidden","true"),node.setAttribute("role","presentation"),node.style.display="inline-block",node.innerHTML=slLib.testStrAvg,container.lineHeight=node.offsetHeight,container.avgCharWidth=node.offsetWidth/3,documentSupport.isBrowserLess?((node=container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("style",keyStr),this.svgRoot.appendChild(node),node.textContent=slLib.testStrAvg,container.lineHeight=node.getBBox().height,container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3,node.textContent="...",container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION,node.textContent=".",container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION):(node.innerHTML="...",container.ellipsesWidth=node.offsetWidth,node.innerHTML=".",container.dotWidth=node.offsetWidth,node.innerHTML=""),container},ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;keyStr&&this.length&&cObj&&(this.length-=1,cObj.prev&&(cObj.prev.next=cObj.next),cObj.next&&(cObj.next.prev=cObj.prev),this.first===cObj&&(this.first=cObj.next),this.last===cObj&&(this.last=cObj.prev),cObj.node.parentNode.removeChild(cObj.node),delete this.containers[keyStr])},ContainerManager.prototype.dispose=function(){var key,containers=this.containers;for(key in this.maxContainers=null,containers)this.removeContainer(containers[key]);this.rootNode.parentNode.removeChild(this.rootNode),this.rootNode=null,this.first=null,this.last=null},module.exports=ContainerManager},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var scales_namespaceObject={};__webpack_require__.r(scales_namespaceObject),__webpack_require__.d(scales_namespaceObject,"scaleLinear",function(){return linear_linear}),__webpack_require__.d(scales_namespaceObject,"scaleThreshold",function(){return threshold_threshold}),__webpack_require__.d(scales_namespaceObject,"scaleLog",function(){return log}),__webpack_require__.d(scales_namespaceObject,"scalePow",function(){return pow}),__webpack_require__.d(scales_namespaceObject,"scaleIdentity",function(){return identity_identity}),__webpack_require__.d(scales_namespaceObject,"scaleOrdinal",function(){return ordinal}),__webpack_require__.d(scales_namespaceObject,"scaleSequential",function(){return sequential}),__webpack_require__.d(scales_namespaceObject,"scaleQuantize",function(){return quantize_quantize}),__webpack_require__.d(scales_namespaceObject,"scaleQuantile",function(){return quantile_quantile}),__webpack_require__.d(scales_namespaceObject,"schemeCategory10",function(){return category10}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20",function(){return category20}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20b",function(){return category20b}),__webpack_require__.d(scales_namespaceObject,"scaleBand",function(){return band}),__webpack_require__.d(scales_namespaceObject,"scaleTime",function(){return src_time});var color_schemes_namespaceObject={};__webpack_require__.r(color_schemes_namespaceObject),__webpack_require__.d(color_schemes_namespaceObject,"schemeDark2",function(){return Dark2}),__webpack_require__.d(color_schemes_namespaceObject,"schemePaired",function(){return Paired}),__webpack_require__.d(color_schemes_namespaceObject,"schemeAccent",function(){return Accent}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel1",function(){return Pastel1}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel2",function(){return Pastel2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet1",function(){return Set1}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet2",function(){return Set2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet3",function(){return Set3}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBlues",function(){return Blues_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBrBG",function(){return BrBG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePRGn",function(){return PRGn_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePiYG",function(){return PiYG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBrBG",function(){return BrBG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePRGn",function(){return PRGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePiYG",function(){return PiYG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuOr",function(){return PuOr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdBu",function(){return RdBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdGy",function(){return RdGy}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlBu",function(){return RdYlBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlGn",function(){return RdYlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateSpectral",function(){return Spectral}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBlues",function(){return Blues}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreens",function(){return Greens}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreys",function(){return Greys}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOranges",function(){return Oranges}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePurples",function(){return Purples}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateReds",function(){return Reds}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateViridis",function(){return sequential_multi_viridis}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateInferno",function(){return viridis_inferno}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateMagma",function(){return viridis_magma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePlasma",function(){return viridis_plasma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateWarm",function(){return rainbow_warm}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCool",function(){return rainbow_cool}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCubehelixDefault",function(){return sequential_multi_cubehelix}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuGn",function(){return BuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuPu",function(){return BuPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGnBu",function(){return GnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOrRd",function(){return OrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBuGn",function(){return PuBuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBu",function(){return PuBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuRd",function(){return PuRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdPu",function(){return RdPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGnBu",function(){return YlGnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGn",function(){return YlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrBr",function(){return YlOrBr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrRd",function(){return YlOrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRainbow",function(){return sequential_multi_rainbow});var namespace_namespaceObject={};__webpack_require__.r(namespace_namespaceObject),__webpack_require__.d(namespace_namespaceObject,"UNIT_GLOBAL_NAMESPACE",function(){return UNIT_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"UNIT_LOCAL_NAMESPACE",function(){return UNIT_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_LOCAL_NAMESPACE",function(){return LAYER_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_GLOBAL_NAMESPACE",function(){return LAYER_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_GLOBAL_NAMESPACE",function(){return GROUP_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_LOCAL_NAMESPACE",function(){return GROUP_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_LOCAL_NAMESPACE",function(){return CANVAS_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_GLOBAL_NAMESPACE",function(){return CANVAS_GLOBAL_NAMESPACE});var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,"DRAG",function(){return DRAG}),__webpack_require__.d(actions_namespaceObject,"HOVER",function(){return HOVER}),__webpack_require__.d(actions_namespaceObject,"SELECTIONDRAG",function(){return SELECTIONDRAG}),__webpack_require__.d(actions_namespaceObject,"CLICK",function(){return CLICK}),__webpack_require__.d(actions_namespaceObject,"LONGTOUCH",function(){return LONGTOUCH}),__webpack_require__.d(actions_namespaceObject,"TOUCHDRAG",function(){return TOUCHDRAG}),__webpack_require__.d(actions_namespaceObject,"ALL_ACTIONS",function(){return ALL_ACTIONS});var enums_selection_namespaceObject={};__webpack_require__.r(enums_selection_namespaceObject),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_ENTRY",function(){return SELECTION_NEW_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_EXIT",function(){return SELECTION_NEW_EXIT}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NULL",function(){return SELECTION_NULL}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_ENTRY",function(){return SELECTION_OLD_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_EXIT",function(){return SELECTION_OLD_EXIT});var behaviours_namespaceObject={};__webpack_require__.r(behaviours_namespaceObject),__webpack_require__.d(behaviours_namespaceObject,"BRUSH",function(){return BRUSH}),__webpack_require__.d(behaviours_namespaceObject,"HIGHLIGHT",function(){return HIGHLIGHT}),__webpack_require__.d(behaviours_namespaceObject,"TOOLTIP",function(){return behaviours_TOOLTIP}),__webpack_require__.d(behaviours_namespaceObject,"FILTER",function(){return FILTER}),__webpack_require__.d(behaviours_namespaceObject,"SELECT",function(){return SELECT});var behavioural_namespaceObject={};__webpack_require__.r(behavioural_namespaceObject),__webpack_require__.d(behavioural_namespaceObject,"HighlightBeahviour",function(){return highlight_HighlightBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"BrushBehaviour",function(){return brush_BrushBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"FilterBehaviour",function(){return filter_FilterBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"SelectBehaviour",function(){return select_SelectBehaviour});var side_effects_namespaceObject={};__webpack_require__.r(side_effects_namespaceObject),__webpack_require__.d(side_effects_namespaceObject,"ANCHORS",function(){return side_effects_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"BRUSH_ANCHORS",function(){return side_effects_BRUSH_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"PERSISTENT_ANCHORS",function(){return side_effects_PERSISTENT_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"FILTER",function(){return side_effects_FILTER}),__webpack_require__.d(side_effects_namespaceObject,"HIGHLIGHTER",function(){return side_effects_HIGHLIGHTER}),__webpack_require__.d(side_effects_namespaceObject,"CROSSLINE",function(){return CROSSLINE}),__webpack_require__.d(side_effects_namespaceObject,"TOOLTIP",function(){return side_effects_TOOLTIP});var src_side_effects_namespaceObject={};__webpack_require__.r(src_side_effects_namespaceObject),__webpack_require__.d(src_side_effects_namespaceObject,"SelectionBox",function(){return selection_box}),__webpack_require__.d(src_side_effects_namespaceObject,"Tooltip",function(){return side_effects_tooltip_Tooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"Crossline",function(){return crossline_Crossline}),__webpack_require__.d(src_side_effects_namespaceObject,"PlotHighlighter",function(){return plot_highlighter_PlotHighlighter}),__webpack_require__.d(src_side_effects_namespaceObject,"FilterEffect",function(){return FilterEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"PersistentAnchors",function(){return persistent_anchors_PersistentAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"BrushAnchors",function(){return brush_anchors_BrushAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"AnchorEffect",function(){return anchors_AnchorEffect});var axis_orientation_namespaceObject={};__webpack_require__.r(axis_orientation_namespaceObject),__webpack_require__.d(axis_orientation_namespaceObject,"BOTTOM",function(){return axis_orientation_BOTTOM}),__webpack_require__.d(axis_orientation_namespaceObject,"TOP",function(){return axis_orientation_TOP}),__webpack_require__.d(axis_orientation_namespaceObject,"LEFT",function(){return axis_orientation_LEFT}),__webpack_require__.d(axis_orientation_namespaceObject,"RIGHT",function(){return axis_orientation_RIGHT}),__webpack_require__.d(axis_orientation_namespaceObject,"axisOrientationMap",function(){return axisOrientationMap});var scale_type_namespaceObject={};__webpack_require__.r(scale_type_namespaceObject),__webpack_require__.d(scale_type_namespaceObject,"LINEAR",function(){return LINEAR}),__webpack_require__.d(scale_type_namespaceObject,"BAND",function(){return BAND}),__webpack_require__.d(scale_type_namespaceObject,"TIME",function(){return TIME}),__webpack_require__.d(scale_type_namespaceObject,"COLOR",function(){return scale_type_COLOR}),__webpack_require__.d(scale_type_namespaceObject,"ORDINAL",function(){return ORDINAL}),__webpack_require__.d(scale_type_namespaceObject,"QUANTIZE",function(){return QUANTIZE}),__webpack_require__.d(scale_type_namespaceObject,"QUANTILE",function(){return QUANTILE}),__webpack_require__.d(scale_type_namespaceObject,"LOG",function(){return LOG}),__webpack_require__.d(scale_type_namespaceObject,"POW",function(){return POW}),__webpack_require__.d(scale_type_namespaceObject,"IDENTITY",function(){return scale_type_IDENTITY}),__webpack_require__.d(scale_type_namespaceObject,"SEQUENTIAL",function(){return SEQUENTIAL}),__webpack_require__.d(scale_type_namespaceObject,"THRESHOLD",function(){return THRESHOLD});var layer_types_namespaceObject={};__webpack_require__.r(layer_types_namespaceObject),__webpack_require__.d(layer_types_namespaceObject,"AREA_LAYER",function(){return layer_types_AREA_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"ARC_LAYER",function(){return layer_types_ARC_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"LINE_LAYER",function(){return layer_types_LINE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TEXT_LAYER",function(){return layer_types_TEXT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"POINT_LAYER",function(){return layer_types_POINT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BAR_LAYER",function(){return layer_types_BAR_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TICK_LAYER",function(){return layer_types_TICK_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"SIMPLE_LAYER",function(){return layer_types_SIMPLE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BASE_LAYER",function(){return layer_types_BASE_LAYER});var firebolt_behavioural_namespaceObject={};__webpack_require__.r(firebolt_behavioural_namespaceObject),__webpack_require__.d(firebolt_behavioural_namespaceObject,"SelectBehaviour",function(){return behavioural_select_SelectBehaviour});var firebolt_side_effects_namespaceObject={};__webpack_require__.r(firebolt_side_effects_namespaceObject),__webpack_require__.d(firebolt_side_effects_namespaceObject,"SelectionBox",function(){return side_effects_selection_box}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendHighlighter",function(){return legend_highlighter_LegendHighlighter});var operators_namespaceObject={};__webpack_require__.r(operators_namespaceObject),__webpack_require__.d(operators_namespaceObject,"share",function(){return operators_share}),__webpack_require__.d(operators_namespaceObject,"html",function(){return operators_html});var dist_datamodel=__webpack_require__(0),datamodel_default=__webpack_require__.n(dist_datamodel),ascending=function(a,b){return ab?1:a>=b?0:NaN},bisector=function(compare){return 1===compare.length&&(compare=function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}(compare)),{left:function left(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)<0?lo=mid+1:hi=mid}return lo},right:function right(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)>0?hi=mid:lo=mid+1}return lo}}};var ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right,bisect=(ascendingBisect.left,bisectRight);var number=function(x){return null===x?NaN:+x},array_array=Array.prototype,src_range=(array_array.slice,array_array.map,function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;for(var i=-1,n=0|Math.max(0,Math.ceil((stop-start)/step)),range=new Array(n);++i0)return[start];if((reverse=stop0)for(start=Math.ceil(start/step),stop=Math.floor(stop/step),ticks=new Array(n=Math.ceil(stop-start+1));++i=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;return error>=e10?step1*=10:error>=e5?step1*=5:error>=e2&&(step1*=2),stop=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values);return value0+(+valueof(values[i0+1],i0+1,values)-value0)*(i-i0)}};function map_Map(){}function map_map(object,f){var map=new map_Map;if(object instanceof map_Map)object.each(function(value,key){map.set(key,value)});else if(Array.isArray(object)){var o,i=-1,n=object.length;if(null==f)for(;++i=keys.length)return null!=_sortValues&&array.sort(_sortValues),null!=_rollup?_rollup(array):array;for(var keyValue,value,values,i=-1,n=array.length,key=keys[depth++],valuesByKey=src_map(),result=createResult();++ikeys.length)return map;var array,sortKey=_sortKeys[depth-1];return null!=_rollup&&depth>=keys.length?array=map.entries():(array=[],map.each(function(v,k){array.push({key:k,values:_entries(v,depth)})})),null!=sortKey?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}(apply(array,0,createMap,setMap),0)},key:function key(d){return keys.push(d),nest},sortKeys:function sortKeys(order){return _sortKeys[keys.length-1]=order,nest},sortValues:function sortValues(order){return _sortValues=order,nest},rollup:function rollup(f){return _rollup=f,nest}}};function createObject(){return{}}function setObject(object,key,value){object[key]=value}function createMap(){return src_map()}function setMap(map,key,value){map.set(key,value)}function set_Set(){}var proto=src_map.prototype;function set_set(object,f){var set=new set_Set;if(object instanceof set_Set)object.each(function(value){set.add(value)});else if(object){var i=-1,n=object.length;if(null==f)for(;++i1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo)),hiIndex=getClosestIndexOf(values,hi),b=lo===hi?a:Math.max(a,hiIndex-1),reverse&&(t=a,a=n-b,b=n-t),a>b?void 0:domain().slice(a,b+1)},scale.invert=function(r0,r1){var a,t,lo=+r0,hi=arguments.length>1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo,"left")),domain()[reverse?n-a:a]},rescale()}function getClosestIndexOf(arr,value,side){for(var highVal,mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1:high}var define=function(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype,prototype.constructor=constructor};function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var reI="\\s*([+-]?\\d+)\\s*",reN="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",reP="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",reHex3=/^#([0-9a-f]{3})$/,reHex6=/^#([0-9a-f]{6})$/,reRgbInteger=new RegExp("^rgb\\("+[reI,reI,reI]+"\\)$"),reRgbPercent=new RegExp("^rgb\\("+[reP,reP,reP]+"\\)$"),reRgbaInteger=new RegExp("^rgba\\("+[reI,reI,reI,reN]+"\\)$"),reRgbaPercent=new RegExp("^rgba\\("+[reP,reP,reP,reN]+"\\)$"),reHslPercent=new RegExp("^hsl\\("+[reN,reP,reP]+"\\)$"),reHslaPercent=new RegExp("^hsla\\("+[reN,reP,reP,reN]+"\\)$"),named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(format){var m;return format=(format+"").trim().toLowerCase(),(m=reHex3.exec(format))?new Rgb((m=parseInt(m[1],16))>>8&15|m>>4&240,m>>4&15|240&m,(15&m)<<4|15&m,1):(m=reHex6.exec(format))?rgbn(parseInt(m[1],16)):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(255*m[1]/100,255*m[2]/100,255*m[3]/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(255*m[1]/100,255*m[2]/100,255*m[3]/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):"transparent"===format?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,255&n,1)}function rgba(r,g,b,a){return a<=0&&(r=g=b=NaN),new Rgb(r,g,b,a)}function rgbConvert(o){return o instanceof Color||(o=color_color(o)),o?new Rgb((o=o.rgb()).r,o.g,o.b,o.opacity):new Rgb}function color_rgb(r,g,b,opacity){return 1===arguments.length?rgbConvert(r):new Rgb(r,g,b,null==opacity?1:opacity)}function Rgb(r,g,b,opacity){this.r=+r,this.g=+g,this.b=+b,this.opacity=+opacity}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function hex(value){return((value=Math.max(0,Math.min(255,Math.round(value)||0)))<16?"0":"")+value.toString(16)}function hsla(h,s,l,a){return a<=0?h=s=l=NaN:l<=0||l>=1?h=s=NaN:s<=0&&(h=NaN),new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color_color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;var r=(o=o.rgb()).r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;return s?(h=r===max?(g-b)/s+6*(g0&&l<1?0:h,new Hsl(h,s,l,o.opacity)}function hsl(h,s,l,opacity){return 1===arguments.length?hslConvert(h):new Hsl(h,s,l,null==opacity?1:opacity)}function Hsl(h,s,l,opacity){this.h=+h,this.s=+s,this.l=+l,this.opacity=+opacity}function hsl2rgb(h,m1,m2){return 255*(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)}define(Color,color_color,{copy:function copy(channels){return Object.assign(new this.constructor,this,channels)},displayable:function displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,color_rgb,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb:function rgb(){return this},displayable:function displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb:function rgb(){var h=this.h%360+360*(this.h<0),s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},displayable:function displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function formatHsl(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var deg2rad=Math.PI/180,rad2deg=180/Math.PI,Xn=.96422,Yn=1,Zn=.82521,lab_t0=4/29,lab_t1=6/29,t2=3*lab_t1*lab_t1,t3=lab_t1*lab_t1*lab_t1;function labConvert(o){if(o instanceof Lab)return new Lab(o.l,o.a,o.b,o.opacity);if(o instanceof Hcl)return hcl2lab(o);o instanceof Rgb||(o=rgbConvert(o));var x,z,r=rgb2lrgb(o.r),g=rgb2lrgb(o.g),b=rgb2lrgb(o.b),y=xyz2lab((.2225045*r+.7168786*g+.0606169*b)/Yn);return r===g&&g===b?x=z=y:(x=xyz2lab((.4360747*r+.3850649*g+.1430804*b)/Xn),z=xyz2lab((.0139322*r+.0971045*g+.7141733*b)/Zn)),new Lab(116*y-16,500*(x-y),200*(y-z),o.opacity)}function lab(l,a,b,opacity){return 1===arguments.length?labConvert(l):new Lab(l,a,b,null==opacity?1:opacity)}function Lab(l,a,b,opacity){this.l=+l,this.a=+a,this.b=+b,this.opacity=+opacity}function xyz2lab(t){return t>t3?Math.pow(t,1/3):t/t2+lab_t0}function lab2xyz(t){return t>lab_t1?t*t*t:t2*(t-lab_t0)}function lrgb2rgb(x){return 255*(x<=.0031308?12.92*x:1.055*Math.pow(x,1/2.4)-.055)}function rgb2lrgb(x){return(x/=255)<=.04045?x/12.92:Math.pow((x+.055)/1.055,2.4)}function hclConvert(o){if(o instanceof Hcl)return new Hcl(o.h,o.c,o.l,o.opacity);if(o instanceof Lab||(o=labConvert(o)),0===o.a&&0===o.b)return new Hcl(NaN,0180||d<-180?d-360*Math.round(d/360):d):src_constant(isNaN(a)?b:a)}function gamma(y){return 1==(y=+y)?nogamma:function(a,b){return b-a?function exponential(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y)}}(a,b,y):src_constant(isNaN(a)?b:a)}}function nogamma(a,b){var d=b-a;return d?linear(a,d):src_constant(isNaN(a)?b:a)}var src_rgb=function rgbGamma(y){var color=gamma(y);function rgb(start,end){var r=color((start=color_rgb(start)).r,(end=color_rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.r=r(t),start.g=g(t),start.b=b(t),start.opacity=opacity(t),start+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(spline){return function(colors){var i,color,n=colors.length,r=new Array(n),g=new Array(n),b=new Array(n);for(i=0;i=1?(t=1,n-1):Math.floor(t*n),v1=values[i],v2=values[i+1],v0=i>0?values[i-1]:2*v1-v2,v3=ibi&&(bs=b.slice(bi,bs),s[i]?s[i]+=bs:s[++i]=bs),(am=am[0])===(bm=bm[0])?s[i]?s[i]+=bm:s[++i]=bm:(s[++i]=null,q.push({i:i,x:src_number(am,bm)})),bi=reB.lastIndex;return bi180?b+=360:b-a>180&&(a+=360),q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:src_number(a,b)})):b&&s.push(pop(s)+"rotate("+b+degParen)}(a.rotate,b.rotate,s,q),function skewX(a,b,s,q){a!==b?q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:src_number(a,b)}):b&&s.push(pop(s)+"skewX("+b+degParen)}(a.skewX,b.skewX,s,q),function scale(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:src_number(xa,xb)},{i:i-2,x:src_number(ya,yb)})}else 1===xb&&1===yb||s.push(pop(s)+"scale("+xb+","+yb+")")}(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q),a=b=null,function(t){for(var o,i=-1,n=q.length;++i2?polymap:bimap,output=input=null,scale}function scale(x){return(output||(output=piecewise(domain,range,clamp?function deinterpolateClamp(deinterpolate){return function(a,b){var d=deinterpolate(a=+a,b=+b);return function(x){return x<=a?0:x>=b?1:d(x)}}}(deinterpolate):deinterpolate,interpolate)))(+x)}return scale.invert=function(y){return(input||(input=piecewise(range,domain,deinterpolateLinear,clamp?function reinterpolateClamp(reinterpolate){return function(a,b){var r=reinterpolate(a=+a,b=+b);return function(t){return t<=0?a:t>=1?b:r(t)}}}(reinterpolate):reinterpolate)))(+y)},scale.domain=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),rescale()):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),rescale()):range.slice()},scale.rangeRound=function(_){return range=array_slice.call(_),interpolate=src_round,rescale()},scale.clamp=function(_){return arguments.length?(clamp=!!_,rescale()):clamp},scale.interpolate=function(_){return arguments.length?(interpolate=_,rescale()):interpolate},rescale()}var formatDecimal=function(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]},src_exponent=function(x){return(x=formatDecimal(Math.abs(x)))?x[1]:NaN},re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]})}function FormatSpecifier(specifier){this.fill=void 0===specifier.fill?" ":specifier.fill+"",this.align=void 0===specifier.align?">":specifier.align+"",this.sign=void 0===specifier.sign?"-":specifier.sign+"",this.symbol=void 0===specifier.symbol?"":specifier.symbol+"",this.zero=!!specifier.zero,this.width=void 0===specifier.width?void 0:+specifier.width,this.comma=!!specifier.comma,this.precision=void 0===specifier.precision?void 0:+specifier.precision,this.trim=!!specifier.trim,this.type=void 0===specifier.type?"":specifier.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var prefixExponent,defaultLocale_locale,defaultLocale_format,defaultLocale_formatPrefix,formatTrim=function(s){out:for(var i1,n=s.length,i=1,i0=-1;i0){if(!+s[i])break out;i0=0}}return i0>0?s.slice(0,i0)+s.slice(i1+1):s},formatRounded=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")},formatTypes={"%":function _(x,p){return(100*x).toFixed(p)},b:function b(x){return Math.round(x).toString(2)},c:function c(x){return x+""},d:function d(x){return Math.round(x).toString(10)},e:function e(x,p){return x.toExponential(p)},f:function f(x,p){return x.toFixed(p)},g:function g(x,p){return x.toPrecision(p)},o:function o(x){return Math.round(x).toString(8)},p:function p(x,_p){return formatRounded(100*x,_p)},r:formatRounded,s:function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=3*Math.max(-8,Math.min(8,Math.floor(exponent/3))))+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]},X:function X(x){return Math.round(x).toString(16).toUpperCase()},x:function x(_x){return Math.round(_x).toString(16)}},src_identity=function(x){return x},locale_map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],src_locale=function(locale){var group=void 0===locale.grouping||void 0===locale.thousands?src_identity:function(grouping,thousands){return function(value,width){for(var i=value.length,t=[],j=0,g=grouping[0],length=0;i>0&&g>0&&(length+g+1>width&&(g=Math.max(1,width-length)),t.push(value.substring(i-=g,i+g)),!((length+=g+1)>width));)g=grouping[j=(j+1)%grouping.length];return t.reverse().join(thousands)}}(locale_map.call(locale.grouping,Number),locale.thousands+""),currencyPrefix=void 0===locale.currency?"":locale.currency[0]+"",currencySuffix=void 0===locale.currency?"":locale.currency[1]+"",decimal=void 0===locale.decimal?".":locale.decimal+"",numerals=void 0===locale.numerals?src_identity:function(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}}(locale_map.call(locale.numerals,String)),percent=void 0===locale.percent?"%":locale.percent+"",minus=void 0===locale.minus?"-":locale.minus+"",nan=void 0===locale.nan?"NaN":locale.nan+"";function newFormat(specifier){var fill=(specifier=formatSpecifier(specifier)).fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;"n"===type?(comma=!0,type="g"):formatTypes[type]||(void 0===precision&&(precision=12),trim=!0,type="g"),(zero||"0"===fill&&"="===align)&&(zero=!0,fill="0",align="=");var prefix="$"===symbol?currencyPrefix:"#"===symbol&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix="$"===symbol?currencySuffix:/[%p]/.test(type)?percent:"",formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);function format(value){var i,n,c,valuePrefix=prefix,valueSuffix=suffix;if("c"===type)valueSuffix=formatType(value)+valueSuffix,value="";else{var valueNegative=(value=+value)<0;if(value=isNaN(value)?nan:formatType(Math.abs(value),precision),trim&&(value=formatTrim(value)),valueNegative&&0==+value&&(valueNegative=!1),valuePrefix=(valueNegative?"("===sign?sign:minus:"-"===sign||"("===sign?"":sign)+valuePrefix,valueSuffix=("s"===type?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&"("===sign?")":""),maybeSuffix)for(i=-1,n=value.length;++i(c=value.charCodeAt(i))||c>57){valueSuffix=(46===c?decimal+value.slice(i+1):value.slice(i))+valueSuffix,value=value.slice(0,i);break}}comma&&!zero&&(value=group(value,1/0));var length=valuePrefix.length+value.length+valueSuffix.length,padding=length>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix}return numerals(value)}return precision=void 0===precision?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision)),format.toString=function(){return specifier+""},format}return{format:newFormat,formatPrefix:function formatPrefix(specifier,value){var f=newFormat(((specifier=formatSpecifier(specifier)).type="f",specifier)),e=3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3))),k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}}};!function defaultLocale(definition){return defaultLocale_locale=src_locale(definition),defaultLocale_format=defaultLocale_locale.format,defaultLocale_formatPrefix=defaultLocale_locale.formatPrefix,defaultLocale_locale}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var src_tickFormat=function(domain,count,specifier){var precision,start=domain[0],stop=domain[domain.length-1],step=tickStep(start,stop,null==count?10:count);switch((specifier=formatSpecifier(null==specifier?",f":specifier)).type){case"s":var value=Math.max(Math.abs(start),Math.abs(stop));return null!=specifier.precision||isNaN(precision=function(step,value){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3)))-src_exponent(Math.abs(step)))}(step,value))||(specifier.precision=precision),defaultLocale_formatPrefix(specifier,value);case"":case"e":case"g":case"p":case"r":null!=specifier.precision||isNaN(precision=function(step,max){return step=Math.abs(step),max=Math.abs(max)-step,Math.max(0,src_exponent(max)-src_exponent(step))+1}(step,Math.max(Math.abs(start),Math.abs(stop))))||(specifier.precision=precision-("e"===specifier.type));break;case"f":case"%":null!=specifier.precision||isNaN(precision=function(step){return Math.max(0,-src_exponent(Math.abs(step)))}(step))||(specifier.precision=precision-2*("%"===specifier.type))}return defaultLocale_format(specifier)};function linearish(scale){var domain=scale.domain;return scale.ticks=function(count){var d=domain();return src_ticks(d[0],d[d.length-1],null==count?10:count)},scale.tickFormat=function(count,specifier){return src_tickFormat(domain(),count,specifier)},scale.nice=function(count){null==count&&(count=10);var step,d=domain(),i0=0,i1=d.length-1,start=d[i0],stop=d[i1];return stop0?step=tickIncrement(start=Math.floor(start/step)*step,stop=Math.ceil(stop/step)*step,count):step<0&&(step=tickIncrement(start=Math.ceil(start*step)/step,stop=Math.floor(stop*step)/step,count)),step>0?(d[i0]=Math.floor(start/step)*step,d[i1]=Math.ceil(stop/step)*step,domain(d)):step<0&&(d[i0]=Math.ceil(start*step)/step,d[i1]=Math.floor(stop*step)/step,domain(d)),scale},scale}function linear_linear(){var scale=continuous(deinterpolateLinear,src_number);return scale.copy=function(){return copy(scale,linear_linear())},linearish(scale)}function identity_identity(){var domain=[0,1];function scale(x){return+x}return scale.invert=scale,scale.domain=scale.range=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),scale):domain.slice()},scale.copy=function(){return identity_identity().domain(domain)},linearish(scale)}var nice=function(domain,interval){var t,i0=0,i1=(domain=domain.slice()).length-1,x0=domain[i0],x1=domain[i1];return x10){for(;iv)break;z.push(t)}}else for(;i=1;--k)if(!((t=p*k)v)break;z.push(t)}}else z=src_ticks(i,j,Math.min(j-i,n)).map(pows);return r?z.reverse():z},scale.tickFormat=function(count,specifier){if(null==specifier&&(specifier=10===base?".0e":","),"function"!=typeof specifier&&(specifier=defaultLocale_format(specifier)),count===1/0)return specifier;null==count&&(count=10);var k=Math.max(1,base*count/scale.ticks().length);return function(d){var i=d/pows(Math.round(logs(d)));return i*base0?thresholds[i-1]:domain[0],i=n?[domain[n-1],x1]:[domain[i-1],domain[i]]},scale.copy=function(){return quantize_quantize().domain([x0,x1]).range(range)},linearish(scale)}function threshold_threshold(){var domain=[.5],range=[0,1],n=1;function scale(x){if(x<=x)return range[bisect(domain,x,0,n)]}return scale.domain=function(_){return arguments.length?(domain=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):range.slice()},scale.invertExtent=function(y){var i=range.indexOf(y);return[domain[i-1],domain[i]]},scale.copy=function(){return threshold_threshold().domain(domain).range(range)},scale}var interval_t0=new Date,interval_t1=new Date;function newInterval(floori,offseti,count,field){function interval(date){return floori(date=new Date(+date)),date}return interval.floor=interval,interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),floori(date),date},interval.round=function(date){var d0=interval(date),d1=interval.ceil(date);return date-d00))return range;do{range.push(previous=new Date(+start)),offseti(start,step),floori(start)}while(previous=date)for(;floori(date),!test(date);)date.setTime(date-1)},function(date,step){if(date>=date)if(step<0)for(;++step<=0;)for(;offseti(date,-1),!test(date););else for(;--step>=0;)for(;offseti(date,1),!test(date););})},count&&(interval.count=function(start,end){return interval_t0.setTime(+start),interval_t1.setTime(+end),floori(interval_t0),floori(interval_t1),Math.floor(count(interval_t0,interval_t1))},interval.every=function(step){return step=Math.floor(step),isFinite(step)&&step>0?step>1?interval.filter(field?function(d){return field(d)%step==0}:function(d){return interval.count(0,d)%step==0}):interval:null}),interval}var millisecond_millisecond=newInterval(function(){},function(date,step){date.setTime(+date+step)},function(start,end){return end-start});millisecond_millisecond.every=function(k){return k=Math.floor(k),isFinite(k)&&k>0?k>1?newInterval(function(date){date.setTime(Math.floor(date/k)*k)},function(date,step){date.setTime(+date+step*k)},function(start,end){return(end-start)/k}):millisecond_millisecond:null};var src_millisecond=millisecond_millisecond,durationMinute=(millisecond_millisecond.range,6e4),durationWeek=6048e5,second_second=newInterval(function(date){date.setTime(date-date.getMilliseconds())},function(date,step){date.setTime(+date+1e3*step)},function(start,end){return(end-start)/1e3},function(date){return date.getUTCSeconds()}),src_second=second_second,minute_minute=(second_second.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds())},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getMinutes()})),src_minute=minute_minute,hour_hour=(minute_minute.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds()-date.getMinutes()*durationMinute)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getHours()})),src_hour=hour_hour,day_day=(hour_hour.range,newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/864e5},function(date){return date.getDate()-1})),src_day=day_day;day_day.range;function weekday(i){return newInterval(function(date){date.setDate(date.getDate()-(date.getDay()+7-i)%7),date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+7*step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6),month_month=(sunday.range,monday.range,tuesday.range,wednesday.range,thursday.range,friday.range,saturday.range,newInterval(function(date){date.setDate(1),date.setHours(0,0,0,0)},function(date,step){date.setMonth(date.getMonth()+step)},function(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())},function(date){return date.getMonth()})),src_month=month_month,year_year=(month_month.range,newInterval(function(date){date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()},function(date){return date.getFullYear()}));year_year.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setFullYear(Math.floor(date.getFullYear()/k)*k),date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step*k)}):null};var src_year=year_year,utcMinute=(year_year.range,newInterval(function(date){date.setUTCSeconds(0,0)},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getUTCMinutes()})),utcHour=(utcMinute.range,newInterval(function(date){date.setUTCMinutes(0,0,0)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getUTCHours()})),utcDay=(utcHour.range,newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5},function(date){return date.getUTCDate()-1})),src_utcDay=utcDay;utcDay.range;function utcWeekday(i){return newInterval(function(date){date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+7*step)},function(start,end){return(end-start)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6),utcMonth=(utcSunday.range,utcMonday.range,utcTuesday.range,utcWednesday.range,utcThursday.range,utcFriday.range,utcSaturday.range,newInterval(function(date){date.setUTCDate(1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCMonth(date.getUTCMonth()+step)},function(start,end){return end.getUTCMonth()-start.getUTCMonth()+12*(end.getUTCFullYear()-start.getUTCFullYear())},function(date){return date.getUTCMonth()})),utcYear=(utcMonth.range,newInterval(function(date){date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()},function(date){return date.getUTCFullYear()}));utcYear.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setUTCFullYear(Math.floor(date.getUTCFullYear()/k)*k),date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step*k)}):null};var src_utcYear=utcYear;utcYear.range;function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);return date.setFullYear(d.y),date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));return date.setUTCFullYear(d.y),date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newYear(y){return{y:y,m:0,d:1,H:0,M:0,S:0,L:0}}var src_defaultLocale_locale,timeFormat,utcFormat,utcParse,pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function locale_pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i,i+6));return n?(d.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseMicroseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+6));return n?(d.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function parseUnixTimestamp(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=+n[0],i+n[0].length):-1}function parseUnixTimestampSeconds(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=1e3*+n[0],i+n[0].length):-1}function formatDayOfMonth(d,p){return locale_pad(d.getDate(),p,2)}function formatHour24(d,p){return locale_pad(d.getHours(),p,2)}function formatHour12(d,p){return locale_pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return locale_pad(1+src_day.count(src_year(d),d),p,3)}function formatMilliseconds(d,p){return locale_pad(d.getMilliseconds(),p,3)}function formatMicroseconds(d,p){return formatMilliseconds(d,p)+"000"}function formatMonthNumber(d,p){return locale_pad(d.getMonth()+1,p,2)}function formatMinutes(d,p){return locale_pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return locale_pad(d.getSeconds(),p,2)}function formatWeekdayNumberMonday(d){var day=d.getDay();return 0===day?7:day}function formatWeekNumberSunday(d,p){return locale_pad(sunday.count(src_year(d),d),p,2)}function formatWeekNumberISO(d,p){var day=d.getDay();return d=day>=4||0===day?thursday(d):thursday.ceil(d),locale_pad(thursday.count(src_year(d),d)+(4===src_year(d).getDay()),p,2)}function formatWeekdayNumberSunday(d){return d.getDay()}function formatWeekNumberMonday(d,p){return locale_pad(monday.count(src_year(d),d),p,2)}function locale_formatYear(d,p){return locale_pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return locale_pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+locale_pad(z/60|0,"0",2)+locale_pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return locale_pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return locale_pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return locale_pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return locale_pad(1+src_utcDay.count(src_utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return locale_pad(d.getUTCMilliseconds(),p,3)}function formatUTCMicroseconds(d,p){return formatUTCMilliseconds(d,p)+"000"}function formatUTCMonthNumber(d,p){return locale_pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return locale_pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return locale_pad(d.getUTCSeconds(),p,2)}function formatUTCWeekdayNumberMonday(d){var dow=d.getUTCDay();return 0===dow?7:dow}function formatUTCWeekNumberSunday(d,p){return locale_pad(utcSunday.count(src_utcYear(d),d),p,2)}function formatUTCWeekNumberISO(d,p){var day=d.getUTCDay();return d=day>=4||0===day?utcThursday(d):utcThursday.ceil(d),locale_pad(utcThursday.count(src_utcYear(d),d)+(4===src_utcYear(d).getUTCDay()),p,2)}function formatUTCWeekdayNumberSunday(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return locale_pad(utcMonday.count(src_utcYear(d),d),p,2)}function formatUTCYear(d,p){return locale_pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return locale_pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(d){return+d}function formatUnixTimestampSeconds(d){return Math.floor(+d/1e3)}!function defaultLocale_defaultLocale(definition){return src_defaultLocale_locale=function formatLocale(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_weekdays=locale.days,locale_shortWeekdays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths,periodRe=formatRe(locale_periods),periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths),formats={a:function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]},A:function formatWeekday(d){return locale_weekdays[d.getDay()]},b:function formatShortMonth(d){return locale_shortMonths[d.getMonth()]},B:function formatMonth(d){return locale_months[d.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},utcFormats={a:function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]},A:function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]},b:function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]},B:function formatUTCMonth(d){return locale_months[d.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},parses={a:function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},A:function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},b:function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup[n[0].toLowerCase()],i+n[0].length):-1},B:function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup[n[0].toLowerCase()],i+n[0].length):-1},c:function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(d,string,i){var n=periodRe.exec(string.slice(i));return n?(d.p=periodLookup[n[0].toLowerCase()],i+n[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)},X:function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(specifier,formats){return function(date){var c,pad,format,string=[],i=-1,j=0,n=specifier.length;for(date instanceof Date||(date=new Date(+date));++i53)return null;"w"in d||(d.w=1),"Z"in d?(week=(day=(week=utcDate(newYear(d.y))).getUTCDay())>4||0===day?utcMonday.ceil(week):utcMonday(week),week=src_utcDay.offset(week,7*(d.V-1)),d.y=week.getUTCFullYear(),d.m=week.getUTCMonth(),d.d=week.getUTCDate()+(d.w+6)%7):(week=(day=(week=newDate(newYear(d.y))).getDay())>4||0===day?monday.ceil(week):monday(week),week=src_day.offset(week,7*(d.V-1)),d.y=week.getFullYear(),d.m=week.getMonth(),d.d=week.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),day="Z"in d?utcDate(newYear(d.y)).getUTCDay():newDate(newYear(d.y)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(day+5)%7:d.w+7*d.U-(day+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,utcDate(d)):newDate(d)}}function parseSpecifier(d,specifier,string,j){for(var c,parse,i=0,n=specifier.length,m=string.length;i=m)return-1;if(37===(c=specifier.charCodeAt(i++))){if(c=specifier.charAt(i++),!(parse=parses[c in pads?specifier.charAt(i++):c])||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++))return-1}return j}return formats.x=newFormat(locale_date,formats),formats.X=newFormat(locale_time,formats),formats.c=newFormat(locale_dateTime,formats),utcFormats.x=newFormat(locale_date,utcFormats),utcFormats.X=newFormat(locale_time,utcFormats),utcFormats.c=newFormat(locale_dateTime,utcFormats),{format:function format(specifier){var f=newFormat(specifier+="",formats);return f.toString=function(){return specifier},f},parse:function parse(specifier){var p=newParse(specifier+="",localDate);return p.toString=function(){return specifier},p},utcFormat:function utcFormat(specifier){var f=newFormat(specifier+="",utcFormats);return f.toString=function(){return specifier},f},utcParse:function utcParse(specifier){var p=newParse(specifier,utcDate);return p.toString=function(){return specifier},p}}}(definition),timeFormat=src_defaultLocale_locale.format,src_defaultLocale_locale.parse,utcFormat=src_defaultLocale_locale.utcFormat,utcParse=src_defaultLocale_locale.utcParse,src_defaultLocale_locale}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||utcParse("%Y-%m-%dT%H:%M:%S.%LZ");var time_durationSecond=1e3,time_durationMinute=60*time_durationSecond,time_durationHour=60*time_durationMinute,time_durationDay=24*time_durationHour,time_durationWeek=7*time_durationDay,durationMonth=30*time_durationDay,durationYear=365*time_durationDay;function time_date(t){return new Date(t)}function time_number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(year,month,week,day,hour,minute,second,millisecond,format){var scale=continuous(deinterpolateLinear,src_number),invert=scale.invert,domain=scale.domain,formatMillisecond=format(".%L"),formatSecond=format(":%S"),formatMinute=format("%I:%M"),formatHour=format("%I %p"),formatDay=format("%a %d"),formatWeek=format("%b %d"),formatMonth=format("%B"),formatYear=format("%Y"),tickIntervals=[[second,1,time_durationSecond],[second,5,5*time_durationSecond],[second,15,15*time_durationSecond],[second,30,30*time_durationSecond],[minute,1,time_durationMinute],[minute,5,5*time_durationMinute],[minute,15,15*time_durationMinute],[minute,30,30*time_durationMinute],[hour,1,time_durationHour],[hour,3,3*time_durationHour],[hour,6,6*time_durationHour],[hour,12,12*time_durationHour],[day,1,time_durationDay],[day,2,2*time_durationDay],[week,1,time_durationWeek],[month,1,durationMonth],[month,3,3*durationMonth],[year,1,durationYear]];function tickFormat(date){return(second(date)1)&&(t-=Math.floor(t));var ts=Math.abs(t-.5);return rainbow_c.h=360*t-100,rainbow_c.s=1.5-1.5*ts,rainbow_c.l=.8-.9*ts,rainbow_c+""},sequential_multi_cubehelix=cubehelixLong(cubehelix_cubehelix(300,.5,0),cubehelix_cubehelix(-240,.5,1)),BuGn=src_ramp(new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(d3_scale_chromatic_src_colors)),BuPu=src_ramp(new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(d3_scale_chromatic_src_colors)),GnBu=src_ramp(new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(d3_scale_chromatic_src_colors)),OrRd=src_ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(d3_scale_chromatic_src_colors)),PuBuGn=src_ramp(new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(d3_scale_chromatic_src_colors)),PuBu=src_ramp(new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(d3_scale_chromatic_src_colors)),PuRd=src_ramp(new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(d3_scale_chromatic_src_colors)),RdPu=src_ramp(new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(d3_scale_chromatic_src_colors)),YlGnBu=src_ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(d3_scale_chromatic_src_colors)),YlGn=src_ramp(new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(d3_scale_chromatic_src_colors)),YlOrBr=src_ramp(new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(d3_scale_chromatic_src_colors)),YlOrRd=src_ramp(new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(d3_scale_chromatic_src_colors)),UNIT_GLOBAL_NAMESPACE="app.units",UNIT_LOCAL_NAMESPACE="local.units",LAYER_LOCAL_NAMESPACE="local.layers",LAYER_GLOBAL_NAMESPACE="app.layers",GROUP_GLOBAL_NAMESPACE="app.group",GROUP_LOCAL_NAMESPACE="local.group",CANVAS_LOCAL_NAMESPACE="local.canvas",CANVAS_GLOBAL_NAMESPACE="app.canvas",reserved_fields={ROW_ID:"__id__"},common_props={ACTION_INF:"actionInf",ON_LAYER_DRAW:"onLayerDraw",MATRIX_CREATED:"matrixCreated"},COORD_TYPES_POLAR="polar",COORD_TYPES_CARTESIAN="cartesian",DATA_TYPE_FUNCTION="function",DATA_TYPE_STRING="string",src_array_slice=Array.prototype.slice,d3_axis_src_identity=function(x){return x},axis_top=1,axis_right=2,axis_bottom=3,axis_left=4,epsilon=1e-6;function translateX(x){return"translate("+(x+.5)+",0)"}function translateY(y){return"translate(0,"+(y+.5)+")"}function entering(){return!this.__axis}function axis_axis(orient,scale){var tickArguments=[],tickValues=null,tickFormat=null,tickTransform=null,tickSizeInner=6,tickSizeOuter=6,tickPadding=3,k=orient===axis_top||orient===axis_left?-1:1,x=orient===axis_left||orient===axis_right?"x":"y",transform=orient===axis_top||orient===axis_bottom?translateX:translateY;function axis(context){var values=null==tickValues?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():tickValues,format=null==tickFormat?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):d3_axis_src_identity:tickFormat,spacing=Math.max(tickSizeInner,0)+tickPadding,range=scale.range(),range0=+range[0]+.5,range1=+range[range.length-1]+.5,position=(scale.bandwidth?function axis_center(scale){var offset=Math.max(0,scale.bandwidth()-1)/2;return scale.round()&&(offset=Math.round(offset)),function(d){return+scale(d)+offset}}:function axis_number(scale){return function(d){return+scale(d)}})(scale.copy()),selection=context.selection?context.selection():context,path=selection.selectAll(".domain").data([null]),tick=selection.selectAll(".tick").data(values,scale).order(),tickExit=tick.exit(),tickEnter=tick.enter().append("g").attr("class","tick"),line=tick.select("line"),text=tick.select("text");path=path.merge(path.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),tick=tick.merge(tickEnter),line=line.merge(tickEnter.append("line").attr("stroke","#000").attr(x+"2",k*tickSizeInner)),text=text.merge(tickEnter.append("text").attr("fill","#000").attr(x,k*spacing).attr("dy",orient===axis_top?"0em":orient===axis_bottom?"0.71em":"0.32em")).style("transform",tickTransform),context!==selection&&(path=path.transition(context),tick=tick.transition(context),line=line.transition(context),text=text.transition(context),tickExit=tickExit.transition(context).attr("opacity",epsilon).attr("transform",function(d){return isFinite(d=position(d))?transform(d):this.getAttribute("transform")}),tickEnter.attr("opacity",epsilon).attr("transform",function(d){var p=this.parentNode.__axis;return transform(p&&isFinite(p=p(d))?p:position(d))})),tickExit.remove(),path.attr("d",orient===axis_left||orient==axis_right?"M"+k*tickSizeOuter+","+range0+"H0.5V"+range1+"H"+k*tickSizeOuter:"M"+range0+","+k*tickSizeOuter+"V0.5H"+range1+"V"+k*tickSizeOuter),tick.attr("opacity",1).attr("transform",function(d){return transform(position(d))}),line.attr(x+"2",k*tickSizeInner),text.attr(x,k*spacing).text(format),selection.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",orient===axis_right?"start":orient===axis_left?"end":"middle"),selection.each(function(){this.__axis=position})}return axis.scale=function(_){return arguments.length?(scale=_,axis):scale},axis.tickTransform=function(_){return arguments.length?(tickTransform=_,axis):tickTransform},axis.ticks=function(){return tickArguments=src_array_slice.call(arguments),axis},axis.tickArguments=function(_){return arguments.length?(tickArguments=null==_?[]:src_array_slice.call(_),axis):tickArguments.slice()},axis.tickValues=function(_){return arguments.length?(tickValues=null==_?null:src_array_slice.call(_),axis):tickValues&&tickValues.slice()},axis.tickFormat=function(_){return arguments.length?(tickFormat=_,axis):tickFormat},axis.tickSize=function(_){return arguments.length?(tickSizeInner=tickSizeOuter=+_,axis):tickSizeInner},axis.tickSizeInner=function(_){return arguments.length?(tickSizeInner=+_,axis):tickSizeInner},axis.tickSizeOuter=function(_){return arguments.length?(tickSizeOuter=+_,axis):tickSizeOuter},axis.tickPadding=function(_){return arguments.length?(tickPadding=+_,axis):tickPadding},axis}var pi=Math.PI,tau=2*pi,tauEpsilon=tau-1e-6;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function moveTo(x,y){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)},closePath:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function lineTo(x,y){this._+="L"+(this._x1=+x)+","+(this._y1=+y)},quadraticCurveTo:function quadraticCurveTo(x1,y1,x,y){this._+="Q"+ +x1+","+ +y1+","+(this._x1=+x)+","+(this._y1=+y)},bezierCurveTo:function bezierCurveTo(x1,y1,x2,y2,x,y){this._+="C"+ +x1+","+ +y1+","+ +x2+","+ +y2+","+(this._x1=+x)+","+(this._y1=+y)},arcTo:function arcTo(x1,y1,x2,y2,r){x1=+x1,y1=+y1,x2=+x2,y2=+y2,r=+r;var x0=this._x1,y0=this._y1,x21=x2-x1,y21=y2-y1,x01=x0-x1,y01=y0-y1,l01_2=x01*x01+y01*y01;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=x1)+","+(this._y1=y1);else if(l01_2>1e-6)if(Math.abs(y01*x21-y21*x01)>1e-6&&r){var x20=x2-x0,y20=y2-y0,l21_2=x21*x21+y21*y21,l20_2=x20*x20+y20*y20,l21=Math.sqrt(l21_2),l01=Math.sqrt(l01_2),l=r*Math.tan((pi-Math.acos((l21_2+l01_2-l20_2)/(2*l21*l01)))/2),t01=l/l01,t21=l/l21;Math.abs(t01-1)>1e-6&&(this._+="L"+(x1+t01*x01)+","+(y1+t01*y01)),this._+="A"+r+","+r+",0,0,"+ +(y01*x20>x01*y20)+","+(this._x1=x1+t21*x21)+","+(this._y1=y1+t21*y21)}else this._+="L"+(this._x1=x1)+","+(this._y1=y1);else;},arc:function arc(x,y,r,a0,a1,ccw){x=+x,y=+y,ccw=!!ccw;var dx=(r=+r)*Math.cos(a0),dy=r*Math.sin(a0),x0=x+dx,y0=y+dy,cw=1^ccw,da=ccw?a0-a1:a1-a0;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+x0+","+y0:(Math.abs(this._x1-x0)>1e-6||Math.abs(this._y1-y0)>1e-6)&&(this._+="L"+x0+","+y0),r&&(da<0&&(da=da%tau+tau),da>tauEpsilon?this._+="A"+r+","+r+",0,1,"+cw+","+(x-dx)+","+(y-dy)+"A"+r+","+r+",0,1,"+cw+","+(this._x1=x0)+","+(this._y1=y0):da>1e-6&&(this._+="A"+r+","+r+",0,"+ +(da>=pi)+","+cw+","+(this._x1=x+r*Math.cos(a1))+","+(this._y1=y+r*Math.sin(a1))))},rect:function rect(x,y,w,h){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)+"h"+ +w+"v"+ +h+"h"+-w+"Z"},toString:function toString(){return this._}};var src_path=path_path,d3_shape_src_constant=function(x){return function constant(){return x}},abs=Math.abs,atan2=Math.atan2,cos=Math.cos,math_max=Math.max,math_min=Math.min,sin=Math.sin,math_sqrt=Math.sqrt,math_epsilon=1e-12,math_pi=Math.PI,halfPi=math_pi/2,math_tau=2*math_pi;function asin(x){return x>=1?halfPi:x<=-1?-halfPi:Math.asin(x)}function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/math_sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*math_sqrt(math_max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function Linear(context){this._context=context}Linear.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:this._context.lineTo(x,y)}}};var curve_linear=function(context){return new Linear(context)};function point_x(p){return p[0]}function point_y(p){return p[1]}var src_line=function(){var x=point_x,y=point_y,defined=d3_shape_src_constant(!0),context=null,curve=curve_linear,output=null;function line(data){var i,d,buffer,n=data.length,defined0=!1;for(null==context&&(output=curve(buffer=src_path())),i=0;i<=n;++i)!(i=j;--k)output.point(x0z[k],y0z[k]);output.lineEnd(),output.areaEnd()}defined0&&(x0z[i]=+x0(d,i,data),y0z[i]=+y0(d,i,data),output.point(x1?+x1(d,i,data):x0z[i],y1?+y1(d,i,data):y0z[i]))}if(buffer)return output=null,buffer+""||null}function arealine(){return src_line().defined(defined).curve(curve).context(context)}return area.x=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),x1=null,area):x0},area.x0=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),area):x0},area.x1=function(_){return arguments.length?(x1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):x1},area.y=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),y1=null,area):y0},area.y0=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),area):y0},area.y1=function(_){return arguments.length?(y1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):y1},area.lineX0=area.lineY0=function(){return arealine().x(x0).y(y0)},area.lineY1=function(){return arealine().x(x0).y(y1)},area.lineX1=function(){return arealine().x(x1).y(y0)},area.defined=function(_){return arguments.length?(defined="function"==typeof _?_:d3_shape_src_constant(!!_),area):defined},area.curve=function(_){return arguments.length?(curve=_,null!=context&&(output=curve(context)),area):curve},area.context=function(_){return arguments.length?(null==_?context=output=null:output=curve(context=_),area):context},area},src_descending=function(a,b){return ba?1:b>=a?0:NaN},d3_shape_src_identity=function(d){return d};curveRadial(curve_linear);function Radial(curve){this._curve=curve}function curveRadial(curve){function radial(context){return new Radial(curve(context))}return radial._curve=curve,radial}Radial.prototype={areaStart:function areaStart(){this._curve.areaStart()},areaEnd:function areaEnd(){this._curve.areaEnd()},lineStart:function lineStart(){this._curve.lineStart()},lineEnd:function lineEnd(){this._curve.lineEnd()},point:function point(a,r){this._curve.point(r*Math.sin(a),r*-Math.cos(a))}};var d3_shape_src_array_slice=Array.prototype.slice;var symbol_circle={draw:function draw(context,size){var r=Math.sqrt(size/math_pi);context.moveTo(r,0),context.arc(0,0,r,0,math_tau)}},symbol_cross={draw:function draw(context,size){var r=Math.sqrt(size/5)/2;context.moveTo(-3*r,-r),context.lineTo(-r,-r),context.lineTo(-r,-3*r),context.lineTo(r,-3*r),context.lineTo(r,-r),context.lineTo(3*r,-r),context.lineTo(3*r,r),context.lineTo(r,r),context.lineTo(r,3*r),context.lineTo(-r,3*r),context.lineTo(-r,r),context.lineTo(-3*r,r),context.closePath()}},tan30=Math.sqrt(1/3),tan30_2=2*tan30,diamond={draw:function draw(context,size){var y=Math.sqrt(size/tan30_2),x=y*tan30;context.moveTo(0,-y),context.lineTo(x,0),context.lineTo(0,y),context.lineTo(-x,0),context.closePath()}},kr=Math.sin(math_pi/10)/Math.sin(7*math_pi/10),kx=Math.sin(math_tau/10)*kr,ky=-Math.cos(math_tau/10)*kr,star={draw:function draw(context,size){var r=Math.sqrt(.8908130915292852*size),x=kx*r,y=ky*r;context.moveTo(0,-r),context.lineTo(x,y);for(var i=1;i<5;++i){var a=math_tau*i/5,c=Math.cos(a),s=Math.sin(a);context.lineTo(s*r,-c*r),context.lineTo(c*x-s*y,s*x+c*y)}context.closePath()}},square={draw:function draw(context,size){var w=Math.sqrt(size),x=-w/2;context.rect(x,x,w,w)}},sqrt3=Math.sqrt(3),triangle={draw:function draw(context,size){var y=-Math.sqrt(size/(3*sqrt3));context.moveTo(0,2*y),context.lineTo(-sqrt3*y,-y),context.lineTo(sqrt3*y,-y),context.closePath()}},wye_s=Math.sqrt(3)/2,wye_k=1/Math.sqrt(12),wye_a=3*(wye_k/2+1),wye={draw:function draw(context,size){var r=Math.sqrt(size/wye_a),x0=r/2,y0=r*wye_k,x1=x0,y1=r*wye_k+r,x2=-x1,y2=y1;context.moveTo(x0,y0),context.lineTo(x1,y1),context.lineTo(x2,y2),context.lineTo(-.5*x0-wye_s*y0,wye_s*x0+-.5*y0),context.lineTo(-.5*x1-wye_s*y1,wye_s*x1+-.5*y1),context.lineTo(-.5*x2-wye_s*y2,wye_s*x2+-.5*y2),context.lineTo(-.5*x0+wye_s*y0,-.5*y0-wye_s*x0),context.lineTo(-.5*x1+wye_s*y1,-.5*y1-wye_s*x1),context.lineTo(-.5*x2+wye_s*y2,-.5*y2-wye_s*x2),context.closePath()}},noop=function(){};function _point(that,x,y){that._context.bezierCurveTo((2*that._x0+that._x1)/3,(2*that._y0+that._y1)/3,(that._x0+2*that._x1)/3,(that._y0+2*that._y1)/3,(that._x0+4*that._x1+x)/6,(that._y0+4*that._y1+y)/6)}function Basis(context){this._context=context}Basis.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 3:_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function BasisClosed(context){this._context=context}BasisClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._x2=x,this._y2=y;break;case 1:this._point=2,this._x3=x,this._y3=y;break;case 2:this._point=3,this._x4=x,this._y4=y,this._context.moveTo((this._x0+4*this._x1+x)/6,(this._y0+4*this._y1+y)/6);break;default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function BasisOpen(context){this._context=context}BasisOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var x0=(this._x0+4*this._x1+x)/6,y0=(this._y0+4*this._y1+y)/6;this._line?this._context.lineTo(x0,y0):this._context.moveTo(x0,y0);break;case 3:this._point=4;default:_point(this,x,y)}this._x0=this._x1,this._x1=x,this._y0=this._y1,this._y1=y}};function Bundle(context,beta){this._basis=new Basis(context),this._beta=beta}Bundle.prototype={lineStart:function lineStart(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function lineEnd(){var x=this._x,y=this._y,j=x.length-1;if(j>0)for(var t,x0=x[0],y0=y[0],dx=x[j]-x0,dy=y[j]-y0,i=-1;++i<=j;)t=i/j,this._basis.point(this._beta*x[i]+(1-this._beta)*(x0+t*dx),this._beta*y[i]+(1-this._beta)*(y0+t*dy));this._x=this._y=null,this._basis.lineEnd()},point:function point(x,y){this._x.push(+x),this._y.push(+y)}};(function custom(beta){function bundle(context){return 1===beta?new Basis(context):new Bundle(context,beta)}return bundle.beta=function(beta){return custom(+beta)},bundle})(.85);function cardinal_point(that,x,y){that._context.bezierCurveTo(that._x1+that._k*(that._x2-that._x0),that._y1+that._k*(that._y2-that._y0),that._x2+that._k*(that._x1-x),that._y2+that._k*(that._y1-y),that._x2,that._y2)}function Cardinal(context,tension){this._context=context,this._k=(1-tension)/6}Cardinal.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2,this._x1=x,this._y1=y;break;case 2:this._point=3;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new Cardinal(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CardinalClosed(context,tension){this._context=context,this._k=(1-tension)/6}CardinalClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._x3=x,this._y3=y;break;case 1:this._point=2,this._context.moveTo(this._x4=x,this._y4=y);break;case 2:this._point=3,this._x5=x,this._y5=y;break;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new CardinalClosed(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CardinalOpen(context,tension){this._context=context,this._k=(1-tension)/6}CardinalOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new CardinalOpen(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function catmullRom_point(that,x,y){var x1=that._x1,y1=that._y1,x2=that._x2,y2=that._y2;if(that._l01_a>math_epsilon){var a=2*that._l01_2a+3*that._l01_a*that._l12_a+that._l12_2a,n=3*that._l01_a*(that._l01_a+that._l12_a);x1=(x1*a-that._x0*that._l12_2a+that._x2*that._l01_2a)/n,y1=(y1*a-that._y0*that._l12_2a+that._y2*that._l01_2a)/n}if(that._l23_a>math_epsilon){var b=2*that._l23_2a+3*that._l23_a*that._l12_a+that._l12_2a,m=3*that._l23_a*(that._l23_a+that._l12_a);x2=(x2*b+that._x1*that._l23_2a-x*that._l12_2a)/m,y2=(y2*b+that._y1*that._l23_2a-y*that._l12_2a)/m}that._context.bezierCurveTo(x1,y1,x2,y2,that._x2,that._y2)}function CatmullRom(context,alpha){this._context=context,this._alpha=alpha}CatmullRom.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};var curve_catmullRom=function custom(alpha){function catmullRom(context){return alpha?new CatmullRom(context,alpha):new Cardinal(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom}(.5);function CatmullRomClosed(context,alpha){this._context=context,this._alpha=alpha}CatmullRomClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=x,this._y3=y;break;case 1:this._point=2,this._context.moveTo(this._x4=x,this._y4=y);break;case 2:this._point=3,this._x5=x,this._y5=y;break;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(alpha){function catmullRom(context){return alpha?new CatmullRomClosed(context,alpha):new CardinalClosed(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom})(.5);function CatmullRomOpen(context,alpha){this._context=context,this._alpha=alpha}CatmullRomOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(alpha){function catmullRom(context){return alpha?new CatmullRomOpen(context,alpha):new CardinalOpen(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom})(.5);function LinearClosed(context){this._context=context}LinearClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){this._point&&this._context.closePath()},point:function point(x,y){x=+x,y=+y,this._point?this._context.lineTo(x,y):(this._point=1,this._context.moveTo(x,y))}};function monotone_sign(x){return x<0?-1:1}function slope3(that,x2,y2){var h0=that._x1-that._x0,h1=x2-that._x1,s0=(that._y1-that._y0)/(h0||h1<0&&-0),s1=(y2-that._y1)/(h1||h0<0&&-0),p=(s0*h1+s1*h0)/(h0+h1);return(monotone_sign(s0)+monotone_sign(s1))*Math.min(Math.abs(s0),Math.abs(s1),.5*Math.abs(p))||0}function slope2(that,t){var h=that._x1-that._x0;return h?(3*(that._y1-that._y0)/h-t)/2:t}function monotone_point(that,t0,t1){var x0=that._x0,y0=that._y0,x1=that._x1,y1=that._y1,dx=(x1-x0)/3;that._context.bezierCurveTo(x0+dx,y0+dx*t0,x1-dx,y1-dx*t1,x1,y1)}function MonotoneX(context){this._context=context}function MonotoneY(context){this._context=new ReflectContext(context)}function ReflectContext(context){this._context=context}function Natural(context){this._context=context}function controlPoints(x){var i,m,n=x.length-1,a=new Array(n),b=new Array(n),r=new Array(n);for(a[0]=0,b[0]=2,r[0]=x[0]+2*x[1],i=1;i=0;--i)a[i]=(r[i]-a[i+1])/b[i];for(b[n-1]=(x[n]+a[n-1])/2,i=0;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,y),this._context.lineTo(x,y);else{var x1=this._x*(1-this._t)+x*this._t;this._context.lineTo(x1,this._y),this._context.lineTo(x1,y)}}this._x=x,this._y=y}};var curve_step=function(context){return new Step(context,.5)};function stepBefore(context){return new Step(context,0)}function stepAfter(context){return new Step(context,1)}var none=function(series,order){if((n=series.length)>1)for(var j,s0,n,i=1,s1=series[order[0]],m=s1.length;i=0;)o[n]=n;return o};function stackValue(d,key){return d[key]}var order_ascending=function(series){var sums=series.map(ascending_sum);return order_none(series).sort(function(a,b){return sums[a]-sums[b]})};function ascending_sum(series){for(var v,s=0,i=-1,n=series.length;++i0)){if(r/=dx,dx<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=x1-ax,dx||!(r<0)){if(r/=dx,dx<0){if(r>t1)return;r>t0&&(t0=r)}else if(dx>0){if(r0)){if(r/=dy,dy<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=y1-ay,dy||!(r<0)){if(r/=dy,dy<0){if(r>t1)return;r>t0&&(t0=r)}else if(dy>0){if(r0||t1<1)||(t0>0&&(edge[0]=[ax+t0*dx,ay+t0*dy]),t1<1&&(edge[1]=[ax+t1*dx,ay+t1*dy]),!0)}}}}}function connectEdge(edge,x0,y0,x1,y1){var v1=edge[1];if(v1)return!0;var fm,fb,v0=edge[0],left=edge.left,right=edge.right,lx=left[0],ly=left[1],rx=right[0],ry=right[1],fx=(lx+rx)/2,fy=(ly+ry)/2;if(ry===ly){if(fx=x1)return;if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[fx,y0];v1=[fx,y1]}else{if(v0){if(v0[1]1)if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[(y0-fb)/fm,y0];v1=[(y1-fb)/fm,y1]}else{if(v0){if(v0[1]=x1)return}else v0=[x0,fm*x0+fb];v1=[x1,fm*x1+fb]}else{if(v0){if(v0[0]=-Diagram_epsilon2)){var ha=ax*ax+ay*ay,hc=cx*cx+cy*cy,x=(cy*ha-ay*hc)/d,y=(ax*hc-cx*ha)/d,circle=circlePool.pop()||new function Circle(){RedBlackNode(this),this.x=this.y=this.arc=this.site=this.cy=null};circle.arc=arc,circle.site=cSite,circle.x=x+bx,circle.y=(circle.cy=y+by)+Math.sqrt(x*x+y*y),arc.circle=circle;for(var before=null,node=circles._;node;)if(circle.yDiagram_epsilon)node=node.L;else{if(!((dxr=x-rightBreakPoint(node,directrix))>Diagram_epsilon)){dxl>-Diagram_epsilon?(lArc=node.P,rArc=node):dxr>-Diagram_epsilon?(lArc=node,rArc=node.N):lArc=rArc=node;break}if(!node.R){lArc=node;break}node=node.R}!function createCell(site){return Diagram_cells[site.index]={site:site,halfedges:[]}}(site);var newArc=createBeach(site);if(beaches.insert(lArc,newArc),lArc||rArc){if(lArc===rArc)return detachCircle(lArc),rArc=createBeach(lArc.site),beaches.insert(newArc,rArc),newArc.edge=rArc.edge=createEdge(lArc.site,newArc.site),attachCircle(lArc),void attachCircle(rArc);if(rArc){detachCircle(lArc),detachCircle(rArc);var lSite=lArc.site,ax=lSite[0],ay=lSite[1],bx=site[0]-ax,by=site[1]-ay,rSite=rArc.site,cx=rSite[0]-ax,cy=rSite[1]-ay,d=2*(bx*cy-by*cx),hb=bx*bx+by*by,hc=cx*cx+cy*cy,vertex=[(cy*hb-by*hc)/d+ax,(bx*hc-cx*hb)/d+ay];setEdgeEnd(rArc.edge,lSite,rSite,vertex),newArc.edge=createEdge(lSite,site,null,vertex),rArc.edge=createEdge(site,rSite,null,vertex),attachCircle(lArc),attachCircle(rArc)}else newArc.edge=createEdge(lArc.site,newArc.site)}}function leftBreakPoint(arc,directrix){var site=arc.site,rfocx=site[0],rfocy=site[1],pby2=rfocy-directrix;if(!pby2)return rfocx;var lArc=arc.P;if(!lArc)return-1/0;var lfocx=(site=lArc.site)[0],lfocy=site[1],plby2=lfocy-directrix;if(!plby2)return lfocx;var hl=lfocx-rfocx,aby2=1/pby2-1/plby2,b=hl/plby2;return aby2?(-b+Math.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx:(rfocx+lfocx)/2}function rightBreakPoint(arc,directrix){var rArc=arc.N;if(rArc)return leftBreakPoint(rArc,directrix);var site=arc.site;return site[1]===directrix?site[0]:1/0}var beaches,Diagram_cells,circles,Diagram_edges,Diagram_epsilon=1e-6,Diagram_epsilon2=1e-12;function triangleArea(a,b,c){return(a[0]-c[0])*(b[1]-a[1])-(a[0]-b[0])*(c[1]-a[1])}function lexicographic(a,b){return b[1]-a[1]||b[0]-a[0]}function Diagram(sites,extent){var x,y,circle,site=sites.sort(lexicographic).pop();for(Diagram_edges=[],Diagram_cells=new Array(sites.length),beaches=new src_RedBlackTree,circles=new src_RedBlackTree;;)if(circle=firstCircle,site&&(!circle||site[1]Diagram_epsilon||Math.abs(edge[0][1]-edge[1][1])>Diagram_epsilon)||delete Diagram_edges[i]}(x0,y0,x1,y1),function clipCells(x0,y0,x1,y1){var iCell,cell,site,iHalfedge,halfedges,nHalfedges,start,startX,startY,end,endX,endY,nCells=Diagram_cells.length,cover=!0;for(iCell=0;iCellDiagram_epsilon||Math.abs(endY-startY)>Diagram_epsilon)&&(halfedges.splice(iHalfedge,0,Diagram_edges.push(createBorderEdge(site,end,Math.abs(endX-x0)Diagram_epsilon?[x0,Math.abs(startX-x0)Diagram_epsilon?[Math.abs(startY-y1)Diagram_epsilon?[x1,Math.abs(startX-x1)Diagram_epsilon?[Math.abs(startY-y0)=n)return null;var dx=x-cell.site[0],dy=y-cell.site[1],d2=dx*dx+dy*dy;do{cell=that.cells[i0=i1],i1=null,cell.halfedges.forEach(function(e){var edge=that.edges[e],v=edge.left;if(v!==cell.site&&v||(v=edge.right)){var vx=x-v[0],vy=y-v[1],v2=vx*vx+vy*vy;v20?0:domain[0],domain[1]=domain[1]>0?domain[1]:0),domain},unionDomain=function unionDomain(domains,fieldType){var _ref2,domain=[];(domains=domains.filter(function(dom){return dom&&dom.length})).length&&(domain=fieldType===CATEGORICAL?(_ref2=[]).concat.apply(_ref2,common_utils_toConsumableArray(domains)):[Math.min.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[0]}))),Math.max.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[1]})))]);return domain},symbolFns={circle:symbol_circle,cross:symbol_cross,diamond:diamond,square:square,star:star,wye:wye,triangle:triangle},easeFns={cubic:cubicInOut,bounce:bounceOut,linear:function src_linear_linear(t){return+t},elastic:elasticOut,back:backInOut,poly:polyInOut,circle:function circleInOut(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}},common_utils_getClosestIndexOf=function getClosestIndexOf(arr,value,side){for(var mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1},getNearestValue=function getNearestValue(data,key){var filterData=data.filter(function(d){return"number"==typeof d});return filterData[common_utils_getClosestIndexOf(filterData,key)]},getWindow=function getWindow(){return window},getQualifiedClassName=(requestAnimationFrame,cancelAnimationFrame,function getQualifiedClassName(cls,id,prefix){return cls=cls.replace(/^\.*/,""),["".concat(prefix,"-").concat(cls),"".concat(prefix,"-").concat(cls,"-").concat(id)]}),defaultValue=function defaultValue(param,value){return void 0===param||"object"===common_utils_typeof(param)&&!param?value:param},objectIterator=function objectIterator(obj,fn){for(var key in obj)Object.hasOwnProperty.call(obj,key)&&fn(key,obj)},common_utils_Voronoi=function(){function Voronoi(){var data=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function common_utils_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Voronoi),this._voronoi=src_voronoi().x(function(d){return d.x}).y(function(d){return d.y}),this.data(data)}return function common_utils_createClass(Constructor,protoProps,staticProps){return protoProps&&common_utils_defineProperties(Constructor.prototype,protoProps),staticProps&&common_utils_defineProperties(Constructor,staticProps),Constructor}(Voronoi,[{key:"data",value:function data(_data){return _data&&(this._voronoiFn=this._voronoi(_data)),this}},{key:"find",value:function find(x,y,radius){return this._voronoiFn.find(x,y,radius)}}]),Voronoi}(),getObjProp=function getObjProp(obj){if(void 0===obj||null===obj)return obj;for(var retObj=obj,_len=arguments.length,fields=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)fields[_key-1]=arguments[_key];for(var i=0,len=fields.length;i=0;i--)if(arr1[i]!==arr2[i])return!1;return!0}(oldVal,newVal):"Object"===type?Object.is(oldVal,newVal):oldVal===newVal}},ERROR_MSG={INTERFACE_IMPL:"Method not implemented"},mergeRecursive=function mergeRecursive(source,sink){for(var prop in sink)isSimpleObject(source[prop])&&isSimpleObject(sink[prop])?mergeRecursive(source[prop],sink[prop]):sink[prop]instanceof Object&&sink[prop].constructor===Object?(source[prop]={},mergeRecursive(source[prop],sink[prop])):source[prop]=sink[prop];return source},common_utils_createSelection=function createSelection(sel,appendObj,data,idFn){var selection=sel||function dataSelect(idFn){return new DataSystem_selection(idFn)}(idFn),mergedSelection=(selection=selection.data(data)).enter().append(appendObj).merge(selection),exitSelection=selection.exit();return exitSelection.getObjects().forEach(function(inst){return inst.remove()}),exitSelection.remove(),mergedSelection},common_utils_interpolator=function interpolator(){return src_value},common_utils_numberInterpolator=function numberInterpolator(){return src_number},common_utils_piecewiseInterpolator=function piecewiseInterpolator(){return piecewise_piecewise};var rgbToHsv=function rgbToHsv(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r=+r,g=+g,b=+b,a=+a,r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;if(max===min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(g=range[0]&&val<=range[1]})},{saveChild:!1,mode:mode})},common_utils_getDataModelFromIdentifiers=function getDataModelFromIdentifiers(dataModel,identifiers,mode){var filteredDataModel;if(identifiers instanceof Array){var fieldsConfig=dataModel.getFieldsConfig(),dataArr=identifiers.slice(1,identifiers.length);if(identifiers instanceof Function)filteredDataModel=identifiers(dataModel,{},!1);else if(identifiers instanceof Array&&identifiers[0].length){var filteredSchema=identifiers[0].filter(function(d){return d in fieldsConfig});filteredDataModel=dataModel.select(function(fields){var include=!0;return filteredSchema.forEach(function(propField,idx){var value=fields[propField].internalValue,index=dataArr.findIndex(function(d){return d[idx]===value});include=include&&-1!==index}),include},{saveChild:!1,mode:mode})}else filteredDataModel=dataModel.select(function(){return!1},{saveChild:!1,mode:mode})}else filteredDataModel=getDataModelFromRange(dataModel,identifiers,mode);return filteredDataModel},isValidValue=function isValidValue(value){return!isNaN(value)&&value!==-1/0&&value!==1/0},toArray=function toArray(arr){return arr instanceof Array?arr:[arr]},common_utils_getSymbol=function getSymbol(type){return function(){var type=d3_shape_src_constant(symbol_circle),size=d3_shape_src_constant(64),context=null;function symbol(){var buffer;if(context||(context=buffer=src_path()),type.apply(this,arguments).draw(context,+size.apply(this,arguments)),buffer)return context=null,buffer+""||null}return symbol.type=function(_){return arguments.length?(type="function"==typeof _?_:d3_shape_src_constant(_),symbol):type},symbol.size=function(_){return arguments.length?(size="function"==typeof _?_:d3_shape_src_constant(+_),symbol):size},symbol.context=function(_){return arguments.length?(context=null==_?null:_,symbol):context},symbol}().type(symbolFns[type])},stackOrders=(_defineProperty(_stackOrders={},"none",order_none),_defineProperty(_stackOrders,"ascending",order_ascending),_defineProperty(_stackOrders,"descending",function(series){return order_ascending(series).reverse()}),_stackOrders),stackOffsets=(_defineProperty(_stackOffsets={},"diverging",function(series,order){if((n=series.length)>0)for(var i,d,dy,yp,yn,n,j=0,m=series[order[0]].length;j=0?(d[0]=yp,d[1]=yp+=dy):dy<0?(d[1]=yn,d[0]=yn+=dy):d[0]=yp}),_defineProperty(_stackOffsets,"none",none),_defineProperty(_stackOffsets,"expand",function(series,order){if((n=series.length)>0){for(var i,n,y,j=0,m=series[0].length;j0&&(m=(s0=series[order[0]]).length)>0){for(var s0,m,n,y=0,j=1;j0&&(sum+=v);for(null!=sortValues?index.sort(function(i,j){return sortValues(arcs[i],arcs[j])}):null!=sort&&index.sort(function(i,j){return sort(data[i],data[j])}),i=0,k=sum?(da-n*pa)/sum:0;i0?v*k:0)+pa,arcs[j]={data:data[j],index:i,value:v,startAngle:a0,endAngle:a1,padAngle:p};return arcs}return pie.value=function(_){return arguments.length?(value="function"==typeof _?_:d3_shape_src_constant(+_),pie):value},pie.sortValues=function(_){return arguments.length?(sortValues=_,sort=null,pie):sortValues},pie.sort=function(_){return arguments.length?(sort=_,sortValues=null,pie):sort},pie.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):startAngle},pie.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):endAngle},pie.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):padAngle},pie},arc:function(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=d3_shape_src_constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null;function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=src_path()),r1math_epsilon)if(da>math_tau-math_epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>math_epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>math_epsilon&&(padRadius?+padRadius.apply(this,arguments):math_sqrt(r0*r0+r1*r1)),rc=math_min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>math_epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>math_epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>math_epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>math_epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da1?0:x<-1?math_pi:Math.acos(x)}((ax*bx+ay*by)/(math_sqrt(ax*ax+ay*ay)*math_sqrt(bx*bx+by*by)))/2),lc=math_sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=math_min(rc,(r0-lc)/(kc-1)),rc1=math_min(rc,(r1-lc)/(kc+1))}}da1>math_epsilon?rc1>math_epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1math_epsilon&&da0>math_epsilon?rc0>math_epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc01?_len3-1:0),_key3=1;_key3<_len3;_key3++)measureFieldNames[_key3-1]=arguments[_key3];var filteredReducers={};if(dataModel instanceof datamodel_default.a){var derivations=[].concat(common_utils_toConsumableArray(dataModel.getDerivations().reverse()),common_utils_toConsumableArray(dataModel.getAncestorDerivations().reverse())),nearestReducers=defaultValue(getObjProp(derivations.find(function(derv){return derv.op===dist_datamodel.DM_DERIVATIVES.GROUPBY}),"criteria"),{}),measures=dataModel.getFieldspace().getMeasure();(measureFieldNames=measureFieldNames.length?measureFieldNames:Object.keys(measures)).forEach(function(measureName){if(nearestReducers[measureName])filteredReducers[measureName]=nearestReducers[measureName];else{var measureField=measures[measureName];measureField&&(filteredReducers[measureName]=measureField.defAggFn())}})}return filteredReducers},retrieveFieldDisplayName=function retrieveFieldDisplayName(dm,fieldName){return dm.getFieldspace().fieldsObj()[fieldName].displayName()},sortOrderMap=(_defineProperty(_sortOrderMap={},"asc",function(firstVal,secondVal){return firstVal.localeCompare(secondVal)}),_defineProperty(_sortOrderMap,"desc",function(firstVal,secondVal){return secondVal.localeCompare(firstVal)}),_sortOrderMap),common_utils_intersect=function intersect(arr1,arr2){var _accessors=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors[0],fn2=_accessors[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return set.has(fn1(value))})},xhtml="http://www.w3.org/1999/xhtml",src_namespaces={svg:"http://www.w3.org/2000/svg",xhtml:xhtml,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},src_namespace=function(name){var prefix=name+="",i=prefix.indexOf(":");return i>=0&&"xmlns"!==(prefix=name.slice(0,i))&&(name=name.slice(i+1)),src_namespaces.hasOwnProperty(prefix)?{space:src_namespaces[prefix],local:name}:name};var creator=function(name){var fullname=src_namespace(name);return(fullname.local?function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local)}}:function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name)}})(fullname)};function selector_none(){}var src_selector=function(selector){return null==selector?selector_none:function(){return this.querySelector(selector)}};function selectorAll_empty(){return[]}var selectorAll=function(selector){return null==selector?selectorAll_empty:function(){return this.querySelectorAll(selector)}},matcher=function(selector){return function(){return this.matches(selector)}},sparse=function(update){return new Array(update.length)};function EnterNode(parent,datum){this.ownerDocument=parent.ownerDocument,this.namespaceURI=parent.namespaceURI,this._next=null,this._parent=parent,this.__data__=datum}EnterNode.prototype={constructor:EnterNode,appendChild:function appendChild(child){return this._parent.insertBefore(child,this._next)},insertBefore:function insertBefore(child,next){return this._parent.insertBefore(child,next)},querySelector:function querySelector(selector){return this._parent.querySelector(selector)},querySelectorAll:function querySelectorAll(selector){return this._parent.querySelectorAll(selector)}};var keyPrefix="$";function bindIndex(parent,group,enter,update,exit,data){for(var node,i=0,groupLength=group.length,dataLength=data.length;ib?1:a>=b?0:NaN}var src_window=function(node){return node.ownerDocument&&node.ownerDocument.defaultView||node.document&&node||node.defaultView};function styleValue(node,name){return node.style.getPropertyValue(name)||src_window(node).getComputedStyle(node,null).getPropertyValue(name)}function classArray(string){return string.trim().split(/^|\s+/)}function classList(node){return node.classList||new ClassList(node)}function ClassList(node){this._node=node,this._names=classArray(node.getAttribute("class")||"")}function classedAdd(node,names){for(var list=classList(node),i=-1,n=names.length;++i=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function contains(name){return this._names.indexOf(name)>=0}};function textRemove(){this.textContent=""}function htmlRemove(){this.innerHTML=""}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function constantNull(){return null}function remove_remove(){var parent=this.parentNode;parent&&parent.removeChild(this)}function selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var filterEvents={},on_event=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(filterEvents={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(listener,index,group){return listener=contextListener(listener,index,group),function(event){var related=event.relatedTarget;related&&(related===this||8&related.compareDocumentPosition(this))||listener.call(this,event)}}function contextListener(listener,index,group){return function(event1){var event0=on_event;on_event=event1;try{listener.call(this,this.__data__,index,group)}finally{on_event=event0}}}function onRemove(typename){return function(){var on=this.__on;if(on){for(var o,j=0,i=-1,m=on.length;j=i1&&(i1=i0+1);!(next=updateGroup[i1])&&++i1=0;)(node=group[i])&&(next&&4^node.compareDocumentPosition(next)&&next.parentNode.insertBefore(node,next),next=node);return this},sort:function(compare){function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b}compare||(compare=sort_ascending);for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;j1?this.each((null==value?function styleRemove(name){return function(){this.style.removeProperty(name)}}:"function"==typeof value?function styleFunction(name,value,priority){return function(){var v=value.apply(this,arguments);null==v?this.style.removeProperty(name):this.style.setProperty(name,v,priority)}}:function styleConstant(name,value,priority){return function(){this.style.setProperty(name,value,priority)}})(name,value,null==priority?"":priority)):styleValue(this.node(),name)},property:function(name,value){return arguments.length>1?this.each((null==value?function propertyRemove(name){return function(){delete this[name]}}:"function"==typeof value?function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);null==v?delete this[name]:this[name]=v}}:function propertyConstant(name,value){return function(){this[name]=value}})(name,value)):this.node()[name]},classed:function(name,value){var names=classArray(name+"");if(arguments.length<2){for(var list=classList(this.node()),i=-1,n=names.length;++i=0&&(name=t.slice(i+1),t=t.slice(0,i)),{type:t,name:name}})}(typename+""),n=typenames.length;if(!(arguments.length<2)){for(on=value?onAdd:onRemove,null==capture&&(capture=!1),i=0;i=0&&(name=t.slice(i+1),t=t.slice(0,i)),t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:name}})}(typename+"",_),i=-1,n=T.length;if(!(arguments.length<2)){if(null!=callback&&"function"!=typeof callback)throw new Error("invalid callback: "+callback);for(;++i0)for(var n,t,args=new Array(n),i=0;iclickDistance2}gestures.mouse("drag")}function mouseupped(){src_select(on_event.view).on("mousemove.drag mouseup.drag",null),function yesdrag(view,noclick){var root=view.document.documentElement,selection=src_select(view).on("dragstart.drag",null);noclick&&(selection.on("click.drag",noevent,!0),setTimeout(function(){selection.on("click.drag",null)},0)),"onselectstart"in root?selection.on("selectstart.drag",null):(root.style.MozUserSelect=root.__noselect,delete root.__noselect)}(on_event.view,mousemoving),noevent(),gestures.mouse("end")}function touchstarted(){if(filter.apply(this,arguments)){var i,gesture,touches=on_event.changedTouches,c=container.apply(this,arguments),n=touches.length;for(i=0;i=0&&t._call.call(null,e),t=t._next;--timer_frame}()}finally{timer_frame=0,function nap(){var t0,t2,t1=taskHead,time=1/0;for(;t1;)t1._call?(time>t1._time&&(time=t1._time),t0=t1,t1=t1._next):(t2=t1._next,t1._next=null,t1=t0?t0._next=t2:taskHead=t2);taskTail=t0,sleep(time)}(),clockNow=0}}function poke(){var now=clock.now(),delay=now-clockLast;delay>pokeDelay&&(clockSkew-=delay,clockLast=now)}function sleep(time){timer_frame||(timeout&&(timeout=clearTimeout(timeout)),time-clockNow>24?(time<1/0&&(timeout=setTimeout(wake,time-clock.now()-clockSkew)),timer_interval&&(timer_interval=clearInterval(timer_interval))):(timer_interval||(clockLast=clock.now(),timer_interval=setInterval(poke,pokeDelay)),timer_frame=1,setFrame(wake)))}Timer.prototype=timer_timer.prototype={constructor:Timer,restart:function restart(callback,delay,time){if("function"!=typeof callback)throw new TypeError("callback is not a function");time=(null==time?now():+time)+(null==delay?0:+delay),this._next||taskTail===this||(taskTail?taskTail._next=this:taskHead=this,taskTail=this),this._call=callback,this._time=time,sleep()},stop:function stop(){this._call&&(this._call=null,this._time=1/0,sleep())}};var src_timeout=function(callback,delay,time){var t=new Timer;return delay=null==delay?0:+delay,t.restart(function(elapsed){t.stop(),callback(elapsed+delay)},delay,time),t},emptyOn=src_dispatch("start","end","cancel","interrupt"),emptyTween=[],CREATED=0,SCHEDULED=1,STARTING=2,STARTED=3,RUNNING=4,ENDING=5,ENDED=6,transition_schedule=function(node,name,id,index,group,timing){var schedules=node.__transition;if(schedules){if(id in schedules)return}else node.__transition={};!function schedule_create(node,id,self){var tween,schedules=node.__transition;function start(elapsed){var i,j,n,o;if(self.state!==SCHEDULED)return stop();for(i in schedules)if((o=schedules[i]).name===self.name){if(o.state===STARTED)return src_timeout(start);o.state===RUNNING?(o.state=ENDED,o.timer.stop(),o.on.call("interrupt",node,node.__data__,o.index,o.group),delete schedules[i]):+iCREATED)throw new Error("too late; already scheduled");return schedule}function schedule_set(node,id){var schedule=schedule_get(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule}function schedule_get(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule}function tweenValue(transition,name,value){var id=transition._id;return transition.each(function(){var schedule=schedule_set(this,id);(schedule.value||(schedule.value={}))[name]=value.apply(this,arguments)}),function(node){return schedule_get(node,id).value[name]}}var transition_interpolate=function(a,b){var c;return("number"==typeof b?src_number:b instanceof color_color?src_rgb:(c=color_color(b))?(b=c,src_rgb):src_string)(a,b)};var transition_selection_Selection=src_selection.prototype.constructor;function style_styleRemove(name){return function(){this.style.removeProperty(name)}}var transition_id=0;function Transition(groups,parents,name,id){this._groups=groups,this._parents=parents,this._name=name,this._id=id}function newId(){return++transition_id}var selection_prototype=src_selection.prototype;Transition.prototype=function src_transition_transition(name){return src_selection().transition(name)}.prototype={constructor:Transition,select:function(select){var name=this._name,id=this._id;"function"!=typeof select&&(select=src_selector(select));for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j=0&&(t=t.slice(0,i)),!t||"start"===t})}(name)?init:schedule_set;return function(){var schedule=sit(this,id),on=schedule.on;on!==on0&&(on1=(on0=on).copy()).on(name,listener),schedule.on=on1}}(id,name,listener))},attr:function(name,value){var fullname=src_namespace(name),i="transform"===fullname?interpolateTransformSvg:transition_interpolate;return this.attrTween(name,"function"==typeof value?(fullname.local?function attr_attrFunctionNS(fullname,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttributeNS(fullname.space,fullname.local))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttribute(name))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttribute(name)}})(fullname,i,tweenValue(this,"attr."+name,value)):null==value?(fullname.local?function attr_attrRemoveNS(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrRemove(name){return function(){this.removeAttribute(name)}})(fullname):(fullname.local?function attr_attrConstantNS(fullname,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttributeNS(fullname.space,fullname.local);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}:function attr_attrConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttribute(name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}})(fullname,i,value))},attrTween:function(name,value){var key="attr."+name;if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;var fullname=src_namespace(name);return this.tween(key,(fullname.local?function attrTweenNS(fullname,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolateNS(fullname,i){return function(t){this.setAttributeNS(fullname.space,fullname.local,i(t))}}(fullname,i)),t0}return tween._value=value,tween}:function attrTween(name,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolate(name,i){return function(t){this.setAttribute(name,i(t))}}(name,i)),t0}return tween._value=value,tween})(fullname,value))},style:function(name,value,priority){var i="transform"==(name+="")?interpolateTransformCss:transition_interpolate;return null==value?this.styleTween(name,function styleNull(name,interpolate){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),string1=(this.style.removeProperty(name),styleValue(this,name));return string0===string1?null:string0===string00&&string1===string10?interpolate0:interpolate0=interpolate(string00=string0,string10=string1)}}(name,i)).on("end.style."+name,style_styleRemove(name)):"function"==typeof value?this.styleTween(name,function style_styleFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),value1=value(this),string1=value1+"";return null==value1&&(this.style.removeProperty(name),string1=value1=styleValue(this,name)),string0===string1?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1))}}(name,i,tweenValue(this,"style."+name,value))).each(function styleMaybeRemove(id,name){var on0,on1,listener0,remove,key="style."+name,event="end."+key;return function(){var schedule=schedule_set(this,id),on=schedule.on,listener=null==schedule.value[key]?remove||(remove=style_styleRemove(name)):void 0;on===on0&&listener0===listener||(on1=(on0=on).copy()).on(event,listener0=listener),schedule.on=on1}}(this._id,name)):this.styleTween(name,function style_styleConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=styleValue(this,name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}(name,i,value),priority).on("end.style."+name,null)},styleTween:function(name,value,priority){var key="style."+(name+="");if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function styleTween(name,value,priority){var t,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t=(i0=i)&&function styleInterpolate(name,i,priority){return function(t){this.style.setProperty(name,i(t),priority)}}(name,i,priority)),t}return tween._value=value,tween}(name,value,null==priority?"":priority))},text:function(value){return this.tween("text","function"==typeof value?function text_textFunction(value){return function(){var value1=value(this);this.textContent=null==value1?"":value1}}(tweenValue(this,"text",value)):function text_textConstant(value){return function(){this.textContent=value}}(null==value?"":value+""))},remove:function(){return this.on("end.remove",function removeFunction(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;parent&&parent.removeChild(this)}}(this._id))},tween:function(name,value){var id=this._id;if(name+="",arguments.length<2){for(var t,tween=schedule_get(this.node(),id).tween,i=0,n=tween.length;iSTARTING&&schedule.state4&&void 0!==arguments[4]?arguments[4]:{},keyFn=arguments.length>5?arguments[5]:void 0;(parent instanceof HTMLElement||parent instanceof SVGElement)&&(parent=renderer_utils_selectElement(parent));var filter,selectorVal=selector?selector[0]:null,selectorType=null,actualSelector=null,element=null,enterSel=null,mergeSel=null;selectorVal?"#"===selectorVal?(selectorType="id",actualSelector=selector):(selectorType="class",actualSelector="."===selector[0]?selector:".".concat(selector)):(actualSelector=elemType,filter=!0),element=parent.selectAll(actualSelector),filter&&(element=element.filter(function(){return this.parentNode===parent.node()})),enterSel=(element=element.data(data,keyFn)).enter().append(elemType||"div"),callbacks.enter&&enterSel.each(function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];callbacks.enter.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),mergeSel=enterSel.merge(element),callbacks.update&&mergeSel.each(function(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];callbacks.update.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),"class"===selectorType?mergeSel.classed("."===selectorVal?selector.substring(1,selector.length):selector,!0):"id"===selectorType&&mergeSel.attr("id",selector.substring(1,selector.length));var exitSel=element.exit();return callbacks.exit?exitSel.each(function(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];callbacks.exit.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}):exitSel.remove(),mergeSel},applyStyle=function applyStyle(elem,styleObj){return Object.entries(styleObj).forEach(function(d){elem.style(d[0],d[1])},void 0),elem},setElementAttrs=function setElementAttrs(element,attrs){for(var key in attrs)({}).hasOwnProperty.call(attrs,key)&&element.attr(key,attrs[key])},renderer_utils_setAttrs=function setAttrs(element,attrs,className){return element instanceof src_selection||(element=renderer_utils_selectElement(element)),void 0!==className?element.selectAll(".".concat(className)).each(function(){setElementAttrs(src_select(this),attrs)}):setElementAttrs(element,attrs),element},renderer_utils_setStyles=function setStyles(element,styles){for(var key in element instanceof src_selection||(element=renderer_utils_selectElement(element)),styles)({}).hasOwnProperty.call(styles,key)&&element.style(key,styles[key]);return element},renderer_utils_createElements=function createElements(params){var data,sel,container=src_select(params.container);"number"==typeof(data=params.data)&&(data=Array(data).fill().map(function(d,i){return i})),sel=container.selectAll(params.selector).data(data),(sel=container.selectAll(params.selector).filter(function(){return this.parentNode===container.node()}).data(params.data)).enter().append(params.append).merge(sel).each(function(d,i){params.each(d,src_select(this),i)}).attr("class",params.className||""),sel.exit().remove()},renderer_utils_getClientPoint=function getClientPoint(){var pos=src_point.apply(void 0,arguments);return{x:pos[0],y:pos[1]}},renderer_utils_getEvent=function getEvent(){return on_event},renderer_utils_getD3Drag=function getD3Drag(){return src_drag},renderer_utils_getSmartComputedStyle=function getSmartComputedStyle(group,css){var textEl,mandatoryStyle={"fill-opacity":0},className="string"==typeof css?css:css instanceof Array?css.join(" "):void 0;textEl=group.node()instanceof HTMLElement?group.append("div").html("W"):group.append("text").text("W"),className?textEl.attr("class",className):"object"===renderer_utils_typeof(css)&&(delete css["fill-opacity"],mergeRecursive(mandatoryStyle,css)),textEl.style(mandatoryStyle);var computedStyle=window.getComputedStyle(textEl.node()),styleForSmartLabel={fontSize:computedStyle.fontSize,fontFamily:computedStyle.fontFamily,fontWeight:computedStyle.fontWeight,fontStyle:computedStyle.fontStyle};return textEl.remove(),styleForSmartLabel},hasTouch=function hasTouch(){return"ontouchstart"in document.documentElement},hyperdis=__webpack_require__(5),hyperdis_default=__webpack_require__.n(hyperdis);function store_slicedToArray(arr,i){return function store_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function store_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function store_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function store_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:function(){return{}};return props.forEach(function(prop){obj[prop]||(obj[prop]=val()),obj=obj[prop]}),obj},fetchPropValues=function fetchPropValues(propNames,params,deps){return params.map(function(param,i){var prop=propNames[i];return param.map(function(val){return void 0===val||null===val?val:val[deps[prop]]})})},setContexts=function setContexts(contexts,propObj,contextMap){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=propObj.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;contexts[key]={context:contextMap[key],deps:propObj.get(key).depProps}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return contexts},store_registerListener=function registerListener(context,type){for(var _len=arguments.length,options=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)options[_key-2]=arguments[_key];var propList=options[0],callBack=options[1],instantCall=options[2],_options$=options[3],namespaceInf=void 0===_options$?{}:_options$,props=propList;Array.isArray(propList)||(props=[propList]);var ns=namespaceInf.namespace,callbackFn=function(propNames,namespaceVal){return function(){var commits=context._savedCommits,propListenerMap=context._propListenerMap;if(!propNames.some(function(prop){return getObjProp(propListenerMap,prop,"disabled")})){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(namespaceVal){var listenersObj=context._registeredListeners[namespaceVal],contextMap=context._contextMap[namespaceVal],contextsObj={};for(var key in propNames.forEach(function(prop){var commitsObj=defaultValue(getObjProp(commits,prop,type),{}),listeners=listenersObj[prop].subNamespaces,propDeps=propListenerMap[prop][type];for(var nm in commitsObj){var fnInf=defaultValue(propDeps[nm],{fns:0}),fns=fnInf.fns;fns>0&&(setContexts(contextsObj,listeners[nm],contextMap),fns--),fns<=0&&delete commitsObj[nm],fnInf.fns=fns}}),contextsObj){var obj=contextsObj[key];callBack.apply(void 0,[obj.context].concat(store_toConsumableArray(fetchPropValues(propNames,params,obj.deps))))}}else callBack.apply(void 0,params)}}}(props,ns),fn=context.model[type](props,callbackFn,instantCall);ns&&function registerPropInMaps(store,props,namespaceInf,type){var registeredListeners=store._registeredListeners,propListenerMap=store._propListenerMap,subNamespace=namespaceInf.subNamespace,ns=namespaceInf.namespace;initProp(registeredListeners,[ns]),props.forEach(function(prop){var subNamespaces=defaultValue(getObjProp(registeredListeners,ns,prop,"subNamespace"),[]),fns=defaultValue(getObjProp(propListenerMap,prop,type,"fns"),0);fns++,subNamespace&&subNamespaces.push(subNamespace),registeredListeners[ns][prop]={subNamespace:subNamespaces,allProps:props,subNamespaces:{}},initProp(propListenerMap,[prop,type]),propListenerMap[prop][type]={fns:fns,_fnCount:fns}})}(context,props,namespaceInf,type),function addListenerToNamespace(namespaceInf,fn,context){var key=namespaceInf.key,namespace=namespaceInf.id,listeners=context._listeners;if(namespace){!listeners.get(namespace)&&listeners.set(namespace,new Map);var namespaceListeners=listeners.get(namespace);key||(key=namespaceListeners.size),namespaceListeners.set(key,fn)}else key=key||listeners.size,listeners.set(key,fn)}(namespaceInf,fn,context)},store_createMap=function createMap(){return new Map},listenerTypes=["next","on"],removePropValue=function removePropValue(context,map,propInf){var sns=propInf.subNamespace,prop=propInf.prop,propObj=propInf.propListenerMap[prop];if(listenerTypes.forEach(function(type){type in propObj&&delete propObj[type][sns]}),map.has(sns)){var value=context.get(prop);value instanceof Object&&sns in value&&delete value[sns],map.delete(sns)}},store_Store=function(){function Store(config){!function store_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Store),this.model=hyperdis_default.a.create(config),this._listeners=new Map,this._registeredListeners={},this._contextMap={},this._commits={},this._savedCommits={},this._queuedProps={},this._propListenerMap={},this._locked=!1}return function store_createClass(Constructor,protoProps,staticProps){return protoProps&&store_defineProperties(Constructor.prototype,protoProps),staticProps&&store_defineProperties(Constructor,staticProps),Constructor}(Store,[{key:"lockModel",value:function lockModel(){return this.model.lock(),this._locked=!0,this}},{key:"unlockModel",value:function unlockModel(){return this._locked=!1,this.model.unlock(),this}},{key:"serialize",value:function serialize(){return this.model.serialize()}},{key:"lockCommits",value:function lockCommits(props){var _this=this;return props.forEach(function(prop){_this._commits[prop]={locked:!0,queue:[]}}),this}},{key:"unlockCommits",value:function unlockCommits(props){var _this2=this,commitsObj=this._commits;return this.lockModel(),props.forEach(function(prop){commitsObj[prop].locked=!1;var queuedProps={},queue=commitsObj[prop].queue;queue.forEach(function(params){var _params=store_slicedToArray(params,3),propName=_params[0],value=_params[1],namespace=_params[2];if(namespace){var propObj=initProp(queuedProps,[propName,namespace]);Object.assign(propObj,value)}}),queue.forEach(function(params){var _params2=store_slicedToArray(params,3),propName=_params2[0],value=_params2[1],namespace=_params2[2];_this2.commit(propName,propName in queuedProps?queuedProps[propName][namespace]:value,namespace)}),delete commitsObj[prop]}),this.unlockModel(),this}},{key:"addSubNamespace",value:function addSubNamespace(sns,namespace,context){var listeners=this._registeredListeners[namespace],propListenerMap=this._propListenerMap;initProp(this._contextMap,[namespace]),this._contextMap[namespace][sns]=context;var _loop=function _loop(key){var obj=listeners[key],propObj=propListenerMap[key],propFns=listenerTypes.reduce(function(acc,type){var val=defaultValue(getObjProp(propObj,type,"fns"),0);return val&&(acc[type]=val),acc},{}),allProps=obj.allProps,subNamespaces=obj.subNamespaces,subNamespace=obj.subNamespace;(subNamespace.length?subNamespace:[sns]).forEach(function(ns){var nsObj=ns instanceof Function?ns(context):ns,names=function retrieveNamespaces(names,key){return names instanceof Object?[names[key]]:names instanceof Array?names:[names]}(nsObj,key),depProps=allProps.reduce(function(acc,prop){return acc[prop]=ns instanceof Function?nsObj[prop]:ns,acc},{});names.forEach(function(nm){for(var type in initProp(subNamespaces,[nm],store_createMap).set(sns,{depProps:depProps}),propFns){initProp(propObj,[type,nm]);var fns=propFns[type];propObj[type][nm]={fns:fns,_fnCount:fns}}})})};for(var key in listeners)_loop(key);return this}},{key:"commit",value:function commit(propName,value,namespace){var disableListener=arguments.length>3&&void 0!==arguments[3]&&arguments[3],sanitizedVal=value,commits=this._commits,savedCommits=this._savedCommits,locked=getObjProp(commits,propName,"locked"),propListenerMap=this._propListenerMap[propName]||{};if(propListenerMap.disabled=disableListener,locked)return commits[propName].queue.push([propName,value,namespace]),this;if(namespace){if(this._locked){var queuedProps=initProp(this._queuedProps,[propName]);queuedProps[namespace]=value,sanitizedVal=queuedProps}else(sanitizedVal=defaultValue(this.get(propName),{}))[namespace]=value;listenerTypes.forEach(function(type){initProp(savedCommits,[propName,type]),savedCommits[propName][type][namespace]=!0,getObjProp(propListenerMap,type,namespace)&&(propListenerMap[type][namespace].fns=propListenerMap[type][namespace]._fnCount)})}return this.model.prop(propName,sanitizedVal),this}},{key:"registerChangeListener",value:function registerChangeListener(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];return store_registerListener.apply(void 0,[this,"next"].concat(params)),this}},{key:"registerImmediateListener",value:function registerImmediateListener(){for(var _len4=arguments.length,params=new Array(_len4),_key4=0;_key4<_len4;_key4++)params[_key4]=arguments[_key4];store_registerListener.apply(void 0,[this,"on"].concat(params))}},{key:"get",value:function get(propName,subNamespace){var value=this.model.prop(propName);return subNamespace?value&&value[subNamespace]:value}},{key:"computed",value:function computed(propName,callBack){return this.model.calculatedProp(propName,callBack)}},{key:"append",value:function append(){var _this$model;return(_this$model=this.model).append.apply(_this$model,arguments),this}},{key:"unsubscribeAll",value:function unsubscribeAll(){return Object.values(this._listeners).forEach(function(fn){return fn()}),this}},{key:"unsubscribe",value:function unsubscribe(){var namespaceInf=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},id=namespaceInf.id,key=namespaceInf.key,listenersMap=this._listeners,listeners=listenersMap.get(id);if(key){var fn=listenersMap.get(key);fn&&fn()}else{var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=listeners.values()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){(0,_step2.value)()}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}listenersMap.set(id,[])}return this}},{key:"removeSubNamespace",value:function removeSubNamespace(subNamespace,namespace){var listenerMap=this._registeredListeners,contextMap=this._contextMap,propListenerMap=this._propListenerMap,listenersObj=listenerMap[namespace];for(var prop in listenersObj){var subNamespaces=listenersObj[prop].subNamespaces,propInf={subNamespace:subNamespace,prop:prop,propListenerMap:propListenerMap};if(subNamespaces[subNamespace])removePropValue(this,subNamespaces[subNamespace],propInf),delete subNamespaces[subNamespace];else for(var ns in subNamespaces){var snsMap=subNamespaces[ns];removePropValue(this,snsMap,propInf),snsMap.size||delete subNamespaces[ns]}}return delete contextMap[namespace][subNamespace],this}}]),Store}(),store_transactor=function transactor(holder,options,model){var conf,namespaceInf=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},store=model instanceof store_Store?model:new store_Store({}),stateProps={},namespace=namespaceInf.namespace,subNamespace=namespaceInf.subNamespace;for(var prop in options)if({}.hasOwnProperty.call(options,prop)){conf=options[prop];var nameSpaceProp=namespace?"".concat(namespace,".").concat(prop):prop;if(subNamespace){var value=defaultValue(store.get(nameSpaceProp),{});value[subNamespace]=conf.value,stateProps[nameSpaceProp]=value}else stateProps[prop]=conf.value;holder[prop]=function(context,meta,nsProp){return function(){for(var _len5=arguments.length,params=new Array(_len5),_key5=0;_key5<_len5;_key5++)params[_key5]=arguments[_key5];if(params.length){var _ref$takesMultiplePar=(meta||{}).takesMultipleParams,takesMultipleParams=void 0!==_ref$takesMultiplePar&&_ref$takesMultiplePar,val=takesMultipleParams?params:params[0];if(meta){var values,prevVal=context.get(nsProp,subNamespace),sanitization=meta.sanitization,typeCheck=meta.typeCheck,typeExpected=meta.typeExpected;if("function"==typeof sanitization&&(val=sanitization(val,prevVal,holder)),"function"==typeof typeCheck)typeCheck(val)&&(values=val);else"string"==typeof typeCheck&&"constructor"===typeCheck?val&&val.constructor.name===typeExpected&&(values=val):values=val;var preset=meta.preset,oldValues=toArray(context.get(nsProp,subNamespace));preset&&preset(values,holder),takesMultipleParams&&oldValues.forEach(function(value,i){void 0===values[i]&&(values[i]=value)}),values&&context.commit(nsProp,values,subNamespace)}else context.commit(nsProp,val,subNamespace);return holder}return context.get(nsProp,subNamespace)}}(store,conf.meta,nameSpaceProp,Array.isArray(conf.value))}if(subNamespace)for(var key in stateProps)store.commit(key,stateProps[key][subNamespace],subNamespace);else void 0===namespace?store.append(stateProps):store.append(namespace,stateProps);return[holder,store]},SmartlabelManager=__webpack_require__(3),SmartlabelManager_default=__webpack_require__.n(SmartlabelManager),events=["initialized","beforeupdate","updated","beforedraw","drawn","beforeremove","removed","animationend"],EVENT_LIST=[];["canvas","unit","layer","axis","facet-headers","legend","caption"].forEach(function(composition){events.forEach(function(event){EVENT_LIST.push("".concat(composition,".").concat(event))})});var event_list=EVENT_LIST;function lifecycle_manager_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this._lifeCycles=lifeCycles,this._releasePromisesFromCache()}},{key:"_resetTargetPromise",value:function _resetTargetPromise(eventName){var _this4=this;setTimeout(function(){_this4._notifiers[eventName]=lifecycle_manager_resolver,_this4._promises.set(eventName,_this4._makeNotifierPromise(eventName))},0)}}]),LifeCycleManager}(),src_InvalidAwareTypes=datamodel_default.a.InvalidAwareTypes,DRAG="drag",HOVER="hover",SELECTIONDRAG="selectiondrag",CLICK="click",LONGTOUCH="longtouch",TOUCHDRAG="touchdrag",ALL_ACTIONS="*",SELECTION_NEW_ENTRY=1,SELECTION_NEW_EXIT=-1,SELECTION_NULL=0,SELECTION_OLD_ENTRY=2,SELECTION_OLD_EXIT=-2;function selection_set_defineProperties(target,props){for(var i=0;i0?(set[key]===SELECTION_OLD_ENTRY&&retObj.entrySet[0].push(key),set[key]===SELECTION_NEW_ENTRY&&retObj.entrySet[1].push(key)):set[key]<0&&(set[key]===SELECTION_OLD_EXIT&&retObj.exitSet[0].push(key),set[key]===SELECTION_NEW_EXIT&&retObj.exitSet[1].push(key)),retObj.completeSet.push(key);return["entrySet","exitSet"].forEach(function(type){retObj[type]=retObj[type].map(function(e){return e.map(Number)})}),retObj.completeSet=retObj.completeSet.map(Number),retObj}},{key:"reset",value:function reset(ids){var set=this._set;if(ids)ids.forEach(function(i){set[i]=SELECTION_NULL});else{var lockedSel=this._lockedSelection;for(var key in set)key in lockedSel||(set[key]=SELECTION_NULL)}return this._resetted=!0,this}},{key:"getEntrySet",value:function getEntrySet(){var set=this._set,addSet=[];for(var key in set)set[key]===SELECTION_NEW_ENTRY&&addSet.push(key);return addSet}},{key:"getExistingEntrySet",value:function getExistingEntrySet(addSet){var set=this._set;return addSet.filter(function(d){return set[d]===SELECTION_NEW_ENTRY||set[d]===SELECTION_OLD_ENTRY})}},{key:"getExistingExitSet",value:function getExistingExitSet(removeSet){var set=this._set;return removeSet.filter(function(d){return set[d]===SELECTION_NEW_EXIT||set[d]===SELECTION_OLD_EXIT})}},{key:"getOldEntry",value:function getOldEntry(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_ENTRY&&updateSet.push(key);return updateSet}},{key:"getOldExit",value:function getOldExit(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_EXIT&&updateSet.push(key);return updateSet}},{key:"getExitSet",value:function getExitSet(){var set=this._set,removeSet=[];for(var key in set)set[key]===SELECTION_NEW_EXIT&&removeSet.push(key);return removeSet}},{key:"getCompleteSet",value:function getCompleteSet(){var set=this._set,completeSet=[];for(var key in set)completeSet.push(key);return completeSet}},{key:"getCompleteSetCount",value:function getCompleteSetCount(){return this._completeSetCount}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"toggle",value:function toggle(){var set=this._set;for(var key in set)set[key]===SELECTION_NEW_ENTRY?set[key]=SELECTION_NEW_EXIT:set[key]===SELECTION_NEW_EXIT?set[key]=SELECTION_NEW_ENTRY:set[key]===SELECTION_OLD_ENTRY?set[key]=SELECTION_OLD_EXIT:set[key]=SELECTION_OLD_ENTRY;return this}}]),SelectionSet}();function helper_toConsumableArray(arr){return function helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i3&&void 0!==arguments[3]?arguments[3]:{},sideEffectStore=this.sideEffects(),sideEffect=sideEffectStore[name],disable=!1;options.filter&&options.filter(sideEffect)&&(disable=!0),!disable&&sideEffectStore[name].apply(selectionSet,payload,options)}},{key:"registerPropagationBehaviourMap",value:function registerPropagationBehaviourMap(map){return this._propagationBehaviourMap=Object.assign(this._propagationBehaviourMap,map||{}),this}},{key:"dispatchBehaviour",value:function dispatchBehaviour(behaviour,payload){var propagationInfo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},propagate=void 0===propagationInfo.propagate||propagationInfo.propagate,action=this._actions.behavioural[behaviour],sideEffects=function getSideEffects(behaviour,behaviourEffectMap){var sideEffects=[];for(var key in behaviourEffectMap){var behaviours=key.split(",");behaviours.some(function(d){return d===behaviour})&&sideEffects.push({effects:behaviourEffectMap[key],behaviours:behaviours})}return sideEffects}(behaviour,this._behaviourEffectMap);if(this._propagationInf=propagationInfo,action){var selectionSet=action.dispatch(payload),propagationSelectionSet=this.getPropagationSelectionSet(selectionSet);this._entryExitSet[behaviour]=propagationSelectionSet;var shouldApplySideEffects=this.shouldApplySideEffects(propagate);if(propagate&&this.propagate(behaviour,payload,selectionSet.find(function(d){return d.sourceSelectionSet}),sideEffects),shouldApplySideEffects){var applicableSideEffects=this.getApplicableSideEffects(sideEffects,payload,propagationInfo);this.applySideEffects(applicableSideEffects,propagationSelectionSet,payload)}}return this}},{key:"getPropagationSelectionSet",value:function getPropagationSelectionSet(selectionSet){return selectionSet.find(function(d){return!d.sourceSelectionSet})}},{key:"shouldApplySideEffects",value:function shouldApplySideEffects(){return!0}},{key:"changeBehaviourStateOnPropagation",value:function changeBehaviourStateOnPropagation(behaviour,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",behaviourConditions=this._sourceBehaviours[behaviour]||(this._sourceBehaviours[behaviour]={});return value instanceof Function?behaviourConditions[key]=value:behaviourConditions[key]=function(){return value},this}},{key:"changeSideEffectStateOnPropagation",value:function changeSideEffectStateOnPropagation(sideEffect,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",sideEffectConditions=this._sourceSideEffects[sideEffect]||(this._sourceSideEffects[sideEffect]={});value instanceof Function?sideEffectConditions[key]=value:sideEffectConditions[key]=function(){return value}}},{key:"removeSideEffectPolicy",value:function removeSideEffectPolicy(sideEffect,key){return delete this._sourceSideEffects[sideEffect][key],this}},{key:"removeBehaviourPolicy",value:function removeBehaviourPolicy(behaviour,key){return delete this._sourceBehaviours[behaviour][key],this}},{key:"propagate",value:function propagate(){return this}},{key:"sideEffects",value:function sideEffects(){return arguments.length?(this._sideEffects=arguments.length<=0?void 0:arguments[0],this):this._sideEffects}},{key:"enableSideEffects",value:function enableSideEffects(fn){return changeSideEffectAvailability(this,fn,!0),this}},{key:"disableSideEffects",value:function disableSideEffects(fn){return changeSideEffectAvailability(this,fn,!1),this}},{key:"dissociateBehaviour",value:function dissociateBehaviour(behaviour,physicalAction){var actionBehaviourMap=this._actionBehaviourMap;for(var key in actionBehaviourMap)if(key===physicalAction){var behaviourMap=actionBehaviourMap[key];behaviourMap.behaviours=behaviourMap.behaviours.filter(function(d){return d!==behaviour}),this.mapActionsAndBehaviour(key)}return this}},{key:"dissociateSideEffect",value:function dissociateSideEffect(sideEffect,behaviour){var behaviourEffectMap=this._behaviourEffectMap;return behaviourEffectMap[behaviour]=behaviourEffectMap[behaviour].filter(function(d){return(d.name||d)!==sideEffect}),this}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects){return sideEffects}},{key:"attachPropagationListener",value:function attachPropagationListener(dataModel){return dataModel.unsubscribe("propagation"),dataModel.on("propagation",this.onDataModelPropagation()),this}},{key:"onDataModelPropagation",value:function onDataModelPropagation(){var _this2=this;return function(propValue){var payload=propValue.payload,action=payload.action;_this2.dispatchBehaviour(action,payload,{propagate:!1})}}},{key:"createSelectionSet",value:function createSelectionSet(uniqueIds,behaviouralActions){var behaviours=behaviouralActions||this._actions.behavioural,selectionSet=this._selectionSet,volatileSelectionSet=this._volatileSelectionSet;for(var key in behaviours)({}).hasOwnProperty.call(behaviours,key)&&(selectionSet[key]=new src_selection_set(uniqueIds),volatileSelectionSet[key]=new src_selection_set(uniqueIds,!0),this._entryExitSet[key]=null);return this._volatileSelectionSet=volatileSelectionSet,this.selectionSet(selectionSet),this}},{key:"selectionSet",value:function selectionSet(){return arguments.length?(this._selectionSet=arguments.length<=0?void 0:arguments[0],this):this._selectionSet}},{key:"initializeSideEffects",value:function initializeSideEffects(){var sideEffectDefinitions=this._sideEffectDefinitions;return this.sideEffects(function initializeSideEffects(context,sideEffects){var sideEffectsMap=context._sideEffects;return(sideEffects=sideEffects instanceof Array?sideEffects:Object.values(sideEffects)).forEach(function(SideEffect){var formalName=SideEffect.formalName(),sideEffectInstance=sideEffectsMap[formalName];sideEffectsMap[formalName]=sideEffectInstance||new SideEffect(context)}),sideEffectsMap}(this,sideEffectDefinitions)),this}},{key:"registerPhysicalActions",value:function registerPhysicalActions(actions){var initedActions=function initializePhysicalActions(context,actions){var physicalActions={};for(var name in actions)({}).hasOwnProperty.call(name,actions)||(physicalActions[name]=actions[name](context));return physicalActions}(this,actions);return Object.assign(this._actions.physical,initedActions),this}},{key:"propagateWith",value:function propagateWith(action,fields){var append=arguments.length>2&&void 0!==arguments[2]&&arguments[2],behaviouralActions=this._actions.behavioural;if(action===ALL_ACTIONS)for(var key in behaviouralActions)this._propagationFields[key]={fields:fields,append:append};else this._propagationFields[action]={fields:fields,append:append};return this}},{key:"mapActionsAndBehaviour",value:function mapActionsAndBehaviour(phyAction){var initedPhysicalActions=this._actions.physical,map=this._actionBehaviourMap;for(var action in map)if(!{}.hasOwnProperty.call(action,map)&&action===(phyAction||action)){var target=void 0,mapObj=map[action];target=mapObj.target;var touch=mapObj.touch;target||(target=this.context.getDefaultTargetContainer()),(hasTouch()?!0===touch||void 0===touch:!touch)&&this.bindActionWithBehaviour(initedPhysicalActions[action],target,mapObj.behaviours)}return this}},{key:"registerPhysicalBehaviouralMap",value:function registerPhysicalBehaviouralMap(map){return this._actionBehaviourMap=mergeRecursive(this._actionBehaviourMap,map),this}},{key:"bindActionWithBehaviour",value:function bindActionWithBehaviour(action,targets,behaviourList){var _this3=this;return"string"==typeof targets&&(targets=[targets]),targets.forEach(function(target){var mount=_this3.context.mount(),nodes=target.node instanceof Function?target:renderer_utils_selectElement(mount).selectAll(target);nodes.empty()||(nodes instanceof Array?nodes.forEach(function(node){action(renderer_utils_selectElement(node),behaviourList)}):action(nodes,behaviourList))}),this}},{key:"getPropagationInf",value:function getPropagationInf(){return this._propagationInf}},{key:"getAddSetFromCriteria",value:function getAddSetFromCriteria(criteria){var propagationInf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=this.context,filteredDataModel=propagationInf.data?propagationInf.data:context.getDataModelFromIdentifiers(criteria,"all");return{model:filteredDataModel,uids:null===criteria?null:propagationInf.data?propagationInf.entryRowIds:filteredDataModel[0].getUids()}}},{key:"getSelectionSets",value:function getSelectionSets(action){var sourceId=this.context.id(),propagationSource=(this._propagationInf||{}).sourceId,applicableSelectionSets=[];return propagationSource!==sourceId&&(applicableSelectionSets=[this._volatileSelectionSet[action]]),propagationSource&&applicableSelectionSets.push(this.selectionSet()[action]),applicableSelectionSets}},{key:"getFullData",value:function getFullData(){return this.context.data()}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"getEntryExitSet",value:function getEntryExitSet(behaviour){return this._entryExitSet[behaviour]}}]),Firebolt}();function generic_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},sourceIdentifiers=propagationInf.sourceIdentifiers;return sourceIdentifiers?sourceIdentifiers.getSchema().map(function(d){return d.name}):criteria instanceof Array?criteria[0]:Object.keys(criteria||{})}(propagationInf,payload.criteria),sourceSelectionSet:!0===selectionSet._volatile}}},{key:"enable",value:function enable(){this._enabled=!0}},{key:"disable",value:function disable(){this._enabled=!1}},{key:"isEnabled",value:function isEnabled(){return this._enabled}}],[{key:"mutates",value:function mutates(){return!1}}]),GenericBehaviour}();function volatile_typeof(obj){return(volatile_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function volatile_defineProperties(target,props){for(var i=0;iydom[0]?ydom:xdom,max=min===ydom?xdom:ydom;min[1]100&&Math.abs(startPos.x-endPos.x)<=5)){endPos.x=Math.max(0,Math.min(endPos.x,drawingInf.width)),endPos.y=Math.max(0,Math.min(endPos.y,drawingInf.height));var payload=drag_action_config(firebolt.context.getSourceInfo(),{startPos:startPos,endPos:endPos,snap:!0},firebolt.context.data().getFieldsConfig());payload.dragEnd=!0,behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)})}}))},physical_hover=function hover(firebolt){return function(targetEl,behaviours){var dispatchBehaviour=function dispatchBehaviour(args){var event=renderer_utils_getEvent(),context=firebolt.context,mode=context.config().interaction.tooltip.mode,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{getAllPoints:"consolidated"===mode||"fragmented"===mode,data:args,event:event}),payload={criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos,mode:mode};behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()};targetEl.on("mouseover",dispatchBehaviour).on("mousemove",dispatchBehaviour).on("mouseout",function(){behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,{criteria:null})})})}},helpers_generatePayloadFromEvent=function generatePayloadFromEvent(args,event,firebolt){var context=firebolt.context,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event.touches?event.touches[0]:event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{data:args,event:event});return{criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos}},physical_click=function click(firebolt){return function(targetEl,behaviours){targetEl.on("click",function dispatchBehaviour(args){var event=renderer_utils_getEvent(),payload=helpers_generatePayloadFromEvent(args,event,firebolt);behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()})}};function physical_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var physicalActions=(physical_defineProperty(_physicalActions={},DRAG,function drag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt)}}),physical_defineProperty(_physicalActions,HOVER,physical_hover),physical_defineProperty(_physicalActions,CLICK,physical_click),physical_defineProperty(_physicalActions,LONGTOUCH,function longtouch(firebolt){return function(targetEl,behaviours){var event,touchEnd;touchEnd=!1,event=renderer_utils_getEvent(),targetEl.on("touchstart",function(args){event=renderer_utils_getEvent(),touchEnd=!1,setTimeout(function(){touchEnd?behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,{criteria:null})}):function dispatchBehaviour(args){var payload=helpers_generatePayloadFromEvent(args,event,firebolt);behaviours.forEach(function(beh){return firebolt.dispatchBehaviour(beh,payload)}),event.stopPropagation()}(args)},100)}).on("touchend",function(){touchEnd=!0})}}),physical_defineProperty(_physicalActions,TOUCHDRAG,function touchdrag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt,!0)}}),_physicalActions),side_effects_ANCHORS="anchors",side_effects_TOOLTIP="tooltip",side_effects_BRUSH_ANCHORS="brush-anchors",side_effects_PERSISTENT_ANCHORS="persistent-anchors",side_effects_FILTER="filter",side_effects_HIGHLIGHTER="highlighter",CROSSLINE="crossline",PROPS={valueParser:{defaultValue:function defaultValue(val){return val}}};function generic_sideeffect_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];var interactionType=arguments.length>2?arguments[2]:void 0,apply=arguments.length>3?arguments[3]:void 0;return this.firebolt.context.layers().forEach(function(layer){return!1!==layer.config().interactive&&layer.applyInteractionStyle(interactionType,set.uids,apply)}),this}}]),SurrogateSideEffect}();function spawnable_typeof(obj){return(spawnable_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function spawnable_defineProperties(target,props){for(var i=0;i=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(context.getSourceInfo(),{startPos:{x:x,y:y},endPos:{x:x2,y:y2}},context.data().getFieldsConfig());onDrag(payload)}}).on("end",function(){var width=drawingInf.width,height=drawingInf.height,x=Math.min(width-subject.width,Math.max(subject.x,0)),y=Math.min(height-subject.height,Math.max(subject.y,0)),y2=y+subject.height,x2=x+subject.width;if(x>=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(context.getSourceInfo(),{startPos:{x:x,y:y},endPos:{x:x2,y:y2},snap:!0},context.data().getFieldsConfig());payload.dragEnd=!0,onDrag(payload)}}))}}(firebolt)(renderer_utils_selectElement(this),["brush"],sideEffect)}).merge(selection).each(function(attrs){var element=renderer_utils_selectElement(this);for(var key in transition&&(element=element.transition().duration(transition.duration)),attrs)({}).hasOwnProperty.call(attrs,key)&&isValidValue(attrs[key])&&element.attr(key,attrs[key])}),boxClassName=getQualifiedClassName(boxConf.defClassName,this._id,classPrefix);return selectionBox.classed(boxClassName.join(" "),!0),selectionBox.classed(boxConf.className,!0),this}},{key:"hide",value:function hide(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!1)}},{key:"show",value:function show(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!0)}}],[{key:"defaultConfig",value:function defaultConfig(){return{defClassName:"selection-box-group",className:"",classPrefix:"muze",box:{defClassName:"selection-box",className:""},transition:{duration:200}}}},{key:"formalName",value:function formalName(){return"selectionBox"}}]),SelectionBox}(),INITIAL_STYLE={position:"absolute",width:0,height:0},default_config_defaultConfig={classPrefix:"muze",defClassName:"tooltip-box",connectorClassName:"tooltip-connectors",className:"",row:{margin:0},content:{spacing:5,iconContainerSize:10,iconScale:1,iconShape:"circle",iconColor:"#ff0000",rowMargin:"4px 0 4px 0",margin:10,separator:":",className:"tooltip-content-container",parentClassName:"tooltip-content-parent-container"},arrow:{size:10,disabled:!1,defClassName:"tooltip-arrow",className:"",color:"rgba(195,195,195,0.85)"}},helper_getArrowPos=function getArrowPos(orient,dim,measurement,config){var arrowPos,x=measurement.x,y=measurement.y,boxHeight=measurement.boxHeight,boxWidth=measurement.boxWidth,arrowWidth=config.arrow.disabled?0:config.arrow.size;if("left"===orient||"right"===orient){var start=0,diff=boxHeight/2,plotBottom=dim.y+dim.height,boxBottom=y+boxHeight;dim.y>y?(start=dim.y-y,diff=(plotBottom>=boxBottom?boxBottom-dim.y:dim.height)/2):boxBottom>plotBottom&&(diff=Math.abs(y-(dim.y+dim.height))/2),arrowPos=start+diff-arrowWidth/2}else{var _start=0,_diff=boxWidth/2,plotRight=dim.x+dim.width,boxRight=x+boxWidth;dim.x>x?(_start=dim.x-x,_diff=(plotRight>=boxRight?boxRight-dim.x:dim.width)/2):boxRight>plotRight&&(_diff=Math.abs(x-(dim.x+dim.width))/2),arrowPos=_start+_diff-arrowWidth/2}return arrowPos},helper_placeArrow=function placeArrow(context,position,arrowPos){var tooltipArrow=context._tooltipArrow,tooltipBackground=context._tooltipBackground,config=context._config,classPrefix=config.classPrefix,arrowConf=config.arrow,className=getQualifiedClassName(arrowConf.defClassName,context._id,config.classPrefix);tooltipArrow.style("display","block"),tooltipArrow.attr("class","".concat(className.join(" "))),"left"===position||"right"===position?(tooltipArrow.style("top","".concat(arrowPos,"px")),tooltipArrow.style("left",""),tooltipBackground.style("top","".concat(arrowPos,"px")),tooltipBackground.style("left","")):("bottom"===position?tooltipArrow.style("top","100%"):tooltipArrow.style("top","-".concat(arrowConf.size,"px")),tooltipArrow.style("left","".concat(arrowPos,"px")),"bottom"===position?tooltipBackground.style("top","100%"):tooltipBackground.style("top","-".concat(arrowConf.size+3,"px")),tooltipBackground.style("left","".concat(arrowPos,"px"))),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow"),!0),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow-").concat(context._arrowOrientation),!1),tooltipArrow.classed("".concat(classPrefix,"-tooltip-arrow-").concat(position),!0),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow"),!0),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow-").concat(context._arrowOrientation),!1),tooltipBackground.classed("".concat(classPrefix,"-tooltip-background-arrow-").concat(position),!0)};__webpack_require__(10);function content_defineProperties(target,props){for(var i=0;i0?(this._config=mergeRecursive(this._config,arguments.length<=0?void 0:arguments[0]),this):this._config}},{key:"update",value:function update(item){return this._model=item.model,this._formatter=item.formatter,this}},{key:"context",value:function context(ctx){return this._context=ctx,this}},{key:"render",value:function render(mount){var data,config=this._config,iconContainerSize=config.iconContainerSize,formatter=this._formatter,rowMargin=config.rowMargin,model=this._model,classPrefix=config.classPrefix;if(this._mount=mount,(data=model instanceof Array?model:formatter(this._model,this.config(),this._context))instanceof Function){makeElement(mount,"div",[1],"".concat(classPrefix,"-tooltip-html-container")).html(data())}else{var content=data,displayFormat="default";isSimpleObject(data)&&(content=data.content,displayFormat=data.displayFormat);var body=makeElement(mount,"div",[displayFormat],"".concat(classPrefix,"-tooltip-content"),{},function(d){return d});if("table"===displayFormat){var table=makeElement(body,"table",[1],"".concat(classPrefix,"-tooltip-table")),tbody=makeElement(table,"tbody",[1],"".concat(classPrefix,"-tooltip-table-tbody")),rows=makeElement(tbody,"tr",content,"".concat(classPrefix,"-tooltip-table-row"));rows.each(function(d,i){renderer_utils_selectElement(this).classed("".concat(classPrefix,"-tooltip-table-row-").concat(i),!0)}),makeElement(rows,"td",function(d){return d},"".concat(classPrefix,"-tooltip-table-cell")).each(function(d){renderer_utils_selectElement(this).html(d)})}else{var _rows=makeElement(body,"div",content,"",{update:function update(elem,elemData){return elem.attr("class",elemData.className)}}),_cells=makeElement(_rows,"span",function(d){return d.data},"".concat(classPrefix,"-tooltip-content"));_cells.attr("class","".concat(classPrefix,"-tooltip-content")),renderer_utils_setStyles(_rows,{margin:rowMargin}),renderer_utils_setStyles(_cells,{display:"inline-block"}),_cells.each(function(d){var el=renderer_utils_selectElement(this);if(el.html(""),d instanceof Object)if("icon"===d.type){var svg=makeElement(el,"svg",[1]),path=makeElement(svg,"path",[1]),shape=d.shape instanceof Function?d.shape:common_utils_getSymbol(d.shape);renderer_utils_setAttrs(svg,{x:0,y:0,width:iconContainerSize,height:iconContainerSize}),renderer_utils_setAttrs(path,{d:shape.size(d.size)(),transform:"translate(".concat(iconContainerSize/2,", ").concat(iconContainerSize/2,")")}),renderer_utils_setStyles(path,{fill:d.color}),renderer_utils_setStyles(svg,{width:"".concat(iconContainerSize,"px"),height:"".concat(iconContainerSize,"px")})}else el.html(d.value),d.className&&el.classed(d.className,!0),renderer_utils_setStyles(el,d.style);else el.html(d)})}}return this}},{key:"clear",value:function clear(){return this._model=null,this}}],[{key:"defaultConfig",value:function defaultConfig(){var config=default_config_defaultConfig.content;return config.classPrefix=default_config_defaultConfig.classPrefix,config}}]),Content}();function tooltip_defineProperties(target,props){for(var i=0;i0){var defConf=mergeRecursive({},this.constructor.defaultConfig());return this._config=mergeRecursive(defConf,arguments.length<=0?void 0:arguments[0]),this}return this._config}},{key:"addClass",value:function addClass(className){return this._tooltipContainer.classed(className,!0),this}},{key:"context",value:function context(){return arguments.length?(this._context=arguments.length<=0?void 0:arguments[0],this):this._context}},{key:"content",value:function content(name,data){var contentConfig=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},config=this.config(),classPrefix=config.classPrefix,contentClass=config.content.className,formatter=config.formatter,className=contentConfig.className||"".concat(classPrefix,"-").concat(contentClass,"-").concat(name),content=this._contents[name]=this._contents[name]||new content_Content,container=makeElement(this._contentContainer,"div",[contentConfig.order],className);container.attr("class","".concat(classPrefix,"-").concat(contentClass," ").concat(className)),function reorderContainers(parentContainer,className){parentContainer.selectAll(className).sort(function(a,b){return a-b})}(this._contentContainer,".".concat(classPrefix,"-").concat(contentClass));var contentConf=config.content;return contentConfig.classPrefix=this._config.classPrefix,content.config(contentConf),null===data?(content.clear(),container.remove(),delete this._contents[name]):(content.update({model:data,formatter:contentConfig.formatter||formatter}),content.context(this._context),content.render(container)),Object.keys(this._contents).length||this.hide(),this}},{key:"getContents",value:function getContents(){return Object.values(this._contents)}},{key:"position",value:function position(x,y){var conf=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Object.keys(this._contents).length)return this.hide(),this;this.show();var target=this._target,repositionArrow=conf.repositionArrow;if(target&&repositionArrow){var node=this._tooltipContainer.node(),config=this._config,arrowDisabled=config.arrow.disabled,arrowWidth=arrowDisabled?0:config.arrow.size,arrowOrient=this._arrowOrientation,outsidePlot="left"===arrowOrient||"right"===arrowOrient?y+node.offsetHeight-arrowWidthtarget.y+target.height:x+node.offsetWidth-arrowWidthtarget.x+target.width;if(!arrowDisabled)if(outsidePlot){var path;this._tooltipArrow.style("display","none"),this._tooltipBackground.style("display","none"),this._tooltipConnectorContainer.style("display","block");var connector=this._tooltipConnectorContainer.selectAll("path").data([1]),enter=connector.enter().append("path");"left"===arrowOrient?path="M ".concat(x," ").concat(y+node.offsetHeight/2," L ").concat(target.x+target.width)+" ".concat(target.y+target.height/2):"right"===arrowOrient?path="M ".concat(x+node.offsetWidth," ").concat(y+node.offsetHeight/2)+" L ".concat(target.x," ").concat(target.y+target.height/2):"bottom"===arrowOrient&&(path="M ".concat(x+node.offsetWidth/2," ").concat(y+node.offsetHeight)+" L ".concat(target.x+target.width/2," ").concat(target.y)),enter.merge(connector).attr("d",path).style("display","block")}else{var arrowPos=helper_getArrowPos(arrowOrient,target,{x:x,y:y,boxHeight:node.offsetHeight,boxWidth:node.offsetWidth},this._config);helper_placeArrow(this,this._arrowOrientation,arrowPos),this._tooltipConnectorContainer.style("display","none")}}var offset=this._offset||{x:0,y:0};return this._tooltipContainer.style("left","".concat(offset.x+x,"px")).style("top","".concat(offset.y+y,"px")),this}},{key:"positionRelativeTo",value:function positionRelativeTo(dim){var obj,_this=this,tooltipConf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},orientation=tooltipConf.orientation;if(this.show(),!dim)return this.hide(),this;var extent=this._extent,node=this._tooltipContainer.node();this._tooltipContainer.style("top","0px").style("left","0px");var offsetWidth=node.offsetWidth+2,offsetHeight=node.offsetHeight+2,config=this._config,offset=this._offset,arrowDisabled=config.arrow.disabled,arrowSize=arrowDisabled?0:config.arrow.size,draw=void 0===tooltipConf.draw||tooltipConf.draw,topSpace=dim.y,dimX=dim.x+dim.width+offset.x,rightSpace=extent.width-dimX,leftSpace=dim.x+offset.x-extent.x,positionTop=topSpace>offsetHeight+arrowSize,positionRight=rightSpace>=offsetWidth+arrowSize,positionLeft=leftSpace>=offsetWidth+arrowSize;return this._target=dim,orientation||(orientation=positionTop?"vertical":positionRight||positionLeft?"horizontal":"vertical"),"horizontal"===orientation?obj=function positionHorizontal(){var position,x=dim.x+dim.width,y=dim.y;return positionRight?(position="left",x+=arrowSize):positionLeft?(x=dim.x-offsetWidth,position="right",x-=arrowSize):(position="left",x+=arrowSize),dim.height1;hasMultipleMeasures&&content.push({data:[icon,formattedRetinalValue]});var isSelected=target[1][target[0].indexOf(retField)]===retinalFieldValue;measuresArr.forEach(function(measure){var measureIndex=fieldsConfig[measure].index,_fieldInf$measure=fieldInf[measure],dName=_fieldInf$measure.displayName,value=(0,_fieldInf$measure.fn)(valueArr[measureIndex]),keyValue=getKeyValue({field:hasMultipleMeasures?"".concat(dName).concat(separator):formattedRetinalValue,value:value,classPrefix:classPrefix,margin:hasMultipleMeasures?margin:void 0,isSelected:isSelected});hasMultipleMeasures||(keyValue.data=[icon].concat(strategies_toConsumableArray(keyValue.data))),content.push(keyValue)})}};for(var retField in retinalFields)_loop(retField)},strategies_buildTooltipData=function buildTooltipData(dataModel){var nestedDataObj,displayFormat,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=arguments.length>2?arguments[2]:void 0,fieldValues=[],_dataModel$getData=dataModel.getData(),data=_dataModel$getData.data,schema=_dataModel$getData.schema,fieldspace=dataModel.getFieldspace(),fieldsConfig=dataModel.getFieldsConfig(),_context$firebolt$con=context.firebolt.context.retinalFields(),color=_context$firebolt$con.color,shape=_context$firebolt$con.shape,size=_context$firebolt$con.size,detailFields=context.detailFields||[],dimensions=schema.filter(function(d){return d.type===dist_datamodel.FieldType.DIMENSION}),measures=schema.filter(function(d){return d.type===dist_datamodel.FieldType.MEASURE}),containsDetailField=!!common_utils_intersect(schema,detailFields).length,dataLen=data.length,dimensionMeasureMap=context.dimensionMeasureMap,axes=context.axes,fieldInf=function getFieldInf(schema,dataModel,context){var valueParser=context.valueParser,timeDiffs=context.timeDiffs,fieldsObj=dataModel.getFieldspace().fieldsObj(),defFormatter=strategies_formatters(null,null,valueParser)[dist_datamodel.DimensionSubtype.CATEGORICAL];return schema.reduce(function(inf,field){var subtype=field.subtype,name=field.name,type=field.type,interval=subtype===dist_datamodel.DimensionSubtype.TEMPORAL?timeDiffs[name]:0,nf=type===dist_datamodel.FieldType.MEASURE?fieldsObj[name].numberFormat():function(val){return val};return inf[name]={fn:defaultValue(strategies_formatters(nf,interval,valueParser)[subtype],defFormatter),displayName:"".concat(retrieveFieldDisplayName(dataModel,name))},inf},{})}(schema,dataModel,context);if(dataLen>1&&containsDetailField)fieldValues=function getTabularData(dataObj,fieldInf){var rows=[],data=dataObj.data,schema=dataObj.schema;return rows.push(schema.map(function(d){return fieldInf[d.name].displayName})),data.forEach(function(d){var row=[];schema.forEach(function(fieldObj,i){var value=fieldInf[fieldObj.name].fn(d[i]);row.push(value)}),rows.push(row)}),rows}({data:data,schema:schema,fieldspace:fieldspace},fieldInf),displayFormat="table";else{var retinalFields=[color.field,shape.field,size.field].reduce(function(acc,field){return field&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION&&(acc[field]=1),acc},{}),indices=dimensions.filter(function(field){return!retinalFields[field.name]}).map(function(dim){return fieldsConfig[dim.name].index}),allMeasures=strategies_toConsumableArray(_construct(Set,strategies_toConsumableArray(Object.values(dimensionMeasureMap)))),filteredMeasures=dataLen>1?measures.filter(function(d){return-1===allMeasures.indexOf(d.name)}):measures;!function generateTooltipContent(nestedData){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,content=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],classPrefix=config.classPrefix,separator=config.separator,i=0,len=nestedData.length;i1;content.push(getKeyValue({field:"".concat(displayName).concat(separator),value:formattedValue,classPrefix:classPrefix,margin:margin,isSelected:void 0,removeKey:removeKey}))}if(values[0]&&values[0].key)generateTooltipContent(values,index+1,content);else for(var _loop2=function _loop2(j,len2){var valueArr=values[j];generateRetinalFieldsValues(valueArr,retinalFields,content,{fieldInf:fieldInf,axes:axes,config:config,fieldsConfig:fieldsConfig,dimensionMeasureMap:dimensionMeasureMap,dataLen:dataLen,target:context.payload.target}),filteredMeasures.forEach(function(measure){var name=measure.name,_fieldInf$name=fieldInf[name],displayName=_fieldInf$name.displayName,fn=_fieldInf$name.fn;content.push(getKeyValue({field:"".concat(displayName).concat(separator),value:fn(valueArr[fieldsConfig[name].index]),classPrefix:classPrefix,margin:10}))})},j=0,len2=values.length;j2&&void 0!==arguments[2]?arguments[2]:{},totalHeight=0,totalWidth=0,dataModel=selectionSet.mergedEnter.model,context=this.firebolt.context,drawingInf=this.drawingContext();if(dataModel.isEmpty()||null===payload.criteria)return this.hide(options,null),this;var tooltips=this._tooltips,config=this.config(),boundBox={width:drawingInf.width,height:drawingInf.height},showInPosition=payload.showInPosition,pad=config.padding,dataModels=[],fragmented="fragmented"===config.mode,sourceInf=context.getSourceInfo(),fields=sourceInf.fields,showVertically=!!(!!fields.x[0]&&fields.x[0].type()===dist_datamodel.FieldType.DIMENSION),tooltipPos=payload.position,boxes=[],enter={},uids=dataModel.getData().uids;fragmented?dataModels.push.apply(dataModels,tooltip_toConsumableArray(uids.map(function(d){return dataModel.select(function(fieldsArr,i){return i===d},{saveChild:!1})}))):dataModels.push(dataModel);var target=payload.target,targetFields=[];if(target){targetFields=target[0]||[];for(var sourceFields=payload.sourceFields,indices=[],i=0,len=targetFields.length;idrawingInf.height:totalWidth>drawingInf.width)break;boxes.push({x:position.x,y:position.y,width:tooltipBoundBox.width,height:tooltipBoundBox.height,tooltip:tooltipInst})}}for(var key in tooltips)if(!enter[key]){var tooltip=tooltips[key];tooltip.content(payload.action,null),tooltip.getContents().length||(tooltip.remove(),delete tooltips[key])}return fragmented&&(!function spaceOutBoxes(boxes,extent,showVertically){var y,height,x,width,i,len=boxes.length,spaceOutIfOverlap=function spaceOutIfOverlap(firstBox,secondBox,opposite){x=firstBox.x,width=firstBox.width,y=firstBox.y,height=firstBox.height;var bottom=y+height,right=x+width;showVertically?(opposite?ysecondBox.y)&&(secondBox.y=opposite?firstBox.y-secondBox.height-5:bottom+5):(opposite?xsecondBox.x)&&(secondBox.x=opposite?firstBox.x-secondBox.width-5:right+5)};for(boxes.sort(function(a,b){return showVertically?a.y-b.y:a.x-b.x}),i=0,i=0;iextent.height||boxes[i].x+boxes[i].width>extent.width)for(showVertically?boxes[i].y-=boxes[i].height+boxes[i].y-extent.height:boxes[i].x-=boxes[i].width+boxes[i].x-extent.width,i=len-1;i>0;i--)spaceOutIfOverlap(boxes[i],boxes[i-1],!0)}(boxes,boundBox,showVertically),boxes.forEach(function(box){return box.tooltip.position(box.x,box.y,{repositionArrow:!0})})),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var strategy=options.strategy||this._strategy;tooltips[key].content(strategy,null),tooltips[key].hide()}}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:5,offset:{x:0,y:0},highlightSummary:{dataTransform:function dataTransform(dt,fields){return fields?dt.project(fields,{saveChild:!1}):dt}},selectionSummary:{dataTransform:function dataTransform(dt,fields){var fieldspace=dt.getFieldspace(),dimensions=Object.keys(fieldspace.getDimension()),measures=Object.keys(fieldspace.getMeasure()),projectedFields=defaultValue(fields,measures.length?[measures[0]]:[]);return dt.project([].concat(tooltip_toConsumableArray(dimensions),tooltip_toConsumableArray(projectedFields)),{saveChild:!1})}}}}},{key:"formalName",value:function formalName(){return side_effects_TOOLTIP}}]),Tooltip}();__webpack_require__(12);function crossline_typeof(obj){return(crossline_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function crossline_toConsumableArray(arr){return function crossline_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{};return(0,this._strategies[options.strategy||this._strategy])(selectionSet,this,options.strategy||this._strategy),this}}],[{key:"formalName",value:function formalName(){return side_effects_HIGHLIGHTER}},{key:"target",value:function target(){return"visual-unit"}}]),PlotHighlighter}();function side_effects_filter_typeof(obj){return(side_effects_filter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function side_effects_filter_defineProperties(target,props){for(var i=0;i67.5&&rotationNormalizer<=90||(yShift+=2*height),xShift=width,xShift=90===rotation?height:270===rotation?-height:0,orientation===axis_orientation_TOP?(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift+xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(-xShift+tickSize,"\n ").concat(-yShift-tickSize,") rotate(").concat(rotation,")"))):(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift-xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(xShift-tickSize,"\n ").concat(yShift+tickSize,") rotate(").concat(rotation,")"))),renderer_utils_selectElement(this).transition().duration(1e3).text(datum)}),tickText},axis_renderer_changeTickOrientation=function changeTickOrientation(selectContainer,axisInstance,tickSize){var _smartTicks=axisInstance._smartTicks,config=axisInstance.config(),renderConfig=axisInstance.renderConfig(),labelManager=axisInstance.dependencies().labelManager,orientation=config.orientation,classPrefix=config.classPrefix,labels=renderConfig.labels,rotation=labels.rotation,isSmartTicks=labels.smartTicks,tickText=selectContainer.selectAll(".tick text");if(tickText.selectAll("tspan").remove(),!rotation||"top"!==orientation&&"bottom"!==orientation)if(rotation||isSmartTicks){if(tickText.text(""),"top"===orientation||"bottom"===orientation)tickText.attr("y",0).attr("x",0).attr("transform","").text(""),makeElement(tickText,"tspan",function(d,i){return _smartTicks[i]?_smartTicks[i].lines:[]},"".concat(classPrefix,"-smart-text")).attr("dy","0").style("opacity","0").transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).attr("dy",function(d,i){return"bottom"===orientation||0!==i?_smartTicks[0].oriTextHeight:-_smartTicks[0].oriTextHeight*(_smartTicks[0].lines.length-1)-tickSize}).style("opacity",1).text(function(e){return e}).attr("x",0);else makeElement(tickText,"tspan",function(d,i){return _smartTicks[i].lines},"".concat(classPrefix,"-smart-text")).text(function(e){return e})}else tickText.attr("transform","");else axis_renderer_rotateAxis(axisInstance,tickText,labelManager);return tickText},axis_renderer_setFixedBaseline=function setFixedBaseline(axisInstance){var fixedBaseline=axisInstance.config().fixedBaseline,showInnerTicks=axisInstance.renderConfig().showInnerTicks,domain=axisInstance.domain();fixedBaseline&&domain.length&&showInnerTicks&&axisInstance.setFixedBaseline()},axis_renderer_setAxisNamePos=function setAxisNamePos(textNode,orientation,measures){var axisNameHeight=measures.axisNameHeight,availableSpace=measures.availableSpace;switch(orientation){case axis_orientation_LEFT:textNode.attr("transform","translate(".concat(-(availableSpace.width-axisNameHeight),",").concat(availableSpace.height/2,")rotate(-90)"));break;case axis_orientation_RIGHT:textNode.attr("transform","translate(".concat(availableSpace.width-axisNameHeight,",").concat(availableSpace.height/2,")rotate(90)"));break;case axis_orientation_TOP:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(-availableSpace.height+axisNameHeight,")"));break;case axis_orientation_BOTTOM:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(availableSpace.height-axisNameHeight/2,")"))}return textNode};var _rangeAdjustmentMap,longestWord={month:"September",quarter:"October",halfYearly:"July",year:9999,day:"September",hour:"24 AM",mintues:"60:60",seconds:":60",week:"Wed 31"},skip_ticks_tickIntervals=[[1,1,"milliseconds",src_millisecond.every(1),"seconds"],[1,1e3,"seconds",src_second.every(1),"seconds"],[5,5e3,"five seconds",src_second.every(5),"seconds"],[10,1e4,"ten seconds",src_second.every(10),"seconds"],[15,15e3,"fifteen seconds",src_second.every(15),"seconds"],[30,3e4,"thirty seconds",src_second.every(30),"seconds"],[1,6e4,"minute",src_minute.every(1),"minutes"],[5,3e5,"five minutes",src_minute.every(5),"minutes"],[10,6e5,"ten minutes",src_minute.every(10),"minutes"],[15,9e5,"fifteen minutes",src_minute.every(15),"minutes"],[30,18e5,"thirty minutes",src_minute.every(30),"minutes"],[1,36e5,"hour",src_hour.every(1),"hour"],[3,108e5,"three hours",src_hour.every(3),"hour"],[6,216e5,"six hours",src_hour.every(6),"hour"],[12,432e5,"twelve hours",src_hour.every(12),"hour"],[1,864e5,"daily",src_day.every(1),"day"],[1,6048e5,"weekly",sunday.every(1),"week"],[1,2592e6,"monthly",src_month.every(1),"week"],[3,7776e6,"quaterly",src_month.every(3),"quarter"],[6,15552e6,"half yearly",src_month.every(6),"halfYearly"],[1,31536e6,"yearly",src_year.every(1),"year"],[2,63072e6,"2 year",src_year.every(2),"year"],[3,94608e6,"3 year",src_year.every(3),"year"],[5,15768e7,"5 year",src_year.every(5),"year"],[10,31536e7,"decade",src_year.every(10),"year"],[100,31536e8,"century",src_year.every(100),"year"],[1e3,31536e9,"millenium",src_year.every(1e3),"year"]],getTickIntervalFnBasedOnNumberOfTicks=function getTickIntervalFnBasedOnNumberOfTicks(interval,count,context){for(var possibleTickLevelIndex=skip_ticks_tickIntervals.length-1,maxPossibleTicks=1,tickIntervalLevelInfo=null,i=skip_ticks_tickIntervals.length-1;i>=0;i--){var tickIntervalInfo=skip_ticks_tickIntervals[i],numOfPossibleTicks=Math.floor(interval/tickIntervalInfo[1]);numOfPossibleTicks<=count&&(possibleTickLevelIndex=i,maxPossibleTicks=numOfPossibleTicks)}return tickIntervalLevelInfo=skip_ticks_tickIntervals[possibleTickLevelIndex],function getActualTickInterval(context,noOfTicks){var minWidthBetweenTicks=context._minTickDistance.width,width=context.availableSpace().width;return Math.floor((width-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)}(context,maxPossibleTicks)=numOfTicksAccordingToMinDiff&&(actualNumberOfTicks=numOfTicksAccordingToMinDiff),getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval,actualNumberOfTicks,context)}(context,maxTicks));context.renderConfig({tickValues:ticks})},adjustHorizontalRange=function adjustHorizontalRange(range,diff){return range[0]+=diff,range[1]-=diff,range},adjustVerticalRange=function adjustVerticalRange(range,diff){return range[0]-=diff,range[1]+=diff,range},rangeAdjustmentMap=(space_setter_defineProperty(_rangeAdjustmentMap={},axis_orientation_TOP,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_BOTTOM,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_LEFT,adjustVerticalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_RIGHT,adjustVerticalRange),_rangeAdjustmentMap),setAxisRange=function setAxisRange(context,type,rangeBounds,offset){context.range(rangeBounds),offset&&context.renderConfig(space_setter_defineProperty({},"".concat(type,"Offset"),offset))},getAdjustedRange=function getAdjustedRange(minDiff,range,domain,config){var orientation=config.orientation,adjustRange=config.adjustRange,diff=function getAxisOffset(timeDiff,range,domain){var avWidth=Math.abs(range[1]-range[0]),bars=avWidth/(avWidth/(domain[1]-domain[0])*timeDiff);return(avWidth-avWidth/(bars+1)*bars)/2}(minDiff,range,domain);return adjustRange?rangeAdjustmentMap[orientation](range,diff):range},space_setter_spaceSetter=function spaceSetter(context,spaceConfig){var _ref,tickInterval,heightForTicks,config=context.config(),_context$availableSpa2=context.availableSpace(),availWidth=_context$availableSpa2.width,availHeight=_context$availableSpa2.height,padding=_context$availableSpa2.padding,top=padding.top,left=padding.left,bottom=padding.bottom,right=padding.right,isOffset=spaceConfig.isOffset,_context$renderConfig2=context.renderConfig(),showAxisName=_context$renderConfig2.showAxisName,labels=_context$renderConfig2.labels,rotation=labels.rotation,fixedBaseline=config.fixedBaseline,axisNamePadding=config.axisNamePadding,tickValues=config.tickValues,_context$getAxisDimen=context.getAxisDimensions(),tickDimensions=_context$getAxisDimen.tickDimensions,allTickDimensions=_context$getAxisDimen.allTickDimensions,axisNameDimensions=_context$getAxisDimen.axisNameDimensions,tickSize=_context$getAxisDimen.tickSize,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width,namePadding=showAxisName?axisNamePadding:0,labelConfig={smartTicks:!0,rotation:labels.rotation},minTickDistance=context._minTickDistance,minTickSpace=context._minTickSpace,minDiff=context._minDiff,domain=context.domain(),axisNameHeight=axisNameDimensions.height,minWidthBetweenTicks=minTickDistance.width,minTickWidth=Math.min(minTickSpace.width,tickDimWidth),minTickHeight=Math.min(minTickSpace.height,tickDimHeight);return space_setter_defineProperty(_ref={},TIME,{x:function x(){!tickValues&&context.applyTickSkipping();var noOfTicks=context.getTickValues().length;heightForTicks=availHeight-axisNameHeight-tickSize-namePadding,(tickInterval=(availWidth-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)axisNameHeight?(labelConfig.rotation=null,context.renderConfig({showInnerTicks:!0,showAxisName:!0})):(labelConfig.rotation=-90,context.renderConfig({showInnerTicks:!0,showAxisName:!1}))),availHeight0&&void 0!==arguments[0]?arguments[0]:0,width=arguments.length>1?arguments[1]:void 0,height=arguments.length>2?arguments[2]:void 0,rotatedHeight=height,rotatedWidth=width;if(rotation){var angle=(rotation||0)*Math.PI/180;rotatedWidth=Math.abs(height*Math.sin(angle))+Math.abs(width*Math.cos(angle)),rotatedHeight=Math.abs(width*Math.sin(angle))+Math.abs(height*Math.cos(angle))}return{width:rotatedWidth,height:rotatedHeight}},helper_setOffset=function setOffset(context){var x=0,y=0,logicalSpace=context.logicalSpace(),config=context.config(),orientation=config.orientation,xOffset=config.xOffset,yOffset=config.yOffset;orientation===axis_orientation_LEFT&&(x=void 0===xOffset?logicalSpace.width:xOffset),orientation===axis_orientation_TOP&&(y=void 0===yOffset?logicalSpace.height:yOffset),context.renderConfig({xOffset:x,yOffset:y})},getAxisComponentDimensions=function getAxisComponentDimensions(context){var axisTicks,largestTick="",largestTickDimensions={width:0,height:0},smartTick={},allTickDimensions=[],scale=context.scale(),_context$renderConfig=context.renderConfig(),tickValues=_context$renderConfig.tickValues,showAxisName=_context$renderConfig.showAxisName,name=context.config().name,labelManager=context.dependencies().labelManager,labelFunc=scale.ticks||scale.quantile||scale.domain;return labelManager.setStyle(context._tickLabelStyle),axisTicks=(axisTicks=tickValues||labelFunc()).map(function(originalLabel,i){var label=context.getFormattedText(originalLabel,i,axisTicks),tickDimensions=labelManager.getOriSize(label);return allTickDimensions.push(tickDimensions),tickDimensions.width>largestTickDimensions.width&&(largestTick=label,smartTick=context.smartTicks()?context.smartTicks()[i]:{},largestTickDimensions=tickDimensions,smartTick=smartTick||tickDimensions),label}),labelManager.setStyle(context._axisNameStyle),{axisNameDimensions:showAxisName?labelManager.getOriSize(name):{width:0,height:0},largestTick:largestTick,largestTickDimensions:largestTickDimensions,allTickDimensions:allTickDimensions,axisTicks:axisTicks,smartTick:smartTick,tickSize:context.getTickSize()}},getHorizontalAxisSpace=function getHorizontalAxisSpace(context,axisDimensions,range){var width,height,domain=context.domain(),minTickDistance=context._minTickDistance.width,tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config2=context.config(),axisNamePadding=_context$config2.axisNamePadding,tickValues=_context$config2.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width;if(width=range&&range.length?range[1]-range[0]:3*(tickDimWidth+minTickDistance),height=0,tickValues){var minTickDiff=context.getMinTickDifference(),_ref=[Math.min.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain))),Math.max.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain)))];width=(_ref[1]-_ref[0])/Math.abs(minTickDiff)*(tickDimWidth+context._minTickDistance.width)}return height=range&&range.length?tickDimHeight:Math.max(tickDimWidth,tickDimHeight),{width:width,height:height+=(showAxisName?axisDimHeight+axisNamePadding:0)+tickSize}},getVerticalAxisSpace=function getVerticalAxisSpace(context,axisDimensions){var height,width,domain=context.domain(),tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config3=context.config(),axisNamePadding=_context$config3.axisNamePadding,tickValues=_context$config3.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height;if(height=0,width=tickDimensions.width,tickValues){var minTickDiff=context.getMinTickDifference(),_ref2=[Math.min.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain))),Math.max.apply(Math,cartesian_axis_helper_toConsumableArray(tickValues).concat(cartesian_axis_helper_toConsumableArray(domain)))];height=(_ref2[1]-_ref2[0])/Math.abs(minTickDiff)*tickDimHeight}return{height:height,width:width+=(showAxisName?axisDimHeight:0)+tickSize+axisNamePadding}},helper_calculateBandSpace=function calculateBandSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,show=context.renderConfig().show,largestTickDimensions=axisDimensions.largestTickDimensions,axisTicks=axisDimensions.axisTicks,allTickDimensions=axisDimensions.allTickDimensions,largestDimHeight=largestTickDimensions.height,minTickWidth=context._minTickDistance.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa=getHorizontalAxisSpace(context,axisDimensions,range),_width=_getHorizontalAxisSpa.width,_height=_getHorizontalAxisSpa.height;return range&&range.length||(_width=allTickDimensions.reduce(function(t,n){return t+Math.min(n.width,n.height)+minTickWidth},0)),!1===show&&(_height=0,_width=0),{width:_width,height:_height}}var _getVerticalAxisSpace=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace.width,height=_getVerticalAxisSpace.height;return height&&0!==height||(height=axisTicks.length*(largestDimHeight+context._minTickDistance.height)),!1===show&&(width=0),{width:width,height:height}},helper_getValidDomain=function getValidDomain(context,domain){var userDom=context.config().domain;return userDom&&(domain=userDom),defaultValue(domain,[])},setContinousAxisDomain=function setContinousAxisDomain(context,domain){var nice=context.config().nice,scale=context.scale.bind(context);scale().domain(domain),nice&&scale().nice(),context._domain=scale().domain()},props_PROPS={availableSpace:{},axisDimensions:{},axisComponentDimensions:{},config:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._config||{}),mockedOldConfig=mergeRecursive({},oldConfig);(value=mergeRecursive(mockedOldConfig,value)).axisNamePadding=Math.max(value.axisNamePadding,0);var shouldAxesScaleUpdate=function hasAxesConfigChanged(){var obj=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},obj1=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},properties=arguments.length>2?arguments[2]:void 0;return!(!Object.keys(obj).length||!Object.keys(obj1).length)&&properties.some(function(key){return obj[key]!==obj1[key]})}(value,oldConfig,["interpolator","exponent","base","orientation"]),tickFormatter=context.sanitizeTickFormatter(value);return shouldAxesScaleUpdate&&(context._scale=context.createScale(value),context._axis=context.createAxis(value)),context._tickFormatter=function(ticks){return tickFormatter(ticks)},context.resetRenderConfig(value),value}},renderConfig:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._renderConfig||{});return value=mergeRecursive(oldConfig,value)}},logicalSpace:{},mount:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.logicalSpace(null),value}},smartTicks:{},tickSize:{},maxTickSpaces:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._maxTickSpaces||{});return value=mergeRecursive(oldConfig,value)}},valueParser:{defaultValue:function defaultValue(val){return val}}};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function simple_axis_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function simple_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,height=arguments.length>1?arguments[1]:void 0,padding=arguments.length>2?arguments[2]:void 0,isOffset=arguments.length>3?arguments[3]:void 0,labelConfig={},orientation=this.config().orientation;this.availableSpace({width:width,height:height,padding:padding});var type=this.constructor.type();return labelConfig=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?space_setter_spaceSetter(this,{isOffset:isOffset})[type].x():space_setter_spaceSetter(this,{isOffset:isOffset})[type].y(),this.renderConfig({labels:labelConfig}),this.setTickConfig(),this.setSmartAxisName(),this}},{key:"setSmartAxisName",value:function setSmartAxisName(){var _this$config2=this.config(),orientation=_this$config2.orientation,name=_this$config2.name,dimType=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?"width":"height",widthDim=this.availableSpace()[dimType],labelManager=this.dependencies().labelManager;return labelManager.setStyle(this._axisNameStyle),this.renderConfig({smartAxisName:function getSmartAxisName(name,width,labelManager){var oriSize=labelManager.getOriSize(name);return labelManager.useEllipsesOnOverflow(!0),labelManager.getSmartText(name,width,oriSize.height,!0)}(name,widthDim,labelManager)}),this}},{key:"setTickConfig",value:function setTickConfig(){return this}},{key:"getScaleValue",value:function getScaleValue(domainVal){if(null!==domainVal&&void 0!==domainVal)return this.scale()(domainVal)}},{key:"getTickSize",value:function getTickSize(){return this.axis().tickSize()}},{key:"getAxisDimensions",value:function getAxisDimensions(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return this.axisDimensions(function computeAxisDimensions(context){var tickDimensions={},labels=context.renderConfig().labels,smartTicks=labels.smartTicks,rotation=labels.rotation,_getAxisComponentDime=getAxisComponentDimensions(context),largestTickDimensions=_getAxisComponentDime.largestTickDimensions,axisTicks=_getAxisComponentDime.axisTicks,smartTick=_getAxisComponentDime.smartTick,axisNameDimensions=_getAxisComponentDime.axisNameDimensions,allTickDimensions=_getAxisComponentDime.allTickDimensions,tickSize=_getAxisComponentDime.tickSize,labelHeight=largestTickDimensions.height,labelWidth=largestTickDimensions.width;return 0===context.domain().length?null:(tickDimensions=getRotatedSpaces(rotation,(tickDimensions=smartTicks?smartTick:{width:labelWidth,height:labelHeight}).width,tickDimensions.height),0===tickSize&&(tickDimensions={width:0,height:0}),{allTickDimensions:allTickDimensions,tickSize:tickSize,tickDimensions:tickDimensions,axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks})}.apply(void 0,[this].concat(params))),this.axisDimensions()}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()||this.logicalSpace(function calculateContinousSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,_context$renderConfig6=context.renderConfig(),show=_context$renderConfig6.show,showAxisName=_context$renderConfig6.showAxisName,axisNameDimensions=axisDimensions.axisNameDimensions;if(!1===show)return{width:0,height:0};var axisNameWidth=axisNameDimensions.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa2=getHorizontalAxisSpace(context,axisDimensions,range),_width2=_getHorizontalAxisSpa2.width,_height2=_getHorizontalAxisSpa2.height;return{width:Math.max(_width2,axisNameWidth),height:_height2}}var _getVerticalAxisSpace2=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace2.width,height=_getVerticalAxisSpace2.height;return{width:width,height:Math.max(height,showAxisName?axisNameWidth:0)}}(this)),helper_setOffset(this),this.logicalSpace()}},{key:"invert",value:function invert(value){return this.scale().invert(value)}},{key:"getNearestRange",value:function getNearestRange(v1,v2){return[v1,v2]}},{key:"invertExtent",value:function invertExtent(v1,v2){return[this.invert(v1),this.invert(v2)]}},{key:"getMinTickDifference",value:function getMinTickDifference(){return this.domain()}},{key:"getFormattedTickValues",value:function getFormattedTickValues(tickValues){return tickValues}},{key:"getUnitWidth",value:function getUnitWidth(){return 0}},{key:"serialize",value:function serialize(){return{name:this.name,type:this.type,range:this.range(),config:this.config()}}},{key:"render",value:function render(){return this.mount()&&(this.setTickConfig(),function renderAxis(axisInstance){var config=axisInstance.config(),renderConfig=axisInstance.renderConfig(),labelManager=axisInstance.dependencies().labelManager,mount=axisInstance.mount(),range=axisInstance.range(),axis=axisInstance.axis(),scale=axisInstance.scale(),tickLabelStyle=axisInstance._tickLabelStyle,axisTickFormatter=axisInstance._tickFormatter,orientation=config.orientation,axisNamePadding=config.axisNamePadding,className=config.className,id=config.id,classPrefix=config.classPrefix,show=renderConfig.show,xOffset=renderConfig.xOffset,yOffset=renderConfig.yOffset,showAxisName=renderConfig.showAxisName,labels=renderConfig.labels,smartAxisName=renderConfig.smartAxisName;if(show){var tickSize=axisInstance.getTickSize(),selectContainer=makeElement(renderer_utils_selectElement(mount),"g",[axisInstance],"".concat(className),{},function(key){return key.config().id});labelManager.setStyle(tickLabelStyle);var labelFunc=scale.ticks||scale.quantile||scale.domain,ticks=axis.tickValues()||labelFunc();axis.tickFormat(axisTickFormatter(ticks));var availableSpace=Math.abs(range[0]-range[1]),labelProps=axisInstance.axisComponentDimensions().largestTickDimensions;selectContainer.attr("transform","translate(".concat(xOffset,",").concat(yOffset,")")),axis_renderer_setFixedBaseline(axisInstance),!1===labels.smartTicks||0===tickSize?selectContainer.transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).call(axis):selectContainer.call(axis),selectContainer.selectAll(".tick").classed("".concat(classPrefix,"-ticks"),!0),selectContainer.selectAll(".tick line").classed("".concat(classPrefix,"-tick-lines"),!0),selectContainer.selectAll(".tick text").classed("".concat(classPrefix,"-ticks"),!0).classed("".concat(classPrefix,"-ticks-").concat(id),!0),axis_renderer_changeTickOrientation(selectContainer,axisInstance,tickSize);var textNode=makeElement(selectContainer,"text",[smartAxisName],"".concat(classPrefix,"-axis-name")).attr("text-anchor","middle").classed("".concat(classPrefix,"-axis-name-").concat(id),!0).text(function(d){return d.text});textNode.classed(HIDDEN,!showAxisName);var labelOffset=availableSpace/2,measures={labelProps:labelProps,tickSize:tickSize,axisNamePadding:axisNamePadding,axisNameHeight:smartAxisName.height,yOffset:yOffset,xOffset:xOffset,labelOffset:labelOffset,availableSpace:axisInstance.availableSpace()};axis_renderer_setAxisNamePos(textNode,orientation,measures)}}(this)),this}},{key:"remove",value:function remove(){return renderer_utils_selectElement(this.mount()).remove(),this}},{key:"unsubscribe",value:function unsubscribe(){return this}},{key:"isReverse",value:function isReverse(){var range=this.range();return range[0]>range[1]}},{key:"getPixelToValueRatio",value:function getPixelToValueRatio(){var scale=this.scale(),range=scale.range(),domain=scale.domain();return Math.abs(range[1]-range[0])/(domain[1]-domain[0])}},{key:"animationDone",value:function animationDone(){return Promise.all(this._animationDonePromises)}},{key:"registerAnimationDoneHook",value:function registerAnimationDoneHook(){var resolveFn,promise=new Promise(function(resolve){resolveFn=resolve});return this._animationDonePromises.push(promise),function(){resolveFn()}}},{key:"id",get:function get(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return cartesian_axis_default_config_defaultConfig}}]),SimpleAxis}();function linear_defineProperties(target,props){for(var i=0;iavailableSpace&&(numberOfValues=Math.floor(availableSpace/(labelDim+minTickDistance))),numberOfTicks=numberOfTicks||numberOfValues,numberOfValues=Math.min(numberOfTicks,Math.max(2,numberOfValues)),(tickValues=axis.scale().ticks(numberOfValues)).length>numberOfValues&&(tickValues=tickValues.filter(function(e,i){return i%2==0})),2===numberOfValues&&(tickValues=[(tickValues=axis.scale().ticks(10))[0],tickValues[tickValues.length-1]]),tickValues}(availableSpace,labelProps[orientation===axis_orientation_BOTTOM||orientation===axis_orientation_TOP?"width":"height"],axis,this)}},{key:"getMinTickDifference",value:function getMinTickDifference(){return getSmallestDiff(this.renderConfig().tickValues)}},{key:"setFixedBaseline",value:function setFixedBaseline(tickText){var orientation=this.config().orientation,rotation=this.renderConfig().labels.rotation,axis=this.axis(),ticks=axis.tickValues(),smartTicks=this.smartTicks();if(smartTicks&&smartTicks.length){var _this$smartTicks$=this.smartTicks()[0],width=_this$smartTicks$.width,height=_this$smartTicks$.height;axis.tickTransform(function(d){if(d===ticks[0]){if(orientation===axis_orientation_LEFT||orientation===axis_orientation_RIGHT)return"translate(0, -".concat(height/3,"px)");if((orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM)&&!rotation)return"translate(".concat(width/2,"px, ",0,"px)")}return""})}return tickText}}],[{key:"type",value:function type(){return LINEAR}}]),ContinousAxis}();function band_axis_typeof(obj){return(band_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function band_axis_defineProperties(target,props){for(var i=0;irange[1],extent=this.invertExtent(v1,v2);return[scale(reverse?extent[extent.length-1]:extent[0]),scale(reverse?extent[0]:extent[extent.length-1])+scale.bandwidth()]}}],[{key:"type",value:function type(){return BAND}}]),BandAxis}();function time_axis_typeof(obj){return(time_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function time_axis_defineProperties(target,props){for(var i=0;i1?config.range:[DEFAULT_GRADIENT_COLOR].concat(props_toConsumableArray(config.range)));var oldConfig=mergeRecursive(defCon,context.config()),newConfig=mergeRecursive(oldConfig,config);return newConfig.range instanceof Array&&(newConfig.range=newConfig.range.map(function(e,i){return props_getActualHslColor(e,palette[i])}),newConfig.stops=config.stops||newConfig.range.length),newConfig.value=props_getActualHslColor(newConfig.value,newConfig.value),newConfig}},domain:{},scale:{},uniqueValues:{}},helper_treatNullMeasures=function treatNullMeasures(domainVal,scaledVal,minDomainScaledVal){return domainVal instanceof src_InvalidAwareTypes?minDomainScaledVal:scaledVal},helper_resolveAxisConfig=function resolveAxisConfig(propVal,defaultVal,context){switch(getObjProp(propVal,"constructor")){case Function:return propVal(defaultVal,context);case Array:return propVal;default:return defaultVal}};function color_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function color_strategy_toConsumableArray(arr){return function color_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iMath.min(range.length,18))for(var interpolator=common_utils_piecewiseInterpolator()(function hslInterpolator(){return hslLong}(),range.map(function(e){return props_getHslString(e)})),i=0;i0&&void 0!==arguments[0]?arguments[0]:[];if(domain.length){var scale=this.scale(),range=scale.range?scale.range():null,scaleInfo=this._colorStrategy.domainRange()(domain,this.config().stops,range);this.domain(scaleInfo.domain),scaleInfo.range&&this.scale().range(scaleInfo.range),this.uniqueValues(scaleInfo.uniqueVals),this.scale().domain(scaleInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),config:this.config()}}},{key:"transformColor",value:function transformColor(color,transformationArr){var h=360*color[0],s=100*color[1],l=100*color[2],a=Math.min(defaultValue(color[3],0),1),newH=h+transformationArr[0],newS=s+transformationArr[1],newL=l+transformationArr[2],newA=Math.min(a+transformationArr[3]||0,1);return{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH/360,newS/100,newL/100,newA]}}},{key:"id",value:function id(){return this._id}},{key:"getHslArray",value:function getHslArray(color){return props_getActualHslColor(color)}}],[{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIG}},{key:"type",value:function type(){return"color"}}]),ColorAxis}(),defaults_DEFAULT_CONFIG={value:36,range:[36,1e3]};function size_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function size_strategy_toConsumableArray(arr){return function size_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&void 0!==arguments[0]?arguments[0]:0,value=this.config().value,scale=this.scale(),domain=this.domain()||[1,1];return scale&&domain[0]!==domain[1]?this._sizeStrategy.range(domainVal,scale,this.domain(),this.uniqueValues()):value}},{key:"updateDomain",value:function updateDomain(domain){if(domain){var domainInfo=(0,this._sizeStrategy.domain)(domain,this.config().intervals);this.domain(domainInfo.domain),this.uniqueValues(domainInfo.uniqueVals),this.scale().domain(domainInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.range(),config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"size"}}]),SizeAxis}(),shape_axis_defaults_DEFAULT_CONFIG={generator:null,value:"circle",range:["circle","diamond","star","cross","square","wye","triangle"]},shape_axis_props_PROPS={config:{},domain:{},scale:{},uniqueValues:{},generator:{}};function shape_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];return domain.length&&(this.uniqueValues(domain),this.domain(domain),this.scale().domain(domain),this.config().generator&&(this._generatedShapes=function shapeGenerator(domain,generatorFn){var generatedShapes={};return domain.forEach(function(value){generatedShapes[value]=generatorFn(value)}),generatedShapes}(domain,this.config().generator))),this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.config().range,config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return shape_axis_defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"shape"}}]),ShapeAxis}(),polar_axis_props_PROPS={config:{sanitization:function sanitization(context,config){return mergeRecursive(context.config(),config)},preset:function preset(context,config){var range=config.range,domain=config.domain;range&&context.range(range),domain&&context.domain(domain)}},domain:{},range:{}};function angle_axis_slicedToArray(arr,i){return function angle_axis_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function angle_axis_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function angle_axis_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function angle_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function angle_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AngleAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._range=[0,360],this._angleFn=angle_axis_pie().value(function(d){return"string"==typeof d?1:d}).sortValues(null),this._angleValues={}}return function angle_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&angle_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&angle_axis_defineProperties(Constructor,staticProps),Constructor}(AngleAxis,[{key:"createScale",value:function createScale(strategy){var range=this.config().range;return scale_creator_createScale({type:strategy.scale,range:range})}},{key:"getScaleValue",value:function getScaleValue(domainVal){return this._angleValues[domainVal]}},{key:"padAngle",value:function padAngle(angle){this._angleFn=this._angleFn.padAngle(angle)}},{key:"domain",value:function domain(){for(var _len=arguments.length,domainVal=new Array(_len),_key=0;_key<_len;_key++)domainVal[_key]=arguments[_key];if(domainVal.length){var customDomain=this.config().domain,domain=domainVal[0].length?domainVal[0]:DEFAULT_ANGLE_DOMAIN;return this._domain=helper_resolveAxisConfig(customDomain,domain,this),createAngleValues(this),this}return this._domain}},{key:"range",value:function range(){if(arguments.length){var customRange=this.config().range;this._range=helper_resolveAxisConfig(customRange,arguments.length<=0?void 0:arguments[0],this);var domain=this.domain(),_this$_range=angle_axis_slicedToArray(this._range,2),startAngle=_this$_range[0],endAngle=_this$_range[1];return this._angleFn.startAngle(startAngle/180*Math.PI).endAngle(Math.PI*endAngle/180),domain&&domain.length&&createAngleValues(this),this}return this._range}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),AngleAxis}(),X="x",Y="y",MEASURE="measure",ROWS="rows",COLUMNS="columns",COL="col",ROW="row",enums_constants_COLOR="color",enums_constants_SHAPE="shape",enums_constants_SIZE="size",enums_constants_LINEAR="linear",constants_LEFT="left",constants_RIGHT="right",CELL="cell",X_AXES="xAxes",Y_AXES="yAxes",ENTRY_CELLS="entryCell",EXIT_CELLS="exitCell",enums_constants_RADIUS="radius",enums_constants_ANGLE="angle",ANGLE0="angle0",PRIMARY="Primary",SECONDARY="Secondary";function radius_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function radius_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RadiusAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._range=[],this._radiusFactor=1,this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._scale=this.createScale({scale:enums_constants_LINEAR})}return function radius_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&radius_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&radius_axis_defineProperties(Constructor,staticProps),Constructor}(RadiusAxis,[{key:"config",value:function config(){if(arguments.length){var config=mergeRecursive(this.config(),arguments.length<=0?void 0:arguments[0]);return this._config=config,this}return this._config}},{key:"createScale",value:function createScale(strategy){return scale_creator_createScale({type:strategy.scale,range:this.range()})}},{key:"domain",value:function domain(){if(arguments.length){var customDomain=this.config().domain,domain=helper_resolveAxisConfig(customDomain,arguments.length<=0?void 0:arguments[0],this);domain=sanitizeDomainWhenEqual(domain),this._scale.domain(domain),this._domain=domain,adjustDomain(this)}return this._domain}},{key:"getInnerRadius",value:function getInnerRadius(domainVal){return void 0===domainVal?this.range()[0]:this._scale(domainVal)}},{key:"getOuterRadius",value:function getOuterRadius(domainVal){return void 0===domainVal?this.range()[1]:this._scale(domainVal)*this._radiusFactor}},{key:"range",value:function range(){for(var _len=arguments.length,_range=new Array(_len),_key=0;_key<_len;_key++)_range[_key]=arguments[_key];if(_range.length){var _this$config2=this.config(),padding=_this$config2.padding,customRange=_this$config2.range,sanitizedRange=_range[0].map(function(v,i){return v+(i?-padding[i]:padding[i])}),rangeVal=helper_resolveAxisConfig(customRange,sanitizedRange,this);this._range=rangeVal,this._scale.range(rangeVal),adjustDomain(this)}return this._range}},{key:"setRadiusFactor",value:function setRadiusFactor(val){return this._radiusFactor=val,this}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:[0,1],minOuterRadius:10}}}]),RadiusAxis}();function data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DATA_TYPES_MEASURE="measure",DATA_TYPES_TEMPORAL="temporal",group_transform=(data_type_scale_map_defineProperty(_dataTypeScaleMap={},"dimension",BAND),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_MEASURE,LINEAR),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_TEMPORAL,TIME),function(schema,data,config){var groupBy=config.groupBy instanceof Array?config.groupBy:[config.groupBy],groupByIndices=groupBy.map(function(fieldName){return schema.findIndex(function(d){return d.name===fieldName})});if(void 0!==groupByIndices.find(function(d){return-1===d}))throw new Error("Groupby field ".concat(groupBy," not found in schema"));var groupedData=common_utils_nestCollection({keys:groupByIndices,data:data});return groupedData.forEach(function(d){var key=d.key;src_InvalidAwareTypes.isInvalid(key)&&(d.key=src_InvalidAwareTypes.getInvalidType(key))}),groupedData});var _transformMap;function transform_factory_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var transformMap=(transform_factory_defineProperty(_transformMap={},"identity",function identityTransform(schema,data,config){return data}),transform_factory_defineProperty(_transformMap,"group",group_transform),transform_factory_defineProperty(_transformMap,"stack",function(schema,data,config){var uniqueField=config.uniqueField,valueField=config.value,groupBy=config.groupBy,sort=config.sort||"descending",normalizedData=function normalizeData(data,schema,valueField,uniqueField,groupBy){var groupedData=group_transform(schema,data,{groupBy:uniqueField}),uniqueFieldIndex=schema.findIndex(function(d){return d.name===uniqueField}),valueFieldIndex=schema.findIndex(function(d){return d.name===valueField}),seriesKeyIndex=schema.findIndex(function(d){return d.name===groupBy}),seriesKeys=data.map(function(d){return d[seriesKeyIndex]}).filter(function(item,pos,arr){return arr.indexOf(item)===pos}).sort(),fieldNames=schema.reduce(function(acc,obj,i){return acc[i]=obj.name,acc},{});return{data:groupedData.map(function(arr){var tuples={},rowObj=arr.values.reduce(function(acc,row){return acc=row.reduce(function(obj,value,i){return i===seriesKeyIndex?(obj[value]=row[valueFieldIndex],tuples[value]=row):i!==valueFieldIndex&&(obj[fieldNames[i]]=value),obj},acc)},{});return rowObj._tuple=tuples,seriesKeys.forEach(function(seriesKey){if(void 0===rowObj[seriesKey]){rowObj[seriesKey]=0;var newArr=new Array(arr.values[0].length);newArr[uniqueFieldIndex]=arr.key,newArr[seriesKeyIndex]=seriesKey,rowObj._tuple[seriesKey]=newArr}}),rowObj}),keys:seriesKeys}}(data,schema,valueField,uniqueField,groupBy),keys=normalizedData.keys,map={},orderBy=config.orderBy,orderIndex=schema.findIndex(function(d){return d.name===orderBy}),groupByIndex=schema.findIndex(function(d){return d.name===groupBy});-1!==orderIndex&&(keys.forEach(function(key){var name=data.find(function(d){return d[groupByIndex]===key});map[key]=name[orderIndex]}),normalizedData.keys.sort(function(a,b){return map[a].localeCompare(map[b])}));var stackData=common_utils_stack({keys:normalizedData.keys,offset:config.offset||"diverging",order:sort,data:normalizedData.data});return stackData.forEach(function(seriesData){seriesData.forEach(function(dataObj){dataObj.data=dataObj.data._tuple[seriesData.key]})}),stackData}),_transformMap);var _encodingFieldInfRetr,_dataNormalizers,_domainCalculator,transform_factory=function transformFactory(type){var transform=transformMap[type];if("function"!=typeof transform)throw new Error("Invalid transform type supplied.");return transform};function helpers_toConsumableArray(arr){return function helpers_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=d[0]?(y=x0=d[1],x=y0=d[0]):(y=x0=d[0],x=y0=d[1]),(pointObj=xFieldType===dist_datamodel.FieldType.MEASURE?{x:x,x0:x0,y:tuple[yFieldIndex],y0:tuple[yFieldIndex]}:{x:tuple[xFieldIndex],x0:tuple[xFieldIndex],y:y,y0:y0}).source=tuple,pointObj.rowId=tuple[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=tuple[encodingFieldInf["".concat(enc,"FieldIndex")]]})):((pointObj={x:d[xFieldIndex],y:d[yFieldIndex],x0:d[x0FieldIndex],y0:d[y0FieldIndex]}).source=d,pointObj.rowId=d[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=d[encodingFieldInf["".concat(enc,"FieldIndex")]]}));return pointObj})}).filter(function(d){return d.length})}),_dataNormalizers),domainCalculator=(helpers_defineProperty(_domainCalculator={},POLAR,function(data,layerInst){var config=layerInst.config(),sort=config.sort,angleValues=data[0],radius0Field=getObjProp(config.encoding.radius0,"field");return sort&&(angleValues=angleValues.sort(function(a,b){return"asc"===sort?a.radius-b.radius:b.radius-a.radius})),{radius:getDomainFromData(data,[ENCODING.RADIUS,radius0Field?ENCODING.RADIUS0:ENCODING.RADIUS]),angle:angleValues.map(function(d){return d.angle}),angle0:angleValues.map(function(d){return d.angle0})}}),helpers_defineProperty(_domainCalculator,helpers_CARTESIAN,function(data,layerInst){var transformType=layerInst.transformType(),encodingFieldInf=layerInst.encodingFieldsInf(),xFieldSubType=encodingFieldInf.xFieldSubType,yFieldSubType=encodingFieldInf.yFieldSubType,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,x0Field=encodingFieldInf.x0Field,y0Field=encodingFieldInf.y0Field,domains={},yEnc=ENCODING.Y,xEnc=ENCODING.X;return xField&&(domains.x=getDomainFromData(data,x0Field||"stack"===transformType?[xEnc,ENCODING.X0]:[xEnc,xEnc],xFieldSubType)),yField&&(domains.y=getDomainFromData(data,y0Field||"stack"===transformType?[ENCODING.Y0,ENCODING.Y]:[yEnc,yEnc],yFieldSubType)),domains}),_domainCalculator),attachDataToVoronoi=function attachDataToVoronoi(voronoi,points){var _ref3;voronoi.data((_ref3=[]).concat.apply(_ref3,helpers_toConsumableArray(points)).filter(function(d){return void 0!==d.rowId}).map(function(d){var point=d.update;return{x:point.x,y:point.y,data:d}}))},helpers_updateStyle=function updateStyle(target,styles,remove){for(var key in styles)({}).hasOwnProperty.call(styles,key)&&target.style(key,remove?null:styles[key])},positionPoints=function positionPoints(context,points){var positioner=context.encodingTransform();return positioner?positioner(points,context,{smartLabel:context._dependencies.smartLabel}):points},helpers_getPlotMeasurement=function getPlotMeasurement(context,dimensionalValues){var fieldInfo=context.encodingFieldsInf(),axes=context.axes(),transformType=context.transformType(),config=context.config(),bandScale=context._bandScale;return["x","y"].map(function(type){var span=0,groupSpan=0,padding=0,offsetValues=[];if(fieldInfo["".concat(type,"FieldType")]===dist_datamodel.FieldType.DIMENSION){var actualGroupWidth,timeDiff=fieldInfo["".concat(type,"FieldSubType")]===dist_datamodel.DimensionSubtype.TEMPORAL?context.dataProps().timeDiffs[type]:0,axis=axes[type],pad=config["pad".concat(type.toUpperCase())],innerPadding=config.innerPadding,keys=dimensionalValues,scale=axis.scale();groupSpan=function getGroupSpan(axis,minDiff){var width=axis.getUnitWidth(),scale=axis.scale(),range=scale.range(),domain=scale.domain();return width||Math.abs(range[1]-range[0])/Math.abs(domain[1]-domain[0])*minDiff}(axis,timeDiff);var isAxisBandScale=axis.constructor.type()===helpers_BAND,axisPadding=axis.config().padding;if("group"===transformType){var groupPadding=isAxisBandScale?0:axisPadding*groupSpan/2;bandScale.range([groupPadding,groupSpan-groupPadding]).domain(keys).paddingInner(innerPadding),span=bandScale.bandwidth(),actualGroupWidth=groupSpan-(isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(key){return bandScale(key)-(isAxisBandScale?0:groupSpan/2)})}else if(void 0!==pad){var offset;if(isAxisBandScale){var step=scale.step();offset=scale.padding()*step,span=scale.bandwidth()+offset}else span=groupSpan;offsetValues=keys.map(function(){return isAxisBandScale?-offset/2:-span/2})}else actualGroupWidth=span=groupSpan-(padding=isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(){return isAxisBandScale?0:-span/2});groupSpan=actualGroupWidth,padding=isAxisBandScale?axisPadding*axis.scale().step():axisPadding*groupSpan}return{span:span,offsetValues:offsetValues,groupSpan:groupSpan,padding:padding}})},helpers_resolveInvalidTransformType=function resolveInvalidTransformType(context){return function transformResolverPredicates(encodingFieldInf,context,groupByField){var fieldsConfig=context.data().getFieldsConfig(),xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,dimensionField=["xField","yField"].find(function(type){return encodingFieldInf["".concat(type,"Type")]===dist_datamodel.FieldType.DIMENSION});return[!xField,!yField,!groupByField,getObjProp(fieldsConfig[groupByField],"def","type")===dist_datamodel.FieldType.MEASURE,xFieldType===dist_datamodel.FieldType.DIMENSION&&yFieldType===dist_datamodel.FieldType.DIMENSION,dimensionField&&encodingFieldInf[dimensionField]===groupByField]}(context.encodingFieldsInf(),context,context.config().transform.groupBy).some(function(value){return value})?"identity":null},helpers_getValidTransformForAggFn=function getValidTransformForAggFn(context){var resolvedInvalidTransformType=helpers_resolveInvalidTransformType(context);if(resolvedInvalidTransformType)return resolvedInvalidTransformType;var _context$encodingFiel=context.encodingFieldsInf(),xField=_context$encodingFiel.xField,yField=_context$encodingFiel.yField,xFieldType=_context$encodingFiel.xFieldType,yFieldType=_context$encodingFiel.yFieldType,groupByField=context.config().transform.groupBy,isCustomTransformTypeProvided=!!getObjProp(context._customConfig,"transform","type"),transformType=context.config().transform.type;if(!isCustomTransformTypeProvided&&groupByField&&xFieldType!==yFieldType){var measureField=xFieldType===dist_datamodel.FieldType.MEASURE?xField:yField;transformType="sum"===common_utils_retrieveNearestGroupByReducers(context.data(),measureField)[measureField]?"stack":"group"}return transformType},helpers_resolveEncodingValues=function resolveEncodingValues(data,i,dataArr,layerInst){var transformedValues={},values=data.values,encoding=layerInst.config().encoding;for(var key in values){var value=getObjProp(encoding[key],"value");value instanceof Function?transformedValues[key]=value(values,i,dataArr,layerInst):transformedValues[key]=values[key]}return transformedValues},getColorMetaInf=function getColorMetaInf(colorInf,colorAxis){return{originalColor:Object.keys(colorInf).reduce(function(acc,key){return colorInf[key]&&(acc[key]=colorAxis.getHslArray(colorInf[key])),acc},{}),stateColor:{},colorTransform:{}}},getCoordValue=function getCoordValue(radius,trig,angle,offset){return radius*Math[trig](angle)+offset},coordValueGetter=function coordValueGetter(radius,angle,xOffset,yOffset){return{x:getCoordValue(radius,"cos",angle,xOffset),y:getCoordValue(radius,"sin",angle,yOffset)}},toCartesianCoordinates=function toCartesianCoordinates(points,measurement){for(var rangePlot=arguments.length>2&&void 0!==arguments[2]&&arguments[2],xOffset=measurement.width/2,yOffset=measurement.height/2,i=0,len=points.length;i3&&void 0!==arguments[3]?arguments[3]:{};return function base_layer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseLayer),_this=function base_layer_possibleConstructorReturn(self,call){return!call||"object"!==base_layer_typeof(call)&&"function"!=typeof call?base_layer_assertThisInitialized(self):call}(this,base_layer_getPrototypeOf(BaseLayer).call(this)),generateGetterSetters(base_layer_assertThisInitialized(_this),props_props),_this.axes(axes),_this.alias(_this.constructor.formalName()+getUniqueId()),_this.dependencies(dependencies),_this._points=[],_this._cachedData=[],_this._id=getUniqueId(),_this._measurement={},_this._animationDonePromises=[],_this._graphicElems={},_this._customConfig=null,_this}return function base_layer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&base_layer_setPrototypeOf(subClass,superClass)}(BaseLayer,simple_layer_SimpleLayer),function base_layer_createClass(Constructor,protoProps,staticProps){return protoProps&&base_layer_defineProperties(Constructor.prototype,protoProps),staticProps&&base_layer_defineProperties(Constructor,staticProps),Constructor}(BaseLayer,[{key:"store",value:function store(){if(arguments.length){var store=this._store=arguments.length<=0?void 0:arguments[0],namespace=this.metaInf().namespace;return store.addSubNamespace(namespace,BaseLayer.formalName(),this),store_transactor(this,localOptions,store,{subNamespace:namespace,namespace:"".concat(namespace_namespaceObject.LAYER_LOCAL_NAMESPACE)}),this}return this._store}},{key:"domain",value:function domain(){var prop="".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".").concat("domain"),store=this.store();if(arguments.length){var _this$metaInf2=this.metaInf(),parentNamespace=_this$metaInf2.parentNamespace,namespace=_this$metaInf2.namespace,domain=defaultValue(store.get(prop,parentNamespace),{});return domain[namespace]=arguments.length<=0?void 0:arguments[0],this.store().commit(prop,domain,parentNamespace),this}return this.store().get(prop,this.metaInf().namespace)}},{key:"encodingFieldsInf",value:function encodingFieldsInf(){return arguments.length?(this._encodingFieldsInf=arguments.length<=0?void 0:arguments[0],this):this._encodingFieldsInf}},{key:"encodingTransform",value:function encodingTransform(){return arguments.length?(this._encodingTransform=arguments.length<=0?void 0:arguments[0],this):this._encodingTransform}},{key:"alias",value:function alias(){return arguments.length?(this._alias=arguments.length<=0?void 0:arguments[0],this):this._alias||this.constructor.formalName()}},{key:"dependencies",value:function dependencies(){return arguments.length?(this._dependencies=arguments.length<=0?void 0:arguments[0],this):this._dependencies}},{key:"enableCaching",value:function enableCaching(){return this._cacheEnabled=!0,this}},{key:"clearCaching",value:function clearCaching(){return this._cacheEnabled=!1,this.data(this._cachedData[0])}},{key:"serialize",value:function serialize(){return this.config()}},{key:"id",value:function id(){return this._id}},{key:"getTransformedData",value:function getTransformedData(dataModel,config,transformType,encodingFieldsInf){return function transformData(dataModel,config,transformType,encodingFieldInf){var data=dataModel.getData({withUid:!0}),schema=data.schema,transform=config.transform,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,uniqueField=xFieldType===dist_datamodel.FieldType.MEASURE?yField:xField;return transform_factory(transformType)(schema,data.data,{groupBy:transform.groupBy,uniqueField:uniqueField,sort:transform.sort||"none",offset:transform.offset,orderBy:transform.orderBy,value:yFieldType===dist_datamodel.FieldType.MEASURE?yField:xField},data.uids)}(dataModel,config,transformType,encodingFieldsInf)}},{key:"calculateDomainFromData",value:function calculateDomainFromData(data){var domains={};return this.data().isEmpty()||(domains=domainCalculator[this.coord()](data,this)),domains}},{key:"getDataDomain",value:function getDataDomain(encodingType){var _this$metaInf3=this.metaInf(),parentNamespace=_this$metaInf3.parentNamespace,namespace=_this$metaInf3.namespace,domains=getObjProp(this.store().get("".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".").concat("domain"),parentNamespace),namespace);return void 0!==encodingType?domains[encodingType]||[]:domains}},{key:"getNormalizedData",value:function getNormalizedData(transformedData){return function getNormalizedData(transformedData,context){var transformType=context.transformType(),transformedDataArr="identity"===transformType?[transformedData]:transformedData,encodingFieldInf=context.encodingFieldsInf(),fieldsConfig=context.data().getFieldsConfig();return dataNormalizers[context.coord()](transformedDataArr,encodingFieldInf,fieldsConfig,transformType)}(transformedData,this)}},{key:"getNearestPoint",value:function getNearestPoint(){return null}},{key:"applyInteractionStyle",value:function applyInteractionStyle(interactionType,selectionSet,apply,styles){var interactionStyles=(this.config().interaction||{})[interactionType];(interactionStyles=styles||interactionStyles)&&helpers_applyInteractionStyle(this,selectionSet,interactionStyles,{apply:apply,interactionType:interactionType})}},{key:"disableUpdate",value:function disableUpdate(){return this._updateLock=!0,this}},{key:"enableUpdate",value:function enableUpdate(){return this._updateLock=!1,this}},{key:"resolveTransformType",value:function resolveTransformType(){this._transformType=function getValidTransform(context){return helpers_resolveInvalidTransformType(context)||context.config().transform.type}(this)}},{key:"transformType",value:function transformType(){return this._transformType}},{key:"render",value:function render(){return this}},{key:"elemType",value:function elemType(){return"g"}},{key:"remove",value:function remove(){var _this$metaInf4=this.metaInf(),namespace=_this$metaInf4.namespace,parentNamespace=_this$metaInf4.parentNamespace,store=this.store();store.removeSubNamespace(namespace,BaseLayer.formalName());var unitDom=store.get("".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".domain"))[parentNamespace];return unitDom&&delete unitDom[namespace],renderer_utils_selectElement(this.mount()).remove(),this}},{key:"cachePoint",value:function cachePoint(key,data){if(null===key)return this;var pointMap=this._pointMap;return!pointMap[key]&&(pointMap[key]=[]),pointMap[key].push(data),this}},{key:"dataProps",value:function dataProps(){return arguments.length?(this._dataProps=arguments.length<=0?void 0:arguments[0],this):this._dataProps}},{key:"getIdentifiersFromData",value:function getIdentifiersFromData(data){var schema=this.data().getSchema(),fieldsConfig=this.data().getFieldsConfig(),identifiers=[[],[]],_this$encodingFieldsI=this.encodingFieldsInf(),xFieldType=_this$encodingFieldsI.xFieldType,yFieldType=_this$encodingFieldsI.yFieldType,xField=_this$encodingFieldsI.xField,yField=_this$encodingFieldsI.yField,_map2=base_layer_slicedToArray([xFieldType,yFieldType].map(function(type){return type===dist_datamodel.FieldType.MEASURE}),2),xMeasure=_map2[0],yMeasure=_map2[1];if(schema.forEach(function(d,i){var name=d.name;fieldsConfig[name].def.type===dist_datamodel.FieldType.DIMENSION&&(identifiers[0].push(name),identifiers[1].push(data[i]))}),xMeasure&&yMeasure){var _identifiers$,_identifiers$2,xMeasureIndex=fieldsConfig[xField].index,yMeasureIndex=fieldsConfig[yField].index;(_identifiers$=identifiers[0]).push.apply(_identifiers$,[xField,yField]),(_identifiers$2=identifiers[1]).push.apply(_identifiers$2,[data[xMeasureIndex],data[yMeasureIndex]])}return identifiers}},{key:"hasPlotSpan",value:function hasPlotSpan(){return!1}},{key:"getPlotSpan",value:function getPlotSpan(){return{x:0,y:0}}},{key:"getPlotPadding",value:function getPlotPadding(){return{x:0,y:0}}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){var _ref,fieldNames,values,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},getAllAttrs=config.getAllAttrs,getBBox=config.getBBox;if(!this.data())return[];if(identifiers instanceof datamodel_default.a){var dataObj=identifiers.getData();fieldNames=dataObj.schema.map(function(d){return d.name}),values=dataObj.data}else fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length);var points=this._points,fieldsConfig=this.data().getFieldsConfig(),filteredPoints=(_ref=[]).concat.apply(_ref,base_layer_toConsumableArray(points)).filter(function(point){var source=point.source,rowId=point.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})});return getAllAttrs?filteredPoints:filteredPoints.map(function(d){var obj=clone(d);if(getBBox){var update=obj.update||obj;if(void 0!==obj.size){var sizeVal=2*Math.sqrt(obj.size/Math.PI);update.width=sizeVal,update.height=sizeVal,update.x-=sizeVal/2,update.y-=sizeVal/2}else void 0===update.width&&(update.width=2),void 0===update.height&&(update.height=2)}return obj.update||obj}).sort(function(a,b){return a.y-b.y})}},{key:"getTransformedDataFromIdentifiers",value:function getTransformedDataFromIdentifiers(identifiers){var measureIndex,enc,_identifiers$getData=identifiers.getData(),identifierData=_identifiers$getData.data,identifierSchema=_identifiers$getData.schema,normalizedData=this._normalizedData,fieldsConfig=this.data().getFieldsConfig(),_this$encodingFieldsI2=this.encodingFieldsInf(),yField=_this$encodingFieldsI2.yField,xField=_this$encodingFieldsI2.xField,yFieldType=_this$encodingFieldsI2.yFieldType;_this$encodingFieldsI2.xFieldType===dist_datamodel.FieldType.MEASURE?(measureIndex=fieldsConfig[xField].index,enc="x"):yFieldType===dist_datamodel.FieldType.MEASURE&&(measureIndex=fieldsConfig[yField].index,enc="y");var transformedData=[];return normalizedData.forEach(function(dataArr){dataArr.forEach(function(dataObj){var tupleArr=dataObj.source;if(identifierSchema.every(function(obj,i){return-1!==identifierData.findIndex(function(d){return tupleArr[fieldsConfig[obj.name].index]===d[i]})})){var transformedVal=dataObj[enc],row=dataObj.source,tuple={};for(var key in fieldsConfig){var index=fieldsConfig[key].index;tuple[key]=row[index],index===measureIndex&&(tuple[key]=transformedVal)}transformedData.push(tuple)}})}),[transformedData,this.data().getSchema()]}},{key:"getPlotElementsFromSet",value:function getPlotElementsFromSet(set){for(var graphicElems=this._graphicElems,elems=[],i=0,len=set.length;i2&&void 0!==arguments[2]?arguments[2]:{},dataPoint=renderer_utils_selectElement(config.event.target).data()[0];if(isSimpleObject(dataPoint)){var source=dataPoint.source,rowId=dataPoint.rowId;return{id:this.getIdentifiersFromData(source,rowId),layerId:this.id()}}return null}},{key:"translatePoints",value:function translatePoints(data){var _this2=this,_this$axes=this.axes(),angle=_this$axes.angle,colorAxis=_this$axes.color,radiusAxis=_this$axes.radius,pieIndex={},prevData=this._points[0]||[],points=[],angleV={};return this._prevPieData={},prevData.forEach(function(e,index){_this2._prevPieData[e.rowId]=[e,index],pieIndex[e.index]=e}),data.forEach(function(d,i){var angles=angle.getScaleValue(d.angle);if(angles){!angleV[d.angle]&&(angleV[d.angle]=0);var _angles=angles[angleV[d.angle]++],startAngle=_angles.startAngle,endAngle=_angles.endAngle,uid=d.rowId,resolvedEncodings=helpers_resolveEncodingValues({values:{radius:radiusAxis.getOuterRadius(d.radius),radius0:radiusAxis.getInnerRadius(d.radius0),color:colorAxis.getColor(d.color),angle0:startAngle,angle:endAngle,startAngle:startAngle,endAngle:endAngle,startAngle0:startAngle,endAngle0:endAngle},data:d},i,data,_this2),color=resolvedEncodings.color;points.push({source:d.source,index:i,enter:{},update:{angle0:resolvedEncodings.angle0,angle:resolvedEncodings.angle,radius0:resolvedEncodings.radius0,radius:resolvedEncodings.radius},color:color,meta:getColorMetaInf({fill:color},colorAxis),rowId:uid,_previousInfo:_this2._prevPieData[uid]?_this2._prevPieData[uid][0]:function getPreviousPoint(prevData,currIndex,context){var prevArc=prevData[currIndex-1],nextArc=prevData[currIndex],_context$axes$angle$r2=arc_helper_slicedToArray(context.axes().angle.range(),2),startAngle=_context$axes$angle$r2[0],endAngle=_context$axes$angle$r2[1];return prevArc&&nextArc?{update:{angle0:getObjProp(prevArc,"update","angle"),angle:getObjProp(nextArc,"update","angle0")}}:nextArc?{update:{angle0:(startAngle-90)*Math.PI*2/360,angle:(startAngle-90)*Math.PI*2/360}}:{update:{angle0:(endAngle-90)*Math.PI*2/360,angle:(endAngle-90)*Math.PI*2/360}}}(pieIndex,i,_this2)})}}),points}},{key:"render",value:function render(container){var _this3=this,measurement=this.measurement(),_this$config=this.config(),classPrefix=_this$config.classPrefix,defClassName=_this$config.defClassName,cornerRadius=_this$config.cornerRadius,padAngle=_this$config.padAngle,padRadius=_this$config.padRadius,transition=_this$config.transition,qualClassName=getQualifiedClassName(defClassName,this.id(),classPrefix),path=this._arcFn=arc_arc().cornerRadius(cornerRadius).startAngle(function(d){return d.update.angle0+Math.PI/2}).endAngle(function(d){return d.update.angle+Math.PI/2}).padAngle(padAngle).padRadius(padRadius).outerRadius(function(d){return d.update.radius}).innerRadius(function(d){return d.update.radius0});this._points=this._normalizedData.map(function(arr){return _this3.translatePoints(arr)});var graphicElems=this._graphicElems={},g=makeElement(renderer_utils_selectElement(container),"g",this._points,"".concat(qualClassName[0],"-group")).classed("".concat(qualClassName[1],"-group"),!0).attr("transform","translate(".concat(measurement.width/2,",\n ").concat(measurement.height/2,")")),consecutiveExits=[],exitCounter=0;return makeElement(g,"g",function(d){return d},"".concat(qualClassName[0]),{update:function tween(elem){makeElement(elem,"path",function(d){return[d]},"".concat(qualClassName[0],"-path")).style("fill",function(d){return d.color}).each(function(d){graphicElems[d.rowId]=renderer_utils_selectElement(this)}).transition().duration(transition.duration).on("end",_this3.registerAnimationDoneHook()).attrTween("d",function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return function tweenPie(path,b){var datum=b[0];return function(t){return path(common_utils_interpolator()(datum._previousInfo,datum)(t))}}(path,params)}).attr("class",function(d,i){var individualClass=getIndividualClassName(d,i,_this3._points,_this3);return"".concat(qualClassName[0],"-path ").concat(qualClassName[1],"-path-").concat(d.index,"\n ").concat(individualClass)})},exit:function tweenExit(elem,d){var exitArr=consecutiveExits[exitCounter],oldExitCounter=exitCounter;exitArr?exitArr[exitArr.length-1].datum.index===d.index-1?exitArr.push({elem:elem,datum:d}):exitCounter++:exitArr=[{elem:elem,datum:d}],consecutiveExits[oldExitCounter]=exitArr}}).attr("class",function(d,i){return"".concat(qualClassName[0]," ").concat(qualClassName[1],"-").concat(i)}),function tweenExitPie(consecutiveExits,transition,path){consecutiveExits.length>0&&consecutiveExits.forEach(function(consecutiveExitArr){var startAngle=consecutiveExitArr[0].datum.update.angle0,endAngle=consecutiveExitArr[consecutiveExitArr.length-1].datum.update.angle,mid=2*Math.PI*startAngle/(2*Math.PI+startAngle-endAngle);consecutiveExitArr.forEach(function(e){var elem=e.elem,datum=e.datum;elem.each(function(){var gElem=renderer_utils_selectElement(this);gElem.selectAll("path").transition().duration(transition.duration).attrTween("d",function(){return function(t){return path(common_utils_interpolator()(datum,{update:{angle0:mid,angle:mid,radius:datum.radius,radius0:datum.radius0}})(t))}}).remove(),gElem.remove()})})})}(consecutiveExits,transition,path),this}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){if(!this.data())return[];var fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length),pieSlices=renderer_utils_selectElement(this.mount()).selectAll("path").data(),fieldsConfig=this.data().getFieldsConfig(),pieSliceInf=pieSlices.filter(function(tData){var source=tData.source,rowId=tData.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})})[0];if(pieSliceInf){var measurement=this.measurement(),centroid=this._arcFn.centroid(pieSliceInf);return[{x:centroid[0]+measurement.width/2,y:centroid[1]+measurement.height/2,width:2,height:2}]}return[]}}],[{key:"defaultConfig",value:function defaultConfig(){return arc_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"arc"}}]),ArcLayer}(),text_renderer=function drawText(container,data,config,layerInst){var selection=renderer_utils_selectElement(container).selectAll("g").data(data),smartLabel=layerInst._dependencies.smartLabel,graphicElems=layerInst._graphicElems,selectionMerge=selection.enter().append("g").each(function(dataObj){renderer_utils_setAttrs(this,dataObj.enter)}).merge(selection),style=renderer_utils_getSmartComputedStyle(renderer_utils_selectElement(container),config.className),fontSize=parseInt(style.fontSize,10);return smartLabel.setStyle(style),selectionMerge.each(function(dataObj){var element=renderer_utils_selectElement(this);graphicElems[dataObj.rowId]=element;var backgroundVal,update=dataObj.update,text=dataObj.text,color=dataObj.color,textanchor=dataObj.textanchor,textStyle=dataObj.style,background=dataObj.background;if(backgroundVal=background.value){var diff,backgroundPadding=background.padding,_smartLabel$getOriSiz=smartLabel.getOriSize(dataObj.text),width=_smartLabel$getOriSiz.width,height=_smartLabel$getOriSiz.height,backgroundEl=makeElement(element,"rect",[1]);diff="end"===textanchor?width:"start"===textanchor?0:width/2,renderer_utils_setAttrs(backgroundEl.node(),{x:update.x-diff-backgroundPadding/2,y:update.y-fontSize-backgroundPadding/2,width:width+backgroundPadding,height:height+backgroundPadding}),background&&renderer_utils_setStyles(backgroundEl,{background:backgroundVal})}var textEl=makeElement(element,"text",function(d){return[d]}).text(text),textNode=textEl.node();textStyle&&renderer_utils_setStyles(textNode,textStyle),color&&renderer_utils_setStyles(textNode,{fill:color}),dataObj.className&&textEl.classed(dataObj.className,!0),renderer_utils_setAttrs(textNode,update),textEl.attr("text-anchor",textanchor),textEl.attr("alignment-baseline",dataObj["alignment-baseline"]),textEl.attr("transform","rotate(".concat(dataObj.rotation," ").concat(update.x," ").concat(update.y,")"))}),selection.exit().remove(),selection},text_default_config_defaultConfig={defClassName:"layer-text",classPrefix:"muze",className:"",transform:{type:"identity"},interaction:{highlight:[{type:"fill",intensity:[0,0,-15,0]}],fade:[{type:"fill",intensity:[0,0,15,0]}],focus:[{type:"fill",intensity:[0,0,15,0]}]},transition:{effect:"cubic",duration:1e3},encoding:{color:{},size:{},radius:{},angle:{},text:{value:"",formatter:function formatter(val,i,data,context){return context.valueParser()(val)},background:{padding:10}},rotation:{value:0},"alignment-baseline":{value:"middle"}},states:{highlight:{className:"".concat("muze","-layer-text-highlight")},fadeout:{className:"".concat("muze","-layer-text-fadeout")},selected:{className:"".concat("muze","-layer-text-selected")}}};__webpack_require__(18);function text_typeof(obj){return(text_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function text_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var _this=this,config=this.config(),normalizedData=this._normalizedData,className=config.className,qualifiedClassName=getQualifiedClassName(config.defClassName,this.id(),config.classPrefix);return renderer_utils_selectElement(container).classed("".concat(qualifiedClassName.join(" ")," ").concat(className),!0),this._graphicElems={},renderer_utils_createElements({data:normalizedData,append:"g",selector:"g",container:container,each:function each(dataArr,group){var node=group.node(),points=_this.translatePoints(dataArr,{},_this);renderer_utils_setStyles(node,{"text-anchor":"middle"}),text_renderer(node,points,{className:qualifiedClassName[0]},_this)}}),this}}],[{key:"defaultConfig",value:function defaultConfig(){return text_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"text"}}]),TextLayer}(),point_renderer=function drawSymbols(params){var layer=params.layer,container=params.container,points=params.points,transition=params.transition,className=params.className,duration=transition.duration,effect=transition.effect,disabled=transition.disabled,mount=renderer_utils_selectElement(container),graphicElems=layer._graphicElems;return mount.attr("class",className),makeElement(mount,"g",points,null,{enter:function enter(group,d){var enter=d.enter;group.attr("transform","translate(".concat(enter.x,",").concat(enter.y,")"))},update:function update(group,d){!function createShape(d,groupElement){var shape=d.shape,size=d.size,update=d.update;if(shape instanceof Promise)shape.then(function(res){d.shape=res,createShape(d,groupElement)});else if(shape instanceof Element){var newShape=shape.cloneNode(!0);if("img"===newShape.nodeName.toLowerCase()){var src=newShape.src||newShape.href;(newShape=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("href",src)}var shapeElement=renderer_utils_selectElement(newShape);"path"===newShape.nodeName||"image"===newShape.nodeName?shapeElement.attr("transform","scale(".concat(size/100,")")):(shapeElement.attr("height",size),shapeElement.attr("width",size)),shapeElement.attr("x",-size/2),shapeElement.attr("y",-size/2),makeElement(groupElement,function(){return newShape},[1])}else if("string"==typeof shape){var pathStr;pathStr=function checkPath(str){return!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(str)&&/[\dz]$/i.test(str)&&str.length>4)}(shape)?shape:common_utils_getSymbol(shape).size(size)(update),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}else d.shape="circle",createShape(d,groupElement)}(d,group),graphicElems[d.rowId]=group;var update=d.update,style=d.style;objectIterator(style,function(key){return group.style(key,style[key])}),group.attr("class",className),group.classed(d.className,!0),disabled||(group=group.transition().duration(transition.duration).on("end",layer.registerAnimationDoneHook())),group.attr("transform","translate(".concat(update.x,",").concat(update.y,")"))},exit:function exit(exitGroup){disabled?exitGroup.remove():exitGroup.transition().ease(easeFns[effect]).duration(duration).on("end",function(){return exitGroup.remove()}).style("fill-opacity",0).style("stroke-opacity",0)}},params.keyFn)},point_default_config_defaultConfig={defClassName:"layer-point",className:"",classPrefix:"muze",defColorStyle:"stroke",interaction:{highlight:[{type:"stroke",intensity:[0,0,0,1]}],fade:[{type:"fill",intensity:[0,0,20,0]}],focus:[{type:"fill",intensity:[0,0,20,0]}]},innerPadding:.1,nearestPointThreshold:10,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},encoding:{size:{value:30},color:{},stroke:{value:"hsla(0,0%,0%,0)"},fill:{},shape:{value:"circle"},x:{},y:{},strokeOpacity:{value:.5},fillOpacity:{value:.5}},shapes:["circle","cross","diamond","square","star","wye","triangle"],sizes:[20,30,40,50,60,70]};__webpack_require__(19);function point_typeof(obj){return(point_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function point_toConsumableArray(arr){return function point_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},points=[],encoding=this.config().encoding,axes=this.axes(),x=encoding.x,y=encoding.y,xField=x.field,yField=y.field,sizeAxis=axes.size,shapeAxis=axes.shape,fieldsConfig=this.data().getFieldsConfig(),isXDim=fieldsConfig[xField]&&fieldsConfig[xField].def.type===dist_datamodel.FieldType.DIMENSION,isYDim=fieldsConfig[yField]&&fieldsConfig[yField].def.type===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=this.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,stroke=encoding.stroke.value,_loop=function _loop(i,len){var d=data[i],size=sizeAxis.getSize(d.size),shape=shapeAxis.getShape(d.shape),_map2=point_slicedToArray([ENCODING.X,ENCODING.Y].map(function(type){var value=null===d[type]?void 0:d[type],measure=type===ENCODING.X?measurement.width:measurement.height;return encoding[type].field?axes[type].getScaleValue(value):measure/2}),2),xPx=_map2[0],yPx=_map2[1];xPx+=offsetX,yPx+=offsetY;var color=colorAxis.getColor(d.color),resolvedEncodings=helpers_resolveEncodingValues({values:{x:xPx,y:yPx,color:color,shape:shape,size:size,data:d},data:d},i,data,_this2),style={fill:color=resolvedEncodings.color,stroke:stroke},pos={x:resolvedEncodings.x,y:resolvedEncodings.y};if(!isNaN(xPx)&&!isNaN(yPx)){var point={enter:pos,update:pos,shape:resolvedEncodings.shape,size:Math.abs(resolvedEncodings.size),meta:getColorMetaInf(style,colorAxis),style:style,source:d.source,rowId:d.rowId};point.className=getIndividualClassName(d,i,data,_this2),points.push(point),_this2.cachePoint(d[key],point)}},i=0,len=data.length;i=update.x&&x<=update.width+update.x&&y>=update.y&&y<=update.height+update.y){pointFound=point;break}pointFound=null}var values=pointFound&&pointFound.source;return values&&(identifiers=this.getIdentifiersFromData(values,pointFound.rowId)),pointFound?{dimensions:[pointFound.update],id:identifiers,layerId:this.id()}:pointFound}},{key:"getPlotSpan",value:function getPlotSpan(){return this._plotSpan}},{key:"hasPlotSpan",value:function hasPlotSpan(){return!0}}],[{key:"formalName",value:function formalName(){return"bar"}},{key:"defaultConfig",value:function defaultConfig(){return bar_default_config_defaultConfig}},{key:"defaultPolicy",value:function defaultPolicy(conf,userConf){var config=base_layer_BaseLayer.defaultPolicy(conf,userConf),colorField=config.encoding.color.field,transform=config.transform;return colorField&&(transform.groupBy=colorField),config}}]),BarLayer}(),tick_default_config_defaultConfig={defClassName:"layer-tick",className:"",classPrefix:"muze",interaction:{highlight:[{type:"stroke",intensity:[0,0,-15,0]}],fade:[{type:"stroke",intensity:[0,0,15,0]}],focus:[{type:"stroke",intensity:[0,0,15,0]}]},innerPadding:.1,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},interpolate:"linear",encoding:{color:{},x:{},y:{},x0:{},y0:{},radius:{},radius0:{},angle:{},angle0:{},strokeOpacity:{value:.5},fillOpacity:{value:.5}},states:{highlight:{className:"".concat("muze","-layer-tick-highlight")},fadeout:{className:"".concat("muze","-layer-tick-fadeout")},selected:{className:"".concat("muze","-layer-tick-selected")}}},tick_renderer_line=Symbols.line,tick_renderer=function(params){var points=params.points,container=params.container,keyFn=params.keyFn,className=params.className,interpolate=params.interpolate,layer=params.layer,mount=renderer_utils_selectElement(container),ticks=mount.selectAll("path").data(points,keyFn),ticksEnter=ticks.enter().append("path"),graphicElems=layer._graphicElems;return mount.attr("class",className||""),ticksEnter.each(function(d){var selection=renderer_utils_selectElement(this),enter=d.enter||{};Object.entries(enter).forEach(function(attr){return!isNaN(attr[1])&&selection.attr(attr[0],attr[1])})}),ticks.exit().remove(),ticks.merge(ticksEnter).each(function(d){var selection=renderer_utils_selectElement(this);graphicElems[d.rowId]=selection;var update=d.update,updateStyle=d.style||{},x0=void 0!==update.x0?update.x0:update.x,y0=void 0!==update.y0?update.y0:update.y,curveInterpolatorFn=pathInterpolators[interpolate],linepath=tick_renderer_line().curve(curveInterpolatorFn).x(function(e){return e[0]}).y(function(e){return e[1]});d.className&&selection.classed(d.className,!0),selection.attr("d",linepath([[update.x,update.y],[x0,y0]])),Object.entries(updateStyle).forEach(function(styleObj){return selection.style(styleObj[0],styleObj[1])})})};__webpack_require__(21);function tick_typeof(obj){return(tick_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tick_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];for(var layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],radiusAxis=axes.radius,angleAxis=axes.angle,angle0Axis=axes.angle0,measurement=layerInst.measurement(),colorAxis=axes.color,angleV={},angle0V={},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],_getAxesScales=helpers_getAxesScales(axes),xAxis=_getAxesScales.xAxis,yAxis=_getAxesScales.yAxis,_layerInst$encodingFi=layerInst.encodingFieldsInf(),xField=_layerInst$encodingFi.xField,yField=_layerInst$encodingFi.yField,x0Field=_layerInst$encodingFi.x0Field,y0Field=_layerInst$encodingFi.y0Field,xFieldType=_layerInst$encodingFi.xFieldType,yFieldType=_layerInst$encodingFi.yFieldType,isXDim=xFieldType===dist_datamodel.FieldType.DIMENSION,isYDim=yFieldType===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_config$span=config.span,xSpan=_config$span.x,ySpan=_config$span.y,i=0,len=data.length;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];var layerRegistry=factoryObj._layerRegistry,instances=(layerDef=layerDef instanceof Array?layerDef:[layerDef]).map(function(layerObj){var layerConstructor=layerRegistry[layerObj.mark];return layerConstructor.create.apply(layerConstructor,params)});return 1===instances.length?instances[0]:instances},getLayerClass:function getLayerClass(mark){return factoryObj._layerRegistry[mark]},composeLayers:function composeLayers(layerType,layerDefs){compositeLayers[layerType]=layerDefs},sanitizeLayerConfig:function sanitizeLayerConfig(layerDef){var newConf=mergeRecursive({},layerDef);return sanitizeEncoding(newConf.encoding),newConf}};return factoryObj}();function defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _CONFIG$ROWS$COLUMNS$,DEFAULT_LAYERS=(defaults_defineProperty(_DEFAULT_LAYERS={},layer_types_AREA_LAYER,area_AreaLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_ARC_LAYER,arc_ArcLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_LINE_LAYER,line_LineLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TEXT_LAYER,text_TextLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_POINT_LAYER,point_PointLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TICK_LAYER,tick_TickLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BAR_LAYER,bar_BarLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BASE_LAYER,base_layer_BaseLayer),_DEFAULT_LAYERS),muze_package=__webpack_require__(6);function visual_group_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var local_options=(visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$={},"config",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,ROWS,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,COLUMNS,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_COLOR,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_SHAPE,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,enums_constants_SIZE,{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"detail",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"layers",{}),visual_group_local_options_defineProperty(_CONFIG$ROWS$COLUMNS$,"transform",{}),_CONFIG$ROWS$COLUMNS$);function simple_group_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{},innerRadius=config.innerRadius,outerRadius=config.outerRadius;return[innerRadius||0,outerRadius||Math.min(height,width)/2]}(context.width(),context.height()))})},helper_isXandYMeasures=function isXandYMeasures(context){var _context$fields=context.fields(),_map2=src_helper_slicedToArray([_context$fields.x,_context$fields.y].map(function(fields){return fields.every(function(field){return field.type()===dist_datamodel.FieldType.MEASURE})}),2),xMeasures=_map2[0],yMeasures=_map2[1];return xMeasures&&yMeasures},getKey=function getKey(arr,row){for(var key=row[arr[0]],i=1,len=arr.length;i=0?axisInf[key]:axisArr.length-1;axes[key]&&(axesObj[key]=defaultValue(axes[key][axisIndex]))}}),Object.keys(axesObj).length&&layer.axes(axesObj)})}(axesVal,layers,layerAxisIndexVal),context._lifeCycleManager.notify({client:layers,action:"updated",formalName:"layer"}))}}];function src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var src_props_PROPS=(src_props_defineProperty(_PROPS={},"facetByFields",{}),src_props_defineProperty(_PROPS,"retinalFields",{}),src_props_defineProperty(_PROPS,"parentAlias",{}),src_props_defineProperty(_PROPS,"cachedData",{}),src_props_defineProperty(_PROPS,"detailFields",{}),src_props_defineProperty(_PROPS,"axes",{defaultValue:{x:[],y:[]}}),src_props_defineProperty(_PROPS,"fields",{defaultValue:{x:[],y:[]},sanitization:function sanitization(context,value){return mergeRecursive({x:[],y:[]},value)}}),src_props_defineProperty(_PROPS,"metaInf",{}),src_props_defineProperty(_PROPS,"registry",{}),src_props_defineProperty(_PROPS,"parentContainerInf",{}),src_props_defineProperty(_PROPS,"valueParser",{defaultValue:function defaultValue(val){return val}}),src_props_defineProperty(_PROPS,"coord",{}),_PROPS);function payload_generator_toConsumableArray(arr){return function payload_generator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{},payload=config.payload,selectionSet=config.selectionSet,propagationFieldInf=config.propagationFields[action]||{},propagationFields=propagationFieldInf.fields||[],append=propagationFieldInf.append,criteria=payload.criteria,context=instance.context,dataModel=context.cachedData()[0],sourceId=context.id(),sideEfffects=instance.sideEffects(),behaviourEffectMap=instance._behaviourEffectMap,mergedModel=selectionSet.mergedEnter.model,fieldsConfig=dataModel.getFieldsConfig();payload.sourceUnit=sourceId,payload.action=action,payload.sourceCanvas=context.parentAlias();var propagationBehaviour=instance._propagationBehaviourMap[action]||action,propFields=[];null===criteria?propagationData=null:isSimpleObject(criteria)?(propFields=Object.keys(criteria||{}),propagationData=mergedModel?mergedModel.project(propFields):null):(propFields=criteria[0],propagationData=mergedModel?mergedModel.project(propFields):null);var facetByFields=context.facetByFields();if(null!==propagationData&&propagationFields.length){var fields=propagationData.getData().schema.map(function(d){return d.name});propagationData=function getModelWithFacetData(dm,data){var dataObj=dm.getData(),schema1=dataObj.schema,data1=dataObj.data,jsonData=[],derivedSchema=data[0].map(function(d){return{name:"".concat(d),type:dist_datamodel.FieldType.DIMENSION,subtype:d.subtype()}}),dataAtFirstPos=data[1];return data1.forEach(function(d){var tuple={};schema1.forEach(function(obj,i){tuple[obj.name]=d[i]}),derivedSchema.forEach(function(obj,i){tuple[obj.name]=dataAtFirstPos[i]}),jsonData.push(tuple)}),new datamodel_default.a(jsonData,[].concat(data_propagator_toConsumableArray(schema1),data_propagator_toConsumableArray(derivedSchema)))}(propagationData,facetByFields),propFields=append?[].concat(data_propagator_toConsumableArray(fields),data_propagator_toConsumableArray(propagationFields)):propagationFields,propagationData=propagationData.project(propFields)}var propagateInterpolatedValues=!1;propFields.length&&propFields.every(function(field){return fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.MEASURE})&&(propagateInterpolatedValues=!0);var groupId=context.parentAlias();payload.action=action;var behaviourInstance=instance._actions.behavioural[propagationBehaviour],isMutableAction=!!behaviourInstance&&behaviourInstance.constructor.mutates(),filterFn=function filterFn(entry,propagationConf){var effects=behaviourEffectMap[entry.config.action],mutates=!entry.config.groupId||effects.some(function(d){return sideEfffects[d.name||d].constructor.mutates()});return entry.config.groupId!==propagationConf.groupId&&mutates},sourceBehaviour=instance._actions.behavioural[action],mutates=!!sourceBehaviour&&sourceBehaviour.constructor.mutates(),propConfig={payload:payload,action:action,criteria:propagationData,isMutableAction:mutates,propagateInterpolatedValues:propagateInterpolatedValues,groupId:groupId,sourceId:mutates?groupId:sourceId,filterFn:filterFn,enabled:function enabled(propConf,firebolt){return action===propagationBehaviour||propConf.payload.sourceCanvas===firebolt.context.parentAlias()}};dataModel.propagate(propagationData,propConfig,!0),action!==propagationBehaviour&&(propConfig={payload:payload,sourceId:isMutableAction?groupId:sourceId,criteria:propagationData,isMutableAction:isMutableAction,propagateInterpolatedValues:propagateInterpolatedValues,action:propagationBehaviour,groupId:groupId,applyOnSource:action===propagationBehaviour,enabled:function enabled(propConf,firebolt){return propConf.payload.sourceCanvas!==firebolt.context.parentAlias()},filterFn:filterFn},dataModel.propagate(propagationData,propConfig,!0,{filterImmutableAction:function filterImmutableAction(actionInf,propInf){return actionInf.groupId!==propInf.groupId}}))};function src_firebolt_typeof(obj){return(src_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function src_firebolt_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},points=[],parsedIdentifiers=identifiers;if(null===identifiers)return[];var layers=this.layers(),len=layers.length;isSimpleObject(identifiers)&&(parsedIdentifiers=[Object.keys(identifiers)],parsedIdentifiers=[].concat(visual_unit_toConsumableArray(parsedIdentifiers),visual_unit_toConsumableArray(function transposeArray(arr){return arr[0].map(function(col,i){return arr.map(function(row){return row[i]})})}(Object.values(identifiers)))));for(var i=0;i0&&(dimensionArr[0]=[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),dimensionArr[1]=[]),{fields:dimensionArr.map(function(list,i){return 1===i?measureArr[i].concat(dimensionArr[i]):dimensionArr[i].concat(measureArr[i])}),dimensions:[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),measures:[].concat(field_sanitizer_toConsumableArray(measureArr[0]),field_sanitizer_toConsumableArray(measureArr[1])),temporal:[].concat(field_sanitizer_toConsumableArray(temporalArr[0]),field_sanitizer_toConsumableArray(temporalArr[1])),categorical:[].concat(field_sanitizer_toConsumableArray(categoricalArr[0]),field_sanitizer_toConsumableArray(categoricalArr[1]))}}(norFields,fields)}),2),rowsInfo=_map2[0],columnsInfo=_map2[1],rows=rowsInfo.fields,rowDimensions=rowsInfo.dimensions,rowMeasures=rowsInfo.measures,rowTemporalFields=rowsInfo.temporal,rowCategoricalFields=rowsInfo.categorical,columns=columnsInfo.fields,columnDimensions=columnsInfo.dimensions,columnMeasures=columnsInfo.measures;return{rows:rows,rowDimensions:rowDimensions,rowMeasures:rowMeasures,rowTemporalFields:rowTemporalFields,rowCategoricalFields:rowCategoricalFields,columns:columns,columnTemporalFields:columnsInfo.temporal,columnCategoricalFields:columnsInfo.categorical,columnDimensions:columnDimensions,columnMeasures:columnMeasures}};function visual_encoder_slicedToArray(arr,i){return function visual_encoder_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function visual_encoder_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function visual_encoder_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function visual_encoder_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},fields=arguments.length>1?arguments[1]:void 0,_getHeaderAxisFrom2=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(ROW,fields.rows,axisFrom),2),rowHeader=_getHeaderAxisFrom2[0],rowAxis=_getHeaderAxisFrom2[1],_getHeaderAxisFrom4=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom("column",fields.columns,axisFrom),2),colHeader=_getHeaderAxisFrom4[0],colAxis=_getHeaderAxisFrom4[1];return this.axisFrom({row:rowAxis,column:colAxis}),this.headerFrom({row:rowHeader,column:colHeader}),this}}]),VisualEncoder}(),scaleMaps={linear:continous_axis_ContinousAxis,band:band_axis_BandAxis,temporal:time_axis_TimeAxis,size:size_axis_SizeAxis,color:color_axis_ColorAxis,shape:shape_axis_ShapeAxis},data_type_scale_map_dataTypeScaleMap={dimension:scale_type_namespaceObject.BAND,categorical:scale_type_namespaceObject.BAND,temporal:scale_type_namespaceObject.TIME,measure:scale_type_namespaceObject.LINEAR,continuous:scale_type_namespaceObject.LINEAR};function encoder_helper_toConsumableArray(arr){return function encoder_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1?axesCreators.position="both":axesCreators.position=_this.axisFrom()[type],geomCellAxes[axis]=encoder_helper_generateAxisFromMap(axis,axisFields[i],axesCreators,{groupAxes:axis===X?xAxes:yAxes,valueParser:resolver.valueParser()},indices,facetFields)}),geomCell.axes(geomCellAxes),geomCellAxes}},{key:"unionUnitDomains",value:function unionUnitDomains(context){for(var store=context.store(),resolver=context.resolver(),units=resolver.units(),domains={0:{},1:{}},config=context.config(),fieldsObj={0:{},1:{}},_loop=function _loop(rIdx,len){for(var unitsArr=units[rIdx],_loop2=function _loop2(cIdx,len2){var unit=unitsArr[cIdx],axisFields=unit.fields(),encodingDomains=unit.getDataDomain();["x","y"].forEach(function(axisType,axisTypeIndex){axisFields[axisType].forEach(function(field,axisIndex){var key=axisTypeIndex?"".concat(rIdx,"0").concat(axisIndex):"0".concat(cIdx).concat(axisIndex),dom=encodingDomains[axisType],typeOfField=field.subtype();fieldsObj[axisTypeIndex][key]=field,dom&&0!==Object.keys(dom).length&&(domains[axisTypeIndex][key]=unionDomain([domains[axisTypeIndex]&&domains[axisTypeIndex][key]||[],dom["".concat(field)]],typeOfField))})})},cIdx=0,len2=unitsArr.length;cIdx1&&typeOfAxis===scale_type_namespaceObject.LINEAR&&axes[0].config().alignZeroLine)axes.forEach(function(axis,i){key=axisType?"".concat(idx,"0").concat(i):"0".concat(idx).concat(i),domain=domains[axisType][key],min[i]=domain[0],max[i]=domain[1]}),adjustedDomain=function getAdjustedDomain(max,min){var y1ratio=max[0]/(max[0]-min[0]),y2ratio=max[1]/(max[1]-min[1]),allSameSign=!1;return min[0]>0&&min[1]>0&&min[1]>0&&max[1]>0&&(allSameSign=!0,min[0]=0,min[1]=0),min[0]<0&&min[1]<0&&min[1]<0&&max[1]<0&&(allSameSign=!0,max[0]=0,max[1]=0),allSameSign||y1ratio===y2ratio||(y1ratiocounter)for(var _i=counter;_i-1&&(projections=[[_facet,_facet]],primaryFacets.splice(_existIndex,1)),secondaryFacets.splice(0,1)}else{var axisFromIndex=primaryFacets.length-1,facet=primaryFacets[axisFromIndex];projections=[[facet]];var existIndex=getIndex(secondaryFacets,facet);existIndex>-1&&(projections=[[facet,facet]],secondaryFacets.splice(existIndex,1)),primaryFacets.splice(axisFromIndex,1)}return{facets:facets=(facets=[].concat(primaryFacets,secondaryFacets)).filter(function(el,index,self){return index===self.findIndex(function(t){return t.toString()===el.toString()})}),projections:projections}}},{key:"fieldSanitizer",value:function fieldSanitizer(datamodel,config){return cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"fieldSanitizer",this).call(this,datamodel,config)}},{key:"getRetinalFieldsDomain",value:function getRetinalFieldsDomain(dataModels,encoding){var groupedModel=dataModels.groupedModel,domains={};for(var key in encoding)if({}.hasOwnProperty.call(encoding,key)){var encodingObj=encoding[key],field=encodingObj.field;if(!encodingObj.domain&&field){var domain=retriveDomainFromData(groupedModel,field);domains[field]=domain}}return domains}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer,i){var def=src_layer_factory.sanitizeLayerConfig(layer);def.order=i,serializedLayers.push(def)}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),layerConfig.push(config)}),layerConfig}},{key:"getLayerConfig",value:function getLayerConfig(fields,userLayerConfig,retinalConfig){var layerConfig=[],columnFields=fields.columnFields,rowFields=fields.rowFields;return columnFields.forEach(function(colField){var colFieldName=colField.toString();rowFields.forEach(function(rowField){var configs=[],rowFieldName=rowField.toString(),encoding={x:{field:colFieldName},y:{field:rowFieldName}},rowFieldType=rowField.subtype(),mark=function getDefaultMark(colFieldType,rowFieldType){return"categorical"===colFieldType||"categorical"===rowFieldType?"bar":"temporal"===colFieldType||"temporal"===rowFieldType?"line":"point"}(colField.subtype(),rowFieldType),defConfigs=[{mark:mark,def:{mark:mark,encoding:encoding}}],layerConfigs=function getLayerConfFromFields(colFields,rowFields,userLayerConfig){return userLayerConfig.filter(function(conf){var _ref,_ref2,_ref3,userConf=conf instanceof Array?conf:[conf],encodingArr=(_ref=[]).concat.apply(_ref,encoder_helper_toConsumableArray(userConf.map(function(d){return d.encoding}).filter(function(d){return void 0!==d})));if(!encodingArr.length)return!0;var xFields=(_ref2=[]).concat.apply(_ref2,encoder_helper_toConsumableArray(encodingArr.map(function(d){return[d.x&&d.x.field,d.x0&&d.x0.field]}))).filter(function(d){return void 0!==d&&null!==d}),yFields=(_ref3=[]).concat.apply(_ref3,encoder_helper_toConsumableArray(encodingArr.map(function(d){return[d.y&&d.y.field,d.y0&&d.y0.field]}))).filter(function(d){return void 0!==d&&null!==d});if(!xFields.length&&!yFields.length)return!0;var colFieldExist=!!xFields.length&&xFields.every(function(d){return-1!==colFields.indexOf(d)}),rowFieldExist=!!yFields.length&&yFields.every(function(d){return-1!==rowFields.indexOf(d)});return xFields.length&&yFields.length?colFieldExist&&rowFieldExist:colFieldExist||rowFieldExist})}(colField.getMembers(),rowField.getMembers(),userLayerConfig||[]);configs=layerConfigs.length?layerConfigs.map(function(layerConf){var mergedLayerConf=mergeRecursive(mergeRecursive({},defConfigs[0].def),layerConf),serializedLayerConfig=src_layer_factory.getSerializedConf(mergedLayerConf.mark,mergedLayerConf);return{mark:mergedLayerConf.mark,order:mergedLayerConf.order,def:serializedLayerConfig}}):defConfigs,layerConfig.push.apply(layerConfig,cartesian_encoder_toConsumableArray(configs))})}),this.sanitizeLayerConfig(retinalConfig,layerConfig)}}],[{key:"type",value:function type(){return cartesian_encoder_CARTESIAN}}]),CartesianEncoder}();function polar_encoder_typeof(obj){return(polar_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function polar_encoder_toConsumableArray(arr){return function polar_encoder_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);icounter)for(var _i=counter;_i0&&(config=mergeRecursive(config,userLayerConfig[0])),layerConfig.push(config)}),0===layerConfig.length&&(layerConfig=userLayerConfig);var sanitizedConfig=this.sanitizeLayerConfig(retinalConfig,layerConfig);return this.layers(sanitizedConfig),sanitizedConfig}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer){var def=src_layer_factory.getSerializedConf(layer.mark,layer);serializedLayers.push({mark:layer.mark,def:def})}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),def.forEach(function(conf){var encoding=conf.encoding||(conf.encoding={});!encoding.angle&&(encoding.angle={});var angleField=getObjProp(encoding.angle,"field"),angle0Field=getObjProp(encoding.angle0,"field");angleField||Object.assign(encoding.angle,{field:encodingConfigs.color&&encodingConfigs.color.field}),angle0Field||(!encoding.angle0&&(encoding.angle0={}),Object.assign(encoding.angle0,{field:encoding.angle.field}))}),layerConfig.push(config)}),layerConfig}}],[{key:"type",value:function type(){return polar_encoder_POLAR}}]),PolarEncoder}();function retinal_encoder_typeof(obj){return(retinal_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function retinal_encoder_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},axisType=axesCreators.axisType,fieldsConfig=axesCreators.fieldsConfig,field=fieldProps.field,axis=[],Cls=scaleMaps[axisType];return fieldProps.type=fieldProps.type?fieldProps.type:group_utils_getAxisType(fieldsConfig,field||null),axis.push(new Cls(fieldProps)),axis}({axisType:axisType,fieldsConfig:fieldsConfig},config[axisType])}),newAxes}},{key:"setCommonDomain",value:function setCommonDomain(context){var domains=context.domains,axes=context.axes,encoding=context.encoding;return Object.entries(encoding).forEach(function(enc){if(enc[1]&&enc[1].field){var encType=enc[0],field=enc[1].field;field&&axes[encType].forEach(function(axis){var domain=domains[field];!enc[1].domain&&axis.updateDomain(domain)})}}),axes}}],[{key:"type",value:function type(){return"retinal"}}]),RetinalEncoder}(),group_utils_this=void 0;function group_utils_slicedToArray(arr,i){return function group_utils_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function group_utils_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function group_utils_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function group_utils_toConsumableArray(arr){return function group_utils_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return"".concat(axisName,"-axis-").concat(params.join("-"))},group_utils_headerCreator=function headerCreator(fields,fieldHeaders,TextCell,_ref2){var classPrefix=_ref2.classPrefix,labelManager=_ref2.labelManager;return fields.length>0?fields[0].map(function(cell,i){return new TextCell({type:"header",className:"".concat(classPrefix,"-grid-headers")},{labelManager:labelManager}).source(function getHeaderText(headers,index,rowLength){var header="";if(index===rowLength-1&&headers.length>rowLength){for(var i=index;i1||right.length>1)&&(borders.top=!0,borders.bottom=!0),borders}(leftRows,rightRows),showColBorders=function getColumnsBorders(top,bottom){var borders={left:!1,right:!1};return(top.length||bottom.length)&&(top[0]&&top[0].length>1||bottom[0]&&bottom[0].length>1)&&(borders.left=!0,borders.right=!0),borders}(topColumns,bottomColumns),showValueBorders=function getValueBorders(rows,columns){var borders={top:!0,left:!0,bottom:!0,right:!0},borderTypeRow=[constants_LEFT,constants_RIGHT],borderTypeCol=["top","bottom"];return rows.forEach(function(e,i){e[0]&&e[0].length?borders[borderTypeRow[i]]=!0:borders[borderTypeRow[i]]=!1}),columns.forEach(function(e,i){e.length?borders[borderTypeCol[i]]=!0:borders[borderTypeCol[i]]=!1}),borders}([leftRows,rightRows],[topColumns,bottomColumns]),valueMatrix.length>1&&(showValueBorders.top=!0,showValueBorders.bottom=!0),valueMatrix.length&&valueMatrix[0].length>1&&(showValueBorders.left=!0,showValueBorders.right=!0),{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}},group_utils_sortFacetFields=function sortFacetFields(facets,keys,config){var schema=[],facetNames=[],sortInfo=[],sortConfig=config.sort;return facets.forEach(function(facet){var name="".concat(facet);facetNames.push(name);var facetSortConfig=sortConfig[name];facetSortConfig?sortInfo.push([name,facetSortConfig]):sortInfo.push([name,null]),schema.push(facet.getSchemaDef())}),new datamodel_default.a([facetNames].concat(group_utils_toConsumableArray(keys)),schema).getData({sort:sortInfo}).data};function matrix_model_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function matrix_model_objectSpread(target){for(var i=1;i0?formattedColKeys[0].map(function(col,i){return formattedColKeys.map(function(row){return row[i]})}):formattedColKeys}};function cell_creator_slicedToArray(arr,i){return function cell_creator_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function cell_creator_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function cell_creator_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function cell_creator_toConsumableArray(arr){return function cell_creator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?rowProjections.length:1):(keys=columnKeys,length=colProjections.length>0?colProjections.length:1),keys=keys.map(function(arr){return arr.map(function(val){return resolver.valueParser()(val)})}),section.length&&headerFrom===type&&axis&&keys.length){var hContext={axis:axis,length:length,type:type},headers=[];index<2?(hContext.keys=keys,hContext.facet=facet.rows,headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)):(hContext.facet=facet.columns,hContext.keys=keys[0].map(function(key,i){return keys.map(function(e){return e[i]})}),headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)),selectionObj["".concat(type,"Headers")]=headers}else selectionObj["".concat(type,"Headers")]=null}),selectionObj},cell_creator_getAxisFields=function getAxisFields(projections){var fieldHolder=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return projections.reduce(function(acc,item){return[].concat(cell_creator_toConsumableArray(acc),cell_creator_toConsumableArray(item.reduce(function(ac,field){return field instanceof simple_var_SimpleVariable?[].concat(cell_creator_toConsumableArray(ac),[field.oneVar()]):ac},[])))},fieldHolder)},cell_creator_transformDataModel=function transformDataModel(dataModel,config,resolver){var groupedModel,fieldsConfig=dataModel.getFieldsConfig(),resolvedData=resolver.data(),groupBy=config.groupBy,suppliedLayers=config.suppliedLayers,facetsAndProjections=config.facetsAndProjections;if(resolvedData instanceof datamodel_default.a&&resolvedData.dispose(),groupedModel=dataModel.project(dataModel.getSchema().map(function(d){return d.name})),resolver.data(groupedModel),!groupBy.disabled){var allFields=function extractFields(facetsAndProjections,layerFields){var _ref6,fields=Object.values(facetsAndProjections).map(function(arr){var _ref4,_ref5,flattenArray=(_ref4=[]).concat.apply(_ref4,group_utils_toConsumableArray(arr));return(_ref5=[]).concat.apply(_ref5,group_utils_toConsumableArray(flattenArray.map(function(field){return field instanceof variable_Variable?field.getMembers():field})))});return(_ref6=[]).concat.apply(_ref6,group_utils_toConsumableArray(fields).concat(group_utils_toConsumableArray(layerFields)))}(facetsAndProjections,function getFieldsFromSuppliedLayers(suppliedLayerConfig,fieldsConfig){var _ref3,fields=[],encodingArr=suppliedLayerConfig.map(function(conf){return conf.encoding||{}});return fields=(fields=[].concat(group_utils_toConsumableArray(fields),[(_ref3=[]).concat.apply(_ref3,group_utils_toConsumableArray(encodingArr.map(function(enc){return Object.values(enc).map(function(d){return d.field})})))])).filter(function(field){return fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION})}(suppliedLayers,groupedModel.getFieldsConfig())),dimensions=allFields.filter(function(field){return getObjProp(fieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),aggregationFns=groupBy.measures,measureNames=Object.keys(groupedModel.getFieldspace().getMeasure()),nearestAggFns=common_utils_retrieveNearestGroupByReducers.apply(void 0,[groupedModel].concat(cell_creator_toConsumableArray(measureNames))),resolvedAggFns=mergeRecursive(nearestAggFns,aggregationFns);groupedModel=groupedModel.groupBy(dimensions.length?dimensions:[""],resolvedAggFns).project(allFields)}return groupedModel=function sortDmTemporalFields(resolver,datamodel){var axisFields=[],projections=resolver.projections();axisFields=cell_creator_getAxisFields(projections.rowProjections,cell_creator_getAxisFields(projections.colProjections));var fieldConfig=datamodel.getFieldsConfig(),temporalFields=axisFields.reduce(function(acc,field){return"temporal"===fieldConfig[field].def.subtype?[].concat(cell_creator_toConsumableArray(acc),[[field]]):acc},[]);return temporalFields.length?datamodel.sort(temporalFields,{saveChild:!0}):datamodel}(resolver,groupedModel)},cell_creator_computeMatrices=function computeMatrices(context,config){var resolver=context.resolver,datamodel=context.datamodel,componentRegistry=context.componentRegistry,encoders=context.encoders,globalConfig=config.globalConfig,selection=config.selection,transform=config.transform,groupBy=globalConfig.autoGroupBy,labelManager=resolver.dependencies().smartlabel,fieldMap=datamodel.getFieldsConfig(),layerConfig=resolver.layerConfig(),registry=resolver.registry(),normalizedRows=resolver.horizontalAxis().fields,normalizedColumns=resolver.verticalAxis().fields,otherEncodings=resolver.optionalProjections(config,layerConfig),facetsAndProjections=resolver.getAllFields(),matrixGnContext={normalizedColumns:normalizedColumns,normalizedRows:normalizedRows,facetsAndProjections:facetsAndProjections,layers:layerConfig,fieldMap:fieldMap,otherEncodings:otherEncodings,encoders:encoders,facet:globalConfig.facet||{},axisFrom:globalConfig.axisFrom||{},selection:selection,resolver:resolver},cells={GeomCell:resolver.getCellDef(registry.GeomCell),AxisCell:resolver.getCellDef(registry.AxisCell),BlankCell:resolver.getCellDef(registry.BlankCell),TextCell:resolver.getCellDef(registry.TextCell)},isRowSizeEqual=group_utils_isDistributionEqual(normalizedRows),isColumnSizeEqual=group_utils_isDistributionEqual(normalizedColumns);resolver.colCells({}),resolver.rowCells({}),resolver.datamodelTransform(transform||{}),resolver.resetSimpleAxes();var newCacheMap={exitCellMap:resolver.cacheMaps().entryCellMap,entryCellMap:new Map};resolver.cacheMaps(newCacheMap);var valueCellContext={config:globalConfig,suppliedLayers:encoders.simpleEncoder.serializeLayerConfig(resolver.layerConfig()),resolver:resolver,cell:cells.GeomCell,encoder:encoders.simpleEncoder,newCacheMap:newCacheMap,detailFields:config.detail,retinalConfig:{color:config.color,size:config.size,shape:config.shape}},groupedModel=cell_creator_transformDataModel(datamodel,{facetsAndProjections:facetsAndProjections,suppliedLayers:valueCellContext.suppliedLayers,groupBy:groupBy},resolver),cellCreator=resolver.valueCellsCreator(valueCellContext),valueMatrixInfo=getMatrixModel(groupedModel,facetsAndProjections,cellCreator,globalConfig);!function removeExitCells(resolver){var _ref7,exitCells=resolver.cacheMaps().exitCellMap,store=resolver.store(),qualifiedStateProps=(_ref7=[]).concat.apply(_ref7,group_utils_toConsumableArray(visual_unit_VisualUnit.getQualifiedStateProps()).concat(group_utils_toConsumableArray(base_layer_BaseLayer.getQualifiedStateProps())));store.lockCommits(qualifiedStateProps),exitCells.forEach(function(placeholder){placeholder.remove()}),store.unlockCommits(qualifiedStateProps)}(resolver),resolver.cacheMaps().exitCellMap.clear(),resolver.valueMatrix(valueMatrixInfo.matrix);var _mutateAxesFromMap=function mutateAxesFromMap(cacheMaps,axes){var xAxes=null,yAxes=null,xAxesMap=cacheMaps.xAxesMap,yAxesMap=cacheMaps.yAxesMap,xAxisSet=axes.x,yAxisSet=axes.y;return xAxisSet&&xAxisSet.forEach(function(axisId){var xAxis=xAxesMap.get(axisId);(xAxes=xAxes||[]).push(xAxis)}),yAxisSet&&yAxisSet.forEach(function(axisId){var yAxis=yAxesMap.get(axisId);(yAxes=yAxes||[]).push(yAxis)}),{xAxes:xAxes,yAxes:yAxes}}(resolver.cacheMaps(),resolver.axes()),xAxes=_mutateAxesFromMap.xAxes,yAxes=_mutateAxesFromMap.yAxes;resolver.axes({x:xAxes,y:yAxes}),resolver.createUnits(componentRegistry,config);var _generateMatrices=function generateMatrices(context,matrices,cells,labelManager){var unitHeight=context.unitHeight,unitWidth=context.unitWidth,facetsAndProjections=context.facetsAndProjections,normalizedRows=context.normalizedRows,normalizedColumns=context.normalizedColumns,selection=context.selection,axisFrom=context.axisFrom,facet=context.facet,encoders=context.encoders,resolver=context.resolver,selectionObj=cell_creator_generatePlaceholders({fields:{rows:normalizedRows,columns:normalizedColumns},matrices:matrices,facetsAndProjections:facetsAndProjections,selection:selection,axisFrom:axisFrom,facet:facet,encoders:encoders,resolver:resolver},cells,labelManager),columnsPrimary=selectionObj.columnsPrimary,columnsSecondary=selectionObj.columnsSecondary,rowsPrimary=selectionObj.rowsPrimary,rowsSecondary=selectionObj.rowsSecondary,leftHeaders=selectionObj.leftHeaders,topHeaders=selectionObj.topHeaders,bottomHeaders=selectionObj.bottomHeaders,rightHeaders=selectionObj.rightHeaders,_map2=cell_creator_slicedToArray([rowsPrimary,rowsSecondary,columnsPrimary,columnsSecondary].map(function(d){return d?d.getObjects():[]}),4),rowPrime=_map2[0],rowSec=_map2[1],colPrime=_map2[2],colSec=_map2[3],_map4=cell_creator_slicedToArray([leftHeaders,rightHeaders].map(function(e){return e?e.getObjects().map(function(f){return f.getObjects()}):[]}),2),leftFacets=_map4[0],rightFacets=_map4[1],rowPriority=rowSec.length?1:-1;rowPrime.length&&rowPriority++;var colPriority=colSec.length?1:-1;colPrime.length&&colPriority++;var leftMatrix=leftFacets.length?leftFacets.map(function(d,i){return rowPrime[i]=rowPrime[i]?[rowPrime[i]]:[],[].concat(cell_creator_toConsumableArray(d),cell_creator_toConsumableArray(rowPrime[i]))}):rowPrime?rowPrime.map(function(d){return[d]}):[],rightMatrix=rowSec.length?rowSec.map(function(d,i){return[d].concat(cell_creator_toConsumableArray(rightFacets[i]||[]))}):rightFacets.length?rightFacets.map(function(d){return cell_creator_toConsumableArray(d)}):[],topMatrix=[];topHeaders&&topHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){topMatrix[i]=topMatrix[i]||[],topMatrix[i].push(x)})});colPrime.length&&topMatrix.push(colPrime);var bottomMatrix=[];colSec.length&&bottomMatrix.push(colSec);var currentBottomLength=bottomMatrix.length;bottomHeaders&&bottomHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){bottomMatrix[i+currentBottomLength]=bottomMatrix[i+currentBottomLength]||[],bottomMatrix[i+currentBottomLength].push(x)})});if(!leftMatrix.length&&!rightMatrix.length){var cell=new cells.BlankCell;cell.setAvailableSpace(unitWidth,unitHeight),leftMatrix=[[cell]]}if(!(topMatrix.length||bottomMatrix.length&&bottomMatrix[0].length)){var _cell=new cells.BlankCell;_cell.setAvailableSpace(unitWidth,unitHeight),bottomMatrix=[[_cell]]}return{rows:[leftMatrix,rightMatrix],columns:[topMatrix,bottomMatrix],selectionObj:selectionObj,colPriority:colPriority,rowPriority:rowPriority}}(matrixGnContext,{valuesMatrix:valueMatrixInfo,axesMatrix:resolver.axes()},cells,labelManager),rows=_generateMatrices.rows,columns=_generateMatrices.columns,selectionObj=_generateMatrices.selectionObj,rowPriority=_generateMatrices.rowPriority,colPriority=_generateMatrices.colPriority;return resolver.rowMatrix(rows),resolver.columnMatrix(columns),{rows:resolver.rowMatrix(),columns:resolver.columnMatrix(),values:resolver.valueMatrix(),isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,priority:{row:rowPriority,col:colPriority},selection:selectionObj,dataModels:{groupedModel:groupedModel,parentModel:datamodel}}},RESOLVER_PROPS={dependencies:{},units:{},datamodelTransform:{},layerConfig:{},matrixLayers:{},colCells:{},rowCells:{},rowMatrix:{},columnMatrix:{},valueMatrix:{},encoder:{},valueParser:{},data:{}};function matrix_resolver_slicedToArray(arr,i){return function matrix_resolver_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function matrix_resolver_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function matrix_resolver_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function matrix_resolver_toConsumableArray(arr){return function matrix_resolver_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?leftRows[0].map(blankCellCreator):[],right:rightRows.length>0?rightRows[0].map(blankCellCreator):[]},_map2=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return topCols.map(function(col,i){return i===topCols.length-1?headers[type]:footers[type]})}),2),topLeft=_map2[0],topRight=_map2[1];if(0===topCols.length){var _map4=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return bottomCols.map(function(col,i){return 0===i?headers[type]:footers[type]})}),2);bottomLeft=_map4[0],bottomRight=_map4[1]}else bottomLeft=bottomCols.map(function(){return leftRows.length>0?leftRows[0].map(blankCellCreator):[]}),bottomRight=bottomCols.map(function(){return rightRows.length>0?rightRows[0].map(blankCellCreator):[]});return lifeCycleManager.notify({client:[topLeft,topRight,bottomLeft,bottomRight],action:"initialized",formalName:"facet-headers"}),{topLeft:topLeft,topRight:topRight,bottomLeft:bottomLeft,bottomRight:bottomRight}}},{key:"getMatrices",value:function getMatrices(datamodel,config,componentRegistry,encoders){return cell_creator_computeMatrices({datamodel:datamodel,componentRegistry:componentRegistry,encoders:encoders,resolver:this},config)}},{key:"store",value:function store(){return arguments.length?(this._store=arguments.length<=0?void 0:arguments[0],this):this._store}},{key:"clear",value:function clear(){var cacheMaps=this._cacheMaps;for(var key in cacheMaps)cacheMaps[key].clear()}}]),MatrixResolver}();function value_matrix_defineProperties(target,props){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{},context=firebolt.context,type=context.constructor.type(),payload=config.payload,data=context.data(),metaData=context.metaData(),fieldType=metaData.getData().schema[0].type,propPayload={},sourceId=context._id;propPayload.action=action_behaviour_map_propagationBehaviourMap[action]||action,propPayload.sideEffects=propagationSideEffects[action],propPayload.sourceCanvas=context.canvasAlias();var isMutableAction=firebolt._actions.behavioural[propPayload.action].constructor.mutates();if(null===payload.criteria)propagationData=null;else{var entrySet=selectionSet.mergedEnter,values=data.filter(function(d){return-1!==entrySet.uids.indexOf(d.id)}).map(function(d){return d.rawVal});if("step"===type||"discrete"===type&&"measure"===fieldType){var field=Object.keys(payload.criteria||{})[0];propagationData=(values=data.filter(function(d){return-1!==entrySet.uids.indexOf(d.id)}).map(function(d){return d.range})).length?metaData.select(function(fields){for(var check=!1,i=0;i=values[i][0]&&fields[field].internalValue<=values[i][1]);i++);return check},{saveChild:!1}):null}else"gradient"===type?propagationData=getDataModelFromRange(metaData,payload.criteria):values.length?propagationData=function assembleModelFromIdentifiers(model,identifiers){var data,schema=[],fieldMap=model.getFieldsConfig();return identifiers.length?function(){for(var fields=identifiers[0],len=fields.length,i=0;i=drawingInfMeasure+offset?[axisScale.invert(drawingInfMeasure+offset-selectionBoxMeasure),axisScale.invert(drawingInfMeasure+offset)]:subjectStartPoint-offset1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-fadeout"),!0),classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)},brighten:function brighten(set){var config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-brighten"),!0),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-brighten"),!1)}}};function legend_highlighter_typeof(obj){return(legend_highlighter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_highlighter_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};(0,this._strategies[options.strategy||this._strategy])(selectionSet,this)}}],[{key:"formalName",value:function formalName(){return"highlighter"}}]),LegendHighlighter}(),legend_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},data:{},fieldName:{},legendContainer:{},measurement:{sanitization:function sanitization(context,value){var measurement=mergeRecursive(context._measurement,value);return["padding","border","margin"].forEach(function(space){measurement[space]=Math.min(measurement[space]>0?measurement[space]:0,.1*measurement.maxWidth,.1*measurement.maxHeight)}),measurement}},logicalSpace:{},metaData:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.resetLogicalSpace(),context.store().commit("range",value),value}},scale:{},smartTicks:{},store:{},title:{sanitization:function sanitization(context,value){return mergeRecursive(context._title||{},value)}},labelManager:{},minTickDistance:{},valueParser:{defaultValue:function defaultValue(val){return val}}},ALIGN_HORIZONTAL="horizontal",ALIGN_VERTICAL="vertical",DEFAULT_MEASUREMENT={height:30,width:30,maxWidth:1/0,maxHeight:1/0,padding:2,margin:2,border:1},LEGEND_TITLE={text:"",orientation:function orientation(pos){return"left"===pos||"right"===pos?"left":"center"}},legend_defaults_DEFAULT_CONFIG={classPrefix:"muze",borderStyle:"solid",borderColor:"rgba(0,0,0,0)",formatter:{bounds:{lower:"less than",upper:"more than"}},item:{text:{orientation:"right",width:10,formatter:function formatter(val,i,data,context){return context.valueParser()(val)}},icon:{className:"legend-icon",height:20,width:20,color:"rgba(0,0,0,.5)",type:"square"}}},defaults_ICON_MAP=function ICON_MAP(icon){return icon&&"string"==typeof icon?common_utils_getSymbol(icon):icon};function legend_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legend_helper_getScaleInfo=function getScaleInfo(scale){var scaleType=scale.constructor.type();return{scaleType:scaleType,domain:scale.uniqueValues(),steps:scale.config().stops||1,scaleFn:SCALE_FUNCTIONS[scaleType]}},legend_helper_getInterpolatedArrayData=function getInterpolatedArrayData(domainForLegend,scaleParams){var requiredWidth,requiredHeight,upperBound=domainForLegend[domainForLegend.length-1],minTickDiff=Math.ceil(domainForLegend[1]-domainForLegend[0]),maxTickDiff=Math.ceil(upperBound-domainForLegend[0]),alignment=scaleParams.alignment,smartLabelCalc=scaleParams.smartLabel,availableSpace=scaleParams.measures,minimumTickSize=scaleParams.minTickDistance,_smartLabelCalc$getOr=smartLabelCalc.getOriSize(upperBound),tickDimHeight=_smartLabelCalc$getOr.height,tickDimWidth=_smartLabelCalc$getOr.width;return Number.isInteger(upperBound)||(upperBound=upperBound.toFixed(2)),minTickDiff=minTickDiff<1?1:minTickDiff,requiredWidth=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*(tickDimWidth+minimumTickSize.width),requiredWidth-=Math.abs(maxTickDiff),requiredHeight=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*tickDimHeight,requiredHeight-=Math.abs(maxTickDiff),domainForLegend=function getcomputedArray(computationhelper,requiredMeasure,availableMeasure,domainForLegend){var currentTickValue,nextTickValue,upperBound=domainForLegend[domainForLegend.length-1],param=computationhelper.measureParam,smartLabelCalc=computationhelper.smartLabelCalc,pixelPerTick=availableMeasure[param]/upperBound;if(availableMeasure[param]>=requiredMeasure[param])return domainForLegend;currentTickValue=smartLabelCalc.getOriSize(domainForLegend[0])[param];for(var i=1;i0?titleSpace.height+effPadding:0,titleWidth=titleSpace.width+effPadding,labelSpaces=this.getLabelSpaces(effPadding,align),_computeItemSpaces=function computeItemSpaces(config,measures,data){var totalHeight=0,totalWidth=0,maxItemSpaces={width:0,height:0},effPadding=measures.effPadding,titleWidth=measures.titleWidth,labelSpaces=measures.labelSpaces,titleHeight=measures.titleHeight,maxWidth=measures.maxWidth,item=config.item,align=config.align,icon=item.icon,textOrientation=item.text.orientation,itemSpaces=[],iconSpaces=[],maxIconWidth=0;return labelSpaces.forEach(function(labelSpace,i){var itemSpace={width:0,height:0},iconSpace={width:0,height:0},datum=data[i]||{};"left"===textOrientation||"right"===textOrientation?(labelSpace.width+=effPadding,iconSpace.width=(datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),itemSpace.width=labelSpace.width+maxIconWidth,labelSpace.height=Math.max(labelSpace.height,icon.height)+effPadding,iconSpace.height=labelSpace.height,itemSpace.height=labelSpace.height):(labelSpace.width=Math.max(labelSpace.width,datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,iconSpace.width=labelSpace.width,itemSpace.width=labelSpace.width,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),labelSpace.height+=effPadding,iconSpace.height=icon.height+effPadding,itemSpace.height=labelSpace.height+iconSpace.height),"horizontal"===align?totalHeight=Math.max(totalHeight,itemSpace.height):(totalHeight+=itemSpace.height,totalWidth=Math.max(totalWidth,itemSpace.width,titleWidth)),maxItemSpaces={width:Math.max(itemSpace.width,maxItemSpaces.width),height:Math.max(itemSpace.height,maxItemSpaces.height)},itemSpaces.push(itemSpace),iconSpaces.push(iconSpace)}),itemSpaces.forEach(function(itemSpace,i){if("horizontal"===align)itemSpace.height=totalHeight,iconSpaces[i].width=maxIconWidth,"left"===textOrientation||"right"===textOrientation?(labelSpaces[i].height=totalHeight,iconSpaces[i].height=totalHeight,itemSpaces[i].width=labelSpaces[i].width+maxIconWidth):(labelSpaces[i].width=maxIconWidth,itemSpaces[i].width=maxIconWidth,labelSpaces[i].width=maxIconWidth),totalWidth=Math.max(totalWidth+itemSpaces[i].width);else if(itemSpace.width=Math.max(totalWidth,maxWidth),"top"===textOrientation||"bottom"===textOrientation)labelSpaces[i].width=totalWidth,iconSpaces[i].width=totalWidth,maxIconWidth=totalWidth;else{var labelWidth=labelSpaces[i].width,newLabelWidth=maxItemSpaces.width-maxIconWidth;iconSpaces[i].width=maxIconWidth,itemSpaces[i].width=labelSpaces[i].width+maxIconWidth,labelSpaces[i].width=Math.max(labelWidth,newLabelWidth),totalWidth=Math.max(totalWidth,itemSpace.width)}}),totalWidth=Math.ceil(Math.max(totalWidth,titleWidth))+effPadding,totalHeight+=titleHeight+effPadding,{totalHeight:totalHeight=Math.ceil(totalHeight),totalWidth:totalWidth,itemSpaces:itemSpaces,iconSpaces:iconSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth}}(this.config(),{effPadding:effPadding,titleWidth:titleWidth,labelSpaces:labelSpaces,titleHeight:titleHeight,maxWidth:maxWidth,maxHeight:maxHeight},this.data()),totalHeight=_computeItemSpaces.totalHeight,totalWidth=_computeItemSpaces.totalWidth,itemSpaces=_computeItemSpaces.itemSpaces,iconSpaces=_computeItemSpaces.iconSpaces,maxItemSpaces=_computeItemSpaces.maxItemSpaces,maxIconWidth=_computeItemSpaces.maxIconWidth;return this.measurement({width:Math.max(totalWidth,width)+effMargin+effBorder,height:Math.max(totalHeight,height)+effMargin+effBorder,labelSpaces:labelSpaces,iconSpaces:iconSpaces,itemSpaces:itemSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth,titleSpaces:{width:Math.min(maxWidth,this.measurement().width)-effMargin-effBorder,height:titleHeight}}),this}},{key:"getTitleSpace",value:function getTitleSpace(){return this._labelManager.setStyle(renderer_utils_getSmartComputedStyle(renderer_utils_selectElement("body"),"".concat(this.config().classPrefix,"-legend-title"))),this._labelManager.getOriSize(this.title().text?this.title().text:"")}},{key:"renderTitle",value:function renderTitle(container){var _this$measurement2=this.measurement(),titleSpaces=_this$measurement2.titleSpaces,border=_this$measurement2.border,padding=_this$measurement2.padding,width=_this$measurement2.width,maxWidth=_this$measurement2.maxWidth,_this$config3=this.config(),borderStyle=_this$config3.borderStyle,borderColor=_this$config3.borderColor;return function titleCreator(container,title,measurement,config){var titleWidth=Math.min(measurement.maxWidth,measurement.width),titleContainer=makeElement(container,"table",[1],"".concat(config.classPrefix,"-legend-title")).style("width","".concat(titleWidth,"px")).style("height","".concat(measurement.height,"px")).style("border-bottom","".concat(measurement.border,"px ").concat(config.borderStyle," ").concat(config.borderColor)).style("text-align",title.orientation instanceof Function?title.orientation(config.position):title.orientation);return makeElement(titleContainer,"td",[1],"".concat(config.classPrefix,"-legend-title-text")).style("width","".concat(titleWidth,"px")).style("max-width","".concat(titleWidth,"px")).style("height","100%").style("line-height",1).style("padding","".concat(measurement.padding,"px")).text(title.text).style("overflow-x","scroll").node()}(container,this.title(),{height:titleSpaces.height,width:width,maxWidth:maxWidth,border:border,padding:padding,borderStyle:borderStyle,borderColor:borderColor},this.config())}},{key:"render",value:function render(){var marginPosition,firebolt=this.firebolt(),_this$config4=this.config(),classPrefix=_this$config4.classPrefix,borderStyle=_this$config4.borderStyle,borderColor=_this$config4.borderColor,position=_this$config4.position,_this$measurement3=this.measurement(),maxWidth=_this$measurement3.maxWidth,maxHeight=_this$measurement3.maxHeight,width=_this$measurement3.width,height=_this$measurement3.height,margin=_this$measurement3.margin,border=_this$measurement3.border,legendContainer=makeElement(renderer_utils_selectElement(this.mount()),"div",[1],"".concat(classPrefix,"-legend-box"));switch(position){case"top":marginPosition="margin-".concat("bottom");break;case"left":marginPosition="margin-".concat("right");break;case"bottom":marginPosition="margin-".concat("top");break;default:marginPosition="margin-".concat("left")}return legendContainer.classed("".concat(classPrefix,"-legend-box-").concat(this._id),!0),legendContainer.style("float","left"),legendContainer.style("width","".concat(Math.min(maxWidth,width)-2*margin,"px")).style("height","".concat(Math.min(maxHeight,height)-2*margin,"px")).style("".concat(marginPosition),"".concat(margin,"px")).style("border","".concat(border,"px ").concat(borderStyle," ").concat(borderColor)),this.legendContainer(legendContainer.node()),this.renderTitle(legendContainer),firebolt.createSelectionSet(this.data().map(function(d){return d.id})),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){var fieldName=this.fieldName();return"measure"===this.metaData().getData().schema[0].type?function simple_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},fieldName,data.range):[[fieldName],[data.rawVal]]}}],[{key:"create",value:function create(dependencies){return new SimpleLegend(dependencies)}},{key:"defaultConfig",value:function defaultConfig(){return legend_defaults_DEFAULT_CONFIG}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENT}}]),SimpleLegend}();function position_config_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legendOrientation=(position_config_defineProperty(_legendOrientation={},"horizontal",{datasets:function datasets(data){return{row:[1],column:data}},itemContainerMeasures:function itemContainerMeasures(measurement){var itemSpaces=measurement.itemSpaces,width=measurement.width;return{row:{width:"".concat(width,"px"),padding:"".concat(0,"px")},column:{width:function width(d,i){return"".concat(itemSpaces[i].width,"px")},padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces;return{iconHeight:measurement.height,iconWidth:maxItemSpaces.width,stepPadding:{horizontal:!0,vertical:!1}}}}),position_config_defineProperty(_legendOrientation,"vertical",{datasets:function datasets(data){return{row:data,column:function column(d){return[d]}}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var width=measurement.width,padding=config.padding;return{row:{width:"".concat(width,"px"),padding:"".concat(padding,"px")},column:{width:"".concat(width,"px"),padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces,width=measurement.width;return{iconHeight:maxItemSpaces.height,iconWidth:width,stepPadding:{horizontal:!1,vertical:!0}}}}),_legendOrientation),positionConfig=(position_config_defineProperty(_positionConfig={},"left",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"right",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"top",legendOrientation.horizontal),position_config_defineProperty(_positionConfig,"bottom",legendOrientation.horizontal),_positionConfig),alignmentMap=(position_config_defineProperty(_alignmentMap={},"left","end"),position_config_defineProperty(_alignmentMap,"right","start"),position_config_defineProperty(_alignmentMap,"top","center"),position_config_defineProperty(_alignmentMap,"bottom","center"),_alignmentMap),itemStack=(position_config_defineProperty(_itemStack={},"left",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"right",["shape",VALUE]),position_config_defineProperty(_itemStack,"top",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"bottom",["shape",VALUE]),_itemStack),renderer_createLegendSkeleton=function createLegendSkeleton(context,container,classPrefix,data){var gradWidth,gradHeight,maxGradHeight,maxGradWidth,measurement=context.measurement(),margin=measurement.margin,border=measurement.border,titleSpaces=measurement.titleSpaces,width=measurement.width,height=measurement.height,maxWidth=measurement.maxWidth,maxHeight=measurement.maxHeight;gradHeight=height-(titleSpaces.height+2*margin+2*border),gradWidth=width-(2*margin+2*border),maxGradHeight=maxHeight-(titleSpaces.height+2*margin+2*border),maxGradWidth=maxWidth-(2*margin+2*border);var legendBody=makeElement(container,"div",[1],"".concat(classPrefix,"-legend-body"));return legendBody.select(".".concat(classPrefix,"-legend-overflow")).remove(),maxGradWidth&&maxGradWidth4)}(shape)?shape:defaults_ICON_MAP(shape).size(size)(),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}return d[1]="circle",createShape(d,elem,"circle")}(datum,makeElement(svg,"g",[datum[1]],"".concat(classPrefix,"-legend-icon")),datum[3]?"circle":"square",iconWidth,iconHeight).attr("transform","translate(".concat(maxIconWidth/2-padding," ").concat(iconHeight/2,")")).attr("fill",datum[2]||color):makeElement(svg,"rect",[datum[1]],"".concat(classPrefix,"-legend-icon")).attr("x",0).attr("y",0).attr("width",maxIconWidth).attr("height",iconHeight).attr("fill",datum[2]||color)};function discrete_legend_typeof(obj){return(discrete_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function discrete_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function discrete_legend_toConsumableArray(arr){return function discrete_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainForLegend.push(domain[1]),domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b}),domainForLegend=legend_helper_getInterpolatedArrayData(domainForLegend,scaleParams)):domainForLegend=legend_helper_getInterpolatedData(domain,steps-1,scaleParams),(domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=domainForLegend[i];return gradient_legend_defineProperty(_ref={},scaleType,"size"===scaleType?scale[scaleFn](ele)*scale.getScaleFactor():scale[scaleFn](Math.floor(ele))),gradient_legend_defineProperty(_ref,"value",+value.toFixed(2)),gradient_legend_defineProperty(_ref,"id",i),_ref}).filter(function(d){return null!==d.value})}},{key:"getLabelSpaces",value:function getLabelSpaces(effPadding){this.config({item:{text:{orientation:this.config().position}}});var axis=function createAxis(context){var data=context.data(),align=context.config().align,AxisCell=context._cells.AxisCell,newAxis=new continous_axis_ContinousAxis({id:"legend-".concat(context._id),orientation:align===ALIGN_VERTICAL?"right":"bottom",style:context._computedStyle,nice:!1,showAxisName:!1,tickValues:data.map(function(d){return d.value}),fixedBaseline:!1,labels:{rotation:null}},{labelManager:context._labelManager});return newAxis.domain(getGradientDomain(data)),newAxis.range([1,1]),(new AxisCell).source(newAxis).config({margin:{left:0,bottom:0,top:0,right:0}})}(this),axisSpace=axis.getLogicalSpace(),space={width:axisSpace.width-effPadding,height:axisSpace.height-effPadding},axisDomainLength=axis.source().domain().length,labelSpaces=new Array(axisDomainLength).fill(space);return this.axis(axis),labelSpaces}},{key:"getDrawingContext",value:function getDrawingContext(){return{svgContainer:this._legendGradientSvg}}},{key:"render",value:function render(){var firebolt=this.firebolt(),legendContainer=gradient_legend_get(gradient_legend_getPrototypeOf(GradientLegend.prototype),"render",this).call(this,this.mount());return function renderGradient(context,container){var gradHeight,gradWidth,_context$config2=context.config(),align=_context$config2.align,classPrefix=_context$config2.classPrefix,item=_context$config2.item,data=context.data(),_createLegendSkeleton=gradient_helper_createLegendSkeleton(container,classPrefix,data),legendContainer=_createLegendSkeleton.legendContainer,legendGradSvg=_createLegendSkeleton.legendGradSvg,legendGradCont=_createLegendSkeleton.legendGradCont,linearGradient=_createLegendSkeleton.linearGradient,legendRect=_createLegendSkeleton.legendRect,labelDim=context.axis().source().getAxisDimensions().tickDimensions,_context$measurement=context.measurement(),padding=_context$measurement.padding,margin=_context$measurement.margin,border=_context$measurement.border,titleSpaces=_context$measurement.titleSpaces,maxItemSpaces=_context$measurement.maxItemSpaces,maxHeight=_context$measurement.maxHeight,maxWidth=_context$measurement.maxWidth,height=_context$measurement.height,width=_context$measurement.width,gradientDimensions={};gradHeight=Math.floor(Math.min(height,maxHeight)-(titleSpaces.height+2*margin+2*border)),gradWidth=Math.floor(Math.min(width,maxWidth)-(2*margin+2*border)),align===ALIGN_HORIZONTAL?(gradientDimensions.height=item.icon.height,gradientDimensions.width=gradWidth-2*padding-labelDim.width/2,linearGradient.attr("x2","100%").attr("y1","0%"),legendGradCont.attr("transform","translate( ".concat(labelDim.width/2," 0)")),gradient_helper_renderAxis(context,legendContainer,gradHeight-item.icon.height-padding,gradWidth-2*padding-1),applyStyle(legendContainer,{height:"".concat(maxItemSpaces.height+border+padding,"px"),width:"".concat(Math.min(width,maxWidth),"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height),legendRect.attr("width",gradientDimensions.width-labelDim.width/2)):(gradientDimensions.height=gradHeight-2*padding-labelDim.height/2,gradientDimensions.width=item.icon.width,linearGradient.attr("x2","0%").attr("y1","100%"),legendGradCont.attr("transform","translate(0 ".concat(labelDim.height/2,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-2*padding-1,gradWidth-item.icon.width-2*padding),applyStyle(legendContainer,{height:"".concat(Math.min(height,maxHeight),"px"),width:"".concat(maxWidth,"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height-labelDim.height/2),legendRect.attr("width",gradientDimensions.width)),applyStyle(legendGradSvg,{height:"".concat(gradientDimensions.height,"px"),width:"".concat(gradientDimensions.width,"px")}),applyStyle(legendRect,{fill:"url(#linear-gradient)"}),legendGradSvg.attr("height",gradientDimensions.height),legendGradSvg.attr("width",gradientDimensions.width),context.measurement({gradientDimensions:gradientDimensions}),context._legendGradientSvg=legendGradSvg}(this,legendContainer),legendContainer.selectAll("div").style("float","left"),firebolt.mapActionsAndBehaviour(),firebolt.createSelectionSet(this.data().map(function(d){return d.id})),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){return[[this.fieldName()],[data.value]]}}],[{key:"create",value:function create(dependencies){return new GradientLegend(dependencies)}},{key:"type",value:function type(){return"gradient"}}]),GradientLegend}();function step_legend_typeof(obj){return(step_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function step_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function step_legend_toConsumableArray(arr){return function step_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&(domainBounds.upper=["".concat(formatter.bounds.upper," ").concat(steps[steps.length-1])])):domainLeg=legend_helper_getInterpolatedData(domain,steps,scaleParams),domainLeg=(domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=null;return i0&&void 0!==arguments[0]?arguments[0]:{},registrableComponents=this._registrableComponents,mergedPolicy=mergeRecursive(mergeRecursive({},function defaultPolicy(registrableComponents){var aliases=registrableComponents.map(function(comp){return comp.alias()});return{behaviours:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}}}}(registrableComponents)),policy);return registrableComponents.forEach(function(canvas){canvas.firebolt().crossInteractionPolicy(mergedPolicy)}),this}}]),ActionModel}()),TITLE_CONFIG={position:"top",align:"left",padding:4,className:"".concat("muze","-title-container")},SUB_TITLE_CONFIG={position:"top",align:"left",padding:16,maxLines:2,className:"".concat("muze","-subtitle-container")},MESSAGE_CONFIG={className:"".concat("muze","-message-container")};function local_options_typeof(obj){return(local_options_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function local_options_slicedToArray(arr,i){return function local_options_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function local_options_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function local_options_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function canvas_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var local_options_localOptions=(canvas_local_options_defineProperty(_localOptions={},"rows",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"columns",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"color",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"shape",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"size",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"detail",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"layers",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"transform",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object"}}),_localOptions),canvasOptions=(canvas_local_options_defineProperty(_canvasOptions={},"title",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref){var _ref2=local_options_slicedToArray(_ref,2),arg1=_ref2[0],arg2=_ref2[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref3){var _ref4=local_options_slicedToArray(_ref3,2),title=_ref4[0],titleConfig=_ref4[1],t=title;"string"!=typeof title&&title||(t=function t(){return title});var defConfig=mergeRecursive({},TITLE_CONFIG);return[t,mergeRecursive(defConfig,titleConfig)]}}}),canvas_local_options_defineProperty(_canvasOptions,"subtitle",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref5){var _ref6=local_options_slicedToArray(_ref5,2),arg1=_ref6[0],arg2=_ref6[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref7){var _ref8=local_options_slicedToArray(_ref7,2),subtitle=_ref8[0],subtitleConfig=_ref8[1],sub=subtitle;"string"!=typeof subtitle&&subtitle||(sub=function sub(){return subtitle});var defConfig=mergeRecursive({},SUB_TITLE_CONFIG);return[sub,mergeRecursive(defConfig,subtitleConfig)]}}}),_canvasOptions);function layoutComponent_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],isGridComponent=arguments.length>3&&void 0!==arguments[3]&&arguments[3],cut="",componentRatioWidth=1,leftHeight=0,leftWidth=0;if(!component)return{first:definitionModel,second:definitionModel};var _component$getLogical=component.getLogicalSpace(),componentHeight=_component$getLogical.height,componentWidth=_component$getLogical.width,position=component.position();"top"===position||"bottom"===position?(cut="h",componentRatioWidth=componentHeight/definitionModel.remainingHeight(),leftHeight=definitionModel.remainingHeight()-componentHeight,leftWidth=definitionModel.remainingWidth()):(cut="v",componentRatioWidth=componentWidth/definitionModel.remainingWidth(),leftWidth=definitionModel.remainingWidth()-componentWidth,leftHeight=definitionModel.remainingHeight()),leftOvercomponentRationWidth=1-componentRatioWidth,definitionModel.cut(cut);var firstLaneConfig={host:component.name(),cut:null,ratioWeight:componentRatioWidth,preferred:!isGridComponent&&isPreferred,lanes:[]},firstLane=new DefinitionModel(firstLaneConfig);firstLane.remainingHeight(componentHeight),firstLane.remainingWidth(componentWidth);var secondLane=new DefinitionModel({host:null,cut:null,ratioWeight:leftOvercomponentRationWidth,preferred:!isGridComponent&&!isPreferred,lanes:[]});return secondLane.remainingHeight(leftHeight),secondLane.remainingWidth(leftWidth),isPreferred?definitionModel.lanes([firstLane]):"top"===position||"left"===position?definitionModel.lanes([firstLane,secondLane]):definitionModel.lanes([secondLane,firstLane]),{first:firstLane,second:secondLane}}function tree_toConsumableArray(arr){return function tree_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?matrix[0]:matrix[1];return isTransposed?(joinedMatrix=matrix[0].length>0?utils_toConsumableArray(matrix[0]):[],joinedMatrix=matrix[1].length>0?[].concat(utils_toConsumableArray(joinedMatrix),utils_toConsumableArray(matrix[1])):joinedMatrix):joinedMatrix=joinedMatrix.map(function(row,rowIndex){var rowData=[];return matrix[0].length>0&&(rowData=utils_toConsumableArray(matrix[0][rowIndex])),matrix[1].length>0&&(rowData=[].concat(utils_toConsumableArray(rowData),utils_toConsumableArray(matrix[1][rowIndex]))),rowData}),joinedMatrix},utils_computeLogicalSpace=function computeLogicalSpace(){var item=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},config=arguments.length>1?arguments[1]:void 0,maxMeasures=arguments.length>2?arguments[2]:void 0,_config$isTransposed=config.isTransposed,isTransposed=void 0!==_config$isTransposed&&_config$isTransposed,unitMeasures=config.unitMeasures,_getMeasureInfo=function getMeasureInfo(isTransposed){return isTransposed?{firstMeasure:enums_constants_HEIGHT,secondMeasure:"width"}:{firstMeasure:"width",secondMeasure:enums_constants_HEIGHT}}(isTransposed),firstMeasure=_getMeasureInfo.firstMeasure,secondMeasure=_getMeasureInfo.secondMeasure,values=item.values,minMeasures=function getMinMeasures(isTransposed,unitMeasures){return isTransposed?{height:0,width:unitMeasures.width}:{height:unitMeasures.height,width:0}}(isTransposed,unitMeasures);if(values[0].key){var _logicalSpace,logicalSpace=(utils_defineProperty(_logicalSpace={},firstMeasure,0),utils_defineProperty(_logicalSpace,secondMeasure,0),_logicalSpace);return values.forEach(function(valueItem){var space=computeLogicalSpace(valueItem,config,maxMeasures);logicalSpace[firstMeasure]=Math.max(logicalSpace[firstMeasure],space[firstMeasure],minMeasures[firstMeasure]),logicalSpace[secondMeasure]+=+space[secondMeasure]}),item.space=logicalSpace,logicalSpace}return function getLogicalSpace(item,measures,minMeasures){var _ref,maxMeasure=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],firstMeasure=measures.firstMeasure,secondMeasure=measures.secondMeasure,firstMeasureValue=0,secondMeasureValue=0;return item.values.forEach(function(valueArray){var _item$space,fMeasure=0,sMeasure=0;valueArray.forEach(function(placeholder,colIndex){placeholder.setAvailableSpace();var space=placeholder.getLogicalSpace(),minSecondMeasure=placeholder.getMinMeasures(minMeasures[secondMeasure]);sMeasure=Math.max(sMeasure,+space[secondMeasure],minSecondMeasure),maxMeasure[colIndex]=Math.max(maxMeasure[colIndex]||0,space[firstMeasure]),fMeasure+=+maxMeasure[colIndex]}),secondMeasureValue+=sMeasure,firstMeasureValue=Math.max(firstMeasureValue,fMeasure),item.space=(utils_defineProperty(_item$space={},secondMeasure,Math.ceil(secondMeasureValue)),utils_defineProperty(_item$space,firstMeasure,Math.ceil(firstMeasureValue)),_item$space)}),utils_defineProperty(_ref={},secondMeasure,secondMeasureValue),utils_defineProperty(_ref,firstMeasure,firstMeasureValue),_ref}(item,{firstMeasure:firstMeasure,secondMeasure:secondMeasure},minMeasures,maxMeasures)},createMatrixEachLevel=function createMatrixEachLevel(item,isTransposed){if(item.values[0].key){var arr=[];return item.values.forEach(function(child){isTransposed?createMatrixEachLevel(child,isTransposed).forEach(function(e,i){var _arr$i;arr[i]=arr[i]||[],(_arr$i=arr[i]).push.apply(_arr$i,utils_toConsumableArray(e))}):arr.push.apply(arr,utils_toConsumableArray(createMatrixEachLevel(child,isTransposed)))}),item.matrix=arr,arr}return item.matrix=isTransposed?item.values[0].map(function(col,colIndex){return item.values.map(function(row){return row[colIndex]})}):item.values,item.matrix},extraCellsRemover=function extraCellsRemover(arr,beg,end){return arr.slice(beg,-end)},visual_matrix_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},maxMeasures:{},availableSpace:{},logicalSpace:{}},visual_matrix_default_config_defaultConfig={distribution:[],classPrefix:"muze",isDistributionEqual:!0,unitMeasures:{height:100,width:100,border:1},isTransposed:!1,facet:"primary",extraCellLengths:[]};function visual_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function visual_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VisualMatrix),this._lastLevelKey=0,this._primaryMatrix=matrix[0]||[],this._secondaryMatrix=matrix[1]||[],this._maxMeasures=[],this._availableSpace={},generateGetterSetters(this,visual_matrix_props_PROPS);var defCon=Object.assign({},this.constructor.defaultConfig());this.config(mergeRecursive(defCon,config)),this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],this.config())}return function visual_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&visual_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&visual_matrix_defineProperties(Constructor,staticProps),Constructor}(VisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"computeViewableSpaces",value:function computeViewableSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"removeExtraCells",value:function removeExtraCells(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getPriorityDistribution",value:function getPriorityDistribution(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"calculateDepth",value:function calculateDepth(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeSpaces",value:function redistributeSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeViewSpaces",value:function redistributeViewSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getCellDimensions",value:function getCellDimensions(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"primaryMatrix",value:function primaryMatrix(){return arguments.length?this:this._primaryMatrix}},{key:"secondaryMatrix",value:function secondaryMatrix(){return arguments.length?this:this._secondaryMatrix}},{key:"tree",value:function tree(){return arguments.length?this:this._tree}},{key:"createTree",value:function createTree(){var _createTree2=function createTree(context){var matrixTree={},lastLevelKey=0,facet="primary",nestFn=utils_nest(),keys=[],layoutMatrix=context._layoutMatrix,primaryMatrix=context.primaryMatrix(),secondaryMatrix=context.secondaryMatrix(),_context$config=context.config(),isTransposed=_context$config.isTransposed,breakPage=_context$config.breakPage;if(isTransposed){if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var _i2=0;_i20){for(var primaryMatrixLength=primaryMatrix.length,_i3=secondaryMatrix.length-1;_i3>0;_i3--)keys.push(_i3+primaryMatrixLength);keys.push(primaryMatrixLength),"primary"===facet&&(lastLevelKey=primaryMatrixLength)}var newMatrix;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),newMatrix=layoutMatrix[0].map(function(col,colIndex){return layoutMatrix.map(function(row){return row[colIndex]})}),matrixTree=nestFn.entries(newMatrix)}else{if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var i=0;i0){for(var keyLength=primaryMatrix.length>0?primaryMatrix[0].length:0,_i=secondaryMatrix[0].length-1;_i>0;_i--)keys.push(_i+keyLength);keys.push(keyLength),"primary"===facet&&(lastLevelKey=keyLength)}else lastLevelKey=primaryMatrix.length>0?primaryMatrix[0].length-1:0;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),matrixTree=nestFn.entries(layoutMatrix)}return{tree:matrixTree,lastLevelKey:lastLevelKey}}(this),tree=_createTree2.tree,lastLevelKey=_createTree2.lastLevelKey;return this._lastLevelKey=lastLevelKey,tree}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()}},{key:"setAvailableSpace",value:function setAvailableSpace(width,height){this.availableSpace({width:width,height:height});var tree=this.tree(),heightMeasures=this.populateMaxMeasures(enums_constants_HEIGHT,tree),widthMeasures=this.populateMaxMeasures("width",tree),depth=this.calculateDepth(widthMeasures,heightMeasures);return this.viewableMatrix=this.createViewPortMatrix(depth),this.viewableMeasures=this.redistributeSpaces(width,height),this}},{key:"populateMaxMeasures",value:function populateMaxMeasures(type,matrixTree){var _this=this,depth=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,measures=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(measures[depth]=Math.max(measures[depth]||0,matrixTree.space[type]),matrixTree.values){var childDepth=depth+1;matrixTree.values.forEach(function(child){child.space&&(measures=_this.populateMaxMeasures(type,child,childDepth,measures))})}return measures}},{key:"getViewableSpaces",value:function getViewableSpaces(){return this.viewableMeasures}},{key:"getViewableMatrices",value:function getViewableMatrices(){return this.viewableMatrix}},{key:"createViewPortMatrix",value:function createViewPortMatrix(depth){var arr=[];return function createMatrixInstances(){var arr=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],depth=arguments.length>1?arguments[1]:void 0,matrixInfo=arguments.length>2?arguments[2]:void 0,layout=arguments.length>3?arguments[3]:void 0,breakPointer=layout._breakPointer,isTransposed=layout.config().isTransposed,tree=matrixInfo.tree,layoutMatrix=matrixInfo.layoutMatrix;if(0===depth){var brokenMatrix=function breakMatrix(matrix,isTransposed,breakPointer){var primaryMatrix=[],secondaryMatrix=[];return isTransposed?matrix.forEach(function(row,rowIndex){rowIndex>=breakPointer?secondaryMatrix.push(row):primaryMatrix.push(row)}):matrix.forEach(function(row,rowIndex){row.forEach(function(column,columnIndex){columnIndex>=breakPointer?(secondaryMatrix[rowIndex]=secondaryMatrix[rowIndex]||[],secondaryMatrix[rowIndex].push(column)):(primaryMatrix[rowIndex]=primaryMatrix[rowIndex]||[],primaryMatrix[rowIndex].push(column))})}),[primaryMatrix,secondaryMatrix]}(tree.matrix,isTransposed,breakPointer);return arr.push({matrix:tree.matrix,primaryMatrix:brokenMatrix[0],secondaryMatrix:brokenMatrix[1],space:tree.space}),arr}var nextLevel=depth-1;return tree.values.forEach(function(e){createMatrixInstances(arr,nextLevel,{tree:e,layoutMatrix:layoutMatrix},layout)}),arr}(arr,depth,this.removeExtraCells(),this),arr}}],[{key:"defaultConfig",value:function defaultConfig(){return visual_matrix_default_config_defaultConfig}}]),VisualMatrix}();function row_matrix_typeof(obj){return(row_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function row_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function row_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RowVisualMatrix),(_this=row_matrix_possibleConstructorReturn(this,row_matrix_getPrototypeOf(RowVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length>0?matrix[0][0].length:0,_this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],_this.config()),_this._tree={key:ROW_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function row_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&row_matrix_setPrototypeOf(subClass,superClass)}(RowVisualMatrix,visual_matrix_VisualMatrix),function row_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&row_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&row_matrix_defineProperties(Constructor,staticProps),Constructor}(RowVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!1),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),widths=_this2$getCellDimensi.widths,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=[height,height],columnMeasures=widths;return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=extraCellsRemover(tree.matrix,begCellLen,endCellLen),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var remainingAvailWidth,remainingWidth,cWidths=[],conditions=[],maxPrioritySpace=0,matrix=measures.matrix,availableWidth=measures.width,maxWidths=measures.maxMeasures,currentWidth=measures.maxWidth,height=measures.height,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length?this.primaryMatrix()[0].length:0,dist=[];remainingAvailWidth=availableWidth,remainingWidth=currentWidth,(conditions=2===priority?[primaryMatrixLength-1,primaryMatrixLength]:0===priority?[primaryMatrixLength-1]:[primaryMatrixLength]).forEach(function(i){dist[i]=maxWidths[i],maxPrioritySpace+=maxWidths[i],remainingAvailWidth-=dist[i],remainingWidth-=dist[i]}),matrix[0].forEach(function(e,i){-1===conditions.indexOf(i)&&(dist[i]=remainingAvailWidth*(maxWidths[i]/remainingWidth))}),matrix.forEach(function(row){return row.forEach(function(col,cIdx){-1===conditions.indexOf(cIdx)?(col.setAvailableSpace(dist[cIdx],height),cWidths[cIdx]=Math.max(cWidths[cIdx]||0,Math.floor(col.getLogicalSpace().width))):cWidths[cIdx]=0})});var prioritySpace=availableWidth-cWidths.reduce(function(t,n){return t+n});return prioritySpace<0?cWidths=cWidths.map(function(){return 0}):conditions.forEach(function(i){cWidths[i]=Math.floor(prioritySpace*(dist[i]/maxPrioritySpace||1))}),cWidths}},{key:"calculateDepth",value:function calculateDepth(widthMeasures,heightMeasures){var i,height=this.availableSpace().height;for(i=0;i0?logicalWidths:maxMeasures.map(function(){return 0}),rHeights=function getDistributedHeight(context){var heightWithoutGutter,distSum=0,gutterSum=0,isTransposed=context.isTransposed,distribution=context.distribution,availableHeight=context.availableHeight,height=context.height,isDistributionEqual=context.isDistributionEqual,gutter=context.gutter,matrix=context.matrix,cIdx=context.cIdx;distribution&&void 0!==distribution[0]&&(distSum=distribution.reduce(function(t,n){return t+=n})),gutter&&void 0!==gutter[0]&&(gutterSum=gutter.reduce(function(t,n){return t+=n})),heightWithoutGutter=availableHeight-Math.floor(availableHeight*gutterSum);var colLen=matrix.length;return matrix.map(function(row,rIdx){var space=row[cIdx].getLogicalSpace().height,distHeight=space+space/height*(heightWithoutGutter-height);return isTransposed||(distribution.length>0&&colLen===distribution.length?distHeight=heightWithoutGutter*distribution[rIdx]/distSum:(isDistributionEqual||0===context.height)&&(distHeight=heightWithoutGutter/colLen)),Math.floor(distHeight)})}({matrix:matrix,cIdx:this._lastLevelKey,height:mHeight,availableHeight:height,isDistributionEqual:isDistributionEqual,distribution:distribution,isTransposed:isTransposed,gutter:gutter}),maxWidths.length>0&&(cWidths=cWidths.map(function(e,i){return Math.max(e,maxWidths[0][i]||0)})),maxWidths.push(cWidths);for(var x=0;x=breakPointer&&(columnWidths[1][cIdx-breakPointer]=colWidth,widths[1]=(widths[1]||0)+colWidth),cIdx===_this4._lastLevelKey&&(rowHeights[0][rIdx]=colHeight,rowHeights[1][rIdx]=colHeight)})}),{heights:[0,0],widths:widths,rowHeights:rowHeights,columnWidths:columnWidths}}}]),RowVisualMatrix}();function column_matrix_typeof(obj){return(column_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function column_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function column_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ColumnVisualMatrix),(_this=column_matrix_possibleConstructorReturn(this,column_matrix_getPrototypeOf(ColumnVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length,_this._tree={key:COLUMN_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function column_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&column_matrix_setPrototypeOf(subClass,superClass)}(ColumnVisualMatrix,visual_matrix_VisualMatrix),function column_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&column_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&column_matrix_defineProperties(Constructor,staticProps),Constructor}(ColumnVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!0),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height,width=measures.width;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i,height:height},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),heights=_this2$getCellDimensi.heights,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=heights,columnMeasures=[width,width];return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=tree.matrix.map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var height=measures.height,maxHeights=measures.maxHeights,remainingHeight=height,heightDist=[],conditions=[],divider=2,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length;return 2===priority?(conditions=[primaryMatrixLength-1,primaryMatrixLength],divider=2):(conditions=0===priority?[primaryMatrixLength-1]:[primaryMatrixLength],divider=1),maxHeights.forEach(function(heights,index){-1===conditions.indexOf(index)&&(heightDist[index]=heights,remainingHeight-=heights)}),remainingHeight<0?heightDist=heightDist.map(function(){return 0}):conditions.forEach(function(condition){heightDist[condition]=Math.min(maxHeights[condition],remainingHeight/divider)}),heightDist}},{key:"calculateDepth",value:function calculateDepth(widthMeasures){var j,width=this.availableSpace().width;for(j=0;j0)distWidth=availableWidth*distribution[colIndex]/distSum;else if(isDistributionEqual||0===width){var rowLen=row.length;distWidth=availableWidth/rowLen}return Math.floor(distWidth)})}({row:matrix[this._lastLevelKey],width:mWidth,availableWidth:width},this.config());matrix.forEach(function(row,rIdx){return row.forEach(function(col,cIdx){var oldLogicalSpace=col.getLogicalSpace();col.setAvailableSpace(cWidths[cIdx]-borderWidth,oldLogicalSpace.height),rHeights[rIdx]=Math.max(rHeights[rIdx]||0,Math.floor(col.getLogicalSpace().height))})}),maxHeights.length>0&&(rHeights=rHeights.map(function(e,i){return Math.max(e,maxHeights[0][i])})),maxHeights.push(rHeights);for(var x=0;x=breakPointer&&(rowHeights[1][rIdx-breakPointer]=colHeight,heights[1]=(heights[1]||0)+colHeight),rIdx===_this4._lastLevelKey&&(columnWidths[0][cIdx]=colWidth,columnWidths[1][cIdx]=colWidth)})}),{heights:heights,widths:[0,0],rowHeights:rowHeights,columnWidths:columnWidths}}}]),ColumnVisualMatrix}();function layout_helper_toConsumableArray(arr){return function layout_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);imaxMeasure&&layout.scrollInfo(computations_defineProperty({},scrollType,!0)),Math.max(maxMeasure,actualMeasure)}}(layout,paginationDetailsMap[matrixType],relatedMaxMeasure,buffer)},computations_getMatrixHeightDetails=function getMatrixHeightDetails(layout,columnMatrixWidth){var height=layout.measurement().height,buffer=layout.config().buffer,_getHeightRequiredByC=function getHeightRequiredByColMatrix(layout,columnMatrixWidth){var height=layout.measurement().height,columnMatrix=layout.columnMatrix(),maxColumnMatrixHeight=Math.min(columnMatrix.getLogicalSpace().height,height/2);columnMatrix.setAvailableSpace(columnMatrixWidth,maxColumnMatrixHeight);var columnViewSpace=columnMatrix.getViewableSpaces()[layout.config().columnPointer];return{columnMatrixHeight:columnViewSpace.height.primary+columnViewSpace.height.secondary,maxColumnMatrixHeight:maxColumnMatrixHeight}}(layout,columnMatrixWidth),columnMatrixHeight=_getHeightRequiredByC.columnMatrixHeight,maxColumnMatrixHeight=_getHeightRequiredByC.maxColumnMatrixHeight,maxHeightAvailableForRowMatrix=height-Math.min(maxColumnMatrixHeight,columnMatrixHeight);return{columnMatrixHeight:columnMatrixHeight,maxColumnMatrixHeight:maxColumnMatrixHeight,rowMatrixHeight:paginationMeasureGetter(layout,"row",maxHeightAvailableForRowMatrix,buffer),maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix}},bufferCondition={isScroll:!0,pagination:"scroll"},computations_getActualBufferFromConfig=function getActualBufferFromConfig(layout){var buffer=layout.config().buffer,_map2=computations_slicedToArray([enums_constants_HORIZONTAL,enums_constants_VERTICAL].map(function(type){return function getBufferFromCondition(layout,type){var scrollInfo=layout.scrollInfo(),currentBufferType={pagination:layout.config().pagination,isScroll:scrollInfo[type]};return Object.keys(bufferCondition).every(function(e){return bufferCondition[e]===currentBufferType[e]})}(layout,type)?buffer:0}),2);return{horizontalBuffer:_map2[0],verticalBuffer:_map2[1]}},computations_computeLayoutMeasurements=function computeLayoutMeasurements(layout){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_getMatrixWidthDetail=function getMatrixWidthDetails(layout){var rowMatrix=layout.rowMatrix(),width=layout.measurement().width,_layout$config3=layout.config(),border=_layout$config3.border,buffer=_layout$config3.buffer,borderWidth=border.width,rowMatrixWidth=getMatrixMeasurement(rowMatrix,"width"),maxRowMatrixWidth=Math.min(rowMatrixWidth+buffer,width/2),maxWidthAvailableForColumnMatrix=width-maxRowMatrixWidth-borderWidth;return{rowMatrixWidth:rowMatrixWidth,maxRowMatrixWidth:maxRowMatrixWidth,columnMatrixWidth:paginationMeasureGetter(layout,"column",maxWidthAvailableForColumnMatrix,0),maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}}(layout),rowMatrixWidth=_getMatrixWidthDetail.rowMatrixWidth,maxRowMatrixWidth=_getMatrixWidthDetail.maxRowMatrixWidth,maxWidthAvailableForColumnMatrix=_getMatrixWidthDetail.maxWidthAvailableForColumnMatrix,columnMatrixWidth=_getMatrixWidthDetail.columnMatrixWidth,_getMatrixHeightDetai=computations_getMatrixHeightDetails(layout,columnMatrixWidth),columnMatrixHeight=_getMatrixHeightDetai.columnMatrixHeight,rowMatrixHeight=_getMatrixHeightDetai.rowMatrixHeight,maxHeightAvailableForRowMatrix=_getMatrixHeightDetai.maxHeightAvailableForRowMatrix,_getActualBufferFromC=computations_getActualBufferFromConfig(layout),horizontalBuffer=_getActualBufferFromC.horizontalBuffer,verticalBuffer=_getActualBufferFromC.verticalBuffer;rowMatrix.setAvailableSpace(maxRowMatrixWidth-verticalBuffer,rowMatrixHeight-horizontalBuffer);var rowViewableSpaces=rowMatrix.getViewableSpaces(),columnViewableSpaces=columnMatrix.getViewableSpaces();return setViewSpaces(layout,"row",rowViewableSpaces),setViewSpaces(layout,"column",columnViewableSpaces),function setValueMatrixMeasurements(layout,rowViewableSpaces,columnViewableSpaces){var _ref,_ref2,_ref3,_ref4,_ref5,centerMatrix=layout.centerMatrix(),border=layout.config().border,matrices=layout.matrices(),top=matrices.top,bottom=matrices.bottom,borderWidth=border.width,rowHeights=(_ref=[]).concat.apply(_ref,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.rowHeights.primary}))),rowWidthsPrimary=(_ref2=[]).concat.apply(_ref2,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.primary}))),rowWidthsSecondary=(_ref3=[]).concat.apply(_ref3,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.secondary}))),columnWidths=(_ref4=[]).concat.apply(_ref4,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.columnWidths.primary}))),columnHeightsPrimary=columnViewableSpaces[0].rowHeights.primary,columnHeightsSecondary=(_ref5=[]).concat.apply(_ref5,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.rowHeights.secondary})));centerMatrix.forEach(function(matrix,rIdx){matrix.forEach(function(placeholder,cIdx){placeholder.setAvailableSpace(columnWidths[cIdx]-borderWidth,rowHeights[rIdx]-borderWidth)})}),computations_setAvailableSpace(top[0],rowWidthsPrimary,columnHeightsPrimary),computations_setAvailableSpace(top[2],rowWidthsSecondary,columnHeightsPrimary),computations_setAvailableSpace(bottom[0],rowWidthsPrimary,columnHeightsSecondary),computations_setAvailableSpace(bottom[2],rowWidthsSecondary,columnHeightsSecondary)}(layout,rowViewableSpaces,columnViewableSpaces),{rowMatrixHeight:rowMatrixHeight-horizontalBuffer,rowMatrixWidth:rowMatrixWidth-verticalBuffer,maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix-horizontalBuffer,columnMatrixHeight:columnMatrixHeight,columnMatrixWidth:columnMatrixWidth,maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}},measureSum=function measureSum(measureArr){return measureArr.reduce(function(total,measure){return total+measure},0)};function layout_typeof(obj){return(layout_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function layout_defineProperties(target,props){for(var i=0;i0&&(leftMatrix=[].concat(layout_helper_toConsumableArray(topLeft),layout_helper_toConsumableArray(leftRows),layout_helper_toConsumableArray(bottomLeft))),rightRows.length>0&&(rightMatrix=[].concat(layout_helper_toConsumableArray(topRight),layout_helper_toConsumableArray(rightRows),layout_helper_toConsumableArray(bottomRight))),topColumns.length>0&&topColumns[0].length>0&&(topMatrix=topColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(topLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(topRight[i]))})),bottomColumns.length>0&&bottomColumns[0].length>0&&(bottomMatrix=bottomColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(bottomLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(bottomRight[i]))})),context.rowMatrix(new row_matrix_RowVisualMatrix([leftMatrix,rightMatrix],{isDistributionEqual:isRowSizeEqual,distribution:distribution.rows,gutter:gutterSpace.rows,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.row,breakPage:breakPage.rows.map(function(e){return e+Math.max(topLeft.length,topRight.length)}),extraCellLengths:[topLeft.length,bottomLeft.length]})),begColCells=topLeft.length>0?topLeft[0].length:bottomLeft.length>0?bottomLeft[0].length:0,endColCells=topRight.length>0?topRight[0].length:bottomRight.length>0?bottomRight[0].length:0,context.columnMatrix(new column_matrix_ColumnVisualMatrix([topMatrix,bottomMatrix],{isDistributionEqual:isColumnSizeEqual,distribution:distribution.columns,gutter:gutterSpace.columns,isTransposed:!0,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.col,breakPage:breakPage.columns,extraCellLengths:[begColCells,endColCells]})),context.centerMatrix(valueMatrix),matrices}(this,_matrices),this):layout_get(layout_getPrototypeOf(GridLayout.prototype),"matrices",this).call(this,_matrices)}},{key:"triggerReflow",value:function triggerReflow(){this.scrollInfo({horizontal:!1,vertical:!1});var _computeLayoutMeasure=computations_computeLayoutMeasurements(this),maxHeightAvailableForRowMatrix=_computeLayoutMeasure.maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix=_computeLayoutMeasure.maxWidthAvailableForColumnMatrix;return this.setViewInformation(maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix),this}},{key:"gotoPage",value:function gotoPage(type,pageNumber){var pageType=type.toLowerCase(),totalPages=this.viewInfo().viewMatricesInfo["".concat(pageType,"Pages")],pointer=Math.min(Math.max(1,pageNumber),totalPages);return this.config(function layout_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},"".concat(pageType,"Pointer"),pointer-1)),this.setViewInformation(),this.renderGrid(),this}},{key:"pages",value:function pages(type){var viewMatricesInfo=this.viewInfo().viewMatricesInfo,pageType=type.toLowerCase();return{totalPages:viewMatricesInfo["".concat(pageType,"Pages")],currentPage:this.config()["".concat(pageType,"Pointer")]+1}}},{key:"viewInfo",value:function viewInfo(){return arguments.length?(this._viewInfo=arguments.length<=0?void 0:arguments[0],this):this._viewInfo}},{key:"scrollInfo",value:function scrollInfo(){return arguments.length?(this._scrollInfo=mergeRecursive(this._scrollInfo,arguments.length<=0?void 0:arguments[0]),this):this._scrollInfo}},{key:"setViewInformation",value:function setViewInformation(maxRowHeight,maxColWidth){var _this$config2=this.config(),rowPointer=_this$config2.rowPointer,columnPointer=_this$config2.columnPointer,border=_this$config2.border,viewMatricesInfo=function getViewMatrices(layout,rowPointer,columnPointer){for(var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),centerMatrix=layout.centerMatrix(),matrices=layout.matrices(),rowMatrices=rowMatrix.getViewableMatrices(),columnMatrices=columnMatrix.getViewableMatrices(),centralMatrixPointer={row:0,column:0},i=rowPointer-1;i>=0;i--){var length=Math.max(rowMatrices[i].primaryMatrix.length,rowMatrices[i].secondaryMatrix.length);centralMatrixPointer.row+=length}for(var _i=columnPointer-1;_i>=0;_i--){var matrix=columnMatrices[_i],primaryMatrix=matrix.primaryMatrix,secondaryMatrix=matrix.secondaryMatrix,_length=Math.max(primaryMatrix[0]?primaryMatrix[0].length:0,secondaryMatrix[0]?secondaryMatrix[0].length:0);centralMatrixPointer.column+=_length}matrices.top[1]=columnMatrices[columnPointer].primaryMatrix,matrices.bottom[1]=columnMatrices[columnPointer].secondaryMatrix,matrices.center[0]=rowMatrices[rowPointer].primaryMatrix,matrices.center[2]=rowMatrices[rowPointer].secondaryMatrix;var rowMatrixLen=Math.max(matrices.center[0].length,matrices.center[2].length),columnMatrixLen=Math.max(matrices.top[1][0]?matrices.top[1][0].length:0,matrices.bottom[1][0]?matrices.bottom[1][0].length:0);return matrices.center[1]=centerMatrix.slice(centralMatrixPointer.row,centralMatrixPointer.row+rowMatrixLen).map(function(matrix){return matrix.slice(centralMatrixPointer.column,centralMatrixPointer.column+columnMatrixLen)}),{matrices:matrices,rowPages:rowMatrices.length,columnPages:columnMatrices.length}}(this,rowPointer,columnPointer),layoutDimensions=function getViewMeasurements(layout,maxRowHeight,maxColWidth){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_layout$config=layout.config(),columnPointer=_layout$config.columnPointer,rowPointer=_layout$config.rowPointer,rowSpaces=rowMatrix.getViewableSpaces()[rowPointer],colSpaces=columnMatrix.getViewableSpaces()[columnPointer],rowHeights=rowSpaces.rowHeights,rowMatrixWidth=rowSpaces.width,columnWidths=colSpaces.columnWidths,columnMatrixHeight=colSpaces.height,leftWidth=rowMatrixWidth.primary,rightWidth=rowMatrixWidth.secondary,topHeight=columnMatrixHeight.primary,bottomHeight=columnMatrixHeight.secondary,centerHeight=measureSum(rowHeights.primary),centerWidth=measureSum(columnWidths.primary),viewWidth=[leftWidth,Math.min(centerWidth,maxColWidth),rightWidth],viewHeight=[topHeight,Math.min(centerHeight,maxRowHeight),bottomHeight];return{viewWidth:viewWidth,viewHeight:viewHeight,actualCenterMeasures:{height:centerHeight,width:centerWidth},totalMeasures:{width:measureSum(viewWidth),height:measureSum(viewHeight)},unitHeights:rowHeights,unitWidths:columnWidths}}(this,maxRowHeight,maxColWidth);return layoutDimensions.border=border,this.viewInfo({viewMatricesInfo:viewMatricesInfo,layoutDimensions:layoutDimensions}),this}}],[{key:"defaultViewInfo",value:function defaultViewInfo(){return Object.assign({},{layoutDimensions:{border:this.defaultConfig().border,viewHeight:[0,0,0],viewWidth:[0,0,0]},viewMatricesInfo:{columnPages:0,rowPages:0,matrices:{top:[],center:[],bottom:[]}}})}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENTS}},{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIGURATION}},{key:"create",value:function create(){return new GridLayout(null,null,this.defaultMeasurement(),this.defaultConfig())}}]),GridLayout}();function border_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _matrixSpanGeneratorM,_spanApplierMap,borderMap=(border_helper_defineProperty(_borderMap={},"".concat("top","-").concat("left"),null),border_helper_defineProperty(_borderMap,"".concat("top","-").concat("middle"),"column"),border_helper_defineProperty(_borderMap,"".concat("top","-").concat("right"),null),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("left"),"row"),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("middle"),"center"),border_helper_defineProperty(_borderMap,"".concat("center","-").concat("right"),"row"),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("left"),null),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("middle"),"column"),border_helper_defineProperty(_borderMap,"".concat("bottom","-").concat("right"),null),_borderMap),border_helper_specificBorderApplier=function specificBorderApplier(borderTypes,showBorders,cells,borderInfo){var color=borderInfo.color,width=borderInfo.width,style=borderInfo.style,borderStyle="".concat(width,"px ").concat(style);borderTypes.forEach(function(borderType){!function applySpecificBorder(cells,color,type,style){cells.style("border-".concat(type),"".concat(style," ").concat(color))}(cells,showBorders[borderType]?color:"rgba(0,0,0,0)",borderType,borderStyle)})},border_helper_applyBorders=function applyBorders(cells,border,row,column){var borderApplierFn=function borderApplier(cells,borderInfo){var showRowBorders=borderInfo.showRowBorders,showColBorders=borderInfo.showColBorders,showValueBorders=borderInfo.showValueBorders;return{row:function row(){return border_helper_specificBorderApplier(["top","bottom"],showRowBorders,cells,borderInfo)},column:function column(){return border_helper_specificBorderApplier(["left","right"],showColBorders,cells,borderInfo)},center:function center(){return border_helper_specificBorderApplier(["left","right","top","bottom"],showValueBorders,cells,borderInfo)}}}(cells,border),borderMapVal=borderMap["".concat(ROW_MATRIX_INDEX[VIEW_INDEX[row]],"-").concat(COLUMN_MATRIX_INDEX[column])];borderMapVal&&borderApplierFn[borderMapVal]()};function span_maker_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var orderMaker=function orderMaker(arr){return Array.from(Array(arr.length).keys())},nestByStack=function nestByStack(stack,updateArr){var optionalParams=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},order=optionalParams.order,keyFn=optionalParams.keyFn,arr=updateArr.slice(),currStack=stack.slice(),prevStack=currStack.slice();if(order=order||Array.from(Array(arr.length).keys()),keyFn=keyFn||function(v){return v},0===currStack.length){var _newArr=[];return order.forEach(function(e){_newArr.push(arr[e])}),{prevStack:prevStack,currStack:arr,arr:_newArr}}for(var arrVal="",stackVal="",newArr=[],i=order.length-1;i>=0;i--){var currElemIndex=order[i];if((arrVal+=keyFn(arr[currElemIndex]))===(stackVal+=keyFn(currStack[currElemIndex])))newArr[currElemIndex]=null;else{stackVal="";for(var j=i;j0&&void 0!==arguments[0]?arguments[0]:1,placeholder=arguments.length>1?arguments[1]:void 0,config=arguments.length>2?arguments[2]:void 0,index=arguments.length>3?arguments[3]:void 0,height=placeholder.availHeight(),width=placeholder.availWidth(),borderWidth=config.border.width,unitWidths=config.dimensions.unitWidths,col=index.col;return span_maker_defineProperty(_ref={},"rowSpan",function(){placeholder.setAvailableSpace(width,height*span),1===span&&renderer_utils_selectElement(this).style("height","".concat(height*span+borderWidth,"px"))}),span_maker_defineProperty(_ref,"colSpan",function(){var primaryUnitWidth=unitWidths.primary[col];if(span>1){for(var cumulativeWidth=0,i=col;i0&&void 0!==arguments[0]?arguments[0]:0}},{key:"type",get:function get(){return"simple"}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),SimpleCell}();function enums_defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var visual_cell_src_props_PROPS,enums_defaults_DEFAULT_CONFIG=(enums_defaults_defineProperty(_DEFAULT_CONFIG={},"margin",(enums_defaults_defineProperty(_CONSTANTS$MARGIN={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$MARGIN)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"spaceFixer",2),enums_defaults_defineProperty(_DEFAULT_CONFIG,"isOffset",!1),enums_defaults_defineProperty(_DEFAULT_CONFIG,"verticalAlign",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"textAlign","center"),enums_defaults_defineProperty(_DEFAULT_CONFIG,"show",!0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"maxLines",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"minCharacters",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"rotation",null),_DEFAULT_CONFIG);function visual_cell_src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_PROPS={mount:{},availHeight:{},availWidth:{},config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config,value)}},logicalSpace:{},minSpacing:{},source:{}},packages_visual_cell_src_props_PROPS=(visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS={},GEOM,mergeRecursive({data:{},caption:{},config:{},axes:{},facetByFields:{},fields:{},transform:{},layerDef:{},detailFields:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_TEXT,mergeRecursive({smartText:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_AXIS,DEFAULT_PROPS),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,BLANK,DEFAULT_PROPS),visual_cell_src_props_PROPS);function axis_cell_typeof(obj){return(axis_cell_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function axis_cell_defineProperties(target,props){for(var i=0;i(availWidth||0)&&maxLines&&(space.height=space.oriTextHeight*maxLines),availWidth&&availWidth":">",'"':""","'":"'","/":"/"};return"".concat(str).replace(/[&<>"'/]/g,function(match){return htmlEscapes[match]})}(rawContent()):rawContent()},createHeading=function createHeading(config,type,labelManager,prevCell){return config?function headerCreator(config,cellType,labelManager,prevCell){var margin={},content=config.content,classPrefix=config.classPrefix,maxLines=config.maxLines,cell=prevCell||new src_text_cell({type:"title"===cellType?"header":"text",className:"".concat(classPrefix,"-").concat(cellType,"-cell")},{labelManager:labelManager}).config({maxLines:maxLines}).minSpacing({width:0,height:0});return cell.source(content),cell._minTickDiff={height:0,width:0},margin=config.position===src_constants_TOP?{top:0,bottom:config.padding}:{top:config.padding,bottom:0},cell.config({margin:margin}),{height:cell.getLogicalSpace().height,cell:cell}}(config,type,labelManager,prevCell):""},legend_maker_legendInitializer=function legendInitializer(legendConfig,canvas,measurement,prevLegends){var legends=[],height=measurement.height,width=measurement.width,headerHeight=measurement.headerHeight,position=legendConfig.position,align=legendConfig.align,legendInfo=function legendCreator(canvas){var LegendCls,dataset=[],axes=canvas.getRetinalAxes();return Object.entries(axes).forEach(function(axisInfo){var scale=axisInfo[1][0],scaleType=axisInfo[0],scaleProps=canvas[scaleType]();if(scaleProps.field&&scale){var _scale$config=scale.config(),type=_scale$config.type,step=_scale$config.step,stepMapper="boolean"==typeof step&&step;LegendCls=LEGEND_TYPE_MAP["".concat(type,"-").concat(stepMapper,"-").concat(scaleType)],dataset.push({scale:scale,canvas:canvas,fieldName:scaleProps.field,title:retrieveFieldDisplayName(canvas.data(),scaleProps.field),LegendCls:LegendCls,scaleType:scaleType})}}),dataset}(canvas),invalidValues=canvas.config().invalidValues,parser=getValueParser(invalidValues);return legendInfo.forEach(function(dataInfo,index){var legendMeasures={},LegendCls=dataInfo.LegendCls,scale=dataInfo.scale,fieldName=dataInfo.fieldName,titleText=dataInfo.title,scaleType=dataInfo.scaleType,config=legendConfig[scaleType]||{},title=config.title||{};if(title.text=title.text||titleText,config.show){config.position=position,config.align=align;var legend=getObjProp(prevLegends[scaleType],index);legend||(legend=LegendCls.create({labelManager:canvas._dependencies.smartlabel,cells:{AxisCell:axis_cell,TextCell:src_text_cell}})),legendMeasures.maxHeight="vertical"===align?height-headerHeight:.2*height,legendMeasures.maxWidth="horizontal"===align?width:.2*width,legendMeasures.width=Math.min(legendMeasures.maxWidth,config.width),legendMeasures.height=Math.min(legendMeasures.maxHeight,config.height),[PADDING,BORDER,MARGIN].forEach(function(e){legendMeasures[e]=config[e]});var metaData=legend.metaData();metaData instanceof datamodel_default.a&&metaData.dispose(),legend.scale(scale).valueParser(parser).title(title).fieldName(fieldName).config(config).metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName])).measurement(legendMeasures).canvasAlias(canvas.alias()).setLegendMeasures(),legends.push({canvas:canvas,legend:legend,scaleType:scaleType})}}),legends};function muze_chart_component_typeof(obj){return(muze_chart_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function muze_chart_component_defineProperties(target,props){for(var i=0;icurrHeight?(sections++,currWidth=0,currHeight=legHeight):sections<0&§ions++,sectionComponents[sections]=sectionComponents[sections]||[],currHeight-=Math.min(leg.measurement().height,currHeight),currWidth=Math.max(Math.min(leg.measurement().width,leg.measurement().maxWidth),currWidth),sectionComponents[sections].push({legend:leg,legendHeight:legHeight,legendWidth:currWidth})});var mount=makeElement(legendMount,["div"],sectionComponents,"".concat(classPrefix,"-legend-section"));mount.classed("".concat(classPrefix,"-legend-vertical-section"),!0).style("width",function(d){return"".concat(d[0].legendWidth,"px")}),makeElement(mount,["div"],function(d){return d},"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legendWidth,"px")})}else{var _mount=makeElement(legendMount,"div",[1],"".concat(classPrefix,"-legend-section"));_mount.classed("".concat(classPrefix,"-legend-horizontal-section"),!0),_mount.classed("".concat(classPrefix,"-legend-section-",0),!0).style("width","".concat(legWidth,"px")),makeElement(_mount,"div",this.components,"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legend.measurement().width,"px")})}}},{key:"draw",value:function draw(container){this.renderLegend(container||document.getElementById(this.renderAt()))}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.boundBox(params.config.measurement.legendSpace),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.components=params.component,this.params=params,this.target(params.config.target),this.position(params.config.position);var _defaultAlignmentHelp=function defaultAlignmentHelper(position){var alignment=null,alignWith="".concat(ROW_MATRIX_INDEX[1],"-").concat(COLUMN_MATRIX_INDEX[1]);switch(position){case src_constants_TOP:case src_constants_BOTTOM:alignment=HORIZONTAL_CENTER;break;case src_constants_LEFT:case src_constants_RIGHT:alignment=VERTICAL_CENTER;break;default:alignment=VERTICAL_CENTER}return{alignment:alignment,alignWith:alignWith}}(params.config.position),alignWith=_defaultAlignmentHelp.alignWith,alignment=_defaultAlignmentHelp.alignment;this.className(params.config.className),this.alignWith(params.config.alignWith||alignWith),this.alignment(params.config.alignment||alignment)}}]),LegendComponent}(),helper_d3Drag=(__webpack_require__(25),renderer_utils_getD3Drag()),arrowSizeMap={left:"width",right:"width",top:"height",bottom:"height"},getUnitPositions=function getUnitPositions(unitMeasures,totalLength,viewLength){var currentLen=0;return(unitMeasures.primary&&unitMeasures.primary.length?unitMeasures.primary:unitMeasures.secondary).map(function(e){var unitPosition=100*currentLen/(totalLength-viewLength);return currentLen+=e,unitPosition})},helper_createScrollBarArrow=function createScrollBarArrow(mount,type,config){var classPrefix=config.classPrefix,thickness=config.thickness,arrow=makeElement(mount,"div",[type],"".concat(classPrefix,"-scroll-arrow-").concat(type));return arrow.classed("".concat(classPrefix,"-scroll-arrow"),!0),arrow.style(arrowSizeMap[type],"".concat(thickness,"px")),makeElement(arrow,"div",[1],"".concat(classPrefix,"-scroll-arrow-chevron")).attr("id","".concat(classPrefix,"-scroll-arrow-chevron-").concat(type)),arrow},helper_createScrollBarRect=function createScrollBarRect(mount,config){var classPrefix=config.classPrefix,rect=makeElement(mount,"div",[1],"".concat(classPrefix,"-scroll-rect"));return{rect:rect,mover:makeElement(rect,"div",[1],"".concat(classPrefix,"-scroll-mover"))}},applyScrollMouseDownAction=function applyScrollMouseDownAction(moverRect,scrollMaker,speed){var mover=moverRect.mover,rect=moverRect.rect,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y;scrollMaker.changeMoverPosition({x:x-rectX+speed,y:y-rectY+speed})},helper_registerListenerOnArrow=function registerListenerOnArrow(scrollMaker,moverRect,arrowType,speed){var timer="",arrow=scrollMaker._components[arrowType],isTouchDevice=hasTouch();arrow.on(isTouchDevice?"touchstart":"mousedown",function(){renderer_utils_getEvent().preventDefault(),timer=setInterval(function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)},100)}).on(isTouchDevice?"touchend":"mouseup",function(){renderer_utils_getEvent().preventDefault(),clearInterval(timer)}).on("click",function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)})},helper_registerListeners=function registerListeners(scrollMaker){var moverRect=scrollMaker._components.moverRect,speed=scrollMaker.config().speed;helper_registerListenerOnArrow(scrollMaker,moverRect,"prevArrow",-speed),function applyMoverDrag(scrollMaker,moverRect){var startPos={},moverStartPos=0,rectStartPos=0,endPos={},mover=moverRect.mover,rect=moverRect.rect;mover.call(helper_d3Drag().on("start",function(){var event=renderer_utils_getEvent();moverStartPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect(),startPos={x:event.x,y:event.y}}).on("drag",function(){var event=renderer_utils_getEvent(),window=getWindow(),distanceMoved_x=(endPos={x:event.x,y:event.y}).x-startPos.x,distanceMoved_y=endPos.y-startPos.y,actualPosition={x:moverStartPos.x+distanceMoved_x-rectStartPos.x+window.pageXOffset,y:moverStartPos.y+distanceMoved_y-rectStartPos.y+window.pageYOffset};scrollMaker.changeMoverPosition(actualPosition)}))}(scrollMaker,moverRect),function applyRectClick(scrollMaker,moverRect){moverRect.rect.on("click",function(){var event=renderer_utils_getEvent();scrollMaker.emptyScrollAreaClick(event)})}(scrollMaker,moverRect),helper_registerListenerOnArrow(scrollMaker,moverRect,"nextArrow",speed)},scroll_bar_maker_props_PROPS={config:{sanitization:function sanitization(context,value){return value=mergeRecursive(context._config,value)}},manager:{},unitPositions:{},logicalSpace:{}};function scroll_maker_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=horizontal_scroll_maker_get(horizontal_scroll_maker_getPrototypeOf(HorizontalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,config,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"left",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"right",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitWidths=_this$logicalSpace.unitWidths,scrollBarWithouArrowLength=width-2*height;rect.style("width","".concat(dimensions.width-2*height,"px")),rect.style("height","".concat(100,"%")),mover.style("width","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style("height","".concat(100,"%")),mover.style(src_constants_LEFT,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitWidths,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.xrectStartPos.width?rectStartPos.width-moverPos.width:newPosition.x,mover.style(src_constants_LEFT,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:0,x:moverPos.x-rectStartPos.x-delta}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.width)/100;return this.changeMoverPosition({y:0,x:movement}),this}}],[{key:"type",value:function type(){return"horizontal"}}]),HorizontalScrollMaker}(),vertical:function(_ScrollMaker){function VerticalScrollMaker(){return function vertical_scroll_maker_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VerticalScrollMaker),vertical_scroll_maker_possibleConstructorReturn(this,vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker).apply(this,arguments))}return function vertical_scroll_maker_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&vertical_scroll_maker_setPrototypeOf(subClass,superClass)}(VerticalScrollMaker,scroll_maker_ScrollMaker),function vertical_scroll_maker_createClass(Constructor,protoProps,staticProps){return protoProps&&vertical_scroll_maker_defineProperties(Constructor.prototype,protoProps),staticProps&&vertical_scroll_maker_defineProperties(Constructor,staticProps),Constructor}(VerticalScrollMaker,[{key:"createScroll",value:function createScroll(mountPoint){var dimensions=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=vertical_scroll_maker_get(vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"top",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"bottom",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitHeights=_this$logicalSpace.unitHeights,scrollBarWithouArrowLength=height-2*width;rect.style("height","".concat(scrollBarWithouArrowLength,"px")),rect.style("width","".concat(100,"%")),mover.style("width","".concat(100,"%")),mover.style("height","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style(src_constants_TOP,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitHeights,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.yrectStartPos.height?rectStartPos.height-moverPos.height:newPosition.y,mover.style(src_constants_TOP,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:moverPos.y-rectStartPos.y-delta,x:0}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.height)/100;return this.changeMoverPosition({x:0,y:movement}),this}}],[{key:"type",value:function type(){return"vertical"}}]),VerticalScrollMaker}()},ScrollComponent=function(_MuzeComponent){function ScrollComponent(params){var _this;!function scroll_component_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ScrollComponent);var ScrollMaker=scrollMakerMap[params.config.type];return params.component=new ScrollMaker,params.component.config(params.config.scrollBarComponentConfig),params.component.logicalSpace(params.dimensions),(_this=scroll_component_possibleConstructorReturn(this,scroll_component_getPrototypeOf(ScrollComponent).call(this,params.name,params.component.getLogicalSpace(),0))).setParams(params),_this}return function scroll_component_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&scroll_component_setPrototypeOf(subClass,superClass)}(ScrollComponent,MuzeComponent),function scroll_component_createClass(Constructor,protoProps,staticProps){return protoProps&&scroll_component_defineProperties(Constructor.prototype,protoProps),staticProps&&scroll_component_defineProperties(Constructor,staticProps),Constructor}(ScrollComponent,[{key:"manager",value:function manager(){return arguments.length?(this.component.manager(arguments.length<=0?void 0:arguments[0]),this):this.component.manager()}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){return this.component.scrollDeltaTo(delta),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){return this.component.scrollTo(scrollPercentage),this}},{key:"scrollToUnitIndex",value:function scrollToUnitIndex(unitIndex){var unitPositions=this.component.unitPositions(),sanitizedUnitIndex=Math.min(Math.max(0,unitIndex),unitPositions.length-1);return this.component.scrollTo(unitPositions[sanitizedUnitIndex]),this}},{key:"getScrollPositionsForUnits",value:function getScrollPositionsForUnits(){return this.component.unitPositions()}},{key:"draw",value:function draw(container){return this.component.createScroll(container||document.getElementById(this.renderAt())),this}},{key:"attachScrollAction",value:function attachScrollAction(externalAction){return this.component.attachScrollAction(externalAction),this}},{key:"detachScrollAction",value:function detachScrollAction(){return this.component.detachScrollAction(),this}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.component.config(params.config.scrollBarComponentConfig),this.component.logicalSpace(params.dimensions),this.boundBox(this.component.getLogicalSpace()),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.component=params.component||this.component,this.params=params,this.target(params.config.target),this.position(params.config.position),this.className(params.config.className),this.alignWith(params.config.alignWith),this.alignment(params.config.alignment)}},{key:"remove",value:function remove(){this.component.remove()}}]),ScrollComponent}();function matrix_component_typeof(obj){return(matrix_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function matrix_component_defineProperties(target,props){for(var i=0;iMath.abs(wheelDeltaY)&&scrollBarManager.preventBrowserScroll("horizontal",event).triggerScrollBarAction("horizontal",wheelDeltaX/30),0!==wheelDeltaY&&Math.abs(wheelDeltaX)0?heightAttr:height,minHeight),availableWidthForCanvas=Math.max(widthAttr>0?widthAttr:width,minWidth),_createHeaders=function createHeaders(context,canvasHeight,canvasWidth){var headerHeight=0,headers={},subtitle=context.subtitle(),isSubtitle=title_maker_resolveTitleSubTitleContent(subtitle[0]);return canvasHeight>=200&&canvasWidth>=200&&["title","subtitle"].forEach(function(type){var headerOptions=context[type](),content=title_maker_resolveTitleSubTitleContent(headerOptions[0]);if(content){var config=headerOptions[1];config.width=context.width(),config.height=context.height(),config.classPrefix=context.config().classPrefix,config.content=content,config.padding="title"!==type||isSubtitle.length?config.padding:subtitle[1].padding;var _createHeading=createHeading(config,type,context.dependencies().smartlabel,context["".concat(type,"Cell")]),height=_createHeading.height,cell=_createHeading.cell;headers["".concat(type,"Cell")]=cell,context._composition[type]=cell,headerHeight+=height}}),{headerHeight:headerHeight,headers:headers}}(context,availableHeightForCanvas,availableWidthForCanvas),headers=_createHeaders.headers,headerHeight=_createHeaders.headerHeight,legends=function createLegend(context,headerHeight,height,width){var measurement={height:height,width:width,headerHeight:headerHeight},legend=context.config().legend,show=legend.show,position=legend.position;legend.classPrefix=context.config().classPrefix;var align=position===src_constants_LEFT||position===src_constants_RIGHT?"vertical":"horizontal";return legend.show=show?"vertical"===align&&width>200||"horizontal"===align&&height>200:show,legend.align=align,legend_maker_legendInitializer(legend,context,measurement,context.composition().legend||{})}(context,headerHeight,availableHeightForCanvas,availableWidthForCanvas);context._composition.legend={},legends.forEach(function(e){context._composition.legend[e.scaleType]=e.legend});var legendSpace=function getLegendSpace(legends,legendConfig,availableHeight,availableWidth){var legendSpace={width:0,height:0};return legends.map(function(legendInfo){return legendInfo.legend.measurement()}).forEach(function(space){var height,width;width=Math.min(space.width,space.maxWidth),height=Math.min(space.height,space.maxHeight),"horizontal"===legendConfig.align?legendSpace.width+width>availableWidth?(legendSpace.width=availableWidth,legendSpace.height+=height):(legendSpace.width+=width,legendSpace.height=Math.max(legendSpace.height,height)):legendSpace.height+height>availableHeight?(legendSpace.height=height,legendSpace.width+=width):(legendSpace.height+=height,legendSpace.width=Math.max(legendSpace.width,width))}),"horizontal"===legendConfig.align&&(legendSpace.width=availableWidth),legendSpace}(legends,legend,availableHeightForCanvas,availableWidthForCanvas),legendWidth=legendPosition===src_constants_LEFT||legendPosition===src_constants_RIGHT?legendSpace.width:0,legendHeight=legendPosition===src_constants_TOP||legendPosition===src_constants_BOTTOM?legendSpace.height:0,components={headers:headers,legends:legends,canvases:[context],rows:rows,columns:columns,values:values,cornerMatrices:visGroup.cornerMatrices()},measurement={mountSpace:{height:height,width:width},headerHeight:headerHeight,legendSpace:legendSpace,canvasWidth:availableWidthForCanvas,canvasHeight:availableHeightForCanvas,width:availableWidthForCanvas-legendWidth,height:availableHeightForCanvas-headerHeight-legendHeight,minUnitHeight:context.minUnitHeight(),minUnitWidth:context.minUnitWidth()};return{layoutConfig:layoutConfig=mergeRecursive(layoutConfig,{classPrefix:classPrefix,showHeaders:showHeaders,border:mergeRecursive(visGroup.metaData().border,context.config().border),layoutArrangement:layoutArrangement,legend:legend,buffer:scrollBar.thickness,pagination:pagination,title:titleConfig,subtitle:subtitleConfig,isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,mount:mount,priority:priority}),components:components,measurement:measurement}},componentIndexes={title:0,subtitle:1,legend:2,verticalScrollBar:3,horizontalScrollBar:4,grid:5,message:6},componentNames={0:"title",1:"subtitle",2:"legend",3:"verticalScrollBar",4:"horizontalScrollBar",5:"grid",6:"message"},layout_maker_renderLayout=function renderLayout(canvas,renderDetails){var layoutManager=canvas._layoutManager,gridLayout=canvas.layout(),grid=componentIndexes.grid,compWrappers=component_wrapper_maker_componentWrapperMaker(canvas,gridLayout,renderDetails),componentWrappers=Object.keys(componentIndexes).map(function(e){return compWrappers[e]});componentWrappers[grid]&&function createScrollManager(componentWrappers,canvas){var verticalScrollBar=componentIndexes.verticalScrollBar,grid=componentIndexes.grid,horizontalScrollWrapper=componentWrappers[componentIndexes.horizontalScrollBar],verticalScrollWrapper=componentWrappers[verticalScrollBar],gridWrapper=componentWrappers[grid],scrollBarManager=new ScrollManager,scrollBarComponents={};verticalScrollWrapper&&(scrollBarComponents.vertical=verticalScrollWrapper),horizontalScrollWrapper&&(scrollBarComponents.horizontal=horizontalScrollWrapper),scrollBarManager.scrollBarComponents(scrollBarComponents).attachedComponents({grid:gridWrapper}),canvas.composition().hScrollBar=horizontalScrollWrapper,canvas.composition().vScrollBar=verticalScrollWrapper,[horizontalScrollWrapper,verticalScrollWrapper].forEach(function(wrapper){wrapper&&wrapper.manager(scrollBarManager)}),gridWrapper.scrollBarManager(scrollBarManager)}(componentWrappers,canvas),componentWrappers.forEach(function(componentWrapper,index){if(!componentWrapper){var deleteElementName=componentNames[index];layoutManager.removeComponent(deleteElementName)}}),layoutManager.registerComponents(componentWrappers).compute(),function attachListeners(componentWrappers){componentWrappers.forEach(function(componentWrapper){componentWrapper&&componentWrapper.attachListener()})}(componentWrappers)};function group_firebolt_typeof(obj){return(group_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function group_firebolt_defineProperties(target,props){for(var i=0;i","\"","'","/","createHeading","prevCell","cellType","_minTickDiff","legendInitializer","legendConfig","prevLegends","legends","headerHeight","legendInfo","legendCreator","LegendCls","dataset","scaleProps","_scale$config","stepMapper","dataInfo","legendMeasures","titleText","getGroupByData","setLegendMeasures","MuzeComponent","_this$boundBox","HeaderComponent","headerComponent_classCallCheck","headerComponent_possibleConstructorReturn","headerComponent_getPrototypeOf","setParams","cont","renderHeader","LegendComponent","legendComponent_classCallCheck","legendComponent_possibleConstructorReturn","legendComponent_getPrototypeOf","legendSpace","sectionComponents","_this$params$config","legendMount","legWidth","legHeight","sections","currHeight","currWidth","leg","legendHeight","legendWidth","renderLegend","_defaultAlignmentHelp","defaultAlignmentHelper","arrowSizeMap","getUnitPositions","totalLength","viewLength","currentLen","unitPosition","createScrollBarArrow","createScrollBarRect","mover","applyScrollMouseDownAction","moverRect","scrollMaker","_mover$node$getBoundi","_rect$node$getBoundin","rectX","rectY","changeMoverPosition","registerListenerOnArrow","arrowType","_components","isTouchDevice","registerListeners","applyMoverDrag","moverStartPos","rectStartPos","distanceMoved","actualPosition","pageXOffset","pageYOffset","applyRectClick","emptyScrollAreaClick","manager","unitPositions","ScrollMaker","scroll_maker_classCallCheck","_attachedScrollAction","_unitPositions","scroll_maker_createClass","scrollTo","scrollDeltaTo","createScroll","scrollBarContainer","scrollContainerHelper","attachScrollAction","externalScrollAction","detachScrollAction","scrollMakerMap","_ScrollMaker","HorizontalScrollMaker","horizontal_scroll_maker_classCallCheck","horizontal_scroll_maker_possibleConstructorReturn","horizontal_scroll_maker_getPrototypeOf","horizontal_scroll_maker_inherits","horizontal_scroll_maker_createClass","horizontal_scroll_maker_get","prevArrow","nextArrow","_this$logicalSpace","scrollBarWithouArrowLength","_scrollBarWithouArrowLength","_this$_components$mov","positionAdjuster","newPosition","currentPos","_this$_components$mov2","moverPos","movedViewLength","performAttachedScrollFunction","delta","_this$_components$mov3","scrollPercentage","movement","VerticalScrollMaker","vertical_scroll_maker_classCallCheck","vertical_scroll_maker_possibleConstructorReturn","vertical_scroll_maker_getPrototypeOf","vertical_scroll_maker_inherits","vertical_scroll_maker_createClass","vertical_scroll_maker_get","ScrollComponent","scroll_component_classCallCheck","scrollBarComponentConfig","scroll_component_possibleConstructorReturn","scroll_component_getPrototypeOf","unitIndex","sanitizedUnitIndex","externalAction","MatrixComponent","matrix_component_classCallCheck","matrix_component_possibleConstructorReturn","matrix_component_getPrototypeOf","_this$params$config$s","containerForMatrix","applyScroll","_cellSpanMaker","cellSpanMaker","_matrixSpanGenerator","renderTable","applySpans","applier","renderPlaceholders","renderMatrix","applyScrollAction","scollDistance","GridComponent","grid_component_classCallCheck","grid_component_possibleConstructorReturn","grid_component_getPrototypeOf","_this$component$viewI","matrixDim","matrixName","updateWrapper","matrixWrapper","allComponents","_scrollBarManager","scrollBarManager","wheelDeltaX","wheelDeltaY","preventBrowserScroll","triggerScrollBarAction","movedView","scrollActionApplier","_this$component$0$0$b","sanitizeGrid","attachScrollListener","MessageComponent","message_component_classCallCheck","message_component_possibleConstructorReturn","message_component_getPrototypeOf","_config$dimensions","message","_params$config","headerMap","headerCell","configType","headerAlignmentMap","component_wrapper_maker_defineProperty","_headerAlignmentMap","isGridPresent","renderDetails","_renderDetails$compon","checkParamsValidation","createHeaderWrapper","headerType","layoutManager","_headerMap$headerType","headerConfig","wrapperParams","component_wrapper_maker_objectSpread","existingComponent","createScrollBarWrapper","scrollBarType","grid","_scrollBarMap$scrollB","scrollBarMap","layoutBasedMeasure","viewMeasure","rowAlign","colAlign","componentWrapperMaker","_layoutManager","createMessageWrapper","_i","_headerValues","defaultDimensions","gridComponent","getBoundBox","createLegendWrapper","legendWrapper","gridLayoutWrapper","verticalScrollBar","horizontalScrollBar","ScrollManager","scroll_manager_classCallCheck","_scrollBarComponents","_attachedComponents","scroll_manager_createClass","scrollBarComponents","attachedComponents","performScrollAction","getRenderDetails","_mount$getBoundingCli","heightAttr","widthAttr","visGroup","_visGroup$placeholder","legendPosition","layoutArrangement","arrangeComponents","_titleLayouts","titleLayouts","component_resolver_defineProperty","legendLayouts","titlePosition","subtitlePosition","availableHeightForCanvas","availableWidthForCanvas","_createHeaders","canvasHeight","canvasWidth","isSubtitle","headerOptions","_createHeading","createLegend","getLegendSpace","mountSpace","componentIndexes","componentNames","3","4","5","6","renderLayout","gridLayout","compWrappers","componentWrappers","createScrollManager","horizontalScrollWrapper","verticalScrollWrapper","gridWrapper","hScrollBar","vScrollBar","componentWrapper","deleteElementName","removeComponent","registerComponents","attachListeners","attachListener","defaultInteractionPolicy","isMeasure","group_firebolt_toConsumableArray","getFieldsFromChannel","colDim","unitColFacets","equals","unitRowFacets","propagateWith","defaultCrossInteractionPolicy","propagationCanvasAlias","propagationUnit","GroupFireBolt","group_firebolt_classCallCheck","group_firebolt_possibleConstructorReturn","group_firebolt_getPrototypeOf","behaviouralAction","validFields","APP_INITIAL_STATE","app","Canvas","globalDependencies","canvas_classCallCheck","canvas_possibleConstructorReturn","canvas_getPrototypeOf","canvas_defineProperty","canvas_assertThisInitialized","initedComponents","initCanvas","createGroupState","_VisualGroup$getState2","canvas_helper_slicedToArray","register","prepareLayout","triggerReflow","setLayoutInfForUnits","getRootNodeId","setLabelRotationForAxes","rotationVal","getAxes","initialSettings","regEntry","COMPONENTS","SUBREGISTRIES","regObj","globalCache","defaultRegistry","overrideRegistryDefinitions","overrideRegistry","muze","_transactor2","muze_slicedToArray","env","globalStore","componentSubRegistryDef","settings","withSettings","enableChainedTransaction","transactionModel","transactionEndpoint","transactionItems","Smartlabel","SideEffects","standards","Behaviours","pkg","operators","utils","lookupWhat","lookupDetails","lookupTarget"],"mappings":"CAAA,SAAAA,iCAAAC,KAAAC,SACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,UACA,mBAAAG,eAAAC,IACAD,OAAA,UAAAH,SACA,iBAAAC,QACAA,QAAA,KAAAD,UAEAD,KAAA,KAAAC,UARA,CASCK,OAAA,WACD,yBCTA,IAAAC,oBAGA,SAAAC,oBAAAC,UAGA,GAAAF,iBAAAE,UACA,OAAAF,iBAAAE,UAAAP,QAGA,IAAAC,OAAAI,iBAAAE,WACAC,EAAAD,SACAE,GAAA,EACAT,YAUA,OANAU,QAAAH,UAAAI,KAAAV,OAAAD,QAAAC,cAAAD,QAAAM,qBAGAL,OAAAQ,GAAA,EAGAR,OAAAD,QA0DA,O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S,IAAIz1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,+BAES0W,eAAKK,cCVTA,YAAS,IAAIz1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,+BAES0W,cAAKK,aCZTA,YAAS,IAAIz1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,+BAES0W,cAAKK,aCZTA,YAAS,IAAIz1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,+BAES0W,cAAKK,aCALL,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,cAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,gBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,gBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCES0W,kBAZK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAN,IAAIi/B,gCCAS0W,gBAVK,IAAIp1C,MAAM,GAAGD,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAN,IAAIi/B,g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","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"muze\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"muze\"] = factory();\n\telse\n\t\troot[\"muze\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"DataModel\",[],t):\"object\"==typeof exports?exports.DataModel=t():e.DataModel=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=1)}([function(e){e.exports=JSON.parse('{\"name\":\"datamodel\",\"description\":\"Relational algebra compliant in-memory tabular data store\",\"homepage\":\"https://github.com/chartshq/datamodel\",\"version\":\"2.2.3\",\"license\":\"MIT\",\"main\":\"dist/datamodel.js\",\"keywords\":[\"datamodel\",\"data\",\"relational\",\"algebra\",\"model\",\"muze\",\"fusioncharts\",\"table\",\"tabular\",\"operation\"],\"author\":\"Muzejs.org (https://muzejs.org/)\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/chartshq/datamodel.git\"},\"contributors\":[{\"name\":\"Akash Goswami\",\"email\":\"akashgoswami90s@gmail.com\"},{\"name\":\"Subhash Haldar\"},{\"name\":\"Rousan Ali\",\"email\":\"rousanali786@gmail.com\",\"url\":\"https://rousan.io\"},{\"name\":\"Ujjal Kumar Dutta\",\"email\":\"duttaujjalkumar@live.com\"},{\"name\":\"Ranajit Banerjee\",\"email\":\"ranajit.113124@gmail.com\"},{\"name\":\"Adarsh Lilha\",\"email\":\"adarshlilha@gmail.com\"}],\"dependencies\":{\"d3-dsv\":\"^1.0.8\"},\"devDependencies\":{\"babel-cli\":\"6.26.0\",\"babel-core\":\"^6.26.3\",\"babel-eslint\":\"6.1.2\",\"babel-loader\":\"^7.1.4\",\"babel-plugin-transform-runtime\":\"^6.23.0\",\"babel-preset-env\":\"^1.7.0\",\"babel-preset-es2015\":\"^6.24.1\",\"babel-preset-flow\":\"^6.23.0\",\"chai\":\"3.5.0\",\"cross-env\":\"^5.0.5\",\"eslint\":\"3.19.0\",\"eslint-config-airbnb\":\"15.1.0\",\"eslint-plugin-import\":\"2.7.0\",\"eslint-plugin-jsx-a11y\":\"5.1.1\",\"eslint-plugin-react\":\"7.3.0\",\"istanbul-instrumenter-loader\":\"^3.0.0\",\"jsdoc\":\"3.5.5\",\"json2yaml\":\"^1.1.0\",\"karma\":\"1.7.1\",\"karma-chai\":\"0.1.0\",\"karma-chrome-launcher\":\"2.1.1\",\"karma-coverage-istanbul-reporter\":\"^1.3.0\",\"karma-mocha\":\"1.3.0\",\"karma-spec-reporter\":\"0.0.31\",\"karma-webpack\":\"2.0.3\",\"marked\":\"^0.5.0\",\"mocha\":\"3.4.2\",\"mocha-webpack\":\"0.7.0\",\"transform-runtime\":\"0.0.0\",\"webpack\":\"^4.12.0\",\"webpack-cli\":\"^3.0.7\",\"webpack-dev-server\":\"^3.1.4\"},\"scripts\":{\"test\":\"npm run lint && npm run ut\",\"ut\":\"karma start karma.conf.js\",\"utd\":\"karma start --single-run false --browsers Chrome karma.conf.js \",\"build\":\"npm run build:prod\",\"build:dev\":\"webpack --mode development\",\"build:prod\":\"webpack --mode production\",\"start\":\"webpack-dev-server --config webpack.config.dev.js --mode development --open\",\"lint\":\"eslint ./src\",\"lint-errors\":\"eslint --quiet ./src\",\"docs\":\"rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json\"}}')},function(e,t,n){var r=n(2);e.exports=r.default?r.default:r},function(e,t,n){\"use strict\";n.r(t);var r={};n.r(r),n.d(r,\"DataFormat\",(function(){return o})),n.d(r,\"DimensionSubtype\",(function(){return u})),n.d(r,\"MeasureSubtype\",(function(){return c})),n.d(r,\"FieldType\",(function(){return f})),n.d(r,\"FilteringMode\",(function(){return l})),n.d(r,\"GROUP_BY_FUNCTIONS\",(function(){return s}));var a={};n.r(a),n.d(a,\"DSVArr\",(function(){return rt})),n.d(a,\"DSVStr\",(function(){return mt})),n.d(a,\"FlatJSON\",(function(){return yt})),n.d(a,\"Auto\",(function(){return bt}));var i={};n.r(i),n.d(i,\"sum\",(function(){return un})),n.d(i,\"avg\",(function(){return cn})),n.d(i,\"min\",(function(){return fn})),n.d(i,\"max\",(function(){return ln})),n.d(i,\"first\",(function(){return sn})),n.d(i,\"last\",(function(){return dn})),n.d(i,\"count\",(function(){return pn})),n.d(i,\"sd\",(function(){return hn}));var o={FLAT_JSON:\"FlatJSON\",DSV_STR:\"DSVStr\",DSV_ARR:\"DSVArr\",AUTO:\"Auto\"},u={CATEGORICAL:\"categorical\",TEMPORAL:\"temporal\",GEO:\"geo\",BINNED:\"binned\"},c={CONTINUOUS:\"continuous\"},f={MEASURE:\"measure\",DIMENSION:\"dimension\"},l={NORMAL:\"normal\",INVERSE:\"inverse\",ALL:\"all\"},s={SUM:\"sum\",AVG:\"avg\",MIN:\"min\",MAX:\"max\",FIRST:\"first\",LAST:\"last\",COUNT:\"count\",STD:\"std\"};function d(e){return e instanceof Date?e:new Date(e)}function p(e){return e<10?\"0\"+e:e}function h(e){this.format=e,this.dtParams=void 0,this.nativeDate=void 0}RegExp.escape=function(e){return e.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\")},h.TOKEN_PREFIX=\"%\",h.DATETIME_PARAM_SEQUENCE={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6},h.defaultNumberParser=function(e){return function(t){var n;return isFinite(n=parseInt(t,10))?n:e}},h.defaultRangeParser=function(e,t){return function(n){var r,a=void 0;if(!n)return t;var i=n.toLowerCase();for(a=0,r=e.length;aa.getFullYear()&&(t=\"\"+(i-1)+r),d(t).getFullYear()},formatter:function(e){var t=d(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:\"Y\",index:0,extract:function(){return\"(\\\\d{4})\"},parser:h.defaultNumberParser(),formatter:function(e){return d(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[i+1],-1!==r.indexOf(o)&&a.push({index:i,token:o});return a},h.formatAs=function(e,t){var n,r=d(e),a=h.findTokens(t),i=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=a.length;l=0;d--)(f=i[d].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(d=0;d0&&e.split(\",\").forEach((function(e){var n=e.split(\"-\"),r=+n[0],a=+(n[1]||n[0]);if(a>=r)for(var i=r;i<=a;i+=1)t(i)}))}var R=function(){function e(e,t){for(var n=0;n=(i=e[a=n+Math.floor((r-n)/2)]).start&&t=i.end?n=a+1:t3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:U.CROSS,i=[],o=[],u=n||H,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,d=c.name+\".\"+f.name,p=Y(c,f);if(l===s)throw new Error(\"DataModels must have different alias names\");return c.fields.forEach((function(e){var t=_({},e.schema());-1===p.indexOf(t.name)||r||(t.name=c.name+\".\"+t.name),i.push(t)})),f.fields.forEach((function(e){var t=_({},e.schema());-1!==p.indexOf(t.name)?r||(t.name=f.name+\".\"+t.name,i.push(t)):i.push(t)})),T(e._rowDiffset,(function(n){var d=!1,h=void 0;T(t._rowDiffset,(function(v){var m=[],y={};y[l]={},y[s]={},c.fields.forEach((function(e){m.push(e.partialField.data[n]),y[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}})),f.fields.forEach((function(e){-1!==p.indexOf(e.schema().name)&&r||m.push(e.partialField.data[v]),y[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}}));var g=At(y[l]),b=At(y[s]);if(u(g,b,(function(){return e.detachedRoot()}),(function(){return t.detachedRoot()}),{})){var w={};m.forEach((function(e,t){w[i[t].name]=e})),d&&U.CROSS!==a?o[h]=w:(o.push(w),d=!0,h=n)}else if((a===U.LEFTOUTER||a===U.RIGHTOUTER)&&!d){var O={},_=c.fields.length-1;m.forEach((function(e,t){O[i[t].name]=t<=_?e:null})),d=!0,h=n,o.push(O)}}))})),new on(o,i,{name:d})}function J(e,t){var n=\"\"+e,r=\"\"+t;return nr?1:0}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J;return e.length>1&&function e(t,n,r,a){if(r===n)return t;var i=n+Math.floor((r-n)/2);return e(t,n,i,a),e(t,i+1,r,a),function(e,t,n,r,a){for(var i=e,o=[],u=t;u<=r;u+=1)o[u]=i[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(i[l]=o[f],f+=1):f>r?(i[l]=o[c],c+=1):a(o[c],o[f])<=0?(i[l]=o[c],c+=1):(i[l]=o[f],f+=1)}(t,n,i,r,a),t}(e,0,e.length-1,t),e}var K=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")};function W(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=\"\"+e)===(t=\"\"+t)?0:e>t?-1:1}}return n}(e.type,n)}function q(e,t){var n=new Map,r=[];return e.forEach((function(e){var a=e[t];n.has(a)?r[n.get(a)][1].push(e):(r.push([a,[e]]),n.set(a,r.length-1))})),r}function Z(e,t,n){var r={label:e[0]};return t.reduce((function(t,r,a){return t[r]=e[1].map((function(e){return e[n[a].index]})),t}),r),r}function $(e,t,n){for(var r=void 0,a=void 0,i=void 0,o=n.length-1;o>=0;o--)r=n[o][0],a=n[o][1],(i=Ht(t,r))&&(\"function\"==typeof a?z(e,(function(e,t){return a(e[i.index],t[i.index])})):E(a)?function(){var n=q(e,i.index),r=a[a.length-1],o=a.slice(0,a.length-1),u=o.map((function(e){return Ht(t,e)}));n.forEach((function(e){e.push(Z(e,o,u))})),z(n,(function(e,t){var n=e[2],a=t[2];return r(n,a)})),e.length=0,n.forEach((function(t){e.push.apply(e,W(t[1]))}))}():function(){var t=X(i,a);z(e,(function(e,n){return t(e[i.index],n[i.index])}))}())}var Q,ee=function e(t,n,r,a){if(0===t.length)return n;var i=t[0],o=new Map;n.reduce((function(e,t){var n=t[i.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e}),o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var d=l.value,p=K(d,2),h=p[0],v=p[1],m=e(t.slice(1),v,r,a);o.set(h,m),Array.isArray(m)&&$(m,r,a)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function te(e,t){var n=e.schema,r=e.data;if(0!==(t=t.filter((function(e){return!!Ht(n,e[0])}))).length){var a=t.findIndex((function(e){return null===e[1]}));a=-1!==a?a:t.length;var i=t.slice(0,a),o=t.slice(a);$(r,n,i),r=function(e,t,n,r){if(0===(n=n.filter((function(e){return null!==e[1]||(r.push(e[0]),!1)}))).length)return e;r=r.map((function(e){return Ht(t,e)}));var a=ee(r,e,t,n);return e.map((function(e){for(var t=0,n=a;!Array.isArray(n);)n=n.get(e[r[t++].index]);return n.shift()}))}(r,n,o,i.map((function(e){return e[0]}))),e.uids=r.map((function(e){return e.pop()})),e.data=r}}function ne(e,t,n,r,a){a=Object.assign({},{addUid:!1,columnWise:!1},a);var i={schema:[],data:[],uids:[]},o=a.addUid,u=r&&r.length>0,c=[];if(n.split(\",\").forEach((function(t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),a=_e.defaultReducer();return Object.keys(r).forEach((function(e){\"string\"!=typeof t[e]&&(t[e]=r[e].defAggFn());var i=_e.resolve(t[e]);i?n[e]=i:(n[e]=a,t[e]=ge)})),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],d=[],p={},h=[],v=void 0;Object.entries(u).forEach((function(e){var t=Ee(e,2),n=t[0],r=t[1];if(-1!==a.indexOf(n)||i[n])switch(d.push(_({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}}));var m=0;T(e._rowDiffset,(function(e){var t=\"\";l.forEach((function(n){t=t+\"-\"+u[n].partialField.data[e]})),void 0===p[t]?(p[t]=m,h.push({}),l.forEach((function(t){h[m][t]=u[t].partialField.data[e]})),s.forEach((function(t){h[m][t]=[u[t].partialField.data[e]]})),m+=1):s.forEach((function(n){h[p[t]][n].push(u[n].partialField.data[e])}))}));var y={},g=function(){return e.detachedRoot()};return h.forEach((function(e){var t=e;s.forEach((function(n){t[n]=i[n](e[n],g,y)}))})),r?(r.__calculateFieldspace(),v=r):v=new yn(h,d,{name:c}),v}function je(e,t){var n=Y(e.getFieldspace(),t.getFieldspace());return function(e,t){var r=!0;return n.forEach((function(n){r=!(e[n].internalValue!==t[n].internalValue||!r)})),r}}function Se(e,t){var n={},r=[],a=[],i=[],o=e.getFieldspace(),u=t.getFieldspace(),c=o.fieldsObj(),f=u.fieldsObj(),l=o.name+\" union \"+u.name;if(!j(e._colIdentifier.split(\",\").sort(),t._colIdentifier.split(\",\").sort()))return null;function s(e,t){T(e._rowDiffset,(function(e){var r={},o=\"\";a.forEach((function(n){var a=t[n].partialField.data[e];o+=\"-\"+a,r[n]=a})),n[o]||(i.push(r),n[o]=!0)}))}return e._colIdentifier.split(\",\").forEach((function(e){var t=c[e];r.push(_({},t.schema())),a.push(t.schema().name)})),s(e,c),s(t,f),new yn(i,r,{name:l})}function De(e,t,n){return G(e,t,n,!1,U.LEFTOUTER)}function Fe(e,t,n){return G(t,e,n,!1,U.RIGHTOUTER)}var Ne=function(){function e(e,t){for(var n=0;nn&&(n=a))})),[t,n]}}]),t}(Ve),He=function(){function e(e,t){for(var n=0;n9999?\"+\"+st(t,6):st(t,4))+\"-\"+st(e.getUTCMonth()+1,2)+\"-\"+st(e.getUTCDate(),2)+(i?\"T\"+st(n,2)+\":\"+st(r,2)+\":\"+st(a,2)+\".\"+st(i,3)+\"Z\":a?\"T\"+st(n,2)+\":\"+st(r,2)+\":\"+st(a,2)+\"Z\":r||n?\"T\"+st(n,2)+\":\"+st(r,2)+\"Z\":\"\")}var pt=function(e){var t=new RegExp('[\"'+e+\"\\n\\r]\"),n=e.charCodeAt(0);function r(e,t){var r,a=[],i=e.length,o=0,u=0,c=i<=0,f=!1;function l(){if(c)return it;if(f)return f=!1,at;var t,r,a=o;if(e.charCodeAt(a)===ot){for(;o++=i?c=!0:(r=e.charCodeAt(o++))===ut?f=!0:r===ct&&(f=!0,e.charCodeAt(o)===ut&&++o),e.slice(a+1,t-1).replace(/\"\"/g,'\"')}for(;o2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,_t(a))):e._derivation.push({op:t,meta:r,criteria:a})},Dt=function(e,t){var n;(n=t._ancestorDerivation).push.apply(n,_t(e._ancestorDerivation).concat(_t(e._derivation)))},Ft=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments[4];St(t,n,r,a),Dt(e,t)},Nt=(Ot(gt={},l.NORMAL,{diffIndex:[\"rowDiffset\"],calcDiff:[!0,!1]}),Ot(gt,l.INVERSE,{diffIndex:[\"rejectRowDiffset\"],calcDiff:[!1,!0]}),Ot(gt,l.ALL,{diffIndex:[\"rowDiffset\",\"rejectRowDiffset\"],calcDiff:[!0,!0]}),gt),kt=function(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split(\"-\")[0]+\"-\"+t}else e.push(\"\"+t)},Tt=function(e,t,n){var r=[],a=[],i=wt(Nt[n].calcDiff,2),o=i[0],u=i[1];return T(e,(function(e){var n=t(e);n&&o&&kt(r,e,-1),!n&&u&&kt(a,e,-1)})),{rowDiffset:r.join(\",\"),rejectRowDiffset:a.join(\",\")}},Rt=function(e,t,n,r,a){var i={},o={},u={};return T(e,(function(e){if(t(e)){var n=\"\",c={keys:{}};r.forEach((function(t){var r=a[t].partialField.data[e];n=n+\"-\"+r,c.keys[t]=r})),void 0===o[n]&&(o[n]=[],i[n]=-1,u[n]=c),kt(o[n],e,i[n]),i[n]=e}})),{splitRowDiffset:o,dimensionMap:u}},Ct=function(e,t,n,r,a){var i={},o=function(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e.getPartialFieldspace().fields,l=f.map((function(e){return e.formattedData()})),s=f.map((function(e){return e.data()}));return a(c,(function(e){return t(Et(f,l,s,e),e,o,i)}),u)},Mt=function(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map((function(e){return e.name()})).join(\",\"),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t},It=function(e,t,n){for(var r=n(e,t,0),a=1,i=e.length;a2&&void 0!==arguments[2]?arguments[2]:{},r=[],a=n.operation||V,i=n.filterByMeasure||!1,o=Mt(e),u=o.getFieldsConfig();r=t.length?t.map((function(e){return n=void 0,r=(t=e).getData(),a=t.getFieldsConfig(),o=Object.keys(t.getFieldspace().getDimension()).filter((function(e){return e in u})),c=o.length,f=o.map((function(e){return a[e].index})),l=Object.keys(t.getFieldspace().getMeasure()).filter((function(e){return e in u})),s=t.getFieldspace().fieldsObj(),d=r.data,p=l.reduce((function(e,t){return e[t]=s[t].domain(),e}),{}),h={},n=function(e,t,n){return t[e[n]]},c&&d.forEach((function(e){var t=It(f,e,n);h[t]=1})),n=function(e,t,n){return t[e[n]].internalValue},d.length?function(e){var t=!c||h[It(o,e,n)];return i?l.every((function(t){return e[t].internalValue>=p[t][0]&&e[t].internalValue<=p[t][1]}))&&t:t}:function(){return!1};var t,n,r,a,o,c,f,l,s,d,p,h})):[function(){return!1}];return a===V?o.select((function(e){return r.every((function(t){return t(e)}))}),{saveChild:!1}):o.select((function(e){return r.some((function(t){return t(e)}))}),{saveChild:!1})},xt=function(e,t,n,r,a){e._rowDiffset=t,e.__calculateFieldspace().calculateFieldsConfig(),Ft(n,e,L.SELECT,{config:r},a)},Lt=function(e,t,n,r){var a=e.clone(n.saveChild),i=t;return n.mode===l.INVERSE&&(i=r.filter((function(e){return-1===t.indexOf(e)}))),a._colIdentifier=i.join(\",\"),a.__calculateFieldspace().calculateFieldsConfig(),Ft(e,a,L.PROJECT,{projField:t,config:n,actualProjField:i},null),a},Ut=function(e,t,n,r){return t.map((function(t){return Lt(e,t,n,r)}))},Vt=function(e){if((e=_({},e)).type||(e.type=f.DIMENSION),!e.subtype)switch(e.type){case f.MEASURE:e.subtype=c.CONTINUOUS;break;default:case f.DIMENSION:e.subtype=u.CATEGORICAL}return e},Bt=function(e){return e.map((function(e){return function(e){var t=[c.CONTINUOUS],n=[u.CATEGORICAL,u.BINNED,u.TEMPORAL,u.GEO],r=e.type,a=e.subtype,i=e.name;switch(r){case f.DIMENSION:if(-1===n.indexOf(a))throw new Error(\"DataModel doesn't support dimension field subtype \"+a+\" used for \"+i+\" field\");break;case f.MEASURE:if(-1===t.indexOf(a))throw new Error(\"DataModel doesn't support measure field subtype \"+a+\" used for \"+i+\" field\");break;default:throw new Error(\"DataModel doesn't support field type \"+r+\" used for \"+i+\" field\")}}(e=Vt(e)),e}))},Yt=function(e,t,n,r){n=Bt(n),r=Object.assign(Object.assign({},nt),r);var i=a[r.dataFormat];if(!i||\"function\"!=typeof i)throw new Error(\"No converter function found for \"+r.dataFormat+\" format\");var u=i(t,n,r),c=wt(u,2),f=c[0],l=c[1];!function(e,t){e.forEach((function(e){var n=e.as;if(n){var r=t.indexOf(e.name);t[r]=n,e.name=n,delete e.as}}))}(n,f);var s=tt(l,n,f),d=F.createNamespace(s,r.name);e._partialFieldspace=d,e._rowDiffset=l.length&&l[0].length?\"0-\"+(l[0].length-1):\"\";var p=[],h=d.fields,v=h.map((function(e){return e.data()})),m=h.map((function(e){return e.formattedData()}));return T(e._rowDiffset,(function(e){p[e]=Et(h,m,v,e)})),d._cachedValueObjects=p,e._colIdentifier=n.map((function(e){return e.name})).join(),e._dataFormat=r.dataFormat===o.AUTO?D(t):r.dataFormat,e},Ht=function(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=a.nonTraversingModel,o=a.excludeModels||[];if(t!==i){var u=!o.length||-1===o.indexOf(t);u&&t.handlePropagation(n,r);var c=t._children;c.forEach((function(t){var i=Gt(n,t);e(t,i,r,a)}))}},zt=function(e){for(;e._parent&&e._derivation.find((function(e){return e.op!==L.GROUPBY}));)e=e._parent;return e},Kt=function(e){for(;e._parent;)e=e._parent;return e},Wt=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t},Xt=function(e,t,n,r){var a=void 0,i=void 0,o=n.propagationNameSpace,u=n.propagateToSource,c=n.sourceId,f=r.propagateInterpolatedValues,l=[];if(null===e&&!0!==r.persistent)l=[{criteria:[]}],a=[];else{var s,d=Object.values(o.mutableActions);!1!==u&&(d=d.filter((function(e){return e.config.sourceId!==c})));var p=d.filter((function(e){return(r.filterFn||function(){return!0})(e,r)})).map((function(e){return e.config.criteria})),h=[];if(!1!==u){var v=Object.values(o.mutableActions);v.forEach((function(e){var t=e.config;!1===t.applyOnSource&&t.action===r.action&&t.sourceId!==c&&(h.push(e.model),(a=v.filter((function(t){return t!==e})).map((function(e){return e.config.criteria}))).length&&l.push({criteria:a,models:e.model,path:Wt(e.model)}))}))}a=(s=[]).concat.apply(s,[].concat(_t(p),[e])).filter((function(e){return null!==e})),l.push({criteria:a,excludeModels:[].concat(h,_t(r.excludeModels||[]))})}var m=t.model,y=Object.assign({sourceIdentifiers:e,propagationSourceId:c},r),g=t.groupByModel;f&&g&&(i=Pt(g,a,{filterByMeasure:f}),Jt(g,i,y)),l.forEach((function(e){var t=Pt(m,e.criteria),n=e.path;if(n){var r=function(e,t){for(var n=0,r=t.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,a=t.isMutableAction,i=t.criteria,o=t.action+\"-\"+t.sourceId;r=a?e.mutableActions:e.immutableActions,null===i?delete r[o]:r[o]={model:n,config:t}},$t=function(e,t,n){var r=e.reduce((function(e,r){return\"RegExp\"===r.constructor.name?e.push.apply(e,_t(t.filter((function(e){return-1!==e.search(r)})))):r in n&&e.push(r),e}),[]);return Array.from(new Set(r)).map((function(e){return e.trim()}))},Qt=function(e,t){return e.numberFormat?e.numberFormat()(t):t},en=function(){function e(e,t){for(var n=0;n1?(a=e.clone(r.saveChild),xt(a,u[c[1]],e,n,t),[o,a]):o}(this,e,t,{saveChild:t.saveChild})}},{key:\"isEmpty\",value:function(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:\"clone\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:\"project\",value:function(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),a=Object.keys(r),i=t.mode,o=$t(e,a,r),u=void 0;i===l.ALL?u=[Lt(this,o,{mode:l.NORMAL,saveChild:t.saveChild},a),Lt(this,o,{mode:l.INVERSE,saveChild:t.saveChild},a)]:u=Lt(this,o,t,a);return u}},{key:\"getFieldsConfig\",value:function(){return this._fieldConfig}},{key:\"calculateFieldsConfig\",value:function(){return this._fieldConfig=this._fieldspace.fields.reduce((function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e}),{}),this}},{key:\"dispose\",value:function(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach((function(e){e._parent=null})),this._children=[]}},{key:\"removeChild\",value:function(e){var t=this._children.findIndex((function(t){return t===e}));-1===t||this._children.splice(t,1)}},{key:\"setParent\",value:function(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:\"getParent\",value:function(){return this._parent}},{key:\"getChildren\",value:function(){return this._children}},{key:\"getDerivations\",value:function(){return this._derivation}},{key:\"getAncestorDerivations\",value:function(){return this._ancestorDerivation}}]),e}(),nn=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")},rn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=\"\"+e.join(),a=[this,e,t],i=Ae.apply(void 0,a);return Ft(this,i,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:_e.defaultReducer()},t),n.saveChild?i.setParent(this):i.setParent(null),i}},{key:\"sort\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:\"row\",sort:e}),r=n.schema.map((function(e){return e.name})),a=[r].concat(n.data),i=new this.constructor(a,n.schema,{dataFormat:\"DSVArr\"});return Ft(this,i,L.SORT,t,e),t.saveChild?i.setParent(this):i.setParent(null),i}},{key:\"serialize\",value:function(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:\",\"},t);var n=this.getFieldspace().fields,r=n.map((function(e){return e.formattedData()})),a=r[0].length,i=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(i=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach((function(t,n){t[e.name()]=new k(a[n],i[n],e)}));return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:\"calculateVariable\",value:function(e,t,n){var r=this;e=Vt(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var a=this.getFieldsConfig(),i=t.slice(0,t.length-1),o=t[t.length-1];if(a[e.name]&&!n.replaceVar)throw new Error(e.name+\" field already exists in datamodel\");var u=i.map((function(e){var t=a[e];if(!t)throw new Error(e+\" is not a valid column name.\");return t.index})),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map((function(e){return f[e]})),s={},d=function(){return r.detachedRoot()},p=[];T(c._rowDiffset,(function(e){var t=l.map((function(t){return t.partialField.data[e]}));p[e]=o.apply(void 0,an(t).concat([e,d,s]))}));var h=tt([p],[e],[e.name]),v=nn(h,1)[0];return c.addField(v),Ft(this,c,L.CAL_VAR,{config:e,fields:i},o),c}},{key:\"propagate\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.isMutableAction,i=t.sourceId,o=t.payload,u=Kt(this),c=u._propagationNameSpace,f=zt(this),l={groupByModel:f,model:u};return n&&Zt(c,t,this),Xt(e,l,{propagationNameSpace:c,sourceId:i},Object.assign({payload:o},t)),a&&qt(c,l,{config:t,propConfig:r}),this}},{key:\"on\",value:function(e,t){switch(e){case\"propagation\":this._onPropagation.push(t)}return this}},{key:\"unsubscribe\",value:function(e){switch(e){case\"propagation\":this._onPropagation=[]}return this}},{key:\"handlePropagation\",value:function(e,t){var n=this;this._onPropagation.forEach((function(r){return r.call(n,e,t)}))}},{key:\"bin\",value:function(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error(\"Field \"+e+\" doesn't exist\");var r=t.name||e+\"_binned\";if(n[r])throw new Error(\"Field \"+r+\" already exists\");var a=function(e,t,n){var r=n.buckets,a=n.binsCount,i=n.binSize,o=n.start,u=n.end,c=e.domain(),f=I(c,2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var d=[],p=0;p2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],a=r.saveChild,i=e.getFieldspace().fieldsObj(),o=Ct(e.clone(a),n,r,e,(function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},a=this.getFieldsConfig(),i=Object.keys(a),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach((function(e,n){o[n]=$t([].concat(an(e),an(t)),i,a)})),Ut(this,o,n,i)}}],[{key:\"configureInvalidAwareTypes\",value:function(e){return M.invalidAwareVals(e)}},{key:\"Reducers\",get:function(){return _e}}]),t}(tn),un=ye.sum,cn=ye.avg,fn=ye.min,ln=ye.max,sn=ye.first,dn=ye.last,pn=ye.count,hn=ye.std,vn={compose:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,a=void 0,i=[];return t.forEach((function(e){r=e(r),i.push.apply(i,B(r._derivation)),a||(a=r)})),a&&a!==r&&a.dispose(),r._ancestorDerivation=[],Ft(e,r,L.COMPOSE,null,i),n.saveChild?r.setParent(e):r.setParent(null),r}},bin:function(){for(var e=arguments.length,t=Array(e),n=0;n whenever a break is necessary. This is to recgonize one\n * generalized format independent of the implementation (canvas based solution, svg based solution). This method\n * converts the output of getSmartText().text to array of lines if the text is wrapped. It sets a named property\n * `lines` on the object passed as parameter.\n *\n * @param {Object} smartlabel - the object returned by getSmartText based on which line arr which to be formed.\n *\n * @return {Object} - The same object which was passed in the arguments. Also a named property `lines` is set.\n */\nSmartLabelManager.textToLines = function (smartlabel) {\n smartlabel = smartlabel || {};\n\n if (!smartlabel.text) {\n smartlabel.text = '';\n } else if (typeof smartlabel.text !== 'string') {\n smartlabel.text = smartlabel.text.toString();\n }\n\n smartlabel.lines = smartlabel.text.split(/\\n|/ig);\n return smartlabel;\n};\n\n// Saves all the instance created so far\nSmartLabelManager.store = {};\n\n// Calculates space taken by a character with an approximation value which is calculated by repeating the\n// character by string length times.\nSmartLabelManager.prototype._calCharDimWithCache = function (text, calculateDifference, length) {\n if (!this._init) {\n return false;\n }\n\n var size,\n csArr,\n tw,\n twi,\n cachedStyle,\n asymmetricDifference,\n maxAdvancedCacheLimit = this.options.maxCacheLimit,\n container = this._container,\n style = this.style || {},\n cache = this._advancedCache || (this._advancedCache = {}),\n advancedCacheKey = this._advancedCacheKey || (this._advancedCacheKey = []),\n cacheName = text + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK),\n cacheInitName = text + 'init' + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK);\n\n htmlSplCharSpace[text] && (text = htmlSplCharSpace[text]);\n\n if (!calculateDifference) {\n asymmetricDifference = 0;\n } else {\n if ((asymmetricDifference = cache[cacheInitName]) === undefined) {\n container.innerHTML = text.repeat ? text.repeat(length) : Array(length + 1).join(text); // jshint ignore:line\n tw = container.offsetWidth;\n\n container.innerHTML = text;\n twi = container.offsetWidth;\n\n asymmetricDifference = cache[cacheInitName] = (tw - length * twi) / (length + 1);\n advancedCacheKey.push(cacheInitName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n }\n }\n\n if (cachedStyle = cache[cacheName]) {\n csArr = cachedStyle.split(',');\n return {\n width: parseFloat(csArr[0], 10),\n height: parseFloat(csArr[1], 10)\n };\n }\n\n container.innerHTML = text;\n\n size = {\n height: container.offsetHeight,\n width: container.offsetWidth + asymmetricDifference\n };\n\n cache[cacheName] = size.width + ',' + size.height;\n advancedCacheKey.push(cacheName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n\n return size;\n};\n\n// Provide function to calculate the height and width based on the environment and available support from dom.\nSmartLabelManager.prototype._getWidthFn = function () {\n var contObj = this._containerObj,\n container = this._container,\n svgText = contObj.svgText;\n\n if (svgText) {\n return function (str) {\n var bbox, width;\n\n svgText.textContent = str;\n bbox = svgText.getBBox();\n width = bbox.width - SVG_BBOX_CORRECTION;\n if (width < 1) {\n width = bbox.width;\n }\n\n return width;\n };\n } else {\n return function (str) {\n container.innerHTML = str;\n return container.offsetWidth;\n };\n }\n};\n\n/*\n * Sets the style based on which the text's metrics to be calculated.\n *\n * @param {Object} style - The style object which affects the text size\n * {\n * fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)\n * fontFamily / 'font-family'\n * fontWeight / 'font-weight'\n * fontStyle / 'font-style'\n * }\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.setStyle = function (style) {\n if (!this._init) {\n return this;\n }\n\n var sCont;\n\n if (style === this.style && !this._styleNotSet) {\n return;\n }\n\n if (!style) {\n style = this.style;\n }\n\n slLib.setLineHeight(style);\n this.style = style;\n\n this._containerObj = sCont = this._containerManager.get(style);\n\n if (this._containerObj) {\n this._container = sCont.node;\n this._context = sCont.context;\n this._cache = sCont.charCache;\n this._lineHeight = sCont.lineHeight;\n this._styleNotSet = false;\n } else {\n this._styleNotSet = true;\n }\n\n return this;\n};\n\n/*\n * Decides whether ellipses to be shown if the node is truncated\n *\n * @param {Boolean} useEllipses - decides if a ellipses to be appended if the text is truncated. Default: false\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.useEllipsesOnOverflow = function (useEllipses) {\n if (!this._init) {\n return this;\n }\n this._showNoEllipses = !useEllipses;\n return this;\n};\n\n/*\n * Get wrapped or truncated text if a bound box is defined around it. The result text would be separated by
\n * if wrapped\n *\n * @param {String} text - the subject text\n * @param {Number} maxWidth - width in px of the the bound box\n * @param {Number} maxHeight - height in px of the the bound box\n * @param {Boolean} noWrap - whether the text to be wrapped. Default false.\n *\n * @return {Object} - The metrics of the text bounded by the box\n * {\n * height : height of the wrapped text\n * width : width of the wrapped text\n * isTruncated : whether the text is truncated\n * maxHeight : Maximum height given\n * maxWidth : Maximum width given\n * oriText : Original text sent\n * oriTextHeight : Original text height\n * oriTextWidth : Original text width\n * text : SMART TEXT\n * }\n */\nSmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight, noWrap) {\n if (!this._init) {\n return false;\n }\n\n if (text === undefined || text === null) {\n text = '';\n } else if (typeof text !== 'string') {\n text = text.toString();\n }\n\n var len,\n trimStr,\n tempArr,\n tmpText,\n maxWidthWithEll,\n toolText,\n oriWidth,\n oriHeight,\n newCharIndex,\n nearestChar,\n tempChar,\n getWidth,\n initialLeft,\n initialTop,\n getOriSizeImproveObj,\n spanArr,\n x,\n y,\n minWidth,\n elem,\n chr,\n elemRightMostPoint,\n elemLowestPoint,\n lastBR,\n removeFromIndex,\n removeFromIndexForEllipses,\n hasHTMLTag = false,\n maxStrWidth = 0,\n lastDash = -1,\n lastSpace = -1,\n lastIndexBroken = -1,\n strWidth = 0,\n strHeight = 0,\n oriTextArr = [],\n i = 0,\n ellipsesStr = this._showNoEllipses ? '' : '...',\n lineHeight = this._lineHeight,\n context = this._context,\n container = this._container,\n sCont = this._containerObj,\n ellipsesWidth = sCont.ellipsesWidth,\n dotWidth = sCont.dotWidth,\n characterArr = [],\n dashIndex = -1,\n spaceIndex = -1,\n lastLineBreak = -1,\n fastTrim = function fastTrim(str) {\n str = str.replace(/^\\s\\s*/, '');\n var ws = /\\s/,\n i = str.length;\n while (ws.test(str.charAt(i -= 1))) {/* jshint noempty:false */}\n return str.slice(0, i + 1);\n },\n smartLabel = {\n text: text,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n width: null,\n height: null,\n oriTextWidth: null,\n oriTextHeight: null,\n oriText: text,\n isTruncated: false\n };\n\n getWidth = this._getWidthFn();\n\n // In some browsers, offsetheight of a single-line text is getting little (1 px) heigher value of the\n // lineheight. As a result, smartLabel is unable to return single-line text.\n // To fix this, increase the maxHeight a little amount. Hence maxHeight = lineHeight * 1.2\n if (maxHeight === lineHeight) {\n maxHeight *= 1.2;\n }\n\n if (container) {\n if (!documentSupport.isBrowserLess) {\n hasHTMLTag = slLib.xmlTagRegEx.test(text);\n if (!hasHTMLTag) {\n // Due to support of <,> for xml we convert <, > to <,> respectively so to get the correct\n // width it is required to convert the same before calculation for the new improve version of the\n // get text width.\n tmpText = text.replace(slLib.ltgtRegex, function (match) {\n return match === '<' ? '<' : '>';\n });\n getOriSizeImproveObj = this.getOriSize(tmpText, true);\n\n smartLabel.oriTextWidth = oriWidth = getOriSizeImproveObj.width;\n smartLabel.oriTextHeight = oriHeight = getOriSizeImproveObj.height;\n } else {\n container.innerHTML = text;\n smartLabel.oriTextWidth = oriWidth = container.offsetWidth;\n smartLabel.oriTextHeight = oriHeight = container.offsetHeight;\n }\n\n if (oriHeight <= maxHeight && oriWidth <= maxWidth) {\n smartLabel.width = smartLabel.oriTextWidth = oriWidth;\n smartLabel.height = smartLabel.oriTextHeight = oriHeight;\n return smartLabel;\n }\n\n if (lineHeight > maxHeight) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = 0;\n smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n }\n }\n\n // Calculate width with ellipses\n text = fastTrim(text).replace(/(\\s+)/g, ' ');\n maxWidthWithEll = this._showNoEllipses ? maxWidth : maxWidth - ellipsesWidth;\n\n if (!hasHTMLTag) {\n oriTextArr = text.split('');\n len = oriTextArr.length;\n trimStr = '', tempArr = [];\n tempChar = oriTextArr[0];\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n minWidth = getWidth(tempChar);\n this._cache[tempChar] = { width: minWidth };\n }\n\n if (maxWidthWithEll > minWidth) {\n tempArr = text.substr(0, slLib.getNearestBreakIndex(text, maxWidthWithEll, this)).split('');\n i = tempArr.length;\n } else if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n } else if (ellipsesStr) {\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n strWidth = getWidth(tempArr.join(''));\n strHeight = this._lineHeight;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n smartLabel.width = getWidth(smartLabel.text);\n smartLabel.height = this._lineHeight;\n return smartLabel;\n }\n }\n }\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = strWidth;\n smartLabel.height = this._lineHeight;\n return smartLabel;\n } else {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (tempChar === ' ' && !context) {\n tempChar = ' ';\n }\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n /** @todo use regular expressions for better performance. */\n lastSpace = text.substr(0, tempArr.length).lastIndexOf(' ');\n lastDash = text.substr(0, tempArr.length).lastIndexOf('-');\n if (lastSpace > lastIndexBroken) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastSpace, 1, '
');\n lastIndexBroken = lastSpace;\n newCharIndex = lastSpace + 1;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === tempArr.length - 1) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '
-');\n } else {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '-
');\n }\n lastIndexBroken = lastDash;\n newCharIndex = lastDash + 1;\n } else {\n tempArr.splice(tempArr.length - 1, 1, '
' + oriTextArr[i]);\n lastLineBreak = tempArr.length - 2;\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastLineBreak + 1).join(''));\n lastIndexBroken = lastLineBreak;\n newCharIndex = i;\n }\n strHeight += this._lineHeight;\n if (strHeight > maxHeight) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n // The max width among all the lines will be the width of the string.\n smartLabel.width = maxWidth;\n smartLabel.height = strHeight - this._lineHeight;\n return smartLabel;\n } else {\n maxStrWidth = max(maxStrWidth, strWidth);\n trimStr = null;\n nearestChar = slLib.getNearestBreakIndex(text.substr(newCharIndex), maxWidthWithEll, this);\n strWidth = getWidth(text.substr(newCharIndex, nearestChar || 1));\n if (tempArr.length < newCharIndex + nearestChar) {\n tempArr = tempArr.concat(text.substr(tempArr.length, newCharIndex + nearestChar - tempArr.length).split(''));\n i = tempArr.length - 1;\n }\n }\n }\n }\n }\n\n maxStrWidth = max(maxStrWidth, strWidth);\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = maxStrWidth;\n smartLabel.height = strHeight;\n return smartLabel;\n }\n } else {\n toolText = text.replace(slLib.spanAdditionRegx, '$2');\n text = text.replace(slLib.spanAdditionRegx, slLib.spanAdditionReplacer);\n text = text.replace(/()/g, '$1');\n\n container.innerHTML = text;\n\n spanArr = container[documentSupport.childRetriverFn](documentSupport.childRetriverString);\n\n for (x = 0, y = spanArr.length; x < y; x += 1) {\n elem = spanArr[x];\n //chech whether this span is temporary inserted span from it's class\n if (documentSupport.noClassTesting || slLib.classNameReg.test(elem.className)) {\n chr = elem.innerHTML;\n if (chr !== '') {\n if (chr === ' ') {\n spaceIndex = characterArr.length;\n } else if (chr === '-') {\n dashIndex = characterArr.length;\n }\n\n characterArr.push({\n spaceIdx: spaceIndex,\n dashIdx: dashIndex,\n elem: elem\n });\n oriTextArr.push(chr);\n }\n }\n }\n\n i = 0;\n len = characterArr.length;\n minWidth = characterArr[0].elem.offsetWidth;\n\n if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n\n return smartLabel;\n } else if (minWidth > maxWidthWithEll && !this._showNoEllipses) {\n\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n initialLeft = characterArr[0].elem.offsetLeft;\n initialTop = characterArr[0].elem.offsetTop;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n if (container.offsetWidth > maxWidth) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n } else {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemLowestPoint = elem.offsetHeight + (elem.offsetTop - initialTop);\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n lastBR = null;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n\n if (elemRightMostPoint > maxWidth) {\n lastSpace = characterArr[i].spaceIdx;\n lastDash = characterArr[i].dashIdx;\n if (lastSpace > lastIndexBroken) {\n characterArr[lastSpace].elem.innerHTML = '
';\n lastIndexBroken = lastSpace;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === i) {\n // in case the overflowing character itself is the '-'\n characterArr[lastDash].elem.innerHTML = '
-';\n } else {\n characterArr[lastDash].elem.innerHTML = '-
';\n }\n lastIndexBroken = lastDash;\n } else {\n elem.parentNode.insertBefore(lastBR = doc.createElement('br'), elem);\n }\n\n //check whether this break made current element outside the area height\n if (elem.offsetHeight + elem.offsetTop > maxHeight) {\n //remove the lastly inserted line break\n if (lastBR) {\n lastBR.parentNode.removeChild(lastBR);\n } else if (lastIndexBroken === lastDash) {\n characterArr[lastDash].elem.innerHTML = '-';\n } else {\n characterArr[lastSpace].elem.innerHTML = ' ';\n }\n removeFromIndex = i;\n //break the looping condition\n i = len;\n } else {\n removeFromIndexForEllipses = null;\n }\n }\n } else {\n //check whether this break made current element outside the area height\n if (elemLowestPoint > maxHeight) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n }\n\n if (removeFromIndex < len) {\n //set the trancated property of the smartlabel\n smartLabel.isTruncated = true;\n\n /** @todo is this really needed? */\n removeFromIndexForEllipses = removeFromIndexForEllipses ? removeFromIndexForEllipses : removeFromIndex;\n\n for (i = len - 1; i >= removeFromIndexForEllipses; i -= 1) {\n elem = characterArr[i].elem;\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n }\n\n for (; i >= 0; i -= 1) {\n elem = characterArr[i].elem;\n if (slLib.classNameBrReg.test(elem.className)) {\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n } else {\n i = 0;\n }\n }\n }\n\n //get the smart text\n smartLabel.text = container.innerHTML.replace(slLib.spanRemovalRegx, '$1').replace(/\\&\\;/g, '&');\n if (smartLabel.isTruncated) {\n smartLabel.text += ellipsesStr;\n smartLabel.tooltext = toolText;\n }\n }\n\n smartLabel.height = container.offsetHeight;\n smartLabel.width = container.offsetWidth;\n\n return smartLabel;\n } else {\n smartLabel.error = new Error('Body Tag Missing!');\n return smartLabel;\n }\n};\n\n/*\n * Get the height and width of a text.\n *\n * @param {String} text - Text whose metrics to be measured\n * @param {Boolean} Optional detailedCalculationFlag - this flag if set it calculates per letter position\n * information and returns it. Ideally you dont need it unless you want to post process the\n * string. And its an EXPENSIVE OPERATION.\n *\n * @return {Object} - If detailedCalculationFlag is set to true the returned object would be\n * {\n * height: height of the text\n * width: width of the text\n * detailObj: detail calculation of letters in the format {lettername: width}\n * }\n * If detailedCalculationFlag is set to false the returned object wont have the detailObj prop.\n */\nSmartLabelManager.prototype.getOriSize = function (text, detailedCalculationFlag) {\n if (!this._init) {\n return false;\n }\n\n var textArr,\n letter,\n lSize,\n i,\n l,\n cumulativeSize = 0,\n height = 0,\n indiSizeStore = {};\n\n if (!detailedCalculationFlag) {\n return this._calCharDimWithCache(text);\n }\n\n // Calculate the width of every letter with an approximation\n textArr = text.split('');\n for (i = 0, l = textArr.length; i < l; i++) {\n letter = textArr[i];\n lSize = this._calCharDimWithCache(letter, true, textArr.length);\n height = max(height, lSize.height);\n cumulativeSize += lSize.width;\n indiSizeStore[letter] = lSize.width;\n }\n\n return {\n width: round(cumulativeSize),\n height: height,\n detailObj: indiSizeStore\n };\n};\n\n/*\n * Dispose the container and object allocated by the smartlabel\n */\nSmartLabelManager.prototype.dispose = function () {\n if (!this._init) {\n return this;\n }\n\n this._containerManager && this._containerManager.dispose && this._containerManager.dispose();\n\n delete this._container;\n delete this._context;\n delete this._cache;\n delete this._containerManager;\n delete this._containerObj;\n delete this.id;\n delete this.style;\n delete this.parentContainer;\n delete this._showNoEllipses;\n\n return this;\n};\n\nexports['default'] = SmartLabelManager;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n\tvalue: true\n});\nvar lib = {\n\tinit: function init(win) {\n\t\tvar doc = win.document,\n\t\t nav = win.navigator,\n\t\t userAgent = nav.userAgent,\n\t\t DIV = 'DIV',\n\t\t ceil = Math.ceil,\n\t\t floor = Math.floor,\n\t\t containerInstanceCount = 0,\n\t\t clsNameSpace = 'fusioncharts-smartlabel-',\n\t\t containerClass = clsNameSpace + 'container',\n\t\t classNameWithTag = clsNameSpace + 'tag',\n\t\t classNameWithTagBR = clsNameSpace + 'br';\n\n\t\tlib = {\n\t\t\twin: win,\n\n\t\t\tcontainerClass: containerClass,\n\n\t\t\tclassNameWithTag: classNameWithTag,\n\n\t\t\tclassNameWithTagBR: classNameWithTagBR,\n\n\t\t\tmaxDefaultCacheLimit: 500,\n\n\t\t\tclassNameReg: new RegExp('\\b' + classNameWithTag + '\\b'),\n\n\t\t\tclassNameBrReg: new RegExp('\\b' + classNameWithTagBR + '\\b'),\n\n\t\t\tspanAdditionRegx: /(<[^<\\>]+?\\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,\n\n\t\t\tspanAdditionReplacer: '$1$2',\n\n\t\t\tspanRemovalRegx: new RegExp('\\\\]+?' + classNameWithTag + '[^\\\\>]{0,}\\\\>(.*?)\\\\<\\\\/span\\\\>', 'ig'),\n\n\t\t\txmlTagRegEx: new RegExp('<[^>][^<]*[^>]+>', 'i'),\n\n\t\t\tltgtRegex: /<|>/g,\n\n\t\t\tbrReplaceRegex: //ig,\n\n\t\t\ttestStrAvg: 'WgI',\n\n\t\t\t// This style is applied over the parent smartlabel container. The container is kept hidden from the viewport\n\t\t\tparentContainerStyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: '-9999em',\n\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\tpadding: '0px',\n\t\t\t\twidth: '1px',\n\t\t\t\theight: '1px',\n\t\t\t\toverflow: 'hidden'\n\t\t\t},\n\n\t\t\t// All the style which might affect the text metrics\n\t\t\tsupportedStyle: {\n\t\t\t\tfont: 'font',\n\t\t\t\tfontFamily: 'font-family',\n\t\t\t\t'font-family': 'font-family',\n\t\t\t\tfontWeight: 'font-weight',\n\t\t\t\t'font-weight': 'font-weight',\n\t\t\t\tfontSize: 'font-size',\n\t\t\t\t'font-size': 'font-size',\n\t\t\t\tlineHeight: 'line-height',\n\t\t\t\t'line-height': 'line-height',\n\t\t\t\tfontStyle: 'font-style',\n\t\t\t\t'font-style': 'font-style'\n\t\t\t},\n\n\t\t\t// Get the support list for html the document where the text calcution is to be done.\n\t\t\tgetDocumentSupport: function getDocumentSupport() {\n\t\t\t\tvar childRetriverFn, childRetriverString, noClassTesting;\n\n\t\t\t\tif (doc.getElementsByClassName) {\n\t\t\t\t\tchildRetriverFn = 'getElementsByClassName';\n\t\t\t\t\tchildRetriverString = classNameWithTag;\n\t\t\t\t\tnoClassTesting = true;\n\t\t\t\t} else {\n\t\t\t\t\tchildRetriverFn = 'getElementsByTagName';\n\t\t\t\t\tchildRetriverString = 'span';\n\t\t\t\t\tnoClassTesting = false;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisIE: /msie/i.test(userAgent) && !win.opera,\n\t\t\t\t\thasSVG: Boolean(win.SVGAngle || doc.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')),\n\t\t\t\t\tisHeadLess: new RegExp(' HtmlUnit').test(userAgent),\n\t\t\t\t\tisWebKit: new RegExp(' AppleWebKit/').test(userAgent),\n\t\t\t\t\tchildRetriverFn: childRetriverFn,\n\t\t\t\t\tchildRetriverString: childRetriverString,\n\t\t\t\t\tnoClassTesting: noClassTesting\n\t\t\t\t};\n\t\t\t},\n\n\t\t\t/*\n * Create a html div element and attach it with a parent. All the subsequent operations are performed\n * by upding this dom tree only.\n *\n * @param {HTMLElement} - The html element where the newly created div is to be attached. If not passed,\n * the new div is appended on the body.\n */\n\t\t\tcreateContainer: function createContainer(containerParent) {\n\t\t\t\tvar body, container;\n\n\t\t\t\tif (containerParent && (containerParent.offsetWidth || containerParent.offsetHeight)) {\n\t\t\t\t\tif (containerParent.appendChild) {\n\t\t\t\t\t\tcontainerParent.appendChild(container = doc.createElement(DIV));\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody = doc.getElementsByTagName('body')[0];\n\n\t\t\t\t\tif (body && body.appendChild) {\n\t\t\t\t\t\tcontainer = doc.createElement(DIV);\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\tcontainerInstanceCount += 1;\n\t\t\t\t\t\tbody.appendChild(container);\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Finds a approximate position where the text is to be broken\n\t\t\tgetNearestBreakIndex: function getNearestBreakIndex(text, maxWidth, sl) {\n\t\t\t\tif (!text || !text.length) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tvar difference,\n\t\t\t\t getWidth = sl._getWidthFn(),\n\t\t\t\t charLen = 0,\n\t\t\t\t increment = 0,\n\t\t\t\t oriWidth = getWidth(text),\n\t\t\t\t avgWidth = oriWidth / text.length;\n\n\t\t\t\tdifference = maxWidth;\n\t\t\t\tcharLen = ceil(maxWidth / avgWidth);\n\n\t\t\t\tif (oriWidth < maxWidth) {\n\t\t\t\t\treturn text.length - 1;\n\t\t\t\t}\n\n\t\t\t\tif (charLen > text.length) {\n\t\t\t\t\tdifference = maxWidth - oriWidth;\n\t\t\t\t\tcharLen = text.length;\n\t\t\t\t}\n\n\t\t\t\twhile (difference > 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twhile (difference < 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn charLen;\n\t\t\t},\n\n\t\t\t/*\n * Determine lineheight of a text for a given style. It adds propery lineHeight to the style passed\n *\n * @param {Object} - The style based on which the text's metric needs to be calculated. The calculation happens\n * based on fontSize property, if its not present a default font size is assumed.\n *\n * @return {Object} - The style that was passed with lineHeight as a named propery set on the object.\n */\n\t\t\tsetLineHeight: function setLineHeight(styleObj) {\n\t\t\t\tvar fSize = styleObj.fontSize = styleObj.fontSize || '12px';\n\t\t\t\tstyleObj.lineHeight = styleObj.lineHeight || styleObj['line-height'] || parseInt(fSize, 10) * 1.2 + 'px';\n\t\t\t\treturn styleObj;\n\t\t\t}\n\t\t};\n\n\t\treturn lib;\n\t}\n};\n\nexports['default'] = lib;\nmodule.exports = exports['default'];","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"hyperdis\",[],t):\"object\"==typeof exports?exports.hyperdis=t():e.hyperdis=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){\"use strict\";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:\"_addPropInModel\",value:function(e,t){return this._graph.createNodesFrom(t,e),this}},{key:\"on\",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:\"CurrFrame\",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride(\"nextFrame\")).resetNodeValue.apply(n,P(e));return o}},{key:\"next\",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:\"NextFrame\",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride(\"currentFrame\")).resetNodeValue.apply(n,P(e));return o}},{key:\"lock\",value:function(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:\"unlock\",value:function(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:\"prop\",value:function(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:\"setProp\",value:function(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i 5 ? maxContainers : 5;\n maxContainers = maxContainers < 20 ? maxContainers : 20;\n\n this.maxContainers = maxContainers;\n this.first = null;\n this.last = null;\n this.containers = {};\n this.length = 0;\n this.rootNode = parentContainer;\n\n if (isBrowserLess) {\n svg = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'height', '0');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'width', '0');\n this.svgRoot = svg;\n this.rootNode.appendChild(svg);\n }\n}\n\nContainerManager.prototype.get = function (style) {\n var diff,\n key,\n containerObj,\n containers = this.containers,\n len = this.length,\n max = this.maxContainers,\n keyStr = '';\n\n for (key in slLib.supportedStyle) {\n if (style[key] !== undefined) {\n keyStr += slLib.supportedStyle[key] + ':' + style[key] + ';';\n }\n }\n\n if (!keyStr) {\n return false;\n }\n\n if (containerObj = containers[keyStr]) {\n if (this.first !== containerObj) {\n containerObj.prev && (containerObj.prev.next = containerObj.next);\n containerObj.next && (containerObj.next.prev = containerObj.prev);\n containerObj.next = this.first;\n containerObj.next.prev = containerObj;\n this.last === containerObj && (this.last = containerObj.prev);\n containerObj.prev = null;\n this.first = containerObj;\n }\n } else {\n if (len >= max) {\n diff = len - max + 1;\n // +1 is to remove an extra entry to make space for the new container to be added.\n while (diff--) {\n this.removeContainer(this.last);\n }\n }\n containerObj = this.addContainer(keyStr);\n }\n\n return containerObj;\n};\n\nContainerManager.prototype.addContainer = function (keyStr) {\n var node, container;\n\n this.containers[keyStr] = container = {\n next: null,\n prev: null,\n node: null,\n ellipsesWidth: 0,\n lineHeight: 0,\n dotWidth: 0,\n avgCharWidth: 4,\n keyStr: keyStr,\n charCache: {}\n };\n\n // Since the container objects are arranged from most recent to least recent order, we need to add the new\n // object at the beginning of the list.\n container.next = this.first;\n container.next && (container.next.prev = container);\n this.first = container;\n if (!this.last) {\n this.last = container;\n }\n this.length += 1;\n\n node = container.node = doc.createElement('div');\n this.rootNode.appendChild(node);\n\n if (documentSupport.isIE && !documentSupport.hasSVG) {\n node.style.setAttribute('cssText', keyStr);\n } else {\n node.setAttribute('style', keyStr);\n }\n\n node.setAttribute('aria-hidden', 'true');\n node.setAttribute('role', 'presentation');\n node.style.display = 'inline-block';\n\n node.innerHTML = slLib.testStrAvg; // A test string.\n container.lineHeight = node.offsetHeight;\n container.avgCharWidth = node.offsetWidth / 3;\n\n if (documentSupport.isBrowserLess) {\n node = container.svgText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n node.setAttribute('style', keyStr);\n this.svgRoot.appendChild(node);\n\n node.textContent = slLib.testStrAvg; // A test string.\n container.lineHeight = node.getBBox().height;\n container.avgCharWidth = (node.getBBox().width - SVG_BBOX_CORRECTION) / 3;\n\n node.textContent = '...';\n container.ellipsesWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n node.textContent = '.';\n container.dotWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n } else {\n node.innerHTML = '...';\n container.ellipsesWidth = node.offsetWidth;\n node.innerHTML = '.';\n container.dotWidth = node.offsetWidth;\n node.innerHTML = '';\n }\n\n return container;\n};\n\nContainerManager.prototype.removeContainer = function (cObj) {\n var keyStr = cObj.keyStr;\n\n if (!keyStr || !this.length || !cObj) {\n return;\n }\n this.length -= 1;\n\n cObj.prev && (cObj.prev.next = cObj.next);\n cObj.next && (cObj.next.prev = cObj.prev);\n this.first === cObj && (this.first = cObj.next);\n this.last === cObj && (this.last = cObj.prev);\n\n cObj.node.parentNode.removeChild(cObj.node);\n\n delete this.containers[keyStr];\n};\n\nContainerManager.prototype.dispose = function () {\n var key,\n containers = this.containers;\n\n this.maxContainers = null;\n for (key in containers) {\n this.removeContainer(containers[key]);\n }\n\n this.rootNode.parentNode.removeChild(this.rootNode);\n\n this.rootNode = null;\n this.first = null;\n this.last = null;\n};\n\nmodule.exports = ContainerManager;","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import map from \"./map\";\n\nexport default function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map.entries();\n else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n}\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return map();\n}\n\nfunction setMap(map, key, value) {\n map.set(key, value);\n}\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n scale.invertExtent = function(r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1, a, b, t,\n hiIndex;\n values.push(values[n] + this.step());\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo));\n hiIndex = getClosestIndexOf(values, hi);\n b = lo===hi ? a : Math.max(a, hiIndex - 1);\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n if (reverse) t = a, a = n - b, b = n - t; // map + swap\n return (a > b) ? undefined : domain().slice(a, b+1);\n };\n\n scale.invert = function (r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1,\n a,\n t;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo, 'left'));\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n return domain()[reverse ? n - a : a];\n }\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n\nfunction getClosestIndexOf (arr, value, side) {\n var low = 0,\n arrLen = arr.length,\n high = arrLen - 1,\n highVal,\n mid,\n d1,\n d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left'? high - 1 : high;\n } else {\n if (high === arr.length - 1) { return high; }\n return side === 'left'? high : high + 1;\n }\n}","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex3 = /^#([0-9a-f]{3})$/,\n reHex6 = /^#([0-9a-f]{6})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00\n : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nvar K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * rad2deg;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * deg2rad;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return hcl2lab(this).rgb();\n }\n}));\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis\";\nimport basisClosed from \"./basisClosed\";\nimport nogamma, {gamma} from \"./color\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return a + b * t;\n };\n}\n","import {basis} from \"./basis\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb\";\nimport array from \"./array\";\nimport date from \"./date\";\nimport number from \"./number\";\nimport object from \"./object\";\nimport string from \"./string\";\nimport constant from \"./constant\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : Array.isArray(b) ? array\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","import decompose, {identity} from \"./decompose\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b -= a, function(t) {\n return d.setTime(a + b * t), d;\n };\n}\n","import value from \"./value\";\n\nexport default function(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return Math.round(a + b * t);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number\";\nimport {parseCss, parseSvg} from \"./parse\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var rho = Math.SQRT2,\n rho2 = 2,\n rho4 = 4,\n epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n// p0 = [ux0, uy0, w0]\n// p1 = [ux1, uy1, w1]\nexport default function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n}\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function piecewise(interpolate, values) {\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns [\"123\", 0].\nexport default function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": function(x) { return Math.round(x).toString(10); },\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = new Date(+date)), date;\n }\n\n interval.floor = interval;\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval\";\nimport {durationSecond} from \"./duration\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval\";\nimport {durationMinute, durationSecond} from \"./duration\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval\";\nimport {durationDay, durationMinute} from \"./duration\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval\";\nimport {durationMinute, durationWeek} from \"./duration\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","import interval from \"./interval\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval\";\nimport {durationMinute} from \"./duration\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","import interval from \"./interval\";\nimport {durationHour} from \"./duration\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval\";\nimport {durationDay} from \"./duration\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval\";\nimport {durationWeek} from \"./duration\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newYear(y) {\n return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, newDate) {\n return function(string) {\n var d = newYear(1900),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newYear(d.y)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = newDate(newYear(d.y)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return newDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", localDate);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier, utcDate);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatWeekNumberISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {utcFormat} from \"./defaultLocale\";\n\nexport var isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : utcFormat(isoSpecifier);\n\nexport default formatIso;\n","import {isoSpecifier} from \"./isoFormat\";\nimport {utcParse} from \"./defaultLocale\";\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : utcParse(isoSpecifier);\n\nexport default parseIso;\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","export default function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return \"#\" + x;\n });\n}\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"./colors\";\n\nexport default colors(\"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6\");\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5\");\n","import colors from \"./colors\";\n\nexport default colors(\"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9\");\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar rainbow = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + \"\";\n}\n","import colors from \"./colors\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import {interpolateRgbBasis} from \"d3-interpolate\";\n\nexport default function(scheme) {\n return interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar c = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n","export const UNIT_GLOBAL_NAMESPACE = 'app.units';\nexport const UNIT_LOCAL_NAMESPACE = 'local.units';\nexport const LAYER_LOCAL_NAMESPACE = 'local.layers';\nexport const LAYER_GLOBAL_NAMESPACE = 'app.layers';\nexport const GROUP_GLOBAL_NAMESPACE = 'app.group';\nexport const GROUP_LOCAL_NAMESPACE = 'local.group';\nexport const CANVAS_LOCAL_NAMESPACE = 'local.canvas';\nexport const CANVAS_GLOBAL_NAMESPACE = 'app.canvas';\n\n","const ReservedFields = {\n ROW_ID: '__id__'\n};\n\nexport default ReservedFields;\n","const CommonProps = {\n ACTION_INF: 'actionInf',\n ON_LAYER_DRAW: 'onLayerDraw',\n MATRIX_CREATED: 'matrixCreated'\n};\n\nexport default CommonProps;\n","export const COORD_TYPES = {\n POLAR: 'polar',\n CARTESIAN: 'cartesian'\n};\nexport const DATA_TYPE = {\n FUNCTION: 'function',\n STRING: 'string',\n NUMBER: 'number',\n BOOLEAN: 'Boolean'\n};\nexport const SORT_ORDER_ASCENDING = 'asc';\nexport const SORT_ORDER_DESCENDING = 'desc';\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickTransform = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"#000\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"#000\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"))\n .style('transform', tickTransform);\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter\n : \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter);\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.tickTransform = function(_) {\n return arguments.length ? (tickTransform = _, axis) : tickTransform;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant\";\nimport curveLinear from \"./curve/linear\";\nimport line from \"./line\";\nimport {x as pointX, y as pointY} from \"./point\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import curveLinear from \"./linear\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n","import curveRadial, {curveRadialLinear} from \"./curve/radial\";\nimport line from \"./line\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n","export var slice = Array.prototype.slice;\n","import {pi, tau} from \"../math\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {pi, tau} from \"../math\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // proceed\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop\";\nimport {point} from \"./basis\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop\";\nimport {point} from \"./cardinal\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math\";\nimport {Cardinal} from \"./cardinal\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed\";\nimport noop from \"../noop\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen\";\nimport {point} from \"./catmullRom\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import {slice} from \"./array\";\nimport constant from \"./constant\";\nimport offsetNone from \"./offset/none\";\nimport orderNone from \"./order/none\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","import none from \"./none\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","var exponent = 3;\n\nexport var polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nexport var polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nexport var polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n","var pi = Math.PI,\n halfPi = pi / 2;\n\nexport function sinIn(t) {\n return 1 - Math.cos(t * halfPi);\n}\n\nexport function sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nexport function sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n","var b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nexport function bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nexport function bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nexport function bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n","var overshoot = 1.70158;\n\nexport var backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nexport var backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nexport var backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n","var tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nexport var elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nexport var elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nexport var elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export function x(d) {\n return d[0];\n}\n\nexport function y(d) {\n return d[1];\n}\n","function RedBlackTree() {\n this._ = null; // root node\n}\n\nexport function RedBlackNode(node) {\n node.U = // parent node\n node.C = // color - true for red, false for black\n node.L = // left node\n node.R = // right node\n node.P = // previous node\n node.N = null; // next node\n}\n\nRedBlackTree.prototype = {\n constructor: RedBlackTree,\n\n insert: function(after, node) {\n var parent, grandpa, uncle;\n\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = RedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n RedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n RedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n\n var parent = node.U,\n sibling,\n left = node.L,\n right = node.R,\n next,\n red;\n\n if (!left) next = right;\n else if (!right) next = left;\n else next = RedBlackFirst(right);\n\n if (parent) {\n if (parent.L === node) parent.L = next;\n else parent.R = next;\n } else {\n this._ = next;\n }\n\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) { node.C = false; return; }\n\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n RedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n RedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n RedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n RedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n\n if (node) node.C = false;\n }\n};\n\nfunction RedBlackRotateLeft(tree, node) {\n var p = node,\n q = node.R,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n}\n\nfunction RedBlackRotateRight(tree, node) {\n var p = node,\n q = node.L,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n}\n\nfunction RedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n}\n\nexport default RedBlackTree;\n","import {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createEdge(left, right, v0, v1) {\n var edge = [null, null],\n index = edges.push(edge) - 1;\n edge.left = left;\n edge.right = right;\n if (v0) setEdgeEnd(edge, left, right, v0);\n if (v1) setEdgeEnd(edge, right, left, v1);\n cells[left.index].halfedges.push(index);\n cells[right.index].halfedges.push(index);\n return edge;\n}\n\nexport function createBorderEdge(left, v0, v1) {\n var edge = [v0, v1];\n edge.left = left;\n return edge;\n}\n\nexport function setEdgeEnd(edge, left, right, vertex) {\n if (!edge[0] && !edge[1]) {\n edge[0] = vertex;\n edge.left = left;\n edge.right = right;\n } else if (edge.left === right) {\n edge[1] = vertex;\n } else {\n edge[0] = vertex;\n }\n}\n\n// Liang–Barsky line clipping.\nfunction clipEdge(edge, x0, y0, x1, y1) {\n var a = edge[0],\n b = edge[1],\n ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?\n\n if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];\n if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];\n return true;\n}\n\nfunction connectEdge(edge, x0, y0, x1, y1) {\n var v1 = edge[1];\n if (v1) return true;\n\n var v0 = edge[0],\n left = edge.left,\n right = edge.right,\n lx = left[0],\n ly = left[1],\n rx = right[0],\n ry = right[1],\n fx = (lx + rx) / 2,\n fy = (ly + ry) / 2,\n fm,\n fb;\n\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!v0) v0 = [fx, y0];\n else if (v0[1] >= y1) return;\n v1 = [fx, y1];\n } else {\n if (!v0) v0 = [fx, y1];\n else if (v0[1] < y0) return;\n v1 = [fx, y0];\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!v0) v0 = [(y0 - fb) / fm, y0];\n else if (v0[1] >= y1) return;\n v1 = [(y1 - fb) / fm, y1];\n } else {\n if (!v0) v0 = [(y1 - fb) / fm, y1];\n else if (v0[1] < y0) return;\n v1 = [(y0 - fb) / fm, y0];\n }\n } else {\n if (ly < ry) {\n if (!v0) v0 = [x0, fm * x0 + fb];\n else if (v0[0] >= x1) return;\n v1 = [x1, fm * x1 + fb];\n } else {\n if (!v0) v0 = [x1, fm * x1 + fb];\n else if (v0[0] < x0) return;\n v1 = [x0, fm * x0 + fb];\n }\n }\n }\n\n edge[0] = v0;\n edge[1] = v1;\n return true;\n}\n\nexport function clipEdges(x0, y0, x1, y1) {\n var i = edges.length,\n edge;\n\n while (i--) {\n if (!connectEdge(edge = edges[i], x0, y0, x1, y1)\n || !clipEdge(edge, x0, y0, x1, y1)\n || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon\n || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {\n delete edges[i];\n }\n }\n}\n","import {createBorderEdge} from \"./Edge\";\nimport {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createCell(site) {\n return cells[site.index] = {\n site: site,\n halfedges: []\n };\n}\n\nfunction cellHalfedgeAngle(cell, edge) {\n var site = cell.site,\n va = edge.left,\n vb = edge.right;\n if (site === vb) vb = va, va = site;\n if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);\n if (site === va) va = edge[1], vb = edge[0];\n else va = edge[0], vb = edge[1];\n return Math.atan2(va[0] - vb[0], vb[1] - va[1]);\n}\n\nexport function cellHalfedgeStart(cell, edge) {\n return edge[+(edge.left !== cell.site)];\n}\n\nexport function cellHalfedgeEnd(cell, edge) {\n return edge[+(edge.left === cell.site)];\n}\n\nexport function sortCellHalfedges() {\n for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {\n if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {\n var index = new Array(m),\n array = new Array(m);\n for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);\n index.sort(function(i, j) { return array[j] - array[i]; });\n for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];\n for (j = 0; j < m; ++j) halfedges[j] = array[j];\n }\n }\n}\n\nexport function clipCells(x0, y0, x1, y1) {\n var nCells = cells.length,\n iCell,\n cell,\n site,\n iHalfedge,\n halfedges,\n nHalfedges,\n start,\n startX,\n startY,\n end,\n endX,\n endY,\n cover = true;\n\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n halfedges = cell.halfedges;\n iHalfedge = halfedges.length;\n\n // Remove any dangling clipped edges.\n while (iHalfedge--) {\n if (!edges[halfedges[iHalfedge]]) {\n halfedges.splice(iHalfedge, 1);\n }\n }\n\n // Insert any border edges as necessary.\n iHalfedge = 0, nHalfedges = halfedges.length;\n while (iHalfedge < nHalfedges) {\n end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];\n start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];\n if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {\n halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,\n Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]\n : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]\n : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]\n : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]\n : null)) - 1);\n ++nHalfedges;\n }\n }\n\n if (nHalfedges) cover = false;\n }\n }\n\n // If there weren’t any edges, have the closest site cover the extent.\n // It doesn’t matter which corner of the extent we measure!\n if (cover) {\n var dx, dy, d2, dc = Infinity;\n\n for (iCell = 0, cover = null; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n dx = site[0] - x0;\n dy = site[1] - y0;\n d2 = dx * dx + dy * dy;\n if (d2 < dc) dc = d2, cover = cell;\n }\n }\n\n if (cover) {\n var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];\n cover.halfedges.push(\n edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,\n edges.push(createBorderEdge(site, v01, v11)) - 1,\n edges.push(createBorderEdge(site, v11, v10)) - 1,\n edges.push(createBorderEdge(site, v10, v00)) - 1\n );\n }\n }\n\n // Lastly delete any cells with no edges; these were entirely clipped.\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n if (!cell.halfedges.length) {\n delete cells[iCell];\n }\n }\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {circles, epsilon2} from \"./Diagram\";\n\nvar circlePool = [];\n\nexport var firstCircle;\n\nfunction Circle() {\n RedBlackNode(this);\n this.x =\n this.y =\n this.arc =\n this.site =\n this.cy = null;\n}\n\nexport function attachCircle(arc) {\n var lArc = arc.P,\n rArc = arc.N;\n\n if (!lArc || !rArc) return;\n\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n if (lSite === rSite) return;\n\n var bx = cSite[0],\n by = cSite[1],\n ax = lSite[0] - bx,\n ay = lSite[1] - by,\n cx = rSite[0] - bx,\n cy = rSite[1] - by;\n\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -epsilon2) return;\n\n var ha = ax * ax + ay * ay,\n hc = cx * cx + cy * cy,\n x = (cy * ha - ay * hc) / d,\n y = (ax * hc - cx * ha) / d;\n\n var circle = circlePool.pop() || new Circle;\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom\n\n arc.circle = circle;\n\n var before = null,\n node = circles._;\n\n while (node) {\n if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {\n if (node.L) node = node.L;\n else { before = node.P; break; }\n } else {\n if (node.R) node = node.R;\n else { before = node; break; }\n }\n }\n\n circles.insert(before, circle);\n if (!before) firstCircle = circle;\n}\n\nexport function detachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) firstCircle = circle.N;\n circles.remove(circle);\n circlePool.push(circle);\n RedBlackNode(circle);\n arc.circle = null;\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {createCell} from \"./Cell\";\nimport {attachCircle, detachCircle} from \"./Circle\";\nimport {createEdge, setEdgeEnd} from \"./Edge\";\nimport {beaches, epsilon} from \"./Diagram\";\n\nvar beachPool = [];\n\nfunction Beach() {\n RedBlackNode(this);\n this.edge =\n this.site =\n this.circle = null;\n}\n\nfunction createBeach(site) {\n var beach = beachPool.pop() || new Beach;\n beach.site = site;\n return beach;\n}\n\nfunction detachBeach(beach) {\n detachCircle(beach);\n beaches.remove(beach);\n beachPool.push(beach);\n RedBlackNode(beach);\n}\n\nexport function removeBeach(beach) {\n var circle = beach.circle,\n x = circle.x,\n y = circle.cy,\n vertex = [x, y],\n previous = beach.P,\n next = beach.N,\n disappearing = [beach];\n\n detachBeach(beach);\n\n var lArc = previous;\n while (lArc.circle\n && Math.abs(x - lArc.circle.x) < epsilon\n && Math.abs(y - lArc.circle.cy) < epsilon) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n detachBeach(lArc);\n lArc = previous;\n }\n\n disappearing.unshift(lArc);\n detachCircle(lArc);\n\n var rArc = next;\n while (rArc.circle\n && Math.abs(x - rArc.circle.x) < epsilon\n && Math.abs(y - rArc.circle.cy) < epsilon) {\n next = rArc.N;\n disappearing.push(rArc);\n detachBeach(rArc);\n rArc = next;\n }\n\n disappearing.push(rArc);\n detachCircle(rArc);\n\n var nArcs = disappearing.length,\n iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);\n\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nexport function addBeach(site) {\n var x = site[0],\n directrix = site[1],\n lArc,\n rArc,\n dxl,\n dxr,\n node = beaches._;\n\n while (node) {\n dxl = leftBreakPoint(node, directrix) - x;\n if (dxl > epsilon) node = node.L; else {\n dxr = x - rightBreakPoint(node, directrix);\n if (dxr > epsilon) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -epsilon) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -epsilon) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n\n createCell(site);\n var newArc = createBeach(site);\n beaches.insert(lArc, newArc);\n\n if (!lArc && !rArc) return;\n\n if (lArc === rArc) {\n detachCircle(lArc);\n rArc = createBeach(lArc.site);\n beaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);\n attachCircle(lArc);\n attachCircle(rArc);\n return;\n }\n\n if (!rArc) { // && lArc\n newArc.edge = createEdge(lArc.site, newArc.site);\n return;\n }\n\n // else lArc !== rArc\n detachCircle(lArc);\n detachCircle(rArc);\n\n var lSite = lArc.site,\n ax = lSite[0],\n ay = lSite[1],\n bx = site[0] - ax,\n by = site[1] - ay,\n rSite = rArc.site,\n cx = rSite[0] - ax,\n cy = rSite[1] - ay,\n d = 2 * (bx * cy - by * cx),\n hb = bx * bx + by * by,\n hc = cx * cx + cy * cy,\n vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];\n\n setEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = createEdge(lSite, site, null, vertex);\n rArc.edge = createEdge(site, rSite, null, vertex);\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nfunction leftBreakPoint(arc, directrix) {\n var site = arc.site,\n rfocx = site[0],\n rfocy = site[1],\n pby2 = rfocy - directrix;\n\n if (!pby2) return rfocx;\n\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n\n site = lArc.site;\n var lfocx = site[0],\n lfocy = site[1],\n plby2 = lfocy - directrix;\n\n if (!plby2) return lfocx;\n\n var hl = lfocx - rfocx,\n aby2 = 1 / pby2 - 1 / plby2,\n b = hl / plby2;\n\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n\n return (rfocx + lfocx) / 2;\n}\n\nfunction rightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return leftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site[1] === directrix ? site[0] : Infinity;\n}\n","import {addBeach, removeBeach} from \"./Beach\";\nimport {sortCellHalfedges, cellHalfedgeStart, clipCells} from \"./Cell\";\nimport {firstCircle} from \"./Circle\";\nimport {clipEdges} from \"./Edge\";\nimport RedBlackTree from \"./RedBlackTree\";\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var beaches;\nexport var cells;\nexport var circles;\nexport var edges;\n\nfunction triangleArea(a, b, c) {\n return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);\n}\n\nfunction lexicographic(a, b) {\n return b[1] - a[1]\n || b[0] - a[0];\n}\n\nexport default function Diagram(sites, extent) {\n var site = sites.sort(lexicographic).pop(),\n x,\n y,\n circle;\n\n edges = [];\n cells = new Array(sites.length);\n beaches = new RedBlackTree;\n circles = new RedBlackTree;\n\n while (true) {\n circle = firstCircle;\n if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {\n if (site[0] !== x || site[1] !== y) {\n addBeach(site);\n x = site[0], y = site[1];\n }\n site = sites.pop();\n } else if (circle) {\n removeBeach(circle.arc);\n } else {\n break;\n }\n }\n\n sortCellHalfedges();\n\n if (extent) {\n var x0 = +extent[0][0],\n y0 = +extent[0][1],\n x1 = +extent[1][0],\n y1 = +extent[1][1];\n clipEdges(x0, y0, x1, y1);\n clipCells(x0, y0, x1, y1);\n }\n\n this.edges = edges;\n this.cells = cells;\n\n beaches =\n circles =\n edges =\n cells = null;\n}\n\nDiagram.prototype = {\n constructor: Diagram,\n\n polygons: function() {\n var edges = this.edges;\n\n return this.cells.map(function(cell) {\n var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });\n polygon.data = cell.site.data;\n return polygon;\n });\n },\n\n triangles: function() {\n var triangles = [],\n edges = this.edges;\n\n this.cells.forEach(function(cell, i) {\n if (!(m = (halfedges = cell.halfedges).length)) return;\n var site = cell.site,\n halfedges,\n j = -1,\n m,\n s0,\n e1 = edges[halfedges[m - 1]],\n s1 = e1.left === site ? e1.right : e1.left;\n\n while (++j < m) {\n s0 = s1;\n e1 = edges[halfedges[j]];\n s1 = e1.left === site ? e1.right : e1.left;\n if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {\n triangles.push([site.data, s0.data, s1.data]);\n }\n }\n });\n\n return triangles;\n },\n\n links: function() {\n return this.edges.filter(function(edge) {\n return edge.right;\n }).map(function(edge) {\n return {\n source: edge.left.data,\n target: edge.right.data\n };\n });\n },\n\n find: function(x, y, radius) {\n var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;\n\n // Use the previously-found cell, or start with an arbitrary one.\n while (!(cell = that.cells[i1])) if (++i1 >= n) return null;\n var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;\n\n // Traverse the half-edges to find a closer cell, if any.\n do {\n cell = that.cells[i0 = i1], i1 = null;\n cell.halfedges.forEach(function(e) {\n var edge = that.edges[e], v = edge.left;\n if ((v === cell.site || !v) && !(v = edge.right)) return;\n var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;\n if (v2 < d2) d2 = v2, i1 = v.index;\n });\n } while (i1 !== null);\n\n that._found = i0;\n\n return radius == null || d2 <= radius * radius ? cell.site : null;\n }\n}\n","import constant from \"./constant\";\nimport {x as pointX, y as pointY} from \"./point\";\nimport Diagram, {epsilon} from \"./Diagram\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n extent = null;\n\n function voronoi(data) {\n return new Diagram(data.map(function(d, i) {\n var s = [Math.round(x(d, i, data) / epsilon) * epsilon, Math.round(y(d, i, data) / epsilon) * epsilon];\n s.index = i;\n s.data = d;\n return s;\n }), extent);\n }\n\n voronoi.polygons = function(data) {\n return voronoi(data).polygons();\n };\n\n voronoi.links = function(data) {\n return voronoi(data).links();\n };\n\n voronoi.triangles = function(data) {\n return voronoi(data).triangles();\n };\n\n voronoi.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), voronoi) : x;\n };\n\n voronoi.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), voronoi) : y;\n };\n\n voronoi.extent = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];\n };\n\n voronoi.size = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];\n };\n\n return voronoi;\n}\n","import { defaultValue } from '../common-utils';\n\nconst sortSelection = (dataObjects, updateData, sortFn) =>\n (a, b) => {\n const kA = a[0];\n const kB = b[0];\n return sortFn([a[0], dataObjects.get(kA), updateData.get(kA)], [kB, dataObjects.get(kB), updateData.get(kB)]);\n };\n\n/**\n * This class represents a selection applied on a data array.\n *\n * @class Selection\n */\nclass Selection {\n /**\n * Creates an instance of Selection.\n * @param {Array} data Array of DataObjects.\n * @memberof Selection\n */\n constructor (idGetter) {\n this._dataObjects = new Map();\n this._updateData = new Map();\n this._enterData = new Map();\n this._exitData = new Map();\n this._idGetter = idGetter;\n }\n\n /**\n * This method is used to supply seed data to a selection.\n *\n * @param {Array} newData Seed data to create the enter selection.\n * @param {Functon | undefined } idGetter This function is used to uniqely identify a data entry.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n data (newData) {\n const entryData = new Map();\n const exitdata = new Map();\n const tempMap = new Map();\n const duplicateData = new Map();\n const updatedData = this._updateData;\n const idGetter = this._idGetter;\n\n newData.forEach((...params) => {\n const key = idGetter ? idGetter(...params) : params[1];\n if (!tempMap.has(key)) {\n tempMap.set(key, params[0]);\n } else {\n duplicateData.push(key, params[0]);\n }\n });\n\n let val;\n // prepare enter data\n let entries = tempMap.entries();\n while (val = entries.next().value) {\n if (!updatedData.has(val[0])) {\n entryData.set(val[0], val[1]);\n } else {\n updatedData.set(val[0], val[1]);\n }\n }\n // prepare exit data\n entries = updatedData.entries();\n while (val = entries.next().value) {\n if (!tempMap.has(val[0])) {\n exitdata.set(val[0], val[1]);\n }\n }\n\n // put duplicate data to exit list\n entries = duplicateData.entries();\n while (val = entries.next().value) {\n exitdata.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = updatedData;\n newSelection._dataObjects = this._dataObjects;\n newSelection._enterData = entryData;\n newSelection._exitData = exitdata;\n\n return newSelection;\n }\n\n /**\n * Applies the supplied callback to each data element\n * and returns a new selection.\n *\n * @param {Function} callback Callback to execute on each item.\n * @return {Selection} New selection with data created using callback.\n * @memberof Selection\n */\n append (callback) {\n let val;\n const dataObjects = new Map();\n const data = new Map();\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n dataObjects.set(val[0], callback(val[1]));\n data.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = data;\n newSelection._dataObjects = dataObjects;\n\n return newSelection;\n }\n\n /**\n * This method returns an enter selection that\n * allows or update operations.\n *\n * @return {Selection} Instance of enter selection.\n * @memberof Selection\n */\n enter () {\n this._mode = 'enter';\n return this;\n }\n\n /**\n * Returns a selection with exit data.\n *\n * @return {Selection} Instance of selection.\n * @memberof Selection\n */\n exit () {\n this._mode = 'exit';\n return this;\n }\n\n /**\n * This method merges the data of one selection with another.\n *\n * @param {Selection} selection Instance of selection.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n merge (target) {\n const mergedObjects = new Map();\n const mergedData = new Map();\n let val;\n let entries;\n\n // merge Object and data present in this selection\n entries = this._updateData.entries();\n while (val = entries.next().value) {\n if (!this._exitData.has(val[0])) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], this._dataObjects.get(val[0]));\n }\n }\n\n // merge object from target selection\n entries = target._updateData.entries();\n while (val = entries.next().value) {\n if (!(mergedData.has(val[0]) || target._exitData.has(val[0]))) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], target._dataObjects.get(val[0]));\n }\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = mergedData;\n newSelection._dataObjects = mergedObjects;\n\n return newSelection;\n }\n\n each (fn) {\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n fn(val[1], this._updateData.get(val[0]), val[0]);\n }\n }\n\n map (fn) {\n const newdata = new Map();\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n newdata.set(val[0], fn(val[1], this._updateData.get(val[0]), val[0]));\n }\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = this._updateData;\n newSelection._dataObjects = newdata;\n\n return newSelection;\n }\n\n remove () {\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n\n currentData.clear();\n\n return this;\n }\n\n sort (sortFn) {\n const updateData = this._updateData;\n const dataObjects = this._dataObjects;\n const sortSel = sortSelection(dataObjects, updateData, sortFn);\n\n this._updateData = new Map([...updateData.entries()].sort(sortSel));\n this._dataObjects = new Map([...dataObjects.entries()].sort(sortSel));\n return this;\n }\n\n /**\n * Gets the object bound to a class\n *\n * @return {Object} current data set bound to the class\n * @memberof Selection\n */\n getObjects () {\n let val;\n const objects = [];\n const dataObjects = this._dataObjects;\n // select the data to create object\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n if (dataObjects.has(val[0])) {\n objects.push(dataObjects.get(val[0]));\n }\n }\n\n return objects;\n }\n}\n\nexport default Selection;\n","export const ORDER_ASCENDING = 'ascending';\nexport const ORDER_DESCENDING = 'descending';\nexport const ORDER_NONE = 'none';\nexport const OFFSET_DIVERGING = 'diverging';\nexport const OFFSET_NONE = 'none';\nexport const OFFSET_EXPAND = 'expand';\nexport const OFFSET_WIGGLE = 'wiggle';\n","/* global window, requestAnimationFrame, cancelAnimationFrame */\nimport { FieldType, DimensionSubtype, DateTimeFormatter, DM_DERIVATIVES, default as DataModel } from 'datamodel';\nimport {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom\n} from 'd3-axis';\nimport {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolWye,\n symbolTriangle,\n symbol,\n stack as d3Stack,\n stackOffsetDiverging,\n stackOrderNone,\n stackOrderAscending,\n stackOrderDescending,\n stackOffsetNone,\n stackOffsetExpand,\n stackOffsetWiggle,\n pie,\n arc,\n line,\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n area\n} from 'd3-shape';\nimport { scaleBand } from 'd3-scale';\nimport { nest } from 'd3-collection';\nimport {\n interpolate,\n interpolateRgb,\n piecewise,\n interpolateNumber,\n interpolateHslLong\n} from 'd3-interpolate';\nimport {\n easeCubic,\n easeBounce,\n easePoly,\n easeBack,\n easeCircle,\n easeLinear,\n easeElastic\n} from 'd3-ease';\nimport {\n color,\n rgb,\n hsl\n} from 'd3-color';\nimport { voronoi } from 'd3-voronoi';\nimport { dataSelect } from './DataSystem';\nimport { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING } from './enums';\nimport * as STACK_CONFIG from './enums/stack-config';\n\nconst { CATEGORICAL, TEMPORAL } = DimensionSubtype;\nconst { STRING, FUNCTION } = DATA_TYPE;\nconst { InvalidAwareTypes } = DataModel;\nconst HTMLElement = window.HTMLElement;\n\nconst isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n};\n\n/**\n * Returns unique id\n * @return {string} Unique id string\n */\nconst\n getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Deep copies an object and returns a new object.\n * @param {Object} o Object to clone\n * @return {Object} New Object.\n */\nconst clone = (o) => {\n const output = {};\n let v;\n for (const key in o) {\n if ({}.hasOwnProperty.call(o, key)) {\n v = o[key];\n output[key] = isSimpleObject(v) ? clone(v) : v;\n }\n }\n return output;\n};\n\n/**\n* Checks the existence of keys in an object\n* @param {Array} keys Set of keys which are to be checked\n* @param {Object} obj whose keys are checked from the set of keys provided\n* @return {Object} Error if the keys are absent, or the object itself\n*/\nconst checkExistence = (keys, obj) => {\n const nonExistentKeys = [];\n keys.forEach((key) => {\n if (key in obj) {\n return;\n }\n nonExistentKeys.push(key);\n });\n return nonExistentKeys;\n};\n\nconst sanitizeIP = {\n typeObj: (keys, obj) => {\n if (typeof obj !== 'object') {\n return Error('Argument type object expected');\n }\n\n const nonExistentKeys = checkExistence(keys, obj);\n if (nonExistentKeys.length) {\n return Error(`Missing keys from parameter ${nonExistentKeys.join(', ')}`);\n }\n return obj;\n },\n\n /* istanbul ignore next */ htmlElem: (elem) => {\n if (!(elem instanceof HTMLElement)) {\n return Error('HTMLElement required');\n }\n return elem;\n }\n};\n\n/**\n * Gets the maximum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Maximum value\n */\nconst getMax = (data, field) => Math.max(...data.map(d => d[field]));\n\n/**\n * Gets the minimum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Minimum value\n */\nconst getMin = (data, field) => Math.min(...data.map(d => d[field]));\n\n/**\n * Gets the domain from the data based on the field name and type of field\n * @param {Array. | Array.} data Data Array\n * @param {Array.} fields Array of fields from where the domain will be calculated\n * @param {string} fieldType Type of field - nominal, quantitiative, temporal.\n * @return {Array} Usually contains a min and max value if field is quantitative or\n * an array of values if field type is nominal or ordinal\n */\nconst getDomainFromData = (data, fields, fieldType) => {\n let domain;\n const domArr = [];\n data = data[0] instanceof Array ? data : [data];\n switch (fieldType) {\n case CATEGORICAL:\n domain = [].concat(...data.map(arr => arr.map(d => d[fields[0]]).filter(d => d !== undefined)));\n break;\n default:\n for (let i = 0, len = data.length; i < len; i++) {\n const arr = data[i];\n const [field0, field1] = fields;\n const arr0 = arr.filter(d => !isNaN(d[field0]));\n const arr1 = arr.filter(d => !isNaN(d[field1]));\n if (arr0.length || arr1.length) {\n const firstMin = getMin(arr0, field0);\n const secondMin = getMin(arr1, field1);\n const firstMax = getMax(arr0, field0);\n const secondMax = getMax(arr1, field1);\n domArr.push([Math.min(firstMin, secondMin), Math.max(firstMax, secondMax)]);\n }\n }\n domain = domArr.length ? [Math.min(...domArr.map(d => d[0])), Math.max(...domArr.map(d => d[1]))] : [];\n break;\n }\n return domain;\n};\n\nconst sanitizeDomainWhenEqual = (domain) => {\n if (domain[0] === domain[1]) {\n domain[0] = domain[0] > 0 ? 0 : domain[0];\n domain[1] = domain[1] > 0 ? domain[1] : 0;\n }\n return domain;\n};\n\n/**\n * Union Domain values\n * @param {Array.} domains Array of domain values\n * @param {string} fieldType type of field - dimension,measure or datetime.\n * @return {Array} Unioned domain of all domain values.\n */\nconst unionDomain = (domains, fieldType) => {\n let domain = [];\n domains = domains.filter(dom => dom && dom.length);\n if (domains.length) {\n if (fieldType === CATEGORICAL) {\n domain = [].concat(...domains);\n } else {\n domain = [Math.min(...domains.map(d => d[0])), Math.max(...domains.map(d => d[1]))];\n }\n }\n\n return domain;\n};\n\nconst symbolFns = {\n circle: symbolCircle,\n cross: symbolCross,\n diamond: symbolDiamond,\n square: symbolSquare,\n star: symbolStar,\n wye: symbolWye,\n triangle: symbolTriangle\n};\n\nconst easeFns = {\n cubic: easeCubic,\n bounce: easeBounce,\n linear: easeLinear,\n elastic: easeElastic,\n back: easeBack,\n poly: easePoly,\n circle: easeCircle\n};\n\n/**\n * Returns the maximum or minimum points of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @param {string} minOrMax minimum or maximum.\n * @return {Object} Minimum or maximum point.\n */\nconst getExtremePoint = (points, compareValue, minOrMax) => {\n let extremePoint;\n let point;\n const len = points.length;\n let minOrMaxVal = minOrMax === 'max' ? -Infinity : Infinity;\n let val;\n\n for (let i = 0; i < len; i++) {\n point = points[i];\n val = point[compareValue];\n if (minOrMax === 'min' ? val < minOrMaxVal : val > minOrMaxVal) {\n minOrMaxVal = val;\n extremePoint = point;\n }\n }\n\n return extremePoint;\n};\n\n/**\n * Returns the minimum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Minimum point.\n */\nconst getMinPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'min');\n\n/**\n * Returns the maximum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Maximum point.\n */\nconst getMaxPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'max');\n\n/**\n * Gets the index of the closest value of the given value from the array.\n * @param {Array} arr Array of values\n * @param {number} value Value from which the nearest value will be calculated.\n * @param {string} side side property.\n * @return {number} index of the closest value\n */\n/* istanbul ignore next */const getClosestIndexOf = (arr, value, side) => {\n let low = 0;\n const arrLen = arr.length;\n let high = arrLen - 1;\n\n let mid;\n let d1;\n let d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n const highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left' ? high - 1 : high;\n }\n if (high === arr.length - 1) { return high; }\n return side === 'left' ? high : high + 1;\n};\n\nconst getNearestValue = (data, key) => {\n const filterData = data.filter(d => typeof d === 'number');\n return filterData[getClosestIndexOf(filterData, key)];\n};\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst getWindow = () => window;\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst reqAnimFrame = (() => requestAnimationFrame)();\n\nconst cancelAnimFrame = (() => cancelAnimationFrame)();\n\n/**\n * Capitalizes the first letter of the word\n * @param {string} text word\n * @return {string} Capitalized word\n */\nconst capitalizeFirst = (text) => {\n text = text.toLowerCase();\n\n return text.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1));\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst unique = arr => ([...new Set(arr)]);\n\n/**\n * Gets the minimum difference between two consecutive numbers in an array.\n * @param {Array} arr Array of numbers\n * @param {number} index index of the value\n * @return {number} minimum difference between values\n */\n/* istanbul ignore next */ const getMinDiff = (arr, index) => {\n let diff;\n let uniqueVals;\n if (index !== undefined) {\n uniqueVals = unique(arr.map(d => d[index]));\n } else {\n uniqueVals = unique(arr);\n }\n if (uniqueVals.length > 1) {\n diff = Math.abs(uniqueVals[1] - uniqueVals[0]);\n for (let i = 2, len = uniqueVals.length; i < len; i++) {\n diff = Math.min(diff, Math.abs(uniqueVals[i] - uniqueVals[i - 1]));\n }\n } else {\n diff = uniqueVals[0];\n }\n\n return diff;\n};\n\n/**\n * Returns the class name appended with a given id.\n * @param {string} cls class name\n * @param {string} id unique identifier\n * @param {string} prefix string needed to add before the classname\n * @return {string} qualified class name\n */\n/* istanbul ignore next */const getQualifiedClassName = (cls, id, prefix) => {\n cls = cls.replace(/^\\.*/, '');\n return [`${prefix}-${cls}`, `${prefix}-${cls}-${id}`];\n};\n\n/**\n * This method is used to set the default value for variables\n * without sullying the code with conditional statements.\n *\n * @export\n * @param {any} param The parameter to test.\n * @param {any} value The default value to assign.\n * @return {any} The value.\n */\n/* istanbul ignore next */ const defaultValue = (param, value) => {\n if (typeof param === 'undefined' || (typeof param === 'object' && !param)) {\n return value;\n }\n return param;\n};\n\n/**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} graph graph whose dependency order has to be generated\n * @return {Object}\n */\nconst getDependencyOrder = (graph) => {\n const dependencyOrder = [];\n const visited = {};\n const keys = Object.keys(graph);\n /**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} name\n * @return {Object}\n */\n const visit = (name) => {\n if (dependencyOrder.length === keys.length) {\n return true;\n }\n visited[name] = true;\n const edges = graph[name];\n for (let e = 0; e < edges.length; e++) {\n const dep = edges[e];\n if (!visited[dep]) {\n visit(dep);\n }\n }\n\n dependencyOrder.push(name);\n return false;\n };\n\n for (let i = 0; i < keys.length; i++) {\n if (visit(keys[i], i)) break;\n }\n\n return dependencyOrder;\n};\n\n/**\n * Iterates over the properties of an object and applies the function\n *\n * @param {any} obj object to be iterated upon\n * @param {any} fn function to be applied on it\n */\nconst objectIterator = (obj, fn) => {\n for (const key in obj) {\n if (Object.hasOwnProperty.call(obj, key)) {\n fn(key, obj);\n }\n }\n};\n\n/**\n * This class creates a d3 voronoi for retrieving the nearest neighbour of any point from a set of two\n * dimensional points\n * @class Voronoi\n */\n/* istanbul ignore next */ class Voronoi {\n /**\n * Initialize the voronoi with the data given.\n * @param {Array.} data Array of points.\n */\n constructor (data = []) {\n this._voronoi = voronoi().x(d => d.x).y(d => d.y);\n this.data(data);\n }\n\n /**\n * Sets the data to voronoi\n * @param {Array.} data Array of objects.\n * @return {Voronoi} Instance of voronoi.\n */\n data (data) {\n if (data) {\n this._voronoiFn = this._voronoi(data);\n }\n return this;\n }\n\n /**\n * Finds the closest point to the x and y position given.\n * @param {number} x x value\n * @param {number} y y value\n * @param {number} radius search radius.\n * @return {Object} Details of the nearest point.\n */\n find (x, y, radius) {\n return this._voronoiFn.find(x, y, radius);\n }\n}\n\nconst getObjProp = (obj, ...fields) => {\n if (obj === undefined || obj === null) {\n return obj;\n }\n let retObj = obj;\n for (let i = 0, len = fields.length; i < len; i++) {\n retObj = retObj[fields[i]];\n if (retObj === undefined || retObj === null) {\n break;\n }\n }\n return retObj;\n};\n\n/**\n * Sanitize an input number / string mixed number. Currently dot in the no is not supported.\n *\n * @param {number | string} val pure number or string mixed number\n * @return {number | null} Number if it can be extracted. Otherwise null\n */\nconst intSanitizer = (val) => {\n const arr = val.toString().match(/(\\d+)(px)*/g);\n if (!arr) {\n // If only characters are passed\n return null;\n }\n\n return parseInt(arr[0], 10);\n};\n\nconst generateGetterSetters = (context, props) => {\n Object.entries(props).forEach((propInfo) => {\n const prop = propInfo[0];\n const { sanitization, preset, onset, typeChecker, defaultValue: defVal } = propInfo[1];\n const prototype = context.constructor.prototype;\n if (!(Object.hasOwnProperty.call(prototype, prop))) {\n if (defVal) {\n context[`_${prop}`] = defVal;\n }\n context[prop] = (...params) => {\n if (params.length) {\n let value = params[0];\n if (sanitization) {\n value = sanitization(context, params[0], context[`_${prop}`]);\n }\n if (preset) {\n preset(context, value);\n }\n if (typeChecker && !typeChecker(value)) {\n return context[`_${prop}`];\n }\n context[`_${prop}`] = value;\n if (onset) {\n onset(context, value);\n }\n return context;\n } return context[`_${prop}`];\n };\n }\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} prop\n */\nconst getArraySum = (arr, prop) => arr.reduce((total, elem) => {\n total += prop ? elem[prop] : elem;\n return total;\n}, 0);\n\n/**\n *\n *\n * @param {*} arr1\n * @param {*} arr2\n *\n */\nconst arraysEqual = (arr1, arr2) => {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = arr1.length; i >= 0; i--) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n\n return true;\n};\n\n/* eslint valid-typeof:0 */\n/**\n * Returns a validation function which can be used to validate variables against a type and value\n *\n * @param {any} type type of value that the object should have\n * @return {Object} validation function\n */\nconst isEqual = type => (oldVal, newVal) => {\n if (type === 'Array') {\n if (!oldVal) {\n return false;\n }\n return arraysEqual(oldVal, newVal);\n } else if (type === 'Object') {\n return Object.is(oldVal, newVal);\n } return oldVal === newVal;\n};\n\n/**\n * Description @todo\n *\n * @param {any} transactionModel @todo\n * @param {any} transactionEndpoint @todo\n * @param {any} transactionItems @todo\n * @return {any} @todo\n */\nconst enableChainedTransaction = (transactionModel, transactionEndpoint, transactionItems) =>\n transactionItems.forEach(item => transactionModel\n .registerImmediateListener(item, ([, newVal]) => transactionEndpoint[item](newVal)));\n\n/**\n * Chceks if the element is istanceof HTMLElement\n *\n * @param {Object} elem any JS Object\n */\nconst isHTMLElem = elem => elem instanceof HTMLElement;\n\nconst ERROR_MSG = {\n INTERFACE_IMPL: 'Method not implemented'\n};\n\n/**\n * Merges the sink object in the source by recursively iterating through the object properties\n * @param {Object} source Source Object\n * @param {Object} sink Sink Object\n * @return {Object} Merged object\n */\nconst mergeRecursive = (source, sink) => {\n for (const prop in sink) {\n if (isSimpleObject(source[prop]) && isSimpleObject(sink[prop])) {\n mergeRecursive(source[prop], sink[prop]);\n } else if (sink[prop] instanceof Object && sink[prop].constructor === Object) {\n source[prop] = {};\n mergeRecursive(source[prop], sink[prop]);\n } else {\n source[prop] = sink[prop];\n }\n }\n return source;\n};\n\n/**\n * Creates a selection set from a data set with corresponding attributes\n *\n * @export\n * @param {Selection} sel contains previous selection\n * @param {Object} appendObj Object to be appended\n * @param {Array} data Data based on which the selection is entered/updated/removed\n * @param {Object} [attrs={}] Attributes to be set on the data\n * @return {Selection} Merged selection\n */\nconst createSelection = (sel, appendObj, data, idFn) => {\n let selection = sel || dataSelect(idFn);\n\n selection = selection.data(data);\n\n const enter = selection.enter().append(appendObj);\n const mergedSelection = enter.merge(selection);\n\n const exitSelection = selection.exit();\n exitSelection.getObjects().forEach(inst => inst.remove());\n exitSelection.remove();\n return mergedSelection;\n};\n\nconst interpolateArray = (data, fitCount) => {\n const linearInterpolate = function (before, after, atPoint) {\n return before + (after - before) * atPoint;\n };\n const newData = [];\n const springFactor = ((data.length - 1) / (fitCount - 1));\n newData[0] = data[0]; // for new allocation\n for (let i = 1; i < fitCount - 1; i++) {\n const tmp = i * springFactor;\n const before = (Math.floor(tmp)).toFixed();\n const after = (Math.ceil(tmp)).toFixed();\n const atPoint = tmp - before;\n newData[i] = linearInterpolate(data[before], data[after], atPoint);\n }\n newData[fitCount - 1] = data[data.length - 1]; // for new allocation\n return newData;\n};\n\n/**\n *\n *\n * @param {*} fn\n */\nconst nextFrame = (fn) => {\n setTimeout(() => {\n fn();\n }, 0);\n};\n\n/**\n *\n *\n * @param {*} angle\n */\nconst angleToRadian = angle => angle * Math.PI / 180;\n\n/**\n *\n *\n * @param {*} newName\n * @param {*} oldName\n */\nconst replaceCSSPrefix = () => {\n // @todo\n};\n\n/**\n * Gets the interpolator function from d3 color\n *\n */\nconst interpolator = () => interpolate;\n\n/**\n * Gets the number interpolator from d3 color\n *\n */\nconst numberInterpolator = () => interpolateNumber;\n\n/**\n * Gets the rgb interpolator from d3 color\n *\n */\nconst colorInterpolator = () => interpolateRgb;\n\n/**\n * Gets the hsl interpolator from d3 color\n *\n */\nconst hslInterpolator = () => interpolateHslLong;\n\nconst transformColors = () => ({\n color,\n rgb,\n hsl\n});\n\n/**\n * Gets the piecewise interpolator from d3 color\n *\n */\nconst piecewiseInterpolator = () => piecewise;\n\nfunction hue2rgb (p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\n\n /**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number l The lightness\n * @return Array The RGB representation\n */\nconst hslToRgb = (h, s, l, a = 1) => {\n let r;\n let g;\n let b;\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\n /**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nconst rgbToHsv = (r, g, b, a = 1) => {\n r = +r; g = +g; b = +b; a = +a;\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n default: break;\n }\n h /= 6;\n }\n return [h, s, l, a];\n};\n\n /**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nconst hsvToRgb = (h, s, v, a = 1) => {\n let r;\n let g;\n let b;\n\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0: r = v; g = t; b = p; break;\n case 1: r = q; g = v; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 3: r = p; g = q; b = v; break;\n case 4: r = t; g = p; b = v; break;\n case 5: r = v; g = p; b = q; break;\n default: break;\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\nconst hexToHsv = (hex) => {\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? rgbToHsv(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : '';\n};\n\nconst detectColor = (col) => {\n const matchRgb = /rgb\\((\\d{1,3}), (\\d{1,3}), (\\d{1,3})\\)/;\n const matchHsl = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\n\n // Source : https://gist.github.com/sethlopezme/d072b945969a3cc2cc11\n // eslint-disable-next-line\n const matchRgba = /rgba?\\(((25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,\\s*?){2}(25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,?\\s*([01]\\.?\\d*?)?\\)/;\n // eslint-disable-next-line\n const matchHsla = /^hsla\\(([\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n const matchHex = /^#([0-9a-f]{3}){1,2}$/i;\n\n if (matchRgb.test(col) || matchRgba.test(col)) {\n return 'rgb';\n } else if (matchHsl.test(col) || matchHsla.test(col)) {\n return 'hsl';\n } else if (matchHex.test(col)) {\n return 'hex';\n } return col;\n};\n\nconst assembleModelFromIdentifiers = (model, identifiers) => {\n let schema = [];\n let data;\n const fieldMap = model.getFieldsConfig();\n if (identifiers.length) {\n const fields = identifiers[0];\n const len = fields.length;\n for (let i = 0; i < len; i++) {\n const field = fields[i];\n const fieldObj = fieldMap[field] && Object.assign({}, fieldMap[field].def);\n if (fieldObj) {\n schema.push(Object.assign(fieldObj));\n }\n }\n\n data = [];\n const header = identifiers[0];\n for (let i = 1; i < identifiers.length; i += 1) {\n const vals = identifiers[i];\n const temp = {};\n vals.forEach((fieldVal, cIdx) => {\n temp[header[cIdx]] = fieldVal;\n });\n data.push(temp);\n }\n } else {\n data = [];\n schema = [];\n }\n\n return new model.constructor(data, schema);\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} criteria\n *\n */\nconst getDataModelFromRange = (dataModel, criteria, mode) => {\n if (criteria === null) {\n return null;\n }\n const selFields = Object.keys(criteria);\n const selFn = fields => selFields.every((field) => {\n const val = fields[field].internalValue;\n const range = criteria[field][0] instanceof Array ? criteria[field][0] : criteria[field];\n if (typeof range[0] === STRING) {\n return range.find(d => d === val) !== undefined;\n }\n return range ? val >= range[0] && val <= range[1] : true;\n });\n\n return dataModel.select(selFn, {\n saveChild: false,\n mode\n });\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} identifiers\n *\n */\nconst getDataModelFromIdentifiers = (dataModel, identifiers, mode) => {\n let filteredDataModel;\n if (identifiers instanceof Array) {\n const fieldsConfig = dataModel.getFieldsConfig();\n\n const dataArr = identifiers.slice(1, identifiers.length);\n if (identifiers instanceof Function) {\n filteredDataModel = identifiers(dataModel, {}, false);\n } else if (identifiers instanceof Array && identifiers[0].length) {\n const filteredSchema = identifiers[0].filter(d => d in fieldsConfig);\n filteredDataModel = dataModel.select((fields) => {\n let include = true;\n filteredSchema.forEach((propField, idx) => {\n const value = fields[propField].internalValue;\n const index = dataArr.findIndex(d => d[idx] === value);\n include = include && index !== -1;\n });\n return include;\n }, {\n saveChild: false,\n mode\n });\n } else {\n filteredDataModel = dataModel.select(() => false, {\n saveChild: false,\n mode\n });\n }\n } else {\n filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode);\n }\n return filteredDataModel;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} listenerMap\n */\nconst registerListeners = (context, listenerMap, ...params) => {\n const propListenerMap = listenerMap(context, ...params);\n for (const key in propListenerMap) {\n if ({}.hasOwnProperty.call(propListenerMap, key)) {\n const { namespace } = params[1];\n let ns = null;\n if (namespace) {\n ns = namespace;\n }\n const mapObj = propListenerMap[key];\n const propType = mapObj.type;\n const props = mapObj.props;\n const listenerFn = mapObj.listener;\n context.store()[propType](props, listenerFn, false, {\n namespace: ns\n });\n }\n }\n};\n\nconst isValidValue = value => !isNaN(value) && value !== -Infinity && value !== Infinity;\n/**\n *\n *\n * @param {*} str\n *\n */\nconst escapeHTML = (str) => {\n const htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n };\n const htmlEscaper = /[&<>\"'/]/g;\n return (`${str}`).replace(htmlEscaper, match => htmlEscapes[match]);\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst transposeArray = arr => arr[0].map((col, i) => arr.map(row => row[i]));\nconst toArray = arr => (arr instanceof Array ? arr : [arr]);\nconst extendsClass = (cls, extendsFrom, found) => {\n if (!cls) {\n return false;\n }\n const prototype = cls.prototype;\n if (prototype instanceof extendsFrom) {\n found = true;\n } else {\n found = extendsClass(prototype, extendsFrom, found);\n }\n return found;\n};\n\n/**\n *\n * @param {*} dm1\n * @param {*} dm2\n */\nconst concatModels = (dm1, dm2) => {\n const dataObj1 = dm1.getData();\n const dataObj2 = dm2.getData();\n const data1 = dataObj1.data;\n const data2 = dataObj2.data;\n const schema1 = dataObj1.schema;\n const schema2 = dataObj2.schema;\n const tuples1 = {};\n const tuples2 = {};\n const commonTuples = {};\n for (let i = 0; i < data1.length; i++) {\n for (let ii = 0; ii < data2.length; ii++) {\n const row1 = data1[i];\n const row2 = data2[ii];\n const dim1Values = row1.filter((d, idx) => schema1[idx].type === FieldType.DIMENSION);\n const dim2Values = row2.filter((d, idx) => schema2[idx].type === FieldType.DIMENSION);\n const allDimSame = dim1Values.every(value => dim2Values.indexOf(value) !== -1);\n if (allDimSame) {\n const key = dim1Values.join();\n !commonTuples[key] && (commonTuples[key] = {});\n row1.forEach((value, idx) => {\n commonTuples[key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n commonTuples[key][schema2[idx].name] = value;\n });\n } else {\n const dm1Key = dim1Values.join();\n const dm2Key = dim2Values.join();\n if (!commonTuples[dm1Key] && !commonTuples[dm2Key]) {\n !tuples1[dm1Key] && (tuples1[dm1Key] = {});\n !tuples2[dm2Key] && (tuples2[dm2Key] = {});\n row1.forEach((value, idx) => {\n tuples1[dm1Key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n tuples2[dm2Key][schema2[idx].name] = value;\n });\n }\n }\n }\n }\n\n const commonSchema = [...schema1, ...schema2.filter(s2 => schema1.findIndex(s1 => s1.name === s2.name) === -1)];\n const data = [...Object.values(tuples1), ...Object.values(tuples2), ...Object.values(commonTuples)];\n return [data, commonSchema];\n};\n\nconst getSymbol = type => symbol().type(symbolFns[type]);\n\nconst stackOrders = {\n [STACK_CONFIG.ORDER_NONE]: stackOrderNone,\n [STACK_CONFIG.ORDER_ASCENDING]: stackOrderAscending,\n [STACK_CONFIG.ORDER_DESCENDING]: stackOrderDescending\n};\nconst stackOffsets = {\n [STACK_CONFIG.OFFSET_DIVERGING]: stackOffsetDiverging,\n [STACK_CONFIG.OFFSET_NONE]: stackOffsetNone,\n [STACK_CONFIG.OFFSET_EXPAND]: stackOffsetExpand,\n [STACK_CONFIG.OFFSET_WIGGLE]: stackOffsetWiggle\n};\n\n// eslint-disable-next-line require-jsdoc\nconst stack = params => d3Stack().keys(params.keys).offset(stackOffsets[params.offset])\n .order(stackOrders[params.order])(params.data);\n\n/**\n * Groups the data into a hierarchical tree structure based on one or more fields.\n * @param { Object } params Configuration properties for nesting data\n * @param { Array. } params.data Data which needs to be grouped\n * @param { Array. } params.keys Field indices by which the data will be grouped\n * @return { Array. } Grouped data array\n */\nconst nestCollection = (params) => {\n const nestFn = nest();\n params.keys.forEach(key => nestFn.key(d => d[key]));\n return nestFn.entries(params.data);\n};\n\nconst pathInterpolators = {\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n stepAfter: curveStepAfter,\n catmullRom: curveCatmullRom,\n step: curveStep,\n stepBefore: curveStepBefore,\n linear: curveLinear\n};\n\nconst Symbols = {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom,\n line,\n area,\n pie,\n arc,\n nest\n};\n\nconst Scales = {\n band: scaleBand\n};\n\nconst getSmallestDiff = (points) => {\n points = points.sort((a, b) => a - b);\n let minDiff = points[1] - points[0];\n for (let i = 2; i < points.length; i++) {\n minDiff = Math.min(minDiff, points[i] - points[i - 1]);\n }\n\n return minDiff;\n};\n\nconst timeFormats = {\n millisecond: '%A, %b %e, %H:%M:%S.%L',\n second: '%A, %b %e, %H:%M:%S',\n minute: '%A, %b %e, %H:%M',\n hour: '%A, %b %e, %H:%M',\n day: '%A, %b %e, %Y',\n month: '%B %Y',\n year: '%Y'\n};\n\nconst timeDurations = [\n ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'],\n [1, 1000, 60000, 3600000, 86400000, 2592000000, 31536000000]\n];\n\nconst getNearestInterval = (interval) => {\n const index = getClosestIndexOf(timeDurations[1], interval);\n return timeDurations[0][index];\n};\n\nconst formatTemporal = (value, interval) => {\n const nearestInterval = getNearestInterval(interval);\n return DateTimeFormatter.formatAs(value, timeFormats[nearestInterval]);\n};\n\nconst temporalFields = (dataModel) => {\n const filteredFields = {};\n Object.entries(dataModel.getFieldspace().getDimension()).forEach(([fieldName, fieldObj]) => {\n if (fieldObj.subtype() === TEMPORAL) {\n filteredFields[fieldName] = fieldObj;\n }\n });\n return filteredFields;\n};\n\nconst require = (lookupWhat, lookupDetails) => ({\n resolvable: (store) => {\n const lookupTarget = store[lookupWhat];\n const depArr = lookupDetails.slice(0, lookupDetails.length - 1);\n const fn = lookupDetails[lookupDetails.length - 1]; // fn\n\n const deps = depArr.map(str => lookupTarget[str]);\n return {\n fn: fn(...deps),\n depArr\n };\n }\n});\n\nconst nextAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n };\n\nconst getValueParser = config => (val) => {\n if (InvalidAwareTypes.getInvalidType(val)) {\n return val in config ? config[val] : `${val}`;\n }\n return val;\n};\n\nconst retrieveNearestGroupByReducers = (dataModel, ...measureFieldNames) => {\n const filteredReducers = {};\n if (dataModel instanceof DataModel) {\n const derivations = [...dataModel.getDerivations().reverse(), ...dataModel.getAncestorDerivations().reverse()];\n const nearestReducers = defaultValue(\n getObjProp(derivations.find(derv => derv.op === DM_DERIVATIVES.GROUPBY), 'criteria'), {});\n\n const measures = dataModel.getFieldspace().getMeasure();\n measureFieldNames = measureFieldNames.length ? measureFieldNames : Object.keys(measures);\n measureFieldNames.forEach((measureName) => {\n if (nearestReducers[measureName]) {\n filteredReducers[measureName] = nearestReducers[measureName];\n } else {\n const measureField = measures[measureName];\n if (measureField) {\n filteredReducers[measureName] = measureField.defAggFn();\n }\n }\n });\n }\n return filteredReducers;\n};\n\nconst retrieveFieldDisplayName = (dm, fieldName) => dm.getFieldspace().fieldsObj()[fieldName].displayName();\n/**\n * Fetches the nearest sort operation details by traversing the chain of parent DataModels\n * @param {Object} dataModel Instance of DataModel\n *\n * @return {Array|null} sort criteria, null if no sort operation found\n */\nconst nearestSortingDetails = (dataModel) => {\n const allDerivations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n const nearestSortDerivation = allDerivations.reverse().find(derivation => derivation.op === DM_DERIVATIVES.SORT);\n\n return nearestSortDerivation ? nearestSortDerivation.criteria : null;\n};\n\n/**\n * Map containing key, value sortingOrder pairs\n */\nconst sortOrderMap = {\n [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => firstVal.localeCompare(secondVal),\n [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => secondVal.localeCompare(firstVal)\n};\n\n/**\n * Sort categorical field based on it's sorting order\n * @param {string} sortOrder Order by which field is to be sorted (asc or desc or func)\n * @param {string} firstVal First sort parameter\n * @param {string} secondVal Second sort parameter\n * @return {number} position|null if sort order is invalid\n*/\nconst sortCategoricalField = (sortOrder, firstVal, secondVal) => {\n const sortOrderType = typeof sortOrder;\n\n if (sortOrderType === FUNCTION) {\n return sortOrder(firstVal, secondVal);\n } else if (sortOrderType === STRING) {\n if (!sortOrderMap[sortOrder]) return null;\n return sortOrderMap[sortOrder](firstVal, secondVal);\n }\n return null;\n};\n\nconst intersect = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => set.has(fn1(value)));\n};\n\nexport {\n getValueParser,\n require,\n intersect,\n Scales,\n Symbols,\n pathInterpolators,\n stack,\n nestCollection,\n getSymbol,\n transformColors,\n detectColor,\n hexToHsv,\n hslToRgb,\n rgbToHsv,\n hsvToRgb,\n concatModels,\n toArray,\n angleToRadian,\n escapeHTML,\n generateGetterSetters,\n getArraySum,\n interpolator,\n piecewiseInterpolator,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n colorInterpolator,\n numberInterpolator,\n ERROR_MSG,\n reqAnimFrame,\n nextAnimFrame,\n transposeArray,\n cancelAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n symbolFns,\n easeFns,\n clone,\n isEqual,\n interpolateArray,\n getMinPoint,\n defaultValue,\n getMaxPoint,\n getClosestIndexOf,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isSimpleObject,\n nextFrame,\n registerListeners,\n replaceCSSPrefix,\n getObjProp,\n extendsClass,\n assembleModelFromIdentifiers,\n isValidValue,\n hslInterpolator,\n getSmallestDiff,\n getNearestValue,\n retrieveNearestGroupByReducers,\n nearestSortingDetails,\n createSelection,\n formatTemporal,\n temporalFields,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField\n};\n","export function linear(t) {\n return +t;\n}\n","export function circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nexport function circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nexport function circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n","import Selection from './selection';\n/**\n * This function applies a selection operation on a data array.\n *\n * @export\n * @param {Array} [data=[]] The data array to be observed.\n * @return {Selection} Instance of a selection.\n */\nexport default function dataSelect (idFn) {\n return new Selection(idFn);\n}\n\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle\";\nimport cross from \"./symbol/cross\";\nimport diamond from \"./symbol/diamond\";\nimport star from \"./symbol/star\";\nimport square from \"./symbol/square\";\nimport triangle from \"./symbol/triangle\";\nimport wye from \"./symbol/wye\";\nimport constant from \"./constant\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","import ascending from \"./ascending\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = yp;\n }\n }\n }\n}\n","import none from \"./none\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import constant from \"./constant\";\nimport descending from \"./descending\";\nimport identity from \"./identity\";\nimport {tau} from \"./math\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n return this.parentNode.insertBefore(this.cloneNode(false), this.nextSibling);\n}\n\nfunction selection_cloneDeep() {\n return this.parentNode.insertBefore(this.cloneNode(true), this.nextSibling);\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_join from \"./join\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n","import {event} from \"./selection/on\";\n\nexport default function() {\n var current = event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n}\n","export default function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart(\"mouse\", container.apply(this, arguments), mouse, this, arguments);\n if (!gesture) return;\n select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\");\n }\n\n function mouseupped() {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent();\n gestures.mouse(\"end\");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, touch, this, arguments)) {\n nopropagation();\n gesture(\"start\");\n }\n }\n }\n\n function touchmoved() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture(\"drag\");\n }\n }\n }\n\n function touchended() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture(\"end\");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!customEvent(new DragEvent(drag, \"beforestart\", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[id] = gesture, n = active++; break;\n case \"end\": delete gestures[id], --active; // nobreak\n case \"drag\": p = point(container, id), n = active; break;\n }\n customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {get, set} from \"./schedule\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","import {tweenValue} from \"./tween\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr\";\nimport transition_attrTween from \"./attrTween\";\nimport transition_delay from \"./delay\";\nimport transition_duration from \"./duration\";\nimport transition_ease from \"./ease\";\nimport transition_filter from \"./filter\";\nimport transition_merge from \"./merge\";\nimport transition_on from \"./on\";\nimport transition_remove from \"./remove\";\nimport transition_select from \"./select\";\nimport transition_selectAll from \"./selectAll\";\nimport transition_selection from \"./selection\";\nimport transition_style from \"./style\";\nimport transition_styleTween from \"./styleTween\";\nimport transition_text from \"./text\";\nimport transition_transition from \"./transition\";\nimport transition_tween from \"./tween\";\nimport transition_end from \"./end\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n end: transition_end\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {get, set, init} from \"./schedule\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i(t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i(t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i(t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {get, init} from \"./schedule\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n });\n}\n","import {Transition, newId} from \"../transition/index\";\nimport schedule from \"../transition/schedule\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt\";\nimport selection_transition from \"./transition\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import { select, event as d3event, selection, clientPoint } from 'd3-selection';\nimport { drag as d3drag } from 'd3-drag';\nimport 'd3-transition';\nimport { mergeRecursive } from './common-utils';\n/**\n * This function takes a raw DOM element or\n * a string and returns a d3 selection of that element.\n *\n * @param {HTMLElement | string} element The element to wrap in d3 selection.\n * @return {Selection} Instance of d3 selection.\n */\nconst selectElement = element => select(element);\n\n/**\n * It creates a new d3 element on the parent element\n * @param {Selection} parent Element to which the element is to be appended\n * @param {Object} elemType Type of the new element\n * @param {Array} data Data for the new element\n * @param {Object} selector classname/id/tagname for the element\n * @return {HTMLElement} Newly Created Element\n */\nconst makeElement = (parent, elemType, data, selector, callbacks = {}, keyFn) => {\n if ((parent instanceof HTMLElement || parent instanceof SVGElement)) {\n parent = selectElement(parent);\n }\n\n const selectorVal = selector ? selector[0] : null;\n let selectorType = null;\n let actualSelector = null;\n let element = null;\n let enterSel = null;\n let mergeSel = null;\n let filter;\n if (selectorVal) {\n if (selectorVal === '#') {\n selectorType = 'id';\n actualSelector = selector;\n } else {\n selectorType = 'class';\n actualSelector = selector[0] === '.' ? selector : `.${selector}`;\n }\n } else {\n actualSelector = elemType;\n filter = true;\n }\n element = parent.selectAll(actualSelector);\n\n filter && (element = element.filter(function () {\n return this.parentNode === parent.node();\n }));\n element = element.data(data, keyFn);\n\n enterSel = element.enter()\n .append(elemType || 'div');\n callbacks.enter && enterSel.each(function (...params) {\n callbacks.enter(selectElement(this), ...params);\n });\n\n mergeSel = enterSel.merge(element);\n callbacks.update && mergeSel.each(function (...params) {\n callbacks.update(selectElement(this), ...params);\n });\n if (selectorType === 'class') {\n mergeSel.classed(selectorVal === '.' ? selector.substring(1, selector.length) : selector, true);\n } else if (selectorType === 'id') {\n mergeSel.attr('id', selector.substring(1, selector.length));\n }\n const exitSel = element.exit();\n\n if (callbacks.exit) {\n exitSel.each(function (...params) {\n callbacks.exit(selectElement(this), ...params);\n });\n } else {\n exitSel.remove();\n }\n return mergeSel;\n};\n\n/**\n * This function applies styles to an element\n * @param {Object} elem Element Selection\n * @param {Object} styleObj Style Object to be applied\n * @return {Element} Newly Created Element\n*/\nconst applyStyle = (elem, styleObj) => {\n Object.entries(styleObj).forEach((d) => {\n elem.style(d[0], d[1]);\n }, this);\n return elem;\n};\n\n/**\n * This function appends a dom element in another element.\n * @param {HTMLElement | SVGElement} element1 The element in which to append the second element\n * @param {HTMLElement | SVGElement} element2 The element which will be appended.\n */\nconst appendElement = (element1, element2) => {\n element1.appendChild(element2);\n};\n\n/**\n * Sets the attributes to the element.\n * @param {HTMLElement | SVGElement} element Element on which attributes will be applied\n * @param {Object} attrs Attributes which need to be applied\n */\nconst setElementAttrs = (element, attrs) => {\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n element.attr(key, attrs[key]);\n }\n }\n};\n\n/**\n * Sets attributes in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which attrs will be applied\n * @param {Array.} attrs Array of attributes\n * @param {string} className className of elements to select.\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setAttrs = (element, attrs, className) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n className !== undefined ? element.selectAll(`.${className}`).each(function () {\n setElementAttrs(select(this), attrs);\n }) : setElementAttrs(element, attrs);\n return element;\n};\n\n/**\n * Adds a css class to elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst addClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, true) :\n elem.classed(className, true);\n });\n};\n\n/**\n * Removes the css class from elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst removeClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, false) :\n elem.classed(className, false);\n });\n};\n\n/**\n * Sets styles in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which styles will be applied\n * @param {Array.} styles Array of style attributes\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setStyles = (element, styles) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n element.style(key, styles[key]);\n }\n }\n return element;\n};\n\n/**\n * Creates svg or html elements by binding data to the selection.Removes extra elements\n * on exit.\n * @param {Object} params Parameter object\n * @param {SVGElement | HTMLElement} params.container Container element where all elements will be appended\n * @param {string} params.selector Selector by which elements will be selected from dom\n * @param {string} params.append Append tag\n * @param {Function} params.each Function which will be executed for each data point and element.\n */\nconst createElements = (params) => {\n const container = select(params.container);\n let data;\n let sel;\n\n data = params.data;\n if (typeof data === 'number') {\n data = Array(data).fill().map((d, i) => i);\n }\n sel = container.selectAll(params.selector).data(data);\n\n sel = container.selectAll(params.selector).filter(function () {\n return this.parentNode === container.node();\n }).data(params.data);\n\n const selectionMerge = sel.enter().append(params.append).merge(sel).each(function (d, i) {\n params.each(d, select(this), i);\n });\n\n selectionMerge.attr('class', params.className || '');\n sel.exit().remove();\n};\n\n/**\n * Clips an element with given measurement. Basically it is used to hide overflowing portions\n * of any element.\n * @param {SVGElement} container svg element which needs to be clipped.\n * @param {Object} measurement Dimensions of the clipped rectangle.\n * @param {string} id Unique id of the clip element\n */\nconst clipElement = (container, measurement, id) => {\n const clipPathElement = makeElement(select(container), 'clipPath', [1], `#${id}`);\n const clipPathRect = makeElement(clipPathElement, 'rect', [1]);\n clipPathRect.attr('x', measurement.x)\n .attr('y', measurement.x)\n .attr('width', measurement.width)\n .attr('height', measurement.height);\n clipPathElement.attr('clip-path', `url(#${id})`);\n};\n\n/**\n * Returns the element of the corresponding classname.\n * @param {HTMLElement | SVGElement} node html or svg node element.\n * @param {string} className css class to be applied.\n * @return {HTMLElement | SVGElement} html or svg element.\n */\nconst getElementsByClassName = (node, className) => select(node).selectAll(className).nodes();\n\n/**\n * Gets the mouse position relative to an svg type of element\n * @param {SVGElement} element Any svg element like rect, circle, etc.\n * @param {Event} event Event object.\n * @return {Object} x and y position relative to the container element passed.\n */\nconst getMousePos = (element, event) => {\n const boundingClientRect = element.getBoundingClientRect();\n return {\n x: event.x - boundingClientRect.x,\n y: event.y - boundingClientRect.y\n };\n};\n\nconst getClientPoint = (...params) => {\n const pos = clientPoint(...params);\n return {\n x: pos[0],\n y: pos[1]\n };\n};\n\n/** This function appends a dom element in another element.\n * @param {Object} tag The tag name of the element to append\n * @param {Object} mount Mount point fo the element\n * @return {Object} selection of the appended element\n */\nconst createElement = (tag, mount) => select(mount).append(tag).node();\n\n/**\n * Gets the d3 event function\n * @return {Object} d3 event\n */\nconst getEvent = () => d3event;\n\n/**\n * Gets the d3 drag function\n * @return {Object} d3 drag\n */\nconst getD3Drag = () => d3drag;\n\nconst getSmartComputedStyle = (group, css) => {\n let textEl;\n const testText = 'W';\n const mandatoryStyle = {\n 'fill-opacity': 0\n };\n const className = typeof css === 'string' ? css : (css instanceof Array ? css.join(' ') : undefined);\n\n if (group.node() instanceof HTMLElement) {\n textEl = group.append('div').html(testText);\n } else {\n textEl = group.append('text').text(testText);\n }\n\n if (className) {\n textEl.attr('class', className);\n } else if (typeof css === 'object') {\n delete css['fill-opacity'];\n mergeRecursive(mandatoryStyle, css);\n }\n\n textEl.style(mandatoryStyle);\n const computedStyle = window.getComputedStyle(textEl.node());\n const styleForSmartLabel = {\n fontSize: computedStyle.fontSize,\n fontFamily: computedStyle.fontFamily,\n fontWeight: computedStyle.fontWeight,\n fontStyle: computedStyle.fontStyle\n };\n\n textEl.remove();\n\n return styleForSmartLabel;\n};\n\nconst hasTouch = () => 'ontouchstart' in document.documentElement;\n\nexport {\n hasTouch,\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint\n};\n","import Model from 'hyperdis';\nimport { defaultValue, getObjProp, toArray } from './common-utils';\n\nconst initProp = (obj, props, val = () => ({})) => {\n props.forEach((prop) => {\n if (!obj[prop]) {\n obj[prop] = val();\n }\n obj = obj[prop];\n });\n return obj;\n};\n\nconst fetchPropValues = (propNames, params, deps) => params.map((param, i) => {\n const prop = propNames[i];\n\n return param.map(val => (val === undefined || val === null ? val : val[deps[prop]]));\n});\n\nconst addListenerToNamespace = (namespaceInf, fn, context) => {\n let key = namespaceInf.key;\n const namespace = namespaceInf.id;\n const listeners = context._listeners;\n\n if (namespace) {\n !listeners.get(namespace) && (listeners.set(namespace, new Map()));\n const namespaceListeners = listeners.get(namespace);\n\n if (!key) {\n key = namespaceListeners.size;\n }\n namespaceListeners.set(key, fn);\n } else {\n key = key || listeners.size;\n listeners.set(key, fn);\n }\n};\n\nconst setContexts = (contexts, propObj, contextMap) => {\n for (const key of propObj.keys()) {\n contexts[key] = {\n context: contextMap[key],\n deps: propObj.get(key).depProps\n };\n }\n return contexts;\n};\n\nconst registerPropInMaps = (store, props, namespaceInf, type) => {\n const {\n _registeredListeners: registeredListeners,\n _propListenerMap: propListenerMap\n } = store;\n const {\n subNamespace,\n namespace: ns\n } = namespaceInf;\n\n initProp(registeredListeners, [ns]);\n props.forEach((prop) => {\n const subNamespaces = defaultValue(getObjProp(registeredListeners, ns, prop, 'subNamespace'), []);\n let fns = defaultValue(getObjProp(propListenerMap, prop, type, 'fns'), 0);\n\n fns++;\n subNamespace && subNamespaces.push(subNamespace);\n registeredListeners[ns][prop] = {\n subNamespace: subNamespaces,\n allProps: props,\n subNamespaces: {}\n };\n initProp(propListenerMap, [prop, type]);\n propListenerMap[prop][type] = {\n fns,\n _fnCount: fns\n };\n });\n};\n\nconst registerListener = (context, type, ...options) => {\n const [propList, callBack, instantCall, namespaceInf = {}] = options;\n let props = propList;\n\n if (!Array.isArray(propList)) {\n props = [propList];\n }\n\n const { namespace: ns } = namespaceInf;\n const callbackFn = ((propNames, namespaceVal) => (...params) => {\n const { _savedCommits: commits, _propListenerMap: propListenerMap } = context;\n\n if (!propNames.some(prop => getObjProp(propListenerMap, prop, 'disabled'))) {\n if (namespaceVal) {\n const listenersObj = context._registeredListeners[namespaceVal];\n const contextMap = context._contextMap[namespaceVal];\n const contextsObj = {};\n\n propNames.forEach((prop) => {\n const commitsObj = defaultValue(getObjProp(commits, prop, type), {});\n const listeners = listenersObj[prop].subNamespaces;\n const propDeps = propListenerMap[prop][type];\n\n for (const nm in commitsObj) {\n const fnInf = defaultValue(propDeps[nm], { fns: 0 });\n let { fns } = fnInf;\n\n if (fns > 0) {\n setContexts(contextsObj, listeners[nm], contextMap);\n fns--;\n }\n\n if (fns <= 0) {\n delete commitsObj[nm];\n }\n fnInf.fns = fns;\n }\n });\n for (const key in contextsObj) {\n const obj = contextsObj[key];\n\n callBack(obj.context, ...fetchPropValues(propNames, params, obj.deps));\n }\n } else {\n callBack(...params);\n }\n }\n })(props, ns, type);\n\n const fn = context.model[type](props, callbackFn, instantCall);\n\n if (ns) {\n registerPropInMaps(context, props, namespaceInf, type);\n }\n addListenerToNamespace(namespaceInf, fn, context);\n};\n\nconst retrieveNamespaces = (names, key) => {\n if (names instanceof Object) {\n return [names[key]];\n } else if (names instanceof Array) {\n return names;\n }\n return [names];\n};\n\nconst createMap = () => new Map();\n\nconst listenerTypes = ['next', 'on'];\n\nconst removePropValue = (context, map, propInf) => {\n const { subNamespace: sns, prop, propListenerMap } = propInf;\n const propObj = propListenerMap[prop];\n\n listenerTypes.forEach((type) => {\n if (type in propObj) {\n delete propObj[type][sns];\n }\n });\n if (map.has(sns)) {\n const value = context.get(prop);\n\n if (value instanceof Object && sns in value) {\n delete value[sns];\n }\n map.delete(sns);\n }\n};\n\n/**\n * Methods to handle changes to table configuration and reactivity are handled by this\n * class.\n */\n/**\n * Common store class\n *\n * @class Store\n */\nexport class Store {\n /**\n * Creates an instance of Store.\n * @param {Object} config The object to create the state store with.\n * @memberof Store\n */\n constructor (config) {\n // create reactive model\n this.model = Model.create(config);\n this._listeners = new Map();\n this._registeredListeners = {};\n this._contextMap = {};\n this._commits = {};\n this._savedCommits = {};\n this._queuedProps = {};\n this._propListenerMap = {};\n this._locked = false;\n }\n\n lockModel () {\n this.model.lock();\n this._locked = true;\n return this;\n }\n\n unlockModel () {\n this._locked = false;\n this.model.unlock();\n return this;\n }\n\n /**\n * This method returns a plain JSON object\n * with all the fields in the state store.\n *\n * @return {Object} Serialized representation of state store.\n * @memberof Store\n */\n serialize () {\n return this.model.serialize();\n }\n\n lockCommits (props) {\n props.forEach((prop) => {\n this._commits[prop] = {\n locked: true,\n queue: []\n };\n });\n return this;\n }\n\n unlockCommits (props) {\n const commitsObj = this._commits;\n\n this.lockModel();\n props.forEach((prop) => {\n commitsObj[prop].locked = false;\n const queuedProps = {};\n const { queue } = commitsObj[prop];\n\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n if (namespace) {\n const propObj = initProp(queuedProps, [propName, namespace]);\n\n Object.assign(propObj, value);\n }\n });\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n this.commit(propName, propName in queuedProps ? queuedProps[propName][namespace] : value,\n namespace);\n });\n delete commitsObj[prop];\n });\n this.unlockModel();\n return this;\n }\n\n addSubNamespace (sns, namespace, context) {\n // Get all the listeners registered by the component\n const listeners = this._registeredListeners[namespace];\n const propListenerMap = this._propListenerMap;\n\n initProp(this._contextMap, [namespace]);\n this._contextMap[namespace][sns] = context;\n for (const key in listeners) {\n const obj = listeners[key];\n const propObj = propListenerMap[key];\n const propFns = listenerTypes.reduce((acc, type) => {\n const val = defaultValue(getObjProp(propObj, type, 'fns'), 0);\n val && (acc[type] = val);\n return acc;\n }, {});\n const { allProps, subNamespaces, subNamespace } = obj;\n const snsArr = subNamespace.length ? subNamespace : [sns];\n\n snsArr.forEach((ns) => {\n const nsObj = ns instanceof Function ? ns(context) : ns;\n const names = retrieveNamespaces(nsObj, key);\n const depProps = allProps.reduce((acc, prop) => {\n acc[prop] = ns instanceof Function ? nsObj[prop] : ns;\n return acc;\n }, {});\n\n names.forEach((nm) => {\n initProp(subNamespaces, [nm], createMap).set(sns, {\n depProps\n });\n\n for (const type in propFns) {\n initProp(propObj, [type, nm]);\n const fns = propFns[type];\n\n propObj[type][nm] = {\n fns,\n _fnCount: fns\n };\n }\n });\n });\n }\n return this;\n }\n\n /**\n * This method is used to update the value of a property in the state store.\n *\n * @param {string} propName The name of the property.\n * @param {number} value The new value of the property.\n * @memberof Store\n */\n commit (propName, value, namespace, disableListener = false) {\n let sanitizedVal = value;\n const commits = this._commits;\n const savedCommits = this._savedCommits;\n const locked = getObjProp(commits, propName, 'locked');\n const propListenerMap = this._propListenerMap[propName] || {};\n\n propListenerMap.disabled = disableListener;\n\n if (locked) {\n commits[propName].queue.push([propName, value, namespace]);\n return this;\n }\n\n if (namespace) {\n if (this._locked) {\n const queuedProps = initProp(this._queuedProps, [propName]);\n queuedProps[namespace] = value;\n sanitizedVal = queuedProps;\n } else {\n sanitizedVal = defaultValue(this.get(propName), {});\n sanitizedVal[namespace] = value;\n }\n\n listenerTypes.forEach((type) => {\n initProp(savedCommits, [propName, type]);\n savedCommits[propName][type][namespace] = true;\n if (getObjProp(propListenerMap, type, namespace)) {\n propListenerMap[type][namespace].fns = propListenerMap[type][namespace]._fnCount;\n }\n });\n }\n\n this.model.prop(propName, sanitizedVal);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */registerChangeListener (...params) {\n registerListener(this, 'next', ...params);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */ registerImmediateListener (...params) {\n registerListener(this, 'on', ...params);\n }\n\n /**\n * This method is used to get the name of the property\n * from the state store.\n *\n * @param {string} propName The name of the field in state store.\n * @return {any} The value of the field.\n * @memberof Store\n */\n get (propName, subNamespace) {\n const value = this.model.prop(propName);\n return subNamespace ? value && value[subNamespace] : value;\n }\n\n /**\n * This method is used to register a computed property that is computed every time\n * the store value changes.\n *\n * @param {string} propName The name of the property to create.\n * @param {Function} callBack The function to execute when depemdent props change.\n * @memberof Store\n */\n computed (propName, callBack) {\n return this.model.calculatedProp(propName, callBack);\n }\n\n append (...params) {\n this.model.append(...params);\n return this;\n }\n\n unsubscribeAll () {\n Object.values(this._listeners).forEach(fn => fn());\n return this;\n }\n\n unsubscribe (namespaceInf = {}) {\n const { id, key } = namespaceInf;\n const listenersMap = this._listeners;\n const listeners = listenersMap.get(id);\n\n if (key) {\n const fn = listenersMap.get(key);\n\n fn && fn();\n } else {\n for (const fn of listeners.values()) {\n fn();\n }\n listenersMap.set(id, []);\n }\n return this;\n }\n\n removeSubNamespace (subNamespace, namespace) {\n const {\n _registeredListeners: listenerMap,\n _contextMap: contextMap,\n _propListenerMap: propListenerMap\n } = this;\n const listenersObj = listenerMap[namespace];\n\n for (const prop in listenersObj) {\n const { subNamespaces } = listenersObj[prop];\n const propInf = {\n subNamespace,\n prop,\n propListenerMap\n };\n\n if (subNamespaces[subNamespace]) {\n removePropValue(this, subNamespaces[subNamespace], propInf);\n delete subNamespaces[subNamespace];\n } else {\n for (const ns in subNamespaces) {\n const snsMap = subNamespaces[ns];\n\n removePropValue(this, snsMap, propInf);\n if (!snsMap.size) {\n delete subNamespaces[ns];\n }\n }\n }\n }\n delete contextMap[namespace][subNamespace];\n return this;\n }\n}\n\n/**\n * Setter getter creator from config\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args. (Optional)\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitization: // Need for sanitization before type is checked\n * }\n * }\n *\n * @param {Object} holder an empty object on which the getters and setters will be mounted\n * @param {Object} options options config based on which the getters and setters are determined.\n * @param {Hyperdis} model optional model to attach the property. If not sent new moel is created.\n * @return {Array}\n */\nexport const transactor = (holder, options, model, namespaceInf = {}) => {\n let conf;\n const store = model instanceof Store ? model : new Store({});\n const stateProps = {};\n const { namespace, subNamespace } = namespaceInf;\n\n for (const prop in options) {\n if ({}.hasOwnProperty.call(options, prop)) {\n conf = options[prop];\n const nameSpaceProp = namespace ? `${namespace}.${prop}` : prop;\n\n if (subNamespace) {\n const value = defaultValue(store.get(nameSpaceProp), {});\n value[subNamespace] = conf.value;\n stateProps[nameSpaceProp] = value;\n } else {\n stateProps[prop] = conf.value;\n }\n\n holder[prop] = ((context, meta, nsProp) => (...params) => {\n const paramsLen = params.length;\n if (paramsLen) {\n const { takesMultipleParams = false } = meta || {};\n // If parameters are passed then it's a setter\n let val = takesMultipleParams ? params : params[0];\n\n if (meta) {\n let values;\n const prevVal = context.get(nsProp, subNamespace);\n const { sanitization, typeCheck, typeExpected } = meta;\n if (typeof sanitization === 'function') {\n // Sanitize if required\n val = sanitization(val, prevVal, holder);\n }\n\n // Checking if a setter is valid\n if (typeof typeCheck === 'function') {\n const typeCheckResult = typeCheck(val);\n\n if (typeCheckResult) {\n values = val;\n }\n } else if (typeof typeCheck === 'string' && typeCheck === 'constructor') {\n if (val && val.constructor.name === typeExpected) {\n values = val;\n }\n } else {\n values = val;\n }\n\n const preset = meta.preset;\n const oldValues = toArray(context.get(nsProp, subNamespace));\n preset && preset(values, holder);\n if (takesMultipleParams) {\n oldValues.forEach((value, i) => {\n if (values[i] === undefined) {\n values[i] = value;\n }\n });\n }\n values && context.commit(nsProp, values, subNamespace);\n } else {\n context.commit(nsProp, val, subNamespace);\n }\n return holder;\n }\n // No parameters are passed hence its a getter\n return context.get(nsProp, subNamespace);\n })(store, conf.meta, nameSpaceProp, Array.isArray(conf.value));\n }\n }\n\n if (subNamespace) {\n for (const key in stateProps) {\n store.commit(key, stateProps[key][subNamespace], subNamespace);\n }\n } else if (namespace === undefined) {\n store.append(stateProps);\n } else {\n store.append(namespace, stateProps);\n }\n\n return [holder, store];\n};\n","const events = [\n 'initialized',\n 'beforeupdate',\n 'updated',\n 'beforedraw',\n 'drawn',\n 'beforeremove',\n 'removed',\n 'animationend'\n];\n\nconst compositions = [\n 'canvas',\n 'unit',\n 'layer',\n 'axis',\n 'facet-headers',\n 'legend',\n 'caption'\n];\n\nconst EVENT_LIST = [];\n\ncompositions.forEach((composition) => {\n events.forEach((event) => {\n EVENT_LIST.push(`${composition}.${event}`);\n });\n});\n\nexport default EVENT_LIST;\n","import EVENT_LIST from './event-list';\nimport { createPromise } from './helper';\n\n/**\n * At first call it accepts one function\n * calling it second time accepts notification object.\n * notification object then called with first accepted function\n *\n * @param {Function} resolveFn a promise's resolve function\n * @return {Function} a function to accept notification object\n */\nconst resolver = resolveFn => notification => resolveFn(notification);\n\n/**\n * Checks if the property string is present in the source object\n *\n * @param {Object} source source object whom you want to check the property\n * @param {string} property key name that need to be checked\n * @return {boolean} returns true if the property found in the source object\n */\nconst hasOwn = (source, property) => Object.prototype.hasOwnProperty.call(source, property);\n\n/**\n * LifeCycleManager which goes as a dependendecy to a muze\n * it accepts notification from the entire library throughout\n * the exeecution life\n *\n * @export\n * @class LifeCycleManager\n */\nexport default class LifeCycleManager {\n\n /**\n * Creates an instance of LifeCycleManager.\n * @memberof LifeCycleManager\n */\n constructor () {\n this._eventList = EVENT_LIST;\n this._promises = new Map();\n this._notifiers = {};\n this._lifeCycles = {};\n this._unreleasedLifeCycles = {};\n this._boot();\n }\n\n /**\n * Fills all the notifiers with resolver callback\n *\n * @memberof LifeCycleManager\n */\n _boot () {\n this._notifiers = this._eventList.reduce((acc, name) => {\n acc[name] = resolver;\n return acc;\n }, {});\n this._preparePromises();\n }\n\n /**\n * Public method which gives the promise corresponding\n * to the event name\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} promise that is passed to the user\n * @memberof LifeCycleManager\n */\n retrieve (eventName) {\n return this._promises.get(eventName);\n }\n\n /**\n * Creates a promise that will be passed to user's callback\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} a pending promise waiting for resolve to be called\n * @memberof LifeCycleManager\n */\n _makeNotifierPromise (eventName) {\n return new Promise((resolve) => {\n this._notifiers[eventName] = resolver(resolve);\n });\n }\n\n /**\n * Prepares the promise map with pending promises\n * all the promises are in a pending state where their's\n * resolve function waiting to be called with notification object\n * @memberof LifeCycleManager\n */\n _preparePromises () {\n this._eventList.forEach((eventName) => {\n const promise = this._makeNotifierPromise(eventName);\n this._promises.set(eventName, promise);\n createPromise(promise, eventName, this);\n });\n }\n\n /**\n * Resolves the promise with notification object\n *\n * @param {string} eventName name of the event in the system\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n *\n * @memberof LifeCycleManager\n */\n _resolvePromise (eventName, notification) {\n this._notifiers[eventName](notification);\n }\n\n /**\n * Public method which is being called by different\n * subcompoents of the system at different execution atages\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n notify (notification) {\n // get the composition name from notification\n // or from static formalName() method\n const composition = notification.formalName || notification.client.constructor.formalName();\n notification.formalName = composition;\n this._releasePromisesFromCache();\n this._notify(composition, notification);\n }\n\n /**\n * Notify user the with promsie in a callback\n * if callback not found then cache it\n *\n * @param {string} composition\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n _notify (composition, notification) {\n const stage = notification.action;\n const eventName = `${composition}.${stage}`;\n\n // resolves promise with the notification object\n this._resolvePromise(eventName, notification);\n\n // get the promise from the promise map\n const promise = this.retrieve(eventName);\n\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // if user given call back exists, then call with promise\n this._callLifeCycleCallback(composition, stage, promise);\n } else {\n // otherwise cache the promise\n this._cachePromise(composition, stage, promise);\n }\n } else {\n this._cachePromise(composition, stage, promise);\n }\n }\n\n /**\n * Calls the user's callback with callback\n *\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _callLifeCycleCallback (composition, stage, promise) {\n const eventName = `${composition}.${stage}`;\n this._lifeCycles[composition][stage](promise);\n this._resetTargetPromise(eventName);\n }\n\n /**\n * Try to clear the cached promsies once we have\n * macthed callbacks from the user\n *\n * @memberof LifeCycleManager\n */\n _releasePromisesFromCache () {\n const compositions = Object.keys(this._unreleasedLifeCycles);\n compositions.forEach((composition) => {\n const stages = Object.keys(this._unreleasedLifeCycles[composition]);\n stages.forEach((stage) => {\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // take the promise from unreleased lifeCycles\n const promise = this._unreleasedLifeCycles[composition][stage];\n // call the user given callback with that promise\n this._callLifeCycleCallback(composition, stage, promise);\n // delete promise from unreleased lifeCycles\n delete this._unreleasedLifeCycles[composition][stage];\n }\n }\n });\n });\n }\n\n /**\n * Cache the promise in the map. This cache\n * then get consumed if we get user callbacks\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _cachePromise (composition, stage, promise) {\n if (!hasOwn(this._unreleasedLifeCycles, composition)) {\n this._unreleasedLifeCycles[composition] = {};\n }\n\n if (!hasOwn(this._unreleasedLifeCycles[composition], stage)) {\n this._unreleasedLifeCycles[composition][stage] = {};\n }\n this._unreleasedLifeCycles[composition][stage] = promise;\n }\n\n /**\n * It register's the callbacks gievn the user\n *\n * @param {Object} [lifeCycles={}] a object with list of callbacks\n * @memberof LifeCycleManager\n */\n register (lifeCycles = {}) {\n this._lifeCycles = lifeCycles;\n // as we get all the callbacks, try to call them\n // from unreleased promise map\n this._releasePromisesFromCache();\n }\n\n /**\n * Reset the promise into pending state\n *\n * @param {string} eventName name of the event happening\n * @memberof LifeCycleManager\n */\n _resetTargetPromise (eventName) {\n setTimeout(() => {\n this._notifiers[eventName] = resolver;\n this._promises.set(eventName, this._makeNotifierPromise(eventName));\n }, 0);\n }\n}\n","import LifeCycleManager from './lifecycle-manager';\n\nexport default LifeCycleManager;\n","/**\n * Creates a new promise when the given promise is resolved. This needs to be done so that after the lifecycle event\n * is completed, then again when the event gets completed, then a new promise gets resolved.\n *\n * @param {Promise} promise Instance of promise\n * @param {string} eventName name of event\n * @param {LifeCycleManager} context Instance of lifecyclemanager\n */\nexport const createPromise = (promise, eventName, context) => {\n promise.then(() => {\n const prm = context._makeNotifierPromise(eventName);\n context._promises.set(eventName, prm);\n createPromise(prm, eventName, context);\n });\n};\n","import { default as DataModel } from 'datamodel';\nimport * as scales from './scales';\nimport * as colorSchemes from './color-schemes';\nimport * as STATE_NAMESPACES from './enums/namespace';\n\nconst InvalidAwareTypes = DataModel.InvalidAwareTypes;\n\nexport {\n InvalidAwareTypes,\n DataModel\n};\n\nexport {\n ReservedFields,\n CommonProps,\n COORD_TYPES\n} from './enums';\n\nexport { STATE_NAMESPACES };\n\nexport {\n scales,\n colorSchemes\n};\n\nexport {\n getNearestValue,\n getValueParser,\n transformColors,\n detectColor,\n hslToRgb,\n rgbToHsv,\n hexToHsv,\n hsvToRgb,\n escapeHTML,\n angleToRadian,\n generateGetterSetters,\n getArraySum,\n ERROR_MSG,\n interpolator,\n colorInterpolator,\n numberInterpolator,\n piecewiseInterpolator,\n reqAnimFrame,\n cancelAnimFrame,\n nextAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n replaceCSSPrefix,\n symbolFns,\n defaultValue,\n easeFns,\n clone,\n interpolateArray,\n getMinPoint,\n getMaxPoint,\n getClosestIndexOf,\n registerListeners,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isEqual,\n isSimpleObject,\n nextFrame,\n getObjProp,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n transposeArray,\n toArray,\n extendsClass,\n concatModels,\n assembleModelFromIdentifiers,\n isValidValue,\n nestCollection,\n stack,\n getSymbol,\n Scales,\n Symbols,\n pathInterpolators,\n hslInterpolator,\n getSmallestDiff,\n require,\n formatTemporal,\n nearestSortingDetails,\n createSelection,\n temporalFields,\n retrieveNearestGroupByReducers,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n intersect\n} from './common-utils';\n\nexport {\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint,\n hasTouch\n} from './renderer-utils';\n\nexport {\n Store,\n transactor\n} from './store';\n\nexport {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'd3-time';\n\nexport { default as Smartlabel } from 'fusioncharts-smartlabel';\nexport { dataSelect } from './DataSystem';\n\nexport { default as LifeCycleManager } from './lifecycle-manager';\n\nexport {\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n DateTimeFormatter,\n DM_DERIVATIVES,\n GROUP_BY_FUNCTIONS\n} from 'datamodel';\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\nexport const LONGTOUCH = 'longtouch';\nexport const TOUCHDRAG = 'touchdrag';\nexport const ALL_ACTIONS = '*';\n","const SELECTION_NEW_ENTRY = 1;\nconst SELECTION_NEW_EXIT = -1;\nconst SELECTION_NULL = 0;\nconst SELECTION_OLD_ENTRY = 2;\nconst SELECTION_OLD_EXIT = -2;\n\nexport {\n SELECTION_NEW_ENTRY,\n SELECTION_NEW_EXIT,\n SELECTION_NULL,\n SELECTION_OLD_ENTRY,\n SELECTION_OLD_EXIT\n};\n","import SelectionSet from './selection-set';\n\nexport default SelectionSet;\n","import {\n SELECTION_NEW_ENTRY, SELECTION_NEW_EXIT, SELECTION_NULL, SELECTION_OLD_ENTRY, SELECTION_OLD_EXIT\n} from '../enums/selection';\n/* eslint-disable guard-for-in */\n\n/**\n * This component is used to keep track of the row tuples of the data which gets added and removed. This keeps\n * information of which rows are in previous and new entry set and previous and new exit set. This is initialized by\n * {@link Firebolt}.\n *\n * @public\n *\n * @class SelectionSet\n */\nclass SelectionSet {\n /**\n * Creates an instance of selection set\n *\n * @param {Array.} completeSet Set of unique ids.\n */\n constructor (completeSet, _volatile) {\n this.completeSet = completeSet;\n this._set = completeSet.reduce((obj, key) => {\n obj[key] = SELECTION_NULL;\n return obj;\n }, {});\n this._volatile = _volatile;\n this._completeSetCount = completeSet.length;\n this._lockedSelection = {};\n this._resetted = true;\n }\n\n /**\n * Adds a set of ids to the selection set. This also moves the other rows to exit set.\n *\n * @public\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n add (ids) {\n this._resetted = false;\n\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n set[i] = SELECTION_NEW_ENTRY;\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_ENTRY && set[key] !== SELECTION_OLD_ENTRY) {\n set[key] = set[key] < 0 ? SELECTION_OLD_EXIT : SELECTION_NEW_EXIT;\n }\n }\n return this;\n }\n\n /**\n * Adds an array of ids to the old entry set.\n *\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n update (ids) {\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n set[i] = SELECTION_OLD_ENTRY;\n });\n\n return this;\n }\n\n /**\n * Moves all ids which in new entry set to old entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateEntry () {\n const set = this._set;\n\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_ENTRY ? SELECTION_OLD_ENTRY : set[key];\n }\n return this;\n }\n\n /**\n * Moves an array of ids which are in new exit set to old exit set.\n *\n * @public\n *\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateExit () {\n const set = this._set;\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_EXIT ? SELECTION_OLD_EXIT : set[key];\n }\n return this;\n }\n\n /**\n * Removes an array of ids from the selection set. It also moves the remaining row ids to entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set\n */\n remove (ids) {\n this._resetted = false;\n\n const set = this._set;\n ids.forEach((i) => {\n set[i] = SELECTION_NEW_EXIT;\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_EXIT && set[key] !== SELECTION_OLD_EXIT) {\n set[key] = set[key] === 0 ? SELECTION_NEW_ENTRY : SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getSets () {\n const set = this._set;\n const retObj = {\n entrySet: [[], []],\n exitSet: [[], []],\n completeSet: []\n };\n\n for (const key in set) {\n if (set[key] > 0) {\n set[key] === SELECTION_OLD_ENTRY && retObj.entrySet[0].push(key);\n set[key] === SELECTION_NEW_ENTRY && retObj.entrySet[1].push(key);\n } else if (set[key] < 0) {\n set[key] === SELECTION_OLD_EXIT && retObj.exitSet[0].push(key);\n set[key] === SELECTION_NEW_EXIT && retObj.exitSet[1].push(key);\n }\n retObj.completeSet.push(key);\n }\n\n ['entrySet', 'exitSet'].forEach((type) => {\n retObj[type] = retObj[type].map(e => e.map(Number));\n });\n retObj.completeSet = retObj.completeSet.map(Number);\n\n return retObj;\n }\n\n /**\n * Resets an array of ids in the selection set to initial state. It sets the value of every unique id value to\n * null in the selection set which means they are neither in entry set nor in exit set. If no ids are passed,\n * then it resets all the ids to null.\n *\n * @public\n *\n * @param {Array} ids Array of unique ids.\n * @return {SelectionSet} Instance of selection set.\n */\n reset (ids) {\n const set = this._set;\n if (ids) {\n ids.forEach((i) => {\n set[i] = SELECTION_NULL;\n });\n } else {\n const lockedSel = this._lockedSelection;\n for (const key in set) {\n if (!(key in lockedSel)) {\n set[key] = SELECTION_NULL;\n }\n }\n }\n this._resetted = true;\n return this;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n *\n * @public\n *\n * @return {Array.} Array of unique ids\n */\n getEntrySet () {\n const set = this._set;\n const addSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_ENTRY && addSet.push(key);\n }\n\n return addSet;\n }\n\n /**\n * Returns a set of unique ids which are already present in entry set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old entry set or new entry set\n */\n getExistingEntrySet (addSet) {\n const set = this._set;\n return addSet.filter(d => set[d] === SELECTION_NEW_ENTRY || set[d] === SELECTION_OLD_ENTRY);\n }\n\n /**\n * Returns a set of unique ids which are already present in exit set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old exit set or new exit set\n */\n getExistingExitSet (removeSet) {\n const set = this._set;\n return removeSet.filter(d => set[d] === SELECTION_NEW_EXIT || set[d] === SELECTION_OLD_EXIT);\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldEntry () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_ENTRY && updateSet.push(key);\n }\n return updateSet;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldExit () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_EXIT && updateSet.push(key);\n }\n\n return updateSet;\n }\n\n /**\n * Gets the array of ids which are in the exit set.\n *\n * @public\n * @return {Array.} Array of unique ids\n */\n getExitSet () {\n const set = this._set;\n const removeSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_EXIT && removeSet.push(key);\n }\n return removeSet;\n }\n\n /**\n * Gets all the ids which are either in exit or entry set.\n *\n * @public\n * @return {Array} Array of unique ids\n */\n getCompleteSet () {\n const set = this._set;\n const completeSet = [];\n\n for (const key in set) {\n completeSet.push(key);\n }\n\n return completeSet;\n }\n\n getCompleteSetCount () {\n return this._completeSetCount;\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Swaps the add set and remove set in the selection set.\n * @return {SelectionSet} Instance of selection set.\n */\n toggle () {\n const set = this._set;\n\n for (const key in set) {\n if (set[key] === SELECTION_NEW_ENTRY) {\n set[key] = SELECTION_NEW_EXIT;\n } else if (set[key] === SELECTION_NEW_EXIT) {\n set[key] = SELECTION_NEW_ENTRY;\n } else if (set[key] === SELECTION_OLD_ENTRY) {\n set[key] = SELECTION_OLD_EXIT;\n } else {\n set[key] = SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n}\n\nexport default SelectionSet;\n","import { clone, retrieveNearestGroupByReducers } from 'muze-utils';\nimport * as SELECTION from '../enums/selection';\n\nexport const initializeSideEffects = (context, sideEffects) => {\n const sideEffectsMap = context._sideEffects;\n sideEffects = sideEffects instanceof Array ? sideEffects : Object.values(sideEffects);\n sideEffects.forEach((SideEffect) => {\n const formalName = SideEffect.formalName();\n const sideEffectInstance = sideEffectsMap[formalName];\n sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context);\n });\n return sideEffectsMap;\n};\n\nexport const setSideEffectConfig = (sideEffects, config) => {\n for (const key in sideEffects) {\n const sideEffect = sideEffects[key];\n const formalName = sideEffect.constructor.formalName();\n const sideEffectConf = config[formalName];\n\n sideEffectConf && sideEffect.config(sideEffectConf);\n }\n};\n\nexport const initializeBehaviouralActions = (context, actions) => {\n const dispatchableBehaviours = {};\n\n actions = actions instanceof Array ? actions : Object.values(actions);\n actions.forEach((Action) => {\n dispatchableBehaviours[Action.formalName()] = new Action(context);\n });\n return dispatchableBehaviours;\n};\n\nexport const initializePhysicalActions = (context, actions) => {\n const physicalActions = {};\n\n for (const name in actions) {\n if (!({}).hasOwnProperty.call(name, actions)) {\n physicalActions[name] = actions[name](context);\n }\n }\n return physicalActions;\n};\n\nexport const changeSideEffectAvailability = (context, fn, toEnable) => {\n const sideEffects = context.sideEffects();\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n let change = true;\n if (fn && fn(key) === false) {\n change = false;\n }\n if (change) {\n toEnable ? sideEffects[key].enable() : sideEffects[key].disable();\n }\n }\n }\n};\n\nexport const getMergedSet = set => [...new Set([...set[0], ...set[1]])];\n\nexport const getSourceFields = (propagationInf, criteria = {}) => {\n const sourceIdentifiers = propagationInf.sourceIdentifiers;\n let sourceFields;\n if (sourceIdentifiers) {\n sourceFields = sourceIdentifiers.getSchema().map(d => d.name);\n } else if (criteria instanceof Array) {\n sourceFields = criteria[0];\n } else {\n sourceFields = Object.keys(criteria || {});\n }\n return sourceFields;\n};\n\nconst conditionsMap = {\n mergedEnter: [SELECTION.SELECTION_NEW_ENTRY, SELECTION.SELECTION_OLD_ENTRY],\n mergedExit: [SELECTION.SELECTION_NEW_EXIT, SELECTION.SELECTION_OLD_EXIT],\n complete: []\n};\n\nexport const getModelFromSet = (type, model, set) => {\n const conditions = conditionsMap[type];\n if (model && conditions) {\n return model.select((fields, i) =>\n (conditions.some(condition => set[i] === condition)), {\n saveChild: false\n });\n }\n return null;\n};\n\nexport const getSetInfo = (type, set, config) => {\n let model = null;\n const filteredDataModel = config.filteredDataModel;\n const selectionSet = config.selectionSet;\n if (!config.propagationData) {\n if (selectionSet.resetted()) {\n model = null;\n } else if (type === 'mergedEnter') {\n model = getModelFromSet(type, config.dataModel, config.selectionSet._set);\n }\n } else if (filteredDataModel) {\n model = type === 'mergedEnter' ? filteredDataModel[0] : filteredDataModel[1];\n }\n return {\n uids: set,\n length: set.length,\n model\n };\n};\n\nexport const getSideEffects = (behaviour, behaviourEffectMap) => {\n const sideEffects = [];\n for (const key in behaviourEffectMap) {\n const behaviours = key.split(',');\n const found = behaviours.some(d => d === behaviour);\n if (found) {\n sideEffects.push({\n effects: behaviourEffectMap[key],\n behaviours\n });\n }\n }\n return sideEffects;\n};\n\nexport const unionSets = (context, behaviours) => {\n let combinedSet = {};\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n behaviours.forEach((behaviour) => {\n const entryExitSet = context._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const model = entryExitSet[type].model;\n let existingModel = models[type];\n let aggFns = retrieveNearestGroupByReducers(model);\n if (!existingModel) {\n existingModel = models[type] = model;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n aggFns = Object.assign({}, retrieveNearestGroupByReducers(existingModel));\n existingModel = models[type] = model.union(existingModel);\n } else {\n existingModel = model;\n }\n combinedSet[type].model = existingModel;\n combinedSet[type].aggFns = aggFns;\n });\n }\n });\n return combinedSet;\n};\n","import {\n mergeRecursive,\n hasTouch,\n selectElement,\n isSimpleObject\n} from 'muze-utils';\nimport { ALL_ACTIONS } from './enums/actions';\nimport SelectionSet from './selection-set';\nimport {\n initializeBehaviouralActions,\n initializeSideEffects,\n changeSideEffectAvailability,\n initializePhysicalActions,\n unionSets,\n getSideEffects,\n setSideEffectConfig\n} from './helper';\n\n/**\n * This class is responsible for dispatching behavioural actions and side effects. It also keeps the information of\n * registered physical actions, behavioural actions and side effects. Also, it keeps the map of physical and behavioural\n * actions and behavioural actions and side effects. Whenever any behavioural action is dispatched, it also propagates\n * the rows which got affected to the other datamodels. This class is initialized by {@link VisualUnit} and legend to\n * manage it's interaction.\n *\n * @public\n * @class Firebolt\n * @module Firebolt\n */\nexport default class Firebolt {\n constructor (context, actions, sideEffects, behaviourEffectMap) {\n this.context = context;\n this._sideEffectDefinitions = {};\n this._sideEffects = {};\n this._propagationInf = {};\n this._actions = {\n behavioural: {},\n physical: {}\n };\n this._selectionSet = {};\n this._volatileSelectionSet = {};\n this._propagationFields = {};\n this._sourceSideEffects = {};\n this._propagationBehaviourMap = {};\n this._sourceBehaviours = {};\n this._actionBehaviourMap = {};\n this._config = {};\n this._behaviourEffectMap = {};\n this._entryExitSet = {};\n this._actionHistory = {};\n this._queuedSideEffects = {};\n\n this.mapSideEffects(behaviourEffectMap);\n this.registerBehaviouralActions(actions.behavioural);\n this.registerSideEffects(sideEffects);\n this.registerPhysicalBehaviouralMap(actions.physicalBehaviouralMap);\n this.registerPhysicalActions(actions.physical);\n }\n\n config (...config) {\n if (config.length) {\n this._config = mergeRecursive(this._config, config[0]);\n setSideEffectConfig(this.sideEffects(), this._config);\n return this;\n }\n return this._config;\n }\n\n mapSideEffects (behEffectMap) {\n const behaviourEffectMap = this._behaviourEffectMap;\n for (const key in behEffectMap) {\n if ({}.hasOwnProperty.call(behEffectMap, key)) {\n const sideEffects = behEffectMap[key] || [];\n let preventDefaultActions = false;\n let effectNames;\n if (isSimpleObject(sideEffects)) {\n effectNames = sideEffects.effects;\n preventDefaultActions = sideEffects.preventDefaultActions;\n } else {\n effectNames = sideEffects;\n }\n !behaviourEffectMap[key] && (behaviourEffectMap[key] = []);\n this._behaviourEffectMap[key] = [...new Set(preventDefaultActions ? effectNames :\n [...behaviourEffectMap[key], ...effectNames])];\n }\n }\n return this;\n }\n\n registerBehaviouralActions (actions) {\n const behaviours = initializeBehaviouralActions(this, actions);\n this.prepareSelectionSets(behaviours);\n Object.assign(this._actions.behavioural, behaviours);\n return this;\n }\n\n prepareSelectionSets () {\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n return this;\n }\n\n applySideEffects (sideEffects, selectionSet, payload) {\n const sideEffectStore = this.sideEffects();\n const actionHistory = this._actionHistory;\n const queuedSideEffects = this._queuedSideEffects;\n sideEffects.forEach((sideEffect) => {\n let options;\n let name;\n const effects = sideEffect.effects;\n const behaviours = sideEffect.behaviours;\n const combinedSet = unionSets(this, behaviours, selectionSet);\n effects.forEach((effect) => {\n if (typeof effect === 'object') {\n name = effect.name;\n options = effect.options;\n } else {\n name = effect;\n }\n\n const sideEffectInstance = sideEffectStore[name];\n if (sideEffectInstance.isEnabled()) {\n if (!sideEffectInstance.constructor.mutates() &&\n Object.values(actionHistory).some(d => d.isMutableAction)) {\n queuedSideEffects[`${name}-${behaviours.join()}`] = {\n name,\n params: [combinedSet, payload, options]\n };\n } else {\n this.dispatchSideEffect(name, combinedSet, payload, options);\n }\n }\n });\n });\n return this;\n }\n\n dispatchSideEffect (name, selectionSet, payload, options = {}) {\n const sideEffectStore = this.sideEffects();\n const sideEffect = sideEffectStore[name];\n let disable = false;\n if (options.filter && options.filter(sideEffect)) {\n disable = true;\n }\n !disable && sideEffectStore[name].apply(selectionSet, payload, options);\n }\n\n registerPropagationBehaviourMap (map) {\n this._propagationBehaviourMap = Object.assign(this._propagationBehaviourMap, map || {});\n return this;\n }\n\n dispatchBehaviour (behaviour, payload, propagationInfo = {}) {\n const propagate = propagationInfo.propagate !== undefined ? propagationInfo.propagate : true;\n const behaviouralActions = this._actions.behavioural;\n const action = behaviouralActions[behaviour];\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(behaviour, behaviourEffectMap);\n this._propagationInf = propagationInfo;\n\n if (action) {\n const selectionSet = action.dispatch(payload);\n const propagationSelectionSet = this.getPropagationSelectionSet(selectionSet);\n this._entryExitSet[behaviour] = propagationSelectionSet;\n const shouldApplySideEffects = this.shouldApplySideEffects(propagate);\n\n if (propagate) {\n this.propagate(behaviour, payload, selectionSet.find(d => d.sourceSelectionSet), sideEffects);\n }\n if (shouldApplySideEffects) {\n const applicableSideEffects = this.getApplicableSideEffects(sideEffects, payload, propagationInfo);\n this.applySideEffects(applicableSideEffects, propagationSelectionSet, payload);\n }\n }\n\n return this;\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet.find(d => !d.sourceSelectionSet);\n }\n\n shouldApplySideEffects () {\n return true;\n }\n\n changeBehaviourStateOnPropagation (behaviour, value, key = 'default') {\n const behaviourConditions = this._sourceBehaviours[behaviour] || (this._sourceBehaviours[behaviour] = {});\n if (value instanceof Function) {\n behaviourConditions[key] = value;\n } else {\n behaviourConditions[key] = () => value;\n }\n return this;\n }\n\n changeSideEffectStateOnPropagation (sideEffect, value, key = 'default') {\n const sideEffectConditions = this._sourceSideEffects[sideEffect] || (this._sourceSideEffects[sideEffect] = {});\n if (value instanceof Function) {\n sideEffectConditions[key] = value;\n } else {\n sideEffectConditions[key] = () => value;\n }\n }\n\n removeSideEffectPolicy (sideEffect, key) {\n delete this._sourceSideEffects[sideEffect][key];\n return this;\n }\n\n removeBehaviourPolicy (behaviour, key) {\n delete this._sourceBehaviours[behaviour][key];\n return this;\n }\n\n propagate () {\n return this;\n }\n\n sideEffects (...sideEffects) {\n if (sideEffects.length) {\n this._sideEffects = sideEffects[0];\n return this;\n }\n return this._sideEffects;\n }\n\n enableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, true);\n return this;\n }\n\n disableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, false);\n return this;\n }\n\n dissociateBehaviour (behaviour, physicalAction) {\n const actionBehaviourMap = this._actionBehaviourMap;\n for (const key in actionBehaviourMap) {\n if (key === physicalAction) {\n const behaviourMap = actionBehaviourMap[key];\n behaviourMap.behaviours = behaviourMap.behaviours.filter(d => d !== behaviour);\n this.mapActionsAndBehaviour(key);\n }\n }\n\n return this;\n }\n\n dissociateSideEffect (sideEffect, behaviour) {\n const behaviourEffectMap = this._behaviourEffectMap;\n behaviourEffectMap[behaviour] = behaviourEffectMap[behaviour].filter(d => (d.name || d) !== sideEffect);\n return this;\n }\n\n getApplicableSideEffects (sideEffects) {\n return sideEffects;\n }\n\n attachPropagationListener (dataModel) {\n dataModel.unsubscribe('propagation');\n dataModel.on('propagation', this.onDataModelPropagation());\n return this;\n }\n\n onDataModelPropagation () {\n return (propValue) => {\n const payload = propValue.payload;\n const action = payload.action;\n\n this.dispatchBehaviour(action, payload, {\n propagate: false\n });\n };\n }\n\n createSelectionSet (uniqueIds, behaviouralActions) {\n const behaviours = behaviouralActions || this._actions.behavioural;\n const selectionSet = this._selectionSet;\n const volatileSelectionSet = this._volatileSelectionSet;\n\n for (const key in behaviours) {\n if ({}.hasOwnProperty.call(behaviours, key)) {\n selectionSet[key] = new SelectionSet(uniqueIds);\n volatileSelectionSet[key] = new SelectionSet(uniqueIds, true);\n this._entryExitSet[key] = null;\n }\n }\n this._volatileSelectionSet = volatileSelectionSet;\n this.selectionSet(selectionSet);\n return this;\n }\n\n selectionSet (...selectionSet) {\n if (selectionSet.length) {\n this._selectionSet = selectionSet[0];\n return this;\n }\n return this._selectionSet;\n }\n\n initializeSideEffects () {\n const sideEffectDefinitions = this._sideEffectDefinitions;\n this.sideEffects(initializeSideEffects(this, sideEffectDefinitions));\n return this;\n }\n\n registerPhysicalActions (actions) {\n const initedActions = initializePhysicalActions(this, actions);\n Object.assign(this._actions.physical, initedActions);\n return this;\n }\n\n /**\n * Allows to propagate the datamodel with only the supplied fields. When propagation is done, then the fields\n * which are supplied for the specified behavioural action is propagated.\n *\n * @public\n *\n * @param {string} action Name of behavioural action. If '*' is specified, then for all behavioural actions it is\n * applied.\n * @param {Array} fields Array of field names which will be propagated.\n * @param {boolean} append If true, then it is appended to the existing propagation data model fields else only\n * those fields are projected from propagation data model and propagated.\n *\n * @return {Firebolt} Instance of firebolt\n */\n propagateWith (action, fields, append = false) {\n const behaviouralActions = this._actions.behavioural;\n if (action === ALL_ACTIONS) {\n for (const key in behaviouralActions) {\n this._propagationFields[key] = {\n fields,\n append\n };\n }\n } else {\n this._propagationFields[action] = {\n fields,\n append\n };\n }\n return this;\n }\n\n /**\n * Map actions and behaviours\n * @return {Firebolt} Firebolt instance\n */\n mapActionsAndBehaviour (phyAction) {\n const initedPhysicalActions = this._actions.physical;\n const map = this._actionBehaviourMap;\n\n for (const action in map) {\n if (!({}).hasOwnProperty.call(action, map) && action === (phyAction || action)) {\n let target;\n const mapObj = map[action];\n target = mapObj.target;\n const touch = mapObj.touch;\n if (!target) {\n target = this.context.getDefaultTargetContainer();\n }\n const bind = hasTouch() ? touch === true || touch === undefined : !touch;\n bind && this.bindActionWithBehaviour(initedPhysicalActions[action],\n target, mapObj.behaviours);\n }\n }\n return this;\n }\n\n registerPhysicalBehaviouralMap (map) {\n this._actionBehaviourMap = mergeRecursive(this._actionBehaviourMap, map);\n return this;\n }\n\n /**\n * Binds a target element with an action.\n *\n * @param {Function} action Action method\n * @param {string} target Class name of element\n * @param {Array} behaviourList Array of behaviours\n * @return {FireBolt} Instance of firebolt\n */\n bindActionWithBehaviour (action, targets, behaviourList) {\n if (typeof (targets) === 'string') {\n targets = [targets];\n }\n targets.forEach((target) => {\n const mount = this.context.mount();\n const nodes = target.node instanceof Function ? target : selectElement(mount).selectAll(target);\n if (!nodes.empty()) {\n if (nodes instanceof Array) {\n nodes.forEach((node) => {\n action(selectElement(node), behaviourList);\n });\n } else {\n action(nodes, behaviourList);\n }\n }\n });\n return this;\n }\n\n getPropagationInf () {\n return this._propagationInf;\n }\n\n getAddSetFromCriteria (criteria, propagationInf = {}) {\n const context = this.context;\n const filteredDataModel = propagationInf.data ? propagationInf.data :\n context.getDataModelFromIdentifiers(criteria, 'all');\n return {\n model: filteredDataModel,\n uids: criteria === null ? null : (propagationInf.data ? propagationInf.entryRowIds :\n filteredDataModel[0].getUids())\n };\n }\n\n getSelectionSets (action) {\n const sourceId = this.context.id();\n const propagationInf = this._propagationInf || {};\n const propagationSource = propagationInf.sourceId;\n let applicableSelectionSets = [];\n if (propagationSource !== sourceId) {\n applicableSelectionSets = [this._volatileSelectionSet[action]];\n }\n\n if (propagationSource) {\n applicableSelectionSets.push(this.selectionSet()[action]);\n }\n return applicableSelectionSets;\n }\n\n getFullData () {\n return this.context.data();\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Returns the entry and exit set information of the specified behavioural action.\n *\n * @public\n *\n * @param {string} behaviour Name of behavioural action.\n *\n * @return {Object} Entry exit set information.\n */\n getEntryExitSet (behaviour) {\n return this._entryExitSet[behaviour];\n }\n}\n","import { getSetInfo, getMergedSet, getSourceFields } from '../../helper';\n\n/**\n * This is the base class has all the common functionalities needed for all behavioural actions. Any other behavioural\n * action needs to extend this class.\n *\n * @public\n * @class GenericBehaviour\n * @module GenericBehaviour\n */\nexport default class GenericBehaviour {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n }\n\n /**\n * Returns entry and exit set information. This method is called by firebolt when ```dispatchBehaviour``` is called\n * dynamically or when any physical action is triggered on the chart.\n *\n * @param {Object} payload Payload information.\n * @param {Object|Array} payload.criteria Identifiers of data interacted with.\n *\n * @return {Array} Entry and exit set information.\n */\n dispatch (payload) {\n const criteria = payload.criteria;\n const firebolt = this.firebolt;\n const formalName = this.constructor.formalName();\n const selectionSets = firebolt.getSelectionSets(formalName);\n const {\n model: filteredDataModel,\n uids\n } = this.firebolt.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf());\n const entryExitSets = selectionSets.map((selectionSet) => {\n this.setSelectionSet(uids, selectionSet);\n return this.getEntryExitSet(selectionSet, filteredDataModel, payload);\n });\n\n return entryExitSets;\n }\n\n /**\n * Updates the selection set by adding uids to the instance of {@link SelectionSet} or removing them.\n * {@link SelectionSet} keeps the information of which rows are in the entry set and exit set.\n *\n * @public\n * @param {Array} addSet Array of row ids which got affected during interaction.\n * @param {SelectionSet} selectionSet Instance of selection set.\n *\n * @return {GenericBehaviour} Instance of behaviour.\n */\n setSelectionSet () {\n return this;\n }\n\n getEntryExitSet (selectionSet, filteredDataModel, payload) {\n const {\n entrySet,\n exitSet,\n completeSet\n } = selectionSet.getSets();\n const propagationInf = this.firebolt.getPropagationInf();\n const dataModel = this.firebolt.getFullData();\n const setConfig = {\n dataModel,\n filteredDataModel,\n propagationData: propagationInf.data,\n selectionSet\n };\n\n return {\n entrySet: [getSetInfo('oldEntry', entrySet[0], setConfig),\n getSetInfo('newEntry', entrySet[1], setConfig)],\n exitSet: [getSetInfo('oldEntry', exitSet[0], setConfig),\n getSetInfo('newExit', exitSet[1], setConfig)],\n mergedEnter: getSetInfo('mergedEnter', getMergedSet(entrySet), setConfig),\n mergedExit: getSetInfo('mergedExit', getMergedSet(exitSet), setConfig),\n completeSet: getSetInfo('complete', completeSet, setConfig),\n fields: getSourceFields(propagationInf, payload.criteria),\n sourceSelectionSet: selectionSet._volatile === true\n };\n }\n\n static mutates () {\n return false;\n }\n\n enable () {\n this._enabled = true;\n }\n\n disable () {\n this._enabled = false;\n }\n\n isEnabled () {\n return this._enabled;\n }\n}\n\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class VolatileBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets();\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n","import VolatileBehaviour from './volatile';\nimport { HIGHLIGHT } from '../../enums/behaviours';\n\nexport default class HighlightBehaviour extends VolatileBehaviour {\n static formalName () {\n return HIGHLIGHT;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport * as BEHAVIOURNAMES from '../../enums/behaviours';\n\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class BrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BEHAVIOURNAMES.BRUSH;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport { FILTER } from '../../enums/behaviours';\n\nexport default class FilterBehaviour extends VolatileBehaviour {\n static formalName () {\n return FILTER;\n }\n\n static mutates () {\n return true;\n }\n}\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class PersistentBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.propagate === false) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets();\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n // existing add set\n if (existingAddSet.length) {\n selectionSet.updateExit();\n selectionSet.remove(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n const { exitSet } = selectionSet.getSets();\n const mergedExitSet = getMergedSet(exitSet);\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n\n return this;\n }\n}\n","import PersistentBehaviour from './persistent';\nimport { SELECT } from '../../enums/behaviours';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return SELECT;\n }\n}\n\n","import { DimensionSubtype, MeasureSubtype } from 'muze-utils';\n/**\n * Gets the drag action configuration\n * @param {VisualUnit} instance instance of visual unit\n * @param {Object} config x y positions\n * @return {Object} Payload of behaviour\n*/\n/* istanbul ignore next */ const getDragActionConfig = (sourceInfo, config, fieldsConfig) => {\n if (!(sourceInfo.axes.x || sourceInfo.axes.y)) {\n return {\n criteria: null\n };\n }\n\n const axes = sourceInfo.axes;\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const axisFields = sourceInfo.fields;\n const xField = axisFields.x[0].getMembers()[0];\n const yField = axisFields.y[0].getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n const dimensions = {};\n const stPos = config.startPos;\n const endPos = config.endPos;\n\n if (stPos.x === endPos.x && stPos.y === endPos.y) {\n return {\n criteria: null\n };\n }\n\n const dragDim = xFieldType === MeasureSubtype.CONTINUOUS ? (yFieldType === MeasureSubtype.CONTINUOUS ?\n ['x', 'y'] : ['y']) : ['x'];\n const criteria = {};\n const isXDimension = xFieldType === DimensionSubtype.CATEGORICAL;\n const isYDimension = yFieldType === DimensionSubtype.CATEGORICAL;\n const xRange = xAxis.invertExtent(stPos.x, endPos.x);\n const yRange = yAxis.invertExtent(stPos.y, endPos.y);\n const selectedDomains = {\n x: stPos.x === endPos.x ? [] : (isXDimension ? xRange : xRange.sort((a, b) => a - b)),\n y: stPos.y === endPos.y ? [] : (isYDimension ? yRange : yRange.sort((a, b) => a - b))\n };\n const rangeObj = {};\n\n if (dragDim.length === 2) {\n rangeObj[xField] = selectedDomains.x;\n rangeObj[yField] = selectedDomains.y;\n if (xField === yField) {\n const xdom = selectedDomains.x;\n const ydom = selectedDomains.y;\n const min = xdom[0] > ydom[0] ? ydom : xdom;\n const max = min === ydom ? xdom : ydom;\n if (min[1] < max[0]) {\n rangeObj[xField] = [];\n } else {\n rangeObj[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]];\n }\n dimensions.x = [stPos.x, endPos.x];\n dimensions.y = [stPos.y, endPos.y];\n }\n } else {\n criteria[dragDim[0]] = selectedDomains[dragDim[0]] || [];\n\n if (dragDim[0] === 'x') {\n rangeObj[xField] = criteria.x;\n if (xFieldType === DimensionSubtype.CATEGORICAL) {\n dimensions.x = (config.snap && stPos.x !== endPos.x) ? xAxis.getNearestRange(stPos.x, endPos.x) :\n [stPos.x, endPos.x];\n }\n } else {\n rangeObj[yField] = criteria.y;\n if (yFieldType === DimensionSubtype.CATEGORICAL) {\n dimensions.y = (config.snap && stPos.y !== endPos.y) ? yAxis.getNearestRange(stPos.y, endPos.y) :\n [stPos.y, endPos.y];\n }\n }\n }\n\n return {\n criteria: rangeObj,\n dimensions\n };\n};\n\nexport default getDragActionConfig;\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './drag-action-config';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const attachDragEvent = (targetEl, behaviours, firebolt, touch) => {\n let startPos = {};\n let endPos = {};\n let drawingInf;\n\n const d3Drag = getD3Drag();\n let touchStart;\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n drawingInf = firebolt.context.getDrawingContext();\n touchStart = new Date().getTime();\n }).on('drag', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n if (touch && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n\n const payload = getDragActionConfig(firebolt.context.getSourceInfo(), {\n startPos,\n endPos\n }, firebolt.context.data().getFieldsConfig());\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n }).on('end', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n const duration = new Date().getTime() - touchStart;\n\n if (touch && duration > 100 && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n\n const payload = getDragActionConfig(firebolt.context.getSourceInfo(), {\n startPos,\n endPos,\n snap: true\n }, firebolt.context.data().getFieldsConfig());\n payload.dragEnd = true;\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n }));\n};\n\n","import { getClientPoint, getEvent } from 'muze-utils';\nimport { CONSOLIDATED, FRAGMENTED } from '../../enums/constants';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} instance instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const context = firebolt.context;\n const tooltipConf = context.config().interaction.tooltip;\n const mode = tooltipConf.mode;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n getAllPoints: mode === CONSOLIDATED || mode === FRAGMENTED,\n data: args,\n event\n });\n const payload = {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos,\n mode\n };\n\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, {\n criteria: null\n }));\n });\n};\n\nexport default hover;\n","export const CLASSPREFIX = 'muze';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\n\n","import { getClientPoint } from 'muze-utils';\n\nexport const generatePayloadFromEvent = function (args, event, firebolt) {\n const context = firebolt.context;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event.touches ? event.touches[0] : event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n data: args,\n event\n });\n return {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos\n };\n};\n","import { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = generatePayloadFromEvent(args, event, firebolt);\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport { longtouch } from './longtouch';\nimport { touchdrag } from './touch-drag';\nimport * as ACTIONNAMES from '../../enums/actions';\nimport click from './click';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click,\n [ACTIONNAMES.LONGTOUCH]: longtouch,\n [ACTIONNAMES.TOUCHDRAG]: touchdrag\n};\n\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt);\n};\n\nexport default drag;\n","/* global setTimeout */\nimport { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nexport const longtouch = firebolt => (targetEl, behaviours) => {\n let event;\n let touchEnd;\n const dispatchBehaviour = function (args) {\n const payload = generatePayloadFromEvent(args, event, firebolt);\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, payload));\n event.stopPropagation();\n };\n\n touchEnd = false;\n event = getEvent();\n targetEl.on('touchstart', (args) => {\n event = getEvent();\n touchEnd = false;\n setTimeout(() => {\n if (!touchEnd) {\n dispatchBehaviour(args);\n } else {\n behaviours.forEach(beh => firebolt.dispatchBehaviour(beh, {\n criteria: null\n }));\n }\n }, 100);\n }).on('touchend', () => {\n touchEnd = true;\n });\n};\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const touchdrag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt, true);\n};\n\n","const ANCHORS = 'anchors';\nconst TOOLTIP = 'tooltip';\nconst BRUSH_ANCHORS = 'brush-anchors';\nconst PERSISTENT_ANCHORS = 'persistent-anchors';\nconst FILTER = 'filter';\nconst HIGHLIGHTER = 'highlighter';\nconst CROSSLINE = 'crossline';\n\nexport {\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS,\n FILTER,\n HIGHLIGHTER,\n CROSSLINE,\n TOOLTIP\n};\n","export const PROPS = {\n valueParser: {\n defaultValue: val => val\n }\n};\n","import GenericSideEffect from './generic-sideeffect';\n\nexport default GenericSideEffect;\n","import { mergeRecursive, getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { PROPS } from './props';\n\n/**\n * This is the base class of all side effects. It contains all common methods like setting configuration, disabling,\n * enabling side effect, etc. Every new side effect has to inherit this class or {@link SpawnableSideEffect} or\n * {@link SurrogateSideEffect} class. All side effects are initialized by firebolt. The instance of firebolt is\n * passed on initialization. The firebolt instance contains ```context``` which is the instance of visual unit with\n * which the firebolt is attached.\n *\n * @public\n * @class\n * @module GenericSideEffect\n */\nexport default class GenericSideEffect {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n this._strategy = 'default';\n this._config = {};\n this._id = getUniqueId();\n this._strategies = {};\n generateGetterSetters(this, PROPS);\n this.config(this.constructor.defaultConfig());\n }\n\n /**\n * Returns the default configuration of the side effect.\n *\n * @public\n * @return {Object} Default configuration of side effect.\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the formal name of a side effect. This method must be implemented by all side effects which changes\n * or adds any element in the visualization.\n *\n * @return {string} Formal name of side effect.\n */\n static formalName () {\n return 'generic';\n }\n\n static target () {\n return 'all';\n }\n\n /**\n * Returns true if the side effects mutates the data of chart.\n *\n * @public\n *\n * @return {boolean} If the side effect mutates the data of chart.\n */\n static mutates () {\n return false;\n }\n\n /**\n * Sets or gets the configuration of side effect.\n *\n * When setter,\n * @param {Object} config Configuration of side effect.\n * @return {GenericSideEffect} Side effect instance.\n *\n * When getter,\n * @return {Object} Side effect configuration.\n */\n config (...params) {\n if (params.length) {\n this._config = mergeRecursive(this._config, params[0]);\n return this;\n }\n return this._config;\n }\n\n disable () {\n this._enabled = false;\n return this;\n }\n\n enable () {\n this._enabled = true;\n return this;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n /**\n * Applies the interaction effect on the chart. This is where the implemntation of the side effect is defined.\n *\n * @param {Object} selectionSet Contains the entry and exit set of data which got affected during interaction.\n * @param {Object} selectionSet.mergedEnter Combined previous entry and new entry set.\n * @param {DataModel} selectionSet.mergedEnter.model Instance of data model containing all rows which got\n * affected during interaction.\n * @param {Array} selectionSet.mergedEnter.uids Ids of all rows which were affected during interaction.\n * @param {Object} selectionSet.mergedExit Combined previous exit and new exit set.\n * @param {DataModel} selectionSet.mergedExit.model Instance of data model containing rows which were not affected\n * during interaction.\n * @param {Array} selectionSet.mergedExit.uids Ids of all rows which were not affected during interaction.\n * @param {Object} selectionSet.entrySet Entry set information.\n * @param {Array} selectionSet.entrySet[0].uids All row ids which got affected during previous interaction.\n * @param {Array} selectionSet.entrySet[1].uids All row ids which got affected during current interaction.\n * @param {Array} selectionSet.exitSet[0].uids All row ids which were not affected during previous interaction.\n * @param {Array} selectionSet.exitSet[1].uids All row ids which were not affected during current interaction.\n * @param {Object} payload Payload information of the behavioural action on trigger of which this side effect\n * is applied.\n * @param {Object} options Optional information for side effect like strategy, etc.\n */\n apply () {\n return this;\n }\n\n /**\n * Adds a new strategy method for this side effect. The strategy method is implemented by side effect class.\n *\n * @param {string} name Name of the strategy.\n * @param {Function} fn Strategy method.\n *\n * @return {GenericSideEffect} Instance of side effect.\n */\n setStrategy (name, fn) {\n if (fn) {\n this._strategies[name] = fn;\n }\n return this;\n }\n}\n","import GenericSideEffect from './generic';\n\n/**\n * This class is inherited by all side effects which changes the look of any existing elements in the visualization.\n * For example, if a side effect wants to change the color of bar plots, then it is a surrogate side effect.\n *\n * To use this,\n * ```\n * const SurrogateSideEffect = muze.SideEffects.standards.SurrogateSideEffect;\n *\n * class BarColorChanger extends SurrogateSideEffect {\n * static formalName () {\n * return 'colorChanger';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n *\n * @module SurrogateSideEffect\n * @class\n * @extends GenericSideEffect\n */\nexport default class SurrogateSideEffect extends GenericSideEffect {\n /**\n * Applies or removes interaction styles from plot elements. An array of row ids needs to be passed\n * which identifies the plot elements and applies styles to them.\n *\n * To apply the interaction style,\n * ```\n * const entryRowIds = entrySet[0].uids;\n * const interactionStyle = [{\n * type: 'fill',\n * intensity: [0, 0, 15, 0] // hsla configuration\n * }];\n *\n * this.applyInteractionStyle(entryRowIds, interactionStyle, 'brighten', true);\n * ```\n * @public\n * @param {Array} set Array of row ids.\n * @param {Array} config Style configuration.\n * @param {Object} config[0] fill or stroke configuration.\n * @param {string} config[0].type Type of style - fill or stroke.\n * @param {Array} config[0].intensity hsla configuration.\n * @param {string} interactionType Type of interaction. This is needed for storing the styles for\n * each type of interaction in the plot elements.\n * @param {boolean} apply Whether to apply or remove the interaction style.\n *\n * @return {SurrogateSideEffect} Instance of surrogate side effect.\n */\n applyInteractionStyle (set, config = {}, interactionType, apply) {\n const layers = this.firebolt.context.layers();\n layers.forEach(layer => layer.config().interactive !== false &&\n layer.applyInteractionStyle(interactionType, set.uids, apply));\n return this;\n }\n}\n","import { makeElement } from 'muze-utils';\n\nimport GenericSideEffect from './generic';\n\n/**\n * Any side effect which will add any new element to the chart like drawing a rectangular box or any annotation over\n * the chart needs to inherit this class. This class has methods which returns the container where the dom elements\n * needs to be created.\n *\n * To use this,\n * ```\n * const SpawnableSideEffect = muze.SideEffects.standards.SpawnableSideEffect;\n *\n * class SelectionBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'selectionBox';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n * @class\n * @extends GenericSideEffect\n * @module SpawnableSideEffect\n */\nexport default class SpawnableSideEffect extends GenericSideEffect {\n /**\n * Creates a html or svg element in the container.\n *\n * @public\n * @param {SVGElement|HTMLElement} container Container where the dom element will be rendered.\n * @param {string} elemType Type of dom element.\n * @param {Array} data Array of objects with which the dom elements will be binded.\n * @param {string} className class name of the element.\n *\n * @return {Selection} D3 Selection of the element.\n */\n createElement (container, elemType, data, className, callbacks) {\n return makeElement(container, elemType, data, className, callbacks);\n }\n\n /**\n * Returns the drawing information for side effect like svg container, dimensions of the visual unit.\n *\n * @public\n * @return {Object} Drawing information for side effect.\n * ```\n * sideEffectGroup: // svg container where the side effect needs to be appended.\n * svgContainer: // svg container of the {@link VisualUnit}.\n * htmlContainer: // html div container of the {@link VisualUnit}.\n * width: // Width of the {@link VisualUnit}\n * height: // Height of the {@link VisualUnit}\n * ```\n */\n drawingContext (...drawingContext) {\n if (drawingContext.length) {\n this._drawingContext = drawingContext[0];\n return this;\n }\n return this._drawingContext();\n }\n\n show () {\n return this;\n }\n\n hide () {\n return this;\n }\n}\n","import { selectElement } from 'muze-utils';\n\nexport const getBoxDimensionsFromPayload = (payload, axes, axisFields) => {\n let x1;\n let x2;\n let y1;\n let y2;\n let xRange;\n let yRange;\n let direction;\n const criteria = payload.criteria;\n const dimensions = payload.dimensions || {};\n const xDim = dimensions.x;\n const yDim = dimensions.y;\n\n if (criteria === null) {\n return null;\n }\n\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const xLinear = xAxis.constructor.type() === 'linear';\n const yLinear = yAxis.constructor.type() === 'linear';\n const xField = `${axisFields.x[0]}`;\n const yField = `${axisFields.y[0]}`;\n const xCriteria = criteria[xField];\n const yCriteria = criteria[yField];\n\n if (xCriteria && xCriteria[0] instanceof Array) {\n xRange = xCriteria[0];\n yRange = xCriteria[1];\n } else {\n xRange = xCriteria || [];\n yRange = yCriteria || [];\n }\n direction = xCriteria && yCriteria ? 'both' : (xCriteria ? 'vertical' : 'horizontal');\n if (xRange && xRange.length) {\n if ((yAxis.constructor.type() === 'band' && xLinear)) {\n x1 = x2 = undefined;\n direction = 'horizontal';\n } else {\n const domain = xAxis.domain();\n const bandScale = xAxis.constructor.type() === 'band';\n let x1Val;\n let x2Val;\n if (bandScale) {\n let x1DomainIndex = domain.indexOf(xRange[0]);\n let x2DomainIndex = domain.indexOf(xRange[xRange.length - 1]);\n [x1DomainIndex, x2DomainIndex] = [x1DomainIndex, x2DomainIndex].sort((a, b) => a - b);\n x1Val = domain[x1DomainIndex];\n x2Val = domain[x2DomainIndex];\n } else {\n x1Val = xRange[0];\n x2Val = xRange[xRange.length - 1];\n }\n x1 = xAxis.getScaleValue(x1Val);\n x2 = xAxis.getScaleValue(x2Val);\n x2 += bandScale ? xAxis.getUnitWidth() : 0;\n }\n } else {\n x1 = x2 = undefined;\n }\n if (yRange && yRange.length) {\n if ((xAxis.constructor.type() === 'band' && yLinear)) {\n y1 = y2 = undefined;\n direction = 'vertical';\n } else {\n const domain = yAxis.domain();\n const bandScale = yAxis.constructor.type() === 'band';\n let y1Val;\n let y2Val;\n if (bandScale) {\n let y1DomainIndex = domain.indexOf(yRange[0]);\n let y2DomainIndex = domain.indexOf(yRange[yRange.length - 1]);\n [y1DomainIndex, y2DomainIndex] = [y1DomainIndex, y2DomainIndex].sort(((a, b) => b - a));\n y1Val = domain[y1DomainIndex];\n y2Val = domain[y2DomainIndex];\n } else {\n y1Val = yRange[0];\n y2Val = yRange[yRange.length - 1];\n }\n y1 = yAxis.getScaleValue(y1Val);\n y2 = yAxis.getScaleValue(y2Val);\n y2 += yAxis.constructor.type() === 'band' ? yAxis.getUnitWidth() : 0;\n }\n } else {\n y1 = y2 = undefined;\n }\n\n if ((yLinear && xLinear) || !payload.dragEnd) {\n if (xDim) {\n [x1, x2] = xDim;\n }\n if (yDim) {\n [y1, y2] = yDim;\n }\n }\n\n return {\n dimension: {\n x1,\n x2,\n y1,\n y2\n },\n direction\n };\n};\n\nexport const changeVisibility = (context, sideEffectGroup, visible) => {\n const config = context.config();\n const className = config.defClassName;\n const classPrefix = config.classPrefix;\n selectElement(sideEffectGroup).selectAll(`.${classPrefix}-${className}`)\n .style('display', visible ? 'block' : 'none');\n};\n","import {\n getQualifiedClassName,\n selectElement,\n makeElement,\n isValidValue\n} from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport './styles.scss';\nimport SpawnableSideEffect from '../spawnable';\nimport { selectionBoxDrag } from '../../actions/physical/selection-box-drag';\nimport { getBoxDimensionsFromPayload, changeVisibility } from './helper';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\nclass SelectionBox extends SpawnableSideEffect {\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n defClassName: 'selection-box-group',\n className: '',\n classPrefix: CLASSPREFIX,\n box: {\n defClassName: 'selection-box',\n className: ''\n },\n transition: {\n duration: 200\n }\n };\n }\n\n static formalName () {\n return 'selectionBox';\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n * @param {Object} dimension Dimensions of the selection box.\n * @param {number} dimension.x1 Starting x position\n * @param {number} dimension.x2 Ending x position\n * @param {number} dimension.y1 Starting y position\n * @param {number} dimension.y2 Ending y position\n * @param {Object} conf Configuration needed to draw the selection box\n * @param {number} unitWidth Width of the visual unit.\n * @param {number} unitHeight Height of the visual unit.\n */\n apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const config = this._config;\n const boxConf = config.box;\n const firebolt = this.firebolt;\n const drawingInf = this.drawingContext();\n const mountPoint = drawingInf.sideEffectGroup;\n const unitWidth = drawingInf.width;\n const unitHeight = drawingInf.height;\n const classPrefix = config.classPrefix;\n const selectionGroupClassName = config.defClassName;\n\n if (payload.criteria === null) {\n this.hide(drawingInf);\n return this;\n }\n\n const sourceInf = firebolt.context.getSourceInfo();\n const { dimension, direction } = getBoxDimensionsFromPayload(payload, sourceInf.axes,\n sourceInf.fields);\n const transition = payload.dragEnd && config.transition;\n\n if (direction === 'both' || direction === 'vertical') {\n x = Math.min(dimension.x1, dimension.x2);\n width = Math.abs(dimension.x2 - dimension.x1);\n } else {\n x = 0;\n width = unitWidth;\n }\n if (direction === 'both' || direction === 'horizontal') {\n y = Math.min(dimension.y1, dimension.y2);\n height = Math.abs(dimension.y2 - dimension.y1);\n } else {\n height = unitHeight;\n y = 0;\n }\n this.show(drawingInf);\n // Create the data array for drawing the rectangle\n const points = [\n {\n x,\n y,\n width,\n height\n }\n ];\n // Create the container group for selection box.\n const selectionGroup = makeElement(selectElement(mountPoint), 'g', [1],\n `.${classPrefix}-${selectionGroupClassName}`);\n const sideEffect = this;\n const selection = selectionGroup.selectAll('rect').data(points);\n const selectionBox = selection.enter().append('rect')\n .each(function () {\n selectionBoxDrag(firebolt)(selectElement(this), ['brush'], sideEffect);\n })\n .merge(selection)\n .each(function (attrs) {\n let element = selectElement(this);\n transition && (element = element.transition().duration(transition.duration));\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n isValidValue(attrs[key]) && element.attr(key, attrs[key]);\n }\n }\n });\n // Get the qualified class name for selection box rectangle\n const boxClassName = getQualifiedClassName(boxConf.defClassName, this._id, classPrefix);\n selectionBox.classed(boxClassName.join(' '), true);\n selectionBox.classed(boxConf.className, true);\n\n return this;\n }\n\n hide (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, false);\n }\n\n show (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, true);\n }\n}\n\nexport default SelectionBox;\n\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './helpers/drag-action-config';\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let subject;\n let drawingInf;\n const context = firebolt.context;\n const onDrag = (payload) => {\n behaviours.forEach(action => firebolt.dispatchBehaviour(action, payload));\n };\n const d3Drag = getD3Drag();\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n drawingInf = context.getDrawingContext();\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n subject.x += event.dx;\n subject.y += event.dy;\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(context.getSourceInfo(), {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n }, context.data().getFieldsConfig());\n onDrag(payload);\n }\n }).on('end', () => {\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(context.getSourceInfo(), {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n },\n snap: true\n }, context.data().getFieldsConfig());\n payload.dragEnd = true;\n onDrag(payload);\n }\n }));\n};\n","export const CLASSPREFIX = 'muze';\nexport const ARROW_RIGHT = 'right';\nexport const ARROW_TOP = 'top';\nexport const ARROW_BOTTOM = 'bottom';\nexport const ARROW_LEFT = 'left';\nexport const TOOLTIP_LEFT = 'left';\nexport const TOOLTIP_RIGHT = 'right';\nexport const TOOLTIP_BOTTOM = 'bottom';\nexport const TOOLTIP_TOP = 'top';\nexport const INITIAL_STYLE = {\n position: 'absolute',\n width: 0,\n height: 0\n};\nexport const TABLE_FORMAT = 'table';\n","import { CLASSPREFIX } from './constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'tooltip-box',\n connectorClassName: 'tooltip-connectors',\n className: '',\n row: {\n margin: 0\n },\n content: {\n spacing: 5,\n iconContainerSize: 10,\n iconScale: 1,\n iconShape: 'circle',\n iconColor: '#ff0000',\n rowMargin: '4px 0 4px 0',\n margin: 10,\n separator: ':',\n className: 'tooltip-content-container',\n parentClassName: 'tooltip-content-parent-container'\n },\n arrow: {\n size: 10,\n disabled: false,\n defClassName: 'tooltip-arrow',\n className: '',\n color: 'rgba(195,195,195,0.85)'\n }\n};\n","import { getQualifiedClassName } from 'muze-utils';\nimport { TOOLTIP_LEFT, TOOLTIP_RIGHT, ARROW_RIGHT, ARROW_LEFT, TOOLTIP_BOTTOM } from './constants';\n\nexport const getArrowPos = (orient, dim, measurement, config) => {\n let arrowPos;\n const { x, y, boxHeight, boxWidth } = measurement;\n const arrowDisabled = config.arrow.disabled;\n const arrowWidth = arrowDisabled ? 0 : config.arrow.size;\n\n if (orient === ARROW_LEFT || orient === ARROW_RIGHT) {\n let start = 0;\n let diff = boxHeight / 2;\n const plotBottom = dim.y + dim.height;\n const boxBottom = y + boxHeight;\n\n if (dim.y > y) {\n start = dim.y - y;\n diff = (plotBottom >= boxBottom ? (boxBottom - dim.y) : dim.height) / 2;\n } else if (boxBottom > plotBottom) {\n diff = Math.abs(y - (dim.y + dim.height)) / 2;\n }\n arrowPos = start + diff - arrowWidth / 2;\n } else {\n let start = 0;\n let diff = boxWidth / 2;\n const plotRight = dim.x + dim.width;\n const boxRight = x + boxWidth;\n\n if (dim.x > x) {\n start = dim.x - x;\n diff = (plotRight >= boxRight ? (boxRight - dim.x) : dim.width) / 2;\n } else if (boxRight > plotRight) {\n diff = Math.abs(x - (dim.x + dim.width)) / 2;\n }\n arrowPos = start + diff - arrowWidth / 2;\n }\n return arrowPos;\n};\n\n/**\n * Places the arrow in the specified arrow position. It also applies appropriate arrow\n * class name to the arrow element.\n * @param {string} position Left, bottom or right position of the arrow;\n * @param {number} arrowPos position of arrow in pixels\n * @return {Tooltip} Instance of tooltip.\n */\nexport const placeArrow = (context, position, arrowPos) => {\n const tooltipArrow = context._tooltipArrow;\n const tooltipBackground = context._tooltipBackground;\n const config = context._config;\n const classPrefix = config.classPrefix;\n const arrowConf = config.arrow;\n const className = getQualifiedClassName(arrowConf.defClassName, context._id, config.classPrefix);\n\n tooltipArrow.style('display', 'block');\n tooltipArrow.attr('class', `${className.join(' ')}`);\n if (position === TOOLTIP_LEFT || position === TOOLTIP_RIGHT) {\n tooltipArrow.style('top', `${arrowPos}px`);\n tooltipArrow.style('left', '');\n tooltipBackground.style('top', `${arrowPos}px`);\n tooltipBackground.style('left', '');\n } else {\n position === TOOLTIP_BOTTOM ? tooltipArrow.style('top', '100%') : tooltipArrow.style('top',\n `-${arrowConf.size}px`);\n tooltipArrow.style('left', `${arrowPos}px`);\n position === TOOLTIP_BOTTOM ? tooltipBackground.style('top', '100%') : tooltipBackground.style('top',\n `-${arrowConf.size + 3}px`);\n tooltipBackground.style('left', `${arrowPos}px`);\n }\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow`, true);\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${context._arrowOrientation}`, false);\n tooltipArrow.classed(`${classPrefix}-tooltip-arrow-${position}`, true);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow`, true);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${context._arrowOrientation}`, false);\n tooltipBackground.classed(`${classPrefix}-tooltip-background-arrow-${position}`, true);\n return this;\n};\n\nexport const reorderContainers = (parentContainer, className) => {\n parentContainer.selectAll(className).sort((a, b) => a - b);\n};\n","import {\n selectElement,\n mergeRecursive,\n makeElement,\n setAttrs,\n setStyles,\n getSymbol,\n isSimpleObject\n} from 'muze-utils';\nimport { TABLE_FORMAT } from './constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class is used to manage the content of tooltip.\n */\nexport default class Content {\n /**\n * Creates an instance of content.\n */\n constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n const config = defaultConfig.content;\n config.classPrefix = defaultConfig.classPrefix;\n return config;\n }\n\n config (...c) {\n if (c.length > 0) {\n this._config = mergeRecursive(this._config, c[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Update model. The format contains presentation strategy which determines how to show the content.\n * If no strategy is mentioned then default is to show key value pair\n */\n update (item) {\n this._model = item.model;\n this._formatter = item.formatter;\n return this;\n }\n\n context (ctx) {\n this._context = ctx;\n return this;\n }\n\n render (mount) {\n let data;\n const config = this._config;\n const iconContainerSize = config.iconContainerSize;\n const formatter = this._formatter;\n const rowMargin = config.rowMargin;\n const model = this._model;\n const { classPrefix } = config;\n\n this._mount = mount;\n if (model instanceof Array) {\n data = model;\n } else {\n data = formatter(this._model, this.config(), this._context);\n }\n\n if (data instanceof Function) {\n const mountHtmlTooltip = makeElement(mount, 'div', [1], `${classPrefix}-tooltip-html-container`);\n mountHtmlTooltip.html(data());\n } else {\n let content = data;\n let displayFormat = 'default';\n\n if (isSimpleObject(data)) {\n content = data.content;\n displayFormat = data.displayFormat;\n }\n\n const body = makeElement(mount, 'div', [displayFormat], `${classPrefix}-tooltip-content`, {},\n d => d);\n\n if (displayFormat === TABLE_FORMAT) {\n const table = makeElement(body, 'table', [1], `${classPrefix}-tooltip-table`);\n const tbody = makeElement(table, 'tbody', [1], `${classPrefix}-tooltip-table-tbody`);\n const rows = makeElement(tbody, 'tr', content, `${classPrefix}-tooltip-table-row`);\n rows.each(function (d, i) {\n selectElement(this).classed(`${classPrefix}-tooltip-table-row-${i}`, true);\n });\n const cells = makeElement(rows, 'td', d => d, `${classPrefix}-tooltip-table-cell`);\n cells.each(function (d) {\n selectElement(this).html(d);\n });\n } else {\n const rows = makeElement(body, 'div', content, '', {\n update: (elem, elemData) => elem.attr('class', elemData.className)\n });\n const cells = makeElement(rows, 'span', d => d.data, `${classPrefix}-tooltip-content`);\n cells.attr('class', `${classPrefix}-tooltip-content`);\n setStyles(rows, {\n margin: rowMargin\n });\n setStyles(cells, {\n display: 'inline-block' // 'margin-right': `${config.spacing}px`\n });\n\n cells.each(function (d) {\n const el = selectElement(this);\n el.html('');\n if (d instanceof Object) {\n if (d.type === 'icon') {\n const svg = makeElement(el, 'svg', [1]);\n const path = makeElement(svg, 'path', [1]);\n const shape = d.shape instanceof Function ? d.shape : getSymbol(d.shape);\n\n setAttrs(svg, {\n x: 0,\n y: 0,\n width: iconContainerSize,\n height: iconContainerSize\n });\n setAttrs(path, {\n d: shape.size(d.size)(),\n transform: `translate(${iconContainerSize / 2}, ${iconContainerSize / 2})`\n });\n setStyles(path, {\n fill: d.color\n });\n setStyles(svg, {\n width: `${iconContainerSize}px`,\n height: `${iconContainerSize}px`\n });\n } else {\n el.html(d.value);\n d.className && el.classed(d.className, true);\n setStyles(el, d.style);\n }\n } else {\n el.html(d);\n }\n });\n }\n }\n return this;\n }\n\n clear () {\n this._model = null;\n return this;\n }\n}\n","import {\n mergeRecursive,\n getQualifiedClassName,\n getUniqueId,\n selectElement,\n setStyles,\n makeElement\n} from 'muze-utils';\nimport { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM, TOOLTIP_TOP,\n INITIAL_STYLE } from './constants';\nimport { defaultConfig } from './default-config';\nimport { getArrowPos, placeArrow, reorderContainers } from './helper';\nimport './styles.scss';\nimport Content from './content';\n\n/**\n * This component is responsible for creating a tooltip element. It appends the tooltip\n * in the body element.\n * @class Tooltip\n */\nexport default class Tooltip {\n /**\n * Initializes the tooltip with the container element and configuration\n * @param {HTMLElement} container container where the tooltip will be mounted.\n * @param {string} className Class name of the tooltip.\n */\n constructor (htmlContainer, svgContainer) {\n let connectorContainer = svgContainer;\n this._id = getUniqueId();\n this._config = {};\n this.config({});\n const tooltipConf = this._config;\n const classPrefix = tooltipConf.classPrefix;\n const contentClass = tooltipConf.content.parentClassName;\n const container = makeElement(htmlContainer, 'div', [1], `${classPrefix}-tooltip-container`);\n this._container = container;\n this._tooltipContainer = container.append('div').style('position', 'absolute');\n this._contentContainer = this._tooltipContainer.append('div').attr('class', `${classPrefix}-${contentClass}`);\n this._tooltipBackground = this._tooltipContainer.append('div').style('position', 'relative');\n this._tooltipArrow = this._tooltipContainer.append('div');\n\n if (!svgContainer) {\n connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none');\n }\n this._contents = {};\n this._tooltipConnectorContainer = selectElement(connectorContainer)\n .append('g')\n .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`);\n const id = this._id;\n const defClassName = tooltipConf.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix);\n\n setStyles(this._tooltipArrow, INITIAL_STYLE);\n setStyles(this._tooltipBackground, INITIAL_STYLE);\n this.addClass(qualifiedClassName.join(' '));\n this.addClass(tooltipConf.className);\n this.hide();\n }\n\n /**\n * Sets the configuration of tooltip.\n * @param {Object} config Configuration of tooltip\n * @return {Tooltip} Instance of tooltip\n */\n config (...config) {\n if (config.length > 0) {\n const defConf = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConf, config[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n return defaultConfig;\n }\n /**\n * Sets the class name of tooltip\n * @param {string} className tooltip class name\n * @return {Tooltip} Instance of tooltip.\n */\n addClass (className) {\n this._tooltipContainer.classed(className, true);\n return this;\n }\n\n context (...ctx) {\n if (ctx.length) {\n this._context = ctx[0];\n return this;\n }\n return this._context;\n }\n\n content (name, data, contentConfig = {}) {\n const config = this.config();\n const { classPrefix } = config;\n const contentClass = config.content.className;\n const formatter = config.formatter;\n const className = contentConfig.className || `${classPrefix}-${contentClass}-${name}`;\n const content = this._contents[name] = this._contents[name] || new Content();\n const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className);\n container.attr('class', `${classPrefix}-${contentClass} ${className}`);\n reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`);\n const contentConf = config.content;\n contentConfig.classPrefix = this._config.classPrefix;\n content.config(contentConf);\n\n if (data === null) {\n content.clear();\n container.remove();\n delete this._contents[name];\n } else {\n content.update({\n model: data,\n formatter: contentConfig.formatter || formatter\n });\n content.context(this._context);\n content.render(container);\n }\n\n if (!Object.keys(this._contents).length) {\n this.hide();\n }\n return this;\n }\n\n getContents () {\n return Object.values(this._contents);\n }\n\n /**\n * Positions the tooltip at the given x and y position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Tooltip} Instance of tooltip.\n */\n position (x, y, conf = {}) {\n if (!Object.keys(this._contents).length) {\n this.hide();\n return this;\n }\n this.show();\n const target = this._target;\n const repositionArrow = conf.repositionArrow;\n\n if (target && repositionArrow) {\n const node = this._tooltipContainer.node();\n const config = this._config;\n const arrowDisabled = config.arrow.disabled;\n const arrowWidth = arrowDisabled ? 0 : config.arrow.size;\n const arrowOrient = this._arrowOrientation;\n const outsidePlot = arrowOrient === ARROW_LEFT || arrowOrient === ARROW_RIGHT ?\n (y + node.offsetHeight - arrowWidth) < target.y || y > (target.y + target.height) :\n (x + node.offsetWidth - arrowWidth) < target.x || x > (target.x + target.width);\n\n if (!arrowDisabled) {\n if (outsidePlot) {\n let path;\n this._tooltipArrow.style('display', 'none');\n this._tooltipBackground.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'block');\n const connector = this._tooltipConnectorContainer.selectAll('path').data([1]);\n const enter = connector.enter().append('path');\n if (arrowOrient === ARROW_LEFT) {\n path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}`\n + ` ${target.y + target.height / 2}`;\n } else if (arrowOrient === ARROW_RIGHT) {\n path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}`\n + ` L ${target.x} ${target.y + target.height / 2}`;\n } else if (arrowOrient === ARROW_BOTTOM) {\n path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}`\n + ` L ${target.x + target.width / 2} ${target.y}`;\n }\n enter.merge(connector).attr('d', path).style('display', 'block');\n } else {\n const arrowPos = getArrowPos(arrowOrient, target, {\n x,\n y,\n boxHeight: node.offsetHeight,\n boxWidth: node.offsetWidth\n }, this._config);\n\n placeArrow(this, this._arrowOrientation, arrowPos);\n this._tooltipConnectorContainer.style('display', 'none');\n }\n }\n }\n\n const offset = this._offset || {\n x: 0,\n y: 0\n };\n this._tooltipContainer.style('left', `${offset.x + x}px`).style('top',\n `${offset.y + y}px`);\n\n return this;\n }\n\n /**\n * Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the\n * boundaries.\n * @param {Object} dim Dimensions of the plot.\n */\n positionRelativeTo (dim, tooltipConf = {}) {\n let obj;\n let orientation = tooltipConf.orientation;\n this.show();\n if (!dim) {\n this.hide();\n return this;\n }\n\n const extent = this._extent;\n const node = this._tooltipContainer.node();\n\n this._tooltipContainer.style('top', '0px')\n .style('left', '0px');\n const offsetWidth = node.offsetWidth + 2;\n const offsetHeight = node.offsetHeight + 2;\n const config = this._config;\n const offset = this._offset;\n const arrowDisabled = config.arrow.disabled;\n const arrowSize = arrowDisabled ? 0 : config.arrow.size;\n const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true;\n const topSpace = dim.y;\n // When there is no space in right\n const dimX = dim.x + dim.width + offset.x;\n const rightSpace = extent.width - dimX;\n const leftSpace = dim.x + offset.x - extent.x;\n const positionTop = topSpace > (offsetHeight + arrowSize);\n const positionRight = rightSpace >= offsetWidth + arrowSize;\n const positionLeft = leftSpace >= offsetWidth + arrowSize;\n\n const positionHorizontal = () => {\n let position;\n let x = dim.x + dim.width;\n let y = dim.y;\n\n if (positionRight) {\n position = TOOLTIP_LEFT;\n x += arrowSize;\n } else if (positionLeft) {\n x = dim.x - offsetWidth;\n position = TOOLTIP_RIGHT;\n x -= arrowSize;\n } else {\n position = 'left';\n x += arrowSize;\n }\n if (dim.height < offsetHeight) {\n y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2);\n }\n\n const arrowPos = getArrowPos(position, dim, {\n x,\n y,\n boxHeight: offsetHeight,\n boxWidth: offsetWidth\n }, this._config);\n\n return {\n position,\n arrowPos,\n x,\n y\n };\n };\n\n const positionVertical = () => {\n let position;\n let y;\n // Position tooltip at the center of plot\n let x = dim.x - offsetWidth / 2 + dim.width / 2;\n\n // Overflows to the right\n if ((extent.width - (dim.x + offset.x)) < offsetWidth) {\n x = extent.width - offsetWidth - offset.x;\n } else if ((x + offset.x) < extent.x) { // Overflows to the left\n x = extent.x;\n }\n\n if (positionTop) {\n y = dim.y - offsetHeight - arrowSize;\n position = TOOLTIP_BOTTOM;\n } else {\n y = dim.y + dim.height + arrowSize;\n position = TOOLTIP_TOP;\n }\n\n const arrowPos = getArrowPos(position, dim, {\n x,\n y,\n boxHeight: offsetHeight,\n boxWidth: offsetWidth\n }, this._config);\n\n return {\n position,\n arrowPos,\n x,\n y\n };\n };\n\n this._target = dim;\n if (!orientation) {\n if (positionTop) {\n orientation = 'vertical';\n } else if (positionRight || positionLeft) {\n orientation = 'horizontal';\n } else {\n orientation = 'vertical';\n }\n }\n\n if (orientation === 'horizontal') {\n obj = positionHorizontal();\n } else if (orientation === 'vertical') {\n obj = positionVertical();\n }\n\n this._position = {\n x: obj.x,\n y: obj.y\n };\n\n this._arrowPos = obj.arrowPos;\n if (!arrowDisabled) {\n placeArrow(this, obj.position, obj.arrowPos);\n } else {\n this._tooltipArrow.style('display', 'none');\n this._tooltipBackground.style('display', 'none');\n }\n this._arrowOrientation = obj.position;\n draw && this.position(obj.x, obj.y);\n return this;\n }\n\n /**\n * Hides the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n hide () {\n this._tooltipContainer.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'none');\n return this;\n }\n\n /**\n * Shows the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n show () {\n this._tooltipContainer.style('display', 'block');\n return this;\n }\n\n extent (extent) {\n this._extent = extent;\n return this;\n }\n\n offset (offset) {\n this._offset = offset;\n return this;\n }\n\n remove () {\n this._tooltipContainer.remove();\n this._tooltipBackground.remove();\n this._tooltipConnectorContainer.remove();\n return this;\n }\n}\n","export const SELECTION_SUMMARY = 'selectionSummary';\nexport const HIGHLIGHT_SUMMARY = 'highlightSummary';\n","import {\n FieldType,\n GROUP_BY_FUNCTIONS,\n formatTemporal,\n DimensionSubtype,\n MeasureSubtype,\n DataModel,\n defaultValue,\n retrieveFieldDisplayName,\n nestCollection,\n getObjProp,\n intersect\n} from 'muze-utils';\nimport { TABLE_FORMAT } from '@chartshq/muze-tooltip';\nimport { SELECTION_SUMMARY, HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst { SUM, COUNT } = GROUP_BY_FUNCTIONS;\nconst { InvalidAwareTypes } = DataModel;\nconst FIRST_VALUE_MARGIN = '10px';\nconst SINGLE_DATA_MARGIN = 10;\n\nconst formatters = (formatter, interval, valueParser) => ({\n [DimensionSubtype.TEMPORAL]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatTemporal(Number(value), interval)),\n [MeasureSubtype.CONTINUOUS]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatter(value.toFixed(2))),\n [DimensionSubtype.CATEGORICAL]: value => valueParser(value)\n});\n\nconst getTabularData = (dataObj, fieldInf) => {\n const rows = [];\n const { data, schema } = dataObj;\n rows.push(schema.map(d => fieldInf[d.name].displayName));\n\n data.forEach((d) => {\n const row = [];\n schema.forEach((fieldObj, i) => {\n const value = fieldInf[fieldObj.name].fn(d[i]);\n row.push(value);\n });\n rows.push(row);\n });\n return rows;\n};\n\nconst getKeyValue = (params) => {\n const { field, value, classPrefix, margin, isSelected, removeKey } = params;\n\n if (!removeKey) {\n const keyObj = {\n value: field,\n className: `${classPrefix}-tooltip-key`\n };\n const valueObj = {\n value,\n className: `${classPrefix}-tooltip-value`\n };\n if (margin !== undefined) {\n keyObj.style = {\n 'margin-left': `${margin}px`\n };\n valueObj.style = {\n 'margin-left': `${margin}px`\n };\n }\n\n return ({\n className: isSelected ? `${classPrefix}-tooltip-row ${classPrefix}-tooltip-selected-row`\n : `${classPrefix}-tooltip-row`,\n data: [keyObj, valueObj]\n }\n );\n }\n return ({\n data: [{\n className: '',\n value,\n style: {\n 'margin-left': FIRST_VALUE_MARGIN\n }\n }],\n className: `${classPrefix}-tooltip-first`\n });\n};\n\nconst generateRetinalFieldsValues = (valueArr, retinalFields, content, context) => {\n const { fieldsConfig, dimensionMeasureMap, axes, config, fieldInf, dataLen, target } = context;\n const { classPrefix, margin, separator } = config;\n const colorAxis = axes.color[0];\n const shapeAxis = axes.shape[0];\n const sizeAxis = axes.size[0];\n const REF_VALUES_INDEX = 1;\n const REF_KEYS_INDEX = 0;\n\n for (const retField in retinalFields) {\n const retIndex = fieldsConfig[retField].index;\n const retinalFieldValue = valueArr[retIndex];\n const measuresArr = dimensionMeasureMap[retField];\n const icon = {\n type: 'icon',\n color: colorAxis.getColor(retinalFieldValue),\n shape: shapeAxis.getShape(retinalFieldValue),\n size: sizeAxis.getSize(retinalFieldValue) * config.iconScale\n };\n const { displayName, fn } = fieldInf[retField];\n const formattedRetinalValue = fn(retinalFieldValue);\n\n if (dataLen === 1) {\n content.push(getKeyValue({\n field: displayName,\n value: formattedRetinalValue,\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n } else {\n const hasMultipleMeasures = measuresArr.length > 1;\n hasMultipleMeasures && (content.push({ data: [icon, formattedRetinalValue] }));\n const selectedContext = target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)];\n const isSelected = selectedContext === retinalFieldValue;\n measuresArr.forEach((measure) => {\n const measureIndex = fieldsConfig[measure].index;\n const { displayName: dName, fn: formatterFn } = fieldInf[measure];\n const value = formatterFn(valueArr[measureIndex]);\n const keyValue = getKeyValue({\n field: hasMultipleMeasures ? `${dName}${separator}` : formattedRetinalValue,\n value,\n classPrefix,\n margin: hasMultipleMeasures ? margin : undefined,\n isSelected\n });\n if (!hasMultipleMeasures) {\n keyValue.data = [icon, ...keyValue.data];\n }\n content.push(keyValue);\n });\n }\n }\n};\n\nconst getFieldInf = (schema, dataModel, context) => {\n const { valueParser, timeDiffs } = context;\n const fieldsObj = dataModel.getFieldspace().fieldsObj();\n const defFormatter = formatters(null, null, valueParser)[DimensionSubtype.CATEGORICAL];\n\n return schema.reduce((inf, field) => {\n const { subtype, name, type } = field;\n const interval = subtype === DimensionSubtype.TEMPORAL ? timeDiffs[name] : 0;\n const nf = type === FieldType.MEASURE ? fieldsObj[name].numberFormat() : val => val;\n inf[name] = {\n fn: defaultValue(formatters(nf, interval, valueParser)[subtype], defFormatter),\n displayName: `${retrieveFieldDisplayName(dataModel, name)}`\n };\n return inf;\n }, {});\n};\n\nexport const buildTooltipData = (dataModel, config = {}, context) => {\n let nestedDataObj;\n let fieldValues = [];\n const { data, schema } = dataModel.getData();\n const fieldspace = dataModel.getFieldspace();\n const fieldsConfig = dataModel.getFieldsConfig();\n const { color, shape, size } = context.firebolt.context.retinalFields();\n const detailFields = context.detailFields || [];\n const dimensions = schema.filter(d => d.type === FieldType.DIMENSION);\n const measures = schema.filter(d => d.type === FieldType.MEASURE);\n const containsDetailField = !!intersect(schema, detailFields).length;\n const dataLen = data.length;\n const {\n dimensionMeasureMap,\n axes\n } = context;\n const fieldInf = getFieldInf(schema, dataModel, context);\n\n let displayFormat;\n if (dataLen > 1 && containsDetailField) {\n fieldValues = getTabularData({\n data,\n schema,\n fieldspace\n }, fieldInf);\n displayFormat = TABLE_FORMAT;\n } else {\n const retinalFields = [color.field, shape.field, size.field].reduce((acc, field) => {\n field && fieldsConfig[field].def.type === FieldType.DIMENSION && (acc[field] = 1);\n return acc;\n }, {});\n const filteredDimensions = dimensions.filter(field => !retinalFields[field.name]);\n const indices = filteredDimensions.map(dim => fieldsConfig[dim.name].index);\n const allMeasures = [...new Set(...Object.values(dimensionMeasureMap))];\n const filteredMeasures = dataLen > 1 ? measures.filter(d => allMeasures.indexOf(d.name) === -1) : measures;\n\n nestedDataObj = nestCollection({\n data,\n keys: indices\n });\n\n nestedDataObj = !('key' in nestedDataObj[0]) ? [{\n values: nestedDataObj\n }] : nestedDataObj;\n\n const generateTooltipContent = (nestedData, index = 0, content = []) => {\n const { classPrefix, separator } = config;\n for (let i = 0, len = nestedData.length; i < len; i++) {\n const { values, key } = nestedData[i];\n const field = getObjProp(schema, indices[index], 'name');\n const margin = dataLen === 1 || Object.keys(retinalFields).length === 0\n ? SINGLE_DATA_MARGIN : undefined;\n if (field) {\n const { displayName, fn } = fieldInf[field];\n const formattedValue = fn(key);\n const removeKey = values.length > 1;\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: formattedValue,\n classPrefix,\n margin,\n isSelected: undefined,\n removeKey\n }));\n }\n\n if (values[0] && values[0].key) {\n generateTooltipContent(values, index + 1, content);\n } else {\n for (let j = 0, len2 = values.length; j < len2; j++) {\n const valueArr = values[j];\n generateRetinalFieldsValues(valueArr, retinalFields, content, {\n fieldInf,\n axes,\n config,\n fieldsConfig,\n dimensionMeasureMap,\n dataLen,\n target: context.payload.target\n });\n\n filteredMeasures.forEach((measure) => {\n const { name } = measure;\n const { displayName, fn } = fieldInf[name];\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: fn(valueArr[fieldsConfig[name].index]),\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n });\n }\n }\n }\n };\n generateTooltipContent(nestedDataObj, 0, fieldValues);\n }\n\n return {\n content: fieldValues,\n displayFormat\n };\n};\n\nexport const strategies = {\n [SELECTION_SUMMARY]: (dm, config, context) => {\n const { selectionSet } = context;\n const aggFns = selectionSet.mergedEnter.aggFns;\n const dataObj = dm.getData();\n const measures = dataObj.schema.filter(d => d.type === FieldType.MEASURE);\n const aggregatedModel = dm.groupBy([''], measures.reduce((acc, v) => {\n acc[v.name] = aggFns[v.name] === COUNT ? SUM : aggFns[v.name];\n return acc;\n }, {\n saveChild: false\n }));\n const fieldsConf = aggregatedModel.getFieldsConfig();\n let values = [[{\n value: `${dataObj.data.length}`,\n style: {\n 'font-weight': 'bold'\n }\n }, 'Items Selected']];\n const measureNames = measures.map(d => d.name);\n const data = aggregatedModel.getData().data;\n measureNames.forEach((measure) => {\n const value = data[0][fieldsConf[measure].index];\n value instanceof InvalidAwareTypes ? values.push([]) : values.push([`(${aggFns[measure].toUpperCase()})`,\n `${retrieveFieldDisplayName(dm, measure)}`,\n {\n value: `${value.toFixed(2)}`,\n style: {\n 'font-weight': 'bold'\n }\n }]);\n });\n if (measureNames.length === 1) {\n values = [[...values[0], ...values[1]]];\n }\n return ([{\n data: values[0]\n }]);\n },\n [HIGHLIGHT_SUMMARY]: (data, config, context) => buildTooltipData(data, config, context)\n};\n","import { Tooltip as TooltipRenderer } from '@chartshq/muze-tooltip';\nimport { FieldType, mergeRecursive, defaultValue } from 'muze-utils';\nimport { spaceOutBoxes } from '../helper';\nimport { strategies } from './strategies';\nimport { FRAGMENTED } from '../../enums/constants';\nimport { TOOLTIP } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\nimport { HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst configResolvers = {\n [HIGHLIGHT_SUMMARY]: (specificConf, config) => defaultValue(specificConf, config),\n default: specificConf => defaultValue(specificConf, {})\n};\n\nconst sanitizeConfig = (config, context) => {\n const strategyObj = context._strategies;\n const sanitizedConf = Object.assign({}, config);\n for (const key in strategyObj) {\n sanitizedConf[key] = defaultValue(configResolvers[key], configResolvers.default)(config[key], config);\n }\n return sanitizedConf;\n};\n\nexport default class Tooltip extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._tooltips = {};\n this._strategies = mergeRecursive({}, strategies);\n this._strategy = HIGHLIGHT_SUMMARY;\n }\n\n static defaultConfig () {\n return {\n padding: 5,\n offset: {\n x: 0,\n y: 0\n },\n highlightSummary: {\n dataTransform: (dt, fields) => (fields ? dt.project(fields, { saveChild: false }) : dt\n )\n },\n selectionSummary: {\n dataTransform: (dt, fields) => {\n const fieldspace = dt.getFieldspace();\n const dimensions = Object.keys(fieldspace.getDimension());\n const measures = Object.keys(fieldspace.getMeasure());\n const projectedFields = defaultValue(fields, measures.length ? [measures[0]] : []);\n return dt.project([...dimensions, ...projectedFields], {\n saveChild: false\n });\n }\n }\n };\n }\n\n static formalName () {\n return TOOLTIP;\n }\n\n config (...params) {\n if (params.length) {\n const config = this._config = mergeRecursive(this._config, sanitizeConfig(params[0], this));\n const strategyObj = this._strategies;\n for (const key in strategyObj) {\n const formatter = config[key].formatter;\n this.setStrategy(key, formatter);\n }\n return this;\n }\n return this._config;\n }\n\n apply (selectionSet, payload, options = {}) {\n let totalHeight = 0;\n let totalWidth = 0;\n const dataModel = selectionSet.mergedEnter.model;\n const context = this.firebolt.context;\n const drawingInf = this.drawingContext();\n if ((dataModel.isEmpty() || payload.criteria === null)) {\n this.hide(options, null);\n return this;\n }\n\n const tooltips = this._tooltips;\n const config = this.config();\n const boundBox = {\n width: drawingInf.width,\n height: drawingInf.height\n };\n const showInPosition = payload.showInPosition;\n const pad = config.padding;\n const dataModels = [];\n const fragmented = config.mode === FRAGMENTED;\n const sourceInf = context.getSourceInfo();\n const fields = sourceInf.fields;\n const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false;\n const showVertically = !!xFieldDim;\n const tooltipPos = payload.position;\n const boxes = [];\n const enter = {};\n const uids = dataModel.getData().uids;\n if (fragmented) {\n dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, {\n saveChild: false\n })));\n } else {\n dataModels.push(dataModel);\n }\n\n let target = payload.target;\n let targetFields = [];\n if (target) {\n targetFields = target[0] || [];\n const sourceFields = payload.sourceFields;\n const indices = [];\n for (let i = 0, len = targetFields.length; i < len; i++) {\n if (sourceFields.indexOf(targetFields[i]) !== -1) {\n indices.push(i);\n }\n }\n target = target.map(d => d.filter((v, i) => indices.indexOf(i) !== -1));\n }\n\n const plotDimensions = context.getPlotPointsFromIdentifiers(target || payload.criteria, {\n getBBox: true\n });\n\n const strategy = defaultValue(options.strategy, this._strategy);\n const strategyConf = config[strategy];\n const { dataTransform, fields: projectFields } = strategyConf;\n const strategyObj = this._strategies;\n // Show tooltip for each datamodel\n for (let i = 0; i < dataModels.length; i++) {\n let plotDim = plotDimensions[i];\n if (fragmented) {\n const dimensions = dataModels[i].getData().schema.filter(d => d.type === FieldType.DIMENSION)\n .map(d => d.name);\n plotDim = context.getPlotPointsFromIdentifiers(dataModels[i].project(dimensions), { getBBox: true });\n plotDim = plotDim && plotDim[0];\n }\n\n const dt = dataTransform(dataModels[i], projectFields, this);\n\n enter[i] = true;\n const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf;\n const layoutBoundBox = layoutContainer.getBoundingClientRect();\n const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect();\n\n const offsetLeft = unitBoundBox.left - layoutBoundBox.left;\n const offsetTop = unitBoundBox.top - layoutBoundBox.top;\n const tooltipInst = tooltips[i] = tooltips[i] || new TooltipRenderer(layoutContainer,\n drawingInf.svgContainer);\n\n sourceInf.payload = payload;\n sourceInf.firebolt = this.firebolt;\n sourceInf.detailFields = context.detailFields();\n sourceInf.timeDiffs = context.timeDiffsByField();\n sourceInf.valueParser = context.valueParser();\n sourceInf.selectionSet = selectionSet;\n tooltipInst.context(sourceInf);\n const strategyFn = strategyObj[strategy];\n tooltipInst.content(strategy, dt, {\n formatter: strategyFn,\n order: options.order\n })\n .config(this.config())\n .extent({\n x: 0,\n y: 0,\n width: parentContainerDimensions.width,\n height: parentContainerDimensions.height\n })\n .offset({\n x: offsetLeft + (config.offset.x || 0),\n y: offsetTop + (config.offset.y || 0)\n });\n\n if (showInPosition) {\n tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad);\n } else if (plotDim) {\n tooltipInst.positionRelativeTo({\n x: plotDim.x,\n y: plotDim.y,\n width: plotDim.width || 0,\n height: plotDim.height || 0\n }, {\n orientation: fragmented ?\n (showVertically ? 'horizontal' : 'vertical') : undefined\n });\n } else {\n tooltipInst.hide();\n break;\n }\n\n if (fragmented) {\n const position = tooltipInst._position;\n const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect();\n\n totalHeight += tooltipBoundBox.height + pad;\n totalWidth += tooltipBoundBox.width + pad;\n if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) {\n break;\n }\n boxes.push({\n x: position.x,\n y: position.y,\n width: tooltipBoundBox.width,\n height: tooltipBoundBox.height,\n tooltip: tooltipInst\n });\n }\n }\n\n for (const key in tooltips) {\n if (!enter[key]) {\n const tooltip = tooltips[key];\n tooltip.content(payload.action, null);\n if (!tooltip.getContents().length) {\n tooltip.remove();\n delete tooltips[key];\n }\n }\n }\n if (fragmented) {\n spaceOutBoxes(boxes, boundBox, showVertically);\n boxes.forEach(box => box.tooltip.position(box.x, box.y, {\n repositionArrow: true\n }));\n }\n return this;\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const strategy = options.strategy || this._strategy;\n tooltips[key].content(strategy, null);\n tooltips[key].hide();\n }\n }\n }\n}\n","export const spaceOutBoxes = (boxes, extent, showVertically) => {\n let y;\n let height;\n let x;\n let width;\n let i;\n const pad = 5;\n const len = boxes.length;\n const spaceOutIfOverlap = (firstBox, secondBox, opposite) => {\n x = firstBox.x;\n width = firstBox.width;\n y = firstBox.y;\n height = firstBox.height;\n const bottom = y + height;\n const right = x + width;\n\n if (showVertically) {\n if (opposite ? y < (secondBox.y + secondBox.height) : bottom > secondBox.y) {\n secondBox.y = opposite ? firstBox.y - secondBox.height - pad :\n bottom + pad;\n }\n } else if (opposite ? x < (secondBox.x + secondBox.width) : right > secondBox.x) {\n secondBox.x = opposite ? firstBox.x - secondBox.width - pad :\n right + pad;\n }\n };\n\n boxes.sort((a, b) => (showVertically ? a.y - b.y : a.x - b.x));\n i = 0;\n\n for (i = 0; i < len - 1; i++) {\n spaceOutIfOverlap(boxes[i], boxes[i + 1]);\n }\n\n if ((boxes[i].y + boxes[i].height) > extent.height ||\n (boxes[i].x + boxes[i].width) > extent.width) {\n if (showVertically) {\n boxes[i].y -= (boxes[i].height + boxes[i].y) - extent.height;\n } else {\n boxes[i].x -= (boxes[i].width + boxes[i].x) - extent.width;\n }\n for (i = len - 1; i > 0; i--) {\n spaceOutIfOverlap(boxes[i], boxes[i - 1], true);\n }\n }\n return boxes;\n}\n;\n","import { selectElement, FieldType } from 'muze-utils';\n\nimport './styles.scss';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { CROSSLINE } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nexport default class Crossline extends SpawnableSideEffect {\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-crossline-group`,\n bandClass: `${CLASSPREFIX}-crossband`,\n lineClass: `${CLASSPREFIX}-crossline`\n };\n }\n\n static formalName () {\n return CROSSLINE;\n }\n\n apply (selectionSet, payload) {\n let height;\n let bandWidth;\n let px;\n let width;\n const {\n className,\n bandClass,\n lineClass\n } = this.config();\n const dataModel = selectionSet.mergedEnter.model;\n const drawingInf = this.drawingContext();\n if (payload.criteria && dataModel && dataModel.isEmpty()) {\n return this;\n }\n if (payload.criteria === null || !dataModel) {\n this.hide();\n return this;\n }\n\n const dataObj = dataModel.getData();\n const sourceInf = this.firebolt.context.getSourceInfo();\n const axes = sourceInf.axes;\n const axisFields = sourceInf.fields;\n const fields = selectionSet.fields;\n const data = dataObj.data;\n const fieldsConfig = dataModel.getFieldsConfig();\n const svgContainer = drawingInf.sideEffectGroup;\n\n const elemData = [];\n fields.forEach((field) => {\n const fieldIndex = fieldsConfig[field] && fieldsConfig[field].index;\n const dataArr = data.map(d => d[fieldIndex]);\n const axisIndex = [['x', 0], ['x', 1], ['y', 0], ['y', 1]].find((arr) => {\n const fieldInst = axisFields[arr[0]][arr[1]];\n return fieldInst && fieldInst.type() === FieldType.DIMENSION &&\n fieldInst.getMembers().indexOf(field) !== -1;\n });\n if (axisIndex !== undefined && data.length) {\n const type = axisIndex[0];\n const axis = axes[type][axisIndex[1]];\n const value = dataArr[0];\n bandWidth = axis.getUnitWidth() || 0;\n px = axis.getScaleValue(value) + bandWidth / 2 + drawingInf.xOffset;\n const layers = this.firebolt.context.layers();\n const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type]));\n const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type]));\n height = drawingInf.height;\n width = drawingInf.width;\n const startPx = px - plotWidth / 2 - pad / 2;\n const endPx = px + plotWidth / 2 + pad / 2;\n const dataPoint = {};\n if (type === 'y') {\n dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`;\n } else {\n dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`;\n }\n dataPoint.className = plotWidth ? bandClass : lineClass;\n !isNaN(px) && elemData.push(dataPoint);\n }\n });\n if (elemData.length) {\n const parentGroup = this.createElement(svgContainer, 'g', [1], className);\n const elem = this.createElement(parentGroup, 'path', elemData);\n elem.attr('d', d => d.d).style('pointer-events', 'none')\n .attr('class', d => d.className);\n }\n return this;\n }\n\n hide () {\n const className = this.config().className;\n const drawingInf = this.drawingContext();\n selectElement(drawingInf.sideEffectGroup).selectAll(`.${className}`).remove();\n }\n}\n","const fadeFn = (set, context, strategy) => {\n const {\n mergedEnter,\n mergedExit,\n exitSet,\n completeSet\n } = set;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, strategy, false);\n } else {\n context.applyInteractionStyle(exitSet[1], {}, strategy, true);\n context.applyInteractionStyle(mergedEnter, {}, strategy, false);\n }\n};\n\nexport const strategies = {\n fade: fadeFn,\n focus: (set, context) => {\n const {\n mergedEnter,\n mergedExit,\n completeSet\n } = set;\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, 'focus', false);\n } else {\n context.applyInteractionStyle(mergedExit, {}, 'focus', true);\n context.applyInteractionStyle(mergedEnter, {}, 'focus', false);\n }\n },\n highlight: (set, context) => {\n const {\n mergedEnter,\n mergedExit,\n entrySet,\n exitSet,\n completeSet\n } = set;\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, {}, 'highlight', false);\n } else {\n context.applyInteractionStyle(entrySet[1], {}, 'highlight', true);\n context.applyInteractionStyle(exitSet[1], {}, 'highlight', false);\n }\n }\n};\n","import SurrogateSideEffect from '../surrogate';\nimport { strategies } from './strategy';\nimport { HIGHLIGHTER } from '../../enums/side-effects';\n\nexport default class PlotHighlighter extends SurrogateSideEffect {\n constructor (...params) {\n super(...params);\n this._strategy = 'highlight';\n this._strategies = strategies;\n }\n\n static formalName () {\n return HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this, options.strategy || this._strategy);\n\n return this;\n }\n}\n","import SurrogateSideEffect from '../surrogate';\n\nexport default class FilterEffect extends SurrogateSideEffect {\n static formalName () {\n return 'filter';\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static mutates () {\n return true;\n }\n\n apply (selectionSet, payload) {\n const context = this.firebolt.context;\n const entryModel = selectionSet.mergedEnter.model;\n if (payload.criteria === null) {\n context.clearCaching().resetData();\n } else {\n context.enableCaching().data(entryModel);\n }\n return this;\n }\n}\n","import { DataModel, getObjProp } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { ANCHORS } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\n\nconst addLayer = (layerRegistry, context, sideEffect) => {\n context.addLayer((layerDefs) => {\n const layers = [];\n\n if (layerDefs) {\n layerDefs.forEach((layerDef) => {\n const mark = layerDef.mark;\n const layerCls = layerRegistry[mark];\n\n if (layerCls && layerCls.shouldDrawAnchors()) {\n const depLayerEncoding = layerDef.def.encoding;\n const encoding = {\n x: getObjProp(depLayerEncoding, 'x', 'field'),\n y: getObjProp(depLayerEncoding, 'y', 'field'),\n color: getObjProp(depLayerEncoding, 'color', 'field'),\n size: {\n field: getObjProp(depLayerEncoding, 'size', 'field'),\n value: sideEffect.defaultSizeValue()\n }\n };\n const commonName = sideEffect.constructor.formalName();\n const name = `${layerDef.def.name}-${commonName}`;\n\n layers.push({\n name,\n mark: 'point',\n groupId: commonName,\n className: sideEffect.constructor.defaultConfig().className,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n }\n });\n }\n return layers;\n });\n};\n\nexport default class AnchorEffect extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._layersMap = {};\n this.addAnchorLayers();\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-anchors-group`\n };\n }\n\n static formalName () {\n return ANCHORS;\n }\n\n addAnchorLayers () {\n const context = this.firebolt.context;\n const layerRegistry = context.registry().layerRegistry;\n\n addLayer(layerRegistry, context, this);\n return this;\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n /**\n * Returns the default area value of the anchor point.\n * @return { number } Default area value of anchor.\n */\n defaultSizeValue () {\n return 100;\n }\n\n apply (selectionSet) {\n const dataModel = selectionSet.mergedEnter.model;\n const formalName = this.constructor.formalName();\n\n const context = this.firebolt.context;\n const layers = context.layers().filter(layer => layer.config().groupId === formalName);\n\n layers.forEach((layer) => {\n const linkedLayer = context.getLayerByName(layer.config().owner);\n const [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel);\n const transformedDataModel = new DataModel(transformedData, schema);\n\n layer.data(transformedDataModel);\n });\n return this;\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { PERSISTENT_ANCHORS } from '../enums/side-effects';\n\nexport default class PersistentAnchors extends AnchorEffect {\n static formalName () {\n return PERSISTENT_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-persistent-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { BRUSH_ANCHORS } from '../enums/side-effects';\n\nexport default class BrushAnchors extends AnchorEffect {\n static formalName () {\n return BRUSH_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-brush-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n}\n","import * as BEHAVIOURS from './enums/behaviours';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: ['selectionBox', {\n name: 'highlighter',\n options: {\n strategy: 'fade'\n }\n }, 'brush-anchors'],\n [`${BEHAVIOURS.BRUSH},${BEHAVIOURS.SELECT}`]: [{\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary',\n order: 0,\n filter: context => context.config().mode === 'fragmented'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: 'highlighter',\n options: {\n strategy: 'highlight'\n }\n }, 'crossline', {\n name: 'tooltip',\n options: {\n order: 9999\n }\n }, 'anchors'],\n [BEHAVIOURS.FILTER]: ['filter'],\n [BEHAVIOURS.SELECT]: [{\n name: 'highlighter',\n options: {\n strategy: 'focus'\n }\n }, 'persistent-anchors']\n};\n","export const CLASSPREFIX = 'muze';\nexport const STACK = 'stack';\nexport const GROUP = 'group';\nexport const IDENTITY = 'identity';\nexport const ANGLE = 'angle';\nexport const RADIUS = 'radius';\nexport const SIZE = 'size';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const TEXT = 'text';\nexport const OUTER_RADIUS_VALUE = 'outerRadiusValue';\nexport const TEXT_ANCHOR_MIDDLE = 'middle';\nexport const ENCODING = {\n X: 'x',\n Y: 'y',\n X0: 'x0',\n Y0: 'y0',\n RADIUS: 'radius',\n RADIUS0: 'radius0',\n ANGLE: 'angle',\n ANGLE0: 'angle0'\n};\n\nexport const ASCENDING = 'asc';\n\nexport const AGG_FN_SUM = 'sum';\n\nexport const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { CLASSPREFIX, STACK } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-area',\n className: '',\n interpolate: 'linear',\n transform: {\n type: STACK\n },\n interaction: {\n\n },\n nearestPointThreshold: 10,\n encoding: {\n color: {},\n x: {},\n y: {},\n y0: {},\n strokeOpacity: {\n value: 1\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * This is an interface class which any new layer class has to extend.\n *\n * @example\n * class BarLayer extends BaseLayer {\n * update (params) {\n * // super.update(params);\n * // Update the bar layer\n * }\n * }\n * @class\n */\nexport default class SimpleLayer {\n\n formalName () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets or gets the dependencies.\n * @param {Object} dependencies Dependencies needed by layer\n * @return {BaseLayer} Instance of base layer.\n */\n dependencies () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the config of the layer\n *\n * @param {Object} config Configuration of layer\n * @return {Object} configuration of layer\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Acts as a getter or setter function\n * When setter\n * Returns the datamodel of the layer\n * @param { DataModel } dataModel instance of DataModel\n * @return { DataModel } DataModel instance of the layer\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized schema of the layer\n * @return {Object} Serialized schema\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the unique identifier of this layer\n * @return {string} id of the layer\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n /*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldMap field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n * @private\n */\n normalizeTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of dataModel\n * @param {Object} config configuration for transforming data\n * @return {Array.} Transformed data.\n * @private\n */\n getTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a nominal field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @return {Array} Domain values array.\n */\n _calculateDomainFromData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, color, etc.\n * @return {Object} Axis domains\n */\n getDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for getting nearest point\n * @return {BaseLayer} Instance of base layer\n */\n getNearestPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for highlighting points\n * @return {BaseLayer} Instance of base layer\n */\n highlightPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for deselecting points\n * @return {BaseLayer} Instance of base layer\n */\n dehighlightPoint () {\n return this;\n }\n\n linkLayerStore () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets the container element for the layer to be renderered.\n * @param {SVGElement} mountPoint SVG element or group element.\n */\n mount () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n","import { COORD_TYPES, mergeRecursive } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nconst { CARTESIAN } = COORD_TYPES;\nexport const props = {\n axes: {},\n mount: {},\n measurement: {},\n metaInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {\n defaultValue: CARTESIAN\n },\n [PROPS.CONFIG]: {\n value: null,\n sanitization: (context, config) => {\n context._customConfig = config;\n const constructor = context.constructor;\n const newConf = mergeRecursive({}, constructor.defaultConfig());\n\n return constructor.defaultPolicy(newConf, config);\n }\n }\n};\n","export const DATA = 'data';\nexport const CONFIG = 'config';\nexport const MEASUREMENT = 'measurement';\nexport const DOMAIN = 'domain';\nexport const MOUNT = 'mount';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { Symbols } from 'muze-utils';\nimport * as AxisOrientation from '../enums/axis-orientation';\n\n/**\n * @module Axis\n * This file exports constants that are used to reference axis orientations\n * in a consistent manner.\n */\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\n\n/**\n * This object is used to associate the axis orientation with the d3 class\n * used to represent that axis.\n */\nexport const axisOrientationMap = {\n [AxisOrientation.LEFT]: Symbols.axisLeft,\n [AxisOrientation.BOTTOM]: Symbols.axisBottom,\n [AxisOrientation.RIGHT]: Symbols.axisRight,\n [AxisOrientation.TOP]: Symbols.axisTop\n};\n","/**\n * @module axis\n * This file exports constants used to reference scale type\n * consistently throughout the project.\n */\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const TIME = 'temporal';\nexport const COLOR = 'color';\nexport const ORDINAL = 'ordinal';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\nexport const LOG = 'log';\nexport const POW = 'pow';\nexport const IDENTITY = 'identity';\nexport const SEQUENTIAL = 'sequential';\nexport const THRESHOLD = 'threshold';\n","export const CLASSPREFIX = 'muze';\n\nexport const CONTINOUS = 'continous';\nexport const DISCRETE = 'discrete';\nexport const SEQUENTIAL = 'sequential';\nexport const ORDINAL = 'ordinal';\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const THRESHOLD = 'threshold';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\n\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\n\nexport const DOMAIN = 'domain';\nexport const HIDDEN = 'hidden';\nexport const NUMBER = 'number';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\n\nexport const RGB = 'rgb';\nexport const HEX = 'hex';\nexport const HSLA = 'hsla';\nexport const HSL = 'hsl';\n\nexport const DEFAULT_ANGLE_DOMAIN = [1];\nexport const MIN_NO_OF_TICKS = 2;\nexport const DEFAULT_NO_OF_TICKS = 10;\n\n","import { scales, colorSchemes } from 'muze-utils';\n\nimport {\n SEQUENTIAL,\n ORDINAL,\n LINEAR,\n CONTINOUS,\n THRESHOLD,\n QUANTIZE\n} from './enums/constants';\n\nimport * as ScaleType from './enums/scale-type';\n\nconst {\n scaleLinear,\n scaleThreshold,\n scaleLog,\n scalePow,\n scaleIdentity,\n scaleOrdinal,\n scaleSequential,\n scaleQuantize,\n scaleQuantile,\n schemeCategory10,\n schemeCategory20,\n schemeCategory20b,\n scaleBand,\n scaleTime\n} = scales;\nexport const scaleMap = {\n [ScaleType.LINEAR]: scaleLinear,\n [ScaleType.BAND]: scaleBand,\n [ScaleType.QUANTIZE]: scaleQuantize,\n [ScaleType.QUANTILE]: scaleQuantile,\n [ScaleType.THRESHOLD]: scaleThreshold,\n [ScaleType.SEQUENTIAL]: scaleSequential,\n [ScaleType.LOG]: scaleLog,\n [ScaleType.POW]: scalePow,\n [ScaleType.IDENTITY]: scaleIdentity,\n [ScaleType.TIME]: scaleTime,\n [ScaleType.COLOR]: scaleLinear,\n [ScaleType.ORDINAL]: scaleOrdinal\n};\nexport const SCHEMES = {\n SCHEME1: schemeCategory10,\n SCHEME2: schemeCategory20,\n SCHEME3: schemeCategory20b\n};\n\n/**\n * Accepts a scheme in a string format and returns the scale from d3-scale-chromatic\n *\n * @export\n * @param {string} scheme a string representing the kind of scheme for the color axis\n * @return {Object} The corresponding scale from a scheme type from d3 chromatic scale\n */\nexport function getScheme (scheme) {\n if (scheme[0] === 'i') {\n return scaleSequential(colorSchemes[scheme]);\n }\n return scaleOrdinal(colorSchemes[scheme]);\n}\n\n/**\n *\n *\n * @export\n * @param {*} scheme\n *\n */\nexport function getSchemeType (scheme) {\n let schemeType = '';\n if (scheme && typeof (scheme) === 'string') {\n schemeType = scheme[0] === 'i' ? SEQUENTIAL : ORDINAL;\n } else {\n schemeType = ORDINAL;\n }\n return schemeType;\n}\n\n/**\n * This function is used to create a scale that is assigned to\n * an instance of axis.\n *\n * @export\n * @param {Object} params the input parameters to create a Scale object\n * @param {string} params.type the type of scale\n * @param {Array} params.range the range of scale\n * @return {Object} instance of scale\n */\nexport function createScale (params) {\n if (!params.type || !scaleMap[params.type]) {\n throw new Error(`${params.type} is not a valid scale type`);\n }\n if (!Array.isArray(params.range)) {\n throw new Error('range parameter must be an array');\n }\n let scaleFactory = null;\n const range = params.range;\n // @todo: do it using scale decorator\n if (params.type === LINEAR && params.interpolator) {\n scaleFactory = scaleMap[params.interpolator];\n if (params.interpolator === ScaleType.POW) {\n return scaleFactory().range(range).exponent(params.exponent);\n } else if (params.interpolator === ScaleType.LOG) {\n return scaleFactory().range(range).base([params.base]);\n }\n } else {\n scaleFactory = scaleMap[params.type];\n }\n\n if (params.type === QUANTIZE) {\n scaleFactory().nice();\n }\n return scaleFactory().range(range);\n}\n\n/**\n * This method is used to update the range of a scale\n * so that the core module can remain agnostic of the d3\n * scale api.\n *\n * @export\n * @param {Scale} scale Instance of d3 Scale.\n * @param {Array} range new range of the scale.\n * @return {Scale} Updated scale.\n */\nexport function updateScaleRange (scale, range) {\n return scale.range(range);\n}\n\n/**\n *\n *\n * @export\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} steps\n *\n */\nexport function getScaleType (domainType, rangeType, steps) {\n if (rangeType === CONTINOUS) {\n return LINEAR;\n }\n if (domainType === CONTINOUS) {\n if (steps instanceof Array) {\n return THRESHOLD;\n }\n return QUANTIZE;\n }\n return ORDINAL;\n}\n","import { getUniqueId } from 'muze-utils';\nimport { CLASSPREFIX } from '../enums/constants';\n\n/**\n *\n *\n */\nexport const defaultConfig = {\n id: getUniqueId(),\n adjustRange: false,\n axisName: {\n defClassName: 'axis-name'\n },\n axisNamePadding: 12,\n base: 10,\n classPrefix: CLASSPREFIX,\n className: `${CLASSPREFIX}-axis`,\n exponent: 1,\n interpolator: 'linear',\n fixedBaseline: true,\n labels: {\n rotation: null,\n smartTicks: null\n },\n orientation: 'left',\n numberFormat: val => val,\n padding: 0.3,\n nice: true,\n numberOfTicks: null,\n rotate: false,\n show: true,\n showAxisName: true,\n showInnerTicks: true,\n showOuterTicks: true,\n style: {},\n type: 'linear',\n tickFormat: null,\n tickValues: null,\n xOffset: 0,\n yOffset: 0\n};\n\n","/**\n * This file exports functionality that is used to render axis.\n */\nimport { selectElement, makeElement, angleToRadian } from 'muze-utils';\nimport * as AxisOrientation from './enums/axis-orientation';\nimport { LINEAR, HIDDEN, BOTTOM, TOP } from './enums/constants';\n\n/**\n *\n *\n * @param {*} instance\n * @param {*} container\n * @param {*} labelManager\n * @param {*} config\n */\nconst rotateAxis = (instance, tickText, labelManager) => {\n let rotation;\n const axis = instance.axis();\n const config = instance.config();\n const renderConfig = instance.renderConfig();\n const smartTicks = instance.smartTicks();\n const scale = axis.scale();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n const ticks = labelFunc();\n const {\n orientation,\n fixedBaseline,\n type\n } = config;\n const {\n labels\n } = renderConfig;\n\n rotation = labels.rotation;\n\n const tickSize = instance.getTickSize();\n tickText.each(function (d, index) {\n let yShift;\n let xShift;\n let datum = smartTicks[index] ? smartTicks[index].text : d;\n\n datum = datum.toString();\n\n const tickLabelDim = labelManager.getOriSize(datum);\n\n const width = tickLabelDim.width * 0.5;\n const height = tickLabelDim.height * 0.5;\n\n if (rotation < 0) {\n rotation = 360 + rotation;\n }\n\n const quadrant = 4 - Math.floor(rotation / 90);\n const rotationNormalizer = ((quadrant % 2 === 0) ? rotation : 180 * Math.ceil(rotation / 180) - rotation) % 180;\n\n yShift = Math.sqrt(height ** 2 + width ** 2) * Math.sin(angleToRadian(rotationNormalizer));\n\n if ((quadrant === 3 || quadrant === 2) && !(rotationNormalizer > 67.5 && rotationNormalizer <= 90)) {\n yShift += height * 2;\n }\n xShift = width;\n\n if (rotation === 90) {\n xShift = height;\n } else if (rotation === 270) {\n xShift = -height;\n } else {\n xShift = 0;\n }\n\n if (orientation === AxisOrientation.TOP) {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift + xShift / 2 : xShift;\n selectElement(this)\n .attr('transform', `translate(${-xShift + tickSize}\n ${-yShift - tickSize}) rotate(${rotation})`);\n } else {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift - xShift / 2 : xShift;\n\n selectElement(this)\n .attr('transform', `translate(${xShift - tickSize}\n ${yShift + tickSize}) rotate(${rotation})`);\n }\n selectElement(this).transition()\n .duration(1000).text(datum);\n });\n return tickText;\n};\n\n/**\n *\n *\n * @param {*} tickText\n * @param {*} axisInstance\n */\nconst changeTickOrientation = (selectContainer, axisInstance, tickSize) => {\n const {\n _smartTicks\n } = axisInstance;\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const {\n orientation,\n classPrefix\n } = config;\n const {\n labels\n } = renderConfig;\n const {\n rotation,\n smartTicks: isSmartTicks\n } = labels;\n\n const tickText = selectContainer.selectAll('.tick text');\n tickText.selectAll('tspan').remove();\n\n // rotate labels if not enough space is available\n if (rotation && (orientation === TOP || orientation === BOTTOM)) {\n rotateAxis(axisInstance, tickText, labelManager);\n } else if (!rotation && !isSmartTicks) {\n tickText.attr('transform', '');\n } else {\n tickText.text('');\n if (orientation === TOP || orientation === BOTTOM) {\n tickText.attr('y', 0)\n .attr('x', 0)\n .attr('transform', '')\n .text('');\n const tspan = makeElement(tickText, 'tspan', (d, i) => {\n if (_smartTicks[i]) {\n return _smartTicks[i].lines;\n } return [];\n }, `${classPrefix}-smart-text`);\n\n tspan.attr('dy', '0')\n .style('opacity', '0')\n\n .transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .attr('dy', (d, i) => {\n if (orientation === BOTTOM || i !== 0) {\n return _smartTicks[0].oriTextHeight;\n }\n return -_smartTicks[0].oriTextHeight * (_smartTicks[0].lines.length - 1) - tickSize;\n })\n .style('opacity', 1)\n .text(e => e)\n .attr('x', 0);\n } else {\n const tspan = makeElement(tickText, 'tspan', (d, i) => _smartTicks[i].lines, `${classPrefix}-smart-text`);\n tspan.text(e => e);\n }\n }\n\n return tickText;\n};\n\nconst setFixedBaseline = (axisInstance) => {\n const {\n fixedBaseline\n } = axisInstance.config();\n const {\n showInnerTicks\n } = axisInstance.renderConfig();\n const domain = axisInstance.domain();\n if (fixedBaseline && domain.length && showInnerTicks) {\n axisInstance.setFixedBaseline();\n }\n};\n\n/**\n *\n *\n * @param {*} textNode\n * @param {*} orientation\n * @param {*} measures\n */\nconst setAxisNamePos = (textNode, orientation, measures) => {\n const {\n axisNameHeight,\n availableSpace\n } = measures;\n\n switch (orientation) {\n case AxisOrientation.LEFT:\n textNode.attr('transform',\n `translate(${-(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(-90)`);\n break;\n case AxisOrientation.RIGHT:\n textNode.attr('transform',\n `translate(${(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(90)`);\n break;\n case AxisOrientation.TOP:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${-availableSpace.height + axisNameHeight})`);\n break;\n case AxisOrientation.BOTTOM:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${availableSpace.height - axisNameHeight / 2})`);\n break;\n default:\n }\n return textNode;\n};\n\n/**\n * This method is used to render the axis inside an\n * svg container.\n *\n * @export\n * @param {Object} axisInstance the nput object required to render axis\n * @param {string} axisInstance.orientation the orientation of axis\n * @param {Object} axisInstance.scale instance of d3 scale\n * @param {SVGElement} axisInstance.container the container in which to render\n */\nexport function renderAxis (axisInstance) {\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const mount = axisInstance.mount();\n const range = axisInstance.range();\n const axis = axisInstance.axis();\n const scale = axisInstance.scale();\n const {\n _tickLabelStyle: tickLabelStyle,\n _tickFormatter: axisTickFormatter\n } = axisInstance;\n const {\n orientation,\n axisNamePadding,\n className,\n id,\n classPrefix\n } = config;\n const {\n show,\n xOffset,\n yOffset,\n showAxisName,\n labels,\n smartAxisName\n } = renderConfig;\n\n if (!show) {\n return;\n }\n\n const tickSize = axisInstance.getTickSize();\n\n const selectContainer = makeElement(selectElement(mount), 'g', [axisInstance], `${className}`, {},\n key => key.config().id);\n\n // Set style for tick labels\n labelManager.setStyle(tickLabelStyle);\n\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n const ticks = axis.tickValues() || labelFunc();\n\n axis.tickFormat(axisTickFormatter(ticks));\n\n // Get range(length of range)\n const availableSpace = Math.abs(range[0] - range[1]);\n\n // Get width and height taken by axis labels\n const labelProps = axisInstance.axisComponentDimensions().largestTickDimensions;\n\n // Draw axis ticks\n selectContainer.attr('transform', `translate(${xOffset},${yOffset})`);\n setFixedBaseline(axisInstance);\n if (labels.smartTicks === false || tickSize === 0) {\n selectContainer.transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .call(axis);\n } else {\n selectContainer.call(axis);\n }\n selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true);\n selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true);\n\n // Set classes for ticks\n const tickText = selectContainer.selectAll('.tick text');\n tickText.classed(`${classPrefix}-ticks`, true)\n .classed(`${classPrefix}-ticks-${id}`, true);\n\n changeTickOrientation(selectContainer, axisInstance, tickSize);\n\n // Create axis name\n const textNode = makeElement(selectContainer, 'text', [smartAxisName], `${classPrefix}-axis-name`)\n .attr('text-anchor', 'middle')\n .classed(`${classPrefix}-axis-name-${id}`, true)\n .text(d => d.text);\n\n // Hide axis name if show is off\n textNode.classed(HIDDEN, !showAxisName);\n\n // render labels based on orientation of axis\n const labelOffset = availableSpace / 2;\n\n const measures = {\n labelProps,\n tickSize,\n axisNamePadding,\n axisNameHeight: smartAxisName.height,\n yOffset,\n xOffset,\n labelOffset,\n availableSpace: axisInstance.availableSpace()\n };\n // Set position for axis name\n setAxisNamePos(textNode, orientation, measures);\n}\n","import {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'muze-utils';\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\n// Longest Word for each level based on which tick skipping is decided\nconst longestWord = {\n month: 'September',\n quarter: 'October',\n halfYearly: 'July',\n year: 9999,\n day: 'September',\n hour: '24 AM',\n mintues: '60:60',\n seconds: ':60',\n week: 'Wed 31'\n};\n\n// These are the various levels of ticks that can be shown by Muze.\n// Each level is described as how frequently the ticks appear\n// The format is as follows:\n// [Frequency, Milliseconds, Name of Seconds, Tick Generator, Level Type]\nconst tickIntervals = [\n [1, 1, 'milliseconds', timeMillisecond.every(1), 'seconds'],\n [1, durationSecond, 'seconds', timeSecond.every(1), 'seconds'],\n [5, 5 * durationSecond, 'five seconds', timeSecond.every(5), 'seconds'],\n [10, 10 * durationSecond, 'ten seconds', timeSecond.every(10), 'seconds'],\n [15, 15 * durationSecond, 'fifteen seconds', timeSecond.every(15), 'seconds'],\n [30, 30 * durationSecond, 'thirty seconds', timeSecond.every(30), 'seconds'],\n [1, durationMinute, 'minute', timeMinute.every(1), 'minutes'],\n [5, 5 * durationMinute, 'five minutes', timeMinute.every(5), 'minutes'],\n [10, 10 * durationMinute, 'ten minutes', timeMinute.every(10), 'minutes'],\n [15, 15 * durationMinute, 'fifteen minutes', timeMinute.every(15), 'minutes'],\n [30, 30 * durationMinute, 'thirty minutes', timeMinute.every(30), 'minutes'],\n [1, durationHour, 'hour', timeHour.every(1), 'hour'],\n [3, 3 * durationHour, 'three hours', timeHour.every(3), 'hour'],\n [6, 6 * durationHour, 'six hours', timeHour.every(6), 'hour'],\n [12, 12 * durationHour, 'twelve hours', timeHour.every(12), 'hour'],\n [1, durationDay, 'daily', timeDay.every(1), 'day'],\n [1, durationWeek, 'weekly', timeWeek.every(1), 'week'],\n [1, durationMonth, 'monthly', timeMonth.every(1), 'week'],\n [3, 3 * durationMonth, 'quaterly', timeMonth.every(3), 'quarter'],\n [6, 6 * durationMonth, 'half yearly', timeMonth.every(6), 'halfYearly'],\n [1, durationYear, 'yearly', timeYear.every(1), 'year'],\n [2, 2 * durationYear, '2 year', timeYear.every(2), 'year'],\n [3, 3 * durationYear, '3 year', timeYear.every(3), 'year'],\n [5, 5 * durationYear, '5 year', timeYear.every(5), 'year'],\n [10, 10 * durationYear, 'decade', timeYear.every(10), 'year'],\n [100, 100 * durationYear, 'century', timeYear.every(100), 'year'],\n [1000, 1000 * durationYear, 'millenium', timeYear.every(1000), 'year']\n];\n/**\n * Get the actual tick interval based on the available width, number of ticks\n * and the distance between two ticks\n *\n * @param {Object} context Axis Context\n * @param {number} noOfTicks Number of Ticks based on which interval is calculated\n * @return {number} The width for the tick interval\n */\nconst getActualTickInterval = (context, noOfTicks) => {\n const minTickDistance = context._minTickDistance;\n const minWidthBetweenTicks = minTickDistance.width;\n\n const { width } = context.availableSpace();\n const actualTickInterval = Math.floor(((width - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks));\n\n return actualTickInterval;\n};\n\n/**\n * Get the tick interval based on the current level of ticks. Levels are decided on\n * the number of ticks that are possible to show\n *\n * @param {Object} context Axis Context\n * @param {string} type Type of level (yearly, monthly, etc)\n * @return {number} The width for the tick interval\n */\nconst getTickIntervalBasedOnCurrentLevel = (context, type) => {\n const labelManager = context._dependencies.labelManager;\n const longestWordType = longestWord[type];\n const measure = labelManager.getOriSize(longestWordType);\n\n return measure.width;\n};\n\nconst getTickIntervalFnBasedOnNumberOfTicks = (interval, count, context) => {\n let possibleTickLevelIndex = tickIntervals.length - 1;\n let maxPossibleTicks = 1;\n let tickIntervalLevelInfo = null;\n\n // Decide possible tick level based on min tick width (with ellipses)\n for (let i = tickIntervals.length - 1; i >= 0; i--) {\n const tickIntervalInfo = tickIntervals[i];\n const numOfPossibleTicks = Math.floor(interval / tickIntervalInfo[1]);\n if (numOfPossibleTicks <= count) {\n possibleTickLevelIndex = i;\n maxPossibleTicks = numOfPossibleTicks;\n }\n }\n\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex];\n\n // Get actual tick interval based on the level of ticks generated\n const actualTickInterval = getActualTickInterval(context, maxPossibleTicks);\n\n // Maximum Possible tick Interval for a particular level based on a pre decided set of values\n const maxTickInterval = getTickIntervalBasedOnCurrentLevel(context, tickIntervalLevelInfo[4]);\n\n // Display the next level involving tick skipping if current level does not meet the requirement\n // for displaying max tick\n if (actualTickInterval < maxTickInterval && possibleTickLevelIndex < tickIntervals.length - 1) {\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex + 1];\n }\n return tickIntervalLevelInfo[3];\n};\n\nexport const getSkippedTicks = (context, maxPossibleTicks) => {\n let actualNumberOfTicks = maxPossibleTicks;\n const domain = context.domain();\n const minDiff = context._minDiff;\n // Get the interval in ms from the domain\n const millisecondInterval = domain[1] - domain[0];\n // Get number of ticks based on the minimum difference in the data\n const numOfTicksAccordingToMinDiff = Math.floor(millisecondInterval / minDiff);\n\n // Show ticks according to min diff if possible\n if (maxPossibleTicks >= numOfTicksAccordingToMinDiff) {\n actualNumberOfTicks = numOfTicksAccordingToMinDiff;\n }\n\n return getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval, actualNumberOfTicks, context);\n};\n","import { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { getSkippedTicks } from './skip-ticks';\nimport { TIME, LINEAR, BAND } from '../enums/scale-type';\n\nexport const applyTickSkipping = (context) => {\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = minTickSpace.width;\n\n const { width } = context.availableSpace();\n\n const maxTicks = Math.floor((width + minWidthBetweenTicks) / (minTickWidth + minWidthBetweenTicks));\n\n const ticks = context.scale().ticks(getSkippedTicks(context, maxTicks));\n\n context.renderConfig({\n tickValues: ticks\n });\n};\n\nconst adjustHorizontalRange = (range, diff) => {\n range[0] += diff;\n range[1] -= diff;\n return range;\n};\n\nconst adjustVerticalRange = (range, diff) => {\n range[0] -= diff;\n range[1] += diff;\n return range;\n};\n\nconst rangeAdjustmentMap = {\n [TOP]: adjustHorizontalRange,\n [BOTTOM]: adjustHorizontalRange,\n [LEFT]: adjustVerticalRange,\n [RIGHT]: adjustVerticalRange\n};\n\nexport const setAxisRange = (context, type, rangeBounds, offset) => {\n context.range(rangeBounds);\n offset && context.renderConfig({ [`${type}Offset`]: offset });\n};\n\nconst getAxisOffset = (timeDiff, range, domain) => {\n const avWidth = Math.abs(range[1] - range[0]);\n const pvr = avWidth / (domain[1] - domain[0]);\n const width = (pvr * timeDiff);\n const bars = avWidth / width;\n const barWidth = avWidth / (bars + 1);\n const diff = avWidth - barWidth * bars;\n\n return diff / 2;\n};\n\nexport const getAdjustedRange = (minDiff, range, domain, config) => {\n const {\n orientation,\n adjustRange\n } = config;\n const diff = getAxisOffset(minDiff, range, domain);\n\n if (adjustRange) {\n return rangeAdjustmentMap[orientation](range, diff);\n }\n return range;\n};\n\nexport const spaceSetter = (context, spaceConfig) => {\n let tickInterval;\n let heightForTicks;\n const config = context.config();\n const {\n width: availWidth,\n height: availHeight,\n padding\n } = context.availableSpace();\n const {\n top,\n left,\n bottom,\n right\n } = padding;\n const {\n isOffset\n } = spaceConfig;\n const {\n showAxisName,\n labels\n } = context.renderConfig();\n const {\n rotation\n } = labels;\n const {\n fixedBaseline,\n axisNamePadding,\n tickValues\n } = config;\n const {\n tickDimensions,\n allTickDimensions,\n axisNameDimensions,\n tickSize\n } = context.getAxisDimensions();\n const {\n height: tickDimHeight,\n width: tickDimWidth\n } = tickDimensions;\n\n const namePadding = showAxisName ? axisNamePadding : 0;\n const labelConfig = { smartTicks: true, rotation: labels.rotation };\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minDiff = context._minDiff;\n const domain = context.domain();\n const axisNameHeight = axisNameDimensions.height;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = Math.min(minTickSpace.width, tickDimWidth);\n const minTickHeight = Math.min(minTickSpace.height, tickDimHeight);\n\n return {\n [TIME]: {\n x: () => {\n !tickValues && context.applyTickSkipping();\n const noOfTicks = context.getTickValues().length;\n\n // Get the Tick Interval\n tickInterval = ((availWidth - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks);\n\n // Get height for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation;\n // Remove ticks if not enough height\n if (tickInterval < minTickHeight) {\n heightForTicks = availHeight;\n tickInterval = minTickHeight;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n const tickShifter = Math.min(tickInterval, tickDimWidth);\n // set range for axis\n setAxisRange(context, 'y', getAdjustedRange(minDiff, [tickShifter / 2,\n availWidth - left - right - tickShifter / 2], domain, config),\n isOffset ? availHeight : null);\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n\n return labelConfig;\n },\n y: () => {\n let widthForTicks = availWidth;\n const tickShifter = tickDimHeight / 2;\n\n setAxisRange(context, 'x', getAdjustedRange(minDiff,\n [availHeight - top - bottom - tickShifter, tickShifter], domain, config),\n isOffset ? availWidth : null);\n\n if ((availWidth - axisNameHeight - namePadding) <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [BAND]: {\n x: () => {\n setAxisRange(context, 'y', [0, availWidth - left - right], isOffset ? availHeight : null);\n const range = context.range();\n\n // Get Tick Interval\n tickInterval = ((range[1] - range[0]) / (tickValues || domain).length) - minWidthBetweenTicks;\n\n // Get height available for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation === null ? -90 : rotation;\n labelConfig.smartTicks = false;\n\n tickInterval = Math.max(heightForTicks, minTickWidth);\n\n if (heightForTicks < minTickWidth) {\n context.renderConfig({ showAxisName: false });\n }\n } else if (tickValues) {\n const interval = (availWidth / domain.length) - minWidthBetweenTicks;\n if (interval < minTickWidth) {\n context.range([minTickHeight / 2, availWidth - minTickHeight / 2]);\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n return labelConfig;\n },\n y: () => {\n setAxisRange(context, 'x', [availHeight - bottom, top], isOffset ? availWidth : null);\n\n let widthForTicks = availWidth - axisNameHeight - tickSize - namePadding;\n if (widthForTicks <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [LINEAR]: {\n x: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimWidth / 2;\n\n const baseline = fixedBaseline ? 0 : tickShifter;\n\n setAxisRange(context, 'y', [baseline + left, availWidth - right - tickShifter],\n isOffset ? availHeight : null);\n\n const range = context.range();\n\n // Get Tick widths and available space\n const totalTickWidth = allTickDimensions.length * (tickDimWidth + minWidthBetweenTicks);\n const availableWidth = range[1] - range[0];\n\n // Rotate labels if not enough width\n if (availableWidth < totalTickWidth && labels.rotation !== null) {\n if (availHeight - tickDimWidth - namePadding - tickSize > axisNameHeight) {\n labelConfig.rotation = null;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: true\n });\n } else {\n labelConfig.rotation = -90;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: false\n\n });\n }\n }\n\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n },\n y: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimensions.height / 2;\n const baseline = fixedBaseline ? 1 : tickShifter;\n\n setAxisRange(context, 'x', [availHeight - bottom - baseline, tickShifter + top],\n isOffset ? availWidth : null);\n\n // Remove display of ticks if no space is left\n if (availWidth < tickDimWidth + axisNameHeight + namePadding) {\n context.renderConfig({ showInnerTicks: false });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n }\n return labelConfig;\n }\n }\n };\n};\n","import { defaultValue } from 'muze-utils';\nimport { TOP, LEFT, BOTTOM } from '../enums/axis-orientation';\nimport { MIN_NO_OF_TICKS, DEFAULT_NO_OF_TICKS } from '../enums/constants';\nimport { setAxisRange, getAdjustedRange } from './space-setter';\n\nexport const getRotatedSpaces = (rotation = 0, width, height) => {\n let rotatedHeight = height;\n let rotatedWidth = width;\n if (rotation) {\n const angle = ((rotation || 0) * Math.PI) / 180;\n rotatedWidth = Math.abs(height * Math.sin(angle)) + Math.abs(width * Math.cos(angle));\n rotatedHeight = Math.abs(width * Math.sin(angle)) + Math.abs(height * Math.cos(angle));\n }\n return { width: rotatedWidth, height: rotatedHeight };\n};\n\nexport const setOffset = (context) => {\n let x = 0;\n let y = 0;\n const logicalSpace = context.logicalSpace();\n const config = context.config();\n const {\n orientation,\n xOffset,\n yOffset\n } = config;\n if (orientation === LEFT) {\n x = xOffset === undefined ? logicalSpace.width : xOffset;\n }\n if (orientation === TOP) {\n y = yOffset === undefined ? logicalSpace.height : yOffset;\n }\n context.renderConfig({ xOffset: x, yOffset: y });\n};\n\nexport const getNumberOfTicks = (availableSpace, labelDim, axis, axisInstance) => {\n let numberOfValues = 0;\n let tickValues = [];\n let { numberOfTicks } = axisInstance.config();\n const ticks = axis.scale().ticks();\n const tickLength = ticks.length;\n const minTickDistance = axisInstance._minTickDistance.width;\n\n numberOfValues = tickLength;\n\n if (tickLength * (labelDim + minTickDistance) > availableSpace) {\n numberOfValues = Math.floor(availableSpace / (labelDim + minTickDistance));\n }\n\n numberOfTicks = numberOfTicks || numberOfValues;\n numberOfValues = Math.min(numberOfTicks, Math.max(MIN_NO_OF_TICKS, numberOfValues));\n\n tickValues = axis.scale().ticks(numberOfValues);\n\n if (tickValues.length > numberOfValues) {\n tickValues = tickValues.filter((e, i) => i % 2 === 0);\n }\n\n if (numberOfValues === MIN_NO_OF_TICKS) {\n tickValues = axis.scale().ticks(DEFAULT_NO_OF_TICKS);\n tickValues = [tickValues[0], tickValues[tickValues.length - 1]];\n }\n return tickValues;\n};\n\nexport const getAxisComponentDimensions = (context) => {\n let largestTick = '';\n let largestTickDimensions = { width: 0, height: 0 };\n let smartTick = {};\n let axisTicks;\n const allTickDimensions = [];\n const scale = context.scale();\n const { tickValues, showAxisName } = context.renderConfig();\n const { name } = context.config();\n const { labelManager } = context.dependencies();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(context._tickLabelStyle);\n\n // get the values along the domain\n axisTicks = tickValues || labelFunc();\n\n // Get the tick labels\n axisTicks = axisTicks.map((originalLabel, i) => {\n const label = context.getFormattedText(originalLabel, i, axisTicks);\n\n // convert to string for quant values\n const tickDimensions = labelManager.getOriSize(label);\n\n // Get spaces for all labels\n allTickDimensions.push(tickDimensions);\n\n // Getting largest label\n if (tickDimensions.width > largestTickDimensions.width) {\n largestTick = label;\n smartTick = context.smartTicks() ? context.smartTicks()[i] : {};\n\n largestTickDimensions = tickDimensions;\n smartTick = smartTick || tickDimensions;\n }\n return label;\n });\n\n labelManager.setStyle(context._axisNameStyle);\n const axisNameDimensions = showAxisName ? labelManager.getOriSize(name) : { width: 0, height: 0 };\n\n return {\n axisNameDimensions,\n largestTick,\n largestTickDimensions,\n allTickDimensions,\n axisTicks,\n smartTick,\n tickSize: context.getTickSize()\n };\n};\n\nexport const computeAxisDimensions = (context) => {\n let tickDimensions = {};\n const { labels } = context.renderConfig();\n const { smartTicks, rotation } = labels;\n const {\n largestTickDimensions,\n axisTicks,\n smartTick,\n axisNameDimensions,\n allTickDimensions,\n tickSize\n } = getAxisComponentDimensions(context);\n const { height: labelHeight, width: labelWidth } = largestTickDimensions;\n\n // get the domain of axis\n const domain = context.domain();\n // const angle = ((rotation || 0) * Math.PI) / 180;\n\n if (domain.length === 0) {\n return null;\n }\n\n if (smartTicks) {\n tickDimensions = smartTick;\n } else {\n tickDimensions = { width: labelWidth, height: labelHeight };\n }\n tickDimensions = getRotatedSpaces(rotation, tickDimensions.width, tickDimensions.height);\n\n if (tickSize === 0) {\n tickDimensions = { width: 0, height: 0 };\n }\n return {\n allTickDimensions,\n tickSize,\n tickDimensions,\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getHorizontalAxisSpace = (context, axisDimensions, range) => {\n let width;\n let height;\n const domain = context.domain();\n const minTickDistance = context._minTickDistance.width;\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n width = range && range.length ? range[1] - range[0] : ((tickDimWidth + minTickDistance) * 3);\n\n height = 0;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n width = ((max - min) / Math.abs(minTickDiff)) * (tickDimWidth + context._minTickDistance.width);\n }\n if (!range || !range.length) {\n height = Math.max(tickDimWidth, tickDimHeight);\n } else {\n height = tickDimHeight;\n }\n\n height += (showAxisName ? axisDimHeight + axisNamePadding : 0) + tickSize;\n\n return {\n width,\n height\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getVerticalAxisSpace = (context, axisDimensions) => {\n let height;\n let width;\n const domain = context.domain();\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n height = 0;\n width = tickDimWidth;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n height = ((max - min) / Math.abs(minTickDiff)) * tickDimHeight;\n }\n width += (showAxisName ? axisDimHeight : 0) + tickSize + axisNamePadding;\n\n return {\n height,\n width\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateBandSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n\n const { orientation } = context.config();\n const { show } = context.renderConfig();\n const { largestTickDimensions, axisTicks, allTickDimensions } = axisDimensions;\n const { height: largestDimHeight } = largestTickDimensions;\n const minTickWidth = context._minTickDistance.width;\n if (orientation === TOP || orientation === BOTTOM) {\n let {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n\n if (!range || !range.length) {\n width = allTickDimensions.reduce((t, n) =>\n t + Math.min(n.width, n.height) + minTickWidth, 0);\n }\n\n if (show === false) {\n height = 0;\n width = 0;\n }\n return {\n width,\n height\n };\n }\n\n let {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n if (!height || height === 0) {\n height = axisTicks.length * (largestDimHeight + context._minTickDistance.height);\n }\n if (show === false) {\n width = 0;\n }\n return {\n width,\n height\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateContinousSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n const { orientation } = context.config();\n const { show, showAxisName } = context.renderConfig();\n const { axisNameDimensions } = axisDimensions;\n\n if (show === false) {\n return {\n width: 0,\n height: 0\n };\n }\n\n const { width: axisNameWidth } = axisNameDimensions;\n\n if (orientation === TOP || orientation === BOTTOM) {\n const {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n const axisWidth = Math.max(width, axisNameWidth);\n\n return {\n width: axisWidth,\n height\n };\n }\n const {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n const effHeight = Math.max(height, showAxisName ? axisNameWidth : 0);\n\n return {\n width,\n height: effHeight\n };\n};\n\n/**\n * Overwrites domain with user defined domain (if present)\n * @param {Object} context reference to current axes\n * @param {Array} domain default domain\n *\n * @return {Array} domain\n */\nexport const getValidDomain = (context, domain) => {\n const { domain: userDom } = context.config();\n\n if (userDom) {\n domain = userDom;\n }\n\n return defaultValue(domain, []);\n};\n\nexport const setContinousAxisDomain = (context, domain) => {\n const { nice } = context.config();\n const scale = context.scale.bind(context);\n\n scale().domain(domain);\n nice && scale().nice();\n context._domain = scale().domain();\n};\n\n/**\n * Checks if any of the properties have changed between two objects\n * @param {Object} obj first object\n * @param {Object} obj1 second object\n * @param {Array} properties properties to be compared between two objects\n *\n * @return {Boolean} boolean value\n */\nexport const hasAxesConfigChanged = (obj = {}, obj1 = {}, properties) => {\n if (!Object.keys(obj).length || !Object.keys(obj1).length) {\n return false;\n }\n return properties.some(key => obj[key] !== obj1[key]);\n};\n\nexport const resetTickInterval = (context, domain) => {\n const {\n orientation,\n isOffset\n } = context.config();\n\n const minDiff = context._minDiff;\n // Set available space on interaction\n if (context.range().length && (orientation === TOP || orientation === BOTTOM)) {\n context.applyTickSkipping();\n const {\n largestTickDimensions\n } = context.getAxisDimensions();\n\n const noOfTicks = context.getTickValues().length;\n\n const { width, height, padding } = context.availableSpace();\n const {\n left,\n right\n } = padding;\n // Get the Tick Interval\n const tickInterval = Math.min(largestTickDimensions.width,\n ((width - (noOfTicks - 1) * (context._minTickDistance.width)) / noOfTicks));\n\n context.maxTickSpaces({\n width: tickInterval\n });\n\n const adjustedRange = getAdjustedRange(minDiff, [tickInterval / 2,\n width - left - right - tickInterval / 2], domain, context.config());\n\n // set range for axis\n setAxisRange(context, 'y', adjustedRange, isOffset ? height : null);\n\n context.setTickConfig();\n }\n};\n\nexport const getSmartAxisName = (name, width, labelManager) => {\n const oriSize = labelManager.getOriSize(name);\n\n labelManager.useEllipsesOnOverflow(true);\n\n return labelManager.getSmartText(name, width, oriSize.height, true);\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { hasAxesConfigChanged } from './helper';\n\nexport const PROPS = {\n availableSpace: {},\n axisDimensions: {},\n axisComponentDimensions: {},\n config: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._config || {});\n const mockedOldConfig = mergeRecursive({}, oldConfig);\n value = mergeRecursive(mockedOldConfig, value);\n\n value.axisNamePadding = Math.max(value.axisNamePadding, 0);\n const shouldAxesScaleUpdate = hasAxesConfigChanged(\n value, oldConfig, ['interpolator', 'exponent', 'base', 'orientation']\n );\n const tickFormatter = context.sanitizeTickFormatter(value);\n\n if (shouldAxesScaleUpdate) {\n context._scale = context.createScale(value);\n context._axis = context.createAxis(value);\n }\n\n context._tickFormatter = ticks => tickFormatter(ticks);\n\n context.resetRenderConfig(value);\n return value;\n }\n },\n renderConfig: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._renderConfig || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n logicalSpace: {},\n mount: {\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.logicalSpace(null);\n return value;\n }\n },\n\n smartTicks: {},\n tickSize: {},\n maxTickSpaces: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._maxTickSpaces || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n valueParser: {\n defaultValue: val => val\n }\n};\n","import {\n mergeRecursive,\n getSmartComputedStyle,\n selectElement,\n generateGetterSetters,\n getUniqueId\n} from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { axisOrientationMap, BOTTOM, TOP } from '../enums/axis-orientation';\nimport { defaultConfig } from './default-config';\nimport { renderAxis } from '../axis-renderer';\nimport { spaceSetter } from './space-setter';\nimport {\n getAxisComponentDimensions,\n computeAxisDimensions,\n calculateContinousSpace,\n setOffset,\n getValidDomain,\n getSmartAxisName\n} from './helper';\nimport { PROPS } from './props';\n\nexport default class SimpleAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @memberof SimpleAxis\n */\n constructor (config, dependencies) {\n this._id = getUniqueId();\n\n this._dependencies = dependencies;\n this._mount = null;\n this._range = [];\n this._domain = [];\n this._domainLock = false;\n this._axisDimensions = {};\n this._smartTicks = [];\n\n const defCon = mergeRecursive({}, this.constructor.defaultConfig());\n const simpleConfig = mergeRecursive(defCon, config);\n\n const bodyElem = selectElement('body');\n const classPrefix = simpleConfig.classPrefix;\n this._tickLabelStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-ticks`);\n this._axisNameStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-axis-name`);\n\n dependencies.labelManager.setStyle(this._tickLabelStyle);\n const dist = dependencies.labelManager.getOriSize('w');\n\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n this._minTickSpace = dependencies.labelManager.getOriSize('www...');\n\n generateGetterSetters(this, PROPS);\n this.config(simpleConfig);\n\n this._scale = this.createScale(this._config);\n this._axis = this.createAxis(this._config);\n this._animationDonePromises = [];\n }\n\n /**\n * Returns the default configuration of simple axis\n * @return {Object} default configurations\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline () {\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n scale (...params) {\n if (params.length) {\n this._scale = params[0];\n return this;\n }\n return this._scale;\n }\n\n resetDomain () {\n this._domain = [];\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n axis (...params) {\n if (params.length) {\n this._axis = params[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n this.scale().domain(domainValue);\n this._domain = this.scale().domain();\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n setAxisComponentDimensions () {\n this.axisComponentDimensions(getAxisComponentDimensions(this));\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const scale = createScale({\n padding,\n interpolator,\n exponent,\n base,\n range,\n type: this.constructor.type()\n });\n\n return scale;\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat, numberFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(numberFormat(val), val, i, ticks);\n }\n\n return () => val => numberFormat(val);\n }\n\n resetRenderConfig (config) {\n const {\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n } = config;\n this.renderConfig({\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n });\n return this;\n }\n\n resetLogicalSpace () {\n this.logicalSpace(null);\n this.range([]);\n\n this.resetRenderConfig(this.config());\n }\n\n getFormattedText (text, index, axisTicks) {\n const formatter = this._tickFormatter;\n\n return formatter(axisTicks)(text, index);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createAxis (config) {\n const { orientation } = config;\n const axisClass = axisOrientationMap[orientation];\n\n if (axisClass) {\n const axis = axisClass(this.scale());\n return axis;\n }\n return null;\n }\n\n setTickValues (tickValues) {\n const renderConfig = this.renderConfig();\n this.config({ ...renderConfig, tickValues });\n this.tickValues = tickValues;\n this.axis().tickValues(tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (width = 0, height, padding, isOffset) {\n let labelConfig = {};\n const {\n orientation\n } = this.config();\n\n this.availableSpace({ width, height, padding });\n const type = this.constructor.type();\n\n if (orientation === TOP || orientation === BOTTOM) {\n labelConfig = spaceSetter(this, { isOffset })[type].x();\n } else {\n labelConfig = spaceSetter(this, { isOffset })[type].y();\n }\n\n // Set config\n this.renderConfig({\n labels: labelConfig\n });\n this.setTickConfig();\n this.setSmartAxisName();\n return this;\n }\n\n setSmartAxisName () {\n const { orientation, name } = this.config();\n const dimType = (orientation === TOP || orientation === BOTTOM) ? 'width' : 'height';\n const widthDim = this.availableSpace()[dimType];\n const labelManager = this.dependencies().labelManager;\n labelManager.setStyle(this._axisNameStyle);\n this.renderConfig({\n smartAxisName: getSmartAxisName(name, widthDim, labelManager)\n });\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n return this;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this.scale()(domainVal);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n return this.axis().tickSize();\n }\n\n /**\n * Gets the space occupied by the parts of an axis\n *\n * @return {Object} object with details about sizes of the axis.\n * @memberof SimpleAxis\n */\n getAxisDimensions (...params) {\n this.axisDimensions(computeAxisDimensions(this, ...params));\n return this.axisDimensions();\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateContinousSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n * Returns the value from the domain when given a value from the range.\n * @param {number} value Value from the range.\n * @return {number} Value\n */\n invert (value) {\n return this.scale().invert(value);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n *\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n return [v1, v2];\n }\n\n invertExtent (v1, v2) {\n return [this.invert(v1), this.invert(v2)];\n }\n\n getMinTickDifference () {\n return this.domain();\n }\n\n getFormattedTickValues (tickValues) {\n return tickValues;\n }\n\n /**\n * This method returns the width in pixels for one\n * unit along the axis. It is only applicable to band scale\n * and returns undefined for other scale type.\n *\n * @return {number} the width of one band along band scale axis\n * @memberof SimpleAxis\n */\n getUnitWidth () {\n return 0;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof SimpleAxis\n */\n serialize () {\n return {\n name: this.name,\n type: this.type,\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to render the axis inside\n * the supplied svg container.\n *\n * @param {SVGElement} svg the svg element in which to render the path\n * @memberof SimpleAxis\n */\n /* istanbul ignore next */render () {\n if (this.mount()) {\n this.setTickConfig();\n renderAxis(this);\n }\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n remove () {\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n unsubscribe () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n isReverse () {\n const range = this.range();\n return range[0] > range[1];\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getPixelToValueRatio () {\n const scale = this.scale();\n const range = scale.range();\n const domain = scale.domain();\n\n return Math.abs(range[1] - range[0]) / (domain[1] - domain[0]);\n }\n\n /**\n * Notifies when all animations/transitions of the axis are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n}\n\n","import { sanitizeDomainWhenEqual } from 'muze-utils';\nimport { scaleMap } from '../../scale-creator';\n\nexport default class LinearInterpolator {\n\n createScale (config) {\n const {\n range\n } = config;\n const scaleFactory = scaleMap.linear;\n this._scale = scaleFactory().range(range);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain.length) {\n domain = sanitizeDomainWhenEqual(domain);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class LogInterpolator {\n\n createScale (config) {\n const {\n range,\n base\n } = config;\n const scaleFactory = scaleMap.log;\n this._scale = scaleFactory().range(range).base(base);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n const scale = this._scale;\n if (domainVal <= 0) {\n return scale(scale.domain()[0]);\n }\n\n return scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain[0] <= 0) {\n domain[0] = Math.max(1, domain[0]);\n }\n if (domain[1] <= 0) {\n domain[1] = Math.max(1, domain[1]);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class PowInterpolator {\n\n createScale (config) {\n const {\n range,\n exponent\n } = config;\n const scaleFactory = scaleMap.pow;\n this._scale = scaleFactory().range(range).exponent(exponent);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n return domain;\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { LINEAR, LOG, POW } from '../enums/scale-type';\nimport { LogInterpolator, PowInterpolator, LinearInterpolator } from './interpolators';\nimport {\n getNumberOfTicks,\n getValidDomain,\n setContinousAxisDomain\n} from './helper';\n\nexport const interpolatorMap = {\n [LOG]: LogInterpolator,\n [POW]: PowInterpolator,\n [LINEAR]: LinearInterpolator\n};\n\nexport default class ContinousAxis extends SimpleAxis {\n constructor (config, dependencies) {\n config.tickFormat = config.tickFormat || (val => val);\n super(config, dependencies);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const InterpolatorCls = interpolatorMap[interpolator];\n\n this._interpolator = new InterpolatorCls();\n let scale = this._interpolator.createScale({\n padding,\n exponent,\n base,\n range\n });\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ContinousAxis\n */\n static type () {\n return LINEAR;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this._interpolator.getScaleValue(domainVal);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n\n return axis.tickSize();\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainVal = this._interpolator.sanitizeDomain(getValidDomain(this, domain[0]));\n setContinousAxisDomain(this, domainVal);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @param {*} tickValues\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n const {\n tickValues,\n showInnerTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n if (!showInnerTicks) {\n axis.tickValues([]);\n return this;\n }\n\n if (tickValues) {\n tickValues instanceof Array && this.axis().tickValues(tickValues);\n }\n const newTickValues = this.getTickValues();\n\n axis.tickValues(newTickValues);\n const smartLabel = this.dependencies().labelManager;\n smartLabel.setStyle(this._tickLabelStyle);\n const formatter = this._tickFormatter(newTickValues);\n const smartTicks = newTickValues.map((val, i) => {\n const text = formatter(val, i);\n const tickSpace = smartLabel.getOriSize(text);\n\n tickSpace.text = text;\n return tickSpace;\n });\n\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickValues () {\n let labelDim = 0;\n const {\n orientation\n\n } = this.config();\n const {\n tickValues\n } = this.renderConfig();\n const range = this.range();\n const axis = this.axis();\n\n const availableSpace = Math.abs(range[0] - range[1]);\n\n const labelProps = this.axisComponentDimensions().largestTickDimensions;\n\n if (tickValues) {\n return tickValues;\n }\n labelDim = labelProps[orientation === BOTTOM || orientation === TOP ? 'width' : 'height'];\n\n return getNumberOfTicks(availableSpace, labelDim, axis, this);\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.renderConfig().tickValues);\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline (tickText) {\n const {\n orientation\n } = this.config();\n const {\n labels\n } = this.renderConfig();\n\n const {\n rotation\n } = labels;\n const axis = this.axis();\n const ticks = axis.tickValues();\n const smartTicks = this.smartTicks();\n\n if (smartTicks && smartTicks.length) {\n const { width, height } = this.smartTicks()[0];\n\n axis.tickTransform((d) => {\n if (d === ticks[0]) {\n if ((orientation === LEFT || orientation === RIGHT)) {\n return `translate(0, -${(height) / 3}px)`;\n }\n\n if ((orientation === TOP || orientation === BOTTOM) && !rotation) {\n return `translate(${width / 2}px, ${0}px)`;\n }\n } return '';\n });\n }\n return tickText;\n }\n\n}\n","import SimpleAxis from './simple-axis';\nimport { BAND } from '../enums/scale-type';\nimport { calculateBandSpace, setOffset, getRotatedSpaces } from './helper';\n\nexport default class BandAxis extends SimpleAxis {\n /**\n *\n *\n * @static\n *\n * @memberof BandAxis\n */\n static type () {\n return BAND;\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks = '';\n let smartlabel;\n const domain = this.domain();\n const { labelManager } = this._dependencies;\n const { padding } = this.config();\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n tickValues && this.axis().tickValues(tickValues);\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n // Update padding between plots\n if (typeof padding === 'number') {\n const paddingNormalized = Math.min(1, Math.max(0, padding));\n this.scale().padding(paddingNormalized);\n }\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n *\n *\n * @memberof BandAxis\n */\n getTickValues () {\n return this.axis().scale().domain();\n }\n\n formatTickValue (val) {\n return this.valueParser()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(this.formatTickValue(val), val, i, ticks);\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n getUnitWidth () {\n return this.scale().bandwidth();\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n axis.tickSizeInner(showInnerTicks ? 6 : 0);\n axis.tickSizeOuter(showOuterTicks ? 6 : 0);\n return axis.tickSize();\n }\n\n invertExtent (v1, v2) {\n return this.scale().invertExtent(v1, v2);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n const scale = this.scale();\n const range = scale.range();\n const reverse = range[0] > range[1];\n\n const extent = this.invertExtent(v1, v2);\n const p1 = scale(reverse ? extent[extent.length - 1] : extent[0]);\n const p2 = scale(reverse ? extent[0] : extent[extent.length - 1]) + scale.bandwidth();\n return [p1, p2];\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { TIME } from '../enums/scale-type';\nimport { calculateBandSpace, getRotatedSpaces, getValidDomain, setContinousAxisDomain, setOffset,\n resetTickInterval } from './helper';\nimport { applyTickSkipping } from './space-setter';\n\n/**\n *\n *\n * @export\n * @class TimeAxis\n * @extends {SimpleAxis}\n */\nexport default class TimeAxis extends SimpleAxis {\n\n constructor (...params) {\n super(...params);\n this._minDiff = Infinity;\n }\n\n /**\n *\n *\n * @param {*} range\n *\n * @memberof TimeAxis\n */\n createScale (range) {\n let scale = super.createScale(range);\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TimeAxis\n */\n static type () {\n return TIME;\n }\n\n formatTickValue (val) {\n return this.scale().tickFormat()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return (ticks) => {\n const rawTicks = ticks.map(t => t.getTime());\n return (val, i) => tickFormat(this.formatTickValue(val), val.getTime(), i, rawTicks);\n };\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n return super.getTickSize();\n }\n\n /**\n *\n *\n *\n * @memberof TimeAxis\n */\n getTickValues () {\n return this.renderConfig().tickValues || this.scale().ticks();\n }\n\n /**\n *\n *\n * @param {*} diff\n *\n * @memberof TimeAxis\n */\n minDiff (diff) {\n this._minDiff = Math.min(this._minDiff, diff);\n return this;\n }\n\n applyTickSkipping () {\n applyTickSkipping(this);\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n setContinousAxisDomain(this, domainValue);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n\n resetTickInterval(this, domainValue);\n return this;\n }\n return this._domain;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.config().tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @returns\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks;\n let smartlabel;\n\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { labelManager } = this._dependencies;\n const domain = this.getTickValues();\n\n tickValues && this.axis().tickValues(tickValues);\n\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n\n this.smartTicks(smartTicks);\n return this;\n }\n}\n","export const x11Colors = {\n Pink: { hex: 'ffc0cb', rgb: '255,192,203' },\n LightPink: { hex: 'ffb6c1', rgb: '255,182,193' },\n HotPink: { hex: 'ff69b4', rgb: '255,105,180' },\n DeepPink: { hex: 'ff1493', rgb: '255,20,147' },\n PaleVioletRed: { hex: 'db7093', rgb: '219,112,147' },\n MediumVioletRed: { hex: 'c71585', rgb: '199,21,133' },\n LightSalmon: { hex: 'ffa07a', rgb: '255,160,122' },\n Salmon: { hex: 'fa8072', rgb: '250,128,114' },\n DarkSalmon: { hex: 'e9967a', rgb: '233,150,122' },\n LightCoral: { hex: 'f08080', rgb: '240,128,128' },\n IndianRed: { hex: 'cd5c5c', rgb: '205,92,92' },\n Crimson: { hex: 'dc143c', rgb: '220,20,60' },\n FireBrick: { hex: 'b22222', rgb: '178,34,34' },\n DarkRed: { hex: '8b0000', rgb: '139,0,0' },\n Red: { hex: 'ff0000', rgb: '255,0,0' },\n OrangeRed: { hex: 'ff4500', rgb: '255,69,0' },\n Tomato: { hex: 'ff6347', rgb: '255,99,71' },\n Coral: { hex: 'ff7f50', rgb: '255,127,80' },\n DarkOrange: { hex: 'ff8c00', rgb: '255,140,0' },\n Orange: { hex: 'ffa500', rgb: '255,165,0' },\n Gold: { hex: 'ffd700', rgb: '255,215,0' },\n Yellow: { hex: 'ffff00', rgb: '255,255,0' },\n LightYellow: { hex: 'ffffe0', rgb: '255,255,224' },\n LemonChiffon: { hex: 'fffacd', rgb: '255,250,205' },\n LightGoldenrodYellow: { hex: 'fafad2', rgb: '250,250,210' },\n PapayaWhip: { hex: 'ffefd5', rgb: '255,239,213' },\n Moccasin: { hex: 'ffe4b5', rgb: '255,228,181' },\n PeachPuff: { hex: 'ffdab9', rgb: '255,218,185' },\n PaleGoldenrod: { hex: 'eee8aa', rgb: '238,232,170' },\n Khaki: { hex: 'f0e68c', rgb: '240,230,140' },\n DarkKhaki: { hex: 'bdb76b', rgb: '189,183,107' },\n Cornsilk: { hex: 'fff8dc', rgb: '255,248,220' },\n BlanchedAlmond: { hex: 'ffebcd', rgb: '255,235,205' },\n Bisque: { hex: 'ffe4c4', rgb: '255,228,196' },\n NavajoWhite: { hex: 'ffdead', rgb: '255,222,173' },\n Wheat: { hex: 'f5deb3', rgb: '245,222,179' },\n BurlyWood: { hex: 'deb887', rgb: '222,184,135' },\n Tan: { hex: 'd2b48c', rgb: '210,180,140' },\n RosyBrown: { hex: 'bc8f8f', rgb: '188,143,143' },\n SandyBrown: { hex: 'f4a460', rgb: '244,164,96' },\n Goldenrod: { hex: 'daa520', rgb: '218,165,32' },\n DarkGoldenrod: { hex: 'b8860b', rgb: '184,134,11' },\n Peru: { hex: 'cd853f', rgb: '205,133,63' },\n Chocolate: { hex: 'd2691e', rgb: '210,105,30' },\n SaddleBrown: { hex: '8b4513', rgb: '139,69,19' },\n Sienna: { hex: 'a0522d', rgb: '160,82,45' },\n Brown: { hex: 'a52a2a', rgb: '165,42,42' },\n Maroon: { hex: '800000', rgb: '128,0,0' },\n DarkOliveGreen: { hex: '556b2f', rgb: '85,107,47' },\n Olive: { hex: '808000', rgb: '128,128,0' },\n OliveDrab: { hex: '6b8e23', rgb: '107,142,35' },\n YellowGreen: { hex: '9acd32', rgb: '154,205,50' },\n LimeGreen: { hex: '32cd32', rgb: '50,205,50' },\n Lime: { hex: '00ff00', rgb: '0,255,0' },\n LawnGreen: { hex: '7cfc00', rgb: '124,252,0' },\n Chartreuse: { hex: '7fff00', rgb: '127,255,0' },\n GreenYellow: { hex: 'adff2f', rgb: '173,255,47' },\n SpringGreen: { hex: '00ff7f', rgb: '0,255,127' },\n MediumSpringGreen: { hex: '00fa9a', rgb: '0,250,154' },\n LightGreen: { hex: '90ee90', rgb: '144,238,144' },\n PaleGreen: { hex: '98fb98', rgb: '152,251,152' },\n DarkSeaGreen: { hex: '8fbc8f', rgb: '143,188,143' },\n MediumSeaGreen: { hex: '3cb371', rgb: '60,179,113' },\n SeaGreen: { hex: '2e8b57', rgb: '46,139,87' },\n ForestGreen: { hex: '228b22', rgb: '34,139,34' },\n Green: { hex: '008000', rgb: '0,128,0' },\n DarkGreen: { hex: '006400', rgb: '0,100,0' },\n MediumAquamarine: { hex: '66cdaa', rgb: '102,205,170' },\n Aqua: { hex: '00ffff', rgb: '0,255,255' },\n Cyan: { hex: '00ffff', rgb: '0,255,255' },\n LightCyan: { hex: 'e0ffff', rgb: '224,255,255' },\n PaleTurquoise: { hex: 'afeeee', rgb: '175,238,238' },\n Aquamarine: { hex: '7fffd4', rgb: '127,255,212' },\n Turquoise: { hex: '40e0d0', rgb: '64,224,208' },\n MediumTurquoise: { hex: '48d1cc', rgb: '72,209,204' },\n DarkTurquoise: { hex: '00ced1', rgb: '0,206,209' },\n LightSeaGreen: { hex: '20b2aa', rgb: '32,178,170' },\n CadetBlue: { hex: '5f9ea0', rgb: '95,158,160' },\n DarkCyan: { hex: '008b8b', rgb: '0,139,139' },\n Teal: { hex: '008080', rgb: '0,128,128' },\n LightSteelBlue: { hex: 'b0c4de', rgb: '176,196,222' },\n PowderBlue: { hex: 'b0e0e6', rgb: '176,224,230' },\n LightBlue: { hex: 'add8e6', rgb: '173,216,230' },\n SkyBlue: { hex: '87ceeb', rgb: '135,206,235' },\n LightSkyBlue: { hex: '87cefa', rgb: '135,206,250' },\n DeepSkyBlue: { hex: '00bfff', rgb: '0,191,255' },\n DodgerBlue: { hex: '1e90ff', rgb: '30,144,255' },\n CornflowerBlue: { hex: '6495ed', rgb: '100,149,237' },\n SteelBlue: { hex: '4682b4', rgb: '70,130,180' },\n RoyalBlue: { hex: '4169e1', rgb: '65,105,225' },\n Blue: { hex: '0000ff', rgb: '0,0,255' },\n MediumBlue: { hex: '0000cd', rgb: '0,0,205' },\n DarkBlue: { hex: '00008b', rgb: '0,0,139' },\n Navy: { hex: '000080', rgb: '0,0,128' },\n MidnightBlue: { hex: '191970', rgb: '25,25,112' },\n Lavender: { hex: 'e6e6fa', rgb: '230,230,250' },\n Thistle: { hex: 'd8bfd8', rgb: '216,191,216' },\n Plum: { hex: 'dda0dd', rgb: '221,160,221' },\n Violet: { hex: 'ee82ee', rgb: '238,130,238' },\n Orchid: { hex: 'da70d6', rgb: '218,112,214' },\n Fuchsia: { hex: 'ff00ff', rgb: '255,0,255' },\n Magenta: { hex: 'ff00ff', rgb: '255,0,255' },\n MediumOrchid: { hex: 'ba55d3', rgb: '186,85,211' },\n MediumPurple: { hex: '9370db', rgb: '147,112,219' },\n BlueViolet: { hex: '8a2be2', rgb: '138,43,226' },\n DarkViolet: { hex: '9400d3', rgb: '148,0,211' },\n DarkOrchid: { hex: '9932cc', rgb: '153,50,204' },\n DarkMagenta: { hex: '8b008b', rgb: '139,0,139' },\n Purple: { hex: '800080', rgb: '128,0,128' },\n Indigo: { hex: '4b0082', rgb: '75,0,130' },\n DarkSlateBlue: { hex: '483d8b', rgb: '72,61,139' },\n SlateBlue: { hex: '6a5acd', rgb: '106,90,205' },\n MediumSlateBlue: { hex: '7b68ee', rgb: '123,104,238' },\n White: { hex: 'ffffff', rgb: '255,255,255' },\n Snow: { hex: 'fffafa', rgb: '255,250,250' },\n Honeydew: { hex: 'f0fff0', rgb: '240,255,240' },\n MintCream: { hex: 'f5fffa', rgb: '245,255,250' },\n Azure: { hex: 'f0ffff', rgb: '240,255,255' },\n AliceBlue: { hex: 'f0f8ff', rgb: '240,248,255' },\n GhostWhite: { hex: 'f8f8ff', rgb: '248,248,255' },\n WhiteSmoke: { hex: 'f5f5f5', rgb: '245,245,245' },\n Seashell: { hex: 'fff5ee', rgb: '255,245,238' },\n Beige: { hex: 'f5f5dc', rgb: '245,245,220' },\n OldLace: { hex: 'fdf5e6', rgb: '253,245,230' },\n FloralWhite: { hex: 'fffaf0', rgb: '255,250,240' },\n Ivory: { hex: 'fffff0', rgb: '255,255,240' },\n AntiqueWhite: { hex: 'faebd7', rgb: '250,235,215' },\n Linen: { hex: 'faf0e6', rgb: '250,240,230' },\n LavenderBlush: { hex: 'fff0f5', rgb: '255,240,245' },\n MistyRose: { hex: 'ffe4e1', rgb: '255,228,225' },\n Gainsboro: { hex: 'dcdcdc', rgb: '220,220,220' },\n LightGray: { hex: 'd3d3d3', rgb: '211,211,211' },\n Silver: { hex: 'c0c0c0', rgb: '192,192,192' },\n DarkGrey: { hex: 'a9a9a9', rgb: '169,169,169' },\n Grey: { hex: '808080', rgb: '128,128,128' },\n DimGrey: { hex: '696969', rgb: '105,105,105' },\n LightSlateGrey: { hex: '778899', rgb: '119,136,153' },\n SlateGrey: { hex: '708090', rgb: '112,128,144' },\n DarkSlateGrey: { hex: '2f4f4f', rgb: '47,79,79' },\n Black: { hex: '000000', rgb: '0,0,0' }\n};\n","import {\n LINEAR\n} from '../enums/constants';\n/**\n * Set of default colors\n */\nexport const palette = [\n '#086bb6',\n '#f37d45',\n '#f5ce02',\n '#67bda0',\n '#c54e4e',\n '#ae70af'\n];\n\nexport const DEFAULT_GRADIENT_COLOR = '#eaeaea';\n\nexport const DEFAULT_CONFIG = {\n range: palette,\n value: palette[0],\n step: false,\n stops: 5,\n type: LINEAR\n};\n","import { mergeRecursive, detectColor, hexToHsv, rgbToHsv, defaultValue } from 'muze-utils';\nimport { x11Colors } from './color-maps';\nimport { palette, DEFAULT_GRADIENT_COLOR } from './defaults';\nimport { LINEAR, RGB, HEX, HSL, HSLA } from '../enums/constants';\n\nexport const getHslString = hslArr => `hsla(${hslArr[0] * 360},${hslArr[1] * 100}%,${hslArr[2] * 100}%,\\\n${hslArr[3] || 1})`;\n\nexport const convertToXllString = baseString => (baseString.split(' ') || [])\n .reduce((x, e) => `${x}${e.charAt(0).toUpperCase()}${e.slice(1)}`, '');\n\nexport const getActualHslColor = (e, paletteColor) => {\n let color = '';\n if (typeof e === 'string') {\n e = e.replace(/ /g, '');\n e = e.toLowerCase();\n if (detectColor(e) === HSL || detectColor(e) === HSLA) {\n color = e.match(/(\\d+(\\.\\d+)?)/g);\n color = [color[0] / 360, color[1] / 100, color[2] / 100, defaultValue(Number(color[3]), 1)];\n } else if (detectColor(e) === HEX) {\n color = hexToHsv(e);\n } else if (detectColor(e) === RGB) {\n const col = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')')).split(/,\\s*/);\n color = rgbToHsv(...col);\n } else if (x11Colors[convertToXllString(e)]) {\n color = rgbToHsv(...x11Colors[convertToXllString(e)].rgb.split(','));\n }\n } else if (!(e instanceof Array)) {\n color = rgbToHsv(paletteColor);\n } else {\n color = e;\n }\n return color;\n};\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => {\n const defCon = mergeRecursive({}, context.constructor.defaultConfig());\n if (config.type === LINEAR) {\n config.range = config.range || [defCon.range[0]];\n config.range = config.range.length > 1 ? config.range : [DEFAULT_GRADIENT_COLOR, ...config.range];\n }\n const oldConfig = mergeRecursive(defCon, context.config());\n const newConfig = mergeRecursive(oldConfig, config);\n\n if (newConfig.range instanceof Array) {\n newConfig.range = newConfig.range.map((e, i) => getActualHslColor(e, palette[i]));\n newConfig.stops = config.stops || newConfig.range.length;\n }\n newConfig.value = getActualHslColor(newConfig.value, newConfig.value);\n return newConfig;\n }\n },\n domain: {},\n scale: {},\n uniqueValues: {}\n};\n","import { InvalidAwareTypes, getObjProp } from 'muze-utils';\n\nexport const treatNullMeasures = (domainVal, scaledVal, minDomainScaledVal) => {\n if (domainVal instanceof InvalidAwareTypes) {\n return minDomainScaledVal;\n }\n return scaledVal;\n};\n\nexport const resolveAxisConfig = (propVal, defaultVal, context) => {\n const constructor = getObjProp(propVal, 'constructor');\n switch (constructor) {\n case Function:\n return propVal(defaultVal, context);\n case Array:\n return propVal;\n default:\n return defaultVal;\n }\n};\n","import { numberInterpolator, piecewiseInterpolator, hslInterpolator, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, SEQUENTIAL, ORDINAL, QUANTILE } from '../enums/scale-type';\nimport { getHslString } from './props';\nimport { treatNullMeasures } from '../helper';\n\nconst getStops = (domain, stops) => {\n let newStops = [];\n\n if (stops instanceof Array) {\n newStops = stops.slice().sort();\n newStops = [...new Set([domain[0], ...stops, domain[1]])].sort();\n } else {\n const interpolator = numberInterpolator()(...domain);\n for (let i = 0; i <= stops; i++) {\n newStops[i] = interpolator(i / stops);\n }\n }\n\n if (newStops[0] < domain[0]) {\n newStops.shift();\n }\n return { domain, newStops };\n};\n\nconst rangeStops = (newStopsLength, range) => {\n let newRange = [];\n const maxRangeLength = Math.min(range.length, 18);\n\n if (newStopsLength > maxRangeLength) {\n const interpolator = piecewiseInterpolator()(hslInterpolator(), range.map(e => getHslString(e)));\n for (let i = 0; i < newStopsLength; i++) {\n newRange[i] = interpolator(i / (newStopsLength - 1));\n }\n } else {\n newRange = range.slice(0, newStopsLength);\n }\n return { newRange };\n};\n\n/**\n*\n*\n* @param {*} domain\n*\n*/\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomainMeasure = (domain, stops, range) => {\n const uniqueVals = domain;\n return { domain, uniqueVals, scaleDomain: [0, 1], range };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain, stops, range) => {\n const uniqueVals = domain;\n return { uniqueVals, domain, nice: true, range };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} stops\n *\n */\nconst steppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(domain, stops);\n const { newRange } = rangeStops(newStops.length - 1, range);\n\n return { uniqueVals, domain: newStops, nice: true, range: newRange };\n};\n\nconst continousSteppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(sanitizeDomainWhenEqual(domain), range.length - 1);\n const hslRange = range.map(e => getHslString(e));\n return { uniqueVals, domain: newStops, nice: true, range: hslRange };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst uniqueRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n return scale(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst indexedRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n\n return treatNullMeasures(domainValue, scale(numVal), scale(0));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) => treatNullMeasures(domainValue, scale(domainValue),\n scale(domain[0]));\n\n/**\n *\n *\n * @param {*} stops\n */\nconst strategies = () => ({\n [`${CONTINOUS}-${CONTINOUS}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${CONTINOUS}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${DISCRETE}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomain,\n value: () => uniqueRange\n },\n [`${DISCRETE}-${DISCRETE}-${ORDINAL}`]: {\n scale: ORDINAL,\n domainRange: () => normalDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${CONTINOUS}-${ORDINAL}`]: {\n scale: LINEAR,\n domainRange: () => continousSteppedDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${DISCRETE}-${ORDINAL}`]: {\n scale: QUANTILE,\n domainRange: () => steppedDomain,\n value: () => normalRange\n\n }\n});\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} stops\n */\nexport const strategyGetter = (domainType, rangeType, schemeType) =>\n strategies()[`${domainType}-${rangeType}-${schemeType || ''}`];\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters, rgbToHsv, defaultValue } from 'muze-utils';\nimport { createScale, getScheme, getSchemeType } from '../scale-creator';\nimport { CONTINOUS, DISCRETE, COLOR } from '../enums/constants';\nimport { strategyGetter } from './color-strategy';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { PROPS, getHslString, getActualHslColor } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ColorAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @param {Object | undefined} params.range Type of color range.\n * @param {string} params.name the label to show on axis.\n * @param {string} params.type The type of scale to handle.\n * @memberof ColorAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n this.config(config);\n\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = (this._config.type === 'linear' && !this._config.step) ? CONTINOUS : DISCRETE;\n\n this._schemeType = getSchemeType(this._config.range);\n\n this._colorStrategy = this.setColorStrategy(this._domainType, this._rangeType, this._schemeType);\n this._scale = this.createScale(this._colorStrategy);\n\n this._id = getUniqueId();\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return COLOR;\n }\n\n /**\n *\n *\n * @param {*} colorStrategy\n *\n * @memberof ColorAxis\n */\n createScale (colorStrategy) {\n const { range } = this.config();\n if (range && typeof (range) === 'string') {\n return getScheme(range);\n }\n return createScale({\n type: colorStrategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setColorStrategy (domainType, rangeType, schemeType) {\n return strategyGetter(domainType, rangeType, schemeType);\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getHslString (hslColorArray) {\n return getHslString(hslColorArray);\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getColor (domainVal) {\n return this.getHslString(this.getRawColor(domainVal));\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getRawColor (domainVal) {\n if (this.domain() && domainVal !== undefined) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const color = this._colorStrategy.value(range)(domainVal, scale, this.domain(), this.uniqueValues());\n if (color) {\n if (typeof color === 'string') {\n const col = color.substring(color.indexOf('(') + 1, color.lastIndexOf(')')).split(/,\\s*/);\n return rgbToHsv(...col);\n }\n return [...color];\n }\n }\n return [...this.config().value];\n }\n\n /**\n *\n *\n * @param {*} [domain=[]]\n *\n * @memberof ColorAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const domainRangeFn = this._colorStrategy.domainRange();\n const scaleInfo = domainRangeFn(domain, this.config().stops, range);\n\n this.domain(scaleInfo.domain);\n scaleInfo.range && this.scale().range(scaleInfo.range);\n this.uniqueValues(scaleInfo.uniqueVals);\n this.scale().domain(scaleInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n config: this.config()\n };\n }\n\n transformColor (color, transformationArr) {\n const h = color[0] * 360;\n const s = color[1] * 100;\n const l = color[2] * 100;\n const a = Math.min(defaultValue(color[3], 0), 1);\n const newH = h + transformationArr[0];\n const newS = s + transformationArr[1];\n const newL = l + transformationArr[2];\n const newA = Math.min(a + transformationArr[3] || 0, 1);\n\n return { color: `hsla(${newH},${newS}%,${newL}%,${newA})`, hsla: [newH / 360, newS / 100, newL / 100, newA] };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n\n getHslArray (color) {\n return getActualHslColor(color);\n }\n\n}\n","export const DEFAULT_CONFIG = {\n value: 36,\n range: [36, 1000]\n};\n","import { numberInterpolator, piecewiseInterpolator } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, THRESHOLD } from '../enums/scale-type';\nimport { treatNullMeasures } from '../helper';\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain) => {\n const uniqueVals = domain;\n return { uniqueVals, domain };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} intervals\n *\n */\nconst steppedDomain = (domain, intervals) => {\n let newIntervals = [];\n if (intervals instanceof Array) {\n newIntervals = intervals.slice().sort();\n } else {\n const interpolator = numberInterpolator()(...domain);\n for (let i = 0; i < intervals; i++) {\n newIntervals[i] = interpolator(i / (intervals - 1));\n }\n }\n if (newIntervals[0] < domain[0]) {\n newIntervals.shift();\n }\n const retDomain = newIntervals;\n return { uniqueVals: newIntervals, domain: retDomain, nice: true };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst discreteRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n const interpolator = numberInterpolator()(...scale.range());\n return treatNullMeasures(domainValue, interpolator(numVal), interpolator(domain[0]));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst pieceWiseRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n const fn = piecewiseInterpolator()(numberInterpolator(), [...scale.range()]);\n return fn(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) =>\n treatNullMeasures(domainValue, scale(domainValue), scale(domain[0]));\n\n/**\n *\n *\n * @param {*} intervals\n */\nconst strategies = {\n [`${DISCRETE}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: indexedDomain,\n range: pieceWiseRange\n },\n [`${CONTINOUS}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: normalDomain,\n range: normalRange\n },\n [`${CONTINOUS}-${DISCRETE}`]: {\n scale: THRESHOLD,\n domain: steppedDomain,\n range: discreteRange\n }\n};\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} intervals\n */\nexport const strategyGetter = (domainType, rangeType) =>\n strategies[`${domainType}-${rangeType}`];\n","export const PROPS = {\n config: {},\n domain: {\n sanitization: (context, value) => {\n context.scale().domain(value);\n return value;\n }\n },\n range: {},\n scale: {},\n uniqueValues: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SIZE, CONTINOUS, DISCRETE } from '../enums/constants';\nimport { strategyGetter } from './size-strategy';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class SizeAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @memberof SizeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig(), config);\n // @todo: Will use configuration override using scale decorator\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = CONTINOUS;\n\n this._sizeStrategy = this.setStrategy(this._domainType, this._rangeType);\n this._scale = this.createScale(this._sizeStrategy);\n this._range = this._config.range;\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setStrategy (domainType, rangeType) {\n return strategyGetter(domainType, rangeType);\n }\n\n /**\n *\n *\n *\n * @memberof SizeAxis\n */\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SIZE;\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof SizeAxis\n */\n getSize (domainVal = 0) {\n let sizeVal = 1;\n const {\n value\n } = this.config();\n const scale = this.scale();\n const domain = this.domain() || [1, 1];\n\n if (!scale || domain[0] === domain[1]) {\n sizeVal = value;\n } else {\n return this._sizeStrategy.range(domainVal, scale, this.domain(), this.uniqueValues());\n }\n return sizeVal;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof SizeAxis\n */\n updateDomain (domain) {\n if (domain) {\n const domainFn = this._sizeStrategy.domain;\n\n const domainInfo = domainFn(domain, this.config().intervals);\n\n this.domain(domainInfo.domain);\n this.uniqueValues(domainInfo.uniqueVals);\n\n this.scale().domain(domainInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","export const DEFAULT_CONFIG = {\n generator: null,\n value: 'circle',\n range: ['circle', 'diamond', 'star', 'cross', 'square', 'wye', 'triangle']\n};\n","export const PROPS = {\n config: {},\n domain: {},\n scale: {},\n uniqueValues: {},\n generator: {}\n};\n\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, getSymbol, generateGetterSetters, mergeRecursive, InvalidAwareTypes } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SHAPE } from '../enums/constants';\nimport { shapeGenerator } from './helper';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ShapeAxis {\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} params input parameters.\n * @param {Object | undefined} params.range Type of color scheme.\n * @memberof ShapeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(this._config, config);\n\n this._scale = createScale({\n type: 'ordinal',\n range: this._config.range\n });\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SHAPE;\n }\n\n /**\n *\n *\n * @param {*} value\n *\n * @memberof ShapeAxis\n */\n getShape (value) {\n if (!this.scale() || !this.domain() || !value || value instanceof InvalidAwareTypes) {\n return this.config().value;\n }\n\n if (this._generatedShapes) {\n return this._generatedShapes[value];\n }\n\n const shapeType = this.scale()(value);\n if (shapeType === 'string') {\n return getSymbol(shapeType);\n }\n\n return shapeType;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof ShapeAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n this.uniqueValues(domain);\n this.domain(domain);\n this.scale().domain(domain);\n\n if (this.config().generator) {\n this._generatedShapes = shapeGenerator(domain, this.config().generator);\n }\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.config().range,\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","/**\n *\n *\n * @param {*} domain\n * @param {*} generatorFn\n *\n */\nexport const shapeGenerator = (domain, generatorFn) => {\n const generatedShapes = {};\n domain.forEach((value) => {\n generatedShapes[value] = generatorFn(value);\n });\n return generatedShapes;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => mergeRecursive(context.config(), config),\n preset: (context, config) => {\n const { range, domain } = config;\n range && context.range(range);\n domain && context.domain(domain);\n }\n },\n domain: {},\n range: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, Symbols, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_ANGLE_DOMAIN } from '../enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst { pie } = Symbols;\n\nconst createAngleValues = (context) => {\n const angleData = context._angleFn(context._domain);\n angleData.forEach((v) => {\n v.startAngle -= Math.PI / 2;\n v.endAngle -= Math.PI / 2;\n });\n context._angleValues = angleData.reduce((values, d) => {\n const key = d.data;\n !values[key] && (values[key] = []);\n values[key].push(d);\n return values;\n }, {});\n};\n\n/**\n* This class is used to instantiate a AngleAxis.\n* @class AngleAxis\n*/\nexport default class AngleAxis {\n\n /**\n * Creates an instance of AngleAxis.\n * @param {Object} config input parameters.\n * @memberof AngleAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._range = [0, 360];\n this._angleFn = pie()\n .value(d => (typeof d === 'string' ? 1 : d))\n .sortValues(null);\n this._angleValues = {};\n }\n\n static defaultConfig () {\n return {};\n }\n\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n getScaleValue (domainVal) {\n return this._angleValues[domainVal];\n }\n\n padAngle (angle) {\n this._angleFn = this._angleFn.padAngle(angle);\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n const domain = domainVal[0].length ? domainVal[0] : DEFAULT_ANGLE_DOMAIN;\n this._domain = resolveAxisConfig(customDomain, domain, this);\n createAngleValues(this);\n return this;\n }\n return this._domain;\n }\n\n range (...range) {\n if (range.length) {\n const { range: customRange } = this.config();\n this._range = resolveAxisConfig(customRange, range[0], this);\n const domain = this.domain();\n const [startAngle, endAngle] = this._range;\n this._angleFn\n .startAngle((startAngle / 180) * Math.PI)\n .endAngle(Math.PI * endAngle / 180);\n if (domain && domain.length) {\n createAngleValues(this);\n }\n return this;\n }\n return this._range;\n }\n}\n","/**\n * This file exports constants that are used as enums in the\n * crosstab group implementation.\n */\n/**\n * Width of the crosstab.\n */\nexport const X = 'x';\n/**\n * Width of the crosstab.\n */\nexport const Y = 'y';\n/**\n * Width of the crosstab.\n */\nexport const WIDTH = 'width';\n\n/**\n * Height of the crosstab.\n */\nexport const HEIGHT = 'height';\n\n/**\n * Field referring to object storing measurement configuration.\n */\nexport const MEASUREMENT = 'measurement';\n\n/**\n * Field referring to object storing configuration properties.\n */\nexport const CONFIG = 'config';\n\n/**\n * Width of visual unit in crosstab.\n */\nexport const MIN_UNIT_WIDTH = 'minUnitWidth';\n\n/**\n * Height of visual unit.\n */\nexport const MIN_UNIT_HEIGHT = 'minUnitHeight';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSIONS = 'dimensions';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURES = 'measures';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSION = 'dimension';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURE = 'measure';\n\n/**\n * Flag to specify if model should be pivoted.\n */\nexport const PIVOT = 'pivot';\n\n/**\n * Flag to specify format\n */\nexport const FORMAT = 'format';\n\n/**\n * Mount point where the variable will be hosted\n */\nexport const MOUNT = 'mount';\n\n/**\n * Data update flag\n */\nexport const HAS_DATA_UPDATED = 'hasDataUpdated';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROWS = 'rows';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMNS = 'columns';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COL = 'col';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROW = 'row';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMN = 'column';\n\n/**\n * Field referring to object storing color field\n */\nexport const COLOR = 'color';\n\n/**\n * Field referring to object storing shape field\n */\nexport const SHAPE = 'shape';\n\n/**\n * Field referring to object storing size field\n */\nexport const SIZE = 'size';\n\n/**\n * Field referring to object storing detail field\n */\nexport const DETAIL = 'detail';\n\n/**\n * Field referring to object storing set of layers\n */\nexport const LAYERS = 'layers';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const TRANSFORM = 'transform';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const ORDINAL = 'ordinal';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const LINEAR = 'linear';\n/**\n * Field referring to object storing the transforms\n */\nexport const LEFT = 'left';\n/**\n * Field referring to object storing the transforms\n */\nexport const RIGHT = 'right';\n/**\n * Field referring to object storing the transforms\n */\nexport const TOP = 'top';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTTOM = 'bottom';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const RETINAL = 'retinal';\n/**\n * Field referring to object storing the transforms\n */\nexport const CELL = 'cell';\n/**\n * Field referring to object storing the transforms\n */\nexport const X_AXES = 'xAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const Y_AXES = 'yAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const ENTRY_CELLS = 'entryCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const INITIALIZED = 'initialized';\n/**\n * Field referring to object storing the transforms\n */\nexport const EXIT_CELLS = 'exitCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const AXIS = 'axis';\n/**\n * Field referring to object storing the transforms\n */\nexport const UNIT = 'unit';\n/**\n * Field referring to object storing the transforms\n */\nexport const UPDATED = 'updated';\n/**\n * Field referring to object storing the transforms\n */\nexport const BEFORE_UPDATE = 'beforeupdate';\n/**\n * Field referring to object storing the transforms\n */\nexport const VALUE_MATRIX = 'valueMatrix';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET_HEADERS = 'facet-headers';\n/**\n * Field referring to object storing the transforms\n */\nexport const RADIUS = 'radius';\n/**\n * Field referring to object storing the transforms\n */\nexport const ANGLE = 'angle';\n\nexport const ANGLE0 = 'angle0';\n/**\n * Field referring to object storing the transforms\n */\nexport const ARC = 'arc';\n/**\n * Field referring to object storing the transforms\n */\nexport const CATEGORICAL = 'categorical';\n/**\n * Field referring to object storing the transforms\n */\nexport const TEMPORAL = 'temporal';\n/**\n * Field referring to object storing the transforms\n */\nexport const BAR = 'bar';\n/**\n * Field referring to object storing the transforms\n */\nexport const LINE = 'line';\n/**\n * Field referring to object storing the transforms\n */\nexport const POINT = 'point';\n/**\n * Field referring to object storing the transforms\n */\nexport const PRIMARY = 'Primary';\n/**\n * Field referring to object storing the transforms\n */\nexport const SECONDARY = 'Secondary';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTH = 'both';\n/**\n * Field referring to object storing the transforms\n */\nexport const INTERACTION = 'interaction';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_LINES = 'gridLines';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_BANDS = 'gridBands';\n/**\n * Field referring to object storing the transforms\n */\nexport const HEADER = 'header';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET = 'facet';\n/**\n * Ordering type\n */\nexport const ASCENDING = 'asc';\n/**\n * Ordering type\n */\nexport const DESCENDING = 'desc';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, mergeRecursive, generateGetterSetters, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { LINEAR } from '../../../visual-group/src/enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst adjustDomain = (context) => {\n const minOuterRadius = context.config().minOuterRadius;\n const domain = context._domain;\n if (context._range.length) {\n const scale = context._scale;\n const value = scale.invert(minOuterRadius) - scale.invert(0);\n context._domain = [domain[0] - value, domain[1]];\n scale.domain(context._domain);\n }\n};\n\n/**\n* This class is used to instantiate a RadiusAxis.\n* @class RadiusAxis\n*/\nexport default class RadiusAxis {\n\n /**\n * Creates an instance of RadiusAxis.\n * @param {Object} config input parameters.\n * @memberof RadiusAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._range = [];\n this._radiusFactor = 1;\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._scale = this.createScale({\n scale: LINEAR\n });\n }\n\n static defaultConfig () {\n return {\n padding: [0, 1],\n minOuterRadius: 10\n };\n }\n\n config (...params) {\n if (params.length) {\n const config = mergeRecursive(this.config(), params[0]);\n this._config = config;\n return this;\n }\n return this._config;\n }\n\n createScale (strategy) {\n return createScale({\n type: strategy.scale,\n range: this.range()\n });\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n let domain = resolveAxisConfig(customDomain, domainVal[0], this);\n domain = sanitizeDomainWhenEqual(domain);\n this._scale.domain(domain);\n this._domain = domain;\n adjustDomain(this);\n }\n return this._domain;\n }\n\n getInnerRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[0];\n }\n return this._scale(domainVal);\n }\n\n getOuterRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[1];\n }\n const radius = this._scale(domainVal) * this._radiusFactor;\n return radius;\n }\n\n range (...range) {\n if (range.length) {\n const { padding, range: customRange } = this.config();\n const sanitizedRange = range[0].map((v, i) => v + (i ? -padding[i] : padding[i]));\n const rangeVal = resolveAxisConfig(customRange, sanitizedRange, this);\n this._range = rangeVal;\n this._scale.range(rangeVal);\n adjustDomain(this);\n }\n return this._range;\n }\n\n setRadiusFactor (val) {\n this._radiusFactor = val;\n return this;\n }\n}\n","import * as ScaleType from './enums/scale-type';\n\nconst DATA_TYPES = {\n DIMENSION: 'dimension',\n CATEGORICAL: 'categorical',\n MEASURE: 'measure',\n TEMPORAL: 'temporal'\n};\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [DATA_TYPES.DIMENSION]: ScaleType.BAND,\n [DATA_TYPES.MEASURE]: ScaleType.LINEAR,\n [DATA_TYPES.TEMPORAL]: ScaleType.TIME\n};\n\n","import { nestCollection, InvalidAwareTypes } from 'muze-utils';\n\n/**\n * Create multiple datasets from a single dataset by grouping the data using\n * a dimensional field.\n * @param {Array} schema Name and type of fields are stored in schema\n * @param {Array} data Data array\n * @param {Object} config Configuration object\n * @return {Array} Grouped data array\n */\nexport default (schema, data, config) => {\n const groupBy = config.groupBy instanceof Array ? config.groupBy : [config.groupBy];\n const groupByIndices = groupBy.map(fieldName => schema.findIndex(d => d.name === fieldName));\n\n if (groupByIndices.find(d => d === -1) !== undefined) {\n throw new Error(`Groupby field ${groupBy} not found in schema`);\n }\n\n const groupedData = nestCollection({\n keys: groupByIndices,\n data\n });\n\n groupedData.forEach((d) => {\n const key = d.key;\n if (InvalidAwareTypes.isInvalid(key)) {\n d.key = InvalidAwareTypes.getInvalidType(key);\n }\n });\n return groupedData;\n};\n","/**\n * @module Transform\n * This file exports a function that is used to implement\n * the identity transform\n */\n /* eslint no-unused-vars: 0 */\n /**\n * This function accepts data and returns the data unchanged.\n * @param {Object} schema The schema.\n * @param {Array} data The data array.\n * @param {Object} config The config object.\n * @return {Array} The unchanged data.\n */\n function identityTransform (schema, data, config) {\n return data;\n }\n\n export default identityTransform;\n","/**\n * @module Transform\n * This file exports the transform factory.\n */\nimport * as TransformType from '../enums/transform-type';\nimport identity from '../identity-transform';\nimport group from '../group-transform';\nimport stack from '../stack-transform';\n\n/* istanbul ignore next */\nconst transformMap = {\n [TransformType.IDENTITY]: identity,\n [TransformType.GROUP]: group,\n [TransformType.STACK]: stack\n};\n\n/**\n * This function is used to retirn a transform associated\n * with the given type.\n *\n * @param {string} type The type of the transform.\n * @return {Function} The transform function.\n */\nfunction transformFactory (type) {\n const transform = transformMap[type];\n if (typeof transform !== 'function') {\n throw new Error('Invalid transform type supplied.');\n }\n return transform;\n}\n\nexport default transformFactory;\n","/**\n * @module Transform\n * This module exports constants that are used to reference transforms in\n * a consistent manner throughout the project.\n */\n/* eslint one-var: 0 */\n export const IDENTITY = 'identity';\n export const GROUP = 'group';\n export const STACK = 'stack';\n export const FRACTURE = 'fracture';\n","import { stack } from 'muze-utils';\n\nimport group from '../group-transform';\n/*\n Normalize the data to a form which can be given to d3 stack for stacking the data\n ['Product', 'Sales', 'Region'],\n 0 ['A', 2000, 'North'],\n 1 ['A', 3000, 'South'],\n 2 ['B', 3000, 'South'],\n 3 ['B', 2000, 'North'],\n 4 ['C', 3000, 'South'],\n 5 ['C', 2000, 'North']\n |\n |\n ['Product', 'North', 'South'],\n ['A', 2000, 3000],\n ['B', 2000, 3000],\n ['C', 2000, 3000]\n*/\n// eslint-disable-next-line require-jsdoc\nconst normalizeData = (data, schema, valueField, uniqueField, groupBy) => {\n const groupedData = group(schema, data, {\n groupBy: uniqueField\n });\n const uniqueFieldIndex = schema.findIndex(d => d.name === uniqueField);\n const valueFieldIndex = schema.findIndex(d => d.name === valueField);\n const seriesKeyIndex = schema.findIndex(d => d.name === groupBy);\n const seriesKeys = data.map(d => d[seriesKeyIndex]).filter((item, pos, arr) => arr.indexOf(item) === pos).sort();\n const fieldNames = schema.reduce((acc, obj, i) => {\n acc[i] = obj.name;\n return acc;\n }, {});\n const dataArr = groupedData.map((arr) => {\n const tuples = {};\n const rowObj = arr.values.reduce((acc, row) => {\n acc = row.reduce((obj, value, i) => {\n if (i === seriesKeyIndex) {\n obj[value] = row[valueFieldIndex];\n tuples[value] = row;\n } else if (i !== valueFieldIndex) {\n obj[fieldNames[i]] = value;\n }\n return obj;\n }, acc);\n return acc;\n }, {});\n rowObj._tuple = tuples;\n // Set missing values field to zero value\n seriesKeys.forEach((seriesKey) => {\n if (rowObj[seriesKey] === undefined) {\n rowObj[seriesKey] = 0;\n const newArr = new Array(arr.values[0].length);\n newArr[uniqueFieldIndex] = arr.key;\n newArr[seriesKeyIndex] = seriesKey;\n rowObj._tuple[seriesKey] = newArr;\n }\n });\n return rowObj;\n });\n\n return {\n data: dataArr,\n keys: seriesKeys\n };\n};\n/**\n * Generate a stacked representation of data\n * @param {Array} schema schema Array\n * @param {Array} data data array\n * @param {Object} config Configuration object\n * @return {Array} stacked data\n */\nexport default (schema, data, config) => {\n const uniqueField = config.uniqueField;\n const valueField = config.value;\n const groupBy = config.groupBy;\n const sort = config.sort || 'descending';\n const normalizedData = normalizeData(data, schema, valueField, uniqueField, groupBy);\n const keys = normalizedData.keys;\n const map = {};\n const orderBy = config.orderBy;\n const orderIndex = schema.findIndex(d => d.name === orderBy);\n const groupByIndex = schema.findIndex(d => d.name === groupBy);\n if (orderIndex !== -1) {\n keys.forEach((key) => {\n const name = data.find(d => d[groupByIndex] === key);\n map[key] = name[orderIndex];\n });\n normalizedData.keys.sort((a, b) => map[a].localeCompare(map[b]));\n }\n\n const stackData = stack({\n keys: normalizedData.keys,\n offset: config.offset || 'diverging',\n order: sort,\n data: normalizedData.data\n });\n stackData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n dataObj.data = dataObj.data._tuple[seriesData.key];\n });\n });\n return stackData;\n};\n\n","import {\n FieldType,\n getDomainFromData,\n setStyles,\n easeFns,\n selectElement,\n DimensionSubtype,\n retrieveNearestGroupByReducers,\n getObjProp,\n COORD_TYPES,\n CommonProps,\n defaultValue\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { transformFactory } from '@chartshq/transform';\nimport { IDENTITY, STACK, GROUP, COLOR, SHAPE, SIZE, ENCODING, AGG_FN_SUM, ASCENDING, TEXT } from '../enums/constants';\n\nconst BAND = ScaleType.BAND;\nconst { POLAR, CARTESIAN } = COORD_TYPES;\n\nconst transformColor = (colorAxis, datum, styleType, intensity) => {\n const meta = datum.meta;\n const stateColor = defaultValue(meta.stateColor[styleType], meta.originalColor[styleType]);\n const colorInfo = colorAxis.transformColor(stateColor, intensity);\n\n meta.stateColor[styleType] = colorInfo.hsla;\n return colorInfo;\n};\n\nexport const applyInteractionStyle = (context, selectionSet, interactionStyles, config) => {\n const elements = context.getPlotElementsFromSet(selectionSet);\n const axes = context.axes();\n const colorAxis = axes.color;\n const apply = config.apply;\n const interactionType = config.interactionType;\n interactionStyles.forEach((style) => {\n const styleType = style.type;\n elements.forEach((elem) => {\n elem.style(styleType, ((d) => {\n const { colorTransform, stateColor, originalColor } = d.meta;\n colorTransform[interactionType] = colorTransform[interactionType] || {};\n if (apply && !colorTransform[interactionType][styleType]) {\n // fade selections\n colorTransform[interactionType][styleType] = style.intensity;\n const color = transformColor(colorAxis, d, styleType, style.intensity).color;\n return color;\n }\n if (!apply && colorTransform[interactionType][styleType]) {\n // unfade selections\n colorTransform[interactionType][styleType] = null;\n return transformColor(colorAxis, d, styleType, style.intensity.map(e => -e)).color;\n }\n const [h, s, l, a] = stateColor[styleType] ? stateColor[styleType] : originalColor[styleType];\n return `hsla(${h * 360},${s * 100}%,${l * 100}%, ${a})`;\n }));\n });\n });\n};\n\n/**\n *\n *\n * @param {*} selectionSet\n * @param {*} className\n * @param {*} hasFaded\n */\nexport const fadeUnfadeSelection = (context, selectionSet, hasFaded, interaction) => {\n const interactionConfig = { interaction, apply: hasFaded };\n applyInteractionStyle(context, selectionSet, 'fade', interactionConfig);\n};\n\n/**\n *\n *\n * @param {*} selectionSet\n * @param {*} className\n * @param {*} hasFaded\n */\nexport const focusUnfocusSelection = (context, selectionSet, isFocussed, interaction) => {\n const interactionConfig = { interaction, apply: isFocussed };\n applyInteractionStyle(context, selectionSet, 'focus', interactionConfig);\n};\n\n/**\n *\n *\n * @param {*} axes\n *\n */\nexport const getAxesScales = (axes) => {\n const [xAxis, yAxis] = [ENCODING.X, ENCODING.Y].map(e => axes[e]);\n const [xScale, yScale] = [xAxis, yAxis].map(e => e && e.scale());\n return {\n xAxis,\n yAxis,\n xScale,\n yScale\n };\n};\n\nexport const encodingFieldInfRetriever = {\n [POLAR]: (encoding, fieldsConfig) => {\n const encodingInf = {};\n [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT]\n .forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n });\n return encodingInf;\n },\n [CARTESIAN]: (encoding, fieldsConfig) => {\n const encodingInf = {};\n [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT].forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n encodingInf[`${e}FieldType`] = getObjProp(fieldsConfig, field, 'def', 'type');\n encodingInf[`${e}FieldSubType`] = getObjProp(fieldsConfig, field, 'def', 'subtype');\n });\n\n return encodingInf;\n }\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} config\n * @param {*} transformType\n *\n */\nexport const transformData = (dataModel, config, transformType, encodingFieldInf) => {\n const data = dataModel.getData({ withUid: true });\n const schema = data.schema;\n const transform = config.transform;\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = encodingFieldInf;\n const uniqueField = xFieldType === FieldType.MEASURE ? yField : xField;\n\n return transformFactory(transformType)(schema, data.data, {\n groupBy: transform.groupBy,\n uniqueField,\n sort: transform.sort || 'none',\n offset: transform.offset,\n orderBy: transform.orderBy,\n value: yFieldType === FieldType.MEASURE ? yField : xField\n }, data.uids);\n};\n\nexport const getIndividualClassName = (d, i, data, context) => {\n const className = context.config().individualClassName;\n let classNameStr = '';\n if (className instanceof Function) {\n classNameStr = className(d, i, data, context);\n }\n return classNameStr;\n};\n\nconst dataNormalizers = {\n [POLAR]: (transformedData, encodingFieldInf, fieldsConfig) => {\n const {\n radiusFieldIndex,\n angleFieldIndex,\n radius0FieldIndex,\n angle0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map(data => data.map((d) => {\n const pointObj = {\n radius: d[radiusFieldIndex],\n angle: angleFieldIndex !== undefined ? d[angleFieldIndex] : 1,\n radius0: d[radius0FieldIndex],\n angle0: d[angle0FieldIndex]\n };\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n return pointObj;\n })).filter(d => d.length);\n },\n [CARTESIAN]: (transformedData, encodingFieldInf, fieldsConfig, transformType) => {\n const {\n xFieldType,\n xFieldIndex,\n yFieldIndex,\n x0FieldIndex,\n y0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map((data) => {\n const values = transformType === GROUP ? data.values : data;\n return values.map((d) => {\n let pointObj = {};\n let tuple;\n if (transformType === STACK) {\n tuple = d.data || [];\n let y;\n let y0;\n let x;\n let x0;\n if (d[1] >= d[0]) {\n y = x0 = d[1];\n x = y0 = d[0];\n } else {\n y = x0 = d[0];\n x = y0 = d[1];\n }\n\n pointObj = xFieldType === FieldType.MEASURE ? {\n x,\n x0,\n y: tuple[yFieldIndex],\n y0: tuple[yFieldIndex]\n } : {\n x: tuple[xFieldIndex],\n x0: tuple[xFieldIndex],\n y,\n y0\n };\n pointObj.source = tuple;\n pointObj.rowId = tuple[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = tuple[encodingFieldInf[`${enc}FieldIndex`]];\n });\n } else {\n pointObj = {\n x: d[xFieldIndex],\n y: d[yFieldIndex],\n x0: d[x0FieldIndex],\n y0: d[y0FieldIndex]\n };\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n }\n return pointObj;\n });\n }).filter(d => d.length);\n }\n};\n/*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldsConfig field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n*/\nexport const getNormalizedData = (transformedData, context) => {\n const transformType = context.transformType();\n const transformedDataArr = transformType === IDENTITY ? [transformedData] : transformedData;\n const encodingFieldInf = context.encodingFieldsInf();\n const fieldsConfig = context.data().getFieldsConfig();\n return dataNormalizers[context.coord()](transformedDataArr, encodingFieldInf, fieldsConfig, transformType);\n};\n\nexport const domainCalculator = {\n [POLAR]: (data, layerInst) => {\n const config = layerInst.config();\n const { sort } = config;\n let angleValues = data[0];\n const radius0Field = getObjProp(config.encoding.radius0, 'field');\n if (sort) {\n angleValues = angleValues.sort((a, b) => (sort === ASCENDING ? a.radius - b.radius : b.radius - a.radius));\n }\n const radiusDomain = getDomainFromData(data, [ENCODING.RADIUS, radius0Field ?\n ENCODING.RADIUS0 : ENCODING.RADIUS]);\n return {\n radius: radiusDomain,\n angle: angleValues.map(d => d.angle),\n angle0: angleValues.map(d => d.angle0)\n };\n },\n [CARTESIAN]: (data, layerInst) => {\n const transformType = layerInst.transformType();\n const encodingFieldInf = layerInst.encodingFieldsInf();\n const {\n xFieldSubType,\n yFieldSubType,\n xField,\n yField,\n x0Field,\n y0Field\n } = encodingFieldInf;\n const domains = {};\n const yEnc = ENCODING.Y;\n const xEnc = ENCODING.X;\n if (xField) {\n domains.x = getDomainFromData(data, x0Field || transformType === STACK ? [xEnc, ENCODING.X0] : [xEnc, xEnc],\n xFieldSubType);\n }\n if (yField) {\n domains.y = getDomainFromData(data, y0Field || transformType === STACK ? [ENCODING.Y0, ENCODING.Y] :\n [yEnc, yEnc], yFieldSubType);\n }\n\n return domains;\n }\n};\n\nexport const attachDataToVoronoi = (voronoi, points) => {\n voronoi.data([].concat(...points).filter(d => d.rowId !== undefined).map((d) => {\n const point = d.update;\n return {\n x: point.x,\n y: point.y,\n data: d\n };\n }));\n};\n\n/**\n *\n *\n * @param {*} target\n * @param {*} styles\n * @param {*} remove\n */\nexport const updateStyle = (target, styles, remove) => {\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n target.style(key, remove ? null : styles[key]);\n }\n }\n};\n\n/**\n *\n *\n * @param {*} mount\n * @param {*} context\n */\nexport const animateGroup = (mount, context) => {\n let groupTransition;\n let update;\n const { transition, groupAnimateStyle } = context;\n const { duration, effect, disabled } = transition;\n if (groupAnimateStyle) {\n setStyles(mount.node(), groupAnimateStyle.enter);\n update = groupAnimateStyle.update;\n if (!disabled) {\n groupTransition = mount.transition()\n .ease(easeFns[effect])\n .duration(duration)\n .on('end', function () {\n updateStyle(selectElement(this), update, true);\n });\n } else {\n groupTransition = mount;\n }\n updateStyle(groupTransition, update);\n }\n};\n\nexport const positionPoints = (context, points) => {\n const positioner = context.encodingTransform();\n if (positioner) {\n return positioner(points, context, { smartLabel: context._dependencies.smartLabel });\n }\n return points;\n};\n\n/**\n * Gets the width of each group. It gets the width from axis if it is available for\n * example when the scale is nominal else it calculates the width from the\n * range of the axis and number of data points.\n *\n * @param {SimpleAxis} axis instance of axis\n * @param {number} minDiff Minimum difference between data points\n * @return {number} width of each bar\n * @private\n*/\nexport const getGroupSpan = (axis, minDiff) => {\n let groupSpan;\n const width = axis.getUnitWidth();\n const scale = axis.scale();\n const range = scale.range();\n const domain = scale.domain();\n !width ? groupSpan = (Math.abs(range[1] - range[0]) / Math.abs(domain[1] - domain[0])) * minDiff :\n (groupSpan = width);\n\n return groupSpan;\n};\n\nexport const getPlotMeasurement = (context, dimensionalValues) => {\n const fieldInfo = context.encodingFieldsInf();\n const axes = context.axes();\n const transformType = context.transformType();\n const config = context.config();\n const bandScale = context._bandScale;\n\n return ['x', 'y'].map((type) => {\n let span = 0;\n let groupSpan = 0;\n let padding = 0;\n let offsetValues = [];\n if (fieldInfo[`${type}FieldType`] === FieldType.DIMENSION) {\n let actualGroupWidth;\n const isTemporal = fieldInfo[`${type}FieldSubType`] === DimensionSubtype.TEMPORAL;\n const timeDiff = isTemporal ? context.dataProps().timeDiffs[type] : 0;\n const axis = axes[type];\n const pad = config[`pad${type.toUpperCase()}`];\n const innerPadding = config.innerPadding;\n const keys = dimensionalValues;\n const scale = axis.scale();\n groupSpan = getGroupSpan(axis, timeDiff);\n const isAxisBandScale = axis.constructor.type() === BAND;\n const axisPadding = axis.config().padding;\n // If it is a grouped bar then the width of each bar in a grouping is retrieved from\n // a band scale. The band scale will have range equal to width of one group of bars and\n // the domain is set to series keys.\n if (transformType === 'group') {\n const groupPadding = isAxisBandScale ? 0 : axisPadding * groupSpan / 2;\n bandScale.range([groupPadding, groupSpan - groupPadding]).domain(keys).paddingInner(innerPadding);\n span = bandScale.bandwidth();\n actualGroupWidth = groupSpan - (isAxisBandScale ? 0 : axisPadding * groupSpan);\n offsetValues = keys.map(key => bandScale(key) - (isAxisBandScale ? 0 : (groupSpan / 2)));\n } else if (pad !== undefined) {\n let offset;\n if (isAxisBandScale) {\n const step = scale.step();\n offset = scale.padding() * step;\n span = scale.bandwidth() + offset;\n } else {\n span = groupSpan;\n }\n offsetValues = keys.map(() => (isAxisBandScale ? -(offset / 2) : -(span / 2)));\n } else {\n padding = isAxisBandScale ? 0 : axisPadding * groupSpan;\n span = groupSpan - padding;\n actualGroupWidth = span;\n offsetValues = keys.map(() => (isAxisBandScale ? 0 : -(span / 2)));\n }\n\n groupSpan = actualGroupWidth;\n padding = isAxisBandScale ? axisPadding * axis.scale().step() : axisPadding * groupSpan;\n }\n\n return {\n span,\n offsetValues,\n groupSpan,\n padding\n };\n });\n};\n\nexport const renderLayer = (context) => {\n const mount = context.mount();\n if (mount) {\n context.render(mount);\n context.dependencies().throwback.commit(CommonProps.ON_LAYER_DRAW, true, context.metaInf().parentNamespace);\n }\n};\n\nconst transformResolverPredicates = (encodingFieldInf, context, groupByField) => {\n const fieldsConfig = context.data().getFieldsConfig();\n const { xField, yField, xFieldType, yFieldType } = encodingFieldInf;\n const dimensionField = ['xField', 'yField'].find(type =>\n encodingFieldInf[`${type}Type`] === FieldType.DIMENSION);\n\n return [\n !xField,\n !yField,\n !groupByField,\n getObjProp(fieldsConfig[groupByField], 'def', 'type') === FieldType.MEASURE,\n xFieldType === FieldType.DIMENSION && yFieldType === FieldType.DIMENSION,\n dimensionField && encodingFieldInf[dimensionField] === groupByField\n ];\n};\n\nexport const resolveInvalidTransformType = (context) => {\n const encodingFieldInf = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n\n if (transformResolverPredicates(encodingFieldInf, context, groupByField).some(value => value)) {\n return IDENTITY;\n }\n return null;\n};\n\nexport const getValidTransform = context => resolveInvalidTransformType(context) || context.config().transform.type;\n\nexport const getValidTransformForAggFn = (context) => {\n const resolvedInvalidTransformType = resolveInvalidTransformType(context);\n if (resolvedInvalidTransformType) {\n return resolvedInvalidTransformType;\n }\n\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n const isCustomTransformTypeProvided = !!getObjProp(context._customConfig, 'transform', 'type');\n let transformType = context.config().transform.type;\n\n if (!isCustomTransformTypeProvided && groupByField && xFieldType !== yFieldType) {\n const measureField = xFieldType === FieldType.MEASURE ? xField : yField;\n const { [measureField]: aggFn } = retrieveNearestGroupByReducers(context.data(), measureField);\n transformType = aggFn === AGG_FN_SUM ? STACK : GROUP;\n }\n\n return transformType;\n};\n\nexport const getMarkId = (source, schema) => source.filter((val, i) => schema[i] &&\n schema[i].type === FieldType.DIMENSION).join();\n\nexport const resolveEncodingValues = (data, i, dataArr, layerInst) => {\n const transformedValues = {};\n const values = data.values;\n const encoding = layerInst.config().encoding;\n for (const key in values) {\n const value = getObjProp(encoding[key], 'value');\n if (value instanceof Function) {\n transformedValues[key] = value(values, i, dataArr, layerInst);\n } else {\n transformedValues[key] = values[key];\n }\n }\n return transformedValues;\n};\n\nexport const getColorMetaInf = (colorInf, colorAxis) => ({\n originalColor: Object.keys(colorInf).reduce((acc, key) => {\n if (colorInf[key]) {\n acc[key] = colorAxis.getHslArray(colorInf[key]);\n }\n return acc;\n }, {}),\n stateColor: {},\n colorTransform: {}\n});\n\nconst getCoordValue = (radius, trig, angle, offset) => radius * Math[trig](angle) + offset;\n\nconst coordValueGetter = (radius, angle, xOffset, yOffset) => ({\n x: getCoordValue(radius, 'cos', angle, xOffset),\n y: getCoordValue(radius, 'sin', angle, yOffset)\n});\n\nexport const toCartesianCoordinates = (points, measurement, rangePlot = false) => {\n const xOffset = measurement.width / 2;\n const yOffset = measurement.height / 2;\n for (let i = 0, len = points.length; i < len; i++) {\n const point = points[i];\n const { angle, radius, radius0, angle0 } = point.update;\n point.update = coordValueGetter(radius, angle, xOffset, yOffset);\n if (rangePlot) {\n const update = point.update = coordValueGetter(radius0, angle0, xOffset, yOffset);\n const { x: x0, y: y0 } = coordValueGetter(radius, angle, xOffset, yOffset);\n update.x0 = x0;\n update.y0 = y0;\n }\n }\n return points;\n};\n\nexport const sortData = (data, axes) => {\n const { x: xAxis, y: yAxis } = axes;\n const axisArr = [xAxis, yAxis];\n for (let i = 0, len = axisArr.length; i < len; i++) {\n const axis = axisArr[i];\n if (axis.constructor.type() === BAND) {\n const key = i ? 'y' : 'x';\n const dom = axis.domain();\n const indices = dom.reduce((acc, v, idx) => {\n acc[v] = idx;\n return acc;\n }, {});\n data.sort((a, b) => indices[a[key]] - indices[b[key]]);\n break;\n }\n }\n return data;\n};\n","import * as PROPS from '../enums/props';\n\nexport const localOptions = {\n [PROPS.DATA]: {\n value: null\n }\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\nimport * as PROPS from '../enums/props';\nimport { encodingFieldInfRetriever } from '../helpers';\n\nexport const listenerMap = [\n {\n props: [`${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}.${PROPS.DATA}`],\n type: 'registerImmediateListener',\n listener: (context, [, data]) => {\n const config = context.config();\n if (data && config) {\n if (context._cacheEnabled) {\n context._cachedData.push(data);\n } else {\n context._cachedData = [data];\n }\n const encodingValue = config.encoding;\n if (encodingValue) {\n const fieldsConfig = data.getFieldsConfig();\n const encodingFieldsInf = encodingFieldInfRetriever[context.coord()](encodingValue, fieldsConfig);\n context.encodingFieldsInf(encodingFieldsInf);\n context.resolveTransformType();\n context._transformedData = context.getTransformedData(data, config,\n context.transformType(), encodingFieldsInf);\n context._normalizedData = context.getNormalizedData(context._transformedData, fieldsConfig);\n if (config.calculateDomain !== false) {\n const domain = context.calculateDomainFromData(context._normalizedData,\n context.encodingFieldsInf(), context.data().getFieldsConfig());\n context.domain(domain);\n }\n }\n }\n },\n namespace: context => context.metaInf().namespace\n }\n];\n","import {\n getUniqueId,\n mergeRecursive,\n FieldType,\n selectElement,\n ReservedFields,\n DataModel,\n clone,\n generateGetterSetters,\n STATE_NAMESPACES,\n COORD_TYPES,\n transactor,\n defaultValue,\n getObjProp\n} from 'muze-utils';\nimport { SimpleLayer } from '../simple-layer';\nimport * as PROPS from '../enums/props';\nimport { props } from './props';\nimport {\n transformData,\n getNormalizedData,\n applyInteractionStyle,\n getValidTransform,\n domainCalculator,\n renderLayer\n} from '../helpers';\nimport { localOptions } from './local-options';\nimport { listenerMap } from './listener-map';\n\nconst layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * An abstract class which gives definition of common layer functionality like\n * - transforming data for various modes. Supported modes: identity, group and stack.\n * - calculating data domain\n * - linking dependent layers\n * - merging policy of configuration\n * - interaction sideffect helpers\n * - retrieving dom elements from data using id\n * - retrieving the physical dimensions of marks\n * - disposing layer\n *\n * Every layer has to extend base layer and give concrete definition.\n * This layer does not have any default visual. A new layer has to define the logic of `render` for rendering the\n * visuals\n *\n * @public\n * @class\n * @module BaseLayer\n */\nexport default class BaseLayer extends SimpleLayer {\n\n /**\n * Creates a layer using a configuration and data.\n *\n * @public\n * @constructor\n * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a layer.\n * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from\n * value to px.\n * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators\n * @param {ShapeAxis} axes.shape Axis for providing a shape\n * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator\n * @param {LayerConfig} config Configuration of the layer\n * @param {Object} dependencies Dependencies of the layer\n * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance\n */\n constructor (data, axes, config, dependencies = {}) {\n super();\n\n generateGetterSetters(this, props);\n this.axes(axes);\n this.alias(this.constructor.formalName() + getUniqueId());\n this.dependencies(dependencies);\n this._points = [];\n this._cachedData = [];\n this._id = getUniqueId();\n this._measurement = {};\n this._animationDonePromises = [];\n this._graphicElems = {};\n this._customConfig = null;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys(localOptions).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getListeners () {\n return {\n store: [...listenerMap, {\n type: 'registerChangeListener',\n props: [`${layerNs[1]}.${PROPS.DATA}`,\n ...['x', 'y', 'radius'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context) => {\n renderLayer(context);\n },\n subNamespace: (context) => {\n const { unitRowIndex, unitColIndex, namespace } = context.metaInf();\n return {\n [`${layerNs[1]}.${PROPS.DATA}`]: namespace,\n [`${groupNs}.domain.x`]: `${unitColIndex}0`,\n [`${groupNs}.domain.y`]: `${unitRowIndex}0`,\n [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}`\n };\n }\n }],\n throwback: []\n };\n }\n\n static getQualifiedStateProps () {\n const layerState = BaseLayer.getState();\n return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`));\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { namespace } = this.metaInf();\n store.addSubNamespace(namespace, BaseLayer.formalName(), this);\n\n transactor(this, localOptions, store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}`\n });\n return this;\n }\n return this._store;\n }\n\n domain (...dom) {\n const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`;\n const store = this.store();\n if (dom.length) {\n const { parentNamespace, namespace } = this.metaInf();\n const domain = defaultValue(store.get(prop, parentNamespace), {});\n domain[namespace] = dom[0];\n this.store().commit(prop, domain, parentNamespace);\n return this;\n }\n return this.store().get(prop, this.metaInf().namespace);\n }\n\n /**\n * Creates a layer instance\n * @return {BaseLayer} Instance of a layer\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Default configuration of the layer. This configuration gets merged to the user passed configuration using a\n * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own\n * configuration.\n *\n * @public\n * @static\n *\n * @return {Object} Default configuration\n */\n static defaultConfig () {\n return {\n transform: {\n type: 'identity'\n }\n };\n }\n\n /**\n * Policy defines how user config gets merged to default config. The default policy here does a deep copy\n * operation.\n * Any policy which does more than deep copying should define the policy as a static member.\n *\n * @static\n * @public\n *\n * @param {LayerConfig} conf Configuration with which the user config will be merged\n * @param {LayerConfig} userConf Configuration given by the user\n *\n * @return {LayerConfig} Merged layer configuration\n */\n static defaultPolicy (conf, userConf) {\n return mergeRecursive(conf, userConf);\n }\n\n /**\n * Determines a name for a layer. This name of the layer is used in the input data to refer to this layer.\n * ```\n * .layers([\n * mark: 'bar',\n * encoding: { ... }\n * ])\n * ```\n *\n * @static\n * @public\n *\n * @return {string} name of layer\n */\n static formalName () {\n return 'base';\n }\n\n encodingFieldsInf (...fieldsInf) {\n if (fieldsInf.length) {\n this._encodingFieldsInf = fieldsInf[0];\n return this;\n }\n return this._encodingFieldsInf;\n }\n\n encodingTransform (...encodingTransform) {\n if (encodingTransform.length) {\n this._encodingTransform = encodingTransform[0];\n return this;\n }\n return this._encodingTransform;\n }\n\n /**\n * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among multiple\n * layers of same type if one layer has to be referred, alias is used. If no alias is given then `formalName` is set\n * as the alias name.\n *\n *\n * If used as setter\n * @param {string} alias Name of the alias\n * @return {BaseLayer} Instance of current base layer\n *\n * If used as getter\n * @return {string} Alias of the current layer\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n this._alias = params[0];\n return this;\n }\n return this._alias || this.constructor.formalName();\n }\n\n dependencies (...params) {\n if (params.length) {\n this._dependencies = params[0];\n return this;\n }\n return this._dependencies;\n }\n\n enableCaching () {\n this._cacheEnabled = true;\n return this;\n }\n\n clearCaching () {\n this._cacheEnabled = false;\n return this.data(this._cachedData[0]);\n }\n\n /**\n * Serialize the schema. Merge config is used for serialization.\n *\n * @public\n *\n * @return {LayerConfig} Serialized schema\n */\n serialize () {\n return this.config();\n }\n\n /**\n * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema.\n *\n * @public\n *\n * @return {string} id of the layer\n */\n id () {\n return this._id;\n }\n\n /**\n * Returns the transformed data based on given transform type.\n * It first gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of DataModel\n * @param {Object} config Configuration for transforming data\n * @return {Array.} Transformed data.\n */\n getTransformedData (dataModel, config, transformType, encodingFieldsInf) {\n return transformData(dataModel, config, transformType, encodingFieldsInf);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a categorical field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @param {Object} fieldsConfig Configuration of fields\n * @return {Array} Domain values array.\n */\n calculateDomainFromData (data) {\n let domains = {};\n const isEmpty = this.data().isEmpty();\n\n if (!isEmpty) {\n domains = domainCalculator[this.coord()](data, this);\n }\n return domains;\n }\n\n static shouldDrawAnchors () {\n return false;\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getDataDomain (encodingType) {\n const { parentNamespace, namespace } = this.metaInf();\n const domains = getObjProp(this.store()\n .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace);\n return encodingType !== undefined ? domains[encodingType] || [] : domains;\n }\n\n /**\n * Normalizes the transformed data and returns it.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getNormalizedData (transformedData) {\n return getNormalizedData(transformedData, this);\n }\n\n /**\n * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns\n * null.\n *\n * @public\n *\n * @param {number} x X Coordinate.\n * @param {number} y Y Coordinate.\n *\n * @return {Object} Information of the nearest point.\n * ```\n * {\n * // id property contains the field names and their corresponding values in a 2d array. This is the data\n * // associated with the nearest point.\n * id: // Example data: [['Origin'], ['USA']],\n * dimensions: // Physical dimensions of the point.\n * layerId: // Id of the layer instance.\n * }\n * ```\n */\n getNearestPoint () {\n return null;\n }\n\n applyInteractionStyle (interactionType, selectionSet, apply, styles) {\n const interactionConfig = this.config().interaction || {};\n\n let interactionStyles = interactionConfig[interactionType];\n interactionStyles = styles || interactionStyles;\n if (interactionStyles) {\n applyInteractionStyle(this, selectionSet, interactionStyles, {\n apply,\n interactionType\n });\n }\n }\n\n disableUpdate () {\n this._updateLock = true;\n return this;\n }\n\n enableUpdate () {\n this._updateLock = false;\n return this;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransform(this);\n }\n\n transformType () {\n return this._transformType;\n }\n\n /**\n * Renders the layer\n * @return {BaseLayer} Instance of the layer.\n */\n render () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof BaseLayer\n */\n elemType () {\n return 'g';\n }\n\n /**\n * Disposes the entire layer.\n *\n * @return {BaseLayer} Instance of layer.\n */\n remove () {\n const { namespace, parentNamespace } = this.metaInf();\n const store = this.store();\n store.removeSubNamespace(namespace, BaseLayer.formalName());\n const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`);\n const unitDom = layersDomain[parentNamespace];\n unitDom && (delete unitDom[namespace]);\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n * Stores point in an object with key as the categorical value or temporal value\n *\n * @param {string} key categorical value or temporal value\n * @param {Object} data Information of the data point\n * @return {BarLayer} Instance of bar layer\n */\n cachePoint (key, data) {\n if (key === null) {\n return this;\n }\n const pointMap = this._pointMap;\n !pointMap[key] && (pointMap[key] = []);\n pointMap[key].push(data);\n return this;\n }\n\n /**\n *\n *\n * @param {*} dataProps\n *\n * @memberof BaseLayer\n */\n dataProps (...dataProps) {\n if (dataProps.length) {\n this._dataProps = dataProps[0];\n return this;\n }\n return this._dataProps;\n }\n\n /**\n *\n *\n * @param {*} data\n * @param {*} id\n *\n * @memberof BaseLayer\n */\n getIdentifiersFromData (data) {\n const schema = this.data().getSchema();\n const fieldsConfig = this.data().getFieldsConfig();\n const identifiers = [[], []];\n const {\n xFieldType,\n yFieldType,\n xField,\n yField\n } = this.encodingFieldsInf();\n\n const [xMeasure, yMeasure] = [xFieldType, yFieldType].map(type => type === FieldType.MEASURE);\n schema.forEach((d, i) => {\n const name = d.name;\n if (fieldsConfig[name].def.type === FieldType.DIMENSION) {\n identifiers[0].push(name);\n identifiers[1].push(data[i]);\n }\n });\n\n if (xMeasure && yMeasure) {\n const xMeasureIndex = fieldsConfig[xField].index;\n const yMeasureIndex = fieldsConfig[yField].index;\n identifiers[0].push(...[xField, yField]);\n identifiers[1].push(...[data[xMeasureIndex], data[yMeasureIndex]]);\n }\n return identifiers;\n }\n\n hasPlotSpan () {\n return false;\n }\n\n getPlotSpan () {\n return {\n x: 0,\n y: 0\n };\n }\n\n getPlotPadding () {\n return {\n x: 0,\n y: 0\n };\n }\n\n /**\n * Returns the information of the marks corresponding to the supplied identifiers. Identifiers are a set of field\n * names and their corresponding values in an array. It can also be an instance of datamodel.\n *\n * For example,\n * ```\n * const identifiers = [\n * ['Origin', 'Cylinders'],\n * ['USA', '8']\n * ];\n * const points = barLayer.getPointsFromIdentifiers(identifiers);\n * ```\n * @public\n * @param {Array|DataModel} identifiers Identifiers of the marks.\n * @param {Object} config Optional configuration which describes how to get the information.\n * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only\n * the positions of the points.\n * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks.\n *\n * @return {Array} Array of points contains\n */\n getPointsFromIdentifiers (identifiers, config = {}) {\n const getAllAttrs = config.getAllAttrs;\n const getBBox = config.getBBox;\n if (!this.data()) {\n return [];\n }\n let fieldNames;\n let values;\n if (identifiers instanceof DataModel) {\n const dataObj = identifiers.getData();\n fieldNames = dataObj.schema.map(d => d.name);\n values = dataObj.data;\n } else {\n fieldNames = identifiers[0];\n values = identifiers.slice(1, identifiers.length);\n }\n\n const points = this._points;\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPoints = [].concat(...points).filter((point) => {\n const { source, rowId } = point;\n\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n return getAllAttrs ? filteredPoints : filteredPoints.map((d) => {\n const obj = clone(d);\n if (getBBox) {\n const update = obj.update || obj;\n if (obj.size !== undefined) {\n const sizeVal = Math.sqrt(obj.size / Math.PI) * 2;\n update.width = sizeVal;\n update.height = sizeVal;\n update.x -= sizeVal / 2;\n update.y -= sizeVal / 2;\n } else {\n if (update.width === undefined) {\n update.width = 2;\n }\n if (update.height === undefined) {\n update.height = 2;\n }\n }\n }\n\n return obj.update || obj;\n }).sort((a, b) => a.y - b.y);\n }\n\n getTransformedDataFromIdentifiers (identifiers) {\n const { data: identifierData, schema: identifierSchema } = identifiers.getData();\n const normalizedData = this._normalizedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const {\n yField,\n xField,\n yFieldType,\n xFieldType\n } = this.encodingFieldsInf();\n let measureIndex;\n let enc;\n if (xFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[xField].index;\n enc = 'x';\n } else if (yFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[yField].index;\n enc = 'y';\n }\n\n const transformedData = [];\n normalizedData.forEach((dataArr) => {\n dataArr.forEach((dataObj) => {\n const tupleArr = dataObj.source;\n const exist = identifierSchema.every((obj, i) =>\n identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1);\n if (exist) {\n const transformedVal = dataObj[enc];\n const row = dataObj.source;\n const tuple = {};\n for (const key in fieldsConfig) {\n const index = fieldsConfig[key].index;\n tuple[key] = row[index];\n if (index === measureIndex) {\n tuple[key] = transformedVal;\n }\n }\n transformedData.push(tuple);\n }\n });\n });\n\n return [transformedData, this.data().getSchema()];\n }\n\n /**\n * Returns the dom elements associated with the supplied set of row ids.\n * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids, it returns all\n * the elements which is mapped with those row ids.\n *\n * @public\n * @param {Array} set Array of row ids\n *\n * @return {Selection} D3 Selection of dom elements.\n */\n getPlotElementsFromSet (set) {\n const graphicElems = this._graphicElems;\n const elems = [];\n for (let i = 0, len = set.length; i < len; i++) {\n const elem = graphicElems[set[i]];\n if (elem) {\n elems.push(elem);\n }\n }\n return elems;\n }\n\n /**\n * Notifies when all animations/transitions of the layer are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n getRenderProps () {\n if (this.coord() === COORD_TYPES.POLAR) {\n return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.radius`];\n }\n const { unitRowIndex: rowIndex, unitColIndex: colIndex } = this.metaInf();\n return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.y.${rowIndex}0`,\n `${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.x.${colIndex}0`];\n }\n}\n","import {\n selectElement,\n makeElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\nimport { updateStyle } from '../../helpers';\n\nconst line = Symbols.line;\n\nconst filterFn = (d) => {\n const { update } = d;\n return update.y !== null && update.x !== null;\n};\n\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nexport const drawLine = (context) => {\n let filteredPoints;\n const { layer, container, points, interpolate, connectNullData, className, style, transition } = context;\n const mount = selectElement(container).attr('class', className);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(d => d.update.x)\n .y(d => d.update.y)\n .defined(filterFn);\n\n filteredPoints = points;\n if (connectNullData) {\n filteredPoints = points.filter(filterFn);\n }\n\n updateStyle(mount, style);\n let element = makeElement(mount, 'path', points.length ? [points[0].className] : []);\n element.attr('class', d => d);\n if (!transition.disabled) {\n element = element.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n element.attr('d', linepath(filteredPoints))\n .style('fill-opacity', 0);\n return element;\n};\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-line',\n className: '',\n interpolate: 'linear',\n transform: {\n type: 'group'\n },\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'stroke',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'stroke',\n intensity: [0, 0, +15, 0]\n }]\n },\n nearestPointThreshold: 20,\n encoding: {\n color: {},\n x: {},\n y: {},\n strokeOpacity: {\n value: 1\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n\n","import {\n Voronoi,\n getQualifiedClassName,\n selectElement,\n makeElement,\n FieldType,\n InvalidAwareTypes,\n getObjProp\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawLine } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n animateGroup,\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\nimport './styles.scss';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport default class LineLayer extends BaseLayer {\n\n /**\n * Creates an instance of LineLayer.\n * @param {*} args\n * @memberof LineLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n }\n\n static formalName () {\n return 'line';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Default configuration of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField && !transform.groupBy) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n * Returns the draw method for line\n * @return {Function} Draw method of line layer\n */\n getDrawFn () {\n return drawLine;\n }\n\n static shouldDrawAnchors () {\n return true;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @param {number} seriesIndex index of series\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const axes = this.axes();\n const xAxis = axes.x;\n const yAxis = axes.y;\n const colorAxis = axes.color;\n const { xFieldType, yFieldType } = this.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n sortData(data, axes);\n points = data.map((d, i) => {\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2;\n const color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color\n },\n data: d\n }, i, data, this);\n\n const point = {\n enter: {},\n update: {\n x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x,\n y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y\n },\n style: {\n stroke: resolvedEncodings.color,\n 'fill-opacity': 0\n },\n rowId: d.rowId,\n source: d.source,\n meta: getColorMetaInf({\n stroke: resolvedEncodings.color\n }, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n\n points = points.filter((point) => {\n const { update } = point;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n /**\n * Renders the line plot\n * @param {SVGElement} container svg element\n * @return {LineLayer} instance of line layer\n */\n render (container) {\n let points;\n let seriesClassName;\n let style;\n\n const config = this.config();\n const {\n encoding,\n interpolate,\n className,\n defClassName,\n transition\n } = config;\n const normalizedData = this._normalizedData;\n const transformedData = this._transformedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const keys = transformedData.map(d => d.key);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n const colorField = encoding.color.field;\n const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index;\n\n this._points = [];\n this._pointMap = {};\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n makeElement(container, 'g', normalizedData, null, {\n enter: (group) => {\n animateGroup(group, {\n transition,\n groupAnimateStyle: {\n enter: {\n 'stroke-opacity': 0,\n 'fill-opacity': this.getPathStyle()['fill-opacity']\n },\n update: {\n 'stroke-opacity': encoding.strokeOpacity.value\n }\n }\n });\n },\n update: (group, dataArr, i) => {\n points = this.translatePoints(dataArr);\n this._points.push(points);\n seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n\n let color;\n const colorValFn = encoding.color.value;\n const colorVal = points.find(d => d.source[colorFieldIndex] !== null &&\n d.source[colorFieldIndex] !== undefined);\n\n if (colorValFn) {\n color = colorValFn(dataArr, i, normalizedData);\n } else {\n color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]);\n }\n\n style = this.getPathStyle(color);\n this.getDrawFn()({\n layer: this,\n container: group.node(),\n interpolate,\n points,\n className: seriesClassName,\n transition,\n style: style || {},\n connectNullData: config.connectNullData\n });\n }\n }, d => d[0].source[colorFieldIndex] || d[0].rowId);\n\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n stroke: color,\n 'fill-opacity': '0'\n };\n }\n\n /**\n * Gets the nearest point closest to the given position\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point information\n */\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n const point = this._voronoi.find(x, y, searchRadius);\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n}\n","import {\n easeFns,\n selectElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\n\nconst area = Symbols.area;\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nconst /* istanbul ignore next */ drawArea = (params) => {\n let filteredPoints;\n const { layer, container, points, style, transition, className, connectNullData, interpolate } = params;\n\n const { effect: easeEffect, duration } = transition;\n const mount = selectElement(container);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const selection = mount.selectAll('path').data(points.length ? [points[0].className] : []);\n const [enterAreaPath, updateAreaPath] = ['enter', 'update'].map(e => area().curve(curveInterpolatorFn)\n .x(d => d[e].x)\n .y1(d => d[e].y)\n .y0(d => d[e].y0)\n .defined(d => d[e].y !== null\n ));\n\n filteredPoints = points;\n mount.attr('class', className);\n if (connectNullData) {\n filteredPoints = points.filter(d => d.update.y !== null);\n }\n const selectionEnter = selection.enter().append('path').attr('d', enterAreaPath(filteredPoints));\n selection.merge(selectionEnter).transition().ease(easeFns[easeEffect])\n .duration(duration)\n .on('end', layer.registerAnimationDoneHook())\n .attr('d', updateAreaPath(filteredPoints))\n .each(function (d) {\n const element = selectElement(this);\n element.attr('class', d);\n Object.keys(style).forEach(key => element.style(key, style[key]));\n });\n};\n\nexport default drawArea;\n","import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { LineLayer } from '../line';\nimport drawArea from './renderer';\nimport './styles.scss';\nimport { STACK, ENCODING } from '../../enums/constants';\nimport {\n getAxesScales,\n positionPoints,\n getIndividualClassName,\n getValidTransformForAggFn,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport default class AreaLayer extends LineLayer {\n /** oation of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof AreaLayer\n */\n static formalName () {\n return 'area';\n }\n\n /**\n * Calculates the domain from data. It calls its parent class's method which is line layer\n * to get the domain and overwrites the domain according to its need.\n * @return {Array} Domain values\n */\n calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) {\n const domains = super.calculateDomainFromData(data, fieldsConfig);\n [ENCODING.X, ENCODING.Y].forEach((type) => {\n const { [`${type}FieldType`]: fieldType } = encodingFieldsInf;\n if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) {\n domains[type][0] = Math.min(domains[type][0], 0);\n domains[type][1] = Math.max(0, domains[type][1]);\n }\n });\n return domains;\n }\n\n /**\n * Returns the drawing method of this layer\n * @return {Function} Draw method\n */\n getDrawFn () {\n return drawArea;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const transformType = this.transformType();\n const axes = this.axes();\n const colorAxis = axes.color;\n const config = this.config();\n const fieldsConfig = this.data().getFieldsConfig();\n const { xField, yField, y0Field } = this.encodingFieldsInf();\n const {\n xAxis,\n yAxis\n } = getAxesScales(axes);\n const classNameFn = config.individualClassName;\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const minYVal = yAxis.domain()[0];\n const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal);\n sortData(data, axes);\n points = data.map((d, i) => {\n let color;\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y);\n const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos;\n color = colorAxis.getColor(d.color);\n const invalidY = d.y instanceof InvalidAwareTypes;\n const invalidY0 = d.y0 instanceof InvalidAwareTypes;\n const resolvedValues = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, this);\n color = resolvedValues.color;\n const style = {\n fill: color\n };\n\n const point = {\n enter: {\n x: xPx,\n y: invalidY ? null : basePos,\n y0: invalidY0 ? null : basePos\n },\n update: {\n x: xPx,\n y: invalidY ? null : resolvedValues.y,\n y0: invalidY0 ? null : resolvedValues.y0\n },\n source: d.source,\n rowId: d.rowId,\n className: classNameFn ? classNameFn(d, i, data, this) : '',\n style,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n points = points.filter((point) => {\n const update = point.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n fill: color\n };\n }\n}\n\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-arc',\n padding: { top: 1, bottom: 1, left: 1, right: 1 },\n className: '',\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n height: 100,\n width: 100,\n sort: '',\n colors: ['#F44336', 'blue', 'green', 'yellow', 'orange', 'purple'],\n transform: {\n type: 'identity'\n },\n encoding: {\n 'stroke-width': {\n value: '2px'\n },\n 'stroke-linejoin': {\n value: 'round'\n },\n angle: {\n value: '1'\n },\n radius: {\n value: '1'\n },\n opacity: {\n value: '1'\n },\n color: {\n value: '1'\n },\n shape: {\n value: '1'\n },\n size: {\n value: '1'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 500\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-arc-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-arc-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-arc-selected`\n }\n }\n};\n\n","import {\n makeElement,\n selectElement,\n getQualifiedClassName,\n isSimpleObject,\n Symbols,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { BaseLayer } from '../../base-layer';\nimport { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers';\nimport { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper';\nimport './styles.scss';\n\nconst arc = Symbols.arc;\n\n/**\n * Arc Layer creates a plot with polar coordinates.\n *\n * @public\n *\n * @class\n * @module ArcLayer\n * @extends BaseLayer\n */\nexport default class ArcLayer extends BaseLayer {\n\n constructor (data, axes, config, dependencies) {\n super(data, axes, config, dependencies);\n this._prevPieData = {};\n }\n\n /**\n * returns the default configuration of the layer\n *\n * @static\n * @return {Object} Default configuration for arc layer\n * @memberof ArcLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'arc';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n *\n *\n * @param {Object} x\n * @param {Object} y\n * @return {}\n * @memberof ArcLayer\n */\n getNearestPoint (x, y, config = {}) {\n const dataPoint = selectElement(config.event.target).data()[0];\n if (isSimpleObject(dataPoint)) {\n const { source, rowId } = dataPoint;\n return {\n id: this.getIdentifiersFromData(source, rowId),\n layerId: this.id()\n };\n }\n return null;\n }\n\n translatePoints (data) {\n const { angle, color: colorAxis, radius: radiusAxis } = this.axes();\n const pieIndex = {};\n const prevData = this._points[0] || [];\n const points = [];\n const angleV = {};\n\n this._prevPieData = {};\n prevData.forEach((e, index) => {\n this._prevPieData[e.rowId] = [e, index];\n pieIndex[e.index] = e;\n });\n data.forEach((d, i) => {\n const angles = angle.getScaleValue(d.angle);\n if (angles) {\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const uid = d.rowId;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n radius: radiusAxis.getOuterRadius(d.radius),\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color: colorAxis.getColor(d.color),\n angle0: startAngle,\n angle: endAngle,\n startAngle,\n endAngle,\n startAngle0: startAngle,\n endAngle0: endAngle\n },\n data: d\n }, i, data, this);\n const color = resolvedEncodings.color;\n points.push({\n source: d.source,\n index: i,\n enter: {},\n update: {\n angle0: resolvedEncodings.angle0,\n angle: resolvedEncodings.angle,\n radius0: resolvedEncodings.radius0,\n radius: resolvedEncodings.radius\n },\n color,\n meta: getColorMetaInf({\n fill: color\n }, colorAxis),\n rowId: uid,\n _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] :\n getPreviousPoint(pieIndex, i, this)\n });\n }\n });\n return points;\n }\n\n /**\n *\n *\n * @param {Object} container\n * @return {}\n * @memberof ArcLayer\n */\n render (container) {\n const measurement = this.measurement();\n const {\n classPrefix,\n defClassName,\n cornerRadius,\n padAngle,\n padRadius,\n transition\n } = this.config();\n const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n // This returns a function that generates the arc path based on the datum provided\n const path = this._arcFn = arc()\n .cornerRadius(cornerRadius)\n .startAngle(d => d.update.angle0 + Math.PI / 2)\n .endAngle(d => d.update.angle + Math.PI / 2)\n .padAngle(padAngle)\n .padRadius(padRadius)\n .outerRadius(d => d.update.radius)\n .innerRadius(d => d.update.radius0);\n\n this._points = this._normalizedData.map(arr => this.translatePoints(arr));\n const graphicElems = this._graphicElems = {};\n // Creating the group that holds all the arcs\n const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`)\n .classed(`${qualClassName[1]}-group`, true)\n .attr('transform', `translate(${measurement.width / 2},\n ${measurement.height / 2})`);\n const tween = (elem) => {\n makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`)\n .style('fill', d => d.color)\n .each(function (d) {\n graphicElems[d.rowId] = selectElement(this);\n })\n .transition()\n .duration(transition.duration)\n .on('end', this.registerAnimationDoneHook())\n .attrTween('d', (...params) => tweenPie(path, params))\n .attr('class', (d, i) => {\n const individualClass = getIndividualClassName(d, i, this._points, this);\n return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index}\n ${individualClass}`;\n });\n };\n const consecutiveExits = [];\n let exitCounter = 0;\n const tweenExit = (elem, d) => {\n let exitArr = consecutiveExits[exitCounter];\n const oldExitCounter = exitCounter;\n if (!exitArr) {\n exitArr = [{ elem, datum: d }];\n } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) {\n exitArr.push({ elem, datum: d });\n } else {\n exitCounter++;\n }\n consecutiveExits[oldExitCounter] = exitArr;\n };\n // Creating groups for all the arcs present individually\n makeElement(g, 'g', d => d, `${qualClassName[0]}`,\n {\n update: tween,\n exit: tweenExit\n })\n .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`);\n tweenExitPie(consecutiveExits, transition, path);\n return this;\n }\n\n getPointsFromIdentifiers (identifiers) {\n if (!this.data()) {\n return [];\n }\n const fieldNames = identifiers[0];\n const values = identifiers.slice(1, identifiers.length);\n const pieSlices = selectElement(this.mount()).selectAll('path').data();\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPies = pieSlices.filter((tData) => {\n const { source, rowId } = tData;\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n\n const pieSliceInf = filteredPies[0];\n if (pieSliceInf) {\n const measurement = this.measurement();\n const centroid = this._arcFn.centroid(pieSliceInf);\n return [{\n x: centroid[0] + measurement.width / 2,\n y: centroid[1] + measurement.height / 2,\n width: 2,\n height: 2\n }];\n }\n return [];\n }\n}\n","import { getObjProp, interpolator, FieldType, selectElement } from 'muze-utils';\nimport { ANGLE, RADIUS, SIZE, COLOR } from '../../enums/constants';\n\nexport const getPreviousPoint = (prevData, currIndex, context) => {\n const prevArc = prevData[currIndex - 1];\n const nextArc = prevData[currIndex];\n const [startAngle, endAngle] = context.axes().angle.range();\n if (prevArc && nextArc) {\n return {\n update: {\n angle0: getObjProp(prevArc, 'update', 'angle'),\n angle: getObjProp(nextArc, 'update', 'angle0')\n }\n };\n } else if (!nextArc) {\n return {\n update: {\n angle0: (endAngle - 90) * Math.PI * 2 / 360,\n angle: (endAngle - 90) * Math.PI * 2 / 360\n }\n };\n }\n return {\n update: {\n angle0: (startAngle - 90) * Math.PI * 2 / 360,\n angle: (startAngle - 90) * Math.PI * 2 / 360\n }\n };\n};\n\nexport const tweenPie = (path, b) => {\n const datum = b[0];\n return function (t) {\n return path(interpolator()(datum._previousInfo, datum)(t));\n };\n};\n\nexport const tweenExitPie = (consecutiveExits, transition, path) => {\n if (consecutiveExits.length > 0) {\n consecutiveExits.forEach((consecutiveExitArr) => {\n const startAngle = consecutiveExitArr[0].datum.update.angle0;\n const endAngle = consecutiveExitArr[consecutiveExitArr.length - 1].datum.update.angle;\n const mid = (Math.PI * 2 * startAngle) / ((Math.PI * 2) + startAngle - endAngle);\n\n consecutiveExitArr.forEach((e) => {\n const { elem, datum } = e;\n\n elem.each(function () {\n const gElem = selectElement(this);\n gElem.selectAll('path')\n .transition()\n .duration(transition.duration)\n .attrTween('d', () => function (t) {\n return path(interpolator()(datum, {\n update: {\n angle0: mid,\n angle: mid,\n radius: datum.radius,\n radius0: datum.radius0\n }\n })(t));\n })\n .remove();\n gElem.remove();\n });\n });\n });\n }\n};\n\nexport const getFieldIndices = (encoding, fieldsConfig) => {\n const [angleField, radiusField, colorField, sizeField] = [ANGLE, RADIUS, COLOR, SIZE]\n .map(e => encoding[e].field);\n const [angleIndex, sizeIndex, radiusIndex] = [angleField, sizeField, radiusField]\n .map((e) => {\n const conf = fieldsConfig[e];\n if (conf && conf.def.type === FieldType.MEASURE) {\n return conf.index;\n }\n return null;\n });\n const colorIndex = getObjProp(fieldsConfig, colorField, 'index');\n return {\n angleIndex,\n sizeIndex,\n radiusIndex,\n colorIndex\n };\n};\n","import {\n setAttrs,\n setStyles,\n selectElement,\n makeElement,\n getSmartComputedStyle\n} from 'muze-utils';\n\n/**\n * Draws svg text in the specified container.\n * @param {SVGElement} container Container where labels will be appended.\n * @param {Array.} data Data of the elements.\n * @return {Selection} d3 selection of the elements.\n */\nconst drawText = (container, data, config, layerInst) => {\n const selection = selectElement(container).selectAll('g').data(data);\n const { smartLabel } = layerInst._dependencies;\n const graphicElems = layerInst._graphicElems;\n\n const selectionMerge = selection.enter().append('g')\n .each(function (dataObj) {\n setAttrs(this, dataObj.enter);\n })\n .merge(selection);\n const style = getSmartComputedStyle(selectElement(container), config.className);\n const fontSize = parseInt(style.fontSize, 10);\n\n smartLabel.setStyle(style);\n selectionMerge.each(function (dataObj) {\n const element = selectElement(this);\n graphicElems[dataObj.rowId] = element;\n const { update, text, color, textanchor, style: textStyle } = dataObj;\n const background = dataObj.background;\n let backgroundVal;\n if (backgroundVal = background.value) {\n const backgroundPadding = background.padding;\n let diff;\n const { width, height } = smartLabel.getOriSize(dataObj.text);\n const backgroundEl = makeElement(element, 'rect', [1]);\n\n if (textanchor === 'end') {\n diff = width;\n } else if (textanchor === 'start') {\n diff = 0;\n } else {\n diff = width / 2;\n }\n\n setAttrs(backgroundEl.node(), {\n x: update.x - diff - backgroundPadding / 2,\n y: update.y - fontSize - backgroundPadding / 2,\n width: width + backgroundPadding,\n height: height + backgroundPadding\n });\n background && setStyles(backgroundEl, {\n background: backgroundVal\n });\n }\n const textEl = makeElement(element, 'text', d => [d]).text(text);\n const textNode = textEl.node();\n textStyle && setStyles(textNode, textStyle);\n color && setStyles(textNode, {\n fill: color\n });\n dataObj.className && textEl.classed(dataObj.className, true);\n setAttrs(textNode, update);\n textEl.attr('text-anchor', textanchor);\n textEl.attr('alignment-baseline', dataObj['alignment-baseline']);\n textEl.attr('transform', `rotate(${dataObj.rotation} ${update.x} ${update.y})`);\n });\n selection.exit().remove();\n return selection;\n};\n\nexport default drawText;\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-text',\n classPrefix: CLASSPREFIX,\n className: '',\n transform: {\n type: 'identity'\n },\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n color: {},\n size: {},\n radius: {},\n angle: {},\n text: {\n value: '',\n formatter: (val, i, data, context) => {\n const valueParser = context.valueParser();\n return valueParser(val);\n },\n background: {\n padding: 10\n }\n },\n rotation: {\n value: 0\n },\n 'alignment-baseline': {\n value: 'middle'\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-text-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-text-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-text-selected`\n }\n }\n};\n","import {\n getQualifiedClassName,\n selectElement,\n setStyles,\n createElements\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport drawText from './renderer';\nimport { defaultConfig } from './default-config';\nimport { positionPoints, getIndividualClassName, resolveEncodingValues, getColorMetaInf, toCartesianCoordinates }\n from '../../helpers';\nimport { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants';\n\nimport './styles.scss';\n\nconst defaultEncoding = defaultConfig.encoding;\nconst alignmentBaseLine = defaultEncoding['alignment-baseline'].value;\nconst defRotation = defaultEncoding.rotation.value;\n\nconst pointTranslators = {\n polar: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes;\n const { formatter: textFormatter } = textEncoding;\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const angleV = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const source = d.source;\n const text = d.text;\n\n const color = colorAxis.getColor(d.color);\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n\n const angle = (startAngle + endAngle) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n angle,\n radius,\n color,\n text,\n startAngle,\n endAngle,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n angle: resolvedVal.angle,\n radius: resolvedVal.radius\n },\n text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text,\n color: resolvedVal.color,\n rotation: resolvedVal.rotation,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedVal['alignment-baseline'],\n meta: getColorMetaInf({\n fill: resolvedVal.color\n }, colorAxis),\n style: {},\n source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement());\n\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n },\n cartesian: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const colorAxis = axes.color;\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { field: textField, value, formatter: textFormatter } = textEncoding;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1;\n const xEnc = ENCODING.X;\n const yEnc = ENCODING.Y;\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const row = d.source;\n const textValue = textField ? row[textFieldIndex] : value;\n\n const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) +\n axes[type].getUnitWidth() / 2 : 0));\n\n const color = colorAxis.getColor(d.color, colorAxis);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n text: textValue,\n color,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n },\n text: textFormatter(resolvedEncodings.text, i, data, layerInst),\n color: resolvedEncodings.color,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedEncodings['alignment-baseline'],\n rotation: resolvedEncodings.rotation,\n meta: getColorMetaInf({\n fill: resolvedEncodings.color\n }, colorAxis),\n style: {},\n source: d.source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = positionPoints(layerInst, points);\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n};\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport default class TextLayer extends BaseLayer {\n /**\n * Returns the default configuration of the text layer\n * @return {Object} Default configuration of the text layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'text';\n }\n\n elemType () {\n return 'text';\n }\n\n getPointTranslator (val) {\n return pointTranslators[val];\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {textLayer} Instance of text layer\n */\n render (container) {\n const config = this.config();\n const normalizedData = this._normalizedData;\n const className = config.className;\n const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n\n containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true);\n this._graphicElems = {};\n\n createElements({\n data: normalizedData,\n append: 'g',\n selector: 'g',\n container,\n each: (dataArr, group) => {\n const node = group.node();\n const points = this.translatePoints(dataArr, {}, this);\n setStyles(node, {\n 'text-anchor': TEXT_ANCHOR_MIDDLE\n });\n drawText(node, points, {\n className: qualifiedClassName[0]\n }, this);\n }\n });\n return this;\n }\n}\n","/* global Element, document */\nimport {\n makeElement,\n selectElement,\n easeFns,\n objectIterator,\n getSymbol\n} from 'muze-utils';\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, groupElement) {\n const { shape, size, update } = d;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n createShape(d, groupElement);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n if (newShape.nodeName === 'path' || newShape.nodeName === 'image') {\n shapeElement.attr('transform', `scale(${size / 100})`);\n } else {\n shapeElement.attr('height', size);\n shapeElement.attr('width', size);\n }\n shapeElement.attr('x', -size / 2);\n shapeElement.attr('y', -size / 2);\n makeElement(groupElement, () => newShape, [1]);\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = getSymbol(shape).size(size)(update);\n }\n makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n } else {\n d.shape = 'circle';\n createShape(d, groupElement);\n }\n};\n\n/**\n * Draws symbols using d3 symbol api\n * @param {Object} params Contains the svg container, points and other symbol related attributes.\n */\n/* istanbul ignore next */ const drawSymbols = (params) => {\n const { layer, container, points, transition, className } = params;\n const { duration, effect, disabled } = transition;\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const { enter } = d;\n group.attr('transform', `translate(${enter.x},${enter.y})`);\n },\n update: (group, d) => {\n createShape(d, group);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n objectIterator(style, key => group.style(key, style[key]));\n group.attr('class', className);\n group.classed(d.className, true);\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n group.attr('transform', `translate(${update.x},${update.y})`);\n },\n exit: (exitGroup) => {\n if (!disabled) {\n exitGroup.transition().ease(easeFns[effect])\n .duration(duration)\n .on('end', () => exitGroup.remove())\n .style('fill-opacity', 0)\n .style('stroke-opacity', 0);\n } else {\n exitGroup.remove();\n }\n }\n }, params.keyFn);\n};\n\nexport default drawSymbols;\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-point',\n className: '',\n classPrefix: CLASSPREFIX,\n defColorStyle: 'stroke',\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, 0, +1]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +20, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +20, 0]\n }\n ]\n },\n innerPadding: 0.1,\n nearestPointThreshold: 10,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n size: {\n value: 30\n },\n color: {},\n stroke: {\n value: 'hsla(0,0%,0%,0)'\n },\n fill: {},\n shape: {\n value: 'circle'\n },\n x: {},\n y: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n shapes: ['circle', 'cross', 'diamond', 'square', 'star', 'wye', 'triangle'],\n sizes: [20, 30, 40, 50, 60, 70]\n};\n","import {\n Voronoi,\n selectElement,\n getQualifiedClassName,\n makeElement,\n FieldType,\n Scales\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport drawSymbols from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n positionPoints,\n getPlotMeasurement,\n getIndividualClassName,\n getMarkId,\n getColorMetaInf,\n resolveEncodingValues\n} from '../../helpers';\n\nimport './styles.scss';\n\n/**\n * This layer is used to create various symbols for each data point. This is commonly used in\n * scatterplot visualizations. The mark type of this layer is ```point```.\n *\n * @public\n *\n * @class\n * @module PointLayer\n * @extends BaseLayer\n */\nexport default class PointLayer extends BaseLayer {\n\n /**\n * Creates an instance of PointLayer.\n * @param {*} args\n * @memberof PointLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n this._bandScale = Scales.band();\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Returns the default configuration of the point layer\n * @return {Object} Default configuration of the point layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n static formalName () {\n return 'point';\n }\n\n static drawFn () {\n return drawSymbols;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n let points = [];\n const encoding = this.config().encoding;\n const axes = this.axes();\n const {\n x,\n y\n } = encoding;\n const xField = x.field;\n const yField = y.field;\n const { size: sizeAxis, shape: shapeAxis } = axes;\n const fieldsConfig = this.data().getFieldsConfig();\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = this.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const stroke = encoding.stroke.value;\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const size = sizeAxis.getSize(d.size);\n const shape = shapeAxis.getShape(d.shape);\n\n let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => {\n const value = d[type] === null ? undefined : d[type];\n const measure = type === ENCODING.X ? measurement.width : measurement.height;\n return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value);\n });\n\n xPx += offsetX;\n yPx += offsetY;\n\n let color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color,\n shape,\n size,\n data: d\n },\n data: d\n }, i, data, this);\n color = resolvedEncodings.color;\n\n const style = {\n fill: color,\n stroke\n };\n const pos = {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: pos,\n update: pos,\n shape: resolvedEncodings.shape,\n size: Math.abs(resolvedEncodings.size),\n meta: getColorMetaInf(style, colorAxis),\n style,\n source: d.source,\n rowId: d.rowId\n };\n point.className = getIndividualClassName(d, i, data, this);\n points.push(point);\n this.cachePoint(d[key], point);\n }\n }\n points = positionPoints(this, points);\n return points;\n }\n\n /**\n * Renders the plot in the given container.\n *\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {BarLayer} Instance of bar layer\n */\n render (container) {\n let maxSize = 0;\n let seriesClassName;\n const config = this.config();\n const keys = this._transformedData.map(d => d.key);\n const { transition, className, defClassName, classPrefix } = config;\n const normalizedData = this._normalizedData;\n const containerSelection = selectElement(container);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n this._points = [];\n this._pointMap = {};\n\n containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true);\n\n this._points = this.generateDataPoints(normalizedData, keys);\n this._graphicElems = {};\n\n const schema = this.data().getSchema();\n makeElement(container, 'g', this._points, null, {\n update: (group, points) => {\n maxSize = Math.max(maxSize, ...points.map(d => d.size));\n seriesClassName = `${qualifiedClassName[0]}`;\n this.constructor.drawFn()({\n layer: this,\n container: group.node(),\n points,\n interpolate: config.interpolate,\n className: seriesClassName,\n transition,\n keyFn: v => getMarkId(v.source, schema)\n });\n }\n }, data => data[0].rowId);\n this._maxSize = Math.sqrt(maxSize / Math.PI) * 2;\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n generateDataPoints (normalizedData, keys) {\n const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys);\n const offsetXValues = widthMetrics.offsetValues || [];\n const offsetYValues = heightMetrics.offsetValues || [];\n return normalizedData.map((dataArr, i) => {\n const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span,\n heightMetrics.span);\n return this.translatePoints(dataArr, measurementConf);\n }).filter(d => d.length);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0) + widthSpan / 2,\n y: (offsetY || 0) + heightSpan / 2\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n /**\n * Gets the nearest point from a position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Point details\n */\n getNearestPoint (x, y) {\n const distanceLimit = Math.max(this._maxSize, this.config().nearestPointThreshold);\n\n if (!this.data()) {\n return null;\n }\n\n const point = this._voronoi.find(x, y, distanceLimit);\n const dimensions = point && point.data.data.update;\n const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0;\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: radius,\n height: radius\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n}\n","import { makeElement, easeFns } from 'muze-utils';\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} datum\n * @param {*} index\n * @param {*} context\n */\nconst transitionBars = (layer, elem, datum, index, context) => {\n const { transition } = context;\n const { duration, disabled, effect } = transition;\n const selection = elem;\n\n const selTransition = disabled ? selection :\n selection.transition()\n .duration(duration)\n .ease(easeFns[effect])\n .on('end', layer.registerAnimationDoneHook());\n const update = datum.update || datum;\n const updateStyle = datum.style || {};\n datum.className && selection.classed(datum.className, true);\n Object.entries(update).forEach(attr => (!isNaN(attr[1]) && selTransition.attr(attr[0], attr[1])));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n};\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} d\n */\nconst barEnterFn = (elem, d) => {\n const selection = elem;\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n};\n\n/**\n * Draws rectangles by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Bar Selection\n */\n/* istanbul ignore next */ export const drawRects = (params) => {\n const { layer, points, container, keyFn } = params;\n const graphicElems = layer._graphicElems;\n const updateFns = {\n enter (elem, d) { barEnterFn(elem, d); },\n update (elem, d, i) {\n graphicElems[d.rowId] = elem;\n transitionBars(layer, elem, d, i, params);\n }\n };\n return makeElement(container, 'rect', points, null, updateFns, keyFn);\n};\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-bar',\n className: '',\n interaction: {\n highlight: [{\n type: 'fill',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }],\n focus: [{\n type: 'fill',\n intensity: [0, 0, +15, 0]\n }]\n },\n transform: {\n type: 'stack'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n innerPadding: 0.1,\n encoding: {\n color: {},\n x: {},\n y: {},\n x0: {},\n y0: {}\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-bar-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-bar-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-bar-selected`\n }\n }\n};\n\n","import { MeasureSubtype, DimensionSubtype } from 'muze-utils';\nimport { STACK } from '../../enums/constants';\nimport { positionPoints, getIndividualClassName, getColorMetaInf, resolveEncodingValues } from '../../helpers';\n\nconst positionRetriever = {\n x: (xPx, isNegativeVal, barBasePos) => (isNegativeVal ? [xPx, barBasePos] : [barBasePos, xPx]),\n y: (yPx, isNegativeVal, barBasePos) => (isNegativeVal ? [barBasePos, yPx] : [yPx, barBasePos])\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fieldInfo\n * @param {*} config\n * @param {*} data\n *\n */\nconst resolveDimByField = (type, axesInfo, config, data) => {\n const spaceType = type === 'x' ? 'width' : 'height';\n const [fieldType, axis] = [config[`${type}FieldType`], axesInfo[`${type}Axis`]];\n const {\n transformType,\n sizeEncoding,\n sizeConfig,\n measurement\n } = config;\n\n const sizeValue = sizeEncoding.value;\n let enter = 0;\n let pos;\n let space = 0;\n let enterSpace = 0;\n if (fieldType !== undefined) {\n if (config[`${type}0Field`]) {\n const minVal = data[type];\n const maxVal = data[`${type}0`];\n let min;\n let max;\n if (minVal === null || maxVal === null) {\n return {\n enterSpace: undefined,\n enter: undefined,\n pos: undefined,\n space: undefined\n };\n } else if (fieldType === MeasureSubtype.CONTINUOUS || fieldType === DimensionSubtype.TEMPORAL) {\n min = Math.min(minVal, maxVal);\n max = Math.max(minVal, maxVal);\n } else {\n min = minVal;\n max = maxVal;\n }\n const scales = type === 'x' ? [min, max] : [max, min];\n pos = axis.getScaleValue(scales[0]) + axis.getUnitWidth() / 2;\n space = Math.abs(axis.getScaleValue(scales[1]) - pos) + axis.getUnitWidth() / 2;\n\n enter = pos;\n enterSpace = 0;\n } else if (fieldType === DimensionSubtype.CATEGORICAL || fieldType === DimensionSubtype.TEMPORAL) {\n pos = axis.getScaleValue(data[type]) +\n (sizeConfig[type === 'x' ? 'barWidthOffset' : 'barHeightOffset'] || 0);\n\n space = sizeConfig[type === 'x' ? 'barWidth' : 'barHeight'];\n if (sizeValue !== undefined) {\n const diffPx = sizeValue * space;\n space -= diffPx;\n pos += diffPx / 2;\n }\n enter = pos;\n enterSpace = space;\n } else {\n const minDomVal = axis.domain()[0];\n const barBasePos = minDomVal < 0 ? axis.getScaleValue(0) : axis.getScaleValue(minDomVal);\n pos = axis.getScaleValue(data[type]);\n let endPos = axis.getScaleValue(data[`${type}0`]);\n\n enterSpace = 0;\n const isNegativeVal = data[type] < 0;\n if (transformType !== STACK) {\n [pos, endPos] = positionRetriever[type](pos, isNegativeVal, barBasePos);\n }\n space = Math.abs(pos - endPos);\n enter = barBasePos;\n }\n } else {\n pos = 0;\n space = measurement[spaceType];\n }\n\n return {\n enterSpace,\n enter,\n pos,\n space\n };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} config\n * @param {*} axes\n *\n */\nconst resolveDimensions = (data, config, axes) => {\n const axesInfo = {\n xAxis: axes.x,\n yAxis: axes.y\n };\n const {\n enterSpace: enterWidth,\n enter: enterX,\n pos: xPos,\n space: width\n } = resolveDimByField('x', axesInfo, config, data);\n\n const {\n enterSpace: enterHeight,\n enter: enterY,\n pos: yPos,\n space: height\n } = resolveDimByField('y', axesInfo, config, data);\n return {\n enter: {\n x: enterX,\n y: enterY,\n width: enterWidth,\n height: enterHeight\n },\n update: {\n x: xPos,\n y: yPos,\n width,\n height\n }\n };\n};\n\n/**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\nexport const getTranslatedPoints = (context, data, sizeConfig) => {\n let points = [];\n const encoding = context.config().encoding;\n const axes = context.axes();\n const colorAxis = axes.color;\n const sizeEncoding = encoding.size || {};\n const {\n x0Field,\n y0Field,\n xFieldSubType,\n yFieldSubType\n } = context.encodingFieldsInf();\n const measurement = context.measurement();\n const isXDim = xFieldSubType === DimensionSubtype.CATEGORICAL || xFieldSubType === DimensionSubtype.TEMPORAL;\n const isYDim = yFieldSubType === DimensionSubtype.CATEGORICAL || yFieldSubType === DimensionSubtype.TEMPORAL;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const transformType = context.transformType();\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const dimensions = resolveDimensions(d, {\n xFieldType: xFieldSubType,\n yFieldType: yFieldSubType,\n x0Field,\n y0Field,\n transformType,\n measurement,\n sizeConfig,\n sizeEncoding\n }, axes);\n\n let color = colorAxis.getColor(d.color);\n\n const update = dimensions.update;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: update.x,\n y: update.y,\n width: update.width,\n height: update.height,\n color\n },\n data: d\n }, i, data, context);\n color = resolvedEncodings.color;\n const { x, y, width, height } = resolvedEncodings;\n const style = {\n fill: color\n };\n\n if (!isNaN(x) && !isNaN(y) && d.rowId !== undefined) {\n let point = null;\n point = {\n enter: dimensions.enter,\n update: {\n x,\n y,\n width,\n height\n },\n source: d.source,\n rowId: d.rowId,\n style,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, context);\n points.push(point);\n // Store each point in a hashmap with key as the dimensional or temporal field value\n context.cachePoint(d[key], point);\n }\n }\n\n points = positionPoints(context, points);\n return points;\n};\n","import {\n getQualifiedClassName,\n selectElement,\n createElements,\n clipElement,\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n Scales,\n getNearestValue,\n getObjProp\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawRects } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { getPlotMeasurement, getValidTransformForAggFn } from '../../helpers';\nimport './styles.scss';\nimport { getTranslatedPoints } from './bar-helper';\n\nconst MEASURE = FieldType.MEASURE;\nconst scaleBand = Scales.band;\n\n/**\n * Bar layer creates rectangle marks. The mark type of this layer is ```bar```. This layer can be used\n * to create stacked or grouped bars, range bars, heatmap plots and also reference bands by using\n * the encoding properties.\n *\n * @public\n *\n * @class\n * @module BarLayer\n * @extends BaseLayer\n */\nexport default class BarLayer extends BaseLayer {\n /**\n * Creates an instance of bar layer\n */\n constructor (...params) {\n super(...params);\n this._bandScale = scaleBand();\n this._plotPadding = {\n x: 0,\n y: 0\n };\n this._plotSpan = {\n x: 0,\n y: 0\n };\n this._pointMap = {};\n }\n\n /**\n *\n *\n *\n * @memberof BarLayer\n */\n elemType () {\n return 'rect';\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof BarLayer\n */\n static formalName () {\n return 'bar';\n }\n\n /**\n * Returns the default configuration of the bar layer\n * @return {Object} Default configuration of the bar layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n * @param {*} conf\n * @param {*} userConf\n *\n * @memberof BarLayer\n */\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const colorField = encoding.color.field;\n const transform = config.transform;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n *\n *\n * @param {*} data\n * @param {*} fieldsConfig\n *\n * @memberof BarLayer\n */\n calculateDomainFromData (data, encodingFieldInf, fieldsConfig) {\n const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig);\n ['x', 'y'].forEach((d) => {\n if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) {\n if (encodingFieldInf[`${d}0Field`]) {\n domain[d] = domain[d].sort((a, b) => a - b);\n } else {\n domain[d][0] = Math.min(domain[d][0], 0);\n domain[d][1] = Math.max(0, domain[d][1]);\n }\n }\n });\n return domain;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\n translatePoints (data, sizeConfig) {\n return getTranslatedPoints(this, data, sizeConfig);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGGroup} container SVGGroup where plot will be rendered.\n * @return {BarLayer} Instance of bar layer.\n */\n render (container) {\n const config = this.config();\n const transition = config.transition;\n const normalizedDataArr = this._normalizedData;\n const transformedData = this._transformedData;\n const keys = transformedData.map(d => d.key);\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const height = axes.y && axes.y.scale().range()[0];\n const width = axes.x && axes.x.scale().range()[1];\n const defClassName = config.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const className = config.className;\n const containerSelection = selectElement(container);\n const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION)\n .map(e => e.index);\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n clipElement(container, {\n x: 0,\n y: 0,\n width,\n height\n }, `id-${this.id()}`);\n\n this._points = this.generateDataPoints(normalizedDataArr, keys);\n this._graphicElems = {};\n\n createElements({\n data: this._points,\n container,\n selector: 'g',\n append: 'g',\n each: (points, group, i) => {\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n group.style('display', 'block');\n drawRects({\n layer: this,\n container: group.node(),\n points,\n className: seriesClassName,\n transition,\n style: {},\n keyFn: d => dimensions.map(key => d.source[key]).join('-')\n });\n }\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} normalizedData\n * @param {*} keys\n *\n * @memberof BarLayer\n */\n generateDataPoints (normalizedData, keys) {\n const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys);\n const barWidthOffsets = barWidthMetrics.offsetValues || [];\n const barHeightOffsets = barHeightMetrics.offsetValues || [];\n this._plotSpan = {\n x: barWidthMetrics.groupSpan || 0,\n y: barHeightMetrics.groupSpan || 0\n };\n this._plotPadding = {\n x: barWidthMetrics.padding || 0,\n y: barHeightMetrics.padding || 0\n };\n\n this._pointMap = {};\n return normalizedData.map((data, i) => this.translatePoints(data,\n {\n barWidth: barWidthMetrics.span,\n barWidthOffset: barWidthOffsets[i] || 0,\n barHeight: barHeightMetrics.span,\n barHeightOffset: barHeightOffsets[i] || 0\n }));\n }\n\n getPlotPadding () {\n return this._plotPadding;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Gets the nearest point of the position passed.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point.\n */\n getNearestPoint (x, y) {\n if (!this.data()) {\n return null;\n }\n let axis;\n let value;\n let points;\n let uniqueFieldType;\n let uniqueFieldIndex;\n let filterData;\n let identifiers;\n let pointFound = null;\n const dataModel = this.data();\n const dataObj = dataModel.getData();\n const fieldsConfig = dataModel.getFieldsConfig();\n const axes = this.axes();\n const data = dataObj.data;\n const pointMap = this._pointMap;\n const {\n xField,\n yField,\n xFieldSubType,\n yFieldSubType\n } = this.encodingFieldsInf();\n\n if (xFieldSubType === MeasureSubtype.CONTINUOUS) {\n axis = axes.y;\n value = axis.invert(y);\n uniqueFieldIndex = fieldsConfig[yField].index;\n uniqueFieldType = yFieldSubType;\n } else {\n axis = axes.x;\n value = axis.invert(x);\n uniqueFieldIndex = fieldsConfig[xField].index;\n uniqueFieldType = xFieldSubType;\n }\n\n if (uniqueFieldType === DimensionSubtype.CATEGORICAL) {\n points = pointMap[value];\n }\n\n if (uniqueFieldType === DimensionSubtype.TEMPORAL) {\n filterData = [...new Set(data.map(d => d[uniqueFieldIndex]))];\n value = getNearestValue(filterData, value);\n points = pointMap[value];\n }\n const len = points && points.length;\n points && points.sort((p1, p2) => p1.update.y - p2.update.y);\n for (let i = 0; i < len; i++) {\n const point = points[i];\n const update = point.update;\n if (x >= update.x && x <= (update.width + update.x) && y >= update.y && y <= (update.height + update.y)) {\n pointFound = point;\n break;\n }\n pointFound = null;\n }\n\n const values = pointFound && pointFound.source;\n if (values) {\n identifiers = this.getIdentifiersFromData(values, pointFound.rowId);\n }\n return pointFound ? {\n dimensions: [pointFound.update],\n id: identifiers,\n layerId: this.id()\n } : pointFound;\n }\n\n getPlotSpan () {\n return this._plotSpan;\n }\n\n hasPlotSpan () {\n return true;\n }\n}\n","import { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-tick',\n className: '',\n classPrefix: CLASSPREFIX,\n interaction: {\n highlight: [{\n type: 'stroke',\n intensity: [0, 0, -15, 0]\n }],\n fade: [{\n type: 'stroke',\n intensity: [0, 0, 15, 0]\n }],\n focus: [{\n type: 'stroke',\n intensity: [0, 0, 15, 0]\n }]\n },\n innerPadding: 0.1,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n interpolate: 'linear',\n encoding: {\n color: { },\n x: {},\n y: {},\n x0: {},\n y0: {},\n radius: {},\n radius0: {},\n angle: {},\n angle0: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-tick-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-tick-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-tick-selected`\n }\n }\n};\n\n","import { selectElement, Symbols, pathInterpolators } from 'muze-utils';\n\nconst line = Symbols.line;\n\n/**\n * Draws ticks by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Ticks Selection\n */\nexport default /* istanbul ignore next */ (params) => {\n const { points, container, keyFn, className, interpolate, layer } = params;\n const mount = selectElement(container);\n const ticks = mount.selectAll('path').data(points, keyFn);\n const ticksEnter = ticks.enter().append('path');\n const graphicElems = layer._graphicElems;\n mount.attr('class', className || '');\n ticksEnter.each(function (d) {\n const selection = selectElement(this);\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n });\n\n ticks.exit().remove();\n return ticks.merge(ticksEnter)\n .each(function (d) {\n const selection = selectElement(this);\n graphicElems[d.rowId] = selection;\n const update = d.update;\n const updateStyle = d.style || {};\n const x0 = update.x0 !== undefined ? update.x0 : update.x;\n const y0 = update.y0 !== undefined ? update.y0 : update.y;\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(e => e[0])\n .y(e => e[1]);\n d.className && selection.classed(d.className, true);\n selection.attr('d', linepath([[update.x, update.y], [x0, y0]]));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n });\n};\n\n","import { FieldType } from 'muze-utils';\nimport { PointLayer } from '../point';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport drawTicks from './renderer';\nimport './styles.scss';\nimport { getAxesScales, positionPoints, getIndividualClassName,\n getColorMetaInf, resolveEncodingValues, toCartesianCoordinates } from '../../helpers';\n\nconst pointTranslators = {\n polar: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes;\n const measurement = layerInst.measurement();\n\n const colorAxis = axes.color;\n const angleV = {};\n const angle0V = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const color = colorAxis.getColor(d.color);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const angles0 = angle0Axis.getScaleValue(d.angle0);\n !angle0V[d.angle0] && (angle0V[d.angle0] = 0);\n const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++];\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angle = (startAngle + endAngle) / 2;\n const angle0 = (startAngle0 + endAngle0) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n radius,\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color,\n angle,\n angle0,\n startAngle,\n endAngle,\n startAngle0,\n endAngle0\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedVal.color\n };\n\n const point = {\n enter: {},\n update: {\n radius: resolvedVal.radius,\n radius0: resolvedVal.radius0,\n angle: resolvedVal.angle,\n angle0: resolvedVal.angle0\n },\n style,\n source: d.source,\n rowId: d.rowId,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true);\n return points;\n },\n cartesian: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const {\n xAxis,\n yAxis\n } = getAxesScales(axes);\n const {\n xField,\n yField,\n x0Field,\n y0Field,\n xFieldType,\n yFieldType\n } = layerInst.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const { x: xSpan, y: ySpan } = config.span;\n for (let i = 0, len = data.length; i < len; i++) {\n let xPx;\n let x0Px;\n let y0Px;\n let yPx;\n const d = data[i];\n const row = d.source;\n if (xField) {\n xPx = xAxis.getScaleValue(d.x) + offsetX;\n x0Px = xPx + xSpan;\n }\n\n if (yField) {\n yPx = yAxis.getScaleValue(d.y) + offsetY;\n y0Px = yPx !== null ? yPx + ySpan : null;\n }\n\n if (!xField) {\n xPx = 0;\n x0Px = measurement.width;\n if (!isNaN(yPx)) {\n yPx += ySpan / 2;\n y0Px = yPx;\n }\n }\n\n if (!yField) {\n yPx = 0;\n y0Px = measurement.height;\n x0Px = xPx += xSpan / 2;\n }\n\n if (x0Field) {\n x0Px = xAxis.getScaleValue(d.x0) + xSpan;\n yPx += ySpan / 2;\n y0Px -= ySpan / 2;\n }\n\n if (y0Field) {\n y0Px = yAxis.getScaleValue(d.y0) + ySpan;\n xPx += xSpan / 2;\n x0Px -= xSpan / 2;\n }\n const color = colorAxis.getColor(d.color);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n x0: x0Px,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedEncodings.color\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y,\n x0: resolvedEncodings.x0,\n y0: resolvedEncodings.y0\n },\n style,\n source: row,\n rowId: d.rowId,\n meta: getColorMetaInf(style, colorAxis)\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport default class TickLayer extends PointLayer {\n\n /**\n *\n *\n * @staticg\n *\n * @memberof TickLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TickLayer\n */\n static formalName () {\n return 'tick';\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TickLayer\n */\n static drawFn () {\n return drawTicks;\n }\n\n /**\n *\n *\n *\n * @memberof TickLayer\n */\n elemType () {\n return 'path';\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0),\n y: (offsetY || 0)\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n}\n","export const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { isSimpleObject, mergeRecursive, getObjProp } from 'muze-utils';\n\nconst parseLayerDefinition = (sink, definition, layerDef, layerType) => {\n for (const key in definition) {\n if (Object.hasOwnProperty.call(definition, key)) {\n let strs;\n let propValue;\n const def = definition[key];\n if (isSimpleObject(def)) {\n sink[key] = {};\n parseLayerDefinition(sink[key], def, layerDef, layerType);\n } else if (typeof def === 'string' && (strs = def.split('.')) && strs[0] === layerType) {\n propValue = getObjProp(layerDef, ...strs.slice(1, strs.length));\n if (propValue !== undefined) {\n sink[key] = propValue;\n }\n } else {\n sink[key] = def;\n }\n }\n }\n};\n\nconst sanitizeEncoding = (encoding) => {\n // Create object for each encoding value if encoding value is a string\n for (const key in encoding) {\n if (typeof encoding[key] === 'string') {\n encoding[key] = {\n field: encoding[key]\n };\n }\n }\n};\n\n/**\n * Layer Factory creates layers based on the layer type. All types of layers needs to register in\n * the layer factory. For getting a layer instance, getLayer method needs to invoked with the\n * layerType and other arguments. It also registers the definition of composite layers.\n *\n * @public\n *\n * @module LayerFactory\n */\nconst layerFactory = (() => {\n const compositeLayers = {};\n const factoryObj = {\n setLayerRegistry: (reg) => {\n factoryObj._layerRegistry = reg;\n },\n getSerializedConf: (mark, layerDef) => {\n let serializedDefs;\n const defs = compositeLayers[mark];\n const newConf = mergeRecursive({}, layerDef);\n\n // If it is a composite layer then resolve all the definitions of each unit layer\n if (defs) {\n serializedDefs = defs.map((unitLayerDef) => {\n const sDef = {};\n parseLayerDefinition(sDef, unitLayerDef, newConf, mark);\n sanitizeEncoding(sDef.encoding);\n return sDef;\n });\n } else {\n const encoding = newConf.encoding;\n // Create object for each encoding value if encoding value is a string\n sanitizeEncoding(encoding);\n serializedDefs = newConf;\n }\n\n return serializedDefs;\n },\n getLayerInstance: (layerDef, ...params) => {\n const layerRegistry = factoryObj._layerRegistry;\n layerDef = !(layerDef instanceof Array) ? [layerDef] : layerDef;\n const instances = layerDef.map((layerObj) => {\n const layerConstructor = layerRegistry[layerObj.mark];\n return layerConstructor.create(...params);\n });\n return instances.length === 1 ? instances[0] : instances;\n },\n getLayerClass: mark => factoryObj._layerRegistry[mark],\n /**\n * Registers a new composite layer definition in the layer factory.\n *\n * @public\n *\n * @param {string} layerType Mark type of the new composite layer.\n * @param {Array} layerDefs Layer definitions of the composite layer.\n */\n composeLayers: (layerType, layerDefs) => {\n compositeLayers[layerType] = layerDefs;\n },\n sanitizeLayerConfig: (layerDef) => {\n const newConf = mergeRecursive({}, layerDef);\n sanitizeEncoding(newConf.encoding);\n return newConf;\n }\n };\n return factoryObj;\n})();\n\nexport default layerFactory;\n","import layerFactory from './layer-factory';\n\nexport default layerFactory;\n","import { AreaLayer } from './layers/area';\nimport { ArcLayer } from './layers/arc';\nimport { LineLayer } from './layers/line';\nimport { TextLayer } from './layers/text';\nimport { PointLayer } from './layers/point';\nimport { BarLayer } from './layers/bar';\nimport { BaseLayer } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport { TickLayer } from './layers/tick';\n\nexport const DEFAULT_LAYERS = {\n [LAYER_TYPES.AREA_LAYER]: AreaLayer,\n [LAYER_TYPES.ARC_LAYER]: ArcLayer,\n [LAYER_TYPES.LINE_LAYER]: LineLayer,\n [LAYER_TYPES.TEXT_LAYER]: TextLayer,\n [LAYER_TYPES.POINT_LAYER]: PointLayer,\n [LAYER_TYPES.TICK_LAYER]: TickLayer,\n [LAYER_TYPES.BAR_LAYER]: BarLayer,\n [LAYER_TYPES.BASE_LAYER]: BaseLayer\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Artboard.\n * Artboard merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module\n */\n\nexport default {\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * Interfaces for VisualGroup. Any new VisualGroup has to implement this class.\n * @class SimpleGroup\n */\nclass SimpleGroup {\n\n /**\n * This method is used to set or get the DataModel instance.\n *\n * @param {DataModel | undefined} dataModel Instance of datamodel.\n\n * @memberof SimpleGroup\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to set or get the group specific configuration\n * properties\n *\n * @param {Object | undefined} configObj The input configuration.\n * or instance of visual group.\n * @memberof SimpleGroup\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to return a serialized representation of the\n * instance's properties.\n *\n * @memberof SimpleGroup\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to get or set the measurement object which houses\n * layout properties like width and height.\n *\n * @param {Object | undefined} mObj The measurement properties.\n * @memberof SimpleGroup\n */\n measurement () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n\nexport default SimpleGroup;\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: false\n },\n [ACTIONS.HOVER]: {\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.LONGTOUCH]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: true\n },\n [ACTIONS.TOUCHDRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: true\n },\n [ACTIONS.CLICK]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: false\n }\n};\n","import {\n FieldType,\n getDependencyOrder,\n getObjProp,\n defaultValue,\n objectIterator,\n unionDomain,\n makeElement,\n DimensionSubtype,\n toArray,\n MeasureSubtype,\n getNearestValue\n} from 'muze-utils';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\n\nexport const getDimensionMeasureMap = (layers, fieldsConfig) => {\n const retinalEncodingsAndMeasures = {};\n\n layers.forEach((layer) => {\n const {\n colorField,\n sizeField,\n shapeField,\n xField,\n yField\n } = layer.encodingFieldsInf();\n const measures = [xField, yField].filter(field => fieldsConfig[field] && fieldsConfig[field].def.type ===\n FieldType.MEASURE);\n [colorField, sizeField, shapeField].forEach((field) => {\n if (getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION && measures.length) {\n !retinalEncodingsAndMeasures[field] && (retinalEncodingsAndMeasures[field] = []);\n retinalEncodingsAndMeasures[field].push(...measures);\n }\n });\n });\n\n for (const key in retinalEncodingsAndMeasures) {\n if ({}.hasOwnProperty.call(retinalEncodingsAndMeasures, key)) {\n retinalEncodingsAndMeasures[key] = [...new Set(retinalEncodingsAndMeasures[key])];\n }\n }\n return retinalEncodingsAndMeasures;\n};\n\nexport const transformDataModels = (transform, dataModel) => {\n const dataModels = {};\n for (const key in transform) {\n if ({}.hasOwnProperty.call(transform, key)) {\n const transformVal = transform[key];\n dataModels[key] = transformVal(dataModel);\n }\n }\n\n return dataModels;\n};\n\nexport const getLayerFromDef = (context, definition, existingLayer, namespaces) => {\n let instances = existingLayer;\n const dependencies = context._dependencies;\n const metaInf = context.metaInf();\n if (!existingLayer) {\n instances = layerFactory.getLayerInstance(definition);\n toArray(instances).forEach((inst, i) => {\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: namespaces[i],\n parentNamespace: metaInf.namespace\n })\n .dependencies(dependencies)\n .store(context.store());\n });\n }\n const layers = {};\n const instanceArr = toArray(instances);\n definition = toArray(definition);\n definition.reduce((acc, def, idx) => {\n const instance = instanceArr[idx];\n instance.coord(context.coord());\n instance.config(def);\n instance.valueParser(context.valueParser());\n instance.dataProps({\n timeDiffs: context._timeDiffs\n });\n if (def.name) {\n instance.alias(def.name);\n }\n layers[instance.alias()] = instance;\n return acc;\n }, {});\n return layers;\n};\n\nexport const resolveEncodingTransform = (layerInst, store) => {\n const encodingTransform = layerInst.config().encodingTransform || {};\n const resolvable = encodingTransform.resolvable;\n let depArr = [];\n if (resolvable) {\n const resolved = resolvable(store);\n depArr = resolved.depArr;\n layerInst.encodingTransform(resolved.fn);\n } else if (encodingTransform instanceof Function) {\n layerInst.encodingTransform(encodingTransform);\n }\n return depArr;\n};\n\nexport const sanitizeLayerDef = (layerDefs) => {\n const sanitizedDefs = [];\n layerDefs.forEach((layerDef, i) => {\n const def = layerDef.def;\n const mark = layerDef.mark;\n if (!def) {\n const sConf = layerFactory.getSerializedConf(layerDef.mark, layerDef);\n if (!sConf.name) {\n sConf.name = `${mark}-${i}`;\n }\n sanitizedDefs.push({\n mark: layerDef.mark,\n def: sConf\n });\n } else {\n if (!def.name) {\n def.name = `${mark}-${i}`;\n }\n sanitizedDefs.push(layerDef);\n }\n });\n return sanitizedDefs;\n};\n\nexport const attachDataToLayers = (layers, dm, transformedDataModels) => {\n layers.forEach((layer) => {\n const dataSource = layer.config().source;\n const dataModel = dataSource instanceof Function ? dataSource(dm) :\n (transformedDataModels[dataSource] || dm);\n layer.data(dataModel);\n });\n};\n\nexport const attachAxisToLayers = (axes, layers, layerAxisIndex) => {\n layers.forEach((layer) => {\n const layerId = layer.id();\n const axesObj = {};\n\n objectIterator(axes, (key) => {\n const axisInf = layerAxisIndex[layerId];\n if (axisInf) {\n const axisArr = axes[key] || [];\n const axisIndex = axisInf[key] >= 0 ? axisInf[key] : axisArr.length - 1;\n axes[key] && (axesObj[key] = defaultValue(axes[key][axisIndex]));\n }\n });\n Object.keys(axesObj).length && layer.axes(axesObj);\n });\n};\n\nconst { X, Y, RADIUS, ANGLE, ANGLE0, RADIUS0 } = ENCODING;\n\nexport const getLayerAxisIndex = (layers, fields) => {\n const layerAxisIndex = {};\n layers.forEach((layer) => {\n const { axis, encoding } = layer.config();\n const id = layer.id();\n [X, Y, ANGLE, ANGLE0, RADIUS].forEach((type) => {\n let index;\n const specificField = getObjProp(encoding, type, 'field');\n const encodingField = type === RADIUS ? defaultValue(specificField, getObjProp(encoding, RADIUS0, 'field'))\n : getObjProp(encoding, type, 'field');\n const field = defaultValue(getObjProp(axis, type), encodingField);\n if (fields[type] && fields[type].length) {\n index = fields[type].findIndex(fieldInst => fieldInst.getMembers().indexOf(field) !== -1);\n } else {\n index = 0;\n }\n !layerAxisIndex[id] && (layerAxisIndex[id] = {});\n layerAxisIndex[id][type] = index;\n });\n });\n return layerAxisIndex;\n};\n\nconst getValidDomain = (domain, domain1, encodingType, fieldType) => {\n if (encodingType === ANGLE || encodingType === ANGLE0) {\n return domain.concat(domain1.filter(d => domain.indexOf(d) === -1));\n }\n return unionDomain([domain, domain1], fieldType);\n};\n\nexport const unionDomainFromLayers = (layers, axisFields, layerAxisIndex, fieldsConfig) => {\n let domains = {};\n layers = layers.filter(layer => layer.getDataDomain() !== null);\n layers.forEach((layer) => {\n let domainValues = {};\n const config = layer.config();\n // const encoding = config.encoding;\n const layerDomain = layer.getDataDomain();\n const layerId = layer.id();\n\n if (layerDomain !== null && config.calculateDomain !== false) {\n domainValues = Object.entries(layerDomain);\n domains = domainValues.reduce((fieldDomain, domain) => {\n const encodingType = domain[0];\n const axisIndex = layerAxisIndex[layerId][encodingType];\n const field = getObjProp(axisFields, encodingType, axisIndex);\n !fieldDomain[encodingType] && (fieldDomain[encodingType] = {});\n const encodingDomain = fieldDomain[encodingType];\n if (field) {\n const fieldStr = `${field}`;\n encodingDomain[fieldStr] = encodingDomain[fieldStr] || [];\n encodingDomain[fieldStr] = getValidDomain(encodingDomain[fieldStr],\n domain[1], encodingType, fieldsConfig[field.getMembers()[0]].def.subtype);\n }\n return fieldDomain;\n }, domains);\n }\n });\n return domains;\n};\n\nexport const renderLayers = (context, container, layers, measurement) => {\n context._lifeCycleManager.notify({ client: layers, action: 'beforedraw', formalName: 'layer' });\n const config = context.config();\n const classPrefix = config.classPrefix;\n const orderedLayers = context.layers().sort((a, b) => a.config().order - b.config().order);\n const layerParentGroup = makeElement(container, 'g', [1], `${classPrefix}-layer-group`);\n const layerDepOrder = getDependencyOrder(context._layerDepOrder);\n const groups = {};\n makeElement(layerParentGroup, 'g', orderedLayers, null, {\n update: (group, layer) => {\n groups[layer.alias()] = {\n group,\n layer\n };\n }\n });\n\n const layerSeq = layerDepOrder.map(name => groups[name]);\n layerSeq.forEach((o) => {\n const layer = o.layer;\n const group = o.group;\n layer.measurement(measurement);\n layer.dataProps({\n timeDiffs: context._timeDiffs\n });\n layer.config().render !== false && layer.mount(group.node());\n });\n return this;\n};\n\nexport const getNearestDimensionalValue = (context, position) => {\n const fields = context.fields();\n if (!fields.x.length || !fields.y.length) {\n return null;\n }\n const data = context.data();\n const axes = context.axes();\n const fieldsConfig = data.getFieldsConfig();\n const xField = getObjProp(fields, 'x', 0).getMembers()[0];\n const yField = getObjProp(fields, 'y', 0).getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n\n const entryVal = [['x', xFieldType, xField], ['y', yFieldType, yField]].find(entry =>\n entry[1] === DimensionSubtype.CATEGORICAL || entry[1] === DimensionSubtype.TEMPORAL);\n\n if (!entryVal || (xFieldType !== MeasureSubtype.CONTINUOUS && yFieldType !== MeasureSubtype.CONTINUOUS)) {\n return null;\n }\n const field = entryVal[2];\n const index = fieldsConfig[field].index;\n let key = axes[entryVal[0]][0].invert(position[entryVal[0]]);\n if (entryVal[1] === DimensionSubtype.TEMPORAL) {\n const filterData = [...new Set(data.getData().data.map(d => d[index]))];\n key = getNearestValue(filterData, key);\n }\n\n return key !== undefined ? [[field], [key]] : null;\n};\n\nexport const getLayersBy = (layers, searchBy, value) => layers.filter((layer) => {\n const name = searchBy === 'type' ? layer.constructor.formalName() : layer.alias();\n return name === value;\n});\n\nexport const removeLayersBy = (layers, searchBy, value) => {\n layers.filter((inst) => {\n const name = searchBy === 'type' ? inst.config().mark : inst.alias();\n if (name === value) {\n inst.remove();\n return false;\n }\n return true;\n });\n};\n\nexport const createSideEffectGroup = (container, className) => makeElement(container, 'g', [1], className).node();\n\nexport const createRenderPromise = (unit) => {\n const renderedPromise = unit._renderedPromise;\n renderedPromise.then(() => {\n unit._renderedPromise = new Promise((resolve) => {\n unit._renderedResolve = resolve;\n });\n createRenderPromise(unit);\n });\n};\n\nexport const getRadiusRange = (width, height, config = {}) => {\n const {\n innerRadius,\n outerRadius\n } = config;\n\n return [innerRadius || 0, outerRadius || Math.min(height,\n width) / 2];\n};\n\nexport const setAxisRange = (context) => {\n const axes = context.axes();\n const { radius: radiusAxes } = axes;\n if (radiusAxes) {\n radiusAxes.forEach((axis) => {\n axis.range(getRadiusRange(context.width(), context.height()));\n });\n }\n};\n\nexport const isXandYMeasures = (context) => {\n const { x: xFields, y: yFields } = context.fields();\n const [xMeasures, yMeasures] = [xFields, yFields].map(fields => fields\n .every(field => field.type() === FieldType.MEASURE));\n return xMeasures && yMeasures;\n};\n\nconst getKey = (arr, row) => {\n let key = row[arr[0]];\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${row[arr[i]]}`;\n }\n return key;\n};\n\nexport const getValuesMap = (model, context) => {\n const valuesMap = {};\n const { data: dataArr, schema, uids } = model.getData();\n const fieldsConfig = model.getFieldsConfig();\n const fieldIndices = isXandYMeasures(context) ? schema.map((d, i) => i) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldsConfig[d].index);\n dataArr.forEach((row, i) => {\n const key = getKey(fieldIndices, row);\n valuesMap[key] = uids[i];\n });\n return valuesMap;\n};\n\nexport const getSelectionRejectionModel = (model, propModel, measures, propValuesMap) => {\n let rejectionModel;\n const { data, schema } = propModel.getData();\n const entryRowIds = [];\n const exitRowIds = [];\n\n if (schema.length) {\n const fieldMap = model.getFieldsConfig();\n const rowIdsObj = {};\n const filteredSchema = measures ? schema.map((d, idx) => idx) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldMap[d].index);\n data.forEach((row) => {\n const key = getKey(filteredSchema, row);\n const id = propValuesMap[key];\n if (key in propValuesMap) {\n entryRowIds.push(id);\n rowIdsObj[id] = 1;\n }\n });\n rejectionModel = model.select((fields, i) => {\n if (!rowIdsObj[i]) {\n exitRowIds.push(i);\n return true;\n }\n return false;\n }, {\n saveChild: false\n });\n } else {\n rejectionModel = propModel;\n }\n\n return {\n model: [propModel, rejectionModel],\n entryRowIds,\n exitRowIds\n };\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const GRID_LINE_PARENT_GROUP_CLASS = 'grid-lines';\nexport const GRID_BAND_PARENT_GROUP_CLASS = 'grid-bands';\nexport const GRID_PARENT_GROUP = 'grid-parent-group';\nexport const BAND = 'band';\nexport const TICK = 'tick';\nexport const GRID_BAND = 'gridBands';\nexport const GRID_LINE = 'gridLines';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const RETINAL_FIELDS = 'retinalFields';\nexport const PARENT_ALIAS = 'parentAlias';\nexport const LAYERS = 'layers';\nexport const CACHED_DATA = 'cachedData';\nexport const STORE = 'store';\n","import { getObjProp, defaultValue, makeElement, DimensionSubtype, DataModel, createSelection } from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { layerFactory, LAYER_TYPES } from '@chartshq/visual-layer';\nimport {\n GRID_BAND,\n GRID_LINE,\n GRID_BAND_PARENT_GROUP_CLASS,\n GRID_LINE_PARENT_GROUP_CLASS,\n GRID_PARENT_GROUP\n} from '../enums/constants';\n\nconst { BAR_LAYER, TICK_LAYER } = LAYER_TYPES;\n\nconst LINEAR = ScaleType.LINEAR;\n\nconst getLayerDefinition = (context, axes, type, orientation) => {\n let encoding;\n const config = context.config();\n const { classPrefix, gridLines, gridBands } = config;\n const gridLineColor = gridLines.color;\n const zeroLineColor = gridLines.zeroLineColor;\n const defClassName = type === GRID_BAND ? gridBands.defClassName : gridLines.defClassName;\n const gridBandColor = gridBands[orientation].color;\n const axis = axes[orientation][0];\n const isLinearScale = axis.constructor.type() === LINEAR;\n\n if (type === GRID_BAND && isLinearScale) {\n encoding = {\n [orientation]: `${orientation}value`,\n [`${orientation}0`]: `${orientation}value0`\n };\n } else {\n encoding = {\n [orientation]: isLinearScale ? `${orientation}value` : `${orientation}dim`\n };\n }\n encoding.color = {\n value: (data, i) => {\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (type === GRID_BAND) {\n return gridBandColor[i % 2];\n }\n return isNegativeDomain && data[orientation] === 0 ? zeroLineColor : gridLineColor;\n }\n };\n const { color, shape, size } = context.axes();\n return {\n definition: {\n defClassName: `${defClassName}-${orientation}`,\n className: config.className,\n name: orientation,\n calculateDomain: false,\n individualClassName: (data, i) => {\n let className;\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (isNegativeDomain && data.y === 0 && type !== GRID_BAND) {\n className = `${classPrefix}-axis-zero-line`;\n } else {\n className = `${classPrefix}-grid-${type}-${orientation}-${i % 2}`;\n }\n return className;\n },\n [`pad${orientation.toUpperCase()}`]: type === GRID_BAND ? 0 : undefined,\n encoding\n },\n axes: {\n [orientation]: axis,\n color: color[0],\n shape: shape[0],\n size: size[0]\n },\n interactive: false\n };\n};\n\nconst getDefaultVisibilty = (show, axis) => {\n if (axis.constructor.type() === LINEAR) {\n return show;\n }\n return false;\n};\n\nexport const getGridLayerDefinitions = (context, config, type) => ['x', 'y'].map((axisType) => {\n const axes = context.axes();\n if (!axes[axisType]) {\n return null;\n }\n const show = defaultValue(config[axisType] && config[axisType].show,\n getDefaultVisibilty(config.show, axes[axisType][0]));\n\n return show ? getLayerDefinition(context, axes, type, axisType) : null;\n}).filter(d => d !== null);\n\nconst dimensionSubTypes = Object.values(DimensionSubtype).reduce((acc, v) => {\n acc[v] = 1;\n return acc;\n}, {});\nconst getValidSubtype = subtype => (!dimensionSubTypes[subtype] ? DimensionSubtype.CATEGORICAL : subtype);\n\nexport const getGridLayerData = (axes, fields, fieldsConfig) => {\n const gridData = {};\n\n ['x', 'y'].forEach((type) => {\n let ticks = axes[type][0].getTickValues();\n const subtype = getObjProp(fieldsConfig, getObjProp(fields, type, 0).getMembers()[0], 'def', 'subtype');\n const jsonData = [];\n const schema = [\n {\n name: 'yvalue',\n type: 'measure'\n }, {\n name: 'xvalue',\n type: 'measure'\n },\n {\n name: 'yvalue0',\n type: 'measure'\n }, {\n name: 'xvalue0',\n type: 'measure'\n }, {\n name: 'xdim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }, {\n name: 'ydim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }\n ];\n const len = Math.max(ticks.length);\n ticks = subtype === DimensionSubtype.TEMPORAL ? ticks.map(d => d.getTime()) : ticks;\n for (let i = 0; i < len; i += 1) {\n jsonData.push({\n [`${type}value`]: ticks[i],\n [`${type}value0`]: ticks[i + 1],\n [`${type}dim`]: ticks[i],\n [`${type}dim`]: ticks[i]\n });\n }\n gridData[type] = new DataModel(jsonData, schema);\n });\n return gridData;\n};\n\nexport const createGridLineLayer = (context) => {\n const vuConf = context.config();\n const metaInf = context.metaInf();\n const store = context.store();\n const timeDiffs = context._timeDiffs;\n [GRID_BAND, GRID_LINE].forEach((type) => {\n let mark;\n let config;\n if (type === GRID_BAND) {\n mark = BAR_LAYER;\n config = vuConf.gridBands;\n } else {\n mark = TICK_LAYER;\n config = vuConf.gridLines;\n }\n const definitions = getGridLayerDefinitions(context, config, type);\n\n const sel = `_${type}Selection`;\n context[sel] = createSelection(context[sel], (atomicDef) => {\n const inst = layerFactory.getLayerInstance({ mark });\n inst.dependencies(context._dependencies);\n const name = atomicDef.definition.name;\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: `${metaInf.namespace}${type}${name}`,\n parentNamespace: metaInf.namespace\n })\n .store(store);\n return inst;\n }, definitions, atomicDef => atomicDef.definition.name);\n context[sel].each((layer, atomicDef) => {\n const definition = atomicDef.definition;\n const sConf = layerFactory.getSerializedConf(mark, definition);\n const axesObj = atomicDef.axes;\n layer.config(sConf)\n .dataProps({\n timeDiffs\n })\n .axes(axesObj);\n });\n context[`_${type}`] = context[sel].getObjects();\n });\n};\n\nexport const attachDataToGridLineLayers = (context) => {\n const axes = context.axes();\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n if (gridLines.length || gridBands.length) {\n const gridLayerData = getGridLayerData(axes, context.fields(), context.data().getFieldsConfig());\n [].concat(...gridBands, ...gridLines).forEach((inst) => {\n inst.data(inst.axes().x ? gridLayerData.x : gridLayerData.y);\n });\n }\n};\n\nexport const renderGridLineLayers = (context, container) => {\n const config = context.config();\n const classPrefix = config.classPrefix;\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n const measurement = {\n width: context.width(),\n height: context.height()\n };\n const gridLineParentGroup = makeElement(container, 'g', [1], `${classPrefix}-${GRID_PARENT_GROUP}`);\n\n [[gridLines, `${classPrefix}-${GRID_LINE_PARENT_GROUP_CLASS}`],\n [gridBands, `${classPrefix}-${GRID_BAND_PARENT_GROUP_CLASS}`]].forEach((entry) => {\n const [instances, parentGroupClass] = entry;\n const mountPoint = makeElement(gridLineParentGroup, 'g', [1], `.${parentGroupClass}`);\n const className = `${parentGroupClass}-group`;\n makeElement(mountPoint, 'g', instances, `.${className}`, {\n update: (group, instance) => {\n instance.dataProps({ timeDiffs: context._timeDiffs })\n .measurement(measurement)\n .mount(group.node());\n }\n });\n });\n};\n","import { STATE_NAMESPACES, temporalFields, getObjProp, defaultValue } from 'muze-utils';\nimport * as PROPS from './enums/reactive-props';\nimport {\n transformDataModels,\n getDimensionMeasureMap,\n attachDataToLayers,\n attachAxisToLayers,\n unionDomainFromLayers\n} from './helper';\n\nimport { createGridLineLayer } from './helper/grid-lines';\n\nconst removeExitLayers = (layerDefs, context) => {\n const layersMap = context._layersMap;\n const markSet = {};\n layerDefs.forEach((layerDef, i) => {\n const id = defaultValue(layerDef.name, `${layerDef.mark}-${i}`);\n markSet[id] = true;\n });\n\n for (const key in layersMap) {\n if (!(key in markSet)) {\n layersMap[key].forEach(layer => layer.remove());\n delete layersMap[key];\n }\n }\n};\n\nexport const calculateDomainListener = (context) => {\n const { namespace } = context.metaInf();\n const domain = unionDomainFromLayers(context.layers(), context.fields(), context._layerAxisIndex,\n context.data().getFieldsConfig());\n context.store().commit(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, domain, namespace);\n};\n\nexport const listenerMap = [\n {\n type: 'registerImmediateListener',\n props: [PROPS.LAYERDEFS],\n listener: (context, [, layerDefs]) => {\n const fieldsVal = context.fields();\n if (layerDefs && fieldsVal) {\n removeExitLayers(layerDefs, context);\n const queuedLayerDefs = context._queuedLayerDefs;\n let layerDefArr = layerDefs;\n queuedLayerDefs.forEach((defFn) => {\n layerDefArr = [...layerDefArr, ...defFn(layerDefs)];\n });\n context.addLayer(layerDefArr);\n const adjustRange = context.layers().some(inst => inst.hasPlotSpan());\n ['x', 'y'].forEach((type) => {\n const axisArr = defaultValue(getObjProp(context.axes(), type), []);\n axisArr.forEach((axis) => {\n axis.config({\n adjustRange\n });\n });\n });\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'initialized',\n formalName: 'layer'\n });\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA],\n listener: (context, [, dataModel]) => {\n if (dataModel) {\n const axesObj = context.axes();\n const timeDiffs = {};\n const timeDiffsByField = {};\n\n Object.entries(temporalFields(dataModel)).forEach(([fieldName, fieldObj]) => {\n timeDiffsByField[fieldName] = fieldObj.minimumConsecutiveDifference();\n });\n\n Object.entries(context.fields()).forEach(([type, [field]]) => {\n if (field) {\n const timeDiff = timeDiffsByField[`${field}`];\n if (timeDiff) {\n timeDiffs[type] = timeDiff;\n axesObj[type].forEach(axis => axis.minDiff(timeDiff));\n }\n }\n });\n\n context._timeDiffsByField = timeDiffsByField;\n context._timeDiffs = timeDiffs;\n const firebolt = context.firebolt();\n const originalData = context.cachedData()[0];\n firebolt.createSelectionSet(context.data().getUids());\n firebolt.attachPropagationListener(originalData);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.CONFIG],\n listener: (context, [, config]) => {\n if (config) {\n context.firebolt().config(config.interaction);\n createGridLineLayer(context);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA, PROPS.TRANSFORM],\n listener: (context, [, dataModel], [, transform]) => {\n if (dataModel) {\n const dataModels = transformDataModels(transform, dataModel);\n const metaInf = context.metaInf();\n context.store().commit(`${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}.${PROPS.TRANSFORMEDDATA}`,\n dataModels, metaInf.namespace);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.TRANSFORMEDDATA, PROPS.LAYERS],\n listener: (context, [, transformedData], [, layers]) => {\n const layerAxisIndexVal = context._layerAxisIndex;\n const axesVal = context.axes();\n const dataModel = context.data();\n if (transformedData && layers && axesVal && layerAxisIndexVal) {\n context._lifeCycleManager.notify({ client: layers, action: 'beforeupdate', formalName: 'layer' });\n attachDataToLayers(layers, dataModel, transformedData);\n context._dimensionMeasureMap = getDimensionMeasureMap(layers,\n dataModel.getFieldsConfig(), context.retinalFields());\n attachAxisToLayers(axesVal, layers, layerAxisIndexVal);\n context._lifeCycleManager.notify({ client: layers, action: 'updated', formalName: 'layer' });\n }\n }\n }\n];\n","export const CONFIG = 'config';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const MOUNT = 'mount';\nexport const TRANSFORM = 'transform';\nexport const TRANSFORMEDDATA = 'transformedData';\nexport const DATADOMAIN = 'dataDomain';\nexport const FIELDS = 'fields';\nexport const LAYERAXISINDEX = 'layerAxisIndex';\nexport const LAYERS = 'layers';\nexport const DOMAIN = 'domain';\n\n","import { mergeRecursive } from 'muze-utils';\nimport { FACET_BY_FIELDS, RETINAL_FIELDS, PARENT_ALIAS, CACHED_DATA } from './enums/constants';\n\nexport const PROPS = {\n [FACET_BY_FIELDS]: {},\n [RETINAL_FIELDS]: {},\n [PARENT_ALIAS]: {},\n [CACHED_DATA]: {},\n detailFields: {},\n axes: {\n defaultValue: {\n x: [],\n y: []\n }\n },\n fields: {\n defaultValue: {\n x: [],\n y: []\n },\n sanitization: (context, value) => mergeRecursive({\n x: [],\n y: []\n }, value)\n },\n metaInf: {},\n registry: {},\n parentContainerInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {}\n};\n","import { DimensionSubtype } from 'muze-utils';\n\nconst getRangeFromData = (instance, selectionDataModel, propConfig) => {\n let criteria;\n const dataObj = selectionDataModel[0].getData();\n const propCriteria = propConfig.payload.criteria;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const schema = dataObj.schema;\n const fieldMap = instance.data().getFieldsConfig();\n const data = dataObj.data;\n const isActionSourceSame = instance.id() === propConfig.sourceId;\n\n if (isActionSourceSame) {\n criteria = propCriteria;\n } else {\n criteria = (sourceIdentifiers !== null) ? schema.reduce((acc, obj, index) => {\n let range;\n const field = obj.name;\n const fieldObj = fieldMap[field];\n const type = fieldObj && (fieldObj.def.subtype ? fieldObj.def.subtype : fieldObj.def.type);\n const isDimension = type === DimensionSubtype.CATEGORICAL;\n\n if (!fieldObj) {\n return acc;\n }\n\n if (!isDimension) {\n range = [Math.min(...data.map(d => d[index])), Math.max(...data.map(d => d[index]))];\n } else {\n range = data.map(d => d[index]);\n }\n acc[field] = range;\n return acc;\n }, {}) : null;\n }\n return criteria;\n};\n\nexport const payloadGenerator = {\n brush: (instance, selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const criteria = getRangeFromData(instance, selectionDataModel, propConfig);\n const payload = Object.assign({}, propPayload);\n payload.criteria = criteria;\n return payload;\n },\n\n __default: (instance, selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const dataObj = selectionDataModel[0].getData();\n let schema = dataObj.schema;\n const payload = Object.assign({}, propPayload);\n schema = dataObj.schema;\n const data = dataObj.data;\n const sourceFields = schema.map(d => d.name);\n payload.criteria = !sourceIdentifiers && selectionDataModel[0].isEmpty() ? null :\n [sourceFields, ...data];\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.getSchema().map(d => d.name) : [];\n return payload;\n }\n};\n\n","import { isSimpleObject, FieldType, DataModel } from 'muze-utils';\n\nconst getModelWithFacetData = (dm, data) => {\n const dataObj = dm.getData();\n const schema1 = dataObj.schema;\n const data1 = dataObj.data;\n const jsonData = [];\n const derivedSchema = data[0].map(d => ({\n name: `${d}`,\n type: FieldType.DIMENSION,\n subtype: d.subtype()\n }));\n const dataAtFirstPos = data[1];\n\n data1.forEach((d) => {\n const tuple = {};\n schema1.forEach((obj, i) => {\n tuple[obj.name] = d[i];\n });\n derivedSchema.forEach((obj, i) => {\n tuple[obj.name] = dataAtFirstPos[i];\n });\n jsonData.push(tuple);\n });\n\n return new DataModel(jsonData, [...schema1, ...derivedSchema]);\n};\n\nexport const propagateValues = (instance, action, config = {}) => {\n let propagationData;\n const payload = config.payload;\n const selectionSet = config.selectionSet;\n const propagationFieldInf = config.propagationFields[action] || {};\n const propagationFields = propagationFieldInf.fields || [];\n const append = propagationFieldInf.append;\n const criteria = payload.criteria;\n const context = instance.context;\n const dataModel = context.cachedData()[0];\n const sourceId = context.id();\n const sideEfffects = instance.sideEffects();\n const behaviourEffectMap = instance._behaviourEffectMap;\n const mergedModel = selectionSet.mergedEnter.model;\n const fieldsConfig = dataModel.getFieldsConfig();\n payload.sourceUnit = sourceId;\n payload.action = action;\n payload.sourceCanvas = context.parentAlias();\n const propagationBehaviourMap = instance._propagationBehaviourMap;\n const propagationBehaviour = propagationBehaviourMap[action] || action;\n\n let propFields = [];\n if (criteria === null) {\n propagationData = null;\n } else if (isSimpleObject(criteria)) {\n propFields = Object.keys(criteria || {});\n propagationData = mergedModel ? mergedModel.project(propFields) : null;\n } else {\n propFields = criteria[0];\n propagationData = mergedModel ? mergedModel.project(propFields) : null;\n }\n\n const facetByFields = context.facetByFields();\n if (propagationData !== null && propagationFields.length) {\n const fields = propagationData.getData().schema.map(d => d.name);\n propagationData = getModelWithFacetData(propagationData, facetByFields);\n propFields = append ? [...fields, ...propagationFields] : propagationFields;\n propagationData = propagationData.project(propFields);\n }\n\n let propagateInterpolatedValues = false;\n if (propFields.length && propFields.every(field => fieldsConfig[field] &&\n fieldsConfig[field].def.type === FieldType.MEASURE)) {\n propagateInterpolatedValues = true;\n }\n\n const groupId = context.parentAlias();\n payload.action = action;\n const behaviourInstance = instance._actions.behavioural[propagationBehaviour];\n const isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false;\n\n const filterFn = (entry, propagationConf) => {\n const effects = behaviourEffectMap[entry.config.action];\n const mutates = entry.config.groupId ?\n effects.some(d => sideEfffects[d.name || d].constructor.mutates()) : true;\n return entry.config.groupId !== propagationConf.groupId && mutates;\n };\n\n const sourceBehaviour = instance._actions.behavioural[action];\n const mutates = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false;\n let propConfig = {\n payload,\n action,\n criteria: propagationData,\n isMutableAction: mutates,\n propagateInterpolatedValues,\n groupId,\n sourceId: mutates ? groupId : sourceId,\n filterFn,\n enabled: (propConf, firebolt) => (action !== propagationBehaviour ?\n propConf.payload.sourceCanvas === firebolt.context.parentAlias() : true)\n };\n\n dataModel.propagate(propagationData, propConfig, true);\n\n if (action !== propagationBehaviour) {\n propConfig = {\n payload,\n sourceId: isMutableAction ? groupId : sourceId,\n criteria: propagationData,\n isMutableAction,\n propagateInterpolatedValues,\n action: propagationBehaviour,\n groupId,\n applyOnSource: action === propagationBehaviour,\n enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.context.parentAlias(),\n filterFn\n };\n\n dataModel.propagate(propagationData, propConfig, true, {\n filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId\n });\n }\n};\n","import { FieldType, intersect } from 'muze-utils';\nimport { Firebolt, SIDE_EFFECTS } from '@chartshq/muze-firebolt';\nimport { isXandYMeasures, getSelectionRejectionModel } from '../helper';\nimport { payloadGenerator } from './payload-generator';\nimport { propagateValues } from './data-propagator';\n\nconst sideEffectPolicy = (propPayload, context, propagationInf) => {\n const { sourceIdentifiers, propagationData } = propagationInf;\n const fieldsConfig = sourceIdentifiers.getFieldsConfig();\n const sourceIdentifierFields = Object.keys(fieldsConfig).filter(field =>\n fieldsConfig[field].def.type !== FieldType.MEASURE);\n const propFields = Object.keys(propagationData[0].getFieldsConfig());\n const hasCommonCanvas = propPayload.sourceCanvas === context.parentAlias();\n return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas;\n};\n\n/**\n * This class manages the interactions of visual unit. It associates physical actions with\n * behavioural actions. It also propagates the behavioural actions to other datamodels.\n */\nexport default class UnitFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n const {\n TOOLTIP,\n HIGHLIGHTER,\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS\n } = SIDE_EFFECTS;\n\n const disabledSideEffects = [TOOLTIP, HIGHLIGHTER, ANCHORS, BRUSH_ANCHORS, PERSISTENT_ANCHORS];\n disabledSideEffects.forEach((sideEffect) => {\n this.changeSideEffectStateOnPropagation(sideEffect, sideEffectPolicy, 'sourceTargetPolicy');\n });\n }\n propagate (behaviour, payload, selectionSet, sideEffects) {\n propagateValues(this, behaviour, {\n payload,\n selectionSet,\n sideEffects,\n propagationFields: this._propagationFields\n });\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n const context = this.context;\n const unitId = context.id();\n const aliasName = context.parentAlias();\n const propagationSourceCanvas = propagationInf.propPayload && propagationInf.propPayload.sourceCanvas;\n const sourceUnitId = propagationInf.propPayload && propagationInf.propPayload.sourceUnit;\n const sourceSideEffects = this._sourceSideEffects;\n const sideEffectInstances = this.sideEffects();\n const actionOnSource = sourceUnitId ? sourceUnitId === unitId : true;\n\n const applicableSideEffects = payload.sideEffects ? [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }] : sideEffects;\n applicableSideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n const mutates = sideEffectInstances[se.name || se].constructor.mutates();\n if (mutates && propagationInf.isMutableAction === false) {\n return false;\n }\n if (!actionOnSource && payload.criteria !== null) {\n const sideEffectCheckers = Object.values(sourceSideEffects[se.name || se] || {});\n const { sourceIdentifiers, data: propagationData } = propagationInf;\n return sideEffectCheckers.length ? sideEffectCheckers.every(checker =>\n checker(propagationInf.propPayload, context, {\n sourceIdentifiers,\n propagationData\n })) : true;\n }\n if (propagationSourceCanvas === aliasName || actionOnSource) {\n return se.applyOnSource !== false;\n }\n\n return true;\n });\n d.effects = mappedEffects;\n });\n return applicableSideEffects;\n }\n\n shouldApplySideEffects (propagate) {\n return propagate === false;\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n let isMutableAction = false;\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const {\n model: propagationData,\n entryRowIds,\n exitRowIds\n } = getSelectionRejectionModel(context.data(), data, isXandYMeasures(context), context._cachedValuesMap());\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n\n const payloadFn = payloadGenerator[action] || payloadGenerator.__default;\n const payload = payloadFn(context, propagationData, config);\n const sourceBehaviours = this._sourceBehaviours;\n const filterFns = Object.values(sourceBehaviours[action] || sourceBehaviours['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, context, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled !== false;\n }\n\n if (enabled) {\n const effects = this._behaviourEffectMap[action];\n const sideEffectInstances = this.sideEffects();\n isMutableAction = config.groupId ?\n effects.some(d => sideEffectInstances[d.name || d].constructor.mutates()) : config.isMutableAction;\n\n const propagationInf = {\n propagate: false,\n data: propagationData,\n entryRowIds,\n exitRowIds,\n propPayload,\n sourceIdentifiers,\n persistent: false,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n this._actionHistory[action] = {\n payload,\n propagationInf,\n isMutableAction\n };\n this.dispatchBehaviour(action, payload, propagationInf);\n }\n };\n }\n\n prepareSelectionSets (behaviours) {\n const data = this.context.data();\n if (data) {\n this.createSelectionSet(data.getData().uids, behaviours);\n }\n return this;\n }\n\n remove () {\n this.context.cachedData()[0].unsubscribe('propagation');\n return this;\n }\n}\n","import { SpawnableSideEffect } from '@chartshq/muze-firebolt';\n\nexport const initSideEffects = (sideEffects, firebolt) => {\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n sideEffects[key] instanceof SpawnableSideEffect && sideEffects[key].drawingContext(() => {\n const context = firebolt.context;\n return context.getDrawingContext();\n });\n sideEffects[key].valueParser(firebolt.context.valueParser());\n }\n }\n};\n\nexport const clearActionHistory = (context) => {\n const actionHistory = context._actionHistory;\n for (const key in actionHistory) {\n if (actionHistory[key].isMutableAction) {\n delete context._actionHistory[key];\n }\n }\n};\n\nexport const dispatchQueuedSideEffects = (context) => {\n const queuedSideEffects = context._queuedSideEffects;\n Object.entries(queuedSideEffects).forEach((entry) => {\n const sideEffect = entry[1];\n context.dispatchSideEffect(sideEffect.name, ...sideEffect.params);\n });\n context._queuedSideEffects = {};\n};\n","import { CLASSPREFIX, CONSOLIDATED } from './enums/constants';\n\n/**\n * Returns the default configuration of the visual unit\n * @return {Object} Default configuration of visual unit\n */\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'visual-unit',\n className: '',\n trackerClassName: 'visual-unit-tracker',\n minOuterRadius: 10,\n gridLines: {\n defClassName: 'axis-grid-lines',\n className: '',\n show: true,\n color: '#efefef',\n zeroLineColor: '#b6b6b6'\n },\n gridBands: {\n defClassName: 'axis-grid-bands',\n className: '',\n show: false,\n y: {\n color: ['#fff', '#fbfbfb']\n },\n x: {\n color: ['#fff', '#f9f9f9']\n }\n },\n arcLayerClassName: 'layer-arc',\n interaction: {\n tooltip: {\n mode: CONSOLIDATED\n }\n },\n sideEffectClassName: 'side-effect-container'\n};\n","import { mergeRecursive, DataModel } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { CONFIG, LAYERDEFS, TRANSFORM, DATA, LAYERS, TRANSFORMEDDATA } from './enums/reactive-props';\nimport { sanitizeLayerDef, getValuesMap } from './helper';\n\nexport default {\n [CONFIG]: {\n value: null,\n meta: {\n sanitization: (config, oldConfig) => (\n mergeRecursive(oldConfig || mergeRecursive({}, defaultConfig), config)\n )\n }\n },\n [LAYERDEFS]: {\n value: null,\n meta: {\n preset: layerDef => sanitizeLayerDef(layerDef)\n }\n },\n [TRANSFORM]: {\n value: null\n },\n [LAYERS]: {\n value: null\n },\n [DATA]: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel,\n preset: (data, context) => {\n context._cachedValuesMap = ((model) => {\n let valuesMap = null;\n return () => {\n if (valuesMap) {\n return valuesMap;\n }\n valuesMap = getValuesMap(model, context);\n return valuesMap;\n };\n })(data);\n if (context._cache) {\n const cachedData = context.cachedData();\n context.cachedData([...cachedData, data]);\n } else {\n const oldData = context.cachedData()[0];\n oldData && oldData.unsubscribe('propagation');\n context.cachedData([data]);\n }\n }\n }\n },\n [TRANSFORMEDDATA]: {\n value: null\n },\n width: {\n value: null\n },\n height: {\n value: null\n }\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n setAttrs,\n getUniqueId,\n getQualifiedClassName,\n selectElement,\n transactor,\n makeElement,\n generateGetterSetters,\n getDataModelFromIdentifiers,\n isSimpleObject,\n transposeArray,\n CommonProps,\n toArray,\n STATE_NAMESPACES\n} from 'muze-utils';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { actionBehaviourMap } from './firebolt/action-behaviour-map';\nimport {\n renderLayers,\n getNearestDimensionalValue,\n removeLayersBy,\n getLayersBy,\n getLayerFromDef,\n getLayerAxisIndex,\n sanitizeLayerDef,\n createSideEffectGroup,\n resolveEncodingTransform,\n createRenderPromise,\n setAxisRange\n} from './helper';\nimport { renderGridLineLayers, attachDataToGridLineLayers } from './helper/grid-lines';\nimport { calculateDomainListener, listenerMap } from './listener-map';\nimport { PROPS } from './props';\nimport UnitFireBolt from './firebolt';\nimport { initSideEffects, dispatchQueuedSideEffects, clearActionHistory } from './firebolt/helper';\nimport './styles.scss';\nimport localOptions from './local-options';\nimport { WIDTH, HEIGHT } from './enums/reactive-props';\n\nconst FORMAL_NAME = 'unit';\nconst unitNs = [STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * Visual Unit is hierarchical component created by {@link VisualGroup}. This component accepts layer definitions\n * and creates concrete layer instances from them, binds data and attaches axis to them. It also retreives the domain\n * from the layers and unions them and sets them on corresponding axis instances. This also creates the parent svg\n * groups for all the layers and delegates the rendering to all the layers.\n *\n * @public\n * @module VisualUnit\n * @class\n */\nexport default class VisualUnit {\n\n /**\n * Creates instance of visualization unit.\n *\n * @param {Object} registry Component registry\n * @param {Object} dependencies Dependencies required by visual unit.\n */\n constructor (registry, dependencies) {\n this._id = getUniqueId();\n this._dependencies = dependencies;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n createRenderPromise(this);\n this._lifeCycleManager = dependencies.lifeCycleManager;\n this._layersMap = {};\n this._gridLinesSelection = null;\n this._gridBandsSelection = null;\n this._gridLines = [];\n this._gridBands = [];\n this._layerAxisIndex = {};\n this._queuedLayerDefs = [];\n layerFactory.setLayerRegistry(registry.layerRegistry);\n generateGetterSetters(this, PROPS);\n this.registry(registry);\n this.cachedData([]);\n }\n\n static formalName () {\n return FORMAL_NAME;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys((localOptions)).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getQualifiedStateProps () {\n const unitState = VisualUnit.getState();\n return unitState.map((state, i) => Object.keys(state).map(prop => `${unitNs[i]}.${prop}`));\n }\n\n static getListeners () {\n return {\n store: [...listenerMap.map((d) => {\n const o = Object.assign({}, d);\n const localNs = unitNs[1];\n o.props = o.props.map(prop => `${localNs}.${prop}`);\n return o;\n }), {\n type: 'registerImmediateListener',\n props: [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`],\n listener: calculateDomainListener\n }, {\n type: 'registerImmediateListener',\n props: [`${unitNs[1]}.${WIDTH}`,\n `${unitNs[1]}.${HEIGHT}`,\n ...['x', 'y'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context, [, width], [, height]) => {\n if (width && height) {\n attachDataToGridLineLayers(context);\n }\n },\n subNamespace: (context) => {\n const { rowIndex, colIndex, namespace } = context.metaInf();\n return {\n [`${unitNs[1]}.${WIDTH}`]: namespace,\n [`${unitNs[1]}.${HEIGHT}`]: namespace,\n [`${groupNs}.domain.x`]: `${colIndex}0`,\n [`${groupNs}.domain.y`]: `${rowIndex}0`\n };\n }\n }],\n throwback: [\n {\n type: 'registerChangeListener',\n props: [CommonProps.ON_LAYER_DRAW],\n listener: (context, [, drawn]) => {\n if (drawn) {\n const firebolt = context.firebolt();\n dispatchQueuedSideEffects(firebolt);\n clearActionHistory(firebolt);\n }\n context._renderedResolve();\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'drawn',\n formalName: 'layer'\n });\n }\n }\n ]\n };\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { throwback, fireboltDeps } = this._dependencies;\n const { namespace } = this.metaInf();\n\n store.addSubNamespace(namespace, FORMAL_NAME, this);\n throwback.addSubNamespace(namespace, FORMAL_NAME, this);\n transactor(this, localOptions, store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}`\n });\n\n this.firebolt(new UnitFireBolt(this, {\n physical: Object.assign({}, physicalActions, fireboltDeps.physicalActions),\n behavioural: Object.assign({}, behaviouralActions, fireboltDeps.behaviouralActions),\n physicalBehaviouralMap: actionBehaviourMap\n }, Object.assign({}, sideEffects, fireboltDeps.sideEffects), behaviourEffectMap));\n return this;\n }\n return this._store;\n }\n\n /**\n * Static helper for creates a unit instance\n *\n * @param {Object} [id] optional unique identifier for a unit; , id is calculated internally\n * @param {DataModel} data instance of datamodel\n * @param {Array.} layers layer configuration\n * @param {Object} config configurtion for the visual unit\n * @return {VisualUnit} Instance of a unit\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Returns the instance of firebolt associated with this visual unit. Firebolt dispatches the behavioural actions\n * when any physical action happens on the elements of visual unit.\n *\n * @public\n *\n * @return {Firebolt} Instance of firebolt.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Returns the unique id of this visual unit.\n *\n * @public\n * @return {string} Unique identifier.\n */\n id () {\n return this._id;\n }\n\n lockModel () {\n this.store().lockModel();\n return this;\n }\n\n unlockModel () {\n this.store().unlockModel();\n return this;\n }\n\n timeDiffsByField (...params) {\n if (params.length) {\n return this;\n }\n return this._timeDiffsByField;\n }\n\n /**\n * Renders the visual unit. It creates the layout and renders the axes and layers.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n render (container) {\n const config = this.config();\n const { className, defClassName, sideEffectClassName, classPrefix } = config;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const width = this.width();\n const height = this.height();\n const containerSelection = selectElement(container).style('position', 'relative');\n\n this._rootSvg = makeElement(containerSelection, 'svg', [null], className)\n .style('width', `${width}px`).style('height', `${height}px`);\n\n const node = this._rootSvg.node();\n setAttrs(node, {\n width,\n height,\n class: qualifiedClassName.join(' ')\n });\n\n setAxisRange(this);\n renderGridLineLayers(this, node);\n renderLayers(this, node, this.layers(), {\n width,\n height\n });\n this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`);\n const firebolt = this.firebolt();\n initSideEffects(firebolt.sideEffects(), firebolt);\n return this;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Caches all the datamodels in an array from the next `data()` call on visual unit until `clearCaching()` or\n * `resetData()` is called on it.\n *\n * @public\n * @return {VisualUnit} Instance of visual unit.\n */\n\n enableCaching () {\n this._cache = true;\n return this;\n }\n\n /**\n * Clears all the previous cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n clearCaching () {\n this._cache = false;\n this.cachedData([this.cachedData()[0]]);\n return this;\n }\n\n /**\n * Returns the drawing information from visual unit.Drawing context contains the dimensions of unit and the svg\n * container of the visual unit.\n *\n * @public\n *\n * @return {Object} Drawing information.\n * ```\n * {\n * htmlContainer: // Html container of svg container of the visual unit\n * svgContainer: // Root svg container\n * width: // Width of the visual unit\n * height: // Height of the visual unit\n * sideEffectGroup: // Svg group for drawing side effect elements.\n * parentContainer: // Parent html container of the visual unit.\n * xOffset: // x offset space from the starting x position of the container,\n * yOffset: // y offset space from the starting y position of the container\n * }\n * ```\n */\n getDrawingContext () {\n const rootSvg = this._rootSvg && this._rootSvg.node();\n const width = this.width();\n const height = this.height();\n const { el, dimensions } = this.parentContainerInf();\n return {\n htmlContainer: this.mount(),\n svgContainer: rootSvg,\n width,\n height,\n sideEffectGroup: this._sideEffectGroup,\n parentContainer: el,\n parentContainerDimensions: dimensions,\n xOffset: 0,\n yOffset: 0\n };\n }\n\n /**\n * Returns the serialized configuration of visual unit.\n *\n * @return {Object} serialized configuration\n */\n serialize () {\n return {\n layers: this.layers().map(layer => layer.serialize()),\n config: this.config(),\n axes: this.axes().map(axis => axis.serialize())\n };\n }\n\n mount (...mount) {\n if (mount.length) {\n this._mount = mount[0];\n this.render(mount[0]);\n this.firebolt().mapActionsAndBehaviour();\n return this;\n }\n return this._mount;\n }\n\n /**\n * Adds a new layer to the visual unit. It takes a layer definition and creates layer instances from them. It does\n * not render the layers. It returns the layer instances in an array. If the layer definition is a composite layer,\n * then multiple layer instances will be returned in the array.\n *\n * To add a layer in the unit,\n * ```\n * unit.addLayer({\n * name: 'bullet',\n * mark: 'bar',\n * encoding: {\n * x: 'Year',\n * y: 'Acceleration',\n * color: 'Origin'\n * }\n * });\n * ```\n * @public\n * @param {Object} layerDef Definition of new layer.\n *\n * @return {Array} Array of layer instances.\n */\n addLayer (layerDefinition) {\n if (layerDefinition instanceof Function) {\n this._queuedLayerDefs.push(layerDefinition);\n return this;\n }\n const layerDefinitions = sanitizeLayerDef(toArray(layerDefinition));\n\n const layersMap = this._layersMap;\n const markSet = {};\n const store = {\n layers: {},\n components: {\n unit: this\n }\n };\n let layerIndex = 0;\n const metaInf = this.metaInf();\n const layers = layerDefinitions.sort((a, b) => a.order - b.order).reduce((layersArr, layerDef) => {\n const definition = layerDef.def;\n const markId = definition.name;\n const defArr = toArray(definition);\n const namespaces = [];\n defArr.forEach((def) => {\n def.order = layerDef.order + layerIndex;\n const namespace = `${metaInf.namespace}-${def.mark}-${getUniqueId()}`;\n namespaces.push(namespace);\n });\n layerIndex += defArr.length;\n const instances = getLayerFromDef(this, definition, layersMap[markId], namespaces);\n store.layers = Object.assign(store.layers, instances);\n const instanceValues = Object.values(instances);\n layersArr = layersArr.concat(...instanceValues);\n layersMap[markId] = instanceValues;\n markSet[markId] = markId;\n return layersArr;\n }, []);\n\n store.unit = this;\n const layerdeps = {};\n const layersArr = [].concat(...Object.values(this._layersMap));\n layersArr.forEach((layer) => {\n const alias = layer.alias();\n store.layers[alias] = layer;\n layerdeps[alias] = [];\n });\n layers.forEach((layer) => {\n const depArr = resolveEncodingTransform(layer, store);\n layerdeps[layer.alias()] = depArr;\n });\n\n this._layerDepOrder = layerdeps;\n this._layerAxisIndex = Object.assign(this._layerAxisIndex, getLayerAxisIndex(layers, this.fields()));\n this.layers(layersArr);\n return layers;\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n remove () {\n const formalName = this.constructor.formalName();\n const { lifeCycleManager, throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n lifeCycleManager.notify({ client: this, action: 'beforeremove', formalName: 'unit' });\n const layers = this.layers();\n this.store().removeSubNamespace(namespace, formalName);\n throwback.removeSubNamespace(namespace, FORMAL_NAME);\n selectElement(this.mount()).remove();\n this.firebolt().remove();\n // Remove layers\n lifeCycleManager.notify({ client: layers, action: 'beforeremove', formalName: 'layer' });\n [...layers, ...this._gridLines, ...this._gridBands].forEach(layer => layer.remove());\n lifeCycleManager.notify({ client: layers, action: 'removed', formalName: 'layer' });\n lifeCycleManager.notify({ client: this, action: 'removed', formalName: 'unit' });\n return this;\n }\n\n /**\n *\n *\n * @param {*} identifiers\n *\n * @memberof VisualUnit\n */\n getDataModelFromIdentifiers (identifiers, mode, parentModel) {\n if (identifiers === null) {\n return null;\n }\n const dataModel = parentModel || this.data();\n return getDataModelFromIdentifiers(dataModel, identifiers, mode);\n }\n\n /**\n * Resets the data of visual unit to original data model. It also clears the cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n resetData () {\n this.data(this.cachedData()[0]);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n getSourceInfo () {\n return {\n dimensionMeasureMap: this._dimensionMeasureMap,\n fields: this.fields(),\n data: this.data(),\n axes: this.axes()\n };\n }\n\n getDataDomain () {\n return this.store().get(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`, this.metaInf().namespace);\n }\n\n /**\n *\n *\n *\n * @memberof VisualUnit\n */\n getDefaultTargetContainer () {\n const { classPrefix, defClassName } = this.config();\n return [`.${classPrefix}-${defClassName}`];\n }\n\n /**\n * Returns an array of layer instances which matches the supplied mark type.\n *\n * @public\n *\n * @param {string} type Mark type of layer.\n *\n * @return {Array} Array of layer instances.\n */\n getLayersByType (type) {\n const layers = getLayersBy(this.layers(), 'type', type);\n return layers;\n }\n\n /**\n * Returns the layer instance which matches the supplied layer name. If no layer is found, then it returns\n * undefined.\n *\n * @public\n * @param {string} name Name of layer.\n *\n * @return {VisualUnit} Layer instance.\n */\n getLayerByName (name) {\n const layers = getLayersBy(this.layers(), 'name', name);\n return layers[0];\n }\n\n /**\n * Returns the point located nearest to the supplied x and y position. It returns the unique identifiers of the\n * point. This function also accepts an additional configuration `getAllPoints` inside `config` object in the third\n * argument which if set to true, then it returns the identifiers of all the points which falls on the nearest\n * x value or y value if any one of the field is a dimension. Additionally, a target property is also returned\n * which contains the identifier of the nearest point. If no nearest point is found, then it returns identifier\n * as null.\n *\n * @public\n *\n * @param {number} x X Position of the point from where nearest point is to be found.\n * @param {number} y Y Position of the point from where nearest point is to be found.\n * @param {Object} config Additional configuration options.\n * @param {boolean} config.getAllPoints If true, then returns all the points nearest to the x value or y value if\n * it is dimension.\n * @param {Object} config.data Data associated with the nearest point.\n * @return {Object} Nearest point information\n * ```\n * {\n * id: [['Origin'], ['USA'], ['Japan']], // Identifiers of all the points closest to the x value.\n * target: [['Origin'], ['Japan']] // Identifier of the nearest point.\n * }\n * ```\n */\n getNearestPoint (x, y, config) {\n let pointObj = {\n id: null\n };\n const dimValue = getNearestDimensionalValue(this, {\n x,\n y\n });\n\n if (dimValue !== null && config.getAllPoints) {\n pointObj.id = dimValue;\n const pointInf = this.getMarkInfFromLayers(x, y, config);\n pointObj.target = pointInf && pointInf.id ? pointInf.id : pointObj.id;\n return pointObj;\n }\n\n const markInf = this.getMarkInfFromLayers(x, y, config) || { id: null };\n pointObj = Object.assign({}, markInf);\n\n pointObj.target = markInf.id;\n return pointObj;\n }\n\n getMarkInfFromLayers (x, y, args) {\n const layers = this.layers();\n const len = layers.length;\n let point = null;\n // Iterate through the layers array and fetch the nearest point from each layer. If a valid\n // nearest point is found from any layer, then return that point.\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n const config = layer.config();\n if (config.interactive !== false) {\n point = layer.getNearestPoint(x, y, args);\n }\n if (point) {\n return point;\n }\n }\n return point;\n }\n\n /**\n * Get the information of all the marks such as x, y position and size from supplied identifiers. It\n * returns an array of points whose data matches the given identifiers.\n *\n * @public\n *\n * @param {Array|Object} identifiers Field names and their corresponding values.\n * ```\n * identifiers can be given in an array of array,\n * ['Origin', 'Name'], // Names of the fields supplied in first array\n * ['USA', 'ford'], // Data values of each field supplied in rest of the arrays.\n * ['Japan', 'ford']\n * or in an object,\n * {\n * Origin: ['USA']\n * }\n * ```\n * @param {Object} config Optional configurations which decides which information of the mark will\n * be retrieved.\n * @param {boolean} [config.getAllAttrs = false] If true, then returns all the information of each mark.\n * @param {boolean} [config.getBBox = false] If true, then returns the bounding box of each mark.\n *\n * @return {Array} Array of objects containing the information of each point.\n * ```\n * By default, the method returns the array of points in this structure,\n * [\n * {\n * x: 20,\n * y: 100,\n * width: 200,\n * height: 100\n * }\n * ]\n * If 'config.getAllAttrs' is true, then it returns all the information of each mark,\n * [\n * // Positions of mark on initial state of transition.\n * enter: {\n * x: 0,\n * y: 0\n * },\n * // Final positions of the mark\n * update: {\n * x: 20,\n * y: 10\n * },\n * style: // css styles of each mark\n * source: [200, 'USA'] // Row information of each mark\n * id: 20 // Row id of each mark\n * ]\n * ```\n */\n getPlotPointsFromIdentifiers (identifiers, config = {}) {\n let points = [];\n let parsedIdentifiers = identifiers;\n if (identifiers === null) {\n return [];\n }\n const layers = this.layers();\n const len = layers.length;\n if (isSimpleObject(identifiers)) {\n parsedIdentifiers = [Object.keys(identifiers)];\n parsedIdentifiers = [...parsedIdentifiers, ...transposeArray(Object.values(identifiers))];\n }\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n if (layer.config().interactive !== false) {\n points = [...points, ...layer.getPointsFromIdentifiers(parsedIdentifiers, config)];\n }\n }\n return points;\n }\n\n /**\n * Removes the layer instance which matches the supplied layer name.\n *\n * @public\n * @param {string} name Name of layer\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayerByName (name) {\n removeLayersBy('name', name);\n return this;\n }\n\n /**\n * Removes all the layer instances which matches the supplied mark type.\n *\n * @public\n * @param {string} type Mark type of layer.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayersByType (type) {\n removeLayersBy('type', type);\n return this;\n }\n}\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n *\n *\n * @export\n * @class Variable\n */\nexport default class Variable {\n\n /**\n *\n *\n * @memberof Variable\n */\n type () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof Variable\n */\n toString () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n}\n","import Variable from './variable';\n\n/**\n * This is a wrapper on top of multiple variables which are of same type but they are shown in the same axis.This is\n * required in case of range plots or ohlc plots where one plot is mapped to multiple measure fields. At that time,\n * we need to create a composed variable from multiple variables. This class just wraps them into one variable instance\n * and provides methods to get the type and other common functionalities which can be performed on a simple variable\n * instance.\n *\n * @public\n * @class ComposeVars\n */\nclass ComposedVars extends Variable {\n\n /**\n * Creates an instance of ComposeVars.\n *\n * @param {Array} vars Array of SimpleVars.\n */\n constructor (...vars) {\n super();\n this.vars(vars);\n }\n\n vars (...params) {\n if (params.length) {\n this._vars = params[0];\n return this;\n }\n return this._vars;\n }\n\n data (...dm) {\n if (dm.length) {\n this.vars().forEach(d => d.data(dm[0]));\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n /**\n * Get all the field names from composed variable instance.\n *\n * @public\n * @return {Array} Array of field names.\n */\n getMembers () {\n const vars = this.vars();\n return vars.map(member => member.getMembers()[0]);\n }\n\n /**\n * Type of field associated with this composed variable.\n *\n * @return {string} Type of variable (Measure/Dimension).\n */\n type () {\n return this.vars()[0].type();\n }\n\n toString () {\n return this.vars().map(d => d.toString()).join(',');\n }\n\n /**\n * Returns the number formatter function of the variable.\n *\n * @return {Function} Number formatter function of the variable.\n */\n numberFormat () {\n return this.vars()[0].numberFormat();\n }\n\n format (values) {\n return this.vars()[0].format(values);\n }\n\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.vars()[0]].def;\n }\n\n /**\n * Returns the subtype of the fields associated with this variable instance.\n *\n * @public\n * @return {string} Subtype of the variable.\n */\n subtype () {\n return this.vars()[0].subtype();\n }\n\n /**\n * Returns the consecutive minimum difference of the field values.\n *\n * @public\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n return this.vars()[0].getMinDiff();\n }\n\n /**\n * Returns the display name of the fields.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return this.vars().map(d => d.displayName()).join(',');\n }\n}\n\nexport default ComposedVars;\n","import { DateTimeFormatter, retrieveFieldDisplayName, DimensionSubtype } from 'muze-utils';\nimport Variable from './variable';\n\n/**\n * This is a wrapper on top of fields passed in rows or columns in canvas. This is used to get the type of field or\n * get min difference from the field values.\n *\n * @public\n * @class SimpleVariable\n */\nexport default class SimpleVariable extends Variable {\n\n /**\n * Creates an instance of simple variable instance.\n *\n * @param {string} name Field name.\n */\n constructor (name) {\n super();\n this.oneVar(name);\n }\n\n /**\n * Gets the field name associated with this variable instance.\n *\n * @public\n * @return {string} Name of the field.\n */\n oneVar (...oneV) {\n if (oneV.length) {\n this._oneVar = oneV[0];\n return this;\n }\n return this._oneVar;\n }\n\n data (...dm) {\n if (dm.length) {\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n toString () {\n return this.oneVar();\n }\n\n /**\n * Gets the number formatter function of this variable.\n *\n * @public\n * @return {Function} Number formatter function.\n */\n numberFormat () {\n if (this.type() === 'measure') {\n const formatter = this.data().getFieldspace().getMeasure()[this.oneVar()];\n return formatter.numberFormat();\n } return val => val;\n }\n\n format (values) {\n if (values && this.subtype() === 'temporal') {\n const formatter = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n const dtFormat = new DateTimeFormatter(formatter);\n values = values.map(e => dtFormat.getNativeDate(e));\n }\n return values;\n }\n\n /**\n * Returns a formatter function which transforms the input value to its original form.\n *\n * @public\n * @return {Function} Returns raw formatter function.\n */\n rawFormat () {\n if (this.subtype() === DimensionSubtype.TEMPORAL) {\n const dateFormat = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n return val => DateTimeFormatter.formatAs(val, dateFormat);\n }\n return val => val;\n }\n\n /**\n * Return the field names associated with this variable instance.\n *\n * @public\n * @return {Array} Array of fields.\n */\n getMembers () {\n return [this.oneVar()];\n }\n\n /**\n * Returns the type of the variable. Whether it is measure or dimension.\n *\n * @public\n * @return {string} Type of variable.\n */\n type () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.type;\n }\n\n /**\n * Returns the subtype of the variable. Subtype can be categorical or temporal. If no subtype is found, then it\n * returns the type of the variable.\n *\n * @public\n * @return {string} Subtype of variable.\n */\n subtype () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.subtype || fieldDef.type;\n }\n\n /**\n * Returns the minimum consecutive difference between the data values of this variable.\n *\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n const fieldSpace = this.data().getFieldspace();\n return fieldSpace.fieldsObj()[this.oneVar()].minimumConsecutiveDifference();\n }\n\n /**\n * Returns true if two variable instances are same.If both variable has the same field names, they are equal.\n *\n * @return {Boolean} Whether two variable instances are same.\n */\n equals (varInst) {\n return this.oneVar() === varInst.oneVar();\n }\n\n /**\n * Returns the display name of the field.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return retrieveFieldDisplayName(this.data(), this.oneVar());\n }\n\n /**\n * Returns the schema defination of the field.\n *\n * @return {Object} schema def\n */\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.oneVar()].def;\n }\n}\n","import { ComposedVars, SimpleVariable } from '../variable';\nimport { DIMENSION, COLUMNS, ROWS, TEMPORAL } from '../enums/constants';\n\n/**\n * Gets the list of fields in a sorted order by measurement and dimension\n *\n * @param {Array} fieldList List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields sorted by measurement and dimensions\n */\nconst orderFields = (fieldArray, type) => {\n const dimensionArr = [[], []];\n const measureArr = [[], []];\n const temporalArr = [[], []];\n const categoricalArr = [[], []];\n\n fieldArray.forEach((fieldList, index) => {\n fieldList.forEach((field) => {\n if (field.type() === DIMENSION) {\n dimensionArr[index].push(field);\n field.subtype() === TEMPORAL ? temporalArr[index].push(field) : categoricalArr[index].push(field);\n } else {\n measureArr[index].push(field);\n }\n });\n });\n\n const numOfMeasures = measureArr[0].length + (measureArr[1] ? measureArr[1].length : 0);\n\n // Single array of fields\n if (!fieldArray[1]) {\n // Push measures to bottom\n measureArr[1] = type === COLUMNS ? measureArr[0] : [];\n // Push measures to left\n measureArr[0] = type !== COLUMNS ? measureArr[0] : [];\n // Bottom and right dimensions empty\n dimensionArr[1] = [];\n // Left and top filled with dimensions\n dimensionArr[0] = dimensionArr[0];\n if (numOfMeasures === 0) {\n const allDimensions = [...dimensionArr[0], ...dimensionArr[1]];\n if (type === COLUMNS) {\n dimensionArr[1] = allDimensions[allDimensions.length - 1] ? [allDimensions[allDimensions.length - 1]]\n : [];\n allDimensions.splice(-1, 1);\n } else {\n dimensionArr[1] = [];\n }\n dimensionArr[0] = [...allDimensions];\n }\n }\n\n if (dimensionArr[0].length && dimensionArr[1].length && numOfMeasures > 0) {\n dimensionArr[0] = [...dimensionArr[0], ...dimensionArr[1]];\n dimensionArr[1] = [];\n }\n return {\n fields: dimensionArr.map((list, i) => (i === 1 ?\n measureArr[i].concat(dimensionArr[i]) : dimensionArr[i].concat(measureArr[i]))),\n dimensions: [...dimensionArr[0], ...dimensionArr[1]],\n measures: [...measureArr[0], ...measureArr[1]],\n temporal: [...temporalArr[0], ...temporalArr[1]],\n categorical: [...categoricalArr[0], ...categoricalArr[1]]\n };\n};\n\n/**\n * Gets the list of normalized fields\n *\n * @param {Array} fields List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields normalized by measurement and dimensions\n */\nconst normalizeFields = (config, type) => {\n const fieldsArr = [];\n const fields = config[type];\n\n if (!(fields[0] instanceof Array)) {\n fieldsArr[0] = fields;\n } else {\n fieldsArr[0] = fields[0] || [];\n fieldsArr[1] = fields[1] || [];\n }\n return fieldsArr;\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} datamodel\n *\n */\nconst convertToVar = (datamodel, fields) => {\n const vars = [];\n\n fields && fields.forEach((field) => {\n if (field instanceof ComposedVars) {\n vars.push(field);\n field.data(datamodel);\n } else {\n vars.push(new SimpleVariable(field).data(datamodel));\n }\n });\n return vars;\n};\n\n/**\n *\n *\n * @param {*} rows\n * @param {*} columns\n * @param {*} datamodel\n *\n */\nexport const transformFields = (datamodel, config) => {\n const [rowsInfo, columnsInfo] = [ROWS, COLUMNS].map((fields) => {\n const normalizedFields = normalizeFields(config, fields);\n const norFields = [convertToVar(datamodel, normalizedFields[0])];\n\n if (normalizedFields[1]) {\n norFields[1] = convertToVar(datamodel, normalizedFields[1]);\n }\n return orderFields(norFields, fields);\n });\n const {\n fields: rows,\n dimensions: rowDimensions,\n measures: rowMeasures,\n temporal: rowTemporalFields,\n categorical: rowCategoricalFields\n } = rowsInfo;\n const {\n fields: columns,\n dimensions: columnDimensions,\n measures: columnMeasures,\n temporal: columnTemporalFields,\n categorical: columnCategoricalFields\n } = columnsInfo;\n return {\n rows,\n rowDimensions,\n rowMeasures,\n rowTemporalFields,\n rowCategoricalFields,\n columns,\n columnTemporalFields,\n columnCategoricalFields,\n columnDimensions,\n columnMeasures\n };\n};\n","import { ERROR_MSG, mergeRecursive } from 'muze-utils';\nimport { transformFields } from './field-sanitizer';\nimport { getHeaderAxisFrom } from '../group-helper/group-utils';\nimport { ROW, COLUMN } from '../enums/constants';\n\n/**\n *\n *\n * @export\n * @class VisualEncoder\n */\nexport default class VisualEncoder {\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n createAxis () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n setCommonDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n getLayerConfig () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n fieldInfo (...info) {\n if (info.length) {\n this._fieldInfo = mergeRecursive(this._fieldInfo || {}, info[0]);\n return this;\n }\n return this._fieldInfo;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof VisualEncoder\n */\n fieldSanitizer (datamodel, config) {\n this.fieldInfo(transformFields(datamodel, config));\n return this.fieldInfo();\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n axisFrom (...params) {\n if (params.length) {\n this._axisFrom = params[0];\n return this;\n }\n return this._axisFrom;\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n headerFrom (...params) {\n if (params.length) {\n this._headerFrom = params[0];\n return this;\n }\n return this.__headerFrom;\n }\n\n /**\n *\n *\n * @param {*} axisFrom\n *\n * @memberof CartesianEncoder\n */\n setAxisAndHeaders (axisFrom = {}, fields) {\n const [rowHeader, rowAxis] = getHeaderAxisFrom(ROW, fields.rows, axisFrom);\n const [colHeader, colAxis] = getHeaderAxisFrom(COLUMN, fields.columns, axisFrom);\n\n this.axisFrom({\n row: rowAxis,\n column: colAxis\n });\n this.headerFrom({\n row: rowHeader,\n column: colHeader\n });\n return this;\n }\n}\n","import { ContinousAxis, BandAxis, TimeAxis, ColorAxis, SizeAxis, ShapeAxis } from '@chartshq/muze-axis';\n\nexport const scaleMaps = {\n linear: ContinousAxis,\n band: BandAxis,\n temporal: TimeAxis,\n size: SizeAxis,\n color: ColorAxis,\n shape: ShapeAxis\n};\n","import { ScaleType } from '@chartshq/muze-axis';\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n dimension: ScaleType.BAND,\n categorical: ScaleType.BAND,\n temporal: ScaleType.TIME,\n measure: ScaleType.LINEAR,\n continuous: ScaleType.LINEAR\n};\n","import { mergeRecursive, getObjProp } from 'muze-utils';\nimport { AxisOrientation } from '@chartshq/muze-axis';\nimport { ENCODING } from '@chartshq/visual-layer';\nimport { scaleMaps } from '../enums/scale-maps';\nimport { getAxisType, getAxisKey } from '../group-helper';\nimport { dataTypeScaleMap } from '../data-type-scale-map';\nimport { CATEGORICAL, TEMPORAL, BAR, LINE, POINT, BOTH, Y, COLOR, SHAPE, SIZE, ANGLE0 } from '../enums/constants';\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst getAxisConfig = (axisInfo, field, axesCreators, indices, facetFields) => {\n let axisOrientation;\n const { index, axisIndex, axisType } = axisInfo;\n const { config, position } = axesCreators;\n const { rowIndex, columnIndex } = indices;\n const rawUserAxisConfig = config.axes ? (config.axes[axisType] || {}) : {};\n\n // Change config object to a function if not already one\n const userAxisConfigFn = typeof rawUserAxisConfig !== 'function' ?\n () => rawUserAxisConfig : rawUserAxisConfig;\n const userAxisConfig = userAxisConfigFn(rowIndex, columnIndex, {\n axisFields: field.getMembers(),\n facetFields\n });\n\n // If current config does not specifes config for an axis, retain old config\n if (!userAxisConfig) {\n return {};\n }\n\n const {\n LEFT,\n RIGHT,\n TOP,\n BOTTOM\n } = AxisOrientation;\n const allOrientations = axisType === Y ? [LEFT, RIGHT] : [TOP, BOTTOM];\n\n if (position === BOTH) {\n axisOrientation = allOrientations[axisIndex];\n } else {\n axisOrientation = position;\n }\n const axisConfig = {\n id: `${axisType}-${index}-${axisIndex}`,\n name: field.displayName(),\n field: field.toString(),\n numberFormat: field.numberFormat(),\n orientation: axisOrientation,\n showAxisName: true,\n show: true,\n type: dataTypeScaleMap[field.subtype()]\n };\n userAxisConfig.tickValues = field.format(userAxisConfig.tickValues);\n userAxisConfig.domain = field.format(userAxisConfig.domain);\n\n return mergeRecursive(axisConfig, userAxisConfig);\n};\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst createSimpleAxis = (axisConfig, field, axesCreators) => {\n const { labelManager } = axesCreators;\n const Cls = scaleMaps[dataTypeScaleMap[field.subtype()]];\n const simpleAxis = new Cls(axisConfig, { labelManager });\n return simpleAxis;\n};\n\nexport const getAdjustedDomain = (max, min) => {\n const y1ratio = max[0] / (max[0] - min[0]);\n const y2ratio = max[1] / (max[1] - min[1]);\n\n // adjust min/max values for positive negative values zero line etc\n let allSameSign = false;\n\n // if all numbers are positive set floor to zero\n if (min[0] > 0 && min[1] > 0 && min[1] > 0 && max[1] > 0) {\n allSameSign = true;\n min[0] = 0;\n min[1] = 0;\n }\n\n // if all numbers are negative set ceiling to zero\n if (min[0] < 0 && min[1] < 0 && min[1] < 0 && max[1] < 0) {\n allSameSign = true;\n max[0] = 0;\n max[1] = 0;\n }\n\n // align zero line if necessary\n if (!allSameSign && y1ratio !== y2ratio) {\n if (y1ratio < y2ratio) {\n // adjust min[1]\n min[1] = min[0] / max[0] * max[1];\n } else {\n // adjust min[0]\n min[0] = min[1] / max[1] * max[0];\n }\n }\n return [\n [min[0], max[0]],\n [min[1], max[1]]\n ];\n};\n\n/**\n *\n *\n * @param {*} axisType\n * @param {*} fieldInfo\n * @param {*} axesCreators\n * @param {*} groupAxes\n *\n */\nexport const generateAxisFromMap = (axisType, fieldInfo, axesCreators, axesInfo, indices, facetFields) => {\n let axisKey;\n const { groupAxes, valueParser } = axesInfo;\n const currentAxes = [];\n const { fields, index } = fieldInfo;\n const { cacheMaps } = axesCreators;\n const map = cacheMaps[`${axisType}AxesMap`];\n\n const commonAxisKey = getAxisKey(axisType, index);\n fields.forEach((field, axisIndex) => {\n axisKey = getAxisKey(axisType, index, axisIndex, dataTypeScaleMap[field.subtype()]);\n const axisConfig = getAxisConfig({ index, axisIndex, axisType }, field, axesCreators, indices, facetFields);\n\n let axis;\n if (!map.has(axisKey)) {\n axis = createSimpleAxis(axisConfig, field, axesCreators);\n } else {\n axis = map.get(axisKey);\n axis._rotationLock = false;\n axis.config(axisConfig);\n }\n axis.valueParser(valueParser);\n currentAxes.push(axis);\n map.set(axisKey, axis);\n });\n\n if (currentAxes.length) {\n map.set(commonAxisKey, currentAxes);\n groupAxes.add(commonAxisKey);\n }\n\n return currentAxes;\n};\n\nexport const sanitizeIndividualLayerConfig = (encodingConfigs, def) => {\n [COLOR, SHAPE, SIZE].forEach((axis) => {\n if (encodingConfigs[axis] && encodingConfigs[axis].field) {\n def.forEach((conf) => {\n conf.encoding = conf.encoding || {};\n !conf.encoding[axis] && (conf.encoding[axis] = {});\n conf.encoding[axis].field = encodingConfigs[axis].field;\n });\n }\n });\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n const xAxes = [];\n const yAxes = [];\n\n xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes.push(xAxis);\n });\n yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes.push(yAxis);\n });\n return {\n xAxes, yAxes\n };\n};\n\n/**\n * return a default mark based on predefined set of rules of type and subtype of the fields\n *\n * @param {string} colFieldType dimension/measure - temporal/ordinal/nominal\n * @param {string} rowFieldType dimension/measure - temporal/ordinal/nominal\n * @return {Object} return mark type\n */\nexport const getDefaultMark = (colFieldType, rowFieldType) => {\n let mark;\n\n if (colFieldType === CATEGORICAL || rowFieldType === CATEGORICAL) {\n mark = BAR;\n } else if (colFieldType === TEMPORAL || rowFieldType === TEMPORAL) {\n mark = LINE;\n } else {\n mark = POINT;\n }\n\n return mark;\n};\n\n/**\n *\n *\n * @param {*} axesCreators\n * @param {*} [fieldInfo=[]]\n *\n */\nexport const createRetinalAxis = (axesCreators, fieldProps = {}) => {\n const { axisType, fieldsConfig } = axesCreators;\n const field = fieldProps.field;\n const axis = [];\n const Cls = scaleMaps[axisType];\n\n fieldProps.type = fieldProps.type ? fieldProps.type : getAxisType(fieldsConfig, field || null);\n axis.push(new Cls(fieldProps));\n return axis;\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} val\n *\n */\nexport const getIndex = (arr, val) => {\n let i = 0;\n let arrIndex = -1;\n\n while (arrIndex === -1 && i < arr.length) {\n if (arr[i].toString() === val.toString()) {\n arrIndex = i;\n }\n i++;\n }\n return arrIndex;\n};\n\n/**\n *\n *\n * @param {*} colFields\n * @param {*} rowFields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\nexport const getLayerConfFromFields = (colFields, rowFields, userLayerConfig) => userLayerConfig.filter((conf) => {\n const userConf = conf instanceof Array ? conf : [conf];\n const encodingArr = [].concat(...userConf.map(d => d.encoding).filter(d => d !== undefined));\n\n if (!encodingArr.length) {\n return true;\n }\n\n const xFields = [].concat(...encodingArr.map(d => [d.x && d.x.field, d.x0 && d.x0.field]))\n .filter(d => d !== undefined && d !== null);\n const yFields = [].concat(...encodingArr.map(d => [d.y && d.y.field, d.y0 && d.y0.field]))\n .filter(d => d !== undefined && d !== null);\n\n if (!xFields.length && !yFields.length) {\n return true;\n }\n\n const colFieldExist = xFields.length ? xFields.every(d => colFields.indexOf(d) !== -1) : false;\n const rowFieldExist = yFields.length ? yFields.every(d => rowFields.indexOf(d) !== -1) : false;\n if (xFields.length && yFields.length) {\n return colFieldExist && rowFieldExist;\n }\n return colFieldExist || rowFieldExist;\n});\n\nexport const resolveAxisConfig = (context, fieldInf, axisInfo) => {\n const { rowIndex, columnIndex, axesObj } = axisInfo;\n const { config, facetFields, resolver } = context;\n const resolverAxes = resolver.axes();\n const { RADIUS, ANGLE } = ENCODING;\n [RADIUS, ANGLE, ANGLE0].forEach((enc) => {\n const axesArr = resolverAxes[enc];\n if (!axesArr[rowIndex]) {\n axesArr[rowIndex] = [];\n }\n axesArr[rowIndex][columnIndex] = axesObj[enc];\n const axisConfig = getObjProp(config.axes, enc) || {};\n\n axesObj[enc].forEach((axis, i) => {\n let userConfig = axisConfig;\n if (axisConfig instanceof Function) {\n userConfig = axisConfig(rowIndex, columnIndex, {\n axisFields: [fieldInf[enc][i]],\n facetFields\n });\n }\n axis.config(userConfig);\n });\n });\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n unionDomain,\n COORD_TYPES,\n toArray,\n sortCategoricalField\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport {\n generateAxisFromMap,\n getDefaultMark,\n getIndex,\n getLayerConfFromFields,\n getAdjustedDomain,\n sanitizeIndividualLayerConfig\n} from './encoder-helper';\nimport { retriveDomainFromData } from '../group-helper';\n\nimport { ROW, COLUMN, COL, LEFT, TOP, MEASURE, BOTH, X, Y } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\nconst CARTESIAN = COORD_TYPES.CARTESIAN;\n\n/**\n *\n *\n * @export\n * @class CartesianEncoder\n * @extends {VisualEncoder}\n */\nexport default class CartesianEncoder extends VisualEncoder {\n\n /**\n *\n *\n *\n * @memberof CartesianEncoder\n */\n static type () {\n return CARTESIAN;\n }\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof CartesianEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const geomCellAxes = {};\n const {\n axes\n } = axesCreators;\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const axisFields = [{\n fields: rowFields,\n index: rowIndex\n }, {\n fields: columnFields,\n index: columnIndex\n }];\n const { resolver, facetFields, geomCell } = context;\n const xAxes = axes.x || [];\n const yAxes = axes.y || [];\n\n [rowFields, columnFields].forEach((fields, i) => {\n const type = i === 0 ? ROW : COLUMN;\n const axis = i === 0 ? Y : X;\n\n if (fields.length > 1) {\n axesCreators.position = BOTH;\n } else {\n axesCreators.position = this.axisFrom()[type];\n }\n geomCellAxes[axis] = generateAxisFromMap(axis, axisFields[i], axesCreators, {\n groupAxes: axis === X ? xAxes : yAxes,\n valueParser: resolver.valueParser()\n }, indices, facetFields);\n });\n geomCell.axes(geomCellAxes);\n return geomCellAxes;\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n const resolver = context.resolver();\n const units = resolver.units();\n const domains = {\n 0: {},\n 1: {}\n };\n const config = context.config();\n const fieldsObj = {\n 0: {},\n 1: {}\n };\n\n for (let rIdx = 0, len = units.length; rIdx < len; rIdx++) {\n const unitsArr = units[rIdx];\n for (let cIdx = 0, len2 = unitsArr.length; cIdx < len2; cIdx++) {\n const unit = unitsArr[cIdx];\n const axisFields = unit.fields();\n const encodingDomains = unit.getDataDomain();\n ['x', 'y'].forEach((axisType, axisTypeIndex) => {\n const fieldArr = axisFields[axisType];\n fieldArr.forEach((field, axisIndex) => {\n const key = !axisTypeIndex ? `0${cIdx}${axisIndex}` : `${rIdx}0${axisIndex}`;\n const dom = encodingDomains[axisType];\n const typeOfField = field.subtype();\n fieldsObj[axisTypeIndex][key] = field;\n\n if (dom && Object.keys(dom).length !== 0) {\n domains[axisTypeIndex][key] = unionDomain([(domains[axisTypeIndex] &&\n domains[axisTypeIndex][key]) || [], dom[`${field}`]], typeOfField);\n }\n });\n });\n }\n }\n\n const { x: xAxes, y: yAxes } = resolver.axes();\n store.lockModel();\n [xAxes, yAxes].forEach((axesArr, axisType) => {\n axesArr.forEach((axes, idx) => {\n let key;\n let domain = [];\n let adjustedDomain = [];\n const min = [];\n const max = [];\n const typeOfAxis = axes[0].constructor.type();\n\n if (axes.length > 1 && typeOfAxis === ScaleType.LINEAR && axes[0].config().alignZeroLine) {\n axes.forEach((axis, i) => {\n key = !axisType ? `0${idx}${i}` : `${idx}0${i}`;\n domain = domains[axisType][key];\n min[i] = domain[0];\n max[i] = domain[1];\n });\n adjustedDomain = getAdjustedDomain(max, min);\n } else if (typeOfAxis === ScaleType.BAND) {\n /* Sort categorical fields to ensure consistency across all rows\n only if sorted by user */\n key = !axisType ? `0${idx}0` : `${idx}00`;\n const currentFieldName = fieldsObj[axisType][key].oneVar();\n const sortingOrder = config.sort && config.sort[currentFieldName];\n\n if (sortingOrder) {\n domains[axisType][key].sort((a, b) => sortCategoricalField(sortingOrder, a, b));\n }\n }\n\n axes.forEach((axis, index) => {\n key = !axisType ? `0${idx}${index}` : `${idx}0${index}`;\n domain = adjustedDomain[index] || domains[axisType][key];\n\n domain && axis.domain(domain);\n const type = !axisType ? 'x' : 'y';\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${type}`, domain, `${idx}${index}`);\n });\n });\n });\n store.unlockModel();\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields, type) {\n let facets = [];\n let projections = [];\n let counter = 0;\n const primaryFacets = [];\n const secondaryFacets = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n const axisFrom = this.axisFrom();\n\n for (let i = 0; i < primaryLen; i++) {\n let projArr = [primaryFields[i]];\n const primaryField = primaryFields[i];\n\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter];\n if (secondaryField && secondaryField.type() === MEASURE) {\n counter++;\n projArr = [primaryField, secondaryField];\n }\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n primaryFacets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n secondaryFacets.push(secondaryField);\n }\n }\n }\n if ((primaryFacets.length || secondaryFacets.length) && !projections.length) {\n type = type === COL ? COLUMN : type;\n if ((axisFrom[type] === LEFT || axisFrom[type] === TOP) && primaryFacets.length) {\n const axisFromIndex = primaryFacets.length - 1;\n const facet = primaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(secondaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n secondaryFacets.splice(existIndex, 1);\n }\n primaryFacets.splice(axisFromIndex, 1);\n } else {\n const axisFromIndex = 0;\n const facet = secondaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(primaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n primaryFacets.splice(existIndex, 1);\n }\n secondaryFacets.splice(axisFromIndex, 1);\n }\n }\n\n facets = [...primaryFacets, ...secondaryFacets];\n facets = facets.filter((el, index, self) => index === self.findIndex(t => (t.toString() === el.toString())));\n return {\n facets,\n projections\n };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof CartesianEncoder\n */\n fieldSanitizer (datamodel, config) {\n return super.fieldSanitizer(datamodel, config);\n }\n\n /**\n *\n *\n * @param {*} datamodel\n *\n * @memberof CartesianEncoder\n */\n getRetinalFieldsDomain (dataModels, encoding) {\n const groupedModel = dataModels.groupedModel;\n const domains = {};\n for (const key in encoding) {\n if ({}.hasOwnProperty.call(encoding, key)) {\n const encodingObj = encoding[key];\n const field = encodingObj.field;\n if (!encodingObj.domain && field) {\n const domain = retriveDomainFromData(groupedModel, field);\n domains[field] = domain;\n }\n }\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n * @memberof CartesianEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n // let currentLayerIndex = 0;\n layerArray.length && layerArray.forEach((layer, i) => {\n const def = layerFactory.sanitizeLayerConfig(layer);\n def.order = i;\n serializedLayers.push(def);\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n const layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n\n // let currentLayerIndex = 0;\n columnFields.forEach((colField) => {\n const colFieldName = colField.toString();\n rowFields.forEach((rowField) => {\n let configs = [];\n const rowFieldName = rowField.toString();\n const encoding = {\n x: {\n field: colFieldName\n },\n y: {\n field: rowFieldName\n }\n };\n const rowFieldType = rowField.subtype();\n const colFieldType = colField.subtype();\n const mark = getDefaultMark(colFieldType, rowFieldType);\n\n const defConfigs = [{\n mark,\n def: {\n mark,\n encoding\n }\n }];\n\n const layerConfigs = getLayerConfFromFields(colField.getMembers(),\n rowField.getMembers(), userLayerConfig || []);\n if (layerConfigs.length) {\n configs = layerConfigs.map((layerConf) => {\n const mergedLayerConf = mergeRecursive(mergeRecursive({}, defConfigs[0].def), layerConf);\n const serializedLayerConfig = layerFactory.getSerializedConf(mergedLayerConf.mark,\n mergedLayerConf);\n return {\n mark: mergedLayerConf.mark,\n order: mergedLayerConf.order,\n def: serializedLayerConfig\n };\n });\n } else {\n configs = defConfigs;\n }\n\n layerConfig.push(...configs);\n });\n });\n return this.sanitizeLayerConfig(retinalConfig, layerConfig);\n }\n}\n","import { AngleAxis, RadiusAxis } from '@chartshq/muze-axis';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n GROUP_BY_FUNCTIONS,\n COORD_TYPES,\n toArray,\n getObjProp,\n defaultValue\n} from 'muze-utils';\nimport VisualEncoder from './visual-encoder';\nimport { SIZE, MEASURE, ARC, COLOR } from '../enums/constants';\nimport { sanitizeIndividualLayerConfig, resolveAxisConfig } from './encoder-helper';\nimport { SimpleVariable } from '../variable';\n\nconst POLAR = COORD_TYPES.POLAR;\nconst { RADIUS, ANGLE, ANGLE0 } = ENCODING;\n\nconst axesCls = {\n [RADIUS]: RadiusAxis,\n [ANGLE]: AngleAxis,\n [ANGLE0]: AngleAxis\n};\n\nconst getSizeMultiplier = (sizeVal, sizeAxis) => {\n const sizeAxisDomain = sizeAxis.domain();\n const sizeMultiplier = sizeAxis.getSize(sizeVal) / (sizeAxisDomain ? sizeAxis.range()[1] : sizeAxis.config().value);\n return sizeMultiplier;\n};\n\nconst setRadiusFactor = (context) => {\n const data = context.data();\n const sizeField = context.retinalFields().size.field;\n const { radius, size } = context.axes();\n\n if (sizeField && radius && radius.length) {\n const sizeFieldIndex = data.getFieldsConfig()[sizeField].index;\n const sizeVal = data.getData().data.reduce((acc, val) => acc + val[sizeFieldIndex], 1);\n const sizeMultiplier = getSizeMultiplier(sizeVal, size[0]);\n radius.forEach(axis => axis.setRadiusFactor(sizeMultiplier));\n }\n};\n\n/**\n *\n *\n * @export\n * @class PolarEncoder\n * @extends {VisualEncoder}\n */\nexport default class PolarEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof PolarEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const {\n axes\n } = axesCreators;\n const geomCellAxes = axes;\n const {\n indices\n } = fieldInfo;\n const {\n rowIndex,\n columnIndex\n } = indices;\n // Dummy axes for polar, to create blank cells\n const pieAxes = geomCellAxes.pie || [];\n\n pieAxes[rowIndex] = pieAxes[rowIndex] || [];\n pieAxes[rowIndex][columnIndex] = [];\n\n const axesObj = {};\n const { geomCell, resolver } = context;\n const layers = resolver.matrixLayers();\n const resolverAxes = resolver.axes();\n const cellLayers = layers[rowIndex][columnIndex];\n const fields = {\n radius: {},\n angle: {},\n angle0: {}\n };\n\n cellLayers.forEach((layerConf) => {\n const def = layerConf.def;\n [ANGLE, ANGLE0, RADIUS].forEach((enc) => {\n const field = getObjProp(def.encoding, enc, 'field');\n field && (fields[enc][field] = 0);\n });\n });\n const fieldInf = {};\n const varInstances = {};\n\n for (const encType in fields) {\n fieldInf[encType] = Object.keys(fields[encType]);\n axesObj[encType] = [];\n varInstances[encType] = [];\n fieldInf[encType].forEach((field, i) => {\n varInstances[encType][i] = new SimpleVariable(field);\n axesObj[encType][i] = new axesCls[encType]();\n });\n axesObj[encType][axesObj[encType].length] = new axesCls[encType]();\n }\n resolveAxisConfig(context, fieldInf, {\n axesObj,\n rowIndex,\n columnIndex\n });\n geomCell.axes(axesObj)\n .fields(Object.assign({}, varInstances, geomCell.fields()));\n resolverAxes.pie = pieAxes;\n return geomCellAxes;\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields) {\n let counter = 0;\n const facets = [];\n const projections = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n\n for (let i = 0; i < primaryLen; i++) {\n const primaryField = primaryFields[i];\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter++];\n const projArr = secondaryField ? [primaryField, secondaryField] : [primaryField];\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n }\n }\n }\n return {\n facets,\n projections\n };\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n store.lockModel();\n const domainProps = {\n radius: [],\n angle: [],\n angle0: []\n };\n const axes = context.resolver().axes();\n context.matrixInstance().value.each((cell, rIdx, cIdx) => {\n const unit = cell.valueOf();\n const unitDomains = unit.getDataDomain();\n const fields = unit.fields();\n setRadiusFactor(unit);\n [RADIUS, ANGLE, ANGLE0].forEach((encType) => {\n const encodingFields = fields[encType];\n const domains = unitDomains[encType] || {};\n encodingFields.forEach((field, i) => {\n !domainProps[encType][rIdx] && (domainProps[encType][rIdx] = []);\n !domainProps[encType][rIdx][cIdx] && (domainProps[encType][rIdx][cIdx] = []);\n domainProps[encType][rIdx][cIdx][i] = domains[`${field}`] || [];\n });\n });\n });\n\n for (const key in domainProps) {\n const specificAxes = axes[key];\n specificAxes.forEach((axesArr, rIdx) => {\n axesArr.forEach((axisArr, cIdx) => {\n axisArr.forEach((axis, i) => {\n axis.domain(defaultValue(getObjProp(domainProps[key], rIdx, cIdx, i), []));\n\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${key}`, domainProps[key],\n `${rIdx}-${cIdx}`);\n });\n });\n });\n }\n store.unlockModel();\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n setCommonDomain () {\n // No domain to be set\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n static type () {\n return POLAR;\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof PolarEncoder\n */\n fieldSanitizer (datamodel, config) {\n let sanitizedRows = [[], []];\n let sanitizedColumns = [[], []];\n const fields = super.fieldSanitizer(datamodel, config);\n const {\n layers\n } = config;\n const {\n rows,\n columns\n } = fields;\n const layer = layers[0];\n const encoding = layer.encoding;\n const radius = encoding && encoding.radius ? encoding.radius.field : null;\n const angle = encoding && encoding.angle ? encoding.angle.field : null;\n const sanitizedFields = [sanitizedRows, sanitizedColumns];\n\n [rows, columns].forEach((fieldType, typeIndex) => {\n fieldType.forEach((fieldSet, i) => fieldSet.forEach((field) => {\n if (field.toString() !== radius && field.toString() !== angle && field.type() !== MEASURE) {\n sanitizedFields[typeIndex][i].push(field);\n }\n }));\n });\n sanitizedColumns = [...new Set(sanitizedColumns)];\n sanitizedRows = [...new Set(sanitizedRows)];\n this.fieldInfo({ rows: sanitizedRows, columns: sanitizedColumns });\n return this.fieldInfo();\n }\n\n getRetinalFieldsDomain (dataModels, encoding, facetFields, groupBy) {\n let sizeField;\n let colorField;\n const fields = [];\n const layers = this.layers();\n const dataModel = dataModels.groupedModel;\n const fieldsConfig = dataModel.getFieldsConfig();\n const domains = {};\n if (layers && layers[0]) {\n const layer = layers[0];\n const layerEncoding = layer.def.encoding || {};\n\n [RADIUS, ANGLE, SIZE, COLOR].forEach((encType) => {\n const field = layerEncoding[encType] ? layerEncoding[encType].field : '';\n const measureField = fieldsConfig[field] && fieldsConfig[field].def.type === MEASURE;\n if (encType === SIZE && measureField) {\n sizeField = field;\n }\n if (encType === COLOR) {\n colorField = field;\n }\n fieldsConfig[field] && !measureField && fields.push(field);\n });\n }\n\n if (sizeField) {\n domains[sizeField] = dataModel.groupBy(facetFields, {\n [sizeField]: GROUP_BY_FUNCTIONS.SUM\n }).getFieldspace().fieldsObj()[sizeField].domain();\n }\n\n if (colorField) {\n const dm = dataModel.groupBy([...facetFields, ...fields], groupBy.measures);\n domains[colorField] = dm.getFieldspace().fieldsObj()[colorField].domain();\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof PolarEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n let layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n const allFields = [...columnFields, ...rowFields];\n\n allFields.forEach(() => {\n const encoding = {};\n let config = {\n mark: ARC,\n def: {\n encoding\n }\n };\n if (userLayerConfig && userLayerConfig.length > 0) {\n config = mergeRecursive(config, userLayerConfig[0]);\n }\n layerConfig.push(config);\n });\n if (layerConfig.length === 0) {\n layerConfig = userLayerConfig;\n }\n const sanitizedConfig = this.sanitizeLayerConfig(retinalConfig, layerConfig);\n this.layers(sanitizedConfig);\n return sanitizedConfig;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n *\n * @memberof PolarEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n\n layerArray.length && layerArray.forEach((layer) => {\n const def = layerFactory.getSerializedConf(layer.mark, layer);\n serializedLayers.push({\n mark: layer.mark,\n def\n });\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n def.forEach((conf) => {\n const encoding = conf.encoding || (conf.encoding = {});\n !encoding.angle && (encoding.angle = {});\n const angleField = getObjProp(encoding.angle, 'field');\n const angle0Field = getObjProp(encoding.angle0, 'field');\n if (!angleField) {\n Object.assign(encoding.angle, {\n field: encodingConfigs.color && encodingConfigs.color.field\n });\n }\n if (!angle0Field) {\n !encoding.angle0 && (encoding.angle0 = {});\n Object.assign(encoding.angle0, {\n field: encoding.angle.field\n });\n }\n });\n\n layerConfig.push(config);\n });\n return layerConfig;\n }\n}\n","import { createRetinalAxis } from './encoder-helper';\nimport { COLOR, SHAPE, SIZE } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\n/**\n *\n *\n * @export\n * @class RetinalEncoder\n * @extends {VisualEncoder}\n */\nexport default class RetinalEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n *\n * @memberof RetinalEncoder\n */\n createAxis (axesCreators) {\n const { fieldsConfig, config } = axesCreators;\n const newAxes = {};\n\n [COLOR, SHAPE, SIZE].forEach((axisType) => {\n newAxes[`${axisType}`] = createRetinalAxis({ axisType, fieldsConfig }, config[axisType]);\n });\n return newAxes;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof RetinalEncoder\n */\n static type () {\n return 'retinal';\n }\n\n /**\n *\n *\n * @param {*} context\n *\n * @memberof RetinalEncoder\n */\n setCommonDomain (context) {\n const { domains, axes, encoding } = context;\n\n Object.entries(encoding).forEach((enc) => {\n if (enc[1] && enc[1].field) {\n const encType = enc[0];\n const field = enc[1].field;\n\n if (field) {\n axes[encType].forEach((axis) => {\n const domain = domains[field];\n !enc[1].domain && axis.updateDomain(domain);\n });\n }\n }\n });\n return axes;\n }\n}\n","import { Store, FieldType, COORD_TYPES, getObjProp, DataModel } from 'muze-utils';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { DATA_UPDATE_COUNTER } from '../enums/defaults';\nimport { Variable } from '../variable';\nimport { PolarEncoder, CartesianEncoder } from '../encoder';\nimport {\n DIMENSION,\n MEASURE,\n ORDINAL,\n LINEAR,\n ROW,\n COLUMN,\n COL,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n COLOR,\n SIZE,\n TEMPORAL,\n SHAPE,\n INTERACTION,\n GRID_LINES,\n GRID_BANDS,\n HEADER,\n FACET,\n X,\n Y,\n ARC,\n RADIUS,\n ANGLE\n} from '../enums/constants';\n\nconst POLAR = COORD_TYPES.POLAR;\n\n/**\n * Creates an instance of a store which contains the arguments to make the class reactive\n *\n * @return {Object} instance of store\n * @memberof VisualGroup\n */\nexport const initStore = () => new Store({\n [DATA_UPDATE_COUNTER]: DATA_UPDATE_COUNTER\n});\n\n/**\n *\n *\n * @param {*} arr\n */\nexport const isDistributionEqual = arr => [...arr[0], ...arr[1]].reduce((isEqual, row) => {\n const rowType = row.type();\n\n if (rowType === MEASURE || rowType === TEMPORAL) {\n isEqual = true;\n }\n return isEqual;\n}, false);\n\n/**\n *\n *\n */\nexport const initializeCacheMaps = () => ({\n cellMap: new Map(),\n xAxesMap: new Map(),\n yAxesMap: new Map(),\n entryCellMap: new Map(),\n exitCellMap: new Map()\n});\n\n/**\n *\n *\n * @param {*} axisName\n * @param {*} id\n */\nexport const getAxisKey = (axisName, ...params) => `${axisName}-axis-${params.join('-')}`;\n\n/**\n *\n *\n * @param {*} rowId\n * @param {*} columnId\n */\nexport const getCellKey = (rowId, columnId) => `cell-${rowId}-${columnId}`;\n\n/**\n *\n *\n * @param {*} config\n *\n */\nexport const extractUnitConfig = (config) => {\n const unitConfig = {};\n const attrNames = [INTERACTION, GRID_LINES, GRID_BANDS];\n\n attrNames.forEach((attr) => {\n if (config[attr] !== undefined) {\n unitConfig[attr] = config[attr];\n }\n });\n return unitConfig;\n};\n\n/**\n *\n *\n * @param {*} headers\n * @param {*} index\n * @param {*} rowLength\n *\n * @memberof MatrixResolver\n */\nexport const getHeaderText = (headers, index, rowLength) => {\n let header = '';\n\n if (index === rowLength - 1 && headers.length > rowLength) {\n for (let i = index; i < headers.length - 1; i++) {\n header += `${headers[i].toString()} / `;\n }\n header += headers[headers.length - 1].toString();\n return header;\n } else if (headers[index]) {\n return headers[index].toString();\n }\n return '';\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} fieldHeaders\n * @param {*} TextCell\n * @param {*} labelManager\n *\n */\nexport const headerCreator = (fields, fieldHeaders, TextCell, { classPrefix, labelManager }) => {\n const headers = fields.length > 0 ? fields[0].map((cell, i) => new TextCell({\n type: HEADER,\n className: `${classPrefix}-grid-headers`\n }, {\n labelManager\n }).source(getHeaderText(fieldHeaders, i, fields[0].length))\n .config({ show: cell.config().show })) : [];\n return headers;\n};\n\n/**\n *\n *\n * @param {*} variable\n * @param {*} allFields\n *\n */\nexport const findInGroup = (variable, allFields) => {\n let channel = null;\n\n [COLOR, SIZE, SHAPE].forEach((e) => {\n if (this.store.get(e) && variable === this.store.get(e)[0]) {\n channel = e;\n }\n });\n\n if (channel) {\n return { channel };\n }\n [ROW, COL].forEach((facetType) => {\n allFields[`${facetType}Facets`].forEach((e) => {\n if (e.toString() === variable) {\n channel = { channel: FACET, type: facetType === COL ? COLUMN : ROW };\n }\n });\n });\n\n if (channel) {\n return channel;\n }\n\n [ROW, COL].forEach((projType) => {\n allFields[`${projType}Projections`].forEach((e) => {\n e.forEach((m) => {\n if (m.toString() === variable) {\n channel = projType === COL ? X : Y;\n }\n });\n });\n });\n\n if (channel) {\n return { channel };\n }\n return null;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} field\n */\nexport const getAxisType = (fieldsConfig, field) => {\n let fieldType = ORDINAL;\n\n if (field && fieldsConfig[field].def.type !== DIMENSION) {\n fieldType = LINEAR;\n }\n return fieldType;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} fieldName\n *\n */\nexport const retriveDomainFromData = (datamodel, fieldName) => {\n const field = datamodel.getFieldspace().fields.find(d => d.name() === fieldName.toString());\n return field.domain();\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n let xAxes = null;\n let yAxes = null;\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n\n xAxisSet && xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes = xAxes || [];\n xAxes.push(xAxis);\n });\n\n yAxisSet && yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes = yAxes || [];\n yAxes.push(yAxis);\n });\n\n return {\n xAxes, yAxes\n };\n};\n\nconst hasPolarEncodings = layerConf => layerConf.mark === ARC || [RADIUS, ANGLE].some(field =>\n getObjProp(layerConf.encoding, field));\n\n/**\n *\n *\n * @param {*} layers\n *\n */\nexport const getEncoder = (layers) => {\n let encoder = new CartesianEncoder();\n\n if (layers.length) {\n // Figuring out the kind of layers the group will have\n encoder = layers.some(layerConf => hasPolarEncodings(layerConf)) ? new PolarEncoder() : encoder;\n }\n return encoder;\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} userAxisFromConfig\n *\n */\nexport const getHeaderAxisFrom = (type, fields, userAxisFromConfig) => {\n let axisFrom = userAxisFromConfig[type];\n let headerFrom = '';\n const options = type === ROW ? [LEFT, RIGHT] : [BOTTOM, TOP];\n const [firstField, secondField] = fields;\n const firstFieldType = i => (firstField.length ? firstField[i].type() : null);\n const secondFieldType = i => (secondField.length ? secondField[i].type() : null);\n\n if (firstFieldType(firstField.length - 1) === DIMENSION && secondFieldType(0) === DIMENSION) {\n headerFrom = axisFrom ? options[1 - options.indexOf(axisFrom)] : options[1];\n\n if (type === COLUMN && (firstField[firstField.length - 1].toString() === secondField[0].toString())) {\n axisFrom = TOP;\n } else {\n axisFrom = axisFrom || options[0];\n }\n } else if (secondFieldType(secondField.length - 1) === DIMENSION) {\n headerFrom = type === ROW ? RIGHT : BOTTOM;\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else {\n headerFrom = type === ROW ? LEFT : TOP;\n axisFrom = type === ROW ? LEFT : TOP;\n }\n if (firstFieldType(firstField.length - 1) === MEASURE && secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n } else if (secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else if (firstFieldType(firstField.length - 1) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n }\n return [headerFrom, axisFrom];\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} layers\n *\n * @memberof MatrixResolver\n */\nexport const setFacetsAndProjections = (context, fieldInfo, encoder) => {\n const {\n fields,\n type\n } = fieldInfo;\n const { facets, projections } = encoder.simpleEncoder.getFacetsAndProjections(fields, type);\n\n context.facets({ [`${type}Facets`]: facets });\n context.projections({ [`${type}Projections`]: projections });\n\n return { facets, projections, fields };\n};\n\nconst getRowBorders = (left, right) => {\n const borders = {};\n borders.top = false;\n borders.bottom = false;\n if (left.length > 1 || right.length > 1) {\n borders.top = true;\n borders.bottom = true;\n }\n return borders;\n};\n\nconst getColumnsBorders = (top, bottom) => {\n const borders = {};\n borders.left = false;\n borders.right = false;\n if (top.length || bottom.length) {\n if ((top[0] && top[0].length > 1) || (bottom[0] && bottom[0].length > 1)) {\n borders.left = true;\n borders.right = true;\n }\n }\n return borders;\n};\n\nconst getValueBorders = (rows, columns) => {\n const borders = { top: true, left: true, bottom: true, right: true };\n const borderTypeRow = [LEFT, RIGHT];\n const borderTypeCol = [TOP, BOTTOM];\n rows.forEach((e, i) => {\n if (e[0] && e[0].length) {\n borders[borderTypeRow[i]] = true;\n } else {\n borders[borderTypeRow[i]] = false;\n }\n });\n columns.forEach((e, i) => {\n if (e.length) {\n borders[borderTypeCol[i]] = true;\n } else {\n borders[borderTypeCol[i]] = false;\n }\n });\n\n return borders;\n};\n\nexport const getBorders = (matrices, encoder) => {\n let showRowBorders = { top: false, bottom: false };\n let showColBorders = { left: false, right: false };\n let showValueBorders = { top: false, bottom: false, left: false, right: false };\n const {\n rows,\n columns,\n values: valueMatrix\n } = matrices;\n const [leftRows, rightRows] = rows;\n const [topColumns, bottomColumns] = columns;\n const {\n rowDimensions,\n columnDimensions,\n rowTemporalFields,\n columnTemporalFields,\n columnMeasures,\n rowMeasures\n } = encoder.fieldInfo();\n const allDimensionLength = rowDimensions.length + columnDimensions.length;\n const allMeasuresLength = rowMeasures.length + columnMeasures.length;\n const allTemporalFieldsLength = rowTemporalFields.length + columnTemporalFields.length;\n\n if (encoder.constructor.type() === POLAR) {\n if (!allDimensionLength) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n } else if (!allMeasuresLength && !allTemporalFieldsLength && allDimensionLength <= 2) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n\n showRowBorders = getRowBorders(leftRows, rightRows);\n showColBorders = getColumnsBorders(topColumns, bottomColumns);\n showValueBorders = getValueBorders([leftRows, rightRows], [topColumns, bottomColumns]);\n\n if (valueMatrix.length > 1) {\n showValueBorders.top = true;\n showValueBorders.bottom = true;\n }\n if (valueMatrix.length && valueMatrix[0].length > 1) {\n showValueBorders.left = true;\n showValueBorders.right = true;\n }\n return { showRowBorders, showColBorders, showValueBorders };\n};\n\nexport const getFieldsFromSuppliedLayers = (suppliedLayerConfig, fieldsConfig) => {\n let fields = [];\n const encodingArr = suppliedLayerConfig.map(conf => (conf.encoding || {}));\n fields = [...fields, [].concat(...encodingArr.map(enc => Object.values(enc).map(d => d.field)))];\n fields = fields.filter(field => fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION);\n return fields;\n};\n\nexport const extractFields = (facetsAndProjections, layerFields) => {\n const fields = Object.values(facetsAndProjections).map((arr) => {\n const flattenArray = [].concat(...arr);\n return [].concat(...flattenArray.map((field) => {\n if (field instanceof Variable) {\n return field.getMembers();\n }\n return field;\n }));\n });\n return [].concat(...fields, ...layerFields);\n};\n\n/**\n * This method sorts the facets fields inplace if field is of categorical type\n * @param {Object} facets Array of facets\n * @param {Array} keys Array of the facet field values\n * @param {Object} config configuration object\n * @return {Array} Returns sorted facets\n */\nexport const sortFacetFields = (facets, keys, config) => {\n /**\n * Check if the facet sorted by the user is plotted\n * If an incorrect field is sorted, return the keys as is\n */\n const schema = [];\n const facetNames = [];\n const sortInfo = [];\n const sortConfig = config.sort;\n\n facets.forEach((facet) => {\n const name = `${facet}`;\n facetNames.push(name);\n\n const facetSortConfig = sortConfig[name];\n\n if (facetSortConfig) {\n sortInfo.push([name, facetSortConfig]);\n } else {\n sortInfo.push([name, null]);\n }\n schema.push(facet.getSchemaDef());\n });\n\n return new DataModel([facetNames, ...keys], schema).getData({ sort: sortInfo }).data;\n};\n\nexport const removeExitCells = (resolver) => {\n const exitCells = resolver.cacheMaps().exitCellMap;\n const store = resolver.store();\n const qualifiedStateProps = [].concat(...VisualUnit.getQualifiedStateProps(),\n ...BaseLayer.getQualifiedStateProps());\n store.lockCommits(qualifiedStateProps);\n exitCells.forEach((placeholder) => {\n placeholder.remove();\n });\n store.unlockCommits(qualifiedStateProps);\n};\n","import { DataModel } from 'muze-utils';\nimport { sortFacetFields } from './group-utils';\n\n/**\n* Gets name of fields form the variables\n*\n* @param {*} fields1\n* @param {*} [fields2=[]]\n*\n*/\nconst getFieldNames = fieldVar => fieldVar.reduce((acc, d) => {\n acc = [...acc, ...d.getMembers()];\n return acc;\n}, []);\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareProjectionInfo = (fieldInfo) => {\n const {\n colProjections,\n rowProjections\n } = fieldInfo;\n const uniqueFields = [];\n let indices = [];\n let projections = [];\n\n rowProjections.forEach((rowProj, rIndex) => {\n const newRIndex = rIndex;\n colProjections.forEach((colProj, cIndex) => {\n const newCIndex = cIndex;\n const newRowProj = getFieldNames(rowProj);\n const newColProj = getFieldNames(colProj);\n\n uniqueFields.push([...newRowProj, ...newColProj]);\n indices.push({ rowIndex: newRIndex, colIndex: newCIndex });\n projections.push({ rowFields: rowProj, columnFields: colProj });\n });\n });\n indices = indices.length ? indices : [{ rowIndex: 0, colIndex: 0 }];\n projections = projections.length ? projections : [{ rowFields: [], columnFields: [] }];\n return { uniqueFields, indices, projections };\n};\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareFacetInfo = (fieldInfo) => {\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const rowFacetNames = getFieldNames(rowFacets);\n const colFacetNames = getFieldNames(colFacets);\n const allFacets = [...rowFacetNames, ...colFacetNames];\n\n return { rowFacetNames, colFacetNames, allFacets, rowFacets, colFacets };\n};\n\n/**\n*\n*\n* @param {*} context\n* @param {*} facetNames\n* @param {*} hashMap\n* @param {*} keys\n* @param {*} index\n* @returns\n*/\nconst prepareHashMaps = (context, facetNames, hashMap, keys, index) => {\n const rowKey = [];\n facetNames.forEach((name) => {\n const key = context._derivation[context._derivation.length - 1].meta.keys[name];\n\n rowKey.push(key);\n });\n\n const joinedRowKey = rowKey.join(',');\n\n if (hashMap[joinedRowKey] === undefined) {\n hashMap[joinedRowKey] = index++;\n keys.push(rowKey);\n }\n return rowKey;\n};\n\nconst createJoinedKeys = keys => keys.map(e => ({\n keyArr: e,\n joinedKey: e.join(',')\n}));\n\n/**\n*\n*\n* @param {*} splitModels\n* @param {*} facetInfo\n* @returns\n*/\nconst getSplitModelHashMap = (splitModels, facetInfo, config) => {\n const {\n rowFacetNames,\n colFacetNames,\n rowFacets,\n colFacets\n } = facetInfo;\n\n const rowKeyHashMap = {};\n const colKeyHashMap = {};\n\n const rowKeys = [];\n const colKeys = [];\n const rowIndex = 0;\n\n const splitModelsHashMap = {};\n\n splitModels.forEach((splitContext) => {\n const rowKey = prepareHashMaps(splitContext, rowFacetNames, rowKeyHashMap, rowKeys, rowIndex);\n const colKey = prepareHashMaps(splitContext, colFacetNames, colKeyHashMap, colKeys, 1);\n\n splitModelsHashMap[`${rowKey}-${colKey}`] = splitContext;\n });\n\n return {\n splitModelsHashMap,\n rowKeys: createJoinedKeys(sortFacetFields(rowFacets, rowKeys, config)),\n colKeys: createJoinedKeys(sortFacetFields(colFacets, colKeys, config))\n };\n};\n\n/**\n * Formats row or columns keys with the provided formatter.\n *\n * @param {Array} keys - The collection of row or column keys.\n * @param {Array} formatterList - The list of corresponding formatter.\n */\nconst formatKeys = (keys, formatterList) => {\n const formattedKeys = [];\n keys.forEach((rKeys, rIdx) => {\n formattedKeys[rIdx] = [];\n rKeys.forEach((key, idx) => {\n formattedKeys[rIdx][idx] = formatterList[idx](key);\n });\n });\n return formattedKeys;\n};\n\n/**\n*\n*\n* @param {Object} context\n* @param {Object} fieldInfo\n* @returns\n*/\nconst splitByColumn = (context, optionalProjections) => {\n const {\n matrix,\n dataModel,\n rowIndex,\n colIndex,\n facetInfo,\n projectionInfo,\n geomCellCreator\n } = context;\n const {\n indices,\n uniqueFields,\n projections\n } = projectionInfo;\n\n const commonFields = optionalProjections;\n\n dataModel.splitByColumn(uniqueFields, commonFields).forEach((model, i) => {\n let { rowIndex: row, colIndex: col } = indices[i];\n row += rowIndex;\n col += colIndex;\n\n matrix[row] = matrix[row] || [];\n\n const projectionIndexObject = {\n indices: {\n rowIndex: row,\n columnIndex: col\n },\n projections: projections[i]\n };\n\n matrix[row][col] = geomCellCreator(model, projectionIndexObject, facetInfo);\n });\n const lastIndex = indices[indices.length - 1];\n\n return {\n rowIndex: lastIndex.rowIndex + rowIndex,\n colIndex: lastIndex.colIndex + colIndex\n };\n};\n\nconst createColumnDataModels = (colContext, fieldInfo, sourceDM) => {\n let context = {};\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n const {\n rowKeyArr,\n rowKey,\n colKeyObj,\n newRowIndex,\n splitModelsHashMap,\n currentColumnIndex\n } = colContext;\n\n const { keyArr: colKeyArr, joinedKey: colKey } = colKeyObj;\n const hashMapKey = splitModelsHashMap[`${rowKey}-${colKey}`];\n\n if (hashMapKey) {\n context = { dataModel: hashMapKey };\n } else {\n const emptyDm = new DataModel([], sourceDM.getData().schema);\n context = { dataModel: emptyDm };\n }\n\n context = {\n ...context,\n ...colContext,\n facetInfo: {\n rowFacets: [rowFacets, rowKeyArr],\n colFacets: [colFacets, colKeyArr]\n },\n rowIndex: newRowIndex,\n colIndex: currentColumnIndex\n };\n const dataModels = splitByColumn(context, fieldInfo.optionalProjections);\n\n return {\n columnIndex: dataModels.colIndex + 1,\n rowIndex: dataModels.rowIndex\n };\n};\n\nconst createRowDataModels = (rowContext, fieldInfo, sourceDM) => {\n let currentColumnIndex = 0;\n let rowIndexForCurrentKey = 0;\n const {\n colKeys,\n rowKeyObj,\n currentRowIndex\n } = rowContext;\n const newRowIndex = currentRowIndex;\n const { keyArr: rowKeyArr, joinedKey: rowKey } = rowKeyObj;\n const colContext = {\n ...rowContext,\n rowKeyArr,\n rowKey,\n newRowIndex\n };\n rowIndexForCurrentKey = currentRowIndex;\n if (colKeys.length) {\n colKeys.forEach((colKeyObj) => {\n colContext.colKeyObj = colKeyObj;\n colContext.currentColumnIndex = currentColumnIndex;\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n });\n } else {\n colContext.colKeyObj = { keyArr: [], joinedKey: '' };\n colContext.currentColumnIndex = currentColumnIndex;\n\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n }\n return {\n rowIndex: ++rowIndexForCurrentKey\n };\n};\n\n/**\n* Gets Matrixes for corresponding datamodel, facets and projections\n*\n* @param {Object} dataModel input datamodel\n* @param {Object} fieldInfo Information about the fields\n* @param {Function} geomCellCreator Callback executed after datamodels are prepared after sel/proj\n* @return {Object} set of matrices with the corresponding row and column keys\n*/\nexport const getMatrixModel = (dataModel, fieldInfo, geomCellCreator, globalConfig) => {\n let currentRowIndex = 0;\n const matrix = [];\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const projectionInfo = prepareProjectionInfo(fieldInfo);\n const facetInfo = prepareFacetInfo(fieldInfo);\n const allSplitModels = dataModel.splitByRow(facetInfo.allFacets);\n\n const {\n splitModelsHashMap,\n rowKeys,\n colKeys\n } = getSplitModelHashMap(allSplitModels, facetInfo, globalConfig);\n\n const generalContext = {\n matrix,\n geomCellCreator,\n projectionInfo,\n splitModelsHashMap,\n colKeys\n };\n if (rowKeys.length) {\n rowKeys.forEach((rowKeyObj) => {\n const rowContext = {\n ...generalContext,\n rowKeyObj,\n currentRowIndex\n };\n const { rowIndex } = createRowDataModels(rowContext, fieldInfo, dataModel);\n\n currentRowIndex = rowIndex;\n });\n } else if (colKeys.length) {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n\n colKeys.forEach((colKeyObj) => {\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj,\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n });\n } else {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj: { keyArr: [], joinedKey: '' },\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n }\n\n const formattedColKeys = formatKeys(colKeys.map(e => e.keyArr),\n colFacets.map(facetField => facetField.rawFormat()));\n const formattedRowKeys = formatKeys(rowKeys.map(e => e.keyArr),\n rowFacets.map(facetField => facetField.rawFormat()));\n\n // Getting column keys\n const transposedColKeys = formattedColKeys.length > 0 ? formattedColKeys[0].map((col, i) =>\n formattedColKeys.map(row => row[i])) : formattedColKeys;\n\n return { matrix, rowKeys: formattedRowKeys, columnKeys: transposedColKeys };\n};\n","import { AxisOrientation } from '@chartshq/muze-axis';\nimport {\n getObjProp,\n FieldType,\n retrieveNearestGroupByReducers,\n mergeRecursive,\n createSelection,\n DataModel\n} from 'muze-utils';\nimport { getMatrixModel } from './matrix-model';\nimport {\n getCellKey,\n isDistributionEqual,\n mutateAxesFromMap,\n getFieldsFromSuppliedLayers,\n extractFields,\n removeExitCells\n} from './group-utils';\nimport { ROW, ROWS, COLUMNS, COL, LEFT, RIGHT, TOP,\n BOTTOM, PRIMARY, SECONDARY, X, Y, TEMPORAL } from '../enums/constants';\nimport { SimpleVariable } from '../variable';\n\n/**\n * Updates row and column cells with the geom cell corresponding to the facet keys\n *\n * @param {*} resolver\n * @param {*} facets\n */\nconst updateCells = (resolver, facets, geomCell) => {\n [ROW, COL].forEach((field) => {\n const cells = resolver[`${field}Cells`]();\n const facetKey = facets[`${field}Facets`][1].join();\n\n !cells[facetKey] && (cells[facetKey] = []);\n cells[facetKey].push(geomCell);\n resolver[`${field}Cells`](cells);\n });\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} datamodel\n * @param {*} fieldInfo\n * @param {*} facets\n *\n */\nexport const createValueCells = (context, datamodel, fieldInfo, facets) => {\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const {\n suppliedLayers,\n cell: GeomCell,\n resolver,\n config,\n encoder,\n detailFields\n } = context;\n const axes = resolver.axes();\n const cacheMaps = resolver.cacheMaps();\n const matrixLayers = resolver.matrixLayers();\n const labelManager = resolver.dependencies().smartlabel;\n const horizontalAxis = resolver.horizontalAxis();\n const verticalAxis = resolver.verticalAxis();\n const datamodelTransform = resolver.datamodelTransform();\n const sortedFields = config.sort;\n const {\n entryCellMap,\n exitCellMap\n } = cacheMaps;\n const layerConfigArr = encoder.getLayerConfig({ columnFields, rowFields }, suppliedLayers || [],\n context.retinalConfig);\n const axesCreators = { config, labelManager, axes, cacheMaps };\n\n fieldInfo.normalizedColumns = verticalAxis.fields;\n fieldInfo.normalizedRows = horizontalAxis.fields;\n\n const allFacets = [\n [...facets.rowFacets[0], ...facets.colFacets[0]],\n [...facets.rowFacets[1], ...facets.colFacets[1]]\n ];\n const facetFields = allFacets.slice();\n facetFields[0] = facetFields[0].map(facetField => facetField.oneVar());\n\n matrixLayers[rowIndex] = matrixLayers[rowIndex] ? matrixLayers[rowIndex] : [];\n matrixLayers[rowIndex][columnIndex] = layerConfigArr;\n\n // return from map if already there otherwise create and put in map\n const geomCellKey = getCellKey(rowIndex, columnIndex);\n const fields = {\n y: rowFields,\n x: columnFields\n };\n\n const geomCell = !exitCellMap.has(geomCellKey) ? new GeomCell() : exitCellMap.get(geomCellKey);\n\n // Sort datamodel if user has sorted a field\n const sortConfig = Object.keys(sortedFields).map(field => [field, sortedFields[field]]);\n if (sortConfig.length) {\n datamodel = datamodel.sort(sortConfig, { saveChild: true });\n }\n\n geomCell.data(datamodel)\n .fields(fields)\n .transform(datamodelTransform)\n .detailFields(detailFields)\n .facetByFields(allFacets);\n\n encoder.createAxis(axesCreators, fieldInfo, Object.assign({}, context, { geomCell, facetFields }));\n entryCellMap.set(geomCellKey, geomCell);\n exitCellMap.delete(geomCellKey);\n\n updateCells(resolver, facets, geomCell);\n\n return entryCellMap.get(geomCellKey);\n};\n\nconst extractAxisIndex = id => getObjProp(id.match(/^[0-9]*?(?=-)/g), 0);\n\n/**\n * Creates axis cells based on the set of axes\n *\n * @param {Selection} selection Contains a selection of the axis units\n * @param {Array} axes Actual axis units\n * @param {number} axisIndex 0-> primary axis, 1-> secondary axis(when dual axis is made)\n * @param {Object} cells Contains a collection of the cells\n * @return {Object} return either set of axis/blank cells depending on the config\n */\nconst createAxisCells = (selection, axes, axisIndex, cells) =>\n createSelection(selection, axis => axis, axes, (item, i) => i + item.reduce((e, n) => {\n const id = n.id + axisIndex;\n return `${e}-${id}`;\n }, '')).map((currObj, axis) => {\n if (axis && axis[axisIndex]) {\n const axisInst = axis[axisIndex];\n const { orientation, show } = axisInst.config();\n\n return new cells.AxisCell().source(axisInst).config({\n isOffset: orientation === AxisOrientation.LEFT || orientation === AxisOrientation.TOP,\n show\n });\n }\n return new cells.BlankCell().config({ show: false });\n }).sort((a, b) => extractAxisIndex(a[0]) - extractAxisIndex(b[0]));\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @retur\n */\nconst axisPlaceholderGn = (context, selObj, cells) => {\n const {\n matrices\n } = context;\n const {\n axesMatrix\n } = matrices;\n\n return (type, axisFrom) => {\n const axes = axesMatrix[`${type}`];\n\n if (axes && axes.length) {\n if (type === X || type === Y) {\n const fieldNames = type === Y ? ROWS : COLUMNS;\n\n [PRIMARY, SECONDARY].forEach((fieldType, index) => {\n const selObjProp = `${fieldNames}${fieldType}`;\n let axisIndex = index;\n let axesForDraw = axes;\n if (axisFrom === RIGHT || axisFrom === BOTTOM) {\n axisIndex = 1 - axisIndex;\n }\n if (!getObjProp(axes, 0, axisIndex)) {\n axesForDraw = [];\n }\n selObj[selObjProp] = createAxisCells(selObj[selObjProp], axesForDraw, axisIndex, cells);\n });\n } else {\n selObj.rowsPrimary = createAxisCells(selObj.rowPrime, axes.map(() => []), 0, cells);\n selObj.rowsSecondary = createAxisCells(selObj.rowSec, axes.map(() => []), 0, cells);\n selObj.columnsPrimary = createAxisCells(selObj.colPrime, axes[0], 0, cells);\n selObj.columnsSecondary = createAxisCells(selObj.colSec, axes[0], 0, cells);\n }\n }\n return selObj;\n };\n};\n\n/**\n * Creates header cells based on the set of headers\n *\n * @param {Object} selection Contains a selection of the header units\n * @param {string} headers Contains a list of the headers\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} return either set of header cells depending on the config\n */\nconst createTextCells = (selection, headers, cells, labelManager) => createSelection(selection,\n (label) => {\n const textCell = new cells.TextCell({}, { labelManager });\n textCell.source(label);\n return textCell;\n }, headers, (key, i) => key + i);\n\nconst extractFacetIndex = id => id.split('-').pop();\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @param {*} labelManager\n *\n */\nconst headerPlaceholderGn = (context, selectionObj, cells, labelManager) => {\n const {\n axis,\n keys,\n type,\n facet\n } = context;\n const counter = axis.length / keys.length;\n const selectionKeys = keys.length ? axis.map((d, i) => keys[Math.floor(i / counter)]) : [];\n\n const selObjUpdater = createSelection(selectionObj[`${type}Headers`], keySet => keySet, selectionKeys,\n (keySet, i) => `${keySet.join(',')}-${i}`)\n .sort((a, b) => extractFacetIndex(a[0]) - extractFacetIndex(b[0]));\n\n return selObjUpdater.map((keySet, data) => {\n let textCells = createTextCells(null, data, cells, labelManager);\n textCells = textCells.map((cell, k) => cell.source(k).config(facet));\n return textCells;\n });\n};\n\n/**\n * Creates a set of placeholders as a part of selection object\n *\n * @param {Array} normalizedOptions contains normalized rows and columns\n * @param {Array} matrices contains axis and value matrices\n * @param {aArrayny} projections contains set of row and column projections\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} Creates a set of placeholders as a part of selections\n */\nconst generatePlaceholders = (context, cells, labelManager) => {\n let selectionObj;\n const {\n matrices,\n fields,\n facetsAndProjections,\n selection,\n facet,\n encoders,\n resolver\n } = context;\n const {\n rows,\n columns\n } = fields;\n const {\n valuesMatrix\n } = matrices;\n const {\n rowProjections,\n colProjections\n } = facetsAndProjections;\n const {\n rowKeys,\n columnKeys\n } = valuesMatrix;\n const takeAxisFrom = encoders.simpleEncoder._axisFrom;\n const takeHeaderFrom = encoders.simpleEncoder._headerFrom;\n\n selectionObj = selection || {};\n\n ['pie', X, Y].forEach((axis) => {\n const axisFrom = axis === X ? takeAxisFrom.column : takeAxisFrom.row;\n selectionObj = axisPlaceholderGn(context, selectionObj, cells)(axis, axisFrom);\n });\n\n const {\n rowsPrimary,\n rowsSecondary,\n columnsPrimary,\n columnsSecondary\n } = selectionObj;\n\n const rowAxis = rowsPrimary && rowsPrimary.getObjects().length ? rowsPrimary.getObjects() :\n (rowsSecondary && rowsSecondary.getObjects().length ? rowsSecondary.getObjects() : []);\n const colAxis = columnsPrimary && columnsPrimary.getObjects().length ? columnsPrimary.getObjects() :\n (columnsSecondary && columnsSecondary.getObjects().length ? columnsSecondary.getObjects() : []);\n\n const headerConfig = [\n { type: LEFT, section: rows[0], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: RIGHT, section: rows[1], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: TOP, section: columns[0], axis: colAxis, headerFrom: takeHeaderFrom.column },\n { type: BOTTOM, section: columns[1], axis: colAxis, headerFrom: takeHeaderFrom.column }\n ];\n\n headerConfig.forEach((config, index) => {\n let keys;\n let length;\n const {\n type,\n section,\n axis,\n headerFrom\n } = config;\n\n if (index < 2) {\n keys = rowKeys;\n length = rowProjections.length > 0 ? rowProjections.length : 1;\n } else {\n keys = columnKeys;\n length = colProjections.length > 0 ? colProjections.length : 1;\n }\n keys = keys.map(arr => arr.map(val => resolver.valueParser()(val)));\n if (section.length && headerFrom === type && axis && keys.length) {\n const hContext = { axis, length, type };\n let headers = [];\n if (index < 2) {\n hContext.keys = keys;\n hContext.facet = facet.rows;\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n } else {\n hContext.facet = facet.columns;\n hContext.keys = keys[0].map((key, i) => keys.map(e => e[i]));\n\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n }\n selectionObj[`${type}Headers`] = headers;\n } else {\n selectionObj[`${type}Headers`] = null;\n }\n });\n return selectionObj;\n};\n\n/**\n * Generates matrices\n *\n * @param {Object} config Configuration to generate matrices\n * @param {Array} matrices Matrices containing the set of visual units and axes units\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} contains a collection of matrices\n */\nexport const generateMatrices = (context, matrices, cells, labelManager) => {\n const {\n unitHeight,\n unitWidth,\n facetsAndProjections,\n normalizedRows,\n normalizedColumns,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n } = context;\n const placeholderContext = {\n fields: {\n rows: normalizedRows,\n columns: normalizedColumns\n },\n matrices,\n facetsAndProjections,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n };\n // Generate placeholders for all matrices\n const selectionObj = generatePlaceholders(placeholderContext, cells, labelManager);\n const {\n columnsPrimary,\n columnsSecondary,\n rowsPrimary,\n rowsSecondary,\n leftHeaders,\n topHeaders,\n bottomHeaders,\n rightHeaders\n } = selectionObj;\n const [rowPrime, rowSec, colPrime, colSec] = [rowsPrimary, rowsSecondary, columnsPrimary, columnsSecondary]\n .map(d => (d ? d.getObjects() : []));\n const [leftFacets, rightFacets] = [leftHeaders, rightHeaders]\n .map(e => (e ? e.getObjects()\n .map(f => f.getObjects()) : []));\n let rowPriority = rowSec.length ? 1 : -1;\n rowPrime.length && rowPriority++;\n let colPriority = colSec.length ? 1 : -1;\n colPrime.length && colPriority++;\n\n // Compute left matrix using left headers and the axes on the rows\n let leftMatrix = leftFacets.length ? leftFacets.map((d, i) => {\n rowPrime[i] = rowPrime[i] ? [rowPrime[i]] : [];\n return [...d, ...rowPrime[i]];\n }) : (rowPrime ? rowPrime.map(d => [d]) : []);\n\n // Compute right matrix using right headers and the axes on the rows\n const rightMatrix = rowSec.length ? rowSec.map((d, i) => [d, ...(rightFacets[i] || [])]) : (rightFacets.length ?\n rightFacets.map(d => [...d]) : []);\n\n const topMatrix = [];\n if (topHeaders) {\n const headers = topHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n topMatrix[i] = topMatrix[i] || [];\n topMatrix[i].push(x);\n });\n });\n }\n // Compute top matrix using the top headers and axes on the columns\n if (colPrime.length) {\n topMatrix.push(colPrime);\n }\n\n // Bottom and right matrices are prepared using the user config.\n let bottomMatrix = [];\n if (colSec.length) {\n bottomMatrix.push(colSec);\n }\n const currentBottomLength = bottomMatrix.length;\n if (bottomHeaders) {\n const headers = bottomHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n bottomMatrix[i + currentBottomLength] = bottomMatrix[i + currentBottomLength] || [];\n bottomMatrix[i + currentBottomLength].push(x);\n });\n });\n }\n\n if (!leftMatrix.length && !rightMatrix.length) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n leftMatrix = [[cell]];\n }\n\n if (!topMatrix.length && (!bottomMatrix.length || !bottomMatrix[0].length)) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n bottomMatrix = [[cell]];\n }\n\n return {\n rows: [leftMatrix, rightMatrix],\n columns: [topMatrix, bottomMatrix],\n selectionObj,\n colPriority,\n rowPriority\n };\n};\n\nconst getAxisFields = (projections, fieldHolder = []) =>\n projections.reduce((acc, item) =>\n [...acc, ...item.reduce((ac, field) =>\n (field instanceof SimpleVariable ? [...ac, field.oneVar()] : ac), [])], fieldHolder);\n\nconst sortDmTemporalFields = (resolver, datamodel) => {\n let axisFields = [];\n const projections = resolver.projections();\n axisFields = getAxisFields(projections.rowProjections, getAxisFields(projections.colProjections));\n\n const fieldConfig = datamodel.getFieldsConfig();\n const temporalFields = axisFields.reduce((acc, field) =>\n ((fieldConfig[field].def.subtype === TEMPORAL) ? [...acc, [field]] : acc), []);\n return temporalFields.length ? datamodel.sort(temporalFields, { saveChild: true }) : datamodel;\n};\n\nconst transformDataModel = (dataModel, config, resolver) => {\n let groupedModel;\n\n const fieldsConfig = dataModel.getFieldsConfig();\n const resolvedData = resolver.data();\n const { groupBy, suppliedLayers, facetsAndProjections } = config;\n\n if (resolvedData instanceof DataModel) {\n resolvedData.dispose();\n }\n groupedModel = dataModel.project(dataModel.getSchema().map(d => d.name));\n resolver.data(groupedModel);\n if (!groupBy.disabled) {\n const fields = getFieldsFromSuppliedLayers(suppliedLayers, groupedModel.getFieldsConfig());\n const allFields = extractFields(facetsAndProjections, fields);\n const dimensions = allFields.filter(field =>\n getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const aggregationFns = groupBy.measures;\n const measureNames = Object.keys(groupedModel.getFieldspace().getMeasure());\n const nearestAggFns = retrieveNearestGroupByReducers(groupedModel, ...measureNames);\n const resolvedAggFns = mergeRecursive(nearestAggFns, aggregationFns);\n\n groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns)\n .project(allFields);\n }\n // sort temporal fields if any in the given rows and columns\n groupedModel = sortDmTemporalFields(resolver, groupedModel);\n return groupedModel;\n};\n\n/**\n * Computes matrices for a group\n *\n * @param {Object} datamodel on which the matrices are to be computed\n * @param {Object} config configuration of the matrices\n * @param {Object} layerRegistry contains the registered layers\n * @return {Object} conputed matrices\n * @memberof MatrixResolver\n */\nexport const computeMatrices = (context, config) => {\n const {\n resolver,\n datamodel,\n componentRegistry,\n encoders\n } = context;\n const {\n globalConfig,\n selection,\n transform\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const { smartlabel: labelManager } = resolver.dependencies();\n const fieldMap = datamodel.getFieldsConfig();\n const layerConfig = resolver.layerConfig();\n const registry = resolver.registry();\n const { fields: normalizedRows } = resolver.horizontalAxis();\n const { fields: normalizedColumns } = resolver.verticalAxis();\n const otherEncodings = resolver.optionalProjections(config, layerConfig);\n const facetsAndProjections = resolver.getAllFields();\n const matrixGnContext = {\n // Configuration to be passed to generate the different matrices.\n // A common config is used for both value matrices and other matrices\n normalizedColumns,\n normalizedRows,\n facetsAndProjections,\n layers: layerConfig,\n fieldMap,\n otherEncodings,\n encoders,\n facet: globalConfig.facet || {},\n axisFrom: globalConfig.axisFrom || {},\n selection,\n resolver\n };\n const cells = {\n GeomCell: resolver.getCellDef(registry.GeomCell),\n AxisCell: resolver.getCellDef(registry.AxisCell),\n BlankCell: resolver.getCellDef(registry.BlankCell),\n TextCell: resolver.getCellDef(registry.TextCell)\n };\n const isRowSizeEqual = isDistributionEqual(normalizedRows);\n const isColumnSizeEqual = isDistributionEqual(normalizedColumns);\n\n resolver.colCells({});\n resolver.rowCells({});\n resolver.datamodelTransform(transform || {});\n\n // Cell creation begins here\n resolver.resetSimpleAxes();\n\n const {\n entryCellMap\n } = resolver.cacheMaps();\n const newCacheMap = {\n exitCellMap: entryCellMap,\n entryCellMap: new Map()\n };\n\n resolver.cacheMaps(newCacheMap);\n\n const valueCellContext = {\n config: globalConfig,\n suppliedLayers: encoders.simpleEncoder.serializeLayerConfig(resolver.layerConfig()),\n resolver,\n cell: cells.GeomCell,\n encoder: encoders.simpleEncoder,\n newCacheMap,\n detailFields: config.detail,\n retinalConfig: {\n color: config.color,\n size: config.size,\n shape: config.shape\n }\n };\n\n const groupedModel = transformDataModel(datamodel, {\n facetsAndProjections,\n suppliedLayers: valueCellContext.suppliedLayers,\n groupBy\n }, resolver);\n\n // return a callback function to create the cells from the matrix\n const cellCreator = resolver.valueCellsCreator(valueCellContext);\n // Creates value matrices from the datamodel and configs\n const valueMatrixInfo = getMatrixModel(groupedModel, facetsAndProjections, cellCreator, globalConfig);\n\n removeExitCells(resolver);\n resolver.cacheMaps().exitCellMap.clear();\n resolver.valueMatrix(valueMatrixInfo.matrix);\n\n const { xAxes, yAxes } = mutateAxesFromMap(resolver.cacheMaps(), resolver.axes());\n\n resolver.axes({\n x: xAxes,\n y: yAxes\n });\n\n resolver.createUnits(componentRegistry, config);\n\n const matrices = {\n valuesMatrix: valueMatrixInfo,\n axesMatrix: resolver.axes()\n };\n // Create all matrices\n const {\n rows,\n columns,\n selectionObj,\n rowPriority,\n colPriority\n } = generateMatrices(matrixGnContext, matrices, cells, labelManager);\n\n resolver.rowMatrix(rows);\n resolver.columnMatrix(columns);\n\n return {\n rows: resolver.rowMatrix(),\n columns: resolver.columnMatrix(),\n values: resolver.valueMatrix(),\n isColumnSizeEqual,\n isRowSizeEqual,\n priority: {\n row: rowPriority,\n col: colPriority\n },\n selection: selectionObj,\n dataModels: {\n groupedModel,\n parentModel: datamodel\n }\n };\n};\n","export const RESOLVER_PROPS = {\n dependencies: {},\n units: {},\n datamodelTransform: {},\n layerConfig: {},\n matrixLayers: {},\n colCells: {},\n rowCells: {},\n rowMatrix: {},\n columnMatrix: {},\n valueMatrix: {},\n encoder: {},\n valueParser: {},\n data: {}\n};\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { generateGetterSetters, STATE_NAMESPACES, getUniqueId } from 'muze-utils';\nimport {\n initializeCacheMaps,\n headerCreator,\n extractUnitConfig,\n setFacetsAndProjections\n} from './group-utils';\nimport {\n ROW, COL, LEFT, RIGHT, COLOR, SIZE, SHAPE, DETAIL, CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS, INITIALIZED,\n AXIS, UNIT, BEFORE_UPDATE, UPDATED, VALUE_MATRIX, FACET_HEADERS\n} from '../enums/constants';\nimport { createValueCells, computeMatrices } from './cell-creator';\nimport { RESOLVER_PROPS } from './resolver-props';\n\n/**\n * Resolves the matrices from configuration provided\n *\n * @export\n * @class MatrixResolver\n */\nexport default class MatrixResolver {\n\n /**\n * Creates an instance of MatrixResolver.\n * @param {Object} dependencies needed to run the resolver\n * @memberof MatrixResolver\n */\n constructor (dependencies) {\n this._registry = {};\n this._layerConfig = [];\n this._matrixLayers = [];\n this._dependencies = dependencies;\n this._rowMatrix = [];\n this._columnMatrix = [];\n this._valueMatrix = [];\n this._facets = { rowFacets: [], colFacets: [] };\n this._projections = { rowProjections: [], colProjections: [] };\n this._datamodelTransform = {};\n this._units = [];\n this._cacheMaps = {};\n this._fireboltDeps = {};\n this._axes = {\n x: {},\n y: {},\n color: [],\n size: [],\n shape: [],\n radius: [],\n angle: [],\n angle0: []\n };\n generateGetterSetters(this, RESOLVER_PROPS);\n this.cacheMaps(initializeCacheMaps());\n }\n\n /**\n * Set: Registers placeholders, Get: return {Object} those placeholders\n *\n * @param {Object} placeholders cells that will construct the group\n * @return {Object} Either current instance or the set of placeholders\n * @memberof MatrixResolver\n */\n registry (...placeholders) {\n if (placeholders.length) {\n Object.entries(placeholders[0]).forEach((val) => {\n this._registry[val[0]] = val[1];\n });\n return this;\n }\n return this._registry;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n cacheMaps (...maps) {\n if (maps.length) {\n [CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS].forEach((e) => {\n this._cacheMaps[`${e}Map`] = maps[0][`${e}Map`] || this._cacheMaps[`${e}Map`];\n });\n return this;\n }\n return this._cacheMaps;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n axes (...axes) {\n if (axes.length) {\n this._axes = Object.assign({}, this._axes, axes[0]);\n return this;\n }\n return this._axes;\n }\n\n /**\n *\n *\n * @param {*} facets\n *\n * @memberof MatrixResolver\n */\n facets (...facets) {\n if (facets.length) {\n Object.entries(facets[0]).forEach((e) => {\n this._facets[e[0]] = e[1];\n });\n return this;\n }\n return this._facets;\n }\n\n /**\n *\n *\n * @param {*} projections\n *\n * @memberof MatrixResolver\n */\n projections (...projections) {\n if (projections.length) {\n Object.entries(projections[0]).forEach((e) => {\n this._projections[e[0]] = e[1];\n });\n return this;\n }\n return this._projections;\n }\n\n /**\n *\n *\n * @param {*} config\n * @param {*} layerConfig\n *\n * @memberof MatrixResolver\n */\n optionalProjections (config, layerConfig) {\n const otherEncodings = {};\n const optionalProjections = [];\n const otherEncodingTypes = [SIZE, COLOR, SHAPE];\n\n otherEncodingTypes.forEach((type) => {\n if (config[type] && config[type].field) {\n const enc = config[type];\n otherEncodings[type] = enc.field;\n optionalProjections.push(enc.field);\n }\n });\n\n if (config[DETAIL]) {\n optionalProjections.push(...config.detail);\n }\n\n if (layerConfig.length) {\n layerConfig.forEach((layer) => {\n if (layer.encoding) {\n Object.values(layer.encoding).forEach((enc) => {\n if (enc && optionalProjections.indexOf(enc.field) === -1) {\n optionalProjections.push(enc.field ? enc.field : enc);\n }\n });\n }\n });\n }\n this.projections({ optionalProjections });\n return otherEncodings;\n }\n\n /**\n * return the normalized set of rows and facets and projections\n *\n * @param {Object} rows parameters needed to set horizontal axis consisiting of rows\n * @return {Object} facets, projections and normalized rows\n * @memberof MatrixResolver\n */\n horizontalAxis (rows, encoder) {\n if (rows) {\n this._horizontalAxis = setFacetsAndProjections(this, { type: ROW, fields: rows }, encoder);\n return this;\n }\n return this._horizontalAxis;\n }\n\n /**\n * return the normalized set of columns and facets and projections\n *\n * @param {Object} columns parameters needed to set vertical axis consisiting of columns\n * @return {Object} facets, projections and normalized columns\n * @memberof MatrixResolver\n */\n verticalAxis (columns, encoder) {\n if (columns) {\n this._verticalAxis = setFacetsAndProjections(this, { type: COL, fields: columns }, encoder);\n return this;\n }\n return this._verticalAxis;\n }\n\n /**\n * Gets the class definition of a particular cell type(if the particular type has been extended, that particular\n * definition is returned)\n *\n * @param {Object} cell cell whose class definition is to be retrieved\n * @return {Object} cell definition\n * @memberof MatrixResolver\n */\n getCellDef (cell) {\n const registry = this.registry();\n\n Object.values(registry).forEach((e) => {\n if (e.prototype instanceof cell) {\n cell = e;\n }\n });\n return cell;\n }\n\n /**\n * return a visual cell creator along with its axis information to be injected to the datamodel creation\n * function\n *\n * @param {Object} GeomCell Type of cell to be created\n * @return {Object} Created cell\n * @memberof MatrixResolver\n */\n valueCellsCreator (context) {\n // reset matrix layers\n this.matrixLayers([]);\n\n return (datamodel, fieldInfo, facets) => createValueCells(context, datamodel, fieldInfo, facets);\n }\n\n /**\n * Callback to be applied on each cell of a matrix of a particular type\n *\n * @param {string} matrixType type of matrix on which callback is to be applied\n * @param {Function} callback function to be applied to each cell\n * @memberof MatrixResolver\n */\n forEach (matrixType, callback) {\n this[matrixType]().forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n callback(rIndex, cIndex, col);\n });\n });\n }\n\n /**\n *\n *\n *\n * @memberof MatrixResolver\n */\n getAllFields () {\n const retObj = this.projections();\n\n Object.entries(this.facets()).forEach((e) => {\n retObj[e[0]] = e[1];\n });\n return retObj;\n }\n\n /**\n *\n *\n * @memberof MatrixResolver\n */\n resetSimpleAxes () {\n return this.axes({\n x: new Set(),\n y: new Set(),\n radius: [],\n angle: [],\n angle0: [],\n pie: []\n });\n }\n\n setFireboltDependencies (prop, deps) {\n Object.assign(this._fireboltDeps, {\n [prop]: deps\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} componentRegistry\n * @param {*} config\n * @memberof MatrixResolver\n */\n createUnits (componentRegistry, config) {\n const {\n globalConfig,\n alias,\n coord\n } = config;\n const {\n layerRegistry,\n sideEffectRegistry\n } = componentRegistry;\n const {\n smartlabel: smartLabel,\n lifeCycleManager,\n throwback\n } = this.dependencies();\n const fireboltDeps = this._fireboltDeps;\n\n // Provide the source for the matrix\n const units = [[]];\n // Setting unit configuration\n const unitConfig = extractUnitConfig(globalConfig || {});\n const store = this.store();\n store.lockModel();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n let unit = el.source();\n if (!unit) {\n const namespace = `unit${i}-${j}-${getUniqueId()}`;\n\n unit = VisualUnit.create({\n layerRegistry,\n sideEffectRegistry\n }, {\n smartLabel,\n lifeCycleManager,\n throwback,\n fireboltDeps\n });\n unit.metaInf({\n rowIndex: i,\n colIndex: j,\n namespace\n });\n unit.store(store);\n unit.coord(coord);\n el.source(unit);\n }\n !units[i] && (units[i] = []);\n units[i][j] = unit;\n unit.parentAlias(alias)\n .valueParser(this.valueParser())\n .coord(coord);\n el.config(unitConfig);\n });\n store.unlockModel();\n lifeCycleManager.notify({ client: units, action: INITIALIZED, formalName: UNIT });\n return this.units(units);\n }\n\n /**\n *\n *\n * @param {*} config\n * @memberof MatrixResolver\n */\n setDomains (config, datamodel, encoders) {\n const {\n color,\n shape,\n size,\n globalConfig\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const {\n rowFacets,\n colFacets\n } = this.getAllFields();\n const encoding = {\n color,\n shape,\n size\n };\n const facetFields = [...rowFacets.map(e => e.toString()), ...colFacets.map(e => e.toString())];\n const retContext = {\n domains: encoders.simpleEncoder.getRetinalFieldsDomain(datamodel, encoding, facetFields, groupBy),\n axes: this.axes(),\n encoding\n };\n encoders.retinalEncoder.setCommonDomain(retContext);\n return this;\n }\n\n resetFacetsAndProjections () {\n this._facets = {};\n this._projections = {};\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof MatrixResolver\n */\n getRetinalAxes () {\n const {\n color,\n shape,\n size\n } = this.axes();\n\n return {\n color: [...color],\n shape: [...shape],\n size: [...size]\n };\n }\n\n /**\n *\n *\n * @param {*} type\n *\n * @memberof MatrixResolver\n */\n getSimpleAxes (type) {\n return this.axes()[`${type}`];\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof MatrixResolver\n */\n createRetinalAxes (fieldsConfig, config, encoders) {\n const layerConfig = this.layerConfig();\n this.optionalProjections(config, layerConfig);\n const retinalAxes = encoders.retinalEncoder.createAxis({\n fieldsConfig,\n config,\n axes: this.axes()\n });\n const {\n lifeCycleManager\n } = this.dependencies();\n\n [COLOR, SHAPE, SIZE].forEach((e) => {\n this.axes()[e] = retinalAxes[e];\n });\n\n lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS });\n lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT });\n\n const units = [];\n const matrixLayers = this.matrixLayers();\n const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`,\n `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`];\n const store = this.store();\n store.lockCommits(props);\n store.lockModel();\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n el.axes(Object.assign(el.axes(), retinalAxes));\n el.source() && el.source().retinalFields(config);\n el.layerDef(matrixLayers[i][j]);\n el.updateModel();\n\n units.push(el.source());\n });\n store.unlockModel()\n .unlockCommits([props[0]])\n .unlockCommits([props[1]]);\n lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT });\n return this;\n }\n\n /**\n *\n *\n * @param {*} placeholders\n * @param {*} fieldNames\n *\n * @memberof MatrixResolver\n */\n createHeaders (placeholders, fieldNames, config) {\n let bottomLeft = [];\n let bottomRight = [];\n const {\n rows,\n columns\n } = placeholders;\n const {\n smartlabel: labelManager,\n lifeCycleManager\n } = this.dependencies();\n const {\n showHeaders,\n classPrefix\n } = config;\n const TextCell = this.getCellDef(this.registry().TextCell);\n const BlankCell = this.getCellDef(this.registry().BlankCell);\n const [leftRows, rightRows] = rows;\n const [topCols, bottomCols] = columns;\n const rowHeaders = fieldNames.rows;\n const blankCellCreator = cell => new BlankCell().config({ show: cell.config().show });\n\n // Headers and footers are created based on the rows. Thereafter, using the column information\n // they are tabularized into the current structure\n const headers = {\n left: headerCreator(leftRows, rowHeaders[0], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager }),\n right: headerCreator(rightRows, rowHeaders[1], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager })\n };\n const footers = {\n left: leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : [],\n right: rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []\n };\n const [topLeft, topRight] = [LEFT, RIGHT].map(type => topCols.map((col, i) => {\n if (i === topCols.length - 1) {\n return headers[type];\n }\n return footers[type];\n }));\n\n // Creating only bottom matrices if there is no information on the top\n if (topCols.length === 0) {\n [bottomLeft, bottomRight] = [LEFT, RIGHT].map(type => bottomCols.map((col, i) => {\n if (i === 0) {\n return headers[type];\n }\n return footers[type];\n }));\n } else {\n bottomLeft = bottomCols.map(() => (leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : []));\n bottomRight = bottomCols.map(() => (rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []));\n }\n\n lifeCycleManager.notify({\n client: [topLeft, topRight, bottomLeft, bottomRight],\n action: INITIALIZED,\n formalName: FACET_HEADERS\n });\n\n return { topLeft, topRight, bottomLeft, bottomRight };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @param {*} componentRegistry\n * @param {*} encoders\n *\n * @memberof MatrixResolver\n */\n getMatrices (datamodel, config, componentRegistry, encoders) {\n const context = {\n datamodel,\n componentRegistry,\n encoders,\n resolver: this\n };\n\n return computeMatrices(context, config);\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n return this;\n }\n return this._store;\n }\n\n clear () {\n const cacheMaps = this._cacheMaps;\n for (const key in cacheMaps) {\n cacheMaps[key].clear();\n }\n }\n\n}\n","/**\n * This is a wrapper class over the matrix of cells which gets created in visual group. Visual Group creates left,\n * right, bottom and top and center matrices and wraps them using this class.\n *\n * @public\n * @class ValueMatrix\n */\nclass ValueMatrix {\n\n /**\n * Creates an instance of ValueMatrix.\n *\n * @param {Array} matrixArr Matrix array.\n */\n constructor (matrixArr) {\n const instancesById = {};\n\n this.matrix(matrixArr || []);\n this.filter(() => true);\n\n this.each((el, rIdx, cIdx) => {\n const cellValue = el.valueOf();\n if (cellValue && cellValue.id) {\n const id = cellValue.id();\n instancesById[id] = {\n instance: cellValue,\n rowIndex: rIdx,\n colIndex: cIdx\n };\n }\n });\n\n this.instancesById(instancesById);\n }\n\n instancesById (...id) {\n if (id.length) {\n this._instancesById = id[0];\n return this;\n }\n return this._instancesById;\n }\n\n /**\n * Returns the array of matrices contained in this instance.\n *\n * @public\n * @return {Array} Array of matrices.\n */\n matrix (...matrix) {\n if (matrix.length) {\n this._matrix = matrix[0];\n return this;\n }\n return this._matrix;\n }\n\n /**\n * Sets a filter criteria. This filter criteria gets applied when each function is called.\n *\n * @public\n * @param {Function} fn Filter function.\n *\n * @return {ValueMatrix} Instance of value matrix.\n */\n filter (...fn) {\n if (fn.length) {\n this._filterFn = fn[0];\n return this;\n }\n return this._filterFn;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n width () {\n let rowWidth = 0;\n\n this.matrix().forEach((row) => {\n let currentRowWidth = 0;\n row.forEach((cell) => {\n currentRowWidth += cell.getLogicalSpace().width;\n });\n rowWidth = Math.max(rowWidth, currentRowWidth);\n });\n return rowWidth;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n height () {\n let rowHeight = 0;\n\n this.matrix().forEach((row) => {\n let currentRowHeight = 0;\n row.forEach((cell) => {\n currentRowHeight = Math.max(currentRowHeight, cell.getLogicalSpace().height);\n });\n rowHeight += currentRowHeight;\n });\n return rowHeight;\n }\n\n /**\n * Iterates through the two dimensional matrix array and calls the given callback function with the cell instance,\n * row index, column index and the matrix array.\n *\n * @param {Function} fn Callback function which will get called for every cell.\n * @return {ValueMatrix} Instance of the value matrix.\n */\n each (fn) {\n const matrix = this.matrix();\n const filterFn = this.filter();\n\n matrix.forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n if (filterFn(col)) {\n fn(col, rIndex, cIndex, matrix);\n }\n });\n });\n return this;\n }\n\n findPlaceHolderById (id) {\n return this.instancesById()[id];\n }\n\n clear () {\n this.each(cell => cell.remove());\n this.matrix([]);\n }\n}\n\nexport default ValueMatrix;\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { getEncoder, getBorders } from '../group-helper';\nimport { RetinalEncoder } from '../encoder';\nimport { registerDomainChangeListener, unsubscribeChangeListeners } from './change-listener';\nimport ValueMatrix from './value-matrix';\n\nexport const createUnitState = (context) => {\n const [globalState, localState] = VisualUnit.getState();\n const store = context.store();\n store.append(STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE, localState);\n};\n\nexport const initializeGlobalState = (context) => {\n const globalState = context.constructor.getState()[0];\n const store = context.store();\n store.append(STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE, globalState);\n};\n\nexport const createLayerState = (context) => {\n const [globalState, localState] = BaseLayer.getState();\n context.store().append(STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE, localState);\n};\n\nconst sanitizeRetinalConfig = (retinalConf) => {\n const conf = {};\n for (const key in retinalConf) {\n const confValue = retinalConf[key];\n if (typeof confValue === 'string' || !confValue) {\n conf[key] = {\n field: retinalConf[key]\n };\n } else {\n conf[key] = confValue;\n }\n }\n return conf;\n};\n\nexport const setMatrixInstances = (context, placeholder) => {\n let {\n values,\n rows,\n columns\n } = placeholder;\n values = values || [];\n rows = rows || [];\n columns = columns || [];\n context._composition.matrices = {\n value: new ValueMatrix(values),\n left: new ValueMatrix(rows[0]),\n right: new ValueMatrix(rows[1]),\n top: new ValueMatrix(columns[0]),\n bottom: new ValueMatrix(columns[1])\n };\n\n context._dependencies.throwback.commit(CommonProps.MATRIX_CREATED, true);\n return context;\n};\n\nexport const createMatrices = (context) => {\n const rows = context.rows();\n const columns = context.columns();\n const color = context.color();\n const datamodel = context.data();\n const size = context.size();\n const detail = context.detail();\n const layers = context.layers();\n const transform = context.transform();\n const config = context.config();\n const shape = context.shape();\n\n // Get the resolver for the matrices\n const resolver = context.resolver();\n resolver.store(context.store());\n resolver.valueParser(context.valueParser());\n // Prepare configuration for matrix preparation\n let matrixConfig = {\n selection: context.selection(),\n alias: context.alias(),\n globalConfig: config || {},\n rows,\n columns,\n detail,\n layers,\n transform\n };\n\n unsubscribeChangeListeners(context);\n\n const retinalConfig = sanitizeRetinalConfig({\n color,\n shape,\n size\n });\n\n matrixConfig = Object.assign(matrixConfig, retinalConfig);\n // Create the encoders for the group\n const encoders = {};\n encoders.retinalEncoder = new RetinalEncoder();\n encoders.simpleEncoder = getEncoder(layers);\n matrixConfig.coord = encoders.simpleEncoder.constructor.type();\n resolver.encoder(encoders.simpleEncoder);\n\n // Set the group type\n context.groupType(encoders.simpleEncoder.constructor.type());\n\n // Get sanitized fields as instances of the Vars Class\n const fields = encoders.simpleEncoder.fieldSanitizer(datamodel, matrixConfig);\n encoders.simpleEncoder.setAxisAndHeaders(config ? config.axisFrom : {}, fields);\n // Setting layers for the code\n layers && resolver.layerConfig(layers);\n // Set the row and column axes\n resolver.horizontalAxis(fields.rows, encoders).verticalAxis(fields.columns, encoders);\n // Getting the placeholders\n const placeholderInfo = resolver.getMatrices(datamodel, matrixConfig, context.registry(), encoders);\n context._groupedDataModel = placeholderInfo.dataModels.groupedModel;\n // Set the selection object\n context.selection(placeholderInfo.selection);\n\n // Create retinal axes\n resolver.createRetinalAxes(placeholderInfo.dataModels.parentModel.getFieldsConfig(), retinalConfig,\n encoders);\n\n // Domains are evaluated for each of the axes for commonality\n resolver.setDomains(matrixConfig, placeholderInfo.dataModels, encoders);\n\n // Create matrix instances\n setMatrixInstances(context, placeholderInfo);\n\n // Prepare corner matrices\n context.cornerMatrices(resolver.createHeaders(placeholderInfo, fields, config));\n\n // Set placeholder information\n context.placeholderInfo(placeholderInfo);\n\n context._composition.axes = resolver.axes();\n context.metaData({\n border: getBorders(placeholderInfo, encoders.simpleEncoder)\n });\n\n resolver.encoder().unionUnitDomains(context);\n\n registerDomainChangeListener(context);\n return context;\n};\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\n\nimport { STATE_NAMESPACES } from 'muze-utils';\n\nexport const setupChangeListeners = (context) => {\n const store = context.store();\n const stores = {\n throwback: context._dependencies.throwback,\n store\n };\n\n ['x', 'y'].forEach((axisType) => {\n store.registerChangeListener([`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${axisType}`], () => {\n const groupAxes = context.resolver().axes();\n groupAxes[axisType].forEach(axes => axes.forEach((axis) => {\n axis.render();\n }));\n });\n });\n\n [VisualUnit, BaseLayer].forEach((comp) => {\n const formalName = comp.formalName();\n ['store', 'throwback'].forEach((type) => {\n const listeners = comp.getListeners()[type];\n const storeInst = stores[type];\n listeners.forEach((listenerInf) => {\n storeInst[listenerInf.type](listenerInf.props, listenerInf.listener, false, {\n namespace: formalName,\n subNamespace: listenerInf.subNamespace\n });\n });\n });\n });\n};\n\nexport const registerDomainChangeListener = (context) => {\n const store = context.store();\n store.registerChangeListener([`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`], () => {\n context.resolver().encoder().unionUnitDomains(context);\n }, false, {\n key: 'unionDomain'\n });\n};\n\nexport const unsubscribeChangeListeners = (context) => {\n context.store().unsubscribe({\n key: 'unionDomain'\n });\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\nexport const PROPS = {\n alias: {},\n data: {},\n cornerMatrices: {\n defaultValue: {\n topLeft: [],\n topRight: [],\n bottomLeft: [],\n bottomRight: []\n }\n },\n groupType: {},\n\n metaData: {\n defaultValue: {\n border: {}\n }\n },\n placeholderInfo: {\n defaultValue: {}\n },\n resolver: {},\n valueParser: {\n defaultValue: val => val\n },\n registry: {\n sanitization: (context, value) => {\n if (context.resolver) {\n context.resolver().registry(value.cellRegistry);\n }\n return value;\n }\n },\n selection: {},\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { generateGetterSetters } from 'muze-utils';\nimport localOptions from './local-options';\nimport { SimpleGroup } from '../simple-group';\nimport {\n MatrixResolver,\n findInGroup\n} from '../group-helper';\nimport { createUnitState, initializeGlobalState, setMatrixInstances, createMatrices, createLayerState } from './helper';\nimport { setupChangeListeners } from './change-listener';\nimport { PROPS } from './props';\nimport {\n CONFIG,\n MOUNT,\n RETINAL,\n Y\n} from '../enums/constants';\n\n/**\n * VisualGroup is instantiated by canvas for creating {@link VisualUnit} and axes instances.It creates the\n * the matrix of visual units and axes. It also creates the layout instance which manages the allocation\n * of space of matrices.\n *\n * To get instance of visual group,\n * ```\n * const visualGroup = canvas.composition().visualGroup;\n * ```\n * @public\n *\n * @class VisualGroup\n */\nclass VisualGroup extends SimpleGroup {\n\n /**\n * Creates an instance of VisualGroup. Requires dependencies and other registry options for placeholders\n * and layers that create individual units.\n *\n * @param {Object} registry Key value pair of compostions for the group\n * @param {Object} dependencies Dependencies needed to run the group\n * @memberof VisualGroup\n */\n constructor (registry, dependencies) {\n super();\n\n const {\n componentSubRegistry\n } = registry;\n\n this._dependencies = dependencies;\n // Generate getter/setter methods for all properties of the class\n // One can get each property by calling the method and can set it\n // by passing paramaters for the same. Thus, one can chain setter\n // getter methods.\n generateGetterSetters(this, PROPS);\n generateGetterSetters(this, localOptions);\n // Populate the store with default values\n // initialize group compositions\n this._composition = {};\n // store reference to data\n this._data = [];\n // store reference to mountpoint\n this._mount = null;\n // selection object that takes care of updating of components\n this._selection = {};\n // Create instance of matrix resolver\n this.resolver(new MatrixResolver(this._dependencies));\n // matrix instance store each of the matrices\n setMatrixInstances(this, {});\n // Getting indiviual registered items\n this.registry({\n layerRegistry: componentSubRegistry.layerRegistry.get(),\n cellRegistry: componentSubRegistry.cellRegistry.get()\n });\n }\n\n static getState () {\n return [{\n domain: {\n x: null,\n y: null,\n radius: null,\n angle: null,\n angle0: null\n }\n }, {}];\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n initializeGlobalState(this);\n createUnitState(this);\n createLayerState(this);\n // Register listeners\n setupChangeListeners(this);\n return this;\n }\n return this._store;\n }\n\n /**\n * Return the instances of matrices created by the visual group.\n *\n * @return {Object} Instance of matrices.\n */\n matrixInstance (...matrices) {\n if (matrices.length) {\n return this;\n }\n return this.composition().matrices;\n }\n\n /**\n * Returns the composition of visual group.\n *\n * @public\n *\n * @return {Object} Composition of visual group. It contains instance of matrices {@link ValueMatrix}\n * and instances of axis.\n * ```\n * {\n * matrices: {\n * value: // Instance of center value matrix.\n * left: // Instance of left value matrix\n * right: // Instance of right value matrix\n * bottom: // Instance of bottom value matrix\n * top: // Instance of top value matrix.\n * },\n * axes: {\n * x: // Array of x axis.\n * y: // Array of y axis\n * color: // Array of color axis\n * shape: // Array of shape axis\n * size: // Array of size axis.\n * }\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n /**\n * Locks the model to prevent change listeners to be triggered until unlocked\n *\n * @return {Object} Instance of class VisualGroup\n * @memberof VisualGroup\n */\n lockModel () {\n this.store().model.lock();\n return this;\n }\n\n /**\n * Unlocks the model so that all change listeners can be triggered\n *\n * @return {Object} Instance of class VisualGroup\n */\n unlockModel () {\n this.store().model.unlock();\n return this;\n }\n\n /**\n * Returns the channel name of the variable. Channels are rows, columns, color, shape and size.\n *\n * @public\n * @param {string} variable Name of the variable.\n *\n * @return {string} Name of the channel.\n */\n where (variable) {\n return findInGroup(variable, this.resolver().getAllFields());\n }\n\n /**\n * Gets the axis instances of the visual group based on the given axis type.\n *\n * @public\n * @param {string} type Type of axis. X,Y or retinal axes.\n *\n * @return {Array} Array of axis instances.\n */\n getAxes (type) {\n if (type === RETINAL) {\n return this.resolver().getRetinalAxes();\n }\n return this.resolver().getSimpleAxes(type);\n }\n\n /**\n * Returns the instances of cells based on the given type. Type can be given as `row' or `col`.\n *\n * @public\n * @return {Array} Two dimensional array of cells.\n */\n getCells (type) {\n return this.resolver()[`${type}Cells`]();\n }\n\n getFieldsFromChannel (channel) {\n const {\n rowProjections,\n colProjections\n } = this.resolver().getAllFields();\n return channel === Y ? rowProjections : colProjections;\n }\n\n getCellsByFacetKey (facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey] || [];\n return cells;\n }\n\n getAxesByFacetKey (axisType, facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey];\n const axes = cells[0].valueOf().axes()[axisType] || [];\n\n return axes;\n }\n\n /**\n * This method is used to return a serialized representation of the instance's properties.\n *\n * @return {Object} Object with config proprties.\n * @memberof VisualGroup\n */\n serialize () {\n const store = this.store();\n\n return {\n [CONFIG]: store.get(CONFIG),\n [MOUNT]: store.get(MOUNT)\n };\n }\n\n /**\n * Returns the grouped datamodel prepared by visual group. If there is no group by performed, then it returns the\n * original data model passed to visual group.\n *\n * @return {DataModel} Grouped data model.\n */\n getGroupByData () {\n return this._groupedDataModel;\n }\n\n createMatrices () {\n createMatrices(this);\n }\n\n remove () {\n this.matrixInstance().value.clear();\n this.resolver().clear();\n const info = this.placeholderInfo();\n info.rows = null;\n info.columns = null;\n info.values = null;\n }\n}\n\nexport default VisualGroup;\n","import { PersistentBehaviour, SELECTION } from '@chartshq/muze-firebolt';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return 'select';\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingRemoveSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_OLD_EXIT\n || selectionSet._set[d] === SELECTION.SELECTION_NEW_EXIT);\n // existing add set\n if (existingRemoveSet.length) {\n selectionSet.updateEntry();\n selectionSet.add(existingRemoveSet);\n } else {\n selectionSet.updateExit();\n selectionSet.remove(addSet);\n }\n const { exitSet } = selectionSet.getSets();\n const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])];\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n return this;\n }\n}\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nconst CLASSPREFIX = 'muze';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n target: `.${CLASSPREFIX}-gradient-rect`,\n behaviours: [BEHAVIOURS.BRUSH]\n },\n [ACTIONS.HOVER]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.CLICK]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.SELECT]\n }\n};\n\nexport const propagationBehaviourMap = {\n [BEHAVIOURS.SELECT]: BEHAVIOURS.FILTER,\n [BEHAVIOURS.BRUSH]: BEHAVIOURS.HIGHLIGHT\n};\n","import * as BEHAVIOURS from '../enums/behaviours';\nimport * as sideEffects from '../enums/side-effects';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: [sideEffects.SELECTIONBOX, {\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [sideEffects.Highlighter],\n select: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }]\n};\n\nexport const propagationSideEffects = {\n [BEHAVIOURS.BRUSH]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: ['filter']\n};\n\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n\n","export const SELECTIONBOX = 'selectionBox';\nexport const Highlighter = 'highlighter';\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const CONFIG = 'config';\nexport const DATAMODEL = 'dataModel';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const MAXWIDTH = 'max-width';\nexport const HEIGHT = 'height';\nexport const MOUNTPOINT = 'mountPoint';\nexport const GRIDLINEPARENTGROUPCLASS = 'grid-lines';\nexport const TRANSFORM = 'transform';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const DEFAULTCOLOR = '#F44336';\nexport const DEFAULTSIZE = 50;\nexport const DEFAULTSHAPE = 'circle';\nexport const STEP = 'step';\nexport const GRADIENT = 'gradient';\nexport const ORDINAL = 'ordinal';\nexport const SCALE_FUNCTIONS = {\n size: 'getSize',\n shape: 'getShape',\n color: 'getColor'\n};\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const HORIZONTAL = 'horizontal';\nexport const VERTICAL = 'vertical';\nexport const CENTER = 'center';\nexport const VALUE = 'value';\nexport const PATH = 'path';\nexport const SHAPE = 'shape';\nexport const ICON = 'icon';\nexport const RECT = 'rect';\nexport const START = 'start';\nexport const UPPER = 'upper';\nexport const LOWER = 'lower';\nexport const END = 'end';\nexport const SIZE = 'size';\nexport const DISCRETE = 'discrete';\nexport const MEASURE = 'measure';\n\n","import { assembleModelFromIdentifiers, getDataModelFromRange } from 'muze-utils';\nimport { propagationBehaviourMap } from './action-behaviour-map';\nimport { propagationSideEffects } from './behaviour-effect-map';\nimport { STEP, GRADIENT, DISCRETE, MEASURE } from '../enums/constants';\n\nexport const propagate = (firebolt, action, selectionSet, config = {}) => {\n let propagationData;\n const context = firebolt.context;\n const type = context.constructor.type();\n const payload = config.payload;\n const data = context.data();\n const metaData = context.metaData();\n const fieldType = metaData.getData().schema[0].type;\n\n const propPayload = {};\n const sourceId = context._id;\n propPayload.action = propagationBehaviourMap[action] || action;\n propPayload.sideEffects = propagationSideEffects[action];\n propPayload.sourceCanvas = context.canvasAlias();\n const isMutableAction = firebolt._actions.behavioural[propPayload.action].constructor.mutates();\n if (payload.criteria === null) {\n propagationData = null;\n } else {\n const entrySet = selectionSet.mergedEnter;\n let values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.rawVal);\n if (type === STEP || (type === DISCRETE && fieldType === MEASURE)) {\n const field = Object.keys(payload.criteria || {})[0];\n values = data.filter(d => entrySet.uids.indexOf(d.id) !== -1).map(d => d.range);\n propagationData = values.length ? metaData.select((fields) => {\n let check = false;\n for (let i = 0; i < values.length; i++) {\n check = fields[field].internalValue >= values[i][0] && fields[field].internalValue <= values[i][1];\n if (check === true) {\n break;\n }\n }\n return check;\n }, {\n saveChild: false\n }) : null;\n } else if (type === GRADIENT) {\n propagationData = getDataModelFromRange(metaData, payload.criteria);\n } else if (values.length) {\n propagationData = assembleModelFromIdentifiers(metaData, [payload.criteria[0], ...values.map(d => [d])]);\n } else {\n propPayload.criteria = null;\n propagationData = metaData.select(() => true, {\n saveChild: false\n });\n }\n }\n\n let propagateInterpolatedValues = false;\n\n if (propagationData) {\n const schema = propagationData.getSchema();\n propagateInterpolatedValues = schema.every(d => d.type === MEASURE);\n }\n\n const propConfig = {\n sourceId: `legend-${sourceId}`,\n payload: propPayload,\n criteria: propPayload.criteria === null ? null : propagationData,\n isMutableAction,\n propagateInterpolatedValues,\n action: propPayload.action\n };\n\n metaData.propagate(propagationData, propConfig, true);\n};\n","import { Firebolt } from '@chartshq/muze-firebolt';\nimport { propagate } from './helper';\nimport { STEP, GRADIENT } from '../enums/constants';\n\n/**\n * This class manages the interactions of legend.\n * @export\n * @class LegendFireBolt\n * @extends {Firebolt}\n */\nexport class LegendFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.initializeSideEffects();\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet[0];\n }\n\n propagate (behaviourName, payload, selectionSet) {\n propagate(this, behaviourName, selectionSet, {\n payload\n });\n }\n\n getAddSetFromCriteria (criteria) {\n let values;\n let uniqueIds;\n const type = this.context.constructor.type();\n\n if (criteria === null) {\n uniqueIds = null;\n } else if (type === STEP) {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n } else if (type === GRADIENT) {\n uniqueIds = [];\n } else {\n values = criteria[1];\n if (values) {\n uniqueIds = this.context.data().filter(d => values.indexOf(d.rawVal) !== -1).map(d => d.id);\n } else {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n }\n }\n return {\n uids: uniqueIds,\n model: null\n };\n }\n\n getFullData () {\n return null;\n }\n}\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\n/**\n * Adds dragging action to the target element.\n * @param {firebolt} firebolt firebolt\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let endPos = {};\n let payload;\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const boundingBox = context.measurement().gradientDimensions;\n const axisType = context.config().align === 'horizontal' ? 'x' : 'y';\n const axisScale = context.axis().source().scale();\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n }).on('drag', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }).on('end', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n if (startPos[axisType] === endPos[axisType]) {\n payload = {\n criteria: {}\n };\n } else {\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n }\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }));\n};\n\nexport default drag;\n","import { getEvent } from 'muze-utils';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} Firebolt instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n const event = getEvent();\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, {\n criteria: null\n }));\n event.stopPropagation();\n });\n};\n\nexport default hover;\n","/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nconst click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\n\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport click from './click';\nimport * as ACTIONNAMES from '../../enums/actions';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click\n};\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\n","import {\n getMousePos,\n getEvent,\n getD3Drag\n } from 'muze-utils';\nimport { HEIGHT, WIDTH, HORIZONTAL } from '../../enums/constants';\n\nconst getSelectionCriteria = (subject, axis, measures) => {\n let criteria = [];\n const {\n axisScale,\n axisType\n } = axis;\n const {\n startPos,\n endPos,\n selectionBoxMeasure,\n drawingInfMeasure,\n offset\n } = measures;\n const subjectStartPoint = subject[axisType];\n\n if (startPos[axisType] === endPos[axisType]) {\n criteria = [];\n } else if (subjectStartPoint + selectionBoxMeasure >= drawingInfMeasure + offset) {\n criteria = [axisScale.invert(drawingInfMeasure + offset - selectionBoxMeasure),\n axisScale.invert(drawingInfMeasure + offset)];\n } else if (subjectStartPoint - offset < offset) {\n criteria = [axisScale.invert(offset * 2), axisScale.invert(selectionBoxMeasure + offset * 2)];\n } else {\n criteria = [axisScale.invert(subjectStartPoint), axisScale.invert(subjectStartPoint + selectionBoxMeasure)];\n }\n axisType === 'x' ? criteria : criteria.reverse();\n return criteria;\n};\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let payload;\n const endPos = {};\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const axisScale = context.axis().source().scale();\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n const drawingInfMeasure = context.measurement().gradientDimensions[axisType === 'x' ?\n WIDTH : HEIGHT];\n const offset = axisScale.range()[axisType === 'x' ? 0 : 1];\n const measures = {\n drawingInfMeasure,\n offset\n };\n let subject = {};\n\n targetEl.call(d3Drag().on('start', function () {\n const event = getEvent();\n startPos = getMousePos(this, event.sourceEvent);\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n\n subject.x += event.dx;\n subject.y += event.dy;\n\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(subject, { axisScale, axisType }, measures);\n\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }).on('end', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(event, { axisScale, axisType }, measures);\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true,\n config: {\n transition: {\n duration: 200\n }\n }\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }));\n};\n\n","import { makeElement } from 'muze-utils';\nimport { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { CLASSPREFIX, HEIGHT, WIDTH, HORIZONTAL, RECT } from '../../../enums/constants';\nimport { SELECTIONBOX } from '../../../enums/side-effects';\nimport { selectionBoxDrag } from '../../physical/selection-box-drag';\nimport './styles.scss';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\n/* istanbul ignore next */ class SelectionBox extends SpawnableSideEffect {\n static formalName () {\n return SELECTIONBOX;\n }\n\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n className: 'legend-selection-box',\n classPrefix: CLASSPREFIX\n };\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n */\n /* istanbul ignore next */ apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const firebolt = this.firebolt;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n const className = `${config.classPrefix}-${config.className}`;\n\n const domain = payload.criteria[firebolt.context.fieldName()];\n const axisScale = axis.scale();\n const range = domain ? [axis.getScaleValue(domain[0]), axis.getScaleValue(domain[1])] : [];\n\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n\n const gradientDimension = firebolt.context.measurement().gradientDimensions[axisType === 'x' ?\n HEIGHT : WIDTH];\n\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n const legendGradContainer = context.getDrawingContext().svgContainer;\n const legendSelGroup = makeElement(legendGradContainer, 'g', [1], `${config.classPrefix}-selection-box-group`);\n\n if (firebolt.context.config().align === HORIZONTAL) {\n x = range[0] - rangeShifter || 0;\n y = 0;\n width = range[1] - range[0] || 0;\n height = gradientDimension;\n } else {\n x = 0;\n y = range[1] - rangeShifter || 0;\n height = range[0] - range[1] || 0;\n width = gradientDimension;\n }\n const enterFn = function (el) {\n selectionBoxDrag(firebolt)(el, ['brush']);\n };\n const selBox = makeElement(legendSelGroup, RECT, [{ domain, x, y, width, height }], className,\n { enter: enterFn });\n selBox.attr('y', y)\n .attr('x', x)\n .attr(WIDTH, width)\n .attr(HEIGHT, height);\n }\n}\n\nexport default SelectionBox;\n\n","import { selectElement } from 'muze-utils';\n\nexport const strategies = (firebolt) => {\n const context = firebolt.context;\n const classed = (set, className, change) => {\n const classPrefix = context.config().classPrefix;\n selectElement(context.mount())\n .selectAll(`.${classPrefix}-legend-columns`)\n .filter(d => set.uids.indexOf(d.id) !== -1)\n .selectAll('div')\n .classed(className, change);\n };\n\n return {\n fade: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-fadeout`, false);\n } else {\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-fadeout`, true);\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-fadeout`, false);\n }\n },\n brighten: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-brighten`, false);\n } else {\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-brighten`, true);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n }\n }\n };\n};\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { strategies } from './strategies';\nimport { Highlighter } from '../../../enums/side-effects';\n\nexport default class LegendHighlighter extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._strategies = strategies(this.firebolt);\n this._strategy = 'brighten';\n }\n\n static formalName () {\n return Highlighter;\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this);\n }\n}\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n data: {},\n fieldName: {},\n legendContainer: {},\n measurement: {\n sanitization: (context, value) => {\n const measurement = mergeRecursive(context._measurement, value);\n ['padding', 'border', 'margin'].forEach((space) => {\n measurement[space] = Math.min(measurement[space] > 0 ? measurement[space] : 0,\n measurement.maxWidth * 0.1, measurement.maxHeight * 0.1);\n });\n return measurement;\n }\n },\n logicalSpace: {},\n metaData: {},\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.resetLogicalSpace();\n context.store().commit('range', value);\n return value;\n }\n },\n scale: {},\n smartTicks: {},\n store: {},\n title: {\n sanitization: (context, value) => mergeRecursive(context._title || {}, value)\n },\n labelManager: {},\n minTickDistance: {},\n valueParser: {\n defaultValue: val => val\n }\n};\n","import { getSymbol } from 'muze-utils';\nimport {\n CENTER,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\nexport const ALIGN = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical'\n};\n\nexport const DEFAULT_MEASUREMENT = {\n height: 30,\n width: 30,\n maxWidth: Infinity,\n maxHeight: Infinity,\n padding: 2,\n margin: 2,\n border: 1\n};\n\nexport const LEGEND_TITLE = {\n text: '',\n orientation: (pos) => {\n if (pos === LEFT || pos === RIGHT) {\n return LEFT;\n } return CENTER;\n }\n};\n\nexport const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n borderStyle: 'solid',\n borderColor: 'rgba(0,0,0,0)',\n formatter: {\n bounds: {\n lower: 'less than',\n upper: 'more than'\n }\n },\n item: {\n text: {\n orientation: 'right',\n width: 10,\n formatter: (val, i, data, context) => context.valueParser()(val)\n },\n icon: {\n className: 'legend-icon',\n height: 20,\n width: 20,\n color: 'rgba(0,0,0,.5)',\n type: 'square'\n }\n }\n};\n\n/**\n * Creates a map of pre defined icons\n *\n * @param {string} icon Accepts a icon name like 'square', 'cross', 'diamond' etc\n * @return {Object} icon object which can be used to draw the icons\n */\nexport const ICON_MAP = (icon) => {\n if (icon && typeof (icon) === 'string') {\n return getSymbol(icon);\n } return icon;\n};\n","import { makeElement, numberInterpolator } from 'muze-utils';\n\nimport {\n SCALE_FUNCTIONS,\n WIDTH,\n HEIGHT,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n MAXWIDTH\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} scale\n *\n */\nexport const getScaleInfo = (scale) => {\n const scaleType = scale.constructor.type();\n const domain = scale.uniqueValues();\n const steps = scale.config().stops || 1;\n const scaleFn = SCALE_FUNCTIONS[scaleType];\n\n return { scaleType, domain, steps, scaleFn };\n};\n\n/**\n * Function to recompute the stops in array in case to left and right alignment of legend.\n *\n * @param {string} param - parameter to measure\n * @param {Object} requiredMeasure - required measure parameters\n * @param {Object} availableMeasure - available meassure parameters\n * @param {Array} domainForLegend - array\n * @param {Object} smartLabelCalc - smartLabel Manager\n * @return {Array} - Array\n */\nconst getcomputedArray = (computationhelper, requiredMeasure, availableMeasure, domainForLegend) => {\n // declaring Current and Next Tick Value variable\n let currentTickValue;\n let nextTickValue;\n const upperBound = domainForLegend[domainForLegend.length - 1];\n const param = computationhelper.measureParam;\n const smartLabelCalc = computationhelper.smartLabelCalc;\n\n // calculating pixel required per Tick Values\n const pixelPerTick = (availableMeasure[param] / upperBound);\n\n // checking if available max width is smaller than required width for legend.\n if (availableMeasure[param] >= requiredMeasure[param]) {\n return domainForLegend;\n }\n\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[0]))[param]);\n for (let i = 1; i < domainForLegend.length - 1; i++) {\n nextTickValue = Math.floor((currentTickValue / pixelPerTick) + domainForLegend[i - 1]);\n if (domainForLegend[i] < nextTickValue) {\n domainForLegend.splice(i, 1);\n i -= 1;\n }\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[i]))[param]);\n }\n return domainForLegend;\n};\n\n/**\n * function to recompute the Stops Array provided to prevent the Overlapping of values\n * @param {Array} domainForLegend - Stops Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - modified Stops Array\n */\nexport const getInterpolatedArrayData = (domainForLegend, scaleParams) => {\n // defining param for height/width selector\n let measureParam;\n\n // declaring variable for required Width\n let requiredWidth;\n\n // declaring variable for required height\n let requiredHeight;\n\n // declaring the variable for upperbound\n let upperBound = domainForLegend[domainForLegend.length - 1];\n\n // Initializing Minimum Tick Difference Variable and checking if it's less than 1 or not\n let minTickDiff = Math.ceil(domainForLegend[1] - domainForLegend[0]);\n\n // calculating max tick difference\n const maxTickDiff = Math.ceil(upperBound - domainForLegend[0]);\n\n // gradient Alignment\n const { alignment } = scaleParams;\n\n // getting SmartLabel Manager to calculate tick Params\n const smartLabelCalc = scaleParams.smartLabel;\n\n // scale Measurements (i.e MaxWidth and MaxHeight available)\n const availableSpace = scaleParams.measures;\n\n // getting minimum Tick size (i.e height and width)\n const minimumTickSize = scaleParams.minTickDistance;\n\n // getting domain upperbound dimensions\n const { height: tickDimHeight, width: tickDimWidth } = smartLabelCalc.getOriSize((upperBound));\n\n /* Checking if UpperBound of Domain is Floating or Not.\n In case of floating constricting it to 2 decimals after point. */\n if (!Number.isInteger(upperBound)) {\n upperBound = ((upperBound).toFixed(2));\n }\n\n // Calculating minimum tick difference\n minTickDiff = minTickDiff < 1 ? 1 : minTickDiff;\n\n // required width to render legend\n requiredWidth = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * (tickDimWidth + (minimumTickSize.width));\n\n requiredWidth -= Math.abs(maxTickDiff);\n\n // require height to render legend\n requiredHeight = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * tickDimHeight;\n\n requiredHeight -= Math.abs(maxTickDiff);\n\n // checking the alignment of legend\n if (alignment === TOP || alignment === BOTTOM) {\n measureParam = WIDTH;\n } else {\n measureParam = HEIGHT;\n }\n\n // calculating computed array\n domainForLegend = getcomputedArray({\n smartLabelCalc,\n measureParam\n }, {\n height: requiredHeight,\n width: requiredWidth\n }, {\n height: availableSpace.maxHeight,\n width: availableSpace.maxWidth\n }, domainForLegend);\n\n return domainForLegend;\n};\n\n/**\n * function to recalculate steps on providing more number of stops than canvas can accomodate.\n * @param {Array} domain - Array\n * @param {Array} steps - Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - recalculated Step Array\n */\nexport const getInterpolatedData = (domain, steps, scaleParams) => {\n // declaring recomputeSteps Variable\n let recomputeSteps = 0;\n\n const getTickMeasure = scaleParams.smartLabel;\n const { maxWidth, maxHeight } = scaleParams.measures;\n const { alignment } = scaleParams;\n const domainForLegend = [];\n const interpolatedFn = numberInterpolator()(domain[0], domain[1]);\n\n // getting tick measure(i.e height and width)\n const tickValue = getTickMeasure.getOriSize(domain[1].toFixed(2));\n\n // To round the floating values to Integer and checking if value is 1.\n steps = Math.round(steps);\n steps = steps < 1 ? (steps + 1) : steps;\n\n // checking alignment of the Axis\n if (alignment === TOP || alignment === BOTTOM) {\n recomputeSteps = Math.floor(maxWidth / (tickValue.width));\n } else {\n recomputeSteps = Math.floor(maxHeight / (tickValue.height));\n }\n steps = Math.min(steps, recomputeSteps);\n\n // scaling the axis based on steps provided\n for (let i = 0; i <= steps; i++) {\n domainForLegend[i] = interpolatedFn(i / steps);\n }\n return domainForLegend;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} text\n * @param {*} measurement\n * @param {*} classPrefix\n */\nexport const titleCreator = (container, title, measurement, config) => {\n const titleWidth = Math.min(measurement.maxWidth, measurement.width);\n\n const titleContainer = makeElement(container, 'table', [1], `${config.classPrefix}-legend-title`)\n .style(WIDTH, `${titleWidth}px`)\n .style(HEIGHT, `${measurement.height}px`)\n .style('border-bottom', `${measurement.border}px ${config.borderStyle} ${config.borderColor}`)\n .style('text-align', title.orientation instanceof Function ?\n title.orientation(config.position) : title.orientation);\n return makeElement(titleContainer, 'td', [1], `${config.classPrefix}-legend-title-text`)\n .style(WIDTH, `${titleWidth}px`)\n .style(MAXWIDTH, `${titleWidth}px`)\n .style(HEIGHT, '100%')\n .style('line-height', 1)\n .style('padding', `${measurement.padding}px`)\n .text(title.text)\n .style('overflow-x', 'scroll')\n .node();\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getMaxMeasures = (data, prop, labelManager) => {\n let maxHeight = -Infinity;\n let maxWidth = -Infinity;\n\n data.forEach((item) => {\n const value = prop ? item[prop] : item;\n const space = labelManager.getOriSize(value);\n maxHeight = Math.max(space.height + 2, maxHeight);\n maxWidth = Math.max(space.width + 2, maxWidth);\n });\n\n return { height: maxHeight, width: maxWidth };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getItemMeasures = (context, prop, formatter) => {\n const space = [];\n const data = context.data();\n const labelManager = context._labelManager;\n\n data.forEach((item, index) => {\n const value = prop ? item[prop] : item;\n const { height, width } = labelManager.getOriSize(formatter(value, index, data, context));\n space[index] = { height: height + 1, width: width + 1 };\n });\n return space;\n};\n\n/**\n *\n *\n * @param {*} textOrientation\n * @param {*} effPadding\n * @param {*} titleSpace\n *\n * @memberof Legend\n */\nexport const computeItemSpaces = (config, measures, data) => {\n let totalHeight = 0;\n let totalWidth = 0;\n let maxItemSpaces = {\n width: 0, height: 0\n };\n const {\n effPadding,\n titleWidth,\n labelSpaces,\n titleHeight,\n maxWidth\n } = measures;\n const {\n item,\n align\n } = config;\n const {\n icon,\n text\n } = item;\n const textOrientation = text.orientation;\n const itemSpaces = [];\n const iconSpaces = [];\n let maxIconWidth = 0;\n labelSpaces.forEach((labelSpace, i) => {\n const itemSpace = { width: 0, height: 0 };\n const iconSpace = { width: 0, height: 0 };\n const datum = data[i] || {};\n // Compute each legend item height/width\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n // Get label, icon and item widths\n labelSpace.width += effPadding;\n iconSpace.width = (datum.size ? 2 * Math.sqrt(datum.size / Math.PI) : icon.width) + effPadding;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n itemSpace.width = labelSpace.width + maxIconWidth;\n\n // Get label, icon and item heights\n labelSpace.height = Math.max(labelSpace.height, icon.height) + effPadding;\n iconSpace.height = labelSpace.height;\n itemSpace.height = labelSpace.height;\n } else {\n // Get label, icon and item widths\n labelSpace.width = Math.max(labelSpace.width, datum.size ? 2 * Math.sqrt(datum.size / Math.PI)\n : icon.width) + effPadding;\n iconSpace.width = labelSpace.width;\n itemSpace.width = labelSpace.width;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n\n // Get label, icon and item heights\n labelSpace.height += effPadding;\n iconSpace.height = icon.height + effPadding;\n itemSpace.height = labelSpace.height + iconSpace.height;\n }\n // Compute height and width of legend for each alignment\n if (align === 'horizontal') {\n totalHeight = Math.max(totalHeight, itemSpace.height);\n } else {\n totalHeight += itemSpace.height;\n totalWidth = Math.max(totalWidth, itemSpace.width, titleWidth);\n }\n maxItemSpaces = {\n width: Math.max(itemSpace.width, maxItemSpaces.width),\n height: Math.max(itemSpace.height, maxItemSpaces.height)\n };\n itemSpaces.push(itemSpace);\n iconSpaces.push(iconSpace);\n });\n itemSpaces.forEach((itemSpace, i) => {\n if (align === 'horizontal') {\n itemSpace.height = totalHeight;\n iconSpaces[i].width = maxIconWidth;\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n labelSpaces[i].height = totalHeight;\n iconSpaces[i].height = totalHeight;\n itemSpaces[i].width = labelSpaces[i].width + maxIconWidth;\n } else {\n labelSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = maxIconWidth;\n labelSpaces[i].width = maxIconWidth;\n }\n totalWidth = Math.max(totalWidth + itemSpaces[i].width);\n } else {\n itemSpace.width = Math.max(totalWidth, maxWidth);\n if (textOrientation === TOP || textOrientation === BOTTOM) {\n labelSpaces[i].width = totalWidth;\n iconSpaces[i].width = totalWidth;\n maxIconWidth = totalWidth;\n } else {\n const labelWidth = labelSpaces[i].width;\n const newLabelWidth = (maxItemSpaces.width - maxIconWidth);\n iconSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = labelSpaces[i].width + maxIconWidth;\n labelSpaces[i].width = Math.max(labelWidth, newLabelWidth);\n totalWidth = Math.max(totalWidth, itemSpace.width);\n }\n }\n });\n totalWidth = Math.ceil(Math.max(totalWidth, titleWidth)) + effPadding;\n totalHeight += titleHeight + effPadding;\n totalHeight = Math.ceil(totalHeight);\n return { totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth };\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} scaleInfo\n * @param {*} domainInfo\n *\n */\nexport const getDomainBounds = (type, scaleInfo, domainInfo) => {\n const {\n scaleFn,\n scaleType,\n scale\n } = scaleInfo;\n const {\n domain,\n domainBounds,\n domainLeg,\n steps\n } = domainInfo;\n const ele = domain[type === 'lower' ? 0 : domain.length - 1];\n const step = steps[type === 'lower' ? 0 : steps.length - 1];\n\n return {\n [scaleType]: scaleType === 'size' ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value: domainBounds[type],\n id: type === 'lower' ? 0 : domainLeg.length + 2,\n range: [ele, step]\n };\n};\n","import {\n makeElement,\n selectElement,\n getUniqueId,\n getSmartComputedStyle,\n generateGetterSetters,\n mergeRecursive\n} from 'muze-utils';\nimport { behaviouralActions } from '@chartshq/muze-firebolt';\nimport * as legendBehaviours from '../firebolt/behavioural';\n\nimport { LegendFireBolt } from '../firebolt/legend-firebolt';\nimport { actionBehaviourMap } from '../firebolt/action-behaviour-map';\nimport { physicalActions } from '../firebolt/physical';\nimport * as sideEffects from '../firebolt/side-effects';\nimport { behaviourEffectMap } from '../firebolt/behaviour-effect-map';\nimport { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM } from '../enums/constants';\nimport { PROPS } from './props';\nimport { DEFAULT_MEASUREMENT, DEFAULT_CONFIG, LEGEND_TITLE } from './defaults';\nimport { getItemMeasures, titleCreator, computeItemSpaces } from './legend-helper';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class SimpleLegend\n */\nexport default class SimpleLegend {\n\n /**\n * Creates an instance of Legend.\n * @param {Object} dependencies Set of dependencies required by the legend\n * @memberof Legend\n */\n constructor (dependencies) {\n this._data = [];\n this._metaData = [];\n this._mount = null;\n this._fieldName = null;\n this._title = Object.assign({}, LEGEND_TITLE);\n this._metaData = null;\n this._labelManager = dependencies.labelManager;\n this._cells = dependencies.cells;\n this._id = getUniqueId();\n this._measurement = Object.assign({}, this.constructor.defaultMeasurement());\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n\n const dist = dependencies.labelManager.getOriSize('w');\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n\n generateGetterSetters(this, PROPS);\n this._computedStyle = getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-item-info`);\n\n this._firebolt = new LegendFireBolt(this, {\n behavioural: Object.assign({}, behaviouralActions, legendBehaviours),\n physical: physicalActions,\n physicalBehaviouralMap: actionBehaviourMap\n }, sideEffects, behaviourEffectMap);\n }\n\n id () {\n return this._id;\n }\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new SimpleLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENT;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleLegend\n */\n firebolt (...params) {\n if (params.length) {\n return this;\n }\n return this._firebolt;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return PATH;\n }\n\n canvasAlias (...alias) {\n if (alias.length) {\n this._canvasAlias = alias[0];\n return this;\n }\n return this._canvasAlias;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n mount (...params) {\n if (params.length) {\n this._mount = params[0];\n this.render();\n return this;\n }\n return this._mount;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n const {\n item,\n classPrefix\n } = this.config();\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${classPrefix}-legend-item-info`));\n return getItemMeasures(this, VALUE, item.text.formatter);\n }\n\n /**\n * Sets the height and width of a legend based on provided max\n * height and width and based on its contents\n *\n * @return {Instance} Current instance\n * @memberof Legend\n */\n setLegendMeasures () {\n const {\n width,\n height,\n maxWidth,\n maxHeight,\n padding,\n margin,\n border\n } = this.measurement();\n const {\n align\n } = this.config();\n\n // Effective padding, margin and padding\n const effPadding = padding * 2;\n const effBorder = border * 2;\n const effMargin = margin * 2;\n\n this.data(this.dataFromScale());\n // Get space occupied by title\n const titleSpace = this.getTitleSpace();\n const titleHeight = titleSpace.height > 0 ? titleSpace.height + effPadding : 0;\n const titleWidth = titleSpace.width + effPadding;\n\n // Get space occupied by labels\n const labelSpaces = this.getLabelSpaces(effPadding, align);\n const {\n totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth\n } = computeItemSpaces(this.config(),\n { effPadding, titleWidth, labelSpaces, titleHeight, maxWidth, maxHeight }, this.data());\n\n this.measurement({\n width: Math.max(totalWidth, width) + effMargin + effBorder,\n height: Math.max(totalHeight, height) + effMargin + effBorder,\n labelSpaces,\n iconSpaces,\n itemSpaces,\n maxItemSpaces,\n maxIconWidth,\n titleSpaces: {\n width: Math.min(maxWidth, this.measurement().width) - effMargin - effBorder,\n height: titleHeight\n }\n });\n return this;\n }\n\n /**\n * Returns the space occupied by the legend title\n *\n * @return {Object} Space occupied by title\n * @memberof Legend\n */\n getTitleSpace () {\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-title`));\n return this._labelManager.getOriSize(this.title().text ? this.title().text : '');\n }\n\n /**\n * Creates the title for the legend\n *\n * @param {DOM} container Container made for the title\n * @return {Selection} Title and it's node\n * @memberof Legend\n */\n renderTitle (container) {\n const { titleSpaces, border, padding, width, maxWidth } = this.measurement();\n const { borderStyle, borderColor } = this.config();\n return titleCreator(container, this.title(), {\n height: titleSpaces.height,\n width,\n maxWidth,\n border,\n padding,\n borderStyle,\n borderColor\n }, this.config());\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const {\n classPrefix,\n borderStyle,\n borderColor,\n position\n } = this.config();\n const {\n maxWidth,\n maxHeight,\n width,\n height,\n margin,\n border\n } = this.measurement();\n const legendContainer = makeElement(selectElement(this.mount()), 'div', [1], `${classPrefix}-legend-box`);\n let marginPosition;\n switch (position) {\n case TOP:\n marginPosition = `margin-${BOTTOM}`;\n break;\n case LEFT:\n marginPosition = `margin-${RIGHT}`;\n break;\n case BOTTOM:\n marginPosition = `margin-${TOP}`;\n break;\n default:\n marginPosition = `margin-${LEFT}`;\n }\n legendContainer.classed(`${classPrefix}-legend-box-${this._id}`, true);\n legendContainer.style('float', 'left');\n // set height and width\n legendContainer.style('width', `${Math.min(maxWidth, width) - margin * 2}px`)\n .style('height', `${Math.min(maxHeight, height) - margin * 2}px`)\n .style(`${marginPosition}`, `${margin}px`)\n .style('border', `${border}px ${borderStyle} ${borderColor}`);\n this.legendContainer(legendContainer.node());\n\n // create title\n this.renderTitle(legendContainer);\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n /**\n *\n *\n * @param {*} data\n *\n * @memberof StepLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n const type = this.metaData().getData().schema[0].type;\n if (type === 'measure') {\n return {\n [fieldName]: data.range\n };\n }\n return [[fieldName], [data.rawVal]];\n }\n}\n","import {\n LEFT,\n RIGHT,\n START,\n END,\n TOP,\n BOTTOM,\n HORIZONTAL,\n VERTICAL,\n CENTER,\n SHAPE,\n VALUE\n} from '../enums/constants';\n\nconst legendOrientation = {\n [HORIZONTAL]: {\n datasets: data => ({\n row: [1],\n column: data\n }),\n itemContainerMeasures: (measurement) => {\n const {\n itemSpaces,\n width\n } = measurement;\n return {\n row: {\n width: `${width}px`,\n padding: `${0}px`\n },\n column: {\n width: (d, i) => `${itemSpaces[i].width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, height } = measurement;\n return {\n iconHeight: height,\n iconWidth: maxItemSpaces.width,\n stepPadding: {\n horizontal: true,\n vertical: false\n }\n };\n }\n },\n [VERTICAL]: {\n datasets: data => ({\n row: data,\n column: d => [d]\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n width\n } = measurement;\n const { padding } = config;\n\n return {\n row: {\n width: `${width}px`,\n padding: `${padding}px`\n },\n column: {\n width: `${width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, width } = measurement;\n return {\n iconHeight: maxItemSpaces.height,\n iconWidth: width,\n stepPadding: {\n horizontal: false,\n vertical: true\n }\n };\n }\n }\n};\n\nexport const positionConfig = {\n [LEFT]: legendOrientation[VERTICAL],\n [RIGHT]: legendOrientation[VERTICAL],\n [TOP]: legendOrientation[HORIZONTAL],\n [BOTTOM]: legendOrientation[HORIZONTAL]\n};\n\nexport const alignmentMap = {\n [LEFT]: END,\n [RIGHT]: START,\n [TOP]: CENTER,\n [BOTTOM]: CENTER\n};\n\n// Reverses data for step legend\nexport const stepData = data => ({\n [LEFT]: data.reverse(),\n [RIGHT]: data.reverse(),\n [TOP]: data,\n [BOTTOM]: data\n});\n\n// Changes the item layout based on the position of the text\nexport const itemStack = {\n [LEFT]: [VALUE, SHAPE],\n [RIGHT]: [SHAPE, VALUE],\n [TOP]: [VALUE, SHAPE],\n [BOTTOM]: [SHAPE, VALUE]\n};\n","import { makeElement, selectElement, applyStyle } from 'muze-utils';\nimport { ICON_MAP } from './defaults';\nimport { positionConfig, alignmentMap, itemStack } from './position-config';\nimport {\n WIDTH,\n HEIGHT,\n CENTER,\n VALUE,\n RECT,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} legendInstance\n * @param {*} align\n *\n */\nexport const getItemContainers = (container, data, legendInstance) => {\n const measurement = legendInstance.measurement();\n const config = legendInstance.config();\n const {\n itemSpaces\n } = measurement;\n const {\n classPrefix,\n position\n } = config;\n const positionObj = positionConfig[position];\n const datasets = positionObj.datasets(data);\n const measures = positionObj.itemContainerMeasures(measurement, config);\n\n const rows = makeElement(container, 'div', datasets.row, `${classPrefix}-legend-row`);\n rows.style(HEIGHT, (d, i) => `${itemSpaces[i].height}px`);\n rows.style(WIDTH, measures.row.width);\n rows.style('padding', measures.row.padding);\n\n const columns = makeElement(rows, 'div', datasets.column, `${classPrefix}-legend-columns`);\n columns.style(WIDTH, measures.column.width);\n columns.style('padding', measures.column.padding);\n\n return columns;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} classPrefix\n * @param {*} data\n *\n * @memberof DiscreteLegend\n */\nexport const createLegendSkeleton = (context, container, classPrefix, data) => {\n let gradWidth = 0;\n let gradHeight = 0;\n let maxGradHeight = 0;\n let maxGradWidth = 0;\n const measurement = context.measurement();\n const {\n margin,\n border,\n titleSpaces,\n width,\n height,\n maxWidth,\n maxHeight\n } = measurement;\n\n gradHeight = height - (titleSpaces.height + 2 * margin + 2 * border);\n gradWidth = width - (margin * 2 + border * 2);\n\n maxGradHeight = maxHeight - (titleSpaces.height + margin * 2 + border * 2);\n maxGradWidth = maxWidth - (margin * 2 + border * 2);\n\n let legendBody = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n legendBody.select(`.${classPrefix}-legend-overflow`).remove();\n // Create a div with scroll when overflow\n if (maxGradWidth && maxGradWidth < gradWidth) {\n legendBody = legendBody.style(WIDTH, `${maxGradWidth}px`).style('overflow-x', 'scroll');\n }\n // Create a div with scroll when overflow\n if (maxGradHeight && maxGradHeight < gradHeight) {\n legendBody.style(HEIGHT, `${maxGradHeight}px`).style('overflow-y', 'scroll');\n }\n\n legendBody = makeElement(legendBody, 'div', [1], `${classPrefix}-legend-overflow`);\n\n legendBody.style(WIDTH, `${gradWidth}px`);\n legendBody.style(HEIGHT, `${gradHeight}px`);\n\n const legendItem = getItemContainers(legendBody, data, context);\n return { legendItem };\n};\n\n/**\n * Creates legend item based on alignment and text orientation\n *\n * @param {Selection} container Point where items are to be mounted\n * @return {Instance} Current instance\n * @memberof Legend\n */\nexport const createItemSkeleton = (context, container) => {\n const {\n classPrefix,\n item\n } = context.config();\n const textOrientation = item.text.orientation;\n\n const stack = itemStack[textOrientation];\n const itemSkeleton = makeElement(container, 'div', (d, i) => stack.map(e => [e, d[e], d.color, d.size,\n d.value, context.fieldName(), i]), `${classPrefix}-legend-item-info`);\n\n const alignClass = alignmentMap[textOrientation];\n\n itemSkeleton.classed(alignClass, true);\n return { itemSkeleton };\n};\n\n/**\n *\n *\n * @param {*} measureType\n * @param {*} stepColorCheck\n */\nexport const applyItemStyle = (item, measureType, stepColorCheck, context) => {\n const {\n padding,\n labelSpaces,\n iconSpaces,\n maxIconWidth\n } = context.measurement();\n const diff = stepColorCheck ? -padding * 2 : 0;\n\n if (item[0] === VALUE) {\n return `${labelSpaces[item[6]][measureType]}px`;\n }\n return `${measureType === 'width' && !stepColorCheck ? maxIconWidth : iconSpaces[item[6]][measureType] - diff}px`;\n};\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, elem, defaultIcon, width, height) {\n const groupElement = elem;\n // const { shape, size, update } = d;\n const size = d[3] || Math.min(width, height) * Math.PI;\n const shape = d[1] || defaultIcon;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n return createShape(d, elem);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n shapeElement.attr('transform', `scale(${size / 100})`);\n return selectElement(groupElement.node().appendChild(newShape));\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = ICON_MAP(shape).size(size)();\n }\n return makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n }\n d[1] = 'circle';\n return createShape(d, elem, 'circle');\n};\n\n/**\n * Returns the icon of the legend item\n *\n * @param {Object} datum Data property attached to the item\n * @param {number} width width of the item\n * @param {number} height height of the item\n * @return {Object|string} returns the path string or the string name of the icon\n * @memberof Legend\n */\nexport const getLegendIcon = (datum, width, height, defaultIcon) => {\n const icon = ICON_MAP(datum[1]);\n\n if (icon) {\n return icon.size(datum[3] || Math.min(width, height) * Math.PI);\n }\n return ICON_MAP(datum[3] ? 'circle' : defaultIcon).size(datum[3] || Math.min(width, height) * Math.PI);\n};\n\n/**\n *\n *\n */\nexport const renderIcon = (icon, container, datum, context) => {\n const {\n classPrefix,\n iconHeight,\n iconWidth,\n maxIconWidth,\n padding,\n color\n } = context;\n const svg = makeElement(container, 'svg', f => [f], `${classPrefix}-legend-icon-svg`)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .style(WIDTH, `${maxIconWidth}px`)\n .style(HEIGHT, `${iconHeight}px`);\n\n if (icon !== RECT) {\n const group = makeElement(svg, 'g', [datum[1]], `${classPrefix}-legend-icon`);\n createShape(datum, group, datum[3] ? 'circle' : 'square', iconWidth, iconHeight)\n .attr('transform', `translate(${maxIconWidth / 2 - padding} ${iconHeight / 2})`)\n .attr('fill', datum[2] || color);\n } else {\n makeElement(svg, RECT, [datum[1]], `${classPrefix}-legend-icon`)\n .attr('x', 0)\n .attr('y', 0)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .attr('fill', datum[2] || color);\n }\n};\n\n/**\n * Renders the items in the legend i.e, icon and text\n *\n * @param {DOM} container Point where item is to be mounted\n * @memberof Legend\n */\nexport const renderDiscreteItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n classPrefix\n } = context.config();\n const {\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width: iconWidth,\n height: iconHeight,\n color,\n className\n } = item.icon;\n\n const textOrientation = item.text.orientation;\n const formatter = item.text.formatter;\n\n labelManager.useEllipsesOnOverflow(true);\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, false, context),\n height: d => applyItemStyle(d, HEIGHT, false, context),\n 'text-align': CENTER,\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = container.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context))\n .style(`padding-${textOrientation === RIGHT ? LEFT : RIGHT}`, '0px');\n } else {\n // const icon = getLegendIcon(d, iconWidth, iconHeight, type);\n selectElement(this).classed(`${classPrefix}-${className}`, true);\n selectElement(this).classed(`${classPrefix}-${className}-${i}`, true);\n renderIcon('circle', selectElement(this), d, {\n classPrefix,\n iconWidth,\n // iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth,\n iconHeight,\n maxIconWidth,\n padding,\n color\n });\n }\n });\n};\n\n/**\n* Renders the items in the legend i.e, icon and text\n*\n* @param {DOM} container Point where item is to be mounted\n* @memberof Legend\n*/\nexport const renderStepItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n position,\n classPrefix\n } = context.config();\n const {\n maxItemSpaces,\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width,\n height,\n color\n } = item.icon;\n const {\n formatter\n } = item.text;\n\n labelManager.useEllipsesOnOverflow(true);\n const { iconHeight, iconWidth, stepPadding } = positionConfig[position].getStepSpacesInfo({\n maxItemSpaces, height, width\n });\n\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, stepPadding.horizontal, context),\n height: d => applyItemStyle(d, HEIGHT, stepPadding.vertical, context),\n 'text-align': 'center',\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = container.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context));\n } else {\n renderIcon(RECT, selectElement(this), d, {\n classPrefix,\n iconWidth,\n iconHeight,\n maxIconWidth,\n color\n });\n }\n });\n};\n","import {\n FieldType,\n DimensionSubtype,\n formatTemporal\n} from 'muze-utils';\nimport SimpleLegend from './simple-legend';\nimport { DISCRETE, LEFT, SIZE } from '../enums/constants';\nimport { getScaleInfo } from './legend-helper';\nimport { createLegendSkeleton, createItemSkeleton, renderDiscreteItem } from './renderer';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class DiscreteLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new DiscreteLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof DiscreteLegend\n */\n static type () {\n return DISCRETE;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof DiscreteLegend\n */\n dataFromScale () {\n const scale = this.scale();\n const { scaleType, domain, scaleFn } = getScaleInfo(scale);\n let domainForLegend = [...new Set(domain)];\n const field = this.metaData().getFieldspace().fields[0];\n const { type, subtype } = field.schema();\n\n domainForLegend = domainForLegend.map((ele, i) => {\n let value = 0;\n let range = 0;\n const rawVal = domainForLegend[i];\n if (type === FieldType.MEASURE) {\n value = (+domainForLegend[i]).toFixed(0);\n const nextVal = domainForLegend[i + 1] ? +domainForLegend[i + 1] : +value;\n range = [value, nextVal.toFixed(0)];\n } else {\n let domainVal = rawVal;\n if (subtype === DimensionSubtype.TEMPORAL) {\n domainVal = formatTemporal(domainForLegend[i], field.minimumConsecutiveDifference());\n }\n value = domainVal;\n range = [domainVal];\n }\n return {\n [scaleType]: scale[scaleFn](ele),\n value,\n id: i,\n range,\n rawVal\n };\n }).filter(d => d.value !== null);\n\n domainForLegend = scaleType === SIZE ? domainForLegend.sort((a, b) => a[scaleType] - b[scaleType])\n : domainForLegend;\n return domainForLegend;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const data = this.data();\n const { classPrefix } = this.config();\n const legendContainer = super.render(this.mount());\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n renderDiscreteItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n}\n","import { makeElement, applyStyle } from 'muze-utils';\nimport { ContinousAxis } from '@chartshq/muze-axis';\nimport { BOTTOM, RIGHT } from '../enums/constants';\nimport { ALIGN } from './defaults';\nimport '../styles.scss';\n\n/**\n *\n *\n * @param {*} data\n *\n */\nexport const getGradientDomain = (data) => {\n if (typeof data[0].value === 'number') {\n return data.reduce((accumulator, currentValue) =>\n [Math.min(currentValue.value, accumulator[0]), Math.max(currentValue.value, accumulator[1])],\n [Number.MAX_VALUE, Number.MIN_VALUE]);\n }\n return data.map(e => e.value);\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} domain\n *\n */\nexport const makeLinearGradient = (container, data, domain) => {\n const defs = makeElement(container, 'defs', [1]);\n const linearGradient = makeElement(defs, 'linearGradient', [1])\n .attr('id', 'linear-gradient')\n .attr('x1', '0%')\n .attr('y2', '0%');\n\n makeElement(linearGradient, 'stop', data, 'stop-gradient')\n .attr('offset', d => `${(d.value - domain[0]) * 100 / (domain[1] - domain[0]) || 1}%`)\n .attr('stop-color', d => d.color);\n return linearGradient;\n};\n\n/**\n * Creates an axis cell with a linear axis for computing space and\n * creating gradient legend\n *\n * @return {AxisCell} Instance of Axis Cell for the gradient axis\n * @memberof Legend\n */\nexport const createAxis = (context) => {\n const data = context.data();\n const { align } = context.config();\n const AxisCell = context._cells.AxisCell;\n const newAxis = new ContinousAxis({\n id: `legend-${context._id}`,\n orientation: align === ALIGN.VERTICAL ? RIGHT : BOTTOM,\n style: context._computedStyle,\n nice: false,\n showAxisName: false,\n tickValues: data.map(d => d.value),\n fixedBaseline: false,\n labels: {\n rotation: null\n }\n }, { labelManager: context._labelManager });\n\n newAxis.domain(getGradientDomain(data));\n newAxis.range([1, 1]);\n return new AxisCell().source(newAxis).config({\n margin: { left: 0, bottom: 0, top: 0, right: 0 }\n });\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} classPrefix\n *\n * @memberof GradientLegend\n */\nconst createLegendSkeleton = (container, classPrefix, data) => {\n const domain = getGradientDomain(data);\n const legendContainer = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n const legendGradSvg = makeElement(legendContainer, 'svg', [1], `${classPrefix}-gradient`);\n const legendGradCont = makeElement(legendGradSvg, 'g', [1], `${classPrefix}-gradient-group`);\n const linearGradient = makeLinearGradient(legendGradSvg, data, domain);\n const legendRect = makeElement(legendGradCont, 'rect', [1], `${classPrefix}-gradient-rect`);\n\n return {\n legendContainer,\n legendGradCont,\n legendGradSvg,\n linearGradient,\n legendRect\n };\n};\n\n/**\n * Renders the axis for the gradient\n *\n * @param {Selection} container Point where axis is to be mounted\n * @param {number} height Height for axis\n * @param {number} width Width for axis\n * @memberof Legend\n */\nexport const renderAxis = (context, container, height, width) => {\n const axis = context.axis();\n\n axis.setAvailableSpace(width, height);\n axis.render(container.node());\n axis.source().render();\n};\n\n/**\n * Renders gradient legends\n *\n * @param {Selection} container Point where the legend is to be appended\n * @memberof GradientLegend\n */\nexport const renderGradient = (context, container) => {\n let gradHeight = 0;\n let gradWidth = 0;\n const {\n align,\n classPrefix,\n item\n } = context.config();\n const data = context.data();\n // Create the skeleton for the legend\n const {\n legendContainer,\n legendGradSvg,\n legendGradCont,\n linearGradient,\n legendRect\n } = createLegendSkeleton(container, classPrefix, data);\n const labelDim = context.axis().source().getAxisDimensions().tickDimensions;\n const {\n padding,\n margin,\n border,\n titleSpaces,\n maxItemSpaces,\n maxHeight,\n maxWidth,\n height,\n width\n } = context.measurement();\n const gradientDimensions = {};\n\n gradHeight = Math.floor(Math.min(height, maxHeight) - (titleSpaces.height + 2 * margin + 2 * border));\n gradWidth = Math.floor(Math.min(width, maxWidth) - (margin * 2 + border * 2));\n\n if (align === ALIGN.HORIZONTAL) {\n gradientDimensions.height = item.icon.height;\n gradientDimensions.width = gradWidth - 2 * padding - labelDim.width / 2;\n linearGradient.attr('x2', '100%').attr('y1', '0%');\n legendGradCont.attr('transform', `translate( ${labelDim.width / 2} 0)`);\n renderAxis(context, legendContainer, gradHeight - item.icon.height - padding, gradWidth - 2 * padding - 1);\n\n applyStyle(legendContainer, {\n height: `${maxItemSpaces.height + border + padding}px`,\n width: `${Math.min(width, maxWidth)}px`,\n padding: `${padding}px`\n });\n\n legendRect.attr('height', gradientDimensions.height);\n legendRect.attr('width', gradientDimensions.width - labelDim.width / 2);\n } else {\n gradientDimensions.height = gradHeight - 2 * padding - labelDim.height / 2;\n gradientDimensions.width = item.icon.width;\n linearGradient.attr('x2', '0%').attr('y1', '100%');\n legendGradCont.attr('transform', `translate(0 ${labelDim.height / 2})`);\n renderAxis(context, legendContainer, gradHeight - 2 * padding - 1, gradWidth - item.icon.width - padding * 2);\n\n applyStyle(legendContainer, {\n height: `${Math.min(height, maxHeight)}px`,\n width: `${maxWidth}px`,\n padding: `${padding}px`\n });\n legendRect.attr('height', gradientDimensions.height - labelDim.height / 2);\n legendRect.attr('width', gradientDimensions.width);\n }\n\n // Apply Styles to the legend plot area\n applyStyle(legendGradSvg, {\n height: `${gradientDimensions.height}px`,\n width: `${gradientDimensions.width}px`\n });\n\n // Apply styles to the legend rect\n applyStyle(legendRect, {\n fill: 'url(#linear-gradient)'\n });\n legendGradSvg.attr('height', gradientDimensions.height);\n legendGradSvg.attr('width', gradientDimensions.width);\n\n context.measurement({\n gradientDimensions\n });\n context._legendGradientSvg = legendGradSvg;\n return context;\n};\n","import SimpleLegend from './simple-legend';\nimport { getScaleInfo, getInterpolatedData, getInterpolatedArrayData } from './legend-helper';\nimport { GRADIENT, LEFT, SIZE } from '../enums/constants';\nimport { renderGradient, createAxis } from './gradient-helper';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class GradientLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new GradientLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof GradientLegend\n */\n static type () {\n return GRADIENT;\n }\n\n /**\n *\n *\n * @param {*} axis\n *\n * @memberof GradientLegend\n */\n axis (...axis) {\n if (axis.length) {\n this._axis = axis[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof GradientLegend\n */\n dataFromScale () {\n let domainForLegend = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainForLegend[0] = domain[0];\n }\n domainForLegend = [...domainForLegend, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainForLegend.push(domain[1]);\n }\n // Sorting the domain Array\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n domainForLegend = getInterpolatedArrayData(domainForLegend, scaleParams);\n } else {\n domainForLegend = getInterpolatedData(domain, steps - 1, scaleParams);\n }\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n return domainForLegend.map((ele, i) => {\n const value = domainForLegend[i];\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](Math.floor(ele)),\n value: +value.toFixed(2),\n id: i\n };\n }).filter(d => d.value !== null);\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const axis = createAxis(this);\n const axisSpace = axis.getLogicalSpace();\n const space = { width: axisSpace.width - effPadding, height: axisSpace.height - effPadding };\n const axisDomainLength = axis.source().domain().length;\n const labelSpaces = new Array(axisDomainLength).fill(space);\n\n this.axis(axis);\n return labelSpaces;\n }\n\n /**\n *\n *\n *\n * @memberof GradientLegend\n */\n getDrawingContext () {\n return {\n svgContainer: this._legendGradientSvg\n };\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const legendContainer = super.render(this.mount());\n // create Legend\n renderGradient(this, legendContainer);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n return [[this.fieldName()], [data.value]];\n }\n}\n","import SimpleLegend from './simple-legend';\nimport {\n getScaleInfo,\n getInterpolatedData,\n getDomainBounds\n} from './legend-helper';\nimport {\n createLegendSkeleton,\n createItemSkeleton,\n renderStepItem\n} from './renderer';\nimport { STEP, RECT, LEFT, SIZE, UPPER, LOWER } from '../enums/constants';\nimport { stepData } from './position-config';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class StepLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new StepLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static type () {\n return STEP;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof StepLegend\n */\n dataFromScale () {\n let domainLeg = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n const { formatter } = this.config();\n const domainBounds = {\n lower: null, upper: null\n };\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainBounds.lower = [`${formatter.bounds.lower} ${steps[0]}`];\n }\n domainLeg = [...domainLeg, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainBounds.upper = [`${formatter.bounds.upper} ${steps[steps.length - 1]}`];\n }\n } else {\n domainLeg = getInterpolatedData(domain, steps, scaleParams);\n }\n\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n domainLeg = domainLeg.map((ele, i) => {\n let value = null;\n if (i < domainLeg.length - 1) {\n value = `${(ele.toFixed(1))} - ${(+domainLeg[i + 1].toFixed(1))}`;\n } else if (domainLeg.length === 1) {\n value = ele.toFixed(1);\n }\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value,\n id: i + 1,\n range: [ele, domainLeg[i + 1]]\n };\n }).filter(d => d.value !== null);\n\n if (domainBounds.lower) {\n const lowerBounds = getDomainBounds(LOWER, { scale, scaleFn, scaleType },\n { domain, steps, domainBounds });\n domainLeg = [lowerBounds, ...domainLeg];\n }\n if (domainBounds.upper) {\n const upperBounds = getDomainBounds(UPPER, { scale, scaleFn, scaleType },\n { domain, steps, domainBounds, domainLeg });\n domainLeg = [...domainLeg, upperBounds];\n }\n\n return domainLeg;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding, align) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n return super.getLabelSpaces(effPadding, align);\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return RECT;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const { classPrefix, position } = this.config();\n const data = stepData(this.data())[position];\n\n const legendContainer = super.render(this.mount());\n\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n\n renderStepItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.createSelectionSet(this.data().map(d => d.id));\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof StepLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n return {\n [fieldName]: data.range\n };\n }\n}\n","import { GradientLegend, DiscreteLegend, StepLegend } from '@chartshq/muze-legend';\n\n/**\n * Contants to be used as attr\n */\nexport const ROWS = 'rows';\nexport const COLUMNS = 'columns';\nexport const DATA = 'data';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const DETAIL = 'detail';\nexport const LAYERS = 'layers';\nexport const TRANSFORM = 'transform';\nexport const INITIALIZED = 'isInitialized';\nexport const SOURCE = 'source';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const PADDING = 'padding';\nexport const BORDER = 'border';\nexport const MARGIN = 'margin';\nexport const CONFIG = 'config';\nexport const MOUNT = 'mount';\nexport const CANVAS_UPDATED = 'canvasUpdated';\nexport const CLASSPREFIX = 'classPrefix';\nexport const POLICIES = '_policies';\nexport const LEGEND = 'legend';\nexport const TITLE = 'title';\nexport const SUB_TITLE = 'subtitle';\nexport const RESOLVE = 'resolve';\nexport const DISCRETE = 'discrete';\nexport const STEP_COLOR = 'step-color';\nexport const GRADIENT = 'gradient';\nexport const LINEAR = 'linear';\nexport const ORDINAL = 'ordinal';\nexport const MUZE_PREFIX = 'muze';\n\nexport const TITLE_TEMPLATE_NOT_ALLOWED_TAGS = [\n 'script',\n 'style'\n];\n\nexport const LEGEND_TYPE_MAP = {\n [`${ORDINAL}-${true}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SIZE}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${COLOR}`]: StepLegend,\n [`${LINEAR}-${false}-${COLOR}`]: GradientLegend\n};\n\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const GROUP = 'group';\nexport const LAYOUT = 'layout';\nexport const RETINAL = 'retinal';\nexport const DIMENSION = 'dimension';\nexport const MEASURE = 'measure';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const HORIZONTAL_CENTER = 'h-center';\nexport const VERTICAL_CENTER = 'v-center';\nexport const HIDDEN = 'hidden';\nexport const OVERFLOW = 'overflow';\nexport const OVERFLOW_X = 'overflow-x';\nexport const OVERFLOW_Y = 'overflow-y';\nexport const AUTO = 'auto';\nexport const VISIBLE = 'visible';\nexport const VERTICAL_SCROLL_BAR = 'verticalScrollBar';\nexport const HORIZONTAL_SCROLL_BAR = 'horizontalScrollBar';\nexport const GRID = 'grid';\nexport const MESSAGE = 'message';\nexport const NO_DATA_MESSAGE = 'No data to display';\n\n","import { ComposedVars, SimpleVariable } from '@chartshq/visual-group';\nimport { TITLE_TEMPLATE_NOT_ALLOWED_TAGS } from './constants';\n\n/**\n * This method creates a new composed variable instance from multiple variables. This is required when we have multiple\n * variables on a single axis and the union of domain of all the variables needs to be set on the axis.\n *\n * To create a new composed variable from multiple fields,\n * ```\n * const sharedVar = share('open', 'high', 'low', 'close');\n * canvas.rows([sharedVar])\n * .columns(['date']);\n * ```\n *\n * @module Operators\n * @public\n * @function share\n * @param {Array} vars Variable names.\n *\n * @return {ComposedVars} Instance of composed variable\n */\nexport const share = (...vars) => new ComposedVars(...vars.map(variable => new SimpleVariable(variable)));\n\n/**\n *\n *\n * @param {*} node\n *\n */\nfunction treeShakeNode (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) { return; }\n\n if (TITLE_TEMPLATE_NOT_ALLOWED_TAGS.indexOf(node.tagName.toLowerCase()) !== -1) {\n node.parentNode.removeChild(node);\n } else {\n for (const childNode of node.childNodes) {\n treeShakeNode(childNode);\n }\n }\n}\n\n/**\n * A string template tagged function which sanitizes input html formatted string according to the allowed html tags.\n * This is used to render html in canvas components like title and tooltip.\n *\n * To render html in canvas components,\n * ```\n * canvas.title(html`TITLE`);\n * ```\n *\n * @public\n * @module Operators\n * @function html\n * @param {Array.} strings - The string parts of the template.\n * @param {Array} exps - The list of evaluated expression values.\n *\n * @return {Function} Returns a function which returns the sanitized html string.\n */\nexport function html (strings, ...exps) {\n let htmlCode = '';\n const expLn = exps.length;\n let i = 0;\n\n for (; i < expLn; ++i) {\n htmlCode += strings[i] + exps[i];\n }\n htmlCode += strings[i];\n\n const frag = document.createDocumentFragment();\n const wrapper = document.createElement('div');\n\n frag.appendChild(wrapper);\n wrapper.innerHTML = htmlCode;\n\n treeShakeNode(wrapper);\n const { innerHTML } = wrapper;\n\n return () => innerHTML;\n}\n","import { mergeRecursive, CommonProps } from 'muze-utils';\n\nconst defaultPolicy = (registrableComponents) => {\n const aliases = registrableComponents.map(comp => comp.alias());\n return {\n behaviours: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n }\n };\n};\n\nconst listenerFn = (canvas, fn) => () => {\n const valueMatrix = canvas.composition().visualGroup.matrixInstance().value;\n valueMatrix.each(cell => fn(cell.valueOf().firebolt()));\n};\n\nconst canvasIterator = (canvases, iteratorFn, cFn) => {\n canvases.forEach((canvas) => {\n const matrix = canvas.composition().visualGroup.matrixInstance().value;\n matrix.each(cell => iteratorFn(cell.valueOf().firebolt()));\n cFn && cFn(canvas);\n // Also register actions on canvas update\n const throwback = canvas._throwback;\n\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED],\n listenerFn(canvas, iteratorFn));\n });\n};\n\nconst registerActions = (context, type, fnName, deps) => {\n const canvases = context._registrableComponents;\n\n canvases.forEach((canvas) => {\n const vGroup = canvas.composition().visualGroup;\n\n vGroup.resolver().setFireboltDependencies(type, deps);\n canvas.firebolt()[fnName](deps);\n });\n};\n\n/**\n * This class is initiated only once in lifecycle and is reponsible for regisration of physical and behavioural\n * actions and side effects and the mapping between them.\n *\n * To get the instance of action model\n * ```\n * const ActionModel = muze.ActionModel;\n * ```\n *\n * @public\n * @module ActionModel\n */\nclass ActionModel {\n constructor () {\n this._registrableComponents = [];\n }\n\n /**\n * Takes an array of canvases on which the physical and behavioural actions will get registered.\n *\n * @public\n * @param {Canvas} components Array of canvases\n *\n * @return {ActionModel} Instance of action model.\n */\n for (...components) {\n this._registrableComponents = components;\n return this;\n }\n\n /**\n * Registers physical actions on the canvases. It takes an object with key as the name of action and value having\n * the definition of the action.\n *\n * To register a {@link PhysicalAction},\n * ```\n * const ActionModel = muze.ActionModel;\n * ActionModel\n * // Physical actions will be registered on these canvases.\n * .for(canvas)\n * .registerPhysicalActions({\n * // Key is the name of physical action.\n * ctrlClick: (firebolt) => (targetEl, behaviours) => {\n * targetEl.on('click', function (data) {\n * const event = utils.getEvent();\n * const pos = utils.getClientPoint(event, this);\n * // Get the data point nearest to the mouse position.\n * const nearestPoint = firebolt.context.getNearestPoint(pos, {\n * data\n * });\n * // Prepare the payload\n * const payload = {\n * criteria: nearestPoint.id\n * };\n * behaviours.forEach((behaviour) => firebolt.dispatchBehaviour(behaviour, payload));\n * });\n * }\n * });\n * ```\n * @public\n *\n * @param {Object} action Names of physical actions and their definitions.\n *\n * @return {ActionModel} Instance of the action model.\n */\n registerPhysicalActions (action) {\n registerActions(this, 'physicalActions', 'registerPhysicalActions', action);\n return this;\n }\n\n /**\n * Registers behavioural actions on the canvases. It takes definitions of the behavioural actions and registers\n * them on the canvases. Every behavioural action must inherit the {@link GenericBehaviour} class.\n *\n * To register a behavioural action\n * ```\n * // Define a new behavioural action\n * class SingleSelectBehaviour extends GenericBehaviour {\n * static formalName () {\n * return 'singleSelect';\n * }\n *\n * setSelectionSet (addSet, selectionSet) {\n * if (addSet === null) {\n * selectionSet.reset();\n * } else if (addSet.length) {\n * const existingAddSet = selectionSet.getExistingEntrySet(addSet);\n * if (existingAddSet.length){\n * selectionSet.reset();\n * } else {\n * selectionSet.add(addSet);\n * }\n * } else {\n * selectionSet.reset();\n * }\n * }\n * }\n * muze.ActionModel.registerBehaviouralActions(SingleSelectBehaviour);\n * ```\n *\n * @public\n *\n * @param {GenericBehaviour} actions Definition of behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerBehaviouralActions (...actions) {\n registerActions(this, 'behaviouralActions', 'registerBehaviouralActions', actions);\n return this;\n }\n\n /**\n * Registers the mapping of physical and behavioural actions. This mapping is used to establish which behavioural\n * actions should be dispatched on any triggering of physical actions.\n *\n * To map physical actions with behavioural actions,\n * ```\n * muze.ActionModel.registerPhysicalBehaviouralMap({\n * ctrlClick: {\n * behaviours: ['select'] // This array must be the formal names of the behavioural actions.\n * }\n * });\n * ```\n *\n * @public\n * @param {Object} map Contains the physical and behavioural action map.\n * ```\n * {\n * // Name of the physical action\n * click: {\n * // Target element selector. This is an optional field. If not passed, then by default takes the\n * // container element of visual unit.\n * target: '.muze-layers-area path',\n * // Behaviours which should be dispatched on triggering of the mapped physical action.\n * behaviours: ['select']\n * }\n * }\n * ```\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPhysicalBehaviouralMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPhysicalBehaviouralMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPhysicalBehaviouralMap(map);\n });\n return this;\n }\n\n /**\n * Registers what behaviour to propagate on dispatch of a certain behavioural action. By default, when any\n * behavioural action is dispatched, then the same behavioural action gets propagated to all the other canvases.\n * This can be changed using this api.\n *\n * To register what behaviour should be propagated on dispatch of any behavioural action,\n * ```\n * ActionModel.for(canvas1, canvas2).registerPropagationBehaviourMap({\n * select: 'filter',\n * brush: 'filter'\n * });\n * ```\n *\n * @public\n * @param {Object} map Propagation behaviour map.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPropagationBehaviourMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPropagationBehaviourMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPropagationBehaviourMap(map);\n });\n\n return this;\n }\n\n /**\n * Registers the mapping of side effects and behavioural actions. It takes an object which contains key as the\n * name of behavioural action and the side effects which will be linked to it.\n *\n * To map side effects to select behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: ['infoBox'] // This array must be the formal names of the side effects\n * });\n * ```\n *\n * To map side effects to select behaviour, but disable all the default side effects attached with this behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: {\n * effects: ['infoBox'],\n * preventDefaultActions: true\n * }\n * });\n * @public\n * @param {Object} map Mapping of behavioural actions and side effects.\n * ```\n * {\n * select: ['infoBox']\n * }\n * ```\n * @return {ActionModel} Instance of action model.\n */\n mapSideEffects (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.mapSideEffects(map);\n }, (canvas) => {\n canvas.firebolt().mapSideEffects(map);\n });\n return this;\n }\n\n /**\n * Registers the side effects on the registered canvases. It takes definitions of side effects and registers them\n * on the canvases. Every side effect must inherit the base class {@link GenericSideEffect} or\n * {@link SpawnableSideEffect} or {@link SurrogateSideEffect} class.\n *\n * ```\n * // Define a custom side effect\n * class InfoBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'infoBox';\n * }\n *\n * apply (selectionSet) {\n * }\n * }\n * muze.ActionModel.registerSideEffects(InfoBox);\n * ```\n * @public\n * @param {GenericSideEffect} sideEffects Definition of side effects.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerSideEffects (...sideEffects) {\n registerActions(this, 'sideEffects', 'registerSideEffects', sideEffects);\n return this;\n }\n\n /**\n * Breaks the link between behavioural actions and physical actions. It takes an array of behavioural action\n * and it's physical action.\n *\n * To dissociate behavioural actions from physical actions\n * ```\n * muze.ActionModel.dissociateBehaviour(['select', 'click'], ['highlight', 'hover']);\n * ```\n * @public\n * @param {Array} maps Array of behavioural action and physical action.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateBehaviour (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateBehaviour(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateBehaviour(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * Breaks the link between side effects and behavioural actions. It takes an array of formal names of the side\n * effects and it's linked behavioural action.\n *\n * To dissociate side effects from behavioural actions\n * ```\n * muze.ActionModel.dissociateSideEffect(['crossline', 'highlight'], ['selectionBox', 'brush']);\n * ```\n * @public\n * @param {Array} maps Array of side effects and behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateSideEffect (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateSideEffect(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateSideEffect(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * By default cross interactivity is disabled between canvases. This enables cross interaction between the canvases\n * so that any action happening in one canvas gets dispatched on other canvases as well. An optional policy can also\n * be passed in this method. The policy can be used to control on which canvases the behavioural actions and\n * side effects gets dispatched.\n *\n * To just enable cross interactivity between two canvases,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity();\n * ```\n *\n * To enable cross interactivity but enable any behavioural action only when it is triggered from canvas1.\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * behaviours: {\n * // Here * stands for any behavioural action name. We can also give any name of behavioural action\n * // in place of this.\n * '*': (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n *\n * To enable cross interactivity but enable tooltip effect if the action is propagated from canvas1,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * sideEffects: {\n * tooltip: (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n * @public\n * @param {Object} policy Policy definition.\n *\n * @return {ActionModel} Instance of action model.\n */\n enableCrossInteractivity (policy = {}) {\n const registrableComponents = this._registrableComponents;\n const mergedPolicy = mergeRecursive(mergeRecursive({}, defaultPolicy(registrableComponents)), policy);\n\n registrableComponents.forEach((canvas) => {\n canvas.firebolt().crossInteractionPolicy(mergedPolicy);\n });\n\n return this;\n }\n}\n\nexport const actionModel = (() => new ActionModel())();\n","import { MUZE_PREFIX } from '../constants';\n\nexport const TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 4,\n className: `${MUZE_PREFIX}-title-container`\n};\n\nexport const SUB_TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 16,\n maxLines: 2,\n className: `${MUZE_PREFIX}-subtitle-container`\n};\n\nexport const MESSAGE_CONFIG = {\n className: `${MUZE_PREFIX}-message-container`\n};\n\nexport const CANVAS = 'canvas';\n","import { mergeRecursive } from 'muze-utils';\nimport {\n ROWS,\n COLUMNS,\n COLOR,\n SHAPE,\n SIZE,\n DETAIL,\n LAYERS,\n TRANSFORM,\n TITLE,\n SUB_TITLE\n} from '../constants';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG } from './defaults';\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Canvas.\n * Canvas merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module LocalOptions\n */\n\nexport const localOptions = {\n [ROWS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLUMNS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLOR]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SHAPE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SIZE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [DETAIL]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n\n [LAYERS]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [TRANSFORM]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object'\n }\n }\n};\n\nexport const canvasOptions = {\n [TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([title, titleConfig]) => {\n let t = title;\n if (typeof title === 'string' || !title) {\n t = () => title;\n }\n const defConfig = mergeRecursive({}, TITLE_CONFIG);\n return [t, mergeRecursive(defConfig, titleConfig)];\n }\n }\n },\n [SUB_TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([subtitle, subtitleConfig]) => {\n let sub = subtitle;\n if (typeof subtitle === 'string' || !subtitle) {\n sub = () => subtitle;\n }\n const defConfig = mergeRecursive({}, SUB_TITLE_CONFIG);\n return [sub, mergeRecursive(defConfig, subtitleConfig)];\n }\n }\n }\n};\n","export default class LayoutComponent {\n constructor (name, dimensions, seed) {\n this._seed = seed;\n this._boundBox = {\n height: dimensions.height,\n width: dimensions.width,\n top: null,\n left: null\n };\n this._renderAt = null;\n this._alignWith = null;\n this._alignment = null;\n this._target = null;\n this._position = null;\n this._componentName = name;\n this._className = null;\n }\n\n getLogicalSpace () {\n throw new Error('getLogicalSpace is not defined');\n }\n\n setSpatialConfig () {\n throw new Error('setSpatialSpace is not defined');\n }\n\n name (param) {\n if (param) {\n this._componentName = param;\n }\n return this._componentName;\n }\n\n target (param) {\n if (param) {\n this._target = param;\n }\n return this._target;\n }\n\n position (param) {\n if (param) {\n this._position = param;\n }\n return this._position;\n }\n\n alignment (param) {\n if (param) {\n this._alignment = param;\n }\n return this._alignment;\n }\n\n alignWith (param) {\n if (param) {\n this._alignWith = param;\n }\n return this._alignWith;\n }\n\n renderAt (param) {\n if (param) {\n this._renderAt = param;\n }\n return this._renderAt;\n }\n\n boundBox (param) {\n if (param) {\n Object.assign(this._boundBox, param);\n }\n return this._boundBox;\n }\n\n className (param) {\n if (param) {\n this._className = param;\n }\n return this._className;\n }\n\n draw () {\n throw new Error('draw is not defined');\n }\n\n attachListener () {\n return this;\n }\n }\n\n","import LayoutComponent from './layoutComponent';\n\nclass DummyComponent extends LayoutComponent {\n getLogicalSpace () {\n return {\n width: this.boundBox().width,\n height: this.boundBox().height\n };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n return this;\n }\n\n draw () {\n if (!this.component) {\n throw new Error(`Component not set for ${this.componentName}`);\n }\n this.component.mount(document.getElementById(this.renderAt)); // Change the draw method to component draw\n return this;\n }\n}\n\nexport default DummyComponent;\n","export const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n interaction: {\n sideEffect: 'individual'\n },\n pagination: 'scroll',\n scrollBar: {\n thickness: 10,\n speed: 2,\n vertical: {\n align: 'right'\n },\n horizontal: {\n align: 'bottom'\n }\n },\n legend: {\n position: 'right',\n color: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n shape: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n size: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n }\n },\n showHeaders: false,\n minWidth: 100,\n minHeight: 100,\n facet: {\n rows: {\n minCharacters: 3\n },\n columns: {\n maxLines: 2,\n verticalAlign: 'middle',\n minCharacters: 1\n }\n },\n border: {\n style: 'solid',\n color: '#d6d6d6',\n width: 2,\n collapse: true,\n spacing: 0\n },\n autoGroupBy: {\n disabled: false\n },\n invalidValues: {},\n sort: {}\n};\n","import { DEFAULT_CONFIG } from '../../../../muze/src/defaults';\n\nconst DEFAULT_WIDTH = 600;\nconst DEFAULT_HEIGHT = 400;\nconst DEFAULT_CLASS_NAME = `${DEFAULT_CONFIG.classPrefix}-layout-container-component`;\nconst NODE_PREFIX = `${DEFAULT_CONFIG.classPrefix}-layout-container`;\n\nexport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT,\n DEFAULT_CLASS_NAME,\n NODE_PREFIX\n};\n","export default class DefinitionModel {\n constructor (config) {\n this._host = config.host || null;\n this._cut = config.cut || null;\n this._ratioWeight = config.ratioWeight === 0 ? 0 : config.ratioWeight || 1;\n this._preferred = config.preferred || false;\n this._lanes = config.lanes || [];\n this._remainingHeight = 0;\n this._remainingWidth = 0;\n }\n\n host (host) {\n if (host) {\n this._host = host;\n }\n return this._host;\n }\n\n preferred (preferred) {\n if (preferred) {\n this._preferred = preferred;\n }\n return this._preferred;\n }\n\n cut (cut) {\n if (cut) {\n this._cut = cut;\n }\n return this._cut;\n }\n\n ratioWeight (ratioWeight) {\n if (ratioWeight) {\n this._ratioWeight = ratioWeight;\n }\n return this._ratioWeight;\n }\n\n lanes (lanes) {\n if (lanes) {\n this._lanes = lanes;\n }\n return this._lanes;\n }\n\n remainingHeight (remainingHeight) {\n if (remainingHeight) {\n this._remainingHeight = remainingHeight;\n }\n return this._remainingHeight;\n }\n\n remainingWidth (remainingWidth) {\n if (remainingWidth) {\n this._remainingWidth = remainingWidth;\n }\n return this._remainingWidth;\n }\n}\n","import { NODE_PREFIX } from '../../constants/defaults';\nimport DefinitionModel from '../definition-manager/definitionModel';\nimport DummyComponent from '../../layout-component/dummy-component';\n/**\n * Compares two strings in lowercase\n *\n * @export\n * @param {string} value the value to be compared\n * @param {string} compareTo whom the value would be compared\n * @return {boolean} true if values are equal\n */\nexport function isEqual (value, compareTo) {\n if (typeof value !== 'string' || typeof compareTo !== 'string') {\n throw new TypeError('value and compareTo must be string');\n }\n return value.toLowerCase() === compareTo.toLowerCase();\n}\n\nexport const getNodeId = (() => {\n let _uid = 0;\n return () => `${NODE_PREFIX}-${++_uid}`;\n})();\n\nexport function yExtraSpace (node) {\n let smallestHeight = 0;\n if (node.getCutType() === 'v') {\n smallestHeight = smallestExtraHeightHorizontally(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'h') {\n node.children().forEach((child) => {\n smallestHeight += yExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerHeight = node.boundBox().height;\n const hostHeight = node.model().host().getLogicalSpace().height;\n\n smallestHeight = containerHeight - hostHeight;\n if (smallestHeight < 0) {\n smallestHeight = 0;\n }\n } else {\n smallestHeight = 0;\n }\n return smallestHeight;\n}\n\nexport function smallestExtraHeightHorizontally (node) {\n let smallestHeight = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const h = yExtraSpace(child);\n if (h < smallestHeight) {\n smallestHeight = h;\n }\n });\n return smallestHeight;\n}\n\nexport function xExtraSpace (node) {\n let smallestWidth = 0;\n if (node.getCutType() === 'h') {\n smallestWidth = smallestExtraWidthVertically(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'v') {\n node.children().forEach((child) => {\n smallestWidth += xExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerWidth = node.boundBox().width;\n const hostWidth = node.model().host().getLogicalSpace().width;\n smallestWidth = containerWidth - hostWidth;\n if (smallestWidth < 0) {\n smallestWidth = 0;\n }\n } else {\n smallestWidth = 0;\n }\n return smallestWidth;\n}\n\nexport function smallestExtraWidthVertically (node) {\n let smallestWidth = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const w = xExtraSpace(child);\n if (w < smallestWidth) {\n smallestWidth = w;\n }\n });\n return smallestWidth;\n}\n\nexport function determineBoundBox (bb, i, arr, instance) {\n if (i) {\n // if not first sibling, take boundbox from previous sibling\n const lastSibling = arr[i - 1];\n const { top: _top, left: _left, height: _height, width: _width } = lastSibling.boundBox();\n return {\n width: bb.width,\n height: bb.height,\n\n top: instance.parentCut() === 'h'\n ? _top + _height : _top,\n\n left: instance.parentCut() === 'h'\n ? _left : _left + _width\n };\n }\n // if first sibling, take boundbox from parent\n const { top: _top, left: _left } = instance.parent().boundBox();\n return {\n width: bb.width,\n height: bb.height,\n top: _top,\n left: _left\n };\n}\n\n// prepares the targetComponent Map for target Mapping ie. where a component should lie\nexport function prepareTargetComponentMap (context) {\n context.targetComponentMap(new Map());\n context.componentMap().forEach((value) => {\n if (context.targetComponentMap().has(value.target())) {\n context.targetComponentMap().get(value.target()).push(value);\n } else {\n const temp = [];\n temp.push(value);\n context.targetComponentMap().set(value.target(), temp);\n }\n });\n}\n\nexport function getComponent (canvasComponent, componentName) {\n const comp = canvasComponent.find(component => component.name() === componentName);\n return (comp && comp !== -1) ? comp : null;\n}\nexport function createPlaceHolderComponent (height, width, position) {\n const comp = new DummyComponent(0, { height, width });\n comp.name('placeHolder');\n comp.position(position);\n return comp;\n}\n\nexport function placeComponent (definitionModel, component, isPreferred = false, isGridComponent = false) {\n let cut = '';\n let componentRatioWidth = 1;\n let leftOvercomponentRationWidth = 1;\n let leftHeight = 0;\n let leftWidth = 0;\n\n if (!component) {\n return { first: definitionModel, second: definitionModel };\n }\n\n const { height: componentHeight, width: componentWidth } = component.getLogicalSpace();\n const position = component.position();\n if (position === 'top' || position === 'bottom') {\n cut = 'h';\n componentRatioWidth = componentHeight / definitionModel.remainingHeight();\n leftHeight = definitionModel.remainingHeight() - componentHeight;\n leftWidth = definitionModel.remainingWidth();\n } else {\n cut = 'v';\n componentRatioWidth = componentWidth / definitionModel.remainingWidth();\n leftWidth = definitionModel.remainingWidth() - componentWidth;\n leftHeight = definitionModel.remainingHeight();\n }\n leftOvercomponentRationWidth = 1 - componentRatioWidth;\n\n// update parentModel\n definitionModel.cut(cut);\n const firstLaneConfig = {\n host: component.name(),\n cut: null,\n ratioWeight: componentRatioWidth,\n preferred: isGridComponent ? false : isPreferred,\n lanes: []\n };\n const firstLane = new DefinitionModel(firstLaneConfig);\n firstLane.remainingHeight(componentHeight);\n firstLane.remainingWidth(componentWidth);\n\n const secondLaneConfig = {\n host: null,\n cut: null,\n ratioWeight: leftOvercomponentRationWidth,\n preferred: isGridComponent ? false : !isPreferred,\n lanes: []\n };\n const secondLane = new DefinitionModel(secondLaneConfig);\n secondLane.remainingHeight(leftHeight);\n secondLane.remainingWidth(leftWidth);\n if (isPreferred) {\n definitionModel.lanes([firstLane]);\n } else if (position === 'top' || position === 'left') {\n definitionModel.lanes([firstLane, secondLane]);\n } else {\n definitionModel.lanes([secondLane, firstLane]);\n }\n return { first: firstLane, second: secondLane };\n}\n\nexport function placeGridComponent (definitionModel, gridComponents) {\n let tempDefModel = definitionModel;\n const rows = gridComponents.length;\n const column = rows ? gridComponents[0].length : 0;\n const height = gridComponents.reduce((acc, val) => (acc + val[0].getLogicalSpace().height), 0);\n\n for (let i = 0; i < column; i++) {\n const iscolumnPreffered = i === column - 1;\n const columnPlaceHolderComponent = createPlaceHolderComponent(height,\n gridComponents[0][i].getLogicalSpace().width, 'left');\n const { first, second } = placeComponent(tempDefModel, columnPlaceHolderComponent, iscolumnPreffered);\n tempDefModel = first;\n for (let j = 0; j < rows; j++) {\n const rowpreffred = j === (rows - 1);\n tempDefModel = placeComponent(tempDefModel, gridComponents[j][i], rowpreffred, true).second;\n }\n tempDefModel = second;\n }\n return tempDefModel;\n}\n\nexport function negotiateDimension (node) {\n let preferred;\n let cumultiveExtraSpaceAmt = 0;\n let alteredDim;\n let nonAlteredDim;\n\n const childrenLength = node.children().length;\n\n for (let index = 0; index < childrenLength; index++) {\n let fn;\n let extraSpaceAmt;\n const child = node.children()[index];\n\n if (child.parentCut() === 'h') {\n fn = yExtraSpace;\n alteredDim = 'height';\n nonAlteredDim = 'width';\n } else {\n fn = xExtraSpace;\n alteredDim = 'width';\n nonAlteredDim = 'height';\n }\n // if vertical then get extra height from other node and push it to the preferred node.\n // for horizontal cut the same thing is to be done with width\n if (child.isPreferred()) {\n // push extra space in sink. Execute it when all non preferred space are computed.\n preferred = child;\n\n continue; // eslint-disable-line no-continue\n }\n // reduce own height and save it in a var\n cumultiveExtraSpaceAmt += (extraSpaceAmt = fn(child));\n child.boundBox()[alteredDim] -= extraSpaceAmt;\n // update nonaltered dim from parent for any change which happened during negotiation\n child.boundBox()[nonAlteredDim] = child.parent().boundBox()[nonAlteredDim];\n\n negotiateDimension(child);\n }\n\n if (preferred) {\n preferred.boundBox()[alteredDim] += cumultiveExtraSpaceAmt;\n preferred.boundBox()[nonAlteredDim] = preferred.parent().boundBox()[nonAlteredDim];\n negotiateDimension(preferred);\n }\n}\n\nexport function computePosition (node) {\n node.children().forEach((child, i, children) => {\n const boundBox = determineBoundBox(child.boundBox(), i, children, child);\n child.boundBox(boundBox);\n computePosition(child);\n });\n}\n\nexport function allocateBoundingBox (node) {\n const totalWeight = node.children()\n .map(child => child.model().ratioWeight())\n .reduce((carry, val) => carry + val, 0);\n\n node.children().forEach((child, i, children) => {\n const lastSibling = children[i - 1];\n const ratio = child.model().ratioWeight() / totalWeight;\n\n if (child.parentCut() === 'h') {\n child.boundBox({\n top: i ? lastSibling.boundBox().top + lastSibling.boundBox().height : 0,\n left: child.parent().boundBox().left,\n height: child.parent().boundBox().height * ratio,\n width: child.parent().boundBox().width\n });\n } else {\n child.boundBox({\n top: child.parent().boundBox().top,\n left: i ? lastSibling.boundBox().left + lastSibling.boundBox().width : 0,\n height: child.parent().boundBox().height,\n width: child.parent().boundBox().width * ratio\n });\n }\n allocateBoundingBox(child);\n });\n}\n\n","import { getNodeId } from '../helper';\nimport { LayoutComponent } from '../../layout-component';\n\nclass Node {\n constructor (data) {\n this._model = data;\n this._parent = null;\n this._children = [];\n this._parentCut = null;\n this._boundBox = {\n top: null,\n left: null,\n height: null,\n width: null\n };\n\n this._id = this._model.host() instanceof LayoutComponent && this._model.host().renderAt() ?\n this._model.host().renderAt() :\n getNodeId();\n }\n\n addChildren (entries) {\n this._children.push(...entries);\n entries.forEach((e) => { e.parent(this); });\n }\n\n isRoot () {\n return this._parent === null;\n }\n\n isLeaf () {\n return !this._children.length;\n }\n\n getCutType () {\n return this._model.cut();\n }\n\n isPreferred () {\n return !!this._model.preferred();\n }\n\n children (children) {\n if (children) {\n this._children = children;\n }\n return this._children;\n }\n\n parent (parent) {\n if (parent) {\n this._parent = parent;\n }\n return this._parent;\n }\n\n parentCut (parentCut) {\n if (parentCut) {\n this._parentCut = parentCut;\n }\n return this._parentCut;\n }\n\n id (id) {\n if (id) {\n this._id = id;\n }\n return this._id;\n }\n\n model (model) {\n if (model) {\n this._model = model;\n }\n return this._model;\n }\n\n boundBox (bound) {\n if (bound) {\n this._boundBox = {\n top: bound.top,\n left: bound.left,\n height: bound.height,\n width: bound.width\n };\n }\n return this._boundBox;\n }\n /**\n * function to search a node and update it with the config provided.\n * @param {Object} nodeconfig\n */\n updateNode (nodeconfig) {\n if (this._id === nodeconfig._id) {\n this._model.cut(nodeconfig.cut);\n this._model.ratioWeight(nodeconfig.ratioWeight);\n } else {\n this._children.forEach((node) => {\n if (node._id === nodeconfig._id) {\n node.model.cut(nodeconfig.cut);\n node.model.ratioWeight(nodeconfig.ratioWeight);\n return;\n }\n this.searchNode(node, nodeconfig);\n });\n }\n }\n\n // Recursive function to search a node\n searchNode (node, nodeconfig) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeconfig._id) {\n childNode.model().cut(nodeconfig.cut);\n childNode.model().ratioWeight(nodeconfig.ratioWeight);\n } else {\n this.searchNode(childNode, nodeconfig);\n }\n });\n }\n\n /**\n * function to delete a node from tree Structure.\n * @param {String} nodeId - node Id of the Node\n */\n delete (nodeId) {\n this._children.forEach((node) => {\n if (node.id() === nodeId) {\n const index = this._children.indexOf(node);\n this._model.lanes().splice(index, 1);\n }\n this.deleteSearchNode(node, nodeId);\n });\n }\n\n // Recursive function to search a node\n deleteSearchNode (node, nodeId) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeId) {\n const index = node.children().indexOf(childNode);\n node.model().lanes().splice(index, 1);\n } else {\n this.deleteSearchNode(childNode, nodeId);\n }\n });\n }\n}\n\nexport default Node;\n","import Node from '../tree';\nimport {\n allocateBoundingBox,\n negotiateDimension,\n computePosition\n} from '../helper';\n\nexport default class LayoutModel {\n constructor (measurements, config) {\n this._measurements = measurements;\n this._config = config;\n this._root = this.createTree(this._config, null);\n this.setBoundBox();\n }\n\n createTree (config, parent) {\n const node = new Node(config);\n if (parent) {\n node.parentCut(parent.getCutType());\n parent.addChildren([node]);\n } else {\n this._root = node;\n }\n for (const lane of config.lanes()) {\n this.createTree(lane, node);\n }\n\n return this._root;\n }\n\n setBoundBox () {\n this._root.boundBox({\n top: 0,\n left: 0,\n width: this._measurements.width,\n height: this._measurements.height\n });\n allocateBoundingBox(this._root);\n }\n\n setHostPosition (node) {\n node.children().forEach((child) => {\n LayoutModel.setHostSpatialConfig(child);\n this.setHostPosition(child);\n });\n }\n\n static setHostSpatialConfig (node) {\n const bb = node.boundBox();\n const host = node.model().host();\n if (host && host.setSpatialConfig) {\n const conf = {\n x: bb.left,\n y: bb.top,\n width: bb.width,\n height: bb.height,\n renderAt: node.id()\n };\n host.setSpatialConfig(conf);\n }\n }\n\n negotiate () {\n negotiateDimension(this._root);\n computePosition(this._root);\n return this;\n }\n\n broadcast () {\n this.setHostPosition(this._root);\n return this;\n }\n\n tree () {\n return this._root;\n }\n}\n","/**\n * This file exports constants that will be used to\n * create the state store of the table layout.\n */\n/**\n * The index of top, bottom and center in the matrix\n */\nexport const VIEW_INDEX = {\n top: 0,\n center: 1,\n bottom: 2\n};\n\nexport const ROW_MATRIX_INDEX = {\n 0: 'top',\n 1: 'center',\n 2: 'bottom'\n};\n\nexport const COLUMN_MATRIX_INDEX = {\n 0: 'left',\n 1: 'middle',\n 2: 'right'\n};\n\n/**\n * The width of the grid suppied by the user.\n */\nexport const GRID_WIDTH = 'width';\n\n/**\n * The height of the grid supplied by the user.\n */\nexport const GRID_HEIGHT = 'height';\n\n/**\n * The border for the grid\n */\nexport const BORDER = 'border';\n\n /**\n * The index of the first visible row in view matrix.\n */\nexport const ROW_POINTER = 'rowPointer';\n\n/**\n * The index of the first visible column in the view matrix.\n */\nexport const COLUMN_POINTER = 'columnPointer';\n\n/**\n * Flag to specify whether row sizes should be equal.\n */\nexport const ROW_SIZE_IS_EQUAL = 'isRowSizeEqual';\n\n/**\n * Flag to specify whether column sizes are equal.\n */\nexport const COLUMN_SIZE_IS_EQUAL = 'isColumnSizeEqual';\n\n/**\n * Field to store an array an of the widths of visible columns.\n * @computed\n */\nexport const COLUMN_WIDTHS = 'visibleColumnWidths';\n\n/**\n * Field to store an array of heights of visible rows.\n * @computed\n */\nexport const ROW_HEIGHTS = 'visibleRowHeights';\n\n/**\n * Field to store the width of the left matrix.\n * @computed\n */\nexport const LEFT_MATRIX_WIDTH = 'leftMatrixWidth';\n\n/**\n * Field to store the width of the right matrix.\n * @computed\n */\nexport const RIGHT_MATRIX_WIDTH = 'rightMatrixWidth';\n\n/**\n * Field to store the height of the top matrix.\n * @computed\n */\nexport const TOP_MATRIX_HEIGHT = 'topMatrixHeight';\n\n/**\n * Field to store the height of the bottom matrix.\n * @computed\n */\nexport const BOTTOM_MATRIX_HEIGHT = 'bottomMatrixHeight';\n\n/**\n * The dom element to render the layout inside.\n */\nexport const MOUNT_POINT = 'mount';\n\n/**\n * The id attribute of the left table element.\n */\nexport const LEFT_TABLE_ID = 'grid-left';\n\n/**\n * The id attribute of the right table element.\n */\nexport const RIGHT_TABLE_ID = 'grid-right';\n\n/**\n * The id attribute of the top table.\n */\nexport const TOP_TABLE_ID = 'grid-top';\n\n/**\n * The id attribute of the bottom table.\n */\nexport const BOTTOM_TABLE_ID = 'grid-bottom';\n\n/**\n * The id attribute of the center table.\n */\nexport const CENTER_TABLE_ID = 'grid-center';\n\n/**\n * The id attribute of the top div.\n */\nexport const TOP_DIV_ID = 'muze-div-top';\n\n/**\n * The id attribute of the bottom div.\n */\nexport const BOTTOM_DIV_ID = 'muze-div-bottom';\n\n/**\n * The id attribute of the center div.\n */\nexport const CENTER_DIV_ID = 'muze-div-center';\n\n/**\n * Field that indicates if the row configuration has changed\n */\nexport const HAVE_ROWS_CHANGED = 'haveRowsChanged';\n\n/**\n * Field that indicates if the column configuration has changed\n */\nexport const HAVE_COLUMNS_CHANGED = 'haveColumnsChanged';\n\n/**\n * Field that indicates if the values configuration for the center matrix has changed\n */\nexport const HAVE_VALUES_CHANGED = 'haveValuesChanged';\n\n/**\n * Field that indicates the width of row matrix\n */\nexport const ROW_MATRIX_WIDTH = 'rowMatrixWidth';\n\n/**\n * Field that indicates the height of row matrix\n */\nexport const COLUMN_MATRIX_HEIGHT = 'columnMatrixHeight';\n\n/**\n * Field that indicates the unit width of layout\n */\nexport const UNIT_WIDTH = 'unitWidth';\n\n/**\n * Field that indicates the unit height of layout\n */\nexport const UNIT_HEIGHT = 'unitHeight';\n\n/**\n * Field that indicates the style object\n */\nexport const STYLE = 'style';\n\n/**\n * Field that indicates the color configuration\n */\nexport const COLOR = 'color';\n\n/**\n * Field that indicates width\n */\nexport const WIDTH = 'width';\n\n/**\n * Field that indicates collpase property for border\n */\nexport const COLLAPSE = 'collapse';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SPACING = 'spacing';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const DISTRIBUTION = 'distribution';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const GUTTERSPACE = 'gutterSpace';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const BREAK_PAGE = 'breakPage';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_ROW_BORDERS = 'showRowBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_COL_BORDERS = 'showColBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_VALUE_BORDERS = 'showValueBorders';\n\nexport const HEIGHT = 'height';\nexport const COLUMN = 'column';\nexport const ROW = 'row';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const CENTER = 'center';\nexport const CLICK = 'click';\nexport const ROW_LEFT = 'rowLeft';\nexport const ROW_RIGHT = 'rowRight';\nexport const COLUMN_BOTTOM = 'colBottom';\nexport const COLUMN_TOP = 'colTop';\nexport const AUTO = 'auto';\nexport const ROW_SPAN = 'rowSpan';\nexport const COL_SPAN = 'colSpan';\nexport const ROW_ROOT = 'rowRoot';\nexport const COLUMN_ROOT = 'columnRoot';\nexport const PRIMARY = 'primary';\nexport const SECONDARY = 'secondary';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const GRID = 'grid';\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n\nexport const PAGINATION = 'pagination';\nexport const BUFFER = 'buffer';\nexport const HOLISTIC = 'holistic';\nexport const SCROLL = 'scroll';\nexport const MIDDLE = 'middle';\nexport const NO_BORDERS = null;\n\nexport const MAX_WIDTH_AVAIL_FOR_COL_MATRIX = 'maxWidthAvailableForColumnMatrix';\nexport const COLUMN_MATRIX = 'columnMatrix';\nexport const MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX = 'maxHeightAvailableForRowMatrix';\nexport const ROW_MATRIX = 'rowMatrix';\n","/* eslint no-undef: \"off\" */\n/* eslint default-case: \"off\" */\nexport class Utils {\n static isDOMElement (element) {\n return element instanceof Element;\n }\n\n static getID (element) {\n return element.id;\n }\n\n static getElement (id) {\n return document.getElementById(id);\n }\n\n static findContainer (data) {\n return data.filter(coordinate => coordinate.parent == null)[0];\n }\n /**\n * static method to remove the div\n * @param {} divId - div ID to be removed.\n */\n static removeDiv (divId) {\n if (document.getElementById(divId) !== null) { document.getElementById(divId).remove(); }\n }\n}\n","import { DEFAULT_CLASS_NAME } from '../constants/defaults';\nimport { LayoutComponent } from '../layout-component';\n\nexport default class DataPoint {\n constructor (node) {\n this._node = node;\n this._className = node.model().host() instanceof LayoutComponent ?\n node.model().host().className() : DEFAULT_CLASS_NAME;\n }\n\n node () {\n return this._node;\n }\n\n hasHost () {\n return this._node.model().host() instanceof LayoutComponent;\n }\n\n className () {\n return this._className || DEFAULT_CLASS_NAME;\n }\n}\n","import { getnodePoints } from './helper';\n\nexport class DataParser {\n constructor (data) {\n this._data = data;\n }\n\n defaultDataPointLogic () {\n const nodepoints = [];\n getnodePoints(this._data, nodepoints);\n return nodepoints;\n }\n\n}\n","import DataPoint from './data-point';\n\nexport const getnodePoints = (node, nodepoints) => {\n const datapoint = new DataPoint(node);\n nodepoints.push(datapoint);\n node.children().forEach((child) => {\n getnodePoints(child, nodepoints);\n });\n};\n","import { DataParser } from './data-parser';\n\nexport class HTMLDataAdapter extends DataParser {\n getCoordinates () {\n return super.defaultDataPointLogic();\n }\n}\n","export class Renderer {\n\n initRenderer (node, tree) {\n node.__logicalTree = tree;\n }\n}\n","import { HTMLDataAdapter } from '../data-adapters/html-data';\nimport { Utils } from '../utils';\nimport { Renderer } from './renderer';\n\nexport class HTMLRenderer extends Renderer {\n constructor (data) {\n super();\n this._data = data;\n this._coordinates = new HTMLDataAdapter(this._data).getCoordinates();\n }\n\n createhtml (mount, className) {\n const mainDiv = mount;\n super.initRenderer(mainDiv, this._data); // Initialise node with layout id\n this.parentDiv = this.createAndCustomiseParent(className);\n this._coordinates.forEach((node) => {\n if (node.hasHost()) {\n const host = node.node();\n this.parentDiv.appendChild(this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: node.className() }));\n }\n });\n mainDiv.appendChild(this.parentDiv);\n }\n\n createAndPositionDiv (config) {\n const { top, left, height, width, className, id } = config;\n const existingDiv = document.getElementById(id);\n const div = existingDiv || document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = `${left}px`;\n div.style.top = `${top}px`;\n div.style.height = `${height}px`;\n div.style.width = `${width}px`;\n div.id = id;\n div.className = className;\n return div;\n }\n\n createAndCustomiseParent (className) {\n const container = Utils.findContainer(this._coordinates);\n const host = container.node();\n const parentDiv = this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: container.className() });\n parentDiv.className = className;\n parentDiv.style.position = 'relative';\n return parentDiv;\n }\n\n coordinates () {\n return this._coordinates;\n }\n}\n","import { selectElement } from 'muze-utils';\nimport { HTMLRenderer } from '../renderers/html-renderer';\nimport { LayoutComponent } from '../layout-component';\n\nexport const getChildNode = (context, config) =>\n context.renderer().createAndPositionDiv(config);\n\nexport const findNode = (context, nodeID) =>\n context.renderer().coordinates().find(point => point.node().id() === nodeID);\n\nexport const renderHTML = (context) => {\n context.renderer(new HTMLRenderer(context.data()));\n context.renderer().createhtml(context.mount(), context.className());\n};\n\nexport const drawLayout = context => renderHTML(context);\n\nexport const drawComponent = (componentData) => {\n componentData.children().forEach((node) => {\n const host = node.model().host();\n if (host instanceof LayoutComponent) {\n host.draw();\n }\n drawComponent(node);\n });\n};\n\nexport const removeElement = (elemID) => {\n if (elemID) {\n selectElement(`#${elemID}`).remove();\n }\n};\n\nconst setAlignConfig = (alignment, params) => {\n let newNodeConfig = {};\n const { node, refNode } = params;\n switch (alignment) {\n case 'left':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(refNode.left - node.left))\n };\n break;\n\n case 'right':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(node.left + node.width - (refNode.left + refNode.width)))\n };\n break;\n\n case 'top':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: Math.abs(node.height - Math.abs(refNode.top - node.top)),\n width: node.width\n };\n break;\n\n case 'bottom':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: Math.abs(node.top - refNode.top + refNode.height),\n width: node.width\n };\n break;\n\n case 'h-center':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: refNode.width\n };\n break;\n\n case 'v-center':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: refNode.top,\n width: node.width\n };\n break;\n default:\n break;\n }\n return newNodeConfig;\n};\n\nexport const resolveAligment = (context, componentData) => {\n componentData.children().forEach((component) => {\n const host = component.model().host();\n\n if (host instanceof LayoutComponent && host.alignWith()) {\n const componentToAlign = context.componentMap().get(host.alignWith());\n\n if (componentToAlign) {\n const point = findNode(context, component.id()).node();\n const node = point.boundBox();\n const refNode = findNode(context, componentToAlign.renderAt())\n .node()\n .boundBox();\n const newNodeConfig = setAlignConfig(host.alignment(), { node, refNode });\n\n // check if model in parent component\n Object.assign(newNodeConfig, { id: point.id(), className: host.className() });\n context.renderer().createAndPositionDiv(newNodeConfig);\n context.componentMap().get(host.name()).setSpatialConfig({\n x: newNodeConfig.left,\n y: newNodeConfig.top,\n height: newNodeConfig.height,\n width: newNodeConfig.width\n\n });\n }\n }\n\n resolveAligment(context, component);\n });\n};\n","import { Utils } from '../utils';\nimport { drawLayout, resolveAligment, drawComponent } from './helper';\n\nexport class DrawingManager {\n constructor (data, renderer, container) {\n this._data = data.tree;\n this._componentMap = data.componentMap;\n this._layoutClassName = data.layoutClassName;\n this._renderer = renderer;\n this._mount = Utils.isDOMElement(container) ? container : Utils.getElement(container);\n }\n\n draw () {\n drawLayout(this);\n resolveAligment(this, this._data);\n drawComponent(this._data);\n return this;\n }\n\n data (data) {\n if (data) {\n this._data = data;\n }\n return this._data;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n className (param) {\n if (param) {\n this._layoutClassName = param;\n }\n return this._layoutClassName;\n }\n\n renderer (param) {\n if (param) {\n this._renderer = param;\n }\n return this._renderer;\n }\n\n mount (param) {\n if (param) {\n this._mount = param;\n }\n return this._mount;\n }\n}\n","import DefinitionModel from './definitionModel';\nimport { prepareTargetComponentMap, getComponent, placeComponent, placeGridComponent } from '../helper';\n\nexport default class DefinitionManager {\n constructor (componentMap, sequence, totalHeight, totalWidth) {\n this._componentMap = componentMap;\n this._prioritySequence = sequence;\n this._totalHeight = totalHeight;\n this._totalWidth = totalWidth;\n this._targetComponentMap = null;\n }\n\n // create the config model\n generateConfigModel () {\n prepareTargetComponentMap(this);\n const canvasComponent = this._targetComponentMap.get('canvas');\n const definitionModel = new DefinitionModel({});\n let tempDefModel = definitionModel;\n definitionModel.remainingHeight(this._totalHeight);\n definitionModel.remainingWidth(this._totalWidth);\n\n let componentRef = null;\n\n this._prioritySequence.forEach((name) => {\n componentRef = getComponent(canvasComponent, name);\n if (name !== 'grid') {\n tempDefModel = placeComponent(tempDefModel, componentRef).second;\n } else {\n tempDefModel = placeGridComponent(tempDefModel, componentRef.component);\n }\n });\n return definitionModel;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n targetComponentMap (param) {\n if (param) {\n this._targetComponentMap = param;\n }\n return this._targetComponentMap;\n }\n}\n","import { sanitizeConfig } from './helper';\n\nexport class LayoutDef {\n constructor () {\n this._componentMap = new Map();\n this._layoutDefinition = null;\n }\n\n addComponent (component) {\n this._componentMap.set(component.name(), component);\n }\n\n layoutDefinition (def) {\n if (def) {\n this._layoutDefinition = def;\n }\n return this._layoutDefinition;\n }\n\n addMultipleComponent (componentArray) {\n componentArray.forEach((comp) => {\n this.addComponent(comp);\n });\n }\n\n sanitizedDefinition () {\n sanitizeConfig(this, this._layoutDefinition);\n return this.layoutDefinition();\n }\n\n componentMap () {\n return this._componentMap;\n }\n resetComponentMap () {\n this._componentMap.clear();\n }\n}\n","import DefinitionManager from '../layout-definition/definition-manager';\n\nexport function sanitizeConfig (context, hostObj) {\n const hostID = hostObj.host();\n if (hostObj.lanes() && hostObj.lanes().length) {\n hostObj.lanes().forEach(childHost => sanitizeConfig(context, childHost));\n }\n if (hostID != null && typeof (hostID) === 'string') {\n if (context.componentMap().get(hostID) !== undefined) {\n hostObj.host(context.componentMap().get(hostID));\n }\n }\n}\n\nexport function calLayOutDef (context) {\n const { height, width } = context.dimension();\n const defManager = new DefinitionManager(context.layoutDef().componentMap(),\n context.prioritySequence(),\n height,\n width);\n const genLayoutdef = defManager.generateConfigModel();\n return genLayoutdef;\n}\n","import {\n LayoutModel\n} from '../layout-definition';\n\nimport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT\n} from '../constants/defaults';\n\nimport {\n GRID\n} from '../../enums/constants';\n\nimport { DrawingManager } from '../drawing-manager';\nimport { removeElement } from '../drawing-manager/helper';\nimport { Utils } from '../utils';\nimport { LayoutDef } from './layout-def';\nimport { calLayOutDef } from './helper';\n\nexport default class LayoutManager {\n constructor (conf) {\n this._renderAt = conf.renderAt;\n this._layoutClassName = conf.className;\n this._dimension = {\n width: conf.width || DEFAULT_WIDTH,\n height: conf.height || DEFAULT_HEIGHT\n };\n\n this._skeletonType = conf.skeletonType || 'html';\n this._layoutDefinition = null;\n this._layoutDef = new LayoutDef();\n this._drawingManager = null;\n this._prioritySequence = [];\n this.tree = null;\n this._rootNodeID = null;\n }\n\n layoutDef (param) {\n if (param) {\n this._layoutDef = param;\n }\n return this._layoutDef;\n }\n\n prioritySequence (param) {\n if (param) {\n this._prioritySequence = param;\n }\n return this._prioritySequence;\n }\n\n dimension (param) {\n if (param) {\n Object.assign(this._dimension, param);\n }\n return this._dimension;\n }\n\n addComponent (component) {\n this._layoutDef.addComponent(component);\n }\n\n addMultipleComponent (componentArray) {\n this._layoutDef.addMultipleComponent(componentArray);\n }\n\n resetNode (node) {\n if (this.con) {\n this.con.resetNode(node);\n }\n }\n\n /**\n * function to update the node and rerender the layout.\n * @param {} config - node configuration to change.\n */\n updateNode (config) {\n this.tree.updateNode(config);\n this._layoutDefinition = this.tree.model;\n this.compute();\n }\n\n compute () {\n //----\n if (Utils.isDOMElement(this._renderAt)) {\n this._renderAt._layout = this;\n } else {\n document.getElementById(this._renderAt)._layout = this;\n }\n //-----\n this._layoutDefinition = calLayOutDef(this);\n this._layoutDef.layoutDefinition(this._layoutDefinition);\n this._layoutDefinition = this._layoutDef.sanitizedDefinition();\n this._layout = new LayoutModel({\n width: this._dimension.width,\n height: this._dimension.height\n },\n this._layoutDefinition);\n this.tree = this._layout.negotiate().tree();\n this._layout.broadcast();\n this._drawingManager = new DrawingManager({\n tree: this.tree,\n componentMap: this._layoutDef.componentMap(),\n layoutClassName: this._layoutClassName\n }, this._skeletonType, this._renderAt);\n\n if (this._rootNodeID) {\n this.tree.id(this._rootNodeID);\n } else {\n this._rootNodeID = this.tree.id();\n }\n // this will draw all the components by calling their draw method\n this._drawingManager.draw();\n }\n\n getRootNodeId () {\n return this._rootNodeID;\n }\n\n /**\n * This function takes the LayoutComponents and Register them in component store\n * @param {Array} layoutComponents\n */\n registerComponents (layoutComponents) {\n this._prioritySequence.length = 0;\n this._layoutDef.resetComponentMap();\n layoutComponents.forEach((container) => {\n if (container) {\n this._prioritySequence.push(container.name());\n this.addComponent(container);\n if (container.name() === 'grid') {\n container.component.forEach((componentArr) => {\n componentArr.forEach((compo) => {\n this.addComponent(compo);\n });\n });\n }\n }\n });\n return this;\n }\n\n getComponent (componentName) {\n return this._layoutDef.componentMap().get(componentName);\n }\n\n deleteElement (component, elementName) {\n this._layoutDef.componentMap().delete(elementName);\n const deleteElementId = component.renderAt();\n return removeElement(deleteElementId);\n }\n\n removeComponent (name) {\n const component = this.getComponent(name);\n if (component) {\n if (name === GRID) {\n return component.component.map(comp => comp.map(\n co => this.deleteElement(co, co.name())\n ));\n }\n return this.deleteElement(component, name);\n }\n return this;\n }\n\n renderAt (mount) {\n if (mount) {\n this._renderAt = mount;\n }\n return this._renderAt;\n }\n}\n","import { isEqual, STATE_NAMESPACES, selectElement, getValueParser } from 'muze-utils';\nimport { VisualGroup } from '@chartshq/visual-group';\nimport { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID }\n from '../constants';\nimport { canvasOptions } from './local-options';\nimport { LayoutManager } from '../../../layout/src/tree-layout';\n\n/**\n * Instantiate high level components. Canvas knows what all high level component it has.\n * @nice-to-have dynamic high level components.\n * - Is it even required ?\n * - Reactive to source (canvas) streaming ?\n * @param {*} context Canvas instance\n * @return {Object.} Arrays of Title, visualGroup, Legend\n */\nexport const initCanvas = (context) => {\n const reg = context._registry.components;\n\n return [new reg.VisualGroup(context._registry, Object.assign({\n throwback: context._throwback\n }, context.dependencies()))];\n};\n\nexport const fixScrollBarConfig = (config) => {\n config.scrollBar.thickness = Math.min(50, Math.max(10, config.scrollBar.thickness));\n return config;\n};\n\nexport const setLayoutInfForUnits = (context) => {\n const layoutManager = context._layoutManager;\n const gridLayout = layoutManager.getComponent(GRID);\n const boundBox = gridLayout && gridLayout.getBoundBox();\n const valueMatrix = context.composition().visualGroup.matrixInstance().value;\n const parentContainer = selectElement(`#${layoutManager.getRootNodeId()}`).node();\n valueMatrix.each((cell) => {\n cell.valueOf().parentContainerInf({\n el: parentContainer,\n dimensions: boundBox\n });\n });\n};\n\n/**\n *\n *\n * @memberof Canvas\n */\nexport const dispatchProps = (context) => {\n const lifeCycleManager = context.dependencies().lifeCycleManager;\n lifeCycleManager.notify({ client: context, action: 'beforeupdate' });\n const visualGroup = context.composition().visualGroup;\n\n const allOptions = context._allOptions;\n for (const key in allOptions) {\n const value = context[key]();\n if (value !== null) {\n visualGroup[key] && visualGroup[key](value);\n }\n }\n const { invalidValues } = context.config();\n\n visualGroup.valueParser(getValueParser(invalidValues));\n visualGroup.createMatrices();\n context._cachedProps = {};\n lifeCycleManager.notify({ client: context, action: 'initialized' });\n lifeCycleManager.notify({ client: context, action: 'updated' });\n};\n\nconst equalityChecker = (props, params) => {\n let checker = () => false;\n return !props.every((option, i) => {\n switch (option) {\n case ROWS:\n case COLUMNS:\n case DETAIL:\n checker = isEqual('Array');\n break;\n\n case SHAPE:\n case SIZE:\n case COLOR:\n case DATA:\n case CONFIG:\n checker = isEqual('Object');\n break;\n default:\n checker = () => true;\n break;\n }\n const oldVal = params[i][0];\n const newVal = params[i][1];\n\n return checker(oldVal, newVal);\n });\n};\n\nconst updateChecker = (props, params) => props.every((option, i) => {\n const val = params[i][1];\n switch (option) {\n case ROWS:\n case COLUMNS:\n return val !== null;\n\n case DATA:\n return val && !val.isEmpty();\n\n default:\n return true;\n\n }\n});\n\nexport const notifyAnimationEnd = (context) => {\n const viewInfo = context.layout().viewInfo();\n const centerMatrix = viewInfo && viewInfo.viewMatricesInfo.matrices.center[1] || [];\n const promises = [];\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n promises.push(cell.valueOf().done());\n });\n });\n const lifeCycleManager = context.lifeCycle();\n if (promises.length) {\n Promise.all(promises).then(() => {\n // Update life cycle\n lifeCycleManager.notify({ client: context, action: 'drawn' });\n const animDonePromises = [];\n\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n cell.valueOf().layers().forEach((layer) => {\n animDonePromises.push(layer.animationDone());\n });\n });\n });\n\n [context.xAxes(), context.yAxes()].forEach((axisArr) => {\n axisArr = axisArr || [];\n axisArr.forEach((axes) => {\n axes.forEach((axisInst) => {\n animDonePromises.push(axisInst.animationDone());\n });\n });\n });\n\n Promise.all(animDonePromises).then(() => {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n });\n });\n } else {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n }\n};\n\nexport const setupChangeListener = (context) => {\n const store = context._store;\n\n const allOptions = Object.keys(context._allOptions);\n const props = [...allOptions, ...Object.keys(canvasOptions)];\n const nameSpaceProps = [...allOptions, ...Object.keys(canvasOptions)].map(prop =>\n `${STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE}.${prop}`);\n store.registerChangeListener(nameSpaceProps, (...params) => {\n const equalityProps = equalityChecker(props, params);\n const updateProps = updateChecker(props, params);\n // inform attached board to rerender\n if (equalityProps && context.mount()) {\n if (updateProps) {\n dispatchProps(context);\n } else {\n context.composition().visualGroup.remove();\n }\n context.render();\n }\n notifyAnimationEnd(context);\n }, true);\n};\n\nexport const applyInteractionPolicy = (firebolt) => {\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n if (visualGroup) {\n const valueMatrix = visualGroup.matrixInstance().value;\n const interactionPolicy = firebolt._interactionPolicy;\n interactionPolicy(valueMatrix, firebolt);\n const crossInteractionPolicy = firebolt._crossInteractionPolicy;\n const behaviours = crossInteractionPolicy.behaviours;\n const sideEffects = crossInteractionPolicy.sideEffects;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n for (const key in behaviours) {\n unitFireBolt.changeBehaviourStateOnPropagation(key, behaviours[key]);\n }\n for (const key in sideEffects) {\n unitFireBolt.changeSideEffectStateOnPropagation(key, sideEffects[key]);\n }\n });\n }\n};\n\n/**\n * Sets the rotation for all x axes if any axis has the rotation config set in the\n * entire view\n *\n * @param {Array} columns Column cells that contain the axes cells\n */\nexport const setLabelRotationForAxes = (context) => {\n let rotation = 0;\n\n const xAxes = context.xAxes() || [];\n\n (() => {\n for (let i = 0; i < xAxes.length; i++) {\n for (let j = 0; j < xAxes[i].length; j++) {\n const rotationVal = xAxes[i][j].renderConfig().labels.rotation;\n if (rotationVal && rotationVal !== 0) {\n rotation = rotationVal;\n return;\n }\n }\n }\n })();\n\n if (rotation) {\n xAxes.forEach((axes) => {\n axes.forEach((axis) => {\n axis.renderConfig({ labels: { rotation } });\n axis.smartTicks(axis.setTickConfig());\n });\n });\n }\n};\n\nexport const createGroupState = (context) => {\n const [globalState, localState] = VisualGroup.getState();\n const store = context._store;\n store.append('app.group', globalState);\n store.append('local.group', localState);\n};\n\nexport const removeChild = (mount) => {\n while (mount.firstChild) {\n mount.removeChild(mount.firstChild);\n }\n};\n\nexport const createLayoutManager = () => {\n const layoutManager = new LayoutManager({\n className: 'muze-group-container'\n });\n return layoutManager;\n};\n","/**\n * This is the global options semantics based on which setters getters are created and reactivity is initiated.\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n * @module GlobalOptions\n */\n\nimport { intSanitizer, mergeRecursive, DataModel } from 'muze-utils';\nimport { fixScrollBarConfig } from './canvas/helper';\nimport { DEFAULT_CONFIG } from './defaults';\n\nexport default {\n data: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel\n }\n },\n width: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n height: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitWidth: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitHeight: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n config: {\n value: [null, null],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n takesMultipleParams: true,\n sanitization: ([config, auxConfig = {}], oldConfig) => {\n // Stores additional config, if passed\n const { reset = false } = auxConfig;\n let oldConf = {};\n\n if (!reset) {\n oldConf = mergeRecursive({}, config === null ? {} : oldConfig);\n }\n\n const defConfig = mergeRecursive(oldConf, DEFAULT_CONFIG);\n const newConf = mergeRecursive(defConfig, config);\n return fixScrollBarConfig(newConf);\n }\n\n }\n }\n};\n","import { sanitizeIP, mergeRecursive } from 'muze-utils';\nimport { TOP, CENTER, BOTTOM } from '../enums/constants';\n\n/*\n * This is the abstract implementation of the root layout. This takes care of common work which all the layouts\n * has to handle. The common work includes sanitizaion of inputs, update, rerender, dispose etc. This class can't be\n * used directly (as ofcourse this is an abstract implementaiton), the class which is implementing it has to implement\n * the necessary methods and gives its on visual.\n */\n\n/**\n * This class is used to create a generic layout. It can be extended to create layouts\n * of different types\n * @class GenericLayout\n */\nexport default class GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config configuration to be given for the layout\n * @param {Object} dependencies external dependencies.\n *\n * @memberof GenericLayout\n *\n */\n constructor (mountPoint, measurement, config, dependencies) {\n this._config = {};\n this._measurement = {};\n this._matrices = [];\n // External dependencies to be included for the layout. This includes the ext global dependencies like\n // smartlabel which has one single implementation of throughout the page or per isntance\n this._dependencies = dependencies;\n\n this.measurement(measurement);\n this.mountPoint(mountPoint);\n this.config(config);\n }\n\n /**\n * Returns an object which is used to recreate the layout.\n * @return {Object} the serialized components\n */\n serialize () {\n return {\n measurement: this.measurement(),\n config: this.config(),\n matrices: this.matrices()\n };\n }\n\n /**\n * Sets/Gets the config for the layout\n * @param {Object} config configuration for the layout\n * @return {Layout|Object} Gets the Config/ Returns this instance when set\n */\n config (config) {\n if (config) {\n this._config = mergeRecursive(this._config || {}, config);\n this._config.border.width = Math.max(0, this._config.border.width);\n return this;\n }\n return this._config;\n }\n\n /**\n * Sets/Gets the measurement for the layout\n * @param {Object} measurement measurement for the layout\n * @return {Layout|Object} Gets the measurement/ Returns this instance when set\n */\n measurement (measurement) {\n if (measurement) {\n this._measurement = mergeRecursive(this._measurement || {}, measurement);\n\n return this;\n }\n return this._measurement;\n }\n\n /**\n * Sets/Gets the matrices for the layout\n * @param {Object} matrices matrices for the layout\n * @return {Layout|Object} Gets the matrices/ Returns this instance when set\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = sanitizeIP.typeObj([TOP, CENTER, BOTTOM], matrices);\n\n return this;\n }\n return this._matrices;\n }\n\n /**\n * Sets/Gets the matrix for row\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n rowMatrix (matrix) {\n if (matrix) {\n this._rowMatrix = matrix;\n return this;\n }\n return this._rowMatrix;\n }\n\n /**\n * Sets/Gets the matrix for columns\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n columnMatrix (matrix) {\n if (matrix) {\n this._columnMatrix = matrix;\n return this;\n }\n return this._columnMatrix;\n }\n\n /**\n * Sets/Gets the matrix for value\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n centerMatrix (matrix) {\n if (matrix) {\n this._centerMatrix = matrix;\n return this;\n }\n return this._centerMatrix;\n }\n\n /**\n * Sets/Gets the mountPoint for the layout\n * @param {Object} mountPoint mountPoint for the layout\n * @return {Layout|Object} Gets the mountPoint/ Returns this instance when set\n */\n mountPoint (mountPoint) {\n if (mountPoint) {\n this._mountPoint = mountPoint;\n\n return this;\n }\n return this._mountPoint;\n }\n}\n","import * as FieldNames from '../enums/constants';\n\n/**\n * Default configuration of the layout\n * @return {Object} returns the default configuration\n */\nexport const DEFAULT_CONFIGURATION = {\n [FieldNames.BORDER]: {\n [FieldNames.STYLE]: 'solid',\n [FieldNames.COLOR]: '#d6d6d6',\n [FieldNames.WIDTH]: 2,\n [FieldNames.COLLAPSE]: true,\n [FieldNames.SPACING]: 0\n },\n [FieldNames.PAGINATION]: 'scroll',\n [FieldNames.BUFFER]: 20,\n [FieldNames.GUTTERSPACE]: { rows: [], columns: [] },\n [FieldNames.DISTRIBUTION]: { rows: [], columns: [] },\n [FieldNames.BREAK_PAGE]: { rows: [], columns: [] },\n [FieldNames.ROW_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_POINTER]: 0,\n [FieldNames.ROW_POINTER]: 0\n};\n\n/**\n * Default measurements for the layout\n * @return {Object} returns the default measurements\n */\nexport const DEFAULT_MEASUREMENTS = {\n [FieldNames.GRID_WIDTH]: 100,\n [FieldNames.GRID_HEIGHT]: 100,\n [FieldNames.UNIT_WIDTH]: 100,\n [FieldNames.UNIT_HEIGHT]: 100\n};\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n","/**\n * This file exports utility functions that are used across the layout module\n */\nimport { Symbols } from 'muze-utils';\nimport { PRIMARY, SECONDARY, HEIGHT, WIDTH } from '../enums/constants';\n\nconst nest = Symbols.nest;\n/**\n *\n *\n * @param {*} isTransposed\n *\n */\nconst getMeasureInfo = (isTransposed) => {\n if (isTransposed) {\n return {\n firstMeasure: HEIGHT,\n secondMeasure: WIDTH\n };\n }\n return {\n firstMeasure: WIDTH,\n secondMeasure: HEIGHT\n };\n};\n\n/**\n *\n *\n * @param {*} i\n * @param {*} page\n *\n */\nconst findInPage = (i, page) => {\n let count = 0;\n for (const x in page) {\n if (i < page[x]) {\n count = x;\n break;\n }\n }\n return count;\n};\n\n/**\n * Creates a single matrix from two matrices\n *\n * @param {Array} matrix Input matrix\n * @return {Array} Joined matrix\n * @memberof VisualMatrix\n */\nexport const combineMatrices = (matrix, config) => {\n const { isTransposed } = config;\n let joinedMatrix = matrix[0].length > 0 ? matrix[0] : matrix[1];\n if (isTransposed) {\n joinedMatrix = matrix[0].length > 0 ? [...matrix[0]] : [];\n joinedMatrix = matrix[1].length > 0 ? [...joinedMatrix, ...matrix[1]] : joinedMatrix;\n } else {\n joinedMatrix = joinedMatrix.map((row, rowIndex) => {\n let rowData = [];\n if (matrix[0].length > 0) {\n rowData = [...matrix[0][rowIndex]];\n }\n if (matrix[1].length > 0) {\n rowData = [...rowData, ...matrix[1][rowIndex]];\n }\n return rowData;\n });\n }\n return joinedMatrix;\n};\n\n/**\n * Creates a hirachical tree from the context\n *\n * @param {Object} context context for creating tree\n * @return {Object} nested tree\n */\nexport const createTree = (context) => {\n let matrixTree = {};\n let lastLevelKey = 0;\n let facet = PRIMARY;\n const nestFn = nest();\n const keys = [];\n const layoutMatrix = context._layoutMatrix;\n const primaryMatrix = context.primaryMatrix();\n const secondaryMatrix = context.secondaryMatrix();\n const { isTransposed, breakPage } = context.config();\n\n if (!isTransposed) {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix[0].length - 1; i++) {\n keys.push(i);\n }\n keys.push(primaryMatrix[0].length - 1);\n if (facet === SECONDARY || secondaryMatrix.length === 0) {\n lastLevelKey = primaryMatrix[0].length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const keyLength = primaryMatrix.length > 0 ? primaryMatrix[0].length : 0;\n for (let i = secondaryMatrix[0].length - 1; i > 0; i--) {\n keys.push(i + keyLength);\n }\n keys.push(keyLength);\n\n if (facet === PRIMARY) {\n lastLevelKey = keyLength;\n }\n } else {\n lastLevelKey = primaryMatrix.length > 0 ? primaryMatrix[0].length - 1 : 0;\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n matrixTree = nestFn.entries(layoutMatrix);\n } else {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix.length - 1; i++) {\n keys.push(i);\n }\n // if (facet === PRIMARY) {\n keys.push(primaryMatrix.length - 1);\n // } else {\n if (facet === SECONDARY) {\n lastLevelKey = primaryMatrix.length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const primaryMatrixLength = primaryMatrix.length;\n for (let i = secondaryMatrix.length - 1; i > 0; i--) {\n keys.push(i + primaryMatrixLength);\n }\n // if (facet === SECONDARY) {\n keys.push(primaryMatrixLength);\n // }\n if (facet === PRIMARY) {\n lastLevelKey = primaryMatrixLength;\n }\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n let newMatrix = [];\n newMatrix = layoutMatrix[0].map((col, colIndex) => layoutMatrix.map(row => row[colIndex]));\n matrixTree = nestFn.entries(newMatrix);\n }\n return { tree: matrixTree, lastLevelKey };\n};\n\n/**\n * Gives the min measues\n *\n * @param {boolean} isTransposed is column matrix\n * @param {Object} unitMeasures min measures to be given to cells\n * @return {Object} dimension min cell\n */\nexport const getMinMeasures = (isTransposed, unitMeasures) => {\n if (!isTransposed) {\n return {\n height: unitMeasures.height,\n width: 0\n };\n }\n return {\n height: 0,\n width: unitMeasures.width\n };\n};\n\n/**\n * Get the logical space from the tree\n *\n * @param {Node} item tree to be calculated\n * @param {number} measures width and height\n * @param {Array} minMeasures min measures for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} dimension\n */\nexport const getLogicalSpace = (item, measures, minMeasures, maxMeasure = []) => {\n const { firstMeasure, secondMeasure } = measures;\n let firstMeasureValue = 0;\n let secondMeasureValue = 0;\n item.values.forEach((valueArray) => {\n let fMeasure = 0;\n let sMeasure = 0;\n valueArray.forEach((placeholder, colIndex) => {\n placeholder.setAvailableSpace();\n const space = placeholder.getLogicalSpace();\n const minSecondMeasure = placeholder.getMinMeasures(minMeasures[secondMeasure]);\n\n sMeasure = Math.max(sMeasure, +space[secondMeasure], minSecondMeasure);\n maxMeasure[colIndex] = Math.max(maxMeasure[colIndex] || 0, space[firstMeasure]);\n fMeasure += +maxMeasure[colIndex];\n });\n secondMeasureValue += sMeasure;\n firstMeasureValue = Math.max(firstMeasureValue, fMeasure);\n item.space = {\n [secondMeasure]: Math.ceil(secondMeasureValue),\n [firstMeasure]: Math.ceil(firstMeasureValue)\n };\n });\n return {\n [secondMeasure]: secondMeasureValue,\n [firstMeasure]: firstMeasureValue\n };\n};\n\n/**\n * Computes the logical spcae taken by the matrix tree\n *\n * @param {*} [item={}] tree to be viewed\n * @param {boolean} [isTransposed=false] is column matrix\n * @param {*} unitMeasures min measues for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} logical space taken\n */\nexport const computeLogicalSpace = (item = {}, config, maxMeasures) => {\n const { isTransposed = false, unitMeasures } = config;\n const { firstMeasure, secondMeasure } = getMeasureInfo(isTransposed);\n const { values } = item;\n const minMeasures = getMinMeasures(isTransposed, unitMeasures);\n\n if (values[0].key) {\n const logicalSpace = { [firstMeasure]: 0, [secondMeasure]: 0 };\n\n values.forEach((valueItem) => {\n // Compute logical space for lowest level\n const space = computeLogicalSpace(valueItem, config, maxMeasures);\n // Set logical space for first measure\n logicalSpace[firstMeasure] = Math.max(logicalSpace[firstMeasure], space[firstMeasure],\n minMeasures[firstMeasure]);\n\n // Set logical space for second measure\n logicalSpace[secondMeasure] += +space[secondMeasure];\n });\n item.space = logicalSpace;\n return logicalSpace;\n }\n\n return getLogicalSpace(item, { firstMeasure, secondMeasure }, minMeasures, maxMeasures);\n};\n\n/**\n * Gives the space taken by a row\n *\n * @param {Array} row matrix array of rows\n * @return {Object} dimension of the row\n */\nexport const spaceTakenByRow = (row) => {\n let height = 0;\n let width = 0;\n row.forEach((col) => {\n const spaces = col.getLogicalSpace();\n height = Math.max(height, spaces.height);\n width += spaces.width;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Gives the space taken by a column\n *\n * @param {Array} matrix column matrix\n * @param {number} colIndex column index\n * @return {Object} dimension of the column\n */\nexport const spaceTakenByColumn = (matrix, colIndex) => {\n let height = 0;\n let width = 0;\n matrix.forEach((row) => {\n const col = row[colIndex];\n const spaces = col.getLogicalSpace();\n width = Math.max(width, spaces.width);\n height += spaces.height;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Creates different level matrices\n *\n * @param {Object} item matrix tree\n * @param {boolean} isTransposed is column matrix\n * @return {Object} matrix of each level\n */\nexport const createMatrixEachLevel = (item, isTransposed) => {\n if (item.values[0].key) {\n const arr = [];\n item.values.forEach((child) => {\n if (!isTransposed) {\n arr.push(...createMatrixEachLevel(child, isTransposed));\n } else {\n const eachLevel = createMatrixEachLevel(child, isTransposed);\n eachLevel.forEach((e, i) => {\n arr[i] = arr[i] || [];\n arr[i].push(...e);\n });\n }\n });\n item.matrix = arr;\n return arr;\n }\n if (!isTransposed) {\n item.matrix = item.values;\n } else {\n item.matrix = item.values[0].map((col, colIndex) => item.values.map(row => row[colIndex]));\n }\n return item.matrix;\n};\n\n/**\n * Breaks the matrix into two part\n *\n * @param {Array} matrix input matrix\n * @param {boolean} isTransposed is column matrix\n * @param {number} breakPointer point in matrix where it is to be broken\n * @return {Array} two broken matrix\n */\nexport const breakMatrix = (matrix, isTransposed, breakPointer) => {\n const primaryMatrix = [];\n const secondaryMatrix = [];\n if (isTransposed) {\n matrix.forEach((row, rowIndex) => {\n if (rowIndex >= breakPointer) {\n secondaryMatrix.push(row);\n } else {\n primaryMatrix.push(row);\n }\n });\n } else {\n matrix.forEach((row, rowIndex) => {\n row.forEach((column, columnIndex) => {\n if (columnIndex >= breakPointer) {\n secondaryMatrix[rowIndex] = secondaryMatrix[rowIndex] || [];\n secondaryMatrix[rowIndex].push(column);\n } else {\n primaryMatrix[rowIndex] = primaryMatrix[rowIndex] || [];\n primaryMatrix[rowIndex].push(column);\n }\n });\n });\n }\n return [primaryMatrix, secondaryMatrix];\n};\n\n/**\n * Distributed width returned\n *\n * @param {Object} context context for the width distibution\n * @return {number} distributed widths\n */\nexport const getDistributedWidth = (context, layoutConfig) => {\n const {\n availableWidth,\n width,\n row\n } = context;\n const {\n isDistributionEqual,\n isTransposed,\n distribution\n } = layoutConfig;\n let distSum = 0;\n if (distribution && distribution[0]) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n return row.map((col, colIndex) => {\n const space = col.getLogicalSpace().width;\n let distWidth = (space + (availableWidth - width) * (space / width));\n if (isTransposed) {\n if (distribution.length > 0) {\n distWidth = (availableWidth * distribution[colIndex] / distSum);\n } else if (isDistributionEqual || width === 0) {\n const rowLen = row.length;\n distWidth = (availableWidth / rowLen);\n }\n }\n return Math.floor(distWidth);\n });\n};\n\n/**\n * Distributeed heights returned\n *\n * @param {Object} context input for the height distribution\n * @return {Object} distribured heights\n */\nexport const getDistributedHeight = (context) => {\n let distSum = 0;\n let gutterSum = 0;\n let heightWithoutGutter = 0;\n const {\n isTransposed,\n distribution,\n availableHeight,\n height,\n isDistributionEqual,\n gutter,\n matrix,\n cIdx\n } = context;\n\n if (distribution && distribution[0] !== undefined) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n if (gutter && gutter[0] !== undefined) {\n gutterSum = gutter.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n heightWithoutGutter = availableHeight - Math.floor(availableHeight * gutterSum);\n\n const colLen = matrix.length;\n return matrix.map((row, rIdx) => {\n const col = row[cIdx];\n const space = col.getLogicalSpace().height;\n let distHeight = (space + (heightWithoutGutter - height) * (space / height));\n\n if (!isTransposed) {\n if (distribution.length > 0 && colLen === distribution.length) {\n distHeight = (heightWithoutGutter * distribution[rIdx] / distSum);\n } else if (isDistributionEqual || context.height === 0) {\n distHeight = (heightWithoutGutter / colLen);\n }\n }\n return Math.floor(distHeight);\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} beg\n * @param {*} end\n */\nexport const extraCellsRemover = (arr, beg, end) => arr.slice(beg, -end);\n\n/**\n * Creates matrix instancess\n *\n * @param {Array} [arr=[]] mutated arry\n * @param {number} depth depth of the tree\n * @param {Array} matrixInfo Details about the matrix(tree, etc) to be inserted\n * @param {boolean} layout Instance of layout\n */\nexport const createMatrixInstances = (arr = [], depth, matrixInfo, layout) => {\n const breakPointer = layout._breakPointer;\n const config = layout.config();\n const {\n isTransposed\n } = config;\n const {\n tree,\n layoutMatrix\n } = matrixInfo;\n\n if (depth === 0) {\n const brokenMatrix = breakMatrix(tree.matrix, isTransposed, breakPointer);\n arr.push({\n matrix: tree.matrix,\n primaryMatrix: brokenMatrix[0],\n secondaryMatrix: brokenMatrix[1],\n space: tree.space\n });\n return arr;\n }\n const nextLevel = depth - 1;\n tree.values.forEach((e) => {\n createMatrixInstances(arr, nextLevel, {\n tree: e,\n layoutMatrix\n }, layout);\n });\n return arr;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n maxMeasures: {},\n availableSpace: {},\n logicalSpace: {}\n};\n","import { PRIMARY } from '../enums/constants';\n/**\n *\n *\n */\nexport const defaultConfig = {\n distribution: [],\n classPrefix: 'muze',\n isDistributionEqual: true,\n unitMeasures: {\n height: 100,\n width: 100,\n border: 1\n },\n isTransposed: false,\n facet: PRIMARY,\n extraCellLengths: []\n};\n","import { mergeRecursive, generateGetterSetters, ERROR_MSG } from 'muze-utils';\nimport {\n createTree,\n combineMatrices,\n createMatrixInstances\n } from '../utils';\nimport { PROPS } from './props';\nimport { HEIGHT, WIDTH } from '../enums/constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n // Prepare matrices\n this._lastLevelKey = 0;\n this._primaryMatrix = matrix[0] || [];\n this._secondaryMatrix = matrix[1] || [];\n this._maxMeasures = [];\n this._availableSpace = {};\n\n // Store the config\n generateGetterSetters(this, PROPS);\n const defCon = Object.assign({}, this.constructor.defaultConfig());\n this.config(mergeRecursive(defCon, config));\n\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n computeViewableSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getPriorityDistribution () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @param {*} params\n * @returns\n * @memberof VisualMatrix\n */\n primaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._primaryMatrix;\n }\n\n secondaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._secondaryMatrix;\n }\n\n tree (...params) {\n if (params.length) {\n return this;\n }\n return this._tree;\n }\n\n static defaultConfig () {\n return defaultConfig;\n }\n\n createTree () {\n const { tree, lastLevelKey } = createTree(this);\n this._lastLevelKey = lastLevelKey;\n return tree;\n }\n\n /**\n * Returns the space taken by visual matrix\n *\n * @return {Object} space taken by the matrix\n * @memberof VisualMatrix\n */\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n /**\n * Sets the provied space to the visual matrix\n *\n * @param {number} width width provided\n * @param {number} height height provided\n * @memberof VisualMatrix\n */\n setAvailableSpace (width, height) {\n this.availableSpace({ width, height });\n const tree = this.tree();\n const heightMeasures = this.populateMaxMeasures(HEIGHT, tree);\n const widthMeasures = this.populateMaxMeasures(WIDTH, tree);\n const depth = this.calculateDepth(widthMeasures, heightMeasures);\n\n this.viewableMatrix = this.createViewPortMatrix(depth);\n this.viewableMeasures = this.redistributeSpaces(width, height);\n return this;\n }\n\n /**\n * Populate the max measures in the array\n *\n * @param {Array} measures array to be filled with max measures\n * @param {Object} matrixTree matrix tree of visual matrix\n * @param {number} measure width or height\n * @param {number} [depth=0] depth of the tree that to be calculated\n * @memberof VisualMatrix\n */\n populateMaxMeasures (type, matrixTree, depth = 0, measures = []) {\n measures[depth] = Math.max(measures[depth] || 0, matrixTree.space[type]);\n if (matrixTree.values) {\n const childDepth = depth + 1;\n matrixTree.values.forEach((child) => {\n if (child.space) {\n measures = this.populateMaxMeasures(type, child, childDepth, measures);\n }\n });\n }\n return measures;\n }\n\n /**\n * Gets the viewable measures for the current viewable matrix\n *\n * @return {Object} Set of viewable measures\n * @memberof VisualMatrix\n */\n getViewableSpaces () {\n return this.viewableMeasures;\n }\n\n /**\n * Returns the matrix that can be viewed in the current viewport\n *\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n getViewableMatrices () {\n return this.viewableMatrix;\n }\n\n /**\n * Creates the viewport that can be viewed together\n *\n * @param {number} depth maxDepth that can be viewed in the viewport\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n createViewPortMatrix (depth) {\n const arr = [];\n createMatrixInstances(arr, depth, this.removeExtraCells(), this);\n return arr;\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n combineMatrices,\n spaceTakenByColumn,\n getDistributedHeight,\n computeLogicalSpace,\n createMatrixEachLevel\n } from '../utils';\nimport { ROW_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class RowVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = (matrix[0].length > 0 ? matrix[0][0].length : 0);\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n\n // Create Tree\n this._tree = {\n key: ROW_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, false);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height\n } = measures;\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i };\n const { widths, rowHeights, columnWidths } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = [height, height];\n const columnMeasures = widths;\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n tree.matrix = extraCellsRemover(tree.matrix, begCellLen, endCellLen);\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n let remainingAvailWidth;\n let remainingWidth;\n let cWidths = [];\n let conditions = [];\n let maxPrioritySpace = 0;\n const {\n matrix,\n width: availableWidth,\n maxMeasures: maxWidths,\n maxWidth: currentWidth,\n height\n } = measures;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length ? this.primaryMatrix()[0].length : 0;\n\n const dist = [];\n\n remainingAvailWidth = availableWidth;\n remainingWidth = currentWidth;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n // divider = Math.min(2, matrixLen);\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n // divider = Math.min(1, matrixLen);\n }\n conditions.forEach((i) => {\n dist[i] = maxWidths[i];\n maxPrioritySpace += maxWidths[i];\n remainingAvailWidth -= dist[i];\n remainingWidth -= dist[i];\n });\n matrix[0].forEach((e, i) => {\n if (conditions.indexOf(i) === -1) {\n dist[i] = remainingAvailWidth * (maxWidths[i] / remainingWidth);\n }\n });\n matrix.forEach(row => row.forEach((col, cIdx) => {\n if (conditions.indexOf(cIdx) === -1) {\n col.setAvailableSpace(dist[cIdx], height);\n\n cWidths[cIdx] = Math.max(cWidths[cIdx] || 0, Math.floor(col.getLogicalSpace().width));\n } else {\n cWidths[cIdx] = 0;\n }\n }));\n\n const prioritySpace = availableWidth - cWidths.reduce((t, n) => t + n);\n if (prioritySpace < 0) {\n cWidths = cWidths.map(() => 0);\n } else {\n conditions.forEach((i) => {\n cWidths[i] = Math.floor(prioritySpace * (dist[i] / maxPrioritySpace || 1));\n });\n }\n return cWidths;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures, heightMeasures) {\n let i;\n const { height } = this.availableSpace();\n\n for (i = 0; i < heightMeasures.length; i++) {\n if (heightMeasures[i] <= height) break;\n }\n\n return Math.min(widthMeasures.length - 1, i);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n const maxMeasures = this.maxMeasures();\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n const logicalWidths = this.getPriorityDistribution({\n matrix: this._layoutMatrix,\n maxWidth,\n maxMeasures,\n width,\n height\n });\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths, logicalWidths };\n const measures = this.redistributeViewSpaces(options);\n maxWidths = measures.maxWidths;\n maxHeights = measures.maxHeights;\n });\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let cWidths = [];\n let rHeights = [];\n let mHeight = 0;\n const maxMeasures = this.maxMeasures();\n\n const {\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n } = this.config();\n const { matrix, height, maxHeights, maxWidths, logicalWidths } = measures;\n mHeight = spaceTakenByColumn(matrix, this._lastLevelKey).height;\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n measures.maxMeasures = maxMeasures;\n measures.maxWidth = maxWidth;\n if (maxWidth > 0) {\n cWidths = logicalWidths;\n } else {\n cWidths = maxMeasures.map(() => 0);\n }\n rHeights = getDistributedHeight({\n matrix,\n cIdx: this._lastLevelKey,\n height: mHeight,\n availableHeight: height,\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n });\n if (maxWidths.length > 0) {\n cWidths = cWidths.map((e, i) => Math.max(e, maxWidths[0][i] || 0));\n }\n maxWidths.push(cWidths);\n for (let x = 0; x < maxWidths.length; x++) {\n maxWidths[x] = cWidths;\n }\n maxHeights.push(rHeights);\n return { maxWidths, maxHeights };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = maxHeights[matrixIndex][rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth, colHeight - borderWidth);\n\n if (rIdx === 0 && cIdx < breakPointer) {\n columnWidths[0][cIdx] = colWidth;\n widths[0] = (widths[0] || 0) + colWidth;\n } else if (rIdx === 0 && cIdx >= breakPointer) {\n columnWidths[1][cIdx - breakPointer] = colWidth;\n widths[1] = (widths[1] || 0) + colWidth;\n }\n if (cIdx === this._lastLevelKey) {\n rowHeights[0][rIdx] = colHeight;\n rowHeights[1][rIdx] = colHeight;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n getDistributedWidth,\n spaceTakenByRow,\n createMatrixEachLevel,\n computeLogicalSpace\n } from '../utils';\nimport { COLUMN_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class ColumnVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = matrix[0].length;\n\n // Create Tree\n this._tree = {\n key: COLUMN_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, true);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height,\n width\n } = measures;\n\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i, height };\n const {\n heights,\n rowHeights,\n columnWidths\n } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = heights;\n const columnMeasures = [width, width];\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n\n tree.matrix = tree.matrix.map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n const {\n height,\n maxHeights\n } = measures;\n let remainingHeight = height;\n let heightDist = [];\n let conditions = [];\n let divider = 2;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n divider = 2;\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n divider = 1;\n }\n maxHeights.forEach((heights, index) => {\n if (conditions.indexOf(index) === -1) {\n heightDist[index] = heights;\n remainingHeight -= heights;\n }\n });\n if (remainingHeight < 0) {\n heightDist = heightDist.map(() => 0);\n } else {\n conditions.forEach((condition) => {\n heightDist[condition] = Math.min(maxHeights[condition], (remainingHeight) / divider);\n });\n }\n return heightDist;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures) {\n let j;\n const { width } = this.availableSpace();\n\n for (j = 0; j < widthMeasures.length; j++) {\n if (widthMeasures[j] <= width) break;\n }\n return Math.min(widthMeasures.length - 1, j);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths };\n const maxMeasures = this.redistributeViewSpaces(options);\n maxWidths = maxMeasures.maxWidths;\n maxHeights = maxMeasures.maxHeights;\n });\n\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space column wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let rHeights = [];\n const {\n matrix,\n width,\n maxHeights,\n maxWidths\n } = measures;\n const borderWidth = this.config().unitMeasures.border;\n\n const mWidth = spaceTakenByRow(matrix[this._lastLevelKey]).width;\n const cWidths = getDistributedWidth({\n row: matrix[this._lastLevelKey],\n width: mWidth,\n availableWidth: width\n }, this.config());\n\n matrix.forEach((row, rIdx) => row.forEach((col, cIdx) => {\n const oldLogicalSpace = col.getLogicalSpace();\n\n col.setAvailableSpace(cWidths[cIdx] - borderWidth, oldLogicalSpace.height);\n\n rHeights[rIdx] = Math.max(rHeights[rIdx] || 0, Math.floor(col.getLogicalSpace().height));\n }));\n if (maxHeights.length > 0) {\n rHeights = rHeights.map((e, i) => Math.max(e, maxHeights[0][i]));\n }\n maxHeights.push(rHeights);\n for (let x = 0; x < maxHeights.length; x++) {\n maxHeights[x] = rHeights;\n }\n maxWidths.push(cWidths);\n return { maxHeights, maxWidths };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, height, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n const heightDistribution = this.getPriorityDistribution({ height, maxHeights: maxHeights[0] || [] });\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = heightDistribution[rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth - borderWidth, colHeight);\n\n if (cIdx === 0 && rIdx < breakPointer) {\n rowHeights[0][rIdx] = colHeight;\n heights[0] = (heights[0] || 0) + colHeight;\n } else if (cIdx === 0 && rIdx >= breakPointer) {\n rowHeights[1][rIdx - breakPointer] = colHeight;\n heights[1] = (heights[1] || 0) + colHeight;\n }\n if (rIdx === this._lastLevelKey) {\n columnWidths[0][cIdx] = colWidth;\n columnWidths[1][cIdx] = colWidth;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import {\n HEIGHT, WIDTH, COLUMN, ROW, HORIZONTAL, VERTICAL, HOLISTIC,\n MAX_WIDTH_AVAIL_FOR_COL_MATRIX, COLUMN_MATRIX, MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX, ROW_MATRIX, SCROLL\n} from '../enums/constants';\n\n/**\n * Gets measurement for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @return {Object} Logical height/width of the matrix\n */\nexport function getMatrixMeasurement (matrix, type) {\n if (matrix) {\n return matrix.getLogicalSpace()[type];\n }\n return 0;\n}\n\n/**\n * Sets available space for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @param {number} value Value of measurement\n */\nexport function setMatrixMeasurement (matrix, type, value) {\n if (matrix) {\n const spaces = matrix.getLogicalSpace();\n if (value && spaces[type] !== value) {\n type === HEIGHT ? matrix.setAvailableSpace(spaces.width, value) :\n matrix.setAvailableSpace(value, spaces.height);\n }\n }\n}\n\nconst setAvailableSpace = (matrix, widths, heights) => {\n matrix.forEach((row, rIdx) => {\n row.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(widths[cIdx], heights[rIdx]);\n });\n });\n};\n\nconst setViewSpaces = (layout, pointerType, viewSpaces) => {\n let pointer = layout.config()[`${pointerType}Pointer`];\n if (viewSpaces.length - 1 < pointer) {\n pointer = 0;\n layout.config({ [`${pointerType}Pointer`]: pointer });\n }\n return pointer;\n};\n\nconst paginationDetailsMap = {\n column: {\n maxMeasure: MAX_WIDTH_AVAIL_FOR_COL_MATRIX,\n matrix: COLUMN_MATRIX,\n measureType: WIDTH,\n scrollType: HORIZONTAL\n },\n row: {\n maxMeasure: MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX,\n matrix: ROW_MATRIX,\n measureType: HEIGHT,\n scrollType: VERTICAL\n }\n};\n\n/**\n * This method provides the required width/height in the different pagination stages.\n * If the pagination is holistic, then only the max width/height will be provided for layouting\n * If scroll is enabled, then the entire width/height shall be provided for layouting\n * Note: width is required for scrolling the columns while height is required for scrolling rows\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {Object} measureDetails different measure details for row/column\n * @param {number} maxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst getMatrixMeasureForPagination = (layout, measureDetails, maxMeasure, buffer) => {\n const {\n pagination\n } = layout.config();\n const {\n matrix,\n measureType,\n scrollType\n } = measureDetails;\n\n switch (pagination) {\n case HOLISTIC:\n return maxMeasure;\n default: {\n const actualMeasure = getMatrixMeasurement(layout[matrix](), measureType) + buffer;\n\n if (actualMeasure > maxMeasure) {\n layout.scrollInfo({ [scrollType]: true });\n }\n return Math.max(maxMeasure, actualMeasure);\n }\n }\n};\n\n/**\n * This method uses the getMatrixMeasureForPagination function to calculate maximum measure\n * depending on the layouting algorithm used\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {string} matrixType row/column\n * @param {number} relatedMaxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst paginationMeasureGetter = (layout, matrixType, relatedMaxMeasure, buffer) =>\n getMatrixMeasureForPagination(layout, paginationDetailsMap[matrixType], relatedMaxMeasure, buffer);\n\nconst getMatrixWidthDetails = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const {\n width\n } = layout.measurement();\n const {\n border,\n buffer\n } = layout.config();\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get width of row matrix\n const rowMatrixWidth = getMatrixMeasurement(rowMatrix, WIDTH);\n\n // Get maximum width allowed for the row matrix\n const maxRowMatrixWidth = Math.min(rowMatrixWidth + buffer, width / 2);\n\n // Get maximum width available for the column matrix\n const maxWidthAvailableForColumnMatrix = width - maxRowMatrixWidth - borderWidth;\n\n // Set width for column matrix\n const columnMatrixWidth = paginationMeasureGetter(layout, COLUMN, maxWidthAvailableForColumnMatrix, 0);\n\n return {\n rowMatrixWidth,\n maxRowMatrixWidth,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n\nconst getHeightRequiredByColMatrix = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const columnMatrix = layout.columnMatrix();\n\n // Get maximum allowed height for colum matrix\n const maxColumnMatrixHeight = Math.min(columnMatrix.getLogicalSpace().height, height / 2);\n\n // Set the computed width and max height to column matrix to determine the actual height\n // that will be taken by the column matrix\n columnMatrix.setAvailableSpace(columnMatrixWidth, maxColumnMatrixHeight);\n\n // Get the set of pages column view\n const columnViewPages = columnMatrix.getViewableSpaces();\n\n // Figuring out total space needed by current view space\n const columnViewSpace = columnViewPages[layout.config().columnPointer];\n\n // Getting height of column matrix\n const columnMatrixHeight = columnViewSpace.height.primary + columnViewSpace.height.secondary;\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight\n };\n};\n\nconst getMatrixHeightDetails = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const {\n buffer\n } = layout.config();\n\n // Get actual height required by column matrix\n const { columnMatrixHeight, maxColumnMatrixHeight } = getHeightRequiredByColMatrix(layout, columnMatrixWidth);\n\n // Based on column height, compute max height available for row matrix\n const maxHeightAvailableForRowMatrix = height - Math.min(maxColumnMatrixHeight, columnMatrixHeight);\n\n // Get height for row matrix\n const rowMatrixHeight = paginationMeasureGetter(layout, ROW, maxHeightAvailableForRowMatrix, buffer);\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n };\n};\n\nconst setValueMatrixMeasurements = (layout, rowViewableSpaces, columnViewableSpaces) => {\n const centerMatrix = layout.centerMatrix();\n\n const {\n border\n } = layout.config();\n const matrices = layout.matrices();\n const {\n top,\n bottom\n } = matrices;\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get the heights for each cell in the row matrix\n const rowHeights = [].concat(...rowViewableSpaces.map(e => e.rowHeights.primary));\n\n // Get the widths for each of the row matrix cells(primary and secondary)\n const rowWidthsPrimary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.primary));\n const rowWidthsSecondary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.secondary));\n\n // Get the widths for each cell in the column matrix\n const columnWidths = [].concat(...columnViewableSpaces.map(e => e.columnWidths.primary));\n\n // Get the widths for each of the column matrix cells(primary and secondary)\n const columnHeightsPrimary = columnViewableSpaces[0].rowHeights.primary;\n const columnHeightsSecondary = [].concat(...columnViewableSpaces.map(e => e.rowHeights.secondary));\n\n // Setting the available space for each cell in the centre matrix computed throught the row and\n // column matrices\n centerMatrix.forEach((matrix, rIdx) => {\n matrix.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(columnWidths[cIdx] - borderWidth, rowHeights[rIdx] - borderWidth);\n });\n });\n\n // Set the heights and widths for the corner matrices namely:\n // TOP_LEFT\n setAvailableSpace(top[0], rowWidthsPrimary, columnHeightsPrimary);\n // TOP_RIGHT\n setAvailableSpace(top[2], rowWidthsSecondary, columnHeightsPrimary);\n // BOTTOM_LEFT\n setAvailableSpace(bottom[0], rowWidthsPrimary, columnHeightsSecondary);\n // BOTTOM_RIGHT\n setAvailableSpace(bottom[2], rowWidthsSecondary, columnHeightsSecondary);\n};\n\nconst bufferCondition = {\n isScroll: true,\n pagination: SCROLL\n};\n\nconst getBufferFromCondition = (layout, type) => {\n const scrollInfo = layout.scrollInfo();\n const {\n pagination\n } = layout.config();\n\n const currentBufferType = {\n pagination,\n isScroll: scrollInfo[type]\n };\n\n return Object.keys(bufferCondition).every(e => bufferCondition[e] === currentBufferType[e]);\n};\n\nconst getActualBufferFromConfig = (layout) => {\n const {\n buffer\n } = layout.config();\n const [horizontalBuffer, verticalBuffer] = [HORIZONTAL, VERTICAL].map((type) => {\n if (getBufferFromCondition(layout, type)) {\n return buffer;\n }\n return 0;\n });\n\n return {\n horizontalBuffer,\n verticalBuffer\n };\n};\n/**\n * Computes the measurements of space for all matrices in the\n * layout\n *\n * @param {Object} layout Instance of grid layout\n * @return {Object} set of measurements for the layout\n */\nexport const computeLayoutMeasurements = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n\n // Compute the widths of the row and column matrices\n const {\n rowMatrixWidth,\n maxRowMatrixWidth,\n maxWidthAvailableForColumnMatrix,\n columnMatrixWidth\n } = getMatrixWidthDetails(layout);\n\n // Compute the heights of the row and column matrices\n const {\n columnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n } = getMatrixHeightDetails(layout, columnMatrixWidth);\n\n const {\n horizontalBuffer,\n verticalBuffer\n } = getActualBufferFromConfig(layout);\n rowMatrix.setAvailableSpace(maxRowMatrixWidth - verticalBuffer, rowMatrixHeight - horizontalBuffer);\n\n // Get row and columns viewable spaces\n const rowViewableSpaces = rowMatrix.getViewableSpaces();\n const columnViewableSpaces = columnMatrix.getViewableSpaces();\n\n // Set view spaces for row and columns\n setViewSpaces(layout, ROW, rowViewableSpaces);\n setViewSpaces(layout, COLUMN, columnViewableSpaces);\n\n // Set measures for each cell of the value matrix\n setValueMatrixMeasurements(layout, rowViewableSpaces, columnViewableSpaces);\n\n return {\n rowMatrixHeight: rowMatrixHeight - horizontalBuffer,\n rowMatrixWidth: rowMatrixWidth - verticalBuffer,\n maxHeightAvailableForRowMatrix: maxHeightAvailableForRowMatrix - horizontalBuffer,\n\n columnMatrixHeight,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n","/**\n * Gets view matrices based on current pointers for row and column\n *\n * @param {Object} layout instance of layout\n * @param {number} rowPointer current row pointer\n * @param {number} columnPointer current column pointer\n * @return {Object} returns the view matrix and its relevant information\n */\nexport const getViewMatrices = (layout, rowPointer, columnPointer) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const centerMatrix = layout.centerMatrix();\n const matrices = layout.matrices();\n const rowMatrices = rowMatrix.getViewableMatrices();\n const columnMatrices = columnMatrix.getViewableMatrices();\n const centralMatrixPointer = {\n row: 0,\n column: 0\n };\n\n for (let i = rowPointer - 1; i >= 0; i--) {\n const length = Math.max(rowMatrices[i].primaryMatrix.length,\n rowMatrices[i].secondaryMatrix.length);\n centralMatrixPointer.row += length;\n }\n /* istanbul ignore next */\n for (let i = columnPointer - 1; i >= 0; i--) {\n const matrix = columnMatrices[i];\n const { primaryMatrix, secondaryMatrix } = matrix;\n const length = Math.max(primaryMatrix[0] ? primaryMatrix[0].length : 0,\n secondaryMatrix[0] ? secondaryMatrix[0].length : 0);\n centralMatrixPointer.column += length;\n }\n\n matrices.top[1] = columnMatrices[columnPointer].primaryMatrix;\n matrices.bottom[1] = columnMatrices[columnPointer].secondaryMatrix;\n\n matrices.center[0] = rowMatrices[rowPointer].primaryMatrix;\n matrices.center[2] = rowMatrices[rowPointer].secondaryMatrix;\n\n const rowMatrixLen = Math.max(matrices.center[0].length, matrices.center[2].length);\n /* istanbul ignore next */\n const columnMatrixLen = Math.max(matrices.top[1][0] ? matrices.top[1][0].length : 0, matrices.bottom[1][0] ?\n matrices.bottom[1][0].length : 0);\n matrices.center[1] = centerMatrix.slice(centralMatrixPointer.row, centralMatrixPointer.row + rowMatrixLen)\n .map(matrix => matrix.slice(centralMatrixPointer.column, centralMatrixPointer.column + columnMatrixLen));\n\n return {\n matrices,\n rowPages: rowMatrices.length,\n columnPages: columnMatrices.length\n };\n};\n\nconst measureSum = measureArr => measureArr.reduce((total, measure) => total + measure, 0);\n/**\n * Returns measurements of the cells of the current matrix\n *\n * @param {Object} layout instance of layout\n * @return {Object} returns the measurements for current view matrix\n */\nexport const getViewMeasurements = (layout, maxRowHeight, maxColWidth) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const {\n columnPointer,\n rowPointer\n } = layout.config();\n\n const rowSpaces = rowMatrix.getViewableSpaces()[rowPointer];\n const colSpaces = columnMatrix.getViewableSpaces()[columnPointer];\n\n const {\n rowHeights,\n width: rowMatrixWidth\n } = rowSpaces;\n const {\n columnWidths,\n height: columnMatrixHeight\n } = colSpaces;\n\n const { primary: leftWidth, secondary: rightWidth } = rowMatrixWidth;\n const { primary: topHeight, secondary: bottomHeight } = columnMatrixHeight;\n\n const centerHeight = measureSum(rowHeights.primary);\n const centerWidth = measureSum(columnWidths.primary);\n const viewWidth = [leftWidth, Math.min(centerWidth, maxColWidth), rightWidth];\n const viewHeight = [topHeight, Math.min(centerHeight, maxRowHeight), bottomHeight];\n\n return {\n viewWidth,\n viewHeight,\n actualCenterMeasures: {\n height: centerHeight,\n width: centerWidth\n },\n totalMeasures: {\n width: measureSum(viewWidth),\n height: measureSum(viewHeight)\n },\n unitHeights: rowHeights,\n unitWidths: columnWidths\n };\n};\n","/**\n * This file declares a table that can be extended to create a Datagrid, crosstab\n * and man other visualzations that require a tabular structure.\n */\n\nimport { getUniqueId, mergeRecursive } from 'muze-utils';\nimport GenericLayout from '../generic-layout';\nimport { DEFAULT_CONFIGURATION, DEFAULT_MEASUREMENTS } from './defaults';\nimport { generateVisualMatrices } from './layout-helper';\nimport { computeLayoutMeasurements } from './computations';\nimport { getViewMeasurements, getViewMatrices } from './view-info-getter';\n/**\n * This class is used to create a tabular structure that\n * can house charts and values.\n *\n * @class GridLayout\n */\nexport default class GridLayout extends GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} matrices Set of upto 9 matrices containing the cells to be rendered\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config external configurations.\n * @memberof GenericLayout\n */\n constructor (matrices, mountPoint, measurement, config) {\n super(mountPoint, measurement, config);\n this.matrices(matrices);\n this.config(this.constructor.defaultConfig());\n this._layoutId = getUniqueId();\n this._scrollInfo = { horizontal: false, vertical: false };\n }\n\n static defaultViewInfo () {\n return Object.assign({}, {\n layoutDimensions: {\n border: this.defaultConfig().border,\n viewHeight: [0, 0, 0],\n viewWidth: [0, 0, 0]\n },\n viewMatricesInfo: {\n columnPages: 0,\n rowPages: 0,\n matrices: { top: [], center: [], bottom: [] }\n }\n });\n }\n\n /**\n * Returns initial set of measurements for the grid layout\n *\n * @static\n * @return {Object} Returns initial set of measurements\n * @memberof GridLayout\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENTS;\n }\n\n /**\n * Returns initialconfiguration for grid layout\n *\n * @static\n * @return {Object} Returns initial configuration for grid layout\n * @memberof GridLayout\n */\n static defaultConfig () {\n return DEFAULT_CONFIGURATION;\n }\n\n /**\n * This function is used to return an instance of GridLayout\n *\n * @return {GridLayout} Instance of grid layout.\n * @static\n * @memberof GridLayout\n */\n static create () {\n return new GridLayout(null, null, this.defaultMeasurement(), this.defaultConfig());\n }\n\n /**\n * Sets/Gets the matrices for the layout\n *\n * @param {Array} matrices Set of matrices\n * @return {Object} Getter/Setter\n * @memberof GridLayout\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = generateVisualMatrices(this, matrices);\n return this;\n }\n return super.matrices(matrices);\n }\n\n /**\n * Triggers the computations for the layout based on the matrices available\n * This causes a reflow in the entire layout system.\n *\n * @return {Object} Layout instance\n * @memberof GridLayout\n */\n triggerReflow () {\n this.scrollInfo({ horizontal: false, vertical: false });\n const {\n maxHeightAvailableForRowMatrix,\n maxWidthAvailableForColumnMatrix\n } = computeLayoutMeasurements(this);\n\n this.setViewInformation(maxHeightAvailableForRowMatrix, maxWidthAvailableForColumnMatrix);\n return this;\n }\n\n gotoPage (type, pageNumber) {\n const pageType = type.toLowerCase();\n const { viewMatricesInfo } = this.viewInfo();\n const totalPages = viewMatricesInfo[`${pageType}Pages`];\n const pointer = Math.min(Math.max(1, pageNumber), totalPages);\n this.config({\n [`${pageType}Pointer`]: pointer - 1\n });\n this.setViewInformation();\n this.renderGrid();\n return this;\n }\n\n pages (type) {\n const { viewMatricesInfo } = this.viewInfo();\n const pageType = type.toLowerCase();\n return {\n totalPages: viewMatricesInfo[`${pageType}Pages`],\n currentPage: this.config()[`${pageType}Pointer`] + 1\n };\n }\n\n viewInfo (...viewInfo) {\n if (viewInfo.length) {\n this._viewInfo = viewInfo[0];\n return this;\n }\n return this._viewInfo;\n }\n\n scrollInfo (...scrollInfo) {\n if (scrollInfo.length) {\n this._scrollInfo = mergeRecursive(this._scrollInfo, scrollInfo[0]);\n return this;\n }\n return this._scrollInfo;\n }\n\n /**\n *\n *\n * @returns\n * @memberof GridLayout\n */\n setViewInformation (maxRowHeight, maxColWidth) {\n const {\n rowPointer,\n columnPointer,\n border\n } = this.config();\n const viewMatricesInfo = getViewMatrices(this, rowPointer, columnPointer);\n const layoutDimensions = getViewMeasurements(this, maxRowHeight, maxColWidth);\n layoutDimensions.border = border;\n this.viewInfo({\n viewMatricesInfo,\n layoutDimensions\n });\n return this;\n }\n}\n","import RowMatrix from '../visual-matrix/row-matrix';\nimport ColumnMatrix from '../visual-matrix/column-matrix';\n\nexport const generateVisualMatrices = (context, matrices) => {\n // Set of matrices for layout is generated starting with the left matrix\n let leftMatrix = [];\n let rightMatrix = [];\n let topMatrix = [];\n let bottomMatrix = [];\n let begColCells;\n let endColCells;\n const {\n isRowSizeEqual,\n isColumnSizeEqual,\n gutterSpace,\n distribution,\n border,\n breakPage,\n priority\n } = context.config();\n const {\n minUnitHeight,\n minUnitWidth\n } = context.measurement();\n const { top, center, bottom } = matrices;\n const [topLeft, topColumns, topRight] = top;\n const [leftRows, valueMatrix, rightRows] = center;\n const [bottomLeft, bottomColumns, bottomRight] = bottom;\n\n if (leftRows.length > 0) {\n // If no left matrix is present, context will be empty\n leftMatrix = [...topLeft, ...leftRows, ...bottomLeft];\n }\n if (rightRows.length > 0) {\n // If no right matrix is present, context will be empty\n rightMatrix = [...topRight, ...rightRows, ...bottomRight];\n }\n if (topColumns.length > 0 && topColumns[0].length > 0) {\n // If no top matrix is present, context will be empty\n topMatrix = topColumns.map((d, i) => [...topLeft[i], ...d, ...topRight[i]]);\n }\n if (bottomColumns.length > 0 && bottomColumns[0].length > 0) {\n // If no bottom matrix is present, context will be empty\n bottomMatrix = bottomColumns.map((d, i) => [...bottomLeft[i], ...d, ...bottomRight[i]]);\n }\n\n context.rowMatrix(new RowMatrix([leftMatrix, rightMatrix], {\n isDistributionEqual: isRowSizeEqual,\n distribution: distribution.rows,\n gutter: gutterSpace.rows,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.row,\n breakPage: breakPage.rows.map(e => e + Math.max(topLeft.length, topRight.length)),\n extraCellLengths: [topLeft.length, bottomLeft.length]\n }));\n\n if (topLeft.length > 0) {\n begColCells = topLeft[0].length;\n } else {\n begColCells = bottomLeft.length > 0 ? bottomLeft[0].length : 0;\n }\n\n if (topRight.length > 0) {\n endColCells = topRight[0].length;\n } else {\n endColCells = bottomRight.length > 0 ? bottomRight[0].length : 0;\n }\n\n context.columnMatrix(new ColumnMatrix([topMatrix, bottomMatrix], {\n isDistributionEqual: isColumnSizeEqual,\n distribution: distribution.columns,\n gutter: gutterSpace.columns,\n isTransposed: true,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.col,\n breakPage: breakPage.columns,\n extraCellLengths: [begColCells, endColCells]\n }));\n context.centerMatrix(valueMatrix);\n\n return matrices;\n};\n","import {\n TOP, BOTTOM, LEFT, RIGHT, CENTER, BLANK_BORDERS, COLUMN, ROW,\n VIEW_INDEX, ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, MIDDLE, NO_BORDERS\n} from '../enums/constants';\n\nconst borderMap = {\n [`${TOP}-${LEFT}`]: NO_BORDERS,\n [`${TOP}-${MIDDLE}`]: COLUMN,\n [`${TOP}-${RIGHT}`]: NO_BORDERS,\n [`${CENTER}-${LEFT}`]: ROW,\n [`${CENTER}-${MIDDLE}`]: CENTER,\n [`${CENTER}-${RIGHT}`]: ROW,\n [`${BOTTOM}-${LEFT}`]: NO_BORDERS,\n [`${BOTTOM}-${MIDDLE}`]: COLUMN,\n [`${BOTTOM}-${RIGHT}`]: NO_BORDERS\n};\n\nconst applySpecificBorder = (cells, color, type, style) => {\n cells.style(`border-${type}`, `${style} ${color}`);\n};\n\nconst specificBorderApplier = (borderTypes, showBorders, cells, borderInfo) => {\n const {\n color,\n width,\n style\n } = borderInfo;\n const borderStyle = `${width}px ${style}`;\n\n borderTypes.forEach((borderType) => {\n applySpecificBorder(cells, showBorders[borderType] ? color : BLANK_BORDERS, borderType, borderStyle);\n });\n};\n\nconst borderApplier = (cells, borderInfo) => {\n const {\n showRowBorders,\n showColBorders,\n showValueBorders\n } = borderInfo;\n return {\n row: () => specificBorderApplier([TOP, BOTTOM], showRowBorders, cells, borderInfo),\n column: () => specificBorderApplier([LEFT, RIGHT], showColBorders, cells, borderInfo),\n center: () => specificBorderApplier([LEFT, RIGHT, TOP, BOTTOM], showValueBorders, cells, borderInfo)\n };\n};\n\nexport const applyBorders = (cells, border, row, column) => {\n const borderApplierFn = borderApplier(cells, border);\n const borderMapVal = borderMap[`${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`];\n if (borderMapVal) {\n borderApplierFn[borderMapVal]();\n }\n};\n","import { selectElement } from 'muze-utils';\nimport {\n TOP, BOTTOM, ROW_SPAN, COL_SPAN, CENTER, ROW, COLUMN\n} from '../enums/constants';\n\nconst orderMaker = arr => Array.from(Array(arr.length).keys());\n\nconst nestByStack = (stack, updateArr, optionalParams = {}) => {\n let {\n order,\n keyFn\n } = optionalParams;\n const arr = updateArr.slice();\n const currStack = stack.slice();\n const prevStack = currStack.slice();\n // Order in which element are to be checked for nesting, default normal looping\n // Order is always in the order of nest, i.e., left to right\n order = order || Array.from(Array(arr.length).keys());\n\n // Key function, if array of objects\n keyFn = keyFn || (v => v);\n\n // Return same array if stack is empty\n if (currStack.length === 0) {\n const newArr = [];\n order.forEach((e) => {\n newArr.push(arr[e]);\n });\n return { prevStack, currStack: arr, arr: newArr };\n }\n\n let arrVal = '';\n let stackVal = '';\n const newArr = [];\n\n // Loop in order\n for (let i = order.length - 1; i >= 0; i--) {\n // Get current element index from the order given\n const currElemIndex = order[i];\n\n // Crete a hashmap for the hierarchy by joining strings of the array for both stack and input array\n arrVal += keyFn(arr[currElemIndex]);\n stackVal += keyFn(currStack[currElemIndex]);\n\n // If the current value and value in stack is same, convert it to null\n if (arrVal === stackVal) {\n newArr[currElemIndex] = null;\n } else {\n stackVal = '';\n // Loop from the current index in order to the last element in order to change the\n // whole hierarchy\n for (let j = i; j < order.length; j++) {\n const newElem = order[j];\n const arrElem = arr[newElem];\n\n newArr[newElem] = arrElem;\n\n // Reset stack to new stack\n currStack[newElem] = arrElem;\n stackVal = arrVal;\n }\n }\n }\n const returnArr = [];\n order.forEach((e) => {\n returnArr.push(newArr[e]);\n });\n return { prevStack, currStack, arr: returnArr };\n};\n\nconst spanCalculator = (colData, colIdx, matrix, rIdx) => {\n // if data is not header cell then rowspan\n // has to be 1\n if (!colData) {\n return () => null;\n }\n\n const conditions = {\n row: count => matrix[rIdx + count] && matrix[rIdx + count][colIdx],\n column: count => matrix[rIdx][colIdx + count]\n };\n\n return (type) => {\n let count = 1;\n let isNull = false;\n\n while (!isNull) {\n if (conditions[type](count) === null) {\n count += 1;\n } else {\n isNull = true;\n }\n }\n return count;\n };\n};\n\nconst maskCreator = (matrix, order) => ({\n row: () => {\n let stack = [];\n return matrix.map((e) => {\n const {\n currStack,\n arr\n } = nestByStack(stack, e, { keyFn: val => val.valueOf(), order });\n\n stack = currStack;\n return arr;\n });\n },\n column: () => {\n let stack = [];\n const viewMatrix = [];\n matrix.length && matrix[0].forEach((cell, colIndex) => {\n const hierarchy = [];\n matrix.forEach((row) => {\n hierarchy.push(row[colIndex]);\n });\n const {\n currStack,\n arr\n } = nestByStack(stack, hierarchy, { keyFn: val => val.valueOf(), order });\n stack = currStack;\n\n matrix.forEach((row, rowIndex) => {\n viewMatrix[rowIndex] = viewMatrix[rowIndex] || [];\n viewMatrix[rowIndex][colIndex] = arr[rowIndex];\n });\n });\n return viewMatrix;\n }\n});\n\nconst spanGenerator = viewMatrix => ({\n row: () => {\n const spans = [];\n viewMatrix.forEach((row, ridx) => {\n spans[ridx] = spans[ridx] || [];\n row.forEach((col, i) => {\n if (viewMatrix[ridx][i]) {\n const currSpan = spanCalculator(col, i, viewMatrix, ridx)('row');\n currSpan && spans[ridx].push(currSpan);\n }\n });\n });\n return spans;\n },\n column: () => viewMatrix.map((row, ridx) => row.map((col, i) => spanCalculator(col, i, viewMatrix, ridx)('column'))\n .filter(col => col !== null))\n});\n\nconst getOrder = () => ({\n row: matrix => orderMaker(matrix[0]),\n column: matrix => orderMaker(matrix)\n});\n\nconst matrixSpanGeneratorMap = {\n [`${TOP}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${BOTTOM}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${CENTER}-0`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n },\n [`${CENTER}-2`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n }\n};\n\nconst matrixSpanGenerator = (type) => {\n const generator = matrixSpanGeneratorMap[type];\n if (generator) {\n return generator;\n }\n return {\n orderGetter: () => null,\n viewMatrixMaker: matrix => () => matrix,\n spanMaker: () => () => null\n };\n};\n\n/**\n * This function is used to set the col and row spans\n * for the matrices based on repeated/hierarchichal data\n *\n * @export\n * @param {Array} matrix The 2d array for which filtering is to be done\n * @param {string} type Type of array (center, top, bottom)\n * @param {number} index Index of array in the row\n * @return {Object} containing the view matrix and their spans\n */\nexport function cellSpanMaker (matrix, type, index) {\n let spans = null;\n let viewMatrix = matrix;\n const {\n orderGetter,\n viewMatrixMaker,\n spanMaker\n } = matrixSpanGenerator(`${type}-${index}`);\n\n if (matrix.length) {\n const order = orderGetter(matrix);\n viewMatrix = viewMatrixMaker(matrix, order)();\n spans = spanMaker(viewMatrix)();\n }\n return { viewMatrix, spans };\n}\n\nconst spaceAllocationDueToSpan = (span = 1, placeholder, config, index) => {\n const height = placeholder.availHeight();\n const width = placeholder.availWidth();\n const borderWidth = config.border.width;\n const { unitWidths } = config.dimensions;\n const { col } = index;\n\n return {\n [ROW_SPAN] () {\n placeholder.setAvailableSpace(width, height * span);\n if (span === 1) {\n selectElement(this).style('height', `${height * span + borderWidth}px`);\n }\n },\n [COL_SPAN] () {\n const primaryUnitWidth = unitWidths.primary[col];\n if (span > 1) {\n let cumulativeWidth = 0;\n for (let i = col; i < col + span; i++) {\n cumulativeWidth += unitWidths.primary[i] - borderWidth;\n }\n placeholder.setAvailableSpace(cumulativeWidth + borderWidth, height);\n } else if (primaryUnitWidth) {\n placeholder.setAvailableSpace(primaryUnitWidth - borderWidth, height);\n }\n selectElement(this).style('height', `${height}px`);\n }\n };\n};\n\nconst spanApplier = (cells, spans, config, type) => {\n let cellCounter = 0;\n cells.attr(type, function (cell, colIndex) {\n if (colIndex === 0) {\n cellCounter = 0;\n }\n const span = spans[cell.rowIndex][colIndex];\n const placeholder = cell.placeholder;\n const index = {\n row: cell.rowIndex,\n col: cellCounter\n };\n\n spaceAllocationDueToSpan(span, placeholder, config, index)[type].bind(this)();\n cellCounter += span;\n return span;\n });\n};\n\nconst spanApplierMap = {\n [`${TOP}-0`]: null,\n [`${TOP}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${TOP}-2`]: null,\n [`${CENTER}-0`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${CENTER}-1`]: null,\n [`${CENTER}-2`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${BOTTOM}-0`]: null,\n [`${BOTTOM}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${BOTTOM}-2`]: null\n};\n\nexport const applySpans = (cells, spans, config, type) => {\n const applier = spanApplierMap[type];\n if (applier) {\n applier(cells, spans, config);\n }\n};\n","import { ERROR_MSG } from 'muze-utils';\n/**\n * An Interface to be implemented if the transaction support is necessary. This class ensures reactivity to\n * global properties.\n */\nexport default class TransactionSupport {\n /**\n * Property accessor for data member of the class. Data is passed to the system by calling this method.\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for width of the class. Width is passed as an integer.\n */\n width () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for height of the class. Height is passed as an integer.\n */\n height () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for config of the class. Config is passed as an object.\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n}\n","import { TOP, BOTTOM, LEFT, TITLE, SUB_TITLE, GROUP, LAYOUT, LEGEND } from '../constants';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const arrangeComponents = (context) => {\n const legendConfig = context.config().legend;\n const titleConfig = context.title()[1];\n const subtitleConfig = context.subtitle()[1];\n const titleLayouts = {\n [`${TOP}-${TOP}`]: [TITLE, SUB_TITLE, GROUP],\n [`${BOTTOM}-${BOTTOM}`]: [GROUP, SUB_TITLE, TITLE],\n [`${TOP}-${BOTTOM}`]: [TITLE, GROUP, SUB_TITLE],\n [`${BOTTOM}-${TOP}`]: [SUB_TITLE, GROUP, TITLE]\n };\n const legendLayouts = [\n [LEGEND, LAYOUT],\n [LAYOUT, LEGEND]\n ];\n const titlePosition = titleConfig.position || TOP;\n const subtitlePosition = subtitleConfig.position || TOP;\n\n return {\n headers: titleLayouts[`${titlePosition}-${subtitlePosition}`],\n legends: legendConfig.position === LEFT || legendConfig.position === TOP ?\n legendLayouts[0] : legendLayouts[1]\n };\n};\n","/**\n * Flag to specify whether direction is vertical.\n */\nexport const MARGIN = 'margin';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const SPACE_FIXER = 'spaceFixer';\nexport const CLASSPREFIX = 'muze';\nexport const VERTICAL_ALIGN = 'verticalAlign';\nexport const TEXT_ALIGN = 'textAlign';\nexport const IS_OFFSET = 'isOffset';\nexport const MIDDLE = 'middle';\nexport const BASELINE = 'baseline';\nexport const SHOW = 'show';\nexport const CENTER = 'center';\nexport const TEXT = 'text';\nexport const HEADER = 'header';\nexport const HEIGHT = 'height';\nexport const WIDTH = 'width';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const FIELDS = 'fields';\nexport const TRANSFORM = 'transform';\nexport const LAYER_DEF = 'layerDef';\nexport const CONFIG = 'config';\nexport const DETAIL_FIELDS = 'detailFields';\nexport const MAX_LINES = 'maxLines';\nexport const MIN_CHARS = 'minCharacters';\nexport const ROTATION = 'rotation';\n\nexport const TEXT_CELL = 'text-cell';\nexport const AXIS_CELL = 'axis-cell';\nexport const GEOM_CELL = 'geom-cell';\nexport const BLANK_CELL = 'blank-cell';\n","// eneum to refer to simple cell\nexport const SIMPLE = 'simple';\n// eneum to refer to header cell\nexport const TEXT = 'text';\n// enum to refer to axis cell\nexport const AXIS = 'axis';\n// enum to refer to visual cell\nexport const GEOM = 'geom';\n// enum to refer blank cell\nexport const BLANK = 'blank';\n","import {\n ERROR_MSG,\n getUniqueId,\n mergeRecursive\n} from 'muze-utils';\nimport { SIMPLE } from './enums/cell-type';\n\n/**\n * This file declares a class that is used as an interface to create new\n * SimpleCell elements.\n * @module SimpleCell\n */\n/**\n * Base class for all table cells.\n *\n * @interface\n * @class SimpleCell\n */\nclass SimpleCell {\n\n /**\n * Creates an instance of SimpleCell.\n *\n * @param {*} config The input configuration.\n * @memberof SimpleCell\n */\n constructor (config) {\n this._id = getUniqueId();\n\n const defConfig = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConfig, config || {});\n\n this._mount = null;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n */\n get type () {\n return SIMPLE;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n * @return {Object} Default config for the placeholder\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the value contained by the SimpleCell.\n *\n * @memberof SimpleCell\n */\n valueOf () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a unique identifier for the instance used\n * to control selective rendering.\n *\n * @memberof SimpleCell\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized representation of the instance.\n *\n * @memberof SimpleCell\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns an object with width and height fields\n * specifying the space taken up by this metod.\n *\n * @memberof SimpleCell\n */\n getLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Method used to set the space available to render the SimpleCell\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @memberof SimpleCell\n */\n setAvailableSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n remove () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getMinMeasures (providedMinMeasure = 0) {\n return providedMinMeasure;\n }\n\n}\n\nexport default SimpleCell;\n","/**\n * This file exports variables that are used as defaults for\n * the placeholders\n */\nimport * as CONSTANTS from './constants';\n\n /**\n * Default Configuration for the cells\n * @return {Object} Default configuration\n */\nexport const DEFAULT_CONFIG = {\n [CONSTANTS.MARGIN]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.SPACE_FIXER]: 2,\n [CONSTANTS.IS_OFFSET]: false,\n [CONSTANTS.VERTICAL_ALIGN]: null,\n [CONSTANTS.TEXT_ALIGN]: CONSTANTS.CENTER,\n [CONSTANTS.SHOW]: true,\n [CONSTANTS.MAX_LINES]: 0,\n [CONSTANTS.MIN_CHARS]: 0,\n [CONSTANTS.ROTATION]: null\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { GEOM, TEXT, AXIS, BLANK } from './enums/cell-type';\n\nconst DEFAULT_PROPS = {\n mount: {},\n availHeight: {},\n availWidth: {},\n config: {\n sanitization: (context, value) => mergeRecursive(context._config, value)\n },\n logicalSpace: {},\n minSpacing: {},\n source: {}\n};\n\nconst geomProps = {\n data: {},\n caption: {},\n config: {},\n axes: {},\n facetByFields: {},\n fields: {},\n transform: {},\n layerDef: {},\n detailFields: {}\n};\n\nconst textProps = {\n smartText: {}\n};\nexport const PROPS = {\n [GEOM]: mergeRecursive(geomProps, DEFAULT_PROPS),\n [TEXT]: mergeRecursive(textProps, DEFAULT_PROPS),\n [AXIS]: DEFAULT_PROPS,\n [BLANK]: DEFAULT_PROPS\n};\n","/**\n * This file declares a class that represents a table cell\n * used to house an axis.\n * @module VisualCell\n */\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport { CLASSPREFIX, HEIGHT, WIDTH, AXIS_CELL, BOTTOM, TOP } from './enums/constants';\nimport SimpleCell from './simple-cell';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { AXIS } from './enums/cell-type';\nimport { PROPS } from './props';\n\n/**\n * Computes the logical space of the an axis instance within an axis cell\n *\n * @param {Object} context Required to get the needed parameters to compute axis space\n * @return {Object} Returns the logical space for axis\n */\nconst computeAxisSpace = (context) => {\n let logicalWidth;\n let logicalHeight;\n const axis = context.source();\n const {\n spaceFixer,\n margin\n } = context.config();\n const {\n width,\n height\n } = axis.getLogicalSpace();\n const {\n show\n } = axis.config();\n if (show === true) {\n logicalHeight = Math.floor(height + margin.top + margin.bottom + spaceFixer);\n logicalWidth = Math.floor(width + margin.left + margin.right + spaceFixer);\n } else {\n [logicalWidth, logicalHeight] = [width, height];\n }\n return {\n width: logicalWidth,\n height: logicalHeight\n };\n};\n\n/**\n * Represents an axis cell.\n *\n * @class Axis\n */\nclass AxisCell extends SimpleCell {\n\n /**\n * Creates an instance of AxisCell.\n *\n * @param {Object} config The input config.\n * @memberof AxisCell\n */\n constructor (config) {\n super(config);\n\n this._axis = null;\n this._availHeight = null;\n this._availWidth = null;\n this._logicalSpace = null;\n\n generateGetterSetters(this, PROPS[AXIS]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof AxisCell\n */\n get type () {\n return AXIS;\n }\n\n /**\n * This method return the value conatined by this SimpleCell.\n *\n * @return {SimpleAxis | ColorAxis} Instance of SimpleAxis or ColorAxis.\n * @memberof AxisCell\n */\n valueOf () {\n return this.source().id;\n }\n\n /**\n * This method return the unique identififer of the axis\n *\n * @return {string} Id of the axis.\n * @memberof AxisCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Retrns the serialized representation of this cell.\n *\n * @return {Object}Object with serializable props.\n * @memberof AxisCell\n */\n serialize () {\n return {\n type: AXIS,\n axis: this.source().serialize()\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof AxisCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * return the space taken up by an axis element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof AxisCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeAxisSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @return {Instance} Returns current Instance\n * @memberof AxisCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n const {\n margin,\n isOffset\n } = this.config();\n\n if (width || height) {\n this.source().setAvailableSpace(width, height, margin, isOffset);\n this.source().logicalSpace(null);\n } else {\n this.source().resetLogicalSpace();\n }\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the axis inside the axis cell.\n *\n * @param {HTMLElement} mount The mount point.\n * @return {Selection} node where axis mounted\n * @memberof AxisCell\n */\n /* istanbul ignore next */render (mount) {\n if (!mount) {\n return this;\n }\n let actualWidth = 0;\n let actualHeight = 0;\n const axis = this.source();\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const {\n margin\n } = this.config();\n const {\n top,\n bottom,\n left,\n right\n } = margin;\n const {\n show,\n orientation\n } = axis.config();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [this], `${CLASSPREFIX}-${AXIS_CELL}`);\n const selection = makeElement(wrapperDiv, 'svg', [1], `${CLASSPREFIX}-axis-container`);\n selection.classed(`${CLASSPREFIX}-axis-container-${orientation}`, true);\n\n this.mount(mount);\n if (!availWidth) {\n selection.attr(WIDTH, `${0}px`);\n }\n if (!availHeight) {\n selection.attr(HEIGHT, `${0}px`);\n }\n actualWidth = availWidth;\n actualHeight = availHeight;\n if (!show) {\n actualWidth = (orientation === TOP || orientation === BOTTOM) ? availWidth : 0;\n actualHeight = (orientation === TOP || orientation === BOTTOM) ? 0 : availHeight;\n }\n wrapperDiv.style(WIDTH, `${actualWidth}px`)\n .style(HEIGHT, `${actualHeight}px`)\n .style('margin-top', top)\n .style('margin-bottom', bottom)\n .style('margin-left', left)\n .style('margin-right', right);\n\n axis.mount(selection.node());\n return selection;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Current instance of AxisCell\n * @memberof AxisCell\n */\n remove () {\n this.source() && this.source().remove();\n this.mount() && this.mount().remove();\n return this;\n }\n}\n\nexport default AxisCell;\n\n","/**\n * This file declares a class that represents a BLANK element in a table.\n * @module VisualCell\n */\nimport {\n selectElement,\n makeElement,\n applyStyle,\n generateGetterSetters\n } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { CLASSPREFIX, BLANK_CELL } from './enums/constants';\nimport { BLANK } from './enums/cell-type';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { PROPS } from './props';\n\n/**\n * Represents a table haeder.\n *\n * @class BLANK\n */\nclass BlankCell extends SimpleCell {\n\n /**\n * Creates an instance of BLANK.\n * @param {Object} config The input configuration.\n * @memberof BLANK\n */\n constructor (config) {\n super(config);\n\n generateGetterSetters(this, PROPS[BLANK]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof BlankCell\n */\n get type () {\n return BLANK;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof BlankCell\n */\n valueOf () {\n return this.id;\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof BlankCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method is used to return a unique identifier for\n * the BLANK cell.\n *\n * @return {string} The unique identifier for the BLANK.\n * @memberof BlankCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof BLANK\n */\n serialize () {\n return {\n type: BLANK\n };\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof BLANK\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n return {\n width: this.width || 0,\n height: this.height || 0\n };\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the BLANK cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof BLANK\n */\n /* istanbul ignore next */render (mount) {\n if (mount) {\n const { style } = this.config();\n // append span element to mount point\n this.mount(mount);\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id]);\n elem.classed(`${CLASSPREFIX}-${BLANK_CELL}`, true);\n elem.style('width', `${this.availWidth()}px`);\n elem.style('height', `${this.availHeight()}px`);\n elem.html('');\n // apply style on the returned element\n if (style) {\n applyStyle(elem, style);\n }\n } return this;\n }\n\n /**\n * Removes the cell(Disposal)\n *\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n\n getMinMeasures () {\n return 0;\n }\n }\nexport default BlankCell;\n","/**\n * This file declares a class that represents a Text element in a table.\n * @module VisualCell\n */\n\nimport {\n selectElement,\n makeElement,\n getSmartComputedStyle,\n generateGetterSetters\n} from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { TEXT } from './enums/cell-type';\nimport { PROPS } from './props';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { CLASSPREFIX, TOP, BOTTOM, LEFT, RIGHT, HEADER, WIDTH, TEXT_CELL } from './enums/constants';\nimport './text-cell.scss';\n\nconst setSmartText = (context) => {\n const source = context.source();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n rotation\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const labelManager = context.dependencies().labelManager;\n\n labelManager.setStyle(context._computedStyle);\n\n !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false));\n rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true));\n\n return context;\n};\n\n/**\n* Computes the Logical Space for the text\n*\n* @param {Object} context Required to get the needed parameters to compute text space\n* @return {Object} Logical space taken up by text\n* @memberof TextCell\n*/\nconst computeTextSpace = (context) => {\n const { labelManager } = context.dependencies();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n show,\n maxLines,\n minCharacters\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const source = context.source();\n const space = context.smartText();\n const minText = new Array(minCharacters).fill('W').join('');\n const _minTextSpace = labelManager.getOriSize(minText);\n\n context.config({ rotation: false });\n if (space.width > (availWidth || 0) && maxLines) {\n space.height = space.oriTextHeight * maxLines;\n }\n if (availWidth && availWidth < space.width) {\n space.width = _minTextSpace.width;\n }\n if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) {\n const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true);\n space.width = smartSpace.height;\n space.height = smartSpace.width;\n context.config({ rotation: true });\n context.smartText(smartSpace);\n }\n\n if (show) {\n return {\n width: Math.ceil(space.width) + paddedWidth,\n height: Math.ceil(space.height) + paddedHeight\n };\n } return {\n width: 0,\n height: 0\n };\n};\n\n/**\n * Represents a table haeder.\n *\n * @class Text\n */\nclass TextCell extends SimpleCell {\n\n /**\n * Creates an instance of Text.\n * @param {Object} config The input configuration.\n * @param {string} dependencies Dependencies for the class(labelManager)\n * @memberof Text\n */\n constructor (config, dependencies) {\n super(config);\n\n this._dependencies = dependencies;\n this._className = this._config.className ||\n (this._config.type === HEADER ? `${CLASSPREFIX}-${HEADER}-cell` : `${CLASSPREFIX}-${TEXT}-cell`);\n this._computedStyle = getSmartComputedStyle(selectElement('body'), this._className);\n this._dependencies.labelManager.setStyle(this._computedStyle);\n generateGetterSetters(this, PROPS[TEXT]);\n const space = this._dependencies.labelManager.getOriSize('w');\n this.minSpacing({ width: Math.floor(space.width * 3 / 4), height: Math.floor(space.height / 2) });\n setSmartText(this);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof TextCell\n */\n get type () {\n return TEXT;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof TextCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return a unique identifier for\n * the Text cell.\n *\n * @return {string} The unique identifier for the Text.\n * @memberof TextCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Returns the dependencies of the instance\n *\n * @return {Object} Dependencies needed by the class\n * @memberof TextCell\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof TextCell\n */\n serialize () {\n return {\n text: this.source(),\n type: TEXT\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof TextCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof Text\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeTextSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n setSmartText(this);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the Text cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof Text\n */\n render (mount) {\n const availWidth = this.availWidth();\n const availHeight = this.availHeight();\n const {\n margin,\n show,\n verticalAlign,\n textAlign,\n rotation\n } = this.config();\n\n this.mount(mount);\n if (show) {\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`);\n const vAlign = verticalAlign || rotation ? 'middle' : 'top';\n const {\n width,\n height\n } = this.smartText();\n const {\n height: minHeightSpace\n } = this.minSpacing();\n const translation = {\n top: width + minHeightSpace / 2,\n middle: width / 2 + minHeightSpace,\n bottom: minHeightSpace\n };\n\n container.style('vertical-align', vAlign);\n\n // Set class name\n elem.classed(this._className, true);\n\n // Apply styles\n elem.style('text-align', textAlign);\n elem.style('display', 'inline');\n elem.style('transform', rotation ? `translate(${height / 2}px,\n ${translation[vAlign]}px) rotate(-90deg)` : '');\n elem.style(WIDTH, availWidth ? `${availWidth}px` : '100%');\n [TOP, BOTTOM, LEFT, RIGHT].forEach((type) => {\n container.style(`margin-${type}`, `${margin[type]}px`);\n });\n elem.style('text-align', textAlign);\n elem.style('display', 'inline');\n // set the text as the innerHTML\n this._dependencies.labelManager.setStyle(this._computedStyle);\n elem.html(this._dependencies.labelManager.getSmartText(this.source(), availWidth, availHeight, true).text);\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n }\n\nexport default TextCell;\n","/**\n * This file declares a class that is used to represent a table cell\n * that houses a visual unit.\n * @module VisualCell\n */\n\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { GEOM } from './enums/cell-type';\nimport { PROPS } from './props';\nimport {\n CLASSPREFIX, HEIGHT, WIDTH, DATA, AXES, FACET_BY_FIELDS, FIELDS, TRANSFORM, LAYER_DEF, CONFIG, GEOM_CELL,\n DETAIL_FIELDS\n} from './enums/constants';\nimport { DEFAULT_CONFIG } from './enums/defaults';\n\n/**\n * Calculates the logical space of the cell\n *\n * @param {Object} context Required to get the needed parameters to compute unit space\n * @return {Object} Logical space taken up by the unit\n * @memberof GeomCell\n */\nconst computeGeomSpace = (context) => {\n const config = context.source().config();\n const { width, height } = config;\n return {\n width: Math.ceil(width),\n height: Math.ceil(height + context.getCaptionSpace().height)\n };\n};\n\n /**\n * This class represents a SimpleCell for visual unit.\n *\n * @class GeomCell\n */\nclass GeomCell extends SimpleCell {\n\n /**\n * Creates an instance of GeomCell.\n * @param {Object} config The input configuration.\n * @memberof GeomCell\n */\n constructor (config) {\n super(config);\n\n this._unit = null;\n this._layers = null;\n this._axes = {};\n this._datamodel = {};\n this._facetByFields = {};\n this._fields = null;\n this._transform = null;\n this._caption = null;\n\n generateGetterSetters(this, PROPS[GEOM]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof GeomCell\n */\n get type () {\n return GEOM;\n }\n\n /**\n * This method return the value contained by this cell.\n *\n * @return {VisualUnit} Instance of visual unit contained by visual unit.\n * @memberof GeomCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return the id of the\n * visual unit housed by this cell.\n *\n * @return {string} The unique id of the visual unit.\n * @memberof GeomCell\n */\n get id () {\n return this.source().id();\n }\n\n /**\n * This method return a serialized representation of\n * this instance.\n *\n * @return {Object} Object with serializable props.\n * @memberof GeomCell\n */\n serialize () {\n return {\n type: GEOM,\n unit: this.source().serialize(),\n caption: this.caption()\n };\n }\n\n /**\n * return the default configuration for the geom cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof GeomCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * Updates the model based on the changed parameters\n *\n * @return {Instance} return instance\n * @memberof GeomCell\n */\n updateModel () {\n const unit = this.source();\n unit.clearCaching();\n [LAYER_DEF, TRANSFORM, AXES, FIELDS, CONFIG, DATA, AXES, FACET_BY_FIELDS, DETAIL_FIELDS].forEach((prop) => {\n this[prop]() && unit[prop](this[prop]());\n });\n return this;\n }\n\n /**\n * It gives the space taken by the caption of the unit\n *\n * @return {Object} return the space taken by caption\n * @memberof GeomCell\n */\n getCaptionSpace () {\n const caption = this.caption();\n\n let captionSpace = { width: 0, height: 0 };\n if (caption) {\n captionSpace = caption.getLogicalSpace();\n }\n return captionSpace;\n }\n\n /**\n * return the space taken up by the element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof GeomCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeGeomSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space available to\n * render the SimpleCell.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n setAvailableSpace (width, height) {\n const unit = this.source();\n\n this.availWidth(width);\n this.availHeight(height);\n unit.lockModel()\n .width(width).height(height - this.getCaptionSpace().height)\n .unlockModel();\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * his method is used to render the visual unit inside the provided cell.\n *\n * @param {HTMLElement} mount The mountpoint in the table.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n render (mount) {\n if (mount) {\n this.mount(mount);\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const caption = this.caption();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [1], `${CLASSPREFIX}-${GEOM_CELL}`);\n\n if (caption) {\n const captionDom = makeElement(wrapperDiv, 'div', [caption], `${CLASSPREFIX}-unit-caption`).node();\n caption.render(captionDom);\n }\n const selection = makeElement(wrapperDiv, 'div', [1], `${CLASSPREFIX}-unit`);\n wrapperDiv.style(WIDTH, `${availWidth}px`).style(HEIGHT, `${availHeight}px`);\n selection.style(WIDTH, `${availWidth}px`)\n .style(HEIGHT, `${availHeight - this.getCaptionSpace().height}px`);\n this.source().mount(selection.node());\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Object} Current instance\n * @memberof GeomCell\n */\n remove () {\n this.mount() && this.mount().remove();\n this.source().remove();\n return this;\n }\n}\n\nexport default GeomCell;\n","import AxisCell from './axis-cell';\nimport BlankCell from './blank-cell';\nimport TextCell from './text-cell';\nimport GeomCell from './geom-cell';\nimport SimpleCell from './simple-cell';\n\nimport * as CONSTANTS from './constants';\n\nexport const DEFAULT_PLACEHOLDERS = {\n [CONSTANTS.SIMPLE_CELL]: SimpleCell,\n [CONSTANTS.TEXT_CELL]: TextCell,\n [CONSTANTS.AXIS_CELL]: AxisCell,\n [CONSTANTS.GEOM_CELL]: GeomCell,\n [CONSTANTS.BLANK_CELL]: BlankCell\n};\n\n","export const SIMPLE_CELL = 'SimpleCell';\nexport const TEXT_CELL = 'TextCell';\nexport const AXIS_CELL = 'AxisCell';\nexport const BLANK_CELL = 'BlankCell';\nexport const GEOM_CELL = 'GeomCell';\n\n","import { DEFAULT_PLACEHOLDERS } from './defaults';\n\n/**\n * Creates a registry for the cells, which can be used for\n * setting a new cell or getting the registered cells\n *\n * @return {Object} Setters and getters for registered cells\n */\nconst cellRegistry = () => {\n const reg = DEFAULT_PLACEHOLDERS;\n return {\n set: (key, def) => {\n if (key in reg) {\n reg[key] = def;\n }\n return cellRegistry;\n },\n get: () => reg\n };\n};\nexport default cellRegistry;\n","import { TextCell } from '@chartshq/visual-cell';\nimport { escapeHTML } from 'muze-utils';\nimport { TOP } from '../constants';\n\n/**\n *\n *\n * @param {*} rawContent\n *\n */\nconst resolveTitleSubTitleContent = (rawContent) => {\n if (typeof rawContent === 'function' && !rawContent._sanitize) {\n return rawContent();\n }\n return escapeHTML(rawContent());\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} cellType\n * @param {*} labelManager\n * @param {*} prevCell\n *\n */\nconst headerCreator = (config, cellType, labelManager, prevCell) => {\n let margin = {};\n const {\n content,\n classPrefix,\n maxLines\n } = config;\n const cell = prevCell || new TextCell(\n {\n type: cellType === 'title' ? 'header' : 'text',\n className: `${classPrefix}-${cellType}-cell`\n }, {\n labelManager\n })\n .config({ maxLines }).minSpacing({ width: 0, height: 0 });\n\n cell.source(content);\n cell._minTickDiff = { height: 0, width: 0 };\n\n if (config.position === TOP) {\n margin = { top: 0, bottom: config.padding };\n } else {\n margin = { top: config.padding, bottom: 0 };\n }\n cell.config({ margin });\n\n return {\n height: cell.getLogicalSpace().height,\n cell\n };\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} type\n * @param {*} labelManager\n * @param {*} cell\n *\n */\nconst createHeading = (config, type, labelManager, prevCell) => {\n if (!config) { return ''; }\n\n return headerCreator(\n config,\n type,\n labelManager,\n prevCell\n );\n};\n\n/**\n *\n *\n * @param {*} context\n */\nexport const createHeaders = (context, canvasHeight, canvasWidth) => {\n let headerHeight = 0;\n const headers = {};\n const subtitle = context.subtitle();\n const isSubtitle = resolveTitleSubTitleContent(subtitle[0]);\n\n canvasHeight >= 200 && canvasWidth >= 200 && ['title', 'subtitle'].forEach((type) => {\n const headerOptions = context[type]();\n const content = resolveTitleSubTitleContent(headerOptions[0]);\n if (content) {\n const config = headerOptions[1];\n\n config.width = context.width();\n config.height = context.height();\n config.classPrefix = context.config().classPrefix;\n config.content = content;\n config.padding = (type === 'title' && !isSubtitle.length) ? subtitle[1].padding : config.padding;\n\n const { height, cell } = createHeading(config, type, context.dependencies().smartlabel,\n context[`${type}Cell`]);\n\n headers[`${type}Cell`] = cell;\n context._composition[type] = cell;\n headerHeight += height;\n }\n });\n return { headerHeight, headers };\n};\n\n","import { TextCell, AxisCell } from '@chartshq/visual-cell';\nimport { getValueParser, retrieveFieldDisplayName, DataModel, getObjProp } from 'muze-utils';\nimport {\n VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING, BORDER, MARGIN\n} from '../constants';\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n *\n */\nexport const legendCreator = (canvas) => {\n let LegendCls;\n const dataset = [];\n const axes = canvas.getRetinalAxes();\n\n Object.entries(axes).forEach((axisInfo) => {\n const scale = axisInfo[1][0];\n const scaleType = axisInfo[0];\n const scaleProps = canvas[scaleType]();\n\n if (scaleProps.field && scale) {\n const {\n type,\n step\n } = scale.config();\n\n const stepMapper = typeof step === 'boolean' ? step : false;\n LegendCls = LEGEND_TYPE_MAP[`${type}-${stepMapper}-${scaleType}`];\n dataset.push({\n scale,\n canvas,\n fieldName: scaleProps.field,\n title: retrieveFieldDisplayName(canvas.data(), scaleProps.field),\n LegendCls,\n scaleType\n });\n }\n });\n\n return dataset;\n};\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n * @param {*} measurement\n * @param {*} prevLegends\n *\n */\nexport const legendInitializer = (legendConfig, canvas, measurement, prevLegends) => {\n const legends = [];\n const {\n height,\n width,\n headerHeight\n } = measurement;\n const {\n position,\n align\n } = legendConfig;\n\n const legendInfo = legendCreator(canvas);\n const { invalidValues } = canvas.config();\n\n const parser = getValueParser(invalidValues);\n legendInfo.forEach((dataInfo, index) => {\n const legendMeasures = {};\n const {\n LegendCls,\n scale,\n fieldName,\n title: titleText,\n scaleType\n } = dataInfo;\n const config = legendConfig[scaleType] || {};\n const title = config.title || {};\n title.text = title.text || titleText;\n if (config.show) {\n config.position = position;\n config.align = align;\n let legend = getObjProp(prevLegends[scaleType], index);\n if (!legend) {\n legend = LegendCls.create({\n labelManager: canvas._dependencies.smartlabel,\n cells: {\n AxisCell, TextCell\n }\n });\n }\n legendMeasures.maxHeight = align === VERTICAL ? (height - headerHeight) : height * 0.2;\n legendMeasures.maxWidth = align === HORIZONTAL ? width : width * 0.2;\n legendMeasures.width = Math.min(legendMeasures.maxWidth, config.width);\n legendMeasures.height = Math.min(legendMeasures.maxHeight, config.height);\n\n [PADDING, BORDER, MARGIN].forEach((e) => {\n legendMeasures[e] = config[e];\n });\n const metaData = legend.metaData();\n if (metaData instanceof DataModel) {\n metaData.dispose();\n }\n legend.scale(scale)\n .valueParser(parser)\n .title(title)\n .fieldName(fieldName)\n .config(config)\n .metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName]))\n .measurement(legendMeasures)\n .canvasAlias(canvas.alias())\n .setLegendMeasures();\n\n legends.push({ canvas, legend, scaleType });\n }\n });\n return legends;\n};\n\n/**\n *\n *\n * @param {*} legends\n * @param {*} legendConfig\n * @param {*} availableHeight\n * @param {*} availableWidth\n *\n */\nexport const getLegendSpace = (legends, legendConfig, availableHeight, availableWidth) => {\n const legendMeasures = legends.map(legendInfo => legendInfo.legend.measurement());\n const legendSpace = { width: 0, height: 0 };\n\n legendMeasures.forEach((space) => {\n let height = 0;\n let width = 0;\n width = Math.min(space.width, space.maxWidth);\n height = Math.min(space.height, space.maxHeight);\n\n if (legendConfig.align === HORIZONTAL) {\n if (legendSpace.width + width > availableWidth) {\n legendSpace.width = availableWidth;\n legendSpace.height += height;\n } else {\n legendSpace.width += width;\n legendSpace.height = Math.max(legendSpace.height, height);\n }\n } else if (legendSpace.height + height > availableHeight) {\n legendSpace.height = height;\n legendSpace.width += width;\n } else {\n legendSpace.height += height;\n legendSpace.width = Math.max(legendSpace.width, width);\n }\n });\n if (legendConfig.align === HORIZONTAL) {\n legendSpace.width = availableWidth;\n }\n return legendSpace;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} headerHeight\n *\n */\nexport const createLegend = (context, headerHeight, height, width) => {\n const measurement = {\n height,\n width,\n headerHeight\n };\n const { legend } = context.config();\n const { show, position } = legend;\n\n legend.classPrefix = context.config().classPrefix;\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n\n legend.show = show ? ((align === VERTICAL && width > 200) || (align === HORIZONTAL && height > 200)) : show;\n legend.align = align;\n return legendInitializer(legend, context, measurement, context.composition().legend || {});\n};\n","import { LayoutComponent } from '../../../../layout/src/tree-layout';\n\nexport default class MuzeComponent extends LayoutComponent {\n getLogicalSpace () {\n const { width, height } = this.boundBox();\n return { width, height };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n }\n\n getBoundBox () {\n return this.boundBox();\n }\n\n updateWrapper () {\n throw Error('Update is not implemented');\n }\n\n setParams () {\n throw Error('set params is not implemented');\n }\n}\n","import { selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { LEFT } from '../../constants';\n\nexport default class HeaderComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n renderHeader (container) {\n const layoutConfig = this.params.config;\n container = selectElement(container);\n const { align } = layoutConfig;\n const sel = container\n .selectAll(`.${layoutConfig.classPrefix}-inner-container`)\n .data([this.name]);\n sel.exit().remove();\n const selEnter = sel.enter().append('div');\n\n const cont = selEnter.merge(sel);\n cont.classed(`${layoutConfig.classPrefix}-inner-container`, true);\n const { height, width } = this.boundBox();\n this.component.setAvailableSpace(width, height);\n\n this.component && this.component.render(cont.node());\n\n cont.selectAll('div').classed(`${layoutConfig.classPrefix}-inner-content`, true);\n cont.style('width', `${100}%`);\n\n if (layoutConfig && this.component) {\n cont.style('float', LEFT)\n .style('text-align', align);\n // .style(`padding-${position === TOP ? BOTTOM : TOP}`, `${padding}px`);\n }\n }\n\n draw (container) {\n this.renderHeader(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.setParams(params);\n this.name(params.name);\n this.boundBox(params.component.getLogicalSpace());\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y,\n left: conf.x,\n width: conf.width,\n height: conf.height });\n this.renderAt(conf.renderAt);\n }\n}\n","import { makeElement, selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport {\n LEFT, RIGHT, VERTICAL, HORIZONTAL, TOP, BOTTOM, HORIZONTAL_CENTER, VERTICAL_CENTER\n} from '../../constants';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\n\nfunction defaultAlignmentHelper (position) {\n let alignment = null;\n const alignWith = `${ROW_MATRIX_INDEX[1]}-${COLUMN_MATRIX_INDEX[1]}`;\n switch (position) {\n case TOP:\n case BOTTOM:\n alignment = HORIZONTAL_CENTER;\n break;\n case LEFT:\n case RIGHT:\n alignment = VERTICAL_CENTER;\n break;\n default:\n alignment = VERTICAL_CENTER;\n }\n return { alignment, alignWith };\n}\nexport default class LegendComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.measurement.legendSpace, 0);\n this.setParams(params);\n }\n\n renderLegend (container) {\n container = selectElement(container);\n const sectionComponents = [];\n const { position, classPrefix } = this.params.config;\n const legendMount = makeElement(container, 'div', [this.components],\n `${classPrefix}-inner-content`, {}, d => d);\n legendMount.classed(`${classPrefix}-legend`, true);\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n const legWidth = this.newDimensions.width;\n const legHeight = this.newDimensions.height;\n\n [container, legendMount].forEach((elem) => {\n elem.style('width', `${Math.floor(legWidth)}px`)\n .style('height', `${legHeight}px`)\n .style('float', LEFT);\n });\n\n if (align === VERTICAL) {\n let sections = -1;\n let currHeight = legHeight;\n let currWidth = 0;\n\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n if (leg.measurement().height > currHeight) {\n sections++;\n currWidth = 0;\n currHeight = legHeight;\n } else {\n sections < 0 && sections++;\n }\n sectionComponents[sections] = sectionComponents[sections] || [];\n currHeight -= Math.min(leg.measurement().height, currHeight);\n currWidth = Math.max(Math.min(leg.measurement().width, leg.measurement().maxWidth), currWidth);\n sectionComponents[sections].push({\n legend: leg,\n legendHeight: legHeight,\n legendWidth: currWidth\n });\n });\n\n const mount = makeElement(legendMount, ['div'], sectionComponents, `${classPrefix}-legend-section`);\n // mount.each((d, i) => selectElement(this).classed(`${classPrefix}-legend-section-${i}`, true));\n mount.classed(`${classPrefix}-legend-vertical-section`, true)\n .style('width', d => `${d[0].legendWidth}px`);\n makeElement(mount, ['div'], d => d, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) {\n d.legend.mount(this);\n })\n .style('width', d => `${d.legendWidth}px`);\n } else {\n const mount = makeElement(legendMount, 'div', [1], `${classPrefix}-legend-section`);\n mount.classed(`${classPrefix}-legend-horizontal-section`, true);\n mount.classed(`${classPrefix}-legend-section-${0}`, true)\n .style('width', `${legWidth}px`);\n\n makeElement(mount, 'div', this.components, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) { d.legend.mount(this); })\n .style('width', d => `${d.legend.measurement().width}px`);\n }\n }\n\n draw (container) {\n this.renderLegend(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.measurement.legendSpace);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.components = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n const { alignWith, alignment } = defaultAlignmentHelper(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith || alignWith);\n this.alignment(params.config.alignment || alignment);\n }\n\n}\n","import {\n selectElement,\n makeElement,\n getD3Drag,\n getEvent,\n getWindow,\n hasTouch\n} from 'muze-utils';\nimport './scroll-bar.scss';\nimport { WIDTH, HEIGHT } from '../../../constants';\n\nconst d3Drag = getD3Drag();\n\nconst arrowSizeMap = {\n left: WIDTH,\n right: WIDTH,\n top: HEIGHT,\n bottom: HEIGHT\n};\n\nexport const getUnitPositions = (unitMeasures, totalLength, viewLength) => {\n let currentLen = 0;\n const measures = unitMeasures.primary && unitMeasures.primary.length ?\n unitMeasures.primary : unitMeasures.secondary;\n\n return measures.map((e) => {\n const unitPosition = currentLen * 100 / (totalLength - viewLength);\n currentLen += e;\n return unitPosition;\n });\n};\n\nexport const createScrollBarArrow = (mount, type, config) => {\n const {\n classPrefix,\n thickness\n } = config;\n const arrow = makeElement(mount, 'div', [type], `${classPrefix}-scroll-arrow-${type}`);\n\n arrow.classed(`${classPrefix}-scroll-arrow`, true);\n arrow.style(arrowSizeMap[type], `${thickness}px`);\n\n const chevron = makeElement(arrow, 'div', [1], `${classPrefix}-scroll-arrow-chevron`);\n\n chevron.attr('id', `${classPrefix}-scroll-arrow-chevron-${type}`);\n\n return arrow;\n};\n\nexport const createScrollBarRect = (mount, config) => {\n const {\n classPrefix\n } = config;\n const rect = makeElement(mount, 'div', [1], `${classPrefix}-scroll-rect`);\n const mover = makeElement(rect, 'div', [1], `${classPrefix}-scroll-mover`);\n\n return { rect, mover };\n};\n\nexport const applyRectClick = (scrollMaker, moverRect) => {\n const {\n rect\n } = moverRect;\n\n rect.on('click', () => {\n const event = getEvent();\n scrollMaker.emptyScrollAreaClick(event);\n });\n};\n\nconst applyMoverDrag = (scrollMaker, moverRect) => {\n let startPos = {};\n let moverStartPos = 0;\n let rectStartPos = 0;\n let endPos = {};\n const {\n mover,\n rect\n } = moverRect;\n\n mover.call(d3Drag()\n .on('start', () => {\n const event = getEvent();\n\n moverStartPos = mover.node().getBoundingClientRect();\n rectStartPos = rect.node().getBoundingClientRect();\n startPos = {\n x: event.x,\n y: event.y\n };\n })\n .on('drag', () => {\n const event = getEvent();\n const window = getWindow();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n const distanceMoved = {\n x: endPos.x - startPos.x,\n y: endPos.y - startPos.y\n };\n const actualPosition = {\n x: moverStartPos.x + distanceMoved.x - rectStartPos.x + window.pageXOffset,\n y: moverStartPos.y + distanceMoved.y - rectStartPos.y + window.pageYOffset\n };\n\n scrollMaker.changeMoverPosition(actualPosition);\n }));\n};\n\nconst applyScrollMouseDownAction = (moverRect, scrollMaker, speed) => {\n const {\n mover,\n rect\n } = moverRect;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n scrollMaker.changeMoverPosition({ x: x - rectX + speed, y: y - rectY + speed });\n};\n\nconst registerListenerOnArrow = (scrollMaker, moverRect, arrowType, speed) => {\n let timer = '';\n const arrow = scrollMaker._components[arrowType];\n const isTouchDevice = hasTouch();\n\n arrow.on(isTouchDevice ? 'touchstart' : 'mousedown', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n timer = setInterval(() => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n }, 100);\n }).on(isTouchDevice ? 'touchend' : 'mouseup', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n clearInterval(timer);\n }).on('click', () => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n });\n};\n\nexport const registerListeners = (scrollMaker) => {\n const {\n moverRect\n } = scrollMaker._components;\n\n const speed = scrollMaker.config().speed;\n\n registerListenerOnArrow(scrollMaker, moverRect, 'prevArrow', -speed);\n applyMoverDrag(scrollMaker, moverRect);\n applyRectClick(scrollMaker, moverRect);\n registerListenerOnArrow(scrollMaker, moverRect, 'nextArrow', speed);\n};\n\nexport const scrollContainerHelper = (mountPoint, config, dimensions, type) => {\n const {\n classPrefix\n } = config;\n const scrollBarContainer = makeElement(selectElement(mountPoint), 'div', [1], `#${classPrefix}-scroll-bar-${type}`);\n\n scrollBarContainer.classed(`${classPrefix}-scroll-bar`, true);\n scrollBarContainer.style(WIDTH, `${dimensions.width}px`);\n scrollBarContainer.style(HEIGHT, `${dimensions.height}px`);\n return scrollBarContainer;\n};\n\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n\n config: {\n sanitization: (context, value) => {\n value = mergeRecursive(context._config, value);\n return value;\n }\n },\n manager: {},\n unitPositions: {},\n logicalSpace: {}\n};\n\n","import { ERROR_MSG, generateGetterSetters } from 'muze-utils';\nimport {\n scrollContainerHelper,\n registerListeners\n} from './helper';\nimport { PROPS } from './props';\n\nexport class ScrollMaker {\n\n constructor () {\n this._components = {};\n this._logicalSpace = {};\n this._attachedScrollAction = () => {};\n this._config = {\n thickness: 10,\n speed: 2\n };\n this._unitPositions = null;\n\n generateGetterSetters(this, PROPS);\n }\n\n static type () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n emptyScrollAreaClick () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n changeMoverPosition () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollDeltaTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n createScroll (mountPoint) {\n const config = this.config();\n\n return {\n scrollBarContainer: scrollContainerHelper(mountPoint, config, this.logicalSpace(), this.constructor.type())\n };\n }\n\n attachScrollAction (externalScrollAction) {\n this._attachedScrollAction = externalScrollAction;\n return this;\n }\n\n detachScrollAction () {\n this._attachedScrollAction = () => {};\n return this;\n }\n\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n registerListeners () {\n registerListeners(this);\n return this;\n }\n\n remove () {\n this._components.scrollBarContainer.remove();\n return this;\n }\n}\n\n","import MuzeComponent from './muze-chart-component';\nimport { HorizontalScrollMaker } from './scroll-bar-maker/horizontal-scroll-maker';\nimport { VerticalScrollMaker } from './scroll-bar-maker/vertical-scroll-maker';\n\nconst scrollMakerMap = {\n horizontal: HorizontalScrollMaker,\n vertical: VerticalScrollMaker\n};\n\n/**\n * Scroll Component acts as a wrapper over the scoll bars created using the respective Scroll Makers\n * This provides a consistent API for layouting using the tree layout system.\n *\n *\n * @class\n * @public\n * @module ScrollComponent\n */\nexport default class ScrollComponent extends MuzeComponent {\n\n constructor (params) {\n const ScrollMaker = scrollMakerMap[params.config.type];\n\n params.component = new ScrollMaker();\n params.component.config(params.config.scrollBarComponentConfig);\n params.component.logicalSpace(params.dimensions);\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n manager (...manager) {\n if (manager.length) {\n this.component.manager(manager[0]);\n return this;\n }\n return this.component.manager();\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollDeltaTo (delta) {\n this.component.scrollDeltaTo(delta);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollTo (scrollPercentage) {\n this.component.scrollTo(scrollPercentage);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page based on the unit index.\n * The input is provided as a number represting the index for the unit.\n * For vertical scroll, it's the row index that will be required.\n * For horizontal scroll, it's the column index that will be required\n *\n * @public\n *\n * @param {number} unitIndex Index of the unit appearing in the grid\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollToUnitIndex (unitIndex) {\n const unitPositions = this.component.unitPositions();\n const sanitizedUnitIndex = Math.min(Math.max(0, unitIndex), unitPositions.length - 1);\n this.component.scrollTo(unitPositions[sanitizedUnitIndex]);\n return this;\n }\n\n /**\n * Provides the positions of the units(either horizontal or vertical based on the type\n * of scroll bar it wraps) relative to it's container. The position of the first unit starts at 0\n *\n *\n * @public\n *\n * @return {Array} Positions of units either horizontal or vertical\n */\n getScrollPositionsForUnits () {\n return this.component.unitPositions();\n }\n\n draw (container) {\n this.component.createScroll(container || document.getElementById(this.renderAt()));\n return this;\n }\n\n /**\n * Can be used to attach a scroll action whenever scrolling occurs in the canvas\n *\n * @public\n * @param {number} externalAction Action to be attached during scroll\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n attachScrollAction (externalAction) {\n this.component.attachScrollAction(externalAction);\n return this;\n }\n\n /**\n * Can be used to detach the scroll action already bound to the scroll bar\n *\n * @public\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n detachScrollAction () {\n this.component.detachScrollAction();\n return this;\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.component.config(params.config.scrollBarComponentConfig);\n this.component.logicalSpace(params.dimensions);\n this.boundBox(this.component.getLogicalSpace());\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component || this.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n remove () {\n this.component.remove();\n }\n}\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { HORIZONTAL, HEIGHT, WIDTH, LEFT } from '../../../constants';\n\nexport class HorizontalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: horizontal\n */\n static type () {\n return HORIZONTAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, config, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'left', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'right', config);\n const {\n mover,\n rect\n } = moverRect;\n\n const { height, width, totalLength, viewLength, unitWidths } = this.logicalSpace();\n const scrollBarWithouArrowLength = width - height * 2;\n\n rect.style(WIDTH, `${dimensions.width - height * 2}px`);\n rect.style(HEIGHT, `${100}%`);\n mover.style(WIDTH, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(HEIGHT, `${100}%`);\n mover.style(LEFT, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n this.unitPositions(getUnitPositions(unitWidths, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n let positionAdjuster = speed * 10;\n if (event.x < x) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n const {\n totalLength\n } = this.logicalSpace();\n\n if (newPosition.x < 0) {\n currentPos = 0;\n } else if (newPosition.x + moverPos.width > rectStartPos.width) {\n currentPos = rectStartPos.width - moverPos.width;\n } else {\n currentPos = newPosition.x;\n }\n\n mover.style(LEFT, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: 0, x: moverPos.x - rectStartPos.x - delta });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {HorizontalScrollMaker} Instance of the HorizontalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.width)) / 100;\n\n this.changeMoverPosition({ y: 0, x: movement });\n return this;\n }\n\n}\n\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { VERTICAL, TOP, HEIGHT, WIDTH } from '../../../constants';\n\nexport class VerticalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: vertical\n */\n static type () {\n return VERTICAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'top', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'bottom', config);\n const {\n mover,\n rect\n } = moverRect;\n const { height, width, totalLength, viewLength, unitHeights } = this.logicalSpace();\n const scrollBarWithouArrowLength = height - width * 2;\n\n rect.style(HEIGHT, `${scrollBarWithouArrowLength}px`);\n rect.style(WIDTH, `${100}%`);\n mover.style(WIDTH, `${100}%`);\n mover.style(HEIGHT, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(TOP, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n\n this.unitPositions(getUnitPositions(unitHeights, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n let positionAdjuster = speed * 10;\n if (event.y < y) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const {\n totalLength\n } = this.logicalSpace();\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n\n if (newPosition.y < 0) {\n currentPos = 0;\n } else if (newPosition.y + moverPos.height > rectStartPos.height) {\n currentPos = rectStartPos.height - moverPos.height;\n } else {\n currentPos = newPosition.y;\n }\n mover.style(TOP, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: moverPos.y - rectStartPos.y - delta, x: 0 });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.height)) / 100;\n\n this.changeMoverPosition({ x: 0, y: movement });\n return this;\n }\n\n}\n","import { makeElement } from 'muze-utils';\nimport { cellSpanMaker, applySpans } from '../../../../layout/src/grid-layout/span-maker';\nimport { applyBorders } from '../../../../layout/src/grid-layout/border-helper';\n\nimport {\n TOP, CENTER\n} from '../../../../layout/src/enums/constants';\nimport MuzeComponent from './muze-chart-component';\nimport { WIDTH, HEIGHT, HIDDEN, OVERFLOW, AUTO, VISIBLE } from '../../constants';\n\nconst renderPlaceholders = (cells) => {\n // Rendering content within placeholders\n cells.each(function (cell) {\n cell.placeholder.render(this);\n });\n};\n\nexport default class MatrixComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n this.className(params.config.className);\n }\n\n applyScroll (container) {\n const row = this.params.config.row;\n const column = this.params.config.column;\n const { horizontal, vertical } = this.params.config.scrollInfo;\n container.style(OVERFLOW, VISIBLE);\n container.style(WIDTH, AUTO);\n container.style(HEIGHT, AUTO);\n\n if (horizontal && column === 1) {\n container.style(OVERFLOW, HIDDEN);\n container.style(WIDTH, '100%');\n }\n\n if (vertical && row === CENTER) {\n container.style(OVERFLOW, HIDDEN);\n container.style(HEIGHT, '100%');\n }\n }\n\n renderMatrix (mountPoint) {\n // Creating containers for each matrix individually\n const classPrefix = this.params.config.classPrefix;\n const row = this.params.config.row;\n const column = this.params.config.column;\n const dimensions = this.params.config.dimensions;\n const border = this.params.config.border;\n\n // Creating containers for each matrix individually\n const containerForMatrix = makeElement(mountPoint, 'div', [1], `${classPrefix}-grid-${row}-${column + 1}`)\n .classed(`${classPrefix}-grid-${row}`, true)\n .classed(`${classPrefix}-grid`, true);\n\n this.applyScroll(containerForMatrix);\n\n const {\n viewMatrix,\n spans\n } = cellSpanMaker(this.component, row, column);\n\n // Rendering the table components\n const { cells } = this.renderTable(containerForMatrix, `${classPrefix}-grid`, viewMatrix);\n\n applySpans(cells, spans, { dimensions, border }, `${row}-${column}`);\n renderPlaceholders(cells);\n\n cells.exit().each((cell) => {\n cell.placeholder.remove();\n });\n\n applyBorders(cells, border, row, column);\n }\n\n renderTable (mount, className, rowData) {\n const table = makeElement(mount, 'table', ['layout'], `${className}-table`);\n const body = makeElement(table, 'tbody', ['layout'], `${className}-body`);\n const rows = makeElement(body, 'tr', rowData, `${className}-tr`);\n const cells = makeElement(rows, 'td', (d, i) => d.filter(e => e !== null).map(e =>\n ({ placeholder: e, rowIndex: i })), `${className}-td`, {}, key => key.placeholder.id);\n\n return { table, body, rows, cells };\n }\n\n draw (container) {\n this.renderMatrix(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(TOP);\n this.className(params.config.className);\n }\n}\n","import { selectElement, getEvent } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport MatrixComponent from './matrix-component';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\nimport { WHEEL_DELTA_MODIFIER } from '../../enums/constants';\n\n/**\n * Based on the type of scroll, it changes the scrollLeft/scrollTop property of the specific\n * elements based on the scroll distance provided\n *\n *\n */\nconst applyScrollAction = (elem, classPrefix, scollDistance, type) => {\n selectElement(elem)\n .selectAll(`.${classPrefix}-grid`)\n .property(type, scollDistance);\n};\n\n/**\n * Applies the action of the scroll by actually scrolling the respective matrices based on the\n * type of scroll. It returns a function which has both the scroll methods available\n *\n * @return {Object} contains the horizontal and vertical scroll actions on the grid component\n */\nconst scrollActionApplier = (movement, context) => {\n const classPrefix = context.params.config.classPrefix;\n\n return {\n horizontal: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[e][1].renderAt()}`, classPrefix, movement, 'scrollLeft'));\n },\n vertical: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[1][e].renderAt()}`, classPrefix, movement, 'scrollTop'));\n }\n };\n};\n\nexport default class GridComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.gridComponents = [];\n this.setParams(params);\n }\n\n sanitizeGrid () {\n let height = 0;\n let width = 0;\n const { viewMatricesInfo, layoutDimensions } = this.component.viewInfo();\n const scrollInfo = this.component.scrollInfo();\n const {\n viewHeight,\n viewWidth,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n\n for (let i = 0; i < 3; i++) {\n if (!(this.gridComponents.length && this.gridComponents[i] instanceof Array)) {\n this.gridComponents[i] = [];\n }\n for (let j = 0; j < 3; j++) {\n const matrixDim = {\n height: viewHeight[i],\n width: viewWidth[j],\n unitHeights,\n unitWidths\n };\n const matrix = viewMatricesInfo.matrices[`${ROW_MATRIX_INDEX[i]}`][j];\n const matrixName = `${ROW_MATRIX_INDEX[i]}-${COLUMN_MATRIX_INDEX[j]}`;\n const matrixConfig = {\n dimensions: matrixDim,\n border: layoutDimensions.border,\n classPrefix: this.params.config.classPrefix,\n scrollInfo,\n row: ROW_MATRIX_INDEX[i],\n column: j\n };\n if (this.gridComponents[i][j] instanceof MuzeComponent) {\n this.gridComponents[i][j].updateWrapper({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n } else {\n const matrixWrapper = new MatrixComponent({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n this.gridComponents[i].push(matrixWrapper);\n }\n if (i === 0) {\n width += matrixDim.width;\n }\n if (j === 0) {\n height += matrixDim.height;\n }\n }\n }\n this.boundBox({ height, width });\n\n this.component = this.gridComponents;\n this.allComponents = this.gridComponents;\n }\n\n scrollBarManager (...manager) {\n if (manager.length) {\n this._scrollBarManager = manager[0];\n return this;\n }\n return this._scrollBarManager;\n }\n\n /**\n * Attaches a mousewheel listener to the center matrix, based on which the scrolling can occur.\n * It uses the scroll component to change the position of the scroller, which ultimately scrolls the center matrix\n *\n *\n * @return {GridComponent} Instance of the GridComponent\n */\n attachScrollListener () {\n const scrollBarManager = this.scrollBarManager();\n selectElement(`#${this.component[1][1].renderAt()}`)\n .on('wheel', () => {\n const event = getEvent();\n const {\n wheelDeltaX,\n wheelDeltaY\n } = event;\n\n // Scrolling horizontally\n if (wheelDeltaX !== 0 && Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('horizontal', event)\n .triggerScrollBarAction('horizontal', wheelDeltaX / WHEEL_DELTA_MODIFIER);\n }\n\n // Scrolling Vertically\n if (wheelDeltaY !== 0 && Math.abs(wheelDeltaX) < Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('vertical', event)\n .triggerScrollBarAction('vertical', wheelDeltaY / WHEEL_DELTA_MODIFIER);\n }\n });\n return this;\n }\n\n performScrollAction (direction, movedView) {\n scrollActionApplier(movedView, this)[direction]();\n return this;\n }\n\n getBoundBox () {\n const { top, left } = this.component[0][0].boundBox();\n const { height, width } = this.boundBox();\n\n return {\n top,\n left,\n height,\n width\n };\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.className(params.config.className);\n this.sanitizeGrid();\n return this;\n }\n\n attachListener () {\n this.attachScrollListener();\n return this;\n }\n}\n","export const SIDE_EFFECT_COMMON = 'common';\nexport const SIDE_EFFECT_INDIVIDUAL = 'individual';\nexport const TOOLTIP_CONSOLIDATED = 'consolidated';\nexport const TOOLTIP_FRAGMENTED = 'fragmented';\nexport const WHEEL_DELTA_MODIFIER = 30;\n","import { selectElement, makeElement, applyStyle } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\n\nexport default class MessageComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n }\n\n render (container) {\n const parent = selectElement(container);\n\n const { config } = this.params;\n const { className } = config.classPrefix;\n\n const node = makeElement(parent, 'div', [1], className);\n const { height, width } = config.dimensions;\n const { message } = config;\n\n applyStyle(node, { width: `${width}px`, height: `${height}px` });\n\n const child = makeElement(node, 'div', [1], `${className}-child`);\n const textElement = makeElement(child, 'text', [1]);\n\n textElement.html(message);\n }\n\n draw (container) {\n this.render(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n const { target, className } = params.config;\n this.component = params.component;\n this.params = params;\n this.target(target);\n this.className(className);\n this.position(params.config.position);\n return this;\n }\n}\n","import {\n TITLE,\n SUB_TITLE,\n LEGEND, VERTICAL,\n HORIZONTAL,\n WIDTH,\n HEIGHT,\n TOP,\n LEFT,\n RIGHT,\n MESSAGE,\n GRID,\n NO_DATA_MESSAGE,\n HORIZONTAL_CENTER\n} from '../constants';\nimport HeaderComponent from './components/headerComponent';\nimport LegendComponent from './components/legendComponent';\nimport ScrollComponent from './components/scroll-component';\nimport GridComponent from './components/grid-component';\nimport MessageComponent from './components/message-component';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG, CANVAS, MESSAGE_CONFIG } from './defaults';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, CENTER } from '../../../layout/src/enums/constants';\n\n// Mapping between types of headers and their required configs for wrapper creation\nconst headerMap = {\n title: {\n headerCell: 'titleCell',\n configType: TITLE_CONFIG\n },\n subtitle: {\n headerCell: 'subtitleCell',\n configType: SUB_TITLE_CONFIG\n }\n};\n\n// Mapping of header alignment values\nconst headerAlignmentMap = {\n [LEFT]: LEFT,\n [RIGHT]: RIGHT,\n [CENTER]: HORIZONTAL_CENTER\n};\n\n/**\n * returns if data is Valid\n *\n *\n * @param {Object} params object where data has to be checked for validity\n * @return {Boolean} Returns true if all of the params are valid\n */\nconst checkParamsValidation = params => Object.keys(params).every((param => params[param]));\n\n/**\n * returns if message Component is needed or not\n *\n *\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Boolean} Returns if grid is present\n */\nconst isGridPresent = (renderDetails) => {\n const { rows, columns, values } = renderDetails.components;\n return checkParamsValidation({ rows, columns, values });\n};\n\n/**\n * Creates the wrapper for the header, i.e., title and subtitle to be used in the tree layout\n *\n *\n * @param {string} headerType type of header: title/subtite\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createHeaderWrapper = (headerType, layoutManager, renderDetails) => {\n let wrapper = null;\n\n const { components, layoutConfig } = renderDetails;\n const { headerCell, configType } = headerMap[headerType];\n const target = { target: CANVAS };\n\n if (components.headers && components.headers[headerCell]) {\n let headerConfig = layoutConfig[headerType];\n const header = components.headers[headerCell];\n\n headerConfig = Object.assign({}, headerConfig, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n alignWith: `${ROW_MATRIX_INDEX[0]}-${COLUMN_MATRIX_INDEX[1]}`,\n alignment: headerAlignmentMap[headerConfig.align],\n className: configType.className\n });\n\n const wrapperParams = {\n name: headerType,\n component: header,\n config: headerConfig\n };\n\n const existingComponent = layoutManager.getComponent(headerType);\n if (existingComponent) {\n wrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n wrapper = new HeaderComponent(wrapperParams);\n }\n }\n return wrapper;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} canvas canvas instance\n * @return {Instance} Returns the respective wrappers\n */\nconst createMessageWrapper = (layoutManager, canvas, renderDetails, renderGrid) => {\n const headerValues = Object.values(renderDetails.components.headers);\n let sum = 0;\n let messageWrapper = null;\n\n for (const val of headerValues) {\n sum += val.logicalSpace().height;\n }\n\n if (!renderGrid) {\n const defaultDimensions = { height: canvas.height() - sum, width: canvas.width() };\n const gridComponent = layoutManager.getComponent(GRID);\n const { height, width } = (gridComponent && gridComponent.getBoundBox()) || defaultDimensions;\n const target = { target: CANVAS };\n const config = {\n ...target,\n dimensions: { height, width },\n message: NO_DATA_MESSAGE,\n classPrefix: MESSAGE_CONFIG,\n position: TOP\n };\n const wrapperParams = {\n name: MESSAGE,\n component: null,\n config\n };\n const existingComponent = layoutManager.getComponent(MESSAGE);\n\n if (existingComponent) {\n messageWrapper = existingComponent.updateWrapper(wrapperParams);\n } else {\n messageWrapper = new MessageComponent(wrapperParams);\n }\n return messageWrapper;\n }\n return null;\n};\n\n// Mapping between types of scrollBars and their required configs for wrapper creation\nconst scrollBarMap = config => ({\n vertical: {\n componentName: 'verticalScrollBar',\n width: 'thickness',\n height: 'layoutBasedMeasure',\n layoutBasedMeasure: HEIGHT,\n viewMeasure: 'viewHeight',\n rowAlign: 1,\n colAlign: config.align === 'right' ? 2 : 0,\n position: config.align,\n alignment: TOP\n },\n horizontal: {\n componentName: 'horizontalScrollBar',\n width: 'layoutBasedMeasure',\n layoutBasedMeasure: WIDTH,\n viewMeasure: 'viewWidth',\n height: 'thickness',\n rowAlign: config.align === 'top' ? 0 : 2,\n colAlign: 1,\n position: config.align,\n alignment: LEFT\n }\n});\n\n/**\n * Creates the wrapper for the scroller, i.e., horizontal and vertical to be used in the tree layout\n *\n *\n * @param {string} scrollBarType type of scrollbar: horizontal/vertical\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst createScrollBarWrapper = (scrollBarType, layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let scrollBarWrapper = null;\n const { layoutConfig } = renderDetails;\n const target = { target: CANVAS };\n const { scrollBar } = layoutConfig;\n const { layoutDimensions } = grid.viewInfo();\n const {\n actualCenterMeasures,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n const {\n componentName, layoutBasedMeasure, width, height, rowAlign, colAlign,\n viewMeasure, position, alignment\n } = scrollBarMap(scrollBar[scrollBarType])[scrollBarType];\n const dimensions = {\n thickness: scrollBar.thickness,\n layoutBasedMeasure: layoutDimensions[viewMeasure][1]\n };\n const isScroll = grid.scrollInfo()[scrollBarType];\n const totalLength = actualCenterMeasures[layoutBasedMeasure];\n const viewLength = layoutDimensions[viewMeasure][1];\n\n const scrollConfig = Object.assign({}, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n scrollBarComponentConfig: {\n ...scrollBar,\n classPrefix: layoutConfig.classPrefix\n },\n\n type: scrollBarType,\n alignWith: `${ROW_MATRIX_INDEX[rowAlign]}-${COLUMN_MATRIX_INDEX[colAlign]}`,\n alignment,\n position\n });\n\n const wrapperParams = {\n name: componentName,\n config: scrollConfig,\n dimensions: {\n width: dimensions[width],\n height: dimensions[height],\n totalLength,\n viewLength,\n unitHeights,\n unitWidths\n }\n };\n\n const existingComponent = layoutManager.getComponent(componentName);\n\n if (!isScroll) {\n existingComponent && existingComponent.remove();\n return null;\n }\n\n if (existingComponent) {\n scrollBarWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n scrollBarWrapper = new ScrollComponent(wrapperParams);\n }\n\n return scrollBarWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the legend to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createLegendWrapper = (layoutManager, renderDetails, renderGrid) => {\n if (renderGrid) {\n let legendWrapper = null;\n const { components, layoutConfig, measurement } = renderDetails;\n const target = { target: CANVAS };\n\n if (components.legends && components.legends.length) {\n const legendConfig = { ...layoutConfig.legend, ...target, measurement };\n const wrapperParams = {\n name: LEGEND,\n component: components.legends,\n config: legendConfig\n };\n\n const existingComponent = layoutManager.getComponent(LEGEND);\n\n if (existingComponent) {\n legendWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n legendWrapper = new LegendComponent(wrapperParams);\n }\n }\n return legendWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst gridLayoutWrapper = (layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let gridWrapper = null;\n const target = { target: CANVAS };\n const { layoutConfig } = renderDetails;\n\n const config = {\n ...target,\n pagination: layoutConfig.pagination,\n classPrefix: layoutConfig.classPrefix,\n dimensions: { height: 0, width: 0 }\n };\n const wrapperParams = {\n name: GRID,\n component: grid,\n config\n };\n const existingComponent = layoutManager.getComponent(GRID);\n if (existingComponent) {\n gridWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n gridWrapper = new GridComponent(wrapperParams);\n }\n return gridWrapper;\n }\n return null;\n};\n/**\n * Responsible for providing the wrapper creators for every component in Muze.\n * This function, when called, returns the set of components and their respective wrappers.\n *\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} grid Instance of the grid layout\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers for each component\n */\nexport const componentWrapperMaker = (canvas, grid, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const renderGrid = isGridPresent(renderDetails);\n return {\n title: createHeaderWrapper(TITLE, layoutManager, renderDetails),\n subtitle: createHeaderWrapper(SUB_TITLE, layoutManager, renderDetails),\n message: createMessageWrapper(layoutManager, canvas, renderDetails, renderGrid),\n legend: createLegendWrapper(layoutManager, renderDetails, renderGrid),\n grid: gridLayoutWrapper(layoutManager, renderDetails, grid, renderGrid),\n verticalScrollBar: createScrollBarWrapper(VERTICAL, layoutManager, renderDetails, grid, renderGrid),\n horizontalScrollBar: createScrollBarWrapper(HORIZONTAL, layoutManager, renderDetails, grid, renderGrid)\n };\n};\n","export class ScrollManager {\n\n constructor () {\n this._scrollBarComponents = {};\n this._attachedComponents = {};\n }\n\n scrollBarComponents (...sbc) {\n if (sbc.length) {\n this._scrollBarComponents = sbc[0];\n return this;\n }\n return this._scrollBarComponents;\n }\n\n attachedComponents (...abc) {\n if (abc.length) {\n this._attachedComponents = abc[0];\n return this;\n }\n return this._attachedComponents;\n }\n\n preventBrowserScroll (type, event) {\n if (this.scrollBarComponents()[type]) {\n // Prevent default behaviour and stop propagating\n event.preventDefault();\n event.stopPropagation();\n }\n return this;\n }\n\n performAttachedScrollFunction (type, movedViewLength) {\n Object.values(this.attachedComponents()).forEach((e) => {\n e.performScrollAction(type, movedViewLength);\n });\n return this;\n }\n\n triggerScrollBarAction (type, delta) {\n this.scrollBarComponents()[type] && this.scrollBarComponents()[type].scrollDeltaTo(delta);\n return this;\n }\n}\n","import { mergeRecursive } from 'muze-utils';\nimport { arrangeComponents } from './component-resolver';\nimport { createHeaders } from './title-maker';\nimport { createLegend, getLegendSpace } from './legend-maker';\nimport { componentWrapperMaker } from './component-wrapper-maker';\nimport {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n TITLE,\n SUB_TITLE,\n LEGEND,\n VERTICAL_SCROLL_BAR,\n HORIZONTAL_SCROLL_BAR,\n GRID,\n MESSAGE\n} from '../constants';\nimport { ScrollManager } from './scroll-manager';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const prepareLayout = (layout, renderDetails) => {\n const { components, layoutConfig, measurement } = renderDetails;\n const {\n rows,\n columns,\n values,\n cornerMatrices\n } = components;\n const {\n topLeft,\n topRight,\n bottomLeft,\n bottomRight\n } = cornerMatrices;\n if (rows && columns) {\n layout.measurement(measurement)\n .config(layoutConfig)\n .matrices({\n top: [topLeft, columns[0], topRight],\n center: [rows[0], values, rows[1]],\n bottom: [bottomLeft, columns[1], bottomRight]\n })\n .triggerReflow();\n }\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} mount\n *\n */\nexport const getRenderDetails = (context, mount) => {\n let layoutConfig = mergeRecursive({}, context.config());\n // Get height width of the mount point\n let { height, width } = mount.getBoundingClientRect();\n const heightAttr = context.height();\n const widthAttr = context.width();\n const visGroup = context.composition().visualGroup;\n const {\n isColumnSizeEqual,\n isRowSizeEqual,\n priority,\n rows,\n columns,\n values\n } = visGroup.placeholderInfo();\n const {\n minWidth,\n minHeight,\n classPrefix,\n showHeaders,\n legend,\n pagination,\n scrollBar\n } = context.config();\n\n // Get title configuration\n const titleConfig = context.title()[1];\n // Get subtitle configuration\n const subtitleConfig = context.subtitle()[1];\n // Get legend position\n const legendPosition = legend.position;\n // Arrange components according to config\n const layoutArrangement = arrangeComponents(context);\n\n height = Math.floor(height);\n width = Math.floor(width);\n\n const availableHeightForCanvas = Math.max(heightAttr > 0 ? heightAttr : height, minHeight);\n const availableWidthForCanvas = Math.max(widthAttr > 0 ? widthAttr : width, minWidth);\n\n // Create headers and determine header height\n const { headers, headerHeight } = createHeaders(context, availableHeightForCanvas, availableWidthForCanvas);\n\n // Create legends and determine legend space\n const legends = createLegend(context, headerHeight, availableHeightForCanvas, availableWidthForCanvas);\n context._composition.legend = {};\n legends.forEach((e) => {\n context._composition.legend[e.scaleType] = e.legend;\n });\n\n const legendSpace = getLegendSpace(legends, legend, availableHeightForCanvas, availableWidthForCanvas);\n const legendWidth = (legendPosition === LEFT || legendPosition === RIGHT) ? legendSpace.width : 0;\n const legendHeight = (legendPosition === TOP || legendPosition === BOTTOM) ? legendSpace.height : 0;\n\n // Set components for layouting\n const components = {\n headers,\n legends,\n canvases: [context],\n rows,\n columns,\n values,\n cornerMatrices: visGroup.cornerMatrices()\n };\n\n const measurement = {\n mountSpace: {\n height,\n width\n },\n headerHeight,\n legendSpace,\n canvasWidth: availableWidthForCanvas,\n canvasHeight: availableHeightForCanvas,\n width: availableWidthForCanvas - legendWidth,\n height: availableHeightForCanvas - headerHeight - legendHeight,\n minUnitHeight: context.minUnitHeight(),\n minUnitWidth: context.minUnitWidth()\n };\n layoutConfig = mergeRecursive(layoutConfig, {\n classPrefix,\n showHeaders,\n border: mergeRecursive(visGroup.metaData().border, context.config().border),\n layoutArrangement,\n legend,\n buffer: scrollBar.thickness,\n pagination,\n title: titleConfig,\n subtitle: subtitleConfig,\n isColumnSizeEqual,\n isRowSizeEqual,\n mount,\n priority\n });\n return {\n layoutConfig,\n components,\n measurement\n };\n};\n\nconst componentIndexes = {\n title: 0,\n subtitle: 1,\n legend: 2,\n verticalScrollBar: 3,\n horizontalScrollBar: 4,\n grid: 5,\n message: 6\n};\n\nconst componentNames = {\n 0: TITLE,\n 1: SUB_TITLE,\n 2: LEGEND,\n 3: VERTICAL_SCROLL_BAR,\n 4: HORIZONTAL_SCROLL_BAR,\n 5: GRID,\n 6: MESSAGE\n};\n\nconst attachListeners = (componentWrappers) => {\n componentWrappers.forEach((componentWrapper) => {\n if (componentWrapper) {\n componentWrapper.attachListener();\n }\n });\n};\n\n/**\n * Responsible for creating a scroll manager that manages interactions between the grid\n * component and the scroll bar components\n *\n * @param {Array} componentWrappers Contains the wrappers for all the components\n * @param {Canvas} canvas Instance of the current canvas\n * @return {Array} Positions of units either horizontal or vertical\n */\nconst createScrollManager = (componentWrappers, canvas) => {\n const {\n horizontalScrollBar,\n verticalScrollBar,\n grid\n } = componentIndexes;\n\n const horizontalScrollWrapper = componentWrappers[horizontalScrollBar];\n const verticalScrollWrapper = componentWrappers[verticalScrollBar];\n const gridWrapper = componentWrappers[grid];\n const scrollBarManager = new ScrollManager();\n const scrollBarComponents = {};\n\n verticalScrollWrapper && (scrollBarComponents.vertical = verticalScrollWrapper);\n horizontalScrollWrapper && (scrollBarComponents.horizontal = horizontalScrollWrapper);\n\n scrollBarManager\n .scrollBarComponents(scrollBarComponents)\n .attachedComponents({\n grid: gridWrapper\n });\n canvas.composition().hScrollBar = horizontalScrollWrapper;\n canvas.composition().vScrollBar = verticalScrollWrapper;\n\n [horizontalScrollWrapper, verticalScrollWrapper].forEach((wrapper) => {\n wrapper && wrapper.manager(scrollBarManager);\n });\n\n gridWrapper.scrollBarManager(scrollBarManager);\n};\n\nexport const renderLayout = (canvas, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const gridLayout = canvas.layout();\n const {\n\n grid\n } = componentIndexes;\n\n // Get the component wrappers\n const compWrappers = componentWrapperMaker(canvas, gridLayout, renderDetails);\n const componentWrappers = Object.keys(componentIndexes).map(e => compWrappers[e]);\n const gridWrapper = componentWrappers[grid];\n if (gridWrapper) {\n createScrollManager(componentWrappers, canvas);\n }\n\n componentWrappers.forEach((componentWrapper, index) => {\n if (!componentWrapper) {\n const deleteElementName = componentNames[index];\n layoutManager.removeComponent(deleteElementName);\n }\n });\n layoutManager.registerComponents(componentWrappers).compute();\n attachListeners(componentWrappers);\n};\n","import {\n getDataModelFromIdentifiers,\n FieldType,\n mergeRecursive,\n isSimpleObject,\n CommonProps\n} from 'muze-utils';\nimport { Firebolt } from '@chartshq/muze-firebolt';\n\nimport { applyInteractionPolicy } from '../helper';\n\nconst defaultInteractionPolicy = (valueMatrix, firebolt) => {\n const isMeasure = field => field.type() === FieldType.MEASURE;\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n const xFields = [].concat(...visualGroup.getFieldsFromChannel('x'));\n const yFields = [].concat(...visualGroup.getFieldsFromChannel('y'));\n const colDim = xFields.every(field => field.type() === FieldType.DIMENSION);\n const fieldInf = visualGroup.resolver().getAllFields();\n const rowFacets = fieldInf.rowFacets;\n const colFacets = fieldInf.colFacets;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n if (!(xFields.every(isMeasure) && yFields.every(isMeasure))) {\n const facetFields = cell.valueOf().facetByFields()[0];\n const unitColFacets = facetFields.filter(d => colFacets.findIndex(v => v.equals(d)) !== -1);\n const unitRowFacets = facetFields.filter(d => rowFacets.findIndex(v => v.equals(d)) !== -1);\n let propFields;\n if (colDim) {\n propFields = unitColFacets.map(d => `${d}`);\n } else {\n propFields = unitRowFacets.map(d => `${d}`);\n }\n\n unitFireBolt.propagateWith('*', propFields, true);\n }\n });\n};\n\nconst defaultCrossInteractionPolicy = {\n behaviours: {\n '*': (propagationPayload, context) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = context.parentAlias();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n }\n },\n sideEffects: {\n tooltip: (propagationPayload, context) => {\n const propagationUnit = propagationPayload.sourceUnit;\n const propagationCanvas = propagationPayload.sourceCanvas;\n const unitId = context.id();\n const canvasAlias = context.parentAlias();\n if (propagationCanvas) {\n return propagationCanvas !== canvasAlias ? true : unitId === propagationUnit;\n }\n return true;\n },\n selectionBox: () => false\n }\n};\n\n/**\n * This class is responsible for dispatching any behavioural action to all the visual units housed by the canvas.\n * It is created by {@link Canvas}. This class does not handle any physical actions. Physical actions get triggered\n * in {@link VisualUnit} which is managed by it's own firebolt instance. The firebolt instance of canvas only\n * propagates the action to all the visual units in it's composition.\n *\n * To get the firebolt instance of {@link Canvas}\n * ```\n * const firebolt = canvas.firebolt();\n * ```\n *\n * @class GroupFireBolt\n * @public\n */\nexport default class GroupFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this._interactionPolicy = this.constructor.defaultInteractionPolicy();\n this.crossInteractionPolicy(this.constructor.defaultCrossInteractionPolicy());\n }\n\n static defaultInteractionPolicy () {\n return defaultInteractionPolicy;\n }\n\n static defaultCrossInteractionPolicy () {\n return defaultCrossInteractionPolicy;\n }\n\n interactionPolicy (...policy) {\n if (policy.length) {\n this._interactionPolicy = policy[0] || this.constructor.defaultInteractionPolicy();\n return this;\n }\n return this._interactionPolicy;\n }\n\n crossInteractionPolicy (...policy) {\n if (policy.length) {\n this._crossInteractionPolicy = mergeRecursive(mergeRecursive({},\n this.constructor.defaultCrossInteractionPolicy()), policy[0] || {});\n const context = this.context;\n applyInteractionPolicy(this);\n context._throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => {\n applyInteractionPolicy(this);\n });\n return this;\n }\n return this._crossInteractionPolicy;\n }\n\n /**\n * Dispatches a behavioural action with a payload. It takes the name of the behavioural action and a payload\n * object which contains the criteria aend an array of side effects which determines what side effects are\n * going to be shown in each visual unit of the canvas. It prepares the datamodel from the given criteria\n * and initiates a propagation from the datamodel of canvas. Then all the visual units of canvas which listens\n * to the propagation gets informed on which rows got selected and dispatches the behavioural action sent during\n * propagation.\n *\n * To dispatch a behavioural action on the canvas\n * ```\n * // Get the firebolt instance of the canvas\n * const firebolt = canvas.firebolt();\n * // Dispatch a brush behaviour\n * firebolt.dispatchBehaviour('brush', {\n * // Selects all the rows with Horsepower having range between 100 and 200.\n * criteria: {\n * Horsepower: [100, 200]\n * }\n * });\n * // On dispatch of this behavioural action, a selection box gets created and plots gets faded out which are the\n * // default side effects mapped to this behavioural action.\n * ```\n *\n * ```\n * Additionally, it can also be passed an array of side effects in the payload.\n * // Dispatch a select behaviour with only crossline as side effect.\n * firebolt.dispatchBehaviour('select', {\n * criteria: {\n * Cylinders: ['8']\n * },\n * sideEffects: ['crossline']\n * });\n * ```\n *\n * @public\n *\n * @param {string} behaviour Name of the behavioural action\n * @param {Object} payload Object which contains the interaction information.\n * @param {Object | Array.} payload.criteria Identifiers by which the selection happens.\n * @param {Array.} payload.sideEffects Side effects which needs to be shown.\n *\n * @return {GroupFireBolt} Instance of firebolt.\n */\n dispatchBehaviour (behaviour, payload) {\n const propPayload = Object.assign(payload);\n const criteria = propPayload.criteria;\n const data = this.context.composition().visualGroup.getGroupByData();\n const fieldsConfig = data.getFieldsConfig();\n const model = getDataModelFromIdentifiers(data, criteria);\n const behaviouralAction = this._actions.behavioural[behaviour];\n\n if (behaviouralAction) {\n const fields = isSimpleObject(criteria) ? Object.keys(criteria) : (criteria ? criteria[0] : []);\n const validFields = fields.filter(field => field in fieldsConfig);\n const mutates = behaviouralAction.constructor.mutates();\n const propConfig = {\n payload: propPayload,\n action: behaviour,\n criteria: model,\n sourceId: this.context.alias(),\n isMutableAction: mutates,\n propagateInterpolatedValues: validFields.every(field => fieldsConfig[field].def.type ===\n FieldType.MEASURE)\n };\n data.propagate(model, propConfig, true);\n }\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n return this;\n }\n}\n","import GroupFireBolt from './group-firebolt';\n\nexport default GroupFireBolt;\n","export const APP_INITIAL_STATE = {\n app: {\n group: {},\n units: {},\n layers: {},\n canvas: {}\n },\n local: {\n canvas: {},\n group: {},\n units: {},\n layers: {}\n }\n};\n\n","import { GridLayout } from '@chartshq/layout';\nimport { transactor, Store, getUniqueId, selectElement, STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { RETINAL } from '../constants';\nimport TransactionSupport from '../transaction-support';\nimport { getRenderDetails, prepareLayout, renderLayout } from './layout-maker';\nimport { localOptions, canvasOptions } from './local-options';\nimport GroupFireBolt from './firebolt';\nimport options from '../options';\nimport { APP_INITIAL_STATE } from './app-state';\nimport { initCanvas,\n setupChangeListener,\n setLabelRotationForAxes,\n createGroupState,\n createLayoutManager,\n setLayoutInfForUnits\n} from './helper';\n/**\n * Canvas is a logical component which houses a visualization by taking multiple variable in different encoding channel.\n * Canvas manages lifecycle of many other logical component and exposes one consistent interface for creation of chart.\n * Canvas is intialized from environment with settings from environment and singleton dependencies.\n *\n * To create an instance of canvas\n * ```\n * const env = Muze();\n * const canvas = env.canvas()\n * ```\n *\n *\n * @class\n * @public\n * @module Canvas\n */\nexport default class Canvas extends TransactionSupport {\n\n /**\n * Creates reactive property accessors.\n * - data\n * - height\n * - width\n * - config\n * This configs are retrieved from options.\n */\n constructor (globalDependencies) {\n super();\n\n this._allOptions = Object.assign({}, options, localOptions);\n this._registry = {};\n this._composition = {};\n this._cachedProps = {};\n this._alias = null;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n this._composition.layout = new GridLayout();\n this._store = new Store(APP_INITIAL_STATE);\n\n this._throwback = new Store({\n [CommonProps.MATRIX_CREATED]: false,\n [CommonProps.ON_LAYER_DRAW]: null\n });\n\n // Setters and getters will be mounted on this. The object will be mutated.\n const namespace = STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE;\n const allOptions = Object.assign({}, options, localOptions, canvasOptions);\n\n transactor(this, allOptions, this._store, {\n namespace\n });\n\n this.dependencies(Object.assign({}, globalDependencies, this._dependencies));\n this.firebolt(new GroupFireBolt(this, {\n behavioural: behaviouralActions,\n physical: physicalActions,\n physicalBehaviouralMap: {}\n }, sideEffects, behaviourEffectMap));\n this.alias(`canvas-${getUniqueId()}`);\n this.title('', {});\n this.subtitle('', {});\n this.legend({});\n this.color({});\n this.shape({});\n this.size({});\n setupChangeListener(this);\n // init layoutManager\n this._layoutManager = createLayoutManager();\n }\n\n /**\n * Retrieves an instance of layout which is responsible for layouting. Layout is responsible for creating faceted\n * presentation using table layout.\n *\n * @public\n *\n * @return {GridLayout} Instance of layout attached to canvas.\n */\n layout (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().layout;\n }\n\n /**\n * Retrieves the composition for a canvas\n *\n * @public\n *\n * @return {object} Instances of the components which canvas requires to draw the full visualization.\n * ```\n * {\n * layout: // Instance of {@link GridLayout}\n * legend: // Instance of {@link Legend}\n * subtitle: // Instance of {@link TextCell} using which the title is rendered\n * title: // Instance of {@link TextCell} using which the title is rendered\n * visualGroup: // Instance of {@link visualGroup}\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Sets or gets the alias of the canvas. Alias is a name by which the canvas can be referred.\n *\n * When setter\n * @param {string} alias Name of the alias.\n *\n * @return {Canvas} Instance of the canvas.\n *\n * When getter\n *\n * @return {string} Alias of canvas.\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n const visualGroup = this.composition().visualGroup;\n this._alias = params[0];\n visualGroup && visualGroup.alias(this.alias());\n return this;\n }\n return this._alias;\n }\n\n /**\n * Creates an instance initiated with given settings.\n *\n * @param {Object} initialSettings Initial settings to be populated in the model\n * @param {Object} regEntry newly created instance with the initial settings\n * @param {Object} globalDependencies dependencies which will be created only once in the page\n *\n * @return {Object} newly created instance with the initial settings\n */\n static withSettings (initialSettings, regEntry, globalDependencies) {\n const instance = new Canvas(globalDependencies);\n\n for (const key in initialSettings) {\n instance[key](initialSettings[key]);\n }\n // set registry for instance\n instance.registry(regEntry);\n return instance;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof Canvas\n */\n static formalName () {\n return 'canvas';\n }\n\n /**\n * Returns the instance of firebolt associated with this canvas. The firebolt instance can be used to dispatch a\n * behaviour dynamically on the canvas. This firebolt does not handle any physical actions. It is just used to\n * propagate the action to all the visual units in it's composition.\n *\n * @public\n *\n * @return {GroupFireBolt} Instance of firebolt associated with canvas.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Registry peoperty accessor\n *\n * @param {Object} reg plain old javascript object keyvalue pairs. Key containing module name and value contains\n * module definition class. The reg object has to be flat object of level 1.\n */\n registry (...params) {\n if (params.length) {\n const components = Object.assign({}, params[0].components);\n const componentSubRegistry = Object.assign({}, params[0].componentSubRegistry);\n\n this._registry = { components, componentSubRegistry };\n const initedComponents = initCanvas(this);\n // @todo is it okay to continue this tight behaviour? If not use a resolver to resolve diff component type.\n this._composition.visualGroup = initedComponents[0];\n createGroupState(this);\n this.composition().visualGroup.alias(this.alias()).store(this._store);\n return this;\n }\n return this._registry;\n }\n\n /*\n * Prepare dependencies for top level elements\n */\n dependencies (...param) {\n if (param.length) {\n this._dependencies = param[0];\n return this;\n }\n // @todo prepare dependencies here.\n return this._dependencies;\n }\n\n /**\n *\n *\n * @param {*} lifeCycles\n *\n * @memberof Canvas\n */\n lifeCycle (lifeCycles) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n if (lifeCycles) {\n lifeCycleManager.register(lifeCycles);\n return this;\n }\n return lifeCycleManager;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof Canvas\n */\n legend (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().legend;\n }\n\n /**\n * Returns a promise for various {@link LifecycleEvents} of the various components of canvas. The promise gets\n * resolved once the particular event gets completed.\n *\n * To use this,\n * ```\n * canvas.once('layer.drawn').then(() => {\n * // Do any post drawing work here.\n * });\n * ```\n * @public\n *\n * @param {string} eventName Name of the lifecycle event.\n *\n * @return {Promise} A pending promise waiting for resolve to be called.\n */\n once (eventName) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n return lifeCycleManager.retrieve(eventName);\n }\n\n /**\n * Internal function to trigger render, this method is cognizant of all the properties of the core modules and\n * establish a passive reactivity. Passive reactivity is not always a bad thing :)\n * @internal\n */\n render () {\n const mount = this.mount();\n // removeChild(mount);\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n // Get render details including arrangement and measurement\n const renderDetails = getRenderDetails(this, mount);\n lifeCycleManager.notify({ client: this, action: 'beforedraw' });\n // Prepare the layout by triggering the matrix calculation\n prepareLayout(this.layout(), renderDetails);\n\n this._layoutManager.dimension({\n height: renderDetails.measurement.canvasHeight,\n width: renderDetails.measurement.canvasWidth\n });\n\n this._layoutManager.renderAt(mount);\n\n // Render each component\n renderLayout(this, renderDetails);\n\n setLayoutInfForUnits(this);\n\n // setLabelRotation\n setLabelRotationForAxes(this);\n }\n\n /**\n * Returns the instances of x axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the top axis and the second element represents the bottom\n * // axis.\n * [\n * [X1, X2],\n * [X3, X4]\n * ]\n * ```\n * @public\n *\n * @return {Array.} Instances of x axis.\n */\n xAxes () {\n return this.composition().visualGroup.getAxes('x');\n }\n\n /**\n * Returns the instances of y axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the left axis and the second element represents the right\n * // axis.\n * [\n * [Y1, Y2],\n * [Y3, Y4]\n * ]\n * ```\n * @public\n * @return {Array.} Instances of y axis.\n */\n yAxes () {\n return this.composition().visualGroup.getAxes('y');\n }\n\n /**\n * Returns all the retinal axis of the canvas. Color, shape and size axis are combinedly called retinal axis.\n *\n * @public\n * @return {Object} Instances of retinal axis.\n * ```\n * {\n * color: [ColorAxis], // Array of color axis.\n * shape: [ShapeAxis], // Array of shape axis.\n * size: [SizeAxis] // Array of size axis.\n * }\n * ```\n */\n getRetinalAxes () {\n const visualGroup = this.composition().visualGroup;\n return visualGroup.getAxes(RETINAL);\n }\n\n mount (...params) {\n if (params.length) {\n let value = params[0];\n if (typeof params[0] === 'string') {\n value = selectElement(params[0]).node();\n }\n this._mount = value;\n return this;\n }\n return this._mount;\n }\n}\n","import { cellRegistry, SimpleCell } from '@chartshq/visual-cell';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { layerRegistry } from '@chartshq/visual-layer';\nimport { SimpleGroup, VisualGroup } from '@chartshq/visual-group';\n\nexport const COMPONENTS = {\n VisualGroup,\n VisualUnit\n};\nexport const SUBREGISTRIES = {\n cellRegistry,\n layerRegistry\n};\nexport const INTERFACES = {\n SimpleGroup,\n SimpleCell\n};\n\n","import { DEFAULT_LAYERS } from './defaults';\n\nexport default () => {\n const reg = DEFAULT_LAYERS;\n const regObj = {\n set: (key, def) => {\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n return regObj;\n};\n","import {\n transactor,\n Smartlabel,\n enableChainedTransaction,\n LifeCycleManager,\n DataModel,\n makeElement,\n getClientPoint,\n selectElement,\n getEvent,\n require,\n DateTimeFormatter,\n Store\n} from 'muze-utils';\n\nimport {\n SurrogateSideEffect,\n SpawnableSideEffect,\n sideEffects,\n PersistentBehaviour,\n GenericBehaviour,\n VolatileBehaviour,\n behaviouralActions,\n GenericSideEffect\n} from '@chartshq/muze-firebolt';\nimport { layerFactory } from '@chartshq/visual-layer';\nimport pkg from '../package.json';\nimport * as operators from './operators';\nimport { actionModel as ActionModel } from './action-model';\nimport options from './options';\nimport { Canvas } from './canvas';\nimport { COMPONENTS, SUBREGISTRIES } from './default-registry';\nimport './muze.scss';\n\n// Cache singleton instances which should be included only once in a page\nconst globalCache = {};\nconst defaultRegistry = COMPONENTS;\n\nconst overrideRegistryDefinitions = (overrideRegistry, registry) => {\n for (const prop in overrideRegistry) {\n registry.set(prop, overrideRegistry[prop]);\n }\n};\n\n/**\n * Entry point to renderer. Initializes an environment with settings and registries for canvas. This is a simple wrapper\n * over {@link Canvas} which enables common configuration passing to multiple such canvases.\n *\n * Everytime `muze()` is called it creates an environment. These environment supports subset of APIs of Canvas. If\n * common configuration is used to render multiple canvases then it can be set directly in the env. Like if data is\n * common across all the visulization then its better to set the data in env. When a canvas is created it receives all\n * those configuration from env.\n *\n * ```\n * // Creates an environment\n * const env = muze()\n * // Set data property in environment, so that all the canvas created from the same environment gets this data\n * // automatically\n * env.data(dm);\n * // Creates canvas, by default env pushes data to canvas instance\n * const canvas = env.canvas();\n * ```\n *\n * If a property is set on both environment and canvas instance, property set on canvas instance gets more priority.\n *\n * @public\n * @module muze\n * @namespace Muze\n *\n * @return {Env} Instance of an environment\n */\nconst muze = () => {\n // Setters and getters will be mounted on this. Object will be mutated.\n const [env, globalStore] = transactor({}, options);\n const components = Object.assign({}, COMPONENTS);\n const componentSubRegistryDef = Object.assign(SUBREGISTRIES);\n const componentSubRegistry = {};\n\n for (const prop in componentSubRegistryDef) {\n componentSubRegistry[prop] = componentSubRegistryDef[prop]();\n }\n\n // Apart form the setter getter, an instance method is injected to create real renderer instances\n env.canvas = () => {\n // Create a canvas instance with this settings\n const settings = globalStore.serialize();\n const canvas = Canvas.withSettings(settings, { /* registry */\n components,\n componentSubRegistry\n }, env.globalDependencies());\n\n // Whenever settings is changed canvas is updated\n enableChainedTransaction(globalStore, canvas, Object.keys(settings));\n\n return canvas;\n };\n\n // Global dependencies for for compositions. Only one copy of the same should be in the page\n env.globalDependencies = () => {\n if (!globalCache.smartlabel) {\n globalCache.smartlabel = new Smartlabel(1, 'body');\n }\n return {\n smartlabel: globalCache.smartlabel,\n lifeCycleManager: new LifeCycleManager()\n };\n };\n\n // Retrieves global settings. This getter is readonly so that user can't change this as change should happen\n // only from setter to avoid unwanted sync issues.\n env.settings = () => globalStore.serialize();\n\n env.registry = (...overrideRegistry) => {\n // Selectively copy the properties from COMPONENTS\n if (overrideRegistry.length) {\n for (const prop in overrideRegistry) {\n if (prop in defaultRegistry) {\n components[prop] = overrideRegistry[prop];\n }\n }\n return env;\n }\n return components;\n };\n\n env.cellRegistry = (...overrideRegistry) => {\n const cellRegistry = componentSubRegistry.cellRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry[0], cellRegistry);\n return env;\n }\n return cellRegistry.get();\n };\n\n env.layerRegistry = (...overrideRegistry) => {\n const layerRegistry = componentSubRegistry.layerRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry[0], layerRegistry);\n return env;\n }\n return layerRegistry.get();\n };\n\n return env;\n};\n\nconst SideEffects = {\n sideEffects,\n standards: {\n SurrogateSideEffect,\n SpawnableSideEffect,\n GenericSideEffect\n }\n};\n\nconst Behaviours = {\n behaviouralActions,\n standards: {\n GenericBehaviour,\n PersistentBehaviour,\n VolatileBehaviour\n }\n};\n\nmuze.DataModel = DataModel;\nmuze.version = pkg.version;\nmuze.SideEffects = SideEffects;\nmuze.ActionModel = ActionModel;\nmuze.layerFactory = layerFactory;\nmuze.Operators = operators;\nmuze.Behaviours = Behaviours;\nmuze.utils = {\n getClientPoint,\n getEvent,\n makeElement,\n selectElement,\n DateTimeFormatter,\n require\n};\nmuze.Model = new Store().model.constructor;\nexport default muze;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/muze/npm/package.json b/packages/muze/npm/package.json index 447db11a..f46319db 100644 --- a/packages/muze/npm/package.json +++ b/packages/muze/npm/package.json @@ -1,13 +1,13 @@ { "name": "muze", - "version": "1.2.3", + "version": "1.2.1", "description": "Composable visualisation library for web with a data-first approach", "homepage": "https://muzejs.org", "license": "MIT", "author": "Muzejs.org (https://muzejs.org/)", "contributors": [ { - "name": "Akash Goswami", + "name": "Akash Ghoswami", "email": "akashgoswami90s@gmail.com" }, { @@ -28,21 +28,12 @@ }, { "name": "Rousan Ali", - "email": "hello@rousan.io", + "email": "rousanali786@gmail.com", "url": "https://rousan.io" }, { "name": "Ujjal Kumar Dutta", - "email": "duttaujjal143@gmail.com" - }, - { - "name": "Adarsh Lilha", - "email": "adarshlilha@gmail.com", - "url": "https://adarshlilha.com" - }, - { - "name": "Swati Mukherjee", - "email": "swati@charts.com" + "email": "duttaujjalkumar@live.com" } ], "main": "dist/muze.js", @@ -64,4 +55,4 @@ "url": "https://github.com/chartshq/muze" }, "dependencies": {} -} \ No newline at end of file +} diff --git a/packages/muze/package.json b/packages/muze/package.json index e83ffeaa..b13dcb0a 100644 --- a/packages/muze/package.json +++ b/packages/muze/package.json @@ -1,7 +1,7 @@ { "name": "muze", "private": true, - "version": "1.2.3", + "version": "1.3.0", "description": "Composable visualisation library for web with a data-first approach", "homepage": "https://muzejs.org", "author": "Muzejs.org (https://muzejs.org/)", @@ -74,4 +74,4 @@ "@chartshq/visual-layer": "^1.0.0", "@chartshq/visual-unit": "^1.0.0" } -} \ No newline at end of file +} diff --git a/packages/muze/src/action-model.js b/packages/muze/src/action-model.js index 0d0ea7b9..04421295 100644 --- a/packages/muze/src/action-model.js +++ b/packages/muze/src/action-model.js @@ -8,6 +8,12 @@ const defaultPolicy = (registrableComponents) => { const propagationCanvas = propagationPayload.sourceCanvas; return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true; } + }, + sideEffects: { + '*': (propagationPayload) => { + const propagationCanvas = propagationPayload.sourceCanvas; + return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true; + } } }; }; @@ -108,6 +114,7 @@ class ActionModel { */ registerPhysicalActions (action) { registerActions(this, 'physicalActions', 'registerPhysicalActions', action); + return this; } diff --git a/packages/muze/src/border-applier.scss b/packages/muze/src/border-applier.scss new file mode 100644 index 00000000..c315e9b3 --- /dev/null +++ b/packages/muze/src/border-applier.scss @@ -0,0 +1,53 @@ +@import "./prefix.scss"; + +.#{$prefix}grid-normal { + border-color: #ebebeb; + + .#{$prefix}axis-name{ + font-size: 12px; + line-height: 15px; + } +} + +.#{$prefix}grid-dark { + border-color: #cbcbcb; + + .#{$prefix}axis-name{ + font-size: 12px; + line-height: 15px; + } +} +.#{$prefix}grid-dark-bottom { + border-bottom-color:#cbcbcb; +} + +.#{$prefix}grid-darker-top { + border-top-color: #979797; +} +.#{$prefix}grid-dark-top { + border-top-color: #cbcbcb; +} +.#{$prefix}grid-dark-right { + border-right-color: #cbcbcb; +} + +.#{$prefix}grid-darker-bottom { + border-bottom-color: #979797; +} + +.#{$prefix}grid-dark-left { + border-left-color: #cbcbcb; +} + +.#{$prefix}grid-none-left { + border-left-color:transparent; +} +.#{$prefix}grid-none-right { + border-right-color:transparent; +} +.#{$prefix}grid-none-top { + border-top-color:transparent; +} +.#{$prefix}grid-none-bottom { + border-bottom-color:transparent; +} diff --git a/packages/muze/src/canvas/canvas.js b/packages/muze/src/canvas/canvas.js index fa1ca4f0..878a55c8 100644 --- a/packages/muze/src/canvas/canvas.js +++ b/packages/muze/src/canvas/canvas.js @@ -1,5 +1,6 @@ import { GridLayout } from '@chartshq/layout'; import { transactor, Store, getUniqueId, selectElement, STATE_NAMESPACES, CommonProps } from 'muze-utils'; +import UnitBrushBehaviour from '@chartshq/visual-unit/src/firebolt/behaviours/brush'; import { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt'; import { RETINAL } from '../constants'; import TransactionSupport from '../transaction-support'; @@ -58,7 +59,8 @@ export default class Canvas extends TransactionSupport { this._throwback = new Store({ [CommonProps.MATRIX_CREATED]: false, - [CommonProps.ON_LAYER_DRAW]: null + [CommonProps.ON_LAYER_DRAW]: null, + propagationInfo: null }); // Setters and getters will be mounted on this. The object will be mutated. @@ -71,7 +73,9 @@ export default class Canvas extends TransactionSupport { this.dependencies(Object.assign({}, globalDependencies, this._dependencies)); this.firebolt(new GroupFireBolt(this, { - behavioural: behaviouralActions, + behavioural: Object.assign({}, behaviouralActions, { + brush: UnitBrushBehaviour + }), physical: physicalActions, physicalBehaviouralMap: {} }, sideEffects, behaviourEffectMap)); @@ -209,10 +213,12 @@ export default class Canvas extends TransactionSupport { */ registry (...params) { if (params.length) { - const components = Object.assign({}, params[0].components); - const componentSubRegistry = Object.assign({}, params[0].componentSubRegistry); + const param = params[0]; + const components = Object.assign({}, param.components); + const componentSubRegistry = Object.assign({}, param.componentSubRegistry); + const interactionRegistry = Object.assign({}, param.interactions); - this._registry = { components, componentSubRegistry }; + this._registry = { components, componentSubRegistry, interactions: interactionRegistry }; const initedComponents = initCanvas(this); // @todo is it okay to continue this tight behaviour? If not use a resolver to resolve diff component type. this._composition.visualGroup = initedComponents[0]; @@ -314,6 +320,8 @@ export default class Canvas extends TransactionSupport { // setLabelRotation setLabelRotationForAxes(this); + + this.firebolt().mapActionsAndBehaviour(); } /** diff --git a/packages/muze/src/canvas/component-wrapper-maker.js b/packages/muze/src/canvas/component-wrapper-maker.js index 8e9825fe..5fc58f63 100644 --- a/packages/muze/src/canvas/component-wrapper-maker.js +++ b/packages/muze/src/canvas/component-wrapper-maker.js @@ -10,7 +10,7 @@ import { RIGHT, MESSAGE, GRID, - NO_DATA_MESSAGE, + ERROR_MESSAGE, HORIZONTAL_CENTER } from '../constants'; import HeaderComponent from './components/headerComponent'; @@ -114,8 +114,9 @@ const createHeaderWrapper = (headerType, layoutManager, renderDetails) => { * @param {GridLayout} canvas canvas instance * @return {Instance} Returns the respective wrappers */ -const createMessageWrapper = (layoutManager, canvas, renderDetails, renderGrid) => { - const headerValues = Object.values(renderDetails.components.headers); +const createMessageWrapper = (layoutManager, renderDetails, renderGrid) => { + const { components, measurement } = renderDetails; + const headerValues = Object.values(components.headers); let sum = 0; let messageWrapper = null; @@ -124,14 +125,14 @@ const createMessageWrapper = (layoutManager, canvas, renderDetails, renderGrid) } if (!renderGrid) { - const defaultDimensions = { height: canvas.height() - sum, width: canvas.width() }; + const defaultDimensions = { height: measurement.canvasHeight - sum, width: measurement.canvasWidth }; const gridComponent = layoutManager.getComponent(GRID); const { height, width } = (gridComponent && gridComponent.getBoundBox()) || defaultDimensions; const target = { target: CANVAS }; const config = { ...target, dimensions: { height, width }, - message: NO_DATA_MESSAGE, + message: ERROR_MESSAGE, classPrefix: MESSAGE_CONFIG, position: TOP }; @@ -348,7 +349,7 @@ export const componentWrapperMaker = (canvas, grid, renderDetails) => { return { title: createHeaderWrapper(TITLE, layoutManager, renderDetails), subtitle: createHeaderWrapper(SUB_TITLE, layoutManager, renderDetails), - message: createMessageWrapper(layoutManager, canvas, renderDetails, renderGrid), + message: createMessageWrapper(layoutManager, renderDetails, renderGrid), legend: createLegendWrapper(layoutManager, renderDetails, renderGrid), grid: gridLayoutWrapper(layoutManager, renderDetails, grid, renderGrid), verticalScrollBar: createScrollBarWrapper(VERTICAL, layoutManager, renderDetails, grid, renderGrid), diff --git a/packages/muze/src/canvas/components/grid-component.js b/packages/muze/src/canvas/components/grid-component.js index 0630be60..afe3d1a6 100644 --- a/packages/muze/src/canvas/components/grid-component.js +++ b/packages/muze/src/canvas/components/grid-component.js @@ -79,12 +79,18 @@ export default class GridComponent extends MuzeComponent { column: j }; if (this.gridComponents[i][j] instanceof MuzeComponent) { + const { isFacet, showHeaders } = this.params.component.config(); + matrixConfig.isFacet = isFacet; + matrixConfig.showHeaders = showHeaders; this.gridComponents[i][j].updateWrapper({ name: matrixName, component: matrix, config: matrixConfig }); } else { + const { isFacet, showHeaders } = this.params.component.config(); + matrixConfig.isFacet = isFacet; + matrixConfig.showHeaders = showHeaders; const matrixWrapper = new MatrixComponent({ name: matrixName, component: matrix, diff --git a/packages/muze/src/canvas/components/legendComponent.js b/packages/muze/src/canvas/components/legendComponent.js index 0371bb42..c94ed87e 100644 --- a/packages/muze/src/canvas/components/legendComponent.js +++ b/packages/muze/src/canvas/components/legendComponent.js @@ -85,8 +85,8 @@ export default class LegendComponent extends MuzeComponent { .style('width', `${legWidth}px`); makeElement(mount, 'div', this.components, `${classPrefix}-legend-components`, {}, d => d.legend.id()) - .each(function (d) { d.legend.mount(this); }) - .style('width', d => `${d.legend.measurement().width}px`); + .style('width', d => `${d.legend.measurement().width}px`) + .each(function (d) { d.legend.mount(this); }); } } @@ -112,4 +112,12 @@ export default class LegendComponent extends MuzeComponent { this.alignment(params.config.alignment || alignment); } + setComponentInfo (params) { + const { rootNode } = params; + this.components.forEach((legendInfo) => { + const leg = legendInfo.legend; + leg.setParentInfo({ canvasRoot: rootNode }); + }); + } + } diff --git a/packages/muze/src/canvas/components/matrix-component.js b/packages/muze/src/canvas/components/matrix-component.js index 8cd7232c..b92effa6 100644 --- a/packages/muze/src/canvas/components/matrix-component.js +++ b/packages/muze/src/canvas/components/matrix-component.js @@ -1,7 +1,7 @@ import { makeElement } from 'muze-utils'; import { cellSpanMaker, applySpans } from '../../../../layout/src/grid-layout/span-maker'; import { applyBorders } from '../../../../layout/src/grid-layout/border-helper'; - +import '../../border-applier.scss'; import { TOP, CENTER } from '../../../../layout/src/enums/constants'; @@ -43,12 +43,7 @@ export default class MatrixComponent extends MuzeComponent { } renderMatrix (mountPoint) { - // Creating containers for each matrix individually - const classPrefix = this.params.config.classPrefix; - const row = this.params.config.row; - const column = this.params.config.column; - const dimensions = this.params.config.dimensions; - const border = this.params.config.border; + const { classPrefix, row, column, dimensions, border, isFacet, showHeaders } = this.params.config; // Creating containers for each matrix individually const containerForMatrix = makeElement(mountPoint, 'div', [1], `${classPrefix}-grid-${row}-${column + 1}`) @@ -72,15 +67,21 @@ export default class MatrixComponent extends MuzeComponent { cell.placeholder.remove(); }); - applyBorders(cells, border, row, column); + applyBorders({ cells, border, row, column, isFacet, showHeaders }); } renderTable (mount, className, rowData) { const table = makeElement(mount, 'table', ['layout'], `${className}-table`); const body = makeElement(table, 'tbody', ['layout'], `${className}-body`); const rows = makeElement(body, 'tr', rowData, `${className}-tr`); - const cells = makeElement(rows, 'td', (d, i) => d.filter(e => e !== null).map(e => - ({ placeholder: e, rowIndex: i })), `${className}-td`, {}, key => key.placeholder.id); + const cells = makeElement(rows, 'td', + (d, i) => d.filter(e => e !== null).map(e => + ({ placeholder: e, rowIndex: i })), `${className}-td`, { + update: (elem, cell) => { + const { externalClassname } = cell.placeholder.config(); + externalClassname && externalClassname.map(d => elem.classed(`${className}-${d}`, true)); + } + }, key => key.placeholder.id); return { table, body, rows, cells }; } diff --git a/packages/muze/src/canvas/components/message-component.js b/packages/muze/src/canvas/components/message-component.js index 529aacdd..8ab5d383 100644 --- a/packages/muze/src/canvas/components/message-component.js +++ b/packages/muze/src/canvas/components/message-component.js @@ -1,5 +1,23 @@ import { selectElement, makeElement, applyStyle } from 'muze-utils'; import MuzeComponent from './muze-chart-component'; +import { incorrectMessageIcon } from './message-icon'; +import { MESSAGE_CONFIG } from '../defaults'; + +const formatFontSize = (width, height) => { + const { baseFontLimit, upperFontLimit, baseSizeLimit, upperSizeLimit } = MESSAGE_CONFIG; + const fractionFont = (upperSizeLimit - baseSizeLimit) / (upperFontLimit - baseFontLimit); + let fontSize = upperFontLimit; + const dim = width < height && width !== 0 ? width : height; + + if (dim === 0) { + fontSize = 0; + } else if (dim <= baseSizeLimit) { + fontSize = baseFontLimit; + } else if (dim > baseSizeLimit && dim < upperSizeLimit) { + fontSize = baseFontLimit + (upperSizeLimit - dim) / fractionFont; + } + return fontSize; +}; export default class MessageComponent extends MuzeComponent { constructor (params) { @@ -15,12 +33,22 @@ export default class MessageComponent extends MuzeComponent { const node = makeElement(parent, 'div', [1], className); const { height, width } = config.dimensions; + const childHeight = height > MESSAGE_CONFIG.baseSizeLimit ? MESSAGE_CONFIG.fractionChild * height : 0; const { message } = config; applyStyle(node, { width: `${width}px`, height: `${height}px` }); - const child = makeElement(node, 'div', [1], `${className}-child`); - const textElement = makeElement(child, 'text', [1]); + const childNode = makeElement(node, 'div', [1], `${className}-child`); + const imageNode = makeElement(childNode, 'div', [1], `${className}-child-img`); + const messageNode = makeElement(childNode, 'div', [1], `${className}-child-message`); + + applyStyle(childNode, { width, height: `${childHeight}px` }); + applyStyle(imageNode, { width, height: `${childHeight * MESSAGE_CONFIG.fractionImage}px` }); + + imageNode.html(incorrectMessageIcon); + + const textElement = makeElement(messageNode, 'text', [1]); + applyStyle(messageNode, { 'font-size': `${formatFontSize(width, height)}px` }); textElement.html(message); } diff --git a/packages/muze/src/canvas/components/message-icon.js b/packages/muze/src/canvas/components/message-icon.js new file mode 100644 index 00000000..dd6bcae0 --- /dev/null +++ b/packages/muze/src/canvas/components/message-icon.js @@ -0,0 +1,93 @@ +export const incorrectMessageIcon = ` + + +Group 23 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `; diff --git a/packages/muze/src/canvas/components/muze-chart-component.js b/packages/muze/src/canvas/components/muze-chart-component.js index d1dc0f2a..4120e789 100644 --- a/packages/muze/src/canvas/components/muze-chart-component.js +++ b/packages/muze/src/canvas/components/muze-chart-component.js @@ -26,4 +26,8 @@ export default class MuzeComponent extends LayoutComponent { setParams () { throw Error('set params is not implemented'); } + + setComponentInfo () { + throw Error('setComponentInfo is not implemented'); + } } diff --git a/packages/muze/src/canvas/defaults.js b/packages/muze/src/canvas/defaults.js index 28a87512..5a51aaf4 100644 --- a/packages/muze/src/canvas/defaults.js +++ b/packages/muze/src/canvas/defaults.js @@ -16,7 +16,13 @@ export const SUB_TITLE_CONFIG = { }; export const MESSAGE_CONFIG = { - className: `${MUZE_PREFIX}-message-container` + className: `${MUZE_PREFIX}-message-container`, + baseFontLimit: 16, + upperFontLimit: 24, + baseSizeLimit: 100, + upperSizeLimit: 300, + fractionImage: 0.8, + fractionChild: 0.7 }; export const CANVAS = 'canvas'; diff --git a/packages/muze/src/canvas/firebolt/group-firebolt.js b/packages/muze/src/canvas/firebolt/group-firebolt.js index 6db65f84..8f8358fc 100644 --- a/packages/muze/src/canvas/firebolt/group-firebolt.js +++ b/packages/muze/src/canvas/firebolt/group-firebolt.js @@ -1,60 +1,147 @@ import { - getDataModelFromIdentifiers, FieldType, mergeRecursive, - isSimpleObject, - CommonProps + CommonProps, + ReservedFields } from 'muze-utils'; -import { Firebolt } from '@chartshq/muze-firebolt'; - +import { Firebolt, getSideEffects } from '@chartshq/muze-firebolt'; +import { createMapByDimensions } from '@chartshq/visual-unit/src/firebolt/helper'; +import { + payloadGenerator, + isSideEffectEnabled, + sanitizePayloadCriteria, + prepareSelectionSetMap +} from '@chartshq/visual-unit'; +import { TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects'; +import { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants'; import { applyInteractionPolicy } from '../helper'; +import { + propagateValues, + isCrosstab, + addSelectedMeasuresInPayload, + resetSelectAction, + dispatchBehaviours, + attachBehaviours +} from './helper'; +import { COMMON_INTERACTION } from '../../constants'; -const defaultInteractionPolicy = (valueMatrix, firebolt) => { - const isMeasure = field => field.type() === FieldType.MEASURE; - const canvas = firebolt.context; - const visualGroup = canvas.composition().visualGroup; - const xFields = [].concat(...visualGroup.getFieldsFromChannel('x')); - const yFields = [].concat(...visualGroup.getFieldsFromChannel('y')); - const colDim = xFields.every(field => field.type() === FieldType.DIMENSION); - const fieldInf = visualGroup.resolver().getAllFields(); - const rowFacets = fieldInf.rowFacets; - const colFacets = fieldInf.colFacets; - valueMatrix.each((cell) => { - const unitFireBolt = cell.valueOf().firebolt(); - if (!(xFields.every(isMeasure) && yFields.every(isMeasure))) { - const facetFields = cell.valueOf().facetByFields()[0]; - const unitColFacets = facetFields.filter(d => colFacets.findIndex(v => v.equals(d)) !== -1); - const unitRowFacets = facetFields.filter(d => rowFacets.findIndex(v => v.equals(d)) !== -1); - let propFields; - if (colDim) { - propFields = unitColFacets.map(d => `${d}`); - } else { - propFields = unitRowFacets.map(d => `${d}`); +const setSideEffectConfig = (firebolt) => { + const tooltipSideEffect = firebolt.sideEffects().tooltip; + const allFields = firebolt.context.composition().visualGroup.resolver().getAllFields(); + + if (isCrosstab(allFields)) { + tooltipSideEffect.config({ + selectionSummary: { + order: 1, + className: 'tooltip-content-container-selectionSummary-crosstab', + showMultipleMeasures: true + }, + highlightSummary: { + order: 0, + className: 'tooltip-content-container-highlightSummary-crosstab' + } + }); + } else { + tooltipSideEffect.config({ + selectionSummary: { + order: 0, + className: 'tooltip-content-container-selectionSummary-default', + showMultipleMeasures: false + }, + highlightSummary: { + order: 1, + className: 'tooltip-content-container-highlightSummary-default' } + }); + } +}; + +const prepareSelectionSetData = (group, dataModel) => { + const valueMatrix = group.matrixInstance().value; + const fieldsConfig = dataModel.getFieldsConfig(); + const dimensions = Object.values(fieldsConfig).filter(d => d.def.type === FieldType.DIMENSION); + const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length; + const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : []; + const keys = {}; + const dimensionsMap = {}; + const unitDimsMap = {}; + + valueMatrix.each((cell) => { + const unit = cell.source(); + const dm = unit.data(); + const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name); + const facetFields = Object.keys(unit.facetFieldsMap()); - unitFireBolt.propagateWith('*', propFields, true); + unitDimsMap[unitDims] = { + inst: unit, + dims: [...facetFields, ...unitDims] + }; + }); + + const groupDataMap = {}; + + dataModel.getData().data.forEach((row) => { + for (const key in unitDimsMap) { + const { dims } = unitDimsMap[key]; + const dimKey = dims.map(dim => row[fieldsConfig[dim].index]); + groupDataMap[dimKey] = row; } }); + + valueMatrix.each((cell) => { + const unit = cell.source(); + const dm = unit.data(); + const layers = unit.layers(); + const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name); + const facetMap = unit.facetFieldsMap(); + const facetFields = Object.keys(facetMap); + const unitFieldsConfig = dm.getFieldsConfig(); + const linkedRows = []; + + dm.getData().data.forEach((row) => { + const dimKey = [...facetFields.map(field => facetMap[field]), ...unitDims.map(d => + row[unitFieldsConfig[d].index])]; + const linkedRow = groupDataMap[dimKey]; + + if (linkedRow) { + linkedRows.push(linkedRow); + } + }); + + prepareSelectionSetMap({ + data: linkedRows, + uids: dm.getUids(), + dimensions + }, layers, { + keys, + dimensionsMap + }); + }); + + const dimensionFields = dimensions.length ? [...dimensions.map(d => d.def.name)] : + [ReservedFields.ROW_ID]; + + return { + keys, + dimensionsMap, + dimensions: dimensionFields, + allFields: [...dimensionFields, ...measureName] + }; }; const defaultCrossInteractionPolicy = { behaviours: { - '*': (propagationPayload, context) => { + '*': (propagationPayload, firebolt) => { const propagationCanvasAlias = propagationPayload.sourceCanvas; - const canvasAlias = context.parentAlias(); + const canvasAlias = firebolt.sourceCanvas(); return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true; } }, sideEffects: { - tooltip: (propagationPayload, context) => { - const propagationUnit = propagationPayload.sourceUnit; - const propagationCanvas = propagationPayload.sourceCanvas; - const unitId = context.id(); - const canvasAlias = context.parentAlias(); - if (propagationCanvas) { - return propagationCanvas !== canvasAlias ? true : unitId === propagationUnit; - } - return true; + '*': (propagationPayload, firebolt) => { + const propagationCanvasAlias = propagationPayload.sourceCanvas; + const canvasAlias = firebolt.sourceCanvas(); + return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true; }, selectionBox: () => false } @@ -77,12 +164,13 @@ const defaultCrossInteractionPolicy = { export default class GroupFireBolt extends Firebolt { constructor (...params) { super(...params); + this.payloadGenerators(payloadGenerator); this._interactionPolicy = this.constructor.defaultInteractionPolicy(); this.crossInteractionPolicy(this.constructor.defaultCrossInteractionPolicy()); } static defaultInteractionPolicy () { - return defaultInteractionPolicy; + return () => {}; } static defaultCrossInteractionPolicy () { @@ -99,84 +187,110 @@ export default class GroupFireBolt extends Firebolt { crossInteractionPolicy (...policy) { if (policy.length) { + const context = this.context; this._crossInteractionPolicy = mergeRecursive(mergeRecursive({}, this.constructor.defaultCrossInteractionPolicy()), policy[0] || {}); - const context = this.context; + applyInteractionPolicy(this); - context._throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => { + const throwback = context._throwback; + throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => { + this.config(this.context.config().interaction); applyInteractionPolicy(this); + const group = this.context.composition().visualGroup; + if (group) { + setSideEffectConfig(this); + + const { keys, dimensions, dimensionsMap, allFields } = prepareSelectionSetData(group, + group.getGroupByData()); + this._metaData = { + dimensionsMap, + dimensions, + allFields + }; + this.createSelectionSet({ keys, fields: dimensions }); + group.getGroupByData().on('propagation', (data, config) => { + this.handleDataModelPropagation(data, config); + }); + // Dispatch pseudo select behaviour for highlighting measures with common dimensions in crosstab + attachBehaviours(group); + } }); return this; } return this._crossInteractionPolicy; } - /** - * Dispatches a behavioural action with a payload. It takes the name of the behavioural action and a payload - * object which contains the criteria aend an array of side effects which determines what side effects are - * going to be shown in each visual unit of the canvas. It prepares the datamodel from the given criteria - * and initiates a propagation from the datamodel of canvas. Then all the visual units of canvas which listens - * to the propagation gets informed on which rows got selected and dispatches the behavioural action sent during - * propagation. - * - * To dispatch a behavioural action on the canvas - * ``` - * // Get the firebolt instance of the canvas - * const firebolt = canvas.firebolt(); - * // Dispatch a brush behaviour - * firebolt.dispatchBehaviour('brush', { - * // Selects all the rows with Horsepower having range between 100 and 200. - * criteria: { - * Horsepower: [100, 200] - * } - * }); - * // On dispatch of this behavioural action, a selection box gets created and plots gets faded out which are the - * // default side effects mapped to this behavioural action. - * ``` - * - * ``` - * Additionally, it can also be passed an array of side effects in the payload. - * // Dispatch a select behaviour with only crossline as side effect. - * firebolt.dispatchBehaviour('select', { - * criteria: { - * Cylinders: ['8'] - * }, - * sideEffects: ['crossline'] - * }); - * ``` - * - * @public - * - * @param {string} behaviour Name of the behavioural action - * @param {Object} payload Object which contains the interaction information. - * @param {Object | Array.} payload.criteria Identifiers by which the selection happens. - * @param {Array.} payload.sideEffects Side effects which needs to be shown. - * - * @return {GroupFireBolt} Instance of firebolt. - */ - dispatchBehaviour (behaviour, payload) { - const propPayload = Object.assign(payload); - const criteria = propPayload.criteria; - const data = this.context.composition().visualGroup.getGroupByData(); - const fieldsConfig = data.getFieldsConfig(); - const model = getDataModelFromIdentifiers(data, criteria); - const behaviouralAction = this._actions.behavioural[behaviour]; - - if (behaviouralAction) { - const fields = isSimpleObject(criteria) ? Object.keys(criteria) : (criteria ? criteria[0] : []); - const validFields = fields.filter(field => field in fieldsConfig); - const mutates = behaviouralAction.constructor.mutates(); - const propConfig = { - payload: propPayload, - action: behaviour, - criteria: model, - sourceId: this.context.alias(), - isMutableAction: mutates, - propagateInterpolatedValues: validFields.every(field => fieldsConfig[field].def.type === - FieldType.MEASURE) + handleDataModelPropagation (data, config) { + const group = this.context.composition().visualGroup; + const valueMatrix = group.matrixInstance().value; + const units = group.resolver().units(); + const propagationData = data; + // @todo refactor this code + const { + enabled: enabledFn, + sourceIdentifiers, + action, + payload: propPayload + } = config; + const { interaction: { behaviours: behaviourConfs = {} } } = this.context.config(); + const mode = behaviourConfs[action]; + if (mode !== COMMON_INTERACTION) { + return this; + } + + const payloadFn = this.getPayloadGeneratorFor(action); + const payload = payloadFn(this, propagationData, config); + + const behaviourPolicies = this._behaviourPolicies; + const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {}); + let enabled = filterFns.every(fn => fn(propPayload || {}, this, { + sourceIdentifiers, + propagationData + })); + + if (enabledFn) { + enabled = enabledFn(config, this) && enabled; + } + + if (enabled) { + const propagationInf = { + propagate: false, + data: propagationData, + propPayload, + sourceIdentifiers, + sourceId: config.propagationSourceId, + isMutableAction: config.isMutableAction }; - data.propagate(model, propConfig, true); + + const behaviourEffectMap = this._behaviourEffectMap; + const sideEffects = getSideEffects(action, behaviourEffectMap); + const sideEffectInstances = this.sideEffects(); + const { instance: unit = units[0][0] } = + valueMatrix.findPlaceHolderById(propPayload.sourceUnit) || {}; + + sideEffects.forEach(({ effects }) => { + effects.forEach((effect) => { + const name = effect.name; + const inst = sideEffectInstances[name]; + + if (inst) { + inst.sourceInfo(() => unit.getSourceInfo()); + inst.layers(() => unit.layers()); + inst.plotPointsFromIdentifiers((...params) => + unit.getPlotPointsFromIdentifiers(...params)); + inst.drawingContext(() => unit.getDrawingContext()); + inst.valueParser(unit.valueParser()); + } + }); + }); + + if (propPayload.sourceUnit) { + addSelectedMeasuresInPayload(this, unit, payload); + } + + this.dispatchBehaviour(action, payload, propagationInf); } + return this; } @@ -184,6 +298,128 @@ export default class GroupFireBolt extends Firebolt { for (const key in sideEffects) { this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key]; } + this.initializeSideEffects(); + + return this; + } + + target () { + return 'visual-group'; + } + + mapActionsAndBehaviour () { + const unitMatrix = this.context.composition().visualGroup.matrixInstance().value; + + unitMatrix.each((unit) => { + const firebolt = unit.source().firebolt(); + firebolt.mapActionsAndBehaviour(); + }); + + this.registerPhysicalActionHandlers(); + } + + registerPhysicalActionHandlers () { + const unitMatrix = this.context.composition().visualGroup.matrixInstance().value; + + unitMatrix.each((cell) => { + const unit = cell.source(); + const firebolt = unit.firebolt(); + + firebolt.onPhysicalAction('*', (event, payload) => { + this.handlePhysicalAction(event, payload, unit); + }, this.context.constructor.formalName()); + }); + return this; } + + handlePhysicalAction (event, payload, unit) { + const firebolt = unit.firebolt(); + const { behaviours } = firebolt._actionBehaviourMap[event]; + dispatchBehaviours(this, { behaviours, payload, unit }); + // Reset select action when dragging is done. Remove this when brush and select will be unioned + resetSelectAction(this, { behaviours, payload, unit }); + } + + sanitizePayload (payload) { + const { criteria } = payload; + const { allFields: fields, dimensionsMap } = this._metaData; + + return Object.assign({}, payload, + { + criteria: sanitizePayloadCriteria(criteria, fields, { + dm: this.data(), + dimensionsMap, + dimsMapGetter: this._dimsMapGetter + }) + }); + } + + createSelectionSet (...params) { + super.createSelectionSet(...params); + + this._dimsMapGetter = createMapByDimensions(this, this.data()); + + return this; + } + + id () { + return this.context.alias(); + } + + shouldApplySideEffects (propInf) { + return propInf.applySideEffect !== false; + } + + data () { + return this.context.composition().visualGroup.getGroupByData(); + } + + getRangeFromIdentifiers ({ criteria, fields }) { + return fields.reduce((acc, v) => { + acc[v] = criteria[v]; + return acc; + }, {}); + } + + propagate (behaviour, payload, identifiers, auxConfig = {}) { + propagateValues(this, behaviour, Object.assign({ + payload, + identifiers, + propagationFields: this._propagationFields, + sourceId: this.id(), + sourceCanvasId: this.id(), + propagationDataSource: this.data() + }, auxConfig)); + } + + getPropagationSource () { + return this.data(); + } + + sourceCanvas () { + return this.context.alias(); + } + + getApplicableSideEffects (sideEffects, payload, propagationInf) { + if (payload.sideEffects) { + return [{ + effects: payload.sideEffects, + behaviours: [payload.action] + }]; + } + const { mode } = this.context.config().interaction.tooltip; + propagationInf.propPayload = propagationInf.propPayload || payload; + sideEffects.forEach((d) => { + let mappedEffects = d.effects; + mappedEffects = mappedEffects.filter((se) => { + if (se.name === TOOLTIP && mode === FRAGMENTED) { + return false; + } + return isSideEffectEnabled(this, { se, propagationInf }); + }); + d.effects = mappedEffects; + }); + return sideEffects; + } } diff --git a/packages/muze/src/canvas/firebolt/helper.js b/packages/muze/src/canvas/firebolt/helper.js new file mode 100644 index 00000000..1643a47e --- /dev/null +++ b/packages/muze/src/canvas/firebolt/helper.js @@ -0,0 +1,182 @@ +import { isSimpleObject, ReservedFields, FieldType } from 'muze-utils'; +import { getSideEffects, BEHAVIOURS } from '@chartshq/muze-firebolt'; +import { PSEUDO_SELECT } from '@chartshq/visual-unit/src/enums/behaviours'; +import { COMMON_INTERACTION } from '../../constants'; + +export const addFacetDataAndMeasureNames = (data, facetData, measureNames) => { + if (data === null) { + return data; + } + + const facets = Object.keys(facetData); + const facetVals = Object.values(facetData); + + if (isSimpleObject(data)) { + return Object.assign({}, Object.keys(facetData).reduce((acc, v) => { + acc[v] = [facetData[v]]; + return acc; + }, {}), data, { + [ReservedFields.MEASURE_NAMES]: measureNames + }); + } + const criteriaFields = data[0]; + const hasMeasureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES); + const fieldsWithFacets = [...facets, ...criteriaFields, + ...(hasMeasureNameField ? [] : [ReservedFields.MEASURE_NAMES])]; + + const dataWithFacets = [ + fieldsWithFacets + ]; + + for (let i = 1, len = data.length; i < len; i++) { + let measureNameArr = []; + if (!hasMeasureNameField && measureNames) { + measureNameArr = measureNames; + } + const row = [...facetVals, ...data[i], ...measureNameArr]; + dataWithFacets.push(row); + } + return dataWithFacets; +}; + +export const propagateValues = (instance, action, config = {}) => { + const { payload, identifiers, sourceUnitId, sourceCanvasId, propagationDataSource } = config; + const dataModel = propagationDataSource; + const sideEfffects = instance._sideEffectDefinitions; + const behaviourEffectMap = instance._behaviourEffectMap; + const propagationBehaviourMap = instance._propagationBehaviourMap; + const propagationBehaviour = propagationBehaviourMap[action] || action; + + payload.sourceUnit = sourceUnitId; + payload.action = action; + payload.sourceCanvas = sourceCanvasId; + + const groupId = sourceCanvasId; + + const filterFn = (entry, propagationConf) => { + const effects = behaviourEffectMap[entry.config.action]; + const mutates = entry.config.groupId ? + (effects ? effects.some(d => sideEfffects[d.name || d].mutates()) : false) : true; + return entry.config.groupId !== propagationConf.groupId && mutates; + }; + + const sourceBehaviour = instance._actions.behavioural[action]; + let isMutableAction = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false; + const propConfig = { + payload, + action, + criteria: identifiers, + isMutableAction, + groupId, + sourceId: config.sourceId, + filterFn, + enabled: (propConf, firebolt) => (action !== propagationBehaviour ? + propConf.payload.sourceCanvas === firebolt.sourceCanvas() : true) + }; + + dataModel.propagate(identifiers, propConfig, true); + + if (action !== propagationBehaviour) { + const behaviourInstance = instance._actions.behavioural[propagationBehaviour]; + isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false; + + dataModel.propagate(identifiers, Object.assign({}, propConfig, { + isMutableAction, + applyOnSource: false, + action: propagationBehaviour, + sourceId: isMutableAction ? groupId : sourceUnitId, + enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.sourceCanvas() + }), true, { + filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId + }); + } +}; + +const isDimension = fields => fields.some(field => field.type() === FieldType.DIMENSION); + +export const isCrosstab = (fields) => { + const { rowFacets, colFacets, rowProjections, colProjections } = fields; + if (rowFacets.length || colFacets.length) { + return true; + } + const colProj = colProjections.flat(); + const rowProj = rowProjections.flat(); + + if ((isDimension(colProj) || isDimension(rowProj)) && (colProj.length > 1 || rowProj.length > 1)) { + return true; + } + return false; +}; + +export const addSelectedMeasuresInPayload = (firebolt, unit, payload) => { + const groupFields = firebolt.context.composition().visualGroup.resolver().getAllFields(); + if (isCrosstab(groupFields)) { + const { x, y } = unit.fields(); + let measureFields; + + if (x.length && y.length) { + if (x[0].type() === FieldType.MEASURE) { + measureFields = [`${x[0]}`]; + } else if (y[0].type() === FieldType.MEASURE) { + measureFields = [`${y[0]}`]; + } + payload.selectedMeasures = measureFields; + } + } +}; + +export const dispatchBehaviours = (firebolt, { payload, unit, behaviours }) => { + const { interaction: { behaviours: behaviourConfs = {} } } = firebolt.context.config(); + const unitFirebolt = unit.firebolt(); + + behaviours.forEach((action) => { + const mode = behaviourConfs[action]; + let targetFirebolt = unitFirebolt; + if (mode === COMMON_INTERACTION) { + targetFirebolt = firebolt; + } + + const actions = targetFirebolt._actions.behavioural; + payload.criteria = addFacetDataAndMeasureNames(payload.criteria, unit.facetFieldsMap(), + unit.layers().map(layer => Object.keys(layer.data().getFieldspace().getMeasure()))); + + targetFirebolt.dispatchBehaviour(action, payload, { + propagate: false, + applySideEffect: false + }); + + const identifiers = actions[action].propagationIdentifiers(); + + firebolt.propagate(action, payload, identifiers, { + sideEffects: getSideEffects(action, targetFirebolt._behaviourEffectMap), + sourceUnitId: unit.id(), + sourceId: targetFirebolt.id(), + propagationDataSource: targetFirebolt.getPropagationSource() + }); + }); +}; + +export const resetSelectAction = (firebolt, { unit, payload, behaviours }) => { + if (behaviours[0] === BEHAVIOURS.BRUSH && payload.dragging && payload.dragDiff < 5) { + dispatchBehaviours(firebolt, { + behaviours: [BEHAVIOURS.SELECT], + payload: { + criteria: null + }, + unit + }); + } +}; + +export const attachBehaviours = (group) => { + const allFields = group.resolver().getAllFields(); + const valueMatrix = group.matrixInstance().value; + const crosstab = isCrosstab(allFields); + + valueMatrix.each((cell) => { + const unit = cell.valueOf(); + const firebolt = unit.firebolt(); + const behaviours = crosstab ? [PSEUDO_SELECT] : []; + firebolt._connectedBehaviours[BEHAVIOURS.SELECT] = behaviours; + }); +}; diff --git a/packages/muze/src/canvas/helper.js b/packages/muze/src/canvas/helper.js index 85ea69e3..ec352a01 100644 --- a/packages/muze/src/canvas/helper.js +++ b/packages/muze/src/canvas/helper.js @@ -1,6 +1,8 @@ -import { isEqual, STATE_NAMESPACES, selectElement, getValueParser } from 'muze-utils'; +import { isEqual, STATE_NAMESPACES, selectElement, getValueParser, FieldType } from 'muze-utils'; import { VisualGroup } from '@chartshq/visual-group'; -import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID } +import { BEHAVIOURS } from '@chartshq/muze-firebolt'; +import { payloadGenerator } from '@chartshq/visual-unit'; +import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID, LEGEND } from '../constants'; import { canvasOptions } from './local-options'; import { LayoutManager } from '../../../layout/src/tree-layout'; @@ -21,6 +23,30 @@ export const initCanvas = (context) => { }, context.dependencies()))]; }; +export const fixFacetConfig = (config) => { + if (config) { + let isBorderPresent = false; + const isGridLinePresent = {}; + + if (config.border && config.border.width) { + isBorderPresent = true; + } + if (config.gridLines) { + isGridLinePresent.x = !!config.gridLines.x; + isGridLinePresent.y = !!config.gridLines.y; + } + const facetsUserConfig = { + isBorderPresent, + isGridLinePresent + }; + return { + facetsUserConfig, + isFacet: false + }; + } + return {}; +}; + export const fixScrollBarConfig = (config) => { config.scrollBar.thickness = Math.min(50, Math.max(10, config.scrollBar.thickness)); return config; @@ -29,9 +55,13 @@ export const fixScrollBarConfig = (config) => { export const setLayoutInfForUnits = (context) => { const layoutManager = context._layoutManager; const gridLayout = layoutManager.getComponent(GRID); + const legend = layoutManager.getComponent(LEGEND); const boundBox = gridLayout && gridLayout.getBoundBox(); const valueMatrix = context.composition().visualGroup.matrixInstance().value; const parentContainer = selectElement(`#${layoutManager.getRootNodeId()}`).node(); + if (legend) { + legend.setComponentInfo({ rootNode: parentContainer }); + } valueMatrix.each((cell) => { cell.valueOf().parentContainerInf({ el: parentContainer, @@ -60,7 +90,13 @@ export const dispatchProps = (context) => { const { invalidValues } = context.config(); visualGroup.valueParser(getValueParser(invalidValues)); - visualGroup.createMatrices(); + + const sanitizedData = visualGroup.getMandatoryFields(); + if (sanitizedData.shouldRender) { + visualGroup.createMatrices(sanitizedData); + } else { + visualGroup.remove(); + } context._cachedProps = {}; lifeCycleManager.notify({ client: context, action: 'initialized' }); lifeCycleManager.notify({ client: context, action: 'updated' }); @@ -94,22 +130,6 @@ const equalityChecker = (props, params) => { }); }; -const updateChecker = (props, params) => props.every((option, i) => { - const val = params[i][1]; - switch (option) { - case ROWS: - case COLUMNS: - return val !== null; - - case DATA: - return val && !val.isEmpty(); - - default: - return true; - - } -}); - export const notifyAnimationEnd = (context) => { const viewInfo = context.layout().viewInfo(); const centerMatrix = viewInfo && viewInfo.viewMatricesInfo.matrices.center[1] || []; @@ -161,24 +181,42 @@ export const setupChangeListener = (context) => { `${STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE}.${prop}`); store.registerChangeListener(nameSpaceProps, (...params) => { const equalityProps = equalityChecker(props, params); - const updateProps = updateChecker(props, params); // inform attached board to rerender if (equalityProps && context.mount()) { - if (updateProps) { - dispatchProps(context); - } else { - context.composition().visualGroup.remove(); - } + dispatchProps(context); context.render(); } notifyAnimationEnd(context); }, true); }; +const applyPropagationPolicy = (firebolt, { behaviours, sideEffects }) => { + for (const key in behaviours) { + firebolt.changeBehaviourStateOnPropagation(key, behaviours[key]); + } + for (const key in sideEffects) { + firebolt.changeSideEffectStateOnPropagation(key, sideEffects[key]); + } +}; + +const isMeasure = fields => fields.every(field => field.type() === FieldType.MEASURE); + +const isSplom = (fields) => { + const { rowProjections, colProjections } = fields; + const colProj = colProjections.flat(); + const rowProj = rowProjections.flat(); + + if (isMeasure(colProj) && isMeasure(rowProj)) { + return true; + } + return false; +}; + export const applyInteractionPolicy = (firebolt) => { const canvas = firebolt.context; const visualGroup = canvas.composition().visualGroup; if (visualGroup) { + const splom = isSplom(visualGroup.resolver().getAllFields()); const valueMatrix = visualGroup.matrixInstance().value; const interactionPolicy = firebolt._interactionPolicy; interactionPolicy(valueMatrix, firebolt); @@ -187,13 +225,25 @@ export const applyInteractionPolicy = (firebolt) => { const sideEffects = crossInteractionPolicy.sideEffects; valueMatrix.each((cell) => { const unitFireBolt = cell.valueOf().firebolt(); - for (const key in behaviours) { - unitFireBolt.changeBehaviourStateOnPropagation(key, behaviours[key]); - } - for (const key in sideEffects) { - unitFireBolt.changeSideEffectStateOnPropagation(key, sideEffects[key]); + applyPropagationPolicy(unitFireBolt, { behaviours, sideEffects }); + if (splom) { + unitFireBolt.payloadGenerators({ + [BEHAVIOURS.BRUSH]: (inst, dm, propConfig, facetFields) => payloadGenerator.brush(inst, dm, + { ...propConfig, ...{ includeMeasures: false } }, facetFields) + }); + unitFireBolt.sideEffects().selectionBox.config({ + persistent: true + }); + } else { + unitFireBolt.payloadGenerators({ + [BEHAVIOURS.BRUSH]: payloadGenerator.brush + }); + unitFireBolt.sideEffects().selectionBox.config({ + persistent: false + }); } }); + applyPropagationPolicy(firebolt, { behaviours, sideEffects }); } }; diff --git a/packages/muze/src/canvas/legend-maker.js b/packages/muze/src/canvas/legend-maker.js index a0a9ea00..a70fa721 100644 --- a/packages/muze/src/canvas/legend-maker.js +++ b/packages/muze/src/canvas/legend-maker.js @@ -1,7 +1,8 @@ import { TextCell, AxisCell } from '@chartshq/visual-cell'; import { getValueParser, retrieveFieldDisplayName, DataModel, getObjProp } from 'muze-utils'; import { - VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING, BORDER, MARGIN + VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING, + BORDER, MARGIN, SIZE, COLOR, IS_POINT_MAP, POINT } from '../constants'; /** @@ -43,6 +44,18 @@ export const legendCreator = (canvas) => { return dataset; }; +/** + * @param {*} mark mark of the layers in the canvas + * @param {*} scaleType type of the scale to draw the legend ie shape, size or color + * + */ +export const legendIconShapeMapper = (layers, scaleType) => { + const layerMarks = layers.map(el => el.mark); + const shape = IS_POINT_MAP[(scaleType === COLOR || scaleType === SIZE) + && layerMarks.includes(POINT)]; + return shape; +}; + /** * * @@ -66,8 +79,9 @@ export const legendInitializer = (legendConfig, canvas, measurement, prevLegends const legendInfo = legendCreator(canvas); const { invalidValues } = canvas.config(); - + const interactionRegistry = canvas.registry().interactions; const parser = getValueParser(invalidValues); + legendInfo.forEach((dataInfo, index) => { const legendMeasures = {}; const { @@ -89,6 +103,9 @@ export const legendInitializer = (legendConfig, canvas, measurement, prevLegends labelManager: canvas._dependencies.smartlabel, cells: { AxisCell, TextCell + }, + registry: { + interactions: interactionRegistry } }); } @@ -104,6 +121,10 @@ export const legendInitializer = (legendConfig, canvas, measurement, prevLegends if (metaData instanceof DataModel) { metaData.dispose(); } + + const mark = canvas.composition().visualGroup.resolver().matrixLayers()[0][0]; + config.shape = legendIconShapeMapper(mark, scaleType); + legend.scale(scale) .valueParser(parser) .title(title) diff --git a/packages/muze/src/canvas/title-maker.js b/packages/muze/src/canvas/title-maker.js index 9e7fb61a..c100e05d 100644 --- a/packages/muze/src/canvas/title-maker.js +++ b/packages/muze/src/canvas/title-maker.js @@ -34,7 +34,8 @@ const headerCreator = (config, cellType, labelManager, prevCell) => { const cell = prevCell || new TextCell( { type: cellType === 'title' ? 'header' : 'text', - className: `${classPrefix}-${cellType}-cell` + className: `${classPrefix}-${cellType}-cell`, + subType: cellType }, { labelManager }) diff --git a/packages/muze/src/constants.js b/packages/muze/src/constants.js index bdf351c1..0b16c842 100644 --- a/packages/muze/src/constants.js +++ b/packages/muze/src/constants.js @@ -40,6 +40,16 @@ export const TITLE_TEMPLATE_NOT_ALLOWED_TAGS = [ 'style' ]; +export const ICON_SHAPES = { + SQUARE: 'square', + CIRCLE: 'circle' +}; + +export const IS_POINT_MAP = { + true: ICON_SHAPES.CIRCLE, + false: ICON_SHAPES.SQUARE +}; + export const LEGEND_TYPE_MAP = { [`${ORDINAL}-${true}-${COLOR}`]: DiscreteLegend, [`${ORDINAL}-${true}-${SIZE}`]: DiscreteLegend, @@ -76,6 +86,8 @@ export const VISIBLE = 'visible'; export const VERTICAL_SCROLL_BAR = 'verticalScrollBar'; export const HORIZONTAL_SCROLL_BAR = 'horizontalScrollBar'; export const GRID = 'grid'; +export const POINT = 'point'; export const MESSAGE = 'message'; -export const NO_DATA_MESSAGE = 'No data to display'; - +export const ERROR_MESSAGE = 'Insufficient data or incorrect configurations'; +export const COMMON_INTERACTION = 'common'; +export const INDIVIDUAL_INTERACTION = 'individual'; diff --git a/packages/muze/src/default-registry.js b/packages/muze/src/default-registry.js index c65982a8..471caf59 100644 --- a/packages/muze/src/default-registry.js +++ b/packages/muze/src/default-registry.js @@ -2,17 +2,38 @@ import { cellRegistry, SimpleCell } from '@chartshq/visual-cell'; import { VisualUnit } from '@chartshq/visual-unit'; import { layerRegistry } from '@chartshq/visual-layer'; import { SimpleGroup, VisualGroup } from '@chartshq/visual-group'; +import { registry as interactionRegistry } from '@chartshq/muze-firebolt'; export const COMPONENTS = { - VisualGroup, - VisualUnit + [VisualGroup.formalName()]: VisualGroup, + [VisualUnit.formalName()]: VisualUnit }; + export const SUBREGISTRIES = { - cellRegistry, - layerRegistry + cells: cellRegistry, + layers: layerRegistry }; export const INTERFACES = { SimpleGroup, SimpleCell }; +const componentRegistry = (components = COMPONENTS) => { + const reg = Object.assign({}, components); + + return { + register: (cls) => { + const key = cls.formalName(); + reg[key] = cls; + return componentRegistry; + }, + get: () => reg + }; +}; + +export const registry = { + components: componentRegistry(COMPONENTS), + cells: cellRegistry(), + layers: layerRegistry(), + interactions: interactionRegistry +}; diff --git a/packages/muze/src/defaults.js b/packages/muze/src/defaults.js index d68ad796..7ae6d803 100644 --- a/packages/muze/src/defaults.js +++ b/packages/muze/src/defaults.js @@ -1,7 +1,19 @@ +import { COMMON_INTERACTION } from './constants'; + export const DEFAULT_CONFIG = { classPrefix: 'muze', interaction: { - sideEffect: 'individual' + sideEffects: { + tooltip: COMMON_INTERACTION + }, + behaviours: { + highlight: COMMON_INTERACTION, + select: COMMON_INTERACTION, + brush: COMMON_INTERACTION + }, + tooltip: { + + } }, pagination: 'scroll', scrollBar: { diff --git a/packages/muze/src/muze.js b/packages/muze/src/muze.js index 12ab38e7..de9c3fec 100644 --- a/packages/muze/src/muze.js +++ b/packages/muze/src/muze.js @@ -1,18 +1,7 @@ -import { - transactor, - Smartlabel, - enableChainedTransaction, - LifeCycleManager, - DataModel, - makeElement, - getClientPoint, - selectElement, - getEvent, - require, - DateTimeFormatter, - Store -} from 'muze-utils'; +import * as utils from 'muze-utils'; +import { VisualUnit, helpers as unitHelpers, enums as unitEnums, UnitFireBolt } from '@chartshq/visual-unit'; +import { VisualGroup, Encoders, encoderHelpers, groupUtils, enums as groupEnums } from '@chartshq/visual-group'; import { SurrogateSideEffect, SpawnableSideEffect, @@ -21,25 +10,48 @@ import { GenericBehaviour, VolatileBehaviour, behaviouralActions, - GenericSideEffect + GenericSideEffect, + Firebolt } from '@chartshq/muze-firebolt'; -import { layerFactory } from '@chartshq/visual-layer'; +import { + layerFactory, + BaseLayer, + LineLayer, + TextLayer, + TickLayer, + PointLayer, + helpers, + enums, + SimpleLayer, + AreaLayer, + ArcLayer, + layerMixins +} from '@chartshq/visual-layer'; import pkg from '../package.json'; import * as operators from './operators'; import { actionModel as ActionModel } from './action-model'; import options from './options'; import { Canvas } from './canvas'; -import { COMPONENTS, SUBREGISTRIES } from './default-registry'; +import { registry as globalRegistry, SUBREGISTRIES } from './default-registry'; import './muze.scss'; +const { + transactor, + Smartlabel, + enableChainedTransaction, + LifeCycleManager, + DataModel, + Store +} = utils; + // Cache singleton instances which should be included only once in a page const globalCache = {}; -const defaultRegistry = COMPONENTS; +const defaultRegistry = globalRegistry.components; const overrideRegistryDefinitions = (overrideRegistry, registry) => { - for (const prop in overrideRegistry) { - registry.set(prop, overrideRegistry[prop]); - } + overrideRegistry.forEach((def) => { + registry.register(def); + }); }; /** @@ -72,12 +84,13 @@ const overrideRegistryDefinitions = (overrideRegistry, registry) => { const muze = () => { // Setters and getters will be mounted on this. Object will be mutated. const [env, globalStore] = transactor({}, options); - const components = Object.assign({}, COMPONENTS); - const componentSubRegistryDef = Object.assign(SUBREGISTRIES); + const components = Object.assign({}, globalRegistry.components.get()); + const componentSubRegistryDef = Object.assign({}, SUBREGISTRIES); + const componentSubRegistry = {}; for (const prop in componentSubRegistryDef) { - componentSubRegistry[prop] = componentSubRegistryDef[prop](); + componentSubRegistry[prop] = componentSubRegistryDef[prop](globalRegistry[prop].get()); } // Apart form the setter getter, an instance method is injected to create real renderer instances @@ -86,7 +99,8 @@ const muze = () => { const settings = globalStore.serialize(); const canvas = Canvas.withSettings(settings, { /* registry */ components, - componentSubRegistry + componentSubRegistry, + interactions: globalRegistry.interactions }, env.globalDependencies()); // Whenever settings is changed canvas is updated @@ -113,11 +127,12 @@ const muze = () => { env.registry = (...overrideRegistry) => { // Selectively copy the properties from COMPONENTS if (overrideRegistry.length) { - for (const prop in overrideRegistry) { + overrideRegistry.forEach((def) => { + const prop = def.formalName(); if (prop in defaultRegistry) { - components[prop] = overrideRegistry[prop]; + components[prop] = def; } - } + }); return env; } return components; @@ -126,7 +141,7 @@ const muze = () => { env.cellRegistry = (...overrideRegistry) => { const cellRegistry = componentSubRegistry.cellRegistry; if (overrideRegistry.length) { - overrideRegistryDefinitions(overrideRegistry[0], cellRegistry); + overrideRegistryDefinitions(overrideRegistry, cellRegistry); return env; } return cellRegistry.get(); @@ -135,7 +150,7 @@ const muze = () => { env.layerRegistry = (...overrideRegistry) => { const layerRegistry = componentSubRegistry.layerRegistry; if (overrideRegistry.length) { - overrideRegistryDefinitions(overrideRegistry[0], layerRegistry); + overrideRegistryDefinitions(overrideRegistry, layerRegistry); return env; } return layerRegistry.get(); @@ -144,6 +159,45 @@ const muze = () => { return env; }; +muze.registry = globalRegistry; + +muze.Components = { + VisualLayer: { + layers: { + BaseLayer, + LineLayer, + TextLayer, + TickLayer, + PointLayer, + SimpleLayer, + AreaLayer, + ArcLayer + }, + helpers, + enums, + layerMixins + }, + VisualUnit: { + constructor: VisualUnit, + helpers: unitHelpers, + enums: unitEnums, + UnitFireBolt + }, + VisualGroup: { + constructor: VisualGroup, + Encoders, + encoderHelpers, + groupUtils, + enums: groupEnums + }, + Canvas: { + constructor: Canvas + }, + Firebolt: { + constructor: Firebolt + } +}; + const SideEffects = { sideEffects, standards: { @@ -169,13 +223,7 @@ muze.ActionModel = ActionModel; muze.layerFactory = layerFactory; muze.Operators = operators; muze.Behaviours = Behaviours; -muze.utils = { - getClientPoint, - getEvent, - makeElement, - selectElement, - DateTimeFormatter, - require -}; +muze.utils = utils; muze.Model = new Store().model.constructor; + export default muze; diff --git a/packages/muze/src/muze.scss b/packages/muze/src/muze.scss index 9f3b1f36..94e17ab8 100644 --- a/packages/muze/src/muze.scss +++ b/packages/muze/src/muze.scss @@ -4,10 +4,11 @@ .#{$groupContainer} { @extend %font; - font-size: 14px; + font-size: 12px; + line-height: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.42857143; - color: #333; + color: #5F5F5F; background-color: transparent; margin: 0; @@ -162,6 +163,11 @@ position: relative; float: left; } +.#{$prefix}grid-top { + position: relative; + top: 100%; + transform: translateY(-100%); +} .#{$prefix}grid div{ float: left; @@ -178,9 +184,7 @@ color: #5f5f5f; } .#{$prefix}grid-headers{ - font-size: 14px; - font-weight: bold; - + font-size: 12px; } .#{$prefix}subtitle-cell { @@ -204,11 +208,23 @@ } .#{$messageContainer}-child { + display: table-cell; vertical-align: middle; + + &-img { + text-align: center; + svg { + display: unset; + float: unset; + } + } +} + +.#{$messageContainer}-child-message { text-align: center; - font-size: 18px; - color: rgb(140, 141, 142); - display: table-cell; + color: #4F708C;; + text-align: center; + font-weight: 600; } .hidden { diff --git a/packages/muze/src/muze.spec.js b/packages/muze/src/muze.spec.js new file mode 100644 index 00000000..b4e727e5 --- /dev/null +++ b/packages/muze/src/muze.spec.js @@ -0,0 +1,24 @@ +/* global describe, it */ + +import { expect } from 'chai'; + +import muze from './muze'; + +describe('#layerRegistry', () => { + it('should get layers', () => { + expect(muze.registry.layers.get()).to.be.an.instanceOf(Object); + }); + + it('should register new layers', () => { + const { bar: BarLayer } = muze.registry.layers.get(); + + class CustomBar extends BarLayer { + static formalName () { + return 'custom-bar'; + } + } + muze.registry.layers.register(CustomBar); + const customBar = muze.registry.layers.get()['custom-bar']; + expect(customBar).to.equals(CustomBar); + }); +}); diff --git a/packages/muze/src/options.js b/packages/muze/src/options.js index 0e3a96c7..72ab751c 100644 --- a/packages/muze/src/options.js +++ b/packages/muze/src/options.js @@ -15,7 +15,7 @@ */ import { intSanitizer, mergeRecursive, DataModel } from 'muze-utils'; -import { fixScrollBarConfig } from './canvas/helper'; +import { fixScrollBarConfig, fixFacetConfig } from './canvas/helper'; import { DEFAULT_CONFIG } from './defaults'; export default { @@ -64,12 +64,17 @@ export default { const { reset = false } = auxConfig; let oldConf = {}; + // handle the default cases for facet, as it is different to other charts + const facetDefaultConfig = fixFacetConfig(config); + config = mergeRecursive(config, facetDefaultConfig); + if (!reset) { oldConf = mergeRecursive({}, config === null ? {} : oldConfig); } const defConfig = mergeRecursive(oldConf, DEFAULT_CONFIG); const newConf = mergeRecursive(defConfig, config); + return fixScrollBarConfig(newConf); } diff --git a/packages/transform/src/stack-transform/index.js b/packages/transform/src/stack-transform/index.js index e1275302..912a9b65 100644 --- a/packages/transform/src/stack-transform/index.js +++ b/packages/transform/src/stack-transform/index.js @@ -1,4 +1,4 @@ -import { stack } from 'muze-utils'; +import { stack, InvalidAwareTypes } from 'muze-utils'; import group from '../group-transform'; /* @@ -26,6 +26,7 @@ const normalizeData = (data, schema, valueField, uniqueField, groupBy) => { const valueFieldIndex = schema.findIndex(d => d.name === valueField); const seriesKeyIndex = schema.findIndex(d => d.name === groupBy); const seriesKeys = data.map(d => d[seriesKeyIndex]).filter((item, pos, arr) => arr.indexOf(item) === pos).sort(); + const fieldNames = schema.reduce((acc, obj, i) => { acc[i] = obj.name; return acc; @@ -35,6 +36,9 @@ const normalizeData = (data, schema, valueField, uniqueField, groupBy) => { const rowObj = arr.values.reduce((acc, row) => { acc = row.reduce((obj, value, i) => { if (i === seriesKeyIndex) { + if (row[valueFieldIndex] instanceof InvalidAwareTypes) { + row[valueFieldIndex] = null; + } obj[value] = row[valueFieldIndex]; tuples[value] = row; } else if (i !== valueFieldIndex) { @@ -63,6 +67,7 @@ const normalizeData = (data, schema, valueField, uniqueField, groupBy) => { keys: seriesKeys }; }; + /** * Generate a stacked representation of data * @param {Array} schema schema Array @@ -71,9 +76,7 @@ const normalizeData = (data, schema, valueField, uniqueField, groupBy) => { * @return {Array} stacked data */ export default (schema, data, config) => { - const uniqueField = config.uniqueField; - const valueField = config.value; - const groupBy = config.groupBy; + const { uniqueField, value: valueField, groupBy } = config; const sort = config.sort || 'descending'; const normalizedData = normalizeData(data, schema, valueField, uniqueField, groupBy); const keys = normalizedData.keys; @@ -81,6 +84,7 @@ export default (schema, data, config) => { const orderBy = config.orderBy; const orderIndex = schema.findIndex(d => d.name === orderBy); const groupByIndex = schema.findIndex(d => d.name === groupBy); + if (orderIndex !== -1) { keys.forEach((key) => { const name = data.find(d => d[groupByIndex] === key); @@ -95,11 +99,13 @@ export default (schema, data, config) => { order: sort, data: normalizedData.data }); + stackData.forEach((seriesData) => { seriesData.forEach((dataObj) => { dataObj.data = dataObj.data._tuple[seriesData.key]; }); }); + return stackData; }; diff --git a/packages/visual-cell/src/axis-cell.js b/packages/visual-cell/src/axis-cell.js index 69320d2b..3fc5a248 100644 --- a/packages/visual-cell/src/axis-cell.js +++ b/packages/visual-cell/src/axis-cell.js @@ -9,6 +9,7 @@ import SimpleCell from './simple-cell'; import { DEFAULT_CONFIG } from './enums/defaults'; import { AXIS } from './enums/cell-type'; import { PROPS } from './props'; +import * as CONSTANTS from './constants'; /** * Computes the logical space of the an axis instance within an axis cell @@ -97,6 +98,10 @@ class AxisCell extends SimpleCell { return this._id; } + static formalName () { + return CONSTANTS.AXIS_CELL; + } + /** * Retrns the serialized representation of this cell. * diff --git a/packages/visual-cell/src/blank-cell.js b/packages/visual-cell/src/blank-cell.js index 16cd6d45..0d7fb183 100644 --- a/packages/visual-cell/src/blank-cell.js +++ b/packages/visual-cell/src/blank-cell.js @@ -13,6 +13,7 @@ import { CLASSPREFIX, BLANK_CELL } from './enums/constants'; import { BLANK } from './enums/cell-type'; import { DEFAULT_CONFIG } from './enums/defaults'; import { PROPS } from './props'; +import * as CONSTANTS from './constants'; /** * Represents a table haeder. @@ -74,6 +75,10 @@ class BlankCell extends SimpleCell { return this._id; } + static formalName () { + return CONSTANTS.BLANK_CELL; + } + /** * This method is used to obtain a serialized representation of this instance. * diff --git a/packages/visual-cell/src/cell-registry.js b/packages/visual-cell/src/cell-registry.js index 0fd45c06..5427d9b1 100644 --- a/packages/visual-cell/src/cell-registry.js +++ b/packages/visual-cell/src/cell-registry.js @@ -9,7 +9,8 @@ import { DEFAULT_PLACEHOLDERS } from './defaults'; const cellRegistry = () => { const reg = DEFAULT_PLACEHOLDERS; return { - set: (key, def) => { + register: (def) => { + const key = def.formalName(); if (key in reg) { reg[key] = def; } diff --git a/packages/visual-cell/src/defaults.js b/packages/visual-cell/src/defaults.js index 34d8fb53..1bb7ff8d 100644 --- a/packages/visual-cell/src/defaults.js +++ b/packages/visual-cell/src/defaults.js @@ -13,4 +13,3 @@ export const DEFAULT_PLACEHOLDERS = { [CONSTANTS.GEOM_CELL]: GeomCell, [CONSTANTS.BLANK_CELL]: BlankCell }; - diff --git a/packages/visual-cell/src/enums/constants.js b/packages/visual-cell/src/enums/constants.js index 9e151c61..fd79bd50 100644 --- a/packages/visual-cell/src/enums/constants.js +++ b/packages/visual-cell/src/enums/constants.js @@ -35,3 +35,10 @@ export const TEXT_CELL = 'text-cell'; export const AXIS_CELL = 'axis-cell'; export const GEOM_CELL = 'geom-cell'; export const BLANK_CELL = 'blank-cell'; + +export const PADDING = 'padding'; +export const HEADER_PADDING = 'headerPadding'; +export const TITLE_PADDING = 'titlePadding'; + +export const TITLE = 'title'; +export const SUBTITLE = 'subtitle'; diff --git a/packages/visual-cell/src/enums/defaults.js b/packages/visual-cell/src/enums/defaults.js index b6af82ec..ac90d72b 100644 --- a/packages/visual-cell/src/enums/defaults.js +++ b/packages/visual-cell/src/enums/defaults.js @@ -22,5 +22,23 @@ export const DEFAULT_CONFIG = { [CONSTANTS.SHOW]: true, [CONSTANTS.MAX_LINES]: 0, [CONSTANTS.MIN_CHARS]: 0, - [CONSTANTS.ROTATION]: null + [CONSTANTS.ROTATION]: null, + [CONSTANTS.PADDING]: { + [CONSTANTS.LEFT]: 8, + [CONSTANTS.RIGHT]: 8, + [CONSTANTS.TOP]: 10, + [CONSTANTS.BOTTOM]: 0 + }, + [CONSTANTS.HEADER_PADDING]: { + [CONSTANTS.LEFT]: 8, + [CONSTANTS.RIGHT]: 5, + [CONSTANTS.TOP]: 2, + [CONSTANTS.BOTTOM]: 5 + }, + [CONSTANTS.TITLE_PADDING]: { + [CONSTANTS.LEFT]: 0, + [CONSTANTS.RIGHT]: 0, + [CONSTANTS.TOP]: 0, + [CONSTANTS.BOTTOM]: 0 + } }; diff --git a/packages/visual-cell/src/geom-cell.js b/packages/visual-cell/src/geom-cell.js index 1affa015..744187a1 100644 --- a/packages/visual-cell/src/geom-cell.js +++ b/packages/visual-cell/src/geom-cell.js @@ -12,6 +12,7 @@ import { CLASSPREFIX, HEIGHT, WIDTH, DATA, AXES, FACET_BY_FIELDS, FIELDS, TRANSFORM, LAYER_DEF, CONFIG, GEOM_CELL, DETAIL_FIELDS } from './enums/constants'; +import * as CONSTANTS from './constants'; import { DEFAULT_CONFIG } from './enums/defaults'; /** @@ -88,6 +89,10 @@ class GeomCell extends SimpleCell { return this.source().id(); } + static formalName () { + return CONSTANTS.GEOM_CELL; + } + /** * This method return a serialized representation of * this instance. diff --git a/packages/visual-cell/src/simple-cell.js b/packages/visual-cell/src/simple-cell.js index 59d72fb7..bfcc8f6c 100644 --- a/packages/visual-cell/src/simple-cell.js +++ b/packages/visual-cell/src/simple-cell.js @@ -4,6 +4,7 @@ import { mergeRecursive } from 'muze-utils'; import { SIMPLE } from './enums/cell-type'; +import { SIMPLE_CELL } from './constants'; /** * This file declares a class that is used as an interface to create new @@ -43,6 +44,10 @@ class SimpleCell { return SIMPLE; } + static formalName () { + return SIMPLE_CELL; + } + /** * Returns the type of the placehlder. * diff --git a/packages/visual-cell/src/text-cell-helper.js b/packages/visual-cell/src/text-cell-helper.js new file mode 100644 index 00000000..08fe6cdf --- /dev/null +++ b/packages/visual-cell/src/text-cell-helper.js @@ -0,0 +1,129 @@ +import { + TOP, + BOTTOM, + LEFT, + RIGHT, + HEADER, + TITLE, + SUBTITLE +} from './enums/constants'; + +export const setSmartText = (context) => { + const source = context.source(); + const { + height: minHeightSpace, + width: minWidthSpace + } = context.minSpacing(); + const { + margin, + rotation + } = context.config(); + const { + left, + right, + top, + bottom + } = margin; + const paddedHeight = top + bottom + minHeightSpace; + const paddedWidth = left + right + minWidthSpace; + const availHeight = context.availHeight() - paddedHeight; + const availWidth = context.availWidth() - paddedWidth; + const labelManager = context.dependencies().labelManager; + + labelManager.setStyle(context._computedStyle); + + !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false)); + rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true)); + + return context; +}; + +export const isTitleSubtitle = (subType) => { + let returnVal = false; + if (subType === `${TITLE}` || subType === `${SUBTITLE}`) { + returnVal = true; + } + return returnVal; +}; + +/** +* Computes the Logical Space for the text +* +* @param {Object} context Required to get the needed parameters to compute text space +* @return {Object} Logical space taken up by text +* @memberof TextCell +*/ +export const computeTextSpace = (context) => { + const { labelManager } = context.dependencies(); + const { + height: minHeightSpace, + width: minWidthSpace + } = context.minSpacing(); + const { + margin, + show, + maxLines, + minCharacters + } = context.config(); + const { + left, + right, + top, + bottom + } = margin; + const paddedHeight = top + bottom + minHeightSpace; + const paddedWidth = left + right + minWidthSpace; + const availHeight = context.availHeight() - paddedHeight; + const availWidth = context.availWidth() - paddedWidth; + const source = context.source(); + const space = context.smartText(); + const minText = new Array(minCharacters).fill('W').join(''); + const _minTextSpace = labelManager.getOriSize(minText); + + context.config({ rotation: false }); + if (space.width > (availWidth || 0) && maxLines) { + space.height = space.oriTextHeight * maxLines; + } + if (availWidth && availWidth < space.width) { + space.width = _minTextSpace.width; + } + if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) { + const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true); + const { height: smHeight, width: smWidth } = smartSpace; + space.width = smWidth; + space.height = smHeight; + context.config({ rotation: true }); + context.smartText(smartSpace); + } + + const { subType, headerPadding } = context.config(); + if (!isTitleSubtitle(subType)) { + space.width += headerPadding[LEFT] + headerPadding[RIGHT]; + } + + if (show) { + return { + width: Math.ceil(space.width) + paddedWidth, + height: Math.ceil(space.height) + paddedHeight + }; + } return { + width: 0, + height: 0 + }; +}; + +export const setPadding = (measures) => { + const { elem, className, headerPadding, padding, type, titlePadding } = measures; + let localPadding; + if (isTitleSubtitle(className)) { + localPadding = titlePadding; + } else if (type === HEADER) { + localPadding = headerPadding; + } else { + localPadding = padding; + } + [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => { + elem.style(`padding-${position}`, `${localPadding[position]}px`); + }); + return elem; +}; diff --git a/packages/visual-cell/src/text-cell.js b/packages/visual-cell/src/text-cell.js index 7f3521f3..1ba25a43 100644 --- a/packages/visual-cell/src/text-cell.js +++ b/packages/visual-cell/src/text-cell.js @@ -15,96 +15,12 @@ import { PROPS } from './props'; import { DEFAULT_CONFIG } from './enums/defaults'; import { CLASSPREFIX, TOP, BOTTOM, LEFT, RIGHT, HEADER, WIDTH, TEXT_CELL } from './enums/constants'; import './text-cell.scss'; - -const setSmartText = (context) => { - const source = context.source(); - const { - height: minHeightSpace, - width: minWidthSpace - } = context.minSpacing(); - const { - margin, - rotation - } = context.config(); - const { - left, - right, - top, - bottom - } = margin; - const paddedHeight = top + bottom + minHeightSpace; - const paddedWidth = left + right + minWidthSpace; - const availHeight = context.availHeight() - paddedHeight; - const availWidth = context.availWidth() - paddedWidth; - const labelManager = context.dependencies().labelManager; - - labelManager.setStyle(context._computedStyle); - - !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false)); - rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true)); - - return context; -}; - -/** -* Computes the Logical Space for the text -* -* @param {Object} context Required to get the needed parameters to compute text space -* @return {Object} Logical space taken up by text -* @memberof TextCell -*/ -const computeTextSpace = (context) => { - const { labelManager } = context.dependencies(); - const { - height: minHeightSpace, - width: minWidthSpace - } = context.minSpacing(); - const { - margin, - show, - maxLines, - minCharacters - } = context.config(); - const { - left, - right, - top, - bottom - } = margin; - const paddedHeight = top + bottom + minHeightSpace; - const paddedWidth = left + right + minWidthSpace; - const availHeight = context.availHeight() - paddedHeight; - const availWidth = context.availWidth() - paddedWidth; - const source = context.source(); - const space = context.smartText(); - const minText = new Array(minCharacters).fill('W').join(''); - const _minTextSpace = labelManager.getOriSize(minText); - - context.config({ rotation: false }); - if (space.width > (availWidth || 0) && maxLines) { - space.height = space.oriTextHeight * maxLines; - } - if (availWidth && availWidth < space.width) { - space.width = _minTextSpace.width; - } - if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) { - const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true); - space.width = smartSpace.height; - space.height = smartSpace.width; - context.config({ rotation: true }); - context.smartText(smartSpace); - } - - if (show) { - return { - width: Math.ceil(space.width) + paddedWidth, - height: Math.ceil(space.height) + paddedHeight - }; - } return { - width: 0, - height: 0 - }; -}; +import * as CONSTANTS from './constants'; +import { + setSmartText, + computeTextSpace, + setPadding +} from './text-cell-helper'; /** * Represents a table haeder. @@ -198,6 +114,10 @@ class TextCell extends SimpleCell { return DEFAULT_CONFIG; } + static formalName () { + return CONSTANTS.TEXT_CELL; + } + /** * This method return the space taken up * by the text with the style applied. @@ -209,6 +129,8 @@ class TextCell extends SimpleCell { if (!this.logicalSpace()) { this.logicalSpace(computeTextSpace(this)); } + const space = computeTextSpace(this); + this.logicalSpace(space); return this.logicalSpace(); } @@ -244,13 +166,18 @@ class TextCell extends SimpleCell { show, verticalAlign, textAlign, - rotation + rotation, + padding, + type, + headerPadding, + className, + titlePadding } = this.config(); this.mount(mount); if (show) { const container = selectElement(mount); - const elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`); + let elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`); const vAlign = verticalAlign || rotation ? 'middle' : 'top'; const { width, @@ -271,15 +198,19 @@ class TextCell extends SimpleCell { elem.classed(this._className, true); // Apply styles - elem.style('text-align', textAlign); elem.style('display', 'inline'); elem.style('transform', rotation ? `translate(${height / 2}px, ${translation[vAlign]}px) rotate(-90deg)` : ''); elem.style(WIDTH, availWidth ? `${availWidth}px` : '100%'); - [TOP, BOTTOM, LEFT, RIGHT].forEach((type) => { - container.style(`margin-${type}`, `${margin[type]}px`); + + [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => { + container.style(`margin-${position}`, `${margin[position]}px`); }); - elem.style('text-align', textAlign); + + elem = setPadding({ elem, className, headerPadding, padding, type, titlePadding }); + if (this._className === 'muze-grid-headers') { + elem.style('text-align', textAlign); + } elem.style('display', 'inline'); // set the text as the innerHTML this._dependencies.labelManager.setStyle(this._computedStyle); diff --git a/packages/visual-cell/src/text-cell.scss b/packages/visual-cell/src/text-cell.scss index ac21a6d0..f26d817c 100644 --- a/packages/visual-cell/src/text-cell.scss +++ b/packages/visual-cell/src/text-cell.scss @@ -1,12 +1,12 @@ @import './prefix.scss'; .#{$prefix}text-cell { - font-size: 14px; - text-align: center; + font-size: 12px; + line-height: 15px; color: #5f5f5f; font-weight: 400; font-family: 'Source Sans Pro',"Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 1; + line-height: 15px; white-space: nowrap; transform-origin: 0 0; } diff --git a/packages/visual-group/src/data-type-scale-map.js b/packages/visual-group/src/data-type-scale-map.js index e4e8c3e1..f4efb1d7 100644 --- a/packages/visual-group/src/data-type-scale-map.js +++ b/packages/visual-group/src/data-type-scale-map.js @@ -1,12 +1,15 @@ +import { MeasureSubtype, DimensionSubtype, FieldType } from 'muze-utils'; + import { ScaleType } from '@chartshq/muze-axis'; /** * Map of DataModel types to associated field types. */ export const dataTypeScaleMap = { - dimension: ScaleType.BAND, - categorical: ScaleType.BAND, - temporal: ScaleType.TIME, - measure: ScaleType.LINEAR, - continuous: ScaleType.LINEAR + [FieldType.DIMENSION]: ScaleType.BAND, + [DimensionSubtype.CATEGORICAL]: ScaleType.BAND, + [DimensionSubtype.TEMPORAL]: ScaleType.TIME, + [FieldType.MEASURE]: ScaleType.LINEAR, + [MeasureSubtype.CONTINUOUS]: ScaleType.LINEAR, + [DimensionSubtype.BINNED]: ScaleType.BAND }; diff --git a/packages/visual-group/src/encoder/cartesian-encoder.js b/packages/visual-group/src/encoder/cartesian-encoder.js index a5249f70..a23eb33a 100644 --- a/packages/visual-group/src/encoder/cartesian-encoder.js +++ b/packages/visual-group/src/encoder/cartesian-encoder.js @@ -14,7 +14,8 @@ import { getIndex, getLayerConfFromFields, getAdjustedDomain, - sanitizeIndividualLayerConfig + sanitizeIndividualLayerConfig, + getSortingConfig } from './encoder-helper'; import { retriveDomainFromData } from '../group-helper'; @@ -104,7 +105,6 @@ export default class CartesianEncoder extends VisualEncoder { 0: {}, 1: {} }; - const config = context.config(); const fieldsObj = { 0: {}, 1: {} @@ -115,7 +115,7 @@ export default class CartesianEncoder extends VisualEncoder { for (let cIdx = 0, len2 = unitsArr.length; cIdx < len2; cIdx++) { const unit = unitsArr[cIdx]; const axisFields = unit.fields(); - const encodingDomains = unit.getDataDomain(); + const encodingDomains = unit.dataDomain(); ['x', 'y'].forEach((axisType, axisTypeIndex) => { const fieldArr = axisFields[axisType]; fieldArr.forEach((field, axisIndex) => { @@ -157,9 +157,8 @@ export default class CartesianEncoder extends VisualEncoder { only if sorted by user */ key = !axisType ? `0${idx}0` : `${idx}00`; const currentFieldName = fieldsObj[axisType][key].oneVar(); - const sortingOrder = config.sort && config.sort[currentFieldName]; - - if (sortingOrder) { + const sortingOrder = getSortingConfig(context, currentFieldName, axes[0].config); + if (sortingOrder && domains[axisType][key] instanceof Array) { domains[axisType][key].sort((a, b) => sortCategoricalField(sortingOrder, a, b)); } } @@ -382,4 +381,11 @@ export default class CartesianEncoder extends VisualEncoder { }); return this.sanitizeLayerConfig(retinalConfig, layerConfig); } + + hasMandatoryFields (fields) { + const { colProjections, rowProjections } = fields; + const colFields = super.hasMandatoryFields({ colProjections }); + const rowFields = super.hasMandatoryFields({ rowProjections }); + return colFields && rowFields; + } } diff --git a/packages/visual-group/src/encoder/encoder-helper.js b/packages/visual-group/src/encoder/encoder-helper.js index 1fb6900a..87050fa1 100644 --- a/packages/visual-group/src/encoder/encoder-helper.js +++ b/packages/visual-group/src/encoder/encoder-helper.js @@ -318,3 +318,25 @@ export const resolveAxisConfig = (context, fieldInf, axisInfo) => { }); }); }; + +export const getSortingConfig = (context, currentFieldName, axesConfig) => { + const config = context.config(); + const dataModel = context.data(); + + let lastSortConfig = null; + if (Object.keys(config.sort).length !== 0) { + return config.sort[currentFieldName]; + } + + const operations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()]; + + while (lastSortConfig = operations.pop()) { + if (lastSortConfig.op === 'sort') break; + } + if (lastSortConfig && + lastSortConfig.criteria.length && + lastSortConfig.criteria[0][0] === currentFieldName) { + return lastSortConfig.criteria[0][1]; + } + return axesConfig().defaultSort; +}; diff --git a/packages/visual-group/src/encoder/polar-encoder.js b/packages/visual-group/src/encoder/polar-encoder.js index e47dd279..d53878ee 100644 --- a/packages/visual-group/src/encoder/polar-encoder.js +++ b/packages/visual-group/src/encoder/polar-encoder.js @@ -173,7 +173,7 @@ export default class PolarEncoder extends VisualEncoder { const axes = context.resolver().axes(); context.matrixInstance().value.each((cell, rIdx, cIdx) => { const unit = cell.valueOf(); - const unitDomains = unit.getDataDomain(); + const unitDomains = unit.dataDomain(); const fields = unit.fields(); setRadiusFactor(unit); [RADIUS, ANGLE, ANGLE0].forEach((encType) => { @@ -375,6 +375,7 @@ export default class PolarEncoder extends VisualEncoder { !encoding.angle && (encoding.angle = {}); const angleField = getObjProp(encoding.angle, 'field'); const angle0Field = getObjProp(encoding.angle0, 'field'); + if (!angleField) { Object.assign(encoding.angle, { field: encodingConfigs.color && encodingConfigs.color.field @@ -392,4 +393,9 @@ export default class PolarEncoder extends VisualEncoder { }); return layerConfig; } + + hasMandatoryFields (fields) { + const { optionalProjections } = fields; + return super.hasMandatoryFields({ optionalProjections }); + } } diff --git a/packages/visual-group/src/encoder/props.js b/packages/visual-group/src/encoder/props.js new file mode 100644 index 00000000..3c768820 --- /dev/null +++ b/packages/visual-group/src/encoder/props.js @@ -0,0 +1,5 @@ +export const PROPS = { + layers: {}, + data: {}, + globalConfig: {} +}; diff --git a/packages/visual-group/src/encoder/retinal-encoder.js b/packages/visual-group/src/encoder/retinal-encoder.js index c426f1ce..4735a286 100644 --- a/packages/visual-group/src/encoder/retinal-encoder.js +++ b/packages/visual-group/src/encoder/retinal-encoder.js @@ -62,6 +62,7 @@ export default class RetinalEncoder extends VisualEncoder { } } }); + return axes; } } diff --git a/packages/visual-group/src/encoder/visual-encoder.js b/packages/visual-group/src/encoder/visual-encoder.js index 4e18834f..8af34f6c 100644 --- a/packages/visual-group/src/encoder/visual-encoder.js +++ b/packages/visual-group/src/encoder/visual-encoder.js @@ -1,7 +1,8 @@ -import { ERROR_MSG, mergeRecursive } from 'muze-utils'; +import { ERROR_MSG, mergeRecursive, generateGetterSetters } from 'muze-utils'; import { transformFields } from './field-sanitizer'; -import { getHeaderAxisFrom } from '../group-helper/group-utils'; +import { getHeaderAxisFrom, getFieldsFromSuppliedLayers, hasOneField } from '../group-helper/group-utils'; import { ROW, COLUMN } from '../enums/constants'; +import { PROPS } from './props'; /** * @@ -11,6 +12,10 @@ import { ROW, COLUMN } from '../enums/constants'; */ export default class VisualEncoder { + constructor () { + generateGetterSetters(this, PROPS); + } + /** * * @@ -110,4 +115,12 @@ export default class VisualEncoder { }); return this; } + + getProjectionFields (layers) { + return getFieldsFromSuppliedLayers(layers); + } + + hasMandatoryFields (fields) { + return hasOneField(fields); + } } diff --git a/packages/visual-group/src/enums/constants.js b/packages/visual-group/src/enums/constants.js index 44b0f91b..767803e7 100644 --- a/packages/visual-group/src/enums/constants.js +++ b/packages/visual-group/src/enums/constants.js @@ -90,6 +90,11 @@ export const ROWS = 'rows'; */ export const COLUMNS = 'columns'; +/** + * Field referring to object storing data + */ +export const DATA = 'data'; + /** * Field referring to object storing set of columns */ @@ -279,6 +284,7 @@ export const HEADER = 'header'; * Field referring to object storing the transforms */ export const FACET = 'facet'; +export const DEFAULT = 'default'; /** * Ordering type */ @@ -287,3 +293,8 @@ export const ASCENDING = 'asc'; * Ordering type */ export const DESCENDING = 'desc'; + +export const DARK = 'dark'; +export const NONE = 'none'; +export const NORMAL = 'normal'; +export const DARKER = 'darker'; diff --git a/packages/visual-group/src/enums/defaults.js b/packages/visual-group/src/enums/defaults.js index 0798b90e..7a066989 100644 --- a/packages/visual-group/src/enums/defaults.js +++ b/packages/visual-group/src/enums/defaults.js @@ -5,3 +5,7 @@ export const DATA_UPDATE_COUNTER = 0; export const DEFAULT_LAYER_TYPE = 'cartesian'; +export const BORDER_WIDTH = { + default: 2, + facet: 1 +}; diff --git a/packages/visual-group/src/group-helper/cell-border-applier.js b/packages/visual-group/src/group-helper/cell-border-applier.js new file mode 100644 index 00000000..1bbe3b3b --- /dev/null +++ b/packages/visual-group/src/group-helper/cell-border-applier.js @@ -0,0 +1,135 @@ +import { + DARK, + NONE, + LEFT, + RIGHT, + NORMAL, + TOP, + DARKER, + BOTTOM +} from '../enums/constants'; + +const handleBlankCell = (data) => { + data.config().externalClassname.push(`${NONE}-${LEFT}`); + data.config().externalClassname.push(`${NONE}-${RIGHT}`); +}; + +export const sanitiseHeaderMatrix = (matrices, header) => { + if (header) { + for (let i = 0; i < matrices.length; i++) { + if (i !== 0) { + matrices[i].config({ + externalClassname: [`${DARK}`] + }); + } else { + matrices[i].config({ + externalClassname: [`${NONE}-${LEFT}`, `${DARK}`] + }); + } + } + } else { + for (let i = 0; i < matrices.length; i++) { + for (let j = 0; j < matrices[0].length; j++) { + matrices[i][j].config({ + externalClassname: [`${DARK}`] + }); + } + } + } +}; + +export const sanitiseGeomMatrix = (matrices, arr = {}) => { + for (let i = 0; i < matrices.length; i++) { + for (let j = 0; j < matrices[0].length; j++) { + matrices[i][j].config({ + externalClassname: [`${NORMAL}`] + }); + + if (i === 0) { + matrices[i][j].config().externalClassname.push(`${DARKER}-${TOP}`); + } else if (i === matrices.length - 1) { + matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`); + } + + if (j === matrices[i].length - 1) { + matrices[i][j].config().externalClassname.push(`${DARK}-${RIGHT}`); + } + + if (arr[i]) { + matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`); + } + } + } +}; + +export const sanitiseFacetValues = (matrices, type, blankCell) => { + const normal = type === `${RIGHT}` ? `${DARK}` : `${NORMAL}`; + const length = matrices.length; + let latestSource = matrices[0][0].source(); + const lastSource = matrices[matrices.length - 1][0].source(); + const arr = {}; + + // initialise the classname + for (let i = 0; i < matrices.length; i++) { + for (let j = 0; j < matrices[0].length; j++) { + matrices[i][j].config({ + externalClassname: [normal] + }); + } + + // seperate wrt the corner most facet + if (matrices[i][0].source() !== latestSource) { + arr[i] = i; + latestSource = matrices[i][0].source(); + } + } + + // add custom classname + for (let i = 0; i < matrices.length; i++) { + for (let j = 0; j < matrices[0].length; j++) { + if (j === 0) { + matrices[i][0].config().externalClassname.push(`${NONE}-${type}`); + if (matrices[i][j].source() === lastSource) { + matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`); + } else { + matrices[i][0].config().externalClassname.push(`${DARK}-${BOTTOM}`); + } + if (matrices[i][j] instanceof blankCell) { + matrices[i][j].config().externalClassname.push(`${NONE}-${TOP}`); + matrices[i][j].config().externalClassname.push(`${NONE}-${BOTTOM}`); + } + } else if (j !== matrices[i].length - 1) { + matrices[i][j].config().externalClassname.push(`${DARK}-${type}`); + } + + if (i === 0) { + matrices[0][j].config().externalClassname.push(`${DARKER}-${TOP}`); + } else if (i === length - 1) { + matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`); + } + + if (arr[i]) { + matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`); + } + + if (matrices[i][j] instanceof blankCell) { + handleBlankCell(matrices[i][j], blankCell); + } + } + } + return arr; +}; + +export const sanitiseBorderMatrix = (matrices, blankCell) => { + const { leftMatrix, rightMatrix, topMatrix, bottomMatrix } = matrices; + let bottomBorderObj = {}; + if (rightMatrix.length) { + bottomBorderObj = sanitiseFacetValues(rightMatrix, `${RIGHT}`, blankCell); + } + if (leftMatrix.length) { + bottomBorderObj = sanitiseFacetValues(leftMatrix, `${LEFT}`, blankCell); + } + topMatrix.length && sanitiseHeaderMatrix(topMatrix); + bottomMatrix.length && sanitiseHeaderMatrix(bottomMatrix); + return bottomBorderObj; +}; diff --git a/packages/visual-group/src/group-helper/cell-creator.js b/packages/visual-group/src/group-helper/cell-creator.js index 8c59f625..390d6088 100644 --- a/packages/visual-group/src/group-helper/cell-creator.js +++ b/packages/visual-group/src/group-helper/cell-creator.js @@ -19,6 +19,7 @@ import { import { ROW, ROWS, COLUMNS, COL, LEFT, RIGHT, TOP, BOTTOM, PRIMARY, SECONDARY, X, Y, TEMPORAL } from '../enums/constants'; import { SimpleVariable } from '../variable'; +import { sanitiseBorderMatrix, sanitiseGeomMatrix } from './cell-border-applier'; /** * Updates row and column cells with the geom cell corresponding to the facet keys @@ -499,23 +500,27 @@ const transformDataModel = (dataModel, config, resolver) => { if (resolvedData instanceof DataModel) { resolvedData.dispose(); } - groupedModel = dataModel.project(dataModel.getSchema().map(d => d.name)); + + const fields = getFieldsFromSuppliedLayers(suppliedLayers).filter(field => + getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION); + const allFields = extractFields(facetsAndProjections, fields); + + groupedModel = dataModel.project(allFields); resolver.data(groupedModel); if (!groupBy.disabled) { - const fields = getFieldsFromSuppliedLayers(suppliedLayers, groupedModel.getFieldsConfig()); - const allFields = extractFields(facetsAndProjections, fields); + const newFieldsConfig = groupedModel.getFieldsConfig(); const dimensions = allFields.filter(field => - getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION); + getObjProp(newFieldsConfig, field, 'def', 'type') === FieldType.DIMENSION); const aggregationFns = groupBy.measures; const measureNames = Object.keys(groupedModel.getFieldspace().getMeasure()); const nearestAggFns = retrieveNearestGroupByReducers(groupedModel, ...measureNames); const resolvedAggFns = mergeRecursive(nearestAggFns, aggregationFns); - groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns) - .project(allFields); + groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns); } // sort temporal fields if any in the given rows and columns groupedModel = sortDmTemporalFields(resolver, groupedModel); + resolver.transformedData(groupedModel); return groupedModel; }; @@ -528,27 +533,36 @@ const transformDataModel = (dataModel, config, resolver) => { * @return {Object} conputed matrices * @memberof MatrixResolver */ -export const computeMatrices = (context, config) => { +export const computeMatrices = (resolverConfig) => { + let placeholderInfo = {}; const { - resolver, datamodel, + encoders, + resolver, + globalConfig, + selection, + transform, componentRegistry, - encoders - } = context; - const { - globalConfig, - selection, - transform - } = config; - const groupBy = globalConfig.autoGroupBy; - const { smartlabel: labelManager } = resolver.dependencies(); - const fieldMap = datamodel.getFieldsConfig(); - const layerConfig = resolver.layerConfig(); - const registry = resolver.registry(); - const { fields: normalizedRows } = resolver.horizontalAxis(); - const { fields: normalizedColumns } = resolver.verticalAxis(); - const otherEncodings = resolver.optionalProjections(config, layerConfig); - const facetsAndProjections = resolver.getAllFields(); + groupBy, + labelManager, + fieldMap, + layerConfig, + registry, + normalizedRows, + normalizedColumns, + otherEncodings, + facetsAndProjections, + simpleEncoder, + config + } = resolverConfig; + + const { rowFacets, colFacets, colProjections, rowProjections } = facetsAndProjections; + const isProjection = rowProjections.length > 0 || colProjections.length > 0; + const isFacet = rowFacets.length > 0 || colFacets.length > 0; + + if (isFacet) { + globalConfig.isFacet = true; + } const matrixGnContext = { // Configuration to be passed to generate the different matrices. // A common config is used for both value matrices and other matrices @@ -565,10 +579,10 @@ export const computeMatrices = (context, config) => { resolver }; const cells = { - GeomCell: resolver.getCellDef(registry.GeomCell), - AxisCell: resolver.getCellDef(registry.AxisCell), - BlankCell: resolver.getCellDef(registry.BlankCell), - TextCell: resolver.getCellDef(registry.TextCell) + GeomCell: resolver.getCellDef(registry.cells.GeomCell), + AxisCell: resolver.getCellDef(registry.cells.AxisCell), + BlankCell: resolver.getCellDef(registry.cells.BlankCell), + TextCell: resolver.getCellDef(registry.cells.TextCell) }; const isRowSizeEqual = isDistributionEqual(normalizedRows); const isColumnSizeEqual = isDistributionEqual(normalizedColumns); @@ -589,13 +603,12 @@ export const computeMatrices = (context, config) => { }; resolver.cacheMaps(newCacheMap); - const valueCellContext = { config: globalConfig, - suppliedLayers: encoders.simpleEncoder.serializeLayerConfig(resolver.layerConfig()), + suppliedLayers: simpleEncoder.serializeLayerConfig(resolver.layerConfig()), resolver, cell: cells.GeomCell, - encoder: encoders.simpleEncoder, + encoder: simpleEncoder, newCacheMap, detailFields: config.detail, retinalConfig: { @@ -610,7 +623,7 @@ export const computeMatrices = (context, config) => { suppliedLayers: valueCellContext.suppliedLayers, groupBy }, resolver); - + simpleEncoder.data(groupedModel); // return a callback function to create the cells from the matrix const cellCreator = resolver.valueCellsCreator(valueCellContext); // Creates value matrices from the datamodel and configs @@ -644,8 +657,17 @@ export const computeMatrices = (context, config) => { resolver.rowMatrix(rows); resolver.columnMatrix(columns); + if (isFacet || isProjection) { + const arr = sanitiseBorderMatrix({ + leftMatrix: rows[0], + rightMatrix: rows[1], + topMatrix: columns[0], + bottomMatrix: columns[1] + }, registry.cells.BlankCell); + valueMatrixInfo.matrix = sanitiseGeomMatrix(valueMatrixInfo.matrix, arr); + } - return { + placeholderInfo = { rows: resolver.rowMatrix(), columns: resolver.columnMatrix(), values: resolver.valueMatrix(), @@ -661,4 +683,5 @@ export const computeMatrices = (context, config) => { parentModel: datamodel } }; + return placeholderInfo; }; diff --git a/packages/visual-group/src/group-helper/group-utils.js b/packages/visual-group/src/group-helper/group-utils.js index 004fe858..e14a860e 100644 --- a/packages/visual-group/src/group-helper/group-utils.js +++ b/packages/visual-group/src/group-helper/group-utils.js @@ -1,9 +1,10 @@ -import { Store, FieldType, COORD_TYPES, getObjProp, DataModel } from 'muze-utils'; +import { Store, COORD_TYPES, getObjProp, DataModel } from 'muze-utils'; import { VisualUnit } from '@chartshq/visual-unit'; import { BaseLayer } from '@chartshq/visual-layer'; import { DATA_UPDATE_COUNTER } from '../enums/defaults'; import { Variable } from '../variable'; import { PolarEncoder, CartesianEncoder } from '../encoder'; +import { sanitiseHeaderMatrix } from './cell-border-applier'; import { DIMENSION, MEASURE, @@ -104,6 +105,13 @@ export const extractUnitConfig = (config) => { return unitConfig; }; +export const hasOneField = (fields) => { + let hasField = false; + const keys = Object.keys(fields); + hasField = keys.some(d => fields[d].length > 0); + return hasField; +}; + /** * * @@ -145,6 +153,7 @@ export const headerCreator = (fields, fieldHeaders, TextCell, { classPrefix, lab labelManager }).source(getHeaderText(fieldHeaders, i, fields[0].length)) .config({ show: cell.config().show })) : []; + sanitiseHeaderMatrix(headers, true); return headers; }; @@ -430,12 +439,11 @@ export const getBorders = (matrices, encoder) => { return { showRowBorders, showColBorders, showValueBorders }; }; -export const getFieldsFromSuppliedLayers = (suppliedLayerConfig, fieldsConfig) => { - let fields = []; +export const getFieldsFromSuppliedLayers = (suppliedLayerConfig) => { const encodingArr = suppliedLayerConfig.map(conf => (conf.encoding || {})); - fields = [...fields, [].concat(...encodingArr.map(enc => Object.values(enc).map(d => d.field)))]; - fields = fields.filter(field => fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION); - return fields; + const fields = [].concat(...encodingArr.map(enc => Object.values(enc).map(d => (typeof d === 'object' ? + d.field : d)))); + return [...new Set(fields.filter(d => d))]; }; export const extractFields = (facetsAndProjections, layerFields) => { diff --git a/packages/visual-group/src/group-helper/index.js b/packages/visual-group/src/group-helper/index.js index a104bf1f..321172c5 100644 --- a/packages/visual-group/src/group-helper/index.js +++ b/packages/visual-group/src/group-helper/index.js @@ -1,4 +1,4 @@ export { - initStore, findInGroup, getEncoder, getAxisType, getAxisKey, retriveDomainFromData, getBorders + initStore, findInGroup, getEncoder, getAxisType, getAxisKey, retriveDomainFromData, getBorders, hasOneField } from './group-utils'; export { default as MatrixResolver } from './matrix-resolver'; diff --git a/packages/visual-group/src/group-helper/matrix-model.js b/packages/visual-group/src/group-helper/matrix-model.js index 4208eb2e..3f8ffcab 100644 --- a/packages/visual-group/src/group-helper/matrix-model.js +++ b/packages/visual-group/src/group-helper/matrix-model.js @@ -1,5 +1,7 @@ -import { DataModel } from 'muze-utils'; +import { DataModel, mergeRecursive } from 'muze-utils'; import { sortFacetFields } from './group-utils'; +import { BORDER_WIDTH } from '../enums/defaults'; +import { FACET } from '../enums/constants'; /** * Gets name of fields form the variables @@ -96,6 +98,36 @@ const createJoinedKeys = keys => keys.map(e => ({ joinedKey: e.join(',') })); +const setDefaultConfigForFacet = (facetInfo, projectionInfo, config) => { + let conf = {}; + + if (facetInfo.allFacets.length || projectionInfo.indices.length > 1) { + const { facetsUserConfig, border } = config; + const { isBorderPresent, isGridLinePresent } = facetsUserConfig; + const gridLinesShowLength = Object.keys(isGridLinePresent).length; + let borderWidth = border.width; + let gridLines = {}; + + if (!isBorderPresent) { + borderWidth = BORDER_WIDTH[FACET]; + } + if (gridLinesShowLength <= 0) { + gridLines = { + x: { + show: false + } + }; + } + conf = { + border: { + width: borderWidth + }, + gridLines + }; + } + return conf; +}; + /** * * @@ -310,6 +342,9 @@ export const getMatrixModel = (dataModel, fieldInfo, geomCellCreator, globalConf colKeys } = getSplitModelHashMap(allSplitModels, facetInfo, globalConfig); + const defaultConfig = setDefaultConfigForFacet(facetInfo, projectionInfo, globalConfig); + globalConfig = mergeRecursive(globalConfig, defaultConfig); + const generalContext = { matrix, geomCellCreator, diff --git a/packages/visual-group/src/group-helper/matrix-resolver.js b/packages/visual-group/src/group-helper/matrix-resolver.js index 09324ff4..ab5f00a2 100644 --- a/packages/visual-group/src/group-helper/matrix-resolver.js +++ b/packages/visual-group/src/group-helper/matrix-resolver.js @@ -1,4 +1,3 @@ -import { VisualUnit } from '@chartshq/visual-unit'; import { generateGetterSetters, STATE_NAMESPACES, getUniqueId } from 'muze-utils'; import { initializeCacheMaps, @@ -50,10 +49,15 @@ export default class MatrixResolver { angle: [], angle0: [] }; - generateGetterSetters(this, RESOLVER_PROPS); + this._placeholderInfo = {}; + generateGetterSetters(this, this.constructor.getterSetters()); + this.cacheMaps(initializeCacheMaps()); } + static getterSetters () { + return RESOLVER_PROPS; + } /** * Set: Registers placeholders, Get: return {Object} those placeholders * @@ -103,13 +107,6 @@ export default class MatrixResolver { return this._axes; } - /** - * - * - * @param {*} facets - * - * @memberof MatrixResolver - */ facets (...facets) { if (facets.length) { Object.entries(facets[0]).forEach((e) => { @@ -120,13 +117,6 @@ export default class MatrixResolver { return this._facets; } - /** - * - * - * @param {*} projections - * - * @memberof MatrixResolver - */ projections (...projections) { if (projections.length) { Object.entries(projections[0]).forEach((e) => { @@ -137,15 +127,7 @@ export default class MatrixResolver { return this._projections; } - /** - * - * - * @param {*} config - * @param {*} layerConfig - * - * @memberof MatrixResolver - */ - optionalProjections (config, layerConfig) { + optionalProjections (config, layerConfig, schema) { const otherEncodings = {}; const optionalProjections = []; const otherEncodingTypes = [SIZE, COLOR, SHAPE]; @@ -162,17 +144,8 @@ export default class MatrixResolver { optionalProjections.push(...config.detail); } - if (layerConfig.length) { - layerConfig.forEach((layer) => { - if (layer.encoding) { - Object.values(layer.encoding).forEach((enc) => { - if (enc && optionalProjections.indexOf(enc.field) === -1) { - optionalProjections.push(enc.field ? enc.field : enc); - } - }); - } - }); - } + const encoder = this.encoder(); + optionalProjections.push(...encoder.getProjectionFields(layerConfig, schema)); this.projections({ optionalProjections }); return otherEncodings; } @@ -216,7 +189,7 @@ export default class MatrixResolver { * @memberof MatrixResolver */ getCellDef (cell) { - const registry = this.registry(); + const registry = this.registry().cells; Object.values(registry).forEach((e) => { if (e.prototype instanceof cell) { @@ -256,12 +229,6 @@ export default class MatrixResolver { }); } - /** - * - * - * - * @memberof MatrixResolver - */ getAllFields () { const retObj = this.projections(); @@ -271,11 +238,6 @@ export default class MatrixResolver { return retObj; } - /** - * - * - * @memberof MatrixResolver - */ resetSimpleAxes () { return this.axes({ x: new Set(), @@ -309,7 +271,7 @@ export default class MatrixResolver { } = config; const { layerRegistry, - sideEffectRegistry + interactions } = componentRegistry; const { smartlabel: smartLabel, @@ -324,6 +286,7 @@ export default class MatrixResolver { const unitConfig = extractUnitConfig(globalConfig || {}); const store = this.store(); store.lockModel(); + const { VisualUnit } = this.registry(); this.forEach(VALUE_MATRIX, (i, j, el) => { let unit = el.source(); @@ -332,7 +295,7 @@ export default class MatrixResolver { unit = VisualUnit.create({ layerRegistry, - sideEffectRegistry + interactions }, { smartLabel, lifeCycleManager, @@ -366,7 +329,7 @@ export default class MatrixResolver { * @param {*} config * @memberof MatrixResolver */ - setDomains (config, datamodel, encoders) { + setRetinalAxisDomain (config, datamodel, encoders) { const { color, shape, @@ -386,7 +349,7 @@ export default class MatrixResolver { const facetFields = [...rowFacets.map(e => e.toString()), ...colFacets.map(e => e.toString())]; const retContext = { domains: encoders.simpleEncoder.getRetinalFieldsDomain(datamodel, encoding, facetFields, groupBy), - axes: this.axes(), + axes: this.getRetinalAxes(), encoding }; encoders.retinalEncoder.setCommonDomain(retContext); @@ -399,12 +362,6 @@ export default class MatrixResolver { return this; } - /** - * - * - * - * @memberof MatrixResolver - */ getRetinalAxes () { const { color, @@ -419,73 +376,24 @@ export default class MatrixResolver { }; } - /** - * - * - * @param {*} type - * - * @memberof MatrixResolver - */ getSimpleAxes (type) { return this.axes()[`${type}`]; } - /** - * - * - * @param {*} datamodel - * @param {*} config - * @memberof MatrixResolver - */ createRetinalAxes (fieldsConfig, config, encoders) { - const layerConfig = this.layerConfig(); - this.optionalProjections(config, layerConfig); const retinalAxes = encoders.retinalEncoder.createAxis({ fieldsConfig, config, axes: this.axes() }); - const { - lifeCycleManager - } = this.dependencies(); - [COLOR, SHAPE, SIZE].forEach((e) => { - this.axes()[e] = retinalAxes[e]; - }); + this.axes(retinalAxes); - lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS }); - lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT }); + this.updateVisualUnit(config); - const units = []; - const matrixLayers = this.matrixLayers(); - const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`, - `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`]; - const store = this.store(); - store.lockCommits(props); - store.lockModel(); - this.forEach(VALUE_MATRIX, (i, j, el) => { - el.axes(Object.assign(el.axes(), retinalAxes)); - el.source() && el.source().retinalFields(config); - el.layerDef(matrixLayers[i][j]); - el.updateModel(); - - units.push(el.source()); - }); - store.unlockModel() - .unlockCommits([props[0]]) - .unlockCommits([props[1]]); - lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT }); return this; } - /** - * - * - * @param {*} placeholders - * @param {*} fieldNames - * - * @memberof MatrixResolver - */ createHeaders (placeholders, fieldNames, config) { let bottomLeft = []; let bottomRight = []; @@ -501,8 +409,7 @@ export default class MatrixResolver { showHeaders, classPrefix } = config; - const TextCell = this.getCellDef(this.registry().TextCell); - const BlankCell = this.getCellDef(this.registry().BlankCell); + const { TextCell, BlankCell } = this.registry().cells; const [leftRows, rightRows] = rows; const [topCols, bottomCols] = columns; const rowHeaders = fieldNames.rows; @@ -549,37 +456,47 @@ export default class MatrixResolver { return { topLeft, topRight, bottomLeft, bottomRight }; } - /** - * - * - * @param {*} datamodel - * @param {*} config - * @param {*} componentRegistry - * @param {*} encoders - * - * @memberof MatrixResolver - */ - getMatrices (datamodel, config, componentRegistry, encoders) { - const context = { - datamodel, - componentRegistry, - encoders, - resolver: this - }; + updateVisualUnit (retinalConfig) { + const retinalAxes = this.getRetinalAxes(); + + const { lifeCycleManager } = this.dependencies(); + lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS }); + lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT }); + + const units = []; + const matrixLayers = this.matrixLayers(); + + const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`, + `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`]; + const store = this.store(); + store.lockCommits(props); + store.lockModel(); + + this.forEach(VALUE_MATRIX, (i, j, el) => { + el.axes(Object.assign(el.axes(), retinalAxes)); + el.source() && el.source().retinalFields(retinalConfig); + el.layerDef(matrixLayers[i][j]); + el.updateModel(); + + units.push(el.source()); + }); - return computeMatrices(context, config); + store.unlockModel() + .unlockCommits([props[0]]) + .unlockCommits([props[1]]); + lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT }); + return this; } - store (...params) { - if (params.length) { - this._store = params[0]; - return this; - } - return this._store; + getMatrices (resolverConfig) { + this._placeholderInfo = computeMatrices(resolverConfig); + + return this._placeholderInfo; } clear () { const cacheMaps = this._cacheMaps; + for (const key in cacheMaps) { cacheMaps[key].clear(); } diff --git a/packages/visual-group/src/group-helper/resolver-props.js b/packages/visual-group/src/group-helper/resolver-props.js index 7409b368..af654f21 100644 --- a/packages/visual-group/src/group-helper/resolver-props.js +++ b/packages/visual-group/src/group-helper/resolver-props.js @@ -11,5 +11,7 @@ export const RESOLVER_PROPS = { valueMatrix: {}, encoder: {}, valueParser: {}, - data: {} + data: {}, + transformedData: {}, + store: {} }; diff --git a/packages/visual-group/src/index.js b/packages/visual-group/src/index.js index ce7395dc..acbbc29f 100644 --- a/packages/visual-group/src/index.js +++ b/packages/visual-group/src/index.js @@ -1,4 +1,10 @@ +import * as Encoders from './encoder'; +import * as encoderHelpers from './encoder/encoder-helper'; +import * as groupUtils from './group-helper/group-utils'; +import * as enums from './enums/constants'; + export { VisualGroup } from './visual-group'; export { SimpleGroup } from './simple-group'; export { ComposedVars, SimpleVariable } from './variable'; export { default as ValueMatrix } from './visual-group/value-matrix'; +export { Encoders, encoderHelpers, groupUtils, enums }; diff --git a/packages/visual-group/src/visual-group/change-listener.js b/packages/visual-group/src/visual-group/change-listener.js index cce9bcbe..7dc459d9 100644 --- a/packages/visual-group/src/visual-group/change-listener.js +++ b/packages/visual-group/src/visual-group/change-listener.js @@ -1,6 +1,3 @@ -import { VisualUnit } from '@chartshq/visual-unit'; -import { BaseLayer } from '@chartshq/visual-layer'; - import { STATE_NAMESPACES } from 'muze-utils'; export const setupChangeListeners = (context) => { @@ -18,7 +15,8 @@ export const setupChangeListeners = (context) => { })); }); }); - + const { VisualUnit, layerRegistry } = context.registry(); + const { base: BaseLayer } = layerRegistry; [VisualUnit, BaseLayer].forEach((comp) => { const formalName = comp.formalName(); ['store', 'throwback'].forEach((type) => { diff --git a/packages/visual-group/src/visual-group/helper.js b/packages/visual-group/src/visual-group/helper.js index 57e442cf..49d2a3df 100644 --- a/packages/visual-group/src/visual-group/helper.js +++ b/packages/visual-group/src/visual-group/helper.js @@ -1,10 +1,11 @@ import { VisualUnit } from '@chartshq/visual-unit'; -import { STATE_NAMESPACES, CommonProps } from 'muze-utils'; +import { STATE_NAMESPACES, CommonProps, InvalidAwareTypes } from 'muze-utils'; import { BaseLayer } from '@chartshq/visual-layer'; -import { getEncoder, getBorders } from '../group-helper'; +import { getBorders } from '../group-helper'; import { RetinalEncoder } from '../encoder'; import { registerDomainChangeListener, unsubscribeChangeListeners } from './change-listener'; import ValueMatrix from './value-matrix'; +import { ROWS, COLUMNS, DATA } from '../enums/constants'; export const createUnitState = (context) => { const [globalState, localState] = VisualUnit.getState(); @@ -61,7 +62,34 @@ export const setMatrixInstances = (context, placeholder) => { return context; }; -export const createMatrices = (context) => { +const hasValue = (val) => { + let hasOneValue = false; + for (let i = 0; i < val.length && !hasOneValue; i++) { + for (let j = 0; j < val[i].length; j++) { + if (!(val[i][j] instanceof InvalidAwareTypes)) { + hasOneValue = true; + break; + } + } + } + return hasOneValue; +}; + +export const updateChecker = (context, props) => props.every((option) => { + const val = context[option](); + switch (option) { + case ROWS: + case COLUMNS: + return val !== null; + case DATA: + return val && !val.isEmpty() && hasValue(val.getData().data); + + default: + return true; + } +}); + +export const initializeFields = (context) => { const rows = context.rows(); const columns = context.columns(); const color = context.color(); @@ -72,11 +100,12 @@ export const createMatrices = (context) => { const transform = context.transform(); const config = context.config(); const shape = context.shape(); - // Get the resolver for the matrices const resolver = context.resolver(); + resolver.store(context.store()); resolver.valueParser(context.valueParser()); + // Prepare configuration for matrix preparation let matrixConfig = { selection: context.selection(), @@ -101,7 +130,7 @@ export const createMatrices = (context) => { // Create the encoders for the group const encoders = {}; encoders.retinalEncoder = new RetinalEncoder(); - encoders.simpleEncoder = getEncoder(layers); + encoders.simpleEncoder = context.createEncoderInstance(); matrixConfig.coord = encoders.simpleEncoder.constructor.type(); resolver.encoder(encoders.simpleEncoder); @@ -115,26 +144,57 @@ export const createMatrices = (context) => { layers && resolver.layerConfig(layers); // Set the row and column axes resolver.horizontalAxis(fields.rows, encoders).verticalAxis(fields.columns, encoders); - // Getting the placeholders - const placeholderInfo = resolver.getMatrices(datamodel, matrixConfig, context.registry(), encoders); + + return { + rows, + columns, + color, + datamodel, + size, + detail, + layers, + transform, + config, + shape, + resolver, + matrixConfig, + retinalConfig, + encoders, + fields + }; +}; + +export const createMatrices = (context, sanitizedConfig) => { + const { groupConfig, resolverConfig } = sanitizedConfig; + const { + config, + resolver, + matrixConfig, + encoders, + retinalConfig, + fields + } = groupConfig; + + const placeholderInfo = resolver.getMatrices(resolverConfig); + context._groupedDataModel = placeholderInfo.dataModels.groupedModel; - // Set the selection object + // Set the selection object context.selection(placeholderInfo.selection); - // Create retinal axes + // Create retinal axes resolver.createRetinalAxes(placeholderInfo.dataModels.parentModel.getFieldsConfig(), retinalConfig, - encoders); + encoders); - // Domains are evaluated for each of the axes for commonality - resolver.setDomains(matrixConfig, placeholderInfo.dataModels, encoders); + // Domains are evaluated for each of the axes for commonality + resolver.setRetinalAxisDomain(matrixConfig, placeholderInfo.dataModels, encoders); - // Create matrix instances + // Create matrix instances setMatrixInstances(context, placeholderInfo); - // Prepare corner matrices + // Prepare corner matrices context.cornerMatrices(resolver.createHeaders(placeholderInfo, fields, config)); - // Set placeholder information + // Set placeholder information context.placeholderInfo(placeholderInfo); context._composition.axes = resolver.axes(); @@ -147,3 +207,49 @@ export const createMatrices = (context) => { registerDomainChangeListener(context); return context; }; + +export const initializeResolverFields = (context, config) => { + const { + datamodel, + encoders, + resolver, + componentRegistry + } = context; + const { + globalConfig, + selection, + transform + } = config; + const groupBy = globalConfig.autoGroupBy; + const { smartlabel: labelManager } = resolver.dependencies(); + const fieldMap = datamodel.getFieldsConfig(); + const layerConfig = resolver.layerConfig(); + const registry = resolver.registry(); + const { fields: normalizedRows } = resolver.horizontalAxis(); + const { fields: normalizedColumns } = resolver.verticalAxis(); + const otherEncodings = resolver.optionalProjections(config, layerConfig, datamodel.getSchema()); + const facetsAndProjections = resolver.getAllFields(); + const { simpleEncoder } = encoders; + const shouldRender = simpleEncoder.hasMandatoryFields(facetsAndProjections); + return { + datamodel, + encoders, + resolver, + globalConfig, + selection, + transform, + componentRegistry, + groupBy, + labelManager, + fieldMap, + layerConfig, + registry, + normalizedRows, + normalizedColumns, + otherEncodings, + facetsAndProjections, + simpleEncoder, + shouldRender, + config + }; +}; diff --git a/packages/visual-group/src/visual-group/index.js b/packages/visual-group/src/visual-group/index.js index 0c2e6a12..cd975cda 100644 --- a/packages/visual-group/src/visual-group/index.js +++ b/packages/visual-group/src/visual-group/index.js @@ -1 +1,2 @@ export { default as VisualGroup } from './visual-group'; + diff --git a/packages/visual-group/src/visual-group/props.js b/packages/visual-group/src/visual-group/props.js index b75a9188..404c11c3 100644 --- a/packages/visual-group/src/visual-group/props.js +++ b/packages/visual-group/src/visual-group/props.js @@ -28,7 +28,10 @@ export const PROPS = { registry: { sanitization: (context, value) => { if (context.resolver) { - context.resolver().registry(value.cellRegistry); + context.resolver().registry({ + cells: value.cellRegistry, + VisualUnit: value.VisualUnit + }); } return value; } diff --git a/packages/visual-group/src/visual-group/value-matrix.js b/packages/visual-group/src/visual-group/value-matrix.js index 02a575c4..168f6795 100644 --- a/packages/visual-group/src/visual-group/value-matrix.js +++ b/packages/visual-group/src/visual-group/value-matrix.js @@ -136,6 +136,10 @@ class ValueMatrix { this.each(cell => cell.remove()); this.matrix([]); } + + data () { + + } } export default ValueMatrix; diff --git a/packages/visual-group/src/visual-group/visual-group.js b/packages/visual-group/src/visual-group/visual-group.js index 5daee42f..380478a4 100644 --- a/packages/visual-group/src/visual-group/visual-group.js +++ b/packages/visual-group/src/visual-group/visual-group.js @@ -3,16 +3,29 @@ import localOptions from './local-options'; import { SimpleGroup } from '../simple-group'; import { MatrixResolver, - findInGroup + findInGroup, + getEncoder } from '../group-helper'; -import { createUnitState, initializeGlobalState, setMatrixInstances, createMatrices, createLayerState } from './helper'; +import { + createUnitState, + initializeGlobalState, + setMatrixInstances, + createMatrices, + createLayerState, + initializeResolverFields, + initializeFields, + updateChecker +} from './helper'; import { setupChangeListeners } from './change-listener'; import { PROPS } from './props'; import { CONFIG, MOUNT, RETINAL, - Y + Y, + ROWS, + COLUMNS, + DATA } from '../enums/constants'; /** @@ -42,7 +55,9 @@ class VisualGroup extends SimpleGroup { super(); const { - componentSubRegistry + components, + componentSubRegistry, + interactions } = registry; this._dependencies = dependencies; @@ -50,8 +65,8 @@ class VisualGroup extends SimpleGroup { // One can get each property by calling the method and can set it // by passing paramaters for the same. Thus, one can chain setter // getter methods. - generateGetterSetters(this, PROPS); - generateGetterSetters(this, localOptions); + generateGetterSetters(this, this.constructor.getterSetters()); + generateGetterSetters(this, this.constructor.localOptions()); // Populate the store with default values // initialize group compositions this._composition = {}; @@ -62,13 +77,15 @@ class VisualGroup extends SimpleGroup { // selection object that takes care of updating of components this._selection = {}; // Create instance of matrix resolver - this.resolver(new MatrixResolver(this._dependencies)); + this.createMatrixResolver(); // matrix instance store each of the matrices setMatrixInstances(this, {}); // Getting indiviual registered items this.registry({ - layerRegistry: componentSubRegistry.layerRegistry.get(), - cellRegistry: componentSubRegistry.cellRegistry.get() + layerRegistry: componentSubRegistry.layers.get(), + cellRegistry: componentSubRegistry.cells.get(), + VisualUnit: components.VisualUnit, + interactions }); } @@ -97,6 +114,17 @@ class VisualGroup extends SimpleGroup { return this._store; } + static formalName () { + return 'VisualGroup'; + } + + static localOptions () { + return localOptions; + } + static getterSetters () { + return PROPS; + } + /** * Return the instances of matrices created by the visual group. * @@ -247,8 +275,39 @@ class VisualGroup extends SimpleGroup { return this._groupedDataModel; } - createMatrices () { - createMatrices(this); + createMatrices (sanitizedConfig) { + createMatrices(this, sanitizedConfig); + } + + getMandatoryFields () { + const updateProps = updateChecker(this, [ROWS, COLUMNS, DATA]); + let sanitizedValue = { + groupConfig: {}, + resolverConfig: {}, + shouldRender: false + }; + if (updateProps) { + const localFields = initializeFields(this); + const { + datamodel, + encoders, + resolver, + matrixConfig + } = localFields; + const context = { + datamodel, + componentRegistry: this.registry(), + encoders, + resolver + }; + const resolverFields = initializeResolverFields(context, matrixConfig); + sanitizedValue = { + groupConfig: localFields, + resolverConfig: resolverFields, + shouldRender: resolverFields.shouldRender + }; + } + return sanitizedValue; } remove () { @@ -259,6 +318,18 @@ class VisualGroup extends SimpleGroup { info.columns = null; info.values = null; } + + createEncoderInstance () { + const layers = this.layers(); + + return getEncoder(layers); + } + + createMatrixResolver () { + this.resolver(new MatrixResolver(this._dependencies)); + + return this; + } } export default VisualGroup; diff --git a/packages/visual-layer/src/base-layer/base-layer.js b/packages/visual-layer/src/base-layer/base-layer.js index 1af6629e..f4090191 100644 --- a/packages/visual-layer/src/base-layer/base-layer.js +++ b/packages/visual-layer/src/base-layer/base-layer.js @@ -1,34 +1,9 @@ import { - getUniqueId, - mergeRecursive, - FieldType, - selectElement, - ReservedFields, - DataModel, - clone, - generateGetterSetters, - STATE_NAMESPACES, - COORD_TYPES, - transactor, - defaultValue, - getObjProp + mix } from 'muze-utils'; import { SimpleLayer } from '../simple-layer'; -import * as PROPS from '../enums/props'; -import { props } from './props'; -import { - transformData, - getNormalizedData, - applyInteractionStyle, - getValidTransform, - domainCalculator, - renderLayer -} from '../helpers'; -import { localOptions } from './local-options'; -import { listenerMap } from './listener-map'; - -const layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE]; -const groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE; +import { BaseLayerMixin } from './base-mixin'; +import { BASE_LAYER } from '../enums/constants'; /** * An abstract class which gives definition of common layer functionality like @@ -49,154 +24,7 @@ const groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE; * @class * @module BaseLayer */ -export default class BaseLayer extends SimpleLayer { - - /** - * Creates a layer using a configuration and data. - * - * @public - * @constructor - * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a layer. - * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from - * value to px. - * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis, - * TimeAxis, ContinuousAxis - * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis, - * TimeAxis, ContinuousAxis - * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators - * @param {ShapeAxis} axes.shape Axis for providing a shape - * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator - * @param {LayerConfig} config Configuration of the layer - * @param {Object} dependencies Dependencies of the layer - * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance - */ - constructor (data, axes, config, dependencies = {}) { - super(); - - generateGetterSetters(this, props); - this.axes(axes); - this.alias(this.constructor.formalName() + getUniqueId()); - this.dependencies(dependencies); - this._points = []; - this._cachedData = []; - this._id = getUniqueId(); - this._measurement = {}; - this._animationDonePromises = []; - this._graphicElems = {}; - this._customConfig = null; - } - - static getState () { - return [ - { - domain: null - }, - Object.keys(localOptions).reduce((acc, v) => { - acc[v] = localOptions[v].value; - return acc; - }, {}) - ]; - } - - static getListeners () { - return { - store: [...listenerMap, { - type: 'registerChangeListener', - props: [`${layerNs[1]}.${PROPS.DATA}`, - ...['x', 'y', 'radius'].map(type => `${groupNs}.domain.${type}`)], - listener: (context) => { - renderLayer(context); - }, - subNamespace: (context) => { - const { unitRowIndex, unitColIndex, namespace } = context.metaInf(); - return { - [`${layerNs[1]}.${PROPS.DATA}`]: namespace, - [`${groupNs}.domain.x`]: `${unitColIndex}0`, - [`${groupNs}.domain.y`]: `${unitRowIndex}0`, - [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}` - }; - } - }], - throwback: [] - }; - } - - static getQualifiedStateProps () { - const layerState = BaseLayer.getState(); - return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`)); - } - - store (...params) { - if (params.length) { - const store = this._store = params[0]; - const { namespace } = this.metaInf(); - store.addSubNamespace(namespace, BaseLayer.formalName(), this); - - transactor(this, localOptions, store, { - subNamespace: namespace, - namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}` - }); - return this; - } - return this._store; - } - - domain (...dom) { - const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`; - const store = this.store(); - if (dom.length) { - const { parentNamespace, namespace } = this.metaInf(); - const domain = defaultValue(store.get(prop, parentNamespace), {}); - domain[namespace] = dom[0]; - this.store().commit(prop, domain, parentNamespace); - return this; - } - return this.store().get(prop, this.metaInf().namespace); - } - - /** - * Creates a layer instance - * @return {BaseLayer} Instance of a layer - */ - static create (...params) { - return new this(...params); - } - - /** - * Default configuration of the layer. This configuration gets merged to the user passed configuration using a - * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own - * configuration. - * - * @public - * @static - * - * @return {Object} Default configuration - */ - static defaultConfig () { - return { - transform: { - type: 'identity' - } - }; - } - - /** - * Policy defines how user config gets merged to default config. The default policy here does a deep copy - * operation. - * Any policy which does more than deep copying should define the policy as a static member. - * - * @static - * @public - * - * @param {LayerConfig} conf Configuration with which the user config will be merged - * @param {LayerConfig} userConf Configuration given by the user - * - * @return {LayerConfig} Merged layer configuration - */ - static defaultPolicy (conf, userConf) { - return mergeRecursive(conf, userConf); - } - +export default class BaseLayer extends mix(SimpleLayer).with(BaseLayerMixin) { /** * Determines a name for a layer. This name of the layer is used in the input data to refer to this layer. * ``` @@ -212,495 +40,6 @@ export default class BaseLayer extends SimpleLayer { * @return {string} name of layer */ static formalName () { - return 'base'; - } - - encodingFieldsInf (...fieldsInf) { - if (fieldsInf.length) { - this._encodingFieldsInf = fieldsInf[0]; - return this; - } - return this._encodingFieldsInf; - } - - encodingTransform (...encodingTransform) { - if (encodingTransform.length) { - this._encodingTransform = encodingTransform[0]; - return this; - } - return this._encodingTransform; - } - - /** - * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among multiple - * layers of same type if one layer has to be referred, alias is used. If no alias is given then `formalName` is set - * as the alias name. - * - * - * If used as setter - * @param {string} alias Name of the alias - * @return {BaseLayer} Instance of current base layer - * - * If used as getter - * @return {string} Alias of the current layer - * - * @public - */ - alias (...params) { - if (params.length) { - this._alias = params[0]; - return this; - } - return this._alias || this.constructor.formalName(); - } - - dependencies (...params) { - if (params.length) { - this._dependencies = params[0]; - return this; - } - return this._dependencies; - } - - enableCaching () { - this._cacheEnabled = true; - return this; - } - - clearCaching () { - this._cacheEnabled = false; - return this.data(this._cachedData[0]); - } - - /** - * Serialize the schema. Merge config is used for serialization. - * - * @public - * - * @return {LayerConfig} Serialized schema - */ - serialize () { - return this.config(); - } - - /** - * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema. - * - * @public - * - * @return {string} id of the layer - */ - id () { - return this._id; - } - - /** - * Returns the transformed data based on given transform type. - * It first gets the transform method from transform factory based on type of transform. It then calls the - * transform method with the data and passes the configuration parameters of transform such as - * groupBy, value field, etc. - * - * @param {DataModel} dataModel Instance of DataModel - * @param {Object} config Configuration for transforming data - * @return {Array.} Transformed data. - */ - getTransformedData (dataModel, config, transformType, encodingFieldsInf) { - return transformData(dataModel, config, transformType, encodingFieldsInf); - } - - /** - * Calculates the domain from the data. - * It checks the type of field and calculates the domain based on that. For example, if it - * is a quantitative or temporal field, then it calculates the min and max from the data or - * if it is a categorical field then it gets all the values from the data of that field. - * @param {Array} data DataArray - * @param {Object} fieldsConfig Configuration of fields - * @return {Array} Domain values array. - */ - calculateDomainFromData (data) { - let domains = {}; - const isEmpty = this.data().isEmpty(); - - if (!isEmpty) { - domains = domainCalculator[this.coord()](data, this); - } - return domains; - } - - static shouldDrawAnchors () { - return false; - } - - /** - * Returns the domain for the axis. - * - * @param {string} encodingType type of encoding x, y, etc. - * @return {Object} Axis domains - */ - getDataDomain (encodingType) { - const { parentNamespace, namespace } = this.metaInf(); - const domains = getObjProp(this.store() - .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace); - return encodingType !== undefined ? domains[encodingType] || [] : domains; - } - - /** - * Normalizes the transformed data and returns it. - * - * @param {string} encodingType type of encoding x, y, etc. - * @return {Object} Axis domains - */ - getNormalizedData (transformedData) { - return getNormalizedData(transformedData, this); - } - - /** - * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns - * null. - * - * @public - * - * @param {number} x X Coordinate. - * @param {number} y Y Coordinate. - * - * @return {Object} Information of the nearest point. - * ``` - * { - * // id property contains the field names and their corresponding values in a 2d array. This is the data - * // associated with the nearest point. - * id: // Example data: [['Origin'], ['USA']], - * dimensions: // Physical dimensions of the point. - * layerId: // Id of the layer instance. - * } - * ``` - */ - getNearestPoint () { - return null; - } - - applyInteractionStyle (interactionType, selectionSet, apply, styles) { - const interactionConfig = this.config().interaction || {}; - - let interactionStyles = interactionConfig[interactionType]; - interactionStyles = styles || interactionStyles; - if (interactionStyles) { - applyInteractionStyle(this, selectionSet, interactionStyles, { - apply, - interactionType - }); - } - } - - disableUpdate () { - this._updateLock = true; - return this; - } - - enableUpdate () { - this._updateLock = false; - return this; - } - - resolveTransformType () { - this._transformType = getValidTransform(this); - } - - transformType () { - return this._transformType; - } - - /** - * Renders the layer - * @return {BaseLayer} Instance of the layer. - */ - render () { - return this; - } - - /** - * - * - * - * @memberof BaseLayer - */ - elemType () { - return 'g'; - } - - /** - * Disposes the entire layer. - * - * @return {BaseLayer} Instance of layer. - */ - remove () { - const { namespace, parentNamespace } = this.metaInf(); - const store = this.store(); - store.removeSubNamespace(namespace, BaseLayer.formalName()); - const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`); - const unitDom = layersDomain[parentNamespace]; - unitDom && (delete unitDom[namespace]); - selectElement(this.mount()).remove(); - return this; - } - - /** - * Stores point in an object with key as the categorical value or temporal value - * - * @param {string} key categorical value or temporal value - * @param {Object} data Information of the data point - * @return {BarLayer} Instance of bar layer - */ - cachePoint (key, data) { - if (key === null) { - return this; - } - const pointMap = this._pointMap; - !pointMap[key] && (pointMap[key] = []); - pointMap[key].push(data); - return this; - } - - /** - * - * - * @param {*} dataProps - * - * @memberof BaseLayer - */ - dataProps (...dataProps) { - if (dataProps.length) { - this._dataProps = dataProps[0]; - return this; - } - return this._dataProps; - } - - /** - * - * - * @param {*} data - * @param {*} id - * - * @memberof BaseLayer - */ - getIdentifiersFromData (data) { - const schema = this.data().getSchema(); - const fieldsConfig = this.data().getFieldsConfig(); - const identifiers = [[], []]; - const { - xFieldType, - yFieldType, - xField, - yField - } = this.encodingFieldsInf(); - - const [xMeasure, yMeasure] = [xFieldType, yFieldType].map(type => type === FieldType.MEASURE); - schema.forEach((d, i) => { - const name = d.name; - if (fieldsConfig[name].def.type === FieldType.DIMENSION) { - identifiers[0].push(name); - identifiers[1].push(data[i]); - } - }); - - if (xMeasure && yMeasure) { - const xMeasureIndex = fieldsConfig[xField].index; - const yMeasureIndex = fieldsConfig[yField].index; - identifiers[0].push(...[xField, yField]); - identifiers[1].push(...[data[xMeasureIndex], data[yMeasureIndex]]); - } - return identifiers; - } - - hasPlotSpan () { - return false; - } - - getPlotSpan () { - return { - x: 0, - y: 0 - }; - } - - getPlotPadding () { - return { - x: 0, - y: 0 - }; - } - - /** - * Returns the information of the marks corresponding to the supplied identifiers. Identifiers are a set of field - * names and their corresponding values in an array. It can also be an instance of datamodel. - * - * For example, - * ``` - * const identifiers = [ - * ['Origin', 'Cylinders'], - * ['USA', '8'] - * ]; - * const points = barLayer.getPointsFromIdentifiers(identifiers); - * ``` - * @public - * @param {Array|DataModel} identifiers Identifiers of the marks. - * @param {Object} config Optional configuration which describes how to get the information. - * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only - * the positions of the points. - * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks. - * - * @return {Array} Array of points contains - */ - getPointsFromIdentifiers (identifiers, config = {}) { - const getAllAttrs = config.getAllAttrs; - const getBBox = config.getBBox; - if (!this.data()) { - return []; - } - let fieldNames; - let values; - if (identifiers instanceof DataModel) { - const dataObj = identifiers.getData(); - fieldNames = dataObj.schema.map(d => d.name); - values = dataObj.data; - } else { - fieldNames = identifiers[0]; - values = identifiers.slice(1, identifiers.length); - } - - const points = this._points; - const fieldsConfig = this.data().getFieldsConfig(); - - const filteredPoints = [].concat(...points).filter((point) => { - const { source, rowId } = point; - - return fieldNames.every((field, idx) => { - if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) { - return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1; - } else if (field === ReservedFields.ROW_ID) { - return values.findIndex(d => d[idx] === rowId) !== -1; - } return true; - }); - }); - return getAllAttrs ? filteredPoints : filteredPoints.map((d) => { - const obj = clone(d); - if (getBBox) { - const update = obj.update || obj; - if (obj.size !== undefined) { - const sizeVal = Math.sqrt(obj.size / Math.PI) * 2; - update.width = sizeVal; - update.height = sizeVal; - update.x -= sizeVal / 2; - update.y -= sizeVal / 2; - } else { - if (update.width === undefined) { - update.width = 2; - } - if (update.height === undefined) { - update.height = 2; - } - } - } - - return obj.update || obj; - }).sort((a, b) => a.y - b.y); - } - - getTransformedDataFromIdentifiers (identifiers) { - const { data: identifierData, schema: identifierSchema } = identifiers.getData(); - const normalizedData = this._normalizedData; - const fieldsConfig = this.data().getFieldsConfig(); - const { - yField, - xField, - yFieldType, - xFieldType - } = this.encodingFieldsInf(); - let measureIndex; - let enc; - if (xFieldType === FieldType.MEASURE) { - measureIndex = fieldsConfig[xField].index; - enc = 'x'; - } else if (yFieldType === FieldType.MEASURE) { - measureIndex = fieldsConfig[yField].index; - enc = 'y'; - } - - const transformedData = []; - normalizedData.forEach((dataArr) => { - dataArr.forEach((dataObj) => { - const tupleArr = dataObj.source; - const exist = identifierSchema.every((obj, i) => - identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1); - if (exist) { - const transformedVal = dataObj[enc]; - const row = dataObj.source; - const tuple = {}; - for (const key in fieldsConfig) { - const index = fieldsConfig[key].index; - tuple[key] = row[index]; - if (index === measureIndex) { - tuple[key] = transformedVal; - } - } - transformedData.push(tuple); - } - }); - }); - - return [transformedData, this.data().getSchema()]; - } - - /** - * Returns the dom elements associated with the supplied set of row ids. - * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids, it returns all - * the elements which is mapped with those row ids. - * - * @public - * @param {Array} set Array of row ids - * - * @return {Selection} D3 Selection of dom elements. - */ - getPlotElementsFromSet (set) { - const graphicElems = this._graphicElems; - const elems = []; - for (let i = 0, len = set.length; i < len; i++) { - const elem = graphicElems[set[i]]; - if (elem) { - elems.push(elem); - } - } - return elems; - } - - /** - * Notifies when all animations/transitions of the layer are completed. - * - * @public - * @return {Promise} Returns a promise to notify the animation completion. - */ - animationDone () { - return Promise.all(this._animationDonePromises); - } - - registerAnimationDoneHook () { - let resolveFn; - const promise = new Promise((resolve) => { - resolveFn = resolve; - }); - this._animationDonePromises.push(promise); - - return () => { - resolveFn(); - }; - } - - getRenderProps () { - if (this.coord() === COORD_TYPES.POLAR) { - return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.radius`]; - } - const { unitRowIndex: rowIndex, unitColIndex: colIndex } = this.metaInf(); - return [`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.y.${rowIndex}0`, - `${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.x.${colIndex}0`]; + return BASE_LAYER; } } diff --git a/packages/visual-layer/src/base-layer/base-mixin.js b/packages/visual-layer/src/base-layer/base-mixin.js new file mode 100644 index 00000000..ec8cccac --- /dev/null +++ b/packages/visual-layer/src/base-layer/base-mixin.js @@ -0,0 +1,746 @@ +import { + getUniqueId, + mergeRecursive, + FieldType, + selectElement, + ReservedFields, + DataModel, + clone, + generateGetterSetters, + STATE_NAMESPACES, + transactor, + defaultValue, + getObjProp, + InvalidAwareTypes +} from 'muze-utils'; +import * as PROPS from '../enums/props'; +import { props } from './props'; +import { + transformData, + getNormalizedData, + applyInteractionStyle, + getValidTransform, + domainCalculator, + renderLayer, + encodingFieldInfRetriever +} from '../helpers'; +import { localOptions } from './local-options'; +import { listenerMap } from './listener-map'; +import { BASE_LAYER, AREA_LAYER } from '../enums/constants'; +import { applyStylesOnInteraction } from './helper'; + +const layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE]; +const groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE; + +export const BaseLayerMixin = superclass => class extends superclass { + /** + * Creates a layer using a configuration and data. + * + * @public + * @constructor + * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a + * layer. + * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from + * value to px. + * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis, + * TimeAxis, ContinuousAxis + * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis, + * TimeAxis, ContinuousAxis + * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators + * @param {ShapeAxis} axes.shape Axis for providing a shape + * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator + * @param {LayerConfig} config Configuration of the layer + * @param {Object} dependencies Dependencies of the layer + * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance + */ + constructor () { + super(); + + generateGetterSetters(this, this.constructor.getterSetters()); + this.axes({}); + this.alias(this.constructor.formalName() + getUniqueId()); + this._points = []; + this._cachedData = []; + this._id = getUniqueId(); + this._measurement = {}; + this._animationDonePromises = []; + this._graphicElems = {}; + this._customConfig = null; + } + + static getState () { + return [ + { + domain: null + }, + Object.keys(this.localOptions()).reduce((acc, v) => { + acc[v] = localOptions[v].value; + return acc; + }, {}) + ]; + } + + static getListeners () { + return { + store: [...listenerMap, { + type: 'registerChangeListener', + props: this.getRenderProps(), + listener: (context) => { + renderLayer(context); + }, + subNamespace: (context) => { + const { unitRowIndex, unitColIndex, namespace } = context.metaInf(); + return { + [`${layerNs[1]}.${PROPS.DATA}`]: namespace, + [`${groupNs}.domain.x`]: `${unitColIndex}0`, + [`${groupNs}.domain.y`]: `${unitRowIndex}0`, + [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}` + }; + } + }], + throwback: [] + }; + } + + static getQualifiedStateProps () { + const layerState = this.getState(); + return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`)); + } + + store (...params) { + if (params.length) { + const store = this._store = params[0]; + const { namespace } = this.metaInf(); + store.addSubNamespace(namespace, BASE_LAYER, this); + + transactor(this, this.constructor.localOptions(), store, { + subNamespace: namespace, + namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}` + }); + return this; + } + return this._store; + } + + domain (...dom) { + const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`; + const store = this.store(); + if (dom.length) { + const { parentNamespace, namespace } = this.metaInf(); + const domain = defaultValue(store.get(prop, parentNamespace), {}); + domain[namespace] = dom[0]; + this.store().commit(prop, domain, parentNamespace); + return this; + } + return this.store().get(prop, this.metaInf().namespace); + } + + /** + * Creates a layer instance + * @return {BaseLayer} Instance of a layer + */ + static create (...params) { + return new this(...params); + } + + /** + * Default configuration of the layer. This configuration gets merged to the user passed configuration using a + * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own + * configuration. + * + * @public + * @static + * + * @return {Object} Default configuration + */ + static defaultConfig () { + return { + transform: { + type: 'identity' + } + }; + } + + static getterSetters () { + return props; + } + + static localOptions () { + return localOptions; + } + /** + * Policy defines how user config gets merged to default config. The default policy here does a deep copy + * operation. + * Any policy which does more than deep copying should define the policy as a static member. + * + * @static + * @public + * + * @param {LayerConfig} conf Configuration with which the user config will be merged + * @param {LayerConfig} userConf Configuration given by the user + * + * @return {LayerConfig} Merged layer configuration + */ + static defaultPolicy (conf, userConf) { + return mergeRecursive(conf, userConf); + } + + /** + * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among + * multiple layers of same type if one layer has to be referred, alias is used. If no alias is given then + * `formalName` is set as the alias name. + * + * + * If used as setter + * @param {string} alias Name of the alias + * @return {BaseLayer} Instance of current base layer + * + * If used as getter + * @return {string} Alias of the current layer + * + * @public + */ + alias (...params) { + if (params.length) { + this._alias = params[0]; + return this; + } + return this._alias || this.constructor.formalName(); + } + + enableCaching () { + this._cacheEnabled = true; + return this; + } + + clearCaching () { + this._cacheEnabled = false; + return this.data(this._cachedData[0]); + } + + /** + * Serialize the schema. Merge config is used for serialization. + * + * @public + * + * @return {LayerConfig} Serialized schema + */ + serialize () { + return this.config(); + } + + /** + * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema. + * + * @public + * + * @return {string} id of the layer + */ + id () { + return this._id; + } + + /** + * Returns the transformed data based on given transform type. + * It first gets the transform method from transform factory based on type of transform. It then calls the + * transform method with the data and passes the configuration parameters of transform such as + * groupBy, value field, etc. + * + * @param {DataModel} dataModel Instance of DataModel + * @param {Object} config Configuration for transforming data + * @return {Array.} Transformed data. + */ + getTransformedData (dataModel, config, transformType, encodingFieldsInf) { + return transformData(dataModel, config, transformType, encodingFieldsInf); + } + + /** + * Calculates the domain from the data. + * It checks the type of field and calculates the domain based on that. For example, if it + * is a quantitative or temporal field, then it calculates the min and max from the data or + * if it is a categorical field then it gets all the values from the data of that field. + * @param {Array} data DataArray + * @param {Object} fieldsConfig Configuration of fields + * @return {Array} Domain values array. + */ + calculateDomainFromData (data) { + let domains = {}; + const isEmpty = this.data().isEmpty(); + + if (!isEmpty) { + domains = domainCalculator[this.coord()](data, this); + } + return domains; + } + + static shouldDrawAnchors () { + return false; + } + + /** + * Returns the domain for the axis. + * + * @param {string} encodingType type of encoding x, y, etc. + * @return {Object} Axis domains + */ + getDataDomain (encodingType) { + const { parentNamespace, namespace } = this.metaInf(); + const domains = getObjProp(this.store() + .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace); + return encodingType !== undefined ? domains[encodingType] || [] : domains; + } + + getUidsFromPayload ({ model, uids }, targetData) { + const targetFields = targetData[0]; + const targetVals = targetData.slice(1, targetData.length); + const payloadMap = targetVals.reduce((acc, v) => { + acc[v] = v; + return acc; + }, {}); + const measures = Object.keys(this.data().getFieldspace().getMeasure()); + + const filterFn = (fields, i) => { + const row = `${targetFields.map((field) => { + let val; + if (field === ReservedFields.MEASURE_NAMES) { + val = measures; + } else if (field === ReservedFields.ROW_ID) { + val = i; + } else { + const currentField = fields[field]; + const isFieldInvalid = currentField instanceof InvalidAwareTypes; + + val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue; + } + return val; + })}`; + return row in payloadMap; + }; + + const dm = model.select(filterFn, {}); + + // Need to find a better way to do this instead of iterating the full data + const currentSetIds = this.data().select(filterFn, { + saveChild: false + }).getUids(); + + const uidMap = currentSetIds.reduce((acc, v) => { + acc[v] = true; + return acc; + }, {}); + + return { + model: dm, + uids: uids.filter(d => uidMap[d[0]]), + length: currentSetIds.length + }; + } + + /** + * Normalizes the transformed data and returns it. + * + * @param {string} encodingType type of encoding x, y, etc. + * @return {Object} Axis domains + */ + getNormalizedData (transformedData) { + return getNormalizedData(transformedData, this); + } + + /** + * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns + * null. + * + * @public + * + * @param {number} x X Coordinate. + * @param {number} y Y Coordinate. + * + * @return {Object} Information of the nearest point. + * ``` + * { + * // id property contains the field names and their corresponding values in a 2d array. This is the + * data // associated with the nearest point. + * id: // Example data: [['Origin'], ['USA']], + * dimensions: // Physical dimensions of the point. + * layerId: // Id of the layer instance. + * } + * ``` + */ + getNearestPoint () { + return null; + } + + applyInteractionStyle (interactionType, selectionSet, options) { + const interactionConfig = this.config().interaction || {}; + const { apply, styles, reset } = options; + + let interactionStyles = interactionConfig[interactionType]; + interactionStyles = styles || interactionStyles; + if (interactionStyles) { + applyInteractionStyle(this, selectionSet, interactionStyles, { + apply, + interactionType, + reset + }); + } + } + + resolveTransformType () { + this._transformType = getValidTransform(this); + } + + transformType () { + return this._transformType; + } + + /** + * Renders the layer + * @return {BaseLayer} Instance of the layer. + */ + render () { + return this; + } + + elemType () { + return 'g'; + } + + /** + * Disposes the entire layer. + * + * @return {BaseLayer} Instance of layer. + */ + remove () { + const { namespace, parentNamespace } = this.metaInf(); + const store = this.store(); + store.removeSubNamespace(namespace, BASE_LAYER); + const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`); + const unitDom = layersDomain[parentNamespace]; + unitDom && (delete unitDom[namespace]); + selectElement(this.mount()).remove(); + return this; + } + + /** + * Stores point in an object with key as the categorical value or temporal value + * + * @param {string} key categorical value or temporal value + * @param {Object} data Information of the data point + * @return {BarLayer} Instance of bar layer + */ + cachePoint (key, data) { + if (key === null) { + return this; + } + const pointMap = this._pointMap; + !pointMap[key] && (pointMap[key] = []); + pointMap[key].push(data); + return this; + } + + getInteractionStyles () { + return applyStylesOnInteraction; + } + + addOverlayPath () { + return null; + } + + removeOverlayPath () { + return null; + } + + applyLayerStyle (elem, interactionType, style, options) { + const interactionFn = this.getInteractionStyles(); + return interactionFn(this, elem, interactionType, style, options); + } + + getIdentifiersFromData (data, rowId) { + const schema = this.data().getSchema(); + const fieldsConfig = this.data().getFieldsConfig(); + const identifiers = [[], []]; + + const allMeasures = schema.every(field => field.type === FieldType.MEASURE); + schema.forEach((d, i) => { + const name = d.name; + const { type } = fieldsConfig[name].def; + if (type === FieldType.DIMENSION) { + identifiers[0].push(name); + identifiers[1].push(data[i]); + } + }); + + const measures = schema.filter(d => d.type === FieldType.MEASURE).map(d => d.name); + if (measures.length) { + identifiers[0].push(ReservedFields.MEASURE_NAMES); + identifiers[1].push(measures.join()); + } + + if (allMeasures) { + identifiers[0].push(...[ReservedFields.ROW_ID]); + identifiers[1].push(...[rowId]); + } + + return identifiers; + } + + hasPlotSpan () { + return false; + } + + getPlotSpan () { + return { + x: 0, + y: 0 + }; + } + + getPlotPadding () { + return { + x: 0, + y: 0 + }; + } + + /** + * Returns the information of the marks corresponding to the supplied identifiers. + * Identifiers are a set of field names and their corresponding values in an array. + * It can also be an instance of datamodel. + * + * For example, + * ``` + * const identifiers = [ + * ['Origin', 'Cylinders'], + * ['USA', '8'] + * ]; + * const points = barLayer.getPointsFromIdentifiers(identifiers); + * ``` + * @public + * @param {Array|DataModel} identifiers Identifiers of the marks. + * @param {Object} config Optional configuration which describes how to get the information. + * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only + * the positions of the points. + * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks. + * + * @return {Array} Array of points contains + */ + getPointsFromIdentifiers (identifiers, config = {}) { + const getAllAttrs = config.getAllAttrs; + const getBBox = config.getBBox; + if (!this.data()) { + return []; + } + let fieldNames; + let values; + if (identifiers instanceof DataModel) { + const dataObj = identifiers.getData(); + fieldNames = dataObj.schema.map(d => d.name); + values = dataObj.data; + } else { + fieldNames = identifiers[0]; + values = identifiers.slice(1, identifiers.length); + } + + const points = this._points; + const fieldsConfig = this.data().getFieldsConfig(); + + const filteredPoints = [].concat(...points).filter((point) => { + const { source, rowId } = point; + + return fieldNames.every((field, idx) => { + if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) { + return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1; + } else if (field === ReservedFields.ROW_ID) { + return values.findIndex(d => d[idx] === rowId) !== -1; + } return true; + }); + }); + return getAllAttrs ? filteredPoints : filteredPoints.map((d) => { + const obj = clone(d); + if (getBBox) { + const update = obj.update || obj; + if (obj.size !== undefined) { + const sizeVal = Math.sqrt(obj.size / Math.PI) * 2; + update.width = sizeVal; + update.height = sizeVal; + update.x -= sizeVal / 2; + update.y -= sizeVal / 2; + } else { + if (update.width === undefined) { + update.width = 2; + } + if (update.height === undefined) { + update.height = 2; + } + } + } + + return obj.update || obj; + }).sort((a, b) => a.y - b.y); + } + + getTransformedDataFromIdentifiers (identifiers, idx = 0) { + const { data: identifierData, schema: identifierSchema } = identifiers.getData(); + const normalizedData = this._normalizedData; + const fieldsConfig = this.data().getFieldsConfig(); + const { + yField, + xField, + yFieldType, + xFieldType + } = this.encodingFieldsInf(); + let measureIndex; + let enc; + if (xFieldType === FieldType.MEASURE) { + measureIndex = fieldsConfig[xField].index; + enc = 'x'; + } else if (yFieldType === FieldType.MEASURE) { + const layerName = this.constructor.formalName(); + measureIndex = fieldsConfig[yField].index; + enc = 'y'; + if (layerName === AREA_LAYER) { + enc = (idx % 2 === 0) ? 'y' : 'y0'; + } + } + + const transformedData = []; + normalizedData.forEach((dataArr) => { + dataArr.forEach((dataObj) => { + const tupleArr = dataObj.source; + const exist = identifierSchema.every((obj, i) => + identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1); + if (exist) { + const transformedVal = dataObj[enc] || 0; + const row = dataObj.source; + const tuple = {}; + for (const key in fieldsConfig) { + const index = fieldsConfig[key].index; + tuple[key] = row[index]; + if (index === measureIndex) { + tuple[key] = transformedVal; + } + } + transformedData.push(tuple); + } + }); + }); + + return [transformedData, this.data().getSchema()]; + } + + /** + * Returns the dom elements associated with the supplied set of row ids. + * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids, + * it returns all the elements which is mapped with those row ids. + * + * @public + * @param {Array} set Array of row ids + * + * @return {Selection} D3 Selection of dom elements. + */ + getPlotElementsFromSet (set) { + const graphicElems = this._graphicElems; + const elems = []; + for (let i = 0, len = set.length; i < len; i++) { + const elem = graphicElems[set[i]]; + if (elem) { + elems.push(elem); + } + } + return elems; + } + + /** + * Notifies when all animations/transitions of the layer are completed. + * + * @public + * @return {Promise} Returns a promise to notify the animation completion. + */ + animationDone () { + return Promise.all(this._animationDonePromises); + } + + registerAnimationDoneHook () { + let resolveFn; + const promise = new Promise((resolve) => { + resolveFn = resolve; + }); + this._animationDonePromises.push(promise); + + return () => { + resolveFn(); + }; + } + + /** + * Called when the layer datamodel is set. + * + * @param {Array} arr Old and new datamodel instance. + * @param {DataModel} arr[0] Previous datamodel instance. + * @param {DataModel} arr[1] Current datamodel instance. + * + * @return {BaseLayer} Instance of layer. + */ + dataDidSet ([, data]) { + const config = this.config(); + + if (data && config) { + if (this._cacheEnabled) { + this._cachedData.push(data); + } else { + this._cachedData = [data]; + } + const encodingValue = config.encoding; + if (encodingValue) { + const fieldsConfig = data.getFieldsConfig(); + const encodingFieldsInf = this.retrieveEncodingFields(encodingValue, this.coord(), data); + this.encodingFieldsInf(encodingFieldsInf); + this.resolveTransformType(); + this._transformedData = this.getTransformedData(data, config, + this.transformType(), encodingFieldsInf); + this._normalizedData = this.getNormalizedData(this._transformedData, fieldsConfig); + if (config.calculateDomain !== false) { + const domain = this.calculateDomainFromData(this._normalizedData, + this.encodingFieldsInf(), this.data().getFieldsConfig()); + this.domain(domain); + } + } + } + return this; + } + + retrieveEncodingFields (encoding, coord, data) { + const fieldsConfig = data.getFieldsConfig(); + + return encodingFieldInfRetriever[coord](encoding, fieldsConfig); + } + + static getRenderProps () { + return [`${layerNs[1]}.${PROPS.DATA}`, ...['x', 'y', 'radius'].map(type => + `${groupNs}.domain.${type}`)]; + } + + applyStyles ({ strokeStyles, otherStyles, styleObj, elem, mountPoint, applicableStrokePos, datum }) { + strokeStyles.forEach((type) => { + this.addOverlayPath( + elem.node(), + datum, + { type, value: styleObj[type] }, + applicableStrokePos, + mountPoint + ); + }); + + this.applyElementStyles(elem, otherStyles, styleObj); + } + + applyElementStyles (elem, styles, styleObj) { + styles.forEach((type) => { + elem.style(type, styleObj[type]); + }); + } + + getBoundBoxes () { + return null; + } +}; diff --git a/packages/visual-layer/src/base-layer/helper.js b/packages/visual-layer/src/base-layer/helper.js new file mode 100644 index 00000000..16cd4e48 --- /dev/null +++ b/packages/visual-layer/src/base-layer/helper.js @@ -0,0 +1,99 @@ +import { partition } from 'muze-utils'; + +const getLastItemInMap = map => Array.from(map)[map.size - 1]; + +const getPreviousStyle = (meta, interactionType) => { + const { originalStyle, currentState } = meta; + let stylesForCurrentLevel = Object.assign({}, originalStyle); + + if (currentState.size > 0) { + interactionType = getLastItemInMap(currentState)[0]; + stylesForCurrentLevel = currentState.get(interactionType) || {}; + // const elemFill = elem.style('fill'); + // const newStyle = Object.assign({}, stylesForCurrentLevel, { fill: elemFill }); + } + return stylesForCurrentLevel; +}; + +const strokeProps = { + 'stroke-width': 1, + stroke: 1, + 'stroke-opacity': 1 +}; + +const parseStyle = (value, { datum, datumStyle }, apply) => { + if (typeof value === 'function') { + if (isNaN(datumStyle)) { + // const colorType = detectColor(datumStyle); + const rgbaValues = datumStyle.replace(/[^\d,.]/g, '').split(',').map(s => Number(s)); + value = value(rgbaValues, datum, apply); + } else { + const numValue = parseFloat(datumStyle, 10); + value = value(numValue, datum, apply); + } + return value; + } + return value; +}; + +export const applyStylesOnInteraction = (context, elem, interactionType, conf, options) => { + const { mountPoint, apply, reset } = options; + + const d = elem.data()[0]; + let datum; + + if (Array.isArray(d)) { + datum = d[0]; + } else { + datum = Array.isArray(d.data) ? d.data[0] : d; + } + const { currentState, originalStyle } = datum.meta; + + let applicableStyles = {}; + + const { style: styles, strokePosition } = conf; + let applicableStrokePos = strokePosition; + + if (reset) { + currentState.clear(); + } + + let applyStyle = true; + + if (apply) { + const sanitizedStyles = { + styles: {}, + strokePosition + }; + for (const type in styles) { + const parsedStyleVal = parseStyle(styles[type], { + datum, + datumStyle: elem.style(type) + }, apply); + + sanitizedStyles.styles[type] = parsedStyleVal; + } + currentState.set(interactionType, sanitizedStyles); + applicableStyles = sanitizedStyles.styles; + } else if (!currentState.has(interactionType) && !reset) { + applyStyle = false; + } else { + currentState.delete(interactionType); + const currentStyle = getPreviousStyle(datum.meta, interactionType); + applicableStyles = Object.assign({}, originalStyle.styles, currentStyle.styles); + applicableStrokePos = currentStyle.strokePosition || originalStyle.strokePosition; + } + + const styleKeys = Object.keys(applicableStyles); + const [strokeStyles, otherStyles] = partition(styleKeys, v => v in strokeProps); + + applyStyle && context.applyStyles({ + strokeStyles, + otherStyles, + styleObj: applicableStyles, + elem, + datum, + applicableStrokePos, + mountPoint + }); +}; diff --git a/packages/visual-layer/src/base-layer/index.js b/packages/visual-layer/src/base-layer/index.js index dd443e46..d38f5562 100644 --- a/packages/visual-layer/src/base-layer/index.js +++ b/packages/visual-layer/src/base-layer/index.js @@ -1 +1,2 @@ export { default as BaseLayer } from './base-layer'; +export { BaseLayerMixin } from './base-mixin'; diff --git a/packages/visual-layer/src/base-layer/listener-map.js b/packages/visual-layer/src/base-layer/listener-map.js index 28fbfa90..3a78e498 100644 --- a/packages/visual-layer/src/base-layer/listener-map.js +++ b/packages/visual-layer/src/base-layer/listener-map.js @@ -1,35 +1,12 @@ import { STATE_NAMESPACES } from 'muze-utils'; import * as PROPS from '../enums/props'; -import { encodingFieldInfRetriever } from '../helpers'; export const listenerMap = [ { props: [`${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}.${PROPS.DATA}`], type: 'registerImmediateListener', - listener: (context, [, data]) => { - const config = context.config(); - if (data && config) { - if (context._cacheEnabled) { - context._cachedData.push(data); - } else { - context._cachedData = [data]; - } - const encodingValue = config.encoding; - if (encodingValue) { - const fieldsConfig = data.getFieldsConfig(); - const encodingFieldsInf = encodingFieldInfRetriever[context.coord()](encodingValue, fieldsConfig); - context.encodingFieldsInf(encodingFieldsInf); - context.resolveTransformType(); - context._transformedData = context.getTransformedData(data, config, - context.transformType(), encodingFieldsInf); - context._normalizedData = context.getNormalizedData(context._transformedData, fieldsConfig); - if (config.calculateDomain !== false) { - const domain = context.calculateDomainFromData(context._normalizedData, - context.encodingFieldsInf(), context.data().getFieldsConfig()); - context.domain(domain); - } - } - } + listener: (context, [prevData, data]) => { + context.dataDidSet([prevData, data]); }, namespace: context => context.metaInf().namespace } diff --git a/packages/visual-layer/src/base-layer/props.js b/packages/visual-layer/src/base-layer/props.js index 9abfb4f1..ee40ba16 100644 --- a/packages/visual-layer/src/base-layer/props.js +++ b/packages/visual-layer/src/base-layer/props.js @@ -22,5 +22,9 @@ export const props = { return constructor.defaultPolicy(newConf, config); } - } + }, + encodingTransform: {}, + encodingFieldsInf: {}, + dependencies: {}, + dataProps: {} }; diff --git a/packages/visual-layer/src/enums/constants.js b/packages/visual-layer/src/enums/constants.js index 5b59330d..0f585a7f 100644 --- a/packages/visual-layer/src/enums/constants.js +++ b/packages/visual-layer/src/enums/constants.js @@ -18,9 +18,15 @@ export const ENCODING = { RADIUS: 'radius', RADIUS0: 'radius0', ANGLE: 'angle', - ANGLE0: 'angle0' + ANGLE0: 'angle0', + COLOR: 'color', + SHAPE: 'shape', + SIZE: 'size', + TEXT: 'text' }; +export const STROKE_DASHARRAY = 'stroke-dasharray'; + export const ASCENDING = 'asc'; export const AGG_FN_SUM = 'sum'; diff --git a/packages/visual-layer/src/enums/index.js b/packages/visual-layer/src/enums/index.js new file mode 100644 index 00000000..70adff38 --- /dev/null +++ b/packages/visual-layer/src/enums/index.js @@ -0,0 +1,5 @@ +import * as PROPS from './props'; +import * as LAYER_TYPES from './layer-types'; +import * as CONSTANTS from './constants'; + +export { PROPS, LAYER_TYPES, CONSTANTS }; diff --git a/packages/visual-layer/src/helpers/index.js b/packages/visual-layer/src/helpers/index.js index 262f65ca..9898a9f0 100644 --- a/packages/visual-layer/src/helpers/index.js +++ b/packages/visual-layer/src/helpers/index.js @@ -9,7 +9,9 @@ import { getObjProp, COORD_TYPES, CommonProps, - defaultValue + defaultValue, + InvalidAwareTypes, + isSimpleObject } from 'muze-utils'; import { ScaleType } from '@chartshq/muze-axis'; import { transformFactory } from '@chartshq/transform'; @@ -18,111 +20,79 @@ import { IDENTITY, STACK, GROUP, COLOR, SHAPE, SIZE, ENCODING, AGG_FN_SUM, ASCEN const BAND = ScaleType.BAND; const { POLAR, CARTESIAN } = COORD_TYPES; -const transformColor = (colorAxis, datum, styleType, intensity) => { +export const transformColor = (colorAxis, datum, styleType, intensity, interactionType) => { const meta = datum.meta; - const stateColor = defaultValue(meta.stateColor[styleType], meta.originalColor[styleType]); + const stateColor = defaultValue(meta.currentState[interactionType][styleType], meta.originalState[styleType]); const colorInfo = colorAxis.transformColor(stateColor, intensity); - meta.stateColor[styleType] = colorInfo.hsla; + // meta.stateColor[styleType] = colorInfo.hsla; + meta.currentState[interactionType][styleType] = colorInfo.hsla; return colorInfo; }; export const applyInteractionStyle = (context, selectionSet, interactionStyles, config) => { const elements = context.getPlotElementsFromSet(selectionSet); - const axes = context.axes(); - const colorAxis = axes.color; - const apply = config.apply; - const interactionType = config.interactionType; - interactionStyles.forEach((style) => { - const styleType = style.type; - elements.forEach((elem) => { - elem.style(styleType, ((d) => { - const { colorTransform, stateColor, originalColor } = d.meta; - colorTransform[interactionType] = colorTransform[interactionType] || {}; - if (apply && !colorTransform[interactionType][styleType]) { - // fade selections - colorTransform[interactionType][styleType] = style.intensity; - const color = transformColor(colorAxis, d, styleType, style.intensity).color; - return color; - } - if (!apply && colorTransform[interactionType][styleType]) { - // unfade selections - colorTransform[interactionType][styleType] = null; - return transformColor(colorAxis, d, styleType, style.intensity.map(e => -e)).color; - } - const [h, s, l, a] = stateColor[styleType] ? stateColor[styleType] : originalColor[styleType]; - return `hsla(${h * 360},${s * 100}%,${l * 100}%, ${a})`; - })); - }); - }); -}; + const { apply, interactionType, reset } = config; + const mountPoint = selectElement(context.mount()).select('.muze-overlay-paths').node(); -/** - * - * - * @param {*} selectionSet - * @param {*} className - * @param {*} hasFaded - */ -export const fadeUnfadeSelection = (context, selectionSet, hasFaded, interaction) => { - const interactionConfig = { interaction, apply: hasFaded }; - applyInteractionStyle(context, selectionSet, 'fade', interactionConfig); -}; + elements.forEach((elem) => { + const options = { mountPoint, apply, reset }; + context.applyLayerStyle(elem, interactionType, interactionStyles, options); -/** - * - * - * @param {*} selectionSet - * @param {*} className - * @param {*} hasFaded - */ -export const focusUnfocusSelection = (context, selectionSet, isFocussed, interaction) => { - const interactionConfig = { interaction, apply: isFocussed }; - applyInteractionStyle(context, selectionSet, 'focus', interactionConfig); -}; + // const interactionStylesEntries = Object.entries(interactionStyles.style); -/** - * - * - * @param {*} axes - * - */ -export const getAxesScales = (axes) => { - const [xAxis, yAxis] = [ENCODING.X, ENCODING.Y].map(e => axes[e]); - const [xScale, yScale] = [xAxis, yAxis].map(e => e && e.scale()); - return { - xAxis, - yAxis, - xScale, - yScale - }; + // for (const [type, value] of interactionStylesEntries) { + // const style = { type, value }; + // const options = { mountPoint, apply, reset }; + // context.applyLayerStyle(elem, interactionType, style, options); + // } + }); }; -export const encodingFieldInfRetriever = { - [POLAR]: (encoding, fieldsConfig) => { - const encodingInf = {}; - [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT] - .forEach((e) => { - const field = getObjProp(encoding, e, 'field'); - encodingInf[`${e}Field`] = field; - encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index'); - }); - return encodingInf; - }, - [CARTESIAN]: (encoding, fieldsConfig) => { - const encodingInf = {}; - [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT].forEach((e) => { +export const retrieveEncodingInf = (encoding, fieldsConfig, encodingNames) => { + const encodingInf = {}; + + encodingNames + .forEach((e) => { const field = getObjProp(encoding, e, 'field'); encodingInf[`${e}Field`] = field; encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index'); encodingInf[`${e}FieldType`] = getObjProp(fieldsConfig, field, 'def', 'type'); encodingInf[`${e}FieldSubType`] = getObjProp(fieldsConfig, field, 'def', 'subtype'); }); + return encodingInf; +}; - return encodingInf; +export const encodingFieldInfRetriever = { + [POLAR]: (encoding, fieldsConfig) => { + const fields = [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT]; + return retrieveEncodingInf(encoding, fieldsConfig, fields); + }, + [CARTESIAN]: (encoding, fieldsConfig) => { + const fields = [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT]; + return retrieveEncodingInf(encoding, fieldsConfig, fields); } }; +export const setNullsInStack = (transformedData, schema, value, setNulls) => { + const uniqueFieldIndex = schema.findIndex(d => d.name === value); + transformedData.forEach((seriesData) => { + seriesData.forEach((dataObj) => { + if (dataObj.data[uniqueFieldIndex] === null && !setNulls) { + dataObj[0] = null; + dataObj[1] = null; + } + }); + }); + return transformedData; +}; +export const setNulls = (transformedData, val) => transformedData.map((seriesData) => { + if (val && (seriesData[val.index] instanceof InvalidAwareTypes)) { + seriesData[val.index] = null; + } + return seriesData; +}); + /** * * @@ -134,7 +104,7 @@ export const encodingFieldInfRetriever = { export const transformData = (dataModel, config, transformType, encodingFieldInf) => { const data = dataModel.getData({ withUid: true }); const schema = data.schema; - const transform = config.transform; + const { transform, connectNullData: setNullData } = config; const { xField, yField, @@ -142,15 +112,22 @@ export const transformData = (dataModel, config, transformType, encodingFieldInf yFieldType } = encodingFieldInf; const uniqueField = xFieldType === FieldType.MEASURE ? yField : xField; - - return transformFactory(transformType)(schema, data.data, { + const value = yFieldType === FieldType.MEASURE ? yField : xField; + let transformedData = transformFactory(transformType)(schema, data.data, { groupBy: transform.groupBy, uniqueField, sort: transform.sort || 'none', offset: transform.offset, orderBy: transform.orderBy, - value: yFieldType === FieldType.MEASURE ? yField : xField + value }, data.uids); + + if (transformType === STACK) { + transformedData = setNullsInStack(transformedData, schema, value, setNullData); + } else { + transformedData = setNulls(transformedData, dataModel.getFieldsConfig()[value]); + } + return transformedData; }; export const getIndividualClassName = (d, i, data, context) => { @@ -162,7 +139,7 @@ export const getIndividualClassName = (d, i, data, context) => { return classNameStr; }; -const dataNormalizers = { +export const dataNormalizers = { [POLAR]: (transformedData, encodingFieldInf, fieldsConfig) => { const { radiusFieldIndex, @@ -199,7 +176,9 @@ const dataNormalizers = { x0FieldIndex, y0FieldIndex } = encodingFieldInf; - const fieldsLen = Object.keys(fieldsConfig).length; + const fieldsArr = Object.keys(fieldsConfig); + const fieldsLen = fieldsArr.length; + /** * Returns normalized data from transformed data. It recursively traverses through * the transformed data if there it is nested. @@ -252,6 +231,11 @@ const dataNormalizers = { pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]]; }); } + const source = pointObj.source; + pointObj.dataObj = fieldsArr.reduce((acc, name) => { + acc[name] = source[fieldsConfig[name].index]; + return acc; + }, {}); return pointObj; }); }).filter(d => d.length); @@ -318,12 +302,20 @@ export const domainCalculator = { } }; -export const attachDataToVoronoi = (voronoi, points) => { +const defFn = (d) => { + const { x, y } = d.update; + return { + x, + y + }; +}; + +export const attachDataToVoronoi = (voronoi, points, accessor = defFn) => { voronoi.data([].concat(...points).filter(d => d.rowId !== undefined).map((d) => { - const point = d.update; + const { x, y } = accessor(d); return { - x: point.x, - y: point.y, + x, + y, data: d }; })); @@ -544,15 +536,11 @@ export const resolveEncodingValues = (data, i, dataArr, layerInst) => { return transformedValues; }; -export const getColorMetaInf = (colorInf, colorAxis) => ({ - originalColor: Object.keys(colorInf).reduce((acc, key) => { - if (colorInf[key]) { - acc[key] = colorAxis.getHslArray(colorInf[key]); - } - return acc; - }, {}), - stateColor: {}, - colorTransform: {} +export const getColorMetaInf = (initialStyle, conf = {}) => ({ + originalStyle: Object.assign({}, { + styles: initialStyle + }, conf), + currentState: new Map() }); const getCoordValue = (radius, trig, angle, offset) => radius * Math[trig](angle) + offset; @@ -597,3 +585,32 @@ export const sortData = (data, axes) => { } return data; }; + +export const getBoundBoxes = points => points.map((point) => { + const { x, y } = point.update; + const data = point.data; + return { + minX: x, + maxX: x, + minY: y, + maxY: y, + data + }; +}); + +export const getDataFromEvent = (context, event) => { + const dataPoint = selectElement(event.target).data()[0]; + if (isSimpleObject(dataPoint) && getObjProp(dataPoint, 'meta', 'layerId') === context.id()) { + const values = dataPoint && dataPoint.source; + let identifiers = null; + if (values) { + identifiers = context.getIdentifiersFromData(values, dataPoint.rowId); + } + return { + dimensions: [dataPoint], + id: identifiers, + layerId: context.id() + }; + } + return null; +}; diff --git a/packages/visual-layer/src/index.js b/packages/visual-layer/src/index.js index 393a7070..51156ead 100644 --- a/packages/visual-layer/src/index.js +++ b/packages/visual-layer/src/index.js @@ -1,16 +1,34 @@ -import { AreaLayer } from './layers/area'; -import { ArcLayer } from './layers/arc'; -import { LineLayer } from './layers/line'; -import { TextLayer } from './layers/text'; -import { PointLayer } from './layers/point'; -import { BarLayer } from './layers/bar'; -import { TickLayer } from './layers/tick'; +import { AreaLayer, AreaLayerMixin } from './layers/area'; +import { ArcLayer, ArcLayerMixin } from './layers/arc'; +import { LineLayer, LineLayerMixin } from './layers/line'; +import { TextLayer, TextLayerMixin } from './layers/text'; +import { PointLayer, PointLayerMixin } from './layers/point'; +import { BarLayer, BarLayerMixin } from './layers/bar'; +import { TickLayer, TickLayerMixin } from './layers/tick'; import { SimpleLayer } from './simple-layer'; -import { BaseLayer } from './base-layer'; +import { BaseLayer, BaseLayerMixin } from './base-layer'; import * as LAYER_TYPES from './enums/layer-types'; import layerFactory from './layer-factory'; import layerRegistry from './layer-registry'; import { ENCODING } from './enums/constants'; +import * as pointLayerHelpers from './layers/point/helper'; +import * as commonHelpers from './helpers'; +import * as enums from './enums'; + +const helpers = Object.assign(commonHelpers, { + pointLayerHelpers +}); + +const layerMixins = { + BarLayerMixin, + BaseLayerMixin, + LineLayerMixin, + AreaLayerMixin, + PointLayerMixin, + TextLayerMixin, + TickLayerMixin, + ArcLayerMixin +}; export { BaseLayer, @@ -25,5 +43,8 @@ export { SimpleLayer, layerRegistry, LAYER_TYPES, - ENCODING + ENCODING, + helpers, + enums, + layerMixins }; diff --git a/packages/visual-layer/src/layer-registry.js b/packages/visual-layer/src/layer-registry.js index cf2dbdc0..57ede312 100644 --- a/packages/visual-layer/src/layer-registry.js +++ b/packages/visual-layer/src/layer-registry.js @@ -1,9 +1,11 @@ import { DEFAULT_LAYERS } from './defaults'; -export default () => { - const reg = DEFAULT_LAYERS; +export default (layers = DEFAULT_LAYERS) => { + const reg = Object.assign({}, layers); const regObj = { - set: (key, def) => { + register: (def) => { + const key = def.formalName(); + reg[key] = def; return regObj; }, diff --git a/packages/visual-layer/src/layers/arc/arc-mixin.js b/packages/visual-layer/src/layers/arc/arc-mixin.js new file mode 100644 index 00000000..fa818e08 --- /dev/null +++ b/packages/visual-layer/src/layers/arc/arc-mixin.js @@ -0,0 +1,217 @@ +import { + makeElement, + selectElement, + getQualifiedClassName, + isSimpleObject, + Symbols, + FieldType, + ReservedFields +} from 'muze-utils'; +import { defaultConfig } from './default-config'; +import { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers'; +import { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper'; +import './styles.scss'; + +const arc = Symbols.arc; + +export const ArcLayerMixin = superclass => class extends superclass { + constructor (data, axes, config, dependencies) { + super(data, axes, config, dependencies); + this._prevPieData = {}; + } + + /** + * returns the default configuration of the layer + * + * @static + * @return {Object} Default configuration for arc layer + * @memberof ArcLayer + */ + static defaultConfig () { + return defaultConfig; + } + + static formalName () { + return 'arc'; + } + + elemType () { + return 'path'; + } + + getNearestPoint (x, y, config = {}) { + return this.getDataFromEvent(config.event); + } + + getDataFromEvent (event) { + const dataPoint = selectElement(event.target).data()[0]; + if (isSimpleObject(dataPoint)) { + const { source, rowId } = dataPoint; + return { + id: this.getIdentifiersFromData(source, rowId), + layerId: this.id() + }; + } + return null; + } + + translatePoints (data) { + const { angle, color: colorAxis, radius: radiusAxis } = this.axes(); + const pieIndex = {}; + const prevData = this._points[0] || []; + const points = []; + const angleV = {}; + + this._prevPieData = {}; + prevData.forEach((e, index) => { + this._prevPieData[e.rowId] = [e, index]; + pieIndex[e.index] = e; + }); + data.forEach((d, i) => { + const angles = angle.getScaleValue(d.angle); + if (angles) { + !angleV[d.angle] && (angleV[d.angle] = 0); + const { startAngle, endAngle } = angles[angleV[d.angle]++]; + const uid = d.rowId; + const resolvedEncodings = resolveEncodingValues({ + values: { + radius: radiusAxis.getOuterRadius(d.radius), + radius0: radiusAxis.getInnerRadius(d.radius0), + color: colorAxis.getColor(d.color), + angle0: startAngle, + angle: endAngle, + startAngle, + endAngle, + startAngle0: startAngle, + endAngle0: endAngle + }, + data: d + }, i, data, this); + const color = resolvedEncodings.color; + points.push({ + source: d.source, + index: i, + enter: {}, + update: { + angle0: resolvedEncodings.angle0, + angle: resolvedEncodings.angle, + radius0: resolvedEncodings.radius0, + radius: resolvedEncodings.radius + }, + color, + meta: getColorMetaInf({ + fill: color + }), + rowId: uid, + _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] : + getPreviousPoint(pieIndex, i, this) + }); + } + }); + return points; + } + + render (container) { + const measurement = this.measurement(); + const { + classPrefix, + defClassName, + cornerRadius, + padAngle, + padRadius, + transition + } = this.config(); + const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix); + // This returns a function that generates the arc path based on the datum provided + const path = this._arcFn = arc() + .cornerRadius(cornerRadius) + .startAngle(d => d.update.angle0 + Math.PI / 2) + .endAngle(d => d.update.angle + Math.PI / 2) + .padAngle(padAngle) + .padRadius(padRadius) + .outerRadius(d => d.update.radius) + .innerRadius(d => d.update.radius0); + + this._points = this._normalizedData.map(arr => this.translatePoints(arr)); + const graphicElems = this._graphicElems = {}; + // Creating the group that holds all the arcs + const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`) + .classed(`${qualClassName[1]}-group`, true) + .attr('transform', `translate(${measurement.width / 2}, + ${measurement.height / 2})`); + const tween = (elem) => { + makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`) + .style('fill', d => d.color) + .each(function (d) { + graphicElems[d.rowId] = selectElement(this); + }) + .transition() + .duration(transition.duration) + .on('end', this.registerAnimationDoneHook()) + .attrTween('d', (...params) => tweenPie(path, params)) + .attr('class', (d, i) => { + const individualClass = getIndividualClassName(d, i, this._points, this); + return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index} + ${individualClass}`; + }); + }; + const consecutiveExits = []; + let exitCounter = 0; + const tweenExit = (elem, d) => { + let exitArr = consecutiveExits[exitCounter]; + const oldExitCounter = exitCounter; + if (!exitArr) { + exitArr = [{ elem, datum: d }]; + } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) { + exitArr.push({ elem, datum: d }); + } else { + exitCounter++; + } + consecutiveExits[oldExitCounter] = exitArr; + }; + // Creating groups for all the arcs present individually + makeElement(g, 'g', d => d, `${qualClassName[0]}`, + { + update: tween, + exit: tweenExit + }) + .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`); + tweenExitPie(consecutiveExits, transition, path); + return this; + } + + getPointsFromIdentifiers (identifiers) { + if (!this.data()) { + return []; + } + const fieldNames = identifiers[0]; + const values = identifiers.slice(1, identifiers.length); + const pieSlices = selectElement(this.mount()).selectAll('path').data(); + const fieldsConfig = this.data().getFieldsConfig(); + + const filteredPies = pieSlices.filter((tData) => { + const { source, rowId } = tData; + return fieldNames.every((field, idx) => { + if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) { + return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1; + } else if (field === ReservedFields.ROW_ID) { + return values.findIndex(d => d[idx] === rowId) !== -1; + } return true; + }); + }); + + const pieSliceInf = filteredPies[0]; + if (pieSliceInf) { + const measurement = this.measurement(); + const centroid = this._arcFn.centroid(pieSliceInf); + return [{ + x: centroid[0] + measurement.width / 2, + y: centroid[1] + measurement.height / 2, + width: 2, + height: 2 + }]; + } + return []; + } +}; + diff --git a/packages/visual-layer/src/layers/arc/arc.js b/packages/visual-layer/src/layers/arc/arc.js index 4c025884..fcb75f17 100644 --- a/packages/visual-layer/src/layers/arc/arc.js +++ b/packages/visual-layer/src/layers/arc/arc.js @@ -1,19 +1,8 @@ import { - makeElement, - selectElement, - getQualifiedClassName, - isSimpleObject, - Symbols, - FieldType, - ReservedFields + mix } from 'muze-utils'; -import { defaultConfig } from './default-config'; -import { BaseLayer } from '../../base-layer'; -import { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers'; -import { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper'; -import './styles.scss'; - -const arc = Symbols.arc; +import { BaseLayerMixin, BaseLayer } from '../../base-layer'; +import { ArcLayerMixin } from './arc-mixin'; /** * Arc Layer creates a plot with polar coordinates. @@ -24,215 +13,8 @@ const arc = Symbols.arc; * @module ArcLayer * @extends BaseLayer */ -export default class ArcLayer extends BaseLayer { - - constructor (data, axes, config, dependencies) { - super(data, axes, config, dependencies); - this._prevPieData = {}; - } - - /** - * returns the default configuration of the layer - * - * @static - * @return {Object} Default configuration for arc layer - * @memberof ArcLayer - */ - static defaultConfig () { - return defaultConfig; - } - +export default class ArcLayer extends mix(BaseLayer).with(BaseLayerMixin, ArcLayerMixin) { static formalName () { return 'arc'; } - - elemType () { - return 'path'; - } - - /** - * - * - * @param {Object} x - * @param {Object} y - * @return {} - * @memberof ArcLayer - */ - getNearestPoint (x, y, config = {}) { - const dataPoint = selectElement(config.event.target).data()[0]; - if (isSimpleObject(dataPoint)) { - const { source, rowId } = dataPoint; - return { - id: this.getIdentifiersFromData(source, rowId), - layerId: this.id() - }; - } - return null; - } - - translatePoints (data) { - const { angle, color: colorAxis, radius: radiusAxis } = this.axes(); - const pieIndex = {}; - const prevData = this._points[0] || []; - const points = []; - const angleV = {}; - - this._prevPieData = {}; - prevData.forEach((e, index) => { - this._prevPieData[e.rowId] = [e, index]; - pieIndex[e.index] = e; - }); - data.forEach((d, i) => { - const angles = angle.getScaleValue(d.angle); - if (angles) { - !angleV[d.angle] && (angleV[d.angle] = 0); - const { startAngle, endAngle } = angles[angleV[d.angle]++]; - const uid = d.rowId; - const resolvedEncodings = resolveEncodingValues({ - values: { - radius: radiusAxis.getOuterRadius(d.radius), - radius0: radiusAxis.getInnerRadius(d.radius0), - color: colorAxis.getColor(d.color), - angle0: startAngle, - angle: endAngle, - startAngle, - endAngle, - startAngle0: startAngle, - endAngle0: endAngle - }, - data: d - }, i, data, this); - const color = resolvedEncodings.color; - points.push({ - source: d.source, - index: i, - enter: {}, - update: { - angle0: resolvedEncodings.angle0, - angle: resolvedEncodings.angle, - radius0: resolvedEncodings.radius0, - radius: resolvedEncodings.radius - }, - color, - meta: getColorMetaInf({ - fill: color - }, colorAxis), - rowId: uid, - _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] : - getPreviousPoint(pieIndex, i, this) - }); - } - }); - return points; - } - - /** - * - * - * @param {Object} container - * @return {} - * @memberof ArcLayer - */ - render (container) { - const measurement = this.measurement(); - const { - classPrefix, - defClassName, - cornerRadius, - padAngle, - padRadius, - transition - } = this.config(); - const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix); - // This returns a function that generates the arc path based on the datum provided - const path = this._arcFn = arc() - .cornerRadius(cornerRadius) - .startAngle(d => d.update.angle0 + Math.PI / 2) - .endAngle(d => d.update.angle + Math.PI / 2) - .padAngle(padAngle) - .padRadius(padRadius) - .outerRadius(d => d.update.radius) - .innerRadius(d => d.update.radius0); - - this._points = this._normalizedData.map(arr => this.translatePoints(arr)); - const graphicElems = this._graphicElems = {}; - // Creating the group that holds all the arcs - const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`) - .classed(`${qualClassName[1]}-group`, true) - .attr('transform', `translate(${measurement.width / 2}, - ${measurement.height / 2})`); - const tween = (elem) => { - makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`) - .style('fill', d => d.color) - .each(function (d) { - graphicElems[d.rowId] = selectElement(this); - }) - .transition() - .duration(transition.duration) - .on('end', this.registerAnimationDoneHook()) - .attrTween('d', (...params) => tweenPie(path, params)) - .attr('class', (d, i) => { - const individualClass = getIndividualClassName(d, i, this._points, this); - return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index} - ${individualClass}`; - }); - }; - const consecutiveExits = []; - let exitCounter = 0; - const tweenExit = (elem, d) => { - let exitArr = consecutiveExits[exitCounter]; - const oldExitCounter = exitCounter; - if (!exitArr) { - exitArr = [{ elem, datum: d }]; - } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) { - exitArr.push({ elem, datum: d }); - } else { - exitCounter++; - } - consecutiveExits[oldExitCounter] = exitArr; - }; - // Creating groups for all the arcs present individually - makeElement(g, 'g', d => d, `${qualClassName[0]}`, - { - update: tween, - exit: tweenExit - }) - .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`); - tweenExitPie(consecutiveExits, transition, path); - return this; - } - - getPointsFromIdentifiers (identifiers) { - if (!this.data()) { - return []; - } - const fieldNames = identifiers[0]; - const values = identifiers.slice(1, identifiers.length); - const pieSlices = selectElement(this.mount()).selectAll('path').data(); - const fieldsConfig = this.data().getFieldsConfig(); - - const filteredPies = pieSlices.filter((tData) => { - const { source, rowId } = tData; - return fieldNames.every((field, idx) => { - if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) { - return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1; - } else if (field === ReservedFields.ROW_ID) { - return values.findIndex(d => d[idx] === rowId) !== -1; - } return true; - }); - }); - - const pieSliceInf = filteredPies[0]; - if (pieSliceInf) { - const measurement = this.measurement(); - const centroid = this._arcFn.centroid(pieSliceInf); - return [{ - x: centroid[0] + measurement.width / 2, - y: centroid[1] + measurement.height / 2, - width: 2, - height: 2 - }]; - } - return []; - } } diff --git a/packages/visual-layer/src/layers/arc/default-config.js b/packages/visual-layer/src/layers/arc/default-config.js index 734e16db..57f0183a 100644 --- a/packages/visual-layer/src/layers/arc/default-config.js +++ b/packages/visual-layer/src/layers/arc/default-config.js @@ -1,3 +1,4 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { @@ -6,18 +7,27 @@ export const defaultConfig = { padding: { top: 1, bottom: 1, left: 1, right: 1 }, className: '', interaction: { - highlight: [{ - type: 'fill', - intensity: [0, 0, -15, 0] - }], - fade: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }], - focus: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }] + highlight: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.1 + }, data, apply).color + } + }, + fade: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: +15 + }, data, apply).color + } + }, + focus: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + } }, height: 100, width: 100, diff --git a/packages/visual-layer/src/layers/arc/index.js b/packages/visual-layer/src/layers/arc/index.js index 6d3751ae..b48ad49c 100644 --- a/packages/visual-layer/src/layers/arc/index.js +++ b/packages/visual-layer/src/layers/arc/index.js @@ -1 +1,2 @@ export { default as ArcLayer } from './arc'; +export { ArcLayerMixin } from './arc-mixin'; diff --git a/packages/visual-layer/src/layers/arc/styles.scss b/packages/visual-layer/src/layers/arc/styles.scss index dd32cc11..7fae2bca 100644 --- a/packages/visual-layer/src/layers/arc/styles.scss +++ b/packages/visual-layer/src/layers/arc/styles.scss @@ -13,5 +13,5 @@ } .#{$prefix}layer-arc{ - fill: #086bb6; + fill: #1f77b4; } \ No newline at end of file diff --git a/packages/visual-layer/src/layers/area/area-mixin.js b/packages/visual-layer/src/layers/area/area-mixin.js new file mode 100644 index 00000000..13410846 --- /dev/null +++ b/packages/visual-layer/src/layers/area/area-mixin.js @@ -0,0 +1,220 @@ +import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils'; +import { defaultConfig } from './default-config'; +import drawArea from './renderer'; +import './styles.scss'; +import { STACK, ENCODING } from '../../enums/constants'; +import { + positionPoints, + getIndividualClassName, + getValidTransformForAggFn, + getColorMetaInf, + resolveEncodingValues, + sortData +} from '../../helpers'; + +/** + * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used + * to create stacked or multi-series areas and vertical range area plots by using the encoding properties. + * + * To create this layer using layer configuration from canvas, + * ``` + * canvas.layers([{ + * mark: 'area', + * transform: { + * type: 'stack' // Produces a stacked area. + * } + * }]); + * ``` + * + * @public + * + * @class + * @module AreaLayer + * @extends LineLayer + */ +export const AreaLayerMixin = superclass => class extends superclass { + + /** Default configuration of area layer + * + * @return {Object} Default configuration of layer + */ + static defaultConfig () { + return defaultConfig; + } + + /** + * Calculates the domain from data. It calls its parent class's method which is line layer + * to get the domain and overwrites the domain according to its need. + * @return {Array} Domain values + */ + calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) { + const domains = super.calculateDomainFromData(data, fieldsConfig); + [ENCODING.X, ENCODING.Y].forEach((type) => { + const { [`${type}FieldType`]: fieldType } = encodingFieldsInf; + if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) { + domains[type][0] = Math.min(domains[type][0], 0); + domains[type][1] = Math.max(0, domains[type][1]); + } + }); + return domains; + } + + /** + * Returns the drawing method of this layer + * @return {Function} Draw method + */ + getDrawFn () { + return drawArea; + } + + getNearestPoint (x, y, config) { + let searchRadius = config.searchRadius; + const data = this.data(); + + if (!data || (data && data.isEmpty())) { + return null; + } + + searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold; + let point = this._voronoi.find(x, y, searchRadius); + let index; + let nearestPoint = null; + + if (!point && config.dimValue && this._pointMap) { + const pointArr = this._pointMap[config.dimValue[1][0]] || []; + + for (let i = 0, len = pointArr.length; i < len; i++) { + const { y: pointY, y0: pointY0 } = pointArr[i].update; + if (pointY < y && y < pointY0) { + index = i; + nearestPoint = pointArr[i]; + break; + } + } + + // Index is a number(0 or more) + if (index !== undefined) { + point = { + index, + data: { + x, + y, + data: nearestPoint + } + }; + } + } + + const dimensions = getObjProp(point, 'data', 'data', 'update'); + + if (point) { + const { source, rowId } = point.data.data; + const identifiers = this.getIdentifiersFromData(source, rowId); + return { + id: identifiers, + dimensions: [{ + x: dimensions.x, + y0: dimensions.y0, + y: dimensions.y, + width: 2, + height: 2 + }], + layerId: this.id() + }; + } + return null; + } + + /** + * Generates the x and y positions for each point + * @param {Array} data Data Array + * @param {Object} encoding Visual Encodings of the layer + * @param {Object} axes Contains the axis + * @return {Array} Array of points + */ + translatePoints (data) { + let points = []; + const transformType = this.transformType(); + const axes = this.axes(); + const colorAxis = axes.color; + const config = this.config(); + const encoding = config.encoding; + const fieldsConfig = this.data().getFieldsConfig(); + const { xField, yField, y0Field } = this.encodingFieldsInf(); + const { x: xAxis, y: yAxis } = axes; + const classNameFn = config.individualClassName; + const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION; + const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION; + const key = isXDim ? 'x' : (isYDim ? 'y' : null); + const minYVal = yAxis.domain()[0]; + const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal); + sortData(data, axes); + points = data.map((d, i) => { + let color; + const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2; + const yPx = yAxis.getScaleValue(d.y); + const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos; + color = colorAxis.getColor(d.color); + const invalidY = d.y instanceof InvalidAwareTypes; + const invalidY0 = d.y0 instanceof InvalidAwareTypes; + const resolvedValues = resolveEncodingValues({ + values: { + x: xPx, + y: yPx, + y0: y0Px, + color + }, + data: d + }, i, data, this); + color = resolvedValues.color; + const style = { + fill: color, + 'fill-opacity': encoding.fillOpacity.value + }; + + const point = { + enter: { + x: xPx, + y: invalidY ? null : basePos, + y0: invalidY0 ? null : basePos + }, + update: { + x: xPx, + y: invalidY ? null : resolvedValues.y, + y0: invalidY0 ? null : resolvedValues.y0 + }, + source: d.source, + rowId: d.rowId, + data: d.dataObj, + className: classNameFn ? classNameFn(d, i, data, this) : '', + style, + meta: getColorMetaInf(style) + }; + point.className = getIndividualClassName(d, i, data, this); + this.cachePoint(d[key], point); + return point; + }); + points = positionPoints(this, points); + points = points.filter((point) => { + const update = point.update; + return !isNaN(update.x); + }); + return points; + } + + resolveTransformType () { + this._transformType = getValidTransformForAggFn(this); + } + + /** + * Get the css styles need to be applied on the line path + * @param {string} color Color value + * @return {Object} Path styles + */ + getPathStyle (color) { + return { + fill: color, + 'fill-opacity': 0.30 + }; + } +}; diff --git a/packages/visual-layer/src/layers/area/area.js b/packages/visual-layer/src/layers/area/area.js index 48507bd1..627db14c 100644 --- a/packages/visual-layer/src/layers/area/area.js +++ b/packages/visual-layer/src/layers/area/area.js @@ -1,18 +1,8 @@ -import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils'; -import { defaultConfig } from './default-config'; -import { LineLayer } from '../line'; -import drawArea from './renderer'; -import './styles.scss'; -import { STACK, ENCODING } from '../../enums/constants'; -import { - getAxesScales, - positionPoints, - getIndividualClassName, - getValidTransformForAggFn, - getColorMetaInf, - resolveEncodingValues, - sortData -} from '../../helpers'; +import { mix } from 'muze-utils'; +import { AREA_LAYER } from '../../enums/constants'; +import { BaseLayer, BaseLayerMixin } from '../../base-layer'; +import { LineLayerMixin } from '../line/line-mixin'; +import { AreaLayerMixin } from './area-mixin'; /** * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used @@ -34,140 +24,9 @@ import { * @module AreaLayer * @extends LineLayer */ -export default class AreaLayer extends LineLayer { - /** oation of line layer - * @return {Object} Default configuration of layer - */ - static defaultConfig () { - return defaultConfig; - } - - /** - * - * - * @static - * - * @memberof AreaLayer - */ +export default class AreaLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin, AreaLayerMixin) { static formalName () { - return 'area'; - } - - /** - * Calculates the domain from data. It calls its parent class's method which is line layer - * to get the domain and overwrites the domain according to its need. - * @return {Array} Domain values - */ - calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) { - const domains = super.calculateDomainFromData(data, fieldsConfig); - [ENCODING.X, ENCODING.Y].forEach((type) => { - const { [`${type}FieldType`]: fieldType } = encodingFieldsInf; - if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) { - domains[type][0] = Math.min(domains[type][0], 0); - domains[type][1] = Math.max(0, domains[type][1]); - } - }); - return domains; - } - - /** - * Returns the drawing method of this layer - * @return {Function} Draw method - */ - getDrawFn () { - return drawArea; - } - - /** - * Generates the x and y positions for each point - * @param {Array} data Data Array - * @param {Object} encoding Visual Encodings of the layer - * @param {Object} axes Contains the axis - * @return {Array} Array of points - */ - translatePoints (data) { - let points = []; - const transformType = this.transformType(); - const axes = this.axes(); - const colorAxis = axes.color; - const config = this.config(); - const fieldsConfig = this.data().getFieldsConfig(); - const { xField, yField, y0Field } = this.encodingFieldsInf(); - const { - xAxis, - yAxis - } = getAxesScales(axes); - const classNameFn = config.individualClassName; - const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION; - const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION; - const key = isXDim ? 'x' : (isYDim ? 'y' : null); - const minYVal = yAxis.domain()[0]; - const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal); - sortData(data, axes); - points = data.map((d, i) => { - let color; - const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2; - const yPx = yAxis.getScaleValue(d.y); - const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos; - color = colorAxis.getColor(d.color); - const invalidY = d.y instanceof InvalidAwareTypes; - const invalidY0 = d.y0 instanceof InvalidAwareTypes; - const resolvedValues = resolveEncodingValues({ - values: { - x: xPx, - y: yPx, - y0: y0Px, - color - }, - data: d - }, i, data, this); - color = resolvedValues.color; - const style = { - fill: color - }; - - const point = { - enter: { - x: xPx, - y: invalidY ? null : basePos, - y0: invalidY0 ? null : basePos - }, - update: { - x: xPx, - y: invalidY ? null : resolvedValues.y, - y0: invalidY0 ? null : resolvedValues.y0 - }, - source: d.source, - rowId: d.rowId, - className: classNameFn ? classNameFn(d, i, data, this) : '', - style, - meta: getColorMetaInf(style, colorAxis) - }; - point.className = getIndividualClassName(d, i, data, this); - this.cachePoint(d[key], point); - return point; - }); - points = positionPoints(this, points); - points = points.filter((point) => { - const update = point.update; - return !isNaN(update.x) && !isNaN(update.y); - }); - return points; - } - - resolveTransformType () { - this._transformType = getValidTransformForAggFn(this); - } - - /** - * Get the css styles need to be applied on the line path - * @param {string} color Color value - * @return {Object} Path styles - */ - getPathStyle (color) { - return { - fill: color - }; + return AREA_LAYER; } } diff --git a/packages/visual-layer/src/layers/area/default-config.js b/packages/visual-layer/src/layers/area/default-config.js index e945108c..0e0af237 100644 --- a/packages/visual-layer/src/layers/area/default-config.js +++ b/packages/visual-layer/src/layers/area/default-config.js @@ -9,8 +9,23 @@ export const defaultConfig = { type: STACK }, interaction: { - + fade: { + style: { + 'fill-opacity': 0.7 + } + }, + focus: { + style: { + 'fill-opacity': 0.7 + } + }, + brushStroke: { + style: { + 'fill-opacity': 0.7 + } + } }, + crossline: true, nearestPointThreshold: 10, encoding: { color: {}, @@ -19,6 +34,9 @@ export const defaultConfig = { y0: {}, strokeOpacity: { value: 1 + }, + fillOpacity: { + value: 0.3 } }, transition: { diff --git a/packages/visual-layer/src/layers/area/index.js b/packages/visual-layer/src/layers/area/index.js index d05794c2..e540158a 100644 --- a/packages/visual-layer/src/layers/area/index.js +++ b/packages/visual-layer/src/layers/area/index.js @@ -1 +1,2 @@ export { default as AreaLayer } from './area'; +export { AreaLayerMixin } from './area-mixin'; diff --git a/packages/visual-layer/src/layers/area/renderer.js b/packages/visual-layer/src/layers/area/renderer.js index 77d1d755..a513f23f 100644 --- a/packages/visual-layer/src/layers/area/renderer.js +++ b/packages/visual-layer/src/layers/area/renderer.js @@ -12,33 +12,43 @@ const area = Symbols.area; * @param {Object} params Contains container, points and interpolate attribute. */ const /* istanbul ignore next */ drawArea = (params) => { - let filteredPoints; - const { layer, container, points, style, transition, className, connectNullData, interpolate } = params; + const { layer, container, points, style, transition, className, interpolate, connectNullData } = params; + const graphicElems = layer._graphicElems; const { effect: easeEffect, duration } = transition; const mount = selectElement(container); const curveInterpolatorFn = pathInterpolators[interpolate]; - const selection = mount.selectAll('path').data(points.length ? [points[0].className] : []); + const selection = mount.selectAll('path').data(points.length ? [points] : []); const [enterAreaPath, updateAreaPath] = ['enter', 'update'].map(e => area().curve(curveInterpolatorFn) .x(d => d[e].x) .y1(d => d[e].y) .y0(d => d[e].y0) - .defined(d => d[e].y !== null - )); + .defined(d => d[e].y !== undefined)); - filteredPoints = points; mount.attr('class', className); + + let filteredPoints = points; if (connectNullData) { - filteredPoints = points.filter(d => d.update.y !== null); + filteredPoints = filteredPoints.filter(d => d.update.y !== undefined); } - const selectionEnter = selection.enter().append('path').attr('d', enterAreaPath(filteredPoints)); + const selectionEnter = selection + .enter() + .append('path') + .attr('d', enterAreaPath(filteredPoints)) + .each((d) => { + d.forEach((dd) => { + if (dd.rowId) { + graphicElems[dd.rowId] = mount.select('path'); + } + }); + }); + selection.merge(selectionEnter).transition().ease(easeFns[easeEffect]) .duration(duration) .on('end', layer.registerAnimationDoneHook()) .attr('d', updateAreaPath(filteredPoints)) - .each(function (d) { + .each(function () { const element = selectElement(this); - element.attr('class', d); Object.keys(style).forEach(key => element.style(key, style[key])); }); }; diff --git a/packages/visual-layer/src/layers/area/styles.scss b/packages/visual-layer/src/layers/area/styles.scss index fced27cb..0a09e8e8 100644 --- a/packages/visual-layer/src/layers/area/styles.scss +++ b/packages/visual-layer/src/layers/area/styles.scss @@ -2,6 +2,6 @@ .#{$prefix}layer-area { stroke-linejoin: round; - fill:#086bb6;; - fill-opacity: 0.7; + // fill-opacity: 0.30; + // fill:#1f77b4; } \ No newline at end of file diff --git a/packages/visual-layer/src/layers/bar/bar-helper.js b/packages/visual-layer/src/layers/bar/bar-helper.js index 53c64df8..8374fdbc 100644 --- a/packages/visual-layer/src/layers/bar/bar-helper.js +++ b/packages/visual-layer/src/layers/bar/bar-helper.js @@ -1,6 +1,11 @@ import { MeasureSubtype, DimensionSubtype } from 'muze-utils'; import { STACK } from '../../enums/constants'; -import { positionPoints, getIndividualClassName, getColorMetaInf, resolveEncodingValues } from '../../helpers'; +import { + positionPoints, + getIndividualClassName, + getColorMetaInf, + resolveEncodingValues +} from '../../helpers'; const positionRetriever = { x: (xPx, isNegativeVal, barBasePos) => (isNegativeVal ? [xPx, barBasePos] : [barBasePos, xPx]), @@ -138,6 +143,31 @@ const resolveDimensions = (data, config, axes) => { }; }; +export const strokeWidthPositionMap = ({ width, position }) => { + const offset = width / 2; + const strokeWidthWithOffsetMap = { + center: { + M: { x: 0, y: 0 }, + L1: { x: 0, y: 0 }, + L2: { x: 0, y: 0 }, + L3: { x: 0, y: 0 } + }, + inside: { + M: { x: +offset, y: +offset }, + L1: { x: -offset, y: +offset }, + L2: { x: -offset, y: -offset }, + L3: { x: +offset, y: -offset } + }, + outside: { + M: { x: -offset, y: -offset }, + L1: { x: +offset, y: -offset }, + L2: { x: +offset, y: +offset }, + L3: { x: -offset, y: +offset } + } + }; + return strokeWidthWithOffsetMap[position]; +}; + /** * Generates an array of objects containing x, y, width and height of the bars from the data * @param {Array.} data Data Array @@ -190,10 +220,17 @@ export const getTranslatedPoints = (context, data, sizeConfig) => { }, data: d }, i, data, context); + // const layerEncoding = layerInst.config().encoding; + color = resolvedEncodings.color; const { x, y, width, height } = resolvedEncodings; const style = { - fill: color + fill: color, + stroke: encoding.stroke.value, + 'stroke-width': encoding.strokeWidth.value + }; + const conf = { + strokePosition: encoding.strokePosition.value }; if (!isNaN(x) && !isNaN(y) && d.rowId !== undefined) { @@ -208,8 +245,11 @@ export const getTranslatedPoints = (context, data, sizeConfig) => { }, source: d.source, rowId: d.rowId, + data: d.dataObj, style, - meta: getColorMetaInf(style, colorAxis) + meta: Object.assign({ + layerId: context.id() + }, getColorMetaInf(style, conf)) }; point.className = getIndividualClassName(d, i, data, context); points.push(point); diff --git a/packages/visual-layer/src/layers/bar/bar-mixin.js b/packages/visual-layer/src/layers/bar/bar-mixin.js new file mode 100644 index 00000000..7c89cf92 --- /dev/null +++ b/packages/visual-layer/src/layers/bar/bar-mixin.js @@ -0,0 +1,275 @@ +import { + getQualifiedClassName, + selectElement, + createElements, + clipElement, + FieldType, + Scales, + getObjProp, + makeElement, + appendElement +} from 'muze-utils'; +import { BaseLayer } from '../../base-layer'; +import { drawRects } from './renderer'; +import { defaultConfig } from './default-config'; +import { getPlotMeasurement, getValidTransformForAggFn, getDataFromEvent } from '../../helpers'; +import './styles.scss'; +import { getTranslatedPoints, strokeWidthPositionMap } from './bar-helper'; + +const { MEASURE } = FieldType; + +export const BarLayerMixin = superclass => class extends superclass { + /** + * Creates an instance of bar layer + */ + constructor (...params) { + super(...params); + this._bandScale = Scales.band(); + this._plotPadding = { + x: 0, + y: 0 + }; + this._plotSpan = { + x: 0, + y: 0 + }; + this._pointMap = {}; + this._overlayPath = {}; + } + + elemType () { + return 'rect'; + } + + /** + * Returns the default configuration of the bar layer + * @return {Object} Default configuration of the bar layer + */ + static defaultConfig () { + return defaultConfig; + } + + static defaultPolicy (conf, userConf) { + const config = BaseLayer.defaultPolicy(conf, userConf); + const encoding = config.encoding; + const colorField = encoding.color.field; + const transform = config.transform; + + if (colorField) { + transform.groupBy = colorField; + } + return config; + } + + calculateDomainFromData (data, encodingFieldInf, fieldsConfig) { + const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig); + ['x', 'y'].forEach((d) => { + if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) { + if (encodingFieldInf[`${d}0Field`]) { + domain[d] = domain[d].sort((a, b) => a - b); + } else { + domain[d][0] = Math.min(domain[d][0], 0); + domain[d][1] = Math.max(0, domain[d][1]); + } + } + }); + return domain; + } + + /** + * Generates an array of objects containing x, y, width and height of the bars from the data + * @param {Array.} data Data Array + * @param {Object} encoding Config + * @param {Object} axes Axes object + * @param {Object} conf config object for point generation + * @return {Array.} Array of points + */ + translatePoints (data, sizeConfig) { + return getTranslatedPoints(this, data, sizeConfig); + } + + /** + * Renders the plot in the given container + * @param {SVGGroup} container SVGGroup where plot will be rendered. + * @return {BarLayer} Instance of bar layer. + */ + render (container) { + const config = this.config(); + const transition = config.transition; + const normalizedDataArr = this._normalizedData; + const transformedData = this._transformedData; + const keys = transformedData.map(d => d.key); + const fieldsConfig = this.data().getFieldsConfig(); + const axes = this.axes(); + const height = axes.y && axes.y.scale().range()[0]; + const width = axes.x && axes.x.scale().range()[1]; + const defClassName = config.defClassName; + const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix); + const className = config.className; + const containerSelection = selectElement(container); + const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION) + .map(e => e.index); + containerSelection.classed(qualifiedClassName.join(' '), true); + containerSelection.classed(className, true); + clipElement(container, { + x: 0, + y: 0, + width, + height + }, `id-${this.id()}`); + + this._points = this.generateDataPoints(normalizedDataArr, keys); + this._graphicElems = {}; + const paths = Object.keys(this._overlayPath); + paths.forEach(path => this._overlayPath[path].remove()); + this._overlayPath = {}; + + const barContainer = makeElement(containerSelection, 'g', [1], 'muze-layer-bars', {}, null); + makeElement(containerSelection, 'g', [1], 'muze-overlay-paths', {}, null); + createElements({ + data: this._points, + container: barContainer.node(), + selector: 'g', + append: 'g', + each: (points, group, i) => { + const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase(); + group.style('display', 'block'); + drawRects({ + layer: this, + container: group.node(), + points, + className: seriesClassName, + transition, + style: {}, + keyFn: d => dimensions.map(key => d.source[key]).join('-') + }); + } + }); + + return this; + } + + generateDataPoints (normalizedData, keys) { + const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys); + const barWidthOffsets = barWidthMetrics.offsetValues || []; + const barHeightOffsets = barHeightMetrics.offsetValues || []; + this._plotSpan = { + x: barWidthMetrics.groupSpan || 0, + y: barHeightMetrics.groupSpan || 0 + }; + this._plotPadding = { + x: barWidthMetrics.padding || 0, + y: barHeightMetrics.padding || 0 + }; + + this._pointMap = {}; + return normalizedData.map((data, i) => this.translatePoints(data, + { + barWidth: barWidthMetrics.span, + barWidthOffset: barWidthOffsets[i] || 0, + barHeight: barHeightMetrics.span, + barHeightOffset: barHeightOffsets[i] || 0 + })); + } + + getPlotPadding () { + return this._plotPadding; + } + + resolveTransformType () { + this._transformType = getValidTransformForAggFn(this); + } + + /** + * Gets the nearest point of the position passed. + * @param {number} x x position + * @param {number} y y position + * @return {Object} Nearest point. + */ + getNearestPoint (x, y, { event }) { + if (!this.data()) { + return null; + } + return this.getDataFromEvent(event); + } + + getDataFromEvent (event) { + return getDataFromEvent(this, event); + } + + getPlotSpan () { + return this._plotSpan; + } + + hasPlotSpan () { + return true; + } + + addOverlayPath (refElement, data, style, strokePosition, mountPoint) { + let pathElement; + + if (this._overlayPath[data.rowId]) { + pathElement = this._overlayPath[data.rowId]; + } else { + const pathGroup = makeElement(mountPoint, 'g', [1], null, {}, d => `${d.x} ${data.rowId}`); + pathElement = makeElement(pathGroup, 'path', [data], null, {}, d => `${d.update.x} ${data.rowId}`); + + pathElement.style('fill', 'none'); + pathElement.style('fill-opacity', 0); + pathElement.attr('id', data.rowId); + this._overlayPath[data.rowId] = pathElement; + } + + if (style.type === 'stroke-width') { + const { L1, L2, L3, M } = strokeWidthPositionMap({ + width: parseInt(style.value, 10), + position: strokePosition + }); + + pathElement.attr('d', d => `M ${d.update.x + M.x} ${d.update.y + M.y} + L ${d.update.x + d.update.width + L1.x} ${d.update.y + L1.y} + L ${d.update.x + d.update.width + L2.x} ${d.update.y + d.update.height + L2.y} + L${d.update.x + L3.x} ${d.update.y + d.update.height + L3.y} Z`); + } + + let styleVal = style.value; + if (typeof styleVal === 'function') { + const currentStyle = pathElement.style(style.type); + styleVal = styleVal(currentStyle); + } + pathElement.style(style.type, styleVal); + appendElement(mountPoint, pathElement.node()); + } + + removeOverlayPath (data, style) { + const currentPath = this._overlayPath[data.rowId]; + if (currentPath) { + currentPath.node().removeAttribute('style'); + Object.keys(style).forEach(s => currentPath.style(s, style[s])); + currentPath.style('fill-opacity', 0); + + // Apply the path shape get the correct path position + currentPath.attr('d', d => `M ${d.update.x} ${d.update.y} + L ${d.update.x + d.update.width} ${d.update.y} + L ${d.update.x + d.update.width} ${d.update.y + d.update.height} + L${d.update.x} ${d.update.y + d.update.height} Z`); + } + } + + getBoundBoxes () { + const points = this._points.flat(); + + return points.map((point) => { + const { x, y, width, height } = point.update; + const data = point.data; + return { + minX: x, + maxX: x + width, + minY: y, + maxY: y + height, + data + }; + }); + } +}; + diff --git a/packages/visual-layer/src/layers/bar/bar.js b/packages/visual-layer/src/layers/bar/bar.js index 7c95132f..5783bd71 100644 --- a/packages/visual-layer/src/layers/bar/bar.js +++ b/packages/visual-layer/src/layers/bar/bar.js @@ -1,24 +1,9 @@ -import { - getQualifiedClassName, - selectElement, - createElements, - clipElement, - DimensionSubtype, - FieldType, - MeasureSubtype, - Scales, - getNearestValue, - getObjProp -} from 'muze-utils'; +import { mix } from 'muze-utils'; import { BaseLayer } from '../../base-layer'; -import { drawRects } from './renderer'; -import { defaultConfig } from './default-config'; -import { getPlotMeasurement, getValidTransformForAggFn } from '../../helpers'; +import { BAR_LAYER } from '../../enums/constants'; +import { BarLayerMixin } from './bar-mixin'; +import { BaseLayerMixin } from '../../base-layer/base-mixin'; import './styles.scss'; -import { getTranslatedPoints } from './bar-helper'; - -const MEASURE = FieldType.MEASURE; -const scaleBand = Scales.band; /** * Bar layer creates rectangle marks. The mark type of this layer is ```bar```. This layer can be used @@ -31,283 +16,8 @@ const scaleBand = Scales.band; * @module BarLayer * @extends BaseLayer */ -export default class BarLayer extends BaseLayer { - /** - * Creates an instance of bar layer - */ - constructor (...params) { - super(...params); - this._bandScale = scaleBand(); - this._plotPadding = { - x: 0, - y: 0 - }; - this._plotSpan = { - x: 0, - y: 0 - }; - this._pointMap = {}; - } - - /** - * - * - * - * @memberof BarLayer - */ - elemType () { - return 'rect'; - } - - /** - * - * - * @static - * - * @memberof BarLayer - */ +export default class BarLayer extends mix(BaseLayer).with(BaseLayerMixin, BarLayerMixin) { static formalName () { - return 'bar'; - } - - /** - * Returns the default configuration of the bar layer - * @return {Object} Default configuration of the bar layer - */ - static defaultConfig () { - return defaultConfig; - } - - /** - * - * - * @static - * @param {*} conf - * @param {*} userConf - * - * @memberof BarLayer - */ - static defaultPolicy (conf, userConf) { - const config = BaseLayer.defaultPolicy(conf, userConf); - const encoding = config.encoding; - const colorField = encoding.color.field; - const transform = config.transform; - - if (colorField) { - transform.groupBy = colorField; - } - return config; - } - - /** - * - * - * @param {*} data - * @param {*} fieldsConfig - * - * @memberof BarLayer - */ - calculateDomainFromData (data, encodingFieldInf, fieldsConfig) { - const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig); - ['x', 'y'].forEach((d) => { - if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) { - if (encodingFieldInf[`${d}0Field`]) { - domain[d] = domain[d].sort((a, b) => a - b); - } else { - domain[d][0] = Math.min(domain[d][0], 0); - domain[d][1] = Math.max(0, domain[d][1]); - } - } - }); - return domain; - } - - /** - * Generates an array of objects containing x, y, width and height of the bars from the data - * @param {Array.} data Data Array - * @param {Object} encoding Config - * @param {Object} axes Axes object - * @param {Object} conf config object for point generation - * @return {Array.} Array of points - */ - translatePoints (data, sizeConfig) { - return getTranslatedPoints(this, data, sizeConfig); - } - - /** - * Renders the plot in the given container - * @param {SVGGroup} container SVGGroup where plot will be rendered. - * @return {BarLayer} Instance of bar layer. - */ - render (container) { - const config = this.config(); - const transition = config.transition; - const normalizedDataArr = this._normalizedData; - const transformedData = this._transformedData; - const keys = transformedData.map(d => d.key); - const fieldsConfig = this.data().getFieldsConfig(); - const axes = this.axes(); - const height = axes.y && axes.y.scale().range()[0]; - const width = axes.x && axes.x.scale().range()[1]; - const defClassName = config.defClassName; - const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix); - const className = config.className; - const containerSelection = selectElement(container); - const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION) - .map(e => e.index); - containerSelection.classed(qualifiedClassName.join(' '), true); - containerSelection.classed(className, true); - clipElement(container, { - x: 0, - y: 0, - width, - height - }, `id-${this.id()}`); - - this._points = this.generateDataPoints(normalizedDataArr, keys); - this._graphicElems = {}; - - createElements({ - data: this._points, - container, - selector: 'g', - append: 'g', - each: (points, group, i) => { - const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase(); - group.style('display', 'block'); - drawRects({ - layer: this, - container: group.node(), - points, - className: seriesClassName, - transition, - style: {}, - keyFn: d => dimensions.map(key => d.source[key]).join('-') - }); - } - }); - return this; - } - - /** - * - * - * @param {*} normalizedData - * @param {*} keys - * - * @memberof BarLayer - */ - generateDataPoints (normalizedData, keys) { - const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys); - const barWidthOffsets = barWidthMetrics.offsetValues || []; - const barHeightOffsets = barHeightMetrics.offsetValues || []; - this._plotSpan = { - x: barWidthMetrics.groupSpan || 0, - y: barHeightMetrics.groupSpan || 0 - }; - this._plotPadding = { - x: barWidthMetrics.padding || 0, - y: barHeightMetrics.padding || 0 - }; - - this._pointMap = {}; - return normalizedData.map((data, i) => this.translatePoints(data, - { - barWidth: barWidthMetrics.span, - barWidthOffset: barWidthOffsets[i] || 0, - barHeight: barHeightMetrics.span, - barHeightOffset: barHeightOffsets[i] || 0 - })); - } - - getPlotPadding () { - return this._plotPadding; - } - - resolveTransformType () { - this._transformType = getValidTransformForAggFn(this); - } - - /** - * Gets the nearest point of the position passed. - * @param {number} x x position - * @param {number} y y position - * @return {Object} Nearest point. - */ - getNearestPoint (x, y) { - if (!this.data()) { - return null; - } - let axis; - let value; - let points; - let uniqueFieldType; - let uniqueFieldIndex; - let filterData; - let identifiers; - let pointFound = null; - const dataModel = this.data(); - const dataObj = dataModel.getData(); - const fieldsConfig = dataModel.getFieldsConfig(); - const axes = this.axes(); - const data = dataObj.data; - const pointMap = this._pointMap; - const { - xField, - yField, - xFieldSubType, - yFieldSubType - } = this.encodingFieldsInf(); - - if (xFieldSubType === MeasureSubtype.CONTINUOUS) { - axis = axes.y; - value = axis.invert(y); - uniqueFieldIndex = fieldsConfig[yField].index; - uniqueFieldType = yFieldSubType; - } else { - axis = axes.x; - value = axis.invert(x); - uniqueFieldIndex = fieldsConfig[xField].index; - uniqueFieldType = xFieldSubType; - } - - if (uniqueFieldType === DimensionSubtype.CATEGORICAL) { - points = pointMap[value]; - } - - if (uniqueFieldType === DimensionSubtype.TEMPORAL) { - filterData = [...new Set(data.map(d => d[uniqueFieldIndex]))]; - value = getNearestValue(filterData, value); - points = pointMap[value]; - } - const len = points && points.length; - points && points.sort((p1, p2) => p1.update.y - p2.update.y); - for (let i = 0; i < len; i++) { - const point = points[i]; - const update = point.update; - if (x >= update.x && x <= (update.width + update.x) && y >= update.y && y <= (update.height + update.y)) { - pointFound = point; - break; - } - pointFound = null; - } - - const values = pointFound && pointFound.source; - if (values) { - identifiers = this.getIdentifiersFromData(values, pointFound.rowId); - } - return pointFound ? { - dimensions: [pointFound.update], - id: identifiers, - layerId: this.id() - } : pointFound; - } - - getPlotSpan () { - return this._plotSpan; - } - - hasPlotSpan () { - return true; + return BAR_LAYER; } } diff --git a/packages/visual-layer/src/layers/bar/default-config.js b/packages/visual-layer/src/layers/bar/default-config.js index 303632cf..3a70176c 100644 --- a/packages/visual-layer/src/layers/bar/default-config.js +++ b/packages/visual-layer/src/layers/bar/default-config.js @@ -1,3 +1,4 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { @@ -5,18 +6,57 @@ export const defaultConfig = { defClassName: 'layer-bar', className: '', interaction: { - highlight: [{ - type: 'fill', - intensity: [0, 0, -15, 0] - }], - fade: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }], - focus: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }] + highlight: { + style: { + stroke: 'black', + 'stroke-width': '1px' + }, + strokePosition: 'center' + }, + focusStroke: { + className: 'focus-stroke-class', + style: { + stroke: 'black', + 'stroke-width': '1px' + }, + strokePosition: 'outside' + }, + brushStroke: { + className: 'brush-stroke-class', + style: { + stroke: 'black', + 'stroke-width': '1px' + }, + strokePosition: 'outside' + }, + doubleStroke: { + style: { + stroke: 'black', + 'stroke-width': '2px' + }, + strokePosition: 'outside' + }, + commonDoubleStroke: { + style: { + stroke: 'black', + 'stroke-width': '2px' + }, + strokePosition: 'outside' + }, + fade: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.3 + }, data, apply).color + } + }, + focus: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + } }, transform: { type: 'stack' @@ -31,18 +71,15 @@ export const defaultConfig = { x: {}, y: {}, x0: {}, - y0: {} - }, - states: { - highlight: { - className: `${CLASSPREFIX}-layer-bar-highlight` + y0: {}, + stroke: { + value: '#000' }, - fadeout: { - className: `${CLASSPREFIX}-layer-bar-fadeout` + strokeWidth: { + value: '0px' }, - selected: { - className: `${CLASSPREFIX}-layer-bar-selected` + strokePosition: { + value: 'center' } } }; - diff --git a/packages/visual-layer/src/layers/bar/index.js b/packages/visual-layer/src/layers/bar/index.js index 972239a8..505caa37 100644 --- a/packages/visual-layer/src/layers/bar/index.js +++ b/packages/visual-layer/src/layers/bar/index.js @@ -1 +1,2 @@ export { default as BarLayer } from './bar'; +export { BarLayerMixin } from './bar-mixin'; diff --git a/packages/visual-layer/src/layers/bar/renderer.js b/packages/visual-layer/src/layers/bar/renderer.js index 2325e169..1c38479d 100644 --- a/packages/visual-layer/src/layers/bar/renderer.js +++ b/packages/visual-layer/src/layers/bar/renderer.js @@ -43,14 +43,23 @@ const barEnterFn = (elem, d) => { * @return {Selection} Bar Selection */ /* istanbul ignore next */ export const drawRects = (params) => { - const { layer, points, container, keyFn } = params; + const { layer, points, container, keyFn, className } = params; const graphicElems = layer._graphicElems; const updateFns = { - enter (elem, d) { barEnterFn(elem, d); }, + enter (elem, d) { + barEnterFn(elem, d); + }, update (elem, d, i) { graphicElems[d.rowId] = elem; transitionBars(layer, elem, d, i, params); } }; - return makeElement(container, 'rect', points, null, updateFns, keyFn); + + return makeElement(container, 'g', points, null, { + update: (group, d) => { + makeElement(group.node(), 'rect', data => [data], null, updateFns, keyFn); + group.attr('class', `${className}-${d.rowId}`); + group.classed(d.className, true); + } + }, keyFn); }; diff --git a/packages/visual-layer/src/layers/bar/styles.scss b/packages/visual-layer/src/layers/bar/styles.scss index 46164942..a7b1b76a 100644 --- a/packages/visual-layer/src/layers/bar/styles.scss +++ b/packages/visual-layer/src/layers/bar/styles.scss @@ -2,11 +2,12 @@ .#{$prefix}layer-bar { fill-opacity: 1; + stroke: none; + stroke-width: 0; } .#{$prefix}layer-bar-highlight { fill-opacity: 1; - } .#{$prefix}layer-bar-fadeout { diff --git a/packages/visual-layer/src/layers/line/default-config.js b/packages/visual-layer/src/layers/line/default-config.js index e41a2777..73130f27 100644 --- a/packages/visual-layer/src/layers/line/default-config.js +++ b/packages/visual-layer/src/layers/line/default-config.js @@ -1,3 +1,4 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { @@ -9,19 +10,29 @@ export const defaultConfig = { type: 'group' }, interaction: { - highlight: [{ - type: 'stroke', - intensity: [0, 0, -15, 0] - }], - fade: [{ - type: 'stroke', - intensity: [0, 0, +15, 0] - }], - focus: [{ - type: 'stroke', - intensity: [0, 0, +15, 0] - }] + fade: { + style: { + stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + }, + focus: { + style: { + stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + }, + brushStroke: { + style: { + stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + } }, + crossline: true, nearestPointThreshold: 20, encoding: { color: {}, @@ -29,12 +40,19 @@ export const defaultConfig = { y: {}, strokeOpacity: { value: 1 + }, + fillOpacity: { + value: 0 + }, + strokeWidth: { + value: '2px' } }, transition: { effect: 'cubic', duration: 1000 }, - connectNullData: false + connectNullData: false, + nullDataLineStyle: {}, + nullDataLineClass: 'null' }; - diff --git a/packages/visual-layer/src/layers/line/index.js b/packages/visual-layer/src/layers/line/index.js index b7ab1ed7..e971f041 100644 --- a/packages/visual-layer/src/layers/line/index.js +++ b/packages/visual-layer/src/layers/line/index.js @@ -1 +1,2 @@ export { default as LineLayer } from './line'; +export { LineLayerMixin } from './line-mixin'; diff --git a/packages/visual-layer/src/layers/line/line-mixin.js b/packages/visual-layer/src/layers/line/line-mixin.js new file mode 100644 index 00000000..32c23629 --- /dev/null +++ b/packages/visual-layer/src/layers/line/line-mixin.js @@ -0,0 +1,296 @@ +import { + Voronoi, + getQualifiedClassName, + selectElement, + makeElement, + FieldType, + InvalidAwareTypes, + getObjProp +} from 'muze-utils'; +import { drawLine } from './renderer'; +import { defaultConfig } from './default-config'; +import { ENCODING } from '../../enums/constants'; +import { + attachDataToVoronoi, + animateGroup, + positionPoints, + getIndividualClassName, + getColorMetaInf, + resolveEncodingValues, + sortData, + getBoundBoxes +} from '../../helpers'; +import './styles.scss'; + +/** + * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```. + * + * @public + * + * @class + * @module LineLayer + * @extends BaseLayer + */ +export const LineLayerMixin = superclass => class extends superclass { + /** + * Creates an instance of LineLayer. + * + * @param {*} args + * @memberof LineLayer + */ + constructor (...args) { + super(...args); + this._voronoi = new Voronoi(); + } + + static formalName () { + return 'line'; + } + + elemType () { + return 'path'; + } + + /** + * Default configuration of line layer + * @return {Object} Default configuration of layer + */ + static defaultConfig () { + return defaultConfig; + } + + static defaultPolicy (conf, userConf) { + const config = super.defaultPolicy(conf, userConf); + const encoding = config.encoding; + const transform = config.transform; + const colorField = encoding.color && encoding.color.field; + + if (colorField && !transform.groupBy) { + transform.groupBy = colorField; + } + return config; + } + + /** + * Returns the draw method for line + * @return {Function} Draw method of line layer + */ + getDrawFn () { + return drawLine; + } + + static shouldDrawAnchors () { + return true; + } + + /** + * Generates the x and y positions for each point + * @param {Array} data Data Array + * @param {Object} encoding Visual Encodings of the layer + * @param {Object} axes Contains the axis + * @param {number} seriesIndex index of series + * @return {Array} Array of points + */ + translatePoints (data) { + let points = []; + const axes = this.axes(); + const encoding = this.config().encoding; + const xAxis = axes.x; + const yAxis = axes.y; + const colorAxis = axes.color; + const { xFieldType, yFieldType } = this.encodingFieldsInf(); + const isXDim = xFieldType === FieldType.DIMENSION; + const isYDim = yFieldType === FieldType.DIMENSION; + const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); + sortData(data, axes); + points = data.map((d, i) => { + const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2; + const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2; + const color = colorAxis.getColor(d.color); + + const resolvedEncodings = resolveEncodingValues({ + values: { + x: xPx, + y: yPx, + color + }, + data: d + }, i, data, this); + + const style = { + stroke: resolvedEncodings.color, + 'fill-opacity': encoding.fillOpacity.value, + 'stroke-width': encoding.strokeWidth.value + }; + + const point = { + enter: {}, + update: { + x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x, + y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y + }, + style, + rowId: d.rowId, + source: d.source, + data: d.dataObj, + meta: getColorMetaInf(style) + }; + point.className = getIndividualClassName(d, i, data, this); + this.cachePoint(d[key], point); + return point; + }); + points = positionPoints(this, points); + + points = points.filter((point) => { + const { update } = point; + return !isNaN(update.x) && !isNaN(update.y); + }); + return points; + } + + getTranslatedData (normalizedData, colorValFn, colorFieldIndex, axes) { + return normalizedData.map((data, i) => { + let color; + const colorVal = data.find(d => d.source[colorFieldIndex] !== null && + d.source[colorFieldIndex] !== undefined); + + if (colorValFn) { + color = colorValFn(data, i, normalizedData); + } else { + color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]); + } + + return { + data: this.translatePoints(data), + style: this.getPathStyle(color) + }; + }); + } + + /** + * Renders the line plot + * @param {SVGElement} container svg element + * @return {LineLayer} instance of line layer + */ + render (container) { + const config = this.config(); + const { + encoding, + interpolate, + className, + defClassName, + transition + } = config; + const normalizedData = this._normalizedData; + const transformedData = this._transformedData; + const fieldsConfig = this.data().getFieldsConfig(); + const axes = this.axes(); + const keys = transformedData.map(d => d.key); + const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix); + const containerSelection = selectElement(container); + const colorField = encoding.color.field; + const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index; + + this._points = []; + this._pointMap = {}; + containerSelection.classed(qualifiedClassName.join(' '), true); + containerSelection.classed(className, true); + + const colorValFn = encoding.color.value; + const translatedPoints = this.getTranslatedData(normalizedData, colorValFn, colorFieldIndex, axes); + + makeElement(container, 'g', translatedPoints, null, { + enter: (group) => { + animateGroup(group, { + transition, + groupAnimateStyle: { + enter: { + 'stroke-opacity': 0, + 'fill-opacity': this.getPathStyle()['fill-opacity'] + }, + update: { + 'stroke-opacity': encoding.strokeOpacity.value + } + } + }); + }, + update: (group, dataArr, i) => { + const points = dataArr.data; + const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase(); + const style = dataArr.style; + + this._points.push(points); + this.getDrawFn()({ + layer: this, + container: group.node(), + interpolate, + points, + className: seriesClassName, + transition, + style: style || {}, + connectNullData: config.connectNullData + }); + } + }, d => d.data[0].source[colorFieldIndex] || d.data[0].rowId); + + attachDataToVoronoi(this._voronoi, this._points); + return this; + } + + /** + * Get the css styles need to be applied on the line path + * @param {string} color Color value + * @return {Object} Path styles + */ + getPathStyle (color) { + return { + stroke: color, + 'fill-opacity': '0' + }; + } + + /** + * Gets the nearest point closest to the given position + * @param {number} x x position + * @param {number} y y position + * @return {Object} Nearest point information + */ + getNearestPoint (x, y, config) { + let searchRadius = config.searchRadius; + const data = this.data(); + + if (!data || (data && data.isEmpty())) { + return null; + } + + searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold; + const point = this._voronoi.find(x, y, searchRadius); + const dimensions = getObjProp(point, 'data', 'data', 'update'); + + if (point) { + const { source, rowId } = point.data.data; + const identifiers = this.getIdentifiersFromData(source, rowId); + return { + id: identifiers, + dimensions: [{ + x: dimensions.x, + y: dimensions.y, + width: 2, + height: 2 + }], + layerId: this.id() + }; + } + return null; + } + + applyStyles ({ strokeStyles, otherStyles, styleObj, elem }) { + [...otherStyles, ...strokeStyles].forEach((type) => { + elem.style(type, styleObj[type]); + }); + } + + getBoundBoxes () { + return getBoundBoxes(this._points.flat()); + } +}; diff --git a/packages/visual-layer/src/layers/line/line.js b/packages/visual-layer/src/layers/line/line.js index ce91d02e..70170615 100644 --- a/packages/visual-layer/src/layers/line/line.js +++ b/packages/visual-layer/src/layers/line/line.js @@ -1,27 +1,9 @@ import { - Voronoi, - getQualifiedClassName, - selectElement, - makeElement, - FieldType, - InvalidAwareTypes, - getObjProp + mix } from 'muze-utils'; -import { BaseLayer } from '../../base-layer'; -import { drawLine } from './renderer'; -import { defaultConfig } from './default-config'; -import { ENCODING } from '../../enums/constants'; -import { - attachDataToVoronoi, - animateGroup, - positionPoints, - getIndividualClassName, - getColorMetaInf, - resolveEncodingValues, - sortData -} from '../../helpers'; - -import './styles.scss'; +import { BaseLayer, BaseLayerMixin } from '../../base-layer'; +import { LineLayerMixin } from './line-mixin'; +import { LINE_LAYER } from '../../enums/constants'; /** * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```. @@ -32,245 +14,8 @@ import './styles.scss'; * @module LineLayer * @extends BaseLayer */ -export default class LineLayer extends BaseLayer { - - /** - * Creates an instance of LineLayer. - * @param {*} args - * @memberof LineLayer - */ - constructor (...args) { - super(...args); - this._voronoi = new Voronoi(); - } - +export default class LineLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin) { static formalName () { - return 'line'; - } - - elemType () { - return 'path'; - } - - /** - * Default configuration of line layer - * @return {Object} Default configuration of layer - */ - static defaultConfig () { - return defaultConfig; - } - - static defaultPolicy (conf, userConf) { - const config = BaseLayer.defaultPolicy(conf, userConf); - const encoding = config.encoding; - const transform = config.transform; - const colorField = encoding.color && encoding.color.field; - - if (colorField && !transform.groupBy) { - transform.groupBy = colorField; - } - return config; - } - - /** - * Returns the draw method for line - * @return {Function} Draw method of line layer - */ - getDrawFn () { - return drawLine; - } - - static shouldDrawAnchors () { - return true; - } - - /** - * Generates the x and y positions for each point - * @param {Array} data Data Array - * @param {Object} encoding Visual Encodings of the layer - * @param {Object} axes Contains the axis - * @param {number} seriesIndex index of series - * @return {Array} Array of points - */ - translatePoints (data) { - let points = []; - const axes = this.axes(); - const xAxis = axes.x; - const yAxis = axes.y; - const colorAxis = axes.color; - const { xFieldType, yFieldType } = this.encodingFieldsInf(); - const isXDim = xFieldType === FieldType.DIMENSION; - const isYDim = yFieldType === FieldType.DIMENSION; - const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); - sortData(data, axes); - points = data.map((d, i) => { - const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2; - const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2; - const color = colorAxis.getColor(d.color); - - const resolvedEncodings = resolveEncodingValues({ - values: { - x: xPx, - y: yPx, - color - }, - data: d - }, i, data, this); - - const point = { - enter: {}, - update: { - x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x, - y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y - }, - style: { - stroke: resolvedEncodings.color, - 'fill-opacity': 0 - }, - rowId: d.rowId, - source: d.source, - meta: getColorMetaInf({ - stroke: resolvedEncodings.color - }, colorAxis) - }; - point.className = getIndividualClassName(d, i, data, this); - this.cachePoint(d[key], point); - return point; - }); - points = positionPoints(this, points); - - points = points.filter((point) => { - const { update } = point; - return !isNaN(update.x) && !isNaN(update.y); - }); - return points; - } - - /** - * Renders the line plot - * @param {SVGElement} container svg element - * @return {LineLayer} instance of line layer - */ - render (container) { - let points; - let seriesClassName; - let style; - - const config = this.config(); - const { - encoding, - interpolate, - className, - defClassName, - transition - } = config; - const normalizedData = this._normalizedData; - const transformedData = this._transformedData; - const fieldsConfig = this.data().getFieldsConfig(); - const axes = this.axes(); - const keys = transformedData.map(d => d.key); - const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix); - const containerSelection = selectElement(container); - const colorField = encoding.color.field; - const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index; - - this._points = []; - this._pointMap = {}; - containerSelection.classed(qualifiedClassName.join(' '), true); - containerSelection.classed(className, true); - makeElement(container, 'g', normalizedData, null, { - enter: (group) => { - animateGroup(group, { - transition, - groupAnimateStyle: { - enter: { - 'stroke-opacity': 0, - 'fill-opacity': this.getPathStyle()['fill-opacity'] - }, - update: { - 'stroke-opacity': encoding.strokeOpacity.value - } - } - }); - }, - update: (group, dataArr, i) => { - points = this.translatePoints(dataArr); - this._points.push(points); - seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase(); - - let color; - const colorValFn = encoding.color.value; - const colorVal = points.find(d => d.source[colorFieldIndex] !== null && - d.source[colorFieldIndex] !== undefined); - - if (colorValFn) { - color = colorValFn(dataArr, i, normalizedData); - } else { - color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]); - } - - style = this.getPathStyle(color); - this.getDrawFn()({ - layer: this, - container: group.node(), - interpolate, - points, - className: seriesClassName, - transition, - style: style || {}, - connectNullData: config.connectNullData - }); - } - }, d => d[0].source[colorFieldIndex] || d[0].rowId); - - attachDataToVoronoi(this._voronoi, this._points); - return this; - } - - /** - * Get the css styles need to be applied on the line path - * @param {string} color Color value - * @return {Object} Path styles - */ - getPathStyle (color) { - return { - stroke: color, - 'fill-opacity': '0' - }; - } - - /** - * Gets the nearest point closest to the given position - * @param {number} x x position - * @param {number} y y position - * @return {Object} Nearest point information - */ - getNearestPoint (x, y, config) { - let searchRadius = config.searchRadius; - const data = this.data(); - - if (!data || (data && data.isEmpty())) { - return null; - } - - searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold; - const point = this._voronoi.find(x, y, searchRadius); - const dimensions = getObjProp(point, 'data', 'data', 'update'); - - if (point) { - const { source, rowId } = point.data.data; - const identifiers = this.getIdentifiersFromData(source, rowId); - return { - id: identifiers, - dimensions: [{ - x: dimensions.x, - y: dimensions.y, - width: 2, - height: 2 - }], - layerId: this.id() - }; - } - return null; + return LINE_LAYER; } } diff --git a/packages/visual-layer/src/layers/line/renderer.js b/packages/visual-layer/src/layers/line/renderer.js index 4e1b52f4..9ad6f972 100644 --- a/packages/visual-layer/src/layers/line/renderer.js +++ b/packages/visual-layer/src/layers/line/renderer.js @@ -2,7 +2,8 @@ import { selectElement, makeElement, pathInterpolators, - Symbols + Symbols, + setStyles } from 'muze-utils'; import { updateStyle } from '../../helpers'; @@ -13,36 +14,133 @@ const filterFn = (d) => { return update.y !== null && update.x !== null; }; +const containsNull = (elem) => { + const { x, y } = elem ? elem.update : {}; + if (x === null || y === null) { + return true; + } + return false; +}; + +const settIndexPrevOrNext = (arr, index, indexesObj) => { + const prevContainsNull = containsNull(arr[index - 1], index - 1); + const nextContainsNull = containsNull(arr[index + 1], index + 1); + + !prevContainsNull && indexesObj.prevOfNull.push(index - 1); + !nextContainsNull && indexesObj.nextOfNull.push(index + 1); +}; + +const getborderIndexes = (arr) => { + const indexes = { + prevOfNull: [], + nextOfNull: [] + }; + arr.forEach((value, index) => { + const { update } = value; + if (update.y === null || update.x === null) { + settIndexPrevOrNext(arr, index, indexes); + } + }); + return indexes; +}; + +const makeStartEndPair = (arr, borderIndexes) => { + const pairArray = []; + const { prevOfNull, nextOfNull } = borderIndexes; + const length = prevOfNull.length; + if (!length) { + return pairArray; + } + + for (let i = 0; i < length; i++) { + const pair = []; + const prevValue = arr[prevOfNull[i]]; + const nextValue = arr[nextOfNull[i]]; + if (prevValue) { + pair.push(prevValue); + } + if (nextValue) { + pair.push(nextValue); + } + pairArray.push(pair); + } + return pairArray; +}; + +const sanitizeNullConfig = (arr) => { + const borderIndexes = getborderIndexes(arr); + return makeStartEndPair(arr, borderIndexes); +}; + +const getElementsForLine = (params) => { + const { mount, data, className, layer, strokeStyle, linepath, transition, updateFns } = params; + let element = makeElement(mount, 'path', data.length ? [data] : [], className, updateFns); + element.attr('class', (d, i) => d[i].className); + setStyles(element, strokeStyle); + if (!transition.disabled) { + element = element.transition() + .duration(transition.duration) + .on('end', layer.registerAnimationDoneHook()); + } + element.attr('d', linepath(data)) + .style('fill-opacity', 0); + return element; +}; + /** * Draws a line from the points * Generates a svg path string * @param {Object} params Contains container, points and interpolate attribute. */ export const drawLine = (context) => { - let filteredPoints; const { layer, container, points, interpolate, connectNullData, className, style, transition } = context; - const mount = selectElement(container).attr('class', className); + const containerSelection = selectElement(container); + const strokeStyle = layer.config().nullDataLineStyle; + const nullDataLineClass = layer.config().nullDataLineClass; + const mount = containerSelection.attr('class', className); const curveInterpolatorFn = pathInterpolators[interpolate]; const linepath = line() - .curve(curveInterpolatorFn) - .x(d => d.update.x) - .y(d => d.update.y) - .defined(filterFn); - - filteredPoints = points; - if (connectNullData) { - filteredPoints = points.filter(filterFn); - } + .curve(curveInterpolatorFn) + .x(d => d.update.x) + .y(d => d.update.y) + .defined(filterFn); + + const graphicElems = layer._graphicElems; + const updateFns = { + update: (group, d) => { + d.forEach((dd) => { + graphicElems[dd.rowId] = containerSelection; + }); + } + }; updateStyle(mount, style); - let element = makeElement(mount, 'path', points.length ? [points[0].className] : []); - element.attr('class', d => d); - if (!transition.disabled) { - element = element.transition() - .duration(transition.duration) - .on('end', layer.registerAnimationDoneHook()); - } - element.attr('d', linepath(filteredPoints)) - .style('fill-opacity', 0); - return element; + + const elementWithNullData = getElementsForLine({ + mount, + data: points, + strokeStyle: undefined, + layer, + linepath, + transition, + updateFns + }); + const sanitizedPoints = sanitizeNullConfig(points); + + sanitizedPoints.map((d) => { + if (connectNullData && d.length > 1) { + getElementsForLine({ + mount, + data: d, + strokeStyle, + className: `.${className}-${nullDataLineClass}`, + layer, + linepath, + transition, + updateFns + }); + } + return null; + }); + return elementWithNullData; }; diff --git a/packages/visual-layer/src/layers/line/styles.scss b/packages/visual-layer/src/layers/line/styles.scss index b2ef6e2f..8931c060 100644 --- a/packages/visual-layer/src/layers/line/styles.scss +++ b/packages/visual-layer/src/layers/line/styles.scss @@ -8,5 +8,5 @@ .#{$prefix}layer-line { stroke-linejoin: round; stroke-width: 2px; - stroke: #086bb6;; + stroke: #1f77b4;; } diff --git a/packages/visual-layer/src/layers/point/default-config.js b/packages/visual-layer/src/layers/point/default-config.js index 9a21b288..57459c06 100644 --- a/packages/visual-layer/src/layers/point/default-config.js +++ b/packages/visual-layer/src/layers/point/default-config.js @@ -1,3 +1,4 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { @@ -6,22 +7,63 @@ export const defaultConfig = { classPrefix: CLASSPREFIX, defColorStyle: 'stroke', interaction: { - highlight: [{ - type: 'stroke', - intensity: [0, 0, 0, +1] - }], - fade: [{ - type: 'fill', - intensity: [0, 0, +20, 0] - }], - focus: [{ - type: 'fill', - intensity: [0, 0, +20, 0] + highlight: { + className: 'highlight-class', + style: { + stroke: 'black', + 'stroke-width': '1px' + // fill: 'red' + }, + strokePosition: 'center' + }, + focusStroke: { + className: 'focus-stroke-class', + style: { + stroke: 'black', + 'stroke-width': '1px' + }, + strokePosition: 'outside' + }, + commonDoubleStroke: { + style: { + stroke: 'black', + 'stroke-width': '2px' + }, + strokePosition: 'outside' + }, + brushStroke: { + className: 'brush-stroke-class', + style: { + stroke: 'black', + 'stroke-width': '1px' + // fill: 'blue' + }, + strokePosition: 'outside' + }, + doubleStroke: { + style: { + stroke: 'black', + 'stroke-width': '2px' + }, + strokePosition: 'outside' + }, + fade: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } + }, + focus: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + a: -0.5 + }, data, apply).color + } } - ] }, innerPadding: 0.1, - nearestPointThreshold: 10, + nearestPointThreshold: 5, transform: { type: 'identity' }, @@ -35,7 +77,10 @@ export const defaultConfig = { }, color: {}, stroke: { - value: 'hsla(0,0%,0%,0)' + value: '#000' + }, + 'stroke-width': { + value: 0 }, fill: {}, shape: { @@ -43,11 +88,19 @@ export const defaultConfig = { }, x: {}, y: {}, - strokeOpacity: { - value: 0.5 + 'stroke-opacity': { + value: 1 }, - fillOpacity: { + 'fill-opacity': { value: 0.5 + }, + strokePosition: { + value: 'center' + }, + interaction: { + anchors: 'highlight', + 'persistent-anchors': 'focusStroke', + 'brush-anchors': 'brushStroke' } }, shapes: ['circle', 'cross', 'diamond', 'square', 'star', 'wye', 'triangle'], diff --git a/packages/visual-layer/src/layers/point/helper.js b/packages/visual-layer/src/layers/point/helper.js new file mode 100644 index 00000000..50825693 --- /dev/null +++ b/packages/visual-layer/src/layers/point/helper.js @@ -0,0 +1,111 @@ +import { FieldType, COORD_TYPES } from 'muze-utils'; +import { ENCODING } from '../../enums/constants'; +import { + getIndividualClassName, + resolveEncodingValues, + getColorMetaInf, + positionPoints +} from '../../helpers'; + +export const prepareDrawingInf = ({ data, datum, i, layerInst, xPx, yPx }) => { + const axes = layerInst.axes(); + const { shape: shapeAxis, color: colorAxis, size: sizeAxis } = axes; + let shape = shapeAxis.getShape(datum.shape); + let size = sizeAxis.getSize(datum.size); + let color = colorAxis.getColor(datum.color); + const layerEncoding = layerInst.config().encoding; + const stroke = layerEncoding.stroke.value; + const strokeWidth = layerEncoding['stroke-width'].value; + + const resolvedEncodings = resolveEncodingValues({ + values: { + x: xPx, + y: yPx, + color, + stroke, + 'stroke-width': strokeWidth, + size, + shape, + data: datum + }, + data: datum + }, i, data, layerInst); + const { rowId, source } = datum; + ({ shape, size, color } = resolvedEncodings); + const style = { + fill: color, + stroke: resolvedEncodings.stroke, + 'stroke-width': resolvedEncodings['stroke-width'] + }; + const { x, y } = resolvedEncodings; + const pos = { x, y }; + return { + enter: pos, + update: pos, + shape, + source, + rowId, + style, + data: datum.dataObj, + meta: Object.assign({ + layerId: layerInst.id() + }, getColorMetaInf(style, { + strokePosition: layerEncoding.strokePosition.value + })), + size + }; +}; + +export const pointTranslators = { + [COORD_TYPES.CARTESIAN]: (data, config, layerInst) => { + let points = []; + const encoding = layerInst.config().encoding; + const axes = layerInst.axes(); + const { x, y } = encoding; + const xField = x.field; + const yField = y.field; + const fieldsConfig = layerInst.data().getFieldsConfig(); + const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION; + const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION; + const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); + const measurement = layerInst.measurement(); + const { x: offsetX, y: offsetY } = config.offset; + + for (let i = 0, len = data.length; i < len; i++) { + const d = data[i]; + + let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => { + const value = d[type] === null ? undefined : d[type]; + const measure = type === ENCODING.X ? measurement.width : measurement.height; + return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value); + }); + + xPx += offsetX; + yPx += offsetY; + if (!isNaN(xPx) && !isNaN(yPx)) { + const point = prepareDrawingInf({ + data, + datum: d, + i, + layerInst, + xPx, + yPx + }); + point.className = getIndividualClassName(d, i, data, layerInst); + points.push(point); + layerInst.cachePoint(d[key], point); + } + } + points = positionPoints(layerInst, points); + return points; + } +}; + +export const getStrokeWidthByPosition = (position, radius) => { + const strokeWidthWithOffsetMap = { + center: -radius, + inside: -(radius * Math.PI), + outside: +(radius * Math.PI) + }; + return strokeWidthWithOffsetMap[position]; +}; diff --git a/packages/visual-layer/src/layers/point/index.js b/packages/visual-layer/src/layers/point/index.js index f637ecb4..b8b05cc6 100644 --- a/packages/visual-layer/src/layers/point/index.js +++ b/packages/visual-layer/src/layers/point/index.js @@ -1 +1,2 @@ export { default as PointLayer } from './point'; +export { PointLayerMixin } from './point-mixin'; diff --git a/packages/visual-layer/src/layers/point/point-mixin.js b/packages/visual-layer/src/layers/point/point-mixin.js new file mode 100644 index 00000000..1c57e539 --- /dev/null +++ b/packages/visual-layer/src/layers/point/point-mixin.js @@ -0,0 +1,243 @@ +import { + Voronoi, + Scales, + makeElement, + getQualifiedClassName, + selectElement, + appendElement, + getSymbol, + pointWithinCircle +} from 'muze-utils'; +import drawSymbols from './renderer'; +import { defaultConfig } from './default-config'; +import { + attachDataToVoronoi, + getPlotMeasurement, + getMarkId, + getBoundBoxes +} from '../../helpers'; +import './styles.scss'; +import { pointTranslators, getStrokeWidthByPosition } from './helper'; + +export const PointLayerMixin = superclass => class extends superclass { + /** + * Creates an instance of PointLayer. + * @param {*} args + * @memberof PointLayer + */ + constructor (...args) { + super(...args); + this._voronoi = new Voronoi(); + this._bandScale = Scales.band(); + this._overlayPath = {}; + this.formattedUids = []; + } + + elemType () { + return 'g'; + } + + /** + * Returns the default configuration of the point layer + * @return {Object} Default configuration of the point layer + */ + static defaultConfig () { + return defaultConfig; + } + + static defaultPolicy (conf, userConf) { + const config = super.defaultPolicy(conf, userConf); + const encoding = config.encoding; + const transform = config.transform; + const colorField = encoding.color && encoding.color.field; + + if (colorField) { + transform.groupBy = colorField; + } + return config; + } + + static drawFn () { + return drawSymbols; + } + + /** + * Generates an array of objects containing x, y, width and height of the points from the data + * @param {Array.} data Data Array + * @param {Object} encoding Config + * @param {Object} axes Axes object + * @return {Array.} Array of points + */ + translatePoints (data, config = {}) { + return pointTranslators[this.coord()](data, config, this); + } + + /** + * Renders the plot in the given container. + * + * @param {SVGElement} container SVGElement which will hold the plot + * @return {BarLayer} Instance of bar layer + */ + render (container) { + let maxSize = 0; + let seriesClassName; + const config = this.config(); + const keys = this._transformedData.map(d => d.key); + const { transition, className, defClassName, classPrefix } = config; + const normalizedData = this._normalizedData; + const containerSelection = selectElement(container); + const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix); + this._points = []; + this._pointMap = {}; + + containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true); + + this._points = this.generateDataPoints(normalizedData, keys); + this._graphicElems = {}; + + const schema = this.data().getSchema(); + makeElement(container, 'g', this._points, null, { + update: (group, points) => { + maxSize = Math.max(maxSize, ...points.map(d => d.size || 0)); + seriesClassName = `${qualifiedClassName[0]}`; + this.constructor.drawFn()({ + layer: this, + container: group.node(), + points, + interpolate: config.interpolate, + className: seriesClassName, + transition, + keyFn: v => getMarkId(v.source, schema) + }); + } + }, data => data[0].rowId); + this._maxSize = Math.sqrt(maxSize / Math.PI) * 2; + this.attachDataToVoronoi(this._points); + return this; + } + + attachDataToVoronoi (points) { + attachDataToVoronoi(this._voronoi, points); + } + + generateDataPoints (normalizedData, keys) { + const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys); + const offsetXValues = widthMetrics.offsetValues || []; + const offsetYValues = heightMetrics.offsetValues || []; + return normalizedData.map((dataArr, i) => { + const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span, + heightMetrics.span); + return this.translatePoints(dataArr, measurementConf); + }).filter(d => d.length); + } + + getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) { + return { + offset: { + x: (offsetX || 0) + widthSpan / 2, + y: (offsetY || 0) + heightSpan / 2 + }, + span: { + x: widthSpan, + y: heightSpan + } + }; + } + + /** + * Gets the nearest point from a position. + * @param {number} x x position + * @param {number} y y position + * @return {Object} Point details + */ + getNearestPoint (x, y) { + const nearestPointThreshold = this.config().nearestPointThreshold; + const distanceLimit = Math.max(this._maxSize, nearestPointThreshold); + + if (!this.data()) { + return null; + } + + const point = this._voronoi.find(x, y, distanceLimit); + const dimensions = point && point.data.data.update; + const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0; + + if (point) { + const insideShape = pointWithinCircle({ + x: dimensions.x, + y: dimensions.y, + r: radius + nearestPointThreshold + }, { x, y }); + if (insideShape) { + const { source, rowId } = point.data.data; + const identifiers = this.getIdentifiersFromData(source, rowId); + return { + id: identifiers, + dimensions: [{ + x: dimensions.x, + y: dimensions.y, + width: radius, + height: radius + }], + layerId: this.id() + }; + } + } + return null; + } + + addOverlayPath (refElement, data, style, strokePosition) { + const container = refElement.parentElement; + let pathElement; + + if (this._overlayPath[data.rowId]) { + pathElement = this._overlayPath[data.rowId]; + } else { + pathElement = makeElement(container, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`); + pathElement.style('fill', 'none'); + pathElement.style('fill-opacity', 0); + pathElement.attr('id', data.rowId); + this._overlayPath[data.rowId] = pathElement; + } + + if (style.type === 'stroke-width') { + const position = strokePosition; + // get radius as per stroke position + let radius = Math.sqrt(data.size / Math.PI); + radius = getStrokeWidthByPosition(position, radius); + + const size = data.size + radius; + if (typeof data.shape === 'string') { + const path = getSymbol(data.shape).size(size); + pathElement.attr('d', path); + } + } + + let styleVal = style.value; + if (typeof styleVal === 'function') { + const currentStyle = pathElement.style(style.type); + styleVal = styleVal(currentStyle); + } + pathElement.style(style.type, styleVal); + appendElement(refElement, pathElement.node()); + } + + removeOverlayPath (data, style) { + const currentPath = this._overlayPath[data.rowId]; + if (currentPath) { + currentPath.node().removeAttribute('style'); + Object.keys(style).forEach(s => currentPath.style(s, style[s])); + currentPath.style('fill-opacity', 0); + } + } + + getBoundBoxes () { + return getBoundBoxes(this._points.flat()); + } + + applyElementStyles (elem, styles, styleObj) { + styles.forEach((type) => { + elem.select('path').style(type, styleObj[type]); + }); + } +}; diff --git a/packages/visual-layer/src/layers/point/point.js b/packages/visual-layer/src/layers/point/point.js index 020e69f7..ac71cc54 100644 --- a/packages/visual-layer/src/layers/point/point.js +++ b/packages/visual-layer/src/layers/point/point.js @@ -1,26 +1,9 @@ import { - Voronoi, - selectElement, - getQualifiedClassName, - makeElement, - FieldType, - Scales + mix } from 'muze-utils'; import { BaseLayer } from '../../base-layer'; -import drawSymbols from './renderer'; -import { defaultConfig } from './default-config'; -import { ENCODING } from '../../enums/constants'; -import { - attachDataToVoronoi, - positionPoints, - getPlotMeasurement, - getIndividualClassName, - getMarkId, - getColorMetaInf, - resolveEncodingValues -} from '../../helpers'; - -import './styles.scss'; +import { POINT_LAYER } from '../../enums/constants'; +import { PointLayerMixin } from './point-mixin'; /** * This layer is used to create various symbols for each data point. This is commonly used in @@ -32,235 +15,8 @@ import './styles.scss'; * @module PointLayer * @extends BaseLayer */ -export default class PointLayer extends BaseLayer { - - /** - * Creates an instance of PointLayer. - * @param {*} args - * @memberof PointLayer - */ - constructor (...args) { - super(...args); - this._voronoi = new Voronoi(); - this._bandScale = Scales.band(); - } - - elemType () { - return 'g'; - } - - /** - * Returns the default configuration of the point layer - * @return {Object} Default configuration of the point layer - */ - static defaultConfig () { - return defaultConfig; - } - - static defaultPolicy (conf, userConf) { - const config = BaseLayer.defaultPolicy(conf, userConf); - const encoding = config.encoding; - const transform = config.transform; - const colorField = encoding.color && encoding.color.field; - - if (colorField) { - transform.groupBy = colorField; - } - return config; - } - +export default class PointLayer extends mix(BaseLayer).with(PointLayerMixin) { static formalName () { - return 'point'; - } - - static drawFn () { - return drawSymbols; - } - - /** - * Generates an array of objects containing x, y, width and height of the points from the data - * @param {Array.} data Data Array - * @param {Object} encoding Config - * @param {Object} axes Axes object - * @return {Array.} Array of points - */ - translatePoints (data, config = {}) { - let points = []; - const encoding = this.config().encoding; - const axes = this.axes(); - const { - x, - y - } = encoding; - const xField = x.field; - const yField = y.field; - const { size: sizeAxis, shape: shapeAxis } = axes; - const fieldsConfig = this.data().getFieldsConfig(); - const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION; - const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION; - const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); - const measurement = this.measurement(); - const colorAxis = axes.color; - const { x: offsetX, y: offsetY } = config.offset; - const stroke = encoding.stroke.value; - - for (let i = 0, len = data.length; i < len; i++) { - const d = data[i]; - const size = sizeAxis.getSize(d.size); - const shape = shapeAxis.getShape(d.shape); - - let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => { - const value = d[type] === null ? undefined : d[type]; - const measure = type === ENCODING.X ? measurement.width : measurement.height; - return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value); - }); - - xPx += offsetX; - yPx += offsetY; - - let color = colorAxis.getColor(d.color); - - const resolvedEncodings = resolveEncodingValues({ - values: { - x: xPx, - y: yPx, - color, - shape, - size, - data: d - }, - data: d - }, i, data, this); - color = resolvedEncodings.color; - - const style = { - fill: color, - stroke - }; - const pos = { - x: resolvedEncodings.x, - y: resolvedEncodings.y - }; - - if (!isNaN(xPx) && !isNaN(yPx)) { - const point = { - enter: pos, - update: pos, - shape: resolvedEncodings.shape, - size: Math.abs(resolvedEncodings.size), - meta: getColorMetaInf(style, colorAxis), - style, - source: d.source, - rowId: d.rowId - }; - point.className = getIndividualClassName(d, i, data, this); - points.push(point); - this.cachePoint(d[key], point); - } - } - points = positionPoints(this, points); - return points; - } - - /** - * Renders the plot in the given container. - * - * @param {SVGElement} container SVGElement which will hold the plot - * @return {BarLayer} Instance of bar layer - */ - render (container) { - let maxSize = 0; - let seriesClassName; - const config = this.config(); - const keys = this._transformedData.map(d => d.key); - const { transition, className, defClassName, classPrefix } = config; - const normalizedData = this._normalizedData; - const containerSelection = selectElement(container); - const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix); - this._points = []; - this._pointMap = {}; - - containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true); - - this._points = this.generateDataPoints(normalizedData, keys); - this._graphicElems = {}; - - const schema = this.data().getSchema(); - makeElement(container, 'g', this._points, null, { - update: (group, points) => { - maxSize = Math.max(maxSize, ...points.map(d => d.size)); - seriesClassName = `${qualifiedClassName[0]}`; - this.constructor.drawFn()({ - layer: this, - container: group.node(), - points, - interpolate: config.interpolate, - className: seriesClassName, - transition, - keyFn: v => getMarkId(v.source, schema) - }); - } - }, data => data[0].rowId); - this._maxSize = Math.sqrt(maxSize / Math.PI) * 2; - attachDataToVoronoi(this._voronoi, this._points); - return this; - } - - generateDataPoints (normalizedData, keys) { - const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys); - const offsetXValues = widthMetrics.offsetValues || []; - const offsetYValues = heightMetrics.offsetValues || []; - return normalizedData.map((dataArr, i) => { - const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span, - heightMetrics.span); - return this.translatePoints(dataArr, measurementConf); - }).filter(d => d.length); - } - - getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) { - return { - offset: { - x: (offsetX || 0) + widthSpan / 2, - y: (offsetY || 0) + heightSpan / 2 - }, - span: { - x: widthSpan, - y: heightSpan - } - }; - } - - /** - * Gets the nearest point from a position. - * @param {number} x x position - * @param {number} y y position - * @return {Object} Point details - */ - getNearestPoint (x, y) { - const distanceLimit = Math.max(this._maxSize, this.config().nearestPointThreshold); - - if (!this.data()) { - return null; - } - - const point = this._voronoi.find(x, y, distanceLimit); - const dimensions = point && point.data.data.update; - const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0; - - if (point) { - const { source, rowId } = point.data.data; - const identifiers = this.getIdentifiersFromData(source, rowId); - return { - id: identifiers, - dimensions: [{ - x: dimensions.x, - y: dimensions.y, - width: radius, - height: radius - }], - layerId: this.id() - }; - } - return null; + return POINT_LAYER; } } diff --git a/packages/visual-layer/src/layers/point/renderer.js b/packages/visual-layer/src/layers/point/renderer.js index 3cf81928..52fdc326 100644 --- a/packages/visual-layer/src/layers/point/renderer.js +++ b/packages/visual-layer/src/layers/point/renderer.js @@ -4,7 +4,8 @@ import { selectElement, easeFns, objectIterator, - getSymbol + getSymbol, + setStyles } from 'muze-utils'; /** @@ -27,7 +28,7 @@ const checkPath = (str) => { * @param {*} elem */ const createShape = function (d, groupElement) { - const { shape, size, update } = d; + const { shape, size, update, style } = d; if (shape instanceof Promise) { shape.then((res) => { @@ -59,7 +60,8 @@ const createShape = function (d, groupElement) { } else { pathStr = getSymbol(shape).size(size)(update); } - makeElement(groupElement, 'path', data => [data]).attr('d', pathStr); + const pathEl = makeElement(groupElement, 'path', data => [data]).attr('d', pathStr); + setStyles(pathEl, style); } else { d.shape = 'circle'; createShape(d, groupElement); diff --git a/packages/visual-layer/src/layers/point/styles.scss b/packages/visual-layer/src/layers/point/styles.scss index 1ca88b46..bab8245e 100644 --- a/packages/visual-layer/src/layers/point/styles.scss +++ b/packages/visual-layer/src/layers/point/styles.scss @@ -2,24 +2,4 @@ .#{$prefix}layer-point { fill-opacity: 0.5; - stroke-opacity: 0.5; - fill: #086bb6;; - stroke: #086bb6;; -} - -.#{$prefix}layer-point-highlight { - stroke-width: 2px !important; - fill-opacity: 0; - stroke-opacity: 1; -} - -.#{$prefix}layer-point-fadeout { - fill-opacity: 0.3 !important; - fill: #7f7f7f !important; - stroke-opacity: 0.3 !important; - stroke: #7f7f7f !important; -} - -.#{$prefix}layer-point-selected { - fill: #000 !important; } \ No newline at end of file diff --git a/packages/visual-layer/src/layers/text/default-config.js b/packages/visual-layer/src/layers/text/default-config.js index 708722d2..73e41882 100644 --- a/packages/visual-layer/src/layers/text/default-config.js +++ b/packages/visual-layer/src/layers/text/default-config.js @@ -1,3 +1,4 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { @@ -8,19 +9,29 @@ export const defaultConfig = { type: 'identity' }, interaction: { - highlight: [{ - type: 'fill', - intensity: [0, 0, -15, 0] - }], - fade: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }], - focus: [{ - type: 'fill', - intensity: [0, 0, +15, 0] - }] + highlight: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: -15 + }, data, apply).color + } + }, + fade: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: +15 + }, data, apply).color + } + }, + focus: { + style: { + fill: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: +15 + }, data, apply).color + } + } }, + crossline: false, transition: { effect: 'cubic', duration: 1000 diff --git a/packages/visual-layer/src/layers/text/index.js b/packages/visual-layer/src/layers/text/index.js index 72b10388..8a8fbbba 100644 --- a/packages/visual-layer/src/layers/text/index.js +++ b/packages/visual-layer/src/layers/text/index.js @@ -1,2 +1,2 @@ export { default as TextLayer } from './text'; - +export { TextLayerMixin } from './text-mixin'; diff --git a/packages/visual-layer/src/layers/text/text-mixin.js b/packages/visual-layer/src/layers/text/text-mixin.js new file mode 100644 index 00000000..9b57a2c9 --- /dev/null +++ b/packages/visual-layer/src/layers/text/text-mixin.js @@ -0,0 +1,256 @@ +import { + getQualifiedClassName, + selectElement, + setStyles, + createElements +} from 'muze-utils'; +import drawText from './renderer'; +import { defaultConfig } from './default-config'; +import { + positionPoints, + getIndividualClassName, + resolveEncodingValues, + getColorMetaInf, + toCartesianCoordinates, + getDataFromEvent +} from '../../helpers'; +import { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants'; + +import './styles.scss'; + +const defaultEncoding = defaultConfig.encoding; +const alignmentBaseLine = defaultEncoding['alignment-baseline'].value; +const defRotation = defaultEncoding.rotation.value; + +const pointTranslators = { + polar: (data, config, layerInst) => { + let points = []; + const axes = layerInst.axes(); + const encoding = layerInst.config().encoding; + const textEncoding = encoding.text; + const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes; + const { formatter: textFormatter } = textEncoding; + const backgroundEncoding = encoding.text.background; + const backgroundPadding = backgroundEncoding.padding; + const backgroundValue = backgroundEncoding.value; + const angleV = {}; + for (let i = 0, len = data.length; i < len; i++) { + const d = data[i]; + const source = d.source; + const text = d.text; + + const color = colorAxis.getColor(d.color); + const radius = radiusAxis.getOuterRadius(d.radius); + const angles = angleAxis.getScaleValue(d.angle); + !angleV[d.angle] && (angleV[d.angle] = 0); + const { startAngle, endAngle } = angles[angleV[d.angle]++]; + + const angle = (startAngle + endAngle) / 2; + const resolvedVal = resolveEncodingValues({ + values: { + angle, + radius, + color, + text, + startAngle, + endAngle, + rotation: defRotation, + 'alignment-baseline': alignmentBaseLine + }, + data: d + }, i, data, layerInst); + const point = { + enter: {}, + update: { + angle: resolvedVal.angle, + radius: resolvedVal.radius + }, + text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text, + color: resolvedVal.color, + rotation: resolvedVal.rotation, + background: { + value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null, + padding: backgroundPadding + }, + 'alignment-baseline': resolvedVal['alignment-baseline'], + meta: { ...{ layerId: layerInst.id() }, + ...getColorMetaInf({ + fill: resolvedVal.color + }) }, + style: {}, + source, + rowId: d.rowId + }; + + point.className = getIndividualClassName(d, i, data, layerInst); + points.push(point); + } + + points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement()); + + points = points.filter((d) => { + const update = d.update; + return !isNaN(update.x) && !isNaN(update.y); + }); + return points; + }, + cartesian: (data, config, layerInst) => { + let points = []; + const axes = layerInst.axes(); + const colorAxis = axes.color; + const encoding = layerInst.config().encoding; + const textEncoding = encoding.text; + const { field: textField, value, formatter: textFormatter } = textEncoding; + const fieldsConfig = layerInst.data().getFieldsConfig(); + + const backgroundEncoding = encoding.text.background; + const backgroundPadding = backgroundEncoding.padding; + const backgroundValue = backgroundEncoding.value; + const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1; + const xEnc = ENCODING.X; + const yEnc = ENCODING.Y; + for (let i = 0, len = data.length; i < len; i++) { + const d = data[i]; + const row = d.source; + const textValue = textField ? row[textFieldIndex] : value; + + const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) + + axes[type].getUnitWidth() / 2 : 0)); + + const color = colorAxis.getColor(d.color, colorAxis); + const resolvedEncodings = resolveEncodingValues({ + values: { + x: xPx, + y: yPx, + text: textValue, + color, + rotation: defRotation, + 'alignment-baseline': alignmentBaseLine + }, + data: d + }, i, data, layerInst); + const point = { + enter: {}, + update: { + x: resolvedEncodings.x, + y: resolvedEncodings.y + }, + text: textFormatter(resolvedEncodings.text, i, data, layerInst), + color: resolvedEncodings.color, + background: { + value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null, + padding: backgroundPadding + }, + 'alignment-baseline': resolvedEncodings['alignment-baseline'], + rotation: resolvedEncodings.rotation, + meta: { ...{ layerId: layerInst.id() }, + ...getColorMetaInf({ + fill: resolvedEncodings.color + }) }, + style: {}, + source: d.source, + rowId: d.rowId + }; + + point.className = getIndividualClassName(d, i, data, layerInst); + points.push(point); + } + + points = positionPoints(layerInst, points); + points = points.filter((d) => { + const update = d.update; + return !isNaN(update.x) && !isNaN(update.y); + }); + return points; + } +}; + +/** + * This layer is used to create labels for each data point. It has an encoding property ```text``` + * which determines from which field's data the value of the label will be taken. The text encoding + * property is necessary for the layer to render the text.The mark type of this layer is ```text```. + * + * @public + * + * @class + * @module TextLayer + * @extends BaseLayer + */ +export const TextLayerMixin = superclass => class extends superclass { + /** + * Returns the default configuration of the text layer + * @return {Object} Default configuration of the text layer + */ + static defaultConfig () { + return defaultConfig; + } + + static formalName () { + return 'text'; + } + + elemType () { + return 'text'; + } + + getPointTranslator (val) { + return pointTranslators[val]; + } + + /** + * Generates an array of objects containing x, y, width and height of the points from the data + * @param {Array.} data Data Array + * @param {Object} encoding Config + * @param {Object} axes Axes object + * @return {Array.} Array of points + */ + translatePoints (data, config = {}) { + return pointTranslators[this.coord()](data, config, this); + } + + /** + * Renders the plot in the given container + * @param {SVGElement} container SVGElement which will hold the plot + * @return {textLayer} Instance of text layer + */ + render (container) { + const config = this.config(); + const normalizedData = this._normalizedData; + const className = config.className; + const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix); + const containerSelection = selectElement(container); + + containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true); + this._graphicElems = {}; + + createElements({ + data: normalizedData, + append: 'g', + selector: 'g', + container, + each: (dataArr, group) => { + const node = group.node(); + const points = this.translatePoints(dataArr, {}, this); + setStyles(node, { + 'text-anchor': TEXT_ANCHOR_MIDDLE + }); + drawText(node, points, { + className: qualifiedClassName[0] + }, this); + } + }); + return this; + } + + getNearestPoint (x, y, { event }) { + if (!this.data()) { + return null; + } + return this.getDataFromEvent(event); + } + + getDataFromEvent (event) { + return getDataFromEvent(this, event); + } +}; + diff --git a/packages/visual-layer/src/layers/text/text.js b/packages/visual-layer/src/layers/text/text.js index c0cdf97c..13a44788 100644 --- a/packages/visual-layer/src/layers/text/text.js +++ b/packages/visual-layer/src/layers/text/text.js @@ -1,162 +1,8 @@ import { - getQualifiedClassName, - selectElement, - setStyles, - createElements + mix } from 'muze-utils'; -import { BaseLayer } from '../../base-layer'; -import drawText from './renderer'; -import { defaultConfig } from './default-config'; -import { positionPoints, getIndividualClassName, resolveEncodingValues, getColorMetaInf, toCartesianCoordinates } - from '../../helpers'; -import { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants'; - -import './styles.scss'; - -const defaultEncoding = defaultConfig.encoding; -const alignmentBaseLine = defaultEncoding['alignment-baseline'].value; -const defRotation = defaultEncoding.rotation.value; - -const pointTranslators = { - polar: (data, config, layerInst) => { - let points = []; - const axes = layerInst.axes(); - const encoding = layerInst.config().encoding; - const textEncoding = encoding.text; - const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes; - const { formatter: textFormatter } = textEncoding; - const backgroundEncoding = encoding.text.background; - const backgroundPadding = backgroundEncoding.padding; - const backgroundValue = backgroundEncoding.value; - const angleV = {}; - for (let i = 0, len = data.length; i < len; i++) { - const d = data[i]; - const source = d.source; - const text = d.text; - - const color = colorAxis.getColor(d.color); - const radius = radiusAxis.getOuterRadius(d.radius); - const angles = angleAxis.getScaleValue(d.angle); - !angleV[d.angle] && (angleV[d.angle] = 0); - const { startAngle, endAngle } = angles[angleV[d.angle]++]; - - const angle = (startAngle + endAngle) / 2; - const resolvedVal = resolveEncodingValues({ - values: { - angle, - radius, - color, - text, - startAngle, - endAngle, - rotation: defRotation, - 'alignment-baseline': alignmentBaseLine - }, - data: d - }, i, data, layerInst); - const point = { - enter: {}, - update: { - angle: resolvedVal.angle, - radius: resolvedVal.radius - }, - text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text, - color: resolvedVal.color, - rotation: resolvedVal.rotation, - background: { - value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null, - padding: backgroundPadding - }, - 'alignment-baseline': resolvedVal['alignment-baseline'], - meta: getColorMetaInf({ - fill: resolvedVal.color - }, colorAxis), - style: {}, - source, - rowId: d.rowId - }; - - point.className = getIndividualClassName(d, i, data, layerInst); - points.push(point); - } - - points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement()); - - points = points.filter((d) => { - const update = d.update; - return !isNaN(update.x) && !isNaN(update.y); - }); - return points; - }, - cartesian: (data, config, layerInst) => { - let points = []; - const axes = layerInst.axes(); - const colorAxis = axes.color; - const encoding = layerInst.config().encoding; - const textEncoding = encoding.text; - const { field: textField, value, formatter: textFormatter } = textEncoding; - const fieldsConfig = layerInst.data().getFieldsConfig(); - - const backgroundEncoding = encoding.text.background; - const backgroundPadding = backgroundEncoding.padding; - const backgroundValue = backgroundEncoding.value; - const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1; - const xEnc = ENCODING.X; - const yEnc = ENCODING.Y; - for (let i = 0, len = data.length; i < len; i++) { - const d = data[i]; - const row = d.source; - const textValue = textField ? row[textFieldIndex] : value; - - const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) + - axes[type].getUnitWidth() / 2 : 0)); - - const color = colorAxis.getColor(d.color, colorAxis); - const resolvedEncodings = resolveEncodingValues({ - values: { - x: xPx, - y: yPx, - text: textValue, - color, - rotation: defRotation, - 'alignment-baseline': alignmentBaseLine - }, - data: d - }, i, data, layerInst); - const point = { - enter: {}, - update: { - x: resolvedEncodings.x, - y: resolvedEncodings.y - }, - text: textFormatter(resolvedEncodings.text, i, data, layerInst), - color: resolvedEncodings.color, - background: { - value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null, - padding: backgroundPadding - }, - 'alignment-baseline': resolvedEncodings['alignment-baseline'], - rotation: resolvedEncodings.rotation, - meta: getColorMetaInf({ - fill: resolvedEncodings.color - }, colorAxis), - style: {}, - source: d.source, - rowId: d.rowId - }; - - point.className = getIndividualClassName(d, i, data, layerInst); - points.push(point); - } - - points = positionPoints(layerInst, points); - points = points.filter((d) => { - const update = d.update; - return !isNaN(update.x) && !isNaN(update.y); - }); - return points; - } -}; +import { BaseLayer, BaseLayerMixin } from '../../base-layer'; +import { TextLayerMixin } from './text-mixin'; /** * This layer is used to create labels for each data point. It has an encoding property ```text``` @@ -169,69 +15,8 @@ const pointTranslators = { * @module TextLayer * @extends BaseLayer */ -export default class TextLayer extends BaseLayer { - /** - * Returns the default configuration of the text layer - * @return {Object} Default configuration of the text layer - */ - static defaultConfig () { - return defaultConfig; - } - +export default class TextLayer extends mix(BaseLayer).with(BaseLayerMixin, TextLayerMixin) { static formalName () { return 'text'; } - - elemType () { - return 'text'; - } - - getPointTranslator (val) { - return pointTranslators[val]; - } - - /** - * Generates an array of objects containing x, y, width and height of the points from the data - * @param {Array.} data Data Array - * @param {Object} encoding Config - * @param {Object} axes Axes object - * @return {Array.} Array of points - */ - translatePoints (data, config = {}) { - return pointTranslators[this.coord()](data, config, this); - } - - /** - * Renders the plot in the given container - * @param {SVGElement} container SVGElement which will hold the plot - * @return {textLayer} Instance of text layer - */ - render (container) { - const config = this.config(); - const normalizedData = this._normalizedData; - const className = config.className; - const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix); - const containerSelection = selectElement(container); - - containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true); - this._graphicElems = {}; - - createElements({ - data: normalizedData, - append: 'g', - selector: 'g', - container, - each: (dataArr, group) => { - const node = group.node(); - const points = this.translatePoints(dataArr, {}, this); - setStyles(node, { - 'text-anchor': TEXT_ANCHOR_MIDDLE - }); - drawText(node, points, { - className: qualifiedClassName[0] - }, this); - } - }); - return this; - } } diff --git a/packages/visual-layer/src/layers/tick/default-config.js b/packages/visual-layer/src/layers/tick/default-config.js index 3020eeeb..507e7b95 100644 --- a/packages/visual-layer/src/layers/tick/default-config.js +++ b/packages/visual-layer/src/layers/tick/default-config.js @@ -1,22 +1,26 @@ +import { transformColor } from 'muze-utils'; import { CLASSPREFIX } from '../../enums/constants'; export const defaultConfig = { defClassName: 'layer-tick', className: '', classPrefix: CLASSPREFIX, + nearestPointThreshold: 10, interaction: { - highlight: [{ - type: 'stroke', - intensity: [0, 0, -15, 0] - }], - fade: [{ - type: 'stroke', - intensity: [0, 0, 15, 0] - }], - focus: [{ - type: 'stroke', - intensity: [0, 0, 15, 0] - }] + fade: { + style: { + stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: +15 + }, data, apply).color + } + }, + focus: { + style: { + stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, { + l: +15 + }, data, apply).color + } + } }, innerPadding: 0.1, transform: { diff --git a/packages/visual-layer/src/layers/tick/helper.js b/packages/visual-layer/src/layers/tick/helper.js new file mode 100644 index 00000000..f9fbd966 --- /dev/null +++ b/packages/visual-layer/src/layers/tick/helper.js @@ -0,0 +1,18 @@ +export const strokeWidthPositionMap = ({ width, position = 'center' }) => { + const offset = width ? width / 2 : 1; + const strokeWidthWithOffsetMap = { + center: { + M: { x: 0, y: 0 }, + L: { x: 0, y: 0 } + }, + inside: { + M: { x: +offset, y: +offset }, + L: { x: -offset, y: +offset } + }, + outside: { + M: { x: -offset, y: -offset }, + L: { x: +offset, y: -offset } + } + }; + return strokeWidthWithOffsetMap[position]; +}; diff --git a/packages/visual-layer/src/layers/tick/index.js b/packages/visual-layer/src/layers/tick/index.js index 424aae7b..a0d8ed63 100644 --- a/packages/visual-layer/src/layers/tick/index.js +++ b/packages/visual-layer/src/layers/tick/index.js @@ -1 +1,2 @@ export { default as TickLayer } from './tick'; +export { TickLayerMixin } from './tick-mixin'; diff --git a/packages/visual-layer/src/layers/tick/renderer.js b/packages/visual-layer/src/layers/tick/renderer.js index 19bd8fb9..ec1a1ac0 100644 --- a/packages/visual-layer/src/layers/tick/renderer.js +++ b/packages/visual-layer/src/layers/tick/renderer.js @@ -1,4 +1,9 @@ -import { selectElement, Symbols, pathInterpolators } from 'muze-utils'; +import { + selectElement, + Symbols, + pathInterpolators, + makeElement +} from 'muze-utils'; const line = Symbols.line; @@ -8,35 +13,44 @@ const line = Symbols.line; * @return {Selection} Ticks Selection */ export default /* istanbul ignore next */ (params) => { - const { points, container, keyFn, className, interpolate, layer } = params; + const { points, container, keyFn, className, interpolate, layer, transition } = params; + const { disabled } = transition; + const mount = selectElement(container); - const ticks = mount.selectAll('path').data(points, keyFn); - const ticksEnter = ticks.enter().append('path'); const graphicElems = layer._graphicElems; - mount.attr('class', className || ''); - ticksEnter.each(function (d) { - const selection = selectElement(this); - const enter = d.enter || {}; - Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1]))); - }); + mount.attr('class', className); - ticks.exit().remove(); - return ticks.merge(ticksEnter) - .each(function (d) { - const selection = selectElement(this); - graphicElems[d.rowId] = selection; - const update = d.update; - const updateStyle = d.style || {}; - const x0 = update.x0 !== undefined ? update.x0 : update.x; - const y0 = update.y0 !== undefined ? update.y0 : update.y; - const curveInterpolatorFn = pathInterpolators[interpolate]; - const linepath = line() - .curve(curveInterpolatorFn) - .x(e => e[0]) - .y(e => e[1]); - d.className && selection.classed(d.className, true); - selection.attr('d', linepath([[update.x, update.y], [x0, y0]])); - Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1])); - }); -}; + return makeElement(mount, 'g', points, null, { + enter: (group, d) => { + const enter = d.enter || {}; + Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && group.attr(attr[0], attr[1]))); + }, + update: (group, d) => { + const pathElem = makeElement(group, 'path', [1]); + graphicElems[d.rowId] = group; + const { update, style } = d; + group.attr('class', className); + group.classed(d.className, true); + const x0 = update.x0 !== undefined ? update.x0 : update.x; + const y0 = update.y0 !== undefined ? update.y0 : update.y; + const curveInterpolatorFn = pathInterpolators[interpolate]; + const linepath = line() + .curve(curveInterpolatorFn) + .x(e => e[0]) + .y(e => e[1]); + + d.className && group.classed(d.className, true); + pathElem.attr('d', linepath([[update.x, update.y], [x0, y0]])); + if (!disabled) { + group = group.transition() + .duration(transition.duration) + .on('end', layer.registerAnimationDoneHook()); + } + Object.entries(style).forEach(styleObj => group.style(styleObj[0], styleObj[1])); + }, + exit: (exitGroup) => { + exitGroup.remove(); + } + }, keyFn); +}; diff --git a/packages/visual-layer/src/layers/tick/tick-mixin.js b/packages/visual-layer/src/layers/tick/tick-mixin.js new file mode 100644 index 00000000..ceb7607d --- /dev/null +++ b/packages/visual-layer/src/layers/tick/tick-mixin.js @@ -0,0 +1,285 @@ +import { FieldType, makeElement, appendElement } from 'muze-utils'; +import { defaultConfig } from './default-config'; +import { ENCODING } from '../../enums/constants'; +import drawTicks from './renderer'; +import './styles.scss'; +import { positionPoints, getIndividualClassName, + getColorMetaInf, resolveEncodingValues, toCartesianCoordinates, attachDataToVoronoi } from '../../helpers'; +import { strokeWidthPositionMap } from './helper'; + +const pointTranslators = { + polar: (data, config = {}, layerInst) => { + const axes = layerInst.axes(); + let points = []; + const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes; + const measurement = layerInst.measurement(); + + const colorAxis = axes.color; + const angleV = {}; + const angle0V = {}; + for (let i = 0, len = data.length; i < len; i++) { + const d = data[i]; + const color = colorAxis.getColor(d.color); + const angles = angleAxis.getScaleValue(d.angle); + !angleV[d.angle] && (angleV[d.angle] = 0); + const { startAngle, endAngle } = angles[angleV[d.angle]++]; + const angles0 = angle0Axis.getScaleValue(d.angle0); + !angle0V[d.angle0] && (angle0V[d.angle0] = 0); + const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++]; + const radius = radiusAxis.getOuterRadius(d.radius); + const angle = (startAngle + endAngle) / 2; + const angle0 = (startAngle0 + endAngle0) / 2; + const resolvedVal = resolveEncodingValues({ + values: { + radius, + radius0: radiusAxis.getInnerRadius(d.radius0), + color, + angle, + angle0, + startAngle, + endAngle, + startAngle0, + endAngle0 + }, + data: d + }, i, data, layerInst); + const style = { + stroke: resolvedVal.color + }; + + const point = { + enter: {}, + update: { + radius: resolvedVal.radius, + radius0: resolvedVal.radius0, + angle: resolvedVal.angle, + angle0: resolvedVal.angle0 + }, + style, + source: d.source, + rowId: d.rowId, + data: d, + meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) } + }; + point.className = getIndividualClassName(d, i, data, layerInst); + points.push(point); + } + points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true); + return points; + }, + cartesian: (data, config = {}, layerInst) => { + const axes = layerInst.axes(); + let points = []; + const { x: xAxis, y: yAxis } = axes; + const { + xField, + yField, + x0Field, + y0Field, + xFieldType, + yFieldType + } = layerInst.encodingFieldsInf(); + const isXDim = xFieldType === FieldType.DIMENSION; + const isYDim = yFieldType === FieldType.DIMENSION; + const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); + const measurement = layerInst.measurement(); + const colorAxis = axes.color; + const { x: offsetX, y: offsetY } = config.offset; + const { x: xSpan, y: ySpan } = config.span; + for (let i = 0, len = data.length; i < len; i++) { + let xPx; + let x0Px; + let y0Px; + let yPx; + const d = data[i]; + const row = d.source; + if (xField) { + xPx = xAxis.getScaleValue(d.x) + offsetX; + x0Px = xPx + xSpan; + } + + if (yField) { + yPx = yAxis.getScaleValue(d.y) + offsetY; + y0Px = yPx !== null ? yPx + ySpan : null; + } + + if (!xField) { + xPx = 0; + x0Px = measurement.width; + if (!isNaN(yPx)) { + yPx += ySpan / 2; + y0Px = yPx; + } + } + + if (!yField) { + yPx = 0; + y0Px = measurement.height; + x0Px = xPx += xSpan / 2; + } + + if (x0Field) { + x0Px = xAxis.getScaleValue(d.x0) + xSpan; + yPx += ySpan / 2; + y0Px -= ySpan / 2; + } + + if (y0Field) { + y0Px = yAxis.getScaleValue(d.y0) + ySpan; + xPx += xSpan / 2; + x0Px -= xSpan / 2; + } + const color = colorAxis.getColor(d.color); + const resolvedEncodings = resolveEncodingValues({ + values: { + x: xPx, + y: yPx, + x0: x0Px, + y0: y0Px, + color + }, + data: d + }, i, data, layerInst); + const style = { + stroke: resolvedEncodings.color + }; + + if (!isNaN(xPx) && !isNaN(yPx)) { + const point = { + enter: {}, + update: { + x: resolvedEncodings.x, + y: resolvedEncodings.y, + x0: resolvedEncodings.x0, + y0: resolvedEncodings.y0 + }, + style, + source: row, + rowId: d.rowId, + data: d.dataObj, + meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) } + }; + point.className = getIndividualClassName(d, i, data, layerInst); + points.push(point); + layerInst.cachePoint(d[key], point); + } + } + points = positionPoints(layerInst, points); + return points; + } +}; + +/** + * This layer is used to create small lines. The orientation of the line is determined by the positional + * encoding properties x0 and y0. The mark type of the layer is ```tick```. + * + * @public + * + * @class + * @module TickLayer + * @extends BaseLayer + */ +export const TickLayerMixin = superclass => class extends superclass { + static defaultConfig () { + return defaultConfig; + } + + static formalName () { + return 'tick'; + } + + static drawFn () { + return drawTicks; + } + + elemType () { + return 'path'; + } + + /** + * Generates an array of objects containing x, y, width and height of the points from the data + * @param {Array.} data Data Array + * @param {Object} encoding Config + * @param {Object} axes Axes object + * @return {Array.} Array of points + */ + translatePoints (data, config) { + return pointTranslators[this.coord()](data, config, this); + } + + attachDataToVoronoi (points) { + attachDataToVoronoi(this._voronoi, points, (d) => { + const { x, x0, y, y0 } = d.update; + + return { + x: x + (x0 - x) / 2, + y: y + (y0 - y) / 2 + }; + }); + } + + getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) { + return { + offset: { + x: (offsetX || 0), + y: (offsetY || 0) + }, + span: { + x: widthSpan, + y: heightSpan + } + }; + } + + addOverlayPath (refElement, data, style, strokePosition) { + let pathElement; + + if (this._overlayPath[data.rowId]) { + pathElement = this._overlayPath[data.rowId]; + } else { + pathElement = makeElement(refElement, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`); + pathElement.style('fill', 'none'); + pathElement.style('fill-opacity', 0); + pathElement.attr('id', data.rowId); + this._overlayPath[data.rowId] = pathElement; + } + + let offsetM = { x: 0, y: 0 }; + let offsetL = { x: 0, y: 0 }; + + if (style.type === 'stroke-width') { + const { L, M } = strokeWidthPositionMap({ + width: parseInt(style.value, 10), + position: strokePosition + }); + offsetM = M; + offsetL = L; + } + + pathElement.attr('d', (d) => { + if (d.update) { + return `M ${d.update.x + offsetM.x} ${d.update.y + offsetM.y} + L ${d.update.x0 + offsetL.x} ${d.update.y0 + offsetL.y}`; + } + return `M ${d.x + offsetM.x} ${d.y + offsetM.y} + L ${d.x0 + offsetL.x} ${d.y0 + offsetL.y}`; + }); + + let styleVal = style.value; + if (typeof styleVal === 'function') { + const currentStyle = pathElement.style(style.type); + styleVal = styleVal(currentStyle); + } + pathElement.style(style.type, styleVal); + appendElement(refElement, pathElement.node()); + } + + removeOverlayPath (data, style) { + const currentPath = this._overlayPath[data.rowId]; + if (currentPath) { + currentPath.node().removeAttribute('style'); + Object.keys(style).forEach(s => currentPath.style(s, style[s])); + currentPath.style('fill-opacity', 0); + } + } +}; diff --git a/packages/visual-layer/src/layers/tick/tick.js b/packages/visual-layer/src/layers/tick/tick.js index 05fe6f96..bb917fcc 100644 --- a/packages/visual-layer/src/layers/tick/tick.js +++ b/packages/visual-layer/src/layers/tick/tick.js @@ -1,174 +1,7 @@ -import { FieldType } from 'muze-utils'; -import { PointLayer } from '../point'; -import { defaultConfig } from './default-config'; -import { ENCODING } from '../../enums/constants'; -import drawTicks from './renderer'; -import './styles.scss'; -import { getAxesScales, positionPoints, getIndividualClassName, - getColorMetaInf, resolveEncodingValues, toCartesianCoordinates } from '../../helpers'; - -const pointTranslators = { - polar: (data, config = {}, layerInst) => { - const axes = layerInst.axes(); - let points = []; - const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes; - const measurement = layerInst.measurement(); - - const colorAxis = axes.color; - const angleV = {}; - const angle0V = {}; - for (let i = 0, len = data.length; i < len; i++) { - const d = data[i]; - const color = colorAxis.getColor(d.color); - const angles = angleAxis.getScaleValue(d.angle); - !angleV[d.angle] && (angleV[d.angle] = 0); - const { startAngle, endAngle } = angles[angleV[d.angle]++]; - const angles0 = angle0Axis.getScaleValue(d.angle0); - !angle0V[d.angle0] && (angle0V[d.angle0] = 0); - const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++]; - const radius = radiusAxis.getOuterRadius(d.radius); - const angle = (startAngle + endAngle) / 2; - const angle0 = (startAngle0 + endAngle0) / 2; - const resolvedVal = resolveEncodingValues({ - values: { - radius, - radius0: radiusAxis.getInnerRadius(d.radius0), - color, - angle, - angle0, - startAngle, - endAngle, - startAngle0, - endAngle0 - }, - data: d - }, i, data, layerInst); - const style = { - stroke: resolvedVal.color - }; - - const point = { - enter: {}, - update: { - radius: resolvedVal.radius, - radius0: resolvedVal.radius0, - angle: resolvedVal.angle, - angle0: resolvedVal.angle0 - }, - style, - source: d.source, - rowId: d.rowId, - meta: getColorMetaInf(style, colorAxis) - }; - point.className = getIndividualClassName(d, i, data, layerInst); - points.push(point); - } - points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true); - return points; - }, - cartesian: (data, config = {}, layerInst) => { - const axes = layerInst.axes(); - let points = []; - const { - xAxis, - yAxis - } = getAxesScales(axes); - const { - xField, - yField, - x0Field, - y0Field, - xFieldType, - yFieldType - } = layerInst.encodingFieldsInf(); - const isXDim = xFieldType === FieldType.DIMENSION; - const isYDim = yFieldType === FieldType.DIMENSION; - const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null); - const measurement = layerInst.measurement(); - const colorAxis = axes.color; - const { x: offsetX, y: offsetY } = config.offset; - const { x: xSpan, y: ySpan } = config.span; - for (let i = 0, len = data.length; i < len; i++) { - let xPx; - let x0Px; - let y0Px; - let yPx; - const d = data[i]; - const row = d.source; - if (xField) { - xPx = xAxis.getScaleValue(d.x) + offsetX; - x0Px = xPx + xSpan; - } - - if (yField) { - yPx = yAxis.getScaleValue(d.y) + offsetY; - y0Px = yPx !== null ? yPx + ySpan : null; - } - - if (!xField) { - xPx = 0; - x0Px = measurement.width; - if (!isNaN(yPx)) { - yPx += ySpan / 2; - y0Px = yPx; - } - } - - if (!yField) { - yPx = 0; - y0Px = measurement.height; - x0Px = xPx += xSpan / 2; - } - - if (x0Field) { - x0Px = xAxis.getScaleValue(d.x0) + xSpan; - yPx += ySpan / 2; - y0Px -= ySpan / 2; - } - - if (y0Field) { - y0Px = yAxis.getScaleValue(d.y0) + ySpan; - xPx += xSpan / 2; - x0Px -= xSpan / 2; - } - const color = colorAxis.getColor(d.color); - const resolvedEncodings = resolveEncodingValues({ - values: { - x: xPx, - y: yPx, - x0: x0Px, - y0: y0Px, - color - }, - data: d - }, i, data, layerInst); - const style = { - stroke: resolvedEncodings.color - }; - - if (!isNaN(xPx) && !isNaN(yPx)) { - const point = { - enter: {}, - update: { - x: resolvedEncodings.x, - y: resolvedEncodings.y, - x0: resolvedEncodings.x0, - y0: resolvedEncodings.y0 - }, - style, - source: row, - rowId: d.rowId, - meta: getColorMetaInf(style, colorAxis) - }; - point.className = getIndividualClassName(d, i, data, layerInst); - points.push(point); - layerInst.cachePoint(d[key], point); - } - } - points = positionPoints(layerInst, points); - return points; - } -}; +import { mix } from 'muze-utils'; +import { PointLayerMixin } from '../point'; +import { BaseLayerMixin, BaseLayer } from '../../base-layer'; +import { TickLayerMixin } from './tick-mixin'; /** * This layer is used to create small lines. The orientation of the line is determined by the positional @@ -180,72 +13,8 @@ const pointTranslators = { * @module TickLayer * @extends BaseLayer */ -export default class TickLayer extends PointLayer { - - /** - * - * - * @staticg - * - * @memberof TickLayer - */ - static defaultConfig () { - return defaultConfig; - } - - /** - * - * - * @static - * - * @memberof TickLayer - */ +export default class TickLayer extends mix(BaseLayer).with(BaseLayerMixin, PointLayerMixin, TickLayerMixin) { static formalName () { return 'tick'; } - - /** - * - * - * @static - * - * @memberof TickLayer - */ - static drawFn () { - return drawTicks; - } - - /** - * - * - * - * @memberof TickLayer - */ - elemType () { - return 'path'; - } - - /** - * Generates an array of objects containing x, y, width and height of the points from the data - * @param {Array.} data Data Array - * @param {Object} encoding Config - * @param {Object} axes Axes object - * @return {Array.} Array of points - */ - translatePoints (data, config) { - return pointTranslators[this.coord()](data, config, this); - } - - getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) { - return { - offset: { - x: (offsetX || 0), - y: (offsetY || 0) - }, - span: { - x: widthSpan, - y: heightSpan - } - }; - } } diff --git a/packages/visual-unit/src/enums/behaviours.js b/packages/visual-unit/src/enums/behaviours.js index bb658f34..e96bf8fb 100644 --- a/packages/visual-unit/src/enums/behaviours.js +++ b/packages/visual-unit/src/enums/behaviours.js @@ -2,4 +2,5 @@ export const BRUSH = 'brush'; export const HIGHLIGHT = 'highlight'; export const TOOLTIP = 'tooltip'; export const FILTER = 'filter'; +export const PSEUDO_SELECT = 'pseudoSelect'; diff --git a/packages/visual-unit/src/enums/index.js b/packages/visual-unit/src/enums/index.js new file mode 100644 index 00000000..7ea1a93e --- /dev/null +++ b/packages/visual-unit/src/enums/index.js @@ -0,0 +1,4 @@ +import * as REACTIVE_PROPS from './reactive-props'; +import * as CONSTANTS from './constants'; + +export { REACTIVE_PROPS, CONSTANTS }; diff --git a/packages/visual-unit/src/firebolt/behaviours/brush.js b/packages/visual-unit/src/firebolt/behaviours/brush.js new file mode 100644 index 00000000..3fb26f50 --- /dev/null +++ b/packages/visual-unit/src/firebolt/behaviours/brush.js @@ -0,0 +1,18 @@ +import { VolatileBehaviour } from '@chartshq/muze-firebolt'; +import { BRUSH } from '../../enums/behaviours'; +/** + * This is the behaviour for brushing a region on the chart. It accepts a payload + * which contains the x and y range of the data and other configuration. It will then + * create a selection box from the range and select the points which fall within the range. + */ +export default class UnitBrushBehaviour extends VolatileBehaviour { + static formalName () { + return BRUSH; + } + + dispatch (...params) { + this.active = params[0].dragging; + this.start = params[0].dragStart; + return super.dispatch(...params); + } +} diff --git a/packages/visual-unit/src/firebolt/behaviours/pseudo-select.js b/packages/visual-unit/src/firebolt/behaviours/pseudo-select.js new file mode 100644 index 00000000..7b001429 --- /dev/null +++ b/packages/visual-unit/src/firebolt/behaviours/pseudo-select.js @@ -0,0 +1,9 @@ +import { VolatileBehaviour } from '@chartshq/muze-firebolt'; +import { PSEUDO_SELECT } from '../../enums/behaviours'; + +export default class PseudoSelectBehaviour extends VolatileBehaviour { + static formalName () { + return PSEUDO_SELECT; + } +} + diff --git a/packages/visual-unit/src/firebolt/data-propagator.js b/packages/visual-unit/src/firebolt/data-propagator.js index ea58a7ad..32eb516e 100644 --- a/packages/visual-unit/src/firebolt/data-propagator.js +++ b/packages/visual-unit/src/firebolt/data-propagator.js @@ -1,122 +1,139 @@ -import { isSimpleObject, FieldType, DataModel } from 'muze-utils'; - -const getModelWithFacetData = (dm, data) => { - const dataObj = dm.getData(); - const schema1 = dataObj.schema; - const data1 = dataObj.data; - const jsonData = []; - const derivedSchema = data[0].map(d => ({ - name: `${d}`, - type: FieldType.DIMENSION, - subtype: d.subtype() - })); - const dataAtFirstPos = data[1]; - - data1.forEach((d) => { - const tuple = {}; - schema1.forEach((obj, i) => { - tuple[obj.name] = d[i]; - }); - derivedSchema.forEach((obj, i) => { - tuple[obj.name] = dataAtFirstPos[i]; - }); - jsonData.push(tuple); - }); - - return new DataModel(jsonData, [...schema1, ...derivedSchema]); -}; - -export const propagateValues = (instance, action, config = {}) => { - let propagationData; - const payload = config.payload; - const selectionSet = config.selectionSet; - const propagationFieldInf = config.propagationFields[action] || {}; - const propagationFields = propagationFieldInf.fields || []; - const append = propagationFieldInf.append; - const criteria = payload.criteria; - const context = instance.context; - const dataModel = context.cachedData()[0]; - const sourceId = context.id(); - const sideEfffects = instance.sideEffects(); - const behaviourEffectMap = instance._behaviourEffectMap; - const mergedModel = selectionSet.mergedEnter.model; - const fieldsConfig = dataModel.getFieldsConfig(); - payload.sourceUnit = sourceId; - payload.action = action; - payload.sourceCanvas = context.parentAlias(); - const propagationBehaviourMap = instance._propagationBehaviourMap; - const propagationBehaviour = propagationBehaviourMap[action] || action; - - let propFields = []; - if (criteria === null) { - propagationData = null; - } else if (isSimpleObject(criteria)) { - propFields = Object.keys(criteria || {}); - propagationData = mergedModel ? mergedModel.project(propFields) : null; - } else { - propFields = criteria[0]; - propagationData = mergedModel ? mergedModel.project(propFields) : null; - } - - const facetByFields = context.facetByFields(); - if (propagationData !== null && propagationFields.length) { - const fields = propagationData.getData().schema.map(d => d.name); - propagationData = getModelWithFacetData(propagationData, facetByFields); - propFields = append ? [...fields, ...propagationFields] : propagationFields; - propagationData = propagationData.project(propFields); - } - - let propagateInterpolatedValues = false; - if (propFields.length && propFields.every(field => fieldsConfig[field] && - fieldsConfig[field].def.type === FieldType.MEASURE)) { - propagateInterpolatedValues = true; - } - - const groupId = context.parentAlias(); - payload.action = action; - const behaviourInstance = instance._actions.behavioural[propagationBehaviour]; - const isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false; - - const filterFn = (entry, propagationConf) => { - const effects = behaviourEffectMap[entry.config.action]; - const mutates = entry.config.groupId ? - effects.some(d => sideEfffects[d.name || d].constructor.mutates()) : true; - return entry.config.groupId !== propagationConf.groupId && mutates; - }; - - const sourceBehaviour = instance._actions.behavioural[action]; - const mutates = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false; - let propConfig = { - payload, - action, - criteria: propagationData, - isMutableAction: mutates, - propagateInterpolatedValues, - groupId, - sourceId: mutates ? groupId : sourceId, - filterFn, - enabled: (propConf, firebolt) => (action !== propagationBehaviour ? - propConf.payload.sourceCanvas === firebolt.context.parentAlias() : true) - }; - - dataModel.propagate(propagationData, propConfig, true); - - if (action !== propagationBehaviour) { - propConfig = { - payload, - sourceId: isMutableAction ? groupId : sourceId, - criteria: propagationData, - isMutableAction, - propagateInterpolatedValues, - action: propagationBehaviour, - groupId, - applyOnSource: action === propagationBehaviour, - enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.context.parentAlias(), - filterFn - }; - - dataModel.propagate(propagationData, propConfig, true, { - filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId - }); - } -}; +// import { isSimpleObject, FieldType } from 'muze-utils'; + +// export const addFacetData = ({ identifiers: data }, facetData, propFields, dm) => { +// const facets = Object.keys(facetData); +// const facetVals = Object.values(facetData); +// const facetLen = facets.length; +// if (isSimpleObject(data)) { +// return Object.assign({}, Object.keys(facetData).reduce((acc, v) => { +// acc[v] = [facetData[v]]; +// return acc; +// }, {}), data); +// } +// const fieldsWithFacets = data[0].length ? [...facets.map(d => ({ name: d, type: FieldType.DIMENSION })), +// ...data[0].map((d, i) => ({ +// name: d, +// index: i + facetLen +// }))] : []; + +// const fieldIndexMap = fieldsWithFacets.reduce((acc, v, i) => { +// acc[v.name] = i; +// return acc; +// }, {}); +// propFields = propFields || fieldsWithFacets.map(d => d.name); +// const dataWithFacets = [ +// propFields +// ]; +// const fieldsConfig = dm.getFieldsConfig(); +// const propDims = fieldsWithFacets.filter(d => d.name in fieldsConfig).map(d => d.name); + +// const dimsMap = dm.getData().data.reduce((acc, row) => { +// const key = propDims.map(d => row[fieldsConfig[d].index]); +// acc[key] || (acc[key] = []); +// acc[key].push(row); +// return acc; +// }, {}); + +// for (let i = 1, len = data.length; i < len; i++) { +// const row = [...facetVals, ...data[i]]; +// const newRow = []; +// const dimKey = propDims.map(field => row[fieldIndexMap[field]]); +// const origRow = dimsMap[dimKey]; +// if (origRow) { +// origRow.forEach((rowVal) => { +// const newRowVal = []; +// propFields.forEach((field) => { +// if (field in fieldIndexMap) { +// const idx = fieldIndexMap[field]; +// newRowVal.push(row[idx]); +// } else { +// const idx = fieldsConfig[field].index; +// newRowVal.push(rowVal[idx]); +// } +// }); + +// dataWithFacets.push(newRowVal); +// }); +// } else { +// propFields.forEach((field) => { +// if (field in fieldIndexMap) { +// const idx = fieldIndexMap[field]; +// newRow.push(row[idx]); +// } +// }); +// dataWithFacets.push(newRow); +// } +// } +// return dataWithFacets; +// }; + +// export const propagateValues = (instance, action, config = {}) => { +// let propFields = []; +// const { payload, identifiers, propagationFields } = config; +// const { fields: propagationFieldNames = [], append } = propagationFields[action] || {}; +// const context = instance.context; +// const dataModel = context.cachedData()[0]; +// const sourceId = context.id(); +// const sideEfffects = instance.sideEffects(); +// const behaviourEffectMap = instance._behaviourEffectMap; +// const propagationBehaviourMap = instance._propagationBehaviourMap; +// const propagationBehaviour = propagationBehaviourMap[action] || action; +// const facetByFields = context.facetByFields(); + +// payload.sourceUnit = sourceId; +// payload.action = action; +// payload.sourceCanvas = context.parentAlias(); + +// if (identifiers !== null) { +// propFields = identifiers.fields; + +// if (propagationFieldNames.length) { +// const fields = identifiers.fields; +// propFields = append ? [...fields.map(d => d.name), ...propagationFieldNames] : propagationFieldNames; +// Object.assign(identifiers, { +// identifiers: addFacetData(identifiers, facetByFields, propFields) +// }); +// } +// } + +// const groupId = context.parentAlias(); + +// const filterFn = (entry, propagationConf) => { +// const effects = behaviourEffectMap[entry.config.action]; +// const mutates = entry.config.groupId ? +// (effects ? effects.some(d => sideEfffects[d.name || d].constructor.mutates()) : false) : true; +// return entry.config.groupId !== propagationConf.groupId && mutates; +// }; + +// const sourceBehaviour = instance._actions.behavioural[action]; +// let isMutableAction = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false; +// const propConfig = { +// payload, +// action, +// criteria: identifiers, +// isMutableAction, +// groupId, +// sourceId: config.sourceId, +// filterFn, +// enabled: (propConf, firebolt) => (action !== propagationBehaviour ? +// propConf.payload.sourceCanvas === firebolt.context.parentAlias() : true) +// }; + +// dataModel.propagate(identifiers, propConfig, true); + +// if (action !== propagationBehaviour) { +// const behaviourInstance = instance._actions.behavioural[propagationBehaviour]; +// isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false; + +// dataModel.propagate(identifiers, Object.assign({}, propConfig, { +// isMutableAction, +// applyOnSource: false, +// action: propagationBehaviour, +// sourceId: isMutableAction ? groupId : sourceId, +// enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.context.parentAlias() +// }), true, { +// filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId +// }); +// } +// }; + diff --git a/packages/visual-unit/src/firebolt/helper.js b/packages/visual-unit/src/firebolt/helper.js index 8787f044..96fb4a40 100644 --- a/packages/visual-unit/src/firebolt/helper.js +++ b/packages/visual-unit/src/firebolt/helper.js @@ -1,4 +1,5 @@ import { SpawnableSideEffect } from '@chartshq/muze-firebolt'; +import { FieldType, ReservedFields, defaultValue, isSimpleObject, getObjProp } from 'muze-utils'; export const initSideEffects = (sideEffects, firebolt) => { for (const key in sideEffects) { @@ -29,3 +30,172 @@ export const dispatchQueuedSideEffects = (context) => { }); context._queuedSideEffects = {}; }; + +export const isSideEffectEnabled = (firebolt, { se, propagationInf }) => { + const sideEffectPolicies = firebolt._sideEffectPolicies; + const sideEffectCheckers = Object.values(sideEffectPolicies[se.name || se] || {}); + const { sourceIdentifiers, data: propagationData } = propagationInf; + return sideEffectCheckers.length ? sideEffectCheckers.every(checker => + checker(propagationInf.propPayload, firebolt, { + sourceIdentifiers, + propagationData + })) : true; +}; + +const getUniqueKeys = (data, dimensions, { layers, uids, keys = {}, dimensionsMap = {} }) => { + data.forEach((row, i) => { + const key = dimensions.length ? dimensions.map(d => row[d.index]) : [uids[i]]; + + layers.forEach((layer) => { + const measureNames = Object.keys(layer.data().getFieldspace().getMeasure()); + const mKey = `${[key, ...measureNames]}`; + keys[mKey] = defaultValue(keys[mKey], {}); + keys[mKey] = { + dims: key, + measureNames, + uid: uids[i] + }; + dimensionsMap[key] = defaultValue(dimensionsMap[key], []); + dimensionsMap[key].push(measureNames); + }); + }); + + return { + keys, + dimensionsMap + }; +}; + +export const prepareSelectionSetMap = ({ data, uids, dimensions }, layers, maps = {}) => { + const obj = getUniqueKeys(data, dimensions, { + layers, + uids, + keys: maps.keys, + dimensionsMap: maps.dimensionsMap + }); + + return { + keys: obj.keys, + dimensionsMap: obj.dimensionsMap + }; +}; + +export const prepareSelectionSetData = (dataModel, unit) => { + const { data, uids } = dataModel.getData(); + const dimensions = Object.values(dataModel.getFieldsConfig()).filter(d => d.def.type === FieldType.DIMENSION); + const layers = unit.layers(); + const { keys, dimensionsMap } = prepareSelectionSetMap({ data, uids, dimensions }, layers); + const dimensionFields = dimensions.length ? dimensions.map(d => d.def.name) : [ReservedFields.ROW_ID]; + const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length; + const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : []; + + return { + keys, + dimensions: dimensionFields, + dimensionsMap, + allFields: [...dimensionFields, ...measureName] + }; +}; + +export const sanitizePayloadCriteria = (data, propFields, { dm, dimensionsMap, dimsMapGetter }) => { + const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), { + [ReservedFields.ROW_ID]: { + index: Object.keys(dm.getFieldsConfig()).length, + def: { + name: ReservedFields.ROW_ID, + type: FieldType.DIMENSION + } + } + }); + if (data === null) { + return null; + } + + if (isSimpleObject(data)) { + return Object.keys(data).reduce((acc, v) => { + if (v in fieldsConfig || v === ReservedFields.MEASURE_NAMES) { + acc[v] = data[v]; + } + return acc; + }, {}); + } + + const criteriaFields = data[0]; + const fields = criteriaFields.length ? criteriaFields.map((d, i) => ({ + name: d, + index: i + })) : []; + + const fieldIndexMap = fields.reduce((acc, v, i) => { + acc[v.name] = i; + return acc; + }, {}); + + propFields = propFields || fields.map(d => d.name); + const dataWithFacets = [ + propFields + ]; + + const measureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES); + const propDims = fields.filter(d => d.name in fieldsConfig).map(d => d.name); + + const dimsMap = dimsMapGetter(propDims, fieldsConfig); + + for (let i = 1, len = data.length; i < len; i++) { + const row = data[i]; + const dimKey = propDims.map(field => row[fieldIndexMap[field]]); + const origRow = dimsMap[dimKey]; + if (origRow) { + origRow.forEach((rowVal) => { + const newRowVal = []; + propFields.forEach((field) => { + if (field in fieldIndexMap) { + const idx = fieldIndexMap[field]; + newRowVal.push(row[idx]); + } else { + const idx = getObjProp(fieldsConfig[field], 'index'); + idx !== undefined && newRowVal.push(rowVal[idx]); + } + }); + if (!measureNameField) { + const measuresArr = dimensionsMap[newRowVal].length ? dimensionsMap[newRowVal] : [[]]; + measuresArr.forEach((measures) => { + dataWithFacets.push([...newRowVal, ...measures]); + }); + } else { + dataWithFacets.push(newRowVal); + } + }); + } + } + return dataWithFacets; +}; + +export const dispatchSecondaryActions = (firebolt, { action, propagationData, config, propagationInf }) => { + const context = firebolt.context; + + const secondaryActions = firebolt._connectedBehaviours[action] || []; + + secondaryActions.forEach((secAction) => { + const payloadGeneratorFn = firebolt.getPayloadGeneratorFor(secAction); + const generatedPayload = payloadGeneratorFn(firebolt, propagationData, config, + context.facetByFields()); + firebolt.dispatchBehaviour(secAction, generatedPayload, propagationInf); + }); +}; + +export const createMapByDimensions = (context, dm) => { + let cacheMap = context._cacheMap = {}; + return (propDims, fieldsConfig) => { + cacheMap = context._cacheMap; + if (!cacheMap[propDims]) { + cacheMap[propDims] = dm.getData({ withUid: true }).data.reduce((acc, row) => { + const key = propDims.map(d => row[fieldsConfig[d].index]); + acc[key] || (acc[key] = []); + acc[key].push(row); + return acc; + }, {}); + } + return cacheMap[propDims]; + }; +}; diff --git a/packages/visual-unit/src/firebolt/index.js b/packages/visual-unit/src/firebolt/index.js index 3e3218b3..6ff1e2b1 100644 --- a/packages/visual-unit/src/firebolt/index.js +++ b/packages/visual-unit/src/firebolt/index.js @@ -1,16 +1,20 @@ import { FieldType, intersect } from 'muze-utils'; import { Firebolt, SIDE_EFFECTS } from '@chartshq/muze-firebolt'; -import { isXandYMeasures, getSelectionRejectionModel } from '../helper'; import { payloadGenerator } from './payload-generator'; -import { propagateValues } from './data-propagator'; +import { + isSideEffectEnabled, + sanitizePayloadCriteria, + dispatchSecondaryActions, + createMapByDimensions +} from './helper'; -const sideEffectPolicy = (propPayload, context, propagationInf) => { +const sideEffectPolicy = (propPayload, firebolt, propagationInf) => { const { sourceIdentifiers, propagationData } = propagationInf; - const fieldsConfig = sourceIdentifiers.getFieldsConfig(); - const sourceIdentifierFields = Object.keys(fieldsConfig).filter(field => - fieldsConfig[field].def.type !== FieldType.MEASURE); - const propFields = Object.keys(propagationData[0].getFieldsConfig()); - const hasCommonCanvas = propPayload.sourceCanvas === context.parentAlias(); + const fields = sourceIdentifiers.fields; + const sourceIdentifierFields = Object.keys(fields).filter(field => + field.type !== FieldType.MEASURE); + const propFields = Object.keys(propagationData.getFieldsConfig()); + const hasCommonCanvas = propPayload.sourceCanvas === firebolt.sourceCanvas(); return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas; }; @@ -28,20 +32,16 @@ export default class UnitFireBolt extends Firebolt { BRUSH_ANCHORS, PERSISTENT_ANCHORS } = SIDE_EFFECTS; - + this._handlers = {}; + this._propagationIdentifiers = {}; + this._connectedBehaviours = {}; + this.payloadGenerators(payloadGenerator); + this.sideEffects().tooltip.disable(); const disabledSideEffects = [TOOLTIP, HIGHLIGHTER, ANCHORS, BRUSH_ANCHORS, PERSISTENT_ANCHORS]; disabledSideEffects.forEach((sideEffect) => { this.changeSideEffectStateOnPropagation(sideEffect, sideEffectPolicy, 'sourceTargetPolicy'); }); } - propagate (behaviour, payload, selectionSet, sideEffects) { - propagateValues(this, behaviour, { - payload, - selectionSet, - sideEffects, - propagationFields: this._propagationFields - }); - } getApplicableSideEffects (sideEffects, payload, propagationInf) { const context = this.context; @@ -49,7 +49,6 @@ export default class UnitFireBolt extends Firebolt { const aliasName = context.parentAlias(); const propagationSourceCanvas = propagationInf.propPayload && propagationInf.propPayload.sourceCanvas; const sourceUnitId = propagationInf.propPayload && propagationInf.propPayload.sourceUnit; - const sourceSideEffects = this._sourceSideEffects; const sideEffectInstances = this.sideEffects(); const actionOnSource = sourceUnitId ? sourceUnitId === unitId : true; @@ -65,13 +64,7 @@ export default class UnitFireBolt extends Firebolt { return false; } if (!actionOnSource && payload.criteria !== null) { - const sideEffectCheckers = Object.values(sourceSideEffects[se.name || se] || {}); - const { sourceIdentifiers, data: propagationData } = propagationInf; - return sideEffectCheckers.length ? sideEffectCheckers.every(checker => - checker(propagationInf.propPayload, context, { - sourceIdentifiers, - propagationData - })) : true; + return isSideEffectEnabled(this, { se, propagationInf }); } if (propagationSourceCanvas === aliasName || actionOnSource) { return se.applyOnSource !== false; @@ -84,8 +77,22 @@ export default class UnitFireBolt extends Firebolt { return applicableSideEffects; } - shouldApplySideEffects (propagate) { - return propagate === false; + shouldApplySideEffects (propInf) { + return propInf.propagate === false && propInf.applySideEffect !== false; + } + + sanitizePayload (payload) { + const { criteria } = payload; + const { allFields: fields, dimensionsMap } = this._metaData; + + return Object.assign({}, payload, + { + criteria: sanitizePayloadCriteria(criteria, fields, { + dm: this.data(), + dimensionsMap, + dimsMapGetter: this._dimsMapGetter + }) + }); } onDataModelPropagation () { @@ -95,11 +102,8 @@ export default class UnitFireBolt extends Firebolt { if (!context.mount()) { return; } - const { - model: propagationData, - entryRowIds, - exitRowIds - } = getSelectionRejectionModel(context.data(), data, isXandYMeasures(context), context._cachedValuesMap()); + const propagationData = data; + const { enabled: enabledFn, sourceIdentifiers, @@ -107,11 +111,11 @@ export default class UnitFireBolt extends Firebolt { payload: propPayload } = config; - const payloadFn = payloadGenerator[action] || payloadGenerator.__default; - const payload = payloadFn(context, propagationData, config); - const sourceBehaviours = this._sourceBehaviours; - const filterFns = Object.values(sourceBehaviours[action] || sourceBehaviours['*'] || {}); - let enabled = filterFns.every(fn => fn(propPayload || {}, context, { + const payloadFn = this.getPayloadGeneratorFor(action); + const payload = payloadFn(this, propagationData, config, context.facetByFields()); + const behaviourPolicies = this._behaviourPolicies; + const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {}); + let enabled = filterFns.every(fn => fn(propPayload || {}, this, { sourceIdentifiers, propagationData })); @@ -129,11 +133,8 @@ export default class UnitFireBolt extends Firebolt { const propagationInf = { propagate: false, data: propagationData, - entryRowIds, - exitRowIds, propPayload, sourceIdentifiers, - persistent: false, sourceId: config.propagationSourceId, isMutableAction: config.isMutableAction }; @@ -143,16 +144,28 @@ export default class UnitFireBolt extends Firebolt { propagationInf, isMutableAction }; + this.dispatchBehaviour(action, payload, propagationInf); + + dispatchSecondaryActions(this, { + action, + propagationInf, + propagationData, + config + }); } }; } - prepareSelectionSets (behaviours) { - const data = this.context.data(); - if (data) { - this.createSelectionSet(data.getData().uids, behaviours); - } + target () { + return 'visual-unit'; + } + + createSelectionSet (...params) { + super.createSelectionSet(...params); + + this._dimsMapGetter = createMapByDimensions(this, this.data()); + return this; } @@ -160,4 +173,28 @@ export default class UnitFireBolt extends Firebolt { this.context.cachedData()[0].unsubscribe('propagation'); return this; } + + propagationIdentifiers (action, identifiers) { + if (identifiers) { + this._propagationIdentifiers = identifiers; + } + return this._propagationIdentifiers[action]; + } + + registerPhysicalActionHandlers () { + return this; + } + + id () { + return this.context.id(); + } + + getPropagationSource () { + return this.context.cachedData()[0]; + } + + sourceCanvas () { + return this.context.parentAlias(); + } } + diff --git a/packages/visual-unit/src/firebolt/payload-generator.js b/packages/visual-unit/src/firebolt/payload-generator.js index 4d23bcf3..259555de 100644 --- a/packages/visual-unit/src/firebolt/payload-generator.js +++ b/packages/visual-unit/src/firebolt/payload-generator.js @@ -1,63 +1,151 @@ -import { DimensionSubtype } from 'muze-utils'; +import { ReservedFields, FieldType, difference, isSimpleObject } from 'muze-utils'; const getRangeFromData = (instance, selectionDataModel, propConfig) => { - let criteria; - const dataObj = selectionDataModel[0].getData(); - const propCriteria = propConfig.payload.criteria; - const sourceIdentifiers = propConfig.sourceIdentifiers; + const dataObj = selectionDataModel.getData(); + const { includeMeasures = true, sourceIdentifiers } = propConfig; const schema = dataObj.schema; const fieldMap = instance.data().getFieldsConfig(); - const data = dataObj.data; - const isActionSourceSame = instance.id() === propConfig.sourceId; - - if (isActionSourceSame) { - criteria = propCriteria; - } else { - criteria = (sourceIdentifiers !== null) ? schema.reduce((acc, obj, index) => { - let range; + const selectionDataFields = selectionDataModel.getFieldspace().fieldsObj(); + let criteria = null; + if (sourceIdentifiers !== null) { + criteria = schema.reduce((ranges, obj) => { const field = obj.name; const fieldObj = fieldMap[field]; - const type = fieldObj && (fieldObj.def.subtype ? fieldObj.def.subtype : fieldObj.def.type); - const isDimension = type === DimensionSubtype.CATEGORICAL; if (!fieldObj) { - return acc; + return ranges; } - if (!isDimension) { - range = [Math.min(...data.map(d => d[index])), Math.max(...data.map(d => d[index]))]; - } else { - range = data.map(d => d[index]); - } - acc[field] = range; - return acc; - }, {}) : null; + ranges[field] = selectionDataFields[field].domain(); + return ranges; + }, {}); + const measureNamesIdx = sourceIdentifiers.identifiers[0] + .findIndex(field => field === ReservedFields.MEASURE_NAMES); + if (measureNamesIdx !== undefined && includeMeasures) { + const measureNames = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length) + .map(d => d[measureNamesIdx]); + criteria[ReservedFields.MEASURE_NAMES] = measureNames.map(d => [d]); + } } return criteria; }; export const payloadGenerator = { - brush: (instance, selectionDataModel, propConfig) => { + brush: (instance, selectionDataModel, propConfig, facetByFields) => { const propPayload = propConfig.payload; - const criteria = getRangeFromData(instance, selectionDataModel, propConfig); - const payload = Object.assign({}, propPayload); - payload.criteria = criteria; + let payload; + if (isSimpleObject(propPayload.criteria)) { + const criteria = getRangeFromData(instance, selectionDataModel, propConfig); + payload = Object.assign({}, propPayload); + payload.criteria = criteria; + } else { + payload = payloadGenerator.__default(instance, selectionDataModel, propConfig, facetByFields); + } + return payload; }, - __default: (instance, selectionDataModel, propConfig) => { - const propPayload = propConfig.payload; - const sourceIdentifiers = propConfig.sourceIdentifiers; - const dataObj = selectionDataModel[0].getData(); - let schema = dataObj.schema; + __default: (instance, selectionDataModel, propConfig, facetByFields = []) => { + const { payload: propPayload, sourceIdentifiers, excludeSelectedMeasures } = propConfig; + const dataObj = selectionDataModel.getData({ withUid: true }); const payload = Object.assign({}, propPayload); - schema = dataObj.schema; const data = dataObj.data; - const sourceFields = schema.map(d => d.name); - payload.criteria = !sourceIdentifiers && selectionDataModel[0].isEmpty() ? null : - [sourceFields, ...data]; - payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.getSchema().map(d => d.name) : []; + const fieldsConfig = Object.assign({}, selectionDataModel.getFieldsConfig(), { + [ReservedFields.ROW_ID]: { + index: Object.keys(selectionDataModel.getFieldsConfig()).length, + def: { + type: FieldType.DIMENSION + } + } + }); + const selectionSet = instance._selectionSet[propConfig.action]; + const selectionSetFields = selectionSet._fields; + if (sourceIdentifiers) { + const [facetFields = [], facetValues = []] = facetByFields; + const facetIndices = facetFields.reduce((acc, v, i) => { + acc[v] = i; + return acc; + }, {}); + const identifierIdxMap = sourceIdentifiers.fields.reduce((acc, v, i) => { + acc[v.name] = i; + return acc; + }, {}); + const identifiers = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length); + const sourceIdentifierFields = sourceIdentifiers.fields.filter(d => d.name in fieldsConfig || + d.name in facetIndices || d.name === ReservedFields.ROW_ID); + + const identifierMap = identifiers.reduce((acc, v) => { + const key = sourceIdentifierFields.map(d => v[identifierIdxMap[d.name]]); + const measureNamesIdx = identifierIdxMap[ReservedFields.MEASURE_NAMES]; + if (measureNamesIdx) { + !acc[key] && (acc[key] = []); + acc[key].push([v[measureNamesIdx]]); + } + return acc; + }, {}); + + const dataArr = []; + for (let i = 0, len = data.length; i < len; i++) { + const row = data[i]; + const dims = []; + selectionSetFields.forEach((field) => { + if (fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION) { + const idx = fieldsConfig[field].index; + dims.push(row[idx]); + } + }); + + const vals = `${sourceIdentifierFields.map((d) => { + if (d.name in fieldsConfig) { + return row[fieldsConfig[d.name].index]; + } else if (d.name in facetIndices) { + return facetValues[facetIndices[d.name]]; + } + return null; + }).filter(d => d !== null)}`; + + if (vals in identifierMap) { + const measures = identifierMap[vals]; + const allMeasures = instance._metaData.dimensionsMap[dims]; + + if (excludeSelectedMeasures) { + const fn = v => `${v}`; + const diffMeasures = difference(allMeasures, measures, [fn, fn]); + diffMeasures.forEach((measureArr) => { + dataArr.push([...dims, measureArr]); + }); + } else { + measures.forEach((measureArr) => { + dataArr.push([...dims, measureArr]); + }); + } + } else { + let measures = instance._metaData.dimensionsMap[dims]; + measures = measures && measures.length ? measures : [[]]; + measures.forEach((measureArr) => { + dataArr.push([...dims, measureArr]); + }); + } + } + + payload.criteria = [[...selectionSetFields, ReservedFields.MEASURE_NAMES], ...dataArr]; + } else { + payload.criteria = null; + } + + payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : []; return payload; - } + }, + pseudoSelect: (instance, selectionDataModel, propConfig, facetByFields = []) => + payloadGenerator.__default(instance, selectionDataModel, Object.assign({}, { + excludeSelectedMeasures: true + }, propConfig), facetByFields) }; +export const getPayloadGenerator = (action, criteria) => { + if (criteria instanceof Array || !payloadGenerator[action]) { + return payloadGenerator.__default; + } + + return payloadGenerator[action]; +}; diff --git a/packages/visual-unit/src/helper/grid-lines.js b/packages/visual-unit/src/helper/grid-lines.js index b8ba15e9..96072248 100644 --- a/packages/visual-unit/src/helper/grid-lines.js +++ b/packages/visual-unit/src/helper/grid-lines.js @@ -95,6 +95,7 @@ const dimensionSubTypes = Object.values(DimensionSubtype).reduce((acc, v) => { acc[v] = 1; return acc; }, {}); + const getValidSubtype = subtype => (!dimensionSubTypes[subtype] ? DimensionSubtype.CATEGORICAL : subtype); export const getGridLayerData = (axes, fields, fieldsConfig) => { @@ -174,6 +175,7 @@ export const createGridLineLayer = (context) => { .store(store); return inst; }, definitions, atomicDef => atomicDef.definition.name); + context[sel].each((layer, atomicDef) => { const definition = atomicDef.definition; const sConf = layerFactory.getSerializedConf(mark, definition); diff --git a/packages/visual-unit/src/helper/index.js b/packages/visual-unit/src/helper/index.js index 7d608744..5e477e0f 100644 --- a/packages/visual-unit/src/helper/index.js +++ b/packages/visual-unit/src/helper/index.js @@ -9,7 +9,8 @@ import { DimensionSubtype, toArray, MeasureSubtype, - getNearestValue + getNearestValue, + RTree } from 'muze-utils'; import { layerFactory, ENCODING } from '@chartshq/visual-layer'; @@ -222,7 +223,7 @@ export const renderLayers = (context, container, layers, measurement) => { context._lifeCycleManager.notify({ client: layers, action: 'beforedraw', formalName: 'layer' }); const config = context.config(); const classPrefix = config.classPrefix; - const orderedLayers = context.layers().sort((a, b) => a.config().order - b.config().order); + const orderedLayers = layers.sort((a, b) => a.config().order - b.config().order); const layerParentGroup = makeElement(container, 'g', [1], `${classPrefix}-layer-group`); const layerDepOrder = getDependencyOrder(context._layerDepOrder); const groups = {}; @@ -235,7 +236,7 @@ export const renderLayers = (context, container, layers, measurement) => { } }); - const layerSeq = layerDepOrder.map(name => groups[name]); + const layerSeq = layerDepOrder.map(name => groups[name]).filter(d => d !== undefined); layerSeq.forEach((o) => { const layer = o.layer; const group = o.group; @@ -342,16 +343,18 @@ const getKey = (arr, row) => { }; export const getValuesMap = (model, context) => { - const valuesMap = {}; + const idValuesMap = {}; + const valuesIdMap = {}; const { data: dataArr, schema, uids } = model.getData(); const fieldsConfig = model.getFieldsConfig(); const fieldIndices = isXandYMeasures(context) ? schema.map((d, i) => i) : Object.keys(model.getFieldspace().getDimension()).map(d => fieldsConfig[d].index); dataArr.forEach((row, i) => { const key = getKey(fieldIndices, row); - valuesMap[key] = uids[i]; + valuesIdMap[key] = uids[i]; + idValuesMap[uids[i]] = row; }); - return valuesMap; + return { valuesIdMap, idValuesMap, fieldsConfig }; }; export const getSelectionRejectionModel = (model, propModel, measures, propValuesMap) => { @@ -362,13 +365,15 @@ export const getSelectionRejectionModel = (model, propModel, measures, propValue if (schema.length) { const fieldMap = model.getFieldsConfig(); + const { valuesIdMap } = propValuesMap; + const rowIdsObj = {}; const filteredSchema = measures ? schema.map((d, idx) => idx) : Object.keys(model.getFieldspace().getDimension()).map(d => fieldMap[d].index); data.forEach((row) => { const key = getKey(filteredSchema, row); - const id = propValuesMap[key]; - if (key in propValuesMap) { + const id = valuesIdMap[key]; + if (key in valuesIdMap) { entryRowIds.push(id); rowIdsObj[id] = 1; } @@ -393,3 +398,14 @@ export const getSelectionRejectionModel = (model, propModel, measures, propValue }; }; +export const createRTree = (context) => { + const elements = [].concat(...context.layers().filter(layer => layer.config().interactive !== false) + .map((layer) => { + const points = layer.getBoundBoxes(); + return points; + })).flat().filter(d => d !== null); + + const rtree = new RTree(); + rtree.load(elements); + return rtree; +}; diff --git a/packages/visual-unit/src/index.js b/packages/visual-unit/src/index.js index 755775a4..7d480cf1 100644 --- a/packages/visual-unit/src/index.js +++ b/packages/visual-unit/src/index.js @@ -1 +1,16 @@ +import * as helpers from './helper'; +import * as enums from './enums'; +import UnitFireBolt from './firebolt'; +import { isSideEffectEnabled, prepareSelectionSetMap, sanitizePayloadCriteria } from './firebolt/helper'; +import { payloadGenerator } from './firebolt/payload-generator'; + export { default as VisualUnit } from './visual-unit'; +export { + helpers, + enums, + UnitFireBolt, + isSideEffectEnabled, + payloadGenerator, + prepareSelectionSetMap, + sanitizePayloadCriteria +}; diff --git a/packages/visual-unit/src/listener-map.js b/packages/visual-unit/src/listener-map.js index 38cf4cd8..01856dda 100644 --- a/packages/visual-unit/src/listener-map.js +++ b/packages/visual-unit/src/listener-map.js @@ -1,14 +1,22 @@ -import { STATE_NAMESPACES, temporalFields, getObjProp, defaultValue } from 'muze-utils'; +import { + STATE_NAMESPACES, + temporalFields, + getObjProp, + defaultValue, + isSimpleObject +} from 'muze-utils'; +import { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants'; +import { TOOLTIP, FRAGMENTED_TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects'; import * as PROPS from './enums/reactive-props'; import { transformDataModels, getDimensionMeasureMap, attachDataToLayers, - attachAxisToLayers, - unionDomainFromLayers + attachAxisToLayers } from './helper'; import { createGridLineLayer } from './helper/grid-lines'; +import { prepareSelectionSetData } from './firebolt/helper'; const removeExitLayers = (layerDefs, context) => { const layersMap = context._layersMap; @@ -26,19 +34,13 @@ const removeExitLayers = (layerDefs, context) => { } }; -export const calculateDomainListener = (context) => { - const { namespace } = context.metaInf(); - const domain = unionDomainFromLayers(context.layers(), context.fields(), context._layerAxisIndex, - context.data().getFieldsConfig()); - context.store().commit(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, domain, namespace); -}; - export const listenerMap = [ { type: 'registerImmediateListener', props: [PROPS.LAYERDEFS], listener: (context, [, layerDefs]) => { const fieldsVal = context.fields(); + if (layerDefs && fieldsVal) { removeExitLayers(layerDefs, context); const queuedLayerDefs = context._queuedLayerDefs; @@ -47,6 +49,7 @@ export const listenerMap = [ layerDefArr = [...layerDefArr, ...defFn(layerDefs)]; }); context.addLayer(layerDefArr); + const adjustRange = context.layers().some(inst => inst.hasPlotSpan()); ['x', 'y'].forEach((type) => { const axisArr = defaultValue(getObjProp(context.axes(), type), []); @@ -91,7 +94,13 @@ export const listenerMap = [ context._timeDiffs = timeDiffs; const firebolt = context.firebolt(); const originalData = context.cachedData()[0]; - firebolt.createSelectionSet(context.data().getUids()); + const { keys, dimensionsMap, dimensions, allFields } = prepareSelectionSetData(context.data(), context); + firebolt._metaData = { + dimensionsMap, + dimensions, + allFields + }; + firebolt.createSelectionSet({ keys, fields: dimensions }); firebolt.attachPropagationListener(originalData); } } @@ -101,7 +110,27 @@ export const listenerMap = [ props: [PROPS.CONFIG], listener: (context, [, config]) => { if (config) { - context.firebolt().config(config.interaction); + const firebolt = context.firebolt(); + const { interaction } = config; + firebolt.config(interaction); + const { mode } = interaction.tooltip; + if (mode === FRAGMENTED) { + const map = firebolt._behaviourEffectMap; + for (const key in map) { + const sideEffects = map[key]; + + map[key] = sideEffects.map((val) => { + let name = val; + if (isSimpleObject(val)) { + name = val.name; + } + if (name === TOOLTIP) { + return FRAGMENTED_TOOLTIP; + } + return val; + }); + } + } createGridLineLayer(context); } } diff --git a/packages/visual-unit/src/props.js b/packages/visual-unit/src/props.js index 30fcb1c7..5ef81f43 100644 --- a/packages/visual-unit/src/props.js +++ b/packages/visual-unit/src/props.js @@ -2,7 +2,16 @@ import { mergeRecursive } from 'muze-utils'; import { FACET_BY_FIELDS, RETINAL_FIELDS, PARENT_ALIAS, CACHED_DATA } from './enums/constants'; export const PROPS = { - [FACET_BY_FIELDS]: {}, + [FACET_BY_FIELDS]: { + onset: (context, facets) => { + const facetKeys = facets[0].reduce((acc, v, i) => { + acc[`${v}`] = facets[1][i]; + return acc; + }, {}); + context.facetFieldsMap(facetKeys); + } + }, + facetFieldsMap: {}, [RETINAL_FIELDS]: {}, [PARENT_ALIAS]: {}, [CACHED_DATA]: {}, diff --git a/packages/visual-unit/src/visual-unit.js b/packages/visual-unit/src/visual-unit.js index 27a644ed..feae75f8 100644 --- a/packages/visual-unit/src/visual-unit.js +++ b/packages/visual-unit/src/visual-unit.js @@ -12,10 +12,13 @@ import { transposeArray, CommonProps, toArray, - STATE_NAMESPACES + STATE_NAMESPACES, + FieldType, + ReservedFields } from 'muze-utils'; -import { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt'; +import { behaviourEffectMap } from '@chartshq/muze-firebolt'; import { actionBehaviourMap } from './firebolt/action-behaviour-map'; +import UnitBrushBehaviour from './firebolt/behaviours/brush'; import { renderLayers, getNearestDimensionalValue, @@ -27,18 +30,23 @@ import { createSideEffectGroup, resolveEncodingTransform, createRenderPromise, - setAxisRange + setAxisRange, + unionDomainFromLayers, + createRTree } from './helper'; import { renderGridLineLayers, attachDataToGridLineLayers } from './helper/grid-lines'; -import { calculateDomainListener, listenerMap } from './listener-map'; +import { listenerMap } from './listener-map'; import { PROPS } from './props'; import UnitFireBolt from './firebolt'; import { initSideEffects, dispatchQueuedSideEffects, clearActionHistory } from './firebolt/helper'; import './styles.scss'; import localOptions from './local-options'; import { WIDTH, HEIGHT } from './enums/reactive-props'; +import { REACTIVE_PROPS } from './enums'; +import { PSEUDO_SELECT } from './enums/behaviours'; +import PseudoSelectBehaviour from './firebolt/behaviours/pseudo-select'; -const FORMAL_NAME = 'unit'; +const FORMAL_NAME = 'VisualUnit'; const unitNs = [STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE]; const groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE; @@ -77,7 +85,7 @@ export default class VisualUnit { this._layerAxisIndex = {}; this._queuedLayerDefs = []; layerFactory.setLayerRegistry(registry.layerRegistry); - generateGetterSetters(this, PROPS); + generateGetterSetters(this, this.constructor.getterSetters()); this.registry(registry); this.cachedData([]); } @@ -91,13 +99,21 @@ export default class VisualUnit { { domain: null }, - Object.keys((localOptions)).reduce((acc, v) => { + Object.keys((this.localOptions())).reduce((acc, v) => { acc[v] = localOptions[v].value; return acc; }, {}) ]; } + static getterSetters () { + return PROPS; + } + + static localOptions () { + return localOptions; + } + static getQualifiedStateProps () { const unitState = VisualUnit.getState(); return unitState.map((state, i) => Object.keys(state).map(prop => `${unitNs[i]}.${prop}`)); @@ -113,7 +129,10 @@ export default class VisualUnit { }), { type: 'registerImmediateListener', props: [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`], - listener: calculateDomainListener + listener: (context) => { + const domain = context.calculateDomainFromData(); + context.dataDomain(domain); + } }, { type: 'registerImmediateListener', props: [`${unitNs[1]}.${WIDTH}`, @@ -140,6 +159,8 @@ export default class VisualUnit { props: [CommonProps.ON_LAYER_DRAW], listener: (context, [, drawn]) => { if (drawn) { + context._rtree = createRTree(context); + const firebolt = context.firebolt(); dispatchQueuedSideEffects(firebolt); clearActionHistory(firebolt); @@ -159,26 +180,51 @@ export default class VisualUnit { store (...params) { if (params.length) { const store = this._store = params[0]; - const { throwback, fireboltDeps } = this._dependencies; + const { throwback } = this._dependencies; const { namespace } = this.metaInf(); store.addSubNamespace(namespace, FORMAL_NAME, this); throwback.addSubNamespace(namespace, FORMAL_NAME, this); - transactor(this, localOptions, store, { + transactor(this, this.constructor.localOptions(), store, { subNamespace: namespace, namespace: `${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}` }); + this.createFireboltInstance(); - this.firebolt(new UnitFireBolt(this, { - physical: Object.assign({}, physicalActions, fireboltDeps.physicalActions), - behavioural: Object.assign({}, behaviouralActions, fireboltDeps.behaviouralActions), - physicalBehaviouralMap: actionBehaviourMap - }, Object.assign({}, sideEffects, fireboltDeps.sideEffects), behaviourEffectMap)); return this; } return this._store; } + createFireboltInstance () { + const { interactions } = this.registry(); + const { fireboltDeps } = this._dependencies; + const Cls = this.getFireboltCls(); + + this.firebolt(new Cls(this, { + physical: Object.assign({}, interactions.physicalActions.get(), fireboltDeps.physicalActions), + behavioural: Object.assign({}, interactions.behaviours.get(), { + [UnitBrushBehaviour.formalName()]: UnitBrushBehaviour, + [PSEUDO_SELECT]: PseudoSelectBehaviour + }, fireboltDeps.behaviouralActions), + physicalBehaviouralMap: this.getActionBehaviourMap() + }, Object.assign({}, interactions.sideEffects.get(), fireboltDeps.sideEffects), this.getBehaviourEffectMap())); + + return this; + } + + getFireboltCls () { + return UnitFireBolt; + } + + getBehaviourEffectMap () { + return behaviourEffectMap; + } + + getActionBehaviourMap () { + return actionBehaviourMap; + } + /** * Static helper for creates a unit instance * @@ -241,32 +287,48 @@ export default class VisualUnit { * @return {VisualUnit} Instance of visual unit. */ render (container) { + this.createRootContainers(container); + + setAxisRange(this); + this.renderLayers(); + const node = this._rootSvg.node(); + const { sideEffectClassName, classPrefix } = this.config(); + this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`); + const firebolt = this.firebolt(); + initSideEffects(firebolt.sideEffects(), firebolt); + return this; + } + + createRootContainers (container) { const config = this.config(); - const { className, defClassName, sideEffectClassName, classPrefix } = config; + const { className, defClassName } = config; const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix); const width = this.width(); const height = this.height(); const containerSelection = selectElement(container).style('position', 'relative'); - this._rootSvg = makeElement(containerSelection, 'svg', [null], className) .style('width', `${width}px`).style('height', `${height}px`); const node = this._rootSvg.node(); + setAttrs(node, { width, height, class: qualifiedClassName.join(' ') }); + return this; + } + + renderLayers () { + const width = this.width(); + const height = this.height(); + const node = this._rootSvg.node(); - setAxisRange(this); renderGridLineLayers(this, node); renderLayers(this, node, this.layers(), { width, height }); - this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`); - const firebolt = this.firebolt(); - initSideEffects(firebolt.sideEffects(), firebolt); return this; } @@ -355,7 +417,6 @@ export default class VisualUnit { if (mount.length) { this._mount = mount[0]; this.render(mount[0]); - this.firebolt().mapActionsAndBehaviour(); return this; } return this._mount; @@ -439,12 +500,6 @@ export default class VisualUnit { return layers; } - /** - * - * - * - * @memberof VisualUnit - */ remove () { const formalName = this.constructor.formalName(); const { lifeCycleManager, throwback } = this._dependencies; @@ -470,12 +525,10 @@ export default class VisualUnit { * * @memberof VisualUnit */ - getDataModelFromIdentifiers (identifiers, mode, parentModel) { - if (identifiers === null) { - return null; - } + getDataModelFromIdentifiers (identifiers, mode, parentModel, hasBarLayer) { + if (!identifiers) return null; const dataModel = parentModel || this.data(); - return getDataModelFromIdentifiers(dataModel, identifiers, mode); + return getDataModelFromIdentifiers(dataModel, identifiers, mode, hasBarLayer); } /** @@ -490,31 +543,29 @@ export default class VisualUnit { return this; } - /** - * - * - * - * @memberof VisualUnit - */ getSourceInfo () { return { dimensionMeasureMap: this._dimensionMeasureMap, fields: this.fields(), data: this.data(), - axes: this.axes() + axes: this.axes(), + retinalFields: this.retinalFields(), + layers: this.layers(), + timeDiffs: this.timeDiffsByField() }; } - getDataDomain () { - return this.store().get(`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`, this.metaInf().namespace); + dataDomain (...params) { + const { namespace } = this.metaInf(); + const store = this.store(); + const prop = `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${REACTIVE_PROPS.DOMAIN}`; + if (params.length) { + const domain = params[0]; + store.commit(prop, domain, namespace); + } + return store.get(prop, namespace); } - /** - * - * - * - * @memberof VisualUnit - */ getDefaultTargetContainer () { const { classPrefix, defClassName } = this.config(); return [`.${classPrefix}-${defClassName}`]; @@ -582,13 +633,22 @@ export default class VisualUnit { }); if (dimValue !== null && config.getAllPoints) { + dimValue[0].push(ReservedFields.MEASURE_NAMES); pointObj.id = dimValue; - const pointInf = this.getMarkInfFromLayers(x, y, config); - pointObj.target = pointInf && pointInf.id ? pointInf.id : pointObj.id; + const layers = this.layers(); + const pointInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue }); + layers.forEach((layer) => { + const measures = layer.data().getSchema() + .filter(d => d.type === FieldType.MEASURE).map(d => d.name); + for (let i = 1, len = dimValue.length; i < len; i++) { + dimValue[i].push(measures.join()); + } + }); + pointObj.target = pointInf && pointInf.id ? pointInf.id : null; return pointObj; } - const markInf = this.getMarkInfFromLayers(x, y, config) || { id: null }; + const markInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue }) || { id: null }; pointObj = Object.assign({}, markInf); pointObj.target = markInf.id; @@ -711,4 +771,81 @@ export default class VisualUnit { removeLayersBy('type', type); return this; } + + calculateDomainFromData () { + const domain = unionDomainFromLayers(this.layers(), this.fields(), this._layerAxisIndex, + this.data().getFieldsConfig()); + return domain; + } + + getValueFromId (id, fields, fieldsConfig) { + const { idValuesMap } = this._cachedValuesMap(); + const row = idValuesMap[id]; + const filteredRow = fields.map(d => (d === ReservedFields.ROW_ID ? id : row[fieldsConfig[d].index])); + + return filteredRow; + } + + getRangeFromIdentifiers ({ criteria, fields }) { + return fields.reduce((acc, v) => { + acc[v] = criteria[v]; + return acc; + }, {}); + } + + getRangeFromPositions ({ startPos, endPos }) { + const { x, y } = this.fields(); + const axes = this.axes(); + const xField = x[0]; + const yField = y[0]; + const xFieldType = x[0].type(); + const yFieldType = y[0].type(); + const dimensions = Object.keys(this.data().getFieldspace().getDimension()); + + if (xFieldType === FieldType.MEASURE && yFieldType === FieldType.MEASURE) { + const dom = { + x: axes.x[0].invertExtent(startPos.x, endPos.x).sort((a, b) => a - b), + y: axes.y[0].invertExtent(startPos.y, endPos.y).sort((a, b) => a - b) + }; + const range = {}; + if (`${xField}` === `${yField}`) { + const xdom = dom.x; + const ydom = dom.y; + const min = xdom[0] > ydom[0] ? ydom : xdom; + const max = min === ydom ? xdom : ydom; + if (min[1] < max[0]) { + range[xField] = []; + } else { + range[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]]; + } + } else { + range[xField] = dom.x; + range[yField] = dom.y; + } + return range; + } else if (xFieldType === FieldType.DIMENSION || yFieldType === FieldType.DIMENSION) { + const points = this._rtree.search({ + minX: startPos.x, + minY: startPos.y, + maxX: endPos.x, + maxY: endPos.y + }); + + const criteria = [[]]; + dimensions.forEach((field) => { + criteria[0].push(`${field}`); + }); + + points.forEach((point) => { + const data = point.data; + const vals = []; + dimensions.forEach((field) => { + vals.push(data[field]); + }); + criteria.push(vals); + }); + return criteria; + } + return null; + } } diff --git a/packages/muze/npm/LICENSE b/release/LICENSE similarity index 100% rename from packages/muze/npm/LICENSE rename to release/LICENSE diff --git a/packages/muze/npm/README.md b/release/README.md similarity index 99% rename from packages/muze/npm/README.md rename to release/README.md index 0748cc49..c7365ff6 100644 --- a/packages/muze/npm/README.md +++ b/release/README.md @@ -149,4 +149,4 @@ Your PRs and stars are always welcome :). Checkout the [Contributing](https://gi ## License -MIT +MIT \ No newline at end of file diff --git a/release/dist/muze.css b/release/dist/muze.css new file mode 100644 index 00000000..48a75f3e --- /dev/null +++ b/release/dist/muze.css @@ -0,0 +1 @@ +.muze-simple-axis text{text-align:center;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-ticks{font-style:"normal";fill:#858585}.muze-tick-lines,.muze-ticks{font-size:12px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-tick-lines{stroke:#efefef}.muze-axis-name{font-size:14px;text-align:center;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;fill:#5f5f5f}.muze-axis-name.hidden{display:none}.muze-fadeout-interaction{stroke-opacity:.3}.muze-layer-line{stroke-linejoin:round;stroke-width:2px;stroke:#1f77b4}.muze-layer-area{stroke-linejoin:round}.muze-layer-arc-highlight{fill:#7f7f7f!important}.muze-layer-arc-fadeout{fill-opacity:.3!important}.muze-layer-arc-selected{fill:#e6e6e6!important}.muze-layer-arc{fill:#1f77b4}.muze-layer-text text{font-size:12px;fill:#000}.muze-layer-text rect{fill:#7f7f7f;fill-opacity:.3}.muze-layer-text-highlight{fill-opacity:1}.muze-layer-text-fadeout{fill-opacity:.3!important}.muze-layer-text-selected{fill:#000!important}.muze-layer-point{fill-opacity:.5}.muze-layer-bar{fill-opacity:1;stroke:none;stroke-width:0}.muze-layer-bar-highlight{fill-opacity:1}.muze-layer-bar-fadeout{fill-opacity:.2!important}.muze-layer-bar-selected{fill:#4682b4!important}.muze-layer-tick{stroke-opacity:.7;stroke:#f44336}.muze-layer-tick-highlight{stroke-opacity:1}.muze-layer-tick-fadeout{stroke-opacity:.3!important;stroke:#7f7f7f!important}.muze-layer-tick-selected{stroke:#000!important}.muze-selection-box-group{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-tooltip-box{opacity:1;border:1px solid hsla(0,0%,59.2%,.19);background:#fbfbfb;-webkit-box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);box-shadow:2px 2px 3px 0 hsla(0,0%,82.7%,.5);font-size:12px;color:#5f5f5f;-webkit-border-radius:1px;border-radius:1px;padding-top:4px;display:inline-block;pointer-events:none;z-index:9999999999;text-align:left}.muze-tooltip-row{padding-bottom:2px;padding-top:2px;overflow:auto}.muze-tooltip-parent-container{pointer-events:none;z-index:9999999999}.muze-tooltip-stacked-row{color:#828282;margin-left:10px;font-size:12px;font-weight:600;line-height:"15px"}.muze-tooltip-stacked-row-key{margin-left:10px}.muze-tooltip-stacked-row-value{margin-left:2px}.muze-tooltip-stacked-percentage{font-size:10px;color:#828282;margin-left:-20px;margin-right:20px;float:right;line-height:17px}.muze-tooltip-selected-row{background-color:#ebebeb}.muze-tooltip-row:last-child{padding-bottom:4px}.muze-tooltip-value{color:#5f5f5f;float:right;margin-left:10px}.muze-tooltip-connectors path{stroke-width:2px;stroke:#c7c7be;stroke-linejoin:round;stroke-linecap:round}.muze-tooltip-html-container{margin-left:10px;margin-right:10px}.muze-tooltip-content svg{margin-left:10px;margin-right:5px}.muze-tooltip-value{margin-right:24px;margin-left:24px}.muze-tooltip-first{font-weight:600;font-size:15px;margin-left:15px}.muze-tooltip-table-tbody td{padding:3px}.muze-tooltip-table-row-0{font-weight:700}.muze-tooltip-content-parent-container :last-child{border-bottom:none}.muze-tooltip-content-parent-container{display:inline-block}.muze-tooltip-content-container-highlightSummary{border-right:1px solid #e9e9e9}.muze-tooltip-content-container-selectionSummary-crosstab{display:inline-block}.muze-tooltip-content-container-selectionSummary-default{border-bottom:1px solid #e9e9e9}.muze-tooltip-content-container-highlightSummary-crosstab{float:left}.muze-tooltip-content-container-selectionSummary .muze-tooltip-content{margin-left:3px;margin-right:3px}.muze-crossband{stroke-opacity:0;fill:grey;fill-opacity:.2}.muze-crossline{stroke:#979797;stroke-dasharray:5,7;fill:#979797;opacity:.65}.muze-anchors-group{pointer-events:none}.muze-anchors-group-lower .muze-layer-point,.muze-anchors-group-upper .muze-layer-point,.muze-anchors-group .muze-layer-point,.muze-brush-anchors-lower .muze-layer-point,.muze-brush-anchors-upper .muze-layer-point,.muze-persistent-anchors-lower .muze-layer-point,.muze-persistent-anchors-upper .muze-layer-point,.muze-persistent-anchors .muze-layer-point{fill-opacity:1}.muze-axis-ticks-highlight{font-weight:700;fill:#595959}.muze-axis-ticks-unhighlight{font-weight:400;fill:#858585}.muze-visual-unit{background:transparent}.muze-axis-zero-line{stroke-width:1px}.muze-grid-band-x-0,.muze-grid-band-y-0{fill-opacity:0}.muze-unit{-webkit-touch-callout:none;-webkit-user-select:none}.muze-legend-box,.muze-legend-item-info,.muze-legend-title{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-legend-box{line-height:10px!important;height:100px;display:inline-block}.muze-legend-title{display:table;-webkit-box-align:center;-webkit-align-items:center;align-items:center;float:left;text-align:left;font-size:14px;height:30px;fill:#5f5f5f;font-weight:600}.muze-legend-title-text{display:table-cell;vertical-align:middle}.muze-legend-overflow{text-align:center}.muze-legend-icon,.muze-legend-icon-svg{cursor:pointer}.muze-overflow-y{overflow-y:scroll}.muze-overflow-x{overflow-x:scroll}.muze-legend-fadeout{fill-opacity:.3}.muze-legend-fadeout path{stroke-width:1px;fill-opacity:0}.muze-legend-brighten{fill-opacity:1}.muze-legend-item-info{float:left;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;cursor:pointer;font-size:12px}.muze-legend-item-info.center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.muze-legend-item-info.start{-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.muze-legend-item-info.end{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.muze-legend-selection-box{fill:#d3d3d3;fill-opacity:.3;stroke:#b4b4b4;cursor:all-scroll;pointer-events:all}.muze-legend-marker{stroke:#e2e2e2;stroke-width:1px;fill:#797474}.muze-legend-marker-show{display:block}.muze-legend-marker-hide{display:none}.muze-legend-marker-text-container{position:relative}.muze-legend-marker-text{position:absolute}.muze-legend-marker-text div{text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff;pointer-events:none}.muze-text-cell{font-size:12px;color:#5f5f5f;font-weight:400;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:15px;white-space:nowrap;-webkit-transform-origin:0 0;transform-origin:0 0}.muze-header-cell{font-size:16px}.muze-header-cell,.muze-subheader-cell{text-align:center;color:#858585;font-weight:800;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:1;white-space:nowrap}.muze-subheader-cell{font-size:15px}.muze-scroll-bar{background:#f8f8f8;position:relative;font-size:10px}.muze-scroll-arrow{float:left;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background:#a2a2a2;color:#fff}.muze-scroll-arrow-left{height:100%;width:20px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-right{height:100%;width:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.muze-scroll-arrow-right,.muze-scroll-arrow-top{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.muze-scroll-arrow-top{width:100%;height:20px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.muze-scroll-arrow-bottom{width:100%;height:20px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.muze-scroll-rect{float:left;position:relative}.muze-scroll-mover{position:absolute;-webkit-border-radius:3px;background:#a2a2a2;cursor:-webkit-grab;border-radius:3px}.muze-scroll-mover:active{cursor:-webkit-grabbing}.muze-scroll-arrow-chevron{position:relative;text-align:center;padding:1px;margin-bottom:0}.muze-scroll-arrow-chevron:after,.muze-scroll-arrow-chevron:before{content:"";position:absolute;background:#fff}#muze-scroll-arrow-chevron-bottom,#muze-scroll-arrow-chevron-top{height:1px;width:6px}#muze-scroll-arrow-chevron-left,#muze-scroll-arrow-chevron-right{width:1px;height:6px}#muze-scroll-arrow-chevron-bottom:before{top:0;left:0;height:100%;width:51%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-bottom:after{right:0;width:50%}#muze-scroll-arrow-chevron-bottom:after,#muze-scroll-arrow-chevron-top:before{top:0;height:100%;-webkit-transform:skew(0deg,-35deg);transform:skew(0deg,-35deg)}#muze-scroll-arrow-chevron-top:before{left:0;width:51%}#muze-scroll-arrow-chevron-top:after{top:0;right:0;height:100%;width:50%;-webkit-transform:skew(0deg,35deg);transform:skew(0deg,35deg)}#muze-scroll-arrow-chevron-right:before{top:0;left:0;height:51%;width:100%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-right:after{bottom:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}#muze-scroll-arrow-chevron-left:before{bottom:0;left:0;width:100%;height:51%;-webkit-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}#muze-scroll-arrow-chevron-left:after{top:0;left:0;width:100%;height:50%;-webkit-transform:skew(-35deg,0deg);transform:skew(-35deg,0deg)}.muze-grid-normal{border-color:#ebebeb}.muze-grid-normal .muze-axis-name{font-size:12px;line-height:15px}.muze-grid-dark{border-color:#cbcbcb}.muze-grid-dark .muze-axis-name{font-size:12px;line-height:15px}.muze-grid-dark-bottom{border-bottom-color:#cbcbcb}.muze-grid-darker-top{border-top-color:#979797}.muze-grid-dark-top{border-top-color:#cbcbcb}.muze-grid-dark-right{border-right-color:#cbcbcb}.muze-grid-darker-bottom{border-bottom-color:#979797}.muze-grid-dark-left{border-left-color:#cbcbcb}.muze-grid-none-left{border-left-color:transparent}.muze-grid-none-right{border-right-color:transparent}.muze-grid-none-top{border-top-color:transparent}.muze-grid-none-bottom{border-bottom-color:transparent}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:200;src:local("Source Sans Pro ExtraLight Italic"),local("SourceSansPro-ExtraLightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZYokSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkido18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkidi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:300;src:local("Source Sans Pro Light Italic"),local("SourceSansPro-LightItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZMkids18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7qsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7jsDJB9cme_xc.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7rsDJB9cme_xc.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7ksDJB9cme_xc.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7osDJB9cme_xc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7psDJB9cme_xc.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local("Source Sans Pro Italic"),local("SourceSansPro-Italic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDJB9cme.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local("Source Sans Pro SemiBold Italic"),local("SourceSansPro-SemiBoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZY4lCds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSdi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local("Source Sans Pro Bold Italic"),local("SourceSansPro-BoldItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZclSds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydh18S0xR41YDw.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydo18S0xR41YDw.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydg18S0xR41YDw.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydv18S0xR41YDw.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydj18S0xR41YDw.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklydi18S0xR41YDw.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:900;src:local("Source Sans Pro Black Italic"),local("SourceSansPro-BlackItalic"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKwdSBYKcSV-LCoeQqfX1RYOo3qPZZklyds18S0xR41.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:200;src:local("Source Sans Pro ExtraLight"),local("SourceSansPro-ExtraLight"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i94_wlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:300;src:local("Source Sans Pro Light"),local("SourceSansPro-Light"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local("Source Sans Pro SemiBold"),local("SourceSansPro-SemiBold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local("Source Sans Pro Bold"),local("SourceSansPro-Bold"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmhdu3cOWxy40.woff2) format("woff2");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwkxdu3cOWxy40.woff2) format("woff2");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmxdu3cOWxy40.woff2) format("woff2");unicode-range:U+1f??}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0370-03ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmBdu3cOWxy40.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+1ea0-1ef9,U+20ab}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwmRdu3cOWxy40.woff2) format("woff2");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:900;src:local("Source Sans Pro Black"),local("SourceSansPro-Black"),url(https://fonts.gstatic.com/s/sourcesanspro/v11/6xKydSBYKcSV-LCoeQqfX1RYOo3iu4nwlxdu3cOWxw.woff2) format("woff2");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.muze-group-container,.muze-subtitle-cell,.muze-title-cell{font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif}.muze-group-container{font-size:12px;line-height:15px;-webkit-tap-highlight-color:rgba(0,0,0,0);line-height:1.42857143;color:#5f5f5f;background-color:transparent;margin:0}.muze-group-container *,.muze-group-container :after,.muze-group-container :before{-webkit-box-sizing:border-box;box-sizing:border-box}.muze-group-container .muze-table-arrow{margin:5px;width:0;height:0;position:absolute;opacity:.5;z-index:10;cursor:pointer}.muze-group-container .muze-table-arrow:hover{opacity:1}.muze-group-container .muze-table-arrow-right{left:100%;border-left:15px solid #4682b4}.muze-group-container .muze-table-arrow-left,.muze-group-container .muze-table-arrow-right{top:-webkit-calc(50% - 25px);top:calc(50% - 25px);border-top:20px solid transparent;border-bottom:20px solid transparent}.muze-group-container .muze-table-arrow-left{right:100%;border-right:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom{top:100%;border-top:15px solid #4682b4}.muze-group-container .muze-table-arrow-bottom,.muze-group-container .muze-table-arrow-top{left:-webkit-calc(50% - 25px);left:calc(50% - 25px);border-left:20px solid transparent;border-right:20px solid transparent}.muze-group-container .muze-table-arrow-top{bottom:100%;border-bottom:15px solid #4682b4}.muze-group-container .table-row-nested{visibility:hidden;border-top:none}.muze-group-container svg{display:block;width:inherit;height:inherit;float:left;vertical-align:top}.muze-group-container .axisName.hidden{opacity:0}.muze-group-container .axisName{opacity:1}.muze-group-container .grid-td svg{max-width:100%;max-height:100%}.muze-group-container .domain{opacity:0}.muze-board{float:left}.muze-layout-container{float:left;position:relative}.muze-board-legend,.muze-legend-section{text-align:center;float:left}.muze-legend-horizontal-section{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.muze-legend-components{text-align:center;float:left}.muze-grid-layout,.muze-grid-layout-container,.muze-grid-layout-row{float:left;position:relative}.muze-grid-table{background-color:transparent;border-spacing:0;table-layout:fixed}.muze-grid-td,.muze-grid-th{padding:0}.muze-table-header{width:inherit;height:inherit}.muze-grid-layout,.muze-layout-grid-container{float:left;position:relative}.muze-grid-top{position:relative;top:100%;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.muze-grid div{float:left}.muze-grid div,.muze-grid table{border-collapse:collapse}.muze-title-cell{font-size:24px;font-weight:700;color:#5f5f5f}.muze-grid-headers{font-size:12px}.muze-subtitle-cell{font-size:16px;font-weight:400;color:#b1b1b1}.domain{opacity:0}.muze-group-container,.muze-layout-container,.muze-legend-container{float:left}.muze-message-container{background-color:#f1f1f1;display:table;border:1px solid #c3c9d0}.muze-message-container-child{display:table-cell;vertical-align:middle}.muze-message-container-child-img{text-align:center}.muze-message-container-child-img svg{display:unset;float:unset}.muze-message-container-child-message{color:#4f708c;text-align:center;font-weight:600}.hidden{display:none} \ No newline at end of file diff --git a/release/dist/muze.js b/release/dist/muze.js new file mode 100644 index 00000000..7267db07 --- /dev/null +++ b/release/dist/muze.js @@ -0,0 +1,2 @@ +!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("muze",[],factory):"object"==typeof exports?exports.muze=factory():root.muze=factory()}(window,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=18)}([function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"name":"datamodel","description":"Relational algebra compliant in-memory tabular data store","homepage":"https://github.com/chartshq/datamodel","version":"2.3.0","license":"MIT","main":"dist/datamodel.js","keywords":["datamodel","data","relational","algebra","model","muze","fusioncharts","table","tabular","operation"],"author":"Muzejs.org (https://muzejs.org/)","repository":{"type":"git","url":"https://github.com/chartshq/datamodel.git"},"contributors":[{"name":"Akash Goswami","email":"akashgoswami90s@gmail.com"},{"name":"Subhash Haldar"},{"name":"Rousan Ali","email":"rousanali786@gmail.com","url":"https://rousan.io"},{"name":"Ujjal Kumar Dutta","email":"duttaujjalkumar@live.com"},{"name":"Ranajit Banerjee","email":"ranajit.113124@gmail.com"},{"name":"Adarsh Lilha","email":"adarshlilha@gmail.com"}],"dependencies":{"d3-dsv":"^1.0.8"},"devDependencies":{"babel-cli":"6.26.0","babel-core":"^6.26.3","babel-eslint":"6.1.2","babel-loader":"^7.1.4","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-flow":"^6.23.0","chai":"3.5.0","cross-env":"^5.0.5","eslint":"3.19.0","eslint-config-airbnb":"15.1.0","eslint-plugin-import":"2.7.0","eslint-plugin-jsx-a11y":"5.1.1","eslint-plugin-react":"7.3.0","istanbul-instrumenter-loader":"^3.0.0","jsdoc":"3.5.5","json2yaml":"^1.1.0","karma":"1.7.1","karma-chai":"0.1.0","karma-chrome-launcher":"2.1.1","karma-coverage-istanbul-reporter":"^1.3.0","karma-mocha":"1.3.0","karma-spec-reporter":"0.0.31","karma-webpack":"2.0.3","marked":"^0.5.0","mocha":"3.4.2","mocha-webpack":"0.7.0","transform-runtime":"0.0.0","webpack":"^4.12.0","webpack-cli":"^3.0.7","webpack-dev-server":"^3.1.4"},"scripts":{"test":"npm run lint && npm run ut","ut":"karma start karma.conf.js","utd":"karma start --single-run false --browsers Chrome karma.conf.js ","build":"npm run build:prod","build:dev":"webpack --mode development","build:prod":"webpack --mode production","start":"webpack-dev-server --config webpack.config.dev.js --mode development --open","lint":"eslint ./src","lint-errors":"eslint --quiet ./src","docs":"rm -rf yaml && mkdir yaml && jsdoc -c jsdoc.conf.json"}}')},function(e,t,n){var r=n(2);e.exports=r.default?r.default:r},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"DataFormat",function(){return o}),n.d(r,"DimensionSubtype",function(){return u}),n.d(r,"MeasureSubtype",function(){return c}),n.d(r,"FieldType",function(){return f}),n.d(r,"FilteringMode",function(){return l}),n.d(r,"GROUP_BY_FUNCTIONS",function(){return s});var i={};n.r(i),n.d(i,"Dimension",function(){return Me}),n.d(i,"Measure",function(){return xe}),n.d(i,"FieldParser",function(){return Le}),n.d(i,"fieldRegistry",function(){return ot}),n.d(i,"columnMajor",function(){return v});var a={};n.r(a),n.d(a,"sum",function(){return kn}),n.d(a,"avg",function(){return Dn}),n.d(a,"min",function(){return Tn}),n.d(a,"max",function(){return Fn}),n.d(a,"first",function(){return Nn}),n.d(a,"last",function(){return Rn}),n.d(a,"count",function(){return Pn}),n.d(a,"sd",function(){return Cn});var o={FLAT_JSON:"FlatJSON",DSV_STR:"DSVStr",DSV_ARR:"DSVArr",AUTO:"Auto"},u={CATEGORICAL:"categorical",TEMPORAL:"temporal",BINNED:"binned"},c={CONTINUOUS:"continuous"},f={MEASURE:"measure",DIMENSION:"dimension"},l={NORMAL:"normal",INVERSE:"inverse",ALL:"all"},s={SUM:"sum",AVG:"avg",MIN:"min",MAX:"max",FIRST:"first",LAST:"last",COUNT:"count",STD:"std"};function p(e){return e instanceof Date?e:new Date(e)}function d(e){return e<10?"0"+e:e}function h(e){this.format=e,this.dtParams=void 0,this.nativeDate=void 0}RegExp.escape=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},h.TOKEN_PREFIX="%",h.DATETIME_PARAM_SEQUENCE={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6},h.defaultNumberParser=function(e){return function(t){var n;return isFinite(n=parseInt(t,10))?n:e}},h.defaultRangeParser=function(e,t){return function(n){var r,i=void 0;if(!n)return t;var a=n.toLowerCase();for(i=0,r=e.length;ii.getFullYear()&&(t=""+(a-1)+r),p(t).getFullYear()},formatter:function formatter(e){var t=p(e).getFullYear().toString(),n=void 0;return t&&(n=t.length,t=t.substring(n-2,n)),t}},Y:{name:"Y",index:0,extract:function extract(){return"(\\d{4})"},parser:h.defaultNumberParser(),formatter:function formatter(e){return p(e).getFullYear().toString()}}}},h.getTokenFormalNames=function(){var e=h.getTokenDefinitions();return{HOUR:e.H,HOUR_12:e.l,AMPM_UPPERCASE:e.p,AMPM_LOWERCASE:e.P,MINUTE:e.M,SECOND:e.S,SHORT_DAY:e.a,LONG_DAY:e.A,DAY_OF_MONTH:e.e,DAY_OF_MONTH_CONSTANT_WIDTH:e.d,SHORT_MONTH:e.b,LONG_MONTH:e.B,MONTH_OF_YEAR:e.m,SHORT_YEAR:e.y,LONG_YEAR:e.Y}},h.tokenResolver=function(){var e=h.getTokenDefinitions(),t=function t(){for(var e=0,t=void 0,n=void 0,r=arguments.length;e=0;)o=e[a+1],-1!==r.indexOf(o)&&i.push({index:a,token:o});return i},h.formatAs=function(e,t){var n,r=p(e),i=h.findTokens(t),a=h.getTokenDefinitions(),o=String(t),u=h.TOKEN_PREFIX,c=void 0,f=void 0,l=void 0;for(l=0,n=i.length;l=0;p--)(f=a[p].index)+1!==s.length-1?(void 0===u&&(u=s.length),l=s.substring(f+2,u),s=s.substring(0,f+2)+RegExp.escape(l)+s.substring(u,s.length),u=f):u=f;for(p=0;p0&&e.split(",").forEach(function(e){var n=e.split("-"),r=+n[0],i=+(n[1]||n[0]);if(i>=r)for(var a=r;a<=i;a+=1)t(a)})}var R=function(){function e(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:V.CROSS,a=[],o=[],u=n||J,c=e.getFieldspace(),f=t.getFieldspace(),l=c.name,s=f.name,p=c.name+"."+f.name,d=H(c,f);if(l===s)throw new Error("DataModels must have different alias names");return c.fields.forEach(function(e){var t=O({},e.schema());-1===d.indexOf(t.name)||r||(t.name=c.name+"."+t.name),a.push(t)}),f.fields.forEach(function(e){var t=O({},e.schema());-1!==d.indexOf(t.name)?r||(t.name=f.name+"."+t.name,a.push(t)):a.push(t)}),N(e._rowDiffset,function(n){var p=!1,h=void 0;N(t._rowDiffset,function(v){var y=[],m={};m[l]={},m[s]={},c.fields.forEach(function(e){y.push(e.partialField.data[n]),m[l][e.name()]={rawValue:e.partialField.data[n],formattedValue:e.formattedData()[n]}}),f.fields.forEach(function(e){-1!==d.indexOf(e.schema().name)&&r||y.push(e.partialField.data[v]),m[s][e.name()]={rawValue:e.partialField.data[v],formattedValue:e.formattedData()[v]}});var b=Bt(m[l]),g=Bt(m[s]);if(u(b,g,function(){return e.detachedRoot()},function(){return t.detachedRoot()},{})){var _={};y.forEach(function(e,t){_[a[t].name]=e}),p&&V.CROSS!==i?o[h]=_:(o.push(_),p=!0,h=n)}else if((i===V.LEFTOUTER||i===V.RIGHTOUTER)&&!p){var w={},O=c.fields.length-1;y.forEach(function(e,t){w[a[t].name]=t<=O?e:null}),p=!0,h=n,o.push(w)}})}),new Sn(o,a,{name:p})}function z(e,t){var n=""+e,r=""+t;return nr?1:0}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;return e.length>1&&function e(t,n,r,i){if(r===n)return t;var a=n+Math.floor((r-n)/2);return e(t,n,a,i),e(t,a+1,r,i),function(e,t,n,r,i){for(var a=e,o=[],u=t;u<=r;u+=1)o[u]=a[u];for(var c=t,f=n+1,l=t;l<=r;l+=1)c>n?(a[l]=o[f],f+=1):f>r?(a[l]=o[c],c+=1):i(o[c],o[f])<=0?(a[l]=o[c],c+=1):(a[l]=o[f],f+=1)}(t,n,a,r,i),t}(e,0,e.length-1,t),e}var W=function W(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function X(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tt?1:-1}:function(e,t){return(e=""+e)==(t=""+t)?0:e>t?-1:1}}return n}(e.type,n)}function Z(e,t){var n=new Map,r=[];return e.forEach(function(e){var i=e[t];n.has(i)?r[n.get(i)][1].push(e):(r.push([i,[e]]),n.set(i,r.length-1))}),r}function $(e,t,n){var r={label:e[0]};return t.reduce(function(t,r,i){return t[r]=e[1].map(function(e){return e[n[i].index]}),t},r),r}function Q(e,t,n){for(var r=void 0,i=void 0,a=void 0,o=n.length-1;o>=0;o--)r=n[o][0],i=n[o][1],(a=sn(t,r))&&("function"==typeof i?K(e,function(e,t){return i(e[a.index],t[a.index])}):E(i)?function(){var n=Z(e,a.index),r=i[i.length-1],o=i.slice(0,i.length-1),u=o.map(function(e){return sn(t,e)});n.forEach(function(e){e.push($(e,o,u))}),K(n,function(e,t){var n=e[2],i=t[2];return r(n,i)}),e.length=0,n.forEach(function(t){e.push.apply(e,X(t[1]))})}():function(){var t=q(a,i);K(e,function(e,n){return t(e[a.index],n[a.index])})}())}var ee,te=function e(t,n,r,i){if(0===t.length)return n;var a=t[0],o=new Map;n.reduce(function(e,t){var n=t[a.index];return e.has(n)?e.get(n).push(t):e.set(n,[t]),e},o);var u=!0,c=!1,f=void 0;try{for(var l,s=o[Symbol.iterator]();!(u=(l=s.next()).done);u=!0){var p=l.value,d=W(p,2),h=d[0],v=d[1],y=e(t.slice(1),v,r,i);o.set(h,y),Array.isArray(y)&&Q(y,r,i)}}catch(e){c=!0,f=e}finally{try{!u&&s.return&&s.return()}finally{if(c)throw f}}return o};function re(e,t,n,r,i){var a={schema:[],data:[],uids:[]},o=(i=Object.assign({},{addUid:!1,columnWise:!1},i)).addUid,u=r&&r.length>0,c=[];if(n.split(",").forEach(function(t){for(var n=0;nr&&(r=i))}),[n,r]},Ke=function(){function e(e,t){for(var n=0;n=a?c=!0:(r=e.charCodeAt(o++))===ht?f=!0:r===vt&&(f=!0,e.charCodeAt(o)===ht&&++o),e.slice(i+1,t-1).replace(/""/g,'"')}for(;o9999?"+"+bt(t,6):bt(t,4))+"-"+bt(e.getUTCMonth()+1,2)+"-"+bt(e.getUTCDate(),2)+(a?"T"+bt(n,2)+":"+bt(r,2)+":"+bt(i,2)+"."+bt(a,3)+"Z":i?"T"+bt(n,2)+":"+bt(r,2)+":"+bt(i,2)+"Z":r||n?"T"+bt(n,2)+":"+bt(r,2)+"Z":"")}(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function parse(e,t){var n,i,a=r(e,function(e,r){if(n)return n(e,r-1);i=e,n=t?function(e,t){var n=yt(e);return function(r,i){return t(n(r),i,e)}}(e,t):yt(e)});return a.columns=i||[],a},parseRows:r,format:function format(t,n){return null==n&&(n=mt(t)),[n.map(o).join(e)].concat(i(t,n)).join("\n")},formatBody:function formatBody(e,t){return null==t&&(t=mt(e)),i(e,t).join("\n")},formatRows:function formatRows(e){return e.map(a).join("\n")},formatRow:a,formatValue:o}},wt=function wt(e,t,n){if(!Array.isArray(t))throw new Error("Schema missing or is in an unsupported format");var r=t.map(function(e){return e.name});n=Object.assign({},{firstRowHeader:!0},n);var i=[],a=v(i),o=r;n.firstRowHeader&&(o=e.splice(0,1)[0]);var u=o.reduce(function(e,t,n){return Object.assign(e,(a=n,(i=t)in(r={})?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r));var r,i,a},{});return e.forEach(function(e){var t=[];return r.forEach(function(n){var r=u[n];t.push(e[r])}),a.apply(void 0,t)}),[r,i]},Ot=function Ot(e,t,n){n=Object.assign({},{firstRowHeader:!0,fieldSeparator:","},n);var r=_t(n.fieldSeparator);return wt(r.parseRows(e),t,n)},Et=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){return e.store.set(t.type,t)}),this.store}},{key:"register",value:function value(e){return e instanceof lt?(this.store.set(e.type,e),this):null}},{key:"unregister",value:function value(e){return this.store.delete(e.type),this}},{key:"get",value:function value(e){return this.store.has(e)?this.store.get(e):null}}]),e}(),xt=function(){var e=null;return e||new It}(),Ut=function Ut(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3];t===L.COMPOSE?(e._derivation.length=0,(n=e._derivation).push.apply(n,Vt(i))):e._derivation.push({op:t,meta:r,criteria:i})})(t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},arguments[4]),function Jt(e,t){var n;(n=t._ancestorDerivation).push.apply(n,Vt(e._ancestorDerivation).concat(Vt(e._derivation)))}(e,t)},zt=(Lt(Ct={},l.NORMAL,{diffIndex:["rowDiffset"],calcDiff:[!0,!1]}),Lt(Ct,l.INVERSE,{diffIndex:["rejectRowDiffset"],calcDiff:[!1,!0]}),Lt(Ct,l.ALL,{diffIndex:["rowDiffset","rejectRowDiffset"],calcDiff:[!0,!0]}),Ct),Kt=function Kt(e,t,n){if(-1!==n&&t===n+1){var r=e.length-1;e[r]=e[r].split("-")[0]+"-"+t}else e.push(""+t)},Wt=function Wt(e,t,n){var r=[],i=[],a=Ut(zt[n].calcDiff,2),o=a[0],u=a[1];return N(e,function(e){var n=t(e);n&&o&&Kt(r,e,-1),!n&&u&&Kt(i,e,-1)}),{rowDiffset:r.join(","),rejectRowDiffset:i.join(",")}},qt=function qt(e,t,n,r,i){var a={},o=function o(){return r.detachedRoot()},u=n.mode,c=e._rowDiffset,f=e._partialFieldspace._cachedValueObjects;return i(c,function(e){return t(f[e],e,o,a)},u)},Qt=function Qt(e,t,n,r){var i=e[n];return i===U?r:t[i].internalValue},en=function en(e,t){return(t[0]instanceof Array?t:[t]).some(function(t){return e>=t[0]&&e<=t[1]})},tn=(Lt(Mt={},c.CONTINUOUS,en),Lt(Mt,u.TEMPORAL,en),Mt),rn=function rn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=n.operation||"and",a=n.filterByDim,o=void 0===a||a,u=n.filterByMeasure,c=void 0!==u&&u,l=n.clone,p=void 0===l||l?function Zt(e){var t=e.clone(!1),n=e.getPartialFieldspace();return t._colIdentifier=n.fields.map(function(e){return e.name()}).join(","),n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,t.__calculateFieldspace().calculateFieldsConfig(),t}(e):e,d=p.getFieldsConfig();return r=t.length?t.map(function(e){return function(e){var t=e.criteria,n=void 0===t?{}:t,r=n.identifiers,i=void 0===r?[[],[]]:r,a=n.range,u=Ut(i,2),l=u[0],s=void 0===l?[]:l,p=u[1],h=void 0===p?[]:p,v=s.reduce(function(e,t,n){return e[t]=n,e},{}),y=(s=s.filter(function(e){return e in d&&d[e].def.type===f.DIMENSION||e===U})).length,m={};if(y)for(var b=function b(e,t){var n=i[e],r=""+s.map(function(e){var t=v[e];return n[t]});m[r]=1},g=1,_=i.length;g<_;g++)b(g);var w=Object.keys(a||{}).filter(function(e){return e in d}),O=h.length||w.length;return c||(w=w.filter(function(e){return d[e].def.type!==f.MEASURE})),o||(w=w.filter(function(e){return d[e].def.type!==f.DIMENSION})),O?function(e,t){var n=!0;return o&&(n=!y||m[function $t(e,t,n,r){for(var i=n(e,t,0,r),a=1,o=e.length;a1&&void 0!==arguments[1]?arguments[1]:[];e._parent;)t.push(e),e=e._parent;return t}(e.model)}))})}i=(s=[]).concat.apply(s,[].concat(Vt(d.map(c)),[{criteria:e,groupedModel:null!==e&&e.fields.some(function(e){return e.type===f.MEASURE})?dn(n.propagationSource):null}])).filter(function(e){return null!==e}),l.push({criteria:i,excludeModels:[].concat(h,Vt(r.excludeModels||[]))})}var y=t.model,m=Object.assign({sourceIdentifiers:e,propagationSourceId:u},r);l.forEach(function(e){var t=e.criteria,n=rn(y,t,{filterByMeasure:!!t.find(function(e){return e.groupedModel===y})}),r=e.path;if(r){var i=function(e,t){for(var n=0,r=t.length;n2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.excludeModels||[],o=i.criteria;(!a.length||-1===a.indexOf(t))&&t.handlePropagation(n,r),t._children.forEach(function(t){var a=o.filter(function(e){return e.groupedModel===t}),u=pn(n,t);a.length&&(u=rn(u,a,{filterByDim:!1,filterByMeasure:!0,clone:!1})),e(t,u,r,i)})}(y,n,m,{excludeModels:e.excludeModels,criteria:t})})},gn=function gn(e,t,n){var r=e.reduce(function(e,r){return"RegExp"===r.constructor.name?e.push.apply(e,Vt(t.filter(function(e){return-1!==e.search(r)}))):r in n&&e.push(r),e},[]);return Array.from(new Set(r)).map(function(e){return e.trim()})},_n=function _n(e,t){return e.numberFormat?e.numberFormat()(t):t},wn=function(){function e(e,t){for(var n=0;n1?(i=e.clone(r.saveChild),an(i,u[c[1]],e,n,t),[o,i]):o}(this,e,t,{saveChild:t.saveChild})}},{key:"isEmpty",value:function value(){return!this._rowDiffset.length||!this._colIdentifier.length}},{key:"clone",value:function value(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new this.constructor(this);return e?t.setParent(this):t.setParent(null),t}},{key:"project",value:function value(e,t){var n={mode:l.NORMAL,saveChild:!0};t=Object.assign({},n,t);var r=this.getFieldsConfig(),i=Object.keys(r),a=t.mode,o=gn(e,i,r);return a===l.ALL?[on(this,o,{mode:l.NORMAL,saveChild:t.saveChild},i),on(this,o,{mode:l.INVERSE,saveChild:t.saveChild},i)]:on(this,o,t,i)}},{key:"getFieldsConfig",value:function value(){return this._fieldConfig}},{key:"calculateFieldsConfig",value:function value(){return this._fieldConfig=this._fieldspace.fields.reduce(function(e,t,n){return e[t.name()]={index:n,def:t.schema()},e},{}),this}},{key:"dispose",value:function value(){this._parent&&this._parent.removeChild(this),this._parent=null,this._children.forEach(function(e){e._parent=null}),this._children=[]}},{key:"removeChild",value:function value(e){var t=this._children.findIndex(function(t){return t===e});-1===t||this._children.splice(t,1)}},{key:"setParent",value:function value(e){this._parent&&this._parent.removeChild(this),this._parent=e,e&&e._children.push(this)}},{key:"getParent",value:function value(){return this._parent}},{key:"getChildren",value:function value(){return this._children}},{key:"getDerivations",value:function value(){return this._derivation}},{key:"getAncestorDerivations",value:function value(){return this._ancestorDerivation}}]),e}(),En=function En(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},jn=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{saveChild:!0},r=""+e.join(),a=function Ae(e,t,n,r){var i=function(e,t){var n=[],r=e.getFieldspace().getDimension();return Object.entries(r).forEach(function(e){var r=je(e,1)[0];t&&t.length?-1!==t.indexOf(r)&&n.push(r):n.push(r)}),n}(e,t),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=e.getFieldspace().getMeasure(),i=Ee.defaultReducer();return Object.keys(r).forEach(function(e){"string"!=typeof t[e]&&(t[e]=r[e].defAggFn());var a=Ee.resolve(t[e]);a?n[e]=a:(n[e]=i,t[e]=ge)}),n}(e,n),o=e.getFieldspace(),u=o.fieldsObj(),c=o.name,l=[],s=[],p=[],d={},h=[],v=void 0;Object.entries(u).forEach(function(e){var t=je(e,2),n=t[0],r=t[1];if(-1!==i.indexOf(n)||a[n])switch(p.push(O({},r.schema())),r.schema().type){case f.MEASURE:s.push(n);break;default:case f.DIMENSION:l.push(n)}});var y=0;N(e._rowDiffset,function(e){var t="";l.forEach(function(n){t=t+"-"+u[n].partialField.data[e]}),void 0===d[t]?(d[t]=y,h.push({}),l.forEach(function(t){h[y][t]=u[t].partialField.data[e]}),s.forEach(function(t){h[y][t]=[u[t].partialField.data[e]]}),y+=1):s.forEach(function(n){h[d[t]][n].push(u[n].partialField.data[e])})});var m={},b=function b(){return e.detachedRoot()};return h.forEach(function(e){var t=e;s.forEach(function(n){t[n]=a[n](e[n],b,m)})}),r?(r.__calculateFieldspace(),v=r):v=new xn(h,p,{name:c}),v}.apply(void 0,[this,e,t]);return Gt(this,a,L.GROUPBY,{fieldsArr:e,groupByString:r,defaultReducer:Ee.defaultReducer()},t),n.saveChild?a.setParent(this):a.setParent(null),a}},{key:"sort",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{saveChild:!1},n=this.getData({order:"row",sort:e}),i=[n.schema.map(function(e){return e.name})].concat(n.data),a=new this.constructor(i,n.schema,{dataFormat:"DSVArr"});return Gt(this,a,L.SORT,t,e),t.saveChild?a.setParent(this):a.setParent(null),a}},{key:"serialize",value:function value(e,t){e=e||this._dataFormat,t=Object.assign({},{fieldSeparator:","},t);var n=this.getFieldspace().fields,r=n.map(function(e){return e.formattedData()}),i=r[0].length,a=void 0,u=void 0,c=void 0;if(e===o.FLAT_JSON)for(a=[],u=0;u=0&&(n.fields[o]=e)}else n.fields.push(e),r.forEach(function(t,n){t[e.name()]=new F(i[n],a[n],e)});return n._cachedFieldsObj=null,n._cachedDimension=null,n._cachedMeasure=null,this.__calculateFieldspace().calculateFieldsConfig(),this}},{key:"calculateVariable",value:function value(e,t,n){var r=this;e=cn(e),n=Object.assign({},{saveChild:!0,replaceVar:!1},n);var i=this.getFieldsConfig(),a=t.slice(0,t.length-1),o=t[t.length-1];if(i[e.name]&&!n.replaceVar)throw new Error(e.name+" field already exists in datamodel");var u=a.map(function(e){var t=i[e];if(!t)throw new Error(e+" is not a valid column name.");return t.index}),c=this.clone(n.saveChild),f=c.getFieldspace().fields,l=u.map(function(e){return f[e]}),s={},p=function p(){return r.detachedRoot()},d=[];N(c._rowDiffset,function(e){var t=l.map(function(t){return t.partialField.data[e]});d[e]=o.apply(void 0,An(t).concat([e,p,s]))});var h=ut([d],[e],[e.name]),v=En(h,1)[0];return c.addField(v),Gt(this,c,L.CAL_VAR,{config:e,fields:a},o),c}},{key:"propagate",value:function value(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.isMutableAction,a=t.sourceId,o=t.payload,u=function hn(e){for(;e._parent;)e=e._parent;return e}(this),c=u._propagationNameSpace,l={groupByModel:dn(this),model:u};return n&&function bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],r=void 0,i=t.isMutableAction,a=t.criteria,o=t.action+"-"+t.sourceId;r=i?e.mutableActions:e.immutableActions,null===a?delete r[o]:r[o]={model:n,config:t}}(c,t,this),yn(e,l,{propagationNameSpace:c,sourceId:a,propagationSource:this},Object.assign({payload:o},t)),i&&function mn(e,t,n){var r=e.immutableActions;for(var i in r){var a=r[i],o=a.config,u=n.config.sourceId,c=!n.propConfig.filterImmutableAction||n.propConfig.filterImmutableAction(o,n.config);if(o.sourceId!==u&&c){var f=o.criteria;yn(f,{model:t,groupByModel:dn(a.model)},{propagationNameSpace:e,propagateToSource:!1,sourceId:u,propagationSource:a.model},o)}}}(c,u,{config:t,propConfig:r}),this}},{key:"on",value:function value(e,t){switch(e){case"propagation":this._onPropagation.push(t)}return this}},{key:"unsubscribe",value:function value(e){switch(e){case"propagation":this._onPropagation=[]}return this}},{key:"handlePropagation",value:function value(e,t){var n=this;this._onPropagation.forEach(function(r){return r.call(n,e,t)})}},{key:"bin",value:function value(e,t){var n=this.getFieldsConfig();if(!n[e])throw new Error("Field "+e+" doesn't exist");var r=t.name||e+"_binned";if(n[r])throw new Error("Field "+r+" already exists");var i=function(e,t,n){var r=n.buckets,i=n.binsCount,a=n.binSize,o=n.start,u=n.end,f=function M(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.domain(),2),l=f[0],s=f[1];r||(o=0!==o&&(!o||o>l)?l:o,u=0!==u&&(!u||ul&&r.unshift(l),r[r.length-1]<=s&&r.push(s+1);for(var p=[],d=0;d=(a=e[i=n+Math.floor((r-n)/2)]).start&&t=a.end?n=i+1:t2&&void 0!==arguments[2]?arguments[2]:function(e){return e},r=arguments[3],i=r.saveChild,a=e.getFieldspace().fieldsObj(),o=qt(e.clone(i),n,r,e,function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={mode:l.NORMAL,saveChild:!0},i=this.getFieldsConfig(),a=Object.keys(i),o=[[t]];return n=Object.assign({},r,n),(e=e.length?e:[[]]).forEach(function(e,n){o[n]=gn([].concat(An(e),An(t)),a,i)}),function un(e,t,n,r){return t.map(function(t){return on(e,t,n,r)})}(this,o,n,a)}}],[{key:"configureInvalidAwareTypes",value:function value(e){return C.invalidAwareVals(e)}},{key:"Reducers",get:function get(){return Ee}},{key:"Converters",get:function get(){return xt}},{key:"FieldTypes",get:function get(){return ot}}]),t}(),kn=be.sum,Dn=be.avg,Tn=be.min,Fn=be.max,Nn=be.first,Rn=be.last,Pn=be.count,Cn=be.std,Mn={compose:function compose(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{saveChild:!0},r=e,i=void 0,a=[];return t.forEach(function(e){r=e(r),a.push.apply(a,function Y(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t/gi),smartlabel},SmartLabelManager.store={},SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(!this._init)return!1;var size,csArr,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,container=this._container,style=this.style||{},cache=this._advancedCache||(this._advancedCache={}),advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]),cacheName=text+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||""),cacheInitName=text+"init"+(style.fontSize||"")+(style.fontFamily||"")+(style.fontWeight||"")+(style.fontStyle||"");return htmlSplCharSpace[text]&&(text=htmlSplCharSpace[text]),calculateDifference?void 0===(asymmetricDifference=cache[cacheInitName])&&(container.innerHTML=text.repeat?text.repeat(length):Array(length+1).join(text),tw=container.offsetWidth,container.innerHTML=text,twi=container.offsetWidth,asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1),advancedCacheKey.push(cacheInitName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()]):asymmetricDifference=0,(cachedStyle=cache[cacheName])?(csArr=cachedStyle.split(","),{width:parseFloat(csArr[0],10),height:parseFloat(csArr[1],10)}):(container.innerHTML=text,size={height:container.offsetHeight,width:container.offsetWidth+asymmetricDifference},cache[cacheName]=size.width+","+size.height,advancedCacheKey.push(cacheName),advancedCacheKey.length>maxAdvancedCacheLimit&&delete cache[advancedCacheKey.shift()],size)},SmartLabelManager.prototype._getWidthFn=function(){var contObj=this._containerObj,container=this._container,svgText=contObj.svgText;return svgText?function(str){var bbox,width;return svgText.textContent=str,(width=(bbox=svgText.getBBox()).width-SVG_BBOX_CORRECTION)<1&&(width=bbox.width),width}:function(str){return container.innerHTML=str,container.offsetWidth}},SmartLabelManager.prototype.setStyle=function(style){return this._init?style!==this.style||this._styleNotSet?(style||(style=this.style),slLib.setLineHeight(style),this.style=style,this._containerObj=sCont=this._containerManager.get(style),this._containerObj?(this._container=sCont.node,this._context=sCont.context,this._cache=sCont.charCache,this._lineHeight=sCont.lineHeight,this._styleNotSet=!1):this._styleNotSet=!0,this):void 0:this;var sCont},SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){return this._init?(this._showNoEllipses=!useEllipses,this):this},SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init)return!1;void 0===text||null===text?text="":"string"!=typeof text&&(text=text.toString());var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=!1,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],i=0,ellipsesStr=this._showNoEllipses?"":"...",lineHeight=this._lineHeight,context=this._context,container=this._container,sCont=this._containerObj,ellipsesWidth=sCont.ellipsesWidth,dotWidth=sCont.dotWidth,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,fastTrim=function fastTrim(str){for(var ws=/\s/,i=(str=str.replace(/^\s\s*/,"")).length;ws.test(str.charAt(i-=1)););return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:!1};if(getWidth=this._getWidthFn(),maxHeight===lineHeight&&(maxHeight*=1.2),container){if(!documentSupport.isBrowserLess){if((hasHTMLTag=slLib.xmlTagRegEx.test(text))?(container.innerHTML=text,smartLabel.oriTextWidth=oriWidth=container.offsetWidth,smartLabel.oriTextHeight=oriHeight=container.offsetHeight):(tmpText=text.replace(slLib.ltgtRegex,function(match){return"<"===match?"<":">"}),getOriSizeImproveObj=this.getOriSize(tmpText,!0),smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width,smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height),oriHeight<=maxHeight&&oriWidth<=maxWidth)return smartLabel.width=smartLabel.oriTextWidth=oriWidth,smartLabel.height=smartLabel.oriTextHeight=oriHeight,smartLabel;if(lineHeight>maxHeight)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=0,smartLabel.height=smartLabel.oriTextHeight=0,smartLabel}if(text=fastTrim(text).replace(/(\s+)/g," "),maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth,!hasHTMLTag){if(len=(oriTextArr=text.split("")).length,trimStr="",tempArr=[],tempChar=oriTextArr[0],this._cache[tempChar]?minWidth=this._cache[tempChar].width:(minWidth=getWidth(tempChar),this._cache[tempChar]={width:minWidth}),maxWidthWithEll>minWidth)i=(tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")).length;else{if(minWidth>maxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;ellipsesStr&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr=""))}if(strWidth=getWidth(tempArr.join("")),strHeight=this._lineHeight,noWrap){for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth))return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=getWidth(smartLabel.text),smartLabel.height=this._lineHeight,smartLabel;return smartLabel.text=tempArr.join(""),smartLabel.width=strWidth,smartLabel.height=this._lineHeight,smartLabel}for(;imaxWidthWithEll&&(trimStr||(trimStr=tempArr.slice(0,-1).join("")),strWidth>maxWidth)){if(lastSpace=text.substr(0,tempArr.length).lastIndexOf(" "),lastDash=text.substr(0,tempArr.length).lastIndexOf("-"),lastSpace>lastIndexBroken?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastSpace,1,"
"),lastIndexBroken=lastSpace,newCharIndex=lastSpace+1):lastDash>lastIndexBroken?(lastDash===tempArr.length-1?(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"
-")):(strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join("")),tempArr.splice(lastDash,1,"-
")),lastIndexBroken=lastDash,newCharIndex=lastDash+1):(tempArr.splice(tempArr.length-1,1,"
"+oriTextArr[i]),lastLineBreak=tempArr.length-2,strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join("")),lastIndexBroken=lastLineBreak,newCharIndex=i),(strHeight+=this._lineHeight)>maxHeight)return smartLabel.text=fastTrim(trimStr)+ellipsesStr,smartLabel.tooltext=smartLabel.oriText,smartLabel.width=maxWidth,smartLabel.height=strHeight-this._lineHeight,smartLabel;maxStrWidth=max(maxStrWidth,strWidth),trimStr=null,nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this),strWidth=getWidth(text.substr(newCharIndex,nearestChar||1)),tempArr.length)/g,'$1'),container.innerHTML=text,x=0,y=(spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString)).length;xmaxWidth)return smartLabel.text="",smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0,smartLabel;if(minWidth>maxWidthWithEll&&!this._showNoEllipses&&((maxWidthWithEll=maxWidth-2*dotWidth)>minWidth?ellipsesStr="..":(maxWidthWithEll=maxWidth-dotWidth)>minWidth?ellipsesStr=".":(maxWidthWithEll=0,ellipsesStr="")),initialLeft=characterArr[0].elem.offsetLeft,initialTop=characterArr[0].elem.offsetTop,noWrap)for(;imaxWidthWithEll&&(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),container.offsetWidth>maxWidth&&(removeFromIndex=i,i=len));else for(;imaxWidthWithEll?(removeFromIndexForEllipses||(removeFromIndexForEllipses=i),elemRightMostPoint>maxWidth&&(lastSpace=characterArr[i].spaceIdx,lastDash=characterArr[i].dashIdx,lastSpace>lastIndexBroken?(characterArr[lastSpace].elem.innerHTML="
",lastIndexBroken=lastSpace):lastDash>lastIndexBroken?(characterArr[lastDash].elem.innerHTML=lastDash===i?"
-":"-
",lastIndexBroken=lastDash):elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem),elem.offsetHeight+elem.offsetTop>maxHeight?(lastBR?lastBR.parentNode.removeChild(lastBR):lastIndexBroken===lastDash?characterArr[lastDash].elem.innerHTML="-":characterArr[lastSpace].elem.innerHTML=" ",removeFromIndex=i,i=len):removeFromIndexForEllipses=null)):elemLowestPoint>maxHeight&&(removeFromIndex=i,i=len);if(removeFromIndex=removeFromIndexForEllipses;i-=1)(elem=characterArr[i].elem).parentNode.removeChild(elem);for(;i>=0;i-=1)elem=characterArr[i].elem,slLib.classNameBrReg.test(elem.className)?elem.parentNode.removeChild(elem):i=0}return smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&\;/g,"&"),smartLabel.isTruncated&&(smartLabel.text+=ellipsesStr,smartLabel.tooltext=toolText),smartLabel.height=container.offsetHeight,smartLabel.width=container.offsetWidth,smartLabel}return smartLabel.error=new Error("Body Tag Missing!"),smartLabel},SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag){if(!this._init)return!1;var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,indiSizeStore={};if(!detailedCalculationFlag)return this._calCharDimWithCache(text);for(i=0,l=(textArr=text.split("")).length;i]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1$2',spanRemovalRegx:new RegExp("\\]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),ltgtRegex:/<|>/g,brReplaceRegex://gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;return doc.getElementsByClassName?(childRetriverFn="getElementsByClassName",childRetriverString=classNameWithTag,noClassTesting=!0):(childRetriverFn="getElementsByTagName",childRetriverString="span",noClassTesting=!1),{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild)return containerParent.appendChild(container=doc.createElement("DIV")),container.className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),container}else if((body=doc.getElementsByTagName("body")[0])&&body.appendChild)return(container=doc.createElement("DIV")).className=containerClass,container.setAttribute("aria-hidden","true"),container.setAttribute("role","presentation"),1,body.appendChild(container),container},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length)return 0;var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;if(difference=maxWidth,charLen=ceil(maxWidth/avgWidth),oriWidthtext.length&&(difference=maxWidth-oriWidth,charLen=text.length);difference>0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}for(;difference<0;){if(difference=maxWidth-getWidth(text.substr(0,charLen)),!(increment=floor(difference/avgWidth)))return charLen;charLen+=increment}return charLen},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize=styleObj.fontSize||"12px";return styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||1.2*parseInt(fSize,10)+"px",styleObj}}}};exports.default=lib,module.exports=exports.default},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(e,t){"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function value(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"next",value:function value(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});return r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,P(e)),o}},{key:"lock",value:function value(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function value(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:"prop",value:function value(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function value(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i5?maxContainers:5)<20?maxContainers:20,this.maxContainers=maxContainers,this.first=null,this.last=null,this.containers={},this.length=0,this.rootNode=parentContainer,isBrowserLess&&((svg=doc.createElementNS("http://www.w3.org/2000/svg","svg")).setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink"),svg.setAttributeNS("http://www.w3.org/2000/svg","height","0"),svg.setAttributeNS("http://www.w3.org/2000/svg","width","0"),this.svgRoot=svg,this.rootNode.appendChild(svg))}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle)void 0!==style[key]&&(keyStr+=slLib.supportedStyle[key]+":"+style[key]+";");if(!keyStr)return!1;if(containerObj=containers[keyStr])this.first!==containerObj&&(containerObj.prev&&(containerObj.prev.next=containerObj.next),containerObj.next&&(containerObj.next.prev=containerObj.prev),containerObj.next=this.first,containerObj.next.prev=containerObj,this.last===containerObj&&(this.last=containerObj.prev),containerObj.prev=null,this.first=containerObj);else{if(len>=max)for(diff=len-max+1;diff--;)this.removeContainer(this.last);containerObj=this.addContainer(keyStr)}return containerObj},ContainerManager.prototype.addContainer=function(keyStr){var node,container;return this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}},container.next=this.first,container.next&&(container.next.prev=container),this.first=container,this.last||(this.last=container),this.length+=1,node=container.node=doc.createElement("div"),this.rootNode.appendChild(node),documentSupport.isIE&&!documentSupport.hasSVG?node.style.setAttribute("cssText",keyStr):node.setAttribute("style",keyStr),node.setAttribute("aria-hidden","true"),node.setAttribute("role","presentation"),node.style.display="inline-block",node.innerHTML=slLib.testStrAvg,container.lineHeight=node.offsetHeight,container.avgCharWidth=node.offsetWidth/3,documentSupport.isBrowserLess?((node=container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("style",keyStr),this.svgRoot.appendChild(node),node.textContent=slLib.testStrAvg,container.lineHeight=node.getBBox().height,container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3,node.textContent="...",container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION,node.textContent=".",container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION):(node.innerHTML="...",container.ellipsesWidth=node.offsetWidth,node.innerHTML=".",container.dotWidth=node.offsetWidth,node.innerHTML=""),container},ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;keyStr&&this.length&&cObj&&(this.length-=1,cObj.prev&&(cObj.prev.next=cObj.next),cObj.next&&(cObj.next.prev=cObj.prev),this.first===cObj&&(this.first=cObj.next),this.last===cObj&&(this.last=cObj.prev),cObj.node.parentNode.removeChild(cObj.node),delete this.containers[keyStr])},ContainerManager.prototype.dispose=function(){var key,containers=this.containers;for(key in this.maxContainers=null,containers)this.removeContainer(containers[key]);this.rootNode.parentNode.removeChild(this.rootNode),this.rootNode=null,this.first=null,this.last=null},module.exports=ContainerManager},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,exports,__webpack_require__){},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var scales_namespaceObject={};__webpack_require__.r(scales_namespaceObject),__webpack_require__.d(scales_namespaceObject,"scaleLinear",function(){return linear_linear}),__webpack_require__.d(scales_namespaceObject,"scaleThreshold",function(){return threshold_threshold}),__webpack_require__.d(scales_namespaceObject,"scaleLog",function(){return log}),__webpack_require__.d(scales_namespaceObject,"scalePow",function(){return pow}),__webpack_require__.d(scales_namespaceObject,"scaleIdentity",function(){return identity_identity}),__webpack_require__.d(scales_namespaceObject,"scaleOrdinal",function(){return ordinal}),__webpack_require__.d(scales_namespaceObject,"scaleSequential",function(){return sequential}),__webpack_require__.d(scales_namespaceObject,"scaleQuantize",function(){return quantize}),__webpack_require__.d(scales_namespaceObject,"scaleQuantile",function(){return quantile_quantile}),__webpack_require__.d(scales_namespaceObject,"schemeCategory10",function(){return category10}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20",function(){return category20}),__webpack_require__.d(scales_namespaceObject,"schemeCategory20b",function(){return category20b}),__webpack_require__.d(scales_namespaceObject,"scaleBand",function(){return band}),__webpack_require__.d(scales_namespaceObject,"scaleTime",function(){return src_time});var color_schemes_namespaceObject={};__webpack_require__.r(color_schemes_namespaceObject),__webpack_require__.d(color_schemes_namespaceObject,"schemeDark2",function(){return Dark2}),__webpack_require__.d(color_schemes_namespaceObject,"schemePaired",function(){return Paired}),__webpack_require__.d(color_schemes_namespaceObject,"schemeAccent",function(){return Accent}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel1",function(){return Pastel1}),__webpack_require__.d(color_schemes_namespaceObject,"schemePastel2",function(){return Pastel2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet1",function(){return Set1}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet2",function(){return Set2}),__webpack_require__.d(color_schemes_namespaceObject,"schemeSet3",function(){return Set3}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBlues",function(){return Blues_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemeBrBG",function(){return BrBG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePRGn",function(){return PRGn_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"schemePiYG",function(){return PiYG_scheme}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBrBG",function(){return BrBG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePRGn",function(){return PRGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePiYG",function(){return PiYG}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuOr",function(){return PuOr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdBu",function(){return RdBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdGy",function(){return RdGy}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlBu",function(){return RdYlBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdYlGn",function(){return RdYlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateSpectral",function(){return Spectral}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBlues",function(){return Blues}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreens",function(){return Greens}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGreys",function(){return Greys}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOranges",function(){return Oranges}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePurples",function(){return Purples}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateReds",function(){return Reds}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateViridis",function(){return sequential_multi_viridis}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateInferno",function(){return viridis_inferno}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateMagma",function(){return viridis_magma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePlasma",function(){return viridis_plasma}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateWarm",function(){return rainbow_warm}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCool",function(){return rainbow_cool}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateCubehelixDefault",function(){return sequential_multi_cubehelix}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuGn",function(){return BuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateBuPu",function(){return BuPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateGnBu",function(){return GnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateOrRd",function(){return OrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBuGn",function(){return PuBuGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuBu",function(){return PuBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolatePuRd",function(){return PuRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRdPu",function(){return RdPu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGnBu",function(){return YlGnBu}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlGn",function(){return YlGn}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrBr",function(){return YlOrBr}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateYlOrRd",function(){return YlOrRd}),__webpack_require__.d(color_schemes_namespaceObject,"interpolateRainbow",function(){return sequential_multi_rainbow});var namespace_namespaceObject={};__webpack_require__.r(namespace_namespaceObject),__webpack_require__.d(namespace_namespaceObject,"UNIT_GLOBAL_NAMESPACE",function(){return UNIT_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"UNIT_LOCAL_NAMESPACE",function(){return UNIT_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_LOCAL_NAMESPACE",function(){return LAYER_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"LAYER_GLOBAL_NAMESPACE",function(){return LAYER_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_GLOBAL_NAMESPACE",function(){return GROUP_GLOBAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"GROUP_LOCAL_NAMESPACE",function(){return GROUP_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_LOCAL_NAMESPACE",function(){return CANVAS_LOCAL_NAMESPACE}),__webpack_require__.d(namespace_namespaceObject,"CANVAS_GLOBAL_NAMESPACE",function(){return CANVAS_GLOBAL_NAMESPACE});var muze_utils_src_namespaceObject={};__webpack_require__.r(muze_utils_src_namespaceObject),__webpack_require__.d(muze_utils_src_namespaceObject,"InvalidAwareTypes",function(){return src_InvalidAwareTypes}),__webpack_require__.d(muze_utils_src_namespaceObject,"DataModel",function(){return datamodel_default.a}),__webpack_require__.d(muze_utils_src_namespaceObject,"ReservedFields",function(){return reserved_fields}),__webpack_require__.d(muze_utils_src_namespaceObject,"CommonProps",function(){return common_props}),__webpack_require__.d(muze_utils_src_namespaceObject,"COORD_TYPES",function(){return COORD_TYPES}),__webpack_require__.d(muze_utils_src_namespaceObject,"STATE_NAMESPACES",function(){return namespace_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"scales",function(){return scales_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"colorSchemes",function(){return color_schemes_namespaceObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"getNearestValue",function(){return getNearestValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"getValueParser",function(){return getValueParser}),__webpack_require__.d(muze_utils_src_namespaceObject,"transformColor",function(){return common_utils_transformColor}),__webpack_require__.d(muze_utils_src_namespaceObject,"transformColors",function(){return common_utils_transformColors}),__webpack_require__.d(muze_utils_src_namespaceObject,"detectColor",function(){return detectColor}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslToRgb",function(){return hslToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"rgbToHsv",function(){return rgbToHsv}),__webpack_require__.d(muze_utils_src_namespaceObject,"hexToHsv",function(){return hexToHsv}),__webpack_require__.d(muze_utils_src_namespaceObject,"hsvToRgb",function(){return hsvToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslaToRgb",function(){return hslaToRgb}),__webpack_require__.d(muze_utils_src_namespaceObject,"escapeHTML",function(){return escapeHTML}),__webpack_require__.d(muze_utils_src_namespaceObject,"angleToRadian",function(){return angleToRadian}),__webpack_require__.d(muze_utils_src_namespaceObject,"generateGetterSetters",function(){return generateGetterSetters}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArraySum",function(){return getArraySum}),__webpack_require__.d(muze_utils_src_namespaceObject,"ERROR_MSG",function(){return ERROR_MSG}),__webpack_require__.d(muze_utils_src_namespaceObject,"interpolator",function(){return common_utils_interpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"colorInterpolator",function(){return common_utils_colorInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"numberInterpolator",function(){return common_utils_numberInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"piecewiseInterpolator",function(){return common_utils_piecewiseInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"reqAnimFrame",function(){return reqAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"cancelAnimFrame",function(){return cancelAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"nextAnimFrame",function(){return nextAnimFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMax",function(){return getMax}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMin",function(){return getMin}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDomainFromData",function(){return getDomainFromData}),__webpack_require__.d(muze_utils_src_namespaceObject,"getUniqueId",function(){return getUniqueId}),__webpack_require__.d(muze_utils_src_namespaceObject,"mergeRecursive",function(){return mergeRecursive}),__webpack_require__.d(muze_utils_src_namespaceObject,"unionDomain",function(){return unionDomain}),__webpack_require__.d(muze_utils_src_namespaceObject,"replaceCSSPrefix",function(){return replaceCSSPrefix}),__webpack_require__.d(muze_utils_src_namespaceObject,"symbolFns",function(){return symbolFns}),__webpack_require__.d(muze_utils_src_namespaceObject,"defaultValue",function(){return defaultValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"easeFns",function(){return easeFns}),__webpack_require__.d(muze_utils_src_namespaceObject,"clone",function(){return clone}),__webpack_require__.d(muze_utils_src_namespaceObject,"interpolateArray",function(){return interpolateArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMinPoint",function(){return getMinPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMaxPoint",function(){return getMaxPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"getClosestIndexOf",function(){return common_utils_getClosestIndexOf}),__webpack_require__.d(muze_utils_src_namespaceObject,"registerListeners",function(){return common_utils_registerListeners}),__webpack_require__.d(muze_utils_src_namespaceObject,"Voronoi",function(){return common_utils_Voronoi}),__webpack_require__.d(muze_utils_src_namespaceObject,"checkExistence",function(){return checkExistence}),__webpack_require__.d(muze_utils_src_namespaceObject,"sanitizeIP",function(){return sanitizeIP}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMinDiff",function(){return getMinDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"capitalizeFirst",function(){return capitalizeFirst}),__webpack_require__.d(muze_utils_src_namespaceObject,"getWindow",function(){return getWindow}),__webpack_require__.d(muze_utils_src_namespaceObject,"getQualifiedClassName",function(){return getQualifiedClassName}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDependencyOrder",function(){return getDependencyOrder}),__webpack_require__.d(muze_utils_src_namespaceObject,"objectIterator",function(){return objectIterator}),__webpack_require__.d(muze_utils_src_namespaceObject,"intSanitizer",function(){return intSanitizer}),__webpack_require__.d(muze_utils_src_namespaceObject,"enableChainedTransaction",function(){return enableChainedTransaction}),__webpack_require__.d(muze_utils_src_namespaceObject,"isHTMLElem",function(){return isHTMLElem}),__webpack_require__.d(muze_utils_src_namespaceObject,"isEqual",function(){return common_utils_isEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"isSimpleObject",function(){return isSimpleObject}),__webpack_require__.d(muze_utils_src_namespaceObject,"nextFrame",function(){return nextFrame}),__webpack_require__.d(muze_utils_src_namespaceObject,"getObjProp",function(){return getObjProp}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDataModelFromIdentifiers",function(){return common_utils_getDataModelFromIdentifiers}),__webpack_require__.d(muze_utils_src_namespaceObject,"getDataModelFromRange",function(){return getDataModelFromRange}),__webpack_require__.d(muze_utils_src_namespaceObject,"transposeArray",function(){return transposeArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"toArray",function(){return toArray}),__webpack_require__.d(muze_utils_src_namespaceObject,"extendsClass",function(){return extendsClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"concatModels",function(){return common_utils_concatModels}),__webpack_require__.d(muze_utils_src_namespaceObject,"assembleModelFromIdentifiers",function(){return assembleModelFromIdentifiers}),__webpack_require__.d(muze_utils_src_namespaceObject,"isValidValue",function(){return isValidValue}),__webpack_require__.d(muze_utils_src_namespaceObject,"nestCollection",function(){return common_utils_nestCollection}),__webpack_require__.d(muze_utils_src_namespaceObject,"stack",function(){return common_utils_stack}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSymbol",function(){return common_utils_getSymbol}),__webpack_require__.d(muze_utils_src_namespaceObject,"Scales",function(){return Scales}),__webpack_require__.d(muze_utils_src_namespaceObject,"Symbols",function(){return Symbols}),__webpack_require__.d(muze_utils_src_namespaceObject,"pathInterpolators",function(){return pathInterpolators}),__webpack_require__.d(muze_utils_src_namespaceObject,"hslInterpolator",function(){return common_utils_hslInterpolator}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSmallestDiff",function(){return getSmallestDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"require",function(){return require}),__webpack_require__.d(muze_utils_src_namespaceObject,"formatTemporal",function(){return common_utils_formatTemporal}),__webpack_require__.d(muze_utils_src_namespaceObject,"nearestSortingDetails",function(){return common_utils_nearestSortingDetails}),__webpack_require__.d(muze_utils_src_namespaceObject,"createSelection",function(){return common_utils_createSelection}),__webpack_require__.d(muze_utils_src_namespaceObject,"temporalFields",function(){return common_utils_temporalFields}),__webpack_require__.d(muze_utils_src_namespaceObject,"retrieveNearestGroupByReducers",function(){return common_utils_retrieveNearestGroupByReducers}),__webpack_require__.d(muze_utils_src_namespaceObject,"retrieveFieldDisplayName",function(){return retrieveFieldDisplayName}),__webpack_require__.d(muze_utils_src_namespaceObject,"sanitizeDomainWhenEqual",function(){return sanitizeDomainWhenEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"sortCategoricalField",function(){return sortCategoricalField}),__webpack_require__.d(muze_utils_src_namespaceObject,"intersect",function(){return common_utils_intersect}),__webpack_require__.d(muze_utils_src_namespaceObject,"partition",function(){return partition}),__webpack_require__.d(muze_utils_src_namespaceObject,"mix",function(){return mix}),__webpack_require__.d(muze_utils_src_namespaceObject,"componentRegistry",function(){return common_utils_componentRegistry}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArrayDiff",function(){return getArrayDiff}),__webpack_require__.d(muze_utils_src_namespaceObject,"difference",function(){return difference}),__webpack_require__.d(muze_utils_src_namespaceObject,"getArrayIndexMap",function(){return getArrayIndexMap}),__webpack_require__.d(muze_utils_src_namespaceObject,"arraysEqual",function(){return arraysEqual}),__webpack_require__.d(muze_utils_src_namespaceObject,"getReadableTicks",function(){return common_utils_getReadableTicks}),__webpack_require__.d(muze_utils_src_namespaceObject,"unique",function(){return unique}),__webpack_require__.d(muze_utils_src_namespaceObject,"dmMultipleSelection",function(){return common_utils_dmMultipleSelection}),__webpack_require__.d(muze_utils_src_namespaceObject,"pointWithinCircle",function(){return pointWithinCircle}),__webpack_require__.d(muze_utils_src_namespaceObject,"selectElement",function(){return renderer_utils_selectElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"makeElement",function(){return makeElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"applyStyle",function(){return renderer_utils_applyStyle}),__webpack_require__.d(muze_utils_src_namespaceObject,"addClass",function(){return renderer_utils_addClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"removeClass",function(){return renderer_utils_removeClass}),__webpack_require__.d(muze_utils_src_namespaceObject,"appendElement",function(){return appendElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"setAttrs",function(){return renderer_utils_setAttrs}),__webpack_require__.d(muze_utils_src_namespaceObject,"setStyles",function(){return renderer_utils_setStyles}),__webpack_require__.d(muze_utils_src_namespaceObject,"createElement",function(){return renderer_utils_createElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"createElements",function(){return renderer_utils_createElements}),__webpack_require__.d(muze_utils_src_namespaceObject,"clipElement",function(){return renderer_utils_clipElement}),__webpack_require__.d(muze_utils_src_namespaceObject,"getElementsByClassName",function(){return renderer_utils_getElementsByClassName}),__webpack_require__.d(muze_utils_src_namespaceObject,"getMousePos",function(){return getMousePos}),__webpack_require__.d(muze_utils_src_namespaceObject,"getEvent",function(){return renderer_utils_getEvent}),__webpack_require__.d(muze_utils_src_namespaceObject,"getD3Drag",function(){return renderer_utils_getD3Drag}),__webpack_require__.d(muze_utils_src_namespaceObject,"getSmartComputedStyle",function(){return renderer_utils_getSmartComputedStyle}),__webpack_require__.d(muze_utils_src_namespaceObject,"getClientPoint",function(){return renderer_utils_getClientPoint}),__webpack_require__.d(muze_utils_src_namespaceObject,"hasTouch",function(){return hasTouch}),__webpack_require__.d(muze_utils_src_namespaceObject,"Store",function(){return store_Store}),__webpack_require__.d(muze_utils_src_namespaceObject,"transactor",function(){return store_transactor}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMillisecond",function(){return src_millisecond}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeSecond",function(){return src_second}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMinute",function(){return src_minute}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeHour",function(){return src_hour}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeDay",function(){return src_day}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeWeek",function(){return sunday}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeMonth",function(){return src_month}),__webpack_require__.d(muze_utils_src_namespaceObject,"timeYear",function(){return src_year}),__webpack_require__.d(muze_utils_src_namespaceObject,"Smartlabel",function(){return SmartlabelManager_default.a}),__webpack_require__.d(muze_utils_src_namespaceObject,"dataSelect",function(){return dataSelect}),__webpack_require__.d(muze_utils_src_namespaceObject,"LifeCycleManager",function(){return lifecycle_manager}),__webpack_require__.d(muze_utils_src_namespaceObject,"DimensionSubtype",function(){return dist_datamodel.DimensionSubtype}),__webpack_require__.d(muze_utils_src_namespaceObject,"FieldType",function(){return dist_datamodel.FieldType}),__webpack_require__.d(muze_utils_src_namespaceObject,"MeasureSubtype",function(){return dist_datamodel.MeasureSubtype}),__webpack_require__.d(muze_utils_src_namespaceObject,"DateTimeFormatter",function(){return dist_datamodel.DateTimeFormatter}),__webpack_require__.d(muze_utils_src_namespaceObject,"DM_DERIVATIVES",function(){return dist_datamodel.DM_DERIVATIVES}),__webpack_require__.d(muze_utils_src_namespaceObject,"GROUP_BY_FUNCTIONS",function(){return dist_datamodel.GROUP_BY_FUNCTIONS}),__webpack_require__.d(muze_utils_src_namespaceObject,"RTree",function(){return RTree});var enums_constants_namespaceObject={};__webpack_require__.r(enums_constants_namespaceObject),__webpack_require__.d(enums_constants_namespaceObject,"CLASSPREFIX",function(){return CLASSPREFIX}),__webpack_require__.d(enums_constants_namespaceObject,"STACK",function(){return STACK}),__webpack_require__.d(enums_constants_namespaceObject,"GROUP",function(){return GROUP}),__webpack_require__.d(enums_constants_namespaceObject,"IDENTITY",function(){return IDENTITY}),__webpack_require__.d(enums_constants_namespaceObject,"ANGLE",function(){return constants_ANGLE}),__webpack_require__.d(enums_constants_namespaceObject,"RADIUS",function(){return constants_RADIUS}),__webpack_require__.d(enums_constants_namespaceObject,"SIZE",function(){return SIZE}),__webpack_require__.d(enums_constants_namespaceObject,"COLOR",function(){return COLOR}),__webpack_require__.d(enums_constants_namespaceObject,"SHAPE",function(){return SHAPE}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT",function(){return TEXT}),__webpack_require__.d(enums_constants_namespaceObject,"OUTER_RADIUS_VALUE",function(){return OUTER_RADIUS_VALUE}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT_ANCHOR_MIDDLE",function(){return TEXT_ANCHOR_MIDDLE}),__webpack_require__.d(enums_constants_namespaceObject,"ENCODING",function(){return ENCODING}),__webpack_require__.d(enums_constants_namespaceObject,"STROKE_DASHARRAY",function(){return STROKE_DASHARRAY}),__webpack_require__.d(enums_constants_namespaceObject,"ASCENDING",function(){return ASCENDING}),__webpack_require__.d(enums_constants_namespaceObject,"AGG_FN_SUM",function(){return AGG_FN_SUM}),__webpack_require__.d(enums_constants_namespaceObject,"AREA_LAYER",function(){return AREA_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"ARC_LAYER",function(){return ARC_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"LINE_LAYER",function(){return LINE_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"TEXT_LAYER",function(){return TEXT_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"POINT_LAYER",function(){return POINT_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"BAR_LAYER",function(){return BAR_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"TICK_LAYER",function(){return TICK_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"SIMPLE_LAYER",function(){return SIMPLE_LAYER}),__webpack_require__.d(enums_constants_namespaceObject,"BASE_LAYER",function(){return BASE_LAYER});var props_namespaceObject={};__webpack_require__.r(props_namespaceObject),__webpack_require__.d(props_namespaceObject,"DATA",function(){return DATA}),__webpack_require__.d(props_namespaceObject,"CONFIG",function(){return CONFIG}),__webpack_require__.d(props_namespaceObject,"MEASUREMENT",function(){return MEASUREMENT}),__webpack_require__.d(props_namespaceObject,"DOMAIN",function(){return DOMAIN}),__webpack_require__.d(props_namespaceObject,"MOUNT",function(){return MOUNT});var axis_orientation_namespaceObject={};__webpack_require__.r(axis_orientation_namespaceObject),__webpack_require__.d(axis_orientation_namespaceObject,"BOTTOM",function(){return axis_orientation_BOTTOM}),__webpack_require__.d(axis_orientation_namespaceObject,"TOP",function(){return axis_orientation_TOP}),__webpack_require__.d(axis_orientation_namespaceObject,"LEFT",function(){return axis_orientation_LEFT}),__webpack_require__.d(axis_orientation_namespaceObject,"RIGHT",function(){return axis_orientation_RIGHT}),__webpack_require__.d(axis_orientation_namespaceObject,"axisOrientationMap",function(){return axisOrientationMap});var scale_type_namespaceObject={};__webpack_require__.r(scale_type_namespaceObject),__webpack_require__.d(scale_type_namespaceObject,"LINEAR",function(){return LINEAR}),__webpack_require__.d(scale_type_namespaceObject,"BAND",function(){return BAND}),__webpack_require__.d(scale_type_namespaceObject,"TIME",function(){return TIME}),__webpack_require__.d(scale_type_namespaceObject,"COLOR",function(){return scale_type_COLOR}),__webpack_require__.d(scale_type_namespaceObject,"ORDINAL",function(){return ORDINAL}),__webpack_require__.d(scale_type_namespaceObject,"QUANTIZE",function(){return QUANTIZE}),__webpack_require__.d(scale_type_namespaceObject,"QUANTILE",function(){return QUANTILE}),__webpack_require__.d(scale_type_namespaceObject,"LOG",function(){return LOG}),__webpack_require__.d(scale_type_namespaceObject,"POW",function(){return POW}),__webpack_require__.d(scale_type_namespaceObject,"IDENTITY",function(){return scale_type_IDENTITY}),__webpack_require__.d(scale_type_namespaceObject,"SEQUENTIAL",function(){return SEQUENTIAL}),__webpack_require__.d(scale_type_namespaceObject,"THRESHOLD",function(){return THRESHOLD});var visual_group_src_enums_constants_namespaceObject={};__webpack_require__.r(visual_group_src_enums_constants_namespaceObject),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"X",function(){return X}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"Y",function(){return Y}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"WIDTH",function(){return WIDTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HEIGHT",function(){return HEIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASUREMENT",function(){return constants_MEASUREMENT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CONFIG",function(){return constants_CONFIG}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MIN_UNIT_WIDTH",function(){return MIN_UNIT_WIDTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MIN_UNIT_HEIGHT",function(){return MIN_UNIT_HEIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DIMENSIONS",function(){return DIMENSIONS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASURES",function(){return MEASURES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DIMENSION",function(){return DIMENSION}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MEASURE",function(){return MEASURE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"PIVOT",function(){return PIVOT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FORMAT",function(){return FORMAT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"MOUNT",function(){return constants_MOUNT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HAS_DATA_UPDATED",function(){return HAS_DATA_UPDATED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ROWS",function(){return ROWS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLUMNS",function(){return COLUMNS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DATA",function(){return constants_DATA}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COL",function(){return COL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ROW",function(){return ROW}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLUMN",function(){return COLUMN}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"COLOR",function(){return enums_constants_COLOR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SHAPE",function(){return enums_constants_SHAPE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SIZE",function(){return enums_constants_SIZE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DETAIL",function(){return DETAIL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LAYERS",function(){return LAYERS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TRANSFORM",function(){return TRANSFORM}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ORDINAL",function(){return enums_constants_ORDINAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LINEAR",function(){return enums_constants_LINEAR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LEFT",function(){return constants_LEFT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RIGHT",function(){return constants_RIGHT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TOP",function(){return enums_constants_TOP}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BOTTOM",function(){return enums_constants_BOTTOM}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RETINAL",function(){return RETINAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CELL",function(){return CELL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"X_AXES",function(){return X_AXES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"Y_AXES",function(){return Y_AXES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ENTRY_CELLS",function(){return ENTRY_CELLS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"INITIALIZED",function(){return INITIALIZED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"EXIT_CELLS",function(){return EXIT_CELLS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"AXIS",function(){return AXIS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"UNIT",function(){return UNIT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"UPDATED",function(){return UPDATED}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BEFORE_UPDATE",function(){return BEFORE_UPDATE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"VALUE_MATRIX",function(){return VALUE_MATRIX}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FACET_HEADERS",function(){return FACET_HEADERS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"RADIUS",function(){return enums_constants_RADIUS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ANGLE",function(){return enums_constants_ANGLE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ANGLE0",function(){return ANGLE0}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ARC",function(){return ARC}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"CATEGORICAL",function(){return constants_CATEGORICAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"TEMPORAL",function(){return constants_TEMPORAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BAR",function(){return BAR}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"LINE",function(){return LINE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"POINT",function(){return POINT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"PRIMARY",function(){return PRIMARY}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"SECONDARY",function(){return SECONDARY}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"BOTH",function(){return BOTH}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"INTERACTION",function(){return INTERACTION}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"GRID_LINES",function(){return GRID_LINES}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"GRID_BANDS",function(){return GRID_BANDS}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"HEADER",function(){return HEADER}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"FACET",function(){return FACET}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DEFAULT",function(){return DEFAULT}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"ASCENDING",function(){return constants_ASCENDING}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DESCENDING",function(){return DESCENDING}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DARK",function(){return DARK}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"NONE",function(){return NONE}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"NORMAL",function(){return NORMAL}),__webpack_require__.d(visual_group_src_enums_constants_namespaceObject,"DARKER",function(){return DARKER});var helpers_namespaceObject={};__webpack_require__.r(helpers_namespaceObject),__webpack_require__.d(helpers_namespaceObject,"transformColor",function(){return helpers_transformColor}),__webpack_require__.d(helpers_namespaceObject,"applyInteractionStyle",function(){return helpers_applyInteractionStyle}),__webpack_require__.d(helpers_namespaceObject,"retrieveEncodingInf",function(){return helpers_retrieveEncodingInf}),__webpack_require__.d(helpers_namespaceObject,"encodingFieldInfRetriever",function(){return encodingFieldInfRetriever}),__webpack_require__.d(helpers_namespaceObject,"setNullsInStack",function(){return setNullsInStack}),__webpack_require__.d(helpers_namespaceObject,"setNulls",function(){return helpers_setNulls}),__webpack_require__.d(helpers_namespaceObject,"transformData",function(){return helpers_transformData}),__webpack_require__.d(helpers_namespaceObject,"getIndividualClassName",function(){return getIndividualClassName}),__webpack_require__.d(helpers_namespaceObject,"dataNormalizers",function(){return dataNormalizers}),__webpack_require__.d(helpers_namespaceObject,"getNormalizedData",function(){return helpers_getNormalizedData}),__webpack_require__.d(helpers_namespaceObject,"domainCalculator",function(){return domainCalculator}),__webpack_require__.d(helpers_namespaceObject,"attachDataToVoronoi",function(){return helpers_attachDataToVoronoi}),__webpack_require__.d(helpers_namespaceObject,"updateStyle",function(){return helpers_updateStyle}),__webpack_require__.d(helpers_namespaceObject,"animateGroup",function(){return helpers_animateGroup}),__webpack_require__.d(helpers_namespaceObject,"positionPoints",function(){return positionPoints}),__webpack_require__.d(helpers_namespaceObject,"getGroupSpan",function(){return getGroupSpan}),__webpack_require__.d(helpers_namespaceObject,"getPlotMeasurement",function(){return helpers_getPlotMeasurement}),__webpack_require__.d(helpers_namespaceObject,"renderLayer",function(){return helpers_renderLayer}),__webpack_require__.d(helpers_namespaceObject,"resolveInvalidTransformType",function(){return helpers_resolveInvalidTransformType}),__webpack_require__.d(helpers_namespaceObject,"getValidTransform",function(){return getValidTransform}),__webpack_require__.d(helpers_namespaceObject,"getValidTransformForAggFn",function(){return helpers_getValidTransformForAggFn}),__webpack_require__.d(helpers_namespaceObject,"getMarkId",function(){return helpers_getMarkId}),__webpack_require__.d(helpers_namespaceObject,"resolveEncodingValues",function(){return helpers_resolveEncodingValues}),__webpack_require__.d(helpers_namespaceObject,"getColorMetaInf",function(){return getColorMetaInf}),__webpack_require__.d(helpers_namespaceObject,"toCartesianCoordinates",function(){return toCartesianCoordinates}),__webpack_require__.d(helpers_namespaceObject,"sortData",function(){return sortData}),__webpack_require__.d(helpers_namespaceObject,"getBoundBoxes",function(){return helpers_getBoundBoxes}),__webpack_require__.d(helpers_namespaceObject,"getDataFromEvent",function(){return helpers_getDataFromEvent});var point_helper_namespaceObject={};__webpack_require__.r(point_helper_namespaceObject),__webpack_require__.d(point_helper_namespaceObject,"prepareDrawingInf",function(){return helper_prepareDrawingInf}),__webpack_require__.d(point_helper_namespaceObject,"pointTranslators",function(){return helper_pointTranslators}),__webpack_require__.d(point_helper_namespaceObject,"getStrokeWidthByPosition",function(){return getStrokeWidthByPosition});var layer_types_namespaceObject={};__webpack_require__.r(layer_types_namespaceObject),__webpack_require__.d(layer_types_namespaceObject,"AREA_LAYER",function(){return layer_types_AREA_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"ARC_LAYER",function(){return layer_types_ARC_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"LINE_LAYER",function(){return layer_types_LINE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TEXT_LAYER",function(){return layer_types_TEXT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"POINT_LAYER",function(){return layer_types_POINT_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BAR_LAYER",function(){return layer_types_BAR_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"TICK_LAYER",function(){return layer_types_TICK_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"SIMPLE_LAYER",function(){return layer_types_SIMPLE_LAYER}),__webpack_require__.d(layer_types_namespaceObject,"BASE_LAYER",function(){return layer_types_BASE_LAYER});var src_enums_namespaceObject={};__webpack_require__.r(src_enums_namespaceObject),__webpack_require__.d(src_enums_namespaceObject,"PROPS",function(){return props_namespaceObject}),__webpack_require__.d(src_enums_namespaceObject,"LAYER_TYPES",function(){return layer_types_namespaceObject}),__webpack_require__.d(src_enums_namespaceObject,"CONSTANTS",function(){return enums_constants_namespaceObject});var visual_unit_src_helper_namespaceObject={};__webpack_require__.r(visual_unit_src_helper_namespaceObject),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getDimensionMeasureMap",function(){return helper_getDimensionMeasureMap}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"transformDataModels",function(){return transformDataModels}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayerFromDef",function(){return helper_getLayerFromDef}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"resolveEncodingTransform",function(){return resolveEncodingTransform}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"sanitizeLayerDef",function(){return helper_sanitizeLayerDef}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"attachDataToLayers",function(){return attachDataToLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"attachAxisToLayers",function(){return helper_attachAxisToLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayerAxisIndex",function(){return helper_getLayerAxisIndex}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"unionDomainFromLayers",function(){return helper_unionDomainFromLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"renderLayers",function(){return helper_renderLayers}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getNearestDimensionalValue",function(){return helper_getNearestDimensionalValue}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getLayersBy",function(){return getLayersBy}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"removeLayersBy",function(){return removeLayersBy}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createSideEffectGroup",function(){return helper_createSideEffectGroup}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createRenderPromise",function(){return createRenderPromise}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getRadiusRange",function(){return getRadiusRange}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"setAxisRange",function(){return helper_setAxisRange}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"isXandYMeasures",function(){return helper_isXandYMeasures}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getValuesMap",function(){return getValuesMap}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"getSelectionRejectionModel",function(){return getSelectionRejectionModel}),__webpack_require__.d(visual_unit_src_helper_namespaceObject,"createRTree",function(){return helper_createRTree});var reactive_props_namespaceObject={};__webpack_require__.r(reactive_props_namespaceObject),__webpack_require__.d(reactive_props_namespaceObject,"CONFIG",function(){return reactive_props_CONFIG}),__webpack_require__.d(reactive_props_namespaceObject,"DATA",function(){return reactive_props_DATA}),__webpack_require__.d(reactive_props_namespaceObject,"AXES",function(){return AXES}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERDEFS",function(){return LAYERDEFS}),__webpack_require__.d(reactive_props_namespaceObject,"WIDTH",function(){return reactive_props_WIDTH}),__webpack_require__.d(reactive_props_namespaceObject,"HEIGHT",function(){return reactive_props_HEIGHT}),__webpack_require__.d(reactive_props_namespaceObject,"MOUNT",function(){return reactive_props_MOUNT}),__webpack_require__.d(reactive_props_namespaceObject,"TRANSFORM",function(){return reactive_props_TRANSFORM}),__webpack_require__.d(reactive_props_namespaceObject,"TRANSFORMEDDATA",function(){return TRANSFORMEDDATA}),__webpack_require__.d(reactive_props_namespaceObject,"DATADOMAIN",function(){return DATADOMAIN}),__webpack_require__.d(reactive_props_namespaceObject,"FIELDS",function(){return FIELDS}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERAXISINDEX",function(){return LAYERAXISINDEX}),__webpack_require__.d(reactive_props_namespaceObject,"LAYERS",function(){return reactive_props_LAYERS}),__webpack_require__.d(reactive_props_namespaceObject,"DOMAIN",function(){return reactive_props_DOMAIN});var visual_unit_src_enums_constants_namespaceObject={};__webpack_require__.r(visual_unit_src_enums_constants_namespaceObject),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CLASSPREFIX",function(){return enums_constants_CLASSPREFIX}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"IDFIELD",function(){return IDFIELD}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_LINE_PARENT_GROUP_CLASS",function(){return GRID_LINE_PARENT_GROUP_CLASS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_BAND_PARENT_GROUP_CLASS",function(){return GRID_BAND_PARENT_GROUP_CLASS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_PARENT_GROUP",function(){return GRID_PARENT_GROUP}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"BAND",function(){return enums_constants_BAND}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"TICK",function(){return TICK}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_BAND",function(){return GRID_BAND}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"GRID_LINE",function(){return GRID_LINE}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CONSOLIDATED",function(){return CONSOLIDATED}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"FRAGMENTED",function(){return FRAGMENTED}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"FACET_BY_FIELDS",function(){return FACET_BY_FIELDS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"RETINAL_FIELDS",function(){return RETINAL_FIELDS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"PARENT_ALIAS",function(){return PARENT_ALIAS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"LAYERS",function(){return constants_LAYERS}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"CACHED_DATA",function(){return CACHED_DATA}),__webpack_require__.d(visual_unit_src_enums_constants_namespaceObject,"STORE",function(){return STORE});var visual_unit_src_enums_namespaceObject={};__webpack_require__.r(visual_unit_src_enums_namespaceObject),__webpack_require__.d(visual_unit_src_enums_namespaceObject,"REACTIVE_PROPS",function(){return reactive_props_namespaceObject}),__webpack_require__.d(visual_unit_src_enums_namespaceObject,"CONSTANTS",function(){return visual_unit_src_enums_constants_namespaceObject});var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,"DRAG",function(){return DRAG}),__webpack_require__.d(actions_namespaceObject,"HOVER",function(){return HOVER}),__webpack_require__.d(actions_namespaceObject,"SELECTIONDRAG",function(){return SELECTIONDRAG}),__webpack_require__.d(actions_namespaceObject,"CLICK",function(){return CLICK}),__webpack_require__.d(actions_namespaceObject,"LONGTOUCH",function(){return LONGTOUCH}),__webpack_require__.d(actions_namespaceObject,"TOUCHDRAG",function(){return TOUCHDRAG}),__webpack_require__.d(actions_namespaceObject,"ALL_ACTIONS",function(){return ALL_ACTIONS});var enums_selection_namespaceObject={};__webpack_require__.r(enums_selection_namespaceObject),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_ENTRY",function(){return SELECTION_NEW_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NEW_EXIT",function(){return SELECTION_NEW_EXIT}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_NULL",function(){return SELECTION_NULL}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_ENTRY",function(){return SELECTION_OLD_ENTRY}),__webpack_require__.d(enums_selection_namespaceObject,"SELECTION_OLD_EXIT",function(){return SELECTION_OLD_EXIT});var behaviours_namespaceObject={};__webpack_require__.r(behaviours_namespaceObject),__webpack_require__.d(behaviours_namespaceObject,"BRUSH",function(){return BRUSH}),__webpack_require__.d(behaviours_namespaceObject,"HIGHLIGHT",function(){return HIGHLIGHT}),__webpack_require__.d(behaviours_namespaceObject,"TOOLTIP",function(){return behaviours_TOOLTIP}),__webpack_require__.d(behaviours_namespaceObject,"FILTER",function(){return FILTER}),__webpack_require__.d(behaviours_namespaceObject,"SELECT",function(){return SELECT});var behavioural_namespaceObject={};__webpack_require__.r(behavioural_namespaceObject),__webpack_require__.d(behavioural_namespaceObject,"HighlightBeahviour",function(){return highlight_HighlightBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"BrushBehaviour",function(){return brush_BrushBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"FilterBehaviour",function(){return filter_FilterBehaviour}),__webpack_require__.d(behavioural_namespaceObject,"SelectBehaviour",function(){return select_SelectBehaviour});var side_effects_namespaceObject={};__webpack_require__.r(side_effects_namespaceObject),__webpack_require__.d(side_effects_namespaceObject,"ANCHORS",function(){return side_effects_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"BRUSH_ANCHORS",function(){return side_effects_BRUSH_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"PERSISTENT_ANCHORS",function(){return side_effects_PERSISTENT_ANCHORS}),__webpack_require__.d(side_effects_namespaceObject,"FILTER",function(){return side_effects_FILTER}),__webpack_require__.d(side_effects_namespaceObject,"HIGHLIGHTER",function(){return side_effects_HIGHLIGHTER}),__webpack_require__.d(side_effects_namespaceObject,"CROSSLINE",function(){return CROSSLINE}),__webpack_require__.d(side_effects_namespaceObject,"TOOLTIP",function(){return side_effects_TOOLTIP}),__webpack_require__.d(side_effects_namespaceObject,"FRAGMENTED_TOOLTIP",function(){return FRAGMENTED_TOOLTIP}),__webpack_require__.d(side_effects_namespaceObject,"AXIS_LABEL_HIGHLIGHTER",function(){return AXIS_LABEL_HIGHLIGHTER});var src_side_effects_namespaceObject={};__webpack_require__.r(src_side_effects_namespaceObject),__webpack_require__.d(src_side_effects_namespaceObject,"SelectionBox",function(){return selection_box}),__webpack_require__.d(src_side_effects_namespaceObject,"Tooltip",function(){return side_effects_tooltip_Tooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"FragmentedTooltip",function(){return fragmented_tooltip_FragmentedTooltip}),__webpack_require__.d(src_side_effects_namespaceObject,"Crossline",function(){return crossline_Crossline}),__webpack_require__.d(src_side_effects_namespaceObject,"PlotHighlighter",function(){return plot_highlighter_PlotHighlighter}),__webpack_require__.d(src_side_effects_namespaceObject,"FilterEffect",function(){return FilterEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"PersistentAnchors",function(){return persistent_anchors_PersistentAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"BrushAnchors",function(){return brush_anchors_BrushAnchors}),__webpack_require__.d(src_side_effects_namespaceObject,"AnchorEffect",function(){return anchors_AnchorEffect}),__webpack_require__.d(src_side_effects_namespaceObject,"AxisLabelHighLighter",function(){return axis_labels_highlighter_AxisLabelHighLighter});var group_utils_namespaceObject={};__webpack_require__.r(group_utils_namespaceObject),__webpack_require__.d(group_utils_namespaceObject,"initStore",function(){return group_utils_initStore}),__webpack_require__.d(group_utils_namespaceObject,"isDistributionEqual",function(){return group_utils_isDistributionEqual}),__webpack_require__.d(group_utils_namespaceObject,"initializeCacheMaps",function(){return initializeCacheMaps}),__webpack_require__.d(group_utils_namespaceObject,"getAxisKey",function(){return getAxisKey}),__webpack_require__.d(group_utils_namespaceObject,"getCellKey",function(){return getCellKey}),__webpack_require__.d(group_utils_namespaceObject,"extractUnitConfig",function(){return group_utils_extractUnitConfig}),__webpack_require__.d(group_utils_namespaceObject,"hasOneField",function(){return hasOneField}),__webpack_require__.d(group_utils_namespaceObject,"getHeaderText",function(){return getHeaderText}),__webpack_require__.d(group_utils_namespaceObject,"headerCreator",function(){return group_utils_headerCreator}),__webpack_require__.d(group_utils_namespaceObject,"findInGroup",function(){return group_utils_findInGroup}),__webpack_require__.d(group_utils_namespaceObject,"getAxisType",function(){return group_utils_getAxisType}),__webpack_require__.d(group_utils_namespaceObject,"retriveDomainFromData",function(){return retriveDomainFromData}),__webpack_require__.d(group_utils_namespaceObject,"mutateAxesFromMap",function(){return mutateAxesFromMap}),__webpack_require__.d(group_utils_namespaceObject,"getEncoder",function(){return group_utils_getEncoder}),__webpack_require__.d(group_utils_namespaceObject,"getHeaderAxisFrom",function(){return group_utils_getHeaderAxisFrom}),__webpack_require__.d(group_utils_namespaceObject,"setFacetsAndProjections",function(){return setFacetsAndProjections}),__webpack_require__.d(group_utils_namespaceObject,"getBorders",function(){return getBorders}),__webpack_require__.d(group_utils_namespaceObject,"getFieldsFromSuppliedLayers",function(){return getFieldsFromSuppliedLayers}),__webpack_require__.d(group_utils_namespaceObject,"extractFields",function(){return group_utils_extractFields}),__webpack_require__.d(group_utils_namespaceObject,"sortFacetFields",function(){return group_utils_sortFacetFields}),__webpack_require__.d(group_utils_namespaceObject,"removeExitCells",function(){return group_utils_removeExitCells});var encoder_helper_namespaceObject={};__webpack_require__.r(encoder_helper_namespaceObject),__webpack_require__.d(encoder_helper_namespaceObject,"getAdjustedDomain",function(){return getAdjustedDomain}),__webpack_require__.d(encoder_helper_namespaceObject,"generateAxisFromMap",function(){return encoder_helper_generateAxisFromMap}),__webpack_require__.d(encoder_helper_namespaceObject,"sanitizeIndividualLayerConfig",function(){return encoder_helper_sanitizeIndividualLayerConfig}),__webpack_require__.d(encoder_helper_namespaceObject,"mutateAxesFromMap",function(){return encoder_helper_mutateAxesFromMap}),__webpack_require__.d(encoder_helper_namespaceObject,"getDefaultMark",function(){return encoder_helper_getDefaultMark}),__webpack_require__.d(encoder_helper_namespaceObject,"createRetinalAxis",function(){return encoder_helper_createRetinalAxis}),__webpack_require__.d(encoder_helper_namespaceObject,"getIndex",function(){return getIndex}),__webpack_require__.d(encoder_helper_namespaceObject,"getLayerConfFromFields",function(){return getLayerConfFromFields}),__webpack_require__.d(encoder_helper_namespaceObject,"resolveAxisConfig",function(){return encoder_helper_resolveAxisConfig}),__webpack_require__.d(encoder_helper_namespaceObject,"getSortingConfig",function(){return getSortingConfig});var encoder_namespaceObject={};__webpack_require__.r(encoder_namespaceObject),__webpack_require__.d(encoder_namespaceObject,"VisualEncoder",function(){return visual_encoder_VisualEncoder}),__webpack_require__.d(encoder_namespaceObject,"CartesianEncoder",function(){return cartesian_encoder_CartesianEncoder}),__webpack_require__.d(encoder_namespaceObject,"PolarEncoder",function(){return polar_encoder_PolarEncoder}),__webpack_require__.d(encoder_namespaceObject,"RetinalEncoder",function(){return retinal_encoder_RetinalEncoder});var firebolt_behavioural_namespaceObject={};__webpack_require__.r(firebolt_behavioural_namespaceObject),__webpack_require__.d(firebolt_behavioural_namespaceObject,"SelectBehaviour",function(){return behavioural_select_SelectBehaviour});var firebolt_side_effects_namespaceObject={};__webpack_require__.r(firebolt_side_effects_namespaceObject),__webpack_require__.d(firebolt_side_effects_namespaceObject,"SelectionBox",function(){return side_effects_selection_box}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendHighlighter",function(){return legend_highlighter_LegendHighlighter}),__webpack_require__.d(firebolt_side_effects_namespaceObject,"LegendMarker",function(){return legend_marker_LegendMarker});var operators_namespaceObject={};__webpack_require__.r(operators_namespaceObject),__webpack_require__.d(operators_namespaceObject,"share",function(){return operators_share}),__webpack_require__.d(operators_namespaceObject,"html",function(){return operators_html});var dist_datamodel=__webpack_require__(0),datamodel_default=__webpack_require__.n(dist_datamodel),ascending=function(a,b){return ab?1:a>=b?0:NaN},bisector=function(compare){return 1===compare.length&&(compare=function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}(compare)),{left:function left(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)<0?lo=mid+1:hi=mid}return lo},right:function right(a,x,lo,hi){for(null==lo&&(lo=0),null==hi&&(hi=a.length);lo>>1;compare(a[mid],x)>0?hi=mid:lo=mid+1}return lo}}};var ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right,bisect=(ascendingBisect.left,bisectRight);var number=function(x){return null===x?NaN:+x},array_array=Array.prototype,src_range=(array_array.slice,array_array.map,function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;for(var i=-1,n=0|Math.max(0,Math.ceil((stop-start)/step)),range=new Array(n);++i0)return[start];if((reverse=stop0)for(start=Math.ceil(start/step),stop=Math.floor(stop/step),ticks=new Array(n=Math.ceil(stop-start+1));++i=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;return error>=e10?step1*=10:error>=e5?step1*=5:error>=e2&&(step1*=2),stop=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values);return value0+(+valueof(values[i0+1],i0+1,values)-value0)*(i-i0)}};function map_Map(){}function map_map(object,f){var map=new map_Map;if(object instanceof map_Map)object.each(function(value,key){map.set(key,value)});else if(Array.isArray(object)){var o,i=-1,n=object.length;if(null==f)for(;++i=keys.length)return null!=_sortValues&&array.sort(_sortValues),null!=_rollup?_rollup(array):array;for(var keyValue,value,values,i=-1,n=array.length,key=keys[depth++],valuesByKey=src_map(),result=createResult();++ikeys.length)return map;var array,sortKey=_sortKeys[depth-1];return null!=_rollup&&depth>=keys.length?array=map.entries():(array=[],map.each(function(v,k){array.push({key:k,values:_entries(v,depth)})})),null!=sortKey?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}(apply(array,0,createMap,setMap),0)},key:function key(d){return keys.push(d),nest},sortKeys:function sortKeys(order){return _sortKeys[keys.length-1]=order,nest},sortValues:function sortValues(order){return _sortValues=order,nest},rollup:function rollup(f){return _rollup=f,nest}}};function createObject(){return{}}function setObject(object,key,value){object[key]=value}function createMap(){return src_map()}function setMap(map,key,value){map.set(key,value)}function set_Set(){}var proto=src_map.prototype;function set_set(object,f){var set=new set_Set;if(object instanceof set_Set)object.each(function(value){set.add(value)});else if(object){var i=-1,n=object.length;if(null==f)for(;++i1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo)),hiIndex=getClosestIndexOf(values,hi),b=lo===hi?a:Math.max(a,hiIndex-1),reverse&&(t=a,a=n-b,b=n-t),a>b?void 0:domain().slice(a,b+1)},scale.invert=function(r0,r1){var a,t,lo=+r0,hi=arguments.length>1?+r1:lo,reverse=range[1]range[1-reverse]))return a=Math.max(0,getClosestIndexOf(values,lo,"left")),domain()[reverse?n-a:a]},rescale()}function getClosestIndexOf(arr,value,side){for(var highVal,mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1:high}var src_number=function(a,b){return a=+a,b=+b,function(t){return a*(1-t)+b*t}},define=function(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype,prototype.constructor=constructor};function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var reI="\\s*([+-]?\\d+)\\s*",reN="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",reP="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",reHex=/^#([0-9a-f]{3,8})$/,reRgbInteger=new RegExp("^rgb\\("+[reI,reI,reI]+"\\)$"),reRgbPercent=new RegExp("^rgb\\("+[reP,reP,reP]+"\\)$"),reRgbaInteger=new RegExp("^rgba\\("+[reI,reI,reI,reN]+"\\)$"),reRgbaPercent=new RegExp("^rgba\\("+[reP,reP,reP,reN]+"\\)$"),reHslPercent=new RegExp("^hsl\\("+[reN,reP,reP]+"\\)$"),reHslaPercent=new RegExp("^hsla\\("+[reN,reP,reP,reN]+"\\)$"),named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(format){var m,l;return format=(format+"").trim().toLowerCase(),(m=reHex.exec(format))?(l=m[1].length,m=parseInt(m[1],16),6===l?rgbn(m):3===l?new Rgb(m>>8&15|m>>4&240,m>>4&15|240&m,(15&m)<<4|15&m,1):8===l?new Rgb(m>>24&255,m>>16&255,m>>8&255,(255&m)/255):4===l?new Rgb(m>>12&15|m>>8&240,m>>8&15|m>>4&240,m>>4&15|240&m,((15&m)<<4|15&m)/255):null):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(255*m[1]/100,255*m[2]/100,255*m[3]/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(255*m[1]/100,255*m[2]/100,255*m[3]/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):"transparent"===format?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,255&n,1)}function rgba(r,g,b,a){return a<=0&&(r=g=b=NaN),new Rgb(r,g,b,a)}function rgbConvert(o){return o instanceof Color||(o=color_color(o)),o?new Rgb((o=o.rgb()).r,o.g,o.b,o.opacity):new Rgb}function color_rgb(r,g,b,opacity){return 1===arguments.length?rgbConvert(r):new Rgb(r,g,b,null==opacity?1:opacity)}function Rgb(r,g,b,opacity){this.r=+r,this.g=+g,this.b=+b,this.opacity=+opacity}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function hex(value){return((value=Math.max(0,Math.min(255,Math.round(value)||0)))<16?"0":"")+value.toString(16)}function hsla(h,s,l,a){return a<=0?h=s=l=NaN:l<=0||l>=1?h=s=NaN:s<=0&&(h=NaN),new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color_color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;var r=(o=o.rgb()).r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;return s?(h=r===max?(g-b)/s+6*(g0&&l<1?0:h,new Hsl(h,s,l,o.opacity)}function hsl(h,s,l,opacity){return 1===arguments.length?hslConvert(h):new Hsl(h,s,l,null==opacity?1:opacity)}function Hsl(h,s,l,opacity){this.h=+h,this.s=+s,this.l=+l,this.opacity=+opacity}function hsl2rgb(h,m1,m2){return 255*(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)}function basis(t1,v0,v1,v2,v3){var t2=t1*t1,t3=t2*t1;return((1-3*t1+3*t2-t3)*v0+(4-6*t2+3*t3)*v1+(1+3*t1+3*t2-3*t3)*v2+t3*v3)/6}define(Color,color_color,{copy:function copy(channels){return Object.assign(new this.constructor,this,channels)},displayable:function displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,color_rgb,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb:function rgb(){return this},displayable:function displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function brighter(k){return k=null==k?1/.7:Math.pow(1/.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},darker:function darker(k){return k=null==k?.7:Math.pow(.7,k),new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb:function rgb(){var h=this.h%360+360*(this.h<0),s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},displayable:function displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function formatHsl(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var src_constant=function(x){return function(){return x}};function linear(a,d){return function(t){return a+t*d}}function color_hue(a,b){var d=b-a;return d?linear(a,d>180||d<-180?d-360*Math.round(d/360):d):src_constant(isNaN(a)?b:a)}function gamma(y){return 1==(y=+y)?nogamma:function(a,b){return b-a?function exponential(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y)}}(a,b,y):src_constant(isNaN(a)?b:a)}}function nogamma(a,b){var d=b-a;return d?linear(a,d):src_constant(isNaN(a)?b:a)}var src_rgb=function rgbGamma(y){var color=gamma(y);function rgb(start,end){var r=color((start=color_rgb(start)).r,(end=color_rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.r=r(t),start.g=g(t),start.b=b(t),start.opacity=opacity(t),start+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(spline){return function(colors){var i,color,n=colors.length,r=new Array(n),g=new Array(n),b=new Array(n);for(i=0;i=1?(t=1,n-1):Math.floor(t*n),v1=values[i],v2=values[i+1],v0=i>0?values[i-1]:2*v1-v2,v3=ibi&&(bs=b.slice(bi,bs),s[i]?s[i]+=bs:s[++i]=bs),(am=am[0])===(bm=bm[0])?s[i]?s[i]+=bm:s[++i]=bm:(s[++i]=null,q.push({i:i,x:src_number(am,bm)})),bi=reB.lastIndex;return bi2?polymap:bimap,output=input=null,scale}function scale(x){return(output||(output=piecewise(domain,range,clamp?function deinterpolateClamp(deinterpolate){return function(a,b){var d=deinterpolate(a=+a,b=+b);return function(x){return x<=a?0:x>=b?1:d(x)}}}(deinterpolate):deinterpolate,interpolate)))(+x)}return scale.invert=function(y){return(input||(input=piecewise(range,domain,deinterpolateLinear,clamp?function reinterpolateClamp(reinterpolate){return function(a,b){var r=reinterpolate(a=+a,b=+b);return function(t){return t<=0?a:t>=1?b:r(t)}}}(reinterpolate):reinterpolate)))(+y)},scale.domain=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),rescale()):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),rescale()):range.slice()},scale.rangeRound=function(_){return range=array_slice.call(_),interpolate=src_round,rescale()},scale.clamp=function(_){return arguments.length?(clamp=!!_,rescale()):clamp},scale.interpolate=function(_){return arguments.length?(interpolate=_,rescale()):interpolate},rescale()}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]})}function FormatSpecifier(specifier){this.fill=void 0===specifier.fill?" ":specifier.fill+"",this.align=void 0===specifier.align?">":specifier.align+"",this.sign=void 0===specifier.sign?"-":specifier.sign+"",this.symbol=void 0===specifier.symbol?"":specifier.symbol+"",this.zero=!!specifier.zero,this.width=void 0===specifier.width?void 0:+specifier.width,this.comma=!!specifier.comma,this.precision=void 0===specifier.precision?void 0:+specifier.precision,this.trim=!!specifier.trim,this.type=void 0===specifier.type?"":specifier.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var prefixExponent,defaultLocale_locale,defaultLocale_format,defaultLocale_formatPrefix,formatDecimal=function(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]},src_exponent=function(x){return(x=formatDecimal(Math.abs(x)))?x[1]:NaN},formatTrim=function(s){out:for(var i1,n=s.length,i=1,i0=-1;i0){if(!+s[i])break out;i0=0}}return i0>0?s.slice(0,i0)+s.slice(i1+1):s},formatRounded=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")},formatTypes={"%":function _(x,p){return(100*x).toFixed(p)},b:function b(x){return Math.round(x).toString(2)},c:function c(x){return x+""},d:function d(x){return Math.round(x).toString(10)},e:function e(x,p){return x.toExponential(p)},f:function f(x,p){return x.toFixed(p)},g:function g(x,p){return x.toPrecision(p)},o:function o(x){return Math.round(x).toString(8)},p:function p(x,_p){return formatRounded(100*x,_p)},r:formatRounded,s:function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=3*Math.max(-8,Math.min(8,Math.floor(exponent/3))))+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]},X:function X(x){return Math.round(x).toString(16).toUpperCase()},x:function x(_x){return Math.round(_x).toString(16)}},src_identity=function(x){return x},locale_map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],src_locale=function(locale){var group=void 0===locale.grouping||void 0===locale.thousands?src_identity:function(grouping,thousands){return function(value,width){for(var i=value.length,t=[],j=0,g=grouping[0],length=0;i>0&&g>0&&(length+g+1>width&&(g=Math.max(1,width-length)),t.push(value.substring(i-=g,i+g)),!((length+=g+1)>width));)g=grouping[j=(j+1)%grouping.length];return t.reverse().join(thousands)}}(locale_map.call(locale.grouping,Number),locale.thousands+""),currencyPrefix=void 0===locale.currency?"":locale.currency[0]+"",currencySuffix=void 0===locale.currency?"":locale.currency[1]+"",decimal=void 0===locale.decimal?".":locale.decimal+"",numerals=void 0===locale.numerals?src_identity:function(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}}(locale_map.call(locale.numerals,String)),percent=void 0===locale.percent?"%":locale.percent+"",minus=void 0===locale.minus?"-":locale.minus+"",nan=void 0===locale.nan?"NaN":locale.nan+"";function newFormat(specifier){var fill=(specifier=formatSpecifier(specifier)).fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;"n"===type?(comma=!0,type="g"):formatTypes[type]||(void 0===precision&&(precision=12),trim=!0,type="g"),(zero||"0"===fill&&"="===align)&&(zero=!0,fill="0",align="=");var prefix="$"===symbol?currencyPrefix:"#"===symbol&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix="$"===symbol?currencySuffix:/[%p]/.test(type)?percent:"",formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);function format(value){var i,n,c,valuePrefix=prefix,valueSuffix=suffix;if("c"===type)valueSuffix=formatType(value)+valueSuffix,value="";else{var valueNegative=(value=+value)<0;if(value=isNaN(value)?nan:formatType(Math.abs(value),precision),trim&&(value=formatTrim(value)),valueNegative&&0==+value&&(valueNegative=!1),valuePrefix=(valueNegative?"("===sign?sign:minus:"-"===sign||"("===sign?"":sign)+valuePrefix,valueSuffix=("s"===type?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&"("===sign?")":""),maybeSuffix)for(i=-1,n=value.length;++i(c=value.charCodeAt(i))||c>57){valueSuffix=(46===c?decimal+value.slice(i+1):value.slice(i))+valueSuffix,value=value.slice(0,i);break}}comma&&!zero&&(value=group(value,1/0));var length=valuePrefix.length+value.length+valueSuffix.length,padding=length>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix}return numerals(value)}return precision=void 0===precision?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision)),format.toString=function(){return specifier+""},format}return{format:newFormat,formatPrefix:function formatPrefix(specifier,value){var f=newFormat(((specifier=formatSpecifier(specifier)).type="f",specifier)),e=3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3))),k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}}};!function defaultLocale(definition){return defaultLocale_locale=src_locale(definition),defaultLocale_format=defaultLocale_locale.format,defaultLocale_formatPrefix=defaultLocale_locale.formatPrefix,defaultLocale_locale}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var src_tickFormat=function(domain,count,specifier){var precision,start=domain[0],stop=domain[domain.length-1],step=tickStep(start,stop,null==count?10:count);switch((specifier=formatSpecifier(null==specifier?",f":specifier)).type){case"s":var value=Math.max(Math.abs(start),Math.abs(stop));return null!=specifier.precision||isNaN(precision=function(step,value){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(src_exponent(value)/3)))-src_exponent(Math.abs(step)))}(step,value))||(specifier.precision=precision),defaultLocale_formatPrefix(specifier,value);case"":case"e":case"g":case"p":case"r":null!=specifier.precision||isNaN(precision=function(step,max){return step=Math.abs(step),max=Math.abs(max)-step,Math.max(0,src_exponent(max)-src_exponent(step))+1}(step,Math.max(Math.abs(start),Math.abs(stop))))||(specifier.precision=precision-("e"===specifier.type));break;case"f":case"%":null!=specifier.precision||isNaN(precision=function(step){return Math.max(0,-src_exponent(Math.abs(step)))}(step))||(specifier.precision=precision-2*("%"===specifier.type))}return defaultLocale_format(specifier)};function linearish(scale){var domain=scale.domain;return scale.ticks=function(count){var d=domain();return src_ticks(d[0],d[d.length-1],null==count?10:count)},scale.tickFormat=function(count,specifier){return src_tickFormat(domain(),count,specifier)},scale.nice=function(count){null==count&&(count=10);var step,d=domain(),i0=0,i1=d.length-1,start=d[i0],stop=d[i1];return stop0?step=tickIncrement(start=Math.floor(start/step)*step,stop=Math.ceil(stop/step)*step,count):step<0&&(step=tickIncrement(start=Math.ceil(start*step)/step,stop=Math.floor(stop*step)/step,count)),step>0?(d[i0]=Math.floor(start/step)*step,d[i1]=Math.ceil(stop/step)*step,domain(d)):step<0&&(d[i0]=Math.ceil(start*step)/step,d[i1]=Math.floor(stop*step)/step,domain(d)),scale},scale}function linear_linear(){var scale=continuous(deinterpolateLinear,src_number);return scale.copy=function(){return copy(scale,linear_linear())},linearish(scale)}function identity_identity(){var domain=[0,1];function scale(x){return+x}return scale.invert=scale,scale.domain=scale.range=function(_){return arguments.length?(domain=src_array_map.call(_,d3_scale_src_number),scale):domain.slice()},scale.copy=function(){return identity_identity().domain(domain)},linearish(scale)}var nice=function(domain,interval){var t,i0=0,i1=(domain=domain.slice()).length-1,x0=domain[i0],x1=domain[i1];return x10){for(;iv)break;z.push(t)}}else for(;i=1;--k)if(!((t=p*k)v)break;z.push(t)}}else z=src_ticks(i,j,Math.min(j-i,n)).map(pows);return r?z.reverse():z},scale.tickFormat=function(count,specifier){if(null==specifier&&(specifier=10===base?".0e":","),"function"!=typeof specifier&&(specifier=defaultLocale_format(specifier)),count===1/0)return specifier;null==count&&(count=10);var k=Math.max(1,base*count/scale.ticks().length);return function(d){var i=d/pows(Math.round(logs(d)));return i*base0?thresholds[i-1]:domain[0],i=n?[domain[n-1],x1]:[domain[i-1],domain[i]]},scale.copy=function(){return quantize().domain([x0,x1]).range(range)},linearish(scale)}function threshold_threshold(){var domain=[.5],range=[0,1],n=1;function scale(x){if(x<=x)return range[bisect(domain,x,0,n)]}return scale.domain=function(_){return arguments.length?(domain=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):domain.slice()},scale.range=function(_){return arguments.length?(range=array_slice.call(_),n=Math.min(domain.length,range.length-1),scale):range.slice()},scale.invertExtent=function(y){var i=range.indexOf(y);return[domain[i-1],domain[i]]},scale.copy=function(){return threshold_threshold().domain(domain).range(range)},scale}var interval_t0=new Date,interval_t1=new Date;function newInterval(floori,offseti,count,field){function interval(date){return floori(date=0===arguments.length?new Date:new Date(+date)),date}return interval.floor=function(date){return floori(date=new Date(+date)),date},interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),floori(date),date},interval.round=function(date){var d0=interval(date),d1=interval.ceil(date);return date-d00))return range;do{range.push(previous=new Date(+start)),offseti(start,step),floori(start)}while(previous=date)for(;floori(date),!test(date);)date.setTime(date-1)},function(date,step){if(date>=date)if(step<0)for(;++step<=0;)for(;offseti(date,-1),!test(date););else for(;--step>=0;)for(;offseti(date,1),!test(date););})},count&&(interval.count=function(start,end){return interval_t0.setTime(+start),interval_t1.setTime(+end),floori(interval_t0),floori(interval_t1),Math.floor(count(interval_t0,interval_t1))},interval.every=function(step){return step=Math.floor(step),isFinite(step)&&step>0?step>1?interval.filter(field?function(d){return field(d)%step==0}:function(d){return interval.count(0,d)%step==0}):interval:null}),interval}var year_year=newInterval(function(date){date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()},function(date){return date.getFullYear()});year_year.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setFullYear(Math.floor(date.getFullYear()/k)*k),date.setMonth(0,1),date.setHours(0,0,0,0)},function(date,step){date.setFullYear(date.getFullYear()+step*k)}):null};var src_year=year_year,month_month=(year_year.range,newInterval(function(date){date.setDate(1),date.setHours(0,0,0,0)},function(date,step){date.setMonth(date.getMonth()+step)},function(start,end){return end.getMonth()-start.getMonth()+12*(end.getFullYear()-start.getFullYear())},function(date){return date.getMonth()})),src_month=month_month,durationMinute=(month_month.range,6e4),durationWeek=6048e5;function weekday(i){return newInterval(function(date){date.setDate(date.getDate()-(date.getDay()+7-i)%7),date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+7*step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/durationWeek})}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6),day_day=(sunday.range,monday.range,tuesday.range,wednesday.range,thursday.range,friday.range,saturday.range,newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*durationMinute)/864e5},function(date){return date.getDate()-1})),src_day=day_day,hour_hour=(day_day.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds()-date.getMinutes()*durationMinute)},function(date,step){date.setTime(+date+36e5*step)},function(start,end){return(end-start)/36e5},function(date){return date.getHours()})),src_hour=hour_hour,minute_minute=(hour_hour.range,newInterval(function(date){date.setTime(date-date.getMilliseconds()-1e3*date.getSeconds())},function(date,step){date.setTime(+date+step*durationMinute)},function(start,end){return(end-start)/durationMinute},function(date){return date.getMinutes()})),src_minute=minute_minute,second_second=(minute_minute.range,newInterval(function(date){date.setTime(date-date.getMilliseconds())},function(date,step){date.setTime(+date+1e3*step)},function(start,end){return(end-start)/1e3},function(date){return date.getUTCSeconds()})),src_second=second_second,millisecond_millisecond=(second_second.range,newInterval(function(){},function(date,step){date.setTime(+date+step)},function(start,end){return end-start}));millisecond_millisecond.every=function(k){return k=Math.floor(k),isFinite(k)&&k>0?k>1?newInterval(function(date){date.setTime(Math.floor(date/k)*k)},function(date,step){date.setTime(+date+step*k)},function(start,end){return(end-start)/k}):millisecond_millisecond:null};var src_millisecond=millisecond_millisecond;millisecond_millisecond.range;function utcWeekday(i){return newInterval(function(date){date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+7*step)},function(start,end){return(end-start)/durationWeek})}var utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6),utcDay=(utcSunday.range,utcMonday.range,utcTuesday.range,utcWednesday.range,utcThursday.range,utcFriday.range,utcSaturday.range,newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5},function(date){return date.getUTCDate()-1})),src_utcDay=utcDay,utcYear=(utcDay.range,newInterval(function(date){date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()},function(date){return date.getUTCFullYear()}));utcYear.every=function(k){return isFinite(k=Math.floor(k))&&k>0?newInterval(function(date){date.setUTCFullYear(Math.floor(date.getUTCFullYear()/k)*k),date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step*k)}):null};var src_utcYear=utcYear;utcYear.range;function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);return date.setFullYear(d.y),date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));return date.setUTCFullYear(d.y),date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newDate(y,m,d){return{y:y,m:m,d:d,H:0,M:0,S:0,L:0}}var src_defaultLocale_locale,timeFormat,pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function locale_pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i,i+6));return n?(d.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function parseQuarter(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.q=3*n[0]-3,i+n[0].length):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseMicroseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+6));return n?(d.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function parseUnixTimestamp(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.Q=+n[0],i+n[0].length):-1}function parseUnixTimestampSeconds(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.s=+n[0],i+n[0].length):-1}function formatDayOfMonth(d,p){return locale_pad(d.getDate(),p,2)}function formatHour24(d,p){return locale_pad(d.getHours(),p,2)}function formatHour12(d,p){return locale_pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return locale_pad(1+src_day.count(src_year(d),d),p,3)}function formatMilliseconds(d,p){return locale_pad(d.getMilliseconds(),p,3)}function formatMicroseconds(d,p){return formatMilliseconds(d,p)+"000"}function formatMonthNumber(d,p){return locale_pad(d.getMonth()+1,p,2)}function formatMinutes(d,p){return locale_pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return locale_pad(d.getSeconds(),p,2)}function formatWeekdayNumberMonday(d){var day=d.getDay();return 0===day?7:day}function formatWeekNumberSunday(d,p){return locale_pad(sunday.count(src_year(d)-1,d),p,2)}function formatWeekNumberISO(d,p){var day=d.getDay();return d=day>=4||0===day?thursday(d):thursday.ceil(d),locale_pad(thursday.count(src_year(d),d)+(4===src_year(d).getDay()),p,2)}function formatWeekdayNumberSunday(d){return d.getDay()}function formatWeekNumberMonday(d,p){return locale_pad(monday.count(src_year(d)-1,d),p,2)}function locale_formatYear(d,p){return locale_pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return locale_pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+locale_pad(z/60|0,"0",2)+locale_pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return locale_pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return locale_pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return locale_pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return locale_pad(1+src_utcDay.count(src_utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return locale_pad(d.getUTCMilliseconds(),p,3)}function formatUTCMicroseconds(d,p){return formatUTCMilliseconds(d,p)+"000"}function formatUTCMonthNumber(d,p){return locale_pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return locale_pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return locale_pad(d.getUTCSeconds(),p,2)}function formatUTCWeekdayNumberMonday(d){var dow=d.getUTCDay();return 0===dow?7:dow}function formatUTCWeekNumberSunday(d,p){return locale_pad(utcSunday.count(src_utcYear(d)-1,d),p,2)}function formatUTCWeekNumberISO(d,p){var day=d.getUTCDay();return d=day>=4||0===day?utcThursday(d):utcThursday.ceil(d),locale_pad(utcThursday.count(src_utcYear(d),d)+(4===src_utcYear(d).getUTCDay()),p,2)}function formatUTCWeekdayNumberSunday(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return locale_pad(utcMonday.count(src_utcYear(d)-1,d),p,2)}function formatUTCYear(d,p){return locale_pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return locale_pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(d){return+d}function formatUnixTimestampSeconds(d){return Math.floor(+d/1e3)}!function defaultLocale_defaultLocale(definition){return src_defaultLocale_locale=function formatLocale(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_weekdays=locale.days,locale_shortWeekdays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths,periodRe=formatRe(locale_periods),periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths),formats={a:function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]},A:function formatWeekday(d){return locale_weekdays[d.getDay()]},b:function formatShortMonth(d){return locale_shortMonths[d.getMonth()]},B:function formatMonth(d){return locale_months[d.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]},q:function formatQuarter(d){return 1+~~(d.getMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},utcFormats={a:function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]},A:function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]},b:function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]},B:function formatUTCMonth(d){return locale_months[d.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]},q:function formatUTCQuarter(d){return 1+~~(d.getUTCMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},parses={a:function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},A:function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup[n[0].toLowerCase()],i+n[0].length):-1},b:function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup[n[0].toLowerCase()],i+n[0].length):-1},B:function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup[n[0].toLowerCase()],i+n[0].length):-1},c:function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(d,string,i){var n=periodRe.exec(string.slice(i));return n?(d.p=periodLookup[n[0].toLowerCase()],i+n[0].length):-1},q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)},X:function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(specifier,formats){return function(date){var c,pad,format,string=[],i=-1,j=0,n=specifier.length;for(date instanceof Date||(date=new Date(+date));++i53)return null;"w"in d||(d.w=1),"Z"in d?(week=(day=(week=utcDate(newDate(d.y,0,1))).getUTCDay())>4||0===day?utcMonday.ceil(week):utcMonday(week),week=src_utcDay.offset(week,7*(d.V-1)),d.y=week.getUTCFullYear(),d.m=week.getUTCMonth(),d.d=week.getUTCDate()+(d.w+6)%7):(week=(day=(week=localDate(newDate(d.y,0,1))).getDay())>4||0===day?monday.ceil(week):monday(week),week=src_day.offset(week,7*(d.V-1)),d.y=week.getFullYear(),d.m=week.getMonth(),d.d=week.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),day="Z"in d?utcDate(newDate(d.y,0,1)).getUTCDay():localDate(newDate(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(day+5)%7:d.w+7*d.U-(day+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,utcDate(d)):localDate(d)}}function parseSpecifier(d,specifier,string,j){for(var c,parse,i=0,n=specifier.length,m=string.length;i=m)return-1;if(37===(c=specifier.charCodeAt(i++))){if(c=specifier.charAt(i++),!(parse=parses[c in pads?specifier.charAt(i++):c])||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++))return-1}return j}return formats.x=newFormat(locale_date,formats),formats.X=newFormat(locale_time,formats),formats.c=newFormat(locale_dateTime,formats),utcFormats.x=newFormat(locale_date,utcFormats),utcFormats.X=newFormat(locale_time,utcFormats),utcFormats.c=newFormat(locale_dateTime,utcFormats),{format:function format(specifier){var f=newFormat(specifier+="",formats);return f.toString=function(){return specifier},f},parse:function parse(specifier){var p=newParse(specifier+="",!1);return p.toString=function(){return specifier},p},utcFormat:function utcFormat(specifier){var f=newFormat(specifier+="",utcFormats);return f.toString=function(){return specifier},f},utcParse:function utcParse(specifier){var p=newParse(specifier+="",!0);return p.toString=function(){return specifier},p}}}(definition),timeFormat=src_defaultLocale_locale.format,src_defaultLocale_locale.parse,src_defaultLocale_locale.utcFormat,src_defaultLocale_locale.utcParse,src_defaultLocale_locale}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var time_durationSecond=1e3,time_durationMinute=60*time_durationSecond,time_durationHour=60*time_durationMinute,time_durationDay=24*time_durationHour,time_durationWeek=7*time_durationDay,durationMonth=30*time_durationDay,durationYear=365*time_durationDay;function time_date(t){return new Date(t)}function time_number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(year,month,week,day,hour,minute,second,millisecond,format){var scale=continuous(deinterpolateLinear,src_number),invert=scale.invert,domain=scale.domain,formatMillisecond=format(".%L"),formatSecond=format(":%S"),formatMinute=format("%I:%M"),formatHour=format("%I %p"),formatDay=format("%a %d"),formatWeek=format("%b %d"),formatMonth=format("%B"),formatYear=format("%Y"),tickIntervals=[[second,1,time_durationSecond],[second,5,5*time_durationSecond],[second,15,15*time_durationSecond],[second,30,30*time_durationSecond],[minute,1,time_durationMinute],[minute,5,5*time_durationMinute],[minute,15,15*time_durationMinute],[minute,30,30*time_durationMinute],[hour,1,time_durationHour],[hour,3,3*time_durationHour],[hour,6,6*time_durationHour],[hour,12,12*time_durationHour],[day,1,time_durationDay],[day,2,2*time_durationDay],[week,1,time_durationWeek],[month,1,durationMonth],[month,3,3*durationMonth],[year,1,durationYear]];function tickFormat(date){return(second(date)1)&&(t-=Math.floor(t));var ts=Math.abs(t-.5);return rainbow_c.h=360*t-100,rainbow_c.s=1.5-1.5*ts,rainbow_c.l=.8-.9*ts,rainbow_c+""},sequential_multi_cubehelix=cubehelixLong(cubehelix_cubehelix(300,.5,0),cubehelix_cubehelix(-240,.5,1)),BuGn=src_ramp(new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(d3_scale_chromatic_src_colors)),BuPu=src_ramp(new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(d3_scale_chromatic_src_colors)),GnBu=src_ramp(new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(d3_scale_chromatic_src_colors)),OrRd=src_ramp(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(d3_scale_chromatic_src_colors)),PuBuGn=src_ramp(new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(d3_scale_chromatic_src_colors)),PuBu=src_ramp(new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(d3_scale_chromatic_src_colors)),PuRd=src_ramp(new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(d3_scale_chromatic_src_colors)),RdPu=src_ramp(new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(d3_scale_chromatic_src_colors)),YlGnBu=src_ramp(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(d3_scale_chromatic_src_colors)),YlGn=src_ramp(new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(d3_scale_chromatic_src_colors)),YlOrBr=src_ramp(new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(d3_scale_chromatic_src_colors)),YlOrRd=src_ramp(new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(d3_scale_chromatic_src_colors)),UNIT_GLOBAL_NAMESPACE="app.units",UNIT_LOCAL_NAMESPACE="local.units",LAYER_LOCAL_NAMESPACE="local.layers",LAYER_GLOBAL_NAMESPACE="app.layers",GROUP_GLOBAL_NAMESPACE="app.group",GROUP_LOCAL_NAMESPACE="local.group",CANVAS_LOCAL_NAMESPACE="local.canvas",CANVAS_GLOBAL_NAMESPACE="app.canvas",swap=function swap(arr,i,j){var tmp=arr[i];arr[i]=arr[j],arr[j]=tmp},defaultCompare=function defaultCompare(a,b){return a>b?-1:a>b?1:0},quick_select=function quickselect(arr,k,left,right,compare){!function quickselectStep(arr,k,left,right,compare){for(;right>left;){if(right-left>600){var n=right-left+1,m=k-left+1,z=Math.log(n),s=.5*Math.exp(2*z/3),sd=.5*Math.sqrt(z*s*(n-s)/n)*(m-n/2<0?-1:1);quickselectStep(arr,k,Math.max(left,Math.floor(k-m*s/n+sd)),Math.min(right,Math.floor(k+(n-m)*s/n+sd)),compare)}var t=arr[k],i=left,j=right;for(swap(arr,left,k),compare(arr[right],t)>0&&swap(arr,left,right);i0;)j--}0===compare(arr[left],t)?swap(arr,left,j):swap(arr,++j,right),j<=k&&(left=j+1),k<=j&&(right=j-1)}}(arr,k,left||0,right||arr.length-1,compare||defaultCompare)};function _defineProperties(target,props){for(var i=0;i=a.minX&&b.maxY>=a.minY},findItem=function findItem(item,items,equalsFn){if(!equalsFn)return items.indexOf(item);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:9;!function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RTree),this._maxEntries=Math.max(4,maxEntries),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(RTree,[{key:"all",value:function all(){return _all(this.data,[])}},{key:"search",value:function search(bbox){var node=this.data,result=[];if(!intersects(bbox,node))return result;for(var toBBox=this.toBBox,nodesToSearch=[];node;){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=node.children[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var child=_step.value,childBBox=node.leaf?toBBox(child):child;intersects(bbox,childBBox)&&(node.leaf?result.push(child):contains(bbox,childBBox)?_all(child,result):nodesToSearch.push(child))}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}node=nodesToSearch.pop()}return result}},{key:"load",value:function load(data){if(!data||!data.length)return this;if(data.length=0&&insertPath[level].children.length>this._maxEntries;)this.split(insertPath,level),level--;this.adjustParentBoxes(bbox,insertPath,level)}},{key:"split",value:function split(insertPath,level){var node=insertPath[level],M=node.children.length,m=this._minEntries;this.chooseSplitAxis(node,m,M);var splitIndex=this.chooseSplitIndex(node,m,M),newNode=createNode(node.children.splice(splitIndex,node.children.length-splitIndex));newNode.height=node.height,newNode.leaf=node.leaf,calcBBox(node,this.toBBox),calcBBox(newNode,this.toBBox),level?insertPath[level-1].children.push(newNode):this.splitRoot(node,newNode)}},{key:"splitRoot",value:function splitRoot(node,newNode){this.data=createNode([node,newNode]),this.data.height=node.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)}},{key:"chooseSplitIndex",value:function chooseSplitIndex(node,m,M){for(var index,minOverlap=1/0,minArea=1/0,i=m;i<=M-m;i++){var bbox1=distBBox(node,0,i,this.toBBox),bbox2=distBBox(node,i,M,this.toBBox),overlap=intersectionArea(bbox1,bbox2),area=bboxArea(bbox1)+bboxArea(bbox2);overlap=m;_i--){var _child=node.children[_i];r_tree_extend(rightBBox,node.leaf?toBBox(_child):_child),margin+=bboxMargin(rightBBox)}return margin}},{key:"adjustParentBoxes",value:function adjustParentBoxes(bbox,path,level){for(var i=level;i>=0;i--)r_tree_extend(path[i],bbox)}},{key:"condense",value:function condense(path){for(var siblings,i=path.length-1;i>=0;i--)0===path[i].children.length?i>0?(siblings=path[i-1].children).splice(siblings.indexOf(path[i]),1):this.clear():calcBBox(path[i],this.toBBox)}}]),RTree}(),reserved_fields={ROW_ID:"__id__",MEASURE_NAMES:"__measure_names__"},common_props={ACTION_INF:"actionInf",ON_LAYER_DRAW:"onLayerDraw",MATRIX_CREATED:"matrixCreated"},COORD_TYPES={POLAR:"polar",CARTESIAN:"cartesian"},DATA_TYPE_FUNCTION="function",DATA_TYPE_STRING="string",src_array_slice=Array.prototype.slice,d3_axis_src_identity=function(x){return x},axis_top=1,axis_right=2,axis_bottom=3,axis_left=4,epsilon=1e-6;function translateX(x){return"translate("+(x+.5)+",0)"}function translateY(y){return"translate(0,"+(y+.5)+")"}function entering(){return!this.__axis}function axis_axis(orient,scale){var tickArguments=[],tickValues=null,tickFormat=null,tickTransform=null,tickSizeInner=6,tickSizeOuter=6,tickPadding=3,k=orient===axis_top||orient===axis_left?-1:1,x=orient===axis_left||orient===axis_right?"x":"y",transform=orient===axis_top||orient===axis_bottom?translateX:translateY;function axis(context){var values=null==tickValues?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():tickValues,format=null==tickFormat?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):d3_axis_src_identity:tickFormat,spacing=Math.max(tickSizeInner,0)+tickPadding,range=scale.range(),range0=+range[0]+.5,range1=+range[range.length-1]+.5,position=(scale.bandwidth?function axis_center(scale){var offset=Math.max(0,scale.bandwidth()-1)/2;return scale.round()&&(offset=Math.round(offset)),function(d){return+scale(d)+offset}}:function axis_number(scale){return function(d){return+scale(d)}})(scale.copy()),selection=context.selection?context.selection():context,path=selection.selectAll(".domain").data([null]),tick=selection.selectAll(".tick").data(values,scale).order(),tickExit=tick.exit(),tickEnter=tick.enter().append("g").attr("class","tick"),line=tick.select("line"),text=tick.select("text");path=path.merge(path.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),tick=tick.merge(tickEnter),line=line.merge(tickEnter.append("line").attr("stroke","#000").attr(x+"2",k*tickSizeInner)),text=text.merge(tickEnter.append("text").attr("fill","#000").attr(x,k*spacing).attr("dy",orient===axis_top?"0em":orient===axis_bottom?"0.71em":"0.32em")).style("transform",tickTransform),context!==selection&&(path=path.transition(context),tick=tick.transition(context),line=line.transition(context),text=text.transition(context),tickExit=tickExit.transition(context).attr("opacity",epsilon).attr("transform",function(d){return isFinite(d=position(d))?transform(d):this.getAttribute("transform")}),tickEnter.attr("opacity",epsilon).attr("transform",function(d){var p=this.parentNode.__axis;return transform(p&&isFinite(p=p(d))?p:position(d))})),tickExit.remove(),path.attr("d",orient===axis_left||orient==axis_right?"M"+k*tickSizeOuter+","+range0+"H0.5V"+range1+"H"+k*tickSizeOuter:"M"+range0+","+k*tickSizeOuter+"V0.5H"+range1+"V"+k*tickSizeOuter),tick.attr("opacity",1).attr("transform",function(d){return transform(position(d))}),line.attr(x+"2",k*tickSizeInner),text.attr(x,k*spacing).text(format),selection.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",orient===axis_right?"start":orient===axis_left?"end":"middle"),selection.each(function(){this.__axis=position})}return axis.scale=function(_){return arguments.length?(scale=_,axis):scale},axis.tickTransform=function(_){return arguments.length?(tickTransform=_,axis):tickTransform},axis.ticks=function(){return tickArguments=src_array_slice.call(arguments),axis},axis.tickArguments=function(_){return arguments.length?(tickArguments=null==_?[]:src_array_slice.call(_),axis):tickArguments.slice()},axis.tickValues=function(_){return arguments.length?(tickValues=null==_?null:src_array_slice.call(_),axis):tickValues&&tickValues.slice()},axis.tickFormat=function(_){return arguments.length?(tickFormat=_,axis):tickFormat},axis.tickSize=function(_){return arguments.length?(tickSizeInner=tickSizeOuter=+_,axis):tickSizeInner},axis.tickSizeInner=function(_){return arguments.length?(tickSizeInner=+_,axis):tickSizeInner},axis.tickSizeOuter=function(_){return arguments.length?(tickSizeOuter=+_,axis):tickSizeOuter},axis.tickPadding=function(_){return arguments.length?(tickPadding=+_,axis):tickPadding},axis}var abs=Math.abs,atan2=Math.atan2,cos=Math.cos,math_max=Math.max,math_min=Math.min,sin=Math.sin,math_sqrt=Math.sqrt,math_epsilon=1e-12,pi=Math.PI,halfPi=pi/2,tau=2*pi;function asin(x){return x>=1?halfPi:x<=-1?-halfPi:Math.asin(x)}var symbol_circle={draw:function draw(context,size){var r=Math.sqrt(size/pi);context.moveTo(r,0),context.arc(0,0,r,0,tau)}},symbol_cross={draw:function draw(context,size){var r=Math.sqrt(size/5)/2;context.moveTo(-3*r,-r),context.lineTo(-r,-r),context.lineTo(-r,-3*r),context.lineTo(r,-3*r),context.lineTo(r,-r),context.lineTo(3*r,-r),context.lineTo(3*r,r),context.lineTo(r,r),context.lineTo(r,3*r),context.lineTo(-r,3*r),context.lineTo(-r,r),context.lineTo(-3*r,r),context.closePath()}},tan30=Math.sqrt(1/3),tan30_2=2*tan30,diamond={draw:function draw(context,size){var y=Math.sqrt(size/tan30_2),x=y*tan30;context.moveTo(0,-y),context.lineTo(x,0),context.lineTo(0,y),context.lineTo(-x,0),context.closePath()}},square={draw:function draw(context,size){var w=Math.sqrt(size),x=-w/2;context.rect(x,x,w,w)}},kr=Math.sin(pi/10)/Math.sin(7*pi/10),kx=Math.sin(tau/10)*kr,ky=-Math.cos(tau/10)*kr,star={draw:function draw(context,size){var r=Math.sqrt(.8908130915292852*size),x=kx*r,y=ky*r;context.moveTo(0,-r),context.lineTo(x,y);for(var i=1;i<5;++i){var a=tau*i/5,c=Math.cos(a),s=Math.sin(a);context.lineTo(s*r,-c*r),context.lineTo(c*x-s*y,s*x+c*y)}context.closePath()}},wye_s=Math.sqrt(3)/2,wye_k=1/Math.sqrt(12),wye_a=3*(wye_k/2+1),wye={draw:function draw(context,size){var r=Math.sqrt(size/wye_a),x0=r/2,y0=r*wye_k,x1=x0,y1=r*wye_k+r,x2=-x1,y2=y1;context.moveTo(x0,y0),context.lineTo(x1,y1),context.lineTo(x2,y2),context.lineTo(-.5*x0-wye_s*y0,wye_s*x0+-.5*y0),context.lineTo(-.5*x1-wye_s*y1,wye_s*x1+-.5*y1),context.lineTo(-.5*x2-wye_s*y2,wye_s*x2+-.5*y2),context.lineTo(-.5*x0+wye_s*y0,-.5*y0-wye_s*x0),context.lineTo(-.5*x1+wye_s*y1,-.5*y1-wye_s*x1),context.lineTo(-.5*x2+wye_s*y2,-.5*y2-wye_s*x2),context.closePath()}},sqrt3=Math.sqrt(3),triangle={draw:function draw(context,size){var y=-Math.sqrt(size/(3*sqrt3));context.moveTo(0,2*y),context.lineTo(-sqrt3*y,-y),context.lineTo(sqrt3*y,-y),context.closePath()}},path_pi=Math.PI,path_tau=2*path_pi,tauEpsilon=path_tau-1e-6;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,moveTo:function moveTo(x,y){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)},closePath:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function lineTo(x,y){this._+="L"+(this._x1=+x)+","+(this._y1=+y)},quadraticCurveTo:function quadraticCurveTo(x1,y1,x,y){this._+="Q"+ +x1+","+ +y1+","+(this._x1=+x)+","+(this._y1=+y)},bezierCurveTo:function bezierCurveTo(x1,y1,x2,y2,x,y){this._+="C"+ +x1+","+ +y1+","+ +x2+","+ +y2+","+(this._x1=+x)+","+(this._y1=+y)},arcTo:function arcTo(x1,y1,x2,y2,r){x1=+x1,y1=+y1,x2=+x2,y2=+y2,r=+r;var x0=this._x1,y0=this._y1,x21=x2-x1,y21=y2-y1,x01=x0-x1,y01=y0-y1,l01_2=x01*x01+y01*y01;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=x1)+","+(this._y1=y1);else if(l01_2>1e-6)if(Math.abs(y01*x21-y21*x01)>1e-6&&r){var x20=x2-x0,y20=y2-y0,l21_2=x21*x21+y21*y21,l20_2=x20*x20+y20*y20,l21=Math.sqrt(l21_2),l01=Math.sqrt(l01_2),l=r*Math.tan((path_pi-Math.acos((l21_2+l01_2-l20_2)/(2*l21*l01)))/2),t01=l/l01,t21=l/l21;Math.abs(t01-1)>1e-6&&(this._+="L"+(x1+t01*x01)+","+(y1+t01*y01)),this._+="A"+r+","+r+",0,0,"+ +(y01*x20>x01*y20)+","+(this._x1=x1+t21*x21)+","+(this._y1=y1+t21*y21)}else this._+="L"+(this._x1=x1)+","+(this._y1=y1);else;},arc:function arc(x,y,r,a0,a1,ccw){x=+x,y=+y,ccw=!!ccw;var dx=(r=+r)*Math.cos(a0),dy=r*Math.sin(a0),x0=x+dx,y0=y+dy,cw=1^ccw,da=ccw?a0-a1:a1-a0;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+x0+","+y0:(Math.abs(this._x1-x0)>1e-6||Math.abs(this._y1-y0)>1e-6)&&(this._+="L"+x0+","+y0),r&&(da<0&&(da=da%path_tau+path_tau),da>tauEpsilon?this._+="A"+r+","+r+",0,1,"+cw+","+(x-dx)+","+(y-dy)+"A"+r+","+r+",0,1,"+cw+","+(this._x1=x0)+","+(this._y1=y0):da>1e-6&&(this._+="A"+r+","+r+",0,"+ +(da>=path_pi)+","+cw+","+(this._x1=x+r*Math.cos(a1))+","+(this._y1=y+r*Math.sin(a1))))},rect:function rect(x,y,w,h){this._+="M"+(this._x0=this._x1=+x)+","+(this._y0=this._y1=+y)+"h"+ +w+"v"+ +h+"h"+-w+"Z"},toString:function toString(){return this._}};var src_path=path_path,d3_shape_src_constant=function(x){return function constant(){return x}},none=function(series){for(var n=series.length,o=new Array(n);--n>=0;)o[n]=n;return o},order_ascending=function(series){var sums=series.map(ascending_sum);return none(series).sort(function(a,b){return sums[a]-sums[b]})};function ascending_sum(series){for(var v,s=0,i=-1,n=series.length;++i1)for(var j,s0,n,i=1,s1=series[order[0]],m=s1.length;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,y),this._context.lineTo(x,y);else{var x1=this._x*(1-this._t)+x*this._t;this._context.lineTo(x1,this._y),this._context.lineTo(x1,y)}}this._x=x,this._y=y}};var curve_step=function(context){return new Step(context,.5)};function stepBefore(context){return new Step(context,0)}function stepAfter(context){return new Step(context,1)}function _point(that,x,y){that._context.bezierCurveTo(that._x1+that._k*(that._x2-that._x0),that._y1+that._k*(that._y2-that._y0),that._x2+that._k*(that._x1-x),that._y2+that._k*(that._y1-y),that._x2,that._y2)}function Cardinal(context,tension){this._context=context,this._k=(1-tension)/6}Cardinal.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){switch(x=+x,y=+y,this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2,this._x1=x,this._y1=y;break;case 2:this._point=3;default:_point(this,x,y)}this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};(function custom(tension){function cardinal(context){return new Cardinal(context,tension)}return cardinal.tension=function(tension){return custom(+tension)},cardinal})(0);function CatmullRom(context,alpha){this._context=context,this._alpha=alpha}CatmullRom.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(x,y){if(x=+x,y=+y,this._point){var x23=this._x2-x,y23=this._y2-y;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(x23*x23+y23*y23,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(x,y):this._context.moveTo(x,y);break;case 1:this._point=2;break;case 2:this._point=3;default:!function catmullRom_point(that,x,y){var x1=that._x1,y1=that._y1,x2=that._x2,y2=that._y2;if(that._l01_a>math_epsilon){var a=2*that._l01_2a+3*that._l01_a*that._l12_a+that._l12_2a,n=3*that._l01_a*(that._l01_a+that._l12_a);x1=(x1*a-that._x0*that._l12_2a+that._x2*that._l01_2a)/n,y1=(y1*a-that._y0*that._l12_2a+that._y2*that._l01_2a)/n}if(that._l23_a>math_epsilon){var b=2*that._l23_2a+3*that._l23_a*that._l12_a+that._l12_2a,m=3*that._l23_a*(that._l23_a+that._l12_a);x2=(x2*b+that._x1*that._l23_2a-x*that._l12_2a)/m,y2=(y2*b+that._y1*that._l23_2a-y*that._l12_2a)/m}that._context.bezierCurveTo(x1,y1,x2,y2,that._x2,that._y2)}(this,x,y)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=x,this._y0=this._y1,this._y1=this._y2,this._y2=y}};var curve_catmullRom=function custom(alpha){function catmullRom(context){return alpha?new CatmullRom(context,alpha):new Cardinal(context,0)}return catmullRom.alpha=function(alpha){return custom(+alpha)},catmullRom}(.5);function point_x(p){return p[0]}function point_y(p){return p[1]}var src_line=function(){var x=point_x,y=point_y,defined=d3_shape_src_constant(!0),context=null,curve=curve_linear,output=null;function line(data){var i,d,buffer,n=data.length,defined0=!1;for(null==context&&(output=curve(buffer=src_path())),i=0;i<=n;++i)!(ia?1:b>=a?0:NaN},d3_shape_src_identity=function(d){return d};function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/math_sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*math_sqrt(math_max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function hsl_hsl(hue){return function(start,end){var h=hue((start=hsl(start)).h,(end=hsl(end)).h),s=nogamma(start.s,end.s),l=nogamma(start.l,end.l),opacity=nogamma(start.opacity,end.opacity);return function(t){return start.h=h(t),start.s=s(t),start.l=l(t),start.opacity=opacity(t),start+""}}}hsl_hsl(color_hue);var hslLong=hsl_hsl(nogamma);function piecewise_piecewise(interpolate,values){for(var i=0,n=values.length-1,v=values[0],I=new Array(n<0?0:n);i0)){if(r/=dx,dx<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=x1-ax,dx||!(r<0)){if(r/=dx,dx<0){if(r>t1)return;r>t0&&(t0=r)}else if(dx>0){if(r0)){if(r/=dy,dy<0){if(r0){if(r>t1)return;r>t0&&(t0=r)}if(r=y1-ay,dy||!(r<0)){if(r/=dy,dy<0){if(r>t1)return;r>t0&&(t0=r)}else if(dy>0){if(r0||t1<1)||(t0>0&&(edge[0]=[ax+t0*dx,ay+t0*dy]),t1<1&&(edge[1]=[ax+t1*dx,ay+t1*dy]),!0)}}}}}function connectEdge(edge,x0,y0,x1,y1){var v1=edge[1];if(v1)return!0;var fm,fb,v0=edge[0],left=edge.left,right=edge.right,lx=left[0],ly=left[1],rx=right[0],ry=right[1],fx=(lx+rx)/2,fy=(ly+ry)/2;if(ry===ly){if(fx=x1)return;if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[fx,y0];v1=[fx,y1]}else{if(v0){if(v0[1]1)if(lx>rx){if(v0){if(v0[1]>=y1)return}else v0=[(y0-fb)/fm,y0];v1=[(y1-fb)/fm,y1]}else{if(v0){if(v0[1]=x1)return}else v0=[x0,fm*x0+fb];v1=[x1,fm*x1+fb]}else{if(v0){if(v0[0]=-epsilon2)){var ha=ax*ax+ay*ay,hc=cx*cx+cy*cy,x=(cy*ha-ay*hc)/d,y=(ax*hc-cx*ha)/d,circle=circlePool.pop()||new function Circle(){RedBlackNode(this),this.x=this.y=this.arc=this.site=this.cy=null};circle.arc=arc,circle.site=cSite,circle.x=x+bx,circle.y=(circle.cy=y+by)+Math.sqrt(x*x+y*y),arc.circle=circle;for(var before=null,node=circles._;node;)if(circle.yDiagram_epsilon)node=node.L;else{if(!((dxr=x-rightBreakPoint(node,directrix))>Diagram_epsilon)){dxl>-Diagram_epsilon?(lArc=node.P,rArc=node):dxr>-Diagram_epsilon?(lArc=node,rArc=node.N):lArc=rArc=node;break}if(!node.R){lArc=node;break}node=node.R}!function createCell(site){return Diagram_cells[site.index]={site:site,halfedges:[]}}(site);var newArc=createBeach(site);if(beaches.insert(lArc,newArc),lArc||rArc){if(lArc===rArc)return detachCircle(lArc),rArc=createBeach(lArc.site),beaches.insert(newArc,rArc),newArc.edge=rArc.edge=createEdge(lArc.site,newArc.site),attachCircle(lArc),void attachCircle(rArc);if(rArc){detachCircle(lArc),detachCircle(rArc);var lSite=lArc.site,ax=lSite[0],ay=lSite[1],bx=site[0]-ax,by=site[1]-ay,rSite=rArc.site,cx=rSite[0]-ax,cy=rSite[1]-ay,d=2*(bx*cy-by*cx),hb=bx*bx+by*by,hc=cx*cx+cy*cy,vertex=[(cy*hb-by*hc)/d+ax,(bx*hc-cx*hb)/d+ay];setEdgeEnd(rArc.edge,lSite,rSite,vertex),newArc.edge=createEdge(lSite,site,null,vertex),rArc.edge=createEdge(site,rSite,null,vertex),attachCircle(lArc),attachCircle(rArc)}else newArc.edge=createEdge(lArc.site,newArc.site)}}function leftBreakPoint(arc,directrix){var site=arc.site,rfocx=site[0],rfocy=site[1],pby2=rfocy-directrix;if(!pby2)return rfocx;var lArc=arc.P;if(!lArc)return-1/0;var lfocx=(site=lArc.site)[0],lfocy=site[1],plby2=lfocy-directrix;if(!plby2)return lfocx;var hl=lfocx-rfocx,aby2=1/pby2-1/plby2,b=hl/plby2;return aby2?(-b+Math.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx:(rfocx+lfocx)/2}function rightBreakPoint(arc,directrix){var rArc=arc.N;if(rArc)return leftBreakPoint(rArc,directrix);var site=arc.site;return site[1]===directrix?site[0]:1/0}var beaches,Diagram_cells,circles,Diagram_edges,Diagram_epsilon=1e-6,epsilon2=1e-12;function triangleArea(a,b,c){return(a[0]-c[0])*(b[1]-a[1])-(a[0]-b[0])*(c[1]-a[1])}function lexicographic(a,b){return b[1]-a[1]||b[0]-a[0]}function Diagram(sites,extent){var x,y,circle,site=sites.sort(lexicographic).pop();for(Diagram_edges=[],Diagram_cells=new Array(sites.length),beaches=new src_RedBlackTree,circles=new src_RedBlackTree;;)if(circle=firstCircle,site&&(!circle||site[1]Diagram_epsilon||Math.abs(edge[0][1]-edge[1][1])>Diagram_epsilon)||delete Diagram_edges[i]}(x0,y0,x1,y1),function clipCells(x0,y0,x1,y1){var iCell,cell,site,iHalfedge,halfedges,nHalfedges,start,startX,startY,end,endX,endY,nCells=Diagram_cells.length,cover=!0;for(iCell=0;iCellDiagram_epsilon||Math.abs(endY-startY)>Diagram_epsilon)&&(halfedges.splice(iHalfedge,0,Diagram_edges.push(createBorderEdge(site,end,Math.abs(endX-x0)Diagram_epsilon?[x0,Math.abs(startX-x0)Diagram_epsilon?[Math.abs(startY-y1)Diagram_epsilon?[x1,Math.abs(startX-x1)Diagram_epsilon?[Math.abs(startY-y0)=n)return null;var dx=x-cell.site[0],dy=y-cell.site[1],d2=dx*dx+dy*dy;do{cell=that.cells[i0=i1],i1=null,cell.halfedges.forEach(function(e){var edge=that.edges[e],v=edge.left;if(v!==cell.site&&v||(v=edge.right)){var vx=x-v[0],vy=y-v[1],v2=vx*vx+vy*vy;v20?0:domain[0],domain[1]=domain[1]>0?domain[1]:0),domain},unionDomain=function unionDomain(domains,fieldType){var _ref2,domain=[];(domains=domains.filter(function(dom){return dom&&dom.length})).length&&(domain=fieldType===CATEGORICAL?(_ref2=[]).concat.apply(_ref2,common_utils_toConsumableArray(domains)):[Math.min.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[0]}))),Math.max.apply(Math,common_utils_toConsumableArray(domains.map(function(d){return d[1]})))]);return domain},symbolFns={circle:symbol_circle,cross:symbol_cross,diamond:diamond,square:square,star:star,wye:wye,triangle:triangle},easeFns={cubic:cubicInOut,bounce:bounceOut,linear:function src_linear_linear(t){return+t},elastic:elasticOut,back:backInOut,poly:polyInOut,circle:function circleInOut(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}},getExtremePoint=function getExtremePoint(points,compareValue,minOrMax){for(var extremePoint,point,val,len=points.length,minOrMaxVal="max"===minOrMax?-1/0:1/0,i=0;iminOrMaxVal)&&(minOrMaxVal=val,extremePoint=point);return extremePoint},getMinPoint=function getMinPoint(points,compareValue){return getExtremePoint(points,compareValue,"min")},getMaxPoint=function getMaxPoint(points,compareValue){return getExtremePoint(points,compareValue,"max")},common_utils_getClosestIndexOf=function getClosestIndexOf(arr,value,side){for(var mid,d1,low=0,high=arr.length-1;lowvalue?0===high?high:"left"===side?high-1:high:high===arr.length-1?high:"left"===side?high:high+1},getNearestValue=function getNearestValue(data,key){var filterData=data.filter(function(d){return"number"==typeof d});return filterData[common_utils_getClosestIndexOf(filterData,key)]},getWindow=function getWindow(){return window},reqAnimFrame=requestAnimationFrame,cancelAnimFrame=cancelAnimationFrame,capitalizeFirst=function capitalizeFirst(text){return(text=text.toLowerCase()).replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1)})},unique=function unique(arr){var fn=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(d){return d},vals=arr.reduce(function(acc,v){return acc[fn(v)]=v,acc},{});return Object.values(vals)},getMinDiff=function getMinDiff(arr,index){var diff,uniqueVals;if((uniqueVals=unique(void 0!==index?arr.map(function(d){return d[index]}):arr)).length>1){diff=Math.abs(uniqueVals[1]-uniqueVals[0]);for(var i=2,len=uniqueVals.length;i0&&void 0!==arguments[0]?arguments[0]:[];!function common_utils_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Voronoi),this._voronoi=src_voronoi().x(function(d){return d.x}).y(function(d){return d.y}),this.data(data)}return function common_utils_createClass(Constructor,protoProps,staticProps){return protoProps&&common_utils_defineProperties(Constructor.prototype,protoProps),staticProps&&common_utils_defineProperties(Constructor,staticProps),Constructor}(Voronoi,[{key:"data",value:function data(_data){return _data&&(this._voronoiFn=this._voronoi(_data)),this}},{key:"find",value:function find(x,y,radius){return this._voronoiFn.find(x,y,radius)}}]),Voronoi}(),getObjProp=function getObjProp(obj){if(void 0===obj||null===obj)return obj;for(var retObj=obj,_len=arguments.length,fields=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)fields[_key-1]=arguments[_key];for(var i=0,len=fields.length;i=0;i--)if(arr1[i]!==arr2[i])return!1;return!0},common_utils_isEqual=function isEqual(type){return function(oldVal,newVal){return"Array"===type?!!oldVal&&arraysEqual(oldVal,newVal):"Object"===type?Object.is(oldVal,newVal):oldVal===newVal}},enableChainedTransaction=function enableChainedTransaction(transactionModel,transactionEndpoint,transactionItems){return transactionItems.forEach(function(item){return transactionModel.registerImmediateListener(item,function(_ref3){var newVal=_slicedToArray(_ref3,2)[1];return transactionEndpoint[item](newVal)})})},isHTMLElem=function isHTMLElem(elem){return elem instanceof common_utils_HTMLElement},ERROR_MSG={INTERFACE_IMPL:"Method not implemented"},mergeRecursive=function mergeRecursive(source,sink){for(var prop in sink)isSimpleObject(source[prop])&&isSimpleObject(sink[prop])?mergeRecursive(source[prop],sink[prop]):sink[prop]instanceof Object&&sink[prop].constructor===Object?(source[prop]={},mergeRecursive(source[prop],sink[prop])):source[prop]=sink[prop];return source},common_utils_createSelection=function createSelection(sel,appendObj,data,idFn){var selection=sel||dataSelect(idFn),mergedSelection=(selection=selection.data(data)).enter().append(appendObj).merge(selection),exitSelection=selection.exit();return exitSelection.getObjects().forEach(function(inst){return inst.remove()}),exitSelection.remove(),mergedSelection},interpolateArray=function interpolateArray(data,fitCount){var linearInterpolate=function linearInterpolate(before,after,atPoint){return before+(after-before)*atPoint},newData=[],springFactor=(data.length-1)/(fitCount-1);newData[0]=data[0];for(var i=1;i1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p}var hslToRgb=function hslToRgb(h,s,l){var r,g,b,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(0===s)r=g=b=l;else{var q=l<.5?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return[255*r,255*g,255*b,a]},rgbToHsv=function rgbToHsv(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r=+r,g=+g,b=+b,a=+a,r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;if(max===min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(g3&&void 0!==arguments[3]?arguments[3]:1,i=Math.floor(6*h),f=6*h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s);switch(i%6){case 0:r=v,g=t,b=p;break;case 1:r=q,g=v,b=p;break;case 2:r=p,g=v,b=t;break;case 3:r=p,g=q,b=v;break;case 4:r=t,g=p,b=v;break;case 5:r=v,g=p,b=q}return[255*r,255*g,255*b,a]},hexToHsv=function hexToHsv(hex){hex=hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(m,r,g,b){return r+r+g+g+b+b});var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?rgbToHsv(parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)):""},hslaToRgb=function hslaToRgb(h,s,l,a){var _hslToRgb2=_slicedToArray(hslToRgb(h,s,l,a),4);return function RGBAtoRGB(r,g,b,a){var r2=arguments.length>4&&void 0!==arguments[4]?arguments[4]:255,g2=arguments.length>5&&void 0!==arguments[5]?arguments[5]:255,b2=arguments.length>6&&void 0!==arguments[6]?arguments[6]:255,r3=Math.round((1-a)*r2+a*r),g3=Math.round((1-a)*g2+a*g),b3=Math.round((1-a)*b2+a*b);return"rgb(".concat(r3,",").concat(g3,",").concat(b3,")")}(_hslToRgb2[0],_hslToRgb2[1],_hslToRgb2[2],_hslToRgb2[3])},detectColor=function detectColor(col){return/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/.test(col)||/rgba?\(((25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,\s*?){2}(25[0-5]|2[0-4]\d|1\d{1,2}|\d\d?)\s*,?\s*([01]\.?\d*?)?\)/.test(col)?"rgb":/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(col)||/^hsla\(([\d.]+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/.test(col)?"hsl":/^#([0-9a-f]{3}){1,2}$/i.test(col)?"hex":col};var assembleModelFromIdentifiers=function assembleModelFromIdentifiers(model,identifiers){var data,schema=[],fieldMap=model.getFieldsConfig();return identifiers.length?function(){for(var fields=identifiers[0],len=fields.length,i=0;i=range[0]&&fieldValue<=range[1]})},{saveChild:!1,mode:mode})},getArrayIndexMap=function getArrayIndexMap(arr){return arr.reduce(function(acc,value,i){return acc[value]=i,acc},{})},common_utils_getDataModelFromIdentifiers=function getDataModelFromIdentifiers(dataModel,identifiers,mode,hasBarLayer){var filteredDataModel;if(identifiers instanceof Array){var fieldsConfig=dataModel.getFieldsConfig(),dataArr=identifiers.slice(1,identifiers.length);if(identifiers instanceof Function)filteredDataModel=identifiers(dataModel,{},!1);else if(identifiers instanceof Array&&identifiers[0].length){var filteredSchema=identifiers[0].filter(function(d){return d in fieldsConfig||d===reserved_fields.ROW_ID});filteredDataModel=dataModel.select(function(fields,rowId){var include=!0;return filteredSchema.forEach(function(propField,idx){var value=propField===reserved_fields.ROW_ID?rowId:fields[propField].internalValue,index=dataArr.findIndex(function(d){return d[idx]===value});include=include&&-1!==index}),include},{saveChild:!1,mode:mode})}else filteredDataModel=dataModel.select(function(){return!1},{saveChild:!1,mode:mode})}else filteredDataModel=getDataModelFromRange(dataModel,identifiers,mode,hasBarLayer);return filteredDataModel},common_utils_registerListeners=function registerListeners(context,listenerMap){for(var _len2=arguments.length,params=new Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++)params[_key2-2]=arguments[_key2];var propListenerMap=listenerMap.apply(void 0,[context].concat(params));for(var key in propListenerMap)if({}.hasOwnProperty.call(propListenerMap,key)){var namespace=params[1].namespace,ns=null;namespace&&(ns=namespace);var mapObj=propListenerMap[key],propType=mapObj.type,props=mapObj.props,listenerFn=mapObj.listener;context.store()[propType](props,listenerFn,!1,{namespace:ns})}},isValidValue=function isValidValue(value){return!isNaN(value)&&value!==-1/0&&value!==1/0},escapeHTML=function escapeHTML(str){var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"".concat(str).replace(/[&<>"'/]/g,function(match){return htmlEscapes[match]})},transposeArray=function transposeArray(arr){return arr[0].map(function(col,i){return arr.map(function(row){return row[i]})})},toArray=function toArray(arr){return arr instanceof Array?arr:[arr]},extendsClass=function extendsClass(cls,extendsFrom,found){if(!cls)return!1;var prototype=cls.prototype;return found=prototype instanceof extendsFrom||extendsClass(prototype,extendsFrom,found)},common_utils_concatModels=function concatModels(dm1,dm2){for(var dataObj1=dm1.getData(),dataObj2=dm2.getData(),data1=dataObj1.data,data2=dataObj2.data,schema1=dataObj1.schema,schema2=dataObj2.schema,commonTuples={},i=0;i0)for(var i,d,dy,yp,yn,n,j=0,m=series[order[0]].length;j0?(d[0]=yp,d[1]=yp+=dy):dy<0?(d[1]=yn,d[0]=yn+=dy):(d[0]=0,d[1]=dy)}),_defineProperty(_stackOffsets,"none",offset_none),_defineProperty(_stackOffsets,"expand",function(series,order){if((n=series.length)>0){for(var i,n,y,j=0,m=series[0].length;j0&&(m=(s0=series[order[0]]).length)>0){for(var s0,m,n,y=0,j=1;j=j;--k)output.point(x0z[k],y0z[k]);output.lineEnd(),output.areaEnd()}defined0&&(x0z[i]=+x0(d,i,data),y0z[i]=+y0(d,i,data),output.point(x1?+x1(d,i,data):x0z[i],y1?+y1(d,i,data):y0z[i]))}if(buffer)return output=null,buffer+""||null}function arealine(){return src_line().defined(defined).curve(curve).context(context)}return area.x=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),x1=null,area):x0},area.x0=function(_){return arguments.length?(x0="function"==typeof _?_:d3_shape_src_constant(+_),area):x0},area.x1=function(_){return arguments.length?(x1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):x1},area.y=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),y1=null,area):y0},area.y0=function(_){return arguments.length?(y0="function"==typeof _?_:d3_shape_src_constant(+_),area):y0},area.y1=function(_){return arguments.length?(y1=null==_?null:"function"==typeof _?_:d3_shape_src_constant(+_),area):y1},area.lineX0=area.lineY0=function(){return arealine().x(x0).y(y0)},area.lineY1=function(){return arealine().x(x0).y(y1)},area.lineX1=function(){return arealine().x(x1).y(y0)},area.defined=function(_){return arguments.length?(defined="function"==typeof _?_:d3_shape_src_constant(!!_),area):defined},area.curve=function(_){return arguments.length?(curve=_,null!=context&&(output=curve(context)),area):curve},area.context=function(_){return arguments.length?(null==_?context=output=null:output=curve(context=_),area):context},area},pie:function(){var value=d3_shape_src_identity,sortValues=src_descending,sort=null,startAngle=d3_shape_src_constant(0),endAngle=d3_shape_src_constant(tau),padAngle=d3_shape_src_constant(0);function pie(data){var i,j,k,a1,v,n=data.length,sum=0,index=new Array(n),arcs=new Array(n),a0=+startAngle.apply(this,arguments),da=Math.min(tau,Math.max(-tau,endAngle.apply(this,arguments)-a0)),p=Math.min(Math.abs(da)/n,padAngle.apply(this,arguments)),pa=p*(da<0?-1:1);for(i=0;i0&&(sum+=v);for(null!=sortValues?index.sort(function(i,j){return sortValues(arcs[i],arcs[j])}):null!=sort&&index.sort(function(i,j){return sort(data[i],data[j])}),i=0,k=sum?(da-n*pa)/sum:0;i0?v*k:0)+pa,arcs[j]={data:data[j],index:i,value:v,startAngle:a0,endAngle:a1,padAngle:p};return arcs}return pie.value=function(_){return arguments.length?(value="function"==typeof _?_:d3_shape_src_constant(+_),pie):value},pie.sortValues=function(_){return arguments.length?(sortValues=_,sort=null,pie):sortValues},pie.sort=function(_){return arguments.length?(sort=_,sortValues=null,pie):sort},pie.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):startAngle},pie.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):endAngle},pie.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:d3_shape_src_constant(+_),pie):padAngle},pie},arc:function(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=d3_shape_src_constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null;function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=src_path()),r1math_epsilon)if(da>tau-math_epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>math_epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>math_epsilon&&(padRadius?+padRadius.apply(this,arguments):math_sqrt(r0*r0+r1*r1)),rc=math_min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>math_epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>math_epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>math_epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>math_epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da1?0:x<-1?pi:Math.acos(x)}((ax*bx+ay*by)/(math_sqrt(ax*ax+ay*ay)*math_sqrt(bx*bx+by*by)))/2),lc=math_sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=math_min(rc,(r0-lc)/(kc-1)),rc1=math_min(rc,(r1-lc)/(kc+1))}}da1>math_epsilon?rc1>math_epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1math_epsilon&&da0>math_epsilon?rc0>math_epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc01?_len3-1:0),_key3=1;_key3<_len3;_key3++)measureFieldNames[_key3-1]=arguments[_key3];var filteredReducers={};if(dataModel instanceof datamodel_default.a){var derivations=[].concat(common_utils_toConsumableArray(dataModel.getDerivations().reverse()),common_utils_toConsumableArray(dataModel.getAncestorDerivations().reverse())),nearestReducers=defaultValue(getObjProp(derivations.find(function(derv){return derv.op===dist_datamodel.DM_DERIVATIVES.GROUPBY}),"criteria"),{}),measures=dataModel.getFieldspace().getMeasure();(measureFieldNames=measureFieldNames.length?measureFieldNames:Object.keys(measures)).forEach(function(measureName){if(nearestReducers[measureName])filteredReducers[measureName]=nearestReducers[measureName];else{var measureField=measures[measureName];measureField&&(filteredReducers[measureName]=measureField.defAggFn())}})}return filteredReducers},retrieveFieldDisplayName=function retrieveFieldDisplayName(dm,fieldName){return dm.getFieldspace().fieldsObj()[fieldName].displayName()},common_utils_nearestSortingDetails=function nearestSortingDetails(dataModel){var nearestSortDerivation=[].concat(common_utils_toConsumableArray(dataModel.getAncestorDerivations()),common_utils_toConsumableArray(dataModel.getDerivations())).reverse().find(function(derivation){return derivation.op===dist_datamodel.DM_DERIVATIVES.SORT});return nearestSortDerivation?nearestSortDerivation.criteria:null},common_utils_sortingOrder=function sortingOrder(a,b){return a instanceof InvalidAwareTypes||a instanceof InvalidAwareTypes?1:a.localeCompare(b)},sortOrderMap=(_defineProperty(_sortOrderMap={},"asc",function(firstVal,secondVal){return common_utils_sortingOrder(firstVal,secondVal)}),_defineProperty(_sortOrderMap,"desc",function(firstVal,secondVal){return common_utils_sortingOrder(secondVal,firstVal)}),_sortOrderMap),sortCategoricalField=function sortCategoricalField(sortOrder,firstVal,secondVal){var sortOrderType=common_utils_typeof(sortOrder);return sortOrderType===FUNCTION?sortOrder(firstVal,secondVal):sortOrderType===STRING&&sortOrderMap[sortOrder]?sortOrderMap[sortOrder](firstVal,secondVal):null},common_utils_intersect=function intersect(arr1,arr2){var _accessors=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors[0],fn2=_accessors[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return set.has(fn1(value))})},difference=function difference(arr1,arr2){var _accessors2=_slicedToArray(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[function(v){return v},function(v){return v}],2),fn1=_accessors2[0],fn2=_accessors2[1],set=new Set(arr2.map(function(v){return fn2(v)}));return arr1.filter(function(value){return!set.has(fn1(value))})},partition=function partition(array,filterFn){return array.reduce(function(acc,v,i){return filterFn(v,i,array)?acc[0].push(v):acc[1].push(v),acc},[[],[]])},mix=function mix(superclass){return{with:function _with(){for(var _len4=arguments.length,mixins=new Array(_len4),_key4=0;_key4<_len4;_key4++)mixins[_key4]=arguments[_key4];return mixins.reduce(function(cls,mixin){return mixin(cls)},superclass)}}},common_utils_componentRegistry=function componentRegistry(comps){var reg=Object.assign({},comps),regObj={register:function register(def,customKey){var key=customKey||def.formalName();return reg[key]=def,regObj},get:function get(){return reg}};return regObj},common_utils_getReadableTicks=function getReadableTicks(domain,steps){var orderedDomain=[Math.min.apply(Math,common_utils_toConsumableArray(domain)),Math.max.apply(Math,common_utils_toConsumableArray(domain))];if(steps<3)return orderedDomain;var tempScale=quantize().domain(orderedDomain).nice(),legendTicks=null;return legendTicks=Symbols.axisBottom().scale(tempScale).scale().ticks(steps),Math.max.apply(Math,common_utils_toConsumableArray(legendTicks))orderedDomain[0]&&legendTicks.unshift(orderedDomain[0]),legendTicks},common_utils_transformColor=function transformColor(rgbaValues,_ref7,datum,apply){var _ref7$h=_ref7.h,h=void 0===_ref7$h?0:_ref7$h,_ref7$s=_ref7.s,s=void 0===_ref7$s?0:_ref7$s,_ref7$l=_ref7.l,l=void 0===_ref7$l?0:_ref7$l,a=_ref7.a,_RGBAToHSLA$code=_slicedToArray(function RGBAToHSLA(r,g,b){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;r/=255,g/=255,b/=255;var cmin=Math.min(r,g,b),cmax=Math.max(r,g,b),delta=cmax-cmin,h=0,s=0,l=0;return h=0===delta?0:cmax===r?(g-b)/delta%6:cmax===g?(b-r)/delta+2:(r-g)/delta+4,(h=Math.round(60*h))<0&&(h+=360),l=(cmax+cmin)/2,s=+(100*(s=0===delta?0:delta/(1-Math.abs(2*l-1)))).toFixed(1),l=+(100*l).toFixed(1),{color:"hsla(".concat(h,",").concat(s,"%,").concat(l,"%,").concat(a,")"),code:[h,s,l,a]}}.apply(void 0,common_utils_toConsumableArray(rgbaValues)).code,4),origH=_RGBAToHSLA$code[0],origS=_RGBAToHSLA$code[1],origL=_RGBAToHSLA$code[2],origA=_RGBAToHSLA$code[3],sanitizedA=parseFloat(a||origA,10),newH=origH+h,newS=origS+s,newL=origL+l,newA=sanitizedA+1;return apply||(newA=sanitizedA-1),{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH,newS,newL,newA]}},pointWithinCircle=function pointWithinCircle(c,point){var cx=c.x,cy=c.y,r=c.r,x=point.x,y=point.y;return Math.sqrt(Math.pow(cx-x,2)+Math.pow(cy-y,2))<=r},common_utils_dmMultipleSelection=function dmMultipleSelection(targetData,dm){var targetFields=targetData[0],payloadMap=targetData.slice(1,targetData.length).reduce(function(acc,v){return acc[v]=v,acc},{}),measures=Object.keys(dm.getFieldspace().getMeasure());return function filterFn(fields,i){return"".concat(targetFields.map(function(field){var val;if(field===reserved_fields.MEASURE_NAMES)val=measures;else if(field===reserved_fields.ROW_ID)val=i;else{var currentField=fields[field];val=currentField instanceof InvalidAwareTypes?currentField.value():(currentField||{}).internalValue}return val}))in payloadMap}};function selector_none(){}var src_selector=function(selector){return null==selector?selector_none:function(){return this.querySelector(selector)}};function selectorAll_empty(){return[]}var selectorAll=function(selector){return null==selector?selectorAll_empty:function(){return this.querySelectorAll(selector)}},matcher=function(selector){return function(){return this.matches(selector)}},sparse=function(update){return new Array(update.length)};function EnterNode(parent,datum){this.ownerDocument=parent.ownerDocument,this.namespaceURI=parent.namespaceURI,this._next=null,this._parent=parent,this.__data__=datum}EnterNode.prototype={constructor:EnterNode,appendChild:function appendChild(child){return this._parent.insertBefore(child,this._next)},insertBefore:function insertBefore(child,next){return this._parent.insertBefore(child,next)},querySelector:function querySelector(selector){return this._parent.querySelector(selector)},querySelectorAll:function querySelectorAll(selector){return this._parent.querySelectorAll(selector)}};var keyPrefix="$";function bindIndex(parent,group,enter,update,exit,data){for(var node,i=0,groupLength=group.length,dataLength=data.length;ib?1:a>=b?0:NaN}var xhtml="http://www.w3.org/1999/xhtml",src_namespaces={svg:"http://www.w3.org/2000/svg",xhtml:xhtml,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},src_namespace=function(name){var prefix=name+="",i=prefix.indexOf(":");return i>=0&&"xmlns"!==(prefix=name.slice(0,i))&&(name=name.slice(i+1)),src_namespaces.hasOwnProperty(prefix)?{space:src_namespaces[prefix],local:name}:name};var src_window=function(node){return node.ownerDocument&&node.ownerDocument.defaultView||node.document&&node||node.defaultView};function styleValue(node,name){return node.style.getPropertyValue(name)||src_window(node).getComputedStyle(node,null).getPropertyValue(name)}function classArray(string){return string.trim().split(/^|\s+/)}function classList(node){return node.classList||new ClassList(node)}function ClassList(node){this._node=node,this._names=classArray(node.getAttribute("class")||"")}function classedAdd(node,names){for(var list=classList(node),i=-1,n=names.length;++i=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function contains(name){return this._names.indexOf(name)>=0}};function textRemove(){this.textContent=""}function htmlRemove(){this.innerHTML=""}function raise_raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}var creator=function(name){var fullname=src_namespace(name);return(fullname.local?function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local)}}:function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name)}})(fullname)};function constantNull(){return null}function remove_remove(){var parent=this.parentNode;parent&&parent.removeChild(this)}function selection_cloneShallow(){var clone=this.cloneNode(!1),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}function selection_cloneDeep(){var clone=this.cloneNode(!0),parent=this.parentNode;return parent?parent.insertBefore(clone,this.nextSibling):clone}var filterEvents={},on_event=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(filterEvents={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(listener,index,group){return listener=contextListener(listener,index,group),function(event){var related=event.relatedTarget;related&&(related===this||8&related.compareDocumentPosition(this))||listener.call(this,event)}}function contextListener(listener,index,group){return function(event1){var event0=on_event;on_event=event1;try{listener.call(this,this.__data__,index,group)}finally{on_event=event0}}}function onRemove(typename){return function(){var on=this.__on;if(on){for(var o,j=0,i=-1,m=on.length;j=i1&&(i1=i0+1);!(next=updateGroup[i1])&&++i1=0;)(node=group[i])&&(next&&4^node.compareDocumentPosition(next)&&next.parentNode.insertBefore(node,next),next=node);return this},sort:function(compare){function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b}compare||(compare=sort_ascending);for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;j1?this.each((null==value?function styleRemove(name){return function(){this.style.removeProperty(name)}}:"function"==typeof value?function styleFunction(name,value,priority){return function(){var v=value.apply(this,arguments);null==v?this.style.removeProperty(name):this.style.setProperty(name,v,priority)}}:function styleConstant(name,value,priority){return function(){this.style.setProperty(name,value,priority)}})(name,value,null==priority?"":priority)):styleValue(this.node(),name)},property:function(name,value){return arguments.length>1?this.each((null==value?function propertyRemove(name){return function(){delete this[name]}}:"function"==typeof value?function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);null==v?delete this[name]:this[name]=v}}:function propertyConstant(name,value){return function(){this[name]=value}})(name,value)):this.node()[name]},classed:function(name,value){var names=classArray(name+"");if(arguments.length<2){for(var list=classList(this.node()),i=-1,n=names.length;++i=0&&(name=t.slice(i+1),t=t.slice(0,i)),{type:t,name:name}})}(typename+""),n=typenames.length;if(!(arguments.length<2)){for(on=value?onAdd:onRemove,null==capture&&(capture=!1),i=0;i=0&&(name=t.slice(i+1),t=t.slice(0,i)),t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:name}})}(typename+"",_),i=-1,n=T.length;if(!(arguments.length<2)){if(null!=callback&&"function"!=typeof callback)throw new Error("invalid callback: "+callback);for(;++i0)for(var n,t,args=new Array(n),i=0;iclickDistance2}gestures.mouse("drag")}function mouseupped(){src_select(on_event.view).on("mousemove.drag mouseup.drag",null),function yesdrag(view,noclick){var root=view.document.documentElement,selection=src_select(view).on("dragstart.drag",null);noclick&&(selection.on("click.drag",noevent,!0),setTimeout(function(){selection.on("click.drag",null)},0)),"onselectstart"in root?selection.on("selectstart.drag",null):(root.style.MozUserSelect=root.__noselect,delete root.__noselect)}(on_event.view,mousemoving),noevent(),gestures.mouse("end")}function touchstarted(){if(filter.apply(this,arguments)){var i,gesture,touches=on_event.changedTouches,c=container.apply(this,arguments),n=touches.length;for(i=0;i=0&&t._call.call(null,e),t=t._next;--timer_frame}()}finally{timer_frame=0,function nap(){var t0,t2,t1=taskHead,time=1/0;for(;t1;)t1._call?(time>t1._time&&(time=t1._time),t0=t1,t1=t1._next):(t2=t1._next,t1._next=null,t1=t0?t0._next=t2:taskHead=t2);taskTail=t0,sleep(time)}(),clockNow=0}}function poke(){var now=clock.now(),delay=now-clockLast;delay>pokeDelay&&(clockSkew-=delay,clockLast=now)}function sleep(time){timer_frame||(timeout&&(timeout=clearTimeout(timeout)),time-clockNow>24?(time<1/0&&(timeout=setTimeout(wake,time-clock.now()-clockSkew)),timer_interval&&(timer_interval=clearInterval(timer_interval))):(timer_interval||(clockLast=clock.now(),timer_interval=setInterval(poke,pokeDelay)),timer_frame=1,setFrame(wake)))}Timer.prototype=timer_timer.prototype={constructor:Timer,restart:function restart(callback,delay,time){if("function"!=typeof callback)throw new TypeError("callback is not a function");time=(null==time?now():+time)+(null==delay?0:+delay),this._next||taskTail===this||(taskTail?taskTail._next=this:taskHead=this,taskTail=this),this._call=callback,this._time=time,sleep()},stop:function stop(){this._call&&(this._call=null,this._time=1/0,sleep())}};var src_timeout=function(callback,delay,time){var t=new Timer;return delay=null==delay?0:+delay,t.restart(function(elapsed){t.stop(),callback(elapsed+delay)},delay,time),t},emptyOn=src_dispatch("start","end","cancel","interrupt"),emptyTween=[],CREATED=0,SCHEDULED=1,STARTING=2,STARTED=3,RUNNING=4,ENDING=5,ENDED=6,transition_schedule=function(node,name,id,index,group,timing){var schedules=node.__transition;if(schedules){if(id in schedules)return}else node.__transition={};!function schedule_create(node,id,self){var tween,schedules=node.__transition;function start(elapsed){var i,j,n,o;if(self.state!==SCHEDULED)return stop();for(i in schedules)if((o=schedules[i]).name===self.name){if(o.state===STARTED)return src_timeout(start);o.state===RUNNING?(o.state=ENDED,o.timer.stop(),o.on.call("interrupt",node,node.__data__,o.index,o.group),delete schedules[i]):+iCREATED)throw new Error("too late; already scheduled");return schedule}function schedule_set(node,id){var schedule=schedule_get(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule}function schedule_get(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule}var cssNode,cssRoot,cssView,svgNode,degrees=180/Math.PI,decompose_identity={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},decompose=function(a,b,c,d,e,f){var scaleX,scaleY,skewX;return(scaleX=Math.sqrt(a*a+b*b))&&(a/=scaleX,b/=scaleX),(skewX=a*c+b*d)&&(c-=a*skewX,d-=b*skewX),(scaleY=Math.sqrt(c*c+d*d))&&(c/=scaleY,d/=scaleY,skewX/=scaleY),a*d180?b+=360:b-a>180&&(a+=360),q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:src_number(a,b)})):b&&s.push(pop(s)+"rotate("+b+degParen)}(a.rotate,b.rotate,s,q),function skewX(a,b,s,q){a!==b?q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:src_number(a,b)}):b&&s.push(pop(s)+"skewX("+b+degParen)}(a.skewX,b.skewX,s,q),function scale(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:src_number(xa,xb)},{i:i-2,x:src_number(ya,yb)})}else 1===xb&&1===yb||s.push(pop(s)+"scale("+xb+","+yb+")")}(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q),a=b=null,function(t){for(var o,i=-1,n=q.length;++i=0&&(t=t.slice(0,i)),!t||"start"===t})}(name)?init:schedule_set;return function(){var schedule=sit(this,id),on=schedule.on;on!==on0&&(on1=(on0=on).copy()).on(name,listener),schedule.on=on1}}(id,name,listener))},attr:function(name,value){var fullname=src_namespace(name),i="transform"===fullname?interpolateTransformSvg:transition_interpolate;return this.attrTween(name,"function"==typeof value?(fullname.local?function attr_attrFunctionNS(fullname,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttributeNS(fullname.space,fullname.local))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0,string1,value1=value(this);if(null!=value1)return(string0=this.getAttribute(name))===(string1=value1+"")?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1));this.removeAttribute(name)}})(fullname,i,tweenValue(this,"attr."+name,value)):null==value?(fullname.local?function attr_attrRemoveNS(fullname){return function(){this.removeAttributeNS(fullname.space,fullname.local)}}:function attr_attrRemove(name){return function(){this.removeAttribute(name)}})(fullname):(fullname.local?function attr_attrConstantNS(fullname,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttributeNS(fullname.space,fullname.local);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}:function attr_attrConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=this.getAttribute(name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}})(fullname,i,value))},attrTween:function(name,value){var key="attr."+name;if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;var fullname=src_namespace(name);return this.tween(key,(fullname.local?function attrTweenNS(fullname,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolateNS(fullname,i){return function(t){this.setAttributeNS(fullname.space,fullname.local,i.call(this,t))}}(fullname,i)),t0}return tween._value=value,tween}:function attrTween(name,value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function attrInterpolate(name,i){return function(t){this.setAttribute(name,i.call(this,t))}}(name,i)),t0}return tween._value=value,tween})(fullname,value))},style:function(name,value,priority){var i="transform"==(name+="")?interpolateTransformCss:transition_interpolate;return null==value?this.styleTween(name,function styleNull(name,interpolate){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),string1=(this.style.removeProperty(name),styleValue(this,name));return string0===string1?null:string0===string00&&string1===string10?interpolate0:interpolate0=interpolate(string00=string0,string10=string1)}}(name,i)).on("end.style."+name,style_styleRemove(name)):"function"==typeof value?this.styleTween(name,function style_styleFunction(name,interpolate,value){var string00,string10,interpolate0;return function(){var string0=styleValue(this,name),value1=value(this),string1=value1+"";return null==value1&&(this.style.removeProperty(name),string1=value1=styleValue(this,name)),string0===string1?null:string0===string00&&string1===string10?interpolate0:(string10=string1,interpolate0=interpolate(string00=string0,value1))}}(name,i,tweenValue(this,"style."+name,value))).each(function styleMaybeRemove(id,name){var on0,on1,listener0,remove,key="style."+name,event="end."+key;return function(){var schedule=schedule_set(this,id),on=schedule.on,listener=null==schedule.value[key]?remove||(remove=style_styleRemove(name)):void 0;on===on0&&listener0===listener||(on1=(on0=on).copy()).on(event,listener0=listener),schedule.on=on1}}(this._id,name)):this.styleTween(name,function style_styleConstant(name,interpolate,value1){var string00,interpolate0,string1=value1+"";return function(){var string0=styleValue(this,name);return string0===string1?null:string0===string00?interpolate0:interpolate0=interpolate(string00=string0,value1)}}(name,i,value),priority).on("end.style."+name,null)},styleTween:function(name,value,priority){var key="style."+(name+="");if(arguments.length<2)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function styleTween(name,value,priority){var t,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t=(i0=i)&&function styleInterpolate(name,i,priority){return function(t){this.style.setProperty(name,i.call(this,t),priority)}}(name,i,priority)),t}return tween._value=value,tween}(name,value,null==priority?"":priority))},text:function(value){return this.tween("text","function"==typeof value?function text_textFunction(value){return function(){var value1=value(this);this.textContent=null==value1?"":value1}}(tweenValue(this,"text",value)):function text_textConstant(value){return function(){this.textContent=value}}(null==value?"":value+""))},textTween:function(value){var key="text";if(arguments.length<1)return(key=this.tween(key))&&key._value;if(null==value)return this.tween(key,null);if("function"!=typeof value)throw new Error;return this.tween(key,function textTween(value){var t0,i0;function tween(){var i=value.apply(this,arguments);return i!==i0&&(t0=(i0=i)&&function textInterpolate(i){return function(t){this.textContent=i.call(this,t)}}(i)),t0}return tween._value=value,tween}(value))},remove:function(){return this.on("end.remove",function removeFunction(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;parent&&parent.removeChild(this)}}(this._id))},tween:function(name,value){var id=this._id;if(name+="",arguments.length<2){for(var t,tween=schedule_get(this.node(),id).tween,i=0,n=tween.length;iSTARTING&&schedule.state4&&void 0!==arguments[4]?arguments[4]:{},keyFn=arguments.length>5?arguments[5]:void 0;(parent instanceof HTMLElement||parent instanceof SVGElement)&&(parent=renderer_utils_selectElement(parent));var filter,selectorVal=selector?selector[0]:null,selectorType=null,actualSelector=null,element=null,enterSel=null,mergeSel=null;selectorVal?"#"===selectorVal?(selectorType="id",actualSelector=selector):(selectorType="class",actualSelector="."===selector[0]?selector:".".concat(selector)):(actualSelector=elemType,filter=!0),element=parent.selectAll(actualSelector),filter&&(element=element.filter(function(){return this.parentNode===parent.node()})),enterSel=(element=element.data(data,keyFn)).enter().append(elemType||"div"),callbacks.enter&&enterSel.each(function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];callbacks.enter.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),mergeSel=enterSel.merge(element),callbacks.update&&mergeSel.each(function(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];callbacks.update.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}),"class"===selectorType?mergeSel.classed("."===selectorVal?selector.substring(1,selector.length):selector,!0):"id"===selectorType&&mergeSel.attr("id",selector.substring(1,selector.length));var exitSel=element.exit();return callbacks.exit?exitSel.each(function(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];callbacks.exit.apply(callbacks,[renderer_utils_selectElement(this)].concat(params))}):exitSel.remove(),mergeSel},renderer_utils_applyStyle=function applyStyle(elem,styleObj){return Object.entries(styleObj).forEach(function(d){elem.style(d[0],d[1])},void 0),elem},appendElement=function appendElement(element1,element2){element1.appendChild(element2)},setElementAttrs=function setElementAttrs(element,attrs){for(var key in attrs)({}).hasOwnProperty.call(attrs,key)&&element.attr(key,attrs[key])},renderer_utils_setAttrs=function setAttrs(element,attrs,className){return element instanceof src_selection||(element=renderer_utils_selectElement(element)),void 0!==className?element.selectAll(".".concat(className)).each(function(){setElementAttrs(src_select(this),attrs)}):setElementAttrs(element,attrs),element},renderer_utils_addClass=function addClass(element,className,selector,filterFn){src_select(element).selectAll(selector).each(function(data){var elem=src_select(this);filterFn?filterFn(data)&&elem.classed(className,!0):elem.classed(className,!0)})},renderer_utils_removeClass=function removeClass(element,className,selector,filterFn){src_select(element).selectAll(selector).each(function(data){var elem=src_select(this);filterFn?filterFn(data)&&elem.classed(className,!1):elem.classed(className,!1)})},renderer_utils_setStyles=function setStyles(element,styles){for(var key in element instanceof src_selection||(element=renderer_utils_selectElement(element)),styles)({}).hasOwnProperty.call(styles,key)&&element.style(key,styles[key]);return element},renderer_utils_createElements=function createElements(params){var data,container=src_select(params.container);"number"==typeof(data=params.data)&&(data=Array(data).fill().map(function(d,i){return i}));var sel=container.selectAll(params.selector).filter(function(){return this.parentNode===container.node()}).data(data);sel.enter().append(params.append).merge(sel).each(function(d,i){params.each(d,src_select(this),i)}).attr("class",params.className||""),sel.exit().remove()},renderer_utils_clipElement=function clipElement(container,measurement,id){var clipPathElement=makeElement(src_select(container),"clipPath",[1],"#".concat(id));makeElement(clipPathElement,"rect",[1]).attr("x",measurement.x).attr("y",measurement.x).attr("width",measurement.width).attr("height",measurement.height),clipPathElement.attr("clip-path","url(#".concat(id,")"))},renderer_utils_getElementsByClassName=function getElementsByClassName(node,className){return src_select(node).selectAll(className).nodes()},getMousePos=function getMousePos(element,event){var boundingClientRect=element.getBoundingClientRect();return{x:event.x-boundingClientRect.x,y:event.y-boundingClientRect.y}},renderer_utils_getClientPoint=function getClientPoint(){var pos=src_point.apply(void 0,arguments);return{x:pos[0],y:pos[1]}},renderer_utils_createElement=function createElement(tag,mount){return src_select(mount).append(tag).node()},renderer_utils_getEvent=function getEvent(){return on_event},renderer_utils_getD3Drag=function getD3Drag(){return src_drag},renderer_utils_getSmartComputedStyle=function getSmartComputedStyle(group,css){var textEl,mandatoryStyle={"fill-opacity":0},className="string"==typeof css?css:css instanceof Array?css.join(" "):void 0;textEl=group.node()instanceof HTMLElement?group.append("div").html("W"):group.append("text").text("W"),className?textEl.attr("class",className):"object"===renderer_utils_typeof(css)&&(delete css["fill-opacity"],mergeRecursive(mandatoryStyle,css)),textEl.style(mandatoryStyle);var computedStyle=window.getComputedStyle(textEl.node()),styleForSmartLabel={fontSize:computedStyle.fontSize,fontFamily:computedStyle.fontFamily,fontWeight:computedStyle.fontWeight,fontStyle:computedStyle.fontStyle};return textEl.remove(),styleForSmartLabel},hasTouch=function hasTouch(){return"ontouchstart"in document.documentElement},hyperdis=__webpack_require__(11),hyperdis_default=__webpack_require__.n(hyperdis);function store_slicedToArray(arr,i){return function store_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function store_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function store_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function store_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:function(){return{}};return props.forEach(function(prop){obj[prop]||(obj[prop]=val()),obj=obj[prop]}),obj},fetchPropValues=function fetchPropValues(propNames,params,deps){return params.map(function(param,i){var prop=propNames[i];return param.map(function(val){return void 0===val||null===val?val:val[deps[prop]]})})},setContexts=function setContexts(contexts,propObj,contextMap){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=propObj.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;contexts[key]={context:contextMap[key],deps:propObj.get(key).depProps}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return contexts},store_registerListener=function registerListener(context,type){for(var _len=arguments.length,options=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++)options[_key-2]=arguments[_key];var propList=options[0],callBack=options[1],instantCall=options[2],_options$=options[3],namespaceInf=void 0===_options$?{}:_options$,props=propList;Array.isArray(propList)||(props=[propList]);var ns=namespaceInf.namespace,callbackFn=function(propNames,namespaceVal){return function(){var commits=context._savedCommits,propListenerMap=context._propListenerMap;if(!propNames.some(function(prop){return getObjProp(propListenerMap,prop,"disabled")})){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(namespaceVal){var listenersObj=context._registeredListeners[namespaceVal],contextMap=context._contextMap[namespaceVal],contextsObj={};for(var key in propNames.forEach(function(prop){var commitsObj=defaultValue(getObjProp(commits,prop,type),{}),listeners=listenersObj[prop].subNamespaces,propDeps=propListenerMap[prop][type];for(var nm in commitsObj){var fnInf=defaultValue(propDeps[nm],{fns:0}),fns=fnInf.fns;fns>0&&(setContexts(contextsObj,listeners[nm],contextMap),fns--),fns<=0&&delete commitsObj[nm],fnInf.fns=fns}}),contextsObj){var obj=contextsObj[key];callBack.apply(void 0,[obj.context].concat(store_toConsumableArray(fetchPropValues(propNames,params,obj.deps))))}}else callBack.apply(void 0,params)}}}(props,ns),fn=context.model[type](props,callbackFn,instantCall);ns&&function registerPropInMaps(store,props,namespaceInf,type){var registeredListeners=store._registeredListeners,propListenerMap=store._propListenerMap,subNamespace=namespaceInf.subNamespace,ns=namespaceInf.namespace;initProp(registeredListeners,[ns]),props.forEach(function(prop){var subNamespaces=defaultValue(getObjProp(registeredListeners,ns,prop,"subNamespace"),[]),fns=defaultValue(getObjProp(propListenerMap,prop,type,"fns"),0);fns++,subNamespace&&subNamespaces.push(subNamespace),registeredListeners[ns][prop]={subNamespace:subNamespaces,allProps:props,subNamespaces:{}},initProp(propListenerMap,[prop,type]),propListenerMap[prop][type]={fns:fns,_fnCount:fns}})}(context,props,namespaceInf,type),function addListenerToNamespace(namespaceInf,fn,context){var key=namespaceInf.key,namespace=namespaceInf.id,listeners=context._listeners;if(namespace){!listeners.get(namespace)&&listeners.set(namespace,new Map);var namespaceListeners=listeners.get(namespace);key||(key=namespaceListeners.size),namespaceListeners.set(key,fn)}else key=key||listeners.size,listeners.set(key,fn)}(namespaceInf,fn,context)},store_createMap=function createMap(){return new Map},listenerTypes=["next","on"],removePropValue=function removePropValue(context,map,propInf){var sns=propInf.subNamespace,prop=propInf.prop,propObj=propInf.propListenerMap[prop];if(listenerTypes.forEach(function(type){type in propObj&&delete propObj[type][sns]}),map.has(sns)){var value=context.get(prop);value instanceof Object&&sns in value&&delete value[sns],map.delete(sns)}},store_Store=function(){function Store(config){!function store_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Store),this.model=hyperdis_default.a.create(config),this._listeners=new Map,this._registeredListeners={},this._contextMap={},this._commits={},this._savedCommits={},this._queuedProps={},this._propListenerMap={},this._locked=!1}return function store_createClass(Constructor,protoProps,staticProps){return protoProps&&store_defineProperties(Constructor.prototype,protoProps),staticProps&&store_defineProperties(Constructor,staticProps),Constructor}(Store,[{key:"lockModel",value:function lockModel(){return this.model.lock(),this._locked=!0,this}},{key:"unlockModel",value:function unlockModel(){return this._locked=!1,this.model.unlock(),this}},{key:"serialize",value:function serialize(){return this.model.serialize()}},{key:"lockCommits",value:function lockCommits(props){var _this=this;return props.forEach(function(prop){_this._commits[prop]={locked:!0,queue:[]}}),this}},{key:"unlockCommits",value:function unlockCommits(props){var _this2=this,commitsObj=this._commits;return this.lockModel(),props.forEach(function(prop){commitsObj[prop].locked=!1;var queuedProps={},queue=commitsObj[prop].queue;queue.forEach(function(params){var _params=store_slicedToArray(params,3),propName=_params[0],value=_params[1],namespace=_params[2];if(namespace){var propObj=initProp(queuedProps,[propName,namespace]);Object.assign(propObj,value)}}),queue.forEach(function(params){var _params2=store_slicedToArray(params,3),propName=_params2[0],value=_params2[1],namespace=_params2[2];_this2.commit(propName,propName in queuedProps?queuedProps[propName][namespace]:value,namespace)}),delete commitsObj[prop]}),this.unlockModel(),this}},{key:"addSubNamespace",value:function addSubNamespace(sns,namespace,context){var listeners=this._registeredListeners[namespace],propListenerMap=this._propListenerMap;initProp(this._contextMap,[namespace]),this._contextMap[namespace][sns]=context;var _loop=function _loop(key){var obj=listeners[key],propObj=propListenerMap[key],propFns=listenerTypes.reduce(function(acc,type){var val=defaultValue(getObjProp(propObj,type,"fns"),0);return val&&(acc[type]=val),acc},{}),allProps=obj.allProps,subNamespaces=obj.subNamespaces,subNamespace=obj.subNamespace;(subNamespace.length?subNamespace:[sns]).forEach(function(ns){var nsObj=ns instanceof Function?ns(context):ns,names=function retrieveNamespaces(names,key){return names instanceof Object?[names[key]]:names instanceof Array?names:[names]}(nsObj,key),depProps=allProps.reduce(function(acc,prop){return acc[prop]=ns instanceof Function?nsObj[prop]:ns,acc},{});names.forEach(function(nm){for(var type in initProp(subNamespaces,[nm],store_createMap).set(sns,{depProps:depProps}),propFns){initProp(propObj,[type,nm]);var fns=propFns[type];propObj[type][nm]={fns:fns,_fnCount:fns}}})})};for(var key in listeners)_loop(key);return this}},{key:"commit",value:function commit(propName,value,namespace){var disableListener=arguments.length>3&&void 0!==arguments[3]&&arguments[3],sanitizedVal=value,commits=this._commits,savedCommits=this._savedCommits,locked=getObjProp(commits,propName,"locked"),propListenerMap=this._propListenerMap[propName]||{};if(propListenerMap.disabled=disableListener,locked)return commits[propName].queue.push([propName,value,namespace]),this;if(namespace){if(this._locked){var queuedProps=initProp(this._queuedProps,[propName]);queuedProps[namespace]=value,sanitizedVal=queuedProps}else(sanitizedVal=defaultValue(this.get(propName),{}))[namespace]=value;listenerTypes.forEach(function(type){initProp(savedCommits,[propName,type]),savedCommits[propName][type][namespace]=!0,getObjProp(propListenerMap,type,namespace)&&(propListenerMap[type][namespace].fns=propListenerMap[type][namespace]._fnCount)})}return this.model.prop(propName,sanitizedVal),this}},{key:"registerChangeListener",value:function registerChangeListener(){for(var _len3=arguments.length,params=new Array(_len3),_key3=0;_key3<_len3;_key3++)params[_key3]=arguments[_key3];return store_registerListener.apply(void 0,[this,"next"].concat(params)),this}},{key:"registerImmediateListener",value:function registerImmediateListener(){for(var _len4=arguments.length,params=new Array(_len4),_key4=0;_key4<_len4;_key4++)params[_key4]=arguments[_key4];store_registerListener.apply(void 0,[this,"on"].concat(params))}},{key:"get",value:function get(propName,subNamespace){var value=this.model.prop(propName);return subNamespace?value&&value[subNamespace]:value}},{key:"computed",value:function computed(propName,callBack){return this.model.calculatedProp(propName,callBack)}},{key:"append",value:function append(){var _this$model;return(_this$model=this.model).append.apply(_this$model,arguments),this}},{key:"unsubscribeAll",value:function unsubscribeAll(){return Object.values(this._listeners).forEach(function(fn){return fn()}),this}},{key:"unsubscribe",value:function unsubscribe(){var namespaceInf=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},id=namespaceInf.id,key=namespaceInf.key,listenersMap=this._listeners,listeners=listenersMap.get(id);if(key){var fn=listenersMap.get(key);fn&&fn()}else{var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=listeners.values()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){(0,_step2.value)()}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}listenersMap.set(id,[])}return this}},{key:"removeSubNamespace",value:function removeSubNamespace(subNamespace,namespace){var listenerMap=this._registeredListeners,contextMap=this._contextMap,propListenerMap=this._propListenerMap,listenersObj=listenerMap[namespace];for(var prop in listenersObj){var subNamespaces=listenersObj[prop].subNamespaces,propInf={subNamespace:subNamespace,prop:prop,propListenerMap:propListenerMap};if(subNamespaces[subNamespace])removePropValue(this,subNamespaces[subNamespace],propInf),delete subNamespaces[subNamespace];else for(var ns in subNamespaces){var snsMap=subNamespaces[ns];removePropValue(this,snsMap,propInf),snsMap.size||delete subNamespaces[ns]}}return delete contextMap[namespace][subNamespace],this}}]),Store}(),store_transactor=function transactor(holder,options,model){var conf,namespaceInf=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},store=model instanceof store_Store?model:new store_Store({}),stateProps={},namespace=namespaceInf.namespace,subNamespace=namespaceInf.subNamespace;for(var prop in options)if({}.hasOwnProperty.call(options,prop)){conf=options[prop];var nameSpaceProp=namespace?"".concat(namespace,".").concat(prop):prop;if(subNamespace){var value=defaultValue(store.get(nameSpaceProp),{});value[subNamespace]=conf.value,stateProps[nameSpaceProp]=value}else stateProps[prop]=conf.value;holder[prop]=function(context,meta,nsProp){return function(){for(var _len5=arguments.length,params=new Array(_len5),_key5=0;_key5<_len5;_key5++)params[_key5]=arguments[_key5];if(params.length){var _ref$takesMultiplePar=(meta||{}).takesMultipleParams,takesMultipleParams=void 0!==_ref$takesMultiplePar&&_ref$takesMultiplePar,val=takesMultipleParams?params:params[0];if(meta){var values,prevVal=context.get(nsProp,subNamespace),sanitization=meta.sanitization,typeCheck=meta.typeCheck,typeExpected=meta.typeExpected;if("function"==typeof sanitization&&(val=sanitization(val,prevVal,holder)),"function"==typeof typeCheck)typeCheck(val)&&(values=val);else"string"==typeof typeCheck&&"constructor"===typeCheck?val&&val.constructor.name===typeExpected&&(values=val):values=val;var preset=meta.preset,oldValues=toArray(context.get(nsProp,subNamespace));preset&&preset(values,holder),takesMultipleParams&&oldValues.forEach(function(value,i){void 0===values[i]&&(values[i]=value)}),values&&context.commit(nsProp,values,subNamespace)}else context.commit(nsProp,val,subNamespace);return holder}return context.get(nsProp,subNamespace)}}(store,conf.meta,nameSpaceProp,Array.isArray(conf.value))}if(subNamespace)for(var key in stateProps)store.commit(key,stateProps[key][subNamespace],subNamespace);else void 0===namespace?store.append(stateProps):store.append(namespace,stateProps);return[holder,store]},SmartlabelManager=__webpack_require__(8),SmartlabelManager_default=__webpack_require__.n(SmartlabelManager),events=["initialized","beforeupdate","updated","beforedraw","drawn","beforeremove","removed","animationend"],EVENT_LIST=[];["canvas","unit","layer","axis","facet-headers","legend","caption"].forEach(function(composition){events.forEach(function(event){EVENT_LIST.push("".concat(composition,".").concat(event))})});var event_list=EVENT_LIST;function lifecycle_manager_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this._lifeCycles=lifeCycles,this._releasePromisesFromCache()}},{key:"_resetTargetPromise",value:function _resetTargetPromise(eventName){var _this4=this;setTimeout(function(){_this4._notifiers[eventName]=lifecycle_manager_resolver,_this4._promises.set(eventName,_this4._makeNotifierPromise(eventName))},0)}}]),LifeCycleManager}(),src_InvalidAwareTypes=datamodel_default.a.InvalidAwareTypes,CLASSPREFIX="muze",STACK="stack",GROUP="group",IDENTITY="identity",constants_ANGLE="angle",constants_RADIUS="radius",SIZE="size",COLOR="color",SHAPE="shape",TEXT="text",OUTER_RADIUS_VALUE="outerRadiusValue",TEXT_ANCHOR_MIDDLE="middle",ENCODING={X:"x",Y:"y",X0:"x0",Y0:"y0",RADIUS:"radius",RADIUS0:"radius0",ANGLE:"angle",ANGLE0:"angle0",COLOR:"color",SHAPE:"shape",SIZE:"size",TEXT:"text"},STROKE_DASHARRAY="stroke-dasharray",ASCENDING="asc",AGG_FN_SUM="sum",AREA_LAYER="area",ARC_LAYER="arc",LINE_LAYER="line",TEXT_LAYER="text",POINT_LAYER="point",BAR_LAYER="bar",TICK_LAYER="tick",SIMPLE_LAYER="simple",BASE_LAYER="base";function simple_layer_defineProperties(target,props){for(var i=0;i67.5&&rotationNormalizer<=90||(yShift+=2*height),xShift=width,xShift=90===rotation?height:270===rotation?-height:0,orientation===axis_orientation_TOP?(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift+xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(-xShift+tickSize,"\n ").concat(-yShift-tickSize,") rotate(").concat(rotation,")"))):(xShift=fixedBaseline&&ticks[0]===d&&type===constants_LINEAR?xShift-xShift/2:xShift,renderer_utils_selectElement(this).attr("transform","translate(".concat(xShift-tickSize,"\n ").concat(yShift+tickSize,") rotate(").concat(rotation,")")))})}(axisInstance,tickText,labelManager);return tickText},axis_renderer_setFixedBaseline=function setFixedBaseline(axisInstance){var fixedBaseline=axisInstance.config().fixedBaseline,showInnerTicks=axisInstance.renderConfig().showInnerTicks,domain=axisInstance.domain();fixedBaseline&&domain.length&&showInnerTicks&&axisInstance.setFixedBaseline()},axis_renderer_setAxisNamePos=function setAxisNamePos(textNode,orientation,measures){var axisNameHeight=measures.axisNameHeight,availableSpace=measures.availableSpace;switch(orientation){case axis_orientation_LEFT:textNode.attr("transform","translate(".concat(-(availableSpace.width-axisNameHeight),",").concat(availableSpace.height/2,")rotate(-90)"));break;case axis_orientation_RIGHT:textNode.attr("transform","translate(".concat(availableSpace.width-axisNameHeight,",").concat(availableSpace.height/2,")rotate(90)"));break;case axis_orientation_TOP:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(-availableSpace.height+axisNameHeight,")"));break;case axis_orientation_BOTTOM:textNode.attr("transform","translate(".concat(availableSpace.width/2,",").concat(availableSpace.height-axisNameHeight/2,")"))}return textNode};var _rangeAdjustmentMap,longestWord={month:"September",quarter:"October",halfYearly:"July",year:9999,day:"September",hour:"24 AM",mintues:"60:60",seconds:":60",week:"Wed 31"},skip_ticks_tickIntervals=[[1,1,"milliseconds",src_millisecond.every(1),"seconds"],[1,1e3,"seconds",src_second.every(1),"seconds"],[5,5e3,"five seconds",src_second.every(5),"seconds"],[10,1e4,"ten seconds",src_second.every(10),"seconds"],[15,15e3,"fifteen seconds",src_second.every(15),"seconds"],[30,3e4,"thirty seconds",src_second.every(30),"seconds"],[1,6e4,"minute",src_minute.every(1),"minutes"],[5,3e5,"five minutes",src_minute.every(5),"minutes"],[10,6e5,"ten minutes",src_minute.every(10),"minutes"],[15,9e5,"fifteen minutes",src_minute.every(15),"minutes"],[30,18e5,"thirty minutes",src_minute.every(30),"minutes"],[1,36e5,"hour",src_hour.every(1),"hour"],[3,108e5,"three hours",src_hour.every(3),"hour"],[6,216e5,"six hours",src_hour.every(6),"hour"],[12,432e5,"twelve hours",src_hour.every(12),"hour"],[1,864e5,"daily",src_day.every(1),"day"],[1,6048e5,"weekly",sunday.every(1),"week"],[1,2592e6,"monthly",src_month.every(1),"week"],[3,7776e6,"quaterly",src_month.every(3),"quarter"],[6,15552e6,"half yearly",src_month.every(6),"halfYearly"],[1,31536e6,"yearly",src_year.every(1),"year"],[2,63072e6,"2 year",src_year.every(2),"year"],[3,94608e6,"3 year",src_year.every(3),"year"],[5,15768e7,"5 year",src_year.every(5),"year"],[10,31536e7,"decade",src_year.every(10),"year"],[100,31536e8,"century",src_year.every(100),"year"],[1e3,31536e9,"millenium",src_year.every(1e3),"year"]],getTickIntervalFnBasedOnNumberOfTicks=function getTickIntervalFnBasedOnNumberOfTicks(interval,count,context){for(var possibleTickLevelIndex=skip_ticks_tickIntervals.length-1,maxPossibleTicks=1,tickIntervalLevelInfo=null,i=skip_ticks_tickIntervals.length-1;i>=0;i--){var tickIntervalInfo=skip_ticks_tickIntervals[i],numOfPossibleTicks=Math.floor(interval/tickIntervalInfo[1]);numOfPossibleTicks<=count&&(possibleTickLevelIndex=i,maxPossibleTicks=numOfPossibleTicks)}return tickIntervalLevelInfo=skip_ticks_tickIntervals[possibleTickLevelIndex],function getActualTickInterval(context,noOfTicks){var minWidthBetweenTicks=context._minTickDistance.width,width=context.availableSpace().width;return Math.floor((width-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)}(context,maxPossibleTicks)=numOfTicksAccordingToMinDiff&&(actualNumberOfTicks=numOfTicksAccordingToMinDiff),getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval,actualNumberOfTicks,context)}(context,maxTicks));context.renderConfig({tickValues:ticks})},adjustHorizontalRange=function adjustHorizontalRange(range,diff){return range[0]+=diff,range[1]-=diff,range},adjustVerticalRange=function adjustVerticalRange(range,diff){return range[0]-=diff,range[1]+=diff,range},rangeAdjustmentMap=(space_setter_defineProperty(_rangeAdjustmentMap={},axis_orientation_TOP,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_BOTTOM,adjustHorizontalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_LEFT,adjustVerticalRange),space_setter_defineProperty(_rangeAdjustmentMap,axis_orientation_RIGHT,adjustVerticalRange),_rangeAdjustmentMap),setAxisRange=function setAxisRange(context,type,rangeBounds,offset){context.range(rangeBounds),offset&&context.renderConfig(space_setter_defineProperty({},"".concat(type,"Offset"),offset))},getAdjustedRange=function getAdjustedRange(minDiff,range,domain,config){var orientation=config.orientation,adjustRange=config.adjustRange,diff=function getAxisOffset(timeDiff,range,domain){var avWidth=Math.abs(range[1]-range[0]),bars=avWidth/(avWidth/(domain[1]-domain[0])*timeDiff);return(avWidth-avWidth/(bars+1)*bars)/2}(minDiff,range,domain);return adjustRange?rangeAdjustmentMap[orientation](range,diff):range},space_setter_spaceSetter=function spaceSetter(context,spaceConfig){var _ref,tickInterval,heightForTicks,config=context.config(),_context$availableSpa2=context.availableSpace(),availWidth=_context$availableSpa2.width,availHeight=_context$availableSpa2.height,padding=_context$availableSpa2.padding,top=padding.top,left=padding.left,bottom=padding.bottom,right=padding.right,isOffset=spaceConfig.isOffset,_context$renderConfig2=context.renderConfig(),showAxisName=_context$renderConfig2.showAxisName,labels=_context$renderConfig2.labels,rotation=labels.rotation,fixedBaseline=config.fixedBaseline,axisNamePadding=config.axisNamePadding,tickValues=config.tickValues,_context$getAxisDimen=context.getAxisDimensions(),tickDimensions=_context$getAxisDimen.tickDimensions,allTickDimensions=_context$getAxisDimen.allTickDimensions,axisNameDimensions=_context$getAxisDimen.axisNameDimensions,tickSize=_context$getAxisDimen.tickSize,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width,namePadding=showAxisName?axisNamePadding:0,labelConfig={smartTicks:!0,rotation:labels.rotation},minTickDistance=context._minTickDistance,minTickSpace=context._minTickSpace,minDiff=context._minDiff,domain=context.domain(),axisNameHeight=axisNameDimensions.height,minWidthBetweenTicks=minTickDistance.width,minTickWidth=Math.min(minTickSpace.width,tickDimWidth),minTickHeight=Math.min(minTickSpace.height,tickDimHeight);return space_setter_defineProperty(_ref={},TIME,{x:function x(){!tickValues&&context.applyTickSkipping();var noOfTicks=context.getTickValues().length;heightForTicks=availHeight-axisNameHeight-tickSize-namePadding,(tickInterval=(availWidth-(noOfTicks-1)*minWidthBetweenTicks)/noOfTicks)axisNameHeight?(labelConfig.rotation=null,context.renderConfig({showInnerTicks:!0,showAxisName:!0})):(labelConfig.rotation=-90,context.renderConfig({showInnerTicks:!0,showAxisName:!1}))),availHeight0&&void 0!==arguments[0]?arguments[0]:0,width=arguments.length>1?arguments[1]:void 0,height=arguments.length>2?arguments[2]:void 0,rotatedHeight=height,rotatedWidth=width;if(rotation){var angle=(rotation||0)*Math.PI/180;rotatedWidth=Math.abs(height*Math.sin(angle))+Math.abs(width*Math.cos(angle)),rotatedHeight=Math.abs(width*Math.sin(angle))+Math.abs(height*Math.cos(angle))}return{width:rotatedWidth,height:rotatedHeight}},helper_setOffset=function setOffset(context){var x=0,y=0,logicalSpace=context.logicalSpace(),config=context.config(),orientation=config.orientation,xOffset=config.xOffset,yOffset=config.yOffset;orientation===axis_orientation_LEFT&&(x=void 0===xOffset?logicalSpace.width:xOffset),orientation===axis_orientation_TOP&&(y=void 0===yOffset?logicalSpace.height:yOffset),context.renderConfig({xOffset:x,yOffset:y})},getAxisComponentDimensions=function getAxisComponentDimensions(context){var axisTicks,largestTick="",largestTickDimensions={width:0,height:0},smartTick={},allTickDimensions=[],scale=context.scale(),_context$renderConfig=context.renderConfig(),tickValues=_context$renderConfig.tickValues,showAxisName=_context$renderConfig.showAxisName,name=context.config().name,labelManager=context.dependencies().labelManager,labelFunc=scale.ticks||scale.quantile||scale.domain;return labelManager.setStyle(context._tickLabelStyle),axisTicks=(axisTicks=tickValues||labelFunc()).map(function(originalLabel,i){var label=context.getFormattedText(originalLabel,i,axisTicks),tickDimensions=labelManager.getOriSize(label);return allTickDimensions.push(tickDimensions),tickDimensions.width>largestTickDimensions.width&&(largestTick=label,smartTick=context.smartTicks()?context.smartTicks()[i]:{},largestTickDimensions=tickDimensions,smartTick=smartTick||tickDimensions),label}),labelManager.setStyle(context._axisNameStyle),{axisNameDimensions:showAxisName?labelManager.getOriSize(name):{width:0,height:0},largestTick:largestTick,largestTickDimensions:largestTickDimensions,allTickDimensions:allTickDimensions,axisTicks:axisTicks,smartTick:smartTick,tickSize:context.getTickSize()}},getHorizontalAxisSpace=function getHorizontalAxisSpace(context,axisDimensions,range){var width,height,domain=context.domain(),minTickDistance=context._minTickDistance.width,tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config2=context.config(),axisNamePadding=_context$config2.axisNamePadding,tickValues=_context$config2.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height,tickDimWidth=tickDimensions.width;if(width=range&&range.length?range[1]-range[0]:3*(tickDimWidth+minTickDistance),height=0,tickValues){var minTickDiff=context.getMinTickDifference(),_ref=[Math.min.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain))),Math.max.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain)))];width=(_ref[1]-_ref[0])/Math.abs(minTickDiff)*(tickDimWidth+context._minTickDistance.width)}return height=range&&range.length?tickDimHeight:Math.max(tickDimWidth,tickDimHeight),{width:width,height:height+=(showAxisName?axisDimHeight+axisNamePadding:0)+tickSize}},getVerticalAxisSpace=function getVerticalAxisSpace(context,axisDimensions){var height,width,domain=context.domain(),tickSize=axisDimensions.tickSize,tickDimensions=axisDimensions.tickDimensions,axisNameDimensions=axisDimensions.axisNameDimensions,_context$config3=context.config(),axisNamePadding=_context$config3.axisNamePadding,tickValues=_context$config3.tickValues,showAxisName=context.renderConfig().showAxisName,axisDimHeight=axisNameDimensions.height,tickDimHeight=tickDimensions.height;if(height=0,width=tickDimensions.width,tickValues){var minTickDiff=context.getMinTickDifference(),_ref2=[Math.min.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain))),Math.max.apply(Math,helper_toConsumableArray(tickValues).concat(helper_toConsumableArray(domain)))];height=(_ref2[1]-_ref2[0])/Math.abs(minTickDiff)*tickDimHeight}return{height:height,width:width+=(showAxisName?axisDimHeight:0)+tickSize+(tickValues?axisNamePadding:0)}},helper_calculateBandSpace=function calculateBandSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,show=context.renderConfig().show,largestTickDimensions=axisDimensions.largestTickDimensions,axisTicks=axisDimensions.axisTicks,allTickDimensions=axisDimensions.allTickDimensions,largestDimHeight=largestTickDimensions.height,minTickWidth=context._minTickDistance.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa=getHorizontalAxisSpace(context,axisDimensions,range),_width=_getHorizontalAxisSpa.width,_height=_getHorizontalAxisSpa.height;return range&&range.length||(_width=allTickDimensions.reduce(function(t,n){return t+Math.min(n.width,n.height)+minTickWidth},0)),!1===show&&(_height=0,_width=0),{width:_width,height:_height}}var _getVerticalAxisSpace=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace.width,height=_getVerticalAxisSpace.height;return height&&0!==height||(height=axisTicks.length*(largestDimHeight+context._minTickDistance.height)),!1===show&&(width=0),{width:width,height:height}},helper_getValidDomain=function getValidDomain(context,domain){var userDom=context.config().domain;return userDom&&(domain=userDom),defaultValue(domain,[])},setContinousAxisDomain=function setContinousAxisDomain(context,domain){var nice=context.config().nice,scale=context.scale.bind(context);scale().domain(domain),nice&&scale().nice(),context._domain=scale().domain()},PROPS={availableSpace:{},axisDimensions:{},axisComponentDimensions:{},config:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._config||{}),mockedOldConfig=mergeRecursive({},oldConfig);(value=mergeRecursive(mockedOldConfig,value)).axisNamePadding=Math.max(value.axisNamePadding,0);var shouldAxesScaleUpdate=function hasAxesConfigChanged(){var obj=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},obj1=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},properties=arguments.length>2?arguments[2]:void 0;return!(!Object.keys(obj).length||!Object.keys(obj1).length)&&properties.some(function(key){return obj[key]!==obj1[key]})}(value,oldConfig,["interpolator","exponent","base","orientation"]),tickFormatter=context.sanitizeTickFormatter(value);return shouldAxesScaleUpdate&&(context._scale=context.createScale(value),context._axis=context.createAxis(value)),context._tickFormatter=function(ticks){return tickFormatter(ticks)},context.resetRenderConfig(value),value}},renderConfig:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._renderConfig||{});return value=mergeRecursive(oldConfig,value)}},logicalSpace:{},mount:{},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.logicalSpace(null),value}},smartTicks:{},tickSize:{},maxTickSpaces:{sanitization:function sanitization(context,value){var oldConfig=Object.assign({},context._maxTickSpaces||{});return value=mergeRecursive(oldConfig,value)}},valueParser:{defaultValue:function defaultValue(val){return val}}};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function simple_axis_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function simple_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,height=arguments.length>1?arguments[1]:void 0,padding=arguments.length>2?arguments[2]:void 0,isOffset=arguments.length>3?arguments[3]:void 0,labelConfig={},orientation=this.config().orientation;this.availableSpace({width:width,height:height,padding:padding});var type=this.constructor.type();return labelConfig=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?space_setter_spaceSetter(this,{isOffset:isOffset})[type].x():space_setter_spaceSetter(this,{isOffset:isOffset})[type].y(),this.renderConfig({labels:labelConfig}),this.setTickConfig(),this.setSmartAxisName(),this}},{key:"setSmartAxisName",value:function setSmartAxisName(){var _this$config2=this.config(),orientation=_this$config2.orientation,name=_this$config2.name,dimType=orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM?"width":"height",widthDim=this.availableSpace()[dimType],labelManager=this.dependencies().labelManager;return labelManager.setStyle(this._axisNameStyle),this.renderConfig({smartAxisName:function getSmartAxisName(name,width,labelManager){var oriSize=labelManager.getOriSize(name);return labelManager.useEllipsesOnOverflow(!0),labelManager.getSmartText(name,width,oriSize.height,!0)}(name,widthDim,labelManager)}),this}},{key:"setTickConfig",value:function setTickConfig(){return this}},{key:"getScaleValue",value:function getScaleValue(domainVal){if(null!==domainVal&&void 0!==domainVal)return this.scale()(domainVal)}},{key:"getTickSize",value:function getTickSize(){return this.axis().tickSize()}},{key:"getAxisDimensions",value:function getAxisDimensions(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return this.axisDimensions(function computeAxisDimensions(context){var tickDimensions={},labels=context.renderConfig().labels,smartTicks=labels.smartTicks,rotation=labels.rotation,_getAxisComponentDime=getAxisComponentDimensions(context),largestTickDimensions=_getAxisComponentDime.largestTickDimensions,axisTicks=_getAxisComponentDime.axisTicks,smartTick=_getAxisComponentDime.smartTick,axisNameDimensions=_getAxisComponentDime.axisNameDimensions,allTickDimensions=_getAxisComponentDime.allTickDimensions,tickSize=_getAxisComponentDime.tickSize,labelHeight=largestTickDimensions.height,labelWidth=largestTickDimensions.width;return 0===context.domain().length?{allTickDimensions:allTickDimensions,tickSize:0,tickDimensions:{height:0,width:0},axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks}:(tickDimensions=getRotatedSpaces(rotation,(tickDimensions=smartTicks?smartTick:{width:labelWidth,height:labelHeight}).width,tickDimensions.height),0===tickSize&&(tickDimensions={width:0,height:0}),{allTickDimensions:allTickDimensions,tickSize:tickSize,tickDimensions:tickDimensions,axisNameDimensions:axisNameDimensions,largestTickDimensions:largestTickDimensions,axisTicks:axisTicks})}.apply(void 0,[this].concat(params))),this.axisDimensions()}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()||this.logicalSpace(function calculateContinousSpace(context){var range=context.range(),axisDimensions=context.getAxisDimensions(),orientation=context.config().orientation,_context$renderConfig6=context.renderConfig(),show=_context$renderConfig6.show,showAxisName=_context$renderConfig6.showAxisName,axisNameDimensions=axisDimensions.axisNameDimensions;if(!1===show)return{width:0,height:0};var axisNameWidth=axisNameDimensions.width;if(orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM){var _getHorizontalAxisSpa2=getHorizontalAxisSpace(context,axisDimensions,range),_width2=_getHorizontalAxisSpa2.width,_height2=_getHorizontalAxisSpa2.height;return{width:Math.max(_width2,axisNameWidth),height:_height2}}var _getVerticalAxisSpace2=getVerticalAxisSpace(context,axisDimensions),width=_getVerticalAxisSpace2.width,height=_getVerticalAxisSpace2.height;return{width:width,height:Math.max(height,showAxisName?axisNameWidth:0)}}(this)),helper_setOffset(this),this.logicalSpace()}},{key:"invert",value:function invert(value){return this.scale().invert(value)}},{key:"getNearestRange",value:function getNearestRange(v1,v2){return[v1,v2]}},{key:"invertExtent",value:function invertExtent(v1,v2){return[this.invert(v1),this.invert(v2)]}},{key:"getMinTickDifference",value:function getMinTickDifference(){return this.domain()}},{key:"getFormattedTickValues",value:function getFormattedTickValues(tickValues){return tickValues}},{key:"getUnitWidth",value:function getUnitWidth(){return 0}},{key:"serialize",value:function serialize(){return{name:this.name,type:this.type,range:this.range(),config:this.config()}}},{key:"render",value:function render(){return this.mount()&&(this.setTickConfig(),function renderAxis(axisInstance){var renderConfig=axisInstance.renderConfig(),config=axisInstance.config(),show=renderConfig.show,xOffset=renderConfig.xOffset,yOffset=renderConfig.yOffset,showAxisName=renderConfig.showAxisName,labels=renderConfig.labels,smartAxisName=renderConfig.smartAxisName,mount=axisInstance.mount(),orientation=config.orientation,axisNamePadding=config.axisNamePadding,className=config.className,id=config.id,classPrefix=config.classPrefix;if(show){var availableSpace,labelProps,tickSize,selectContainer=makeElement(renderer_utils_selectElement(mount),"g",[axisInstance],"".concat(className),{},function(key){return key.config().id});if(selectContainer.attr("transform","translate(".concat(xOffset,",").concat(yOffset,")")),axisInstance.domain().length>0){var labelManager=axisInstance.dependencies().labelManager,range=axisInstance.range(),axis=axisInstance.axis(),scale=axisInstance.scale(),tickLabelStyle=axisInstance._tickLabelStyle,axisTickFormatter=axisInstance._tickFormatter;tickSize=axisInstance.getTickSize(),labelManager.setStyle(tickLabelStyle);var labelFunc=scale.ticks||scale.quantile||scale.domain,ticks=axis.tickValues()||labelFunc();axis.tickFormat(axisTickFormatter(ticks)),availableSpace=Math.abs(range[0]-range[1]),labelProps=axisInstance.axisComponentDimensions().largestTickDimensions,axis_renderer_setFixedBaseline(axisInstance),labels.rotation||!1!==labels.smartTicks?(selectContainer.call(axis),axis_renderer_changeTickOrientation(selectContainer,axisInstance,tickSize)):selectContainer.transition().duration(1e3).on("end",axisInstance.registerAnimationDoneHook()).call(axis),selectContainer.selectAll(".tick").classed("".concat(classPrefix,"-ticks"),!0),selectContainer.selectAll(".tick line").classed("".concat(classPrefix,"-tick-lines"),!0),selectContainer.selectAll(".tick text").classed("".concat(classPrefix,"-ticks"),!0).classed("".concat(classPrefix,"-ticks-").concat(id),!0)}var textNode=makeElement(selectContainer,"text",[smartAxisName],"".concat(classPrefix,"-axis-name")).attr("text-anchor","middle").classed("".concat(classPrefix,"-axis-name-").concat(id),!0).text(function(d){return d.text});textNode.classed(HIDDEN,!showAxisName);var labelOffset=availableSpace/2,measures={labelProps:labelProps,tickSize:tickSize,axisNamePadding:axisNamePadding,axisNameHeight:smartAxisName.height,yOffset:yOffset,xOffset:xOffset,labelOffset:labelOffset,availableSpace:axisInstance.availableSpace()};axis_renderer_setAxisNamePos(textNode,orientation,measures)}}(this)),this}},{key:"remove",value:function remove(){return renderer_utils_selectElement(this.mount()).remove(),this}},{key:"unsubscribe",value:function unsubscribe(){return this}},{key:"isReverse",value:function isReverse(){var range=this.range();return range[0]>range[1]}},{key:"getPixelToValueRatio",value:function getPixelToValueRatio(){var scale=this.scale(),range=scale.range(),domain=scale.domain();return Math.abs(range[1]-range[0])/(domain[1]-domain[0])}},{key:"animationDone",value:function animationDone(){return Promise.all(this._animationDonePromises)}},{key:"registerAnimationDoneHook",value:function registerAnimationDoneHook(){var resolveFn,promise=new Promise(function(resolve){resolveFn=resolve});return this._animationDonePromises.push(promise),function(){resolveFn()}}},{key:"_getRawTickValue",value:function _getRawTickValue(data){return data}},{key:"getTicksBasedOnData",value:function getTicksBasedOnData(tickData){var _this=this,allTicks=renderer_utils_selectElement(this.mount()).selectAll(".tick"),elementToBeModified=null,elementNotToBeModified=null;return tickData&&(elementToBeModified=allTicks.filter(function(tickValue){return tickData===_this._getRawTickValue(tickValue)}),elementNotToBeModified=allTicks.filter(function(tickValue){return!(tickData===_this._getRawTickValue(tickValue))})),{selectionSet:elementToBeModified,rejectionSet:elementNotToBeModified||allTicks}}},{key:"id",get:function get(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return default_config_defaultConfig}}]),SimpleAxis}();function linear_defineProperties(target,props){for(var i=0;iavailableSpace&&(numberOfValues=Math.floor(availableSpace/(labelDim+minTickDistance))),numberOfTicks=numberOfTicks||numberOfValues,numberOfValues=Math.min(numberOfTicks,Math.max(2,numberOfValues)),(tickValues=axis.scale().ticks(numberOfValues)).length>numberOfValues&&(tickValues=tickValues.filter(function(e,i){return i%2==0})),2===numberOfValues&&(tickValues=[(tickValues=axis.scale().ticks(10))[0],tickValues[tickValues.length-1]]),tickValues}(availableSpace,labelProps[orientation===axis_orientation_BOTTOM||orientation===axis_orientation_TOP?"width":"height"],axis,this)}},{key:"getMinTickDifference",value:function getMinTickDifference(){return getSmallestDiff(this.renderConfig().tickValues)}},{key:"setFixedBaseline",value:function setFixedBaseline(tickText){var orientation=this.config().orientation,rotation=this.renderConfig().labels.rotation,axis=this.axis(),ticks=axis.tickValues(),smartTicks=this.smartTicks();if(smartTicks&&smartTicks.length){var _this$smartTicks$=this.smartTicks()[0],width=_this$smartTicks$.width,height=_this$smartTicks$.height;axis.tickTransform(function(d){if(d===ticks[0]){if(orientation===axis_orientation_LEFT||orientation===axis_orientation_RIGHT)return"translate(0, -".concat(height/3,"px)");if((orientation===axis_orientation_TOP||orientation===axis_orientation_BOTTOM)&&!rotation)return"translate(".concat(width/2,"px, ",0,"px)")}return""})}return tickText}}],[{key:"type",value:function type(){return LINEAR}}]),ContinousAxis}();function band_axis_typeof(obj){return(band_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function band_axis_defineProperties(target,props){for(var i=0;irange[1],extent=this.invertExtent(v1,v2);return[scale(reverse?extent[extent.length-1]:extent[0]),scale(reverse?extent[0]:extent[extent.length-1])+scale.bandwidth()]}}],[{key:"type",value:function type(){return BAND}}]),BandAxis}();function time_axis_typeof(obj){return(time_axis_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function time_axis_defineProperties(target,props){for(var i=0;i1?config.range:[DEFAULT_GRADIENT_COLOR].concat(props_toConsumableArray(config.range)));var oldConfig=mergeRecursive(defCon,context.config()),newConfig=mergeRecursive(oldConfig,config);return newConfig.range instanceof Array&&(newConfig.range=newConfig.range.map(function(e,i){return props_getActualHslColor(e,palette[i])}),newConfig.stops=config.stops?config.stops:config.range&&config.range.length>2?config.range.length:DEFAULT_CONFIG.stops),newConfig.value=props_getActualHslColor(newConfig.value,newConfig.value),newConfig}},domain:{},scale:{},uniqueValues:{}},helper_treatNullMeasures=function treatNullMeasures(domainVal,scaledVal,minDomainScaledVal){return domainVal instanceof src_InvalidAwareTypes?minDomainScaledVal:scaledVal},helper_resolveAxisConfig=function resolveAxisConfig(propVal,defaultVal,context){switch(getObjProp(propVal,"constructor")){case Function:return propVal(defaultVal,context);case Array:return propVal;default:return defaultVal}},sanitiseConfigIntervals=function sanitiseConfigIntervals(intervals){return intervals||5};function color_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function color_strategy_toConsumableArray(arr){return function color_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);iMath.min(range.length,18))for(var interpolator=common_utils_piecewiseInterpolator()(common_utils_hslInterpolator(),range.map(function(e){return props_getHslString(e)})),i=0;i0&&void 0!==arguments[0]?arguments[0]:[];if(domain.length){var scale=this.scale(),range=scale.range?scale.range():null,scaleInfo=this._colorStrategy.domainRange()(domain,this.config().stops,range);this.domain(scaleInfo.domain),scaleInfo.range&&this.scale().range(scaleInfo.range),this.uniqueValues(scaleInfo.uniqueVals),this.scale().domain(scaleInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),config:this.config()}}},{key:"transformColor",value:function transformColor(color,transformationArr){var h=360*color[0],s=100*color[1],l=100*color[2],a=Math.min(defaultValue(color[3],0),1),newH=h+transformationArr[0],newS=s+transformationArr[1],newL=l+transformationArr[2],newA=Math.min(a+transformationArr[3]||0,1);return{color:"hsla(".concat(newH,",").concat(newS,"%,").concat(newL,"%,").concat(newA,")"),hsla:[newH/360,newS/100,newL/100,newA]}}},{key:"id",value:function id(){return this._id}},{key:"getHslArray",value:function getHslArray(color){return props_getActualHslColor(color)}}],[{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIG}},{key:"type",value:function type(){return"color"}}]),ColorAxis}(),defaults_DEFAULT_CONFIG={value:51,range:[51,1e3]};function size_strategy_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function size_strategy_toConsumableArray(arr){return function size_strategy_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&void 0!==arguments[0]?arguments[0]:0,value=this.config().value,scale=this.scale(),domain=this.domain()||[1,1];return scale&&domain[0]!==domain[1]?this._sizeStrategy.range(domainVal,scale,this.domain(),this.uniqueValues()):value}},{key:"updateDomain",value:function updateDomain(domain){if(domain){var domainInfo=(0,this._sizeStrategy.domain)(domain,this.config().stops);this.domain(domainInfo.domain),this.uniqueValues(domainInfo.uniqueVals),this.scale().domain(domainInfo.scaleDomain||this.domain())}return this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.range(),config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"size"}}]),SizeAxis}(),shape_axis_defaults_DEFAULT_CONFIG={generator:null,value:"circle",range:["circle","diamond","star","cross","square","wye","triangle"]},shape_axis_props_PROPS={config:{},domain:{},scale:{},uniqueValues:{},generator:{}};function shape_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];return domain.length&&(this.uniqueValues(domain),this.domain(domain),this.scale().domain(domain),this.config().generator&&(this._generatedShapes=function shapeGenerator(domain,generatorFn){var generatedShapes={};return domain.forEach(function(value){generatedShapes[value]=generatorFn(value)}),generatedShapes}(domain,this.config().generator))),this}},{key:"serialize",value:function serialize(){return{type:this.constructor.type(),scale:this.scale(),domain:this.domain(),range:this.config().range,config:this.config()}}},{key:"id",value:function id(){return this._id}}],[{key:"defaultConfig",value:function defaultConfig(){return shape_axis_defaults_DEFAULT_CONFIG}},{key:"type",value:function type(){return"shape"}}]),ShapeAxis}(),polar_axis_props_PROPS={config:{sanitization:function sanitization(context,config){return mergeRecursive(context.config(),config)},preset:function preset(context,config){var range=config.range,domain=config.domain;range&&context.range(range),domain&&context.domain(domain)}},domain:{},range:{}};function angle_axis_slicedToArray(arr,i){return function angle_axis_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function angle_axis_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function angle_axis_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function angle_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function angle_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AngleAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._range=[0,360],this._angleFn=angle_axis_pie().value(function(d){return"string"==typeof d?1:d}).sortValues(null),this._angleValues={}}return function angle_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&angle_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&angle_axis_defineProperties(Constructor,staticProps),Constructor}(AngleAxis,[{key:"createScale",value:function createScale(strategy){var range=this.config().range;return scale_creator_createScale({type:strategy.scale,range:range})}},{key:"getScaleValue",value:function getScaleValue(domainVal){return this._angleValues[domainVal]}},{key:"padAngle",value:function padAngle(angle){this._angleFn=this._angleFn.padAngle(angle)}},{key:"domain",value:function domain(){for(var _len=arguments.length,domainVal=new Array(_len),_key=0;_key<_len;_key++)domainVal[_key]=arguments[_key];if(domainVal.length){var customDomain=this.config().domain,domain=domainVal[0].length?domainVal[0]:DEFAULT_ANGLE_DOMAIN;return this._domain=helper_resolveAxisConfig(customDomain,domain,this),createAngleValues(this),this}return this._domain}},{key:"range",value:function range(){if(arguments.length){var customRange=this.config().range;this._range=helper_resolveAxisConfig(customRange,arguments.length<=0?void 0:arguments[0],this);var domain=this.domain(),_this$_range=angle_axis_slicedToArray(this._range,2),startAngle=_this$_range[0],endAngle=_this$_range[1];return this._angleFn.startAngle(startAngle/180*Math.PI).endAngle(Math.PI*endAngle/180),domain&&domain.length&&createAngleValues(this),this}return this._range}}],[{key:"defaultConfig",value:function defaultConfig(){return{}}}]),AngleAxis}(),X="x",Y="y",WIDTH="width",HEIGHT="height",constants_MEASUREMENT="measurement",constants_CONFIG="config",MIN_UNIT_WIDTH="minUnitWidth",MIN_UNIT_HEIGHT="minUnitHeight",DIMENSIONS="dimensions",MEASURES="measures",DIMENSION="dimension",MEASURE="measure",PIVOT="pivot",FORMAT="format",constants_MOUNT="mount",HAS_DATA_UPDATED="hasDataUpdated",ROWS="rows",COLUMNS="columns",constants_DATA="data",COL="col",ROW="row",COLUMN="column",enums_constants_COLOR="color",enums_constants_SHAPE="shape",enums_constants_SIZE="size",DETAIL="detail",LAYERS="layers",TRANSFORM="transform",enums_constants_ORDINAL="ordinal",enums_constants_LINEAR="linear",constants_LEFT="left",constants_RIGHT="right",enums_constants_TOP="top",enums_constants_BOTTOM="bottom",RETINAL="retinal",CELL="cell",X_AXES="xAxes",Y_AXES="yAxes",ENTRY_CELLS="entryCell",INITIALIZED="initialized",EXIT_CELLS="exitCell",AXIS="axis",UNIT="unit",UPDATED="updated",BEFORE_UPDATE="beforeupdate",VALUE_MATRIX="valueMatrix",FACET_HEADERS="facet-headers",enums_constants_RADIUS="radius",enums_constants_ANGLE="angle",ANGLE0="angle0",ARC="arc",constants_CATEGORICAL="categorical",constants_TEMPORAL="temporal",BAR="bar",LINE="line",POINT="point",PRIMARY="Primary",SECONDARY="Secondary",BOTH="both",INTERACTION="interaction",GRID_LINES="gridLines",GRID_BANDS="gridBands",HEADER="header",FACET="facet",DEFAULT="default",constants_ASCENDING="asc",DESCENDING="desc",DARK="dark",NONE="none",NORMAL="normal",DARKER="darker";function radius_axis_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function radius_axis_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RadiusAxis),this._id=getUniqueId(),generateGetterSetters(this,polar_axis_props_PROPS),this._range=[],this._radiusFactor=1,this._config=mergeRecursive({},this.constructor.defaultConfig()),this.config(config),this._scale=this.createScale({scale:enums_constants_LINEAR})}return function radius_axis_createClass(Constructor,protoProps,staticProps){return protoProps&&radius_axis_defineProperties(Constructor.prototype,protoProps),staticProps&&radius_axis_defineProperties(Constructor,staticProps),Constructor}(RadiusAxis,[{key:"config",value:function config(){if(arguments.length){var config=mergeRecursive(this.config(),arguments.length<=0?void 0:arguments[0]);return this._config=config,this}return this._config}},{key:"createScale",value:function createScale(strategy){return scale_creator_createScale({type:strategy.scale,range:this.range()})}},{key:"domain",value:function domain(){if(arguments.length){var customDomain=this.config().domain,domain=helper_resolveAxisConfig(customDomain,arguments.length<=0?void 0:arguments[0],this);domain=sanitizeDomainWhenEqual(domain),this._scale.domain(domain),this._domain=domain,adjustDomain(this)}return this._domain}},{key:"getInnerRadius",value:function getInnerRadius(domainVal){return void 0===domainVal?this.range()[0]:this._scale(domainVal)}},{key:"getOuterRadius",value:function getOuterRadius(domainVal){return void 0===domainVal?this.range()[1]:this._scale(domainVal)*this._radiusFactor}},{key:"range",value:function range(){for(var _len=arguments.length,_range=new Array(_len),_key=0;_key<_len;_key++)_range[_key]=arguments[_key];if(_range.length){var _this$config2=this.config(),padding=_this$config2.padding,customRange=_this$config2.range,sanitizedRange=_range[0].map(function(v,i){return v+(i?-padding[i]:padding[i])}),rangeVal=helper_resolveAxisConfig(customRange,sanitizedRange,this);this._range=rangeVal,this._scale.range(rangeVal),adjustDomain(this)}return this._range}},{key:"setRadiusFactor",value:function setRadiusFactor(val){return this._radiusFactor=val,this}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:[0,1],minOuterRadius:10}}}]),RadiusAxis}();function data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DATA_TYPES_MEASURE="measure",DATA_TYPES_TEMPORAL="temporal",group_transform=(data_type_scale_map_defineProperty(_dataTypeScaleMap={},"dimension",BAND),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_MEASURE,LINEAR),data_type_scale_map_defineProperty(_dataTypeScaleMap,DATA_TYPES_TEMPORAL,TIME),function(schema,data,config){var groupBy=config.groupBy instanceof Array?config.groupBy:[config.groupBy],groupByIndices=groupBy.map(function(fieldName){return schema.findIndex(function(d){return d.name===fieldName})});if(void 0!==groupByIndices.find(function(d){return-1===d}))throw new Error("Groupby field ".concat(groupBy," not found in schema"));var groupedData=common_utils_nestCollection({keys:groupByIndices,data:data});return groupedData.forEach(function(d){var key=d.key;src_InvalidAwareTypes.isInvalid(key)&&(d.key=src_InvalidAwareTypes.getInvalidType(key))}),groupedData});var _transformMap;function transform_factory_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var transformMap=(transform_factory_defineProperty(_transformMap={},"identity",function identityTransform(schema,data,config){return data}),transform_factory_defineProperty(_transformMap,"group",group_transform),transform_factory_defineProperty(_transformMap,"stack",function(schema,data,config){var uniqueField=config.uniqueField,valueField=config.value,groupBy=config.groupBy,sort=config.sort||"descending",normalizedData=function normalizeData(data,schema,valueField,uniqueField,groupBy){var groupedData=group_transform(schema,data,{groupBy:uniqueField}),uniqueFieldIndex=schema.findIndex(function(d){return d.name===uniqueField}),valueFieldIndex=schema.findIndex(function(d){return d.name===valueField}),seriesKeyIndex=schema.findIndex(function(d){return d.name===groupBy}),seriesKeys=data.map(function(d){return d[seriesKeyIndex]}).filter(function(item,pos,arr){return arr.indexOf(item)===pos}).sort(),fieldNames=schema.reduce(function(acc,obj,i){return acc[i]=obj.name,acc},{});return{data:groupedData.map(function(arr){var tuples={},rowObj=arr.values.reduce(function(acc,row){return acc=row.reduce(function(obj,value,i){return i===seriesKeyIndex?(row[valueFieldIndex]instanceof src_InvalidAwareTypes&&(row[valueFieldIndex]=null),obj[value]=row[valueFieldIndex],tuples[value]=row):i!==valueFieldIndex&&(obj[fieldNames[i]]=value),obj},acc)},{});return rowObj._tuple=tuples,seriesKeys.forEach(function(seriesKey){if(void 0===rowObj[seriesKey]){rowObj[seriesKey]=0;var newArr=new Array(arr.values[0].length);newArr[uniqueFieldIndex]=arr.key,newArr[seriesKeyIndex]=seriesKey,rowObj._tuple[seriesKey]=newArr}}),rowObj}),keys:seriesKeys}}(data,schema,valueField,uniqueField,groupBy),keys=normalizedData.keys,map={},orderBy=config.orderBy,orderIndex=schema.findIndex(function(d){return d.name===orderBy}),groupByIndex=schema.findIndex(function(d){return d.name===groupBy});-1!==orderIndex&&(keys.forEach(function(key){var name=data.find(function(d){return d[groupByIndex]===key});map[key]=name[orderIndex]}),normalizedData.keys.sort(function(a,b){return map[a].localeCompare(map[b])}));var stackData=common_utils_stack({keys:normalizedData.keys,offset:config.offset||"diverging",order:sort,data:normalizedData.data});return stackData.forEach(function(seriesData){seriesData.forEach(function(dataObj){dataObj.data=dataObj.data._tuple[seriesData.key]})}),stackData}),_transformMap);var _encodingFieldInfRetr,_dataNormalizers,_domainCalculator,transform_factory=function transformFactory(type){var transform=transformMap[type];if("function"!=typeof transform)throw new Error("Invalid transform type supplied.");return transform};function helpers_toConsumableArray(arr){return function helpers_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=d[0]?(y=x0=d[1],x=y0=d[0]):(y=x0=d[0],x=y0=d[1]),(pointObj=xFieldType===dist_datamodel.FieldType.MEASURE?{x:x,x0:x0,y:tuple[yFieldIndex],y0:tuple[yFieldIndex]}:{x:tuple[xFieldIndex],x0:tuple[xFieldIndex],y:y,y0:y0}).source=tuple,pointObj.rowId=tuple[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=tuple[encodingFieldInf["".concat(enc,"FieldIndex")]]})):((pointObj={x:d[xFieldIndex],y:d[yFieldIndex],x0:d[x0FieldIndex],y0:d[y0FieldIndex]}).source=d,pointObj.rowId=d[fieldsLen],[COLOR,SHAPE,SIZE,TEXT].forEach(function(enc){pointObj[enc]=d[encodingFieldInf["".concat(enc,"FieldIndex")]]}));var source=pointObj.source;return pointObj.dataObj=fieldsArr.reduce(function(acc,name){return acc[name]=source[fieldsConfig[name].index],acc},{}),pointObj})}).filter(function(d){return d.length})}),_dataNormalizers),helpers_getNormalizedData=function getNormalizedData(transformedData,context){var transformType=context.transformType(),transformedDataArr=transformType===IDENTITY?[transformedData]:transformedData,encodingFieldInf=context.encodingFieldsInf(),fieldsConfig=context.data().getFieldsConfig();return dataNormalizers[context.coord()](transformedDataArr,encodingFieldInf,fieldsConfig,transformType)},domainCalculator=(helpers_defineProperty(_domainCalculator={},POLAR,function(data,layerInst){var config=layerInst.config(),sort=config.sort,angleValues=data[0],radius0Field=getObjProp(config.encoding.radius0,"field");return sort&&(angleValues=angleValues.sort(function(a,b){return sort===ASCENDING?a.radius-b.radius:b.radius-a.radius})),{radius:getDomainFromData(data,[ENCODING.RADIUS,radius0Field?ENCODING.RADIUS0:ENCODING.RADIUS]),angle:angleValues.map(function(d){return d.angle}),angle0:angleValues.map(function(d){return d.angle0})}}),helpers_defineProperty(_domainCalculator,helpers_CARTESIAN,function(data,layerInst){var transformType=layerInst.transformType(),encodingFieldInf=layerInst.encodingFieldsInf(),xFieldSubType=encodingFieldInf.xFieldSubType,yFieldSubType=encodingFieldInf.yFieldSubType,xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,x0Field=encodingFieldInf.x0Field,y0Field=encodingFieldInf.y0Field,domains={},yEnc=ENCODING.Y,xEnc=ENCODING.X;return xField&&(domains.x=getDomainFromData(data,x0Field||transformType===STACK?[xEnc,ENCODING.X0]:[xEnc,xEnc],xFieldSubType)),yField&&(domains.y=getDomainFromData(data,y0Field||transformType===STACK?[ENCODING.Y0,ENCODING.Y]:[yEnc,yEnc],yFieldSubType)),domains}),_domainCalculator),defFn=function defFn(d){var _d$update=d.update;return{x:_d$update.x,y:_d$update.y}},helpers_attachDataToVoronoi=function attachDataToVoronoi(voronoi,points){var _ref,accessor=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defFn;voronoi.data((_ref=[]).concat.apply(_ref,helpers_toConsumableArray(points)).filter(function(d){return void 0!==d.rowId}).map(function(d){var _accessor=accessor(d);return{x:_accessor.x,y:_accessor.y,data:d}}))},helpers_updateStyle=function updateStyle(target,styles,remove){for(var key in styles)({}).hasOwnProperty.call(styles,key)&&target.style(key,remove?null:styles[key])},helpers_animateGroup=function animateGroup(mount,context){var groupTransition,update,transition=context.transition,groupAnimateStyle=context.groupAnimateStyle,duration=transition.duration,effect=transition.effect,disabled=transition.disabled;groupAnimateStyle&&(renderer_utils_setStyles(mount.node(),groupAnimateStyle.enter),update=groupAnimateStyle.update,groupTransition=disabled?mount:mount.transition().ease(easeFns[effect]).duration(duration).on("end",function(){helpers_updateStyle(renderer_utils_selectElement(this),update,!0)}),helpers_updateStyle(groupTransition,update))},positionPoints=function positionPoints(context,points){var positioner=context.encodingTransform();return positioner?positioner(points,context,{smartLabel:context._dependencies.smartLabel}):points},getGroupSpan=function getGroupSpan(axis,minDiff){var width=axis.getUnitWidth(),scale=axis.scale(),range=scale.range(),domain=scale.domain();return width||Math.abs(range[1]-range[0])/Math.abs(domain[1]-domain[0])*minDiff},helpers_getPlotMeasurement=function getPlotMeasurement(context,dimensionalValues){var fieldInfo=context.encodingFieldsInf(),axes=context.axes(),transformType=context.transformType(),config=context.config(),bandScale=context._bandScale;return["x","y"].map(function(type){var span=0,groupSpan=0,padding=0,offsetValues=[];if(fieldInfo["".concat(type,"FieldType")]===dist_datamodel.FieldType.DIMENSION){var actualGroupWidth,timeDiff=fieldInfo["".concat(type,"FieldSubType")]===dist_datamodel.DimensionSubtype.TEMPORAL?context.dataProps().timeDiffs[type]:0,axis=axes[type],pad=config["pad".concat(type.toUpperCase())],innerPadding=config.innerPadding,keys=dimensionalValues,scale=axis.scale();groupSpan=getGroupSpan(axis,timeDiff);var isAxisBandScale=axis.constructor.type()===helpers_BAND,axisPadding=axis.config().padding;if("group"===transformType){var groupPadding=isAxisBandScale?0:axisPadding*groupSpan/2;bandScale.range([groupPadding,groupSpan-groupPadding]).domain(keys).paddingInner(innerPadding),span=bandScale.bandwidth(),actualGroupWidth=groupSpan-(isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(key){return bandScale(key)-(isAxisBandScale?0:groupSpan/2)})}else if(void 0!==pad){var offset;if(isAxisBandScale){var step=scale.step();offset=scale.padding()*step,span=scale.bandwidth()+offset}else span=groupSpan;offsetValues=keys.map(function(){return isAxisBandScale?-offset/2:-span/2})}else actualGroupWidth=span=groupSpan-(padding=isAxisBandScale?0:axisPadding*groupSpan),offsetValues=keys.map(function(){return isAxisBandScale?0:-span/2});groupSpan=actualGroupWidth,padding=isAxisBandScale?axisPadding*axis.scale().step():axisPadding*groupSpan}return{span:span,offsetValues:offsetValues,groupSpan:groupSpan,padding:padding}})},helpers_renderLayer=function renderLayer(context){var mount=context.mount();mount&&(context.render(mount),context.dependencies().throwback.commit(common_props.ON_LAYER_DRAW,!0,context.metaInf().parentNamespace))},helpers_resolveInvalidTransformType=function resolveInvalidTransformType(context){return function transformResolverPredicates(encodingFieldInf,context,groupByField){var fieldsConfig=context.data().getFieldsConfig(),xField=encodingFieldInf.xField,yField=encodingFieldInf.yField,xFieldType=encodingFieldInf.xFieldType,yFieldType=encodingFieldInf.yFieldType,dimensionField=["xField","yField"].find(function(type){return encodingFieldInf["".concat(type,"Type")]===dist_datamodel.FieldType.DIMENSION});return[!xField,!yField,!groupByField,getObjProp(fieldsConfig[groupByField],"def","type")===dist_datamodel.FieldType.MEASURE,xFieldType===dist_datamodel.FieldType.DIMENSION&&yFieldType===dist_datamodel.FieldType.DIMENSION,dimensionField&&encodingFieldInf[dimensionField]===groupByField]}(context.encodingFieldsInf(),context,context.config().transform.groupBy).some(function(value){return value})?IDENTITY:null},getValidTransform=function getValidTransform(context){return helpers_resolveInvalidTransformType(context)||context.config().transform.type},helpers_getValidTransformForAggFn=function getValidTransformForAggFn(context){var resolvedInvalidTransformType=helpers_resolveInvalidTransformType(context);if(resolvedInvalidTransformType)return resolvedInvalidTransformType;var _context$encodingFiel=context.encodingFieldsInf(),xField=_context$encodingFiel.xField,yField=_context$encodingFiel.yField,xFieldType=_context$encodingFiel.xFieldType,yFieldType=_context$encodingFiel.yFieldType,groupByField=context.config().transform.groupBy,isCustomTransformTypeProvided=!!getObjProp(context._customConfig,"transform","type"),transformType=context.config().transform.type;if(!isCustomTransformTypeProvided&&groupByField&&xFieldType!==yFieldType){var measureField=xFieldType===dist_datamodel.FieldType.MEASURE?xField:yField;transformType=common_utils_retrieveNearestGroupByReducers(context.data(),measureField)[measureField]===AGG_FN_SUM?STACK:GROUP}return transformType},helpers_getMarkId=function getMarkId(source,schema){return source.filter(function(val,i){return schema[i]&&schema[i].type===dist_datamodel.FieldType.DIMENSION}).join()},helpers_resolveEncodingValues=function resolveEncodingValues(data,i,dataArr,layerInst){var transformedValues={},values=data.values,encoding=layerInst.config().encoding;for(var key in values){var value=getObjProp(encoding[key],"value");value instanceof Function?transformedValues[key]=value(values,i,dataArr,layerInst):transformedValues[key]=values[key]}return transformedValues},getColorMetaInf=function getColorMetaInf(initialStyle){var conf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{originalStyle:Object.assign({},{styles:initialStyle},conf),currentState:new Map}},getCoordValue=function getCoordValue(radius,trig,angle,offset){return radius*Math[trig](angle)+offset},coordValueGetter=function coordValueGetter(radius,angle,xOffset,yOffset){return{x:getCoordValue(radius,"cos",angle,xOffset),y:getCoordValue(radius,"sin",angle,yOffset)}},toCartesianCoordinates=function toCartesianCoordinates(points,measurement){for(var rangePlot=arguments.length>2&&void 0!==arguments[2]&&arguments[2],xOffset=measurement.width/2,yOffset=measurement.height/2,i=0,len=points.length;i0&&(interactionType=function getLastItemInMap(map){return Array.from(map)[map.size-1]}(currentState)[0],stylesForCurrentLevel=currentState.get(interactionType)||{}),stylesForCurrentLevel},strokeProps={"stroke-width":1,stroke:1,"stroke-opacity":1},parseStyle=function parseStyle(value,_ref,apply){var datum=_ref.datum,datumStyle=_ref.datumStyle;if("function"==typeof value){if(isNaN(datumStyle))value=value(datumStyle.replace(/[^\d,.]/g,"").split(",").map(function(s){return Number(s)}),datum,apply);else value=value(parseFloat(datumStyle,10),datum,apply);return value}return value},helper_applyStylesOnInteraction=function applyStylesOnInteraction(context,elem,interactionType,conf,options){var datum,mountPoint=options.mountPoint,apply=options.apply,reset=options.reset,d=elem.data()[0],_datum$meta=(datum=Array.isArray(d)?d[0]:Array.isArray(d.data)?d.data[0]:d).meta,currentState=_datum$meta.currentState,originalStyle=_datum$meta.originalStyle,applicableStyles={},styles=conf.style,strokePosition=conf.strokePosition,applicableStrokePos=strokePosition;reset&¤tState.clear();var applyStyle=!0;if(apply){var sanitizedStyles={styles:{},strokePosition:strokePosition};for(var type in styles){var parsedStyleVal=parseStyle(styles[type],{datum:datum,datumStyle:elem.style(type)},apply);sanitizedStyles.styles[type]=parsedStyleVal}currentState.set(interactionType,sanitizedStyles),applicableStyles=sanitizedStyles.styles}else if(currentState.has(interactionType)||reset){currentState.delete(interactionType);var currentStyle=getPreviousStyle(datum.meta,interactionType);applicableStyles=Object.assign({},originalStyle.styles,currentStyle.styles),applicableStrokePos=currentStyle.strokePosition||originalStyle.strokePosition}else applyStyle=!1;var styleKeys=Object.keys(applicableStyles),_partition2=helper_slicedToArray(partition(styleKeys,function(v){return v in strokeProps}),2),strokeStyles=_partition2[0],otherStyles=_partition2[1];applyStyle&&context.applyStyles({strokeStyles:strokeStyles,otherStyles:otherStyles,styleObj:applicableStyles,elem:elem,datum:datum,applicableStrokePos:applicableStrokePos,mountPoint:mountPoint})};function base_mixin_typeof(obj){return(base_mixin_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _construct(Parent,args,Class){return(_construct=function isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&base_mixin_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function base_mixin_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function base_mixin_slicedToArray(arr,i){return function base_mixin_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function base_mixin_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function base_mixin_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function base_mixin_toConsumableArray(arr){return function base_mixin_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},getAllAttrs=config.getAllAttrs,getBBox=config.getBBox;if(!this.data())return[];if(identifiers instanceof datamodel_default.a){var dataObj=identifiers.getData();fieldNames=dataObj.schema.map(function(d){return d.name}),values=dataObj.data}else fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length);var points=this._points,fieldsConfig=this.data().getFieldsConfig(),filteredPoints=(_ref2=[]).concat.apply(_ref2,base_mixin_toConsumableArray(points)).filter(function(point){var source=point.source,rowId=point.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})});return getAllAttrs?filteredPoints:filteredPoints.map(function(d){var obj=clone(d);if(getBBox){var update=obj.update||obj;if(void 0!==obj.size){var sizeVal=2*Math.sqrt(obj.size/Math.PI);update.width=sizeVal,update.height=sizeVal,update.x-=sizeVal/2,update.y-=sizeVal/2}else void 0===update.width&&(update.width=2),void 0===update.height&&(update.height=2)}return obj.update||obj}).sort(function(a,b){return a.y-b.y})}},{key:"getTransformedDataFromIdentifiers",value:function getTransformedDataFromIdentifiers(identifiers){var measureIndex,enc,idx=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,_identifiers$getData=identifiers.getData(),identifierData=_identifiers$getData.data,identifierSchema=_identifiers$getData.schema,normalizedData=this._normalizedData,fieldsConfig=this.data().getFieldsConfig(),_this$encodingFieldsI=this.encodingFieldsInf(),yField=_this$encodingFieldsI.yField,xField=_this$encodingFieldsI.xField,yFieldType=_this$encodingFieldsI.yFieldType;if(_this$encodingFieldsI.xFieldType===dist_datamodel.FieldType.MEASURE)measureIndex=fieldsConfig[xField].index,enc="x";else if(yFieldType===dist_datamodel.FieldType.MEASURE){var layerName=this.constructor.formalName();measureIndex=fieldsConfig[yField].index,enc="y",layerName===AREA_LAYER&&(enc=idx%2==0?"y":"y0")}var transformedData=[];return normalizedData.forEach(function(dataArr){dataArr.forEach(function(dataObj){var tupleArr=dataObj.source;if(identifierSchema.every(function(obj,i){return-1!==identifierData.findIndex(function(d){return tupleArr[fieldsConfig[obj.name].index]===d[i]})})){var transformedVal=dataObj[enc]||0,row=dataObj.source,tuple={};for(var key in fieldsConfig){var index=fieldsConfig[key].index;tuple[key]=row[index],index===measureIndex&&(tuple[key]=transformedVal)}transformedData.push(tuple)}})}),[transformedData,this.data().getSchema()]}},{key:"getPlotElementsFromSet",value:function getPlotElementsFromSet(set){for(var graphicElems=this._graphicElems,elems=[],i=0,len=set.length;i1&&renderer_getElementsForLine({mount:mount,data:d,strokeStyle:strokeStyle,className:".".concat(className,"-").concat(nullDataLineClass),layer:layer,linepath:linepath,transition:transition,updateFns:updateFns}),null}),elementWithNullData},line_default_config_defaultConfig={classPrefix:CLASSPREFIX,defClassName:"layer-line",className:"",interpolate:"linear",transform:{type:"group"},interaction:{fade:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},focus:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},brushStroke:{style:{stroke:function stroke(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}}},crossline:!0,nearestPointThreshold:20,encoding:{color:{},x:{},y:{},strokeOpacity:{value:1},fillOpacity:{value:0},strokeWidth:{value:"2px"}},transition:{effect:"cubic",duration:1e3},connectNullData:!1,nullDataLineStyle:{},nullDataLineClass:"null"};__webpack_require__(21);function line_mixin_typeof(obj){return(line_mixin_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function line_mixin_toConsumableArray(arr){return function line_mixin_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{};return this.getDataFromEvent(config.event)}},{key:"getDataFromEvent",value:function getDataFromEvent(event){var dataPoint=renderer_utils_selectElement(event.target).data()[0];if(isSimpleObject(dataPoint)){var source=dataPoint.source,rowId=dataPoint.rowId;return{id:this.getIdentifiersFromData(source,rowId),layerId:this.id()}}return null}},{key:"translatePoints",value:function translatePoints(data){var _this2=this,_this$axes=this.axes(),angle=_this$axes.angle,colorAxis=_this$axes.color,radiusAxis=_this$axes.radius,pieIndex={},prevData=this._points[0]||[],points=[],angleV={};return this._prevPieData={},prevData.forEach(function(e,index){_this2._prevPieData[e.rowId]=[e,index],pieIndex[e.index]=e}),data.forEach(function(d,i){var angles=angle.getScaleValue(d.angle);if(angles){!angleV[d.angle]&&(angleV[d.angle]=0);var _angles=angles[angleV[d.angle]++],startAngle=_angles.startAngle,endAngle=_angles.endAngle,uid=d.rowId,resolvedEncodings=helpers_resolveEncodingValues({values:{radius:radiusAxis.getOuterRadius(d.radius),radius0:radiusAxis.getInnerRadius(d.radius0),color:colorAxis.getColor(d.color),angle0:startAngle,angle:endAngle,startAngle:startAngle,endAngle:endAngle,startAngle0:startAngle,endAngle0:endAngle},data:d},i,data,_this2),color=resolvedEncodings.color;points.push({source:d.source,index:i,enter:{},update:{angle0:resolvedEncodings.angle0,angle:resolvedEncodings.angle,radius0:resolvedEncodings.radius0,radius:resolvedEncodings.radius},color:color,meta:getColorMetaInf({fill:color}),rowId:uid,_previousInfo:_this2._prevPieData[uid]?_this2._prevPieData[uid][0]:function getPreviousPoint(prevData,currIndex,context){var prevArc=prevData[currIndex-1],nextArc=prevData[currIndex],_context$axes$angle$r2=arc_helper_slicedToArray(context.axes().angle.range(),2),startAngle=_context$axes$angle$r2[0],endAngle=_context$axes$angle$r2[1];return prevArc&&nextArc?{update:{angle0:getObjProp(prevArc,"update","angle"),angle:getObjProp(nextArc,"update","angle0")}}:nextArc?{update:{angle0:(startAngle-90)*Math.PI*2/360,angle:(startAngle-90)*Math.PI*2/360}}:{update:{angle0:(endAngle-90)*Math.PI*2/360,angle:(endAngle-90)*Math.PI*2/360}}}(pieIndex,i,_this2)})}}),points}},{key:"render",value:function render(container){var _this3=this,measurement=this.measurement(),_this$config=this.config(),classPrefix=_this$config.classPrefix,defClassName=_this$config.defClassName,cornerRadius=_this$config.cornerRadius,padAngle=_this$config.padAngle,padRadius=_this$config.padRadius,transition=_this$config.transition,qualClassName=getQualifiedClassName(defClassName,this.id(),classPrefix),path=this._arcFn=arc_mixin_arc().cornerRadius(cornerRadius).startAngle(function(d){return d.update.angle0+Math.PI/2}).endAngle(function(d){return d.update.angle+Math.PI/2}).padAngle(padAngle).padRadius(padRadius).outerRadius(function(d){return d.update.radius}).innerRadius(function(d){return d.update.radius0});this._points=this._normalizedData.map(function(arr){return _this3.translatePoints(arr)});var graphicElems=this._graphicElems={},g=makeElement(renderer_utils_selectElement(container),"g",this._points,"".concat(qualClassName[0],"-group")).classed("".concat(qualClassName[1],"-group"),!0).attr("transform","translate(".concat(measurement.width/2,",\n ").concat(measurement.height/2,")")),consecutiveExits=[],exitCounter=0;return makeElement(g,"g",function(d){return d},"".concat(qualClassName[0]),{update:function tween(elem){makeElement(elem,"path",function(d){return[d]},"".concat(qualClassName[0],"-path")).style("fill",function(d){return d.color}).each(function(d){graphicElems[d.rowId]=renderer_utils_selectElement(this)}).transition().duration(transition.duration).on("end",_this3.registerAnimationDoneHook()).attrTween("d",function(){for(var _len=arguments.length,params=new Array(_len),_key=0;_key<_len;_key++)params[_key]=arguments[_key];return function tweenPie(path,b){var datum=b[0];return function(t){return path(common_utils_interpolator()(datum._previousInfo,datum)(t))}}(path,params)}).attr("class",function(d,i){var individualClass=getIndividualClassName(d,i,_this3._points,_this3);return"".concat(qualClassName[0],"-path ").concat(qualClassName[1],"-path-").concat(d.index,"\n ").concat(individualClass)})},exit:function tweenExit(elem,d){var exitArr=consecutiveExits[exitCounter],oldExitCounter=exitCounter;exitArr?exitArr[exitArr.length-1].datum.index===d.index-1?exitArr.push({elem:elem,datum:d}):exitCounter++:exitArr=[{elem:elem,datum:d}],consecutiveExits[oldExitCounter]=exitArr}}).attr("class",function(d,i){return"".concat(qualClassName[0]," ").concat(qualClassName[1],"-").concat(i)}),function tweenExitPie(consecutiveExits,transition,path){consecutiveExits.length>0&&consecutiveExits.forEach(function(consecutiveExitArr){var startAngle=consecutiveExitArr[0].datum.update.angle0,endAngle=consecutiveExitArr[consecutiveExitArr.length-1].datum.update.angle,mid=2*Math.PI*startAngle/(2*Math.PI+startAngle-endAngle);consecutiveExitArr.forEach(function(e){var elem=e.elem,datum=e.datum;elem.each(function(){var gElem=renderer_utils_selectElement(this);gElem.selectAll("path").transition().duration(transition.duration).attrTween("d",function(){return function(t){return path(common_utils_interpolator()(datum,{update:{angle0:mid,angle:mid,radius:datum.radius,radius0:datum.radius0}})(t))}}).remove(),gElem.remove()})})})}(consecutiveExits,transition,path),this}},{key:"getPointsFromIdentifiers",value:function getPointsFromIdentifiers(identifiers){if(!this.data())return[];var fieldNames=identifiers[0],values=identifiers.slice(1,identifiers.length),pieSlices=renderer_utils_selectElement(this.mount()).selectAll("path").data(),fieldsConfig=this.data().getFieldsConfig(),pieSliceInf=pieSlices.filter(function(tData){var source=tData.source,rowId=tData.rowId;return fieldNames.every(function(field,idx){return field in fieldsConfig&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION?-1!==values.findIndex(function(d){return d[idx]===source[fieldsConfig[field].index]}):field!==reserved_fields.ROW_ID||-1!==values.findIndex(function(d){return d[idx]===rowId})})})[0];if(pieSliceInf){var measurement=this.measurement(),centroid=this._arcFn.centroid(pieSliceInf);return[{x:centroid[0]+measurement.width/2,y:centroid[1]+measurement.height/2,width:2,height:2}]}return[]}}],[{key:"defaultConfig",value:function defaultConfig(){return arc_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"arc"}}]),_class}()};function arc_typeof(obj){return(arc_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function arc_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var _this=this,config=this.config(),normalizedData=this._normalizedData,className=config.className,qualifiedClassName=getQualifiedClassName(config.defClassName,this.id(),config.classPrefix);return renderer_utils_selectElement(container).classed("".concat(qualifiedClassName.join(" ")," ").concat(className),!0),this._graphicElems={},renderer_utils_createElements({data:normalizedData,append:"g",selector:"g",container:container,each:function each(dataArr,group){var node=group.node(),points=_this.translatePoints(dataArr,{},_this);renderer_utils_setStyles(node,{"text-anchor":TEXT_ANCHOR_MIDDLE}),text_renderer(node,points,{className:qualifiedClassName[0]},_this)}}),this}},{key:"getNearestPoint",value:function getNearestPoint(x,y,_ref){var event=_ref.event;return this.data()?this.getDataFromEvent(event):null}},{key:"getDataFromEvent",value:function getDataFromEvent(event){return helpers_getDataFromEvent(this,event)}}],[{key:"defaultConfig",value:function defaultConfig(){return text_default_config_defaultConfig}},{key:"formalName",value:function formalName(){return"text"}}]),_class}()};function text_typeof(obj){return(text_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function text_defineProperties(target,props){for(var i=0;i4)}(shape)?shape:common_utils_getSymbol(shape).size(size)(update);var pathEl=makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr);renderer_utils_setStyles(pathEl,style)}else d.shape="circle",createShape(d,groupElement)}(d,group),graphicElems[d.rowId]=group;var update=d.update,style=d.style;objectIterator(style,function(key){return group.style(key,style[key])}),group.attr("class",className),group.classed(d.className,!0),disabled||(group=group.transition().duration(transition.duration).on("end",layer.registerAnimationDoneHook())),group.attr("transform","translate(".concat(update.x,",").concat(update.y,")"))},exit:function exit(exitGroup){disabled?exitGroup.remove():exitGroup.transition().ease(easeFns[effect]).duration(duration).on("end",function(){return exitGroup.remove()}).style("fill-opacity",0).style("stroke-opacity",0)}},params.keyFn)},point_default_config_defaultConfig={defClassName:"layer-point",className:"",classPrefix:CLASSPREFIX,defColorStyle:"stroke",interaction:{highlight:{className:"highlight-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"center"},focusStroke:{className:"focus-stroke-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"outside"},commonDoubleStroke:{style:{stroke:"black","stroke-width":"2px"},strokePosition:"outside"},brushStroke:{className:"brush-stroke-class",style:{stroke:"black","stroke-width":"1px"},strokePosition:"outside"},doubleStroke:{style:{stroke:"black","stroke-width":"2px"},strokePosition:"outside"},fade:{style:{fill:function fill(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}},focus:{style:{fill:function fill(rgbaValues,data,apply){return common_utils_transformColor(rgbaValues,{a:-.5},data,apply).color}}}},innerPadding:.1,nearestPointThreshold:5,transform:{type:"identity"},transition:{effect:"cubic",duration:1e3},encoding:{size:{value:30},color:{},stroke:{value:"#000"},"stroke-width":{value:0},fill:{},shape:{value:"circle"},x:{},y:{},"stroke-opacity":{value:1},"fill-opacity":{value:.5},strokePosition:{value:"center"},interaction:{anchors:"highlight","persistent-anchors":"focusStroke","brush-anchors":"brushStroke"}},shapes:["circle","cross","diamond","square","star","wye","triangle"],sizes:[20,30,40,50,60,70]};__webpack_require__(25);function point_helper_slicedToArray(arr,i){return function point_helper_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function point_helper_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function point_helper_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var helper_prepareDrawingInf=function prepareDrawingInf(_ref){var data=_ref.data,datum=_ref.datum,i=_ref.i,layerInst=_ref.layerInst,xPx=_ref.xPx,yPx=_ref.yPx,axes=layerInst.axes(),shapeAxis=axes.shape,colorAxis=axes.color,sizeAxis=axes.size,shape=shapeAxis.getShape(datum.shape),size=sizeAxis.getSize(datum.size),color=colorAxis.getColor(datum.color),layerEncoding=layerInst.config().encoding,stroke=layerEncoding.stroke.value,strokeWidth=layerEncoding["stroke-width"].value,resolvedEncodings=helpers_resolveEncodingValues({values:{x:xPx,y:yPx,color:color,stroke:stroke,"stroke-width":strokeWidth,size:size,shape:shape,data:datum},data:datum},i,data,layerInst),rowId=datum.rowId,source=datum.source;shape=resolvedEncodings.shape,size=resolvedEncodings.size;var style={fill:color=resolvedEncodings.color,stroke:resolvedEncodings.stroke,"stroke-width":resolvedEncodings["stroke-width"]},pos={x:resolvedEncodings.x,y:resolvedEncodings.y};return{enter:pos,update:pos,shape:shape,source:source,rowId:rowId,style:style,data:datum.dataObj,meta:Object.assign({layerId:layerInst.id()},getColorMetaInf(style,{strokePosition:layerEncoding.strokePosition.value})),size:size}},helper_pointTranslators=function helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},COORD_TYPES.CARTESIAN,function(data,config,layerInst){for(var points=[],encoding=layerInst.config().encoding,axes=layerInst.axes(),x=encoding.x,y=encoding.y,xField=x.field,yField=y.field,fieldsConfig=layerInst.data().getFieldsConfig(),isXDim=fieldsConfig[xField]&&fieldsConfig[xField].def.type===dist_datamodel.FieldType.DIMENSION,isYDim=fieldsConfig[yField]&&fieldsConfig[yField].def.type===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_loop=function _loop(i,len){var d=data[i],_map2=point_helper_slicedToArray([ENCODING.X,ENCODING.Y].map(function(type){var value=null===d[type]?void 0:d[type],measure=type===ENCODING.X?measurement.width:measurement.height;return encoding[type].field?axes[type].getScaleValue(value):measure/2}),2),xPx=_map2[0],yPx=_map2[1];if(xPx+=offsetX,yPx+=offsetY,!isNaN(xPx)&&!isNaN(yPx)){var point=helper_prepareDrawingInf({data:data,datum:d,i:i,layerInst:layerInst,xPx:xPx,yPx:yPx});point.className=getIndividualClassName(d,i,data,layerInst),points.push(point),layerInst.cachePoint(d[key],point)}},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{};return helper_pointTranslators[this.coord()](data,config,this)}},{key:"render",value:function render(container){var seriesClassName,_this2=this,maxSize=0,config=this.config(),keys=this._transformedData.map(function(d){return d.key}),transition=config.transition,className=config.className,defClassName=config.defClassName,classPrefix=config.classPrefix,normalizedData=this._normalizedData,containerSelection=renderer_utils_selectElement(container),qualifiedClassName=getQualifiedClassName(defClassName,this.id(),classPrefix);this._points=[],this._pointMap={},containerSelection.classed(qualifiedClassName.join(" "),!0).classed(className,!0),this._points=this.generateDataPoints(normalizedData,keys),this._graphicElems={};var schema=this.data().getSchema();return makeElement(container,"g",this._points,null,{update:function update(group,points){maxSize=Math.max.apply(Math,[maxSize].concat(point_mixin_toConsumableArray(points.map(function(d){return d.size||0})))),seriesClassName="".concat(qualifiedClassName[0]),_this2.constructor.drawFn()({layer:_this2,container:group.node(),points:points,interpolate:config.interpolate,className:seriesClassName,transition:transition,keyFn:function keyFn(v){return helpers_getMarkId(v.source,schema)}})}},function(data){return data[0].rowId}),this._maxSize=2*Math.sqrt(maxSize/Math.PI),this.attachDataToVoronoi(this._points),this}},{key:"attachDataToVoronoi",value:function attachDataToVoronoi(points){helpers_attachDataToVoronoi(this._voronoi,points)}},{key:"generateDataPoints",value:function generateDataPoints(normalizedData,keys){var _this3=this,_getPlotMeasurement2=point_mixin_slicedToArray(helpers_getPlotMeasurement(this,keys),2),widthMetrics=_getPlotMeasurement2[0],heightMetrics=_getPlotMeasurement2[1],offsetXValues=widthMetrics.offsetValues||[],offsetYValues=heightMetrics.offsetValues||[];return normalizedData.map(function(dataArr,i){var measurementConf=_this3.getMeasurementConfig(offsetXValues[i],offsetYValues[i],widthMetrics.span,heightMetrics.span);return _this3.translatePoints(dataArr,measurementConf)}).filter(function(d){return d.length})}},{key:"getMeasurementConfig",value:function getMeasurementConfig(offsetX,offsetY,widthSpan,heightSpan){return{offset:{x:(offsetX||0)+widthSpan/2,y:(offsetY||0)+heightSpan/2},span:{x:widthSpan,y:heightSpan}}}},{key:"getNearestPoint",value:function getNearestPoint(x,y){var nearestPointThreshold=this.config().nearestPointThreshold,distanceLimit=Math.max(this._maxSize,nearestPointThreshold);if(!this.data())return null;var point=this._voronoi.find(x,y,distanceLimit),dimensions=point&&point.data.data.update,radius=point?Math.sqrt(point.data.data.size/Math.PI):0;if(point&&pointWithinCircle({x:dimensions.x,y:dimensions.y,r:radius+nearestPointThreshold},{x:x,y:y})){var _point$data$data=point.data.data,source=_point$data$data.source,rowId=_point$data$data.rowId;return{id:this.getIdentifiersFromData(source,rowId),dimensions:[{x:dimensions.x,y:dimensions.y,width:radius,height:radius}],layerId:this.id()}}return null}},{key:"addOverlayPath",value:function addOverlayPath(refElement,data,style,strokePosition){var pathElement,container=refElement.parentElement;if(this._overlayPath[data.rowId]?pathElement=this._overlayPath[data.rowId]:((pathElement=makeElement(container,"path",[data.update],null,{},function(d){return"".concat(d.x," ").concat(data.rowId)})).style("fill","none"),pathElement.style("fill-opacity",0),pathElement.attr("id",data.rowId),this._overlayPath[data.rowId]=pathElement),"stroke-width"===style.type){var position=strokePosition,radius=Math.sqrt(data.size/Math.PI);radius=getStrokeWidthByPosition(position,radius);var size=data.size+radius;if("string"==typeof data.shape){var path=common_utils_getSymbol(data.shape).size(size);pathElement.attr("d",path)}}var styleVal=style.value;"function"==typeof styleVal&&(styleVal=styleVal(pathElement.style(style.type)));pathElement.style(style.type,styleVal),appendElement(refElement,pathElement.node())}},{key:"removeOverlayPath",value:function removeOverlayPath(data,style){var currentPath=this._overlayPath[data.rowId];currentPath&&(currentPath.node().removeAttribute("style"),Object.keys(style).forEach(function(s){return currentPath.style(s,style[s])}),currentPath.style("fill-opacity",0))}},{key:"getBoundBoxes",value:function getBoundBoxes(){return helpers_getBoundBoxes(this._points.flat())}},{key:"applyElementStyles",value:function applyElementStyles(elem,styles,styleObj){styles.forEach(function(type){elem.select("path").style(type,styleObj[type])})}}],[{key:"defaultConfig",value:function defaultConfig(){return point_default_config_defaultConfig}},{key:"defaultPolicy",value:function defaultPolicy(conf,userConf){var config=point_mixin_get(point_mixin_getPrototypeOf(_class),"defaultPolicy",this).call(this,conf,userConf),encoding=config.encoding,transform=config.transform,colorField=encoding.color&&encoding.color.field;return colorField&&(transform.groupBy=colorField),config}},{key:"drawFn",value:function drawFn(){return point_renderer}}]),_class}()};function point_typeof(obj){return(point_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function point_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1];for(var layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],radiusAxis=axes.radius,angleAxis=axes.angle,angle0Axis=axes.angle0,measurement=layerInst.measurement(),colorAxis=axes.color,angleV={},angle0V={},i=0,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},layerInst=arguments.length>2?arguments[2]:void 0,axes=layerInst.axes(),points=[],xAxis=axes.x,yAxis=axes.y,_layerInst$encodingFi=layerInst.encodingFieldsInf(),xField=_layerInst$encodingFi.xField,yField=_layerInst$encodingFi.yField,x0Field=_layerInst$encodingFi.x0Field,y0Field=_layerInst$encodingFi.y0Field,xFieldType=_layerInst$encodingFi.xFieldType,yFieldType=_layerInst$encodingFi.yFieldType,isXDim=xFieldType===dist_datamodel.FieldType.DIMENSION,isYDim=yFieldType===dist_datamodel.FieldType.DIMENSION,key=isXDim?ENCODING.X:isYDim?ENCODING.Y:null,measurement=layerInst.measurement(),colorAxis=axes.color,_config$offset=config.offset,offsetX=_config$offset.x,offsetY=_config$offset.y,_config$span=config.span,xSpan=_config$span.x,ySpan=_config$span.y,i=0,len=data.length;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];var layerRegistry=factoryObj._layerRegistry,instances=(layerDef=layerDef instanceof Array?layerDef:[layerDef]).map(function(layerObj){var layerConstructor=layerRegistry[layerObj.mark];return layerConstructor.create.apply(layerConstructor,params)});return 1===instances.length?instances[0]:instances},getLayerClass:function getLayerClass(mark){return factoryObj._layerRegistry[mark]},composeLayers:function composeLayers(layerType,layerDefs){compositeLayers[layerType]=layerDefs},sanitizeLayerConfig:function sanitizeLayerConfig(layerDef){var newConf=mergeRecursive({},layerDef);return sanitizeEncoding(newConf.encoding),newConf}};return factoryObj}();function defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_LAYERS=(defaults_defineProperty(_DEFAULT_LAYERS={},layer_types_AREA_LAYER,area_AreaLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_ARC_LAYER,ArcLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_LINE_LAYER,line_LineLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TEXT_LAYER,TextLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_POINT_LAYER,point_PointLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_TICK_LAYER,TickLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BAR_LAYER,bar_BarLayer),defaults_defineProperty(_DEFAULT_LAYERS,layer_types_BASE_LAYER,base_layer_BaseLayer),_DEFAULT_LAYERS),layer_registry=function(){var layers=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_LAYERS,reg=Object.assign({},layers),regObj={register:function register(def){var key=def.formalName();return reg[key]=def,regObj},get:function get(){return reg}};return regObj},helpers=Object.assign(helpers_namespaceObject,{pointLayerHelpers:point_helper_namespaceObject}),layerMixins={BarLayerMixin:bar_mixin_BarLayerMixin,BaseLayerMixin:base_mixin_BaseLayerMixin,LineLayerMixin:line_mixin_LineLayerMixin,AreaLayerMixin:area_mixin_AreaLayerMixin,PointLayerMixin:point_mixin_PointLayerMixin,TextLayerMixin:text_mixin_TextLayerMixin,TickLayerMixin:tick_mixin_TickLayerMixin,ArcLayerMixin:arc_mixin_ArcLayerMixin};function src_helper_slicedToArray(arr,i){return function src_helper_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function src_helper_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function src_helper_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function src_helper_toConsumableArray(arr){return function src_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i=0?axisInf[key]:axisArr.length-1;axes[key]&&(axesObj[key]=defaultValue(axes[key][axisIndex]))}}),Object.keys(axesObj).length&&layer.axes(axesObj)})},helper_X=ENCODING.X,helper_Y=ENCODING.Y,helper_RADIUS=ENCODING.RADIUS,helper_ANGLE=ENCODING.ANGLE,helper_ANGLE0=ENCODING.ANGLE0,RADIUS0=ENCODING.RADIUS0,helper_getLayerAxisIndex=function getLayerAxisIndex(layers,fields){var layerAxisIndex={};return layers.forEach(function(layer){var _layer$config=layer.config(),axis=_layer$config.axis,encoding=_layer$config.encoding,id=layer.id();[helper_X,helper_Y,helper_ANGLE,helper_ANGLE0,helper_RADIUS].forEach(function(type){var index,specificField=getObjProp(encoding,type,"field"),encodingField=type===helper_RADIUS?defaultValue(specificField,getObjProp(encoding,RADIUS0,"field")):getObjProp(encoding,type,"field"),field=defaultValue(getObjProp(axis,type),encodingField);index=fields[type]&&fields[type].length?fields[type].findIndex(function(fieldInst){return-1!==fieldInst.getMembers().indexOf(field)}):0,!layerAxisIndex[id]&&(layerAxisIndex[id]={}),layerAxisIndex[id][type]=index})}),layerAxisIndex},helper_unionDomainFromLayers=function unionDomainFromLayers(layers,axisFields,layerAxisIndex,fieldsConfig){var domains={};return(layers=layers.filter(function(layer){return null!==layer.getDataDomain()})).forEach(function(layer){var domainValues={},config=layer.config(),layerDomain=layer.getDataDomain(),layerId=layer.id();null!==layerDomain&&!1!==config.calculateDomain&&(domainValues=Object.entries(layerDomain),domains=domainValues.reduce(function(fieldDomain,domain){var encodingType=domain[0],axisIndex=layerAxisIndex[layerId][encodingType],field=getObjProp(axisFields,encodingType,axisIndex);!fieldDomain[encodingType]&&(fieldDomain[encodingType]={});var encodingDomain=fieldDomain[encodingType];if(field){var fieldStr="".concat(field);encodingDomain[fieldStr]=encodingDomain[fieldStr]||[],encodingDomain[fieldStr]=function getValidDomain(domain,domain1,encodingType,fieldType){return encodingType===helper_ANGLE||encodingType===helper_ANGLE0?domain.concat(domain1.filter(function(d){return-1===domain.indexOf(d)})):unionDomain([domain,domain1],fieldType)}(encodingDomain[fieldStr],domain[1],encodingType,fieldsConfig[field.getMembers()[0]].def.subtype)}return fieldDomain},domains))}),domains},helper_renderLayers=function renderLayers(context,container,layers,measurement){context._lifeCycleManager.notify({client:layers,action:"beforedraw",formalName:"layer"});var classPrefix=context.config().classPrefix,orderedLayers=layers.sort(function(a,b){return a.config().order-b.config().order}),layerParentGroup=makeElement(container,"g",[1],"".concat(classPrefix,"-layer-group")),layerDepOrder=getDependencyOrder(context._layerDepOrder),groups={};makeElement(layerParentGroup,"g",orderedLayers,null,{update:function update(group,layer){groups[layer.alias()]={group:group,layer:layer}}}),layerDepOrder.map(function(name){return groups[name]}).filter(function(d){return void 0!==d}).forEach(function(o){var layer=o.layer,group=o.group;layer.measurement(measurement),layer.dataProps({timeDiffs:context._timeDiffs}),!1!==layer.config().render&&layer.mount(group.node())})},helper_getNearestDimensionalValue=function getNearestDimensionalValue(context,position){var fields=context.fields();if(!fields.x.length||!fields.y.length)return null;var data=context.data(),axes=context.axes(),fieldsConfig=data.getFieldsConfig(),xField=getObjProp(fields,"x",0).getMembers()[0],yField=getObjProp(fields,"y",0).getMembers()[0],xFieldType=fieldsConfig[xField].def.subtype,yFieldType=fieldsConfig[yField].def.subtype,entryVal=[["x",xFieldType,xField],["y",yFieldType,yField]].find(function(entry){return entry[1]===dist_datamodel.DimensionSubtype.CATEGORICAL||entry[1]===dist_datamodel.DimensionSubtype.TEMPORAL});if(!entryVal||xFieldType!==dist_datamodel.MeasureSubtype.CONTINUOUS&&yFieldType!==dist_datamodel.MeasureSubtype.CONTINUOUS)return null;var field=entryVal[2],index=fieldsConfig[field].index,key=axes[entryVal[0]][0].invert(position[entryVal[0]]);if(entryVal[1]===dist_datamodel.DimensionSubtype.TEMPORAL){var filterData=src_helper_toConsumableArray(new Set(data.getData().data.map(function(d){return d[index]})));key=getNearestValue(filterData,key)}return void 0!==key?[[field],[key]]:null},getLayersBy=function getLayersBy(layers,searchBy,value){return layers.filter(function(layer){return("type"===searchBy?layer.constructor.formalName():layer.alias())===value})},removeLayersBy=function removeLayersBy(layers,searchBy,value){layers.filter(function(inst){return("type"===searchBy?inst.config().mark:inst.alias())!==value||(inst.remove(),!1)})},helper_createSideEffectGroup=function createSideEffectGroup(container,className){return makeElement(container,"g",[1],className).node()},createRenderPromise=function createRenderPromise(unit){unit._renderedPromise.then(function(){unit._renderedPromise=new Promise(function(resolve){unit._renderedResolve=resolve}),createRenderPromise(unit)})},getRadiusRange=function getRadiusRange(width,height){var config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},innerRadius=config.innerRadius,outerRadius=config.outerRadius;return[innerRadius||0,outerRadius||Math.min(height,width)/2]},helper_setAxisRange=function setAxisRange(context){var radiusAxes=context.axes().radius;radiusAxes&&radiusAxes.forEach(function(axis){axis.range(getRadiusRange(context.width(),context.height()))})},helper_isXandYMeasures=function isXandYMeasures(context){var _context$fields=context.fields(),_map2=src_helper_slicedToArray([_context$fields.x,_context$fields.y].map(function(fields){return fields.every(function(field){return field.type()===dist_datamodel.FieldType.MEASURE})}),2),xMeasures=_map2[0],yMeasures=_map2[1];return xMeasures&&yMeasures},getKey=function getKey(arr,row){for(var key=row[arr[0]],i=1,len=arr.length;i0&&void 0!==arguments[0]?arguments[0]:{},set=this._set,uidMap=this._uidMap,retObj={entrySet:[[],[]],exitSet:[[],[]],mergedEnter:[],mergedExit:[],completeSet:[]},measureNames=this._measureNames,dimVals=this._dimVals,_config$keepDims=config.keepDims,keepDims=void 0!==_config$keepDims&&_config$keepDims,_config$dimensions=config.dimensions,dimensions=void 0===_config$dimensions?this._fields:_config$dimensions,fieldIndices=this._fieldIndices,_loop=function _loop(key){var val=void 0,measureNamesArr=measureNames[key]||[],dims=dimVals[key];keepDims?measureNamesArr.length?(dims=dimensions.map(function(d){return dims[fieldIndices[d]]}),val=dims.length?[].concat(selection_set_toConsumableArray(dims),["".concat(measureNamesArr)]):[uidMap[key],"".concat(measureNamesArr)]):val=dims.length?selection_set_toConsumableArray(dims):[uidMap[key]]:val=measureNamesArr.length?[uidMap[key],measureNames[key],dims]:[uidMap[key]],set[key]>0?([SELECTION_OLD_ENTRY,SELECTION_NEW_ENTRY].forEach(function(v,i){set[key]===v&&retObj.entrySet[i].push(val)}),set[key]!==SELECTION_OLD_ENTRY&&set[key]!==SELECTION_NEW_ENTRY||retObj.mergedEnter.push(val)):set[key]<0&&([SELECTION_OLD_EXIT,SELECTION_NEW_EXIT].forEach(function(v,i){set[key]===v&&retObj.exitSet[i].push(val)}),set[key]!==SELECTION_OLD_EXIT&&set[key]!==SELECTION_NEW_EXIT||retObj.mergedExit.push(val)),retObj.completeSet.push(val)};for(var key in set)_loop(key);return retObj}},{key:"reset",value:function reset(ids){var set=this._set;if(ids)ids.forEach(function(i){i in set&&(set[i]=SELECTION_NULL)});else for(var key in set)set[key]=SELECTION_NULL;return this._resetted=!0,this}},{key:"getEntrySet",value:function getEntrySet(){var set=this._set,addSet=[];for(var key in set)set[key]===SELECTION_NEW_ENTRY&&addSet.push(key);return addSet}},{key:"getExistingEntrySet",value:function getExistingEntrySet(addSet){var set=this._set;return addSet.filter(function(d){return set[d]===SELECTION_NEW_ENTRY||set[d]===SELECTION_OLD_ENTRY})}},{key:"getExistingExitSet",value:function getExistingExitSet(removeSet){var set=this._set;return removeSet.filter(function(d){return set[d]===SELECTION_NEW_EXIT||set[d]===SELECTION_OLD_EXIT})}},{key:"getOldEntry",value:function getOldEntry(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_ENTRY&&updateSet.push(key);return updateSet}},{key:"getOldExit",value:function getOldExit(){var set=this._set,updateSet=[];for(var key in set)set[key]===SELECTION_OLD_EXIT&&updateSet.push(key);return updateSet}},{key:"getExitSet",value:function getExitSet(){var set=this._set,removeSet=[];for(var key in set)set[key]===SELECTION_NEW_EXIT&&removeSet.push(key);return removeSet}},{key:"getCompleteSet",value:function getCompleteSet(){var set=this._set,completeSet=[];for(var key in set)completeSet.push(key);return completeSet}},{key:"getCompleteSetCount",value:function getCompleteSetCount(){return this._completeSetCount}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"toggle",value:function toggle(){var set=this._set;for(var key in set)set[key]===SELECTION_NEW_ENTRY?set[key]=SELECTION_NEW_EXIT:set[key]===SELECTION_NEW_EXIT?set[key]=SELECTION_NEW_ENTRY:set[key]===SELECTION_OLD_ENTRY?set[key]=SELECTION_OLD_EXIT:set[key]=SELECTION_OLD_ENTRY;return this}},{key:"getMergedEntrySet",value:function getMergedEntrySet(raw){var set=this._set,mergedEnter=[],uidMap=this._uidMap,measureNames=this._measureNames,dimVals=this._dimVals;for(var key in set){var val=raw?[].concat(selection_set_toConsumableArray(dimVals[key]),["".concat(measureNames[key])]):[uidMap[key],measureNames[key]];set[key]!==SELECTION_NEW_ENTRY&&set[key]!==SELECTION_OLD_ENTRY||mergedEnter.push(val)}return mergedEnter}},{key:"getMergedExitSet",value:function getMergedExitSet(raw){var set=this._set,mergedExit=[],uidMap=this._uidMap,measureNames=this._measureNames,dimVals=this._dimVals;for(var key in set){var val=raw?[].concat(selection_set_toConsumableArray(dimVals[key]),["".concat(measureNames[key])]):[uidMap[key],measureNames[key]];set[key]!==SELECTION_NEW_EXIT&&set[key]!==SELECTION_OLD_EXIT||mergedExit.push(val)}return mergedExit}}]),SelectionSet}();function muze_firebolt_src_helper_toConsumableArray(arr){return function muze_firebolt_src_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i3&&void 0!==arguments[3]?arguments[3]:{},sideEffect=this.sideEffects()[name],setTransform=options.setTransform;selectionSet=setTransform?setTransform(selectionSet,payload,sideEffect):selectionSet,sideEffect.apply(selectionSet,payload,options)}},{key:"registerPropagationBehaviourMap",value:function registerPropagationBehaviourMap(map){return this._propagationBehaviourMap=Object.assign(this._propagationBehaviourMap,map||{}),this}},{key:"dispatchBehaviour",value:function dispatchBehaviour(behaviour,payload){var propagationInfo=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};payload=this.sanitizePayload(payload);var propagate=void 0===propagationInfo.propagate||propagationInfo.propagate,action=this._actions.behavioural[behaviour],behaviourEffectMap=this._behaviourEffectMap,sideEffects=getSideEffects(behaviour,behaviourEffectMap);if(this._propagationInf=propagationInfo,this._payloads[behaviour]=payload,action){action.dispatch(payload),this._entryExitSet[behaviour]=action.entryExitSet();var shouldApplySideEffects=this.shouldApplySideEffects(propagationInfo);if(propagate&&this.propagate(behaviour,payload,action.propagationIdentifiers(),{sideEffects:sideEffects}),shouldApplySideEffects){var applicableSideEffects=this.getApplicableSideEffects(sideEffects,payload,propagationInfo);this.applySideEffects(applicableSideEffects,this.getEntryExitSet(behaviour),payload)}}return this}},{key:"getPropagationSelectionSet",value:function getPropagationSelectionSet(selectionSet){return selectionSet.find(function(d){return!d.sourceSelectionSet})}},{key:"shouldApplySideEffects",value:function shouldApplySideEffects(){return!0}},{key:"changeBehaviourStateOnPropagation",value:function changeBehaviourStateOnPropagation(behaviour,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",behaviourConditions=this._behaviourPolicies[behaviour]||(this._behaviourPolicies[behaviour]={});return value instanceof Function?behaviourConditions[key]=value:behaviourConditions[key]=function(){return value},this}},{key:"changeSideEffectStateOnPropagation",value:function changeSideEffectStateOnPropagation(sideEffect,value){var key=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",sideEffectConditions=this._sideEffectPolicies[sideEffect]||(this._sideEffectPolicies[sideEffect]={});value instanceof Function?sideEffectConditions[key]=value:sideEffectConditions[key]=function(){return value}}},{key:"removeSideEffectPolicy",value:function removeSideEffectPolicy(sideEffect,key){return delete this._sideEffectPolicies[sideEffect][key],this}},{key:"removeBehaviourPolicy",value:function removeBehaviourPolicy(behaviour,key){return delete this._behaviourPolicies[behaviour][key],this}},{key:"propagate",value:function propagate(){return this}},{key:"sideEffects",value:function sideEffects(){return arguments.length?(this._sideEffects=arguments.length<=0?void 0:arguments[0],this):this._sideEffects}},{key:"enableSideEffects",value:function enableSideEffects(fn){return changeSideEffectAvailability(this,fn,!0),this}},{key:"disableSideEffects",value:function disableSideEffects(fn){return changeSideEffectAvailability(this,fn,!1),this}},{key:"dissociateBehaviour",value:function dissociateBehaviour(behaviour,physicalAction){var actionBehaviourMap=this._actionBehaviourMap;for(var key in actionBehaviourMap)if(key===physicalAction){var behaviourMap=actionBehaviourMap[key];behaviourMap.behaviours=behaviourMap.behaviours.filter(function(d){return d!==behaviour}),this.mapActionsAndBehaviour(key)}return this}},{key:"dissociateSideEffect",value:function dissociateSideEffect(sideEffect,behaviour){var behaviourEffectMap=this._behaviourEffectMap;return behaviourEffectMap[behaviour]=behaviourEffectMap[behaviour].filter(function(d){return(d.name||d)!==sideEffect}),this}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects){return sideEffects}},{key:"attachPropagationListener",value:function attachPropagationListener(dataModel){var handler=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.onDataModelPropagation();return dataModel.unsubscribe("propagation"),dataModel.on("propagation",handler),this}},{key:"onDataModelPropagation",value:function onDataModelPropagation(){var _this2=this;return function(propValue){var payload=propValue.payload,action=payload.action;_this2.dispatchBehaviour(action,payload,{propagate:!1})}}},{key:"createSelectionSet",value:function createSelectionSet(uniqueIds,behaviouralActions){var behaviours=behaviouralActions||this._actions.behavioural,selectionSet=this._selectionSet,volatileSelectionSet=this._volatileSelectionSet;for(var key in behaviours)({}).hasOwnProperty.call(behaviours,key)&&(selectionSet[key]=new src_selection_set(uniqueIds),volatileSelectionSet[key]=new src_selection_set(uniqueIds,!0),this._entryExitSet[key]=null);return this._volatileSelectionSet=volatileSelectionSet,this.selectionSet(selectionSet),this}},{key:"selectionSet",value:function selectionSet(){return arguments.length?(this._selectionSet=arguments.length<=0?void 0:arguments[0],this):this._selectionSet}},{key:"initializeSideEffects",value:function initializeSideEffects(){var sideEffectDefinitions=this._sideEffectDefinitions;return this.sideEffects(function initializeSideEffects(context,sideEffects){var sideEffectsMap=context._sideEffects;return(sideEffects=sideEffects instanceof Array?sideEffects:Object.values(sideEffects)).forEach(function(SideEffect){var formalName=SideEffect.formalName(),target=SideEffect.target();if(target===context.target()||"all"===target){var sideEffectInstance=sideEffectsMap[formalName];sideEffectsMap[formalName]=sideEffectInstance||new SideEffect(context)}}),sideEffectsMap}(this,sideEffectDefinitions)),this}},{key:"target",value:function target(){return"all"}},{key:"registerPhysicalActions",value:function registerPhysicalActions(actions){var initedActions=function initializePhysicalActions(context,actions){var physicalActions={};for(var name in actions)({}).hasOwnProperty.call(name,actions)||(physicalActions[name]=actions[name](context));return physicalActions}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,actions);return Object.assign(this._actions.physical,initedActions),this}},{key:"propagateWith",value:function propagateWith(action,fields){var append=arguments.length>2&&void 0!==arguments[2]&&arguments[2],behaviouralActions=this._actions.behavioural;if(action===ALL_ACTIONS)for(var key in behaviouralActions)this._propagationFields[key]={fields:fields,append:append};else this._propagationFields[action]={fields:fields,append:append};return this}},{key:"mapActionsAndBehaviour",value:function mapActionsAndBehaviour(phyAction){var initedPhysicalActions=this._actions.physical,map=this._actionBehaviourMap;for(var action in map)if(!{}.hasOwnProperty.call(action,map)&&action===(phyAction||action)){var target=void 0,mapObj=map[action];target=mapObj.target;var touch=mapObj.touch;target||(target=this.context.getDefaultTargetContainer()),(hasTouch()?!0===touch||void 0===touch:!touch)&&this.bindActionWithBehaviour(initedPhysicalActions[action],target,mapObj.behaviours)}return this.registerPhysicalActionHandlers(),this}},{key:"registerPhysicalBehaviouralMap",value:function registerPhysicalBehaviouralMap(map){return this._actionBehaviourMap=mergeRecursive(this._actionBehaviourMap,map),this}},{key:"bindActionWithBehaviour",value:function bindActionWithBehaviour(action,targets,behaviourList){var _this3=this;return"string"==typeof targets&&(targets=[targets]),targets.forEach(function(target){var mount=_this3.context.mount(),nodes=target.node instanceof Function?target:renderer_utils_selectElement(mount).selectAll(target);nodes.empty()||(nodes instanceof Array?nodes.forEach(function(node){action(renderer_utils_selectElement(node),behaviourList)}):action(nodes,behaviourList))}),this}},{key:"getPropagationInf",value:function getPropagationInf(){return this._propagationInf}},{key:"getAddSetFromCriteria",value:function getAddSetFromCriteria(criteria){var propagationInf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{model:propagationInf.data?propagationInf.data:null,uids:criteria?firebolt_getKeysFromCriteria(criteria,this):null}}},{key:"getSelectionSets",value:function getSelectionSets(action){var sourceId=this.id(),propagationSource=(this._propagationInf||{}).sourceId,applicableSelectionSets=[];return propagationSource!==sourceId&&(applicableSelectionSets=[this._volatileSelectionSet[action]]),propagationSource&&applicableSelectionSets.push(this.selectionSet()[action]),applicableSelectionSets}},{key:"getFullData",value:function getFullData(){return this.context.data()}},{key:"resetted",value:function resetted(){return this._resetted}},{key:"getEntryExitSet",value:function getEntryExitSet(behaviour){return this._entryExitSet[behaviour]}},{key:"mergeSelectionSets",value:function mergeSelectionSets(behaviours){return helper_unionSets(this,behaviours)}},{key:"data",value:function data(){return this.context.data()}},{key:"triggerPhysicalAction",value:function triggerPhysicalAction(event,payload){var handlers=this._handlers[event]||[],genericHandlers=this._handlers["*"];return[].concat(firebolt_toConsumableArray(Object.values(handlers)),firebolt_toConsumableArray(Object.values(genericHandlers))).forEach(function(fn){fn(event,payload)}),this}},{key:"onPhysicalAction",value:function onPhysicalAction(event,fn,namespace){return!this._handlers[event]&&(this._handlers[event]={}),this._handlers[event][namespace]=fn,this}},{key:"registerPhysicalActionHandlers",value:function registerPhysicalActionHandlers(){var _this4=this;this.onPhysicalAction("*",function(event,payload){_this4._actionBehaviourMap[event].behaviours.forEach(function(beh){return _this4.dispatchBehaviour(beh,payload)})})}},{key:"id",value:function id(){return this.context.id()}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(){var _this$context;return(_this$context=this.context).getRangeFromIdentifiers.apply(_this$context,arguments)}},{key:"sanitizePayload",value:function sanitizePayload(payload){return payload}},{key:"payloadGenerators",value:function payloadGenerators(){return arguments.length&&Object.assign(this._payloadGenerators,arguments.length<=0?void 0:arguments[0]),this._payloadGenerators}},{key:"getPayloadGeneratorFor",value:function getPayloadGeneratorFor(action){var defaultFn=this._payloadGenerators.__default,fn=this._payloadGenerators[action];return defaultValue(fn,defaultFn)}},{key:"getPayload",value:function getPayload(action){return this._payloads[action]}},{key:"actions",value:function actions(){return this._actions}}]),Firebolt}();function generic_toConsumableArray(arr){return function generic_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&void 0!==arguments[1]?arguments[1]:{},sourceIdentifiers=propagationInf.sourceIdentifiers;return sourceIdentifiers?sourceIdentifiers.fields.map(function(d){return d.name}):criteria instanceof Array?criteria[0]:Object.keys(criteria||{})}(propagationInf,payload.criteria)},this}return this._entryExitSet}},{key:"getSetInfo",value:function getSetInfo(type,set,filteredDataModel,setFields){var model=null,data=this.firebolt.data();if("mergedEnter"===type)model=filteredDataModel||null;else if("mergedExit"===type){if(filteredDataModel){var setKeys=new Set(set.map(function(d){return d[0]}));model=data.select(function(fields,i){return setKeys.has(setFields.map(function(field){return field===reserved_fields.ROW_ID?i:fields[field].value}))},{saveChild:!1})}model=filteredDataModel||null}var aggFns=common_utils_retrieveNearestGroupByReducers(model);return{uids:set,length:set.length,model:model,fields:setFields,aggFns:aggFns}}},{key:"propagationIdentifiers",value:function propagationIdentifiers(){for(var _len2=arguments.length,params=new Array(_len2),_key2=0;_key2<_len2;_key2++)params[_key2]=arguments[_key2];if(params.length){var propData=null,selectionSet=params[0],payload=params[1],fieldsConfig=this.firebolt.data().getFieldsConfig(),criteria=payload.criteria,propagationFields=this._propagationFields;if(selectionSet.resetted()||null===criteria)propData=null;else if(isSimpleObject(criteria)){var fields=Object.keys(criteria),otherFields=generic_slicedToArray(partition(fields,function(d){return fieldsConfig[d]?fieldsConfig[d].def.subtype===dist_datamodel.DimensionSubtype.CATEGORICAL:d===reserved_fields.MEASURE_NAMES}),2)[1],allFields=selectionSet._fields.filter(function(d){return d===reserved_fields.ROW_ID||fieldsConfig[d].def.subtype===dist_datamodel.DimensionSubtype.CATEGORICAL}),mergedEnter=selectionSet.getSets({keepDims:!0,dimensions:allFields}).mergedEnter;propData={fields:fields.map(function(d){return fieldsConfig[d]?fieldsConfig[d].def:{name:d}}),range:this.firebolt.getRangeFromIdentifiers({criteria:criteria,entrySet:mergedEnter,fields:otherFields}),identifiers:[[].concat(generic_toConsumableArray(allFields),[reserved_fields.MEASURE_NAMES])].concat(generic_toConsumableArray(mergedEnter))}}else{var _mergedEnter=selectionSet.getSets({keepDims:!0,dimensions:propagationFields}).mergedEnter,_fields=propagationFields?[].concat(generic_toConsumableArray(propagationFields),[reserved_fields.MEASURE_NAMES]):criteria[0];propData={fields:_fields.map(function(d){return fieldsConfig[d]?fieldsConfig[d].def:{name:d}}),identifiers:[_fields].concat(generic_toConsumableArray(_mergedEnter))}}return this._propagationIdentifiers=propData,this}return this._propagationIdentifiers}},{key:"enable",value:function enable(){this._enabled=!0}},{key:"disable",value:function disable(){this._enabled=!1}},{key:"isEnabled",value:function isEnabled(){return this._enabled}},{key:"propagateWith",value:function propagateWith(){return this._propagationFields=arguments.length<=0?void 0:arguments[0],this}}],[{key:"mutates",value:function mutates(){return!1}}]),GenericBehaviour}();function volatile_typeof(obj){return(volatile_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function volatile_defineProperties(target,props){for(var i=0;iendPos.x&&(newStartPos.x=endPos.x,newEndPos.x=startPos.x),startPos.y>endPos.y){var y=startPos.y;newStartPos.y=endPos.y,newEndPos.y=y}var payload=drag_action_config(firebolt,{startPos:newStartPos,endPos:newEndPos});payload.dragging=!0,payload.dragDiff=Math.abs(startPos.x-endPos.x)+Math.abs(startPos.y-endPos.y),firebolt.triggerPhysicalAction(action,payload)}}).on("end",function(){var event=renderer_utils_getEvent();endPos={x:event.x,y:event.y};var duration=(new Date).getTime()-touchStart;if(!(touch&&duration>100&&Math.abs(startPos.x-endPos.x)<=5)){if(endPos.x=Math.max(0,Math.min(endPos.x,drawingInf.width)),endPos.y=Math.max(0,Math.min(endPos.y,drawingInf.height)),startPos.x>endPos.x){var x=startPos.x;startPos.x=endPos.x,endPos.x=x}if(startPos.y>endPos.y){var y=startPos.y;startPos.y=endPos.y,endPos.y=y}var payload=drag_action_config(firebolt,{startPos:startPos,endPos:endPos});payload.dragEnd=!0,firebolt.triggerPhysicalAction(action,payload)}}))},physical_hover=function hover(firebolt){return function(targetEl){var dispatchBehaviour=function dispatchBehaviour(args){var event=renderer_utils_getEvent(),context=firebolt.context,mode=context.config().interaction.tooltip.mode,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{getAllPoints:!0,data:args,event:event}),payload={criteria:nearestPoint?nearestPoint.id:null,getAllPoints:!1,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos,mode:mode};firebolt.triggerPhysicalAction(HOVER,payload),event.stopPropagation()};targetEl.on("mouseover",dispatchBehaviour).on("mousemove",dispatchBehaviour).on("mouseout",function(){firebolt.triggerPhysicalAction(HOVER,{criteria:null})})}},helpers_generatePayloadFromEvent=function generatePayloadFromEvent(args,event,firebolt){var context=firebolt.context,pos=renderer_utils_getClientPoint(context.getDrawingContext().svgContainer,event.touches?event.touches[0]:event),nearestPoint=context.getNearestPoint(pos.x,pos.y,{data:args,event:event});return{criteria:nearestPoint?nearestPoint.id:null,showInPosition:nearestPoint.showInPosition,target:nearestPoint.target,position:pos}},physical_click=function click(firebolt){return function(targetEl){targetEl.on("click",function dispatchBehaviour(args){var event=renderer_utils_getEvent(),payload=helpers_generatePayloadFromEvent(args,event,firebolt);firebolt.triggerPhysicalAction(CLICK,payload),event.stopPropagation()})}};function physical_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var physicalActions=(physical_defineProperty(_physicalActions={},DRAG,function drag(firebolt){return function(targetEl){drag_event_attachDragEvent(targetEl,DRAG,firebolt)}}),physical_defineProperty(_physicalActions,HOVER,physical_hover),physical_defineProperty(_physicalActions,CLICK,physical_click),physical_defineProperty(_physicalActions,LONGTOUCH,function longtouch(firebolt){return function(targetEl){var event,touchEnd;touchEnd=!1,event=renderer_utils_getEvent(),targetEl.on("touchstart",function(args){event=renderer_utils_getEvent(),touchEnd=!1,setTimeout(function(){touchEnd?firebolt.triggerPhysicalAction(LONGTOUCH,{criteria:null}):function dispatchBehaviour(args){var payload=helpers_generatePayloadFromEvent(args,event,firebolt);firebolt.triggerPhysicalAction(LONGTOUCH,payload),event.stopPropagation()}(args)},100)}).on("touchend",function(){touchEnd=!0})}}),physical_defineProperty(_physicalActions,TOUCHDRAG,function touchdrag(firebolt){return function(targetEl,behaviours){drag_event_attachDragEvent(targetEl,behaviours,firebolt,!0)}}),_physicalActions),side_effects_ANCHORS="anchors",side_effects_TOOLTIP="tooltip",side_effects_BRUSH_ANCHORS="brush-anchors",side_effects_PERSISTENT_ANCHORS="persistent-anchors",side_effects_FILTER="filter",side_effects_HIGHLIGHTER="highlighter",CROSSLINE="crossline",FRAGMENTED_TOOLTIP="fragmented-tooltip",AXIS_LABEL_HIGHLIGHTER="axis-label-highlighter",generic_props_PROPS={valueParser:{defaultValue:function defaultValue(val){return val}}};function generic_sideeffect_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},layers=arguments.length>2?arguments[2]:void 0,interactionType=config.interactionType,apply=config.apply,_config$reset=config.reset,reset=void 0!==_config$reset&&_config$reset;return(layers||this.firebolt.context.layers()).forEach(function(layer){if(!1!==layer.config().interactive){var layerFields=layer.data().getFieldsConfig(),filteredUids=set.uids.filter(function(_ref){var _ref2$=surrogate_slicedToArray(_ref,2)[1];return(void 0===_ref2$?[]:_ref2$).every(function(m){return m in layerFields})}).map(function(d){return d[0]}),options={apply:apply,reset:reset,styles:null};layer.applyInteractionStyle(interactionType,filteredUids,options)}}),this}}]),SurrogateSideEffect}();function spawnable_typeof(obj){return(spawnable_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function spawnable_defineProperties(target,props){for(var i=0;i=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(firebolt,{startPos:{x:x,y:y},endPos:{x:x2,y:y2}});onDrag(payload)}}).on("end",function(){var width=drawingInf.width,height=drawingInf.height,x=Math.min(width-subject.width,Math.max(subject.x,0)),y=Math.min(height-subject.height,Math.max(subject.y,0)),y2=y+subject.height,x2=x+subject.width;if(x>=0&&x2<=width&&y>=0&&y2<=height){var payload=drag_action_config(firebolt,{startPos:{x:x,y:y},endPos:{x:x2,y:y2}});payload.dragEnd=!0,onDrag(payload)}}))}}(firebolt)(renderer_utils_selectElement(this),["brush"],sideEffect)}).merge(selection).each(function(attrs){var element=renderer_utils_selectElement(this);for(var key in transition&&(element=element.transition().duration(transition.duration)),attrs)({}).hasOwnProperty.call(attrs,key)&&isValidValue(attrs[key])&&element.attr(key,attrs[key])}),boxClassName=getQualifiedClassName(boxConf.defClassName,this._id,classPrefix);return selectionBox.classed(boxClassName.join(" "),!0),selectionBox.classed(boxConf.className,!0),this}},{key:"hide",value:function hide(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!1)}},{key:"show",value:function show(drawingInf){helper_changeVisibility(this,drawingInf.sideEffectGroup,!0)}}],[{key:"defaultConfig",value:function defaultConfig(){return{defClassName:"selection-box-group",className:"",classPrefix:"muze",box:{defClassName:"selection-box",className:""},transition:{duration:200},persistent:!1}}},{key:"formalName",value:function formalName(){return"selectionBox"}}]),SelectionBox}(),src_default_config_defaultConfig={classPrefix:"muze",defClassName:"tooltip-box",parentClassName:"tooltip-parent-container",connectorClassName:"tooltip-connectors",className:"",row:{margin:0},spacing:5,content:{spacing:5,iconContainerSize:10,iconScale:1,iconShape:"circle",iconColor:"#ff0000",rowMargin:"4px 0 4px 0",margin:10,separator:":",className:"tooltip-content-container",parentClassName:"tooltip-content-parent-container"},arrow:{size:10,disabled:!1,defClassName:"tooltip-arrow",className:"",color:"rgba(195,195,195,0.85)"}};__webpack_require__(28);function content_defineProperties(target,props){for(var i=0;i0?(this._config=mergeRecursive(this._config,arguments.length<=0?void 0:arguments[0]),this):this._config}},{key:"update",value:function update(item){return this._model=item.model,this._formatter=item.formatter,this}},{key:"context",value:function context(ctx){return this._context=ctx,this}},{key:"render",value:function render(mount){var data,config=this._config,iconContainerSize=config.iconContainerSize,formatter=this._formatter,rowMargin=config.rowMargin,model=this._model,classPrefix=config.classPrefix;if(this._mount=mount,(data=model instanceof Array?model:formatter(this._model,this.config(),this._context))instanceof Function){makeElement(mount,"div",[1],"".concat(classPrefix,"-tooltip-html-container")).html(data())}else{var content=data,displayFormat="default";isSimpleObject(data)&&(content=data.content,displayFormat=data.displayFormat);var body=makeElement(mount,"div",[displayFormat],"".concat(classPrefix,"-tooltip-content"),{},function(d){return d});if("table"===displayFormat){var table=makeElement(body,"table",[1],"".concat(classPrefix,"-tooltip-table")),tbody=makeElement(table,"tbody",[1],"".concat(classPrefix,"-tooltip-table-tbody")),rows=makeElement(tbody,"tr",content,"".concat(classPrefix,"-tooltip-table-row"));rows.each(function(d,i){renderer_utils_selectElement(this).classed("".concat(classPrefix,"-tooltip-table-row-").concat(i),!0)}),makeElement(rows,"td",function(d){return d},"".concat(classPrefix,"-tooltip-table-cell")).each(function(d){renderer_utils_selectElement(this).html(d)})}else{var _rows=makeElement(body,"div",content,"",{update:function update(elem,elemData){return elem.attr("class",elemData.className)}}),_cells=makeElement(_rows,"span",function(d){return d.data},"".concat(classPrefix,"-tooltip-content"));_cells.attr("class","".concat(classPrefix,"-tooltip-content")),renderer_utils_setStyles(_rows,{margin:rowMargin}),renderer_utils_setStyles(_cells,{display:"inline-block"}),_cells.each(function(d){var el=renderer_utils_selectElement(this);if(el.html(""),d instanceof Object)if("icon"===d.type){var svg=makeElement(el,"svg",[1]),path=makeElement(svg,"path",[1]),shape=d.shape instanceof Function?d.shape:common_utils_getSymbol(d.shape);renderer_utils_setAttrs(svg,{x:0,y:0,width:iconContainerSize,height:iconContainerSize}),renderer_utils_setAttrs(path,{d:shape.size(d.size)(),transform:"translate(".concat(iconContainerSize/2,", ").concat(iconContainerSize/2,")")}),renderer_utils_setStyles(path,{fill:d.color}),renderer_utils_setStyles(svg,{width:"".concat(iconContainerSize,"px"),height:"".concat(iconContainerSize,"px")})}else el.html(d.value),d.className&&el.classed(d.className,!0),renderer_utils_setStyles(el,d.style);else el.html(d)})}}return this}},{key:"clear",value:function clear(){return this._model=null,this}}],[{key:"defaultConfig",value:function defaultConfig(){var config=src_default_config_defaultConfig.content;return config.classPrefix=src_default_config_defaultConfig.classPrefix,config}}]),Content}();function tooltip_defineProperties(target,props){for(var i=0;i0){var defConf=mergeRecursive({},this.constructor.defaultConfig());return this._config=mergeRecursive(defConf,arguments.length<=0?void 0:arguments[0]),this}return this._config}},{key:"addClass",value:function addClass(className){return this._tooltipContainer.classed(className,!0),this}},{key:"context",value:function context(){return arguments.length?(this._context=arguments.length<=0?void 0:arguments[0],this):this._context}},{key:"content",value:function content(name,data){var contentConfig=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},config=this.config(),classPrefix=config.classPrefix,contentClass=config.content.className,formatter=config.formatter,className="".concat(classPrefix,"-").concat(contentClass,"-").concat(name),specificClass="".concat(classPrefix,"-").concat(contentConfig.className),content=this._contents[name]=this._contents[name]||new content_Content,container=makeElement(this._contentContainer,"div",[contentConfig.order],className);container.attr("class","".concat(classPrefix,"-").concat(contentClass," ").concat(className," ").concat(specificClass)),function reorderContainers(parentContainer,className){parentContainer.selectAll(className).sort(function(a,b){return a-b})}(this._contentContainer,".".concat(classPrefix,"-").concat(contentClass));var contentConf=config.content;return contentConfig.classPrefix=this._config.classPrefix,content.config(contentConf),null===data?(content.clear(),container.remove(),delete this._contents[name]):(content.update({model:data,formatter:contentConfig.formatter||formatter}),content.context(this._context),content.render(container)),Object.keys(this._contents).length||this.hide(),this}},{key:"getContents",value:function getContents(){return Object.values(this._contents)}},{key:"position",value:function position(x,y){if(!Object.keys(this._contents).length)return this.hide(),this;this.show();var target=this._target;if(target){var node=this._tooltipContainer.node(),tooltipPos=this._orientation;if("left"===tooltipPos||"right"===tooltipPos?y+node.offsetHeighttarget.y+target.height:x+node.offsetWidthtarget.x+target.width){var path;this._tooltipConnectorContainer.style("display","block");var connector=this._tooltipConnectorContainer.selectAll("path").data([1]),enter=connector.enter().append("path");"left"===tooltipPos?path="M ".concat(x," ").concat(y+node.offsetHeight/2," L ").concat(target.x+target.width)+" ".concat(target.y+target.height/2):"right"===tooltipPos?path="M ".concat(x+node.offsetWidth," ").concat(y+node.offsetHeight/2)+" L ".concat(target.x," ").concat(target.y+target.height/2):"bottom"===tooltipPos&&(path="M ".concat(x+node.offsetWidth/2," ").concat(y+node.offsetHeight)+" L ".concat(target.x+target.width/2," ").concat(target.y)),enter.merge(connector).attr("d",path).style("display","block")}else this._tooltipConnectorContainer.style("display","none")}var offset=this._offset||{x:0,y:0};return this._tooltipContainer.style("left","".concat(offset.x+x,"px")).style("top","".concat(offset.y+y,"px")),this}},{key:"positionRelativeTo",value:function positionRelativeTo(dim){var obj,tooltipConf=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},orientation=tooltipConf.orientation;if(this.show(),!dim)return this.hide(),this;var extent=this._extent,contentContainer=this._contentContainer.node();this._tooltipContainer.style("top","0px").style("left","0px").style("width","2000px").style("height","2000px");var offsetWidth=contentContainer.offsetWidth+4,offsetHeight=contentContainer.offsetHeight+4,config=this._config,offset=this._offset,spacing=config.spacing,draw=void 0===tooltipConf.draw||tooltipConf.draw,topSpace=dim.y,dimX=dim.x+dim.width+offset.x,rightSpace=extent.width-dimX,leftSpace=dim.x+offset.x-extent.x,bottomSpace=extent.height-(dim.y+dim.height+offset.y),arrowSize=spacing,tooltipHeight=offsetHeight+arrowSize,tooltipWidth=offsetWidth+arrowSize,spaces=[{position:"top",value:topSpace-tooltipHeight},{position:"right",value:rightSpace-tooltipWidth},{position:"left",value:leftSpace-tooltipWidth},{position:"bottom",value:bottomSpace-tooltipHeight}],positionHorizontal=function positionHorizontal(positionVal){var position,x=dim.x+dim.width,y=dim.y;return"right"===positionVal?(position="left",x+=arrowSize):"left"===positionVal&&(x=dim.x-offsetWidth,position="right",x-=arrowSize),dim.height0?positionHorizontal(hMax.position):positionVertical(vMax.position);return this._position={x:obj.x,y:obj.y},this._tooltipContainer.style("height","".concat(offsetHeight,"px")).style("width","".concat(offsetWidth,"px")),this._orientation=obj.position,draw&&this.position(obj.x,obj.y),this}},{key:"hide",value:function hide(){return this._tooltipContainer.style("display","none"),this._tooltipConnectorContainer.style("display","none"),this}},{key:"show",value:function show(){return this._tooltipContainer.style("display","block"),this}},{key:"extent",value:function extent(_extent){return this._extent=_extent,this}},{key:"offset",value:function offset(_offset){return this._offset=_offset,this}},{key:"remove",value:function remove(){return this._tooltipContainer.remove(),this._tooltipConnectorContainer.remove(),this}}],[{key:"defaultConfig",value:function defaultConfig(){return src_default_config_defaultConfig}}]),Tooltip}(),HIGHLIGHT_SUMMARY="highlightSummary";function strategies_construct(Parent,args,Class){return(strategies_construct=function strategies_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&strategies_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function strategies_setPrototypeOf(o,p){return(strategies_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function strategies_toConsumableArray(arr){return function strategies_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1;hasMultipleMeasures&&content.push({data:[icon,formattedRetinalValue]});var isSelected=(target&&target[1][target[0].indexOf(retField)])===retinalFieldValue;measuresArr.forEach(function(measure){var measureIndex=fieldsConfig[measure].index,_fieldInf$measure=fieldInf[measure],dName=_fieldInf$measure.displayName,formatterFn=_fieldInf$measure.fn,currentMeasureValue=valueArr[measureIndex],value=formatterFn(currentMeasureValue),keyValue=strategies_getKeyValue({field:hasMultipleMeasures?"".concat(dName).concat(separator):formattedRetinalValue,value:value,classPrefix:classPrefix,margin:hasMultipleMeasures?margin:void 0,isSelected:isSelected,stackedSum:stackedSum,stackedValue:currentMeasureValue instanceof strategies_InvalidAwareTypes?currentMeasureValue.value():currentMeasureValue.toFixed(2),isStackedBar:isStackedBar});hasMultipleMeasures||(keyValue.data=[icon].concat(strategies_toConsumableArray(keyValue.data))),content.push(keyValue)})}};for(var retField in retinalFields)_loop(retField)},strategies_buildTooltipData=function buildTooltipData(dataModel){var nestedDataObj,displayFormat,config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},context=arguments.length>2?arguments[2]:void 0,fieldValues=[],_dataModel$getData=dataModel.getData(),data=_dataModel$getData.data,schema=_dataModel$getData.schema,fieldspace=dataModel.getFieldspace(),fieldsConfig=dataModel.getFieldsConfig(),_context$retinalField=context.retinalFields,color=_context$retinalField.color,shape=_context$retinalField.shape,size=_context$retinalField.size,detailFields=context.detailFields||[],_ref2$showStackSum=(context.config||{}).showStackSum,showStackSum=void 0===_ref2$showStackSum||_ref2$showStackSum,_context$payload$sele=context.payload.selectedMeasures,selectedMeasures=void 0===_context$payload$sele?[]:_context$payload$sele,dimensions=schema.filter(function(d){return d.type===dist_datamodel.FieldType.DIMENSION}),measures=schema.filter(function(d){return d.type===dist_datamodel.FieldType.MEASURE}),containsDetailField=!!common_utils_intersect(schema,detailFields).length,dataLen=data.length,dimensionMeasureMap=context.dimensionMeasureMap,axes=context.axes,fieldInf=function getFieldInf(schema,dataModel,context){var valueParser=context.valueParser,timeDiffs=context.timeDiffs,fieldsObj=dataModel.getFieldspace().fieldsObj(),defFormatter=strategies_formatters(null,null,valueParser)[dist_datamodel.DimensionSubtype.CATEGORICAL];return schema.reduce(function(inf,field){var subtype=field.subtype,name=field.name,type=field.type,interval=subtype===dist_datamodel.DimensionSubtype.TEMPORAL?timeDiffs[name]:0,nf=type===dist_datamodel.FieldType.MEASURE?fieldsObj[name].numberFormat():function(val){return val};return inf[name]={fn:defaultValue(strategies_formatters(nf,interval,valueParser)[subtype],defFormatter),displayName:"".concat(retrieveFieldDisplayName(dataModel,name))},inf},{})}(schema,dataModel,context);if(dataLen>1&&containsDetailField)fieldValues=function getTabularData(dataObj,fieldInf){var rows=[],data=dataObj.data,schema=dataObj.schema;return rows.push(schema.map(function(d){return fieldInf[d.name].displayName})),data.forEach(function(d){var row=[];schema.forEach(function(fieldObj,i){var value=fieldInf[fieldObj.name].fn(d[i]);row.push(value)}),rows.push(row)}),rows}({data:data,schema:schema,fieldspace:fieldspace},fieldInf),displayFormat="table";else{var retinalFields=[color.field,shape.field,size.field].reduce(function(acc,field){return field&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION&&(acc[field]=1),acc},{}),indices=dimensions.filter(function(field){return!retinalFields[field.name]}).map(function(dim){return fieldsConfig[dim.name].index}),allMeasures=strategies_toConsumableArray(strategies_construct(Set,strategies_toConsumableArray(Object.values(dimensionMeasureMap)))),isStacked=function isStackedChart(layers){return layers.some(function(d){return"stack"===d.transformType()})}(context.layers),isStackedBar=function isStackedBarChart(layers){return layers.some(function(d){return"stack"===d.transformType()&&d.config().mark===BAR})}(context.layers),filteredMeasures=isSingleValue(dataLen,isStacked)?measures:measures.filter(function(d){return-1===allMeasures.indexOf(d.name)});!function generateTooltipContent(nestedData){for(var index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,content=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],classPrefix=config.classPrefix,separator=config.separator,i=0,len=nestedData.length;i2&&void 0!==arguments[2]?arguments[2]:{},dataModel=selectionSet&&selectionSet.mergedEnter.model;if(null===payload.criteria||dataModel&&dataModel.isEmpty()||null===selectionSet)return this.hide(options,null),this;var strategy=defaultValue(options.strategy,this._strategy);return this.createTooltip(dataModel,Object.assign({},{payload:payload,selectionSet:selectionSet,strategy:strategy,options:options}),null,0),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips,orientation=this.config().orientation;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var tooltip=tooltips[key],strategy=options.strategy||this._strategy;tooltip.content(strategy,null),Object.keys(tooltip._contents).length?tooltip.positionRelativeTo(tooltip._target,{orientation:orientation}):tooltip.hide()}}},{key:"getPlotPointsFromIdentifiers",value:function getPlotPointsFromIdentifiers(payload){var target=payload.target,targetFields=[];if(target){targetFields=target[0]||[];for(var sourceFields=payload.sourceFields,indices=[],i=0,len=targetFields.length;i1&&void 0!==arguments[1]?arguments[1]:{},plotDim=arguments.length>2?arguments[2]:void 0,key=arguments.length>3?arguments[3]:void 0,drawingInf=this.drawingContext(),sourceInf=this.sourceInfo(),config=this.config(),strategy=props.strategy,payload=props.payload,selectionSet=props.selectionSet;plotDim=(plotDim=defaultValue(plotDim,this.getPlotPointsFromIdentifiers(payload)))&&plotDim[0];var pad=config.padding,showInPosition=payload.showInPosition,tooltipPos=payload.position,_config$strategy=config[strategy],projectFields=_config$strategy.fields,dataTransform=_config$strategy.dataTransform,strategyFn=this._strategies[strategy],dt=dataTransform(dataModel,projectFields,this),layoutContainer=drawingInf.parentContainer,parentContainerDimensions=drawingInf.parentContainerDimensions,layoutBoundBox=layoutContainer.getBoundingClientRect(),unitBoundBox=drawingInf.htmlContainer.getBoundingClientRect(),offsetLeft=unitBoundBox.left-layoutBoundBox.left,offsetTop=unitBoundBox.top-layoutBoundBox.top,tooltipInst=this._tooltips[key]=this._tooltips[key]||new tooltip_Tooltip(layoutContainer,drawingInf.svgContainer);Object.assign(sourceInf,{payload:payload,firebolt:this.firebolt,detailFields:[],timeDiffs:sourceInf.timeDiffs,valueParser:this.valueParser(),selectionSet:selectionSet,config:config[strategy]}),tooltipInst.context(sourceInf),tooltipInst.content(strategy,dt,{formatter:strategyFn,order:config[strategy].order,className:config[strategy].className}).config(this.config()).extent({x:0,y:0,width:parentContainerDimensions.width,height:parentContainerDimensions.height}).offset({x:offsetLeft+(config.offset.x||0),y:offsetTop+(config.offset.y||0)}),showInPosition?tooltipInst.position(tooltipPos.x+pad,tooltipPos.y+pad):plotDim?tooltipInst.positionRelativeTo({x:plotDim.x,y:plotDim.y,width:plotDim.width||0,height:plotDim.height||0},{orientation:config.orientation}):tooltipInst.hide()}}],[{key:"defaultConfig",value:function defaultConfig(){return{padding:5,offset:{x:0,y:0},highlightSummary:{order:1,dataTransform:function dataTransform(dm,fields){return fields?dm.project(fields,{saveChild:!1}):dm}},selectionSummary:{order:0,dataTransform:function dataTransform(dm){return dm}}}}},{key:"formalName",value:function formalName(){return side_effects_TOOLTIP}},{key:"target",value:function target(){return"all"}}]),Tooltip}();function fragmented_tooltip_typeof(obj){return(fragmented_tooltip_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fragmented_tooltip_toConsumableArray(arr){return function fragmented_tooltip_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);idrawingInf.height:totalWidth>drawingInf.width)break;position&&boxes.push({x:position.x,y:position.y,width:tooltipBoundBox.width,height:tooltipBoundBox.height,tooltip:tooltipInst})}for(var key in tooltips)if(!enter[key]){var tooltip=tooltips[key];tooltip.content(strategy,null),tooltip.getContents().length||(tooltip.remove(),delete tooltips[key])}return boxes.length&&function spaceOutBoxes(boxes,extent,showVertically){var y,height,x,width,i,len=boxes.length,spaceOutIfOverlap=function spaceOutIfOverlap(firstBox,secondBox,opposite){x=firstBox.x,width=firstBox.width,y=firstBox.y,height=firstBox.height;var bottom=y+height,right=x+width;showVertically?(opposite?ysecondBox.y)&&(secondBox.y=opposite?firstBox.y-secondBox.height-5:bottom+5):(opposite?xsecondBox.x)&&(secondBox.x=opposite?firstBox.x-secondBox.width-5:right+5)};for(boxes.sort(function(a,b){return showVertically?a.y-b.y:a.x-b.x}),i=0,i=0;iextent.height||boxes[i].x+boxes[i].width>extent.width)for(showVertically?boxes[i].y-=boxes[i].height+boxes[i].y-extent.height:boxes[i].x-=boxes[i].width+boxes[i].x-extent.width,i=len-1;i>0;i--)spaceOutIfOverlap(boxes[i],boxes[i-1],!0)}(boxes,boundBox,showVertically),boxes.forEach(function(box){return box.tooltip.position(box.x,box.y,{repositionArrow:!0})}),this}},{key:"hide",value:function hide(options){var tooltips=this._tooltips;for(var key in tooltips)if({}.hasOwnProperty.call(tooltips,key)){var strategy=options.strategy||this._strategy;tooltips[key].content(strategy,null),tooltips[key].hide()}}}],[{key:"formalName",value:function formalName(){return FRAGMENTED_TOOLTIP}}]),FragmentedTooltip}();__webpack_require__(30);function crossline_typeof(obj){return(crossline_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function crossline_toConsumableArray(arr){return function crossline_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]&&arguments[2]?common_utils_intersect:difference)(set.uids,selectedPointsId,[function(d){return d[0]},function(d){return d[0]}]);return function helper_objectSpread(target){for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:[];return excludeSet instanceof Function?excludeSet(this.firebolt.getEntryExitSet):excludeSet.reduce(function(acc,behaviour){var selectedPointsIds=((_this2.firebolt.getEntryExitSet(behaviour)||{}).mergedEnter||{}).uids;return selectedPointsIds&&acc.push.apply(acc,plot_highlighter_toConsumableArray(selectedPointsIds)),acc},[])}},{key:"apply",value:function apply(selectionSet,payload){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},currentStrategy=this._strategies[options.strategy||this._strategy],excludeSetIds=this.getExcludeSetIds(options.excludeSet);return currentStrategy({selectionSet:selectionSet,formattedSet:function plot_highlighter_objectSpread(target){for(var i=1;i3&&void 0!==arguments[3]?arguments[3]:[],propPayload=propConfig.payload,sourceIdentifiers=propConfig.sourceIdentifiers,excludeSelectedMeasures=propConfig.excludeSelectedMeasures,dataObj=selectionDataModel.getData({withUid:!0}),payload=Object.assign({},propPayload),data=dataObj.data,fieldsConfig=Object.assign({},selectionDataModel.getFieldsConfig(),function payload_generator_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},reserved_fields.ROW_ID,{index:Object.keys(selectionDataModel.getFieldsConfig()).length,def:{type:dist_datamodel.FieldType.DIMENSION}})),selectionSetFields=instance._selectionSet[propConfig.action]._fields;return sourceIdentifiers?function(){for(var _facetByFields=payload_generator_slicedToArray(facetByFields,2),_facetByFields$=_facetByFields[0],facetFields=void 0===_facetByFields$?[]:_facetByFields$,_facetByFields$2=_facetByFields[1],facetValues=void 0===_facetByFields$2?[]:_facetByFields$2,facetIndices=facetFields.reduce(function(acc,v,i){return acc[v]=i,acc},{}),identifierIdxMap=sourceIdentifiers.fields.reduce(function(acc,v,i){return acc[v.name]=i,acc},{}),identifiers=sourceIdentifiers.identifiers.slice(1,sourceIdentifiers.identifiers.length),sourceIdentifierFields=sourceIdentifiers.fields.filter(function(d){return d.name in fieldsConfig||d.name in facetIndices||d.name===reserved_fields.ROW_ID}),identifierMap=identifiers.reduce(function(acc,v){var key=sourceIdentifierFields.map(function(d){return v[identifierIdxMap[d.name]]}),measureNamesIdx=identifierIdxMap[reserved_fields.MEASURE_NAMES];return measureNamesIdx&&(!acc[key]&&(acc[key]=[]),acc[key].push([v[measureNamesIdx]])),acc},{}),dataArr=[],_loop=function _loop(i,len){var row=data[i],dims=[];selectionSetFields.forEach(function(field){if(fieldsConfig[field]&&fieldsConfig[field].def.type===dist_datamodel.FieldType.DIMENSION){var idx=fieldsConfig[field].index;dims.push(row[idx])}});var vals="".concat(sourceIdentifierFields.map(function(d){return d.name in fieldsConfig?row[fieldsConfig[d.name].index]:d.name in facetIndices?facetValues[facetIndices[d.name]]:null}).filter(function(d){return null!==d}));if(vals in identifierMap){var measures=identifierMap[vals],allMeasures=instance._metaData.dimensionsMap[dims];if(excludeSelectedMeasures){var fn=function fn(v){return"".concat(v)};difference(allMeasures,measures,[fn,fn]).forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}else measures.forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}else{var _measures=instance._metaData.dimensionsMap[dims];(_measures=_measures&&_measures.length?_measures:[[]]).forEach(function(measureArr){dataArr.push([].concat(dims,[measureArr]))})}},i=0,len=data.length;i3&&void 0!==arguments[3]?arguments[3]:[];return payloadGenerator.__default(instance,selectionDataModel,Object.assign({},{excludeSelectedMeasures:!0},propConfig),facetByFields)}};function firebolt_helper_toConsumableArray(arr){return function firebolt_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&void 0!==arguments[2]?arguments[2]:{},obj=function getUniqueKeys(data,dimensions,_ref2){var layers=_ref2.layers,uids=_ref2.uids,_ref2$keys=_ref2.keys,keys=void 0===_ref2$keys?{}:_ref2$keys,_ref2$dimensionsMap=_ref2.dimensionsMap,dimensionsMap=void 0===_ref2$dimensionsMap?{}:_ref2$dimensionsMap;return data.forEach(function(row,i){var key=dimensions.length?dimensions.map(function(d){return row[d.index]}):[uids[i]];layers.forEach(function(layer){var measureNames=Object.keys(layer.data().getFieldspace().getMeasure()),mKey="".concat([key].concat(firebolt_helper_toConsumableArray(measureNames)));keys[mKey]=defaultValue(keys[mKey],{}),keys[mKey]={dims:key,measureNames:measureNames,uid:uids[i]},dimensionsMap[key]=defaultValue(dimensionsMap[key],[]),dimensionsMap[key].push(measureNames)})}),{keys:keys,dimensionsMap:dimensionsMap}}(data,dimensions,{layers:layers,uids:uids,keys:maps.keys,dimensionsMap:maps.dimensionsMap});return{keys:obj.keys,dimensionsMap:obj.dimensionsMap}},helper_sanitizePayloadCriteria=function sanitizePayloadCriteria(data,propFields,_ref4){var dm=_ref4.dm,dimensionsMap=_ref4.dimensionsMap,dimsMapGetter=_ref4.dimsMapGetter,fieldsConfig=Object.assign({},dm.getFieldsConfig(),function firebolt_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},reserved_fields.ROW_ID,{index:Object.keys(dm.getFieldsConfig()).length,def:{name:reserved_fields.ROW_ID,type:dist_datamodel.FieldType.DIMENSION}}));if(null===data)return null;if(isSimpleObject(data))return Object.keys(data).reduce(function(acc,v){return(v in fieldsConfig||v===reserved_fields.MEASURE_NAMES)&&(acc[v]=data[v]),acc},{});for(var criteriaFields=data[0],fields=criteriaFields.length?criteriaFields.map(function(d,i){return{name:d,index:i}}):[],fieldIndexMap=fields.reduce(function(acc,v,i){return acc[v.name]=i,acc},{}),dataWithFacets=[propFields=propFields||fields.map(function(d){return d.name})],measureNameField=criteriaFields.find(function(field){return field===reserved_fields.MEASURE_NAMES}),propDims=fields.filter(function(d){return d.name in fieldsConfig}).map(function(d){return d.name}),dimsMap=dimsMapGetter(propDims,fieldsConfig),_loop=function _loop(i,len){var row=data[i],dimKey=propDims.map(function(field){return row[fieldIndexMap[field]]}),origRow=dimsMap[dimKey];origRow&&origRow.forEach(function(rowVal){var newRowVal=[];(propFields.forEach(function(field){if(field in fieldIndexMap){var idx=fieldIndexMap[field];newRowVal.push(row[idx])}else{var _idx=getObjProp(fieldsConfig[field],"index");void 0!==_idx&&newRowVal.push(rowVal[_idx])}}),measureNameField)?dataWithFacets.push(newRowVal):(dimensionsMap[newRowVal].length?dimensionsMap[newRowVal]:[[]]).forEach(function(measures){dataWithFacets.push([].concat(newRowVal,firebolt_helper_toConsumableArray(measures)))})})},i=1,len=data.length;i1&&void 0!==arguments[1]?arguments[1]:{},points=[],parsedIdentifiers=identifiers;if(null===identifiers)return[];var layers=this.layers(),len=layers.length;isSimpleObject(identifiers)&&(parsedIdentifiers=[Object.keys(identifiers)],parsedIdentifiers=[].concat(visual_unit_toConsumableArray(parsedIdentifiers),visual_unit_toConsumableArray(transposeArray(Object.values(identifiers)))));for(var i=0;iydom[0]?ydom:xdom,max=min===ydom?xdom:ydom;min[1]0&&(dimensionArr[0]=[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),dimensionArr[1]=[]),{fields:dimensionArr.map(function(list,i){return 1===i?measureArr[i].concat(dimensionArr[i]):dimensionArr[i].concat(measureArr[i])}),dimensions:[].concat(field_sanitizer_toConsumableArray(dimensionArr[0]),field_sanitizer_toConsumableArray(dimensionArr[1])),measures:[].concat(field_sanitizer_toConsumableArray(measureArr[0]),field_sanitizer_toConsumableArray(measureArr[1])),temporal:[].concat(field_sanitizer_toConsumableArray(temporalArr[0]),field_sanitizer_toConsumableArray(temporalArr[1])),categorical:[].concat(field_sanitizer_toConsumableArray(categoricalArr[0]),field_sanitizer_toConsumableArray(categoricalArr[1]))}}(norFields,fields)}),2),rowsInfo=_map2[0],columnsInfo=_map2[1],rows=rowsInfo.fields,rowDimensions=rowsInfo.dimensions,rowMeasures=rowsInfo.measures,rowTemporalFields=rowsInfo.temporal,rowCategoricalFields=rowsInfo.categorical,columns=columnsInfo.fields,columnDimensions=columnsInfo.dimensions,columnMeasures=columnsInfo.measures;return{rows:rows,rowDimensions:rowDimensions,rowMeasures:rowMeasures,rowTemporalFields:rowTemporalFields,rowCategoricalFields:rowCategoricalFields,columns:columns,columnTemporalFields:columnsInfo.temporal,columnCategoricalFields:columnsInfo.categorical,columnDimensions:columnDimensions,columnMeasures:columnMeasures}},BORDER_WIDTH={default:2,facet:1},cell_border_applier_handleBlankCell=function handleBlankCell(data){data.config().externalClassname.push("".concat(NONE,"-").concat(constants_LEFT)),data.config().externalClassname.push("".concat(NONE,"-").concat(constants_RIGHT))},cell_border_applier_sanitiseHeaderMatrix=function sanitiseHeaderMatrix(matrices,header){if(header)for(var i=0;i1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return"".concat(axisName,"-axis-").concat(params.join("-"))},getCellKey=function getCellKey(rowId,columnId){return"cell-".concat(rowId,"-").concat(columnId)},group_utils_extractUnitConfig=function extractUnitConfig(config){var unitConfig={};return[INTERACTION,GRID_LINES,GRID_BANDS].forEach(function(attr){void 0!==config[attr]&&(unitConfig[attr]=config[attr])}),unitConfig},hasOneField=function hasOneField(fields){return Object.keys(fields).some(function(d){return fields[d].length>0})},getHeaderText=function getHeaderText(headers,index,rowLength){var header="";if(index===rowLength-1&&headers.length>rowLength){for(var i=index;i0?fields[0].map(function(cell,i){return new TextCell({type:HEADER,className:"".concat(classPrefix,"-grid-headers")},{labelManager:labelManager}).source(getHeaderText(fieldHeaders,i,fields[0].length)).config({show:cell.config().show})}):[];return cell_border_applier_sanitiseHeaderMatrix(headers,!0),headers},group_utils_findInGroup=function findInGroup(variable,allFields){var channel=null;return[enums_constants_COLOR,enums_constants_SIZE,enums_constants_SHAPE].forEach(function(e){group_utils_this.store.get(e)&&variable===group_utils_this.store.get(e)[0]&&(channel=e)}),channel?{channel:channel}:([ROW,COL].forEach(function(facetType){allFields["".concat(facetType,"Facets")].forEach(function(e){e.toString()===variable&&(channel={channel:FACET,type:facetType===COL?COLUMN:ROW})})}),channel||([ROW,COL].forEach(function(projType){allFields["".concat(projType,"Projections")].forEach(function(e){e.forEach(function(m){m.toString()===variable&&(channel=projType===COL?X:Y)})})}),channel?{channel:channel}:null))},group_utils_getAxisType=function getAxisType(fieldsConfig,field){var fieldType=enums_constants_ORDINAL;return field&&fieldsConfig[field].def.type!==DIMENSION&&(fieldType=enums_constants_LINEAR),fieldType},retriveDomainFromData=function retriveDomainFromData(datamodel,fieldName){return datamodel.getFieldspace().fields.find(function(d){return d.name()===fieldName.toString()}).domain()},mutateAxesFromMap=function mutateAxesFromMap(cacheMaps,axes){var xAxes=null,yAxes=null,xAxesMap=cacheMaps.xAxesMap,yAxesMap=cacheMaps.yAxesMap,xAxisSet=axes.x,yAxisSet=axes.y;return xAxisSet&&xAxisSet.forEach(function(axisId){var xAxis=xAxesMap.get(axisId);(xAxes=xAxes||[]).push(xAxis)}),yAxisSet&&yAxisSet.forEach(function(axisId){var yAxis=yAxesMap.get(axisId);(yAxes=yAxes||[]).push(yAxis)}),{xAxes:xAxes,yAxes:yAxes}},group_utils_getEncoder=function getEncoder(layers){var encoder=new cartesian_encoder_CartesianEncoder;return layers.length&&(encoder=layers.some(function(layerConf){return function hasPolarEncodings(layerConf){return layerConf.mark===ARC||[enums_constants_RADIUS,enums_constants_ANGLE].some(function(field){return getObjProp(layerConf.encoding,field)})}(layerConf)})?new polar_encoder_PolarEncoder:encoder),encoder},group_utils_getHeaderAxisFrom=function getHeaderAxisFrom(type,fields,userAxisFromConfig){var axisFrom=userAxisFromConfig[type],headerFrom="",options=type===ROW?[constants_LEFT,constants_RIGHT]:[enums_constants_BOTTOM,enums_constants_TOP],_fields=group_utils_slicedToArray(fields,2),firstField=_fields[0],secondField=_fields[1],firstFieldType=function firstFieldType(i){return firstField.length?firstField[i].type():null},secondFieldType=function secondFieldType(i){return secondField.length?secondField[i].type():null};return firstFieldType(firstField.length-1)===DIMENSION&&secondFieldType(0)===DIMENSION?(headerFrom=axisFrom?options[1-options.indexOf(axisFrom)]:options[1],axisFrom=type===COLUMN&&firstField[firstField.length-1].toString()===secondField[0].toString()?enums_constants_TOP:axisFrom||options[0]):secondFieldType(secondField.length-1)===DIMENSION?(headerFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM,axisFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM):(headerFrom=type===ROW?constants_LEFT:enums_constants_TOP,axisFrom=type===ROW?constants_LEFT:enums_constants_TOP),firstFieldType(firstField.length-1)===MEASURE&&secondFieldType(0)===MEASURE?axisFrom=type===ROW?constants_LEFT:enums_constants_TOP:secondFieldType(0)===MEASURE?axisFrom=type===ROW?constants_RIGHT:enums_constants_BOTTOM:firstFieldType(firstField.length-1)===MEASURE&&(axisFrom=type===ROW?constants_LEFT:enums_constants_TOP),[headerFrom,axisFrom]},setFacetsAndProjections=function setFacetsAndProjections(context,fieldInfo,encoder){var fields=fieldInfo.fields,type=fieldInfo.type,_encoder$simpleEncode=encoder.simpleEncoder.getFacetsAndProjections(fields,type),facets=_encoder$simpleEncode.facets,projections=_encoder$simpleEncode.projections;return context.facets(group_utils_defineProperty({},"".concat(type,"Facets"),facets)),context.projections(group_utils_defineProperty({},"".concat(type,"Projections"),projections)),{facets:facets,projections:projections,fields:fields}},getBorders=function getBorders(matrices,encoder){var showRowBorders={top:!1,bottom:!1},showColBorders={left:!1,right:!1},showValueBorders={top:!1,bottom:!1,left:!1,right:!1},rows=matrices.rows,columns=matrices.columns,valueMatrix=matrices.values,_rows=group_utils_slicedToArray(rows,2),leftRows=_rows[0],rightRows=_rows[1],_columns=group_utils_slicedToArray(columns,2),topColumns=_columns[0],bottomColumns=_columns[1],_encoder$fieldInfo=encoder.fieldInfo(),rowDimensions=_encoder$fieldInfo.rowDimensions,columnDimensions=_encoder$fieldInfo.columnDimensions,rowTemporalFields=_encoder$fieldInfo.rowTemporalFields,columnTemporalFields=_encoder$fieldInfo.columnTemporalFields,columnMeasures=_encoder$fieldInfo.columnMeasures,rowMeasures=_encoder$fieldInfo.rowMeasures,allDimensionLength=rowDimensions.length+columnDimensions.length,allMeasuresLength=rowMeasures.length+columnMeasures.length,allTemporalFieldsLength=rowTemporalFields.length+columnTemporalFields.length;if(encoder.constructor.type()===group_utils_POLAR){if(!allDimensionLength)return{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}}else if(!allMeasuresLength&&!allTemporalFieldsLength&&allDimensionLength<=2)return{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders};return showRowBorders=function getRowBorders(left,right){var borders={top:!1,bottom:!1};return(left.length>1||right.length>1)&&(borders.top=!0,borders.bottom=!0),borders}(leftRows,rightRows),showColBorders=function getColumnsBorders(top,bottom){var borders={left:!1,right:!1};return(top.length||bottom.length)&&(top[0]&&top[0].length>1||bottom[0]&&bottom[0].length>1)&&(borders.left=!0,borders.right=!0),borders}(topColumns,bottomColumns),showValueBorders=function getValueBorders(rows,columns){var borders={top:!0,left:!0,bottom:!0,right:!0},borderTypeRow=[constants_LEFT,constants_RIGHT],borderTypeCol=[enums_constants_TOP,enums_constants_BOTTOM];return rows.forEach(function(e,i){e[0]&&e[0].length?borders[borderTypeRow[i]]=!0:borders[borderTypeRow[i]]=!1}),columns.forEach(function(e,i){e.length?borders[borderTypeCol[i]]=!0:borders[borderTypeCol[i]]=!1}),borders}([leftRows,rightRows],[topColumns,bottomColumns]),valueMatrix.length>1&&(showValueBorders.top=!0,showValueBorders.bottom=!0),valueMatrix.length&&valueMatrix[0].length>1&&(showValueBorders.left=!0,showValueBorders.right=!0),{showRowBorders:showRowBorders,showColBorders:showColBorders,showValueBorders:showValueBorders}},getFieldsFromSuppliedLayers=function getFieldsFromSuppliedLayers(suppliedLayerConfig){var _ref3,encodingArr=suppliedLayerConfig.map(function(conf){return conf.encoding||{}}),fields=(_ref3=[]).concat.apply(_ref3,group_utils_toConsumableArray(encodingArr.map(function(enc){return Object.values(enc).map(function(d){return"object"===group_utils_typeof(d)?d.field:d})})));return group_utils_toConsumableArray(new Set(fields.filter(function(d){return d})))},group_utils_extractFields=function extractFields(facetsAndProjections,layerFields){var _ref6,fields=Object.values(facetsAndProjections).map(function(arr){var _ref4,_ref5,flattenArray=(_ref4=[]).concat.apply(_ref4,group_utils_toConsumableArray(arr));return(_ref5=[]).concat.apply(_ref5,group_utils_toConsumableArray(flattenArray.map(function(field){return field instanceof variable_Variable?field.getMembers():field})))});return(_ref6=[]).concat.apply(_ref6,group_utils_toConsumableArray(fields).concat(group_utils_toConsumableArray(layerFields)))},group_utils_sortFacetFields=function sortFacetFields(facets,keys,config){var schema=[],facetNames=[],sortInfo=[],sortConfig=config.sort;return facets.forEach(function(facet){var name="".concat(facet);facetNames.push(name);var facetSortConfig=sortConfig[name];facetSortConfig?sortInfo.push([name,facetSortConfig]):sortInfo.push([name,null]),schema.push(facet.getSchemaDef())}),new datamodel_default.a([facetNames].concat(group_utils_toConsumableArray(keys)),schema).getData({sort:sortInfo}).data},group_utils_removeExitCells=function removeExitCells(resolver){var _ref7,exitCells=resolver.cacheMaps().exitCellMap,store=resolver.store(),qualifiedStateProps=(_ref7=[]).concat.apply(_ref7,group_utils_toConsumableArray(visual_unit_VisualUnit.getQualifiedStateProps()).concat(group_utils_toConsumableArray(base_layer_BaseLayer.getQualifiedStateProps())));store.lockCommits(qualifiedStateProps),exitCells.forEach(function(placeholder){placeholder.remove()}),store.unlockCommits(qualifiedStateProps)},encoder_props_PROPS={layers:{},data:{},globalConfig:{}};function visual_encoder_slicedToArray(arr,i){return function visual_encoder_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function visual_encoder_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function visual_encoder_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function visual_encoder_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},fields=arguments.length>1?arguments[1]:void 0,_getHeaderAxisFrom2=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(ROW,fields.rows,axisFrom),2),rowHeader=_getHeaderAxisFrom2[0],rowAxis=_getHeaderAxisFrom2[1],_getHeaderAxisFrom4=visual_encoder_slicedToArray(group_utils_getHeaderAxisFrom(COLUMN,fields.columns,axisFrom),2),colHeader=_getHeaderAxisFrom4[0],colAxis=_getHeaderAxisFrom4[1];return this.axisFrom({row:rowAxis,column:colAxis}),this.headerFrom({row:rowHeader,column:colHeader}),this}},{key:"getProjectionFields",value:function getProjectionFields(layers){return getFieldsFromSuppliedLayers(layers)}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){return hasOneField(fields)}}]),VisualEncoder}(),scaleMaps={linear:continous_axis_ContinousAxis,band:band_axis_BandAxis,temporal:time_axis_TimeAxis,size:size_axis_SizeAxis,color:color_axis_ColorAxis,shape:shape_axis_ShapeAxis};function matrix_model_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function matrix_model_objectSpread(target){for(var i=1;i1){var facetsUserConfig=config.facetsUserConfig,border=config.border,isBorderPresent=facetsUserConfig.isBorderPresent,isGridLinePresent=facetsUserConfig.isGridLinePresent,gridLinesShowLength=Object.keys(isGridLinePresent).length,borderWidth=border.width,gridLines={};isBorderPresent||(borderWidth=BORDER_WIDTH[FACET]),gridLinesShowLength<=0&&(gridLines={x:{show:!1}}),conf={border:{width:borderWidth},gridLines:gridLines}}return conf}(facetInfo,projectionInfo,globalConfig);globalConfig=mergeRecursive(globalConfig,defaultConfig);var generalContext={matrix:matrix,geomCellCreator:geomCellCreator,projectionInfo:projectionInfo,splitModelsHashMap:splitModelsHashMap,colKeys:colKeys};if(rowKeys.length)rowKeys.forEach(function(rowKeyObj){var rowIndex=function createRowDataModels(rowContext,fieldInfo,sourceDM){var currentColumnIndex=0,rowIndexForCurrentKey=0,colKeys=rowContext.colKeys,rowKeyObj=rowContext.rowKeyObj,currentRowIndex=rowContext.currentRowIndex,newRowIndex=currentRowIndex,colContext=matrix_model_objectSpread({},rowContext,{rowKeyArr:rowKeyObj.keyArr,rowKey:rowKeyObj.joinedKey,newRowIndex:newRowIndex});if(rowIndexForCurrentKey=currentRowIndex,colKeys.length)colKeys.forEach(function(colKeyObj){colContext.colKeyObj=colKeyObj,colContext.currentColumnIndex=currentColumnIndex;var _createColumnDataMode=matrix_model_createColumnDataModels(colContext,fieldInfo,sourceDM),columnIndex=_createColumnDataMode.columnIndex,rowIndex=_createColumnDataMode.rowIndex;currentColumnIndex=columnIndex,rowIndexForCurrentKey=rowIndex});else{colContext.colKeyObj={keyArr:[],joinedKey:""},colContext.currentColumnIndex=currentColumnIndex;var _createColumnDataMode2=matrix_model_createColumnDataModels(colContext,fieldInfo,sourceDM),columnIndex=_createColumnDataMode2.columnIndex,rowIndex=_createColumnDataMode2.rowIndex;currentColumnIndex=columnIndex,rowIndexForCurrentKey=rowIndex}return{rowIndex:++rowIndexForCurrentKey}}(matrix_model_objectSpread({},generalContext,{rowKeyObj:rowKeyObj,currentRowIndex:currentRowIndex}),fieldInfo,dataModel).rowIndex;currentRowIndex=rowIndex});else if(colKeys.length){var currentColumnIndex=0,newRowIndex=currentRowIndex;colKeys.forEach(function(colKeyObj){var colContext=matrix_model_objectSpread({},generalContext,{rowKeyArr:[],rowKey:"",colKeyObj:colKeyObj,newRowIndex:newRowIndex,currentColumnIndex:currentColumnIndex}),_createColumnDataMode3=matrix_model_createColumnDataModels(colContext,fieldInfo,dataModel),columnIndex=_createColumnDataMode3.columnIndex,rowIndex=_createColumnDataMode3.rowIndex;currentRowIndex=rowIndex,currentColumnIndex=columnIndex})}else{var _currentColumnIndex=0,colContext=matrix_model_objectSpread({},generalContext,{rowKeyArr:[],rowKey:"",colKeyObj:{keyArr:[],joinedKey:""},newRowIndex:currentRowIndex,currentColumnIndex:_currentColumnIndex}),_createColumnDataMode4=matrix_model_createColumnDataModels(colContext,fieldInfo,dataModel),columnIndex=_createColumnDataMode4.columnIndex,rowIndex=_createColumnDataMode4.rowIndex;currentRowIndex=rowIndex,_currentColumnIndex=columnIndex}var formattedColKeys=formatKeys(colKeys.map(function(e){return e.keyArr}),colFacets.map(function(facetField){return facetField.rawFormat()}));return{matrix:matrix,rowKeys:formatKeys(rowKeys.map(function(e){return e.keyArr}),rowFacets.map(function(facetField){return facetField.rawFormat()})),columnKeys:formattedColKeys.length>0?formattedColKeys[0].map(function(col,i){return formattedColKeys.map(function(row){return row[i]})}):formattedColKeys}};function cell_creator_slicedToArray(arr,i){return function cell_creator_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function cell_creator_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function cell_creator_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function cell_creator_toConsumableArray(arr){return function cell_creator_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?rowProjections.length:1):(keys=columnKeys,length=colProjections.length>0?colProjections.length:1),keys=keys.map(function(arr){return arr.map(function(val){return resolver.valueParser()(val)})}),section.length&&headerFrom===type&&axis&&keys.length){var hContext={axis:axis,length:length,type:type},headers=[];index<2?(hContext.keys=keys,hContext.facet=facet.rows,headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)):(hContext.facet=facet.columns,hContext.keys=keys[0].map(function(key,i){return keys.map(function(e){return e[i]})}),headers=cell_creator_headerPlaceholderGn(hContext,selectionObj,cells,labelManager)),selectionObj["".concat(type,"Headers")]=headers}else selectionObj["".concat(type,"Headers")]=null}),selectionObj},cell_creator_getAxisFields=function getAxisFields(projections){var fieldHolder=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return projections.reduce(function(acc,item){return[].concat(cell_creator_toConsumableArray(acc),cell_creator_toConsumableArray(item.reduce(function(ac,field){return field instanceof simple_var_SimpleVariable?[].concat(cell_creator_toConsumableArray(ac),[field.oneVar()]):ac},[])))},fieldHolder)},cell_creator_transformDataModel=function transformDataModel(dataModel,config,resolver){var groupedModel,fieldsConfig=dataModel.getFieldsConfig(),resolvedData=resolver.data(),groupBy=config.groupBy,suppliedLayers=config.suppliedLayers,facetsAndProjections=config.facetsAndProjections;resolvedData instanceof datamodel_default.a&&resolvedData.dispose();var fields=getFieldsFromSuppliedLayers(suppliedLayers).filter(function(field){return getObjProp(fieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),allFields=group_utils_extractFields(facetsAndProjections,fields);if(groupedModel=dataModel.project(allFields),resolver.data(groupedModel),!groupBy.disabled){var newFieldsConfig=groupedModel.getFieldsConfig(),dimensions=allFields.filter(function(field){return getObjProp(newFieldsConfig,field,"def","type")===dist_datamodel.FieldType.DIMENSION}),aggregationFns=groupBy.measures,measureNames=Object.keys(groupedModel.getFieldspace().getMeasure()),nearestAggFns=common_utils_retrieveNearestGroupByReducers.apply(void 0,[groupedModel].concat(cell_creator_toConsumableArray(measureNames))),resolvedAggFns=mergeRecursive(nearestAggFns,aggregationFns);groupedModel=groupedModel.groupBy(dimensions.length?dimensions:[""],resolvedAggFns)}return groupedModel=function sortDmTemporalFields(resolver,datamodel){var axisFields=[],projections=resolver.projections();axisFields=cell_creator_getAxisFields(projections.rowProjections,cell_creator_getAxisFields(projections.colProjections));var fieldConfig=datamodel.getFieldsConfig(),temporalFields=axisFields.reduce(function(acc,field){return fieldConfig[field].def.subtype===constants_TEMPORAL?[].concat(cell_creator_toConsumableArray(acc),[[field]]):acc},[]);return temporalFields.length?datamodel.sort(temporalFields,{saveChild:!0}):datamodel}(resolver,groupedModel),resolver.transformedData(groupedModel),groupedModel},cell_creator_computeMatrices=function computeMatrices(resolverConfig){var datamodel=resolverConfig.datamodel,encoders=resolverConfig.encoders,resolver=resolverConfig.resolver,globalConfig=resolverConfig.globalConfig,selection=resolverConfig.selection,transform=resolverConfig.transform,componentRegistry=resolverConfig.componentRegistry,groupBy=resolverConfig.groupBy,labelManager=resolverConfig.labelManager,fieldMap=resolverConfig.fieldMap,layerConfig=resolverConfig.layerConfig,registry=resolverConfig.registry,normalizedRows=resolverConfig.normalizedRows,normalizedColumns=resolverConfig.normalizedColumns,otherEncodings=resolverConfig.otherEncodings,facetsAndProjections=resolverConfig.facetsAndProjections,simpleEncoder=resolverConfig.simpleEncoder,config=resolverConfig.config,rowFacets=facetsAndProjections.rowFacets,colFacets=facetsAndProjections.colFacets,colProjections=facetsAndProjections.colProjections,isProjection=facetsAndProjections.rowProjections.length>0||colProjections.length>0,isFacet=rowFacets.length>0||colFacets.length>0;isFacet&&(globalConfig.isFacet=!0);var matrixGnContext={normalizedColumns:normalizedColumns,normalizedRows:normalizedRows,facetsAndProjections:facetsAndProjections,layers:layerConfig,fieldMap:fieldMap,otherEncodings:otherEncodings,encoders:encoders,facet:globalConfig.facet||{},axisFrom:globalConfig.axisFrom||{},selection:selection,resolver:resolver},cells={GeomCell:resolver.getCellDef(registry.cells.GeomCell),AxisCell:resolver.getCellDef(registry.cells.AxisCell),BlankCell:resolver.getCellDef(registry.cells.BlankCell),TextCell:resolver.getCellDef(registry.cells.TextCell)},isRowSizeEqual=group_utils_isDistributionEqual(normalizedRows),isColumnSizeEqual=group_utils_isDistributionEqual(normalizedColumns);resolver.colCells({}),resolver.rowCells({}),resolver.datamodelTransform(transform||{}),resolver.resetSimpleAxes();var newCacheMap={exitCellMap:resolver.cacheMaps().entryCellMap,entryCellMap:new Map};resolver.cacheMaps(newCacheMap);var valueCellContext={config:globalConfig,suppliedLayers:simpleEncoder.serializeLayerConfig(resolver.layerConfig()),resolver:resolver,cell:cells.GeomCell,encoder:simpleEncoder,newCacheMap:newCacheMap,detailFields:config.detail,retinalConfig:{color:config.color,size:config.size,shape:config.shape}},groupedModel=cell_creator_transformDataModel(datamodel,{facetsAndProjections:facetsAndProjections,suppliedLayers:valueCellContext.suppliedLayers,groupBy:groupBy},resolver);simpleEncoder.data(groupedModel);var cellCreator=resolver.valueCellsCreator(valueCellContext),valueMatrixInfo=matrix_model_getMatrixModel(groupedModel,facetsAndProjections,cellCreator,globalConfig);group_utils_removeExitCells(resolver),resolver.cacheMaps().exitCellMap.clear(),resolver.valueMatrix(valueMatrixInfo.matrix);var _mutateAxesFromMap=mutateAxesFromMap(resolver.cacheMaps(),resolver.axes()),xAxes=_mutateAxesFromMap.xAxes,yAxes=_mutateAxesFromMap.yAxes;resolver.axes({x:xAxes,y:yAxes}),resolver.createUnits(componentRegistry,config);var _generateMatrices=function generateMatrices(context,matrices,cells,labelManager){var unitHeight=context.unitHeight,unitWidth=context.unitWidth,facetsAndProjections=context.facetsAndProjections,normalizedRows=context.normalizedRows,normalizedColumns=context.normalizedColumns,selection=context.selection,axisFrom=context.axisFrom,facet=context.facet,encoders=context.encoders,resolver=context.resolver,selectionObj=cell_creator_generatePlaceholders({fields:{rows:normalizedRows,columns:normalizedColumns},matrices:matrices,facetsAndProjections:facetsAndProjections,selection:selection,axisFrom:axisFrom,facet:facet,encoders:encoders,resolver:resolver},cells,labelManager),columnsPrimary=selectionObj.columnsPrimary,columnsSecondary=selectionObj.columnsSecondary,rowsPrimary=selectionObj.rowsPrimary,rowsSecondary=selectionObj.rowsSecondary,leftHeaders=selectionObj.leftHeaders,topHeaders=selectionObj.topHeaders,bottomHeaders=selectionObj.bottomHeaders,rightHeaders=selectionObj.rightHeaders,_map2=cell_creator_slicedToArray([rowsPrimary,rowsSecondary,columnsPrimary,columnsSecondary].map(function(d){return d?d.getObjects():[]}),4),rowPrime=_map2[0],rowSec=_map2[1],colPrime=_map2[2],colSec=_map2[3],_map4=cell_creator_slicedToArray([leftHeaders,rightHeaders].map(function(e){return e?e.getObjects().map(function(f){return f.getObjects()}):[]}),2),leftFacets=_map4[0],rightFacets=_map4[1],rowPriority=rowSec.length?1:-1;rowPrime.length&&rowPriority++;var colPriority=colSec.length?1:-1;colPrime.length&&colPriority++;var leftMatrix=leftFacets.length?leftFacets.map(function(d,i){return rowPrime[i]=rowPrime[i]?[rowPrime[i]]:[],[].concat(cell_creator_toConsumableArray(d),cell_creator_toConsumableArray(rowPrime[i]))}):rowPrime?rowPrime.map(function(d){return[d]}):[],rightMatrix=rowSec.length?rowSec.map(function(d,i){return[d].concat(cell_creator_toConsumableArray(rightFacets[i]||[]))}):rightFacets.length?rightFacets.map(function(d){return cell_creator_toConsumableArray(d)}):[],topMatrix=[];topHeaders&&topHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){topMatrix[i]=topMatrix[i]||[],topMatrix[i].push(x)})});colPrime.length&&topMatrix.push(colPrime);var bottomMatrix=[];colSec.length&&bottomMatrix.push(colSec);var currentBottomLength=bottomMatrix.length;bottomHeaders&&bottomHeaders.getObjects().forEach(function(e){e.getObjects().forEach(function(x,i){bottomMatrix[i+currentBottomLength]=bottomMatrix[i+currentBottomLength]||[],bottomMatrix[i+currentBottomLength].push(x)})});if(!leftMatrix.length&&!rightMatrix.length){var cell=new cells.BlankCell;cell.setAvailableSpace(unitWidth,unitHeight),leftMatrix=[[cell]]}if(!(topMatrix.length||bottomMatrix.length&&bottomMatrix[0].length)){var _cell=new cells.BlankCell;_cell.setAvailableSpace(unitWidth,unitHeight),bottomMatrix=[[_cell]]}return{rows:[leftMatrix,rightMatrix],columns:[topMatrix,bottomMatrix],selectionObj:selectionObj,colPriority:colPriority,rowPriority:rowPriority}}(matrixGnContext,{valuesMatrix:valueMatrixInfo,axesMatrix:resolver.axes()},cells,labelManager),rows=_generateMatrices.rows,columns=_generateMatrices.columns,selectionObj=_generateMatrices.selectionObj,rowPriority=_generateMatrices.rowPriority,colPriority=_generateMatrices.colPriority;if(resolver.rowMatrix(rows),resolver.columnMatrix(columns),isFacet||isProjection){var arr=function sanitiseBorderMatrix(matrices,blankCell){var leftMatrix=matrices.leftMatrix,rightMatrix=matrices.rightMatrix,topMatrix=matrices.topMatrix,bottomMatrix=matrices.bottomMatrix,bottomBorderObj={};return rightMatrix.length&&(bottomBorderObj=cell_border_applier_sanitiseFacetValues(rightMatrix,"".concat(constants_RIGHT),blankCell)),leftMatrix.length&&(bottomBorderObj=cell_border_applier_sanitiseFacetValues(leftMatrix,"".concat(constants_LEFT),blankCell)),topMatrix.length&&cell_border_applier_sanitiseHeaderMatrix(topMatrix),bottomMatrix.length&&cell_border_applier_sanitiseHeaderMatrix(bottomMatrix),bottomBorderObj}({leftMatrix:rows[0],rightMatrix:rows[1],topMatrix:columns[0],bottomMatrix:columns[1]},registry.cells.BlankCell);valueMatrixInfo.matrix=function sanitiseGeomMatrix(matrices){for(var arr=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=0;i0?leftRows[0].map(blankCellCreator):[],right:rightRows.length>0?rightRows[0].map(blankCellCreator):[]},_map2=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return topCols.map(function(col,i){return i===topCols.length-1?headers[type]:footers[type]})}),2),topLeft=_map2[0],topRight=_map2[1];if(0===topCols.length){var _map4=matrix_resolver_slicedToArray([constants_LEFT,constants_RIGHT].map(function(type){return bottomCols.map(function(col,i){return 0===i?headers[type]:footers[type]})}),2);bottomLeft=_map4[0],bottomRight=_map4[1]}else bottomLeft=bottomCols.map(function(){return leftRows.length>0?leftRows[0].map(blankCellCreator):[]}),bottomRight=bottomCols.map(function(){return rightRows.length>0?rightRows[0].map(blankCellCreator):[]});return lifeCycleManager.notify({client:[topLeft,topRight,bottomLeft,bottomRight],action:INITIALIZED,formalName:FACET_HEADERS}),{topLeft:topLeft,topRight:topRight,bottomLeft:bottomLeft,bottomRight:bottomRight}}},{key:"updateVisualUnit",value:function updateVisualUnit(retinalConfig){var retinalAxes=this.getRetinalAxes(),lifeCycleManager=this.dependencies().lifeCycleManager;lifeCycleManager.notify({client:this.axes(),action:INITIALIZED,formalName:AXIS}),lifeCycleManager.notify({client:this.units(),action:BEFORE_UPDATE,formalName:UNIT});var units=[],matrixLayers=this.matrixLayers(),props=["".concat(namespace_namespaceObject.LAYER_GLOBAL_NAMESPACE,".domain"),"".concat(namespace_namespaceObject.UNIT_GLOBAL_NAMESPACE,".domain")],store=this.store();return store.lockCommits(props),store.lockModel(),this.forEach(VALUE_MATRIX,function(i,j,el){el.axes(Object.assign(el.axes(),retinalAxes)),el.source()&&el.source().retinalFields(retinalConfig),el.layerDef(matrixLayers[i][j]),el.updateModel(),units.push(el.source())}),store.unlockModel().unlockCommits([props[0]]).unlockCommits([props[1]]),lifeCycleManager.notify({client:units,action:UPDATED,formalName:UNIT}),this}},{key:"getMatrices",value:function getMatrices(resolverConfig){return this._placeholderInfo=cell_creator_computeMatrices(resolverConfig),this._placeholderInfo}},{key:"clear",value:function clear(){var cacheMaps=this._cacheMaps;for(var key in cacheMaps)cacheMaps[key].clear()}}],[{key:"getterSetters",value:function getterSetters(){return RESOLVER_PROPS}}]),MatrixResolver}();function src_data_type_scale_map_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var src_data_type_scale_map_dataTypeScaleMap=(src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap={},dist_datamodel.FieldType.DIMENSION,scale_type_namespaceObject.BAND),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.CATEGORICAL,scale_type_namespaceObject.BAND),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.TEMPORAL,scale_type_namespaceObject.TIME),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.FieldType.MEASURE,scale_type_namespaceObject.LINEAR),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.MeasureSubtype.CONTINUOUS,scale_type_namespaceObject.LINEAR),src_data_type_scale_map_defineProperty(data_type_scale_map_dataTypeScaleMap,dist_datamodel.DimensionSubtype.BINNED,scale_type_namespaceObject.BAND),data_type_scale_map_dataTypeScaleMap);function encoder_helper_toConsumableArray(arr){return function encoder_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0&&min[1]>0&&min[1]>0&&max[1]>0&&(allSameSign=!0,min[0]=0,min[1]=0),min[0]<0&&min[1]<0&&min[1]<0&&max[1]<0&&(allSameSign=!0,max[0]=0,max[1]=0),allSameSign||y1ratio===y2ratio||(y1ratio1&&void 0!==arguments[1]?arguments[1]:{},axisType=axesCreators.axisType,fieldsConfig=axesCreators.fieldsConfig,field=fieldProps.field,axis=[],Cls=scaleMaps[axisType];return fieldProps.type=fieldProps.type?fieldProps.type:group_utils_getAxisType(fieldsConfig,field||null),axis.push(new Cls(fieldProps)),axis},getIndex=function getIndex(arr,val){for(var i=0,arrIndex=-1;-1===arrIndex&&i1?axesCreators.position=BOTH:axesCreators.position=_this.axisFrom()[type],geomCellAxes[axis]=encoder_helper_generateAxisFromMap(axis,axisFields[i],axesCreators,{groupAxes:axis===X?xAxes:yAxes,valueParser:resolver.valueParser()},indices,facetFields)}),geomCell.axes(geomCellAxes),geomCellAxes}},{key:"unionUnitDomains",value:function unionUnitDomains(context){for(var store=context.store(),resolver=context.resolver(),units=resolver.units(),domains={0:{},1:{}},fieldsObj={0:{},1:{}},_loop=function _loop(rIdx,len){for(var unitsArr=units[rIdx],_loop2=function _loop2(cIdx,len2){var unit=unitsArr[cIdx],axisFields=unit.fields(),encodingDomains=unit.dataDomain();["x","y"].forEach(function(axisType,axisTypeIndex){axisFields[axisType].forEach(function(field,axisIndex){var key=axisTypeIndex?"".concat(rIdx,"0").concat(axisIndex):"0".concat(cIdx).concat(axisIndex),dom=encodingDomains[axisType],typeOfField=field.subtype();fieldsObj[axisTypeIndex][key]=field,dom&&0!==Object.keys(dom).length&&(domains[axisTypeIndex][key]=unionDomain([domains[axisTypeIndex]&&domains[axisTypeIndex][key]||[],dom["".concat(field)]],typeOfField))})})},cIdx=0,len2=unitsArr.length;cIdx1&&typeOfAxis===scale_type_namespaceObject.LINEAR&&axes[0].config().alignZeroLine)axes.forEach(function(axis,i){key=axisType?"".concat(idx,"0").concat(i):"0".concat(idx).concat(i),domain=domains[axisType][key],min[i]=domain[0],max[i]=domain[1]}),adjustedDomain=getAdjustedDomain(max,min);else if(typeOfAxis===scale_type_namespaceObject.BAND){key=axisType?"".concat(idx,"00"):"0".concat(idx,"0");var currentFieldName=fieldsObj[axisType][key].oneVar(),sortingOrder=getSortingConfig(context,currentFieldName,axes[0].config);sortingOrder&&domains[axisType][key]instanceof Array&&domains[axisType][key].sort(function(a,b){return sortCategoricalField(sortingOrder,a,b)})}axes.forEach(function(axis,index){key=axisType?"".concat(idx,"0").concat(index):"0".concat(idx).concat(index),(domain=adjustedDomain[index]||domains[axisType][key])&&axis.domain(domain);var type=axisType?"y":"x";store.commit("".concat(namespace_namespaceObject.GROUP_GLOBAL_NAMESPACE,".domain.").concat(type),domain,"".concat(idx).concat(index))})})}),store.unlockModel()}},{key:"getFacetsAndProjections",value:function getFacetsAndProjections(fields,type){for(var facets=[],projections=[],counter=0,primaryFacets=[],secondaryFacets=[],primaryFields=fields[0],secondaryFields=fields[1],primaryLen=primaryFields.length,secondaryLen=secondaryFields.length,axisFrom=this.axisFrom(),i=0;icounter)for(var _i=counter;_i-1&&(projections=[[_facet,_facet]],primaryFacets.splice(_existIndex,1)),secondaryFacets.splice(0,1)}else{var axisFromIndex=primaryFacets.length-1,facet=primaryFacets[axisFromIndex];projections=[[facet]];var existIndex=getIndex(secondaryFacets,facet);existIndex>-1&&(projections=[[facet,facet]],secondaryFacets.splice(existIndex,1)),primaryFacets.splice(axisFromIndex,1)}return{facets:facets=(facets=[].concat(primaryFacets,secondaryFacets)).filter(function(el,index,self){return index===self.findIndex(function(t){return t.toString()===el.toString()})}),projections:projections}}},{key:"fieldSanitizer",value:function fieldSanitizer(datamodel,config){return cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"fieldSanitizer",this).call(this,datamodel,config)}},{key:"getRetinalFieldsDomain",value:function getRetinalFieldsDomain(dataModels,encoding){var groupedModel=dataModels.groupedModel,domains={};for(var key in encoding)if({}.hasOwnProperty.call(encoding,key)){var encodingObj=encoding[key],field=encodingObj.field;if(!encodingObj.domain&&field){var domain=retriveDomainFromData(groupedModel,field);domains[field]=domain}}return domains}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer,i){var def=src_layer_factory.sanitizeLayerConfig(layer);def.order=i,serializedLayers.push(def)}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),layerConfig.push(config)}),layerConfig}},{key:"getLayerConfig",value:function getLayerConfig(fields,userLayerConfig,retinalConfig){var layerConfig=[],columnFields=fields.columnFields,rowFields=fields.rowFields;return columnFields.forEach(function(colField){var colFieldName=colField.toString();rowFields.forEach(function(rowField){var configs=[],rowFieldName=rowField.toString(),encoding={x:{field:colFieldName},y:{field:rowFieldName}},rowFieldType=rowField.subtype(),colFieldType=colField.subtype(),mark=encoder_helper_getDefaultMark(colFieldType,rowFieldType),defConfigs=[{mark:mark,def:{mark:mark,encoding:encoding}}],layerConfigs=getLayerConfFromFields(colField.getMembers(),rowField.getMembers(),userLayerConfig||[]);configs=layerConfigs.length?layerConfigs.map(function(layerConf){var mergedLayerConf=mergeRecursive(mergeRecursive({},defConfigs[0].def),layerConf),serializedLayerConfig=src_layer_factory.getSerializedConf(mergedLayerConf.mark,mergedLayerConf);return{mark:mergedLayerConf.mark,order:mergedLayerConf.order,def:serializedLayerConfig}}):defConfigs,layerConfig.push.apply(layerConfig,cartesian_encoder_toConsumableArray(configs))})}),this.sanitizeLayerConfig(retinalConfig,layerConfig)}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){var colProjections=fields.colProjections,rowProjections=fields.rowProjections,colFields=cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"hasMandatoryFields",this).call(this,{colProjections:colProjections}),rowFields=cartesian_encoder_get(cartesian_encoder_getPrototypeOf(CartesianEncoder.prototype),"hasMandatoryFields",this).call(this,{rowProjections:rowProjections});return colFields&&rowFields}}],[{key:"type",value:function type(){return cartesian_encoder_CARTESIAN}}]),CartesianEncoder}();function polar_encoder_typeof(obj){return(polar_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function polar_encoder_toConsumableArray(arr){return function polar_encoder_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);icounter)for(var _i=counter;_i0&&(config=mergeRecursive(config,userLayerConfig[0])),layerConfig.push(config)}),0===layerConfig.length&&(layerConfig=userLayerConfig);var sanitizedConfig=this.sanitizeLayerConfig(retinalConfig,layerConfig);return this.layers(sanitizedConfig),sanitizedConfig}},{key:"serializeLayerConfig",value:function serializeLayerConfig(layerArray){var serializedLayers=[];return layerArray.length&&layerArray.forEach(function(layer){var def=src_layer_factory.getSerializedConf(layer.mark,layer);serializedLayers.push({mark:layer.mark,def:def})}),serializedLayers}},{key:"sanitizeLayerConfig",value:function sanitizeLayerConfig(encodingConfigs,userLayerConfig){var layerConfig=[];return userLayerConfig.forEach(function(config){var def=toArray(config.def);encoder_helper_sanitizeIndividualLayerConfig(encodingConfigs,def),def.forEach(function(conf){var encoding=conf.encoding||(conf.encoding={});!encoding.angle&&(encoding.angle={});var angleField=getObjProp(encoding.angle,"field"),angle0Field=getObjProp(encoding.angle0,"field");angleField||Object.assign(encoding.angle,{field:encodingConfigs.color&&encodingConfigs.color.field}),angle0Field||(!encoding.angle0&&(encoding.angle0={}),Object.assign(encoding.angle0,{field:encoding.angle.field}))}),layerConfig.push(config)}),layerConfig}},{key:"hasMandatoryFields",value:function hasMandatoryFields(fields){var optionalProjections=fields.optionalProjections;return polar_encoder_get(polar_encoder_getPrototypeOf(PolarEncoder.prototype),"hasMandatoryFields",this).call(this,{optionalProjections:optionalProjections})}}],[{key:"type",value:function type(){return polar_encoder_POLAR}}]),PolarEncoder}();function retinal_encoder_typeof(obj){return(retinal_encoder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function retinal_encoder_defineProperties(target,props){for(var i=0;i=drawingInfMeasure+offset?[axisScale.invert(drawingInfMeasure+offset-selectionBoxMeasure),axisScale.invert(drawingInfMeasure+offset)]:subjectStartPoint-offset1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-fadeout"),!0),classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-fadeout"),!1)},brighten:function brighten(set){var config=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},classPrefix=context.config().classPrefix;set.mergedEnter.length||set.mergedExit.length?(classed(set.mergedEnter,config.className||"".concat(classPrefix,"-legend-brighten"),!0),classed(set.mergedExit,config.className||"".concat(classPrefix,"-legend-brighten"),!1)):classed(set.completeSet,config.className||"".concat(classPrefix,"-legend-brighten"),!1)}}};function legend_highlighter_typeof(obj){return(legend_highlighter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_highlighter_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{};(0,this._strategies[options.strategy||this._strategy])(selectionSet,this)}}],[{key:"formalName",value:function formalName(){return"highlighter"}}]),LegendHighlighter}();__webpack_require__(35);function legend_marker_typeof(obj){return(legend_marker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function legend_marker_defineProperties(target,props){for(var i=0;i0?measurement[space]:0,.1*measurement.maxWidth,.1*measurement.maxHeight)}),measurement}},logicalSpace:{},metaData:{onset:function onset(context,value){return context.firebolt().attachPropagationListener(value)}},range:{sanitization:function sanitization(context,value){return context.scale().range(value),context.resetLogicalSpace(),context.store().commit("range",value),value}},scale:{},smartTicks:{},store:{},title:{sanitization:function sanitization(context,value){return mergeRecursive(context._title||{},value)}},labelManager:{},minTickDistance:{},valueParser:{defaultValue:function defaultValue(val){return val}}};var legend_helper_getScaleInfo=function getScaleInfo(scale){var scaleType=scale.constructor.type();return{scaleType:scaleType,domain:scale.uniqueValues(),steps:scale.config().stops||1,scaleFn:SCALE_FUNCTIONS[scaleType]}},legend_helper_getInterpolatedArrayData=function getInterpolatedArrayData(domainForLegend,scaleParams){var requiredWidth,requiredHeight,upperBound=domainForLegend[domainForLegend.length-1],minTickDiff=Math.ceil(domainForLegend[1]-domainForLegend[0]),maxTickDiff=Math.ceil(upperBound-domainForLegend[0]),alignment=scaleParams.alignment,smartLabelCalc=scaleParams.smartLabel,availableSpace=scaleParams.measures,minimumTickSize=scaleParams.minTickDistance,_smartLabelCalc$getOr=smartLabelCalc.getOriSize(upperBound),tickDimHeight=_smartLabelCalc$getOr.height,tickDimWidth=_smartLabelCalc$getOr.width;return Number.isInteger(upperBound)||(upperBound=upperBound.toFixed(2)),minTickDiff=minTickDiff<1?1:minTickDiff,requiredWidth=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*(tickDimWidth+minimumTickSize.width),requiredWidth-=Math.abs(maxTickDiff),requiredHeight=Math.abs(maxTickDiff)/Math.abs(minTickDiff)*tickDimHeight,requiredHeight-=Math.abs(maxTickDiff),domainForLegend=function getcomputedArray(computationhelper,requiredMeasure,availableMeasure,domainForLegend){var currentTickValue,nextTickValue,upperBound=domainForLegend[domainForLegend.length-1],param=computationhelper.measureParam,smartLabelCalc=computationhelper.smartLabelCalc,pixelPerTick=availableMeasure[param]/upperBound;if(availableMeasure[param]>=requiredMeasure[param])return domainForLegend;currentTickValue=smartLabelCalc.getOriSize(domainForLegend[0])[param];for(var i=1;i0?titleSpace.height+effPadding:0,titleWidth=titleSpace.width+effPadding,labelSpaces=this.getLabelSpaces(effPadding,align),_computeItemSpaces=function computeItemSpaces(config,measures,data){var totalHeight=0,totalWidth=0,maxItemSpaces={width:0,height:0},effPadding=measures.effPadding,titleWidth=measures.titleWidth,labelSpaces=measures.labelSpaces,titleHeight=measures.titleHeight,maxWidth=measures.maxWidth,item=config.item,align=config.align,icon=item.icon,textOrientation=item.text.orientation,itemSpaces=[],iconSpaces=[],maxIconWidth=0;return labelSpaces.forEach(function(labelSpace,i){var itemSpace={width:0,height:0},iconSpace={width:0,height:0},datum=data[i]||{};"left"===textOrientation||"right"===textOrientation?(labelSpace.width+=effPadding,iconSpace.width=(datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),itemSpace.width=labelSpace.width+maxIconWidth,labelSpace.height=Math.max(labelSpace.height,icon.height)+effPadding,iconSpace.height=labelSpace.height,itemSpace.height=labelSpace.height):(labelSpace.width=Math.max(labelSpace.width,datum.size?2*Math.sqrt(datum.size/Math.PI):icon.width)+effPadding,iconSpace.width=labelSpace.width,itemSpace.width=labelSpace.width,maxIconWidth=Math.max(iconSpace.width,maxIconWidth),labelSpace.height+=effPadding,iconSpace.height=icon.height+effPadding,itemSpace.height=labelSpace.height+iconSpace.height),"horizontal"===align?totalHeight=Math.max(totalHeight,itemSpace.height):(totalHeight+=itemSpace.height,totalWidth=Math.max(totalWidth,itemSpace.width,titleWidth)),maxItemSpaces={width:Math.max(itemSpace.width,maxItemSpaces.width),height:Math.max(itemSpace.height,maxItemSpaces.height)},itemSpaces.push(itemSpace),iconSpaces.push(iconSpace)}),itemSpaces.forEach(function(itemSpace,i){if("horizontal"===align)itemSpace.height=totalHeight,"left"===textOrientation||"right"===textOrientation?(labelSpaces[i].height=totalHeight,iconSpaces[i].height=totalHeight,itemSpaces[i].width=labelSpaces[i].width+iconSpaces[i].width+2*effPadding):(labelSpaces[i].width=iconSpaces[i].width,itemSpaces[i].width=iconSpaces[i].width,labelSpaces[i].width=iconSpaces[i].width),totalWidth+=itemSpaces[i].width;else if(itemSpace.width=Math.max(totalWidth,maxWidth),"top"===textOrientation||"bottom"===textOrientation)labelSpaces[i].width=totalWidth,iconSpaces[i].width=totalWidth,maxIconWidth=totalWidth;else{var labelWidth=labelSpaces[i].width,newLabelWidth=maxItemSpaces.width-maxIconWidth;iconSpaces[i].width=maxIconWidth,itemSpaces[i].width=labelWidth+maxIconWidth,labelSpaces[i].width=Math.max(labelWidth,newLabelWidth),totalWidth=Math.max(totalWidth,itemSpace.width)}}),totalWidth=Math.ceil(Math.max(totalWidth,titleWidth))+effPadding,totalHeight+=titleHeight+effPadding,{totalHeight:totalHeight=Math.ceil(totalHeight),totalWidth:totalWidth,itemSpaces:itemSpaces,iconSpaces:iconSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth}}(this.config(),{effPadding:effPadding,titleWidth:titleWidth,labelSpaces:labelSpaces,titleHeight:titleHeight,maxWidth:maxWidth,maxHeight:maxHeight},this.data()),totalHeight=_computeItemSpaces.totalHeight,totalWidth=_computeItemSpaces.totalWidth,itemSpaces=_computeItemSpaces.itemSpaces,iconSpaces=_computeItemSpaces.iconSpaces,maxItemSpaces=_computeItemSpaces.maxItemSpaces,maxIconWidth=_computeItemSpaces.maxIconWidth;return this.measurement({width:Math.max(totalWidth,width)+effMargin+effBorder,height:Math.max(totalHeight,height)+effMargin+effBorder,labelSpaces:labelSpaces,iconSpaces:iconSpaces,itemSpaces:itemSpaces,maxItemSpaces:maxItemSpaces,maxIconWidth:maxIconWidth,titleSpaces:{width:Math.min(maxWidth,this.measurement().width)-effMargin-effBorder,height:titleHeight}}),this}},{key:"getTitleSpace",value:function getTitleSpace(){return this._labelManager.setStyle(renderer_utils_getSmartComputedStyle(renderer_utils_selectElement("body"),"".concat(this.config().classPrefix,"-legend-title"))),this._labelManager.getOriSize(this.title().text?this.title().text:"")}},{key:"renderTitle",value:function renderTitle(container){var _this$measurement2=this.measurement(),titleSpaces=_this$measurement2.titleSpaces,border=_this$measurement2.border,padding=_this$measurement2.padding,maxWidth=_this$measurement2.maxWidth,width=legend_helper_calculateTitleWidth(this.measurement(),this._labelManager.getOriSize(this._title.text).width,this.config()),_this$config3=this.config(),borderStyle=_this$config3.borderStyle,borderColor=_this$config3.borderColor;return function titleCreator(container,title,measurement,config){var orientation=config.item.text.orientation,textAlign="left",alignment=measurement.alignment,maxWidth=measurement.maxWidth,width=measurement.width,height=measurement.height,border=measurement.border,padding=measurement.padding;"top"!==orientation&&"bottom"!==orientation&&alignment!==HORIZONTAL||(textAlign="center");var titleWidth=Math.min(maxWidth,width),titleContainer=makeElement(container,"table",[1],"".concat(config.classPrefix,"-legend-title")).style("width","".concat(titleWidth,"px")).style("height","".concat(height,"px")).style("border-bottom","".concat(border,"px ").concat(config.borderStyle," ").concat(config.borderColor)).style("text-align",title.orientation instanceof Function?title.orientation(config.position):title.orientation);return makeElement(titleContainer,"td",[1],"".concat(config.classPrefix,"-legend-title-text")).style("width","".concat(titleWidth,"px")).style("max-width","".concat(maxWidth,"px")).style("height","100%").style("line-height",1).style("padding","".concat(padding,"px")).text(title.text).style("text-align",textAlign).style("overflow-x","scroll").node()}(container,this.title(),{height:titleSpaces.height,width:width,maxWidth:maxWidth,border:border,padding:padding,borderStyle:borderStyle,borderColor:borderColor,alignment:POSITION_ALIGNMENT_MAP[this.config().position]},this.config())}},{key:"render",value:function render(){var marginPosition,firebolt=this.firebolt(),_this$config4=this.config(),classPrefix=_this$config4.classPrefix,borderStyle=_this$config4.borderStyle,borderColor=_this$config4.borderColor,position=_this$config4.position,_this$measurement3=this.measurement(),border=_this$measurement3.border,marginHorizontal=_this$measurement3.marginHorizontal,maxHeight=_this$measurement3.maxHeight,height=_this$measurement3.height,width=_this$measurement3.width,maxWidth=_this$measurement3.maxWidth,margin=this.measurement().margin,legendContainer=makeElement(renderer_utils_selectElement(this.mount()),"div",[1],"".concat(classPrefix,"-legend-box"));switch(position){case"top":marginPosition="margin-".concat("bottom"),margin=marginHorizontal;break;case"left":marginPosition="margin-".concat("right");break;case"bottom":marginPosition="margin-".concat("top"),margin=marginHorizontal;break;default:marginPosition="margin-".concat("left")}legendContainer.classed("".concat(classPrefix,"-legend-box-").concat(this._id),!0),legendContainer.style("float","left");var widthBox=legend_helper_calculateTitleWidth(this.measurement(),this._labelManager.getOriSize(this._title.text).width,this.config()),titleWidth=Math.min(maxWidth,widthBox);return width1&&void 0!==arguments[1]?arguments[1]:[],data=this.data();return fields.length?(id=Number(id),[data.find(function(d){return id===d.id}).rawVal]):[]}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(_ref2){var fields=_ref2.fields,entrySet=_ref2.entrySet,idRangeMap=this.data().reduce(function(acc,v){return acc[v.id]=v,acc},{});return fields.reduce(function(acc,v){return acc[v]=entrySet.reduce(function(ranges,id){return id in idRangeMap&&ranges.push(idRangeMap[id].range),ranges},[]),acc},{})}},{key:"setParentInfo",value:function setParentInfo(info){this._canvasMount=info.canvasRoot}}],[{key:"create",value:function create(dependencies){return new SimpleLegend(dependencies)}},{key:"defaultConfig",value:function defaultConfig(){return legend_defaults_DEFAULT_CONFIG}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENT}}]),SimpleLegend}();function position_config_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var legendOrientation=(position_config_defineProperty(_legendOrientation={},HORIZONTAL,{datasets:function datasets(data){return{row:[1],column:data}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var itemSpaces=measurement.itemSpaces,width=measurement.width,buffer=config.buffer;return{row:{width:"".concat(width+itemSpaces.length*buffer.horizontal||1,"px"),padding:"".concat(0,"px")},column:{width:function width(d,i){return"".concat(itemSpaces[i].width+buffer.horizontal,"px")},padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces;return{iconHeight:measurement.height,iconWidth:maxItemSpaces.width,stepPadding:{horizontal:!0,vertical:!1}}}}),position_config_defineProperty(_legendOrientation,"vertical",{datasets:function datasets(data){return{row:data,column:function column(d){return[d]}}},itemContainerMeasures:function itemContainerMeasures(measurement,config){var width=measurement.width,padding=config.padding;return{row:{width:"".concat(width,"px"),padding:"".concat(padding,"px")},column:{width:"".concat(width,"px"),padding:"".concat(0,"px")}}},getStepSpacesInfo:function getStepSpacesInfo(measurement){var maxItemSpaces=measurement.maxItemSpaces,width=measurement.width;return{iconHeight:maxItemSpaces.height,iconWidth:width,stepPadding:{horizontal:!1,vertical:!0}}}}),_legendOrientation),positionConfig=(position_config_defineProperty(_positionConfig={},"left",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"right",legendOrientation.vertical),position_config_defineProperty(_positionConfig,"top",legendOrientation.horizontal),position_config_defineProperty(_positionConfig,"bottom",legendOrientation.horizontal),_positionConfig),alignmentMap=(position_config_defineProperty(_alignmentMap={},"left","end"),position_config_defineProperty(_alignmentMap,"right","start"),position_config_defineProperty(_alignmentMap,"top","center"),position_config_defineProperty(_alignmentMap,"bottom","center"),_alignmentMap),itemStack=(position_config_defineProperty(_itemStack={},"left",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"right",["shape",VALUE]),position_config_defineProperty(_itemStack,"top",[VALUE,"shape"]),position_config_defineProperty(_itemStack,"bottom",["shape",VALUE]),_itemStack),renderer_createLegendSkeleton=function createLegendSkeleton(context,container,classPrefix,data){var gradWidth,gradHeight,maxGradHeight,maxGradWidth,measurement=context.measurement(),margin=measurement.margin,border=measurement.border,titleSpaces=measurement.titleSpaces,width=measurement.width,height=measurement.height,maxWidth=measurement.maxWidth,maxHeight=measurement.maxHeight;gradHeight=height-(titleSpaces.height+2*margin+2*border),gradWidth=width-(2*margin+2*border),maxGradHeight=maxHeight-(titleSpaces.height+2*margin+2*border),maxGradWidth=maxWidth-(2*margin+2*border);var legendBody=makeElement(container,"div",[1],"".concat(classPrefix,"-legend-body"));return legendBody.style("width","".concat(gradWidth,"px")),legendBody.style("height","".concat(gradHeight,"px")),legendBody.select(".".concat(classPrefix,"-legend-overflow")).remove(),maxGradWidth&&maxGradWidth4)}(shape)?shape:defaults_ICON_MAP(shape).size(size)(),makeElement(groupElement,"path",function(data){return[data]}).attr("d",pathStr)}return d[1]="circle",createShape(d,elem,"circle")}(datum,makeElement(svg,"g",[datum[1]],"".concat(classPrefix,"-legend-icon")),icon).attr("transform","translate(".concat(transalate," ").concat(iconHeight/2,")")).attr("fill",datum[2]||color).attr("stroke",datum[2]||color):makeElement(svg,"rect",[datum[1]],"".concat(classPrefix,"-legend-icon")).attr("x",0).attr("y",0).attr("width",maxIconWidth).attr("height",iconHeight).attr("fill",datum[2]||color)};function discrete_legend_typeof(obj){return(discrete_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function discrete_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function discrete_legend_toConsumableArray(arr){return function discrete_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainForLegend.push(domain[1]),domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b}),domainForLegend=legend_helper_getInterpolatedArrayData(domainForLegend,scaleParams)):domainForLegend=legend_helper_getInterpolatedData(domain,steps-1,scaleParams),(domainForLegend=gradient_legend_toConsumableArray(new Set(domainForLegend)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,value=domainForLegend[i];return gradient_legend_defineProperty(_ref={},scaleType,"size"===scaleType?scale[scaleFn](ele)*scale.getScaleFactor():scale[scaleFn](ele)),gradient_legend_defineProperty(_ref,"value",+value.toFixed(1)),gradient_legend_defineProperty(_ref,"id",i),_ref}).filter(function(d){return null!==d.value})}},{key:"getLabelSpaces",value:function getLabelSpaces(effPadding){this.config({item:{text:{orientation:this.config().position}}});var axis=function createAxis(context){var data=context.data(),align=context.config().align,AxisCell=context._cells.AxisCell,newAxis=new continous_axis_ContinousAxis({id:"legend-".concat(context._id),orientation:align===ALIGN_VERTICAL?"right":"bottom",style:context._computedStyle,nice:!1,showAxisName:!1,tickValues:data.map(function(d){return d.value}),fixedBaseline:!1,labels:{rotation:null}},{labelManager:context._labelManager});return newAxis.domain(getGradientDomain(data)),newAxis.range([1,1]),(new AxisCell).source(newAxis).config({margin:{left:0,bottom:0,top:0,right:0}})}(this),axisSpace=axis.getLogicalSpace(),space={width:axisSpace.width-effPadding,height:axisSpace.height-effPadding},axisDomainLength=axis.source().domain().length,labelSpaces=new Array(axisDomainLength).fill(space);return this.axis(axis),labelSpaces}},{key:"getDrawingContext",value:function getDrawingContext(){return{svgContainer:this._legendGradientSvg}}},{key:"render",value:function render(){var firebolt=this.firebolt(),legendContainer=gradient_legend_get(gradient_legend_getPrototypeOf(GradientLegend.prototype),"render",this).call(this,this.mount());return function renderGradient(context,container){var gradHeight,gradWidth,_context$config2=context.config(),align=_context$config2.align,classPrefix=_context$config2.classPrefix,item=_context$config2.item,data=context.data(),_createLegendSkeleton=gradient_helper_createLegendSkeleton(container,classPrefix,data,context._id),legendContainer=_createLegendSkeleton.legendContainer,legendGradSvg=_createLegendSkeleton.legendGradSvg,legendGradCont=_createLegendSkeleton.legendGradCont,linearGradient=_createLegendSkeleton.linearGradient,legendRect=_createLegendSkeleton.legendRect,labelDim=context.axis().source().getAxisDimensions().tickDimensions,_context$measurement=context.measurement(),padding=_context$measurement.padding,margin=_context$measurement.margin,border=_context$measurement.border,titleSpaces=_context$measurement.titleSpaces,maxItemSpaces=_context$measurement.maxItemSpaces,maxHeight=_context$measurement.maxHeight,maxWidth=_context$measurement.maxWidth,height=_context$measurement.height,width=_context$measurement.width,gradientDimensions={};gradHeight=Math.floor(Math.min(height,maxHeight)-(titleSpaces.height+2*margin+2*border)),gradWidth=Math.floor(Math.min(width,maxWidth)-(2*margin+2*border)),align===ALIGN_HORIZONTAL?(gradientDimensions.height=item.icon.height,gradientDimensions.width=gradWidth-2*padding-labelDim.width/2,linearGradient.attr("x2","100%").attr("y1","0%"),legendGradCont.attr("transform","translate( ".concat(labelDim.width/2," ").concat(LEGEND_MARKER_PROPS_size+4,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-item.icon.height-padding,gradWidth-2*padding-1),renderer_utils_applyStyle(legendContainer,{height:"".concat(maxItemSpaces.height+border+padding,"px"),width:"".concat(Math.min(width,maxWidth),"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height),legendRect.attr("width",gradientDimensions.width-labelDim.width/2)):(gradientDimensions.height=gradHeight-2*padding-labelDim.height/2,gradientDimensions.width=item.icon.width,linearGradient.attr("x2","0%").attr("y1","100%"),legendGradCont.attr("transform","translate(".concat(LEGEND_MARKER_PROPS_size+4," ").concat(labelDim.height/2,")")),gradient_helper_renderAxis(context,legendContainer,gradHeight-2*padding-1,gradWidth-item.icon.width-2*padding),renderer_utils_applyStyle(legendContainer,{height:"".concat(Math.min(height,maxHeight),"px"),width:"".concat(maxWidth,"px"),padding:"".concat(padding,"px")}),legendRect.attr("height",gradientDimensions.height-labelDim.height/2),legendRect.attr("width",gradientDimensions.width)),renderer_utils_applyStyle(legendGradSvg,{height:"".concat(gradientDimensions.height+LEGEND_MARKER_PROPS_size+4,"px"),width:"".concat(gradientDimensions.width+LEGEND_MARKER_PROPS_size+4,"px")}),renderer_utils_applyStyle(legendRect,{fill:"url(#linear-gradient-".concat(context._id,")")}),legendGradSvg.attr("height",gradientDimensions.height+LEGEND_MARKER_PROPS_size+4),legendGradSvg.attr("width",gradientDimensions.width+LEGEND_MARKER_PROPS_size+4),context.measurement({gradientDimensions:gradientDimensions}),context._legendGradientSvg=legendGradSvg}(this,legendContainer),legendContainer.selectAll("div").style("float","left"),firebolt.mapActionsAndBehaviour(),firebolt.mapSideEffects(gradient_legend_defineProperty({},"highlight",["marker"])),legendContainer}},{key:"getCriteriaFromData",value:function getCriteriaFromData(data){return[[this.fieldName()],[data.value]]}},{key:"getRangeFromIdentifiers",value:function getRangeFromIdentifiers(_ref2){var fields=_ref2.fields,criteria=_ref2.criteria;return fields.reduce(function(range,v){return range[v]=criteria[v],range},{})}}],[{key:"create",value:function create(dependencies){return new GradientLegend(dependencies)}},{key:"type",value:function type(){return"gradient"}}]),GradientLegend}();function step_legend_typeof(obj){return(step_legend_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function step_legend_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function step_legend_toConsumableArray(arr){return function step_legend_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);isteps[steps.length-1]&&domainLeg.push(domain[1]),domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})):domainLeg=legend_helper_getInterpolatedData(domain,steps,scaleParams),domainLeg=(domainLeg=step_legend_toConsumableArray(new Set(domainLeg)).sort(function(a,b){return a-b})).map(function(ele,i){var _ref,range,value=null;if(i0&&void 0!==arguments[0]?arguments[0]:{},registrableComponents=this._registrableComponents,mergedPolicy=mergeRecursive(mergeRecursive({},function defaultPolicy(registrableComponents){var aliases=registrableComponents.map(function(comp){return comp.alias()});return{behaviours:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}},sideEffects:{"*":function _(propagationPayload){var propagationCanvas=propagationPayload.sourceCanvas;return!propagationCanvas||-1!==aliases.indexOf(propagationCanvas)}}}}(registrableComponents)),policy);return registrableComponents.forEach(function(canvas){canvas.firebolt().crossInteractionPolicy(mergedPolicy)}),this}}]),ActionModel}()),TITLE_CONFIG={position:"top",align:"left",padding:4,className:"".concat("muze","-title-container")},SUB_TITLE_CONFIG={position:"top",align:"left",padding:16,maxLines:2,className:"".concat("muze","-subtitle-container")},MESSAGE_CONFIG={className:"".concat("muze","-message-container"),baseFontLimit:16,upperFontLimit:24,baseSizeLimit:100,upperSizeLimit:300,fractionImage:.8,fractionChild:.7};function local_options_typeof(obj){return(local_options_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function local_options_slicedToArray(arr,i){return function local_options_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function local_options_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function local_options_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function canvas_local_options_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var canvas_local_options_localOptions=(canvas_local_options_defineProperty(_localOptions={},"rows",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"columns",{value:null,meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"color",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"shape",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"size",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object",sanitization:function sanitization(config){return"string"!=typeof config&&config?config:{field:config}}}}),canvas_local_options_defineProperty(_localOptions,"detail",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"layers",{value:[],meta:{typeCheck:"constructor",typeExpected:"Array"}}),canvas_local_options_defineProperty(_localOptions,"transform",{value:null,meta:{typeCheck:"constructor",typeExpected:"Object"}}),_localOptions),canvasOptions=(canvas_local_options_defineProperty(_canvasOptions={},"title",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref){var _ref2=local_options_slicedToArray(_ref,2),arg1=_ref2[0],arg2=_ref2[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref3){var _ref4=local_options_slicedToArray(_ref3,2),title=_ref4[0],titleConfig=_ref4[1],t=title;"string"!=typeof title&&title||(t=function t(){return title});var defConfig=mergeRecursive({},TITLE_CONFIG);return[t,mergeRecursive(defConfig,titleConfig)]}}}),canvas_local_options_defineProperty(_canvasOptions,"subtitle",{value:[null,null],meta:{takesMultipleParams:!0,typeCheck:function typeCheck(_ref5){var _ref6=local_options_slicedToArray(_ref5,2),arg1=_ref6[0],arg2=_ref6[1];return"function"==typeof arg1&&"object"===local_options_typeof(arg2)},sanitization:function sanitization(_ref7){var _ref8=local_options_slicedToArray(_ref7,2),subtitle=_ref8[0],subtitleConfig=_ref8[1],sub=subtitle;"string"!=typeof subtitle&&subtitle||(sub=function sub(){return subtitle});var defConfig=mergeRecursive({},SUB_TITLE_CONFIG);return[sub,mergeRecursive(defConfig,subtitleConfig)]}}}),_canvasOptions);function layoutComponent_defineProperties(target,props){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],isGridComponent=arguments.length>3&&void 0!==arguments[3]&&arguments[3],cut="",componentRatioWidth=1,leftHeight=0,leftWidth=0;if(!component)return{first:definitionModel,second:definitionModel};var _component$getLogical=component.getLogicalSpace(),componentHeight=_component$getLogical.height,componentWidth=_component$getLogical.width,position=component.position();"top"===position||"bottom"===position?(cut="h",componentRatioWidth=componentHeight/definitionModel.remainingHeight(),leftHeight=definitionModel.remainingHeight()-componentHeight,leftWidth=definitionModel.remainingWidth()):(cut="v",componentRatioWidth=componentWidth/definitionModel.remainingWidth(),leftWidth=definitionModel.remainingWidth()-componentWidth,leftHeight=definitionModel.remainingHeight()),leftOvercomponentRationWidth=1-componentRatioWidth,definitionModel.cut(cut);var firstLaneConfig={host:component.name(),cut:null,ratioWeight:componentRatioWidth,preferred:!isGridComponent&&isPreferred,lanes:[]},firstLane=new DefinitionModel(firstLaneConfig);firstLane.remainingHeight(componentHeight),firstLane.remainingWidth(componentWidth);var secondLane=new DefinitionModel({host:null,cut:null,ratioWeight:leftOvercomponentRationWidth,preferred:!isGridComponent&&!isPreferred,lanes:[]});return secondLane.remainingHeight(leftHeight),secondLane.remainingWidth(leftWidth),isPreferred?definitionModel.lanes([firstLane]):"top"===position||"left"===position?definitionModel.lanes([firstLane,secondLane]):definitionModel.lanes([secondLane,firstLane]),{first:firstLane,second:secondLane}}function tree_toConsumableArray(arr){return function tree_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i0?matrix[0]:matrix[1];return isTransposed?(joinedMatrix=matrix[0].length>0?utils_toConsumableArray(matrix[0]):[],joinedMatrix=matrix[1].length>0?[].concat(utils_toConsumableArray(joinedMatrix),utils_toConsumableArray(matrix[1])):joinedMatrix):joinedMatrix=joinedMatrix.map(function(row,rowIndex){var rowData=[];return matrix[0].length>0&&(rowData=utils_toConsumableArray(matrix[0][rowIndex])),matrix[1].length>0&&(rowData=[].concat(utils_toConsumableArray(rowData),utils_toConsumableArray(matrix[1][rowIndex]))),rowData}),joinedMatrix},utils_computeLogicalSpace=function computeLogicalSpace(){var item=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},config=arguments.length>1?arguments[1]:void 0,maxMeasures=arguments.length>2?arguments[2]:void 0,_config$isTransposed=config.isTransposed,isTransposed=void 0!==_config$isTransposed&&_config$isTransposed,unitMeasures=config.unitMeasures,_getMeasureInfo=function getMeasureInfo(isTransposed){return isTransposed?{firstMeasure:enums_constants_HEIGHT,secondMeasure:"width"}:{firstMeasure:"width",secondMeasure:enums_constants_HEIGHT}}(isTransposed),firstMeasure=_getMeasureInfo.firstMeasure,secondMeasure=_getMeasureInfo.secondMeasure,values=item.values,minMeasures=function getMinMeasures(isTransposed,unitMeasures){return isTransposed?{height:0,width:unitMeasures.width}:{height:unitMeasures.height,width:0}}(isTransposed,unitMeasures);if(values[0].key){var _logicalSpace,logicalSpace=(utils_defineProperty(_logicalSpace={},firstMeasure,0),utils_defineProperty(_logicalSpace,secondMeasure,0),_logicalSpace);return values.forEach(function(valueItem){var space=computeLogicalSpace(valueItem,config,maxMeasures);logicalSpace[firstMeasure]=Math.max(logicalSpace[firstMeasure],space[firstMeasure],minMeasures[firstMeasure]),logicalSpace[secondMeasure]+=+space[secondMeasure]}),item.space=logicalSpace,logicalSpace}return function getLogicalSpace(item,measures,minMeasures){var _ref,maxMeasure=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],firstMeasure=measures.firstMeasure,secondMeasure=measures.secondMeasure,firstMeasureValue=0,secondMeasureValue=0;return item.values.forEach(function(valueArray){var _item$space,fMeasure=0,sMeasure=0;valueArray.forEach(function(placeholder,colIndex){placeholder.setAvailableSpace();var space=placeholder.getLogicalSpace(),minSecondMeasure=placeholder.getMinMeasures(minMeasures[secondMeasure]);sMeasure=Math.max(sMeasure,+space[secondMeasure],minSecondMeasure),maxMeasure[colIndex]=Math.max(maxMeasure[colIndex]||0,space[firstMeasure]),fMeasure+=+maxMeasure[colIndex]}),secondMeasureValue+=sMeasure,firstMeasureValue=Math.max(firstMeasureValue,fMeasure),item.space=(utils_defineProperty(_item$space={},secondMeasure,Math.ceil(secondMeasureValue)),utils_defineProperty(_item$space,firstMeasure,Math.ceil(firstMeasureValue)),_item$space)}),utils_defineProperty(_ref={},secondMeasure,secondMeasureValue),utils_defineProperty(_ref,firstMeasure,firstMeasureValue),_ref}(item,{firstMeasure:firstMeasure,secondMeasure:secondMeasure},minMeasures,maxMeasures)},createMatrixEachLevel=function createMatrixEachLevel(item,isTransposed){if(item.values[0].key){var arr=[];return item.values.forEach(function(child){isTransposed?createMatrixEachLevel(child,isTransposed).forEach(function(e,i){var _arr$i;arr[i]=arr[i]||[],(_arr$i=arr[i]).push.apply(_arr$i,utils_toConsumableArray(e))}):arr.push.apply(arr,utils_toConsumableArray(createMatrixEachLevel(child,isTransposed)))}),item.matrix=arr,arr}return item.matrix=isTransposed?item.values[0].map(function(col,colIndex){return item.values.map(function(row){return row[colIndex]})}):item.values,item.matrix},extraCellsRemover=function extraCellsRemover(arr,beg,end){return arr.slice(beg,-end)},visual_matrix_props_PROPS={config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config||{},value)}},maxMeasures:{},availableSpace:{},logicalSpace:{}},visual_matrix_default_config_defaultConfig={distribution:[],classPrefix:"muze",isDistributionEqual:!0,unitMeasures:{height:100,width:100,border:1},isTransposed:!1,facet:"primary",extraCellLengths:[]};function visual_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function visual_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VisualMatrix),this._lastLevelKey=0,this._primaryMatrix=matrix[0]||[],this._secondaryMatrix=matrix[1]||[],this._maxMeasures=[],this._availableSpace={},generateGetterSetters(this,visual_matrix_props_PROPS);var defCon=Object.assign({},this.constructor.defaultConfig());this.config(mergeRecursive(defCon,config)),this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],this.config())}return function visual_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&visual_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&visual_matrix_defineProperties(Constructor,staticProps),Constructor}(VisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"computeViewableSpaces",value:function computeViewableSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"removeExtraCells",value:function removeExtraCells(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getPriorityDistribution",value:function getPriorityDistribution(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"calculateDepth",value:function calculateDepth(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeSpaces",value:function redistributeSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"redistributeViewSpaces",value:function redistributeViewSpaces(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"getCellDimensions",value:function getCellDimensions(){throw new Error(ERROR_MSG.INTERFACE_IMPL)}},{key:"primaryMatrix",value:function primaryMatrix(){return arguments.length?this:this._primaryMatrix}},{key:"secondaryMatrix",value:function secondaryMatrix(){return arguments.length?this:this._secondaryMatrix}},{key:"tree",value:function tree(){return arguments.length?this:this._tree}},{key:"createTree",value:function createTree(){var _createTree2=function createTree(context){var matrixTree={},lastLevelKey=0,facet="primary",nestFn=utils_nest(),keys=[],layoutMatrix=context._layoutMatrix,primaryMatrix=context.primaryMatrix(),secondaryMatrix=context.secondaryMatrix(),_context$config=context.config(),isTransposed=_context$config.isTransposed,breakPage=_context$config.breakPage;if(isTransposed){if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var _i2=0;_i20){for(var primaryMatrixLength=primaryMatrix.length,_i3=secondaryMatrix.length-1;_i3>0;_i3--)keys.push(_i3+primaryMatrixLength);keys.push(primaryMatrixLength),"primary"===facet&&(lastLevelKey=primaryMatrixLength)}var newMatrix;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),newMatrix=layoutMatrix[0].map(function(col,colIndex){return layoutMatrix.map(function(row){return row[colIndex]})}),matrixTree=nestFn.entries(newMatrix)}else{if(facet=0===primaryMatrix.length?"primary":0===secondaryMatrix.length?"secondary":primaryMatrix.length>=secondaryMatrix.length?"primary":"secondary",primaryMatrix.length>0){for(var i=0;i0){for(var keyLength=primaryMatrix.length>0?primaryMatrix[0].length:0,_i=secondaryMatrix[0].length-1;_i>0;_i--)keys.push(_i+keyLength);keys.push(keyLength),"primary"===facet&&(lastLevelKey=keyLength)}else lastLevelKey=primaryMatrix.length>0?primaryMatrix[0].length-1:0;keys.forEach(function(key){var counter=-1;return nestFn.key(function(d){return counter++,"".concat(d[key].valueOf(),"-").concat(findInPage(counter,breakPage))})}),matrixTree=nestFn.entries(layoutMatrix)}return{tree:matrixTree,lastLevelKey:lastLevelKey}}(this),tree=_createTree2.tree,lastLevelKey=_createTree2.lastLevelKey;return this._lastLevelKey=lastLevelKey,tree}},{key:"getLogicalSpace",value:function getLogicalSpace(){return this.logicalSpace()}},{key:"setAvailableSpace",value:function setAvailableSpace(width,height){this.availableSpace({width:width,height:height});var tree=this.tree(),heightMeasures=this.populateMaxMeasures(enums_constants_HEIGHT,tree),widthMeasures=this.populateMaxMeasures("width",tree),depth=this.calculateDepth(widthMeasures,heightMeasures);return this.viewableMatrix=this.createViewPortMatrix(depth),this.viewableMeasures=this.redistributeSpaces(width,height),this}},{key:"populateMaxMeasures",value:function populateMaxMeasures(type,matrixTree){var _this=this,depth=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,measures=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(measures[depth]=Math.max(measures[depth]||0,matrixTree.space[type]),matrixTree.values){var childDepth=depth+1;matrixTree.values.forEach(function(child){child.space&&(measures=_this.populateMaxMeasures(type,child,childDepth,measures))})}return measures}},{key:"getViewableSpaces",value:function getViewableSpaces(){return this.viewableMeasures}},{key:"getViewableMatrices",value:function getViewableMatrices(){return this.viewableMatrix}},{key:"createViewPortMatrix",value:function createViewPortMatrix(depth){var arr=[];return function createMatrixInstances(){var arr=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],depth=arguments.length>1?arguments[1]:void 0,matrixInfo=arguments.length>2?arguments[2]:void 0,layout=arguments.length>3?arguments[3]:void 0,breakPointer=layout._breakPointer,isTransposed=layout.config().isTransposed,tree=matrixInfo.tree,layoutMatrix=matrixInfo.layoutMatrix;if(0===depth){var brokenMatrix=function breakMatrix(matrix,isTransposed,breakPointer){var primaryMatrix=[],secondaryMatrix=[];return isTransposed?matrix.forEach(function(row,rowIndex){rowIndex>=breakPointer?secondaryMatrix.push(row):primaryMatrix.push(row)}):matrix.forEach(function(row,rowIndex){row.forEach(function(column,columnIndex){columnIndex>=breakPointer?(secondaryMatrix[rowIndex]=secondaryMatrix[rowIndex]||[],secondaryMatrix[rowIndex].push(column)):(primaryMatrix[rowIndex]=primaryMatrix[rowIndex]||[],primaryMatrix[rowIndex].push(column))})}),[primaryMatrix,secondaryMatrix]}(tree.matrix,isTransposed,breakPointer);return arr.push({matrix:tree.matrix,primaryMatrix:brokenMatrix[0],secondaryMatrix:brokenMatrix[1],space:tree.space}),arr}var nextLevel=depth-1;return tree.values.forEach(function(e){createMatrixInstances(arr,nextLevel,{tree:e,layoutMatrix:layoutMatrix},layout)}),arr}(arr,depth,this.removeExtraCells(),this),arr}}],[{key:"defaultConfig",value:function defaultConfig(){return visual_matrix_default_config_defaultConfig}}]),VisualMatrix}();function row_matrix_typeof(obj){return(row_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function row_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function row_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RowVisualMatrix),(_this=row_matrix_possibleConstructorReturn(this,row_matrix_getPrototypeOf(RowVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length>0?matrix[0][0].length:0,_this._layoutMatrix=combineMatrices([matrix[0]||[],matrix[1]||[]],_this.config()),_this._tree={key:ROW_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function row_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&row_matrix_setPrototypeOf(subClass,superClass)}(RowVisualMatrix,visual_matrix_VisualMatrix),function row_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&row_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&row_matrix_defineProperties(Constructor,staticProps),Constructor}(RowVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!1),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),widths=_this2$getCellDimensi.widths,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=[height,height],columnMeasures=widths;return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=extraCellsRemover(tree.matrix,begCellLen,endCellLen),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var remainingAvailWidth,remainingWidth,cWidths=[],conditions=[],maxPrioritySpace=0,matrix=measures.matrix,availableWidth=measures.width,maxWidths=measures.maxMeasures,currentWidth=measures.maxWidth,height=measures.height,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length?this.primaryMatrix()[0].length:0,dist=[];remainingAvailWidth=availableWidth,remainingWidth=currentWidth,(conditions=2===priority?[primaryMatrixLength-1,primaryMatrixLength]:0===priority?[primaryMatrixLength-1]:[primaryMatrixLength]).forEach(function(i){dist[i]=maxWidths[i],maxPrioritySpace+=maxWidths[i],remainingAvailWidth-=dist[i],remainingWidth-=dist[i]}),matrix[0].forEach(function(e,i){-1===conditions.indexOf(i)&&(dist[i]=remainingAvailWidth*(maxWidths[i]/remainingWidth))}),matrix.forEach(function(row){return row.forEach(function(col,cIdx){-1===conditions.indexOf(cIdx)?(col.setAvailableSpace(dist[cIdx],height),cWidths[cIdx]=Math.max(cWidths[cIdx]||0,Math.floor(col.getLogicalSpace().width))):cWidths[cIdx]=0})});var prioritySpace=availableWidth-cWidths.reduce(function(t,n){return t+n});return prioritySpace<0?cWidths=cWidths.map(function(){return 0}):conditions.forEach(function(i){cWidths[i]=Math.floor(prioritySpace*(dist[i]/maxPrioritySpace||1))}),cWidths}},{key:"calculateDepth",value:function calculateDepth(widthMeasures,heightMeasures){var i,height=this.availableSpace().height;for(i=0;i0?logicalWidths:maxMeasures.map(function(){return 0}),rHeights=function getDistributedHeight(context){var heightWithoutGutter,distSum=0,gutterSum=0,isTransposed=context.isTransposed,distribution=context.distribution,availableHeight=context.availableHeight,height=context.height,isDistributionEqual=context.isDistributionEqual,gutter=context.gutter,matrix=context.matrix,cIdx=context.cIdx;distribution&&void 0!==distribution[0]&&(distSum=distribution.reduce(function(t,n){return t+=n})),gutter&&void 0!==gutter[0]&&(gutterSum=gutter.reduce(function(t,n){return t+=n})),heightWithoutGutter=availableHeight-Math.floor(availableHeight*gutterSum);var colLen=matrix.length;return matrix.map(function(row,rIdx){var space=row[cIdx].getLogicalSpace().height,distHeight=space+space/height*(heightWithoutGutter-height);return isTransposed||(distribution.length>0&&colLen===distribution.length?distHeight=heightWithoutGutter*distribution[rIdx]/distSum:(isDistributionEqual||0===context.height)&&(distHeight=heightWithoutGutter/colLen)),Math.floor(distHeight)})}({matrix:matrix,cIdx:this._lastLevelKey,height:mHeight,availableHeight:height,isDistributionEqual:isDistributionEqual,distribution:distribution,isTransposed:isTransposed,gutter:gutter}),maxWidths.length>0&&(cWidths=cWidths.map(function(e,i){return Math.max(e,maxWidths[0][i]||0)})),maxWidths.push(cWidths);for(var x=0;x=breakPointer&&(columnWidths[1][cIdx-breakPointer]=colWidth,widths[1]=(widths[1]||0)+colWidth),cIdx===_this4._lastLevelKey&&(rowHeights[0][rIdx]=colHeight,rowHeights[1][rIdx]=colHeight)})}),{heights:[0,0],widths:widths,rowHeights:rowHeights,columnWidths:columnWidths}}}]),RowVisualMatrix}();function column_matrix_typeof(obj){return(column_matrix_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function column_matrix_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return function column_matrix_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ColumnVisualMatrix),(_this=column_matrix_possibleConstructorReturn(this,column_matrix_getPrototypeOf(ColumnVisualMatrix).call(this,matrix,config)))._breakPointer=matrix[0].length,_this._tree={key:COLUMN_ROOT,values:_this.createTree()},_this._logicalSpace=_this.computeLogicalSpace(),_this}return function column_matrix_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&column_matrix_setPrototypeOf(subClass,superClass)}(ColumnVisualMatrix,visual_matrix_VisualMatrix),function column_matrix_createClass(Constructor,protoProps,staticProps){return protoProps&&column_matrix_defineProperties(Constructor.prototype,protoProps),staticProps&&column_matrix_defineProperties(Constructor,staticProps),Constructor}(ColumnVisualMatrix,[{key:"computeLogicalSpace",value:function computeLogicalSpace(){var matrixTree=this.tree();return createMatrixEachLevel(matrixTree,!0),utils_computeLogicalSpace(matrixTree,this.config(),this.maxMeasures())}},{key:"computeViewableSpaces",value:function computeViewableSpaces(measures){var _this2=this,maxHeights=measures.maxHeights,maxWidths=measures.maxWidths,height=measures.height,width=measures.width;return this.viewableMatrix.map(function(matrixInst,i){var cellDimOptions={matrixInst:matrixInst,maxWidths:maxWidths,maxHeights:maxHeights,matrixIndex:i,height:height},_this2$getCellDimensi=_this2.getCellDimensions(cellDimOptions),heights=_this2$getCellDimensi.heights,rowHeights=_this2$getCellDimensi.rowHeights,columnWidths=_this2$getCellDimensi.columnWidths,heightMeasures=heights,columnMeasures=[width,width];return{rowHeights:{primary:rowHeights[0],secondary:rowHeights[1]},columnWidths:{primary:columnWidths[0],secondary:columnWidths[1]},height:{primary:heightMeasures[0],secondary:heightMeasures[1]},width:{primary:columnMeasures[0],secondary:columnMeasures[1]}}})}},{key:"removeExtraCells",value:function removeExtraCells(){var _this$config=this.config(),isTransposed=_this$config.isTransposed,extraCellLengths=_this$config.extraCellLengths,matrix=this._layoutMatrix,tree=mergeRecursive({},this.tree()),begCellLen=extraCellLengths[0],endCellLen=extraCellLengths[1]||Number.NEGATIVE_INFINITY,layoutMatrix=isTransposed?matrix.slice(0).map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}):extraCellsRemover(matrix,begCellLen,endCellLen);return tree.values=extraCellsRemover(tree.values,begCellLen,endCellLen),tree.matrix=tree.matrix.map(function(e){return extraCellsRemover(e,begCellLen,endCellLen)}),{tree:tree,layoutMatrix:layoutMatrix}}},{key:"getPriorityDistribution",value:function getPriorityDistribution(measures){var height=measures.height,maxHeights=measures.maxHeights,remainingHeight=height,heightDist=[],conditions=[],divider=2,priority=this.config().priority,primaryMatrixLength=this.primaryMatrix().length;return 2===priority?(conditions=[primaryMatrixLength-1,primaryMatrixLength],divider=2):(conditions=0===priority?[primaryMatrixLength-1]:[primaryMatrixLength],divider=1),maxHeights.forEach(function(heights,index){-1===conditions.indexOf(index)&&(heightDist[index]=heights,remainingHeight-=heights)}),remainingHeight<0?heightDist=heightDist.map(function(){return 0}):conditions.forEach(function(condition){heightDist[condition]=Math.min(maxHeights[condition],remainingHeight/divider)}),heightDist}},{key:"calculateDepth",value:function calculateDepth(widthMeasures){var j,width=this.availableSpace().width;for(j=0;j0)distWidth=availableWidth*distribution[colIndex]/distSum;else if(isDistributionEqual||0===width){var rowLen=row.length;distWidth=availableWidth/rowLen}return Math.floor(distWidth)})}({row:matrix[this._lastLevelKey],width:mWidth,availableWidth:width},this.config());matrix.forEach(function(row,rIdx){return row.forEach(function(col,cIdx){var oldLogicalSpace=col.getLogicalSpace();col.setAvailableSpace(cWidths[cIdx]-borderWidth,oldLogicalSpace.height),rHeights[rIdx]=Math.max(rHeights[rIdx]||0,Math.floor(col.getLogicalSpace().height))})}),maxHeights.length>0&&(rHeights=rHeights.map(function(e,i){return Math.max(e,maxHeights[0][i])})),maxHeights.push(rHeights);for(var x=0;x=breakPointer&&(rowHeights[1][rIdx-breakPointer]=colHeight,heights[1]=(heights[1]||0)+colHeight),rIdx===_this4._lastLevelKey&&(columnWidths[0][cIdx]=colWidth,columnWidths[1][cIdx]=colWidth)})}),{heights:heights,widths:[0,0],rowHeights:rowHeights,columnWidths:columnWidths}}}]),ColumnVisualMatrix}();function layout_helper_toConsumableArray(arr){return function layout_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);imaxMeasure&&layout.scrollInfo(computations_defineProperty({},scrollType,!0)),Math.max(maxMeasure,actualMeasure)}}(layout,paginationDetailsMap[matrixType],relatedMaxMeasure,buffer)},computations_getMatrixHeightDetails=function getMatrixHeightDetails(layout,columnMatrixWidth){var height=layout.measurement().height,buffer=layout.config().buffer,_getHeightRequiredByC=function getHeightRequiredByColMatrix(layout,columnMatrixWidth){var height=layout.measurement().height,columnMatrix=layout.columnMatrix(),maxColumnMatrixHeight=Math.min(columnMatrix.getLogicalSpace().height,height/2);columnMatrix.setAvailableSpace(columnMatrixWidth,maxColumnMatrixHeight);var columnViewSpace=columnMatrix.getViewableSpaces()[layout.config().columnPointer];return{columnMatrixHeight:columnViewSpace.height.primary+columnViewSpace.height.secondary,maxColumnMatrixHeight:maxColumnMatrixHeight}}(layout,columnMatrixWidth),columnMatrixHeight=_getHeightRequiredByC.columnMatrixHeight,maxColumnMatrixHeight=_getHeightRequiredByC.maxColumnMatrixHeight,maxHeightAvailableForRowMatrix=height-Math.min(maxColumnMatrixHeight,columnMatrixHeight);return{columnMatrixHeight:columnMatrixHeight,maxColumnMatrixHeight:maxColumnMatrixHeight,rowMatrixHeight:paginationMeasureGetter(layout,"row",maxHeightAvailableForRowMatrix,buffer),maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix}},bufferCondition={isScroll:!0,pagination:"scroll"},computations_getActualBufferFromConfig=function getActualBufferFromConfig(layout){var buffer=layout.config().buffer,_map2=computations_slicedToArray([enums_constants_HORIZONTAL,enums_constants_VERTICAL].map(function(type){return function getBufferFromCondition(layout,type){var scrollInfo=layout.scrollInfo(),currentBufferType={pagination:layout.config().pagination,isScroll:scrollInfo[type]};return Object.keys(bufferCondition).every(function(e){return bufferCondition[e]===currentBufferType[e]})}(layout,type)?buffer:0}),2);return{horizontalBuffer:_map2[0],verticalBuffer:_map2[1]}},computations_computeLayoutMeasurements=function computeLayoutMeasurements(layout){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_getMatrixWidthDetail=function getMatrixWidthDetails(layout){var rowMatrix=layout.rowMatrix(),width=layout.measurement().width,_layout$config3=layout.config(),border=_layout$config3.border,buffer=_layout$config3.buffer,borderWidth=border.width,rowMatrixWidth=getMatrixMeasurement(rowMatrix,"width"),maxRowMatrixWidth=Math.min(rowMatrixWidth+buffer,width/2),maxWidthAvailableForColumnMatrix=width-maxRowMatrixWidth-borderWidth;return{rowMatrixWidth:rowMatrixWidth,maxRowMatrixWidth:maxRowMatrixWidth,columnMatrixWidth:paginationMeasureGetter(layout,"column",maxWidthAvailableForColumnMatrix,0),maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}}(layout),rowMatrixWidth=_getMatrixWidthDetail.rowMatrixWidth,maxRowMatrixWidth=_getMatrixWidthDetail.maxRowMatrixWidth,maxWidthAvailableForColumnMatrix=_getMatrixWidthDetail.maxWidthAvailableForColumnMatrix,columnMatrixWidth=_getMatrixWidthDetail.columnMatrixWidth,_getMatrixHeightDetai=computations_getMatrixHeightDetails(layout,columnMatrixWidth),columnMatrixHeight=_getMatrixHeightDetai.columnMatrixHeight,rowMatrixHeight=_getMatrixHeightDetai.rowMatrixHeight,maxHeightAvailableForRowMatrix=_getMatrixHeightDetai.maxHeightAvailableForRowMatrix,_getActualBufferFromC=computations_getActualBufferFromConfig(layout),horizontalBuffer=_getActualBufferFromC.horizontalBuffer,verticalBuffer=_getActualBufferFromC.verticalBuffer;rowMatrix.setAvailableSpace(maxRowMatrixWidth-verticalBuffer,rowMatrixHeight-horizontalBuffer);var rowViewableSpaces=rowMatrix.getViewableSpaces(),columnViewableSpaces=columnMatrix.getViewableSpaces();return setViewSpaces(layout,"row",rowViewableSpaces),setViewSpaces(layout,"column",columnViewableSpaces),function setValueMatrixMeasurements(layout,rowViewableSpaces,columnViewableSpaces){var _ref,_ref2,_ref3,_ref4,_ref5,centerMatrix=layout.centerMatrix(),border=layout.config().border,matrices=layout.matrices(),top=matrices.top,bottom=matrices.bottom,borderWidth=border.width,rowHeights=(_ref=[]).concat.apply(_ref,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.rowHeights.primary}))),rowWidthsPrimary=(_ref2=[]).concat.apply(_ref2,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.primary}))),rowWidthsSecondary=(_ref3=[]).concat.apply(_ref3,computations_toConsumableArray(rowViewableSpaces.map(function(e){return e.columnWidths.secondary}))),columnWidths=(_ref4=[]).concat.apply(_ref4,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.columnWidths.primary}))),columnHeightsPrimary=columnViewableSpaces[0].rowHeights.primary,columnHeightsSecondary=(_ref5=[]).concat.apply(_ref5,computations_toConsumableArray(columnViewableSpaces.map(function(e){return e.rowHeights.secondary})));centerMatrix.forEach(function(matrix,rIdx){matrix.forEach(function(placeholder,cIdx){placeholder.setAvailableSpace(columnWidths[cIdx]-borderWidth,rowHeights[rIdx]-borderWidth)})}),computations_setAvailableSpace(top[0],rowWidthsPrimary,columnHeightsPrimary),computations_setAvailableSpace(top[2],rowWidthsSecondary,columnHeightsPrimary),computations_setAvailableSpace(bottom[0],rowWidthsPrimary,columnHeightsSecondary),computations_setAvailableSpace(bottom[2],rowWidthsSecondary,columnHeightsSecondary)}(layout,rowViewableSpaces,columnViewableSpaces),{rowMatrixHeight:rowMatrixHeight-horizontalBuffer,rowMatrixWidth:rowMatrixWidth-verticalBuffer,maxHeightAvailableForRowMatrix:maxHeightAvailableForRowMatrix-horizontalBuffer,columnMatrixHeight:columnMatrixHeight,columnMatrixWidth:columnMatrixWidth,maxWidthAvailableForColumnMatrix:maxWidthAvailableForColumnMatrix}},measureSum=function measureSum(measureArr){return measureArr.reduce(function(total,measure){return total+measure},0)};function layout_typeof(obj){return(layout_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function layout_defineProperties(target,props){for(var i=0;i0&&(leftMatrix=[].concat(layout_helper_toConsumableArray(topLeft),layout_helper_toConsumableArray(leftRows),layout_helper_toConsumableArray(bottomLeft))),rightRows.length>0&&(rightMatrix=[].concat(layout_helper_toConsumableArray(topRight),layout_helper_toConsumableArray(rightRows),layout_helper_toConsumableArray(bottomRight))),topColumns.length>0&&topColumns[0].length>0&&(topMatrix=topColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(topLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(topRight[i]))})),bottomColumns.length>0&&bottomColumns[0].length>0&&(bottomMatrix=bottomColumns.map(function(d,i){return[].concat(layout_helper_toConsumableArray(bottomLeft[i]),layout_helper_toConsumableArray(d),layout_helper_toConsumableArray(bottomRight[i]))})),context.rowMatrix(new row_matrix_RowVisualMatrix([leftMatrix,rightMatrix],{isDistributionEqual:isRowSizeEqual,distribution:distribution.rows,gutter:gutterSpace.rows,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.row,breakPage:breakPage.rows.map(function(e){return e+Math.max(topLeft.length,topRight.length)}),extraCellLengths:[topLeft.length,bottomLeft.length]})),begColCells=topLeft.length>0?topLeft[0].length:bottomLeft.length>0?bottomLeft[0].length:0,endColCells=topRight.length>0?topRight[0].length:bottomRight.length>0?bottomRight[0].length:0,context.columnMatrix(new column_matrix_ColumnVisualMatrix([topMatrix,bottomMatrix],{isDistributionEqual:isColumnSizeEqual,distribution:distribution.columns,gutter:gutterSpace.columns,isTransposed:!0,unitMeasures:{width:minUnitWidth,height:minUnitHeight,border:border.width},priority:priority.col,breakPage:breakPage.columns,extraCellLengths:[begColCells,endColCells]})),context.centerMatrix(valueMatrix),matrices}(this,_matrices),this):layout_get(layout_getPrototypeOf(GridLayout.prototype),"matrices",this).call(this,_matrices)}},{key:"triggerReflow",value:function triggerReflow(){this.scrollInfo({horizontal:!1,vertical:!1});var _computeLayoutMeasure=computations_computeLayoutMeasurements(this),maxHeightAvailableForRowMatrix=_computeLayoutMeasure.maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix=_computeLayoutMeasure.maxWidthAvailableForColumnMatrix;return this.setViewInformation(maxHeightAvailableForRowMatrix,maxWidthAvailableForColumnMatrix),this}},{key:"gotoPage",value:function gotoPage(type,pageNumber){var pageType=type.toLowerCase(),totalPages=this.viewInfo().viewMatricesInfo["".concat(pageType,"Pages")],pointer=Math.min(Math.max(1,pageNumber),totalPages);return this.config(function layout_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}({},"".concat(pageType,"Pointer"),pointer-1)),this.setViewInformation(),this.renderGrid(),this}},{key:"pages",value:function pages(type){var viewMatricesInfo=this.viewInfo().viewMatricesInfo,pageType=type.toLowerCase();return{totalPages:viewMatricesInfo["".concat(pageType,"Pages")],currentPage:this.config()["".concat(pageType,"Pointer")]+1}}},{key:"viewInfo",value:function viewInfo(){return arguments.length?(this._viewInfo=arguments.length<=0?void 0:arguments[0],this):this._viewInfo}},{key:"scrollInfo",value:function scrollInfo(){return arguments.length?(this._scrollInfo=mergeRecursive(this._scrollInfo,arguments.length<=0?void 0:arguments[0]),this):this._scrollInfo}},{key:"setViewInformation",value:function setViewInformation(maxRowHeight,maxColWidth){var _this$config2=this.config(),rowPointer=_this$config2.rowPointer,columnPointer=_this$config2.columnPointer,border=_this$config2.border,viewMatricesInfo=function getViewMatrices(layout,rowPointer,columnPointer){for(var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),centerMatrix=layout.centerMatrix(),matrices=layout.matrices(),rowMatrices=rowMatrix.getViewableMatrices(),columnMatrices=columnMatrix.getViewableMatrices(),centralMatrixPointer={row:0,column:0},i=rowPointer-1;i>=0;i--){var length=Math.max(rowMatrices[i].primaryMatrix.length,rowMatrices[i].secondaryMatrix.length);centralMatrixPointer.row+=length}for(var _i=columnPointer-1;_i>=0;_i--){var matrix=columnMatrices[_i],primaryMatrix=matrix.primaryMatrix,secondaryMatrix=matrix.secondaryMatrix,_length=Math.max(primaryMatrix[0]?primaryMatrix[0].length:0,secondaryMatrix[0]?secondaryMatrix[0].length:0);centralMatrixPointer.column+=_length}matrices.top[1]=columnMatrices[columnPointer].primaryMatrix,matrices.bottom[1]=columnMatrices[columnPointer].secondaryMatrix,matrices.center[0]=rowMatrices[rowPointer].primaryMatrix,matrices.center[2]=rowMatrices[rowPointer].secondaryMatrix;var rowMatrixLen=Math.max(matrices.center[0].length,matrices.center[2].length),columnMatrixLen=Math.max(matrices.top[1][0]?matrices.top[1][0].length:0,matrices.bottom[1][0]?matrices.bottom[1][0].length:0);return matrices.center[1]=centerMatrix.slice(centralMatrixPointer.row,centralMatrixPointer.row+rowMatrixLen).map(function(matrix){return matrix.slice(centralMatrixPointer.column,centralMatrixPointer.column+columnMatrixLen)}),{matrices:matrices,rowPages:rowMatrices.length,columnPages:columnMatrices.length}}(this,rowPointer,columnPointer),layoutDimensions=function getViewMeasurements(layout,maxRowHeight,maxColWidth){var rowMatrix=layout.rowMatrix(),columnMatrix=layout.columnMatrix(),_layout$config=layout.config(),columnPointer=_layout$config.columnPointer,rowPointer=_layout$config.rowPointer,rowSpaces=rowMatrix.getViewableSpaces()[rowPointer],colSpaces=columnMatrix.getViewableSpaces()[columnPointer],rowHeights=rowSpaces.rowHeights,rowMatrixWidth=rowSpaces.width,columnWidths=colSpaces.columnWidths,columnMatrixHeight=colSpaces.height,leftWidth=rowMatrixWidth.primary,rightWidth=rowMatrixWidth.secondary,topHeight=columnMatrixHeight.primary,bottomHeight=columnMatrixHeight.secondary,centerHeight=measureSum(rowHeights.primary),centerWidth=measureSum(columnWidths.primary),viewWidth=[leftWidth,Math.min(centerWidth,maxColWidth),rightWidth],viewHeight=[topHeight,Math.min(centerHeight,maxRowHeight),bottomHeight];return{viewWidth:viewWidth,viewHeight:viewHeight,actualCenterMeasures:{height:centerHeight,width:centerWidth},totalMeasures:{width:measureSum(viewWidth),height:measureSum(viewHeight)},unitHeights:rowHeights,unitWidths:columnWidths}}(this,maxRowHeight,maxColWidth);return layoutDimensions.border=border,this.viewInfo({viewMatricesInfo:viewMatricesInfo,layoutDimensions:layoutDimensions}),this}}],[{key:"defaultViewInfo",value:function defaultViewInfo(){return Object.assign({},{layoutDimensions:{border:this.defaultConfig().border,viewHeight:[0,0,0],viewWidth:[0,0,0]},viewMatricesInfo:{columnPages:0,rowPages:0,matrices:{top:[],center:[],bottom:[]}}})}},{key:"defaultMeasurement",value:function defaultMeasurement(){return DEFAULT_MEASUREMENTS}},{key:"defaultConfig",value:function defaultConfig(){return DEFAULT_CONFIGURATION}},{key:"create",value:function create(){return new GridLayout(null,null,this.defaultMeasurement(),this.defaultConfig())}}]),GridLayout}();function border_helper_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var _matrixSpanGeneratorM,_spanApplierMap,border_helper_specificBorderApplier=function specificBorderApplier(params){var borderTypes=params.borderTypes,showBorders=params.showBorders,cells=params.cells,borderInfo=params.borderInfo,name=params.name,isFacet=params.isFacet,color=borderInfo.color,style=borderInfo.style,width=borderInfo.width;borderTypes.forEach(function(borderType){!function applySpecificBorder(params){var type=params.type,borderWidth=params.borderWidth,borderStyle=params.borderStyle,cells=params.cells,isFacet=params.isFacet,color=params.color;isFacet?(cells.style("border-".concat(type,"-width"),"".concat(borderWidth,"px")),cells.style("border-".concat(type,"-style"),"".concat(borderStyle))):cells.style("border-".concat(type),"".concat(borderWidth,"px ").concat(borderStyle," ").concat(color))}({cells:cells,color:showBorders[borderType]?color:"rgba(0,0,0,0)",type:borderType,borderWidth:width,borderStyle:style,name:name,isFacet:isFacet})})},border_helper_applyBorders=function applyBorders(params){var cells=params.cells,border=params.border,row=params.row,column=params.column,isFacet=params.isFacet,showHeaders=params.showHeaders,name="".concat(ROW_MATRIX_INDEX[VIEW_INDEX[row]],"-").concat(COLUMN_MATRIX_INDEX[column]),borderApplierFn=function borderApplier(cells,borderInfo,name,isFacet){var _ref2,showRowBorders=borderInfo.showRowBorders,showColBorders=borderInfo.showColBorders,showValueBorders=borderInfo.showValueBorders;return border_helper_defineProperty(_ref2={},"row",function(){return border_helper_specificBorderApplier({borderTypes:["top","bottom"],showBorders:showRowBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"column",function(){return border_helper_specificBorderApplier({borderTypes:["left","right"],showBorders:showColBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"center",function(){return border_helper_specificBorderApplier({borderTypes:["left","right","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"left",function(){return border_helper_specificBorderApplier({borderTypes:["left"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"right",function(){return border_helper_specificBorderApplier({borderTypes:["right"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"".concat("center").concat("left"),function _(){return border_helper_specificBorderApplier({borderTypes:["left","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),border_helper_defineProperty(_ref2,"".concat("center").concat("right"),function _(){return border_helper_specificBorderApplier({borderTypes:["right","top","bottom"],showBorders:showValueBorders,cells:cells,borderInfo:borderInfo,name:name,isFacet:isFacet})}),_ref2}(cells,border,name,isFacet),borderMapVal=function borderMap(isFacet,showHeaders){var _ref;return border_helper_defineProperty(_ref={},"".concat("top","-").concat("left"),isFacet&&showHeaders?"left":null),border_helper_defineProperty(_ref,"".concat("top","-").concat("middle"),"column"),border_helper_defineProperty(_ref,"".concat("top","-").concat("right"),isFacet&&showHeaders?"right":null),border_helper_defineProperty(_ref,"".concat("center","-").concat("left"),isFacet?"".concat("center").concat("left"):"row"),border_helper_defineProperty(_ref,"".concat("center","-").concat("middle"),"center"),border_helper_defineProperty(_ref,"".concat("center","-").concat("right"),isFacet?"".concat("center").concat("right"):"row"),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("left"),null),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("middle"),"column"),border_helper_defineProperty(_ref,"".concat("bottom","-").concat("right"),null),_ref}(isFacet,showHeaders)[name];borderMapVal&&borderApplierFn[borderMapVal]()};function span_maker_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var orderMaker=function orderMaker(arr){return Array.from(Array(arr.length).keys())},nestByStack=function nestByStack(stack,updateArr){var optionalParams=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},order=optionalParams.order,keyFn=optionalParams.keyFn,arr=updateArr.slice(),currStack=stack.slice(),prevStack=currStack.slice();if(order=order||Array.from(Array(arr.length).keys()),keyFn=keyFn||function(v){return v},0===currStack.length){var _newArr=[];return order.forEach(function(e){_newArr.push(arr[e])}),{prevStack:prevStack,currStack:arr,arr:_newArr}}for(var arrVal="",stackVal="",newArr=[],i=order.length-1;i>=0;i--){var currElemIndex=order[i];if((arrVal+=keyFn(arr[currElemIndex]))===(stackVal+=keyFn(currStack[currElemIndex])))newArr[currElemIndex]=null;else{stackVal="";for(var j=i;j0&&void 0!==arguments[0]?arguments[0]:1,placeholder=arguments.length>1?arguments[1]:void 0,config=arguments.length>2?arguments[2]:void 0,index=arguments.length>3?arguments[3]:void 0,height=placeholder.availHeight(),width=placeholder.availWidth(),borderWidth=config.border.width,unitWidths=config.dimensions.unitWidths,col=index.col;return span_maker_defineProperty(_ref={},"rowSpan",function(){placeholder.setAvailableSpace(width,height*span),1===span&&renderer_utils_selectElement(this).style("height","".concat(height*span+borderWidth,"px"))}),span_maker_defineProperty(_ref,"colSpan",function(){var primaryUnitWidth=unitWidths.primary[col];if(span>1){for(var cumulativeWidth=0,i=col;i0&&void 0!==arguments[0]?arguments[0]:0}},{key:"type",get:function get(){return"simple"}}],[{key:"formalName",value:function formalName(){return"SimpleCell"}},{key:"defaultConfig",value:function defaultConfig(){return{}}}]),SimpleCell}();function enums_defaults_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var visual_cell_src_props_PROPS,enums_defaults_DEFAULT_CONFIG=(enums_defaults_defineProperty(_DEFAULT_CONFIG={},"margin",(enums_defaults_defineProperty(_CONSTANTS$MARGIN={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$MARGIN,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$MARGIN)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"spaceFixer",2),enums_defaults_defineProperty(_DEFAULT_CONFIG,"isOffset",!1),enums_defaults_defineProperty(_DEFAULT_CONFIG,"verticalAlign",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"textAlign","center"),enums_defaults_defineProperty(_DEFAULT_CONFIG,"show",!0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"maxLines",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"minCharacters",0),enums_defaults_defineProperty(_DEFAULT_CONFIG,"rotation",null),enums_defaults_defineProperty(_DEFAULT_CONFIG,"padding",(enums_defaults_defineProperty(_CONSTANTS$PADDING={},visual_cell_src_enums_constants_LEFT,8),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_RIGHT,8),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_TOP,10),enums_defaults_defineProperty(_CONSTANTS$PADDING,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$PADDING)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"headerPadding",(enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD={},visual_cell_src_enums_constants_LEFT,8),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_RIGHT,5),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_TOP,2),enums_defaults_defineProperty(_CONSTANTS$HEADER_PAD,visual_cell_src_enums_constants_BOTTOM,5),_CONSTANTS$HEADER_PAD)),enums_defaults_defineProperty(_DEFAULT_CONFIG,"titlePadding",(enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD={},visual_cell_src_enums_constants_LEFT,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_RIGHT,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_TOP,0),enums_defaults_defineProperty(_CONSTANTS$TITLE_PADD,visual_cell_src_enums_constants_BOTTOM,0),_CONSTANTS$TITLE_PADD)),_DEFAULT_CONFIG);function visual_cell_src_props_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var DEFAULT_PROPS={mount:{},availHeight:{},availWidth:{},config:{sanitization:function sanitization(context,value){return mergeRecursive(context._config,value)}},logicalSpace:{},minSpacing:{},source:{}},packages_visual_cell_src_props_PROPS=(visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS={},GEOM,mergeRecursive({data:{},caption:{},config:{},axes:{},facetByFields:{},fields:{},transform:{},layerDef:{},detailFields:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_TEXT,mergeRecursive({smartText:{}},DEFAULT_PROPS)),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,cell_type_AXIS,DEFAULT_PROPS),visual_cell_src_props_defineProperty(visual_cell_src_props_PROPS,BLANK,DEFAULT_PROPS),visual_cell_src_props_PROPS);function axis_cell_typeof(obj){return(axis_cell_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function axis_cell_defineProperties(target,props){for(var i=0;i(availWidth||0)&&maxLines&&(space.height=space.oriTextHeight*maxLines),availWidth&&availWidthcurrHeight?(sections++,currWidth=0,currHeight=legHeight):sections<0&§ions++,sectionComponents[sections]=sectionComponents[sections]||[],currHeight-=Math.min(leg.measurement().height,currHeight),currWidth=Math.max(Math.min(leg.measurement().width,leg.measurement().maxWidth),currWidth),sectionComponents[sections].push({legend:leg,legendHeight:legHeight,legendWidth:currWidth})});var mount=makeElement(legendMount,["div"],sectionComponents,"".concat(classPrefix,"-legend-section"));mount.classed("".concat(classPrefix,"-legend-vertical-section"),!0).style("width",function(d){return"".concat(d[0].legendWidth,"px")}),makeElement(mount,["div"],function(d){return d},"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).each(function(d){d.legend.mount(this)}).style("width",function(d){return"".concat(d.legendWidth,"px")})}else{var _mount=makeElement(legendMount,"div",[1],"".concat(classPrefix,"-legend-section"));_mount.classed("".concat(classPrefix,"-legend-horizontal-section"),!0),_mount.classed("".concat(classPrefix,"-legend-section-",0),!0).style("width","".concat(legWidth,"px")),makeElement(_mount,"div",this.components,"".concat(classPrefix,"-legend-components"),{},function(d){return d.legend.id()}).style("width",function(d){return"".concat(d.legend.measurement().width,"px")}).each(function(d){d.legend.mount(this)})}}},{key:"draw",value:function draw(container){this.renderLegend(container||document.getElementById(this.renderAt()))}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.boundBox(params.config.measurement.legendSpace),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.components=params.component,this.params=params,this.target(params.config.target),this.position(params.config.position);var _defaultAlignmentHelp=function defaultAlignmentHelper(position){var alignment=null,alignWith="".concat(ROW_MATRIX_INDEX[1],"-").concat(COLUMN_MATRIX_INDEX[1]);switch(position){case src_constants_TOP:case src_constants_BOTTOM:alignment=HORIZONTAL_CENTER;break;case src_constants_LEFT:case src_constants_RIGHT:alignment=VERTICAL_CENTER;break;default:alignment=VERTICAL_CENTER}return{alignment:alignment,alignWith:alignWith}}(params.config.position),alignWith=_defaultAlignmentHelp.alignWith,alignment=_defaultAlignmentHelp.alignment;this.className(params.config.className),this.alignWith(params.config.alignWith||alignWith),this.alignment(params.config.alignment||alignment)}},{key:"setComponentInfo",value:function setComponentInfo(params){var rootNode=params.rootNode;this.components.forEach(function(legendInfo){legendInfo.legend.setParentInfo({canvasRoot:rootNode})})}}]),LegendComponent}(),helper_d3Drag=(__webpack_require__(37),renderer_utils_getD3Drag()),arrowSizeMap={left:"width",right:"width",top:"height",bottom:"height"},getUnitPositions=function getUnitPositions(unitMeasures,totalLength,viewLength){var currentLen=0;return(unitMeasures.primary&&unitMeasures.primary.length?unitMeasures.primary:unitMeasures.secondary).map(function(e){var unitPosition=100*currentLen/(totalLength-viewLength);return currentLen+=e,unitPosition})},helper_createScrollBarArrow=function createScrollBarArrow(mount,type,config){var classPrefix=config.classPrefix,thickness=config.thickness,arrow=makeElement(mount,"div",[type],"".concat(classPrefix,"-scroll-arrow-").concat(type));return arrow.classed("".concat(classPrefix,"-scroll-arrow"),!0),arrow.style(arrowSizeMap[type],"".concat(thickness,"px")),makeElement(arrow,"div",[1],"".concat(classPrefix,"-scroll-arrow-chevron")).attr("id","".concat(classPrefix,"-scroll-arrow-chevron-").concat(type)),arrow},helper_createScrollBarRect=function createScrollBarRect(mount,config){var classPrefix=config.classPrefix,rect=makeElement(mount,"div",[1],"".concat(classPrefix,"-scroll-rect"));return{rect:rect,mover:makeElement(rect,"div",[1],"".concat(classPrefix,"-scroll-mover"))}},applyScrollMouseDownAction=function applyScrollMouseDownAction(moverRect,scrollMaker,speed){var mover=moverRect.mover,rect=moverRect.rect,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y;scrollMaker.changeMoverPosition({x:x-rectX+speed,y:y-rectY+speed})},helper_registerListenerOnArrow=function registerListenerOnArrow(scrollMaker,moverRect,arrowType,speed){var timer="",arrow=scrollMaker._components[arrowType],isTouchDevice=hasTouch();arrow.on(isTouchDevice?"touchstart":"mousedown",function(){renderer_utils_getEvent().preventDefault(),timer=setInterval(function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)},100)}).on(isTouchDevice?"touchend":"mouseup",function(){renderer_utils_getEvent().preventDefault(),clearInterval(timer)}).on("click",function(){applyScrollMouseDownAction(moverRect,scrollMaker,speed)})},helper_registerListeners=function registerListeners(scrollMaker){var moverRect=scrollMaker._components.moverRect,speed=scrollMaker.config().speed;helper_registerListenerOnArrow(scrollMaker,moverRect,"prevArrow",-speed),function applyMoverDrag(scrollMaker,moverRect){var startPos={},moverStartPos=0,rectStartPos=0,endPos={},mover=moverRect.mover,rect=moverRect.rect;mover.call(helper_d3Drag().on("start",function(){var event=renderer_utils_getEvent();moverStartPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect(),startPos={x:event.x,y:event.y}}).on("drag",function(){var event=renderer_utils_getEvent(),window=getWindow(),distanceMoved_x=(endPos={x:event.x,y:event.y}).x-startPos.x,distanceMoved_y=endPos.y-startPos.y,actualPosition={x:moverStartPos.x+distanceMoved_x-rectStartPos.x+window.pageXOffset,y:moverStartPos.y+distanceMoved_y-rectStartPos.y+window.pageYOffset};scrollMaker.changeMoverPosition(actualPosition)}))}(scrollMaker,moverRect),function applyRectClick(scrollMaker,moverRect){moverRect.rect.on("click",function(){var event=renderer_utils_getEvent();scrollMaker.emptyScrollAreaClick(event)})}(scrollMaker,moverRect),helper_registerListenerOnArrow(scrollMaker,moverRect,"nextArrow",speed)},scroll_bar_maker_props_PROPS={config:{sanitization:function sanitization(context,value){return value=mergeRecursive(context._config,value)}},manager:{},unitPositions:{},logicalSpace:{}};function scroll_maker_defineProperties(target,props){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=horizontal_scroll_maker_get(horizontal_scroll_maker_getPrototypeOf(HorizontalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,config,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"left",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"right",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitWidths=_this$logicalSpace.unitWidths,scrollBarWithouArrowLength=width-2*height;rect.style("width","".concat(dimensions.width-2*height,"px")),rect.style("height","".concat(100,"%")),mover.style("width","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style("height","".concat(100,"%")),mover.style(src_constants_LEFT,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitWidths,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.xrectStartPos.width?rectStartPos.width-moverPos.width:newPosition.x,mover.style(src_constants_LEFT,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:0,x:moverPos.x-rectStartPos.x-delta}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.width)/100;return this.changeMoverPosition({y:0,x:movement}),this}}],[{key:"type",value:function type(){return"horizontal"}}]),HorizontalScrollMaker}(),vertical:function(_ScrollMaker){function VerticalScrollMaker(){return function vertical_scroll_maker_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,VerticalScrollMaker),vertical_scroll_maker_possibleConstructorReturn(this,vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker).apply(this,arguments))}return function vertical_scroll_maker_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&vertical_scroll_maker_setPrototypeOf(subClass,superClass)}(VerticalScrollMaker,scroll_maker_ScrollMaker),function vertical_scroll_maker_createClass(Constructor,protoProps,staticProps){return protoProps&&vertical_scroll_maker_defineProperties(Constructor.prototype,protoProps),staticProps&&vertical_scroll_maker_defineProperties(Constructor,staticProps),Constructor}(VerticalScrollMaker,[{key:"createScroll",value:function createScroll(mountPoint){var dimensions=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.logicalSpace(),config=this.config(),scrollBarContainer=vertical_scroll_maker_get(vertical_scroll_maker_getPrototypeOf(VerticalScrollMaker.prototype),"createScroll",this).call(this,mountPoint,dimensions).scrollBarContainer,prevArrow=helper_createScrollBarArrow(scrollBarContainer,"top",config),moverRect=helper_createScrollBarRect(scrollBarContainer,config),nextArrow=helper_createScrollBarArrow(scrollBarContainer,"bottom",config),mover=moverRect.mover,rect=moverRect.rect,_this$logicalSpace=this.logicalSpace(),height=_this$logicalSpace.height,width=_this$logicalSpace.width,totalLength=_this$logicalSpace.totalLength,viewLength=_this$logicalSpace.viewLength,unitHeights=_this$logicalSpace.unitHeights,scrollBarWithouArrowLength=height-2*width;rect.style("height","".concat(scrollBarWithouArrowLength,"px")),rect.style("width","".concat(100,"%")),mover.style("width","".concat(100,"%")),mover.style("height","".concat(viewLength*scrollBarWithouArrowLength/totalLength,"px")),mover.style(src_constants_TOP,"".concat(0,"px")),this._components={prevArrow:prevArrow,nextArrow:nextArrow,moverRect:moverRect,scrollBarContainer:scrollBarContainer},this._scrollBarWithouArrowLength=scrollBarWithouArrowLength,this.unitPositions(getUnitPositions(unitHeights,totalLength,viewLength)),this.registerListeners()}},{key:"emptyScrollAreaClick",value:function emptyScrollAreaClick(event){var _this$_components$mov=this._components.moverRect,mover=_this$_components$mov.mover,rect=_this$_components$mov.rect,speed=this.config().speed,_mover$node$getBoundi=mover.node().getBoundingClientRect(),x=_mover$node$getBoundi.x,y=_mover$node$getBoundi.y,_rect$node$getBoundin=rect.node().getBoundingClientRect(),rectX=_rect$node$getBoundin.x,rectY=_rect$node$getBoundin.y,positionAdjuster=10*speed;event.yrectStartPos.height?rectStartPos.height-moverPos.height:newPosition.y,mover.style(src_constants_TOP,"".concat(currentPos,"px"));var movedViewLength=currentPos*totalLength/this._scrollBarWithouArrowLength;this.manager().performAttachedScrollFunction(this.constructor.type(),movedViewLength)}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){var _this$_components$mov3=this._components.moverRect,mover=_this$_components$mov3.mover,rect=_this$_components$mov3.rect,moverPos=mover.node().getBoundingClientRect(),rectStartPos=rect.node().getBoundingClientRect();return this.changeMoverPosition({y:moverPos.y-rectStartPos.y-delta,x:0}),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){var moverPos=this._components.moverRect.mover.node().getBoundingClientRect(),movement=scrollPercentage*(this._scrollBarWithouArrowLength-moverPos.height)/100;return this.changeMoverPosition({x:0,y:movement}),this}}],[{key:"type",value:function type(){return"vertical"}}]),VerticalScrollMaker}()},ScrollComponent=function(_MuzeComponent){function ScrollComponent(params){var _this;!function scroll_component_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ScrollComponent);var ScrollMaker=scrollMakerMap[params.config.type];return params.component=new ScrollMaker,params.component.config(params.config.scrollBarComponentConfig),params.component.logicalSpace(params.dimensions),(_this=scroll_component_possibleConstructorReturn(this,scroll_component_getPrototypeOf(ScrollComponent).call(this,params.name,params.component.getLogicalSpace(),0))).setParams(params),_this}return function scroll_component_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&scroll_component_setPrototypeOf(subClass,superClass)}(ScrollComponent,MuzeComponent),function scroll_component_createClass(Constructor,protoProps,staticProps){return protoProps&&scroll_component_defineProperties(Constructor.prototype,protoProps),staticProps&&scroll_component_defineProperties(Constructor,staticProps),Constructor}(ScrollComponent,[{key:"manager",value:function manager(){return arguments.length?(this.component.manager(arguments.length<=0?void 0:arguments[0]),this):this.component.manager()}},{key:"scrollDeltaTo",value:function scrollDeltaTo(delta){return this.component.scrollDeltaTo(delta),this}},{key:"scrollTo",value:function scrollTo(scrollPercentage){return this.component.scrollTo(scrollPercentage),this}},{key:"scrollToUnitIndex",value:function scrollToUnitIndex(unitIndex){var unitPositions=this.component.unitPositions(),sanitizedUnitIndex=Math.min(Math.max(0,unitIndex),unitPositions.length-1);return this.component.scrollTo(unitPositions[sanitizedUnitIndex]),this}},{key:"getScrollPositionsForUnits",value:function getScrollPositionsForUnits(){return this.component.unitPositions()}},{key:"draw",value:function draw(container){return this.component.createScroll(container||document.getElementById(this.renderAt())),this}},{key:"attachScrollAction",value:function attachScrollAction(externalAction){return this.component.attachScrollAction(externalAction),this}},{key:"detachScrollAction",value:function detachScrollAction(){return this.component.detachScrollAction(),this}},{key:"updateWrapper",value:function updateWrapper(params){return this.name(params.name),this.component.config(params.config.scrollBarComponentConfig),this.component.logicalSpace(params.dimensions),this.boundBox(this.component.getLogicalSpace()),this.setParams(params),this}},{key:"setParams",value:function setParams(params){this.component=params.component||this.component,this.params=params,this.target(params.config.target),this.position(params.config.position),this.className(params.config.className),this.alignWith(params.config.alignWith),this.alignment(params.config.alignment)}},{key:"remove",value:function remove(){this.component.remove()}}]),ScrollComponent}();__webpack_require__(38);function matrix_component_typeof(obj){return(matrix_component_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function matrix_component_defineProperties(target,props){for(var i=0;iMath.abs(wheelDeltaY)&&scrollBarManager.preventBrowserScroll("horizontal",event).triggerScrollBarAction("horizontal",wheelDeltaX/30),0!==wheelDeltaY&&Math.abs(wheelDeltaX)MESSAGE_CONFIG.baseSizeLimit?MESSAGE_CONFIG.fractionChild*height:0,message=config.message;renderer_utils_applyStyle(node,{width:"".concat(width,"px"),height:"".concat(height,"px")});var childNode=makeElement(node,"div",[1],"".concat(className,"-child")),imageNode=makeElement(childNode,"div",[1],"".concat(className,"-child-img")),messageNode=makeElement(childNode,"div",[1],"".concat(className,"-child-message"));renderer_utils_applyStyle(childNode,{width:width,height:"".concat(childHeight,"px")}),renderer_utils_applyStyle(imageNode,{width:width,height:"".concat(childHeight*MESSAGE_CONFIG.fractionImage,"px")}),imageNode.html('\n\x3c!-- Generator: Sketch 60.1 (88133) - https://sketch.com --\x3e\n\nGroup 23\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ');var textElement=makeElement(messageNode,"text",[1]);renderer_utils_applyStyle(messageNode,{"font-size":"".concat(function formatFontSize(width,height){var baseFontLimit=MESSAGE_CONFIG.baseFontLimit,upperFontLimit=MESSAGE_CONFIG.upperFontLimit,baseSizeLimit=MESSAGE_CONFIG.baseSizeLimit,upperSizeLimit=MESSAGE_CONFIG.upperSizeLimit,fontSize=upperFontLimit,dim=widthbaseSizeLimit&&dim0?heightAttr:height,minHeight),availableWidthForCanvas=Math.max(widthAttr>0?widthAttr:width,minWidth),_createHeaders=function createHeaders(context,canvasHeight,canvasWidth){var headerHeight=0,headers={},subtitle=context.subtitle(),isSubtitle=title_maker_resolveTitleSubTitleContent(subtitle[0]);return canvasHeight>=200&&canvasWidth>=200&&["title","subtitle"].forEach(function(type){var headerOptions=context[type](),content=title_maker_resolveTitleSubTitleContent(headerOptions[0]);if(content){var config=headerOptions[1];config.width=context.width(),config.height=context.height(),config.classPrefix=context.config().classPrefix,config.content=content,config.padding="title"!==type||isSubtitle.length?config.padding:subtitle[1].padding;var _createHeading=createHeading(config,type,context.dependencies().smartlabel,context["".concat(type,"Cell")]),height=_createHeading.height,cell=_createHeading.cell;headers["".concat(type,"Cell")]=cell,context._composition[type]=cell,headerHeight+=height}}),{headerHeight:headerHeight,headers:headers}}(context,availableHeightForCanvas,availableWidthForCanvas),headers=_createHeaders.headers,headerHeight=_createHeaders.headerHeight,legends=function createLegend(context,headerHeight,height,width){var measurement={height:height,width:width,headerHeight:headerHeight},legend=context.config().legend,show=legend.show,position=legend.position;legend.classPrefix=context.config().classPrefix;var align=position===src_constants_LEFT||position===src_constants_RIGHT?"vertical":"horizontal";return legend.show=show?"vertical"===align&&width>200||"horizontal"===align&&height>200:show,legend.align=align,legend_maker_legendInitializer(legend,context,measurement,context.composition().legend||{})}(context,headerHeight,availableHeightForCanvas,availableWidthForCanvas);context._composition.legend={},legends.forEach(function(e){context._composition.legend[e.scaleType]=e.legend});var legendSpace=function getLegendSpace(legends,legendConfig,availableHeight,availableWidth){var legendSpace={width:0,height:0};return legends.map(function(legendInfo){return legendInfo.legend.measurement()}).forEach(function(space){var height,width;width=Math.min(space.width,space.maxWidth),height=Math.min(space.height,space.maxHeight),"horizontal"===legendConfig.align?legendSpace.width+width>availableWidth?(legendSpace.width=availableWidth,legendSpace.height+=height):(legendSpace.width+=width,legendSpace.height=Math.max(legendSpace.height,height)):legendSpace.height+height>availableHeight?(legendSpace.height=height,legendSpace.width+=width):(legendSpace.height+=height,legendSpace.width=Math.max(legendSpace.width,width))}),"horizontal"===legendConfig.align&&(legendSpace.width=availableWidth),legendSpace}(legends,legend,availableHeightForCanvas,availableWidthForCanvas),legendWidth=legendPosition===src_constants_LEFT||legendPosition===src_constants_RIGHT?legendSpace.width:0,legendHeight=legendPosition===src_constants_TOP||legendPosition===src_constants_BOTTOM?legendSpace.height:0,components={headers:headers,legends:legends,canvases:[context],rows:rows,columns:columns,values:values,cornerMatrices:visGroup.cornerMatrices()},measurement={mountSpace:{height:height,width:width},headerHeight:headerHeight,legendSpace:legendSpace,canvasWidth:availableWidthForCanvas,canvasHeight:availableHeightForCanvas,width:availableWidthForCanvas-legendWidth,height:availableHeightForCanvas-headerHeight-legendHeight,minUnitHeight:context.minUnitHeight(),minUnitWidth:context.minUnitWidth()};return{layoutConfig:layoutConfig=mergeRecursive(layoutConfig,{classPrefix:classPrefix,showHeaders:showHeaders,border:mergeRecursive(visGroup.metaData().border,context.config().border),layoutArrangement:layoutArrangement,legend:legend,buffer:scrollBar.thickness,pagination:pagination,title:titleConfig,subtitle:subtitleConfig,isColumnSizeEqual:isColumnSizeEqual,isRowSizeEqual:isRowSizeEqual,mount:mount,priority:priority}),components:components,measurement:measurement}},componentIndexes={title:0,subtitle:1,legend:2,verticalScrollBar:3,horizontalScrollBar:4,grid:5,message:6},componentNames={0:"title",1:"subtitle",2:"legend",3:"verticalScrollBar",4:"horizontalScrollBar",5:"grid",6:"message"},layout_maker_renderLayout=function renderLayout(canvas,renderDetails){var layoutManager=canvas._layoutManager,gridLayout=canvas.layout(),grid=componentIndexes.grid,compWrappers=component_wrapper_maker_componentWrapperMaker(canvas,gridLayout,renderDetails),componentWrappers=Object.keys(componentIndexes).map(function(e){return compWrappers[e]});componentWrappers[grid]&&function createScrollManager(componentWrappers,canvas){var verticalScrollBar=componentIndexes.verticalScrollBar,grid=componentIndexes.grid,horizontalScrollWrapper=componentWrappers[componentIndexes.horizontalScrollBar],verticalScrollWrapper=componentWrappers[verticalScrollBar],gridWrapper=componentWrappers[grid],scrollBarManager=new ScrollManager,scrollBarComponents={};verticalScrollWrapper&&(scrollBarComponents.vertical=verticalScrollWrapper),horizontalScrollWrapper&&(scrollBarComponents.horizontal=horizontalScrollWrapper),scrollBarManager.scrollBarComponents(scrollBarComponents).attachedComponents({grid:gridWrapper}),canvas.composition().hScrollBar=horizontalScrollWrapper,canvas.composition().vScrollBar=verticalScrollWrapper,[horizontalScrollWrapper,verticalScrollWrapper].forEach(function(wrapper){wrapper&&wrapper.manager(scrollBarManager)}),gridWrapper.scrollBarManager(scrollBarManager)}(componentWrappers,canvas),componentWrappers.forEach(function(componentWrapper,index){if(!componentWrapper){var deleteElementName=componentNames[index];layoutManager.removeComponent(deleteElementName)}}),layoutManager.registerComponents(componentWrappers).compute(),function attachListeners(componentWrappers){componentWrappers.forEach(function(componentWrapper){componentWrapper&&componentWrapper.attachListener()})}(componentWrappers)};function canvas_firebolt_helper_toConsumableArray(arr){return function canvas_firebolt_helper_arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1||rowProj.length>1))},helper_dispatchBehaviours=function dispatchBehaviours(firebolt,_ref){var payload=_ref.payload,unit=_ref.unit,behaviours=_ref.behaviours,_firebolt$context$con2=firebolt.context.config().interaction.behaviours,behaviourConfs=void 0===_firebolt$context$con2?{}:_firebolt$context$con2,unitFirebolt=unit.firebolt();behaviours.forEach(function(action){var mode=behaviourConfs[action],targetFirebolt=unitFirebolt;"common"===mode&&(targetFirebolt=firebolt);var actions=targetFirebolt._actions.behavioural;payload.criteria=helper_addFacetDataAndMeasureNames(payload.criteria,unit.facetFieldsMap(),unit.layers().map(function(layer){return Object.keys(layer.data().getFieldspace().getMeasure())})),targetFirebolt.dispatchBehaviour(action,payload,{propagate:!1,applySideEffect:!1});var identifiers=actions[action].propagationIdentifiers();firebolt.propagate(action,payload,identifiers,{sideEffects:getSideEffects(action,targetFirebolt._behaviourEffectMap),sourceUnitId:unit.id(),sourceId:targetFirebolt.id(),propagationDataSource:targetFirebolt.getPropagationSource()})})};function group_firebolt_typeof(obj){return(group_firebolt_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function group_firebolt_defineProperties(target,props){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{};!function propagateValues(instance,action){var config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},payload=config.payload,identifiers=config.identifiers,sourceUnitId=config.sourceUnitId,sourceCanvasId=config.sourceCanvasId,dataModel=config.propagationDataSource,sideEfffects=instance._sideEffectDefinitions,behaviourEffectMap=instance._behaviourEffectMap,propagationBehaviour=instance._propagationBehaviourMap[action]||action;payload.sourceUnit=sourceUnitId,payload.action=action,payload.sourceCanvas=sourceCanvasId;var groupId=sourceCanvasId,sourceBehaviour=instance._actions.behavioural[action],isMutableAction=!!sourceBehaviour&&sourceBehaviour.constructor.mutates(),propConfig={payload:payload,action:action,criteria:identifiers,isMutableAction:isMutableAction,groupId:groupId,sourceId:config.sourceId,filterFn:function filterFn(entry,propagationConf){var effects=behaviourEffectMap[entry.config.action],mutates=!entry.config.groupId||!!effects&&effects.some(function(d){return sideEfffects[d.name||d].mutates()});return entry.config.groupId!==propagationConf.groupId&&mutates},enabled:function enabled(propConf,firebolt){return action===propagationBehaviour||propConf.payload.sourceCanvas===firebolt.sourceCanvas()}};if(dataModel.propagate(identifiers,propConfig,!0),action!==propagationBehaviour){var behaviourInstance=instance._actions.behavioural[propagationBehaviour];isMutableAction=!!behaviourInstance&&behaviourInstance.constructor.mutates(),dataModel.propagate(identifiers,Object.assign({},propConfig,{isMutableAction:isMutableAction,applyOnSource:!1,action:propagationBehaviour,sourceId:isMutableAction?groupId:sourceUnitId,enabled:function enabled(propConf,firebolt){return propConf.payload.sourceCanvas!==firebolt.sourceCanvas()}}),!0,{filterImmutableAction:function filterImmutableAction(actionInf,propInf){return actionInf.groupId!==propInf.groupId}})}}(this,behaviour,Object.assign({payload:payload,identifiers:identifiers,propagationFields:this._propagationFields,sourceId:this.id(),sourceCanvasId:this.id(),propagationDataSource:this.data()},auxConfig))}},{key:"getPropagationSource",value:function getPropagationSource(){return this.data()}},{key:"sourceCanvas",value:function sourceCanvas(){return this.context.alias()}},{key:"getApplicableSideEffects",value:function getApplicableSideEffects(sideEffects,payload,propagationInf){var _this5=this;if(payload.sideEffects)return[{effects:payload.sideEffects,behaviours:[payload.action]}];var mode=this.context.config().interaction.tooltip.mode;return propagationInf.propPayload=propagationInf.propPayload||payload,sideEffects.forEach(function(d){var mappedEffects=d.effects;mappedEffects=mappedEffects.filter(function(se){return(se.name!==side_effects_TOOLTIP||"fragmented"!==mode)&&isSideEffectEnabled(_this5,{se:se,propagationInf:propagationInf})}),d.effects=mappedEffects}),sideEffects}}],[{key:"defaultInteractionPolicy",value:function defaultInteractionPolicy(){return function(){}}},{key:"defaultCrossInteractionPolicy",value:function defaultCrossInteractionPolicy(){return _defaultCrossInteractionPolicy}}]),GroupFireBolt}(),APP_INITIAL_STATE={app:{group:{},units:{},layers:{},canvas:{}},local:{canvas:{},group:{},units:{},layers:{}}};function canvas_typeof(obj){return(canvas_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function canvas_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function canvas_defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:COMPONENTS,reg=Object.assign({},components);return{register:function register(cls){var key=cls.formalName();return reg[key]=cls,componentRegistry},get:function get(){return reg}}}(COMPONENTS),cells:cell_registry(),layers:layer_registry(),interactions:registry_registry};__webpack_require__(39);function muze_slicedToArray(arr,i){return function muze_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function muze_iterableToArrayLimit(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function muze_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var muze_transactor=store_transactor,Smartlabel=SmartlabelManager_default.a,muze_enableChainedTransaction=enableChainedTransaction,muze_LifeCycleManager=lifecycle_manager,DataModel=datamodel_default.a,muze_Store=store_Store,globalCache={},defaultRegistry=default_registry_registry.components,overrideRegistryDefinitions=function overrideRegistryDefinitions(overrideRegistry,registry){overrideRegistry.forEach(function(def){registry.register(def)})},muze_muze=function muze(){var _transactor2=muze_slicedToArray(muze_transactor({},src_options),2),env=_transactor2[0],globalStore=_transactor2[1],components=Object.assign({},default_registry_registry.components.get()),componentSubRegistryDef=Object.assign({},SUBREGISTRIES),componentSubRegistry={};for(var prop in componentSubRegistryDef)componentSubRegistry[prop]=componentSubRegistryDef[prop](default_registry_registry[prop].get());return env.canvas=function(){var settings=globalStore.serialize(),canvas=canvas_Canvas.withSettings(settings,{components:components,componentSubRegistry:componentSubRegistry,interactions:default_registry_registry.interactions},env.globalDependencies());return muze_enableChainedTransaction(globalStore,canvas,Object.keys(settings)),canvas},env.globalDependencies=function(){return globalCache.smartlabel||(globalCache.smartlabel=new Smartlabel(1,"body")),{smartlabel:globalCache.smartlabel,lifeCycleManager:new muze_LifeCycleManager}},env.settings=function(){return globalStore.serialize()},env.registry=function(){for(var _len=arguments.length,overrideRegistry=new Array(_len),_key=0;_key<_len;_key++)overrideRegistry[_key]=arguments[_key];return overrideRegistry.length?(overrideRegistry.forEach(function(def){var prop=def.formalName();prop in defaultRegistry&&(components[prop]=def)}),env):components},env.cellRegistry=function(){for(var cellRegistry=componentSubRegistry.cellRegistry,_len2=arguments.length,overrideRegistry=new Array(_len2),_key2=0;_key2<_len2;_key2++)overrideRegistry[_key2]=arguments[_key2];return overrideRegistry.length?(overrideRegistryDefinitions(overrideRegistry,cellRegistry),env):cellRegistry.get()},env.layerRegistry=function(){for(var layerRegistry=componentSubRegistry.layerRegistry,_len3=arguments.length,overrideRegistry=new Array(_len3),_key3=0;_key3<_len3;_key3++)overrideRegistry[_key3]=arguments[_key3];return overrideRegistry.length?(overrideRegistryDefinitions(overrideRegistry,layerRegistry),env):layerRegistry.get()},env};muze_muze.registry=default_registry_registry,muze_muze.Components={VisualLayer:{layers:{BaseLayer:base_layer_BaseLayer,LineLayer:line_LineLayer,TextLayer:TextLayer,TickLayer:TickLayer,PointLayer:point_PointLayer,SimpleLayer:simple_layer_SimpleLayer,AreaLayer:area_AreaLayer,ArcLayer:ArcLayer},helpers:helpers,enums:src_enums_namespaceObject,layerMixins:layerMixins},VisualUnit:{constructor:visual_unit_VisualUnit,helpers:visual_unit_src_helper_namespaceObject,enums:visual_unit_src_enums_namespaceObject,UnitFireBolt:firebolt_UnitFireBolt},VisualGroup:{constructor:visual_group,Encoders:encoder_namespaceObject,encoderHelpers:encoder_helper_namespaceObject,groupUtils:group_utils_namespaceObject,enums:visual_group_src_enums_constants_namespaceObject},Canvas:{constructor:canvas_Canvas},Firebolt:{constructor:firebolt_Firebolt}};var SideEffects={sideEffects:src_side_effects_namespaceObject,standards:{SurrogateSideEffect:SurrogateSideEffect,SpawnableSideEffect:spawnable_SpawnableSideEffect,GenericSideEffect:generic}},Behaviours={behaviouralActions:behavioural_namespaceObject,standards:{GenericBehaviour:generic_GenericBehaviour,PersistentBehaviour:persistent_PersistentBehaviour,VolatileBehaviour:volatile_VolatileBehaviour}};muze_muze.DataModel=DataModel,muze_muze.version=muze_package.version,muze_muze.SideEffects=SideEffects,muze_muze.ActionModel=actionModel,muze_muze.layerFactory=src_layer_factory,muze_muze.Operators=operators_namespaceObject,muze_muze.Behaviours=Behaviours,muze_muze.utils=muze_utils_src_namespaceObject,muze_muze.Model=(new muze_Store).model.constructor;__webpack_exports__.default=muze_muze}])}); +//# sourceMappingURL=muze.js.map \ No newline at end of file diff --git a/release/dist/muze.js.map b/release/dist/muze.js.map new file mode 100644 index 00000000..50a945f9 --- /dev/null +++ b/release/dist/muze.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://muze/webpack/universalModuleDefinition","webpack://muze/webpack/bootstrap","webpack://muze/webpack://DataModel/webpack/universalModuleDefinition","webpack://muze/webpack://DataModel/webpack/bootstrap","webpack://muze/webpack://DataModel/src/index.js","webpack://muze/webpack://DataModel/src/enums/data-format.js","webpack://muze/webpack://DataModel/src/enums/dimension-subtype.js","webpack://muze/webpack://DataModel/src/enums/measure-subtype.js","webpack://muze/webpack://DataModel/src/enums/field-type.js","webpack://muze/webpack://DataModel/src/enums/filtering-mode.js","webpack://muze/webpack://DataModel/src/enums/group-by-functions.js","webpack://muze/webpack://DataModel/src/utils/date-time-formatter.js","webpack://muze/webpack://DataModel/src/utils/column-major.js","webpack://muze/webpack://DataModel/src/utils/extend2.js","webpack://muze/webpack://DataModel/src/utils/helper.js","webpack://muze/webpack://DataModel/src/field-store.js","webpack://muze/webpack://DataModel/src/value.js","webpack://muze/webpack://DataModel/src/operator/row-diffset-iterator.js","webpack://muze/webpack://DataModel/src/invalid-aware-types.js","webpack://muze/webpack://DataModel/src/constants/index.js","webpack://muze/webpack://DataModel/src/operator/get-common-schema.js","webpack://muze/webpack://DataModel/src/operator/cross-product.js","webpack://muze/webpack://DataModel/src/operator/merge-sort.js","webpack://muze/webpack://DataModel/src/operator/sort.js","webpack://muze/webpack://DataModel/src/operator/data-builder.js","webpack://muze/webpack://DataModel/src/operator/difference.js","webpack://muze/webpack://DataModel/src/operator/group-by-function.js","webpack://muze/webpack://DataModel/src/utils/reducer-store.js","webpack://muze/webpack://DataModel/src/operator/natural-join-filter-function.js","webpack://muze/webpack://DataModel/src/operator/union.js","webpack://muze/webpack://DataModel/src/operator/outer-join.js","webpack://muze/webpack://DataModel/src/fields/partial-field/index.js","webpack://muze/webpack://DataModel/src/fields/field/index.js","webpack://muze/webpack://DataModel/src/fields/dimension/index.js","webpack://muze/webpack://DataModel/src/fields/measure/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/field-parser/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/categorical-parser/index.js","webpack://muze/webpack://DataModel/src/fields/categorical/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/temporal-parser/index.js","webpack://muze/webpack://DataModel/src/fields/helper.js","webpack://muze/webpack://DataModel/src/fields/temporal/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/binned-parser/index.js","webpack://muze/webpack://DataModel/src/fields/binned/index.js","webpack://muze/webpack://DataModel/src/fields/parsers/continuous-parser/index.js","webpack://muze/webpack://DataModel/src/fields/continuous/index.js","webpack://muze/webpack://DataModel/src/fields/field-registry.js","webpack://muze/webpack://DataModel/src/field-creator.js","webpack://muze/webpack://DataModel/src/default-config.js","webpack://muze/webpack://DataModel/src/converter/model/dataConverter.js","webpack://muze/webpack://DataModel/node_modules/d3-dsv/src/dsv.js","webpack://muze/webpack://DataModel/src/converter/utils/dsv-arr.js","webpack://muze/webpack://DataModel/src/converter/utils/dsv-str.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/dsvStringConverter.js","webpack://muze/webpack://DataModel/src/converter/utils/flat-json.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/jsonConverter.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/dsvArrayConverter.js","webpack://muze/webpack://DataModel/src/converter/defaultConverters/autoConverter.js","webpack://muze/webpack://DataModel/src/converter/utils/auto-resolver.js","webpack://muze/webpack://DataModel/src/converter/dataConverterStore.js","webpack://muze/webpack://DataModel/src/helper.js","webpack://muze/webpack://DataModel/src/relation.js","webpack://muze/webpack://DataModel/src/datamodel.js","webpack://muze/webpack://DataModel/src/operator/group-by.js","webpack://muze/webpack://DataModel/src/operator/bucket-creator.js","webpack://muze/webpack://DataModel/src/stats/index.js","webpack://muze/webpack://DataModel/src/export.js","webpack://muze/webpack://DataModel/src/operator/compose.js","webpack://muze/webpack://DataModel/src/operator/pure-operators.js","webpack://muze/webpack://DataModel/src/operator/natural-join.js","webpack://muze/(webpack)/buildin/module.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/SmartlabelManager.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/lib.js","webpack://muze/webpack://hyperdis/webpack/universalModuleDefinition","webpack://muze/webpack://hyperdis/webpack/bootstrap","webpack://muze/webpack://hyperdis/src/utils/set.js","webpack://muze/webpack://hyperdis/src/utils/index.js","webpack://muze/webpack://hyperdis/src/graph-node.js","webpack://muze/webpack://hyperdis/src/electric-node.js","webpack://muze/webpack://hyperdis/src/graph.js","webpack://muze/webpack://hyperdis/src/model.js","webpack://muze/webpack://hyperdis/src/index.js","webpack://muze/./packages/muze/src/index.js","webpack://muze/./packages/muze-utils/node_modules/fusioncharts-smartlabel/lib/container-manager.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisector.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/bisect.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/range.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/ticks.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/threshold/sturges.js","webpack://muze/./packages/muze-utils/node_modules/d3-array/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/map.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/nest.js","webpack://muze/./packages/muze-utils/node_modules/d3-collection/src/set.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/ordinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/band.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/define.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basis.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/color.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/rgb.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/numberArray.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/basisClosed.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/object.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/string.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/value.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/date.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/round.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/number.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/continuous.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatSpecifier.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatDecimal.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatPrefixAuto.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/exponent.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTrim.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatRounded.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatTypes.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatGroup.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/formatNumerals.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionRound.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/tickFormat.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionPrefix.js","webpack://muze/./packages/muze-utils/node_modules/d3-format/src/precisionFixed.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/nice.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/log.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/pow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantile.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/quantize.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/threshold.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/interval.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/year.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/month.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/week.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/day.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/hour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/minute.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/second.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/millisecond.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcWeek.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcDay.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcYear.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/locale.js","webpack://muze/./packages/muze-utils/node_modules/d3-time-format/src/defaultLocale.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/time.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMonth.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcHour.js","webpack://muze/./packages/muze-utils/node_modules/d3-time/src/utcMinute.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category10.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20b.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/category20c.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-color/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale/src/sequential.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/colors.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Dark2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Paired.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Accent.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Pastel2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set1.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set2.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/categorical/Set3.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/ramp.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Blues.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/BrBG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PRGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PiYG.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/PuOr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdGy.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/diverging/Spectral.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greens.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Greys.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Purples.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-single/Reds.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js","webpack://muze/./packages/muze-utils/node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js","webpack://muze/./packages/muze-utils/src/enums/namespace.js","webpack://muze/./packages/muze-utils/src/quick-select.js","webpack://muze/./packages/muze-utils/src/r-tree.js","webpack://muze/./packages/muze-utils/src/enums/reserved-fields.js","webpack://muze/./packages/muze-utils/src/enums/common-props.js","webpack://muze/./packages/muze-utils/src/enums/constants.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-axis/src/axis.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/math.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/cross.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/diamond.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/square.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/star.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/wye.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol/triangle.js","webpack://muze/./packages/muze-utils/node_modules/d3-path/src/path.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/ascending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/order/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/none.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/array.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/stack.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/step.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/cardinal.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/curve/catmullRom.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/line.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/descending.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/identity.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/arc.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/hsl.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/piecewise.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/cubic.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/bounce.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/elastic.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/back.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/poly.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/RedBlackTree.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Edge.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Cell.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Beach.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/Diagram.js","webpack://muze/./packages/muze-utils/node_modules/d3-voronoi/src/voronoi.js","webpack://muze/./packages/muze-utils/src/DataSystem/selection.js","webpack://muze/./packages/muze-utils/src/DataSystem/dataSelect.js","webpack://muze/./packages/muze-utils/src/enums/stack-config.js","webpack://muze/./packages/muze-utils/src/common-utils.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/linear.js","webpack://muze/./packages/muze-utils/node_modules/d3-ease/src/circle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/symbol.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/diverging.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/expand.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/offset/wiggle.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/area.js","webpack://muze/./packages/muze-utils/node_modules/d3-shape/src/pie.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selector.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selectorAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/matcher.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sparse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/enter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/data.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/sort.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/call.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespaces.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/namespace.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/window.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/classed.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/html.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/raise.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/lower.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/creator.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/insert.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/clone.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/exit.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/join.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/order.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/nodes.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/node.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/size.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/empty.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/each.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/property.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/append.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/selection/datum.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/point.js","webpack://muze/./packages/muze-utils/node_modules/d3-dispatch/src/dispatch.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/sourceEvent.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/mouse.js","webpack://muze/./packages/muze-utils/node_modules/d3-selection/src/touch.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/noevent.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/nodrag.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/constant.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/event.js","webpack://muze/./packages/muze-utils/node_modules/d3-drag/src/drag.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timer.js","webpack://muze/./packages/muze-utils/node_modules/d3-timer/src/timeout.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/schedule.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/interrupt.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/parse.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/decompose.js","webpack://muze/./packages/muze-utils/node_modules/d3-interpolate/src/transform/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/tween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/interpolate.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/remove.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selection.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/style.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/textTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/select.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/selectAll.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/filter.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/merge.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/on.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attr.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/attrTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/styleTween.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/text.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/delay.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/duration.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/ease.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/transition/end.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/transition.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/index.js","webpack://muze/./packages/muze-utils/node_modules/d3-transition/src/selection/interrupt.js","webpack://muze/./packages/muze-utils/src/renderer-utils.js","webpack://muze/./packages/muze-utils/src/store.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/event-list.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/lifecycle-manager.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/index.js","webpack://muze/./packages/muze-utils/src/lifecycle-manager/helper.js","webpack://muze/./packages/muze-utils/src/index.js","webpack://muze/./packages/visual-layer/src/enums/constants.js","webpack://muze/./packages/visual-layer/src/simple-layer/simple-layer.js","webpack://muze/./packages/visual-layer/src/enums/props.js","webpack://muze/./packages/visual-layer/src/base-layer/props.js","webpack://muze/./packages/muze-axis/src/enums/axis-orientation.js","webpack://muze/./packages/muze-axis/src/enums/scale-type.js","webpack://muze/./packages/muze-axis/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/scale-creator.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/default-config.js","webpack://muze/./packages/muze-axis/src/axis-renderer.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/skip-ticks.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/space-setter.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/helper.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/props.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/simple-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/linear.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/log.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/interpolators/pow.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/continous-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/band-axis.js","webpack://muze/./packages/muze-axis/src/cartesian-axis/time-axis.js","webpack://muze/./packages/muze-axis/src/color-axis/color-maps.js","webpack://muze/./packages/muze-axis/src/color-axis/defaults.js","webpack://muze/./packages/muze-axis/src/color-axis/props.js","webpack://muze/./packages/muze-axis/src/helper.js","webpack://muze/./packages/muze-axis/src/color-axis/color-strategy.js","webpack://muze/./packages/muze-axis/src/color-axis/color-axis.js","webpack://muze/./packages/muze-axis/src/size-axis/defaults.js","webpack://muze/./packages/muze-axis/src/size-axis/size-strategy.js","webpack://muze/./packages/muze-axis/src/size-axis/props.js","webpack://muze/./packages/muze-axis/src/size-axis/size-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/defaults.js","webpack://muze/./packages/muze-axis/src/shape-axis/props.js","webpack://muze/./packages/muze-axis/src/shape-axis/shape-axis.js","webpack://muze/./packages/muze-axis/src/shape-axis/helper.js","webpack://muze/./packages/muze-axis/src/polar-axis/props.js","webpack://muze/./packages/muze-axis/src/polar-axis/angle-axis.js","webpack://muze/./packages/visual-group/src/enums/constants.js","webpack://muze/./packages/muze-axis/src/polar-axis/radius-axis.js","webpack://muze/./packages/muze-axis/src/data-type-scale-map.js","webpack://muze/./packages/transform/src/group-transform/index.js","webpack://muze/./packages/transform/src/identity-transform/index.js","webpack://muze/./packages/transform/src/transform-factory/index.js","webpack://muze/./packages/transform/src/enums/transform-type.js","webpack://muze/./packages/transform/src/stack-transform/index.js","webpack://muze/./packages/visual-layer/src/helpers/index.js","webpack://muze/./packages/visual-layer/src/base-layer/local-options.js","webpack://muze/./packages/visual-layer/src/base-layer/listener-map.js","webpack://muze/./packages/visual-layer/src/base-layer/helper.js","webpack://muze/./packages/visual-layer/src/base-layer/base-mixin.js","webpack://muze/./packages/visual-layer/src/base-layer/base-layer.js","webpack://muze/./packages/visual-layer/src/layers/line/renderer.js","webpack://muze/./packages/visual-layer/src/layers/line/default-config.js","webpack://muze/./packages/visual-layer/src/layers/line/line-mixin.js","webpack://muze/./packages/visual-layer/src/layers/area/default-config.js","webpack://muze/./packages/visual-layer/src/layers/area/renderer.js","webpack://muze/./packages/visual-layer/src/layers/area/area-mixin.js","webpack://muze/./packages/visual-layer/src/layers/area/area.js","webpack://muze/./packages/visual-layer/src/layers/arc/default-config.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc-mixin.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc-helper.js","webpack://muze/./packages/visual-layer/src/layers/arc/arc.js","webpack://muze/./packages/visual-layer/src/layers/line/line.js","webpack://muze/./packages/visual-layer/src/layers/text/renderer.js","webpack://muze/./packages/visual-layer/src/layers/text/default-config.js","webpack://muze/./packages/visual-layer/src/layers/text/text-mixin.js","webpack://muze/./packages/visual-layer/src/layers/text/text.js","webpack://muze/./packages/visual-layer/src/layers/point/renderer.js","webpack://muze/./packages/visual-layer/src/layers/point/default-config.js","webpack://muze/./packages/visual-layer/src/layers/point/helper.js","webpack://muze/./packages/visual-layer/src/layers/point/point-mixin.js","webpack://muze/./packages/visual-layer/src/layers/point/point.js","webpack://muze/./packages/visual-layer/src/layers/bar/renderer.js","webpack://muze/./packages/visual-layer/src/layers/bar/default-config.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar-helper.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar-mixin.js","webpack://muze/./packages/visual-layer/src/layers/bar/bar.js","webpack://muze/./packages/visual-layer/src/layers/tick/default-config.js","webpack://muze/./packages/visual-layer/src/layers/tick/renderer.js","webpack://muze/./packages/visual-layer/src/layers/tick/tick-mixin.js","webpack://muze/./packages/visual-layer/src/layers/tick/helper.js","webpack://muze/./packages/visual-layer/src/layers/tick/tick.js","webpack://muze/./packages/visual-layer/src/enums/layer-types.js","webpack://muze/./packages/visual-layer/src/layer-factory/layer-factory.js","webpack://muze/./packages/visual-layer/src/layer-factory/index.js","webpack://muze/./packages/visual-layer/src/defaults.js","webpack://muze/./packages/visual-layer/src/layer-registry.js","webpack://muze/./packages/visual-layer/src/index.js","webpack://muze/./packages/visual-unit/src/helper/index.js","webpack://muze/./packages/visual-unit/src/enums/reactive-props.js","webpack://muze/./packages/visual-unit/src/enums/constants.js","webpack://muze/./packages/muze-firebolt/src/enums/actions.js","webpack://muze/./packages/muze-firebolt/src/enums/selection.js","webpack://muze/./packages/muze-firebolt/src/selection-set/index.js","webpack://muze/./packages/muze-firebolt/src/selection-set/selection-set.js","webpack://muze/./packages/muze-firebolt/src/helper/index.js","webpack://muze/./packages/muze-firebolt/src/firebolt.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/generic.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/volatile.js","webpack://muze/./packages/muze-firebolt/src/enums/behaviours.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/highlight.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/brush.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/filter.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/persistent.js","webpack://muze/./packages/muze-firebolt/src/actions/behavioural/select.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-action-config.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/drag-event.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/hover.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/helpers/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/click.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/drag.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/longtouch.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/touch-drag.js","webpack://muze/./packages/muze-firebolt/src/enums/side-effects.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/props.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/generic/generic-sideeffect.js","webpack://muze/./packages/muze-firebolt/src/side-effects/surrogate.js","webpack://muze/./packages/muze-firebolt/src/side-effects/spawnable.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/helper.js","webpack://muze/./packages/muze-firebolt/src/side-effects/selection-box/index.js","webpack://muze/./packages/muze-firebolt/src/actions/physical/selection-box-drag.js","webpack://muze/./packages/muze-firebolt/src/enums/constants.js","webpack://muze/./packages/muze-tooltip/src/default-config.js","webpack://muze/./packages/muze-tooltip/src/constants.js","webpack://muze/./packages/muze-tooltip/src/content.js","webpack://muze/./packages/muze-tooltip/src/tooltip.js","webpack://muze/./packages/muze-tooltip/src/helper.js","webpack://muze/./packages/muze-firebolt/src/enums/tooltip-strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/strategies.js","webpack://muze/./packages/muze-firebolt/src/side-effects/tooltip/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/fragmented-tooltip/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/helper/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/crossline/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/helper.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js","webpack://muze/./packages/muze-firebolt/src/side-effects/plot-highlighter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/filter/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/anchors/index.js","webpack://muze/./packages/muze-firebolt/src/side-effects/persistent-anchors.js","webpack://muze/./packages/muze-firebolt/src/side-effects/brush-anchors.js","webpack://muze/./packages/muze-firebolt/src/side-effects/axis-labels-highlighter/index.js","webpack://muze/./packages/muze-firebolt/src/behaviour-effect-map.js","webpack://muze/./packages/muze-firebolt/src/registry.js","webpack://muze/./packages/visual-unit/src/firebolt/payload-generator.js","webpack://muze/./packages/visual-unit/src/firebolt/helper.js","webpack://muze/./packages/visual-unit/src/firebolt/index.js","webpack://muze/./packages/visual-unit/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/visual-unit/src/firebolt/behaviours/brush.js","webpack://muze/./packages/visual-unit/src/enums/behaviours.js","webpack://muze/./packages/visual-unit/src/helper/grid-lines.js","webpack://muze/./packages/visual-unit/src/listener-map.js","webpack://muze/./packages/visual-unit/src/props.js","webpack://muze/./packages/visual-unit/src/default-config.js","webpack://muze/./packages/visual-unit/src/local-options.js","webpack://muze/./packages/visual-unit/src/firebolt/behaviours/pseudo-select.js","webpack://muze/./packages/visual-unit/src/visual-unit.js","webpack://muze/./packages/visual-group/src/variable/variable.js","webpack://muze/./packages/visual-group/src/variable/composed-vars.js","webpack://muze/./packages/visual-group/src/variable/simple-var.js","webpack://muze/./packages/visual-group/src/encoder/field-sanitizer.js","webpack://muze/./packages/visual-group/src/enums/defaults.js","webpack://muze/./packages/visual-group/src/group-helper/cell-border-applier.js","webpack://muze/./packages/visual-group/src/group-helper/group-utils.js","webpack://muze/./packages/visual-group/src/encoder/props.js","webpack://muze/./packages/visual-group/src/encoder/visual-encoder.js","webpack://muze/./packages/visual-group/src/enums/scale-maps.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-model.js","webpack://muze/./packages/visual-group/src/group-helper/cell-creator.js","webpack://muze/./packages/visual-group/src/group-helper/resolver-props.js","webpack://muze/./packages/visual-group/src/group-helper/matrix-resolver.js","webpack://muze/./packages/visual-group/src/data-type-scale-map.js","webpack://muze/./packages/visual-group/src/encoder/encoder-helper.js","webpack://muze/./packages/visual-group/src/encoder/cartesian-encoder.js","webpack://muze/./packages/visual-group/src/encoder/polar-encoder.js","webpack://muze/./packages/visual-group/src/encoder/retinal-encoder.js","webpack://muze/./packages/visual-group/src/visual-group/local-options.js","webpack://muze/./packages/visual-group/src/simple-group/simple-group.js","webpack://muze/./packages/visual-group/src/visual-group/value-matrix.js","webpack://muze/./packages/visual-group/src/visual-group/helper.js","webpack://muze/./packages/visual-group/src/visual-group/change-listener.js","webpack://muze/./packages/visual-group/src/visual-group/props.js","webpack://muze/./packages/visual-group/src/visual-group/visual-group.js","webpack://muze/./packages/muze-legend/src/firebolt/behavioural/select.js","webpack://muze/./packages/muze-legend/src/firebolt/action-behaviour-map.js","webpack://muze/./packages/muze-legend/src/firebolt/behaviour-effect-map.js","webpack://muze/./packages/muze-legend/src/enums/behaviours.js","webpack://muze/./packages/muze-legend/src/enums/side-effects.js","webpack://muze/./packages/muze-legend/src/firebolt/helper.js","webpack://muze/./packages/muze-legend/src/enums/constants.js","webpack://muze/./packages/muze-legend/src/firebolt/legend-firebolt.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/drag.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/hover.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/click.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/index.js","webpack://muze/./packages/muze-legend/src/enums/actions.js","webpack://muze/./packages/muze-legend/src/firebolt/physical/selection-box-drag.js","webpack://muze/./packages/muze-legend/src/legend/defaults.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/selection-box/index.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/strategies.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-highlighter/index.js","webpack://muze/./packages/muze-legend/src/firebolt/side-effects/legend-marker/index.js","webpack://muze/./packages/muze-legend/src/legend/props.js","webpack://muze/./packages/muze-legend/src/legend/legend-helper.js","webpack://muze/./packages/muze-legend/src/legend/simple-legend.js","webpack://muze/./packages/muze-legend/src/legend/position-config.js","webpack://muze/./packages/muze-legend/src/legend/renderer.js","webpack://muze/./packages/muze-legend/src/legend/discrete-legend.js","webpack://muze/./packages/muze-legend/src/legend/gradient-helper.js","webpack://muze/./packages/muze-legend/src/legend/gradient-legend.js","webpack://muze/./packages/muze-legend/src/legend/step-legend.js","webpack://muze/./packages/muze/src/constants.js","webpack://muze/./packages/muze/src/operators.js","webpack://muze/./packages/muze/src/action-model.js","webpack://muze/./packages/muze/src/canvas/defaults.js","webpack://muze/./packages/muze/src/canvas/local-options.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/layoutComponent.js","webpack://muze/./packages/layout/src/tree-layout/layout-component/dummy-component.js","webpack://muze/./packages/muze/src/defaults.js","webpack://muze/./packages/layout/src/tree-layout/constants/defaults.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/definitionModel.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/helper/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/tree/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/layout-model/index.js","webpack://muze/./packages/layout/src/enums/constants.js","webpack://muze/./packages/layout/src/tree-layout/utils/index.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-point.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/data-parser.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/helper.js","webpack://muze/./packages/layout/src/tree-layout/data-adapters/html-data.js","webpack://muze/./packages/layout/src/tree-layout/renderers/renderer.js","webpack://muze/./packages/layout/src/tree-layout/renderers/html-renderer.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/drawing-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-definition/definition-manager/index.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/layout-def.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/helper.js","webpack://muze/./packages/layout/src/tree-layout/layout-manager/index.js","webpack://muze/./packages/muze/src/canvas/helper.js","webpack://muze/./packages/muze/src/options.js","webpack://muze/./packages/layout/src/generic-layout/index.js","webpack://muze/./packages/layout/src/grid-layout/defaults.js","webpack://muze/./packages/layout/src/utils/index.js","webpack://muze/./packages/layout/src/visual-matrix/props.js","webpack://muze/./packages/layout/src/visual-matrix/default-config.js","webpack://muze/./packages/layout/src/visual-matrix/visual-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/row-matrix.js","webpack://muze/./packages/layout/src/visual-matrix/column-matrix.js","webpack://muze/./packages/layout/src/grid-layout/computations.js","webpack://muze/./packages/layout/src/grid-layout/view-info-getter.js","webpack://muze/./packages/layout/src/grid-layout/layout.js","webpack://muze/./packages/layout/src/grid-layout/layout-helper.js","webpack://muze/./packages/layout/src/grid-layout/border-helper.js","webpack://muze/./packages/layout/src/grid-layout/span-maker.js","webpack://muze/./packages/muze/src/transaction-support.js","webpack://muze/./packages/muze/src/canvas/component-resolver.js","webpack://muze/./packages/visual-cell/src/enums/constants.js","webpack://muze/./packages/visual-cell/src/enums/cell-type.js","webpack://muze/./packages/visual-cell/src/simple-cell.js","webpack://muze/./packages/visual-cell/src/constants.js","webpack://muze/./packages/visual-cell/src/enums/defaults.js","webpack://muze/./packages/visual-cell/src/props.js","webpack://muze/./packages/visual-cell/src/axis-cell.js","webpack://muze/./packages/visual-cell/src/blank-cell.js","webpack://muze/./packages/visual-cell/src/text-cell-helper.js","webpack://muze/./packages/visual-cell/src/text-cell.js","webpack://muze/./packages/visual-cell/src/geom-cell.js","webpack://muze/./packages/visual-cell/src/defaults.js","webpack://muze/./packages/visual-cell/src/cell-registry.js","webpack://muze/./packages/muze/src/canvas/title-maker.js","webpack://muze/./packages/muze/src/canvas/legend-maker.js","webpack://muze/./packages/muze/src/canvas/components/muze-chart-component.js","webpack://muze/./packages/muze/src/canvas/components/headerComponent.js","webpack://muze/./packages/muze/src/canvas/components/legendComponent.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/helper.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/props.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-component.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/horizontal-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/scroll-bar-maker/vertical-scroll-maker.js","webpack://muze/./packages/muze/src/canvas/components/matrix-component.js","webpack://muze/./packages/muze/src/canvas/components/grid-component.js","webpack://muze/./packages/muze/src/enums/constants.js","webpack://muze/./packages/muze/src/canvas/components/message-component.js","webpack://muze/./packages/muze/src/canvas/components/message-icon.js","webpack://muze/./packages/muze/src/canvas/component-wrapper-maker.js","webpack://muze/./packages/muze/src/canvas/scroll-manager.js","webpack://muze/./packages/muze/src/canvas/layout-maker.js","webpack://muze/./packages/muze/src/canvas/firebolt/helper.js","webpack://muze/./packages/muze/src/canvas/firebolt/group-firebolt.js","webpack://muze/./packages/muze/src/canvas/firebolt/index.js","webpack://muze/./packages/muze/src/canvas/app-state.js","webpack://muze/./packages/muze/src/canvas/canvas.js","webpack://muze/./packages/muze/src/default-registry.js","webpack://muze/./packages/muze/src/muze.js"],"names":["webpackUniversalModuleDefinition","root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","_typeof","DataModel","require","DataFormat","FLAT_JSON","DSV_STR","DSV_ARR","AUTO","DimensionSubtype","CATEGORICAL","TEMPORAL","BINNED","MeasureSubtype","CONTINUOUS","FieldType","MEASURE","DIMENSION","FilteringMode","NORMAL","INVERSE","ALL","GROUP_BY_FUNCTIONS","SUM","AVG","MIN","MAX","FIRST","LAST","COUNT","STD","convertToNativeDate","date","Date","pad","DateTimeFormatter","format","this","dtParams","nativeDate","RegExp","escape","text","replace","TOKEN_PREFIX","DATETIME_PARAM_SEQUENCE","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND","MILLISECOND","defaultNumberParser","defVal","val","parsedVal","isFinite","parseInt","defaultRangeParser","range","nVal","toLowerCase","length","getTokenDefinitions","daysDef","short","long","monthsDef","H","index","extract","parser","formatter","getHours","toString","hours","P","M","getMinutes","S","getSeconds","K","getMilliseconds","a","join","day","getDay","A","e","getDate","b","month","getMonth","B","y","result","substring","presentDate","presentYear","Math","trunc","getFullYear","year","Y","getTokenFormalNames","definitions","HOUR_12","AMPM_UPPERCASE","AMPM_LOWERCASE","SHORT_DAY","LONG_DAY","DAY_OF_MONTH","DAY_OF_MONTH_CONSTANT_WIDTH","SHORT_MONTH","LONG_MONTH","MONTH_OF_YEAR","SHORT_YEAR","LONG_YEAR","tokenResolver","defaultResolver","arg","targetParam","arguments","hourFormat24","hourFormat12","ampmLower","ampmUpper","amOrpm","isPM","findTokens","tokenPrefix","tokenLiterals","keys","occurrence","forwardChar","indexOf","push","token","formatAs","nDate","formattedStr","String","formattedVal","parse","dateTimeStamp","options","extractTokenValue","dtParamSeq","noBreak","dtParamArr","args","resolverKey","resolverParams","resolverFn","param","resolvedVal","splice","apply","checkIfOnlyYear","unshift","tokenObj","lastOccurrenceIndex","occObj","occIndex","targetText","regexFormat","tokenArr","map","obj","occurrenceLength","extractValues","match","shift","getNativeDate","Number","len","v","store","fields","Array","forEach","fieldIndex","from","OBJECTSTRING","objectToStrFn","objectToStr","arrayToStr","checkCyclicRef","parentArr","bIndex","extend2","obj1","obj2","skipUndef","merge","tgtArr","srcArr","item","srcVal","tgtVal","str","cRef","isArray","getUniqueId","getTime","round","random","isArrEqual","arr1","arr2","formatNumber","detectDataFormat","data","fieldStore","createNamespace","fieldArr","dataId","fieldsObj","_cachedFieldsObj","field","getMeasure","measureFields","_cachedMeasure","schema","type","getDimension","dimensionFields","_cachedDimension","Value","rawValue","formattedValue","getNumberFormattedVal","defineProperties","_value","configurable","writable","_formattedValue","_internalValue","rowDiffsetIterator","rowDiffset","callback","split","diffStr","diffStsArr","start","end","InvalidAwareTypes","config","assign","_invalidAwareValsMap","invalidAwareVals","NULL","NA","NIL","invalid","nil","null","undefined","ROW_ID","DM_DERIVATIVES","SELECT","PROJECT","GROUPBY","COMPOSE","CAL_VAR","BIN","SORT","JOINS","CROSS","LEFTOUTER","RIGHTOUTER","NATURAL","FULLOUTER","getCommonSchema","fs1","fs2","retArr","fs1Arr","defaultFilterFn","crossProduct","dm1","dm2","filterFn","replaceCommonSchema","jointype","applicableFilterFn","dm1FieldStore","getFieldspace","dm2FieldStore","dm1FieldStoreName","dm2FieldStoreName","commonSchemaList","Error","tmpSchema","_rowDiffset","rowAdded","rowPosition","ii","tuple","userArg","partialField","formattedData","dm1Fields","prepareJoinData","dm2Fields","detachedRoot","tupleObj","cellVal","iii","defSortFn","a1","b1","mergeSort","arr","sortFn","sort","lo","hi","mid","floor","mainArr","auxArr","resolveStrSortOrder","fDetails","strSortOrder","sortOrder","dataType","sortType","retFunc","groupData","hashMap","Map","groupedData","datum","fieldVal","has","set","createSortingFnArg","groupedDatum","targetFields","targetFieldDetails","label","reduce","acc","next","idx","applyStandardSort","sortingDetails","fieldName","sortMeta","fieldInSchema","sortingFn","slice","f","makeGroupMapAndSort","depColumns","targetCol","currRow","fVal","u","iterator","done","W","nMap","dataBuilder","colIdentifier","retObj","uids","addUid","columnWise","reqSorting","tmpDataArr","colName","insertInd","sortData","dataObj","filter","sDetial","groupSortingIdx","findIndex","standardSortingDetails","groupSortingDetails","detail","sortedGroupMap","row","nextMap","pop","tmpData","difference","hashTable","schemaNameArr","dm1FieldStoreFieldObj","dm2FieldStoreFieldObj","_colIdentifier","prepareDataHelper","dm","addData","hashData","schemaName","getFilteredValues","sum","filteredNumber","curr","avg","totalSum","isNaN","fnList","filteredValues","min","max","sqrt","mean","pow","num","defaultReducerName","ReducerStore","defReducer","entries","reducer","__unregister","Function","reducerStore","naturalJoinFilter","commonSchemaArr","retainTuple","internalValue","union","leftOuterJoin","dataModel1","dataModel2","rightOuterJoin","PartialField","_sanitize","Field","subtype","description","displayName","_params","_context","build","Dimension","_cachedDomain","calculateDataDomain","Measure","unit","defAggFn","numberFormat","FieldParser","CategoricalParser","isInvalid","getInvalidType","trim","Categorical","hash","Set","domain","add","TemporalParser","_dtf","calculateContinuousDomain","POSITIVE_INFINITY","NEGATIVE_INFINITY","Temporal","__proto__","getPrototypeOf","_cachedMinDiff","sortedData","arrLn","minDiff","prevDatum","nextDatum","processedCount","dataFormat","parsedDatum","BinnedParser","matched","parseFloat","Binned","binsArr","bins","ContinuousParser","Continuous","FieldTypeRegistry","_fieldType","dimension","fieldRegistry","registerDefaultFields","registerFieldType","createFields","dataColumn","headers","headersObj","header","BUILDER","ct","DataConverter","_type","EOL","EOF","QUOTE","NEWLINE","RETURN","objectConverter","columns","JSON","stringify","inferColumns","rows","columnSet","column","width","_t","delimiter","reFormat","DELIMITER","charCodeAt","parseRows","N","I","eof","eol","j","preformatBody","formatValue","formatRow","formatDate","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","milliseconds","getUTCMilliseconds","getUTCFullYear","getUTCMonth","getUTCDate","test","convert","concat","formatBody","formatRows","DSVArr","schemaFields","unitSchema","firstRowHeader","columnMajor","headerMap","h","schemaField","headIndex","DSVStr","fieldSeparator","dsv","d3Dsv","DSVStringConverter","FlatJSON","insertionIndex","schemaFieldsName","JSONConverter","DSVArrayConverter","AutoDataConverter","Auto","converters","DataConverterStore","_getDefaultConverters","converter","converterStore","resp","persistDerivations","sourceDm","model","operation","persistCurrentDerivation","criteriaFn","_derivation","Vt","op","meta","criteria","persistAncestorDerivation","newDm","_ancestorDerivation","selectModeMap","diffIndex","calcDiff","generateRowDiffset","lastInsertedValue","li","selectRowDiffsetIterator","checker","newRowDiffSet","rejRowDiffSet","Ut","shouldSelect","shouldReject","checkerResult","rejectRowDiffset","selectHelper","clonedDm","selectFn","cachedStore","cloneProvider","cachedValueObjects","_partialFieldspace","_cachedValueObjects","keyFn","rowId","domainChecker","some","dom","boundsChecker","filterPropagationModel","propModels","fns","filterByDim","filterByMeasure","clone","clonedModel","cloneWithAllFields","partialFieldspace","getPartialFieldspace","__calculateFieldspace","calculateFieldsConfig","modelFieldsConfig","getFieldsConfig","identifiers","fieldNames","values","indices","dLen","def","valuesMap","rangeKeys","hasData","present","getKey","fn","every","isWithinDomain","fieldType","propModel","select","saveChild","addDiffsetToClonedDm","selectConfig","cloneWithProject","projField","allFields","cloned","projectionSet","actualProjField","sanitizeUnitSchema","sanitizeAndValidateSchema","updateData","relation","defaultConfig","dataHeader","fieldNameAs","as","nameSpace","valueObjects","rawFieldsData","formattedFieldsData","rawData","_","_dataFormat","applyExistingOperationOnModel","dataModel","selectionModel","getDerivations","derivation","params","groupByString","getRootGroupByModel","_parent","find","propagateToAllDataModels","rootModels","propagationInf","propagationNameSpace","propagateToSource","propagationSourceId","sourceId","addGroupedModel","conf","crit","groupedModel","criterias","actionCriterias","mutableActions","filteredCriteria","entry","excludeModels","sourceActionCriterias","actionInf","actionConf","applyOnSource","action","models","path","getPathToRootModel","propagationSource","rootModel","propConfig","sourceIdentifiers","inf","propagationModel","filteredModel","reverse","handlePropagation","propagateIdentifiers","propModelInf","_children","child","matchingCriteria","getNormalizedProFields","fieldConfig","normalizedProjField","constructor","search","Relation","source","_fieldStoreName","_propagationNameSpace","immutableActions","_fieldspace","updateFields","fieldStoreName","collID","partialFieldMap","newFields","coll","joinWith","unionWith","differenceWith","defConfig","cloneConfig","extraCloneDm","setOfRowDiffsets","setParent","_fieldConfig","fieldObj","removeChild","sibling","parent","_onPropagation","order","withUid","getAllFields","dataGenerated","fmtFieldIdx","elem","fIdx","fmtFn","datumIdx","ids","En","fill","fieldsArr","reducers","newDataModel","groupBy","existingDataModel","sFieldArr","dimensions","je","reducerObj","measures","defaultReducer","measureName","reducerFn","resolve","fieldStoreObj","dbName","dimensionArr","measureArr","rowCount","getData","dataInCSVArr","sortedDm","colData","rowsCount","serializedData","rowIdx","colIdx","fieldinst","dependency","replaceVar","fieldsConfig","depVars","retrieveFn","depFieldIndices","fieldSpec","fs","suppliedFields","computedValues","fieldsData","addField","addToNameSpace","isMutableAction","payload","getRootDataModel","groupByModel","addToPropNamespace","sourceNamespace","propagateImmutableActions","filterImmutableAction","criteriaModel","eventName","measureFieldName","binFieldName","measureField","buckets","binsCount","binSize","dMin","dMax","ceil","abs","generateBuckets","bucketRanges","binnedData","findBucketRange","leftIdx","rightIdx","midIdx","binField","serialize","getSchema","rowSplitDiffsetIterator","splitRowDiffset","dimensionMap","dimensionSet","clonedDMs","uniqueFields","commonFields","normalizedProjFieldSets","fieldSet","splitWithProject","projFieldSet","projFields","first","last","count","sd","std","Operators","compose","operations","currentDM","firstChild","derivations","dispose","bin","project","calculateVariable","naturalJoin","fullOuterJoin","version","Stats","FieldsUtility","enums","webpackPolyfill","deprecate","paths","children","_interopRequireDefault","default","_lib2","_containerManager2","slLib","init","doc","win","document","htmlSplCharSpace"," ","documentSupport","getDocumentSupport","SVG_BBOX_CORRECTION","isWebKit","SmartLabelManager","id","container","useEllipses","wrapper","prop","prevInstance","isBrowserLess","maxCacheLimit","maxDefaultCacheLimit","getElementById","createContainer","innerHTML","testStrAvg","isHeadLess","isIE","offsetHeight","offsetWidth","parentContainerStyle","style","parentContainer","_containerManager","_showNoEllipses","_init","setStyle","textToLines","smartlabel","lines","_calCharDimWithCache","calculateDifference","size","csArr","tw","twi","cachedStyle","asymmetricDifference","maxAdvancedCacheLimit","_container","cache","_advancedCache","advancedCacheKey","_advancedCacheKey","cacheName","fontSize","fontFamily","fontWeight","fontStyle","cacheInitName","repeat","height","_getWidthFn","contObj","_containerObj","svgText","bbox","textContent","getBBox","_styleNotSet","setLineHeight","sCont","node","context","_cache","charCache","_lineHeight","lineHeight","useEllipsesOnOverflow","getSmartText","maxWidth","maxHeight","noWrap","trimStr","tempArr","tmpText","maxWidthWithEll","toolText","oriWidth","oriHeight","newCharIndex","nearestChar","tempChar","getWidth","initialLeft","initialTop","getOriSizeImproveObj","spanArr","x","minWidth","chr","elemRightMostPoint","elemLowestPoint","lastBR","removeFromIndex","removeFromIndexForEllipses","hasHTMLTag","maxStrWidth","lastDash","lastSpace","lastIndexBroken","strWidth","strHeight","oriTextArr","ellipsesStr","ellipsesWidth","dotWidth","characterArr","dashIndex","spaceIndex","lastLineBreak","fastTrim","ws","charAt","smartLabel","oriTextWidth","oriTextHeight","oriText","isTruncated","xmlTagRegEx","ltgtRegex","getOriSize","substr","getNearestBreakIndex","detailObj","tooltext","lastIndexOf","spanAdditionRegx","spanAdditionReplacer","classNameWithTag","classNameWithTagBR","childRetriverFn","childRetriverString","noClassTesting","classNameReg","className","spaceIdx","dashIdx","offsetLeft","offsetTop","parentNode","insertBefore","createElement","classNameBrReg","spanRemovalRegx","error","detailedCalculationFlag","textArr","letter","lSize","cumulativeSize","indiSizeStore","lib","userAgent","navigator","clsNameSpace","containerClass","brReplaceRegex","position","top","whiteSpace","padding","overflow","supportedStyle","font","font-family","font-weight","font-size","line-height","font-style","getElementsByClassName","opera","hasSVG","Boolean","SVGAngle","implementation","hasFeature","containerParent","body","appendChild","setAttribute","getElementsByTagName","sl","charLen","increment","avgWidth","styleObj","fSize","makeEntry","sCon","_classCallCheck","_set","set1","set2","filteredKeys","s1","s2","ForeignSet","isSimpleObject","reqAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","setTimeout","getTimeBasedId","__lastTime","__id","flat","res","scheduler","onFinishCallback","queue","animationFrame","listeners","tempQ","unique","fetch","namedNode","qualifiedName","seed","fetchAggregator","dependencies","getUpstreamNodes","list","rec","qname","placedIndex","preArr","postArr","outgoingEdges","resolver","accumulate","nodeDetails","identity","CustomResolver","utils_classCallCheck","dep","_dep","graph_node_classCallCheck","edges","_seed","requireResolve","retriever","history","electricEdges","_edges","_this","retrieveDetails","edge","head","hist","TypeError","electric_node_classCallCheck","nextFrame","currentFrame","lstnrs","nodes","nFn","_this2","qualifiedNodeMap","graph_node","_wholeSet","_propagate","propagationOverride","currentFrameListeners","nextFrameListeners","_schedule","flushTarget","flush","mount","resolveReqList","objn","perv","addDependencies","_node","getDependencies","getResolvedList","props","fnSpec","eNode","_ref","electric_node","addEdges","addElectricNode","changedSet","upstreamNodes","upstreamNode","append","__execUniqueElectricEdges","cfLstnrs","nfLstnrs","toArray","_this3","repeatHead","resetPropagationOverride","qnames","_this4","update","resolved","resolveDependencyOrder","resolveMap","neighbour","isRoot","model_classCallCheck","_graph","graph","_lockFlag","_reqQ","mountPoint","_addPropInModel","calculationConfig","customResolver","varName","fetchFn","_customResolver","createNodesFrom","instantCall","_graph$stopPropagatio","propsArr","unsub","createElectricNodeOf","stopPropagation","setPropagationOverride","resetNodeValue","_graph$stopPropagatio2","setProp","getNodeValue","getNodeFromQualifiedName","Model","__webpack_exports__","Muze","ContainerManager","maxContainers","svg","containers","rootNode","createElementNS","setAttributeNS","svgRoot","diff","containerObj","keyStr","prev","removeContainer","addContainer","avgCharWidth","display","cObj","ascending","NaN","bisector","compare","ascendingComparator","left","right","ascendingBisect","bisectRight","number","array","src_range","stop","step","e10","e5","e2","src_ticks","ticks","tickIncrement","power","log","LN10","tickStep","step0","step1","quantile","valueof","i0","value0","each","remove","clear","empty","src_nest","sortValues","rollup","nest","sortKeys","depth","createResult","setResult","keyValue","valuesByKey","createObject","setObject","createMap","setMap","sortKey","k","proto","implicit","ordinal","unknown","scale","copy","band","bandwidth","ordinalRange","paddingInner","paddingOuter","align","rescale","sequence","rangeRound","invertExtent","r0","r1","hiIndex","getClosestIndexOf","invert","side","highVal","d1","low","high","src_number","extend","definition","Color","reI","reN","reP","reHex","reRgbInteger","reRgbPercent","reRgbaInteger","reRgbaPercent","reHslPercent","reHslaPercent","named","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","color_formatHex","rgb","formatHex","color_formatRgb","formatRgb","color","exec","rgbn","Rgb","rgba","hsla","g","rgbConvert","opacity","rgb_formatHex","hex","rgb_formatRgb","Hsl","hslConvert","hsl","hsl2rgb","m1","m2","basis","t1","v0","v1","v2","v3","t2","t3","channels","displayable","formatHsl","color_formatHsl","brighter","darker","src_constant","linear","hue","constant","gamma","nogamma","exponential","src_rgb","rgbGamma","colorRgb","rgbSpline","spline","colors","rgbBasis","numberArray","isNumberArray","ArrayBuffer","isView","DataView","genericArray","nb","na","reA","reB","src_string","am","bm","bs","bi","lastIndex","q","one","zero","src_value","value_typeof","string","setTime","valueOf","src_round","d3_scale_src_constant","d3_scale_src_number","deinterpolateLinear","bimap","deinterpolate","reinterpolate","d0","polymap","bisect","target","interpolate","clamp","continuous","piecewise","output","input","interpolateValue","deinterpolateClamp","reinterpolateClamp","interpolateRound","re","formatSpecifier","specifier","FormatSpecifier","sign","symbol","comma","precision","prefixExponent","locale","formatPrefix","formatDecimal","toExponential","coefficient","src_exponent","formatTrim","out","i1","formatRounded","exponent","formatTypes","%","toFixed","toPrecision","X","toUpperCase","src_identity","prefixes","src_locale","group","grouping","thousands","formatGroup","currencyPrefix","currency","currencySuffix","decimal","numerals","formatNumerals","percent","minus","nan","newFormat","prefix","suffix","formatType","maybeSuffix","valuePrefix","valueSuffix","valueNegative","Infinity","defaultLocale","formatLocale","src_tickFormat","precisionPrefix","precisionRound","precisionFixed","linearish","tickFormat","nice","interval","x0","x1","pow10","powp","base","E","exp","logp","log10","log2","reflect","logs","pows","z","raise","thresholds","threshold","quantiles","quantize","t0","newInterval","floori","offseti","offset","previous","setMonth","setHours","setFullYear","setDate","durationMinute","durationWeek","weekday","getTimezoneOffset","sunday","monday","tuesday","wednesday","thursday","friday","saturday","hour","minute","second","millisecond","utcWeekday","setUTCDate","getUTCDay","setUTCHours","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcDay","utcYear","setUTCMonth","setUTCFullYear","localDate","L","utcDate","UTC","newDate","timeFormat","pads","-","0","numberRe","percentRe","requoteRe","requote","formatRe","names","formatLookup","parseWeekdayNumberSunday","w","parseWeekdayNumberMonday","parseWeekNumberSunday","U","parseWeekNumberISO","V","parseWeekNumberMonday","parseFullYear","parseYear","parseZone","Z","parseQuarter","parseMonthNumber","parseDayOfMonth","parseDayOfYear","parseHour24","parseMinutes","parseSeconds","parseMilliseconds","parseMicroseconds","parseLiteralPercent","parseUnixTimestamp","Q","parseUnixTimestampSeconds","formatDayOfMonth","formatHour24","formatHour12","formatDayOfYear","timeDay","timeYear","formatMilliseconds","formatMicroseconds","formatMonthNumber","formatMinutes","formatSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","timeSunday","formatWeekNumberISO","timeThursday","formatWeekdayNumberSunday","formatWeekNumberMonday","timeMonday","formatYear","formatFullYear","formatZone","formatUTCDayOfMonth","formatUTCHour24","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","formatUTCMicroseconds","formatUTCMonthNumber","formatUTCMinutes","formatUTCSeconds","formatUTCWeekdayNumberMonday","dow","formatUTCWeekNumberSunday","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCFullYear","formatUTCZone","formatLiteralPercent","formatUnixTimestamp","formatUnixTimestampSeconds","locale_dateTime","dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","formatShortWeekday","formatWeekday","formatShortMonth","formatMonth","formatPeriod","formatQuarter","utcFormats","formatUTCShortWeekday","formatUTCWeekday","formatUTCShortMonth","formatUTCMonth","formatUTCPeriod","formatUTCQuarter","parses","parseShortWeekday","parseWeekday","parseShortMonth","parseMonth","parseLocaleDateTime","parseSpecifier","parsePeriod","parseLocaleDate","parseLocaleTime","newParse","week","utcFormat","utcParse","durationSecond","durationHour","durationDay","durationMonth","durationYear","calendar","formatMillisecond","formatSecond","formatMinute","formatHour","formatDay","formatWeek","tickIntervals","tickInterval","src_time","timeMonth","timeWeek","timeHour","timeMinute","timeSecond","timeMillisecond","utcMonth","utcHour","setUTCMinutes","utcMinute","setUTCSeconds","src_colors","deg2rad","PI","rad2deg","C","D","ED","EB","BC_DA","cubehelix","cubehelixConvert","Cubehelix","bl","atan2","cubehelixGamma","colorCubehelix","cosh","cos","sinh","sin","cubehelixLong","interpolateCubehelixLong","ramp","sequential","interpolator","d3_scale_chromatic_src_colors","src_ramp","scheme","interpolateRgbBasis","magma","inferno","plasma","warm","cool","sequential_multi_rainbow","ts","UNIT_GLOBAL_NAMESPACE","UNIT_LOCAL_NAMESPACE","LAYER_LOCAL_NAMESPACE","LAYER_GLOBAL_NAMESPACE","GROUP_GLOBAL_NAMESPACE","GROUP_LOCAL_NAMESPACE","CANVAS_LOCAL_NAMESPACE","CANVAS_GLOBAL_NAMESPACE","swap","tmp","defaultCompare","quickselect","quickselectStep","createNode","leaf","minX","minY","maxX","maxY","distBBox","toBBox","destNode","calcBBox","compareNodeMinX","compareNodeMinY","bboxArea","bboxMargin","enlargedArea","intersectionArea","contains","intersects","findItem","items","equalsFn","multiSelect","stack","all","nodesToSearch","_toConsumableArray","RTree","maxEntries","_maxEntries","_minEntries","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","childBBox","err","insert","splitRoot","tmpNode","insertSingleItem","goingUp","indexes","condense","N2","N1","compareMinX","right2","compareMinY","right3","level","minArea","minEnlargement","targetNode","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","area","enlargement","isNode","insertPath","chooseSubtree","adjustParentBoxes","chooseSplitAxis","splitIndex","chooseSplitIndex","newNode","minOverlap","bbox1","bbox2","overlap","allDistMargin","leftBBox","rightBBox","margin","siblings","ReservedFields","MEASURE_NAMES","CommonProps","ACTION_INF","ON_LAYER_DRAW","MATRIX_CREATED","COORD_TYPES","POLAR","CARTESIAN","DATA_TYPE","d3_axis_src_identity","bottom","epsilon","translateX","translateY","entering","__axis","axis","orient","tickArguments","tickValues","tickTransform","tickSizeInner","tickSizeOuter","tickPadding","transform","spacing","range0","range1","center","selection","selectAll","tick","tickExit","exit","tickEnter","enter","attr","line","transition","getAttribute","tickSize","pi","halfPi","tau","asin","symbol_circle","draw","moveTo","arc","symbol_cross","lineTo","closePath","tan30","tan30_2","diamond","square","rect","kr","kx","ky","star","wye","y0","y1","x2","y2","sqrt3","triangle","tauEpsilon","Path","_x0","_y0","_x1","_y1","quadraticCurveTo","bezierCurveTo","arcTo","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","acos","t01","t21","a0","ccw","dx","dy","cw","da","d3_shape_src_constant","none","series","order_ascending","sums","offset_none","s0","stackValue","Linear","areaStart","_line","areaEnd","lineStart","_point","lineEnd","point","curve_linear","Step","_x","_y","curve_step","stepBefore","stepAfter","that","_k","_x2","_y2","Cardinal","tension","custom","cardinal","CatmullRom","alpha","_alpha","_l01_a","_l12_a","_l23_a","_l01_2a","_l12_2a","_l23_2a","x23","y23","curve_catmullRom","catmullRom","src_line","pointX","pointY","defined","curve","curveLinear","buffer","defined0","src_descending","d3_shape_src_identity","arcInnerRadius","innerRadius","arcOuterRadius","outerRadius","arcStartAngle","startAngle","arcEndAngle","endAngle","arcPadAngle","padAngle","cornerTangents","rc","ox","oy","x11","y11","x10","y10","x00","y00","d2","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","cx","cy","colorHsl","hslLong","cubicInOut","b2","b3","b4","b5","b6","b7","b8","b9","b0","bounceOut","elasticOut","elasticIn","amplitude","period","backInOut","elasticInOut","backIn","overshoot","backOut","polyInOut","polyIn","polyOut","d3_voronoi_src_constant","RedBlackTree","RedBlackNode","R","RedBlackRotateLeft","tree","RedBlackRotateRight","RedBlackFirst","after","grandpa","uncle","createEdge","setEdgeEnd","cells","halfedges","createBorderEdge","vertex","clipEdge","ax","ay","connectEdge","fm","fb","lx","ly","rx","ry","fx","fy","cellHalfedgeAngle","cell","site","va","vb","cellHalfedgeStart","cellHalfedgeEnd","firstCircle","circlePool","attachCircle","lArc","rArc","lSite","cSite","rSite","bx","by","epsilon2","ha","hc","circle","Circle","before","circles","detachCircle","beachPool","createBeach","beach","Beach","detachBeach","beaches","removeBeach","disappearing","iArc","nArcs","addBeach","dxl","dxr","directrix","leftBreakPoint","rightBreakPoint","createCell","newArc","hb","rfocx","rfocy","pby2","lfocx","lfocy","plby2","hl","aby2","triangleArea","lexicographic","Diagram","sites","extent","sortCellHalfedges","clipEdges","clipCells","iCell","iHalfedge","nHalfedges","startX","startY","endX","endY","nCells","cover","dc","v00","v01","v11","v10","polygons","polygon","triangles","e1","links","radius","_found","vx","vy","src_voronoi","voronoi","Selection","idGetter","selection_classCallCheck","_dataObjects","_updateData","_enterData","_exitData","_idGetter","newData","entryData","exitdata","tempMap","duplicateData","updatedData","newSelection","dataObjects","defaultValue","_mode","mergedObjects","mergedData","newdata","sortSel","sortSelection","kA","kB","selection_toConsumableArray","objects","dataSelect","idFn","STRING","FUNCTION","HTMLElement","common_utils_typeof","checkExistence","nonExistentKeys","sanitizeIP","typeObj","htmlElem","getMax","common_utils_toConsumableArray","getMin","getDomainFromData","domArr","_loop","_fields","_slicedToArray","field0","field1","arr0","firstMin","secondMin","firstMax","secondMax","sanitizeDomainWhenEqual","unionDomain","domains","_ref2","symbolFns","symbolCircle","cross","symbolCross","symbolDiamond","symbolSquare","symbolStar","symbolWye","symbolTriangle","easeFns","cubic","easeCubic","bounce","easeBounce","elastic","easeElastic","back","easeBack","poly","easePoly","circleInOut","getExtremePoint","points","compareValue","minOrMax","extremePoint","minOrMaxVal","getMinPoint","getMaxPoint","getNearestValue","filterData","getWindow","cancelAnimFrame","cancelAnimationFrame","capitalizeFirst","txt","vals","getMinDiff","uniqueVals","getQualifiedClassName","cls","getDependencyOrder","dependencyOrder","visited","visit","objectIterator","Voronoi","common_utils_classCallCheck","_voronoi","_voronoiFn","getObjProp","_len","_key","intSanitizer","generateGetterSetters","propInfo","_propInfo$","sanitization","preset","onset","typeChecker","getArraySum","total","arraysEqual","isEqual","oldVal","newVal","is","enableChainedTransaction","transactionModel","transactionEndpoint","transactionItems","registerImmediateListener","_ref3","isHTMLElem","ERROR_MSG","INTERFACE_IMPL","mergeRecursive","sink","createSelection","sel","appendObj","mergedSelection","exitSelection","getObjects","inst","interpolateArray","fitCount","linearInterpolate","atPoint","springFactor","angleToRadian","angle","replaceCSSPrefix","numberInterpolator","interpolateNumber","colorInterpolator","interpolateRgb","hslInterpolator","interpolateHslLong","transformColors","piecewiseInterpolator","hue2rgb","hslToRgb","rgbToHsv","hsvToRgb","hexToHsv","hslaToRgb","_hslToRgb2","RGBAtoRGB","r2","g2","r3","g3","detectColor","col","assembleModelFromIdentifiers","fieldMap","_loop2","temp","cIdx","getDataModelFromRange","criteriaFields","selFields","selFn","fieldValue","getArrayIndexMap","getDataModelFromIdentifiers","hasBarLayer","filteredDataModel","dataArr","filteredSchema","include","propField","registerListeners","listenerMap","_len2","_key2","propListenerMap","namespace","mapObj","propType","listenerFn","listener","isValidValue","escapeHTML","htmlEscapes","&","<",">","\"","'","/","transposeArray","extendsClass","extendsFrom","found","concatModels","dataObj1","dataObj2","data1","data2","schema1","schema2","commonTuples","_loop3","row1","row2","dim1Values","dim2Values","dm1Key","dm2Key","commonSchema","getSymbol","stackOrders","_defineProperty","_stackOrders","stackOrderNone","stackOrderAscending","stackOffsets","_stackOffsets","yp","yn","stackOffsetNone","si","sij0","s3","sk","orderNone","offsetNone","oz","kz","sz","sij","ki","d3Stack","nestCollection","nestFn","getArrayDiff","el","pathInterpolators","curveStepAfter","curveStepBefore","curveStep","curveCatmullRom","Symbols","axisLeft","axisRight","axisTop","axisBottom","x0z","y0z","arealine","lineX0","lineY0","lineY1","lineX1","pie","descending","arcs","pa","cornerRadius","padRadius","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","p0","p1","oc","intersect","x3","y3","x32","y32","kc","lc","centroid","Scales","scaleBand","getSmallestDiff","timeFormats","timeDurations","formatTemporal","nearestInterval","getNearestInterval","temporalFields","filteredFields","_ref5","_ref6","lookupWhat","lookupDetails","resolvable","lookupTarget","depArr","deps","nextAnimFrame","getValueParser","retrieveNearestGroupByReducers","_len3","measureFieldNames","_key3","filteredReducers","getAncestorDerivations","nearestReducers","derv","retrieveFieldDisplayName","nearestSortingDetails","nearestSortDerivation","sortingOrder","localeCompare","sortOrderMap","_sortOrderMap","firstVal","secondVal","sortCategoricalField","sortOrderType","_accessors","fn1","fn2","_accessors2","partition","mix","superclass","with","_with","_len4","mixins","_key4","mixin","componentRegistry","comps","reg","regObj","register","customKey","formalName","getReadableTicks","steps","orderedDomain","tempScale","scales","legendTicks","transformColor","rgbaValues","_ref7","_ref7$h","_ref7$s","_ref7$l","_RGBAToHSLA$code","RGBAToHSLA","cmin","cmax","delta","code","origH","origS","origL","origA","sanitizedA","newH","newS","newL","newA","pointWithinCircle","dmMultipleSelection","targetData","payloadMap","currentField","src_selector","selector","querySelector","selectorAll","querySelectorAll","matcher","matches","sparse","EnterNode","ownerDocument","namespaceURI","_next","__data__","keyPrefix","bindIndex","groupLength","dataLength","bindKey","nodeByKeyValue","keyValues","xhtml","src_namespaces","xlink","xml","xmlns","src_namespace","namespaces","space","local","src_window","defaultView","styleValue","getPropertyValue","getComputedStyle","classArray","classList","ClassList","_names","classedAdd","classedRemove","textRemove","htmlRemove","nextSibling","lower","previousSibling","creator","fullname","creatorFixed","creatorInherit","uri","documentElement","constantNull","selection_cloneShallow","cloneNode","selection_cloneDeep","filterEvents","event","mouseenter","mouseleave","filterContextListener","contextListener","related","relatedTarget","compareDocumentPosition","event1","event0","onRemove","typename","on","__on","removeEventListener","capture","onAdd","wrap","addEventListener","customEvent","sourceEvent","dispatchEvent","CustomEvent","createEvent","initEvent","bubbles","cancelable","groups","parents","_groups","_parents","subgroups","subnode","subgroup","enterGroup","updateGroup","_enter","_exit","onenter","onupdate","onexit","groups0","groups1","m0","merges","group0","group1","compareNode","sortgroups","sortgroup","getAttributeNS","attrRemoveNS","removeAttributeNS","attrRemove","removeAttribute","attrFunctionNS","attrFunction","attrConstantNS","attrConstant","priority","styleRemove","removeProperty","styleFunction","setProperty","styleConstant","propertyRemove","propertyFunction","propertyConstant","classed","classedFunction","classedTrue","classedFalse","textFunction","textConstant","html","htmlFunction","htmlConstant","deep","typenames","parseTypenames","dispatch","dispatchFunction","dispatchConstant","src_select","src_point","ownerSVGElement","createSVGPoint","clientX","clientY","matrixTransform","getScreenCTM","inverse","getBoundingClientRect","clientLeft","clientTop","noop","Dispatch","T","types","current","mouse","changedTouches","src_touch","touches","identifier","touch","nopropagation","stopImmediatePropagation","noevent","preventDefault","nodrag","view","__noselect","MozUserSelect","d3_drag_src_constant","DragEvent","subject","active","defaultFilter","ctrlKey","button","defaultContainer","defaultSubject","defaultTouchable","maxTouchPoints","src_drag","mousedownx","mousedowny","mousemoving","touchending","touchable","gestures","clickDistance2","drag","mousedowned","touchstarted","touchmoved","touchended","gesture","beforestart","mousemoved","mouseupped","yesdrag","noclick","clearTimeout","sublisteners","clickDistance","taskHead","taskTail","frame","timeout","pokeDelay","clockLast","clockNow","clockSkew","clock","performance","timer_typeof","now","setFrame","clearNow","Timer","_call","_time","timer","delay","restart","wake","timerFlush","nap","sleep","poke","clearInterval","setInterval","src_timeout","elapsed","emptyOn","emptyTween","CREATED","SCHEDULED","STARTING","STARTED","RUNNING","ENDING","ENDED","transition_schedule","timing","schedules","__transition","self","tween","state","duration","ease","schedule","cssNode","cssRoot","cssView","svgNode","degrees","rotate","skewX","scaleX","scaleY","decompose","atan","interpolateTransform","pxComma","pxParen","degParen","translate","xa","ya","xb","yb","interpolateTransformCss","parseCss","interpolateTransformSvg","parseSvg","baseVal","consolidate","matrix","tweenValue","_id","transition_interpolate","interpolateString","Transition","_name","newId","selection_prototype","inherit","id0","id1","onFunction","on0","on1","sit","attrTween","string00","string10","interpolate0","string0","string1","value1","attrTweenNS","attrInterpolateNS","attrInterpolate","styleTween","styleNull","styleMaybeRemove","listener0","styleInterpolate","textTween","textInterpolate","removeFunction","tweenRemove","tween0","tween1","tweenFunction","delayFunction","delayConstant","durationFunction","durationConstant","easeConstant","Promise","reject","cancel","interrupt","defaultTiming","easeCubicInOut","selectElement","element","makeElement","elemType","callbacks","SVGElement","selectorVal","selectorType","actualSelector","enterSel","mergeSel","exitSel","applyStyle","appendElement","element1","element2","setElementAttrs","attrs","setAttrs","addClass","removeClass","setStyles","styles","createElements","clipElement","measurement","clipPathElement","getMousePos","boundingClientRect","getClientPoint","pos","clientPoint","tag","getEvent","d3event","getD3Drag","d3drag","getSmartComputedStyle","css","textEl","mandatoryStyle","fill-opacity","renderer_utils_typeof","computedStyle","styleForSmartLabel","hasTouch","initProp","fetchPropValues","propNames","setContexts","contexts","propObj","contextMap","depProps","registerListener","propList","callBack","_options$","namespaceInf","callbackFn","namespaceVal","commits","_savedCommits","_propListenerMap","listenersObj","_registeredListeners","_contextMap","contextsObj","commitsObj","subNamespaces","propDeps","nm","fnInf","store_toConsumableArray","registerPropInMaps","registeredListeners","subNamespace","allProps","_fnCount","addListenerToNamespace","_listeners","namespaceListeners","listenerTypes","removePropValue","propInf","sns","Store","store_classCallCheck","_commits","_queuedProps","_locked","store_createClass","lockModel","lock","unlockModel","unlock","lockCommits","locked","unlockCommits","queuedProps","store_slicedToArray","propName","_params2","commit","addSubNamespace","propFns","nsObj","retrieveNamespaces","disableListener","sanitizedVal","savedCommits","disabled","registerChangeListener","computed","calculatedProp","_this$model","unsubscribeAll","unsubscribe","listenersMap","removeSubNamespace","snsMap","transactor","holder","stateProps","nameSpaceProp","nsProp","_len5","_key5","_ref$takesMultiplePar","takesMultipleParams","prevVal","typeCheck","typeExpected","oldValues","events","EVENT_LIST","composition","resolveFn","notification","hasOwn","LifeCycleManager","lifecycle_manager_classCallCheck","_eventList","_promises","_notifiers","_lifeCycles","_unreleasedLifeCycles","_boot","_preparePromises","promise","_makeNotifierPromise","createPromise","then","prm","client","_releasePromisesFromCache","_notify","stage","_resolvePromise","retrieve","_callLifeCycleCallback","_cachePromise","_resetTargetPromise","lifeCycles","CLASSPREFIX","STACK","GROUP","IDENTITY","ANGLE","RADIUS","SIZE","COLOR","SHAPE","TEXT","OUTER_RADIUS_VALUE","TEXT_ANCHOR_MIDDLE","ENCODING","X0","Y0","RADIUS0","ANGLE0","STROKE_DASHARRAY","ASCENDING","AGG_FN_SUM","AREA_LAYER","ARC_LAYER","LINE_LAYER","TEXT_LAYER","POINT_LAYER","BAR_LAYER","TICK_LAYER","SIMPLE_LAYER","BASE_LAYER","SimpleLayer","DATA","CONFIG","MEASUREMENT","DOMAIN","MOUNT","props_defineProperty","_props","axes","metaInf","valueParser","coord","PROPS","_customConfig","newConf","defaultPolicy","BOTTOM","TOP","LEFT","RIGHT","axisOrientationMap","axis_orientation_defineProperty","_axisOrientationMap","AxisOrientation","LINEAR","BAND","TIME","ORDINAL","QUANTIZE","QUANTILE","LOG","POW","SEQUENTIAL","THRESHOLD","CONTINOUS","DISCRETE","HIDDEN","DEFAULT_ANGLE_DOMAIN","scaleLinear","scaleThreshold","scaleLog","scalePow","scaleIdentity","scaleOrdinal","scaleSequential","scaleQuantize","scaleQuantile","scaleTime","scaleMap","scale_creator_defineProperty","_scaleMap","ScaleType","createScale","scaleFactory","adjustRange","axisName","defClassName","axisNamePadding","classPrefix","fixedBaseline","labels","rotation","smartTicks","orientation","numberOfTicks","show","showAxisName","showInnerTicks","showOuterTicks","xOffset","yOffset","defaultSort","changeTickOrientation","selectContainer","axisInstance","_smartTicks","renderConfig","labelManager","isSmartTicks","tickText","registerAnimationDoneHook","rotateAxis","instance","getTickSize","yShift","xShift","tickLabelDim","quadrant","rotationNormalizer","setFixedBaseline","setAxisNamePos","textNode","axisNameHeight","availableSpace","longestWord","quarter","halfYearly","mintues","getTickIntervalFnBasedOnNumberOfTicks","possibleTickLevelIndex","maxPossibleTicks","tickIntervalLevelInfo","tickIntervalInfo","numOfPossibleTicks","getActualTickInterval","noOfTicks","minWidthBetweenTicks","_minTickDistance","getTickIntervalBasedOnCurrentLevel","_dependencies","longestWordType","applyTickSkipping","minTickDistance","minTickSpace","_minTickSpace","minTickWidth","maxTicks","getSkippedTicks","actualNumberOfTicks","_minDiff","millisecondInterval","numOfTicksAccordingToMinDiff","adjustHorizontalRange","adjustVerticalRange","rangeAdjustmentMap","space_setter_defineProperty","_rangeAdjustmentMap","setAxisRange","rangeBounds","getAdjustedRange","getAxisOffset","timeDiff","avWidth","bars","spaceSetter","spaceConfig","heightForTicks","_context$availableSpa2","availWidth","availHeight","isOffset","_context$renderConfig2","_context$getAxisDimen","getAxisDimensions","tickDimensions","allTickDimensions","axisNameDimensions","tickDimHeight","tickDimWidth","namePadding","labelConfig","minTickHeight","getTickValues","tickShifter","maxTickSpaces","widthForTicks","totalTickWidth","getRotatedSpaces","rotatedHeight","rotatedWidth","setOffset","logicalSpace","getAxisComponentDimensions","axisTicks","largestTick","largestTickDimensions","smartTick","_context$renderConfig","labelFunc","_tickLabelStyle","originalLabel","getFormattedText","_axisNameStyle","getHorizontalAxisSpace","axisDimensions","_context$config2","axisDimHeight","minTickDiff","getMinTickDifference","helper_toConsumableArray","getVerticalAxisSpace","_context$config3","calculateBandSpace","largestDimHeight","_getHorizontalAxisSpa","_getVerticalAxisSpace","getValidDomain","userDom","setContinousAxisDomain","_domain","axisComponentDimensions","oldConfig","_config","mockedOldConfig","shouldAxesScaleUpdate","hasAxesConfigChanged","properties","tickFormatter","sanitizeTickFormatter","_scale","_axis","createAxis","_tickFormatter","resetRenderConfig","_renderConfig","_maxTickSpaces","SimpleAxis","simple_axis_classCallCheck","_mount","_range","_domainLock","_axisDimensions","defCon","simpleConfig","bodyElem","dist","_animationDonePromises","domainValue","setAxisComponentDimensions","smartAxisName","axisClass","_objectSpread","setTickConfig","setSmartAxisName","_this$config2","dimType","widthDim","getSmartAxisName","oriSize","domainVal","computeAxisDimensions","_getAxisComponentDime","labelHeight","labelWidth","calculateContinousSpace","_context$renderConfig6","axisNameWidth","_getHorizontalAxisSpa2","_getVerticalAxisSpace2","renderAxis","labelProps","tickLabelStyle","axisTickFormatter","labelOffset","tickData","allTicks","elementToBeModified","elementNotToBeModified","tickValue","_getRawTickValue","selectionSet","rejectionSet","LinearInterpolator","LogInterpolator","PowInterpolator","interpolatorMap","continous_axis_defineProperty","_interpolatorMap","ContinousAxis","continous_axis_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","InterpolatorCls","_interpolator","getScaleValue","_this$renderConfig","sanitizeDomain","_get2","_get","_this$renderConfig2","newTickValues","tickSpace","getNumberOfTicks","labelDim","numberOfValues","tickLength","_this$smartTicks$","BandAxis","_this$maxTickSpaces","_getRotatedSpaces","paddingNormalized","formatTickValue","TimeAxis","_getPrototypeOf2","time_axis_classCallCheck","time_axis_possibleConstructorReturn","time_axis_getPrototypeOf","time_axis_get","rawTicks","resetTickInterval","_context$config8","_context$availableSpa","adjustedRange","x11Colors","Pink","LightPink","HotPink","DeepPink","PaleVioletRed","MediumVioletRed","LightSalmon","Salmon","DarkSalmon","LightCoral","IndianRed","Crimson","FireBrick","DarkRed","Red","OrangeRed","Tomato","Coral","DarkOrange","Orange","Gold","Yellow","LightYellow","LemonChiffon","LightGoldenrodYellow","PapayaWhip","Moccasin","PeachPuff","PaleGoldenrod","Khaki","DarkKhaki","Cornsilk","BlanchedAlmond","Bisque","NavajoWhite","Wheat","BurlyWood","Tan","RosyBrown","SandyBrown","Goldenrod","DarkGoldenrod","Peru","Chocolate","SaddleBrown","Sienna","Brown","Maroon","DarkOliveGreen","Olive","OliveDrab","YellowGreen","LimeGreen","Lime","LawnGreen","Chartreuse","GreenYellow","SpringGreen","MediumSpringGreen","LightGreen","PaleGreen","DarkSeaGreen","MediumSeaGreen","SeaGreen","ForestGreen","Green","DarkGreen","MediumAquamarine","Aqua","Cyan","LightCyan","PaleTurquoise","Aquamarine","Turquoise","MediumTurquoise","DarkTurquoise","LightSeaGreen","CadetBlue","DarkCyan","Teal","LightSteelBlue","PowderBlue","LightBlue","SkyBlue","LightSkyBlue","DeepSkyBlue","DodgerBlue","CornflowerBlue","SteelBlue","RoyalBlue","Blue","MediumBlue","DarkBlue","Navy","MidnightBlue","Lavender","Thistle","Plum","Violet","Orchid","Fuchsia","Magenta","MediumOrchid","MediumPurple","BlueViolet","DarkViolet","DarkOrchid","DarkMagenta","Purple","Indigo","DarkSlateBlue","SlateBlue","MediumSlateBlue","White","Snow","Honeydew","MintCream","Azure","AliceBlue","GhostWhite","WhiteSmoke","Seashell","Beige","OldLace","FloralWhite","Ivory","AntiqueWhite","Linen","LavenderBlush","MistyRose","Gainsboro","LightGray","Silver","DarkGrey","Grey","DimGrey","LightSlateGrey","SlateGrey","DarkSlateGrey","Black","palette","DEFAULT_GRADIENT_COLOR","DEFAULT_CONFIG","stops","getHslString","hslArr","convertToXllString","baseString","getActualHslColor","paletteColor","props_toConsumableArray","newConfig","uniqueValues","treatNullMeasures","scaledVal","minDomainScaledVal","resolveAxisConfig","propVal","defaultVal","sanitiseConfigIntervals","intervals","getStops","newStops","color_strategy_toConsumableArray","indexedDomain","scaleDomain","indexedDomainMeasure","normalDomain","steppedDomain","_getStops","rangeStops","newStopsLength","newRange","continousSteppedDomain","_getStops2","uniqueRange","indexedRange","numVal","normalRange","strategyGetter","domainType","rangeType","schemeType","strategies","color_strategy_defineProperty","domainRange","ColorAxis","color_axis_classCallCheck","_domainType","_rangeType","_schemeType","getSchemeType","_colorStrategy","setColorStrategy","updateDomain","colorStrategy","getScheme","colorSchemes","hslColorArray","getRawColor","color_axis_toConsumableArray","scaleInfo","domainRangeFn","transformationArr","size_strategy_defineProperty","_strategies","pieceWiseRange","size_strategy_toConsumableArray","newIntervals","discreteRange","_userRange","SizeAxis","size_axis_classCallCheck","_sizeStrategy","setStrategy","strategy","domainInfo","domainFn","generator","ShapeAxis","shape_axis_classCallCheck","_generatedShapes","shapeType","shapeGenerator","generatorFn","generatedShapes","createAngleValues","angleData","_angleFn","_angleValues","AngleAxis","angle_axis_classCallCheck","customDomain","customRange","_this$_range","angle_axis_slicedToArray","WIDTH","HEIGHT","MIN_UNIT_WIDTH","MIN_UNIT_HEIGHT","DIMENSIONS","MEASURES","PIVOT","FORMAT","HAS_DATA_UPDATED","ROWS","COLUMNS","COL","ROW","COLUMN","DETAIL","LAYERS","TRANSFORM","RETINAL","CELL","X_AXES","Y_AXES","ENTRY_CELLS","INITIALIZED","EXIT_CELLS","AXIS","UNIT","UPDATED","BEFORE_UPDATE","VALUE_MATRIX","FACET_HEADERS","ARC","BAR","LINE","POINT","PRIMARY","SECONDARY","BOTH","INTERACTION","GRID_LINES","GRID_BANDS","HEADER","FACET","DEFAULT","DESCENDING","DARK","NONE","DARKER","adjustDomain","minOuterRadius","RadiusAxis","radius_axis_classCallCheck","_radiusFactor","sanitizedRange","rangeVal","DATA_TYPES","group_transform","data_type_scale_map_defineProperty","_dataTypeScaleMap","groupByIndices","identityTransform","transformMap","transform_factory_defineProperty","_transformMap","uniqueField","valueField","normalizedData","normalizeData","uniqueFieldIndex","valueFieldIndex","seriesKeyIndex","seriesKeys","tuples","rowObj","_tuple","seriesKey","newArr","orderBy","orderIndex","groupByIndex","stackData","seriesData","transformFactory","colorAxis","styleType","intensity","interactionType","stateColor","currentState","originalState","colorInfo","applyInteractionStyle","interactionStyles","elements","getPlotElementsFromSet","reset","applyLayerStyle","retrieveEncodingInf","encoding","encodingNames","encodingInf","encodingFieldInfRetriever","helpers_defineProperty","_encodingFieldInfRetr","setNullsInStack","transformedData","setNulls","transformData","transformType","encodingFieldInf","setNullData","connectNullData","xField","yField","xFieldType","yFieldType","getIndividualClassName","individualClassName","classNameStr","dataNormalizers","_dataNormalizers","radiusFieldIndex","angleFieldIndex","radius0FieldIndex","angle0FieldIndex","fieldsLen","pointObj","radius0","angle0","enc","xFieldIndex","yFieldIndex","x0FieldIndex","y0FieldIndex","getNormalizedData","transformedDataArr","encodingFieldsInf","domainCalculator","_domainCalculator","layerInst","angleValues","radius0Field","xFieldSubType","yFieldSubType","x0Field","y0Field","yEnc","xEnc","defFn","_d$update","attachDataToVoronoi","accessor","helpers_toConsumableArray","_accessor","updateStyle","animateGroup","groupTransition","groupAnimateStyle","effect","positionPoints","positioner","encodingTransform","getGroupSpan","getUnitWidth","getPlotMeasurement","dimensionalValues","fieldInfo","bandScale","_bandScale","span","groupSpan","offsetValues","actualGroupWidth","dataProps","timeDiffs","innerPadding","isAxisBandScale","axisPadding","groupPadding","renderLayer","render","throwback","parentNamespace","resolveInvalidTransformType","transformResolverPredicates","groupByField","dimensionField","getValidTransform","getValidTransformForAggFn","resolvedInvalidTransformType","_context$encodingFiel","isCustomTransformTypeProvided","getMarkId","resolveEncodingValues","transformedValues","getColorMetaInf","initialStyle","originalStyle","getCoordValue","trig","coordValueGetter","toCartesianCoordinates","rangePlot","_point$update","_coordValueGetter","axisArr","getBoundBoxes","_point$update2","getDataFromEvent","dataPoint","getIdentifiersFromData","layerId","localOptions","local_options_defineProperty","STATE_NAMESPACES","listener_map_slicedToArray","prevData","dataDidSet","getPreviousStyle","stylesForCurrentLevel","getLastItemInMap","strokeProps","stroke-width","stroke","stroke-opacity","parseStyle","datumStyle","applyStylesOnInteraction","_datum$meta","applicableStyles","strokePosition","applicableStrokePos","sanitizedStyles","parsedStyleVal","currentStyle","styleKeys","_partition2","helper_slicedToArray","strokeStyles","otherStyles","applyStyles","layerNs","groupNs","BaseLayerMixin","_superclass","_class","base_mixin_classCallCheck","base_mixin_possibleConstructorReturn","base_mixin_getPrototypeOf","base_mixin_assertThisInitialized","getterSetters","alias","_points","_cachedData","_measurement","_graphicElems","base_mixin_inherits","base_mixin_createClass","_store","_this$metaInf2","_alias","enableCaching","_cacheEnabled","clearCaching","getTransformedData","calculateDomainFromData","isEmpty","getDataDomain","encodingType","_this$metaInf3","getUidsFromPayload","currentSetIds","getUids","uidMap","getNearestPoint","interactionConfig","interaction","resolveTransformType","_transformType","_this$metaInf4","unitDom","cachePoint","pointMap","_pointMap","getInteractionStyles","addOverlayPath","removeOverlayPath","interactionFn","allMeasures","_identifiers$","_identifiers$2","hasPlotSpan","getPlotSpan","getPlotPadding","getPointsFromIdentifiers","getAllAttrs","filteredPoints","base_mixin_toConsumableArray","sizeVal","getTransformedDataFromIdentifiers","measureIndex","_identifiers$getData","identifierData","identifierSchema","_normalizedData","_this$encodingFieldsI","layerName","tupleArr","transformedVal","graphicElems","elems","animationDone","base_mixin_slicedToArray","encodingValue","retrieveEncodingFields","_transformedData","calculateDomain","applyElementStyles","getState","getListeners","getRenderProps","_context$metaInf","unitRowIndex","unitColIndex","base_mixin_defineProperty","getQualifiedStateProps","_construct","userConf","shouldDrawAnchors","BaseLayer","containsNull","getborderIndexes","prevOfNull","nextOfNull","settIndexPrevOrNext","indexesObj","prevContainsNull","nextContainsNull","getElementsForLine","layer","strokeStyle","linepath","updateFns","drawLine","containerSelection","nullDataLineStyle","nullDataLineClass","curveInterpolatorFn","dd","elementWithNullData","sanitizeNullConfig","makeStartEndPair","borderIndexes","pairArray","pair","prevValue","nextValue","fade","focus","brushStroke","crossline","nearestPointThreshold","strokeOpacity","fillOpacity","strokeWidth","LineLayerMixin","line_mixin_classCallCheck","line_mixin_possibleConstructorReturn","line_mixin_getPrototypeOf","line_mixin_inherits","line_mixin_createClass","getDrawFn","translatePoints","xAxis","yAxis","isXDim","isYDim","xPx","yPx","getColor","resolvedEncodings","getTranslatedData","colorValFn","colorFieldIndex","colorVal","getPathStyle","qualifiedClassName","colorField","translatedPoints","seriesClassName","searchRadius","_point$data$data","line_mixin_toConsumableArray","line_mixin_get","drawArea","easeEffect","_map2","renderer_slicedToArray","enterAreaPath","updateAreaPath","selectionEnter","AreaLayerMixin","area_mixin_classCallCheck","area_mixin_possibleConstructorReturn","area_mixin_getPrototypeOf","area_mixin_inherits","area_mixin_createClass","area_mixin_get","nearestPoint","dimValue","pointArr","_pointArr$i$update","pointY0","classNameFn","minYVal","basePos","y0Px","invalidY","invalidY0","resolvedValues","AreaLayer","highlight","stroke-linejoin","shape","states","fadeout","selected","ArcLayerMixin","arc_mixin_classCallCheck","arc_mixin_possibleConstructorReturn","arc_mixin_getPrototypeOf","_prevPieData","arc_mixin_inherits","arc_mixin_createClass","_this$axes","radiusAxis","pieIndex","angleV","angles","_angles","uid","getOuterRadius","getInnerRadius","startAngle0","endAngle0","_previousInfo","getPreviousPoint","currIndex","prevArc","nextArc","_context$axes$angle$r2","arc_helper_slicedToArray","_this$config","qualClassName","_arcFn","consecutiveExits","exitCounter","tweenPie","individualClass","tweenExit","exitArr","oldExitCounter","tweenExitPie","consecutiveExitArr","gElem","pieSlices","pieSliceInf","tData","ArcLayer","LineLayer","drawText","selectionMerge","backgroundVal","textanchor","textStyle","background","backgroundPadding","_smartLabel$getOriSiz","backgroundEl","alignment-baseline","defaultEncoding","alignmentBaseLine","defRotation","pointTranslators","polar","textEncoding","angleAxis","textFormatter","backgroundEncoding","backgroundValue","text_mixin_objectSpread","cartesian","textField","textFieldIndex","textValue","text_mixin_slicedToArray","TextLayerMixin","text_mixin_classCallCheck","text_mixin_possibleConstructorReturn","text_mixin_getPrototypeOf","text_mixin_inherits","text_mixin_createClass","getPointTranslator","text-anchor","TextLayer","drawSymbols","createShape","groupElement","Element","newShape","nodeName","src","href","shapeElement","pathStr","checkPath","pathEl","exitGroup","defColorStyle","focusStroke","commonDoubleStroke","doubleStroke","anchors","persistent-anchors","brush-anchors","shapes","sizes","prepareDrawingInf","shapeAxis","sizeAxis","getShape","getSize","layerEncoding","helper_defineProperty","_config$offset","offsetX","offsetY","point_helper_slicedToArray","measure","getStrokeWidthByPosition","inside","outside","PointLayerMixin","point_mixin_classCallCheck","point_mixin_possibleConstructorReturn","point_mixin_getPrototypeOf","_overlayPath","formattedUids","point_mixin_inherits","point_mixin_createClass","maxSize","generateDataPoints","point_mixin_toConsumableArray","drawFn","_maxSize","_getPlotMeasurement2","point_mixin_slicedToArray","widthMetrics","heightMetrics","offsetXValues","offsetYValues","measurementConf","getMeasurementConfig","widthSpan","heightSpan","distanceLimit","refElement","pathElement","parentElement","styleVal","currentPath","point_mixin_get","PointLayer","drawRects","barEnterFn","transitionBars","selTransition","positionRetriever","isNegativeVal","barBasePos","resolveDimByField","axesInfo","spaceType","sizeEncoding","sizeConfig","sizeValue","enterSpace","minVal","maxVal","diffPx","minDomVal","endPos","_positionRetriever$ty2","bar_helper_slicedToArray","resolveDimensions","_resolveDimByField","enterWidth","enterX","xPos","_resolveDimByField2","enterHeight","BarLayerMixin","bar_mixin_classCallCheck","bar_mixin_possibleConstructorReturn","bar_mixin_getPrototypeOf","_plotPadding","_plotSpan","bar_mixin_inherits","bar_mixin_createClass","bar_mixin_get","getTranslatedPoints","normalizedDataArr","barContainer","bar_mixin_slicedToArray","barWidthMetrics","barHeightMetrics","barWidthOffsets","barHeightOffsets","barWidth","barWidthOffset","barHeight","barHeightOffset","pathGroup","_strokeWidthPositionM","strokeWidthPositionMap","L1","L2","L3","BarLayer","tick_renderer","pathElem","angle0Axis","angle0V","angles0","_angles2","tick_mixin_objectSpread","_layerInst$encodingFi","_config$span","xSpan","ySpan","x0Px","TickLayerMixin","tick_mixin_classCallCheck","tick_mixin_possibleConstructorReturn","tick_mixin_getPrototypeOf","tick_mixin_inherits","tick_mixin_createClass","offsetM","offsetL","_ref$position","drawTicks","TickLayer","sanitizeEncoding","layerFactory","compositeLayers","factoryObj","setLayerRegistry","_layerRegistry","getSerializedConf","mark","layerDef","serializedDefs","defs","unitLayerDef","sDef","parseLayerDefinition","layerType","strs","propValue","layer_factory_toConsumableArray","getLayerInstance","layerRegistry","instances","layerObj","layerConstructor","getLayerClass","composeLayers","layerDefs","sanitizeLayerConfig","DEFAULT_LAYERS","defaults_defineProperty","_DEFAULT_LAYERS","LAYER_TYPES","layer_registry","layers","helpers","commonHelpers","pointLayerHelpers","layerMixins","getDimensionMeasureMap","retinalEncodingsAndMeasures","_layer$encodingFields","sizeField","shapeField","_retinalEncodingsAndM","src_helper_toConsumableArray","transformDataModels","dataModels","transformVal","getLayerFromDef","existingLayer","rowIndex","colIndex","instanceArr","_timeDiffs","resolveEncodingTransform","sanitizeLayerDef","sanitizedDefs","sConf","attachDataToLayers","transformedDataModels","dataSource","attachAxisToLayers","layerAxisIndex","axesObj","axisInf","axisIndex","getLayerAxisIndex","_layer$config","specificField","encodingField","fieldInst","getMembers","unionDomainFromLayers","axisFields","domainValues","layerDomain","fieldDomain","encodingDomain","fieldStr","domain1","renderLayers","_lifeCycleManager","notify","orderedLayers","layerParentGroup","layerDepOrder","_layerDepOrder","getNearestDimensionalValue","entryVal","getLayersBy","searchBy","removeLayersBy","createSideEffectGroup","createRenderPromise","_renderedPromise","_renderedResolve","getRadiusRange","radiusAxes","isXandYMeasures","_context$fields","src_helper_slicedToArray","xMeasures","yMeasures","getValuesMap","idValuesMap","valuesIdMap","_model$getData","fieldIndices","getSelectionRejectionModel","propValuesMap","rejectionModel","_propModel$getData","entryRowIds","exitRowIds","rowIdsObj","createRTree","interactive","rtree","load","AXES","LAYERDEFS","TRANSFORMEDDATA","DATADOMAIN","FIELDS","LAYERAXISINDEX","IDFIELD","GRID_LINE_PARENT_GROUP_CLASS","GRID_BAND_PARENT_GROUP_CLASS","GRID_PARENT_GROUP","TICK","GRID_BAND","GRID_LINE","CONSOLIDATED","FRAGMENTED","FACET_BY_FIELDS","RETINAL_FIELDS","PARENT_ALIAS","CACHED_DATA","STORE","DRAG","HOVER","SELECTIONDRAG","CLICK","LONGTOUCH","TOUCHDRAG","ALL_ACTIONS","SELECTION_NEW_ENTRY","SELECTION_NEW_EXIT","SELECTION_NULL","SELECTION_OLD_ENTRY","SELECTION_OLD_EXIT","SelectionSet","_volatile","selection_set_classCallCheck","completeSet","_uidMap","_measureNames","_dimVals","measureNames","dims","_completeSetCount","_lockedSelection","_fieldIndices","_resetted","entrySet","exitSet","mergedEnter","mergedExit","dimVals","_config$keepDims","keepDims","_config$dimensions","measureNamesArr","selection_set_toConsumableArray","addSet","removeSet","updateSet","raw","changeSideEffectAvailability","toEnable","sideEffects","change","enable","disable","getMergedSet","muze_firebolt_src_helper_toConsumableArray","getSideEffects","behaviour","behaviourEffectMap","behaviours","effects","unionSets","firebolt","combinedSet","uidSet","entryExitSet","_entryExitSet","_entryExitSet$type","existingModel","cloneObj","clonedVal","getKeysFromCriteria","_firebolt$_metaData","_metaData","dimensionsMap","dimArr","firebolt_defineProperty","dimKey","firebolt_toConsumableArray","Firebolt","actions","firebolt_classCallCheck","_sideEffectDefinitions","_sideEffects","_propagationInf","_sourceSelectionSet","_actions","behavioural","physical","_selectionSet","_volatileSelectionSet","_propagationFields","_sideEffectPolicies","_propagationBehaviourMap","_behaviourPolicies","_actionBehaviourMap","_behaviourEffectMap","_actionHistory","_queuedSideEffects","_handlers","_payloadGenerators","_payloads","mapSideEffects","registerBehaviouralActions","registerSideEffects","registerPhysicalBehaviouralMap","physicalBehaviouralMap","registerPhysicalActions","setSideEffectConfig","sideEffect","sideEffectConf","behEffectMap","preventDefaultActions","effectNames","initializeBehaviouralActions","dispatchableBehaviours","Action","prepareSelectionSets","initializeSideEffects","sideEffectStore","actionHistory","queuedSideEffects","mergeSelectionSets","firebolt_typeof","sideEffectInstance","isEnabled","mutates","dispatchSideEffect","setTransform","propagationInfo","sanitizePayload","propagate","shouldApplySideEffects","propagationIdentifiers","applicableSideEffects","getApplicableSideEffects","applySideEffects","getEntryExitSet","sourceSelectionSet","behaviourConditions","sideEffectConditions","physicalAction","actionBehaviourMap","behaviourMap","mapActionsAndBehaviour","handler","onDataModelPropagation","dispatchBehaviour","uniqueIds","behaviouralActions","volatileSelectionSet","sideEffectDefinitions","sideEffectsMap","SideEffect","initedActions","initializePhysicalActions","physicalActions","phyAction","initedPhysicalActions","getDefaultTargetContainer","bindActionWithBehaviour","registerPhysicalActionHandlers","targets","behaviourList","applicableSelectionSets","handlers","genericHandlers","onPhysicalAction","beh","_this$context","getRangeFromIdentifiers","defaultFn","__default","GenericBehaviour","generic_classCallCheck","_enabled","selectionSets","getSelectionSets","_this$getAddSetFromCr","getAddSetFromCriteria","getPropagationInf","_payload","setSelectionSet","_this$firebolt","_selectionSet$getSets","getSets","getSetInfo","getSourceFields","setFields","setKeys","aggFns","propData","propagationFields","resetted","otherFields","generic_slicedToArray","generic_toConsumableArray","_propagationIdentifiers","VolatileBehaviour","existingAddSet","SELECTION","updateExit","getCompleteSet","BRUSH","HIGHLIGHT","TOOLTIP","FILTER","HighlightBehaviour","BrushBehaviour","BEHAVIOURNAMES","FilterBehaviour","PersistentBehaviour","updateEntry","SelectBehaviour","mergedExitSet","completeSetCount","dragCriteriaRetriever","drag_action_config_defineProperty","_dragCriteriaRetrieve","sourceInfo","startPos","ranges","getRangeFromPositions","getDragActionConfig","getSourceInfo","coordType","attachDragEvent","targetEl","drawingInf","touchStart","d3Drag","getDrawingContext","newStartPos","newEndPos","dragging","dragDiff","triggerPhysicalAction","dragEnd","hover","tooltip","svgContainer","getAllPoints","showInPosition","ACTION_NAMES","generatePayloadFromEvent","click","physical_defineProperty","_physicalActions","longtouch","touchEnd","touchdrag","ANCHORS","BRUSH_ANCHORS","PERSISTENT_ANCHORS","HIGHLIGHTER","CROSSLINE","FRAGMENTED_TOOLTIP","AXIS_LABEL_HIGHLIGHTER","GenericSideEffect","generic_sideeffect_classCallCheck","_strategy","plotPointsFromIdentifiers","_this$firebolt$contex","getPlotPointsFromIdentifiers","_sourceInfo","_layers","_plotPointsFromIdentifiers","SurrogateSideEffect","_config$reset","layerFields","filteredUids","_ref2$","surrogate_slicedToArray","SpawnableSideEffect","_drawingContext","changeVisibility","sideEffectGroup","visible","SelectionBox","boxConf","box","drawingContext","unitWidth","unitHeight","selectionGroupClassName","persistent","hide","sourceInf","_getBoxDimensionsFrom","getBoxDimensionsFromPayload","xRange","yRange","xDim","yDim","xLinear","yLinear","xCriteria","yCriteria","x1Val","x2Val","x1DomainIndex","x2DomainIndex","_sort2","selection_box_helper_slicedToArray","y1Val","y2Val","y1DomainIndex","y2DomainIndex","_sort4","_xDim","_yDim","direction","selectionBox","selectiondrag","BEHAVIOURS","selectionBoxDrag","onDrag","ACTIONS","boxClassName","parentClassName","connectorClassName","content","iconContainerSize","iconScale","iconShape","iconColor","rowMargin","separator","arrow","Content","content_classCallCheck","_model","_formatter","ctx","displayFormat","table","tbody","elemData","Tooltip","htmlContainer","tooltip_classCallCheck","connectorContainer","tooltipConf","contentClass","_tooltipContainer","_contentContainer","_contents","_tooltipConnectorContainer","defConf","contentConfig","specificClass","reorderContainers","contentConf","_target","tooltipPos","_orientation","connector","_offset","dim","_extent","contentContainer","topSpace","dimX","rightSpace","leftSpace","bottomSpace","arrowSize","tooltipHeight","tooltipWidth","spaces","positionHorizontal","positionVal","positionVertical","hMax","vMax","_position","HIGHLIGHT_SUMMARY","defNumberFormat","formatters","strategies_defineProperty","isSingleValue","dataLen","stackedSum","getStackedKeyValue","getKeyValue","isSelected","removeKey","isStackedBar","stackedValue","keyObj","valueObj","stackedValueObj","margin-left","getStackedSum","generateRetinalFieldsValues","valueArr","retinalFields","dimensionMeasureMap","fieldInf","retField","retIndex","retinalFieldValue","measuresArr","icon","_fieldInf$retField","formattedRetinalValue","hasMultipleMeasures","_fieldInf$measure","dName","formatterFn","currentMeasureValue","strategies_toConsumableArray","buildTooltipData","nestedDataObj","fieldValues","_dataModel$getData","fieldspace","_context$retinalField","detailFields","_ref2$showStackSum","showStackSum","_context$payload$sele","selectedMeasures","containsDetailField","getFieldInf","defFormatter","nf","getTabularData","strategies_construct","isStacked","isStackedChart","isStackedBarChart","filteredMeasures","generateTooltipContent","nestedData","_nestedData$i","_fieldInf$field","len2","_fieldInf$name","strategies_strategies","showMultipleMeasures","entryUids","fieldsConf","aggregatedValues","getAggregatedValues","dimsMap","groupedDm","dmFields","_values$0$data","_fieldsConf$measure$d","rowValues","configResolvers","tooltip_defineProperty","_configResolvers","specificConf","_default","side_effects_tooltip_classCallCheck","tooltip_possibleConstructorReturn","tooltip_getPrototypeOf","_tooltips","sanitizeConfig","strategyObj","sanitizedConf","createTooltip","tooltips","positionRelativeTo","sourceFields","tooltip_get","plotDim","_config$strategy","projectFields","dataTransform","strategyFn","dt","layoutContainer","parentContainerDimensions","layoutBoundBox","unitBoundBox","tooltipInst","TooltipRenderer","highlightSummary","selectionSummary","FragmentedTooltip","totalHeight","totalWidth","boundBox","showVertically","boxes","fragmented_tooltip_toConsumableArray","fragmented_tooltip_get","fragmented_tooltip_getPrototypeOf","tooltipBoundBox","getContents","spaceOutBoxes","spaceOutIfOverlap","firstBox","secondBox","opposite","repositionArrow","Crossline","bandWidth","px","bandClass","lineClass","isEmptyDataModel","plotWidth","crossline_toConsumableArray","startPx","endPx","parentGroup","getFormattedSet","selectedPointsId","formattedSet","helper_objectSpread","fadeFn","fadeOnBrush","fadeOnBrushFn","getPayload","actualPoint","commonSet","excludeSetIds","currentHighlightedSet","selectEntrySet","diffSet","pseudoFocus","PlotHighlighter","plot_highlighter_classCallCheck","plot_highlighter_possibleConstructorReturn","plot_highlighter_getPrototypeOf","excludeSet","selectedPointsIds","plot_highlighter_toConsumableArray","currentStrategy","getExcludeSetIds","plot_highlighter_objectSpread","FilterEffect","entryModel","resetData","AnchorEffect","anchors_classCallCheck","anchors_possibleConstructorReturn","anchors_getPrototypeOf","_layersMap","addAnchorLayers","addLayer","layerCls","depLayerEncoding","defaultSizeValue","commonName","layerOwner","defaultClassName","groupId","getTransitionConfig","owner","registry","upperAnchors","lowerAnchors","targetObj","anchors_toConsumableArray","layerConfig","linkedLayer","getLayerByName","linkedLayerName","isUpperAnchor","_linkedLayer$getTrans2","anchors_slicedToArray","dmFromPayload","_linkedLayer$getTrans4","transformedDataModel","anchorSizeConfig","getAnchorSizeOnInteraction","getAnchorStroke","PersistentAnchors","anchor","defaultInteractionLayerEncoding","BrushAnchors","AxisLabelHighLighter","selectedData","selectedDataValues","_context$axes","_context$axes$x","_context$axes$y","axis_labels_highlighter_toConsumableArray","fieldMeta","selData","_axis$getTicksBasedOn","getTicksBasedOnData","selectedElements","nullDataTooltipMap","bar","applySideEffectOnEmptyTarget","behaviour_effect_map_defineProperty","brush","brushEntrySet","unionedSet","highlightUids","SIDE_EFFECTS","convertToObj","payloadGenerator","selectionDataModel","facetByFields","propPayload","getRangeFromData","_propConfig$includeMe","includeMeasures","selectionDataFields","measureNamesIdx","excludeSelectedMeasures","payload_generator_defineProperty","selectionSetFields","_facetByFields","payload_generator_slicedToArray","_facetByFields$","facetFields","_facetByFields$2","facetValues","facetIndices","identifierIdxMap","sourceIdentifierFields","identifierMap","payload_generator_toConsumableArray","pseudoSelect","isSideEffectEnabled","se","sideEffectPolicies","sideEffectCheckers","propagationData","prepareSelectionSetMap","maps","getUniqueKeys","_ref2$keys","_ref2$dimensionsMap","mKey","firebolt_helper_toConsumableArray","sanitizePayloadCriteria","propFields","_ref4","dimsMapGetter","firebolt_helper_defineProperty","fieldIndexMap","dataWithFacets","measureNameField","propDims","origRow","rowVal","newRowVal","createMapByDimensions","cacheMap","_cacheMap","sideEffectPolicy","hasCommonCanvas","sourceCanvas","UnitFireBolt","src_firebolt_classCallCheck","firebolt_possibleConstructorReturn","firebolt_getPrototypeOf","_connectedBehaviours","payloadGenerators","changeSideEffectStateOnPropagation","unitId","aliasName","parentAlias","propagationSourceCanvas","sourceUnitId","sourceUnit","sideEffectInstances","actionOnSource","mappedEffects","applySideEffect","_this$_metaData","_dimsMapGetter","enabledFn","enabled","getPayloadGeneratorFor","payloadFn","behaviourPolicies","dispatchSecondaryActions","secAction","generatedPayload","payloadGeneratorFn","firebolt_get","cachedData","action_behaviour_map_defineProperty","UnitBrushBehaviour","dragStart","brush_get","behaviours_brush_getPrototypeOf","getGridLayerDefinitions","axisType","getDefaultVisibilty","getLayerDefinition","_definition","_axes","_encoding","gridLines","gridBands","gridLineColor","zeroLineColor","gridBandColor","isLinearScale","grid_lines_defineProperty","isNegativeDomain","dimensionSubTypes","getValidSubtype","attachDataToGridLineLayers","_gridLines","_gridBands","gridLayerData","getGridLayerData","gridData","jsonData","_jsonData$push","grid_lines_toConsumableArray","src_listener_map_slicedToArray","fieldsVal","removeExitLayers","layersMap","markSet","queuedLayerDefs","_queuedLayerDefs","layerDefArr","listener_map_toConsumableArray","timeDiffsByField","minimumConsecutiveDifference","_ref8","_timeDiffsByField","originalData","_prepareSelectionSetD","prepareSelectionSetData","_prepareSelectionSetM","createSelectionSet","attachPropagationListener","_ref9","createGridLineLayer","vuConf","atomicDef","_ref11","_ref12","_ref15","_ref16","layerAxisIndexVal","_layerAxisIndex","axesVal","_dimensionMeasureMap","src_props_defineProperty","_PROPS","facets","facetKeys","facetFieldsMap","trackerClassName","arcLayerClassName","sideEffectClassName","local_options","src_local_options_defineProperty","_CONFIG$LAYERDEFS$TRA","_cachedValuesMap","local_options_toConsumableArray","oldData","PseudoSelectBehaviour","unitNs","VisualUnit","visual_unit_classCallCheck","lifeCycleManager","_gridLinesSelection","_gridBandsSelection","createFireboltInstance","_Object$assign","interactions","fireboltDeps","Cls","getFireboltCls","visual_unit_defineProperty","getActionBehaviourMap","getBehaviourEffectMap","_firebolt","createRootContainers","_rootSvg","_sideEffectGroup","initSideEffects","class","renderGridLineLayers","gridLineParentGroup","_entry","grid_lines_slicedToArray","parentGroupClass","rootSvg","_this$parentContainer","parentContainerInf","layerDefinition","layerDefinitions","components","layerIndex","layersArr","_layersArr","markId","defArr","instanceValues","visual_unit_toConsumableArray","layerdeps","_this$_dependencies","parentModel","REACTIVE_PROPS","pointInf","getMarkInfFromLayers","visual_unit_objectSpread","markInf","parsedIdentifiers","_this$fields","xdom","ydom","_rtree","localNs","dataDomain","visual_unit_slicedToArray","dispatchQueuedSideEffects","clearActionHistory","visual_unit_construct","Variable","ComposedVars","composed_vars_classCallCheck","composed_vars_possibleConstructorReturn","composed_vars_getPrototypeOf","vars","_vars","_data","member","SimpleVariable","simple_var_classCallCheck","simple_var_possibleConstructorReturn","simple_var_getPrototypeOf","oneVar","_oneVar","dtFormat","dateFormat","fieldDef","varInst","convertToVar","datamodel","transformFields","field_sanitizer_slicedToArray","normalizedFields","normalizeFields","norFields","orderFields","fieldArray","temporalArr","categoricalArr","fieldList","numOfMeasures","allDimensions","field_sanitizer_toConsumableArray","temporal","categorical","rowsInfo","columnsInfo","rowDimensions","rowMeasures","rowTemporalFields","rowCategoricalFields","columnDimensions","columnMeasures","columnTemporalFields","columnCategoricalFields","BORDER_WIDTH","facet","handleBlankCell","externalClassname","sanitiseHeaderMatrix","matrices","sanitiseFacetValues","blankCell","normal","latestSource","lastSource","initStore","group_utils_defineProperty","isDistributionEqual","group_utils_toConsumableArray","rowType","initializeCacheMaps","cellMap","xAxesMap","yAxesMap","entryCellMap","exitCellMap","getAxisKey","getCellKey","columnId","extractUnitConfig","unitConfig","hasOneField","getHeaderText","rowLength","headerCreator","fieldHeaders","TextCell","findInGroup","variable","channel","group_utils_this","facetType","projType","getAxisType","retriveDomainFromData","mutateAxesFromMap","cacheMaps","xAxes","yAxes","xAxisSet","yAxisSet","axisId","getEncoder","encoder","CartesianEncoder","layerConf","hasPolarEncodings","PolarEncoder","getHeaderAxisFrom","userAxisFromConfig","axisFrom","headerFrom","group_utils_slicedToArray","firstField","secondField","firstFieldType","secondFieldType","setFacetsAndProjections","_encoder$simpleEncode","simpleEncoder","getFacetsAndProjections","projections","getBorders","showRowBorders","showColBorders","showValueBorders","valueMatrix","_rows","leftRows","rightRows","_columns","topColumns","bottomColumns","_encoder$fieldInfo","allDimensionLength","allMeasuresLength","allTemporalFieldsLength","getRowBorders","borders","getColumnsBorders","getValueBorders","borderTypeRow","borderTypeCol","getFieldsFromSuppliedLayers","suppliedLayerConfig","encodingArr","group_utils_typeof","extractFields","facetsAndProjections","flattenArray","sortFacetFields","facetNames","sortInfo","sortConfig","facetSortConfig","getSchemaDef","removeExitCells","exitCells","qualifiedStateProps","placeholder","globalConfig","VisualEncoder","visual_encoder_classCallCheck","_fieldInfo","_axisFrom","_headerFrom","__headerFrom","_getHeaderAxisFrom2","visual_encoder_slicedToArray","rowHeader","rowAxis","_getHeaderAxisFrom4","colHeader","colAxis","scaleMaps","getFieldNames","fieldVar","matrix_model_toConsumableArray","prepareHashMaps","rowKey","joinedRowKey","createJoinedKeys","keyArr","joinedKey","formatKeys","formatterList","formattedKeys","rKeys","rIdx","createColumnDataModels","colContext","sourceDM","rowFacets","colFacets","rowKeyArr","colKeyObj","newRowIndex","splitModelsHashMap","currentColumnIndex","colKeyArr","colKey","hashMapKey","splitByColumn","optionalProjections","facetInfo","projectionInfo","geomCellCreator","_indices$i","projectionIndexObject","columnIndex","matrix_model_objectSpread","getMatrixModel","currentRowIndex","prepareProjectionInfo","colProjections","rowProjections","rowProj","rIndex","newRIndex","colProj","cIndex","newCIndex","newRowProj","newColProj","rowFields","columnFields","prepareFacetInfo","rowFacetNames","colFacetNames","allFacets","_getSplitModelHashMap","getSplitModelHashMap","splitModels","rowKeyHashMap","colKeyHashMap","rowKeys","colKeys","splitContext","splitByRow","setDefaultConfigForFacet","facetsUserConfig","border","isBorderPresent","isGridLinePresent","gridLinesShowLength","borderWidth","generalContext","rowKeyObj","createRowDataModels","rowContext","rowIndexForCurrentKey","_createColumnDataMode","_createColumnDataMode2","_createColumnDataMode3","_createColumnDataMode4","formattedColKeys","facetField","rawFormat","columnKeys","createValueCells","suppliedLayers","GeomCell","matrixLayers","horizontalAxis","verticalAxis","datamodelTransform","sortedFields","layerConfigArr","getLayerConfig","retinalConfig","axesCreators","normalizedColumns","normalizedRows","cell_creator_toConsumableArray","geomCellKey","geomCell","updateCells","facetKey","extractAxisIndex","createAxisCells","currObj","axisInst","_axisInst$config","AxisCell","BlankCell","extractFacetIndex","headerPlaceholderGn","selectionObj","counter","selectionKeys","keySet","textCells","createTextCells","textCell","generatePlaceholders","encoders","valuesMatrix","takeAxisFrom","takeHeaderFrom","axisPlaceholderGn","selObj","axesMatrix","selObjProp","axesForDraw","rowsPrimary","rowPrime","rowsSecondary","rowSec","columnsPrimary","colPrime","columnsSecondary","colSec","_selectionObj","section","hContext","getAxisFields","fieldHolder","ac","transformDataModel","resolvedData","newFieldsConfig","aggregationFns","nearestAggFns","resolvedAggFns","sortDmTemporalFields","computeMatrices","resolverConfig","otherEncodings","isProjection","isFacet","matrixGnContext","getCellDef","isRowSizeEqual","isColumnSizeEqual","colCells","rowCells","resetSimpleAxes","newCacheMap","valueCellContext","serializeLayerConfig","cellCreator","valueCellsCreator","valueMatrixInfo","_mutateAxesFromMap","createUnits","_generateMatrices","generateMatrices","leftHeaders","topHeaders","bottomHeaders","rightHeaders","cell_creator_slicedToArray","_map4","leftFacets","rightFacets","rowPriority","colPriority","leftMatrix","rightMatrix","topMatrix","bottomMatrix","currentBottomLength","setAvailableSpace","rowMatrix","columnMatrix","sanitiseBorderMatrix","bottomBorderObj","sanitiseGeomMatrix","RESOLVER_PROPS","units","MatrixResolver","matrix_resolver_classCallCheck","_registry","_layerConfig","_matrixLayers","_rowMatrix","_columnMatrix","_valueMatrix","_facets","_projections","_datamodelTransform","_units","_cacheMaps","_fireboltDeps","_placeholderInfo","matrix_resolver_toConsumableArray","getProjectionFields","_horizontalAxis","_verticalAxis","matrixType","matrix_resolver_defineProperty","_this5","_this$dependencies","autoGroupBy","_this$getAllFields","retContext","getRetinalFieldsDomain","getRetinalAxes","retinalEncoder","setCommonDomain","retinalAxes","updateVisualUnit","placeholders","bottomLeft","bottomRight","_this$dependencies2","showHeaders","_this$registry$cells","matrix_resolver_slicedToArray","topCols","bottomCols","rowHeaders","blankCellCreator","footers","topLeft","topRight","updateModel","dataTypeScaleMap","src_data_type_scale_map_defineProperty","data_type_scale_map_dataTypeScaleMap","getAdjustedDomain","y1ratio","y2ratio","allSameSign","generateAxisFromMap","axisKey","groupAxes","currentAxes","commonAxisKey","axisConfig","getAxisConfig","axisInfo","axisOrientation","rawUserAxisConfig","userAxisConfig","_rotationLock","createSimpleAxis","sanitizeIndividualLayerConfig","encodingConfigs","getDefaultMark","colFieldType","rowFieldType","createRetinalAxis","fieldProps","getIndex","arrIndex","getLayerConfFromFields","colFields","userLayerConfig","encoder_helper_toConsumableArray","xFields","yFields","colFieldExist","rowFieldExist","resolverAxes","axesArr","userConfig","getSortingConfig","currentFieldName","axesConfig","lastSortConfig","geomCellAxes","1","unitsArr","encodingDomains","axisTypeIndex","typeOfField","_resolver$axes","adjustedDomain","typeOfAxis","alignZeroLine","primaryFacets","secondaryFacets","primaryFields","secondaryFields","primaryLen","secondaryLen","projArr","primaryField","secondaryField","existIndex","axisFromIndex","cartesian_encoder_get","cartesian_encoder_getPrototypeOf","encodingObj","layerArray","serializedLayers","colField","colFieldName","rowField","configs","rowFieldName","defConfigs","layerConfigs","mergedLayerConf","serializedLayerConfig","cartesian_encoder_toConsumableArray","axesCls","polar_encoder_defineProperty","_axesCls","pieAxes","varInstances","encType","domainProps","matrixInstance","unitDomains","setRadiusFactor","sizeFieldIndex","sizeMultiplier","getSizeMultiplier","sizeAxisDomain","encodingFields","sanitizedRows","sanitizedColumns","polar_encoder_get","polar_encoder_getPrototypeOf","sanitizedFields","typeIndex","polar_encoder_toConsumableArray","sanitizedConfig","angleField","angle0Field","RetinalEncoder","newAxes","visual_group_local_options","visual_group_local_options_defineProperty","_CONFIG$ROWS$COLUMNS$","SimpleGroup","ValueMatrix","matrixArr","value_matrix_classCallCheck","instancesById","cellValue","_instancesById","_matrix","_filterFn","rowWidth","currentRowWidth","getLogicalSpace","rowHeight","currentRowHeight","setMatrixInstances","_composition","updateChecker","option","hasValue","hasOneValue","createMatrices","groupConfig","matrixConfig","placeholderInfo","getMatrices","_groupedDataModel","createRetinalAxes","setRetinalAxisDomain","cornerMatrices","createHeaders","metaData","unionUnitDomains","registerDomainChangeListener","visual_group_props_defineProperty","visual_group_props_PROPS","groupType","cellRegistry","VisualGroup","visual_group_classCallCheck","visual_group_possibleConstructorReturn","visual_group_getPrototypeOf","componentSubRegistry","visual_group_assertThisInitialized","_selection","createMatrixResolver","initializeGlobalState","globalState","createUnitState","_VisualUnit$getState2","visual_group_helper_slicedToArray","localState","createLayerState","_BaseLayer$getState2","setupChangeListeners","stores","_context$registry","comp","storeInst","listenerInf","getSimpleAxes","_this$resolver$getAll","visual_group_defineProperty","sanitizedValue","shouldRender","localFields","initializeFields","unsubscribeChangeListeners","sanitizeRetinalConfig","retinalConf","confValue","createEncoderInstance","fieldSanitizer","setAxisAndHeaders","resolverFields","initializeResolverFields","hasMandatoryFields","info","existingRemoveSet","select_toConsumableArray","firebolt_action_behaviour_map_defineProperty","action_behaviour_map_actionBehaviourMap","propagationBehaviourMap","_propagationBehaviour","firebolt_behaviour_effect_map_defineProperty","firebolt_behaviour_effect_map_behaviourEffectMap","propagationSideEffects","_propagationSideEffec","src_firebolt_helper_toConsumableArray","DEFAULTICONSIZE","SCALE_FUNCTIONS","HORIZONTAL","VALUE","POSITION_ALIGNMENT_MAP","constants_defineProperty","_POSITION_ALIGNMENT_M","OPPOSITE_POSITION","_OPPOSITE_POSITION","LegendFireBolt","_Firebolt","legend_firebolt_classCallCheck","legend_firebolt_possibleConstructorReturn","legend_firebolt_getPrototypeOf","legend_firebolt_inherits","legend_firebolt_createClass","getPropagationSelectionSet","behaviourName","canvasAlias","legend_firebolt_toConsumableArray","getFullData","getCriteriaFromData","firebolt_physical_defineProperty","physical_physicalActions","boundingBox","gradientDimensions","axisScale","rangeShifter","drag_defineProperty","getSelectionCriteria","selectionBoxMeasure","drawingInfMeasure","subjectStartPoint","ALIGN","DEFAULT_MEASUREMENT","marginHorizontal","paddingRight","LEGEND_TITLE","_buffer","legend_defaults_defineProperty","borderStyle","borderColor","bounds","upper","tempConfig","STEP_DEFAULT_CONFIG","ICON_MAP","LEGEND_MARKER_PROPS","side_effects_selection_box_classCallCheck","side_effects_selection_box_possibleConstructorReturn","side_effects_selection_box_getPrototypeOf","gradientDimension","legendGradContainer","legendSelGroup","selBox","enterFn","selection_box_drag_defineProperty","fadeOut","brighten","LegendHighlighter","legend_highlighter_classCallCheck","legend_highlighter_possibleConstructorReturn","legend_highlighter_getPrototypeOf","SYMBOL_PADDING","LegendMarker","legend_marker_classCallCheck","legend_marker_possibleConstructorReturn","legend_marker_getPrototypeOf","_graphicElements","markerElement","legendmarkerTextContainer","legendmarkerText","rotateAngle","lableConfig","labelText","_getRelativePosition","getRelativePosition","canvas","legendContainer","_canvasMount","_labelManager$getSmar","MARKER_BUFFER","legendmarkerGroup","textElement","createTextCell","labelManagerRef","maxLines","_minTickDiff","_cells","resetLogicalSpace","title","_title","getScaleInfo","scaleType","scaleFn","getInterpolatedArrayData","domainForLegend","scaleParams","requiredWidth","requiredHeight","upperBound","maxTickDiff","alignment","smartLabelCalc","minimumTickSize","_smartLabelCalc$getOr","isInteger","getcomputedArray","computationhelper","requiredMeasure","availableMeasure","currentTickValue","nextTickValue","measureParam","pixelPerTick","getInterpolatedData","recomputeSteps","getTickMeasure","_scaleParams$measures","getItemMeasures","_labelManager","_labelManager$getOriS","calculateTitleWidth","titleWidth","maxItemSpaces","itemSpaces","localBuffer","cur","SimpleLegend","simple_legend_classCallCheck","_fieldName","defaultMeasurement","_computedStyle","legendBehaviours","_canvasAlias","_this$measurement","effPadding","effBorder","effMargin","dataFromScale","titleSpace","getTitleSpace","titleHeight","labelSpaces","getLabelSpaces","_computeItemSpaces","computeItemSpaces","textOrientation","iconSpaces","maxIconWidth","labelSpace","itemSpace","iconSpace","newLabelWidth","titleSpaces","_this$measurement2","_this$config3","titleCreator","textAlign","titleContainer","marginPosition","_this$config4","_this$measurement3","widthBox","renderTitle","rawVal","simple_legend_defineProperty","idRangeMap","canvasRoot","legendOrientation","position_config_defineProperty","_legendOrientation","datasets","itemContainerMeasures","getStepSpacesInfo","iconHeight","iconWidth","stepPadding","horizontal","vertical","positionConfig","_positionConfig","alignmentMap","_alignmentMap","itemStack","_itemStack","createLegendSkeleton","gradWidth","gradHeight","maxGradHeight","maxGradWidth","legendBody","legendItem","getItemContainers","legendInstance","positionObj","createItemSkeleton","_context$config","itemSkeleton","alignClass","applyItemStyle","measureType","stepColorCheck","_context$measurement","renderIcon","transalate","defaultIcon","defaultIconSize","DiscreteLegend","_getScaleInfo","_field$schema","discrete_legend_toConsumableArray","ele","nextVal","discrete_legend_defineProperty","discrete_legend_get","discrete_legend_getPrototypeOf","renderDiscreteItem","_context$measurement2","_item$icon","text-align","marginVerticalBuffer","allSelections","getGradientDomain","accumulator","currentValue","MAX_VALUE","MIN_VALUE","legendGradSvg","legendGradCont","linearGradient","makeLinearGradient","legendRect","GradientLegend","gradient_legend_toConsumableArray","gradient_legend_defineProperty","getScaleFactor","newAxis","axisSpace","axisDomainLength","_legendGradientSvg","gradient_legend_get","gradient_legend_getPrototypeOf","renderGradient","_createLegendSkeleton","StepLegend","domainLeg","isFraction","step_legend_toConsumableArray","numRight","step_legend_defineProperty","stepData","step_legend_get","step_legend_getPrototypeOf","renderStepItem","_context$measurement3","_item$icon2","_positionConfig$posit","PADDING","BORDER","MARGIN","TITLE_TEMPLATE_NOT_ALLOWED_TAGS","IS_POINT_MAP","true","false","LEGEND_TYPE_MAP","src_constants_defineProperty","_LEGEND_TYPE_MAP","HORIZONTAL_CENTER","VERTICAL_CENTER","share","operators_construct","operators_toConsumableArray","strings","htmlCode","expLn","frag","createDocumentFragment","treeShakeNode","nodeType","Node","ELEMENT_NODE","tagName","childNodes","canvasIterator","canvases","iteratorFn","cFn","visualGroup","_throwback","registerActions","fnName","_registrableComponents","setFireboltDependencies","actionModel","ActionModel","action_model_classCallCheck","registerPropagationBehaviourMap","dissociateBehaviour","dissociateSideEffect","policy","registrableComponents","mergedPolicy","aliases","*","propagationPayload","propagationCanvas","crossInteractionPolicy","TITLE_CONFIG","SUB_TITLE_CONFIG","MESSAGE_CONFIG","baseFontLimit","upperFontLimit","baseSizeLimit","upperSizeLimit","fractionImage","fractionChild","canvas_local_options_defineProperty","_localOptions","canvasOptions","_canvasOptions","local_options_slicedToArray","arg1","arg2","local_options_typeof","titleConfig","subtitle","subtitleConfig","sub","LayoutComponent","layoutComponent_classCallCheck","_boundBox","_renderAt","_alignWith","_alignment","_componentName","_className","DummyComponent","newDimensions","renderAt","component","componentName","pagination","scrollBar","thickness","speed","legend","minHeight","minCharacters","verticalAlign","collapse","invalidValues","DEFAULT_WIDTH","DEFAULT_HEIGHT","DEFAULT_CLASS_NAME","NODE_PREFIX","DefinitionModel","definitionModel_classCallCheck","_host","host","_cut","cut","_ratioWeight","ratioWeight","_preferred","preferred","_lanes","lanes","_remainingHeight","_remainingWidth","remainingHeight","remainingWidth","getNodeId","_uid","yExtraSpace","smallestHeight","getCutType","smallestExtraHeightHorizontally","MAX_SAFE_INTEGER","containerHeight","hostHeight","xExtraSpace","smallestWidth","smallestExtraWidthVertically","containerWidth","hostWidth","createPlaceHolderComponent","placeComponent","definitionModel","leftOvercomponentRationWidth","isPreferred","isGridComponent","componentRatioWidth","leftHeight","leftWidth","_component$getLogical","componentHeight","componentWidth","firstLaneConfig","firstLane","secondLane","tree_classCallCheck","_parentCut","_this$_children","tree_toConsumableArray","parentCut","bound","nodeconfig","searchNode","childNode","nodeId","deleteSearchNode","LayoutModel","measurements","layout_model_classCallCheck","_measurements","_root","createTree","setBoundBox","addChildren","lane","allocateBoundingBox","totalWeight","carry","lastSibling","ratio","setHostSpatialConfig","setHostPosition","negotiateDimension","alteredDim","nonAlteredDim","cumultiveExtraSpaceAmt","childrenLength","extraSpaceAmt","computePosition","determineBoundBox","bb","_lastSibling$boundBox","_top","_left","_height","_width","_instance$parent$boun","setSpatialConfig","VIEW_INDEX","ROW_MATRIX_INDEX","2","COLUMN_MATRIX_INDEX","ROW_ROOT","COLUMN_ROOT","VERTICAL","Utils","utils_createClass","isDOMElement","getID","getElement","findContainer","coordinate","removeDiv","divId","DataPoint","data_point_classCallCheck","DataParser","data_parser_classCallCheck","data_parser_createClass","defaultDataPointLogic","nodepoints","getnodePoints","datapoint","HTMLDataAdapter","_DataParser","html_data_classCallCheck","html_data_possibleConstructorReturn","html_data_getPrototypeOf","html_data_inherits","html_data_createClass","getCoordinates","html_data_get","Renderer","renderer_classCallCheck","renderer_createClass","initRenderer","__logicalTree","HTMLRenderer","_Renderer","html_renderer_classCallCheck","html_renderer_possibleConstructorReturn","html_renderer_getPrototypeOf","_coordinates","html_renderer_inherits","html_renderer_createClass","createhtml","mainDiv","html_renderer_get","parentDiv","createAndCustomiseParent","hasHost","createAndPositionDiv","html_renderer_objectSpread","div","coordinates","findNode","nodeID","renderer","drawLayout","renderHTML","resolveAligment","componentData","alignWith","componentToAlign","componentMap","refNode","newNodeConfig","setAlignConfig","DrawingManager","drawing_manager_classCallCheck","_componentMap","_layoutClassName","layoutClassName","_renderer","drawing_manager_createClass","drawComponent","DefinitionManager","definition_manager_classCallCheck","_prioritySequence","_totalHeight","_totalWidth","_targetComponentMap","prepareTargetComponentMap","targetComponentMap","canvasComponent","tempDefModel","componentRef","getComponent","placeGridComponent","gridComponents","iscolumnPreffered","_placeComponent","rowpreffred","LayoutDef","layout_def_classCallCheck","_layoutDefinition","layout_def_createClass","addComponent","layoutDefinition","addMultipleComponent","componentArray","sanitizedDefinition","hostObj","hostID","childHost","resetComponentMap","LayoutManager","layout_manager_classCallCheck","_dimension","_skeletonType","skeletonType","_layoutDef","_drawingManager","_rootNodeID","con","resetNode","updateNode","compute","_layout","calLayOutDef","_context$dimension","layoutDef","prioritySequence","generateConfigModel","negotiate","broadcast","layoutComponents","componentArr","compo","elementName","removeElement","elemID","co","deleteElement","setupChangeListener","allOptions","_allOptions","canvas_helper_toConsumableArray","nameSpaceProps","equalityChecker","dispatchProps","sanitizedData","getMandatoryFields","_cachedProps","notifyAnimationEnd","viewInfo","layout","centerMatrix","viewMatricesInfo","promises","cellArr","lifeCycle","animDonePromises","applyPropagationPolicy","changeBehaviourStateOnPropagation","isMeasure","applyInteractionPolicy","splom","isSplom","interactionPolicy","_interactionPolicy","_crossInteractionPolicy","unitFireBolt","canvas_helper_defineProperty","canvas_helper_objectSpread","createLayoutManager","src_options","minUnitWidth","minUnitHeight","options_slicedToArray","_auxConfig$reset","oldConf","facetDefaultConfig","fixFacetConfig","fixScrollBarConfig","GenericLayout","generic_layout_classCallCheck","_matrices","_centerMatrix","_mountPoint","DEFAULT_CONFIGURATION","grid_layout_defaults_defineProperty","_DEFAULT_CONFIGURATIO","_FieldNames$BORDER","DEFAULT_MEASUREMENTS","_DEFAULT_MEASUREMENTS","findInPage","page","combineMatrices","isTransposed","joinedMatrix","utils_toConsumableArray","rowData","computeLogicalSpace","maxMeasures","_config$isTransposed","unitMeasures","_getMeasureInfo","getMeasureInfo","firstMeasure","secondMeasure","minMeasures","getMinMeasures","_logicalSpace","utils_defineProperty","valueItem","maxMeasure","firstMeasureValue","secondMeasureValue","valueArray","_item$space","fMeasure","sMeasure","minSecondMeasure","createMatrixEachLevel","_arr$i","extraCellsRemover","beg","distribution","extraCellLengths","VisualMatrix","visual_matrix_classCallCheck","_lastLevelKey","_primaryMatrix","_secondaryMatrix","_maxMeasures","_availableSpace","_layoutMatrix","_tree","_createTree2","matrixTree","lastLevelKey","layoutMatrix","primaryMatrix","secondaryMatrix","breakPage","primaryMatrixLength","newMatrix","keyLength","heightMeasures","populateMaxMeasures","widthMeasures","calculateDepth","viewableMatrix","createViewPortMatrix","viewableMeasures","redistributeSpaces","childDepth","createMatrixInstances","matrixInfo","breakPointer","_breakPointer","brokenMatrix","breakMatrix","nextLevel","removeExtraCells","RowVisualMatrix","row_matrix_classCallCheck","row_matrix_possibleConstructorReturn","row_matrix_getPrototypeOf","maxHeights","maxWidths","matrixInst","cellDimOptions","matrixIndex","_this2$getCellDimensi","getCellDimensions","widths","rowHeights","columnWidths","primary","secondary","begCellLen","endCellLen","remainingAvailWidth","cWidths","conditions","maxPrioritySpace","availableWidth","currentWidth","prioritySpace","logicalWidths","getPriorityDistribution","mWidth","mHeight","redistributeViewSpaces","computeViewableSpaces","rHeights","gutter","spaceTakenByColumn","getDistributedHeight","heightWithoutGutter","distSum","gutterSum","availableHeight","colLen","distHeight","colHeight","colWidth","heights","ColumnVisualMatrix","column_matrix_classCallCheck","column_matrix_possibleConstructorReturn","column_matrix_getPrototypeOf","heightDist","divider","condition","spaceTakenByRow","getDistributedWidth","layoutConfig","distWidth","rowLen","oldLogicalSpace","heightDistribution","getMatrixMeasurement","setViewSpaces","pointerType","viewSpaces","pointer","computations_defineProperty","paginationDetailsMap","scrollType","paginationMeasureGetter","relatedMaxMeasure","getMatrixMeasureForPagination","measureDetails","actualMeasure","scrollInfo","getMatrixHeightDetails","columnMatrixWidth","_getHeightRequiredByC","getHeightRequiredByColMatrix","maxColumnMatrixHeight","columnViewSpace","getViewableSpaces","columnPointer","columnMatrixHeight","maxHeightAvailableForRowMatrix","rowMatrixHeight","bufferCondition","isScroll","getActualBufferFromConfig","computations_slicedToArray","getBufferFromCondition","currentBufferType","horizontalBuffer","verticalBuffer","computeLayoutMeasurements","_getMatrixWidthDetail","getMatrixWidthDetails","_layout$config3","rowMatrixWidth","maxRowMatrixWidth","maxWidthAvailableForColumnMatrix","_getMatrixHeightDetai","_getActualBufferFromC","rowViewableSpaces","columnViewableSpaces","setValueMatrixMeasurements","computations_toConsumableArray","rowWidthsPrimary","rowWidthsSecondary","columnHeightsPrimary","columnHeightsSecondary","measureSum","GridLayout","layout_classCallCheck","layout_possibleConstructorReturn","layout_getPrototypeOf","_layoutId","_scrollInfo","generateVisualMatrices","begColCells","endColCells","gutterSpace","layout_helper_slicedToArray","_center","_bottom","layout_helper_toConsumableArray","RowMatrix","ColumnMatrix","layout_get","_computeLayoutMeasure","setViewInformation","pageNumber","pageType","totalPages","layout_defineProperty","renderGrid","currentPage","_viewInfo","maxRowHeight","maxColWidth","rowPointer","getViewMatrices","rowMatrices","getViewableMatrices","columnMatrices","centralMatrixPointer","rowMatrixLen","columnMatrixLen","rowPages","columnPages","layoutDimensions","getViewMeasurements","_layout$config","rowSpaces","colSpaces","rightWidth","topHeight","bottomHeight","centerHeight","centerWidth","viewWidth","viewHeight","actualCenterMeasures","totalMeasures","unitHeights","unitWidths","specificBorderApplier","borderTypes","showBorders","borderInfo","borderType","applySpecificBorder","applyBorders","borderApplierFn","borderApplier","border_helper_defineProperty","borderMapVal","borderMap","orderMaker","nestByStack","updateArr","optionalParams","currStack","prevStack","arrVal","stackVal","currElemIndex","newElem","arrElem","returnArr","spanCalculator","isNull","maskCreator","_nestByStack","viewMatrix","hierarchy","_nestByStack2","spanGenerator","spans","ridx","currSpan","getOrder","matrixSpanGeneratorMap","span_maker_defineProperty","_matrixSpanGeneratorM","orderGetter","viewMatrixMaker","spanMaker","matrixSpanGenerator","spanApplier","cellCounter","spaceAllocationDueToSpan","primaryUnitWidth","cumulativeWidth","spanApplierMap","_spanApplierMap","TransactionSupport","INTERFACE_IMPl","LAYER_DEF","DETAIL_FIELDS","GEOM","BLANK","SimpleCell","simple_cell_classCallCheck","enums_defaults_defineProperty","_DEFAULT_CONFIG","_CONSTANTS$MARGIN","CONSTANTS","_CONSTANTS$PADDING","_CONSTANTS$HEADER_PAD","_CONSTANTS$TITLE_PADD","DEFAULT_PROPS","minSpacing","visual_cell_src_props_defineProperty","visual_cell_src_props_PROPS","caption","smartText","axis_cell_classCallCheck","axis_cell_possibleConstructorReturn","axis_cell_getPrototypeOf","_availHeight","_availWidth","axis_cell_assertThisInitialized","computeAxisSpace","logicalWidth","logicalHeight","spaceFixer","_axis$getLogicalSpace","actualWidth","actualHeight","_axis$config2","wrapperDiv","blank_cell_classCallCheck","blank_cell_possibleConstructorReturn","blank_cell_getPrototypeOf","blank_cell_assertThisInitialized","setSmartText","_context$minSpacing","minHeightSpace","minWidthSpace","paddedHeight","paddedWidth","isTitleSubtitle","subType","returnVal","computeTextSpace","_context$minSpacing2","minText","_minTextSpace","smartSpace","smHeight","smWidth","headerPadding","text_cell_classCallCheck","text_cell_possibleConstructorReturn","text_cell_getPrototypeOf","text_cell_assertThisInitialized","titlePadding","vAlign","_this$smartText","translation","middle","setPadding","localPadding","geom_cell_classCallCheck","geom_cell_possibleConstructorReturn","geom_cell_getPrototypeOf","_unit","_datamodel","_transform","_caption","geom_cell_assertThisInitialized","captionSpace","computeGeomSpace","getCaptionSpace","captionDom","DEFAULT_PLACEHOLDERS","src_defaults_defineProperty","_DEFAULT_PLACEHOLDERS","resolveTitleSubTitleContent","rawContent","createHeading","prevCell","cellType","legendInitializer","legendConfig","prevLegends","legends","headerHeight","legendInfo","legendCreator","LegendCls","dataset","scaleProps","_scale$config","stepMapper","interactionRegistry","dataInfo","legendMeasures","titleText","legendIconShapeMapper","layerMarks","includes","getGroupByData","setLegendMeasures","MuzeComponent","_this$boundBox","HeaderComponent","headerComponent_classCallCheck","headerComponent_possibleConstructorReturn","headerComponent_getPrototypeOf","setParams","cont","renderHeader","LegendComponent","legendComponent_classCallCheck","legendComponent_possibleConstructorReturn","legendComponent_getPrototypeOf","legendSpace","sectionComponents","_this$params$config","legendMount","legWidth","legHeight","sections","currHeight","currWidth","leg","legendHeight","legendWidth","renderLegend","_defaultAlignmentHelp","defaultAlignmentHelper","setParentInfo","arrowSizeMap","getUnitPositions","totalLength","viewLength","currentLen","unitPosition","createScrollBarArrow","createScrollBarRect","mover","applyScrollMouseDownAction","moverRect","scrollMaker","_mover$node$getBoundi","_rect$node$getBoundin","rectX","rectY","changeMoverPosition","registerListenerOnArrow","arrowType","_components","isTouchDevice","applyMoverDrag","moverStartPos","rectStartPos","distanceMoved","actualPosition","pageXOffset","pageYOffset","applyRectClick","emptyScrollAreaClick","manager","unitPositions","ScrollMaker","scroll_maker_classCallCheck","_attachedScrollAction","_unitPositions","scroll_maker_createClass","scrollTo","scrollDeltaTo","createScroll","scrollBarContainer","scrollContainerHelper","attachScrollAction","externalScrollAction","detachScrollAction","scrollMakerMap","_ScrollMaker","HorizontalScrollMaker","horizontal_scroll_maker_classCallCheck","horizontal_scroll_maker_possibleConstructorReturn","horizontal_scroll_maker_getPrototypeOf","horizontal_scroll_maker_inherits","horizontal_scroll_maker_createClass","horizontal_scroll_maker_get","prevArrow","nextArrow","_this$logicalSpace","scrollBarWithouArrowLength","_scrollBarWithouArrowLength","_this$_components$mov","positionAdjuster","newPosition","currentPos","_this$_components$mov2","moverPos","movedViewLength","performAttachedScrollFunction","_this$_components$mov3","scrollPercentage","movement","VerticalScrollMaker","vertical_scroll_maker_classCallCheck","vertical_scroll_maker_possibleConstructorReturn","vertical_scroll_maker_getPrototypeOf","vertical_scroll_maker_inherits","vertical_scroll_maker_createClass","vertical_scroll_maker_get","ScrollComponent","scroll_component_classCallCheck","scrollBarComponentConfig","scroll_component_possibleConstructorReturn","scroll_component_getPrototypeOf","unitIndex","sanitizedUnitIndex","externalAction","MatrixComponent","matrix_component_classCallCheck","matrix_component_possibleConstructorReturn","matrix_component_getPrototypeOf","_this$params$config$s","containerForMatrix","applyScroll","_cellSpanMaker","cellSpanMaker","_matrixSpanGenerator","renderTable","applySpans","applier","renderPlaceholders","renderMatrix","applyScrollAction","scollDistance","GridComponent","grid_component_classCallCheck","grid_component_possibleConstructorReturn","grid_component_getPrototypeOf","_this$component$viewI","matrixDim","matrixName","_this$params$componen","updateWrapper","_this$params$componen2","matrixWrapper","allComponents","_scrollBarManager","scrollBarManager","wheelDeltaX","wheelDeltaY","preventBrowserScroll","triggerScrollBarAction","movedView","scrollActionApplier","_this$component$0$0$b","sanitizeGrid","attachScrollListener","MessageComponent","message_component_classCallCheck","message_component_possibleConstructorReturn","message_component_getPrototypeOf","childHeight","message","imageNode","messageNode","formatFontSize","_params$config","headerCell","configType","headerAlignmentMap","component_wrapper_maker_defineProperty","_headerAlignmentMap","isGridPresent","renderDetails","_renderDetails$compon","checkParamsValidation","createHeaderWrapper","headerType","layoutManager","_headerMap$headerType","headerConfig","wrapperParams","component_wrapper_maker_objectSpread","existingComponent","createScrollBarWrapper","scrollBarType","grid","_scrollBarMap$scrollB","scrollBarMap","layoutBasedMeasure","viewMeasure","rowAlign","colAlign","componentWrapperMaker","_layoutManager","createMessageWrapper","_i","_headerValues","defaultDimensions","canvasHeight","canvasWidth","gridComponent","getBoundBox","createLegendWrapper","legendWrapper","gridLayoutWrapper","verticalScrollBar","horizontalScrollBar","ScrollManager","scroll_manager_classCallCheck","_scrollBarComponents","_attachedComponents","scroll_manager_createClass","scrollBarComponents","attachedComponents","performScrollAction","getRenderDetails","_mount$getBoundingCli","heightAttr","widthAttr","visGroup","_visGroup$placeholder","legendPosition","layoutArrangement","arrangeComponents","_titleLayouts","titleLayouts","component_resolver_defineProperty","legendLayouts","titlePosition","subtitlePosition","availableHeightForCanvas","availableWidthForCanvas","_createHeaders","isSubtitle","headerOptions","_createHeading","createLegend","getLegendSpace","mountSpace","componentIndexes","componentNames","3","4","5","6","renderLayout","gridLayout","compWrappers","componentWrappers","createScrollManager","horizontalScrollWrapper","verticalScrollWrapper","gridWrapper","hScrollBar","vScrollBar","componentWrapper","deleteElementName","removeComponent","registerComponents","attachListeners","attachListener","addFacetDataAndMeasureNames","facetData","facetVals","canvas_firebolt_helper_defineProperty","hasMeasureNameField","canvas_firebolt_helper_toConsumableArray","measureNameArr","isDimension","isCrosstab","dispatchBehaviours","_firebolt$context$con2","behaviourConfs","unitFirebolt","targetFirebolt","propagationDataSource","getPropagationSource","defaultCrossInteractionPolicy","propagationCanvasAlias","GroupFireBolt","group_firebolt_classCallCheck","group_firebolt_possibleConstructorReturn","group_firebolt_getPrototypeOf","defaultInteractionPolicy","tooltipSideEffect","unitDimsMap","unitDims","group_firebolt_toConsumableArray","groupDataMap","facetMap","unitFieldsConfig","linkedRows","linkedRow","handleDataModelPropagation","attachBehaviours","crosstab","_this$context$config$","_ref$instance","findPlaceHolderById","addSelectedMeasuresInPayload","groupFields","_unit$fields","handlePhysicalAction","resetSelectAction","group_firebolt_get","auxConfig","propagateValues","sourceCanvasId","sideEfffects","propagationBehaviour","sourceBehaviour","propagationConf","propConf","behaviourInstance","APP_INITIAL_STATE","app","Canvas","globalDependencies","canvas_classCallCheck","canvas_possibleConstructorReturn","canvas_getPrototypeOf","canvas_defineProperty","canvas_assertThisInitialized","initedComponents","initCanvas","createGroupState","_VisualGroup$getState2","canvas_helper_slicedToArray","prepareLayout","triggerReflow","setLayoutInfForUnits","getRootNodeId","setComponentInfo","setLabelRotationForAxes","rotationVal","getAxes","initialSettings","regEntry","COMPONENTS","default_registry_defineProperty","_COMPONENTS","SUBREGISTRIES","utils","Smartlabel","globalCache","defaultRegistry","globalRegistry","overrideRegistryDefinitions","overrideRegistry","muze","_transactor2","muze_slicedToArray","env","globalStore","componentSubRegistryDef","settings","withSettings","Components","VisualLayer","unitHelpers","unitEnums","Encoders","encoderHelpers","groupUtils","groupEnums","SideEffects","standards","Behaviours","pkg","operators"],"mappings":"CAAA,SAAAA,iCAAAC,KAAAC,SACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,UACA,mBAAAG,eAAAC,IACAD,OAAA,UAAAH,SACA,iBAAAC,QACAA,QAAA,KAAAD,UAEAD,KAAA,KAAAC,UARA,CASCK,OAAA,WACD,yBCTA,IAAAC,oBAGA,SAAAC,oBAAAC,UAGA,GAAAF,iBAAAE,UACA,OAAAF,iBAAAE,UAAAP,QAGA,IAAAC,OAAAI,iBAAAE,WACAC,EAAAD,SACAE,GAAA,EACAT,YAUA,OANAU,QAAAH,UAAAI,KAAAV,OAAAD,QAAAC,cAAAD,QAAAM,qBAGAL,OAAAQ,GAAA,EAGAR,OAAAD,QA0DA,OArDAM,oBAAAM,EAAAF,QAGAJ,oBAAAO,EAAAR,iBAGAC,oBAAAQ,EAAA,SAAAd,QAAAe,KAAAC,QACAV,oBAAAW,EAAAjB,QAAAe,OACAG,OAAAC,eAAAnB,QAAAe,MAA0CK,YAAA,EAAAC,IAAAL,UAK1CV,oBAAAgB,EAAA,SAAAtB,SACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,QAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,QAAA,cAAiDyB,OAAA,KAQjDnB,oBAAAoB,EAAA,SAAAD,MAAAE,MAEA,GADA,EAAAA,OAAAF,MAAAnB,oBAAAmB,QACA,EAAAE,KAAA,OAAAF,MACA,KAAAE,MAAA,iBAAAF,oBAAAG,WAAA,OAAAH,MACA,IAAAI,GAAAX,OAAAY,OAAA,MAGA,GAFAxB,oBAAAgB,EAAAO,IACAX,OA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ESgW,cAAKK,aCZTA,YAAS,IAAI/pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,+BAESgW,cAAKK,aCZTA,YAAS,IAAI/pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,+BAESgW,cAAKK,aCALL,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,cAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,gBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,gBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCESgW,kBAZK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,yDACA,+DACA,sEACAnX,IAAIs0C,gCCASgW,gBAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,eAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IAAIs0C,gCCESgW,iBAVK,IAAI1pD,MAAM,GAAGuW,OAC/B,qBACA,2BACA,iCACA,uCACA,6CACA,mDACA,0DACAnX,IA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jsE,SAAW8rE,0BAEhBG,UAAKQ,YACDC,aACIr1F,QACInW,+BACA4I,yBACAmC,oBACAmJ,oBACA/E,4BACA7kC,qCACAq7B,yBACAgD,mBAEJyN,gBACAx+G,gCACA2+G,yBAEJq1B,YACI/8I,YAAa+8I,uBACbx1B,QAASq1F,uCACT7zM,MAAO8zM,sCACP1mE,oCAEJitB,aACIpjK,YAAaojK,aACb05C,iCACAC,8CACAC,uCACAj0M,MAAOk0M,kDAEXhD,QACIj6M,YAAai6M,eAEjB3nF,UACItyH,YAAasyH,oBAIrB,IAAM4qF,aACFzsF,6CACA0sF,WACIj/E,wCACAM,kDACAf,4BAIF2/E,YACFxmF,+CACAumF,WACI/kF,0CACAsC,mDACAb,+CAIRqiF,UAAK/oO,UAAYA,UACjB+oO,UAAKtzM,QAAUy0M,aAAIz0M,QACnBszM,UAAKgB,YAAcA,YACnBhB,UAAKpjC,YAAcA,YACnBojC,UAAK32F,aAAeA,kBACpB22F,UAAKl0M,UAAYs1M,0BACjBpB,UAAKkB,WAAaA,WAClBlB,UAAKP,MAAQA,+BACbO,UAAKv9L,OAAQ,IAAIm2D,YAAQl+E,MAAMoJ,YAEhBk8M","file":"muze.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"muze\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"muze\"] = factory();\n\telse\n\t\troot[\"muze\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 18);\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DataModel\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DataModel\"] = factory();\n\telse\n\t\troot[\"DataModel\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","const DataModel = require('./export');\n\nmodule.exports = DataModel.default ? DataModel.default : DataModel;\n","/**\n * DataFormat Enum defines the format of the input data.\n * Based on the format of the data the respective adapter is loaded.\n *\n * @readonly\n * @enum {string}\n */\nconst DataFormat = {\n FLAT_JSON: 'FlatJSON',\n DSV_STR: 'DSVStr',\n DSV_ARR: 'DSVArr',\n AUTO: 'Auto'\n};\n\nexport default DataFormat;\n","/**\n * DimensionSubtype enum defines the sub types of the Dimensional Field.\n *\n * @readonly\n * @enum {string}\n */\nconst DimensionSubtype = {\n CATEGORICAL: 'categorical',\n TEMPORAL: 'temporal',\n BINNED: 'binned'\n};\n\nexport default DimensionSubtype;\n","/**\n * MeasureSubtype enum defines the sub types of the Measure Field.\n *\n * @readonly\n * @enum {string}\n */\nconst MeasureSubtype = {\n CONTINUOUS: 'continuous'\n};\n\nexport default MeasureSubtype;\n","/**\n * FieldType enum defines the high level field based on which visuals are controlled.\n * Measure in a high level is numeric field and Dimension in a high level is string field.\n *\n * @readonly\n * @enum {string}\n */\nconst FieldType = {\n MEASURE: 'measure',\n DIMENSION: 'dimension'\n};\n\nexport default FieldType;\n","/**\n * Filtering mode enum defines the filering modes of DataModel.\n *\n * @readonly\n * @enum {string}\n */\nconst FilteringMode = {\n NORMAL: 'normal',\n INVERSE: 'inverse',\n ALL: 'all'\n};\n\nexport default FilteringMode;\n","/**\n * Group by function names\n *\n * @readonly\n * @enum {string}\n */\nconst GROUP_BY_FUNCTIONS = {\n SUM: 'sum',\n AVG: 'avg',\n MIN: 'min',\n MAX: 'max',\n FIRST: 'first',\n LAST: 'last',\n COUNT: 'count',\n STD: 'std'\n};\n\nexport default GROUP_BY_FUNCTIONS;\n","/**\n * Creates a JS native date object from input\n *\n * @param {string | number | Date} date Input using which date object to be created\n * @return {Date} : JS native date object\n */\nfunction convertToNativeDate (date) {\n if (date instanceof Date) {\n return date;\n }\n\n return new Date(date);\n}\n/**\n * Apply padding before a number if its less than 1o. This is used when constant digit's number to be returned\n * between 0 - 99\n *\n * @param {number} n Input to be padded\n * @return {string} Padded number\n */\nfunction pad (n) {\n return (n < 10) ? (`0${n}`) : n;\n}\n/*\n * DateFormatter utility to convert any date format to any other date format\n * DateFormatter parse a date time stamp specified by a user abiding by rules which are defined\n * by user in terms of token. It creates JS native date object from the user specified format.\n * That native date can also be displayed\n * in any specified format.\n * This utility class only takes care of format conversion only\n */\n\n/*\n * Escapes all the special character that are used in regular expression.\n * Like\n * RegExp.escape('sgfd-$') // Output: sgfd\\-\\$\n *\n * @param text {String} : text which is to be escaped\n */\nRegExp.escape = function (text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n};\n\n/**\n * DateTimeFormatter class to convert any user format of date time stamp to any other format\n * of date time stamp.\n *\n * @param {string} format Format of the date given. For the above date,\n * 'year: %Y, month: %b, day: %d'.\n * @class\n */\n/* istanbul ignore next */ function DateTimeFormatter (format) {\n this.format = format;\n this.dtParams = undefined;\n this.nativeDate = undefined;\n}\n\n// The identifier of the tokens\nDateTimeFormatter.TOKEN_PREFIX = '%';\n\n// JS native Date constructor takes the date params (year, month, etc) in a certail sequence.\n// This defines the sequence of the date parameters in the constructor.\nDateTimeFormatter.DATETIME_PARAM_SEQUENCE = {\n YEAR: 0,\n MONTH: 1,\n DAY: 2,\n HOUR: 3,\n MINUTE: 4,\n SECOND: 5,\n MILLISECOND: 6\n};\n\n/*\n * This is a default number parsing utility. It tries to parse a number in integer, if parsing is unsuccessful, it\n * gives back a default value.\n *\n * @param: defVal {Number} : Default no if the parsing to integer is not successful\n * @return {Function} : An closure function which is to be called by passing an the value which needs to be parsed.\n */\nDateTimeFormatter.defaultNumberParser = function (defVal) {\n return function (val) {\n let parsedVal;\n if (isFinite(parsedVal = parseInt(val, 10))) {\n return parsedVal;\n }\n\n return defVal;\n };\n};\n\n/*\n * This is a default number range utility. It tries to find an element in the range. If not found it returns a\n * default no as an index.\n *\n * @param: range {Array} : The list which is to be serached\n * @param: defVal {Number} : Default no if the serach and find does not return anything\n * @return {Function} : An closure function which is to be called by passing an the value which needs to be found\n */\nDateTimeFormatter.defaultRangeParser = function (range, defVal) {\n return (val) => {\n let i;\n let l;\n\n if (!val) { return defVal; }\n\n const nVal = val.toLowerCase();\n\n for (i = 0, l = range.length; i < l; i++) {\n if (range[i].toLowerCase() === nVal) {\n return i;\n }\n }\n\n if (i === undefined) {\n return defVal;\n }\n return null;\n };\n};\n\n/*\n * Defines the tokens which are supporter by the dateformatter. Using this definitation a value gets extracted from\n * the user specifed date string. This also formats the value for display purpose from native JS date.\n * The definition of each token contains the following named properties\n * {\n * %token_name% : {\n * name: name of the token, this is used in reverse lookup,\n * extract: a function that returns the regular expression to extract that piece of information. All the\n * regex should be gouped by using ()\n * parser: a function which receives value extracted by the above regex and parse it to get the date params\n * formatter: a formatter function that takes milliseconds or JS Date object and format the param\n * represented by the token only.\n * }\n * }\n *\n * @return {Object} : Definition of the all the supported tokens.\n */\nDateTimeFormatter.getTokenDefinitions = function () {\n const daysDef = {\n short: [\n 'Sun',\n 'Mon',\n 'Tue',\n 'Wed',\n 'Thu',\n 'Fri',\n 'Sat'\n ],\n long: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ]\n };\n const monthsDef = {\n short: [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ],\n long: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ]\n };\n\n const definitions = {\n H: {\n // 24 hours format\n name: 'H',\n index: 3,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n\n return d.getHours().toString();\n }\n },\n l: {\n // 12 hours format\n name: 'l',\n index: 3,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const hours = d.getHours() % 12;\n\n return (hours === 0 ? 12 : hours).toString();\n }\n },\n p: {\n // AM or PM\n name: 'p',\n index: 3,\n extract () { return '(AM|PM)'; },\n parser: (val) => {\n if (val) {\n return val.toLowerCase();\n }\n return null;\n },\n formatter: (val) => {\n const d = convertToNativeDate(val);\n const hours = d.getHours();\n\n return (hours < 12 ? 'AM' : 'PM');\n }\n },\n P: {\n // am or pm\n name: 'P',\n index: 3,\n extract () { return '(am|pm)'; },\n parser: (val) => {\n if (val) {\n return val.toLowerCase();\n }\n return null;\n },\n formatter: (val) => {\n const d = convertToNativeDate(val);\n const hours = d.getHours();\n\n return (hours < 12 ? 'am' : 'pm');\n }\n },\n M: {\n // Two digit minutes 00 - 59\n name: 'M',\n index: 4,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const mins = d.getMinutes();\n\n return pad(mins);\n }\n },\n S: {\n // Two digit seconds 00 - 59\n name: 'S',\n index: 5,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const seconds = d.getSeconds();\n\n return pad(seconds);\n }\n },\n K: {\n // Milliseconds\n name: 'K',\n index: 6,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const ms = d.getMilliseconds();\n\n return ms.toString();\n }\n },\n a: {\n // Short name of day, like Mon\n name: 'a',\n index: 2,\n extract () { return `(${daysDef.short.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(daysDef.short),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDay();\n\n return (daysDef.short[day]).toString();\n }\n },\n A: {\n // Long name of day, like Monday\n name: 'A',\n index: 2,\n extract () { return `(${daysDef.long.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(daysDef.long),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDay();\n\n return (daysDef.long[day]).toString();\n }\n },\n e: {\n // 8 of March, 11 of November\n name: 'e',\n index: 2,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDate();\n\n return day.toString();\n }\n },\n d: {\n // 08 of March, 11 of November\n name: 'd',\n index: 2,\n extract () { return '(\\\\d+)'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const day = d.getDate();\n\n return pad(day);\n }\n },\n b: {\n // Short month, like Jan\n name: 'b',\n index: 1,\n extract () { return `(${monthsDef.short.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(monthsDef.short),\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return (monthsDef.short[month]).toString();\n }\n },\n B: {\n // Long month, like January\n name: 'B',\n index: 1,\n extract () { return `(${monthsDef.long.join('|')})`; },\n parser: DateTimeFormatter.defaultRangeParser(monthsDef.long),\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return (monthsDef.long[month]).toString();\n }\n },\n m: {\n // Two digit month of year like 01 for January\n name: 'm',\n index: 1,\n extract () { return '(\\\\d+)'; },\n parser (val) { return DateTimeFormatter.defaultNumberParser()(val) - 1; },\n formatter (val) {\n const d = convertToNativeDate(val);\n const month = d.getMonth();\n\n return pad(month + 1);\n }\n },\n y: {\n // Short year like 90 for 1990\n name: 'y',\n index: 0,\n extract () { return '(\\\\d{2})'; },\n parser (val) {\n let result;\n if (val) {\n const l = val.length;\n val = val.substring(l - 2, l);\n }\n let parsedVal = DateTimeFormatter.defaultNumberParser()(val);\n let presentDate = new Date();\n let presentYear = Math.trunc((presentDate.getFullYear()) / 100);\n\n result = `${presentYear}${parsedVal}`;\n\n if (convertToNativeDate(result).getFullYear() > presentDate.getFullYear()) {\n result = `${presentYear - 1}${parsedVal}`;\n }\n return convertToNativeDate(result).getFullYear();\n },\n formatter (val) {\n const d = convertToNativeDate(val);\n let year = d.getFullYear().toString();\n let l;\n\n if (year) {\n l = year.length;\n year = year.substring(l - 2, l);\n }\n\n return year;\n }\n },\n Y: {\n // Long year like 1990\n name: 'Y',\n index: 0,\n extract () { return '(\\\\d{4})'; },\n parser: DateTimeFormatter.defaultNumberParser(),\n formatter (val) {\n const d = convertToNativeDate(val);\n const year = d.getFullYear().toString();\n\n return year;\n }\n }\n };\n\n return definitions;\n};\n\n/*\n * The tokens which works internally is not user friendly in terms of memorizing the names. This gives a formal\n * definition to the informal notations.\n *\n * @return {Object} : Formal definition of the tokens\n */\nDateTimeFormatter.getTokenFormalNames = function () {\n const definitions = DateTimeFormatter.getTokenDefinitions();\n\n return {\n HOUR: definitions.H,\n HOUR_12: definitions.l,\n AMPM_UPPERCASE: definitions.p,\n AMPM_LOWERCASE: definitions.P,\n MINUTE: definitions.M,\n SECOND: definitions.S,\n SHORT_DAY: definitions.a,\n LONG_DAY: definitions.A,\n DAY_OF_MONTH: definitions.e,\n DAY_OF_MONTH_CONSTANT_WIDTH: definitions.d,\n SHORT_MONTH: definitions.b,\n LONG_MONTH: definitions.B,\n MONTH_OF_YEAR: definitions.m,\n SHORT_YEAR: definitions.y,\n LONG_YEAR: definitions.Y\n };\n};\n\n/*\n * This defines the rules and declares dependencies that resolves a date parameter (year, month etc) from\n * the date time parameter array.\n *\n * @return {Object} : An object that contains dependencies and a resolver function. The dependencies values are fed\n * to the resolver function in that particular sequence only.\n */\nDateTimeFormatter.tokenResolver = function () {\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const defaultResolver = (...args) => { // eslint-disable-line require-jsdoc\n let i = 0;\n let arg;\n let targetParam;\n const l = args.length;\n\n for (; i < l; i++) {\n arg = args[i];\n if (args[i]) {\n targetParam = arg;\n }\n }\n\n if (!targetParam) { return null; }\n\n return targetParam[0].parser(targetParam[1]);\n };\n\n return {\n YEAR: [definitions.y, definitions.Y,\n defaultResolver\n ],\n MONTH: [definitions.b, definitions.B, definitions.m,\n defaultResolver\n ],\n DAY: [definitions.a, definitions.A, definitions.e, definitions.d,\n defaultResolver\n ],\n HOUR: [definitions.H, definitions.l, definitions.p, definitions.P,\n function (hourFormat24, hourFormat12, ampmLower, ampmUpper) {\n let targetParam;\n let amOrpm;\n let isPM;\n let val;\n\n if (hourFormat12 && (amOrpm = (ampmLower || ampmUpper))) {\n if (amOrpm[0].parser(amOrpm[1]) === 'pm') {\n isPM = true;\n }\n\n targetParam = hourFormat12;\n } else if (hourFormat12) {\n targetParam = hourFormat12;\n } else {\n targetParam = hourFormat24;\n }\n\n if (!targetParam) { return null; }\n\n val = targetParam[0].parser(targetParam[1]);\n if (isPM) {\n val += 12;\n }\n return val;\n }\n ],\n MINUTE: [definitions.M,\n defaultResolver\n ],\n SECOND: [definitions.S,\n defaultResolver\n ]\n };\n};\n\n/*\n * Finds token from the format rule specified by a user.\n * @param format {String} : The format of the input date specified by the user\n * @return {Array} : An array of objects which contains the available token and their occurence index in the format\n */\nDateTimeFormatter.findTokens = function (format) {\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const tokenLiterals = Object.keys(definitions);\n const occurrence = [];\n let i;\n let forwardChar;\n\n while ((i = format.indexOf(tokenPrefix, i + 1)) >= 0) {\n forwardChar = format[i + 1];\n if (tokenLiterals.indexOf(forwardChar) === -1) { continue; }\n\n occurrence.push({\n index: i,\n token: forwardChar\n });\n }\n\n return occurrence;\n};\n\n/*\n * Format any JS date to a specified date given by user.\n *\n * @param date {Number | Date} : The date object which is to be formatted\n * @param format {String} : The format using which the date will be formatted for display\n */\nDateTimeFormatter.formatAs = function (date, format) {\n const nDate = convertToNativeDate(date);\n const occurrence = DateTimeFormatter.findTokens(format);\n const definitions = DateTimeFormatter.getTokenDefinitions();\n let formattedStr = String(format);\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n let token;\n let formattedVal;\n let i;\n let l;\n\n for (i = 0, l = occurrence.length; i < l; i++) {\n token = occurrence[i].token;\n formattedVal = definitions[token].formatter(nDate);\n formattedStr = formattedStr.replace(new RegExp(tokenPrefix + token, 'g'), formattedVal);\n }\n\n return formattedStr;\n};\n\n/*\n * Parses the user specified date string to extract the date time params.\n *\n * @return {Array} : Value of date time params in an array [year, month, day, hour, minutes, seconds, milli]\n */\nDateTimeFormatter.prototype.parse = function (dateTimeStamp, options) {\n const tokenResolver = DateTimeFormatter.tokenResolver();\n const dtParams = this.extractTokenValue(dateTimeStamp);\n const dtParamSeq = DateTimeFormatter.DATETIME_PARAM_SEQUENCE;\n const noBreak = options && options.noBreak;\n const dtParamArr = [];\n const args = [];\n let resolverKey;\n let resolverParams;\n let resolverFn;\n let val;\n let i;\n let param;\n let resolvedVal;\n let l;\n let result = [];\n\n for (resolverKey in tokenResolver) {\n if (!{}.hasOwnProperty.call(tokenResolver, resolverKey)) { continue; }\n\n args.length = 0;\n resolverParams = tokenResolver[resolverKey];\n resolverFn = resolverParams.splice(resolverParams.length - 1, 1)[0];\n\n for (i = 0, l = resolverParams.length; i < l; i++) {\n param = resolverParams[i];\n val = dtParams[param.name];\n\n if (val === undefined) {\n args.push(null);\n } else {\n args.push([param, val]);\n }\n }\n\n resolvedVal = resolverFn.apply(this, args);\n\n if ((resolvedVal === undefined || resolvedVal === null) && !noBreak) {\n break;\n }\n\n dtParamArr[dtParamSeq[resolverKey]] = resolvedVal;\n }\n\n if (dtParamArr.length && this.checkIfOnlyYear(dtParamArr.length))\n {\n result.unshift(dtParamArr[0], 0, 1); }\n else {\n result.unshift(...dtParamArr);\n }\n\n return result;\n};\n\n/*\n * Extract the value of the token from user specified date time string.\n *\n * @return {Object} : An key value pair which contains the tokens as key and value as pair\n */\nDateTimeFormatter.prototype.extractTokenValue = function (dateTimeStamp) {\n const format = this.format;\n const definitions = DateTimeFormatter.getTokenDefinitions();\n const tokenPrefix = DateTimeFormatter.TOKEN_PREFIX;\n const occurrence = DateTimeFormatter.findTokens(format);\n const tokenObj = {};\n\n let lastOccurrenceIndex;\n let occObj;\n let occIndex;\n let targetText;\n let regexFormat;\n\n let l;\n let i;\n\n regexFormat = String(format);\n\n const tokenArr = occurrence.map(obj => obj.token);\n const occurrenceLength = occurrence.length;\n for (i = occurrenceLength - 1; i >= 0; i--) {\n occIndex = occurrence[i].index;\n\n if (occIndex + 1 === regexFormat.length - 1) {\n lastOccurrenceIndex = occIndex;\n continue;\n }\n\n if (lastOccurrenceIndex === undefined) {\n lastOccurrenceIndex = regexFormat.length;\n }\n\n targetText = regexFormat.substring(occIndex + 2, lastOccurrenceIndex);\n regexFormat = regexFormat.substring(0, occIndex + 2) +\n RegExp.escape(targetText) +\n regexFormat.substring(lastOccurrenceIndex, regexFormat.length);\n\n lastOccurrenceIndex = occIndex;\n }\n\n for (i = 0; i < occurrenceLength; i++) {\n occObj = occurrence[i];\n regexFormat = regexFormat.replace(tokenPrefix + occObj.token, definitions[occObj.token].extract());\n }\n\n const extractValues = dateTimeStamp.match(new RegExp(regexFormat)) || [];\n extractValues.shift();\n\n for (i = 0, l = tokenArr.length; i < l; i++) {\n tokenObj[tokenArr[i]] = extractValues[i];\n }\n return tokenObj;\n};\n\n/*\n * Give back the JS native date formed from user specified date string\n *\n * @return {Date} : Native JS Date\n */\nDateTimeFormatter.prototype.getNativeDate = function (dateTimeStamp) {\n let date = null;\n if (Number.isFinite(dateTimeStamp)) {\n date = new Date(dateTimeStamp);\n } else if (!this.format && Date.parse(dateTimeStamp)) {\n date = new Date(dateTimeStamp);\n }\n else {\n const dtParams = this.dtParams = this.parse(dateTimeStamp);\n if (dtParams.length) {\n this.nativeDate = new Date(...dtParams);\n date = this.nativeDate;\n }\n }\n return date;\n};\n\nDateTimeFormatter.prototype.checkIfOnlyYear = function(len) {\n return len === 1 && this.format.match(/y|Y/g).length;\n};\n\n/*\n * Represents JS native date to a user specified format.\n *\n * @param format {String} : The format according to which the date is to be represented\n * @return {String} : The formatted date string\n */\nDateTimeFormatter.prototype.formatAs = function (format, dateTimeStamp) {\n let nativeDate;\n\n if (dateTimeStamp) {\n nativeDate = this.nativeDate = this.getNativeDate(dateTimeStamp);\n } else if (!(nativeDate = this.nativeDate)) {\n nativeDate = this.getNativeDate(dateTimeStamp);\n }\n\n return DateTimeFormatter.formatAs(nativeDate, format);\n};\n\nexport { DateTimeFormatter as default };\n","/**\n * The utility function to calculate major column.\n *\n * @param {Object} store - The store object.\n * @return {Function} Returns the push function.\n */\nexport default (store) => {\n let i = 0;\n return (...fields) => {\n fields.forEach((val, fieldIndex) => {\n if (!(store[fieldIndex] instanceof Array)) {\n store[fieldIndex] = Array.from({ length: i });\n }\n store[fieldIndex].push(val);\n });\n i++;\n };\n};\n","/* eslint-disable */\nconst OBJECTSTRING = 'object';\nconst objectToStrFn = Object.prototype.toString;\nconst objectToStr = '[object Object]';\nconst arrayToStr = '[object Array]';\n\nfunction checkCyclicRef(obj, parentArr) {\n let i = parentArr.length;\n let bIndex = -1;\n\n while (i) {\n if (obj === parentArr[i]) {\n bIndex = i;\n return bIndex;\n }\n i -= 1;\n }\n\n return bIndex;\n}\n\nfunction merge(obj1, obj2, skipUndef, tgtArr, srcArr) {\n var item,\n srcVal,\n tgtVal,\n str,\n cRef;\n // check whether obj2 is an array\n // if array then iterate through it's index\n // **** MOOTOOLS precution\n\n if (!srcArr) {\n tgtArr = [obj1];\n srcArr = [obj2];\n }\n else {\n tgtArr.push(obj1);\n srcArr.push(obj2);\n }\n\n if (obj2 instanceof Array) {\n for (item = 0; item < obj2.length; item += 1) {\n try {\n srcVal = obj1[item];\n tgtVal = obj2[item];\n }\n catch (e) {\n continue;\n }\n\n if (typeof tgtVal !== OBJECTSTRING) {\n if (!(skipUndef && tgtVal === undefined)) {\n obj1[item] = tgtVal;\n }\n }\n else {\n if (srcVal === null || typeof srcVal !== OBJECTSTRING) {\n srcVal = obj1[item] = tgtVal instanceof Array ? [] : {};\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n }\n }\n else {\n for (item in obj2) {\n try {\n srcVal = obj1[item];\n tgtVal = obj2[item];\n }\n catch (e) {\n continue;\n }\n\n if (tgtVal !== null && typeof tgtVal === OBJECTSTRING) {\n // Fix for issue BUG: FWXT-602\n // IE < 9 Object.prototype.toString.call(null) gives\n // '[object Object]' instead of '[object Null]'\n // that's why null value becomes Object in IE < 9\n str = objectToStrFn.call(tgtVal);\n if (str === objectToStr) {\n if (srcVal === null || typeof srcVal !== OBJECTSTRING) {\n srcVal = obj1[item] = {};\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n else if (str === arrayToStr) {\n if (srcVal === null || !(srcVal instanceof Array)) {\n srcVal = obj1[item] = [];\n }\n cRef = checkCyclicRef(tgtVal, srcArr);\n if (cRef !== -1) {\n srcVal = obj1[item] = tgtArr[cRef];\n }\n else {\n merge(srcVal, tgtVal, skipUndef, tgtArr, srcArr);\n }\n }\n else {\n obj1[item] = tgtVal;\n }\n }\n else {\n if (skipUndef && tgtVal === undefined) {\n continue;\n }\n obj1[item] = tgtVal;\n }\n }\n }\n return obj1;\n}\n\n\nfunction extend2 (obj1, obj2, skipUndef) {\n //if none of the arguments are object then return back\n if (typeof obj1 !== OBJECTSTRING && typeof obj2 !== OBJECTSTRING) {\n return null;\n }\n\n if (typeof obj2 !== OBJECTSTRING || obj2 === null) {\n return obj1;\n }\n\n if (typeof obj1 !== OBJECTSTRING) {\n obj1 = obj2 instanceof Array ? [] : {};\n }\n merge(obj1, obj2, skipUndef);\n return obj1;\n}\n\nexport { extend2 as default };\n","import { DataFormat } from '../enums';\n\n/**\n * Checks whether the value is an array.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is an array otherwise returns false.\n */\nexport function isArray (val) {\n return Array.isArray(val);\n}\n\n/**\n * Checks whether the value is an object.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is an object otherwise returns false.\n */\nexport function isObject (val) {\n return val === Object(val);\n}\n\n/**\n * Checks whether the value is a string value.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is a string value otherwise returns false.\n */\nexport function isString (val) {\n return typeof val === 'string';\n}\n\n/**\n * Checks whether the value is callable.\n *\n * @param {*} val - The value to be checked.\n * @return {boolean} Returns true if the value is callable otherwise returns false.\n */\nexport function isCallable (val) {\n return typeof val === 'function';\n}\n\n/**\n * Returns the unique values from the input array.\n *\n * @param {Array} data - The input array.\n * @return {Array} Returns a new array of unique values.\n */\nexport function uniqueValues (data) {\n return [...new Set(data)];\n}\n\nexport const getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Checks Whether two arrays have same content.\n *\n * @param {Array} arr1 - The first array.\n * @param {Array} arr2 - The 2nd array.\n * @return {boolean} Returns whether two array have same content.\n */\nexport function isArrEqual(arr1, arr2) {\n if (!isArray(arr1) || !isArray(arr2)) {\n return arr1 === arr2;\n }\n\n if (arr1.length !== arr2.length) {\n return false;\n }\n\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * It is the default number format function for the measure field type.\n *\n * @param {any} val - The input value.\n * @return {number} Returns a number value.\n */\nexport function formatNumber(val) {\n return val;\n}\n\n/**\n * Returns the detected data format.\n *\n * @param {any} data - The input data to be tested.\n * @return {string} Returns the data format name.\n */\nexport const detectDataFormat = (data) => {\n if (isString(data)) {\n return DataFormat.DSV_STR;\n } else if (isArray(data) && isArray(data[0])) {\n return DataFormat.DSV_ARR;\n } else if (isArray(data) && (data.length === 0 || isObject(data[0]))) {\n return DataFormat.FLAT_JSON;\n }\n return null;\n};\n","import { FieldType } from './enums';\nimport { getUniqueId } from './utils';\n\nconst fieldStore = {\n data: {},\n\n createNamespace (fieldArr, name) {\n const dataId = name || getUniqueId();\n\n this.data[dataId] = {\n name: dataId,\n fields: fieldArr,\n\n fieldsObj () {\n let fieldsObj = this._cachedFieldsObj;\n\n if (!fieldsObj) {\n fieldsObj = this._cachedFieldsObj = {};\n this.fields.forEach((field) => {\n fieldsObj[field.name()] = field;\n });\n }\n return fieldsObj;\n },\n getMeasure () {\n let measureFields = this._cachedMeasure;\n\n if (!measureFields) {\n measureFields = this._cachedMeasure = {};\n this.fields.forEach((field) => {\n if (field.schema().type === FieldType.MEASURE) {\n measureFields[field.name()] = field;\n }\n });\n }\n return measureFields;\n },\n getDimension () {\n let dimensionFields = this._cachedDimension;\n\n if (!this._cachedDimension) {\n dimensionFields = this._cachedDimension = {};\n this.fields.forEach((field) => {\n if (field.schema().type === FieldType.DIMENSION) {\n dimensionFields[field.name()] = field;\n }\n });\n }\n return dimensionFields;\n },\n };\n return this.data[dataId];\n },\n};\n\nexport default fieldStore;\n","import { getNumberFormattedVal } from './helper';\n\n/**\n * The wrapper class on top of the primitive value of a field.\n *\n * @todo Need to have support for StringValue, NumberValue, DateTimeValue\n * and GeoValue. These types should expose predicate API mostly.\n */\nclass Value {\n\n /**\n * Creates new Value instance.\n *\n * @param {*} val - the primitive value from the field cell.\n * @param {string | Field} field - The field from which the value belongs.\n */\n constructor (value, rawValue, field) {\n const formattedValue = getNumberFormattedVal(field, value);\n\n Object.defineProperties(this, {\n _value: {\n enumerable: false,\n configurable: false,\n writable: false,\n value\n },\n _formattedValue: {\n enumerable: false,\n configurable: false,\n writable: false,\n value: formattedValue\n },\n _internalValue: {\n enumerable: false,\n configurable: false,\n writable: false,\n value: rawValue\n }\n });\n\n this.field = field;\n }\n\n /**\n * Returns the field value.\n *\n * @return {*} Returns the current value.\n */\n get value () {\n return this._value;\n }\n\n /**\n * Returns the parsed value of field\n */\n get formattedValue () {\n return this._formattedValue;\n }\n\n /**\n * Returns the internal value of field\n */\n get internalValue () {\n return this._internalValue;\n }\n\n /**\n * Converts to human readable string.\n *\n * @override\n * @return {string} Returns a human readable string of the field value.\n *\n */\n toString () {\n return String(this.value);\n }\n\n /**\n * Returns the value of the field.\n *\n * @override\n * @return {*} Returns the field value.\n */\n valueOf () {\n return this.value;\n }\n}\n\nexport default Value;\n","/**\n * Iterates through the diffSet array and call the callback with the current\n * index.\n *\n * @param {string} rowDiffset - The row diffset string e.g. '0-4,6,10-13'.\n * @param {Function} callback - The callback function to be called with every index.\n */\nexport function rowDiffsetIterator (rowDiffset, callback) {\n if (rowDiffset.length > 0) {\n const rowDiffArr = rowDiffset.split(',');\n rowDiffArr.forEach((diffStr) => {\n const diffStsArr = diffStr.split('-');\n const start = +(diffStsArr[0]);\n const end = +(diffStsArr[1] || diffStsArr[0]);\n if (end >= start) {\n for (let i = start; i <= end; i += 1) {\n callback(i);\n }\n }\n });\n }\n}\n","/**\n * A parser to parser null, undefined, invalid and NIL values.\n *\n * @public\n * @class\n */\nclass InvalidAwareTypes {\n /**\n * Static method which gets/sets the invalid value registry.\n *\n * @public\n * @param {Object} config - The custom configuration supplied by user.\n * @return {Object} Returns the invalid values registry.\n */\n static invalidAwareVals (config) {\n if (!config) {\n return InvalidAwareTypes._invalidAwareValsMap;\n }\n return Object.assign(InvalidAwareTypes._invalidAwareValsMap, config);\n }\n\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {string} value - The value of the invalid data type.\n */\n constructor (value) {\n this._value = value;\n }\n\n /**\n * Returns the current value of the instance.\n *\n * @public\n * @return {string} Returns the value of the invalid data type.\n */\n value () {\n return this._value;\n }\n\n /**\n * Returns the current value of the instance in string format.\n *\n * @public\n * @return {string} Returns the value of the invalid data type.\n */\n toString () {\n return String(this._value);\n }\n\n static isInvalid(val) {\n return (val instanceof InvalidAwareTypes) || !!InvalidAwareTypes.invalidAwareVals()[val];\n }\n\n static getInvalidType(val) {\n return val instanceof InvalidAwareTypes ? val : InvalidAwareTypes.invalidAwareVals()[val];\n }\n}\n\n/**\n * Enums for Invalid types.\n */\nInvalidAwareTypes.NULL = new InvalidAwareTypes('null');\nInvalidAwareTypes.NA = new InvalidAwareTypes('na');\nInvalidAwareTypes.NIL = new InvalidAwareTypes('nil');\n\n/**\n * Default Registry for mapping the invalid values.\n *\n * @private\n */\nInvalidAwareTypes._invalidAwareValsMap = {\n invalid: InvalidAwareTypes.NA,\n nil: InvalidAwareTypes.NIL,\n null: InvalidAwareTypes.NULL,\n undefined: InvalidAwareTypes.NA\n};\n\nexport default InvalidAwareTypes;\n","export { DataFormat, FilteringMode } from '../enums';\n/**\n * The event name for data propagation.\n */\nexport const PROPAGATION = 'propagation';\n\n/**\n * The name of the unique row id column in DataModel.\n */\nexport const ROW_ID = '__id__';\n\n/**\n * The enums for operation names performed on DataModel.\n */\nexport const DM_DERIVATIVES = {\n SELECT: 'select',\n PROJECT: 'project',\n GROUPBY: 'group',\n COMPOSE: 'compose',\n CAL_VAR: 'calculatedVariable',\n BIN: 'bin',\n SORT: 'sort'\n};\n\nexport const JOINS = {\n CROSS: 'cross',\n LEFTOUTER: 'leftOuter',\n RIGHTOUTER: 'rightOuter',\n NATURAL: 'natural',\n FULLOUTER: 'fullOuter'\n};\n\nexport const LOGICAL_OPERATORS = {\n AND: 'and',\n OR: 'or'\n};\n","/**\n * The helper function that returns an array of common schema\n * from two fieldStore instances.\n *\n * @param {FieldStore} fs1 - The first FieldStore instance.\n * @param {FieldStore} fs2 - The second FieldStore instance.\n * @return {Array} An array containing the common schema.\n */\nexport function getCommonSchema (fs1, fs2) {\n const retArr = [];\n const fs1Arr = [];\n fs1.fields.forEach((field) => {\n fs1Arr.push(field.schema().name);\n });\n fs2.fields.forEach((field) => {\n if (fs1Arr.indexOf(field.schema().name) !== -1) {\n retArr.push(field.schema().name);\n }\n });\n return retArr;\n}\n","import DataModel from '../datamodel';\nimport { extend2 } from '../utils';\nimport { getCommonSchema } from './get-common-schema';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { JOINS } from '../constants';\nimport { prepareJoinData } from '../helper';\n/**\n * Default filter function for crossProduct.\n *\n * @return {boolean} Always returns true.\n */\nfunction defaultFilterFn() { return true; }\n\n/**\n * Implementation of cross product operation between two DataModel instances.\n * It internally creates the data and schema for the new DataModel.\n *\n * @param {DataModel} dataModel1 - The left DataModel instance.\n * @param {DataModel} dataModel2 - The right DataModel instance.\n * @param {Function} filterFn - The filter function which is used to filter the tuples.\n * @param {boolean} [replaceCommonSchema=false] - The flag if the common name schema should be there.\n * @return {DataModel} Returns The newly created DataModel instance from the crossProduct operation.\n */\nexport function crossProduct (dm1, dm2, filterFn, replaceCommonSchema = false, jointype = JOINS.CROSS) {\n const schema = [];\n const data = [];\n const applicableFilterFn = filterFn || defaultFilterFn;\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreName = dm1FieldStore.name;\n const dm2FieldStoreName = dm2FieldStore.name;\n const name = `${dm1FieldStore.name}.${dm2FieldStore.name}`;\n const commonSchemaList = getCommonSchema(dm1FieldStore, dm2FieldStore);\n\n if (dm1FieldStoreName === dm2FieldStoreName) {\n throw new Error('DataModels must have different alias names');\n }\n // Here prepare the schema\n dm1FieldStore.fields.forEach((field) => {\n const tmpSchema = extend2({}, field.schema());\n if (commonSchemaList.indexOf(tmpSchema.name) !== -1 && !replaceCommonSchema) {\n tmpSchema.name = `${dm1FieldStore.name}.${tmpSchema.name}`;\n }\n schema.push(tmpSchema);\n });\n dm2FieldStore.fields.forEach((field) => {\n const tmpSchema = extend2({}, field.schema());\n if (commonSchemaList.indexOf(tmpSchema.name) !== -1) {\n if (!replaceCommonSchema) {\n tmpSchema.name = `${dm2FieldStore.name}.${tmpSchema.name}`;\n schema.push(tmpSchema);\n }\n } else {\n schema.push(tmpSchema);\n }\n });\n\n // Here prepare Data\n rowDiffsetIterator(dm1._rowDiffset, (i) => {\n let rowAdded = false;\n let rowPosition;\n rowDiffsetIterator(dm2._rowDiffset, (ii) => {\n const tuple = [];\n const userArg = {};\n userArg[dm1FieldStoreName] = {};\n userArg[dm2FieldStoreName] = {};\n dm1FieldStore.fields.forEach((field) => {\n tuple.push(field.partialField.data[i]);\n userArg[dm1FieldStoreName][field.name()] = {\n rawValue: field.partialField.data[i],\n formattedValue: field.formattedData()[i],\n };\n });\n dm2FieldStore.fields.forEach((field) => {\n if (!(commonSchemaList.indexOf(field.schema().name) !== -1 && replaceCommonSchema)) {\n tuple.push(field.partialField.data[ii]);\n }\n userArg[dm2FieldStoreName][field.name()] = {\n rawValue: field.partialField.data[ii],\n formattedValue: field.formattedData()[ii],\n };\n });\n\n let cachedStore = {};\n let cloneProvider1 = () => dm1.detachedRoot();\n let cloneProvider2 = () => dm2.detachedRoot();\n\n const dm1Fields = prepareJoinData(userArg[dm1FieldStoreName]);\n const dm2Fields = prepareJoinData(userArg[dm2FieldStoreName]);\n if (applicableFilterFn(dm1Fields, dm2Fields, cloneProvider1, cloneProvider2, cachedStore)) {\n const tupleObj = {};\n tuple.forEach((cellVal, iii) => {\n tupleObj[schema[iii].name] = cellVal;\n });\n if (rowAdded && JOINS.CROSS !== jointype) {\n data[rowPosition] = tupleObj;\n }\n else {\n data.push(tupleObj);\n rowAdded = true;\n rowPosition = i;\n }\n } else if ((jointype === JOINS.LEFTOUTER || jointype === JOINS.RIGHTOUTER) && !rowAdded) {\n const tupleObj = {};\n let len = dm1FieldStore.fields.length - 1;\n tuple.forEach((cellVal, iii) => {\n if (iii <= len) {\n tupleObj[schema[iii].name] = cellVal;\n }\n else {\n tupleObj[schema[iii].name] = null;\n }\n });\n rowAdded = true;\n rowPosition = i;\n data.push(tupleObj);\n }\n });\n });\n\n return new DataModel(data, schema, { name });\n}\n","/**\n * The default sort function.\n *\n * @param {*} a - The first value.\n * @param {*} b - The second value.\n * @return {number} Returns the comparison result e.g. 1 or 0 or -1.\n */\nfunction defSortFn (a, b) {\n const a1 = `${a}`;\n const b1 = `${b}`;\n if (a1 < b1) {\n return -1;\n }\n if (a1 > b1) {\n return 1;\n }\n return 0;\n}\n\n/**\n * The helper function for merge sort which creates the sorted array\n * from the two halves of the input array.\n *\n * @param {Array} arr - The target array which needs to be merged.\n * @param {number} lo - The starting index of the first array half.\n * @param {number} mid - The ending index of the first array half.\n * @param {number} hi - The ending index of the second array half.\n * @param {Function} sortFn - The sort function.\n */\nfunction merge (arr, lo, mid, hi, sortFn) {\n const mainArr = arr;\n const auxArr = [];\n for (let i = lo; i <= hi; i += 1) {\n auxArr[i] = mainArr[i];\n }\n let a = lo;\n let b = mid + 1;\n\n for (let i = lo; i <= hi; i += 1) {\n if (a > mid) {\n mainArr[i] = auxArr[b];\n b += 1;\n } else if (b > hi) {\n mainArr[i] = auxArr[a];\n a += 1;\n } else if (sortFn(auxArr[a], auxArr[b]) <= 0) {\n mainArr[i] = auxArr[a];\n a += 1;\n } else {\n mainArr[i] = auxArr[b];\n b += 1;\n }\n }\n}\n\n/**\n * The helper function for merge sort which would be called\n * recursively for sorting the array halves.\n *\n * @param {Array} arr - The target array which needs to be sorted.\n * @param {number} lo - The starting index of the array half.\n * @param {number} hi - The ending index of the array half.\n * @param {Function} sortFn - The sort function.\n * @return {Array} Returns the target array itself.\n */\nfunction sort (arr, lo, hi, sortFn) {\n if (hi === lo) { return arr; }\n\n const mid = lo + Math.floor((hi - lo) / 2);\n sort(arr, lo, mid, sortFn);\n sort(arr, mid + 1, hi, sortFn);\n merge(arr, lo, mid, hi, sortFn);\n\n return arr;\n}\n\n/**\n * The implementation of merge sort.\n * It is used in DataModel for stable sorting as it is not sure\n * what the sorting algorithm used by browsers is stable or not.\n *\n * @param {Array} arr - The target array which needs to be sorted.\n * @param {Function} [sortFn=defSortFn] - The sort function.\n * @return {Array} Returns the input array itself in sorted order.\n */\nexport function mergeSort (arr, sortFn = defSortFn) {\n if (arr.length > 1) {\n sort(arr, 0, arr.length - 1, sortFn);\n }\n return arr;\n}\n","import { DimensionSubtype, MeasureSubtype } from '../enums';\nimport { mergeSort } from './merge-sort';\nimport { fieldInSchema } from '../helper';\nimport { isCallable, isArray } from '../utils';\n\n/**\n * Generates the sorting functions to sort the data of a DataModel instance\n * according to the input data type.\n *\n * @param {string} dataType - The data type e.g. 'measure', 'datetime' etc.\n * @param {string} sortType - The sorting order i.e. 'asc' or 'desc'.\n * @return {Function} Returns the the sorting function.\n */\nfunction getSortFn (dataType, sortType) {\n let retFunc;\n\n switch (dataType) {\n case MeasureSubtype.CONTINUOUS:\n case DimensionSubtype.TEMPORAL:\n if (sortType === 'asc') {\n retFunc = (a, b) => a - b;\n } else {\n retFunc = (a, b) => b - a;\n }\n break;\n default:\n if (sortType === 'asc') {\n retFunc = (a, b) => {\n a = `${a}`;\n b = `${b}`;\n if (a === b) {\n return 0;\n }\n return a > b ? 1 : -1;\n };\n } else {\n retFunc = (a, b) => {\n a = `${a}`;\n b = `${b}`;\n if (a === b) {\n return 0;\n }\n return a > b ? -1 : 1;\n };\n }\n }\n\n return retFunc;\n}\n\n/**\n * Resolves the actual sorting function based on sorting string value.\n *\n * @param {Object} fDetails - The target field info.\n * @param {string} strSortOrder - The sort order value.\n * @return {Function} Returns the sorting function.\n */\nfunction resolveStrSortOrder (fDetails, strSortOrder) {\n const sortOrder = String(strSortOrder).toLowerCase() === 'desc' ? 'desc' : 'asc';\n return getSortFn(fDetails.type, sortOrder);\n}\n\n/**\n * Groups the data according to the specified target field.\n *\n * @param {Array} data - The input data array.\n * @param {number} fieldIndex - The target field index within schema array.\n * @return {Array} Returns an array containing the grouped data.\n */\nfunction groupData (data, fieldIndex) {\n const hashMap = new Map();\n const groupedData = [];\n\n data.forEach((datum) => {\n const fieldVal = datum[fieldIndex];\n if (hashMap.has(fieldVal)) {\n groupedData[hashMap.get(fieldVal)][1].push(datum);\n } else {\n groupedData.push([fieldVal, [datum]]);\n hashMap.set(fieldVal, groupedData.length - 1);\n }\n });\n\n return groupedData;\n}\n\n/**\n * Creates the argument value used for sorting function when sort is done\n * with another fields.\n *\n * @param {Array} groupedDatum - The grouped datum for a single dimension field value.\n * @param {Array} targetFields - An array of the sorting fields.\n * @param {Array} targetFieldDetails - An array of the sorting field details in schema.\n * @return {Object} Returns an object containing the value of sorting fields and the target field name.\n */\nfunction createSortingFnArg (groupedDatum, targetFields, targetFieldDetails) {\n const arg = {\n label: groupedDatum[0]\n };\n\n targetFields.reduce((acc, next, idx) => {\n acc[next] = groupedDatum[1].map(datum => datum[targetFieldDetails[idx].index]);\n return acc;\n }, arg);\n\n return arg;\n}\n\n/**\n * Sorts the data by applying the standard sorting mechanism.\n *\n * @param {Array} data - The input data array.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n */\nfunction applyStandardSort (data, schema, sortingDetails) {\n let fieldName;\n let sortMeta;\n let fDetails;\n let i = sortingDetails.length - 1;\n\n for (; i >= 0; i--) {\n fieldName = sortingDetails[i][0];\n sortMeta = sortingDetails[i][1];\n fDetails = fieldInSchema(schema, fieldName);\n\n if (!fDetails) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (isCallable(sortMeta)) {\n // eslint-disable-next-line no-loop-func\n mergeSort(data, (a, b) => sortMeta(a[fDetails.index], b[fDetails.index]));\n } else if (isArray(sortMeta)) {\n const groupedData = groupData(data, fDetails.index);\n const sortingFn = sortMeta[sortMeta.length - 1];\n const targetFields = sortMeta.slice(0, sortMeta.length - 1);\n const targetFieldDetails = targetFields.map(f => fieldInSchema(schema, f));\n\n groupedData.forEach((groupedDatum) => {\n groupedDatum.push(createSortingFnArg(groupedDatum, targetFields, targetFieldDetails));\n });\n\n mergeSort(groupedData, (a, b) => {\n const m = a[2];\n const n = b[2];\n return sortingFn(m, n);\n });\n\n // Empty the array\n data.length = 0;\n groupedData.forEach((datum) => {\n data.push(...datum[1]);\n });\n } else {\n const sortFn = resolveStrSortOrder(fDetails, sortMeta);\n // eslint-disable-next-line no-loop-func\n mergeSort(data, (a, b) => sortFn(a[fDetails.index], b[fDetails.index]));\n }\n }\n}\n\n/**\n * Creates a map based on grouping.\n *\n * @param {Array} depColumns - The dependency columns' info.\n * @param {Array} data - The input data.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - The sorting details for standard sorting.\n * @return {Map} Returns a map.\n */\nconst makeGroupMapAndSort = (depColumns, data, schema, sortingDetails) => {\n if (depColumns.length === 0) { return data; }\n\n const targetCol = depColumns[0];\n const map = new Map();\n\n data.reduce((acc, currRow) => {\n const fVal = currRow[targetCol.index];\n if (acc.has(fVal)) {\n acc.get(fVal).push(currRow);\n } else {\n acc.set(fVal, [currRow]);\n }\n return acc;\n }, map);\n\n for (let [key, val] of map) {\n const nMap = makeGroupMapAndSort(depColumns.slice(1), val, schema, sortingDetails);\n map.set(key, nMap);\n if (Array.isArray(nMap)) {\n applyStandardSort(nMap, schema, sortingDetails);\n }\n }\n\n return map;\n};\n\n/**\n * Sorts the data by retaining the position/order of a particular field.\n *\n * @param {Array} data - The input data array.\n * @param {Array} schema - The data schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n * @param {Array} depColumns - The dependency column list.\n * @return {Array} Returns the sorted data.\n */\nfunction applyGroupSort (data, schema, sortingDetails, depColumns) {\n sortingDetails = sortingDetails.filter((detail) => {\n if (detail[1] === null) {\n depColumns.push(detail[0]);\n return false;\n }\n return true;\n });\n if (sortingDetails.length === 0) { return data; }\n\n depColumns = depColumns.map(c => fieldInSchema(schema, c));\n\n const sortedGroupMap = makeGroupMapAndSort(depColumns, data, schema, sortingDetails);\n return data.map((row) => {\n let i = 0;\n let nextMap = sortedGroupMap;\n\n while (!Array.isArray(nextMap)) {\n nextMap = nextMap.get(row[depColumns[i++].index]);\n }\n\n return nextMap.shift();\n });\n}\n\n/**\n * Sorts the data.\n *\n * @param {Object} dataObj - An object containing the data and schema.\n * @param {Array} sortingDetails - An array containing the sorting configs.\n */\nexport function sortData (dataObj, sortingDetails) {\n let { schema, data } = dataObj;\n\n sortingDetails = sortingDetails.filter(sDetial => !!fieldInSchema(schema, sDetial[0]));\n if (sortingDetails.length === 0) { return; }\n\n let groupSortingIdx = sortingDetails.findIndex(sDetial => sDetial[1] === null);\n groupSortingIdx = groupSortingIdx !== -1 ? groupSortingIdx : sortingDetails.length;\n\n const standardSortingDetails = sortingDetails.slice(0, groupSortingIdx);\n const groupSortingDetails = sortingDetails.slice(groupSortingIdx);\n\n applyStandardSort(data, schema, standardSortingDetails);\n data = applyGroupSort(data, schema, groupSortingDetails, standardSortingDetails.map(detail => detail[0]));\n\n dataObj.uids = data.map(row => row.pop());\n dataObj.data = data;\n}\n","import { rowDiffsetIterator } from './row-diffset-iterator';\nimport { sortData } from './sort';\nimport { FieldType } from '../enums';\nimport { ROW_ID } from '../constants';\n\n/**\n * Builds the actual data array.\n *\n * @param {Array} fieldStore - An array of field.\n * @param {string} rowDiffset - A string consisting of which rows to be included eg. '0-2,4,6';\n * @param {string} colIdentifier - A string consisting of the details of which column\n * to be included eg 'date,sales,profit';\n * @param {Object} sortingDetails - An object containing the sorting details of the DataModel instance.\n * @param {Object} options - The options required to create the type of the data.\n * @return {Object} Returns an object containing the multidimensional array and the relative schema.\n */\nexport function dataBuilder (fieldStore, rowDiffset, colIdentifier, sortingDetails, options) {\n const defOptions = {\n addUid: false,\n columnWise: false\n };\n options = Object.assign({}, defOptions, options);\n\n const retObj = {\n schema: [],\n data: [],\n uids: []\n };\n const addUid = options.addUid;\n const reqSorting = sortingDetails && sortingDetails.length > 0;\n // It stores the fields according to the colIdentifier argument\n const tmpDataArr = [];\n // Stores the fields according to the colIdentifier argument\n const colIArr = colIdentifier.split(',');\n\n colIArr.forEach((colName) => {\n for (let i = 0; i < fieldStore.length; i += 1) {\n if (fieldStore[i].name() === colName) {\n tmpDataArr.push(fieldStore[i]);\n break;\n }\n }\n });\n\n // Inserts the schema to the schema object\n tmpDataArr.forEach((field) => {\n /** @todo Need to use extend2 here otherwise user can overwrite the schema. */\n retObj.schema.push(field.schema());\n });\n\n if (addUid) {\n retObj.schema.push({\n name: ROW_ID,\n type: FieldType.DIMENSION\n });\n }\n\n rowDiffsetIterator(rowDiffset, (i) => {\n retObj.data.push([]);\n const insertInd = retObj.data.length - 1;\n let start = 0;\n tmpDataArr.forEach((field, ii) => {\n retObj.data[insertInd][ii + start] = field.partialField.data[i];\n });\n if (addUid) {\n retObj.data[insertInd][tmpDataArr.length] = i;\n }\n // Creates an array of unique identifiers for each row\n retObj.uids.push(i);\n\n // If sorting needed then there is the need to expose the index\n // mapping from the old index to its new index\n if (reqSorting) { retObj.data[insertInd].push(i); }\n });\n\n // Handles the sort functionality\n if (reqSorting) {\n sortData(retObj, sortingDetails);\n }\n\n if (options.columnWise) {\n const tmpData = Array(...Array(retObj.schema.length)).map(() => []);\n retObj.data.forEach((tuple) => {\n tuple.forEach((data, i) => {\n tmpData[i].push(data);\n });\n });\n retObj.data = tmpData;\n }\n\n return retObj;\n}\n","import DataModel from '../datamodel';\nimport { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { isArrEqual } from '../utils/helper';\n\n/**\n * Performs the union operation between two dm instances.\n *\n * @todo Fix the conflicts between union and difference terminology here.\n *\n * @param {dm} dm1 - The first dm instance.\n * @param {dm} dm2 - The second dm instance.\n * @return {dm} Returns the newly created dm after union operation.\n */\nexport function difference (dm1, dm2) {\n const hashTable = {};\n const schema = [];\n const schemaNameArr = [];\n const data = [];\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreFieldObj = dm1FieldStore.fieldsObj();\n const dm2FieldStoreFieldObj = dm2FieldStore.fieldsObj();\n const name = `${dm1FieldStore.name} union ${dm2FieldStore.name}`;\n\n // For union the columns should match otherwise return a clone of the dm1\n if (!isArrEqual(dm1._colIdentifier.split(',').sort(), dm2._colIdentifier.split(',').sort())) {\n return null;\n }\n\n // Prepare the schema\n (dm1._colIdentifier.split(',')).forEach((fieldName) => {\n const field = dm1FieldStoreFieldObj[fieldName];\n schema.push(extend2({}, field.schema()));\n schemaNameArr.push(field.schema().name);\n });\n\n /**\n * The helper function to create the data.\n *\n * @param {dm} dm - The dm instance for which the data is inserted.\n * @param {Object} fieldsObj - The fieldStore object format.\n * @param {boolean} addData - If true only tuple will be added to the data.\n */\n function prepareDataHelper(dm, fieldsObj, addData) {\n rowDiffsetIterator(dm._rowDiffset, (i) => {\n const tuple = {};\n let hashData = '';\n schemaNameArr.forEach((schemaName) => {\n const value = fieldsObj[schemaName].partialField.data[i];\n hashData += `-${value}`;\n tuple[schemaName] = value;\n });\n if (!hashTable[hashData]) {\n if (addData) { data.push(tuple); }\n hashTable[hashData] = true;\n }\n });\n }\n\n // Prepare the data\n prepareDataHelper(dm2, dm2FieldStoreFieldObj, false);\n prepareDataHelper(dm1, dm1FieldStoreFieldObj, true);\n\n return new DataModel(data, schema, { name });\n}\n\n","import { isArray } from '../utils';\nimport InvalidAwareTypes from '../invalid-aware-types';\nimport { GROUP_BY_FUNCTIONS } from '../enums';\n\nconst { SUM, AVG, FIRST, LAST, COUNT, STD, MIN, MAX } = GROUP_BY_FUNCTIONS;\n\nfunction getFilteredValues(arr) {\n return arr.filter(item => !(item instanceof InvalidAwareTypes));\n}\n/**\n * Reducer function that returns the sum of all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the sum of the array.\n */\nfunction sum (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n const filteredNumber = getFilteredValues(arr);\n const totalSum = filteredNumber.length ?\n filteredNumber.reduce((acc, curr) => acc + curr, 0)\n : InvalidAwareTypes.NULL;\n return totalSum;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that returns the average of all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the mean value of the array.\n */\nfunction avg (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n const totalSum = sum(arr);\n const len = arr.length || 1;\n return (Number.isNaN(totalSum) || totalSum instanceof InvalidAwareTypes) ?\n InvalidAwareTypes.NULL : totalSum / len;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the min value amongst all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the minimum value of the array.\n */\nfunction min (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n // Filter out undefined, null and NaN values\n const filteredValues = getFilteredValues(arr);\n\n return (filteredValues.length) ? Math.min(...filteredValues) : InvalidAwareTypes.NULL;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the max value amongst all the values.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the maximum value of the array.\n */\nfunction max (arr) {\n if (isArray(arr) && !(arr[0] instanceof Array)) {\n // Filter out undefined, null and NaN values\n const filteredValues = getFilteredValues(arr);\n\n return (filteredValues.length) ? Math.max(...filteredValues) : InvalidAwareTypes.NULL;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Reducer function that gives the first value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the first value of the array.\n */\nfunction first (arr) {\n return arr[0];\n}\n\n/**\n * Reducer function that gives the last value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the last value of the array.\n */\nfunction last (arr) {\n return arr[arr.length - 1];\n}\n\n/**\n * Reducer function that gives the count value of the array.\n *\n * @public\n * @param {Array} arr - The input array.\n * @return {number} Returns the length of the array.\n */\nfunction count (arr) {\n if (isArray(arr)) {\n return arr.length;\n }\n return InvalidAwareTypes.NULL;\n}\n\n/**\n * Calculates the variance of the input array.\n *\n * @param {Array.} arr - The input array.\n * @return {number} Returns the variance of the input array.\n */\nfunction variance (arr) {\n let mean = avg(arr);\n return avg(arr.map(num => (num - mean) ** 2));\n}\n\n/**\n * Calculates the square root of the variance of the input array.\n *\n * @public\n * @param {Array.} arr - The input array.\n * @return {number} Returns the square root of the variance.\n */\nfunction std (arr) {\n return Math.sqrt(variance(arr));\n}\n\n\nconst fnList = {\n [SUM]: sum,\n [AVG]: avg,\n [MIN]: min,\n [MAX]: max,\n [FIRST]: first,\n [LAST]: last,\n [COUNT]: count,\n [STD]: std\n};\n\nconst defaultReducerName = SUM;\n\nexport {\n defaultReducerName,\n sum as defReducer,\n fnList,\n};\n","import { defReducer, fnList } from '../operator';\n\n/**\n * A page level storage which stores, registers, unregisters reducers for all the datamodel instances. There is only one\n * reducer store available in a page. All the datamodel instances receive same instance of reducer store. DataModel\n * out of the box provides handful of {@link reducer | reducers} which can be used as reducer funciton.\n *\n * @public\n * @namespace DataModel\n */\nclass ReducerStore {\n constructor () {\n this.store = new Map();\n this.store.set('defReducer', defReducer);\n\n Object.entries(fnList).forEach((key) => {\n this.store.set(key[0], key[1]);\n });\n }\n\n /**\n * Changes the `defaultReducer` globally. For all the fields which does not have `defAggFn` mentioned in schema, the\n * value of `defaultReducer` is used for aggregation.\n *\n * @public\n * @param {string} [reducer='sum'] - The name of the default reducer. It picks up the definition from store by doing\n * name lookup. If no name is found then it takes `sum` as the default reducer.\n * @return {ReducerStore} Returns instance of the singleton store in page.\n */\n defaultReducer (...params) {\n if (!params.length) {\n return this.store.get('defReducer');\n }\n\n let reducer = params[0];\n\n if (typeof reducer === 'function') {\n this.store.set('defReducer', reducer);\n } else {\n reducer = String(reducer);\n if (Object.keys(fnList).indexOf(reducer) !== -1) {\n this.store.set('defReducer', fnList[reducer]);\n } else {\n throw new Error(`Reducer ${reducer} not found in registry`);\n }\n }\n return this;\n }\n\n /**\n *\n * Registers a {@link reducer | reducer}.\n * A {@link reducer | reducer} has to be registered before it is used.\n *\n * @example\n * // find the mean squared value of a given set\n * const reducerStore = DataModel.Reducers();\n *\n * reducers.register('meanSquared', (arr) => {\n * const squaredVal = arr.map(item => item * item);\n * let sum = 0;\n * for (let i = 0, l = squaredVal.length; i < l; i++) {\n * sum += squaredVal[i++];\n * }\n *\n * return sum;\n * })\n *\n * // datamodel (dm) is already prepared with cars.json\n * const dm1 = dm.groupBy(['origin'], {\n * accleration: 'meanSquared'\n * });\n *\n * @public\n *\n * @param {string} name formal name for a reducer. If the given name already exists in store it is overridden by new\n * definition.\n * @param {Function} reducer definition of {@link reducer} function.\n *\n * @return {Function} function for unregistering the reducer.\n */\n register (name, reducer) {\n if (typeof reducer !== 'function') {\n throw new Error('Reducer should be a function');\n }\n\n name = String(name);\n this.store.set(name, reducer);\n\n return () => { this.__unregister(name); };\n }\n\n __unregister (name) {\n if (this.store.has(name)) {\n this.store.delete(name);\n }\n }\n\n resolve (name) {\n if (name instanceof Function) {\n return name;\n }\n return this.store.get(name);\n }\n}\n\nconst reducerStore = (function () {\n let store = null;\n\n function getStore () {\n if (store === null) {\n store = new ReducerStore();\n }\n return store;\n }\n return getStore();\n}());\n\nexport default reducerStore;\n","import { getCommonSchema } from './get-common-schema';\n\n/**\n * The filter function used in natural join.\n * It generates a function that will have the logic to join two\n * DataModel instances by the process of natural join.\n *\n * @param {DataModel} dm1 - The left DataModel instance.\n * @param {DataModel} dm2 - The right DataModel instance.\n * @return {Function} Returns a function that is used in cross-product operation.\n */\nexport function naturalJoinFilter (dm1, dm2) {\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n // const dm1FieldStoreName = dm1FieldStore.name;\n // const dm2FieldStoreName = dm2FieldStore.name;\n const commonSchemaArr = getCommonSchema(dm1FieldStore, dm2FieldStore);\n\n return (dm1Fields, dm2Fields) => {\n let retainTuple = true;\n commonSchemaArr.forEach((fieldName) => {\n if (dm1Fields[fieldName].internalValue ===\n dm2Fields[fieldName].internalValue && retainTuple) {\n retainTuple = true;\n } else {\n retainTuple = false;\n }\n });\n return retainTuple;\n };\n}\n","import DataModel from '../export';\nimport { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport { isArrEqual } from '../utils/helper';\n/**\n * Performs the union operation between two dm instances.\n *\n * @param {dm} dm1 - The first dm instance.\n * @param {dm} dm2 - The second dm instance.\n * @return {dm} Returns the newly created dm after union operation.\n */\nexport function union (dm1, dm2) {\n const hashTable = {};\n const schema = [];\n const schemaNameArr = [];\n const data = [];\n const dm1FieldStore = dm1.getFieldspace();\n const dm2FieldStore = dm2.getFieldspace();\n const dm1FieldStoreFieldObj = dm1FieldStore.fieldsObj();\n const dm2FieldStoreFieldObj = dm2FieldStore.fieldsObj();\n const name = `${dm1FieldStore.name} union ${dm2FieldStore.name}`;\n\n // For union the columns should match otherwise return a clone of the dm1\n if (!isArrEqual(dm1._colIdentifier.split(',').sort(), dm2._colIdentifier.split(',').sort())) {\n return null;\n }\n\n // Prepare the schema\n (dm1._colIdentifier.split(',')).forEach((fieldName) => {\n const field = dm1FieldStoreFieldObj[fieldName];\n schema.push(extend2({}, field.schema()));\n schemaNameArr.push(field.schema().name);\n });\n\n /**\n * The helper function to create the data.\n *\n * @param {dm} dm - The dm instance for which the data is inserted.\n * @param {Object} fieldsObj - The fieldStore object format.\n */\n function prepareDataHelper (dm, fieldsObj) {\n rowDiffsetIterator(dm._rowDiffset, (i) => {\n const tuple = {};\n let hashData = '';\n schemaNameArr.forEach((schemaName) => {\n const value = fieldsObj[schemaName].partialField.data[i];\n hashData += `-${value}`;\n tuple[schemaName] = value;\n });\n if (!hashTable[hashData]) {\n data.push(tuple);\n hashTable[hashData] = true;\n }\n });\n }\n\n // Prepare the data\n prepareDataHelper(dm1, dm1FieldStoreFieldObj);\n prepareDataHelper(dm2, dm2FieldStoreFieldObj);\n\n return new DataModel(data, schema, { name });\n}\n","import { crossProduct } from './cross-product';\nimport { JOINS } from '../constants';\nimport { union } from './union';\n\n\nexport function leftOuterJoin (dataModel1, dataModel2, filterFn) {\n return crossProduct(dataModel1, dataModel2, filterFn, false, JOINS.LEFTOUTER);\n}\n\nexport function rightOuterJoin (dataModel1, dataModel2, filterFn) {\n return crossProduct(dataModel2, dataModel1, filterFn, false, JOINS.RIGHTOUTER);\n}\n\nexport function fullOuterJoin (dataModel1, dataModel2, filterFn) {\n return union(leftOuterJoin(dataModel1, dataModel2, filterFn), rightOuterJoin(dataModel1, dataModel2, filterFn));\n}\n","/**\n * Stores the full data and the metadata of a field. It provides\n * a single source of data from which the future Field\n * instance can get a subset of it with a rowDiffset config.\n *\n * @class\n * @public\n */\nexport default class PartialField {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {string} name - The name of the field.\n * @param {Array} data - The data array.\n * @param {Object} schema - The schema object of the corresponding field.\n * @param {FieldParser} parser - The parser instance corresponding to that field.\n */\n constructor (name, data, schema, parser) {\n this.name = name;\n this.schema = schema;\n this.parser = parser;\n this.data = this._sanitize(data);\n }\n\n /**\n * Sanitizes the field data.\n *\n * @private\n * @param {Array} data - The actual input data.\n * @return {Array} Returns the sanitized data.\n */\n _sanitize (data) {\n return data.map(datum => this.parser.parse(datum, { format: this.schema.format }));\n }\n}\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport PartialField from '../partial-field';\n\n/**\n * In {@link DataModel}, every tabular data consists of column, a column is stored as field.\n * Field contains all the data for a given column in an array.\n *\n * Each record consists of several fields; the fields of all records form the columns.\n * Examples of fields: name, gender, sex etc.\n *\n * In DataModel, each field can have multiple attributes which describes its data and behaviour.\n * A field can have two types of data: Measure and Dimension.\n *\n * A Dimension Field is the context on which a data is categorized and the measure is the numerical values that\n * quantify the data set.\n * In short a dimension is the lens through which you are looking at your measure data.\n *\n * Refer to {@link Schema} to get info about possible field attributes.\n *\n * @public\n * @class\n */\nexport default class Field {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {PartialField} partialField - The partialField instance which holds the whole data.\n * @param {string} rowDiffset - The data subset definition.\n */\n constructor (partialField, rowDiffset) {\n this.partialField = partialField;\n this.rowDiffset = rowDiffset;\n }\n\n static parser() {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Generates the field type specific domain.\n *\n * @public\n * @abstract\n */\n domain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the the field schema.\n *\n * @public\n * @return {string} Returns the field schema.\n */\n schema () {\n return this.partialField.schema;\n }\n\n /**\n * Returns the name of the field.\n *\n * @public\n * @return {string} Returns the name of the field.\n */\n name () {\n return this.partialField.name;\n }\n\n /**\n * Returns the type of the field.\n *\n * @public\n * @return {string} Returns the type of the field.\n */\n type () {\n return this.partialField.schema.type;\n }\n\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return this.partialField.schema.subtype;\n }\n\n /**\n * Returns the description of the field.\n *\n * @public\n * @return {string} Returns the description of the field.\n */\n description () {\n return this.partialField.schema.description;\n }\n\n /**\n * Returns the display name of the field.\n *\n * @public\n * @return {string} Returns the display name of the field.\n */\n displayName () {\n return this.partialField.schema.displayName || this.partialField.schema.name;\n }\n\n /**\n * Returns the data associated with the field.\n *\n * @public\n * @return {Array} Returns the data.\n */\n data () {\n const data = [];\n rowDiffsetIterator(this.rowDiffset, (i) => {\n data.push(this.partialField.data[i]);\n });\n return data;\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @abstract\n */\n formattedData () {\n throw new Error('Not yet implemented');\n }\n\n static get BUILDER() {\n const builder = {\n _params: {},\n _context: this,\n fieldName(name) {\n this._params.name = name;\n return this;\n },\n schema(schema) {\n this._params.schema = schema;\n return this;\n },\n data(data) {\n this._params.data = data;\n return this;\n },\n partialField(partialField) {\n this._params.partialField = partialField;\n return this;\n },\n rowDiffset(rowDiffset) {\n this._params.rowDiffset = rowDiffset;\n return this;\n },\n build() {\n let partialField = null;\n if (this._params.partialField instanceof PartialField) {\n partialField = this._params.partialField;\n } else if (this._params.schema && this._params.data) {\n partialField = new PartialField(this._params.name,\n this._params.data,\n this._params.schema,\n this._context.parser());\n }\n else {\n throw new Error('Invalid Field parameters');\n }\n return new this._context(partialField, this._params.rowDiffset);\n }\n };\n return builder;\n }\n}\n","import Field from '../field';\n\n/**\n * Represents dimension field type.\n *\n * @public\n * @class\n * @extends Field\n */\nexport default class Dimension extends Field {\n /**\n * Returns the domain for the dimension field.\n *\n * @override\n * @public\n * @return {any} Returns the calculated domain.\n */\n domain () {\n if (!this._cachedDomain) {\n this._cachedDomain = this.calculateDataDomain();\n }\n return this._cachedDomain;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @abstract\n */\n calculateDataDomain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n return this.data();\n }\n}\n","import { formatNumber } from '../../utils';\nimport { defaultReducerName } from '../../operator/group-by-function';\nimport Field from '../field';\n\n/**\n * Represents measure field type.\n *\n * @public\n * @class\n * @extends Field\n */\nexport default class Measure extends Field {\n /**\n * Returns the domain for the measure field.\n *\n * @override\n * @public\n * @return {any} Returns the calculated domain.\n */\n domain () {\n if (!this._cachedDomain) {\n this._cachedDomain = this.calculateDataDomain();\n }\n return this._cachedDomain;\n }\n\n /**\n * Returns the unit of the measure field.\n *\n * @public\n * @return {string} Returns unit of the field.\n */\n unit () {\n return this.partialField.schema.unit;\n }\n\n /**\n * Returns the aggregation function name of the measure field.\n *\n * @public\n * @return {string} Returns aggregation function name of the field.\n */\n defAggFn () {\n return this.partialField.schema.defAggFn || defaultReducerName;\n }\n\n /**\n * Returns the number format of the measure field.\n *\n * @public\n * @return {Function} Returns number format of the field.\n */\n numberFormat () {\n const { numberFormat } = this.partialField.schema;\n return numberFormat instanceof Function ? numberFormat : formatNumber;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @abstract\n */\n calculateDataDomain () {\n throw new Error('Not yet implemented');\n }\n\n /**\n * Returns the formatted version of the underlying field data.\n *\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n return this.data();\n }\n}\n","/**\n * A interface to represent a parser which is responsible to parse the field.\n *\n * @public\n * @interface\n */\nexport default class FieldParser {\n /**\n * Parses a single value of a field and return the sanitized form.\n *\n * @public\n * @abstract\n */\n parse () {\n throw new Error('Not yet implemented');\n }\n}\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the categorical values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class CategoricalParser extends FieldParser {\n /**\n * Parses a single value of a field and returns the stringified form.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {string} Returns the stringified value.\n */\n parse (val) {\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n result = String(val).trim();\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport { DimensionSubtype } from '../../enums';\nimport Dimension from '../dimension';\nimport CategoricalParser from '../parsers/categorical-parser';\n/**\n * Represents categorical field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Categorical extends Dimension {\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @override\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return DimensionSubtype.CATEGORICAL;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the unique values.\n */\n calculateDataDomain () {\n const hash = new Set();\n const domain = [];\n\n // here don't use this.data() as the iteration will be occurred two times on same data.\n rowDiffsetIterator(this.rowDiffset, (i) => {\n const datum = this.partialField.data[i];\n if (!hash.has(datum)) {\n hash.add(datum);\n domain.push(datum);\n }\n });\n return domain;\n }\n\n static parser() {\n return new CategoricalParser();\n }\n}\n","import { DateTimeFormatter } from '../../../utils';\nimport FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the temporal values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class TemporalParser extends FieldParser {\n\n /**\n * Parses a single value of a field and returns the millisecond value.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {number} Returns the millisecond value.\n */\n parse (val, { format }) {\n let result;\n // check if invalid date value\n if (!this._dtf) {\n this._dtf = new DateTimeFormatter(format);\n }\n if (!InvalidAwareTypes.isInvalid(val)) {\n let nativeDate = this._dtf.getNativeDate(val);\n result = nativeDate ? nativeDate.getTime() : InvalidAwareTypes.NA;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { rowDiffsetIterator } from '../operator/row-diffset-iterator';\nimport InvalidAwareTypes from '../invalid-aware-types';\n\nexport const calculateContinuousDomain = (data, rowDiffset) => {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // here don't use this.data() as the iteration will be occurred two times on same data.\n rowDiffsetIterator(rowDiffset, (i) => {\n const datum = data[i];\n if (datum instanceof InvalidAwareTypes) {\n return;\n }\n\n if (datum < min) {\n min = datum;\n }\n if (datum > max) {\n max = datum;\n }\n });\n\n return [min, max];\n};\n","import { rowDiffsetIterator } from '../../operator/row-diffset-iterator';\nimport Dimension from '../dimension';\nimport { DateTimeFormatter } from '../../utils';\nimport InvalidAwareTypes from '../../invalid-aware-types';\nimport TemporalParser from '../parsers/temporal-parser';\nimport { calculateContinuousDomain } from '../helper';\n\n/**\n * Represents temporal field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Temporal extends Dimension {\n /**\n * Initialize a new instance.\n *\n * @public\n * @param {PartialField} partialField - The partialField instance which holds the whole data.\n * @param {string} rowDiffset - The data subset definition.\n */\n constructor (partialField, rowDiffset) {\n super(partialField, rowDiffset);\n\n this._cachedMinDiff = null;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the unique values.\n */\n calculateDataDomain () {\n return calculateContinuousDomain(this.partialField.data, this.rowDiffset);\n }\n\n\n /**\n * Calculates the minimum consecutive difference from the associated field data.\n *\n * @public\n * @return {number} Returns the minimum consecutive diff in milliseconds.\n */\n minimumConsecutiveDifference () {\n if (this._cachedMinDiff) {\n return this._cachedMinDiff;\n }\n\n const sortedData = this.data().filter(item => !(item instanceof InvalidAwareTypes)).sort((a, b) => a - b);\n const arrLn = sortedData.length;\n let minDiff = Number.POSITIVE_INFINITY;\n let prevDatum;\n let nextDatum;\n let processedCount = 0;\n\n for (let i = 1; i < arrLn; i++) {\n prevDatum = sortedData[i - 1];\n nextDatum = sortedData[i];\n\n if (nextDatum === prevDatum) {\n continue;\n }\n\n minDiff = Math.min(minDiff, nextDatum - sortedData[i - 1]);\n processedCount++;\n }\n\n if (!processedCount) {\n minDiff = null;\n }\n this._cachedMinDiff = minDiff;\n\n return this._cachedMinDiff;\n }\n\n /**\n * Returns the format specified in the input schema while creating field.\n *\n * @public\n * @return {string} Returns the datetime format.\n */\n format () {\n return this.partialField.schema.format;\n }\n\n /**\n * Returns the formatted version of the underlying field data\n * If data is of type invalid or has missing format use the raw value\n * @public\n * @override\n * @return {Array} Returns the formatted data.\n */\n formattedData () {\n const data = [];\n const dataFormat = this.format();\n\n rowDiffsetIterator(this.rowDiffset, (i) => {\n const datum = this.partialField.data[i];\n // If value is of invalid type or format is missing\n if (InvalidAwareTypes.isInvalid(datum) || (!dataFormat && Number.isFinite(datum))) {\n // Use the invalid map value or the raw value\n const parsedDatum = InvalidAwareTypes.getInvalidType(datum) || datum;\n data.push(parsedDatum);\n } else {\n data.push(DateTimeFormatter.formatAs(datum, dataFormat));\n }\n });\n return data;\n }\n\n static parser() {\n return new TemporalParser();\n }\n}\n\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the binned values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class BinnedParser extends FieldParser {\n /**\n * Parses a single binned value of a field and returns the sanitized value.\n *\n * @public\n * @param {string} val - The value of the field.\n * @return {string} Returns the sanitized value.\n */\n parse (val) {\n const regex = /^\\s*([+-]?\\d+(?:\\.\\d+)?)\\s*-\\s*([+-]?\\d+(?:\\.\\d+)?)\\s*$/;\n val = String(val);\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n let matched = val.match(regex);\n result = matched ? `${Number.parseFloat(matched[1])}-${Number.parseFloat(matched[2])}`\n : InvalidAwareTypes.NA;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import Dimension from '../dimension';\nimport BinnedParser from '../parsers/binned-parser';\n\n/**\n * Represents binned field subtype.\n *\n * @public\n * @class\n * @extends Dimension\n */\nexport default class Binned extends Dimension {\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the last and first values of bins config array.\n */\n calculateDataDomain () {\n const binsArr = this.partialField.schema.bins;\n return [binsArr[0], binsArr[binsArr.length - 1]];\n }\n\n /**\n * Returns the bins config provided while creating the field instance.\n *\n * @public\n * @return {Array} Returns the bins array config.\n */\n bins () {\n return this.partialField.schema.bins;\n }\n\n static parser() {\n return new BinnedParser();\n }\n}\n","import FieldParser from '../field-parser';\nimport InvalidAwareTypes from '../../../invalid-aware-types';\n\n/**\n * A FieldParser which parses the continuous values.\n *\n * @public\n * @class\n * @implements {FieldParser}\n */\nexport default class ContinuousParser extends FieldParser {\n /**\n * Parses a single value of a field and returns the number form.\n *\n * @public\n * @param {string|number} val - The value of the field.\n * @return {string} Returns the number value.\n */\n parse (val) {\n let result;\n // check if invalid date value\n if (!InvalidAwareTypes.isInvalid(val)) {\n let parsedVal = parseFloat(val, 10);\n result = Number.isNaN(parsedVal) ? InvalidAwareTypes.NA : parsedVal;\n } else {\n result = InvalidAwareTypes.getInvalidType(val);\n }\n return result;\n }\n}\n","import { MeasureSubtype } from '../../enums';\nimport Measure from '../measure';\nimport ContinuousParser from '../parsers/continuous-parser';\nimport { calculateContinuousDomain } from '../helper';\n\n/**\n * Represents continuous field subtype.\n *\n * @public\n * @class\n * @extends Measure\n */\nexport default class Continuous extends Measure {\n /**\n * Returns the subtype of the field.\n *\n * @public\n * @override\n * @return {string} Returns the subtype of the field.\n */\n subtype () {\n return MeasureSubtype.CONTINUOUS;\n }\n\n /**\n * Calculates the corresponding field domain.\n *\n * @public\n * @override\n * @return {Array} Returns the min and max values.\n */\n calculateDataDomain () {\n return calculateContinuousDomain(this.partialField.data, this.rowDiffset);\n }\n\n static parser() {\n return new ContinuousParser();\n }\n}\n","import Categorical from './categorical';\nimport Temporal from './temporal';\nimport Binned from './binned';\nimport Continuous from './continuous';\nimport { DimensionSubtype, MeasureSubtype } from '../enums';\n\n\nclass FieldTypeRegistry {\n constructor() {\n this._fieldType = new Map();\n }\n\n registerFieldType(subtype, dimension) {\n this._fieldType.set(subtype, dimension);\n return this;\n }\n\n has(type) {\n return this._fieldType.has(type);\n }\n\n get(type) {\n return this._fieldType.get(type);\n }\n}\n\nconst registerDefaultFields = (store) => {\n store\n .registerFieldType(DimensionSubtype.CATEGORICAL, Categorical)\n .registerFieldType(DimensionSubtype.TEMPORAL, Temporal)\n .registerFieldType(DimensionSubtype.BINNED, Binned)\n .registerFieldType(MeasureSubtype.CONTINUOUS, Continuous);\n};\n\nconst fieldRegistry = (function () {\n let store = null;\n function getStore () {\n store = new FieldTypeRegistry();\n registerDefaultFields(store);\n return store;\n }\n return store || getStore();\n}());\n\nexport default fieldRegistry;\n\n","import { FieldType, DimensionSubtype, MeasureSubtype } from './enums';\nimport { fieldRegistry } from './fields';\n\n/**\n * Creates a field instance according to the provided data and schema.\n *\n * @param {Array} data - The field data array.\n * @param {Object} schema - The field schema object.\n * @return {Field} Returns the newly created field instance.\n */\nfunction createUnitField(data, schema) {\n data = data || [];\n\n if (fieldRegistry.has(schema.subtype)) {\n return fieldRegistry.get(schema.subtype)\n .BUILDER\n .fieldName(schema.name)\n .schema(schema)\n .data(data)\n .rowDiffset(`0-${data.length - 1}`)\n .build();\n }\n return fieldRegistry\n .get(schema.type === FieldType.MEASURE ? MeasureSubtype.CONTINUOUS : DimensionSubtype.CATEGORICAL)\n .BUILDER\n .fieldName(schema.name)\n .schema(schema)\n .data(data)\n .rowDiffset(`0-${data.length - 1}`)\n .build();\n}\n\n\n/**\n * Creates a field instance from partialField and rowDiffset.\n *\n * @param {PartialField} partialField - The corresponding partial field.\n * @param {string} rowDiffset - The data subset config.\n * @return {Field} Returns the newly created field instance.\n */\nexport function createUnitFieldFromPartial(partialField, rowDiffset) {\n const { schema } = partialField;\n\n if (fieldRegistry.has(schema.subtype)) {\n return fieldRegistry.get(schema.subtype)\n .BUILDER\n .partialField(partialField)\n .rowDiffset(rowDiffset)\n .build();\n }\n return fieldRegistry\n .get(schema.type === FieldType.MEASURE ? MeasureSubtype.CONTINUOUS : DimensionSubtype.CATEGORICAL)\n .BUILDER\n .partialField(partialField)\n .rowDiffset(rowDiffset)\n .build();\n}\n\n/**\n * Creates the field instances with input data and schema.\n *\n * @param {Array} dataColumn - The data array for fields.\n * @param {Array} schema - The schema array for fields.\n * @param {Array} headers - The array of header names.\n * @return {Array.} Returns an array of newly created field instances.\n */\nexport function createFields(dataColumn, schema, headers) {\n const headersObj = {};\n\n if (!(headers && headers.length)) {\n headers = schema.map(item => item.name);\n }\n\n headers.forEach((header, i) => {\n headersObj[header] = i;\n });\n\n return schema.map(item => createUnitField(dataColumn[headersObj[item.name]], item));\n}\n","import { DataFormat } from './enums';\n\nexport default {\n dataFormat: DataFormat.AUTO\n};\n","/**\n * Interface for all data converters\n */\nexport default class DataConverter {\n constructor(type) {\n this._type = type;\n }\n\n get type() {\n return this._type;\n }\n\n convert() {\n throw new Error('Convert method not implemented.');\n }\n\n}\n","var EOL = {},\n EOF = {},\n QUOTE = 34,\n NEWLINE = 10,\n RETURN = 13;\n\nfunction objectConverter(columns) {\n return new Function(\"d\", \"return {\" + columns.map(function(name, i) {\n return JSON.stringify(name) + \": d[\" + i + \"] || \\\"\\\"\";\n }).join(\",\") + \"}\");\n}\n\nfunction customConverter(columns, f) {\n var object = objectConverter(columns);\n return function(row, i) {\n return f(object(row), i, columns);\n };\n}\n\n// Compute unique columns in order of discovery.\nfunction inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}\n\nfunction pad(value, width) {\n var s = value + \"\", length = s.length;\n return length < width ? new Array(width - length + 1).join(0) + s : s;\n}\n\nfunction formatYear(year) {\n return year < 0 ? \"-\" + pad(-year, 6)\n : year > 9999 ? \"+\" + pad(year, 6)\n : pad(year, 4);\n}\n\nfunction formatDate(date) {\n var hours = date.getUTCHours(),\n minutes = date.getUTCMinutes(),\n seconds = date.getUTCSeconds(),\n milliseconds = date.getUTCMilliseconds();\n return isNaN(date) ? \"Invalid Date\"\n : formatYear(date.getUTCFullYear(), 4) + \"-\" + pad(date.getUTCMonth() + 1, 2) + \"-\" + pad(date.getUTCDate(), 2)\n + (milliseconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \".\" + pad(milliseconds, 3) + \"Z\"\n : seconds ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \":\" + pad(seconds, 2) + \"Z\"\n : minutes || hours ? \"T\" + pad(hours, 2) + \":\" + pad(minutes, 2) + \"Z\"\n : \"\");\n}\n\nexport default function(delimiter) {\n var reFormat = new RegExp(\"[\\\"\" + delimiter + \"\\n\\r]\"),\n DELIMITER = delimiter.charCodeAt(0);\n\n function parse(text, f) {\n var convert, columns, rows = parseRows(text, function(row, i) {\n if (convert) return convert(row, i - 1);\n columns = row, convert = f ? customConverter(row, f) : objectConverter(row);\n });\n rows.columns = columns || [];\n return rows;\n }\n\n function parseRows(text, f) {\n var rows = [], // output rows\n N = text.length,\n I = 0, // current character index\n n = 0, // current line number\n t, // current token\n eof = N <= 0, // current token followed by EOF?\n eol = false; // current token followed by EOL?\n\n // Strip the trailing newline.\n if (text.charCodeAt(N - 1) === NEWLINE) --N;\n if (text.charCodeAt(N - 1) === RETURN) --N;\n\n function token() {\n if (eof) return EOF;\n if (eol) return eol = false, EOL;\n\n // Unescape quotes.\n var i, j = I, c;\n if (text.charCodeAt(j) === QUOTE) {\n while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);\n if ((i = I) >= N) eof = true;\n else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n return text.slice(j + 1, i - 1).replace(/\"\"/g, \"\\\"\");\n }\n\n // Find next delimiter or newline.\n while (I < N) {\n if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;\n else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }\n else if (c !== DELIMITER) continue;\n return text.slice(j, i);\n }\n\n // Return last token before EOF.\n return eof = true, text.slice(j, N);\n }\n\n while ((t = token()) !== EOF) {\n var row = [];\n while (t !== EOL && t !== EOF) row.push(t), t = token();\n if (f && (row = f(row, n++)) == null) continue;\n rows.push(row);\n }\n\n return rows;\n }\n\n function preformatBody(rows, columns) {\n return rows.map(function(row) {\n return columns.map(function(column) {\n return formatValue(row[column]);\n }).join(delimiter);\n });\n }\n\n function format(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join(\"\\n\");\n }\n\n function formatBody(rows, columns) {\n if (columns == null) columns = inferColumns(rows);\n return preformatBody(rows, columns).join(\"\\n\");\n }\n\n function formatRows(rows) {\n return rows.map(formatRow).join(\"\\n\");\n }\n\n function formatRow(row) {\n return row.map(formatValue).join(delimiter);\n }\n\n function formatValue(value) {\n return value == null ? \"\"\n : value instanceof Date ? formatDate(value)\n : reFormat.test(value += \"\") ? \"\\\"\" + value.replace(/\"/g, \"\\\"\\\"\") + \"\\\"\"\n : value;\n }\n\n return {\n parse: parse,\n parseRows: parseRows,\n format: format,\n formatBody: formatBody,\n formatRows: formatRows,\n formatRow: formatRow,\n formatValue: formatValue\n };\n}\n","import { columnMajor } from '../../utils';\n\n/**\n * Parses and converts data formatted in DSV array to a manageable internal format.\n *\n * @param {Array.} arr - A 2D array containing of the DSV data.\n * @param {Object} options - Option to control the behaviour of the parsing.\n * @param {boolean} [options.firstRowHeader=true] - Whether the first row of the dsv data is header or not.\n * @return {Array} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = [\n * [\"a\", \"b\", \"c\"],\n * [1, 2, 3],\n * [4, 5, 6],\n * [7, 8, 9]\n * ];\n */\nfunction DSVArr(arr, schema, options) {\n if (!Array.isArray(schema)) {\n throw new Error('Schema missing or is in an unsupported format');\n }\n const defaultOption = {\n firstRowHeader: true,\n };\n const schemaFields = schema.map(unitSchema => unitSchema.name);\n options = Object.assign({}, defaultOption, options);\n\n const columns = [];\n const push = columnMajor(columns);\n\n let headers = schemaFields;\n if (options.firstRowHeader) {\n // If header present then remove the first header row.\n // Do in-place mutation to save space.\n headers = arr.splice(0, 1)[0];\n }\n // create a map of the headers\n const headerMap = headers.reduce((acc, h, i) => (\n Object.assign(acc, { [h]: i })\n ), {});\n\n arr.forEach((fields) => {\n const field = [];\n schemaFields.forEach((schemaField) => {\n const headIndex = headerMap[schemaField];\n field.push(fields[headIndex]);\n });\n return push(...field);\n });\n return [schemaFields, columns];\n}\n\nexport default DSVArr;\n","import { dsvFormat as d3Dsv } from 'd3-dsv';\nimport DSVArr from './dsv-arr';\n\n/**\n * Parses and converts data formatted in DSV string to a manageable internal format.\n *\n * @todo Support to be given for https://tools.ietf.org/html/rfc4180.\n * @todo Sample implementation https://github.com/knrz/CSV.js/.\n *\n * @param {string} str - The input DSV string.\n * @param {Object} options - Option to control the behaviour of the parsing.\n * @param {boolean} [options.firstRowHeader=true] - Whether the first row of the dsv string data is header or not.\n * @param {string} [options.fieldSeparator=\",\"] - The separator of two consecutive field.\n * @return {Array} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = `\n * a,b,c\n * 1,2,3\n * 4,5,6\n * 7,8,9\n * `\n */\nfunction DSVStr (str, schema, options) {\n const defaultOption = {\n firstRowHeader: true,\n fieldSeparator: ','\n };\n options = Object.assign({}, defaultOption, options);\n\n const dsv = d3Dsv(options.fieldSeparator);\n return DSVArr(dsv.parseRows(str), schema, options);\n}\n\nexport default DSVStr;\n","import DataConverter from '../model/dataConverter';\nimport DSVStr from '../utils/dsv-str';\nimport DataFormat from '../../enums/data-format';\n\nexport default class DSVStringConverter extends DataConverter {\n constructor() {\n super(DataFormat.DSV_STR);\n }\n\n convert(data, schema, options) {\n return DSVStr(data, schema, options);\n }\n}\n","import { columnMajor } from '../../utils';\n\n/**\n * Parses and converts data formatted in JSON to a manageable internal format.\n *\n * @param {Array.} arr - The input data formatted in JSON.\n * @return {Array.} Returns an array of headers and column major data.\n * @example\n *\n * // Sample input data:\n * const data = [\n * {\n * \"a\": 1,\n * \"b\": 2,\n * \"c\": 3\n * },\n * {\n * \"a\": 4,\n * \"b\": 5,\n * \"c\": 6\n * },\n * {\n * \"a\": 7,\n * \"b\": 8,\n * \"c\": 9\n * }\n * ];\n */\nfunction FlatJSON (arr, schema) {\n if (!Array.isArray(schema)) {\n throw new Error('Schema missing or is in an unsupported format');\n }\n\n const header = {};\n let i = 0;\n let insertionIndex;\n const columns = [];\n const push = columnMajor(columns);\n const schemaFieldsName = schema.map(unitSchema => unitSchema.name);\n\n arr.forEach((item) => {\n const fields = [];\n schemaFieldsName.forEach((unitSchema) => {\n if (unitSchema in header) {\n insertionIndex = header[unitSchema];\n } else {\n header[unitSchema] = i++;\n insertionIndex = i - 1;\n }\n fields[insertionIndex] = item[unitSchema];\n });\n push(...fields);\n });\n\n return [Object.keys(header), columns];\n}\n\nexport default FlatJSON;\n","import DataConverter from '../model/dataConverter';\nimport FlatJSON from '../utils/flat-json';\nimport DataFormat from '../../enums/data-format';\n\nexport default class JSONConverter extends DataConverter {\n constructor() {\n super(DataFormat.FLAT_JSON);\n }\n\n convert(data, schema, options) {\n return FlatJSON(data, schema, options);\n }\n}\n","import DataConverter from '../model/dataConverter';\nimport DSVArr from '../utils/dsv-arr';\nimport DataFormat from '../../enums/data-format';\n\nexport default class DSVArrayConverter extends DataConverter {\n constructor() {\n super(DataFormat.DSV_ARR);\n }\n\n convert(data, schema, options) {\n return DSVArr(data, schema, options);\n }\n}\n","import DataConverter from '../model/dataConverter';\nimport AUTO from '../utils/auto-resolver';\nimport DataFormat from '../../enums/data-format';\n\nexport default class AutoDataConverter extends DataConverter {\n constructor() {\n super(DataFormat.AUTO);\n }\n\n convert(data, schema, options) {\n return AUTO(data, schema, options);\n }\n}\n","import FlatJSON from './flat-json';\nimport DSVArr from './dsv-arr';\nimport DSVStr from './dsv-str';\nimport { detectDataFormat } from '../../utils';\n\n/**\n * Parses the input data and detect the format automatically.\n *\n * @param {string|Array} data - The input data.\n * @param {Object} options - An optional config specific to data format.\n * @return {Array.} Returns an array of headers and column major data.\n */\nfunction Auto (data, schema, options) {\n const converters = { FlatJSON, DSVStr, DSVArr };\n const dataFormat = detectDataFormat(data);\n\n if (!dataFormat) {\n throw new Error('Couldn\\'t detect the data format');\n }\n\n return converters[dataFormat](data, schema, options);\n}\n\nexport default Auto;\n","import DataConverter from './model/dataConverter';\nimport { DSVStringConverter, DSVArrayConverter, JSONConverter, AutoDataConverter } from './defaultConverters';\n\nclass DataConverterStore {\n constructor() {\n this.store = new Map();\n this.converters(this._getDefaultConverters());\n }\n\n _getDefaultConverters() {\n return [\n new DSVStringConverter(),\n new DSVArrayConverter(),\n new JSONConverter(),\n new AutoDataConverter()\n ];\n }\n\n /**\n * Sets the given converters in the store and returns the store\n * @param {Array} converters : contains array of converter instance\n * @return { Map }\n */\n converters(converters = []) {\n converters.forEach(converter => this.store.set(converter.type, converter));\n return this.store;\n }\n\n /**\n * Registers a Converter of type DataConverter\n * @param {DataConverter} converter : converter Instance\n * @returns self\n */\n register(converter) {\n if (converter instanceof DataConverter) {\n this.store.set(converter.type, converter);\n return this;\n }\n return null;\n }\n\n /**\n * Rempves a converter from store\n * @param {DataConverter} converter : converter Instance\n * @returns self\n */\n\n unregister(converter) {\n this.store.delete(converter.type);\n return this;\n }\n\n get(name) {\n if (this.store.has(name)) {\n return this.store.get(name);\n }\n return null;\n }\n\n}\n\nconst converterStore = (function () {\n let store = null;\n\n function getStore () {\n store = new DataConverterStore();\n return store;\n }\n return store || getStore();\n}());\n\nexport default converterStore;\n","import { FieldType, FilteringMode, DimensionSubtype, MeasureSubtype, DataFormat } from './enums';\nimport fieldStore from './field-store';\nimport Value from './value';\nimport {\n rowDiffsetIterator\n} from './operator';\nimport { DM_DERIVATIVES, LOGICAL_OPERATORS, ROW_ID } from './constants';\nimport { createFields, createUnitFieldFromPartial } from './field-creator';\nimport defaultConfig from './default-config';\nimport { converterStore } from './converter';\nimport { fieldRegistry } from './fields';\nimport { extend2, detectDataFormat } from './utils';\n\n/**\n * Prepares the selection data.\n */\nfunction prepareSelectionData (fields, formattedData, rawData, i) {\n const resp = {};\n\n for (const [key, field] of fields.entries()) {\n resp[field.name()] = new Value(formattedData[key][i], rawData[key][i], field);\n }\n return resp;\n}\n\nexport function prepareJoinData (fields) {\n const resp = {};\n\n for (const key in fields) {\n resp[key] = new Value(fields[key].formattedValue, fields[key].rawValue, key);\n }\n return resp;\n}\n\nexport const updateFields = ([rowDiffset, colIdentifier], partialFieldspace, fieldStoreName) => {\n let collID = colIdentifier.length ? colIdentifier.split(',') : [];\n let partialFieldMap = partialFieldspace.fieldsObj();\n let newFields = collID.map(coll => createUnitFieldFromPartial(partialFieldMap[coll].partialField, rowDiffset));\n return fieldStore.createNamespace(newFields, fieldStoreName);\n};\n\nexport const persistCurrentDerivation = (model, operation, config = {}, criteriaFn) => {\n if (operation === DM_DERIVATIVES.COMPOSE) {\n model._derivation.length = 0;\n model._derivation.push(...criteriaFn);\n } else {\n model._derivation.push({\n op: operation,\n meta: config,\n criteria: criteriaFn\n });\n }\n};\nexport const persistAncestorDerivation = (sourceDm, newDm) => {\n newDm._ancestorDerivation.push(...sourceDm._ancestorDerivation, ...sourceDm._derivation);\n};\n\nexport const persistDerivations = (sourceDm, model, operation, config = {}, criteriaFn) => {\n persistCurrentDerivation(model, operation, config, criteriaFn);\n persistAncestorDerivation(sourceDm, model);\n};\n\nconst selectModeMap = {\n [FilteringMode.NORMAL]: {\n diffIndex: ['rowDiffset'],\n calcDiff: [true, false]\n },\n [FilteringMode.INVERSE]: {\n diffIndex: ['rejectRowDiffset'],\n calcDiff: [false, true]\n },\n [FilteringMode.ALL]: {\n diffIndex: ['rowDiffset', 'rejectRowDiffset'],\n calcDiff: [true, true]\n }\n};\n\nconst generateRowDiffset = (rowDiffset, i, lastInsertedValue) => {\n if (lastInsertedValue !== -1 && i === (lastInsertedValue + 1)) {\n const li = rowDiffset.length - 1;\n\n rowDiffset[li] = `${rowDiffset[li].split('-')[0]}-${i}`;\n } else {\n rowDiffset.push(`${i}`);\n }\n};\n\nexport const selectRowDiffsetIterator = (rowDiffset, checker, mode) => {\n let lastInsertedValueSel = -1;\n let lastInsertedValueRej = -1;\n const newRowDiffSet = [];\n const rejRowDiffSet = [];\n\n const [shouldSelect, shouldReject] = selectModeMap[mode].calcDiff;\n\n rowDiffsetIterator(rowDiffset, (i) => {\n const checkerResult = checker(i);\n checkerResult && shouldSelect && generateRowDiffset(newRowDiffSet, i, lastInsertedValueSel);\n !checkerResult && shouldReject && generateRowDiffset(rejRowDiffSet, i, lastInsertedValueRej);\n });\n return {\n rowDiffset: newRowDiffSet.join(','),\n rejectRowDiffset: rejRowDiffSet.join(',')\n };\n};\n\n\nexport const rowSplitDiffsetIterator = (rowDiffset, checker, mode, dimensionArr, fieldStoreObj) => {\n let lastInsertedValue = {};\n const splitRowDiffset = {};\n const dimensionMap = {};\n\n rowDiffsetIterator(rowDiffset, (i) => {\n if (checker(i)) {\n let hash = '';\n\n let dimensionSet = { keys: {} };\n\n dimensionArr.forEach((_) => {\n const data = fieldStoreObj[_].partialField.data[i];\n hash = `${hash}-${data}`;\n dimensionSet.keys[_] = data;\n });\n\n if (splitRowDiffset[hash] === undefined) {\n splitRowDiffset[hash] = [];\n lastInsertedValue[hash] = -1;\n dimensionMap[hash] = dimensionSet;\n }\n\n generateRowDiffset(splitRowDiffset[hash], i, lastInsertedValue[hash]);\n lastInsertedValue[hash] = i;\n }\n });\n\n return {\n splitRowDiffset,\n dimensionMap\n };\n};\n\n\nexport const selectHelper = (clonedDm, selectFn, config, sourceDm, iterator) => {\n let cachedStore = {};\n let cloneProvider = () => sourceDm.detachedRoot();\n const { mode } = config;\n const rowDiffset = clonedDm._rowDiffset;\n const cachedValueObjects = clonedDm._partialFieldspace._cachedValueObjects;\n\n const selectorHelperFn = index => selectFn(\n cachedValueObjects[index],\n index,\n cloneProvider,\n cachedStore\n );\n\n return iterator(rowDiffset, selectorHelperFn, mode);\n};\n\nexport const cloneWithAllFields = (model) => {\n const clonedDm = model.clone(false);\n const partialFieldspace = model.getPartialFieldspace();\n clonedDm._colIdentifier = partialFieldspace.fields.map(f => f.name()).join(',');\n\n // flush out cached namespace values on addition of new fields\n partialFieldspace._cachedFieldsObj = null;\n partialFieldspace._cachedDimension = null;\n partialFieldspace._cachedMeasure = null;\n clonedDm.__calculateFieldspace().calculateFieldsConfig();\n\n return clonedDm;\n};\n\nconst getKey = (arr, data, fn, rowId) => {\n let key = fn(arr, data, 0, rowId);\n\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${fn(arr, data, i, rowId)}`;\n }\n return key;\n};\n\nconst keyFn = (arr, fields, idx, rowId) => {\n const field = arr[idx];\n const val = field === ROW_ID ? rowId : fields[field].internalValue;\n return val;\n};\n\nconst domainChecker = (val, domain) => {\n const domainArr = domain[0] instanceof Array ? domain : [domain];\n return domainArr.some(dom => val >= dom[0] && val <= dom[1]);\n};\n\nconst boundsChecker = {\n [MeasureSubtype.CONTINUOUS]: domainChecker,\n [DimensionSubtype.TEMPORAL]: domainChecker\n};\n\nconst isWithinDomain = (value, domain, fieldType) => boundsChecker[fieldType](value, domain);\n\nexport const filterPropagationModel = (model, propModels, config = {}) => {\n let fns = [];\n const operation = config.operation || LOGICAL_OPERATORS.AND;\n const { filterByDim = true, filterByMeasure = false, clone = true } = config;\n const clonedModel = clone ? cloneWithAllFields(model) : model;\n const modelFieldsConfig = clonedModel.getFieldsConfig();\n\n if (!propModels.length) {\n fns = [() => false];\n } else {\n fns = propModels.map(propModel => (({ criteria = {} }) => {\n const { identifiers = [[], []], range } = criteria;\n let [fieldNames = [], values = []] = identifiers;\n const indices = fieldNames.reduce((map, name, i) => {\n map[name] = i;\n return map;\n }, {});\n fieldNames = fieldNames.filter(field => (field in modelFieldsConfig &&\n modelFieldsConfig[field].def.type === FieldType.DIMENSION) || field === ROW_ID);\n const dLen = fieldNames.length;\n const valuesMap = {};\n\n if (dLen) {\n for (let i = 1, len = identifiers.length; i < len; i++) {\n const row = identifiers[i];\n const key = `${fieldNames.map((field) => {\n const idx = indices[field];\n return row[idx];\n })}`;\n valuesMap[key] = 1;\n }\n }\n let rangeKeys = Object.keys(range || {}).filter(field => field in modelFieldsConfig);\n const hasData = values.length || rangeKeys.length;\n\n if (!filterByMeasure) {\n rangeKeys = rangeKeys.filter(field => modelFieldsConfig[field].def.type !== FieldType.MEASURE);\n }\n\n if (!filterByDim) {\n rangeKeys = rangeKeys.filter(field => modelFieldsConfig[field].def.type !== FieldType.DIMENSION);\n }\n\n return hasData ? (fields, i) => {\n let present = true;\n if (filterByDim) {\n present = dLen ? valuesMap[getKey(fieldNames, fields, keyFn, i)] : true;\n }\n\n return rangeKeys.every((field) => {\n const val = fields[field].internalValue;\n return isWithinDomain(val, range[field], modelFieldsConfig[field].def.subtype);\n }) && present;\n } : () => false;\n })(propModel));\n }\n\n let filteredModel;\n if (operation === LOGICAL_OPERATORS.AND) {\n filteredModel = clonedModel.select((fields, i) => fns.every(fn => fn(fields, i)), {\n saveChild: false\n });\n } else {\n filteredModel = clonedModel.select((fields, i) => fns.some(fn => fn(fields, i)), {\n saveChild: false\n });\n }\n\n return filteredModel;\n};\n\n\nexport const splitWithSelect = (sourceDm, dimensionArr, reducerFn = val => val, config) => {\n const {\n saveChild,\n } = config;\n const fieldStoreObj = sourceDm.getFieldspace().fieldsObj();\n\n const {\n splitRowDiffset,\n dimensionMap\n } = selectHelper(\n sourceDm.clone(saveChild),\n reducerFn,\n config,\n sourceDm,\n (...params) => rowSplitDiffsetIterator(...params, dimensionArr, fieldStoreObj)\n );\n\n const clonedDMs = [];\n Object.keys(splitRowDiffset).sort().forEach((e) => {\n if (splitRowDiffset[e]) {\n const cloned = sourceDm.clone(saveChild);\n const derivation = dimensionMap[e];\n cloned._rowDiffset = splitRowDiffset[e].join(',');\n cloned.__calculateFieldspace().calculateFieldsConfig();\n\n const derivationFormula = fields => dimensionArr.every(_ => fields[_].internalValue === derivation.keys[_]);\n // Store reference to child model and selector function\n if (saveChild) {\n persistDerivations(sourceDm, cloned, DM_DERIVATIVES.SELECT, config, derivationFormula);\n }\n cloned._derivation[cloned._derivation.length - 1].meta = dimensionMap[e];\n\n clonedDMs.push(cloned);\n }\n });\n\n\n return clonedDMs;\n};\nexport const addDiffsetToClonedDm = (clonedDm, rowDiffset, sourceDm, selectConfig, selectFn) => {\n clonedDm._rowDiffset = rowDiffset;\n clonedDm.__calculateFieldspace().calculateFieldsConfig();\n persistDerivations(\n sourceDm,\n clonedDm,\n DM_DERIVATIVES.SELECT,\n { config: selectConfig },\n selectFn\n );\n};\n\n\nexport const cloneWithSelect = (sourceDm, selectFn, selectConfig, cloneConfig) => {\n let extraCloneDm = {};\n\n let { mode } = selectConfig;\n\n const cloned = sourceDm.clone(cloneConfig.saveChild);\n const setOfRowDiffsets = selectHelper(\n cloned,\n selectFn,\n selectConfig,\n sourceDm,\n selectRowDiffsetIterator\n );\n const diffIndex = selectModeMap[mode].diffIndex;\n\n addDiffsetToClonedDm(cloned, setOfRowDiffsets[diffIndex[0]], sourceDm, selectConfig, selectFn);\n\n if (diffIndex.length > 1) {\n extraCloneDm = sourceDm.clone(cloneConfig.saveChild);\n addDiffsetToClonedDm(extraCloneDm, setOfRowDiffsets[diffIndex[1]], sourceDm, selectConfig, selectFn);\n return [cloned, extraCloneDm];\n }\n\n return cloned;\n};\n\nexport const cloneWithProject = (sourceDm, projField, config, allFields) => {\n const cloned = sourceDm.clone(config.saveChild);\n let projectionSet = projField;\n if (config.mode === FilteringMode.INVERSE) {\n projectionSet = allFields.filter(fieldName => projField.indexOf(fieldName) === -1);\n }\n // cloned._colIdentifier = sourceDm._colIdentifier.split(',')\n // .filter(coll => projectionSet.indexOf(coll) !== -1).join();\n cloned._colIdentifier = projectionSet.join(',');\n cloned.__calculateFieldspace().calculateFieldsConfig();\n\n persistDerivations(\n sourceDm,\n cloned,\n DM_DERIVATIVES.PROJECT,\n { projField, config, actualProjField: projectionSet },\n null\n );\n\n return cloned;\n};\n\n\nexport const splitWithProject = (sourceDm, projFieldSet, config, allFields) =>\n projFieldSet.map(projFields =>\n cloneWithProject(sourceDm, projFields, config, allFields));\n\nexport const sanitizeUnitSchema = (unitSchema) => {\n // Do deep clone of the unit schema as the user might change it later.\n unitSchema = extend2({}, unitSchema);\n if (!unitSchema.type) {\n unitSchema.type = FieldType.DIMENSION;\n }\n\n if (!unitSchema.subtype) {\n switch (unitSchema.type) {\n case FieldType.MEASURE:\n unitSchema.subtype = MeasureSubtype.CONTINUOUS;\n break;\n default:\n case FieldType.DIMENSION:\n unitSchema.subtype = DimensionSubtype.CATEGORICAL;\n break;\n }\n }\n\n return unitSchema;\n};\n\nexport const validateUnitSchema = (unitSchema) => {\n const { type, subtype, name } = unitSchema;\n if (type === FieldType.DIMENSION || type === FieldType.MEASURE) {\n if (!fieldRegistry.has(subtype)) {\n throw new Error(`DataModel doesn't support measure field subtype ${subtype} used for ${name} field`);\n }\n } else {\n throw new Error(`DataModel doesn't support field type ${type} used for ${name} field`);\n }\n};\n\nexport const sanitizeAndValidateSchema = schema => schema.map((unitSchema) => {\n unitSchema = sanitizeUnitSchema(unitSchema);\n validateUnitSchema(unitSchema);\n return unitSchema;\n});\n\nexport const resolveFieldName = (schema, dataHeader) => {\n schema.forEach((unitSchema) => {\n const fieldNameAs = unitSchema.as;\n if (!fieldNameAs) { return; }\n\n const idx = dataHeader.indexOf(unitSchema.name);\n dataHeader[idx] = fieldNameAs;\n unitSchema.name = fieldNameAs;\n delete unitSchema.as;\n });\n};\n\nexport const updateData = (relation, data, schema, options) => {\n schema = sanitizeAndValidateSchema(schema);\n options = Object.assign(Object.assign({}, defaultConfig), options);\n const converter = converterStore.get(options.dataFormat);\n\n\n if (!converter) {\n throw new Error(`No converter function found for ${options.dataFormat} format`);\n }\n\n const [header, formattedData] = converter.convert(data, schema, options);\n resolveFieldName(schema, header);\n const fieldArr = createFields(formattedData, schema, header);\n\n // This will create a new fieldStore with the fields\n const nameSpace = fieldStore.createNamespace(fieldArr, options.name);\n relation._partialFieldspace = nameSpace;\n\n // If data is provided create the default colIdentifier and rowDiffset\n relation._rowDiffset = formattedData.length && formattedData[0].length ? `0-${formattedData[0].length - 1}` : '';\n\n // This stores the value objects which is passed to the filter method when selection operation is done.\n const valueObjects = [];\n const { fields } = nameSpace;\n const rawFieldsData = fields.map(field => field.data());\n const formattedFieldsData = fields.map(field => field.formattedData());\n rowDiffsetIterator(relation._rowDiffset, (i) => {\n valueObjects[i] = prepareSelectionData(fields, formattedFieldsData, rawFieldsData, i);\n });\n nameSpace._cachedValueObjects = valueObjects;\n\n relation._colIdentifier = (schema.map(_ => _.name)).join();\n relation._dataFormat = options.dataFormat === DataFormat.AUTO ? detectDataFormat(data) : options.dataFormat;\n return relation;\n};\n\nexport const fieldInSchema = (schema, field) => {\n let i = 0;\n\n for (; i < schema.length; ++i) {\n if (field === schema[i].name) {\n return {\n name: field,\n type: schema[i].subtype || schema[i].type,\n index: i,\n };\n }\n }\n return null;\n};\n\nexport const getDerivationArguments = (derivation) => {\n let params = [];\n let operation;\n operation = derivation.op;\n switch (operation) {\n case DM_DERIVATIVES.SELECT:\n params = [derivation.criteria];\n break;\n case DM_DERIVATIVES.PROJECT:\n params = [derivation.meta.actualProjField];\n break;\n case DM_DERIVATIVES.SORT:\n params = [derivation.criteria];\n break;\n case DM_DERIVATIVES.GROUPBY:\n operation = 'groupBy';\n params = [derivation.meta.groupByString.split(','), derivation.criteria];\n break;\n default:\n operation = null;\n }\n\n return {\n operation,\n params\n };\n};\n\nconst applyExistingOperationOnModel = (propModel, dataModel) => {\n const derivations = dataModel.getDerivations();\n let selectionModel = propModel;\n\n derivations.forEach((derivation) => {\n if (!derivation) {\n return;\n }\n\n const { operation, params } = getDerivationArguments(derivation);\n if (operation) {\n selectionModel = selectionModel[operation](...params, {\n saveChild: false\n });\n }\n });\n\n return selectionModel;\n};\n\nconst getFilteredModel = (propModel, path) => {\n for (let i = 0, len = path.length; i < len; i++) {\n const model = path[i];\n propModel = applyExistingOperationOnModel(propModel, model);\n }\n return propModel;\n};\n\nconst propagateIdentifiers = (dataModel, propModel, config = {}, propModelInf = {}) => {\n const excludeModels = propModelInf.excludeModels || [];\n const criterias = propModelInf.criteria;\n\n const propagate = excludeModels.length ? excludeModels.indexOf(dataModel) === -1 : true;\n\n propagate && dataModel.handlePropagation(propModel, config);\n\n const children = dataModel._children;\n children.forEach((child) => {\n const matchingCriteria = criterias.filter(val => val.groupedModel === child);\n let selectionModel = applyExistingOperationOnModel(propModel, child);\n\n if (matchingCriteria.length) {\n selectionModel = filterPropagationModel(selectionModel, matchingCriteria, {\n filterByDim: false,\n filterByMeasure: true,\n clone: false\n });\n }\n propagateIdentifiers(child, selectionModel, config, propModelInf);\n });\n};\n\nexport const getRootGroupByModel = (model) => {\n while (model._parent && model._derivation.find(d => d.op !== DM_DERIVATIVES.GROUPBY)) {\n model = model._parent;\n }\n return model;\n};\n\nexport const getRootDataModel = (model) => {\n while (model._parent) {\n model = model._parent;\n }\n return model;\n};\n\nexport const getPathToRootModel = (model, path = []) => {\n while (model._parent) {\n path.push(model);\n model = model._parent;\n }\n return path;\n};\n\nexport const propagateToAllDataModels = (identifiers, rootModels, propagationInf, config) => {\n let criteria;\n const { propagationNameSpace, propagateToSource } = propagationInf;\n const propagationSourceId = propagationInf.sourceId;\n const filterFn = (entry) => {\n const filter = config.filterFn || (() => true);\n return filter(entry, config);\n };\n\n const addGroupedModel = ({ config: conf, model }) => {\n const { criteria: crit } = conf;\n let groupedModel;\n\n if (crit !== null && crit.fields.some(d => d.type === FieldType.MEASURE)) {\n groupedModel = getRootGroupByModel(model);\n }\n return Object.assign({}, conf, {\n groupedModel\n });\n };\n\n let criterias = [];\n\n if (identifiers === null) {\n criterias = [{\n criteria: []\n }];\n criteria = [];\n } else {\n let actionCriterias = Object.values(propagationNameSpace.mutableActions);\n if (propagateToSource !== false) {\n actionCriterias = actionCriterias.filter(d => d.config.sourceId !== propagationSourceId);\n }\n\n const filteredCriteria = actionCriterias.filter(filterFn);\n\n const excludeModels = [];\n\n if (propagateToSource !== false) {\n const sourceActionCriterias = Object.values(propagationNameSpace.mutableActions);\n\n sourceActionCriterias.forEach((actionInf) => {\n const actionConf = actionInf.config;\n if (actionConf.applyOnSource === false && actionConf.action === config.action &&\n actionConf.sourceId !== propagationSourceId) {\n excludeModels.push(actionInf.model);\n criteria = sourceActionCriterias.filter(d => d !== actionInf).map(addGroupedModel);\n criteria.length && criterias.push({\n criteria,\n models: actionInf.model,\n path: getPathToRootModel(actionInf.model)\n });\n }\n });\n }\n\n\n criteria = [].concat(...[...filteredCriteria.map(addGroupedModel), {\n criteria: identifiers,\n groupedModel: identifiers !== null && identifiers.fields.some(d => d.type === FieldType.MEASURE) ?\n getRootGroupByModel(propagationInf.propagationSource) : null\n }]).filter(d => d !== null);\n criterias.push({\n criteria,\n excludeModels: [...excludeModels, ...config.excludeModels || []]\n });\n }\n\n const rootModel = rootModels.model;\n\n const propConfig = Object.assign({\n sourceIdentifiers: identifiers,\n propagationSourceId\n }, config);\n\n criterias.forEach((inf) => {\n const { criteria: crit } = inf;\n const propagationModel = filterPropagationModel(rootModel, crit, {\n filterByMeasure: !!crit.find(d => d.groupedModel === rootModel)\n });\n const path = inf.path;\n\n if (path) {\n const filteredModel = getFilteredModel(propagationModel, path.reverse());\n inf.models.handlePropagation(filteredModel, propConfig);\n } else {\n propagateIdentifiers(rootModel, propagationModel, propConfig, {\n excludeModels: inf.excludeModels,\n criteria: crit\n });\n }\n });\n};\n\nexport const propagateImmutableActions = (propagationNameSpace, rootModel, propagationInf) => {\n const immutableActions = propagationNameSpace.immutableActions;\n\n for (const action in immutableActions) {\n const actionInf = immutableActions[action];\n const actionConf = actionInf.config;\n const propagationSourceId = propagationInf.config.sourceId;\n const filterImmutableAction = propagationInf.propConfig.filterImmutableAction ?\n propagationInf.propConfig.filterImmutableAction(actionConf, propagationInf.config) : true;\n if (actionConf.sourceId !== propagationSourceId && filterImmutableAction) {\n const criteriaModel = actionConf.criteria;\n propagateToAllDataModels(criteriaModel, {\n model: rootModel,\n groupByModel: getRootGroupByModel(actionInf.model)\n }, {\n propagationNameSpace,\n propagateToSource: false,\n sourceId: propagationSourceId,\n propagationSource: actionInf.model\n }, actionConf);\n }\n }\n};\n\nexport const addToPropNamespace = (propagationNameSpace, config = {}, model) => {\n let sourceNamespace;\n const isMutableAction = config.isMutableAction;\n const criteria = config.criteria;\n const key = `${config.action}-${config.sourceId}`;\n\n if (isMutableAction) {\n sourceNamespace = propagationNameSpace.mutableActions;\n } else {\n sourceNamespace = propagationNameSpace.immutableActions;\n }\n\n if (criteria === null) {\n delete sourceNamespace[key];\n } else {\n sourceNamespace[key] = {\n model,\n config\n };\n }\n\n return this;\n};\n\n\nexport const getNormalizedProFields = (projField, allFields, fieldConfig) => {\n const normalizedProjField = projField.reduce((acc, field) => {\n if (field.constructor.name === 'RegExp') {\n acc.push(...allFields.filter(fieldName => fieldName.search(field) !== -1));\n } else if (field in fieldConfig) {\n acc.push(field);\n }\n return acc;\n }, []);\n return Array.from(new Set(normalizedProjField)).map(field => field.trim());\n};\n\n/**\n * Get the numberFormatted value if numberFormat present,\n * else returns the supplied value.\n * @param {Object} field Field Instance\n * @param {Number|String} value\n * @return {Number|String}\n */\nexport const getNumberFormattedVal = (field, value) => {\n if (field.numberFormat) {\n return field.numberFormat()(value);\n }\n return value;\n};\n","import { FilteringMode } from './enums';\nimport { getUniqueId } from './utils';\nimport {\n updateFields,\n cloneWithSelect,\n cloneWithProject,\n updateData,\n getNormalizedProFields\n} from './helper';\nimport { crossProduct, difference, naturalJoinFilter, union } from './operator';\n\n/**\n * Relation provides the definitions of basic operators of relational algebra like *selection*, *projection*, *union*,\n * *difference* etc.\n *\n * It is extended by {@link DataModel} to inherit the functionalities of relational algebra concept.\n *\n * @class\n * @public\n * @module Relation\n * @namespace DataModel\n */\nclass Relation {\n\n /**\n * Creates a new Relation instance by providing underlying data and schema.\n *\n * @private\n *\n * @param {Object | string | Relation} data - The input tabular data in dsv or json format or\n * an existing Relation instance object.\n * @param {Array} schema - An array of data schema.\n * @param {Object} [options] - The optional options.\n */\n constructor (...params) {\n let source;\n\n this._parent = null;\n this._derivation = [];\n this._ancestorDerivation = [];\n this._children = [];\n\n if (params.length === 1 && ((source = params[0]) instanceof Relation)) {\n // parent datamodel was passed as part of source\n this._colIdentifier = source._colIdentifier;\n this._rowDiffset = source._rowDiffset;\n this._dataFormat = source._dataFormat;\n this._parent = source;\n this._partialFieldspace = this._parent._partialFieldspace;\n this._fieldStoreName = getUniqueId();\n this.__calculateFieldspace().calculateFieldsConfig();\n } else {\n updateData(this, ...params);\n this._fieldStoreName = this._partialFieldspace.name;\n this.__calculateFieldspace().calculateFieldsConfig();\n this._propagationNameSpace = {\n mutableActions: {},\n immutableActions: {}\n };\n }\n }\n\n /**\n * Retrieves the {@link Schema | schema} details for every {@link Field | field} as an array.\n *\n * @public\n *\n * @return {Array.} Array of fields schema.\n * ```\n * [\n * { name: 'Name', type: 'dimension' },\n * { name: 'Miles_per_Gallon', type: 'measure', numberFormat: (val) => `${val} miles / gallon` },\n * { name: 'Cylinder', type: 'dimension' },\n * { name: 'Displacement', type: 'measure', defAggFn: 'max' },\n * { name: 'HorsePower', type: 'measure', defAggFn: 'max' },\n * { name: 'Weight_in_lbs', type: 'measure', defAggFn: 'avg', },\n * { name: 'Acceleration', type: 'measure', defAggFn: 'avg' },\n * { name: 'Year', type: 'dimension', subtype: 'datetime', format: '%Y' },\n * { name: 'Origin' }\n * ]\n * ```\n */\n getSchema () {\n return this.getFieldspace().fields.map(d => d.schema());\n }\n\n /**\n * Returns the name of the {@link DataModel} instance. If no name was specified during {@link DataModel}\n * initialization, then it returns a auto-generated name.\n *\n * @public\n *\n * @return {string} Name of the DataModel instance.\n */\n getName() {\n return this._fieldStoreName;\n }\n\n getFieldspace () {\n return this._fieldspace;\n }\n\n __calculateFieldspace () {\n this._fieldspace = updateFields([this._rowDiffset, this._colIdentifier],\n this.getPartialFieldspace(), this._fieldStoreName);\n return this;\n }\n\n getPartialFieldspace () {\n return this._partialFieldspace;\n }\n\n /**\n * Performs {@link link_of_cross_product | cross-product} between two {@link DataModel} instances and returns a\n * new {@link DataModel} instance containing the results. This operation is also called theta join.\n *\n * Cross product takes two set and create one set where each value of one set is paired with each value of another\n * set.\n *\n * This method takes an optional predicate which filters the generated result rows. If the predicate returns true\n * the combined row is included in the resulatant table.\n *\n * @example\n * let originDM = dm.project(['Origin','Origin_Formal_Name']);\n * let carsDM = dm.project(['Name','Miles_per_Gallon','Origin'])\n *\n * console.log(carsDM.join(originDM)));\n *\n * console.log(carsDM.join(originDM,\n * obj => obj.[originDM.getName()].Origin === obj.[carsDM.getName()].Origin));\n *\n * @text\n * This is chained version of `join` operator. `join` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} joinWith - The DataModel to be joined with the current instance DataModel.\n * @param {SelectionPredicate} filterFn - The predicate function that will filter the result of the crossProduct.\n *\n * @return {DataModel} New DataModel instance created after joining.\n */\n join (joinWith, filterFn) {\n return crossProduct(this, joinWith, filterFn);\n }\n\n /**\n * {@link natural_join | Natural join} is a special kind of cross-product join where filtering of rows are performed\n * internally by resolving common fields are from both table and the rows with common value are included.\n *\n * @example\n * let originDM = dm.project(['Origin','Origin_Formal_Name']);\n * let carsDM = dm.project(['Name','Miles_per_Gallon','Origin'])\n *\n * console.log(carsDM.naturalJoin(originDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} joinWith - The DataModel with which the current instance of DataModel on which the method is\n * called will be joined.\n * @return {DataModel} New DataModel instance created after joining.\n */\n naturalJoin (joinWith) {\n return crossProduct(this, joinWith, naturalJoinFilter(this, joinWith), true);\n }\n\n /**\n * {@link link_to_union | Union} operation can be termed as vertical stacking of all rows from both the DataModel\n * instances, provided that both of the {@link DataModel} instances should have same column names.\n *\n * @example\n * console.log(EuropeanMakerDM.union(USAMakerDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} unionWith - DataModel instance for which union has to be applied with the instance on which\n * the method is called\n *\n * @return {DataModel} New DataModel instance with the result of the operation\n */\n union (unionWith) {\n return union(this, unionWith);\n }\n\n /**\n * {@link link_to_difference | Difference } operation only include rows which are present in the datamodel on which\n * it was called but not on the one passed as argument.\n *\n * @example\n * console.log(highPowerDM.difference(highExpensiveDM));\n *\n * @text\n * This is chained version of `naturalJoin` operator. `naturalJoin` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {DataModel} differenceWith - DataModel instance for which difference has to be applied with the instance\n * on which the method is called\n * @return {DataModel} New DataModel instance with the result of the operation\n */\n difference (differenceWith) {\n return difference(this, differenceWith);\n }\n\n /**\n * {@link link_to_selection | Selection} is a row filtering operation. It expects a predicate and an optional mode\n * which control which all rows should be included in the resultant DataModel instance.\n *\n * {@link SelectionPredicate} is a function which returns a boolean value. For selection operation the selection\n * function is called for each row of DataModel instance with the current row passed as argument.\n *\n * After executing {@link SelectionPredicate} the rows are labeled as either an entry of selection set or an entry\n * of rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resultant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @example\n * // with selection mode NORMAL:\n * const normDt = dt.select(fields => fields.Origin.value === \"USA\")\n * console.log(normDt));\n *\n * // with selection mode INVERSE:\n * const inverDt = dt.select(fields => fields.Origin.value === \"USA\", { mode: DataModel.FilteringMode.INVERSE })\n * console.log(inverDt);\n *\n * // with selection mode ALL:\n * const dtArr = dt.select(fields => fields.Origin.value === \"USA\", { mode: DataModel.FilteringMode.ALL })\n * // print the selected parts\n * console.log(dtArr[0]);\n * // print the inverted parts\n * console.log(dtArr[1]);\n *\n * @text\n * This is chained version of `select` operator. `select` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {Function} selectFn - The predicate function which is called for each row with the current row.\n * ```\n * function (row, i, cloneProvider, store) { ... }\n * ```\n * @param {Object} config - The configuration object to control the inclusion exclusion of a row in resultant\n * DataModel instance.\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - The mode of the selection.\n * @return {DataModel} Returns the new DataModel instance(s) after operation.\n */\n select (selectFn, config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n config = Object.assign({}, defConfig, config);\n config.mode = config.mode || defConfig.mode;\n\n const cloneConfig = { saveChild: config.saveChild };\n return cloneWithSelect(\n this,\n selectFn,\n config,\n cloneConfig\n );\n }\n\n /**\n * Retrieves a boolean value if the current {@link DataModel} instance has data.\n *\n * @example\n * const schema = [\n * { name: 'CarName', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n * const data = [];\n *\n * const dt = new DataModel(data, schema);\n * console.log(dt.isEmpty());\n *\n * @public\n *\n * @return {Boolean} True if the datamodel has no data, otherwise false.\n */\n isEmpty () {\n return !this._rowDiffset.length || !this._colIdentifier.length;\n }\n\n /**\n * Creates a clone from the current DataModel instance with child parent relationship.\n *\n * @private\n * @param {boolean} [saveChild=true] - Whether the cloned instance would be recorded in the parent instance.\n * @return {DataModel} - Returns the newly cloned DataModel instance.\n */\n clone (saveChild = true) {\n const clonedDm = new this.constructor(this);\n if (saveChild) {\n clonedDm.setParent(this);\n } else {\n clonedDm.setParent(null);\n }\n return clonedDm;\n }\n\n /**\n * {@link Projection} is filter column (field) operation. It expects list of fields' name and either include those\n * or exclude those based on {@link FilteringMode} on the resultant variable.\n *\n * Projection expects array of fields name based on which it creates the selection and rejection set. All the field\n * whose name is present in array goes in selection set and rest of the fields goes in rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @example\n * const dm = new DataModel(data, schema);\n *\n * // with projection mode NORMAL:\n * const normDt = dt.project([\"Name\", \"HorsePower\"]);\n * console.log(normDt.getData());\n *\n * // with projection mode INVERSE:\n * const inverDt = dt.project([\"Name\", \"HorsePower\"], { mode: DataModel.FilteringMode.INVERSE })\n * console.log(inverDt.getData());\n *\n * // with selection mode ALL:\n * const dtArr = dt.project([\"Name\", \"HorsePower\"], { mode: DataModel.FilteringMode.ALL })\n * // print the normal parts\n * console.log(dtArr[0].getData());\n * // print the inverted parts\n * console.log(dtArr[1].getData());\n *\n * @text\n * This is chained version of `select` operator. `select` can also be used as\n * {@link link_to_join_op | functional operator}.\n *\n * @public\n *\n * @param {Array.} projField - An array of column names in string or regular expression.\n * @param {Object} [config] - An optional config to control the creation of new DataModel\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - Mode of the projection\n *\n * @return {DataModel} Returns the new DataModel instance after operation.\n */\n project (projField, config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n config = Object.assign({}, defConfig, config);\n const fieldConfig = this.getFieldsConfig();\n const allFields = Object.keys(fieldConfig);\n const { mode } = config;\n const normalizedProjField = getNormalizedProFields(projField, allFields, fieldConfig);\n\n let dataModel;\n\n if (mode === FilteringMode.ALL) {\n let projectionClone = cloneWithProject(this, normalizedProjField, {\n mode: FilteringMode.NORMAL,\n saveChild: config.saveChild\n }, allFields);\n let rejectionClone = cloneWithProject(this, normalizedProjField, {\n mode: FilteringMode.INVERSE,\n saveChild: config.saveChild\n }, allFields);\n dataModel = [projectionClone, rejectionClone];\n } else {\n let projectionClone = cloneWithProject(this, normalizedProjField, config, allFields);\n dataModel = projectionClone;\n }\n\n return dataModel;\n }\n\n getFieldsConfig () {\n return this._fieldConfig;\n }\n\n calculateFieldsConfig () {\n this._fieldConfig = this._fieldspace.fields.reduce((acc, fieldObj, i) => {\n acc[fieldObj.name()] = {\n index: i,\n def: fieldObj.schema(),\n };\n return acc;\n }, {});\n return this;\n }\n\n\n /**\n * Frees up the resources associated with the current DataModel instance and breaks all the links instance has in\n * the DAG.\n *\n * @public\n */\n dispose () {\n this._parent && this._parent.removeChild(this);\n this._parent = null;\n this._children.forEach((child) => {\n child._parent = null;\n });\n this._children = [];\n }\n\n /**\n * Removes the specified child {@link DataModel} from the child list of the current {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\")\n * dt.removeChild(dt2);\n *\n * @private\n *\n * @param {DataModel} child - Delegates the parent to remove this child.\n */\n removeChild (child) {\n let idx = this._children.findIndex(sibling => sibling === child);\n idx !== -1 ? this._children.splice(idx, 1) : true;\n }\n\n /**\n * Sets the specified {@link DataModel} as a parent for the current {@link DataModel} instance.\n *\n * @param {DataModel} parent - The datamodel instance which will act as parent.\n */\n setParent (parent) {\n this._parent && this._parent.removeChild(this);\n this._parent = parent;\n parent && parent._children.push(this);\n }\n\n /**\n * Returns the parent {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const parentDm = dt2.getParent();\n *\n * @return {DataModel} Returns the parent DataModel instance.\n */\n getParent () {\n return this._parent;\n }\n\n /**\n * Returns the immediate child {@link DataModel} instances.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n *\n * const childDm1 = dt.select(fields => fields.Origin.value === \"USA\");\n * const childDm2 = dt.select(fields => fields.Origin.value === \"Japan\");\n * const childDm3 = dt.groupBy([\"Origin\"]);\n *\n * @return {DataModel[]} Returns the immediate child DataModel instances.\n */\n getChildren () {\n return this._children;\n }\n\n /**\n * Returns the in-between operation meta data while creating the current {@link DataModel} instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const dt3 = dt2.groupBy([\"Origin\"]);\n * const derivations = dt3.getDerivations();\n *\n * @return {Any[]} Returns the derivation meta data.\n */\n getDerivations () {\n return this._derivation;\n }\n\n /**\n * Returns the in-between operation meta data happened from root {@link DataModel} to current instance.\n *\n * @example\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'HorsePower', type: 'measure' },\n * { name: \"Origin\", type: 'dimension' }\n * ];\n *\n * const data = [\n * { Name: \"chevrolet chevelle malibu\", Horsepower: 130, Origin: \"USA\" },\n * { Name: \"citroen ds-21 pallas\", Horsepower: 115, Origin: \"Europe\" },\n * { Name: \"datsun pl510\", Horsepower: 88, Origin: \"Japan\" },\n * { Name: \"amc rebel sst\", Horsepower: 150, Origin: \"USA\"},\n * ]\n *\n * const dt = new DataModel(data, schema);\n * const dt2 = dt.select(fields => fields.Origin.value === \"USA\");\n * const dt3 = dt2.groupBy([\"Origin\"]);\n * const ancDerivations = dt3.getAncestorDerivations();\n *\n * @return {Any[]} Returns the previous derivation meta data.\n */\n getAncestorDerivations () {\n return this._ancestorDerivation;\n }\n}\n\nexport default Relation;\n","/* eslint-disable default-case */\n\nimport { FieldType, DimensionSubtype, DataFormat, FilteringMode } from './enums';\nimport {\n persistDerivations,\n getRootGroupByModel,\n propagateToAllDataModels,\n getRootDataModel,\n propagateImmutableActions,\n addToPropNamespace,\n sanitizeUnitSchema,\n splitWithSelect,\n splitWithProject,\n getNormalizedProFields\n} from './helper';\nimport { DM_DERIVATIVES, PROPAGATION } from './constants';\nimport {\n dataBuilder,\n rowDiffsetIterator,\n groupBy\n} from './operator';\nimport { createBinnedFieldData } from './operator/bucket-creator';\nimport Relation from './relation';\nimport reducerStore from './utils/reducer-store';\nimport { createFields } from './field-creator';\nimport InvalidAwareTypes from './invalid-aware-types';\nimport Value from './value';\nimport { converterStore } from './converter';\nimport { fieldRegistry } from './fields';\n\n/**\n * DataModel is an in-browser representation of tabular data. It supports\n * {@link https://en.wikipedia.org/wiki/Relational_algebra | relational algebra} operators as well as generic data\n * processing opearators.\n * DataModel extends {@link Relation} class which defines all the relational algebra opreators. DataModel gives\n * definition of generic data processing operators which are not relational algebra complient.\n *\n * @public\n * @class\n * @extends Relation\n * @memberof Datamodel\n */\nclass DataModel extends Relation {\n /**\n * Creates a new DataModel instance by providing data and schema. Data could be in the form of\n * - Flat JSON\n * - DSV String\n * - 2D Array\n *\n * By default DataModel finds suitable adapter to serialize the data. DataModel also expects a\n * {@link Schema | schema} for identifying the variables present in data.\n *\n * @constructor\n * @example\n * const data = loadData('cars.csv');\n * const schema = [\n * { name: 'Name', type: 'dimension' },\n * { name: 'Miles_per_Gallon', type: 'measure', unit : 'cm', scale: '1000', numberformat: val => `${val}G`},\n * { name: 'Cylinders', type: 'dimension' },\n * { name: 'Displacement', type: 'measure' },\n * { name: 'Horsepower', type: 'measure' },\n * { name: 'Weight_in_lbs', type: 'measure' },\n * { name: 'Acceleration', type: 'measure' },\n * { name: 'Year', type: 'dimension', subtype: 'datetime', format: '%Y' },\n * { name: 'Origin', type: 'dimension' }\n * ];\n * const dm = new DataModel(data, schema, { name: 'Cars' });\n * table(dm);\n *\n * @public\n *\n * @param {Array. | string | Array.} data Input data in any of the mentioned formats\n * @param {Array.} schema Defination of the variables. Order of the variables in data and order of the\n * variables in schema has to be same.\n * @param {object} [options] Optional arguments to specify more settings regarding the creation part\n * @param {string} [options.name] Name of the datamodel instance. If no name is given an auto generated name is\n * assigned to the instance.\n * @param {string} [options.fieldSeparator=','] specify field separator type if the data is of type dsv string.\n */\n constructor (...args) {\n super(...args);\n\n this._onPropagation = [];\n }\n\n /**\n * Reducers are simple functions which reduces an array of numbers to a representative number of the set.\n * Like an array of numbers `[10, 20, 5, 15]` can be reduced to `12.5` if average / mean reducer function is\n * applied. All the measure fields in datamodel (variables in data) needs a reducer to handle aggregation.\n *\n * @public\n *\n * @return {ReducerStore} Singleton instance of {@link ReducerStore}.\n */\n static get Reducers () {\n return reducerStore;\n }\n\n /**\n * Converters are functions that transforms data in various format tpo datamodel consumabe format.\n */\n static get Converters() {\n return converterStore;\n }\n\n /**\n * Register new type of fields\n */\n static get FieldTypes() {\n return fieldRegistry;\n }\n\n /**\n * Configure null, undefined, invalid values in the source data\n *\n * @public\n *\n * @param {Object} [config] - Configuration to control how null, undefined and non-parsable values are\n * represented in DataModel.\n * @param {string} [config.undefined] - Define how an undefined value will be represented.\n * @param {string} [config.null] - Define how a null value will be represented.\n * @param {string} [config.invalid] - Define how a non-parsable value will be represented.\n */\n static configureInvalidAwareTypes (config) {\n return InvalidAwareTypes.invalidAwareVals(config);\n }\n\n /**\n * Retrieve the data attached to an instance in JSON format.\n *\n * @example\n * // DataModel instance is already prepared and assigned to dm variable\n * const data = dm.getData({\n * order: 'column',\n * formatter: {\n * origin: (val) => val === 'European Union' ? 'EU' : val;\n * }\n * });\n * console.log(data);\n *\n * @public\n *\n * @param {Object} [options] Options to control how the raw data is to be returned.\n * @param {string} [options.order='row'] Defines if data is retieved in row order or column order. Possible values\n * are `'rows'` and `'columns'`\n * @param {Function} [options.formatter=null] Formats the output data. This expects an object, where the keys are\n * the name of the variable needs to be formatted. The formatter function is called for each row passing the\n * value of the cell for a particular row as arguments. The formatter is a function in the form of\n * `function (value, rowId, schema) => { ... }`\n * Know more about {@link Fomatter}.\n *\n * @return {Array} Returns a multidimensional array of the data with schema. The return format looks like\n * ```\n * {\n * data,\n * schema\n * }\n * ```\n */\n getData (options) {\n const defOptions = {\n order: 'row',\n formatter: null,\n withUid: false,\n getAllFields: false,\n sort: []\n };\n options = Object.assign({}, defOptions, options);\n const fields = this.getPartialFieldspace().fields;\n\n const dataGenerated = dataBuilder.call(\n this,\n this.getPartialFieldspace().fields,\n this._rowDiffset,\n options.getAllFields ? fields.map(d => d.name()).join() : this._colIdentifier,\n options.sort,\n {\n columnWise: options.order === 'column',\n addUid: !!options.withUid\n }\n );\n\n if (!options.formatter) {\n return dataGenerated;\n }\n\n const { formatter } = options;\n const { data, schema, uids } = dataGenerated;\n const fieldNames = schema.map((e => e.name));\n const fmtFieldNames = Object.keys(formatter);\n const fmtFieldIdx = fmtFieldNames.reduce((acc, next) => {\n const idx = fieldNames.indexOf(next);\n if (idx !== -1) {\n acc.push([idx, formatter[next]]);\n }\n return acc;\n }, []);\n\n if (options.order === 'column') {\n fmtFieldIdx.forEach((elem) => {\n const fIdx = elem[0];\n const fmtFn = elem[1];\n\n data[fIdx].forEach((datum, datumIdx) => {\n data[fIdx][datumIdx] = fmtFn.call(\n undefined,\n datum,\n uids[datumIdx],\n schema[fIdx]\n );\n });\n });\n } else {\n data.forEach((datum, datumIdx) => {\n fmtFieldIdx.forEach((elem) => {\n const fIdx = elem[0];\n const fmtFn = elem[1];\n\n datum[fIdx] = fmtFn.call(\n undefined,\n datum[fIdx],\n uids[datumIdx],\n schema[fIdx]\n );\n });\n });\n }\n\n return dataGenerated;\n }\n\n /**\n * Returns the unique ids in an array.\n *\n * @return {Array} Returns an array of ids.\n */\n getUids () {\n const rowDiffset = this._rowDiffset;\n const ids = [];\n\n if (rowDiffset.length) {\n const diffSets = rowDiffset.split(',');\n\n diffSets.forEach((set) => {\n let [start, end] = set.split('-').map(Number);\n\n end = end !== undefined ? end : start;\n ids.push(...Array(end - start + 1).fill().map((_, idx) => start + idx));\n });\n }\n\n return ids;\n }\n /**\n * Groups the data using particular dimensions and by reducing measures. It expects a list of dimensions using which\n * it projects the datamodel and perform aggregations to reduce the duplicate tuples. Refer this\n * {@link link_to_one_example_with_group_by | document} to know the intuition behind groupBy.\n *\n * DataModel by default provides definition of few {@link reducer | Reducers}.\n * {@link ReducerStore | User defined reducers} can also be registered.\n *\n * This is the chained implementation of `groupBy`.\n * `groupBy` also supports {@link link_to_compose_groupBy | composability}\n *\n * @example\n * const groupedDM = dm.groupBy(['Year'], { horsepower: 'max' } );\n * console.log(groupedDm);\n *\n * @public\n *\n * @param {Array.} fieldsArr - Array containing the name of dimensions\n * @param {Object} [reducers={}] - A map whose key is the variable name and value is the name of the reducer. If its\n * not passed, or any variable is ommitted from the object, default aggregation function is used from the\n * schema of the variable.\n *\n * @return {DataModel} Returns a new DataModel instance after performing the groupby.\n */\n groupBy (fieldsArr, reducers = {}, config = { saveChild: true }) {\n const groupByString = `${fieldsArr.join()}`;\n let params = [this, fieldsArr, reducers];\n const newDataModel = groupBy(...params);\n\n persistDerivations(\n this,\n newDataModel,\n DM_DERIVATIVES.GROUPBY,\n { fieldsArr, groupByString, defaultReducer: reducerStore.defaultReducer() },\n reducers\n );\n\n if (config.saveChild) {\n newDataModel.setParent(this);\n } else {\n newDataModel.setParent(null);\n }\n\n return newDataModel;\n }\n\n /**\n * Performs sorting operation on the current {@link DataModel} instance according to the specified sorting details.\n * Like every other operator it doesn't mutate the current DataModel instance on which it was called, instead\n * returns a new DataModel instance containing the sorted data.\n *\n * DataModel support multi level sorting by listing the variables using which sorting needs to be performed and\n * the type of sorting `ASC` or `DESC`.\n *\n * In the following example, data is sorted by `Origin` field in `DESC` order in first level followed by another\n * level of sorting by `Acceleration` in `ASC` order.\n *\n * @example\n * // here dm is the pre-declared DataModel instance containing the data of 'cars.json' file\n * let sortedDm = dm.sort([\n * [\"Origin\", \"DESC\"]\n * [\"Acceleration\"] // Default value is ASC\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * // Sort with a custom sorting function\n * sortedDm = dm.sort([\n * [\"Origin\", \"DESC\"]\n * [\"Acceleration\", (a, b) => a - b] // Custom sorting function\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * @text\n * DataModel also provides another sorting mechanism out of the box where sort is applied to a variable using\n * another variable which determines the order.\n * Like the above DataModel contains three fields `Origin`, `Name` and `Acceleration`. Now, the data in this\n * model can be sorted by `Origin` field according to the average value of all `Acceleration` for a\n * particular `Origin` value.\n *\n * @example\n * // here dm is the pre-declared DataModel instance containing the data of 'cars.json' file\n * const sortedDm = dm.sort([\n * ['Origin', ['Acceleration', (a, b) => avg(...a.Acceleration) - avg(...b.Acceleration)]]\n * ]);\n *\n * console.log(dm.getData());\n * console.log(sortedDm.getData());\n *\n * @public\n *\n * @param {Array.} sortingDetails - Sorting details based on which the sorting will be performed.\n * @return {DataModel} Returns a new instance of DataModel with sorted data.\n */\n sort (sortingDetails, config = { saveChild: false }) {\n const rawData = this.getData({\n order: 'row',\n sort: sortingDetails\n });\n const header = rawData.schema.map(field => field.name);\n const dataInCSVArr = [header].concat(rawData.data);\n\n const sortedDm = new this.constructor(dataInCSVArr, rawData.schema, { dataFormat: 'DSVArr' });\n\n persistDerivations(\n this,\n sortedDm,\n DM_DERIVATIVES.SORT,\n config,\n sortingDetails\n );\n\n if (config.saveChild) {\n sortedDm.setParent(this);\n } else {\n sortedDm.setParent(null);\n }\n\n return sortedDm;\n }\n\n /**\n * Performs the serialization operation on the current {@link DataModel} instance according to the specified data\n * type. When an {@link DataModel} instance is created, it de-serializes the input data into its internal format,\n * and during its serialization process, it converts its internal data format to the specified data type and returns\n * that data regardless what type of data is used during the {@link DataModel} initialization.\n *\n * @example\n * // here dm is the pre-declared DataModel instance.\n * const csvData = dm.serialize(DataModel.DataFormat.DSV_STR, { fieldSeparator: \",\" });\n * console.log(csvData); // The csv formatted data.\n *\n * const jsonData = dm.serialize(DataModel.DataFormat.FLAT_JSON);\n * console.log(jsonData); // The json data.\n *\n * @public\n *\n * @param {string} type - The data type name for serialization.\n * @param {Object} options - The optional option object.\n * @param {string} options.fieldSeparator - The field separator character for DSV data type.\n * @return {Array|string} Returns the serialized data.\n */\n serialize (type, options) {\n type = type || this._dataFormat;\n options = Object.assign({}, { fieldSeparator: ',' }, options);\n\n const fields = this.getFieldspace().fields;\n const colData = fields.map(f => f.formattedData());\n const rowsCount = colData[0].length;\n let serializedData;\n let rowIdx;\n let colIdx;\n\n if (type === DataFormat.FLAT_JSON) {\n serializedData = [];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = {};\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row[fields[colIdx].name()] = colData[colIdx][rowIdx];\n }\n serializedData.push(row);\n }\n } else if (type === DataFormat.DSV_STR) {\n serializedData = [fields.map(f => f.name()).join(options.fieldSeparator)];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = [];\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row.push(colData[colIdx][rowIdx]);\n }\n serializedData.push(row.join(options.fieldSeparator));\n }\n serializedData = serializedData.join('\\n');\n } else if (type === DataFormat.DSV_ARR) {\n serializedData = [fields.map(f => f.name())];\n for (rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n const row = [];\n for (colIdx = 0; colIdx < fields.length; colIdx++) {\n row.push(colData[colIdx][rowIdx]);\n }\n serializedData.push(row);\n }\n } else {\n throw new Error(`Data type ${type} is not supported`);\n }\n\n return serializedData;\n }\n\n addField (field) {\n const fieldName = field.name();\n this._colIdentifier += `,${fieldName}`;\n const partialFieldspace = this._partialFieldspace;\n const cachedValueObjects = partialFieldspace._cachedValueObjects;\n const formattedData = field.formattedData();\n const rawData = field.partialField.data;\n\n if (!partialFieldspace.fieldsObj()[field.name()]) {\n partialFieldspace.fields.push(field);\n cachedValueObjects.forEach((obj, i) => {\n obj[field.name()] = new Value(formattedData[i], rawData[i], field);\n });\n } else {\n const fieldIndex = partialFieldspace.fields.findIndex(fieldinst => fieldinst.name() === fieldName);\n fieldIndex >= 0 && (partialFieldspace.fields[fieldIndex] = field);\n }\n\n // flush out cached namespace values on addition of new fields\n partialFieldspace._cachedFieldsObj = null;\n partialFieldspace._cachedDimension = null;\n partialFieldspace._cachedMeasure = null;\n\n this.__calculateFieldspace().calculateFieldsConfig();\n return this;\n }\n\n /**\n * Creates a new variable calculated from existing variables. This method expects the definition of the newly created\n * variable and a function which resolves the value of the new variable from existing variables.\n *\n * Can create a new measure based on existing variables:\n * @example\n * // DataModel already prepared and assigned to dm variable;\n * const newDm = dataModel.calculateVariable({\n * name: 'powerToWeight',\n * type: 'measure'\n * }, ['horsepower', 'weight_in_lbs', (hp, weight) => hp / weight ]);\n *\n *\n * Can create a new dimension based on existing variables:\n * @example\n * // DataModel already prepared and assigned to dm variable;\n * const child = dataModel.calculateVariable(\n * {\n * name: 'Efficiency',\n * type: 'dimension'\n * }, ['horsepower', (hp) => {\n * if (hp < 80) { return 'low'; },\n * else if (hp < 120) { return 'moderate'; }\n * else { return 'high' }\n * }]);\n *\n * @public\n *\n * @param {Object} schema - The schema of newly defined variable.\n * @param {Array.} dependency - An array containing the dependency variable names and a resolver\n * function as the last element.\n * @param {Object} config - An optional config object.\n * @param {boolean} [config.saveChild] - Whether the newly created DataModel will be a child.\n * @param {boolean} [config.replaceVar] - Whether the newly created variable will replace the existing variable.\n * @return {DataModel} Returns an instance of DataModel with the new field.\n */\n calculateVariable (schema, dependency, config) {\n schema = sanitizeUnitSchema(schema);\n config = Object.assign({}, { saveChild: true, replaceVar: false }, config);\n\n const fieldsConfig = this.getFieldsConfig();\n const depVars = dependency.slice(0, dependency.length - 1);\n const retrieveFn = dependency[dependency.length - 1];\n\n if (fieldsConfig[schema.name] && !config.replaceVar) {\n throw new Error(`${schema.name} field already exists in datamodel`);\n }\n\n const depFieldIndices = depVars.map((field) => {\n const fieldSpec = fieldsConfig[field];\n if (!fieldSpec) {\n // @todo dont throw error here, use warning in production mode\n throw new Error(`${field} is not a valid column name.`);\n }\n return fieldSpec.index;\n });\n\n const clone = this.clone(config.saveChild);\n\n const fs = clone.getFieldspace().fields;\n const suppliedFields = depFieldIndices.map(idx => fs[idx]);\n\n let cachedStore = {};\n let cloneProvider = () => this.detachedRoot();\n\n const computedValues = [];\n rowDiffsetIterator(clone._rowDiffset, (i) => {\n const fieldsData = suppliedFields.map(field => field.partialField.data[i]);\n computedValues[i] = retrieveFn(...fieldsData, i, cloneProvider, cachedStore);\n });\n const [field] = createFields([computedValues], [schema], [schema.name]);\n clone.addField(field);\n\n persistDerivations(\n this,\n clone,\n DM_DERIVATIVES.CAL_VAR,\n { config: schema, fields: depVars },\n retrieveFn\n );\n\n return clone;\n }\n\n /**\n * Propagates changes across all the connected DataModel instances.\n *\n * @param {Array} identifiers - A list of identifiers that were interacted with.\n * @param {Object} payload - The interaction specific details.\n *\n * @return {DataModel} DataModel instance.\n */\n propagate (identifiers, config = {}, addToNameSpace, propConfig = {}) {\n const isMutableAction = config.isMutableAction;\n const propagationSourceId = config.sourceId;\n const payload = config.payload;\n const rootModel = getRootDataModel(this);\n const propagationNameSpace = rootModel._propagationNameSpace;\n const rootGroupByModel = getRootGroupByModel(this);\n const rootModels = {\n groupByModel: rootGroupByModel,\n model: rootModel\n };\n\n addToNameSpace && addToPropNamespace(propagationNameSpace, config, this);\n propagateToAllDataModels(identifiers, rootModels, { propagationNameSpace,\n sourceId: propagationSourceId,\n propagationSource: this },\n Object.assign({\n payload\n }, config));\n\n if (isMutableAction) {\n propagateImmutableActions(propagationNameSpace, rootModel, {\n config,\n propConfig\n }, this);\n }\n\n return this;\n }\n\n /**\n * Associates a callback with an event name.\n *\n * @param {string} eventName - The name of the event.\n * @param {Function} callback - The callback to invoke.\n * @return {DataModel} Returns this current DataModel instance itself.\n */\n on (eventName, callback) {\n switch (eventName) {\n case PROPAGATION:\n this._onPropagation.push(callback);\n break;\n }\n return this;\n }\n\n /**\n * Unsubscribes the callbacks for the provided event name.\n *\n * @param {string} eventName - The name of the event to unsubscribe.\n * @return {DataModel} Returns the current DataModel instance itself.\n */\n unsubscribe (eventName) {\n switch (eventName) {\n case PROPAGATION:\n this._onPropagation = [];\n break;\n\n }\n return this;\n }\n\n /**\n * This method is used to invoke the method associated with propagation.\n *\n * @param {Object} payload The interaction payload.\n * @param {DataModel} identifiers The propagated DataModel.\n * @memberof DataModel\n */\n handlePropagation (propModel, payload) {\n let propListeners = this._onPropagation;\n propListeners.forEach(fn => fn.call(this, propModel, payload));\n }\n\n /**\n * Performs the binning operation on a measure field based on the binning configuration. Binning means discretizing\n * values of a measure. Binning configuration contains an array; subsequent values from the array marks the boundary\n * of buckets in [inclusive, exclusive) range format. This operation does not mutate the subject measure field,\n * instead, it creates a new field (variable) of type dimension and subtype binned.\n *\n * Binning can be configured by\n * - providing custom bin configuration with non-uniform buckets,\n * - providing bins count,\n * - providing each bin size,\n *\n * When custom `buckets` are provided as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHP', buckets: [30, 80, 100, 110] }\n * const binnedDM = dataModel.bin('horsepower', config);\n *\n * @text\n * When `binsCount` is defined as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHP', binsCount: 5, start: 0, end: 100 }\n * const binDM = dataModel.bin('horsepower', config);\n *\n * @text\n * When `binSize` is defined as part of binning configuration:\n * @example\n * // DataModel already prepared and assigned to dm variable\n * const config = { name: 'binnedHorsepower', binSize: 20, start: 5}\n * const binDM = dataModel.bin('horsepower', config);\n *\n * @public\n *\n * @param {string} measureFieldName - The name of the target measure field.\n * @param {Object} config - The config object.\n * @param {string} [config.name] - The name of the new field which will be created.\n * @param {string} [config.buckets] - An array containing the bucket ranges.\n * @param {string} [config.binSize] - The size of each bin. It is ignored when buckets are given.\n * @param {string} [config.binsCount] - The total number of bins to generate. It is ignored when buckets are given.\n * @param {string} [config.start] - The start value of the bucket ranges. It is ignored when buckets are given.\n * @param {string} [config.end] - The end value of the bucket ranges. It is ignored when buckets are given.\n * @return {DataModel} Returns a new {@link DataModel} instance with the new field.\n */\n bin (measureFieldName, config) {\n const fieldsConfig = this.getFieldsConfig();\n\n if (!fieldsConfig[measureFieldName]) {\n throw new Error(`Field ${measureFieldName} doesn't exist`);\n }\n\n const binFieldName = config.name || `${measureFieldName}_binned`;\n\n if (fieldsConfig[binFieldName]) {\n throw new Error(`Field ${binFieldName} already exists`);\n }\n\n const measureField = this.getFieldspace().fieldsObj()[measureFieldName];\n const { binnedData, bins } = createBinnedFieldData(measureField, this._rowDiffset, config);\n\n const binField = createFields([binnedData], [\n {\n name: binFieldName,\n type: FieldType.DIMENSION,\n subtype: DimensionSubtype.BINNED,\n bins\n }], [binFieldName])[0];\n\n const clone = this.clone(config.saveChild);\n clone.addField(binField);\n\n persistDerivations(\n this,\n clone,\n DM_DERIVATIVES.BIN,\n { measureFieldName, config, binFieldName },\n null\n );\n\n return clone;\n }\n\n /**\n * Creates a new {@link DataModel} instance with completely detached root from current {@link DataModel} instance,\n * the new {@link DataModel} instance has no parent-children relationship with the current one, but has same data as\n * the current one.\n * This API is useful when a completely different {@link DataModel} but with same data as the current instance is\n * needed.\n *\n * @example\n * const dm = new DataModel(data, schema);\n * const detachedDm = dm.detachedRoot();\n *\n * // has different namespace\n * console.log(dm.getPartialFieldspace().name);\n * console.log(detachedDm.getPartialFieldspace().name);\n *\n * // has same data\n * console.log(dm.getData());\n * console.log(detachedDm.getData());\n *\n * @public\n *\n * @return {DataModel} Returns a detached {@link DataModel} instance.\n */\n detachedRoot () {\n const data = this.serialize(DataFormat.FLAT_JSON);\n const schema = this.getSchema();\n\n return new DataModel(data, schema);\n }\n\n /**\n * Creates a set of new {@link DataModel} instances by splitting the set of rows in the source {@link DataModel}\n * instance based on a set of dimensions.\n *\n * For each unique dimensional value, a new split is created which creates a unique {@link DataModel} instance for\n * that split\n *\n * If multiple dimensions are provided, it splits the source {@link DataModel} instance with all possible\n * combinations of the dimensional values for all the dimensions provided\n *\n * Additionally, it also accepts a predicate function to reduce the set of rows provided. A\n * {@link link_to_selection | Selection} is performed on all the split {@link DataModel} instances based on\n * the predicate function\n *\n * @example\n * // without predicate function:\n * const splitDt = dt.splitByRow(['Origin'])\n * console.log(splitDt));\n * // This should give three unique DataModel instances, one each having rows only for 'USA',\n * // 'Europe' and 'Japan' respectively\n *\n * @example\n * // without predicate function:\n * const splitDtMulti = dt.splitByRow(['Origin', 'Cylinders'])\n * console.log(splitDtMulti));\n * // This should give DataModel instances for all unique combinations of Origin and Cylinder values\n *\n * @example\n * // with predicate function:\n * const splitWithPredDt = dt.select(['Origin'], fields => fields.Origin.value === \"USA\")\n * console.log(splitWithPredDt);\n * // This should not include the DataModel for the Origin : 'USA'\n *\n *\n * @public\n *\n * @param {Array} dimensionArr - Set of dimensions based on which the split should occur\n * @param {Object} config - The configuration object\n * @param {string} [config.saveChild] - Configuration to save child or not\n * @param {string}[config.mode=FilteringMode.NORMAL] -The mode of the selection.\n * @return {Array} Returns the new DataModel instances after operation.\n */\n splitByRow (dimensionArr, reducerFn, config) {\n const fieldsConfig = this.getFieldsConfig();\n\n dimensionArr.forEach((fieldName) => {\n if (!fieldsConfig[fieldName]) {\n throw new Error(`Field ${fieldName} doesn't exist in the schema`);\n }\n });\n\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n\n config = Object.assign({}, defConfig, config);\n\n return splitWithSelect(this, dimensionArr, reducerFn, config);\n }\n\n /**\n * Creates a set of new {@link DataModel} instances by splitting the set of fields in the source {@link DataModel}\n * instance based on a set of common and unique field names provided.\n *\n * Each DataModel created contains a set of fields which are common to all and a set of unique fields.\n * It also accepts configurations such as saveChild and mode(inverse or normal) to include/exclude the respective\n * fields\n *\n * @example\n * // without predicate function:\n * const splitDt = dt.splitByColumn( [['Acceleration'], ['Horsepower']], ['Origin'])\n * console.log(splitDt));\n * // This should give two unique DataModel instances, both having the field 'Origin' and\n * // one each having 'Acceleration' and 'Horsepower' fields respectively\n *\n * @example\n * // without predicate function:\n * const splitDtInv = dt.splitByColumn( [['Acceleration'], ['Horsepower'],['Origin', 'Cylinders'],\n * {mode: 'inverse'})\n * console.log(splitDtInv));\n * // This should give DataModel instances in the following way:\n * // All DataModel Instances do not have the fields 'Origin' and 'Cylinders'\n * // One DataModel Instance has rest of the fields except 'Acceleration' and the other DataModel instance\n * // has rest of the fields except 'Horsepower'\n *\n *\n *\n * @public\n *\n * @param {Array} uniqueFields - Set of unique fields included in each datamModel instance\n * @param {Array} commonFields - Set of common fields included in all datamModel instances\n * @param {Object} config - The configuration object\n * @param {string} [config.saveChild] - Configuration to save child or not\n * @param {string}[config.mode=FilteringMode.NORMAL] -The mode of the selection.\n * @return {Array} Returns the new DataModel instances after operation.\n */\n splitByColumn (uniqueFields = [], commonFields = [], config) {\n const defConfig = {\n mode: FilteringMode.NORMAL,\n saveChild: true\n };\n const fieldConfig = this.getFieldsConfig();\n const allFields = Object.keys(fieldConfig);\n const normalizedProjFieldSets = [[commonFields]];\n\n config = Object.assign({}, defConfig, config);\n uniqueFields = uniqueFields.length ? uniqueFields : [[]];\n\n\n uniqueFields.forEach((fieldSet, i) => {\n normalizedProjFieldSets[i] = getNormalizedProFields(\n [...fieldSet, ...commonFields],\n allFields,\n fieldConfig);\n });\n\n return splitWithProject(this, normalizedProjFieldSets, config, allFields);\n }\n\n\n}\n\nexport default DataModel;\n","import { extend2 } from '../utils';\nimport { rowDiffsetIterator } from './row-diffset-iterator';\nimport DataModel from '../export';\nimport reducerStore from '../utils/reducer-store';\nimport { defaultReducerName } from './group-by-function';\nimport { FieldType } from '../enums';\n\n/**\n * This function sanitize the user given field and return a common Array structure field\n * list\n * @param {DataModel} dataModel the dataModel operating on\n * @param {Array} fieldArr user input of field Array\n * @return {Array} arrays of field name\n */\nfunction getFieldArr (dataModel, fieldArr) {\n const retArr = [];\n const fieldStore = dataModel.getFieldspace();\n const dimensions = fieldStore.getDimension();\n\n Object.entries(dimensions).forEach(([key]) => {\n if (fieldArr && fieldArr.length) {\n if (fieldArr.indexOf(key) !== -1) {\n retArr.push(key);\n }\n } else {\n retArr.push(key);\n }\n });\n\n return retArr;\n}\n\n/**\n * This sanitize the reducer provide by the user and create a common type of object.\n * user can give function Also\n * @param {DataModel} dataModel dataModel to worked on\n * @param {Object|function} [reducers={}] reducer provided by the users\n * @return {Object} object containing reducer function for every measure\n */\nfunction getReducerObj (dataModel, reducers = {}) {\n const retObj = {};\n const fieldStore = dataModel.getFieldspace();\n const measures = fieldStore.getMeasure();\n const defReducer = reducerStore.defaultReducer();\n\n Object.keys(measures).forEach((measureName) => {\n if (typeof reducers[measureName] !== 'string') {\n reducers[measureName] = measures[measureName].defAggFn();\n }\n const reducerFn = reducerStore.resolve(reducers[measureName]);\n if (reducerFn) {\n retObj[measureName] = reducerFn;\n } else {\n retObj[measureName] = defReducer;\n reducers[measureName] = defaultReducerName;\n }\n });\n return retObj;\n}\n\n/**\n * main function which perform the group-by operations which reduce the measures value is the\n * fields are common according to the reducer function provided\n * @param {DataModel} dataModel the dataModel to worked\n * @param {Array} fieldArr fields according to which the groupby should be worked\n * @param {Object|Function} reducers reducers function\n * @param {DataModel} existingDataModel Existing datamodel instance\n * @return {DataModel} new dataModel with the group by\n */\nfunction groupBy (dataModel, fieldArr, reducers, existingDataModel) {\n const sFieldArr = getFieldArr(dataModel, fieldArr);\n const reducerObj = getReducerObj(dataModel, reducers);\n const fieldStore = dataModel.getFieldspace();\n const fieldStoreObj = fieldStore.fieldsObj();\n const dbName = fieldStore.name;\n const dimensionArr = [];\n const measureArr = [];\n const schema = [];\n const hashMap = {};\n const data = [];\n let newDataModel;\n\n // Prepare the schema\n Object.entries(fieldStoreObj).forEach(([key, value]) => {\n if (sFieldArr.indexOf(key) !== -1 || reducerObj[key]) {\n schema.push(extend2({}, value.schema()));\n\n switch (value.schema().type) {\n case FieldType.MEASURE:\n measureArr.push(key);\n break;\n default:\n case FieldType.DIMENSION:\n dimensionArr.push(key);\n }\n }\n });\n // Prepare the data\n let rowCount = 0;\n rowDiffsetIterator(dataModel._rowDiffset, (i) => {\n let hash = '';\n dimensionArr.forEach((_) => {\n hash = `${hash}-${fieldStoreObj[_].partialField.data[i]}`;\n });\n if (hashMap[hash] === undefined) {\n hashMap[hash] = rowCount;\n data.push({});\n dimensionArr.forEach((_) => {\n data[rowCount][_] = fieldStoreObj[_].partialField.data[i];\n });\n measureArr.forEach((_) => {\n data[rowCount][_] = [fieldStoreObj[_].partialField.data[i]];\n });\n rowCount += 1;\n } else {\n measureArr.forEach((_) => {\n data[hashMap[hash]][_].push(fieldStoreObj[_].partialField.data[i]);\n });\n }\n });\n\n // reduction\n let cachedStore = {};\n let cloneProvider = () => dataModel.detachedRoot();\n data.forEach((row) => {\n const tuple = row;\n measureArr.forEach((_) => {\n tuple[_] = reducerObj[_](row[_], cloneProvider, cachedStore);\n });\n });\n if (existingDataModel) {\n existingDataModel.__calculateFieldspace();\n newDataModel = existingDataModel;\n }\n else {\n newDataModel = new DataModel(data, schema, { name: dbName });\n }\n return newDataModel;\n}\n\nexport { groupBy, getFieldArr, getReducerObj };\n","import { rowDiffsetIterator } from './row-diffset-iterator';\nimport InvalidAwareTypes from '../invalid-aware-types';\n\nconst generateBuckets = (binSize, start, end) => {\n const buckets = [];\n let next = start;\n\n while (next < end) {\n buckets.push(next);\n next += binSize;\n }\n buckets.push(next);\n\n return buckets;\n};\n\nconst findBucketRange = (bucketRanges, value) => {\n let leftIdx = 0;\n let rightIdx = bucketRanges.length - 1;\n let midIdx;\n let range;\n\n // Here use binary search as the bucketRanges is a sorted array\n while (leftIdx <= rightIdx) {\n midIdx = leftIdx + Math.floor((rightIdx - leftIdx) / 2);\n range = bucketRanges[midIdx];\n\n if (value >= range.start && value < range.end) {\n return range;\n } else if (value >= range.end) {\n leftIdx = midIdx + 1;\n } else if (value < range.start) {\n rightIdx = midIdx - 1;\n }\n }\n\n return null;\n};\n\n /**\n * Creates the bin data from input measure field and supplied configs.\n *\n * @param {Measure} measureField - The Measure field instance.\n * @param {string} rowDiffset - The datamodel rowDiffset values.\n * @param {Object} config - The config object.\n * @return {Object} Returns the binned data and the corresponding bins.\n */\nexport function createBinnedFieldData (measureField, rowDiffset, config) {\n let { buckets, binsCount, binSize, start, end } = config;\n const [dMin, dMax] = measureField.domain();\n\n if (!buckets) {\n start = (start !== 0 && (!start || start > dMin)) ? dMin : start;\n end = (end !== 0 && (!end || end < dMax)) ? (dMax + 1) : end;\n\n if (binsCount) {\n binSize = Math.ceil(Math.abs(end - start) / binsCount);\n }\n\n buckets = generateBuckets(binSize, start, end);\n }\n\n if (buckets[0] > dMin) {\n buckets.unshift(dMin);\n }\n if (buckets[buckets.length - 1] <= dMax) {\n buckets.push(dMax + 1);\n }\n\n const bucketRanges = [];\n for (let i = 0; i < buckets.length - 1; i++) {\n bucketRanges.push({\n start: buckets[i],\n end: buckets[i + 1]\n });\n }\n\n const binnedData = [];\n rowDiffsetIterator(rowDiffset, (i) => {\n const datum = measureField.partialField.data[i];\n if (datum instanceof InvalidAwareTypes) {\n binnedData.push(datum);\n return;\n }\n\n const range = findBucketRange(bucketRanges, datum);\n binnedData.push(`${range.start}-${range.end}`);\n });\n\n return { binnedData, bins: buckets };\n}\n","import { fnList } from '../operator/group-by-function';\n\nexport const { sum, avg, min, max, first, last, count, std: sd } = fnList;\n","import DataModel from './datamodel';\nimport {\n compose,\n bin,\n select,\n project,\n groupby as groupBy,\n calculateVariable,\n sort,\n crossProduct,\n difference,\n naturalJoin,\n leftOuterJoin,\n rightOuterJoin,\n fullOuterJoin,\n union,\n rowDiffsetIterator\n} from './operator';\nimport * as Stats from './stats';\nimport * as enums from './enums';\nimport { DataConverter } from './converter';\nimport { DateTimeFormatter } from './utils';\nimport { DataFormat, FilteringMode, DM_DERIVATIVES } from './constants';\nimport InvalidAwareTypes from './invalid-aware-types';\nimport pkg from '../package.json';\nimport * as FieldsUtility from './fields';\n\nconst Operators = {\n compose,\n bin,\n select,\n project,\n groupBy,\n calculateVariable,\n sort,\n crossProduct,\n difference,\n naturalJoin,\n leftOuterJoin,\n rightOuterJoin,\n fullOuterJoin,\n union,\n rowDiffsetIterator\n};\n\nconst version = pkg.version;\nObject.assign(DataModel, {\n Operators,\n Stats,\n DM_DERIVATIVES,\n DateTimeFormatter,\n DataFormat,\n FilteringMode,\n InvalidAwareTypes,\n version,\n DataConverter,\n FieldsUtility\n}, enums);\n\nexport default DataModel;\n","import { persistDerivations } from '../helper';\nimport { DM_DERIVATIVES } from '../constants';\n\n/**\n * DataModel's opearators are exposed as composable functional operators as well as chainable operators. Chainable\n * operators are called on the instances of {@link Datamodel} and {@link Relation} class.\n *\n * Those same operators can be used as composable operators from `DataModel.Operators` namespace.\n *\n * All these operators have similar behaviour. All these operators when called with the argument returns a function\n * which expects a DataModel instance.\n *\n * @public\n * @module Operators\n * @namespace DataModel\n */\n\n/**\n * This is functional version of selection operator. {@link link_to_selection | Selection} is a row filtering operation.\n * It takes {@link SelectionPredicate | predicate} for filtering criteria and returns a function.\n * The returned function is called with the DataModel instance on which the action needs to be performed.\n *\n * {@link SelectionPredicate} is a function which returns a boolean value. For selection opearation the selection\n * function is called for each row of DataModel instance with the current row passed as argument.\n *\n * After executing {@link SelectionPredicate} the rows are labeled as either an entry of selection set or an entry\n * of rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * [Warn] Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @error\n * [Error] `FilteringMode.ALL` is not a valid working mode for functional version of `select`. Its only avialable on the\n * chained version.\n *\n * @example\n * const select = DataModel.Operators.select;\n * usaCarsFn = select(fields => fields.Origin.value === 'USA');\n * usaCarsDm = usaCarsFn(dm);\n * console.log(usaCarsDm);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {SelectionPredicate} selectFn - Predicate funciton which is called for each row with the current row\n * ```\n * function (row, i) { ... }\n * ```\n * @param {Object} [config] - The configuration object to control the inclusion exclusion of a row in resultant\n * DataModel instance\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - The mode of the selection\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const select = (...args) => dm => dm.select(...args);\n\n/**\n * This is functional version of projection operator. {@link link_to_projection | Projection} is a column filtering\n * operation.It expects list of fields name and either include those or exclude those based on {@link FilteringMode} on\n * the resultant variable.It returns a function which is called with the DataModel instance on which the action needs\n * to be performed.\n *\n * Projection expects array of fields name based on which it creates the selection and rejection set. All the field\n * whose name is present in array goes in selection set and rest of the fields goes in rejection set.\n *\n * {@link FilteringMode} operates on the selection and rejection set to determine which one would reflect in the\n * resulatant datamodel.\n *\n * @warning\n * Selection and rejection set is only a logical idea for concept explanation purpose.\n *\n * @error\n * `FilteringMode.ALL` is not a valid working mode for functional version of `select`. Its only avialable on the\n * chained version.\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {Array.} projField - An array of column names in string or regular expression.\n * @param {Object} [config] - An optional config to control the creation of new DataModel\n * @param {FilteringMode} [config.mode=FilteringMode.NORMAL] - Mode of the projection\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const project = (...args) => dm => dm.project(...args);\n\n/**\n * This is functional version of binnig operator. Binning happens on a measure field based on a binning configuration.\n * Binning in DataModel does not aggregate the number of rows present in DataModel instance after binning, it just adds\n * a new field with the binned value. Refer binning {@link example_of_binning | example} to have a intuition of what\n * binning is and the use case.\n *\n * Binning can be configured by\n * - providing custom bin configuration with non uniform buckets\n * - providing bin count\n * - providing each bin size\n *\n * When custom buckets are provided as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const buckets = {\n * start: 30\n * stops: [80, 100, 110]\n * };\n * const config = { buckets, name: 'binnedHP' }\n * const binFn = bin('horsepower', config);\n * const binnedDm = binFn(dm);\n *\n * @text\n * When `binCount` is defined as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const config = { binCount: 5, name: 'binnedHP' }\n * const binFn = bin('horsepower', config);\n * const binnedDm = binFn(Dm);\n *\n * @text\n * When `binSize` is defined as part of binning configuration\n * @example\n * // DataModel already prepared and assigned to dm vairable\n * const config = { binSize: 200, name: 'binnedHorsepower' }\n * const binnedDm = dataModel.bin('horsepower', config);\n * const binnedDm = binFn(Dm);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {String} name Name of measure which will be used to create bin\n * @param {Object} config Config required for bin creation\n * @param {Array.} config.bucketObj.stops Defination of bucket ranges. Two subsequent number from arrays\n * are picked and a range is created. The first number from range is inclusive and the second number from range\n * is exclusive.\n * @param {Number} [config.bucketObj.startAt] Force the start of the bin from a particular number.\n * If not mentioned, the start of the bin or the lower domain of the data if stops is not mentioned, else its\n * the first value of the stop.\n * @param {Number} config.binSize Bucket size for each bin\n * @param {Number} config.binCount Number of bins which will be created\n * @param {String} config.name Name of the new binned field to be created\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const bin = (...args) => dm => dm.bin(...args);\n\n/**\n * This is functional version of `groupBy` operator.Groups the data using particular dimensions and by reducing\n * measures. It expects a list of dimensions using which it projects the datamodel and perform aggregations to reduce\n * the duplicate tuples. Refer this {@link link_to_one_example_with_group_by | document} to know the intuition behind\n * groupBy.\n *\n * DataModel by default provides definition of few {@link reducer | Reducers}.\n * {@link ReducerStore | User defined reducers} can also be registered.\n *\n * This is the chained implementation of `groupBy`.\n * `groupBy` also supports {@link link_to_compose_groupBy | composability}\n *\n * @example\n * const groupBy = DataModel.Operators.groupBy;\n * const groupedFn = groupBy(['Year'], { horsepower: 'max' } );\n * groupedDM = groupByFn(dm);\n *\n * @public\n *\n * @param {Array.} fieldsArr - Array containing the name of dimensions\n * @param {Object} [reducers={}] - A map whose key is the variable name and value is the name of the reducer. If its\n * not passed, or any variable is ommitted from the object, default aggregation function is used from the\n * schema of the variable.\n *\n * @return {PreparatorFunction} Function which expects an instance of DataModel on which the operator needs to be\n * applied.\n */\nexport const groupBy = (...args) => dm => dm.groupBy(...args);\n\n/**\n * Enables composing operators to run multiple operations and save group of operataion as named opration on a DataModel.\n * The resulting DataModel will be the result of all the operation provided. The operations provided will be executed in\n * a serial manner ie. result of one operation will be the input for the next operations (like pipe operator in unix).\n *\n * Suported operations in compose are\n * - `select`\n * - `project`\n * - `groupBy`\n * - `bin`\n * - `compose`\n *\n * @example\n * const compose = DataModel.Operators.compose;\n * const select = DataModel.Operators.select;\n * const project = DataModel.Operators.project;\n *\n * let composedFn = compose(\n * select(fields => fields.netprofit.value <= 15),\n * project(['netprofit', 'netsales']));\n *\n * const dataModel = new DataModel(data1, schema1);\n *\n * let composedDm = composedFn(dataModel);\n *\n * @public\n * @namespace DataModel\n * @module Operators\n *\n * @param {Array.} operators: An array of operation that will be applied on the\n * datatable.\n *\n * @returns {DataModel} Instance of resultant DataModel\n */\nexport const compose = (...operations) =>\n (dm, config = { saveChild: true }) => {\n let currentDM = dm;\n let firstChild;\n const derivations = [];\n\n operations.forEach((operation) => {\n currentDM = operation(currentDM);\n derivations.push(...currentDM._derivation);\n if (!firstChild) {\n firstChild = currentDM;\n }\n });\n\n if (firstChild && firstChild !== currentDM) {\n firstChild.dispose();\n }\n\n // reset all ancestorDerivation saved in-between compose\n currentDM._ancestorDerivation = [];\n persistDerivations(\n dm,\n currentDM,\n DM_DERIVATIVES.COMPOSE,\n null,\n derivations\n );\n\n if (config.saveChild) {\n currentDM.setParent(dm);\n } else {\n currentDM.setParent(null);\n }\n\n return currentDM;\n };\n","/**\n * Wrapper on calculateVariable() method of DataModel to behave\n * the pure-function functionality.\n *\n * @param {Array} args - The argument list.\n * @return {any} Returns the returned value of calling function.\n */\nexport const calculateVariable = (...args) => dm => dm.calculateVariable(...args);\n\n/**\n * Wrapper on sort() method of DataModel to behave\n * the pure-function functionality.\n *\n * @param {Array} args - The argument list.\n * @return {any} Returns the returned value of calling function.\n */\nexport const sort = (...args) => dm => dm.sort(...args);\n","import { crossProduct } from './cross-product';\nimport { naturalJoinFilter } from './natural-join-filter-function';\n\nexport function naturalJoin (dataModel1, dataModel2) {\n return crossProduct(dataModel1, dataModel2, naturalJoinFilter(dataModel1, dataModel2), true);\n}\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _lib = require('./lib');\n\nvar _lib2 = _interopRequireDefault(_lib);\n\nvar _containerManager = require('./container-manager');\n\nvar _containerManager2 = _interopRequireDefault(_containerManager);\n\nvar slLib = _lib2['default'].init(typeof window !== \"undefined\" ? window : undefined),\n doc = slLib.win.document,\n M = slLib.win.Math,\n max = M.max,\n round = M.round,\n BLANK = '',\n htmlSplCharSpace = { ' ': ' ' },\n documentSupport = slLib.getDocumentSupport(),\n SVG_BBOX_CORRECTION = documentSupport.isWebKit ? 0 : 4.5;\n\n/*\n * Create new instance of SmartLabelManager.\n *\n * SmartLabelManager controls the lifetime of the execution space where the text's metrics will be calculated.\n * This takes a string for a given style and returns the height, width.\n * If a bound box is defined it wraps the text and returns the wrapped height and width.\n * It allows to append ellipsis at the end if the text is truncated.\n *\n * @param {String | Number} id - Id of the instance. If the same id is passed, it disposes the old instance and\n * save the new one;\n * @param {String | HTMLElement} container - The id or the instance of the container where the intermediate dom\n * elements are to be attached. If not passed, it appends in div\n *\n * @param {Boolean} useEllipses - This decides if a ellipses to be appended if the text is truncated.\n * @param {Object} options - Control options\n * {\n * maxCacheLimit: No of letter to be cached. Default: 500.\n * }\n * @constructor\n */\nfunction SmartLabelManager(id, container, useEllipses, options) {\n var wrapper,\n prop,\n max,\n prevInstance,\n isBrowserLess = false,\n store = SmartLabelManager.store;\n\n if (typeof id === 'undefined' || typeof id === 'object') {\n return;\n }\n\n if (prevInstance = store[id]) {\n prevInstance.dispose();\n }\n\n store[id] = this;\n options = options || {};\n options.maxCacheLimit = isFinite(max = options.maxCacheLimit) ? max : slLib.maxDefaultCacheLimit;\n\n if (typeof container === 'string') {\n container = doc.getElementById(container);\n }\n\n wrapper = slLib.createContainer(container);\n wrapper.innerHTML = slLib.testStrAvg;\n\n if (documentSupport.isHeadLess || !documentSupport.isIE && !wrapper.offsetHeight && !wrapper.offsetWidth) {\n isBrowserLess = true;\n }\n\n wrapper.innerHTML = '';\n for (prop in slLib.parentContainerStyle) {\n wrapper.style[prop] = slLib.parentContainerStyle[prop];\n }\n\n this.id = id;\n this.parentContainer = wrapper;\n\n this._containerManager = new _containerManager2['default'](wrapper, isBrowserLess, 10);\n this._showNoEllipses = !useEllipses;\n this._init = true;\n this.style = {};\n this.options = options;\n\n this.setStyle();\n}\n\n/*\n * getSmartText returns the text separated by
whenever a break is necessary. This is to recgonize one\n * generalized format independent of the implementation (canvas based solution, svg based solution). This method\n * converts the output of getSmartText().text to array of lines if the text is wrapped. It sets a named property\n * `lines` on the object passed as parameter.\n *\n * @param {Object} smartlabel - the object returned by getSmartText based on which line arr which to be formed.\n *\n * @return {Object} - The same object which was passed in the arguments. Also a named property `lines` is set.\n */\nSmartLabelManager.textToLines = function (smartlabel) {\n smartlabel = smartlabel || {};\n\n if (!smartlabel.text) {\n smartlabel.text = '';\n } else if (typeof smartlabel.text !== 'string') {\n smartlabel.text = smartlabel.text.toString();\n }\n\n smartlabel.lines = smartlabel.text.split(/\\n|/ig);\n return smartlabel;\n};\n\n// Saves all the instance created so far\nSmartLabelManager.store = {};\n\n// Calculates space taken by a character with an approximation value which is calculated by repeating the\n// character by string length times.\nSmartLabelManager.prototype._calCharDimWithCache = function (text, calculateDifference, length) {\n if (!this._init) {\n return false;\n }\n\n var size,\n csArr,\n tw,\n twi,\n cachedStyle,\n asymmetricDifference,\n maxAdvancedCacheLimit = this.options.maxCacheLimit,\n container = this._container,\n style = this.style || {},\n cache = this._advancedCache || (this._advancedCache = {}),\n advancedCacheKey = this._advancedCacheKey || (this._advancedCacheKey = []),\n cacheName = text + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK),\n cacheInitName = text + 'init' + (style.fontSize || BLANK) + (style.fontFamily || BLANK) + (style.fontWeight || BLANK) + (style.fontStyle || BLANK);\n\n htmlSplCharSpace[text] && (text = htmlSplCharSpace[text]);\n\n if (!calculateDifference) {\n asymmetricDifference = 0;\n } else {\n if ((asymmetricDifference = cache[cacheInitName]) === undefined) {\n container.innerHTML = text.repeat ? text.repeat(length) : Array(length + 1).join(text); // jshint ignore:line\n tw = container.offsetWidth;\n\n container.innerHTML = text;\n twi = container.offsetWidth;\n\n asymmetricDifference = cache[cacheInitName] = (tw - length * twi) / (length + 1);\n advancedCacheKey.push(cacheInitName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n }\n }\n\n if (cachedStyle = cache[cacheName]) {\n csArr = cachedStyle.split(',');\n return {\n width: parseFloat(csArr[0], 10),\n height: parseFloat(csArr[1], 10)\n };\n }\n\n container.innerHTML = text;\n\n size = {\n height: container.offsetHeight,\n width: container.offsetWidth + asymmetricDifference\n };\n\n cache[cacheName] = size.width + ',' + size.height;\n advancedCacheKey.push(cacheName);\n if (advancedCacheKey.length > maxAdvancedCacheLimit) {\n delete cache[advancedCacheKey.shift()];\n }\n\n return size;\n};\n\n// Provide function to calculate the height and width based on the environment and available support from dom.\nSmartLabelManager.prototype._getWidthFn = function () {\n var contObj = this._containerObj,\n container = this._container,\n svgText = contObj.svgText;\n\n if (svgText) {\n return function (str) {\n var bbox, width;\n\n svgText.textContent = str;\n bbox = svgText.getBBox();\n width = bbox.width - SVG_BBOX_CORRECTION;\n if (width < 1) {\n width = bbox.width;\n }\n\n return width;\n };\n } else {\n return function (str) {\n container.innerHTML = str;\n return container.offsetWidth;\n };\n }\n};\n\n/*\n * Sets the style based on which the text's metrics to be calculated.\n *\n * @param {Object} style - The style object which affects the text size\n * {\n * fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)\n * fontFamily / 'font-family'\n * fontWeight / 'font-weight'\n * fontStyle / 'font-style'\n * }\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.setStyle = function (style) {\n if (!this._init) {\n return this;\n }\n\n var sCont;\n\n if (style === this.style && !this._styleNotSet) {\n return;\n }\n\n if (!style) {\n style = this.style;\n }\n\n slLib.setLineHeight(style);\n this.style = style;\n\n this._containerObj = sCont = this._containerManager.get(style);\n\n if (this._containerObj) {\n this._container = sCont.node;\n this._context = sCont.context;\n this._cache = sCont.charCache;\n this._lineHeight = sCont.lineHeight;\n this._styleNotSet = false;\n } else {\n this._styleNotSet = true;\n }\n\n return this;\n};\n\n/*\n * Decides whether ellipses to be shown if the node is truncated\n *\n * @param {Boolean} useEllipses - decides if a ellipses to be appended if the text is truncated. Default: false\n *\n * @return {SmartLabelManager} - Current instance of SmartLabelManager\n */\nSmartLabelManager.prototype.useEllipsesOnOverflow = function (useEllipses) {\n if (!this._init) {\n return this;\n }\n this._showNoEllipses = !useEllipses;\n return this;\n};\n\n/*\n * Get wrapped or truncated text if a bound box is defined around it. The result text would be separated by
\n * if wrapped\n *\n * @param {String} text - the subject text\n * @param {Number} maxWidth - width in px of the the bound box\n * @param {Number} maxHeight - height in px of the the bound box\n * @param {Boolean} noWrap - whether the text to be wrapped. Default false.\n *\n * @return {Object} - The metrics of the text bounded by the box\n * {\n * height : height of the wrapped text\n * width : width of the wrapped text\n * isTruncated : whether the text is truncated\n * maxHeight : Maximum height given\n * maxWidth : Maximum width given\n * oriText : Original text sent\n * oriTextHeight : Original text height\n * oriTextWidth : Original text width\n * text : SMART TEXT\n * }\n */\nSmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight, noWrap) {\n if (!this._init) {\n return false;\n }\n\n if (text === undefined || text === null) {\n text = '';\n } else if (typeof text !== 'string') {\n text = text.toString();\n }\n\n var len,\n trimStr,\n tempArr,\n tmpText,\n maxWidthWithEll,\n toolText,\n oriWidth,\n oriHeight,\n newCharIndex,\n nearestChar,\n tempChar,\n getWidth,\n initialLeft,\n initialTop,\n getOriSizeImproveObj,\n spanArr,\n x,\n y,\n minWidth,\n elem,\n chr,\n elemRightMostPoint,\n elemLowestPoint,\n lastBR,\n removeFromIndex,\n removeFromIndexForEllipses,\n hasHTMLTag = false,\n maxStrWidth = 0,\n lastDash = -1,\n lastSpace = -1,\n lastIndexBroken = -1,\n strWidth = 0,\n strHeight = 0,\n oriTextArr = [],\n i = 0,\n ellipsesStr = this._showNoEllipses ? '' : '...',\n lineHeight = this._lineHeight,\n context = this._context,\n container = this._container,\n sCont = this._containerObj,\n ellipsesWidth = sCont.ellipsesWidth,\n dotWidth = sCont.dotWidth,\n characterArr = [],\n dashIndex = -1,\n spaceIndex = -1,\n lastLineBreak = -1,\n fastTrim = function fastTrim(str) {\n str = str.replace(/^\\s\\s*/, '');\n var ws = /\\s/,\n i = str.length;\n while (ws.test(str.charAt(i -= 1))) {/* jshint noempty:false */}\n return str.slice(0, i + 1);\n },\n smartLabel = {\n text: text,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n width: null,\n height: null,\n oriTextWidth: null,\n oriTextHeight: null,\n oriText: text,\n isTruncated: false\n };\n\n getWidth = this._getWidthFn();\n\n // In some browsers, offsetheight of a single-line text is getting little (1 px) heigher value of the\n // lineheight. As a result, smartLabel is unable to return single-line text.\n // To fix this, increase the maxHeight a little amount. Hence maxHeight = lineHeight * 1.2\n if (maxHeight === lineHeight) {\n maxHeight *= 1.2;\n }\n\n if (container) {\n if (!documentSupport.isBrowserLess) {\n hasHTMLTag = slLib.xmlTagRegEx.test(text);\n if (!hasHTMLTag) {\n // Due to support of <,> for xml we convert <, > to <,> respectively so to get the correct\n // width it is required to convert the same before calculation for the new improve version of the\n // get text width.\n tmpText = text.replace(slLib.ltgtRegex, function (match) {\n return match === '<' ? '<' : '>';\n });\n getOriSizeImproveObj = this.getOriSize(tmpText, true);\n\n smartLabel.oriTextWidth = oriWidth = getOriSizeImproveObj.width;\n smartLabel.oriTextHeight = oriHeight = getOriSizeImproveObj.height;\n } else {\n container.innerHTML = text;\n smartLabel.oriTextWidth = oriWidth = container.offsetWidth;\n smartLabel.oriTextHeight = oriHeight = container.offsetHeight;\n }\n\n if (oriHeight <= maxHeight && oriWidth <= maxWidth) {\n smartLabel.width = smartLabel.oriTextWidth = oriWidth;\n smartLabel.height = smartLabel.oriTextHeight = oriHeight;\n return smartLabel;\n }\n\n if (lineHeight > maxHeight) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = 0;\n smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n }\n }\n\n // Calculate width with ellipses\n text = fastTrim(text).replace(/(\\s+)/g, ' ');\n maxWidthWithEll = this._showNoEllipses ? maxWidth : maxWidth - ellipsesWidth;\n\n if (!hasHTMLTag) {\n oriTextArr = text.split('');\n len = oriTextArr.length;\n trimStr = '', tempArr = [];\n tempChar = oriTextArr[0];\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n minWidth = getWidth(tempChar);\n this._cache[tempChar] = { width: minWidth };\n }\n\n if (maxWidthWithEll > minWidth) {\n tempArr = text.substr(0, slLib.getNearestBreakIndex(text, maxWidthWithEll, this)).split('');\n i = tempArr.length;\n } else if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n return smartLabel;\n } else if (ellipsesStr) {\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n strWidth = getWidth(tempArr.join(''));\n strHeight = this._lineHeight;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n smartLabel.width = getWidth(smartLabel.text);\n smartLabel.height = this._lineHeight;\n return smartLabel;\n }\n }\n }\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = strWidth;\n smartLabel.height = this._lineHeight;\n return smartLabel;\n } else {\n for (; i < len; i += 1) {\n tempChar = tempArr[i] = oriTextArr[i];\n if (tempChar === ' ' && !context) {\n tempChar = ' ';\n }\n\n if (this._cache[tempChar]) {\n minWidth = this._cache[tempChar].width;\n } else {\n if (!getOriSizeImproveObj || !(minWidth = getOriSizeImproveObj.detailObj[tempChar])) {\n minWidth = getWidth(tempChar);\n }\n this._cache[tempChar] = {\n width: minWidth\n };\n }\n strWidth += minWidth;\n\n if (strWidth > maxWidthWithEll) {\n if (!trimStr) {\n trimStr = tempArr.slice(0, -1).join('');\n }\n if (strWidth > maxWidth) {\n /** @todo use regular expressions for better performance. */\n lastSpace = text.substr(0, tempArr.length).lastIndexOf(' ');\n lastDash = text.substr(0, tempArr.length).lastIndexOf('-');\n if (lastSpace > lastIndexBroken) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastSpace, 1, '
');\n lastIndexBroken = lastSpace;\n newCharIndex = lastSpace + 1;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === tempArr.length - 1) {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '
-');\n } else {\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastSpace).join(''));\n tempArr.splice(lastDash, 1, '-
');\n }\n lastIndexBroken = lastDash;\n newCharIndex = lastDash + 1;\n } else {\n tempArr.splice(tempArr.length - 1, 1, '
' + oriTextArr[i]);\n lastLineBreak = tempArr.length - 2;\n strWidth = getWidth(tempArr.slice(lastIndexBroken + 1, lastLineBreak + 1).join(''));\n lastIndexBroken = lastLineBreak;\n newCharIndex = i;\n }\n strHeight += this._lineHeight;\n if (strHeight > maxHeight) {\n smartLabel.text = fastTrim(trimStr) + ellipsesStr;\n smartLabel.tooltext = smartLabel.oriText;\n // The max width among all the lines will be the width of the string.\n smartLabel.width = maxWidth;\n smartLabel.height = strHeight - this._lineHeight;\n return smartLabel;\n } else {\n maxStrWidth = max(maxStrWidth, strWidth);\n trimStr = null;\n nearestChar = slLib.getNearestBreakIndex(text.substr(newCharIndex), maxWidthWithEll, this);\n strWidth = getWidth(text.substr(newCharIndex, nearestChar || 1));\n if (tempArr.length < newCharIndex + nearestChar) {\n tempArr = tempArr.concat(text.substr(tempArr.length, newCharIndex + nearestChar - tempArr.length).split(''));\n i = tempArr.length - 1;\n }\n }\n }\n }\n }\n\n maxStrWidth = max(maxStrWidth, strWidth);\n\n smartLabel.text = tempArr.join('');\n smartLabel.width = maxStrWidth;\n smartLabel.height = strHeight;\n return smartLabel;\n }\n } else {\n toolText = text.replace(slLib.spanAdditionRegx, '$2');\n text = text.replace(slLib.spanAdditionRegx, slLib.spanAdditionReplacer);\n text = text.replace(/()/g, '$1');\n\n container.innerHTML = text;\n\n spanArr = container[documentSupport.childRetriverFn](documentSupport.childRetriverString);\n\n for (x = 0, y = spanArr.length; x < y; x += 1) {\n elem = spanArr[x];\n //chech whether this span is temporary inserted span from it's class\n if (documentSupport.noClassTesting || slLib.classNameReg.test(elem.className)) {\n chr = elem.innerHTML;\n if (chr !== '') {\n if (chr === ' ') {\n spaceIndex = characterArr.length;\n } else if (chr === '-') {\n dashIndex = characterArr.length;\n }\n\n characterArr.push({\n spaceIdx: spaceIndex,\n dashIdx: dashIndex,\n elem: elem\n });\n oriTextArr.push(chr);\n }\n }\n }\n\n i = 0;\n len = characterArr.length;\n minWidth = characterArr[0].elem.offsetWidth;\n\n if (minWidth > maxWidth) {\n smartLabel.text = '';\n smartLabel.width = smartLabel.oriTextWidth = smartLabel.height = smartLabel.oriTextHeight = 0;\n\n return smartLabel;\n } else if (minWidth > maxWidthWithEll && !this._showNoEllipses) {\n\n maxWidthWithEll = maxWidth - 2 * dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '..';\n } else {\n maxWidthWithEll = maxWidth - dotWidth;\n if (maxWidthWithEll > minWidth) {\n ellipsesStr = '.';\n } else {\n maxWidthWithEll = 0;\n ellipsesStr = '';\n }\n }\n }\n\n initialLeft = characterArr[0].elem.offsetLeft;\n initialTop = characterArr[0].elem.offsetTop;\n\n if (noWrap) {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n if (container.offsetWidth > maxWidth) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n } else {\n for (; i < len; i += 1) {\n elem = characterArr[i].elem;\n elemLowestPoint = elem.offsetHeight + (elem.offsetTop - initialTop);\n elemRightMostPoint = elem.offsetLeft - initialLeft + elem.offsetWidth;\n\n lastBR = null;\n\n if (elemRightMostPoint > maxWidthWithEll) {\n if (!removeFromIndexForEllipses) {\n removeFromIndexForEllipses = i;\n }\n\n if (elemRightMostPoint > maxWidth) {\n lastSpace = characterArr[i].spaceIdx;\n lastDash = characterArr[i].dashIdx;\n if (lastSpace > lastIndexBroken) {\n characterArr[lastSpace].elem.innerHTML = '
';\n lastIndexBroken = lastSpace;\n } else if (lastDash > lastIndexBroken) {\n if (lastDash === i) {\n // in case the overflowing character itself is the '-'\n characterArr[lastDash].elem.innerHTML = '
-';\n } else {\n characterArr[lastDash].elem.innerHTML = '-
';\n }\n lastIndexBroken = lastDash;\n } else {\n elem.parentNode.insertBefore(lastBR = doc.createElement('br'), elem);\n }\n\n //check whether this break made current element outside the area height\n if (elem.offsetHeight + elem.offsetTop > maxHeight) {\n //remove the lastly inserted line break\n if (lastBR) {\n lastBR.parentNode.removeChild(lastBR);\n } else if (lastIndexBroken === lastDash) {\n characterArr[lastDash].elem.innerHTML = '-';\n } else {\n characterArr[lastSpace].elem.innerHTML = ' ';\n }\n removeFromIndex = i;\n //break the looping condition\n i = len;\n } else {\n removeFromIndexForEllipses = null;\n }\n }\n } else {\n //check whether this break made current element outside the area height\n if (elemLowestPoint > maxHeight) {\n removeFromIndex = i;\n i = len;\n }\n }\n }\n }\n\n if (removeFromIndex < len) {\n //set the trancated property of the smartlabel\n smartLabel.isTruncated = true;\n\n /** @todo is this really needed? */\n removeFromIndexForEllipses = removeFromIndexForEllipses ? removeFromIndexForEllipses : removeFromIndex;\n\n for (i = len - 1; i >= removeFromIndexForEllipses; i -= 1) {\n elem = characterArr[i].elem;\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n }\n\n for (; i >= 0; i -= 1) {\n elem = characterArr[i].elem;\n if (slLib.classNameBrReg.test(elem.className)) {\n //chech whether this span is temporary inserted span from it's class\n elem.parentNode.removeChild(elem);\n } else {\n i = 0;\n }\n }\n }\n\n //get the smart text\n smartLabel.text = container.innerHTML.replace(slLib.spanRemovalRegx, '$1').replace(/\\&\\;/g, '&');\n if (smartLabel.isTruncated) {\n smartLabel.text += ellipsesStr;\n smartLabel.tooltext = toolText;\n }\n }\n\n smartLabel.height = container.offsetHeight;\n smartLabel.width = container.offsetWidth;\n\n return smartLabel;\n } else {\n smartLabel.error = new Error('Body Tag Missing!');\n return smartLabel;\n }\n};\n\n/*\n * Get the height and width of a text.\n *\n * @param {String} text - Text whose metrics to be measured\n * @param {Boolean} Optional detailedCalculationFlag - this flag if set it calculates per letter position\n * information and returns it. Ideally you dont need it unless you want to post process the\n * string. And its an EXPENSIVE OPERATION.\n *\n * @return {Object} - If detailedCalculationFlag is set to true the returned object would be\n * {\n * height: height of the text\n * width: width of the text\n * detailObj: detail calculation of letters in the format {lettername: width}\n * }\n * If detailedCalculationFlag is set to false the returned object wont have the detailObj prop.\n */\nSmartLabelManager.prototype.getOriSize = function (text, detailedCalculationFlag) {\n if (!this._init) {\n return false;\n }\n\n var textArr,\n letter,\n lSize,\n i,\n l,\n cumulativeSize = 0,\n height = 0,\n indiSizeStore = {};\n\n if (!detailedCalculationFlag) {\n return this._calCharDimWithCache(text);\n }\n\n // Calculate the width of every letter with an approximation\n textArr = text.split('');\n for (i = 0, l = textArr.length; i < l; i++) {\n letter = textArr[i];\n lSize = this._calCharDimWithCache(letter, true, textArr.length);\n height = max(height, lSize.height);\n cumulativeSize += lSize.width;\n indiSizeStore[letter] = lSize.width;\n }\n\n return {\n width: round(cumulativeSize),\n height: height,\n detailObj: indiSizeStore\n };\n};\n\n/*\n * Dispose the container and object allocated by the smartlabel\n */\nSmartLabelManager.prototype.dispose = function () {\n if (!this._init) {\n return this;\n }\n\n this._containerManager && this._containerManager.dispose && this._containerManager.dispose();\n\n delete this._container;\n delete this._context;\n delete this._cache;\n delete this._containerManager;\n delete this._containerObj;\n delete this.id;\n delete this.style;\n delete this.parentContainer;\n delete this._showNoEllipses;\n\n return this;\n};\n\nexports['default'] = SmartLabelManager;\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n\tvalue: true\n});\nvar lib = {\n\tinit: function init(win) {\n\t\tvar doc = win.document,\n\t\t nav = win.navigator,\n\t\t userAgent = nav.userAgent,\n\t\t DIV = 'DIV',\n\t\t ceil = Math.ceil,\n\t\t floor = Math.floor,\n\t\t containerInstanceCount = 0,\n\t\t clsNameSpace = 'fusioncharts-smartlabel-',\n\t\t containerClass = clsNameSpace + 'container',\n\t\t classNameWithTag = clsNameSpace + 'tag',\n\t\t classNameWithTagBR = clsNameSpace + 'br';\n\n\t\tlib = {\n\t\t\twin: win,\n\n\t\t\tcontainerClass: containerClass,\n\n\t\t\tclassNameWithTag: classNameWithTag,\n\n\t\t\tclassNameWithTagBR: classNameWithTagBR,\n\n\t\t\tmaxDefaultCacheLimit: 500,\n\n\t\t\tclassNameReg: new RegExp('\\b' + classNameWithTag + '\\b'),\n\n\t\t\tclassNameBrReg: new RegExp('\\b' + classNameWithTagBR + '\\b'),\n\n\t\t\tspanAdditionRegx: /(<[^<\\>]+?\\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,\n\n\t\t\tspanAdditionReplacer: '$1$2',\n\n\t\t\tspanRemovalRegx: new RegExp('\\\\]+?' + classNameWithTag + '[^\\\\>]{0,}\\\\>(.*?)\\\\<\\\\/span\\\\>', 'ig'),\n\n\t\t\txmlTagRegEx: new RegExp('<[^>][^<]*[^>]+>', 'i'),\n\n\t\t\tltgtRegex: /<|>/g,\n\n\t\t\tbrReplaceRegex: //ig,\n\n\t\t\ttestStrAvg: 'WgI',\n\n\t\t\t// This style is applied over the parent smartlabel container. The container is kept hidden from the viewport\n\t\t\tparentContainerStyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: '-9999em',\n\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\tpadding: '0px',\n\t\t\t\twidth: '1px',\n\t\t\t\theight: '1px',\n\t\t\t\toverflow: 'hidden'\n\t\t\t},\n\n\t\t\t// All the style which might affect the text metrics\n\t\t\tsupportedStyle: {\n\t\t\t\tfont: 'font',\n\t\t\t\tfontFamily: 'font-family',\n\t\t\t\t'font-family': 'font-family',\n\t\t\t\tfontWeight: 'font-weight',\n\t\t\t\t'font-weight': 'font-weight',\n\t\t\t\tfontSize: 'font-size',\n\t\t\t\t'font-size': 'font-size',\n\t\t\t\tlineHeight: 'line-height',\n\t\t\t\t'line-height': 'line-height',\n\t\t\t\tfontStyle: 'font-style',\n\t\t\t\t'font-style': 'font-style'\n\t\t\t},\n\n\t\t\t// Get the support list for html the document where the text calcution is to be done.\n\t\t\tgetDocumentSupport: function getDocumentSupport() {\n\t\t\t\tvar childRetriverFn, childRetriverString, noClassTesting;\n\n\t\t\t\tif (doc.getElementsByClassName) {\n\t\t\t\t\tchildRetriverFn = 'getElementsByClassName';\n\t\t\t\t\tchildRetriverString = classNameWithTag;\n\t\t\t\t\tnoClassTesting = true;\n\t\t\t\t} else {\n\t\t\t\t\tchildRetriverFn = 'getElementsByTagName';\n\t\t\t\t\tchildRetriverString = 'span';\n\t\t\t\t\tnoClassTesting = false;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisIE: /msie/i.test(userAgent) && !win.opera,\n\t\t\t\t\thasSVG: Boolean(win.SVGAngle || doc.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')),\n\t\t\t\t\tisHeadLess: new RegExp(' HtmlUnit').test(userAgent),\n\t\t\t\t\tisWebKit: new RegExp(' AppleWebKit/').test(userAgent),\n\t\t\t\t\tchildRetriverFn: childRetriverFn,\n\t\t\t\t\tchildRetriverString: childRetriverString,\n\t\t\t\t\tnoClassTesting: noClassTesting\n\t\t\t\t};\n\t\t\t},\n\n\t\t\t/*\n * Create a html div element and attach it with a parent. All the subsequent operations are performed\n * by upding this dom tree only.\n *\n * @param {HTMLElement} - The html element where the newly created div is to be attached. If not passed,\n * the new div is appended on the body.\n */\n\t\t\tcreateContainer: function createContainer(containerParent) {\n\t\t\t\tvar body, container;\n\n\t\t\t\tif (containerParent && (containerParent.offsetWidth || containerParent.offsetHeight)) {\n\t\t\t\t\tif (containerParent.appendChild) {\n\t\t\t\t\t\tcontainerParent.appendChild(container = doc.createElement(DIV));\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody = doc.getElementsByTagName('body')[0];\n\n\t\t\t\t\tif (body && body.appendChild) {\n\t\t\t\t\t\tcontainer = doc.createElement(DIV);\n\t\t\t\t\t\tcontainer.className = containerClass;\n\t\t\t\t\t\tcontainer.setAttribute('aria-hidden', 'true');\n\t\t\t\t\t\tcontainer.setAttribute('role', 'presentation');\n\t\t\t\t\t\tcontainerInstanceCount += 1;\n\t\t\t\t\t\tbody.appendChild(container);\n\t\t\t\t\t\treturn container;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Finds a approximate position where the text is to be broken\n\t\t\tgetNearestBreakIndex: function getNearestBreakIndex(text, maxWidth, sl) {\n\t\t\t\tif (!text || !text.length) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tvar difference,\n\t\t\t\t getWidth = sl._getWidthFn(),\n\t\t\t\t charLen = 0,\n\t\t\t\t increment = 0,\n\t\t\t\t oriWidth = getWidth(text),\n\t\t\t\t avgWidth = oriWidth / text.length;\n\n\t\t\t\tdifference = maxWidth;\n\t\t\t\tcharLen = ceil(maxWidth / avgWidth);\n\n\t\t\t\tif (oriWidth < maxWidth) {\n\t\t\t\t\treturn text.length - 1;\n\t\t\t\t}\n\n\t\t\t\tif (charLen > text.length) {\n\t\t\t\t\tdifference = maxWidth - oriWidth;\n\t\t\t\t\tcharLen = text.length;\n\t\t\t\t}\n\n\t\t\t\twhile (difference > 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twhile (difference < 0) {\n\t\t\t\t\tdifference = maxWidth - getWidth(text.substr(0, charLen));\n\t\t\t\t\tincrement = floor(difference / avgWidth);\n\t\t\t\t\tif (increment) {\n\t\t\t\t\t\tcharLen += increment;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn charLen;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn charLen;\n\t\t\t},\n\n\t\t\t/*\n * Determine lineheight of a text for a given style. It adds propery lineHeight to the style passed\n *\n * @param {Object} - The style based on which the text's metric needs to be calculated. The calculation happens\n * based on fontSize property, if its not present a default font size is assumed.\n *\n * @return {Object} - The style that was passed with lineHeight as a named propery set on the object.\n */\n\t\t\tsetLineHeight: function setLineHeight(styleObj) {\n\t\t\t\tvar fSize = styleObj.fontSize = styleObj.fontSize || '12px';\n\t\t\t\tstyleObj.lineHeight = styleObj.lineHeight || styleObj['line-height'] || parseInt(fSize, 10) * 1.2 + 'px';\n\t\t\t\treturn styleObj;\n\t\t\t}\n\t\t};\n\n\t\treturn lib;\n\t}\n};\n\nexports['default'] = lib;\nmodule.exports = exports['default'];","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"hyperdis\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"hyperdis\"] = factory();\n\telse\n\t\troot[\"hyperdis\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const makeEntry = (arr, sCon) => {\n arr.forEach((elem) => {\n if (elem === undefined || elem === null) {\n return;\n }\n sCon[elem] = 1;\n });\n};\n\nexport default class ForeignSet {\n constructor (arr) {\n this._set = {};\n makeEntry(arr, this._set);\n }\n\n append (arr) {\n makeEntry(arr, this._set);\n return this;\n }\n\n toArray () {\n return Object.keys(this._set);\n }\n\n static difference (set1, set2) {\n let key;\n const filteredKeys = [],\n s1 = set1._set,\n s2 = set2._set;\n for (key in s1) {\n if (!({}).hasOwnProperty.call(s1, key)) {\n continue;\n }\n if (key in s2) {\n continue;\n }\n filteredKeys.push(key);\n }\n return new ForeignSet(filteredKeys);\n }\n}\n","/* global window */\n\nimport ForeignSet from './set';\n\nconst\n isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n },\n minMsThreshold = 16,\n /* istanbul ignore next */win = typeof window === 'undefined' ? (this || {}) : window,\n /* istanbul ignore next */ reqAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame ||\n win.mozRequestAnimationFrame || win.oRequestAnimationFrame ||\n win.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, minMsThreshold);\n },\n\n getTimeBasedId = () => {\n if (getTimeBasedId.__lastTime === new Date().getTime()) {\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n }\n\n getTimeBasedId.__id = 0;\n getTimeBasedId.__lastTime = new Date().getTime();\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n },\n pullableRecent = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const\n hist = node.history,\n l = hist.length - 1;\n return [hist[l - 1 < 0 ? 0 : l - 1], hist[l]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n pullableEnd = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const hist = node.history;\n return [hist[0], hist[hist.length - 1]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n unique = fns => fns\n .reduce((store, fn) => {\n // @warn function with side effect, it mutates the store passed during initialization\n if (fn.__id in store.map) {\n return store;\n }\n\n store.map[fn.__id] = 1;\n store.unique.push(fn);\n\n return store;\n }, { map: {}, unique: [] })\n .unique,\n compose = fns => () => {\n fns.forEach(fn => fn());\n },\n flat = (...params) => {\n const res = [];\n params.forEach(param => res.push(...param));\n return res;\n },\n identityMap = arrays => arrays,\n splitPathProp = (path) => {\n const pathArr = path.split('.'),\n len = pathArr.length;\n return [pathArr.slice(0, len - 1), pathArr[len - 1]];\n },\n scheduler = (onFinishCallback) => {\n let queue = [],\n animationFrame = null;\n\n onFinishCallback = onFinishCallback &&\n typeof onFinishCallback === 'function' && onFinishCallback || (() => { });\n\n return (listeners, payload) => {\n [].push.apply(queue, listeners);\n if (animationFrame === null) {\n animationFrame = reqAnimFrame(() => {\n const tempQ = queue.slice(0);\n queue.length = 0;\n animationFrame = null;\n\n unique(tempQ).forEach(fn => fn());\n onFinishCallback(payload);\n });\n }\n };\n },\n fetch = namedNode => (...params) => params.map((param) => {\n const node = namedNode[param];\n return {\n name: node.name,\n qualifiedName: node.qualifiedName,\n value: node.seed\n };\n }),\n fetchAggregator = (...params) => ({\n dependencies: params.slice(0, params.length - 1),\n fn: params[params.length - 1]\n }),\n getUpstreamNodes = (list) => {\n let res = [];\n const map = {};\n list.forEach(node => map[node.qualifiedName] = -1);\n function rec (arr) {\n arr.forEach((node) => {\n let qname,\n placedIndex,\n preArr,\n postArr;\n if (!((qname = node.qualifiedName) in map)) {\n map[qname] = res.push(node) - 1;\n } else {\n placedIndex = map[qname];\n if (placedIndex !== -1 && placedIndex !== res.length - 1) {\n // If not the last element, readjust the array so that the later dependency position is saved\n preArr = res.slice(0, placedIndex);\n postArr = res.slice(placedIndex + 1);\n res = preArr.concat(postArr);\n\n // reset the index in map\n postArr.forEach((elem, i) => map[elem.qualifiedName] = i + preArr.length);\n map[qname] = res.push(node) - 1;\n }\n }\n rec(node.outgoingEdges);\n });\n }\n rec(list);\n return res;\n },\n resolver = {\n accumulate: (...params) => {\n const resp = {};\n params.forEach((nodeDetails) => {\n Object.assign(resp, { [nodeDetails.name]: nodeDetails.value });\n });\n return resp;\n },\n identity: nodeDetails => nodeDetails.value\n };\n\nfunction resolveDependencyOrder (node, resolved, resolveMap) {\n let qname;\n node.edges.forEach((neighbour) => {\n resolveDependencyOrder(neighbour, resolved, resolveMap);\n });\n\n if (node.isRoot() || (qname = node.qualifiedName) in resolveMap) {\n return;\n }\n resolved.push(node);\n resolveMap[qname] = 1;\n}\n\nclass CustomResolver {\n constructor (resolver) {\n this.fn = resolver;\n this.dep = [];\n }\n\n addDependencies(...dep) {\n this.dep.push(...dep);\n return this;\n }\n\n getDependencies () {\n return this.dep;\n }\n\n get () {\n return this.fn;\n }\n}\n\nexport {\n isSimpleObject,\n scheduler,\n compose,\n flat,\n identityMap,\n pullableEnd,\n pullableRecent,\n unique,\n splitPathProp,\n resolver,\n ForeignSet,\n resolveDependencyOrder,\n fetch,\n fetchAggregator,\n CustomResolver,\n getUpstreamNodes\n};\n","export default class GraphNode {\n constructor (name, qualifiedName, options) {\n /* istanbul ignore next */options = options || {};\n this.name = name;\n this.qualifiedName = qualifiedName;\n this.edges = [];\n this.outgoingEdges = [];\n this._seed = null;\n this.requireResolve = true;\n this.retriever = options.retriever;\n this.history = [];\n this.resolver = null;\n this.electricEdges = [];\n }\n\n addDependencies (...dep) {\n this.edges.push(...dep);\n dep.forEach(entry => entry.outgoingEdges.push(this));\n return this;\n }\n\n addElectricNode (node) {\n this.electricEdges.push(node);\n return this;\n }\n\n get seed () {\n return this._seed;\n }\n\n set seed (value) {\n this._seed = value;\n this.requireResolve = true;\n return this;\n }\n\n resolve () {\n this.seed = this.resolver(...this.retrieveDetails());\n this.history.push(this.seed);\n this.requireResolve = false;\n return this;\n }\n\n retrieveDetails () {\n if (this.edges.length === 0) {\n return [{\n name: this.name,\n qualifiedName: this.qualifiedName,\n value: this.seed\n }];\n }\n return this.retriever(...this.edges.map(edge => edge.qualifiedName));\n }\n\n repeatHead () {\n const\n history = this.history,\n head = history[history.length - 1];\n // @todo- Akash, write test case if history.length === 0 to pass code coverage\n if (history.length === 0) {\n return this;\n }\n history.push(head);\n return this;\n }\n\n flush () {\n const hist = this.history,\n head = hist[hist.length - 1];\n hist.length = 0;\n hist.push(head);\n return this;\n }\n\n isRoot () {\n return this.name === null;\n }\n}\n","import {\n pullableRecent,\n pullableEnd\n} from './utils';\n\nexport default class ElectricNode {\n constructor () {\n this.edges = [];\n this.listeners = {\n nextFrame: [],\n currentFrame: []\n };\n }\n\n addEdges (...nodes) {\n this.edges.push(...nodes);\n return this;\n }\n\n regListenerForCurrFrame (fn) {\n const lstnrs = this.listeners.currentFrame;\n let index = lstnrs.push(pullableRecent(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.currentFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n regListenerForNextFrame (fn) {\n const lstnrs = this.listeners.nextFrame;\n let index = lstnrs.push(pullableEnd(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.nextFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n hasNextFrameListener () {\n return !!this.listeners.nextFrame.length;\n }\n}\n","import {\n isSimpleObject,\n resolver,\n // upstreamNodes,\n flat,\n resolveDependencyOrder,\n getUpstreamNodes,\n ForeignSet,\n fetch,\n CustomResolver,\n scheduler\n} from './utils';\nimport Node from './graph-node';\nimport ElectricNode from './electric-node';\n\nexport default class Graph {\n constructor () {\n this.qualifiedNodeMap = {};\n this.retriever = fetch(this.qualifiedNodeMap);\n this.root = new Node(null, null, { retriever: this.retriever });\n this.root.resolver = resolver.accumulate;\n\n this._wholeSet = null;\n this._propagate = true;\n this.propagationOverride = {\n currentFrameListeners: false,\n nextFrameListeners: false\n };\n\n this._schedule = scheduler((payload) => {\n let qname;\n for (qname in payload.flushTarget) {\n if (!({}).hasOwnProperty.call(this.qualifiedNodeMap, qname)) {\n return;\n }\n this.qualifiedNodeMap[qname].flush();\n }\n });\n }\n\n createNodesFrom (obj, mount) {\n let val,\n resolveReqList;\n const qualifiedNodeMap = this.qualifiedNodeMap,\n root = this.root,\n retriever = this.retriever;\n\n (function rec (objn, qualifiedName, history) {\n let key,\n qname,\n perv,\n node;\n\n for (key in objn) {\n if (!({}).hasOwnProperty.call(objn, key)) {\n continue;\n }\n qname = `${qualifiedName}${key}`;\n node = new Node(key, qname, { retriever });\n qualifiedNodeMap[qname] = node;\n\n if ((perv = history.perv) !== undefined) {\n perv.addDependencies(node);\n } else {\n // top most level entries\n root.addDependencies(node);\n }\n\n if (isSimpleObject(val = objn[key])) {\n rec(val, `${qualifiedName}${key}.`, { perv: node });\n node.resolver = resolver.accumulate;\n } else if (val instanceof CustomResolver) {\n node.resolver = val.get();\n node.addDependencies(...val.getDependencies().map(qname => qualifiedNodeMap[qname]));\n } else {\n node.resolver = resolver.identity;\n node.seed = val;\n // node.resolve();\n }\n }\n }(obj, mount === null ? '' : `${mount}.`, {\n perv: qualifiedNodeMap[mount]\n }));\n\n this._wholeSet = new ForeignSet(Object.keys(this.qualifiedNodeMap));\n\n // Recalculate the model without firing the listeners\n // @todo selective branch resolve. Currently resolve gets called even for a branch which was updated\n resolveReqList = this.constructor.getResolvedList(root).concat(root).filter(node => node.requireResolve);\n resolveReqList.forEach(node => node.resolve());\n getUpstreamNodes(resolveReqList).forEach(node => node.resolve());\n return this;\n }\n\n getNodeValue (prop) {\n if (prop in this.qualifiedNodeMap) {\n return this.qualifiedNodeMap[prop].seed;\n }\n return undefined;\n }\n\n createElectricNodeOf (props, fnSpec) {\n const nodes = props.map(prop => this.qualifiedNodeMap[prop]),\n eNode = new ElectricNode().addEdges(...nodes);\n\n nodes.forEach(node => node.addElectricNode(eNode));\n return eNode[`regListenerFor${fnSpec.type}`](fnSpec.fn);\n }\n\n update (...params) {\n let changedSet,\n upstreamNodes;\n const\n electricEdges = [],\n nodes = params.map((entry) => {\n entry[0].seed = entry[1];\n return entry[0];\n });\n nodes.forEach(node => node.resolve());\n electricEdges.push(...flat(...nodes.map(node => node.electricEdges)));\n changedSet = new ForeignSet(nodes.map(node => node.qualifiedName));\n\n if (!this._propagate) {\n this.__execUniqueElectricEdges(electricEdges);\n this._propagate = true;\n return this;\n }\n\n upstreamNodes = getUpstreamNodes(nodes);\n upstreamNodes.forEach(upstreamNode => upstreamNode.resolve());\n changedSet.append(upstreamNodes.map(node => node.qualifiedName));\n electricEdges.push(...flat(...upstreamNodes.map(node => node.electricEdges)));\n\n this.__execUniqueElectricEdges(Array.from(new Set(electricEdges)), changedSet);\n return this;\n }\n\n __execUniqueElectricEdges (electricEdges, changedSet) {\n const\n cfLstnrs = [], // current frame listeners\n nfLstnrs = []; // next frame listeners\n if (changedSet) {\n const\n differenceSet = ForeignSet.difference(this._wholeSet, changedSet),\n entries = differenceSet.toArray();\n\n entries.forEach(entry => this.qualifiedNodeMap[entry].repeatHead());\n }\n\n electricEdges.forEach((e) => {\n cfLstnrs.push(...e.listeners.currentFrame);\n });\n electricEdges.forEach((e) => {\n nfLstnrs.push(...e.listeners.nextFrame);\n });\n\n !this.propagationOverride.currentFrameListeners && cfLstnrs.forEach(fn => fn());\n !this.propagationOverride.nextFrameListeners && this._schedule(nfLstnrs, { flushTarget: changedSet });\n this.resetPropagationOverride();\n return this;\n }\n\n resetNodeValue (...qnames) {\n const nodes = qnames.map(qname => this.qualifiedNodeMap[qname]),\n args = nodes.map(node => [node, node.seed]);\n this.update(...args);\n return this;\n }\n\n static getResolvedList (node) {\n const resolved = [];\n resolveDependencyOrder(node, resolved, {});\n return resolved;\n }\n\n stopPropagation () {\n this._propagate = false;\n return this;\n }\n\n resetPropagationOverride () {\n this.propagationOverride.currentFrameListeners = false;\n this.propagationOverride.nextFrameListeners = false;\n return this;\n }\n\n setPropagationOverride (key) {\n this.propagationOverride[`${key}Listeners`] = true;\n return this;\n }\n\n getNodeFromQualifiedName (qname) {\n return this.qualifiedNodeMap[qname];\n }\n}\n","import Graph from './graph';\nimport { CustomResolver, fetchAggregator } from './utils';\n\n/**\n * The container class for Hyperdis. Hyperdis is an enabler for observable object with few interesting features like,\n * calculated property, next frame and same frame listeners, multiple listeners etc with a dependency resolving system.\n * It internally uses a graph to hold the hierarchial relationship of a object. Model is merely a container which\n * ties all the components together.\n *\n * @todo Circular dependency detection is not present\n *\n * @example check src/index.spec.js\n * @class\n */\nclass Model {\n constructor () {\n this._graph = new Graph();\n this._lockFlag = false;\n this._reqQ = [];\n }\n\n /**\n * Static method to create and init the model with an observable seed\n *\n * @param {Object} obj The target object which is required to be made observable\n * @return {Model} instance of the observable object model\n */\n static create (obj) {\n return new Model()._addPropInModel(null, obj);\n }\n\n /**\n * Appends more observable property on the already observable instance. This mutates the original model.\n *\n * This function works in two mode. One being\n * @param {String} mountPoint the property on which the new set of properties will be mounted. If its a nested\n * property then the mountPoint has to be written such a way so it feels like you are\n * accessing the object. If the mount point is not found then he obeservables are added in\n * the root.\n * @param {Object} The target object which is required to be made observable\n *\n * Another being\n * @param {Object} The target object which is required to be made observable\n *\n * @return {Model} instance of the observable object model\n */\n append (...params) {\n let mountPoint,\n obj;\n\n if (params.length === 1) {\n mountPoint = null;\n obj = params[0];\n } else {\n mountPoint = params[0];\n obj = params[1];\n }\n\n this._addPropInModel(mountPoint, obj);\n return this;\n }\n\n /**\n * Creates a calculated variable from existing variable. This variable can't be updated from outside.\n * @param {string} mountpoint property path on which the new variable will be placed\n * @param {string} name name of the variable. If the variable could have hierarchy like `limits.start`\n * @param {Function} fn funtion where the dependent variables are injected based on the dependency requirement\n */\n calculatedProp (...params) {\n let calculationConfig,\n customResolver,\n varName,\n mount,\n fetchFn;\n\n if (params.length > 2) {\n mount = params[0];\n varName = params[1];\n fetchFn = params[2];\n } else {\n mount = null;\n varName = params[0];\n fetchFn = params[1];\n }\n\n calculationConfig = fetchFn(fetchAggregator);\n customResolver = new CustomResolver(calculationConfig.fn);\n customResolver.addDependencies(...calculationConfig.dependencies);\n\n this._addPropInModel(mount, { [varName]: customResolver });\n return this;\n }\n\n // eslint-disable-next-line require-jsdoc\n _addPropInModel (mountPoint, obj) {\n this._graph.createNodesFrom(obj, mountPoint);\n return this;\n }\n\n /**\n * Register a listener in the current frame when a property or group of properties is changed.\n *\n * @example\n * This function takes a single or group of property and handler which is called when any of the properties are\n * changed.\n * When a single property is changed the handler is called with two parameter, what was the old value of the state\n * property and what is the new value.\n * myState.on('range.start', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 9);\n * // Output\n * Value before prop change 1\n * Value after prop change 9\n *\n * If a handler is registered on change of a property which has another state property as value, then the handler\n * gets called whenever any state property connected to it gets changed\n *\n * myState.on('range', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 10);\n * myState.prop('range.type.absolute', false);\n *\n * // Output\n * Value before prop change\n * range {\n * start: 9,\n * end: 5,\n * type: {\n * absolute: true\n * }\n * }\n * Value after prop change\n * range: {\n * start: 10,\n * end: 5,\n * type: {\n * absolute: false\n * }\n * }\n * If a handler is registered with more than one property change then, the handler is called when any of the\n * properties gets changed. In this cast the handler is called with more than one parameter: each for one state\n * property which is registered for listening. Each parameter is of type array containing [oldValue, newValue]\n *\n * myState.on('range.start', 'range.end', (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * myState.prop('range.start', 12);\n *\n * // Output\n * Start [10, 12]\n * End [5, 5]\n *\n * myState.prop('range.end', 7);\n *\n * // Output\n * Start [12, 12]\n * End [5, 7]\n *\n * The on returns a function which is when called the listener registered gets unregistered\n *\n * let unsub = myState.on(['range.start', 'range.end'], (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * // Unsubscribe\n * unsub()\n *\n * On takes an optional boolean value as the last parameter, which if passed as a true value the handler gets called\n * during registration itself.\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n on (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed in the current stack frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'CurrFrame',\n fn\n });\n\n if (instantCall) {\n // Bar current next frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('nextFrame').resetNodeValue(...props);\n }\n return unsub;\n }\n\n /**\n * Register a listener for the next frame when a property or group of properties is changed.\n *\n * @example\n * See the examples for the on listener\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties. Here the oldvalue is last value of the last frame\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n next (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed at the tick of next animation frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'NextFrame',\n fn\n });\n\n // @todo check support for this from the graph side\n if (instantCall) {\n // Bar current frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('currentFrame').resetNodeValue(...props);\n }\n\n return unsub;\n }\n\n /**\n * Lock queues the request of property change and releases the change when unlock is called. This is helpful when\n * multiple property is getting called and the model listeners are to be fired once at the end of update.\n *\n * @return {Model} instance of the model\n */\n lock () {\n this._lockFlag = true;\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * Unlock unleashes the change done after the lock was called.\n\n * @return {Model} instance of the model\n */\n unlock () {\n this._lockFlag = false;\n this.setProp(...this._reqQ);\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * This acts as getter and setter. If the function is called by passing only one argument, it retrieve the value\n * associated with the property. If the same function is called using two parameters, first one being the property\n * and second one being the value, then the value is set for the property and the handlers are called (if any)\n * which got registered using the on function\n *\n * Getter\n * @param {string} prop property path whose value to be retrieved\n * @return {Object} value of the property at the time of call\n *\n * Setter\n * @param {string} property property path whose value to be ser\n * @return {Model} instance of the model\n */\n prop (...params) {\n let prop,\n val,\n len;\n\n switch (len = params.length) {\n case 1:\n prop = params[0];\n break;\n\n case 2:\n prop = params[0];\n val = params[1];\n break;\n\n default:\n return this;\n }\n\n if (len === 2) {\n this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([prop, val]);\n return this;\n }\n\n return this._graph.getNodeValue(prop);\n }\n\n // eslint-disable-next-line require-jsdoc\n setProp (...props) {\n // Filter out the calculated variables, so that it cant be changed from outside\n // @todo if a node is not leafValue, and change is called, ignore it too\n // props = props.filter(prop => !(VirtualObj.walkTill(prop[0].split('.'), this._vObj).leafValue()\n // instanceof CalculatedVar));\n\n if (props.length === 0) {\n return this;\n }\n\n this._graph.update(...props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]]));\n return this;\n }\n\n /**\n * Retrieves the graph representation of the object\n * @return {Graph} instance of the graph associated to the model\n */\n graph () {\n return this._graph;\n }\n\n /**\n * Get serialized data from the model\n *\n * @return {Object} Serialized data\n */\n serialize () {\n return this._graph.root.seed;\n }\n}\n\nexport default Model;\n","import Model from './model';\n\nexport default Model;\n","const Muze = require('./muze');\n\nmodule.exports = Muze.default ? Muze.default : Muze;\n","'use strict';\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _lib = require('./lib');\n\nvar _lib2 = _interopRequireDefault(_lib);\n\nvar slLib = _lib2['default'].init(typeof window !== \"undefined\" ? window : undefined),\n doc = slLib.win.document,\n documentSupport = slLib.getDocumentSupport(),\n SVG_BBOX_CORRECTION = documentSupport.isWebKit ? 0 : 4.5;\n\nfunction ContainerManager(parentContainer, isBrowserLess, maxContainers) {\n var svg;\n\n maxContainers = maxContainers > 5 ? maxContainers : 5;\n maxContainers = maxContainers < 20 ? maxContainers : 20;\n\n this.maxContainers = maxContainers;\n this.first = null;\n this.last = null;\n this.containers = {};\n this.length = 0;\n this.rootNode = parentContainer;\n\n if (isBrowserLess) {\n svg = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'height', '0');\n svg.setAttributeNS('http://www.w3.org/2000/svg', 'width', '0');\n this.svgRoot = svg;\n this.rootNode.appendChild(svg);\n }\n}\n\nContainerManager.prototype.get = function (style) {\n var diff,\n key,\n containerObj,\n containers = this.containers,\n len = this.length,\n max = this.maxContainers,\n keyStr = '';\n\n for (key in slLib.supportedStyle) {\n if (style[key] !== undefined) {\n keyStr += slLib.supportedStyle[key] + ':' + style[key] + ';';\n }\n }\n\n if (!keyStr) {\n return false;\n }\n\n if (containerObj = containers[keyStr]) {\n if (this.first !== containerObj) {\n containerObj.prev && (containerObj.prev.next = containerObj.next);\n containerObj.next && (containerObj.next.prev = containerObj.prev);\n containerObj.next = this.first;\n containerObj.next.prev = containerObj;\n this.last === containerObj && (this.last = containerObj.prev);\n containerObj.prev = null;\n this.first = containerObj;\n }\n } else {\n if (len >= max) {\n diff = len - max + 1;\n // +1 is to remove an extra entry to make space for the new container to be added.\n while (diff--) {\n this.removeContainer(this.last);\n }\n }\n containerObj = this.addContainer(keyStr);\n }\n\n return containerObj;\n};\n\nContainerManager.prototype.addContainer = function (keyStr) {\n var node, container;\n\n this.containers[keyStr] = container = {\n next: null,\n prev: null,\n node: null,\n ellipsesWidth: 0,\n lineHeight: 0,\n dotWidth: 0,\n avgCharWidth: 4,\n keyStr: keyStr,\n charCache: {}\n };\n\n // Since the container objects are arranged from most recent to least recent order, we need to add the new\n // object at the beginning of the list.\n container.next = this.first;\n container.next && (container.next.prev = container);\n this.first = container;\n if (!this.last) {\n this.last = container;\n }\n this.length += 1;\n\n node = container.node = doc.createElement('div');\n this.rootNode.appendChild(node);\n\n if (documentSupport.isIE && !documentSupport.hasSVG) {\n node.style.setAttribute('cssText', keyStr);\n } else {\n node.setAttribute('style', keyStr);\n }\n\n node.setAttribute('aria-hidden', 'true');\n node.setAttribute('role', 'presentation');\n node.style.display = 'inline-block';\n\n node.innerHTML = slLib.testStrAvg; // A test string.\n container.lineHeight = node.offsetHeight;\n container.avgCharWidth = node.offsetWidth / 3;\n\n if (documentSupport.isBrowserLess) {\n node = container.svgText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n node.setAttribute('style', keyStr);\n this.svgRoot.appendChild(node);\n\n node.textContent = slLib.testStrAvg; // A test string.\n container.lineHeight = node.getBBox().height;\n container.avgCharWidth = (node.getBBox().width - SVG_BBOX_CORRECTION) / 3;\n\n node.textContent = '...';\n container.ellipsesWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n node.textContent = '.';\n container.dotWidth = node.getBBox().width - SVG_BBOX_CORRECTION;\n } else {\n node.innerHTML = '...';\n container.ellipsesWidth = node.offsetWidth;\n node.innerHTML = '.';\n container.dotWidth = node.offsetWidth;\n node.innerHTML = '';\n }\n\n return container;\n};\n\nContainerManager.prototype.removeContainer = function (cObj) {\n var keyStr = cObj.keyStr;\n\n if (!keyStr || !this.length || !cObj) {\n return;\n }\n this.length -= 1;\n\n cObj.prev && (cObj.prev.next = cObj.next);\n cObj.next && (cObj.next.prev = cObj.prev);\n this.first === cObj && (this.first = cObj.next);\n this.last === cObj && (this.last = cObj.prev);\n\n cObj.node.parentNode.removeChild(cObj.node);\n\n delete this.containers[keyStr];\n};\n\nContainerManager.prototype.dispose = function () {\n var key,\n containers = this.containers;\n\n this.maxContainers = null;\n for (key in containers) {\n this.removeContainer(containers[key]);\n }\n\n this.rootNode.parentNode.removeChild(this.rootNode);\n\n this.rootNode = null;\n this.first = null;\n this.last = null;\n};\n\nmodule.exports = ContainerManager;","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import map from \"./map\";\n\nexport default function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map.entries();\n else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n}\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return map();\n}\n\nfunction setMap(map, key, value) {\n map.set(key, value);\n}\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n scale.invertExtent = function(r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1, a, b, t,\n hiIndex;\n values.push(values[n] + this.step());\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo));\n hiIndex = getClosestIndexOf(values, hi);\n b = lo===hi ? a : Math.max(a, hiIndex - 1);\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n if (reverse) t = a, a = n - b, b = n - t; // map + swap\n return (a > b) ? undefined : domain().slice(a, b+1);\n };\n\n scale.invert = function (r0, r1) {\n var lo = +r0,\n hi = arguments.length > 1 ? +r1 : lo,\n reverse = range[1] < range[0],\n values = reverse ? ordinalRange().reverse() : ordinalRange(),\n n = values.length - 1,\n a,\n t;\n\n // order range inputs, bail if outside of scale range\n if (hi < lo) t = lo, lo = hi, hi = t;\n if (hi < values[0] || lo > range[1-reverse]) return undefined;\n\n // binary search to index into scale range\n a = Math.max(0, getClosestIndexOf(values, lo, 'left'));\n\n // increment index a if lo is within padding gap\n // if (lo - values[a] > bandwidth + 1e-10) ++a;\n\n return domain()[reverse ? n - a : a];\n }\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n\nfunction getClosestIndexOf (arr, value, side) {\n var low = 0,\n arrLen = arr.length,\n high = arrLen - 1,\n highVal,\n mid,\n d1,\n d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left'? high - 1 : high;\n } else {\n if (high === arr.length - 1) { return high; }\n return side === 'left'? high : high + 1;\n }\n}","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? new Rgb(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? new Rgb((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns [\"123\", 0].\nexport default function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import formatDecimal from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": function(x) { return Math.round(x).toString(10); },\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval.js\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval.js\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nvar hour = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nvar minute = interval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nvar second = interval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval.js\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","import interval from \"./interval.js\";\nimport {durationWeek} from \"./duration.js\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval.js\";\nimport {durationDay} from \"./duration.js\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval.js\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatWeekNumberISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","import interval from \"./interval.js\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval.js\";\nimport {durationHour} from \"./duration.js\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval.js\";\nimport {durationMinute} from \"./duration.js\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","export default function(s) {\n return s.match(/.{6}/g).map(function(x) {\n return \"#\" + x;\n });\n}\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf\");\n","import colors from \"./colors\";\n\nexport default colors(\"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6\");\n","import colors from \"./colors\";\n\nexport default colors(\"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5\");\n","import colors from \"./colors\";\n\nexport default colors(\"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9\");\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {deg2rad, rad2deg} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar rainbow = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n rainbow.h = 360 * t - 100;\n rainbow.s = 1.5 - 1.5 * ts;\n rainbow.l = 0.8 - 0.9 * ts;\n return rainbow + \"\";\n}\n","import colors from \"./colors\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n","import colors from \"../colors.js\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n","import colors from \"../colors.js\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n","import {interpolateRgbBasis} from \"d3-interpolate\";\n\nexport default function(scheme) {\n return interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\n\nfunction ramp(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n\nexport default ramp(colors(\"44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725\"));\n\nexport var magma = ramp(colors(\"00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf\"));\n\nexport var inferno = ramp(colors(\"00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4\"));\n\nexport var plasma = ramp(colors(\"0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921\"));\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nexport var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));\n\nvar c = cubehelix();\n\nexport default function(t) {\n if (t < 0 || t > 1) t -= Math.floor(t);\n var ts = Math.abs(t - 0.5);\n c.h = 360 * t - 100;\n c.s = 1.5 - 1.5 * ts;\n c.l = 0.8 - 0.9 * ts;\n return c + \"\";\n}\n","import {cubehelix} from \"d3-color\";\nimport {interpolateCubehelixLong} from \"d3-interpolate\";\n\nexport default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n","import colors from \"../colors.js\";\nimport ramp from \"../ramp.js\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n","export const UNIT_GLOBAL_NAMESPACE = 'app.units';\nexport const UNIT_LOCAL_NAMESPACE = 'local.units';\nexport const LAYER_LOCAL_NAMESPACE = 'local.layers';\nexport const LAYER_GLOBAL_NAMESPACE = 'app.layers';\nexport const GROUP_GLOBAL_NAMESPACE = 'app.group';\nexport const GROUP_LOCAL_NAMESPACE = 'local.group';\nexport const CANVAS_LOCAL_NAMESPACE = 'local.canvas';\nexport const CANVAS_GLOBAL_NAMESPACE = 'app.canvas';\n\n","const swap = (arr, i, j) => {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n};\n\nconst defaultCompare = (a, b) => {\n if (a > b) {\n return -1;\n }\n return a > b ? 1 : 0;\n};\n\nconst quickselectStep = (arr, k, left, right, compare) => {\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n const t = arr[k];\n let i = left;\n let j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n};\n\n/**\n * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the\n * (k - left + 1)-th smallest value in [left, right].\n * array: the array to partially sort (in place)\n * k: middle index for partial sorting (as defined above)\n * left: left index of the range to sort (0 by default)\n * right: right index (last index of the array by default)\n * compareFn: compare function\n *\n * Ref: https://github.com/mourner/quickselect\n * Example:\n * var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];\n * quickselect(arr, 8);\n * arr is [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]\n * ^^ middle index\n * @param {Array} arr the array to partially sort (in place)\n * @param {Number} k middle index for partial sorting (as defined above)\n * @param {Number} left left index of the range to sort (0 by default)\n * @param {Number} right right index (last index of the array by default)\n * @param {Function} compare compare function\n */\nconst quickselect = (arr, k, left, right, compare) => {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n};\n\nexport default quickselect;\n","import quickselect from './quick-select';\n\nconst createNode = children => ({\n children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n});\n\nconst extend = (a, b) => {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n};\n\n// min bounding rectangle of node children from k to p-1\nconst distBBox = (node, k, p, toBBox, destNode) => {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (let i = k; i < p; i++) {\n const child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n};\n\n// calculate node's bbox from bboxes of its children\nconst calcBBox = (node, toBBox) => {\n distBBox(node, 0, node.children.length, toBBox, node);\n};\n\nconst compareNodeMinX = (a, b) => a.minX - b.minX;\nconst compareNodeMinY = (a, b) => a.minY - b.minY;\n\nconst bboxArea = a => (a.maxX - a.minX) * (a.maxY - a.minY);\n\nconst bboxMargin = a => (a.maxX - a.minX) + (a.maxY - a.minY);\n\nconst enlargedArea = (a, b) => (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n\nconst intersectionArea = (a, b) => {\n const minX = Math.max(a.minX, b.minX);\n const minY = Math.max(a.minY, b.minY);\n const maxX = Math.min(a.maxX, b.maxX);\n const maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n};\n\nconst contains = (a, b) => a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n\nconst intersects = (a, b) => b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n\nconst findItem = (item, items, equalsFn) => {\n if (!equalsFn) return items.indexOf(item);\n\n for (let i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n};\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nconst multiSelect = (arr, left, right, n, compare) => {\n const stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n const mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n};\n\nconst all = (node, result) => {\n const nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push(...node.children);\n else nodesToSearch.push(...node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n};\n\nexport default class RTree {\n constructor (maxEntries = 9) {\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n this.clear();\n }\n\n all () {\n return all(this.data, []);\n }\n\n search (bbox) {\n let node = this.data;\n const result = [];\n\n if (!intersects(bbox, node)) return result;\n\n const toBBox = this.toBBox;\n const nodesToSearch = [];\n\n while (node) {\n for (const child of node.children) {\n const childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) all(child, result);\n else nodesToSearch.push(child);\n }\n }\n\n node = nodesToSearch.pop();\n }\n\n return result;\n }\n\n load (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (let i = 0; i < data.length; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n let node = this.build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this.splitRoot(this.data, node);\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n const tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this.insertSingleItem(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n }\n\n insert (item) {\n if (item) this.insertSingleItem(item, this.data.height - 1);\n return this;\n }\n\n clear () {\n this.data = createNode([]);\n return this;\n }\n\n remove (item, equalsFn) {\n if (!item) return this;\n\n let i;\n let parent;\n let goingUp;\n let node = this.data;\n const bbox = this.toBBox(item);\n const path = [];\n const indexes = [];\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n const index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this.condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n } else node = null; // nothing found\n }\n\n return this;\n }\n\n toJSON () { return this.data; }\n\n fromJSON (data) {\n this.data = data;\n return this;\n }\n\n toBBox (item) { return item; }\n\n compareMinX (a, b) { return a.minX - b.minX; }\n compareMinY (a, b) { return a.minY - b.minY; }\n\n build (items, left, right, height) {\n const N = right - left + 1;\n let M = this._maxEntries;\n let node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / (M ** (height - 1)));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n const N2 = Math.ceil(N / M);\n const N1 = N2 * Math.ceil(Math.sqrt(M));\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (let i = left; i <= right; i += N1) {\n const right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (let j = i; j <= right2; j += N2) {\n const right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this.build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n }\n\n chooseSubtree (bbox, node, level, path) {\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n let minArea = Infinity;\n let minEnlargement = Infinity;\n let targetNode;\n\n for (const child of node.children) {\n const area = bboxArea(child);\n const enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n }\n\n insertSingleItem (item, level, isNode) {\n const bbox = isNode ? item : this.toBBox(item);\n const insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n const node = this.chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this.split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this.adjustParentBoxes(bbox, insertPath, level);\n }\n\n // split overflowed node into two\n split (insertPath, level) {\n const node = insertPath[level];\n const M = node.children.length;\n const m = this._minEntries;\n\n this.chooseSplitAxis(node, m, M);\n\n const splitIndex = this.chooseSplitIndex(node, m, M);\n\n const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this.splitRoot(node, newNode);\n }\n\n splitRoot (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n }\n\n chooseSplitIndex (node, m, M) {\n let index;\n let minOverlap = Infinity;\n let minArea = Infinity;\n\n for (let i = m; i <= M - m; i++) {\n const bbox1 = distBBox(node, 0, i, this.toBBox);\n const bbox2 = distBBox(node, i, M, this.toBBox);\n\n const overlap = intersectionArea(bbox1, bbox2);\n const area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index || M - m;\n }\n\n // sorts node children by the best axis for split\n chooseSplitAxis (node, m, M) {\n const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n const xMargin = this.allDistMargin(node, m, M, compareMinX);\n const yMargin = this.allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n }\n\n // total margin of all possible split distributions where each node is at least m full\n allDistMargin (node, m, M, compare) {\n node.children.sort(compare);\n\n const toBBox = this.toBBox;\n const leftBBox = distBBox(node, 0, m, toBBox);\n const rightBBox = distBBox(node, M - m, M, toBBox);\n let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n for (let i = m; i < M - m; i++) {\n const child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (let i = M - m - 1; i >= m; i--) {\n const child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n }\n\n adjustParentBoxes (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (let i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n }\n\n condense (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (let i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n } else this.clear();\n } else calcBBox(path[i], this.toBBox);\n }\n }\n}\n","const ReservedFields = {\n ROW_ID: '__id__',\n MEASURE_NAMES: '__measure_names__'\n};\n\nexport default ReservedFields;\n","const CommonProps = {\n ACTION_INF: 'actionInf',\n ON_LAYER_DRAW: 'onLayerDraw',\n MATRIX_CREATED: 'matrixCreated'\n};\n\nexport default CommonProps;\n","export const COORD_TYPES = {\n POLAR: 'polar',\n CARTESIAN: 'cartesian'\n};\nexport const DATA_TYPE = {\n FUNCTION: 'function',\n STRING: 'string',\n NUMBER: 'number',\n BOOLEAN: 'Boolean'\n};\nexport const SORT_ORDER_ASCENDING = 'asc';\nexport const SORT_ORDER_DESCENDING = 'desc';\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickTransform = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"#000\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"#000\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"))\n .style('transform', tickTransform);\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter\n : \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter);\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.tickTransform = function(_) {\n return arguments.length ? (tickTransform = _, axis) : tickTransform;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","export var abs = Math.abs;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var sin = Math.sin;\nexport var sqrt = Math.sqrt;\n\nexport var epsilon = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, tau} from \"../math.js\";\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","export default {\n draw: function(context, size) {\n var r = Math.sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","var tan30 = Math.sqrt(1 / 3),\n tan30_2 = tan30 * 2;\n\nexport default {\n draw: function(context, size) {\n var y = Math.sqrt(size / tan30_2),\n x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","export default {\n draw: function(context, size) {\n var w = Math.sqrt(size),\n x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","import {pi, tau} from \"../math.js\";\n\nvar ka = 0.89081309152928522810,\n kr = Math.sin(pi / 10) / Math.sin(7 * pi / 10),\n kx = Math.sin(tau / 10) * kr,\n ky = -Math.cos(tau / 10) * kr;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size * ka),\n x = kx * r,\n y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (var i = 1; i < 5; ++i) {\n var a = tau * i / 5,\n c = Math.cos(a),\n s = Math.sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","var c = -0.5,\n s = Math.sqrt(3) / 2,\n k = 1 / Math.sqrt(12),\n a = (k / 2 + 1) * 3;\n\nexport default {\n draw: function(context, size) {\n var r = Math.sqrt(size / a),\n x0 = r / 2,\n y0 = r * k,\n x1 = x0,\n y1 = r * k + r,\n x2 = -x1,\n y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","var sqrt3 = Math.sqrt(3);\n\nexport default {\n draw: function(context, size) {\n var y = -Math.sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n","import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export var slice = Array.prototype.slice;\n","import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var kz = keys.apply(this, arguments),\n i,\n m = data.length,\n n = kz.length,\n sz = new Array(n),\n oz;\n\n for (i = 0; i < n; ++i) {\n for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {\n si[j] = sij = [0, +value(data[j], ki, j, data)];\n sij.data = data[j];\n }\n si.key = ki;\n }\n\n for (i = 0, oz = order(sz); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(slice.call(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // proceed\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // proceed\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function line(data) {\n var i,\n n = data.length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","export default function piecewise(interpolate, values) {\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","var b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nexport function bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nexport function bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nexport function bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n","var tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nexport var elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nexport var elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nexport var elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n","var overshoot = 1.70158;\n\nexport var backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nexport var backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nexport var backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n","var exponent = 3;\n\nexport var polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nexport var polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nexport var polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export function x(d) {\n return d[0];\n}\n\nexport function y(d) {\n return d[1];\n}\n","function RedBlackTree() {\n this._ = null; // root node\n}\n\nexport function RedBlackNode(node) {\n node.U = // parent node\n node.C = // color - true for red, false for black\n node.L = // left node\n node.R = // right node\n node.P = // previous node\n node.N = null; // next node\n}\n\nRedBlackTree.prototype = {\n constructor: RedBlackTree,\n\n insert: function(after, node) {\n var parent, grandpa, uncle;\n\n if (after) {\n node.P = after;\n node.N = after.N;\n if (after.N) after.N.P = node;\n after.N = node;\n if (after.R) {\n after = after.R;\n while (after.L) after = after.L;\n after.L = node;\n } else {\n after.R = node;\n }\n parent = after;\n } else if (this._) {\n after = RedBlackFirst(this._);\n node.P = null;\n node.N = after;\n after.P = after.L = node;\n parent = after;\n } else {\n node.P = node.N = null;\n this._ = node;\n parent = null;\n }\n node.L = node.R = null;\n node.U = parent;\n node.C = true;\n\n after = node;\n while (parent && parent.C) {\n grandpa = parent.U;\n if (parent === grandpa.L) {\n uncle = grandpa.R;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.R) {\n RedBlackRotateLeft(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateRight(this, grandpa);\n }\n } else {\n uncle = grandpa.L;\n if (uncle && uncle.C) {\n parent.C = uncle.C = false;\n grandpa.C = true;\n after = grandpa;\n } else {\n if (after === parent.L) {\n RedBlackRotateRight(this, parent);\n after = parent;\n parent = after.U;\n }\n parent.C = false;\n grandpa.C = true;\n RedBlackRotateLeft(this, grandpa);\n }\n }\n parent = after.U;\n }\n this._.C = false;\n },\n\n remove: function(node) {\n if (node.N) node.N.P = node.P;\n if (node.P) node.P.N = node.N;\n node.N = node.P = null;\n\n var parent = node.U,\n sibling,\n left = node.L,\n right = node.R,\n next,\n red;\n\n if (!left) next = right;\n else if (!right) next = left;\n else next = RedBlackFirst(right);\n\n if (parent) {\n if (parent.L === node) parent.L = next;\n else parent.R = next;\n } else {\n this._ = next;\n }\n\n if (left && right) {\n red = next.C;\n next.C = node.C;\n next.L = left;\n left.U = next;\n if (next !== right) {\n parent = next.U;\n next.U = node.U;\n node = next.R;\n parent.L = node;\n next.R = right;\n right.U = next;\n } else {\n next.U = parent;\n parent = next;\n node = next.R;\n }\n } else {\n red = node.C;\n node = next;\n }\n\n if (node) node.U = parent;\n if (red) return;\n if (node && node.C) { node.C = false; return; }\n\n do {\n if (node === this._) break;\n if (node === parent.L) {\n sibling = parent.R;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateLeft(this, parent);\n sibling = parent.R;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.R || !sibling.R.C) {\n sibling.L.C = false;\n sibling.C = true;\n RedBlackRotateRight(this, sibling);\n sibling = parent.R;\n }\n sibling.C = parent.C;\n parent.C = sibling.R.C = false;\n RedBlackRotateLeft(this, parent);\n node = this._;\n break;\n }\n } else {\n sibling = parent.L;\n if (sibling.C) {\n sibling.C = false;\n parent.C = true;\n RedBlackRotateRight(this, parent);\n sibling = parent.L;\n }\n if ((sibling.L && sibling.L.C)\n || (sibling.R && sibling.R.C)) {\n if (!sibling.L || !sibling.L.C) {\n sibling.R.C = false;\n sibling.C = true;\n RedBlackRotateLeft(this, sibling);\n sibling = parent.L;\n }\n sibling.C = parent.C;\n parent.C = sibling.L.C = false;\n RedBlackRotateRight(this, parent);\n node = this._;\n break;\n }\n }\n sibling.C = true;\n node = parent;\n parent = parent.U;\n } while (!node.C);\n\n if (node) node.C = false;\n }\n};\n\nfunction RedBlackRotateLeft(tree, node) {\n var p = node,\n q = node.R,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.R = q.L;\n if (p.R) p.R.U = p;\n q.L = p;\n}\n\nfunction RedBlackRotateRight(tree, node) {\n var p = node,\n q = node.L,\n parent = p.U;\n\n if (parent) {\n if (parent.L === p) parent.L = q;\n else parent.R = q;\n } else {\n tree._ = q;\n }\n\n q.U = parent;\n p.U = q;\n p.L = q.R;\n if (p.L) p.L.U = p;\n q.R = p;\n}\n\nfunction RedBlackFirst(node) {\n while (node.L) node = node.L;\n return node;\n}\n\nexport default RedBlackTree;\n","import {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createEdge(left, right, v0, v1) {\n var edge = [null, null],\n index = edges.push(edge) - 1;\n edge.left = left;\n edge.right = right;\n if (v0) setEdgeEnd(edge, left, right, v0);\n if (v1) setEdgeEnd(edge, right, left, v1);\n cells[left.index].halfedges.push(index);\n cells[right.index].halfedges.push(index);\n return edge;\n}\n\nexport function createBorderEdge(left, v0, v1) {\n var edge = [v0, v1];\n edge.left = left;\n return edge;\n}\n\nexport function setEdgeEnd(edge, left, right, vertex) {\n if (!edge[0] && !edge[1]) {\n edge[0] = vertex;\n edge.left = left;\n edge.right = right;\n } else if (edge.left === right) {\n edge[1] = vertex;\n } else {\n edge[0] = vertex;\n }\n}\n\n// Liang–Barsky line clipping.\nfunction clipEdge(edge, x0, y0, x1, y1) {\n var a = edge[0],\n b = edge[1],\n ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?\n\n if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];\n if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];\n return true;\n}\n\nfunction connectEdge(edge, x0, y0, x1, y1) {\n var v1 = edge[1];\n if (v1) return true;\n\n var v0 = edge[0],\n left = edge.left,\n right = edge.right,\n lx = left[0],\n ly = left[1],\n rx = right[0],\n ry = right[1],\n fx = (lx + rx) / 2,\n fy = (ly + ry) / 2,\n fm,\n fb;\n\n if (ry === ly) {\n if (fx < x0 || fx >= x1) return;\n if (lx > rx) {\n if (!v0) v0 = [fx, y0];\n else if (v0[1] >= y1) return;\n v1 = [fx, y1];\n } else {\n if (!v0) v0 = [fx, y1];\n else if (v0[1] < y0) return;\n v1 = [fx, y0];\n }\n } else {\n fm = (lx - rx) / (ry - ly);\n fb = fy - fm * fx;\n if (fm < -1 || fm > 1) {\n if (lx > rx) {\n if (!v0) v0 = [(y0 - fb) / fm, y0];\n else if (v0[1] >= y1) return;\n v1 = [(y1 - fb) / fm, y1];\n } else {\n if (!v0) v0 = [(y1 - fb) / fm, y1];\n else if (v0[1] < y0) return;\n v1 = [(y0 - fb) / fm, y0];\n }\n } else {\n if (ly < ry) {\n if (!v0) v0 = [x0, fm * x0 + fb];\n else if (v0[0] >= x1) return;\n v1 = [x1, fm * x1 + fb];\n } else {\n if (!v0) v0 = [x1, fm * x1 + fb];\n else if (v0[0] < x0) return;\n v1 = [x0, fm * x0 + fb];\n }\n }\n }\n\n edge[0] = v0;\n edge[1] = v1;\n return true;\n}\n\nexport function clipEdges(x0, y0, x1, y1) {\n var i = edges.length,\n edge;\n\n while (i--) {\n if (!connectEdge(edge = edges[i], x0, y0, x1, y1)\n || !clipEdge(edge, x0, y0, x1, y1)\n || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon\n || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) {\n delete edges[i];\n }\n }\n}\n","import {createBorderEdge} from \"./Edge\";\nimport {cells, edges, epsilon} from \"./Diagram\";\n\nexport function createCell(site) {\n return cells[site.index] = {\n site: site,\n halfedges: []\n };\n}\n\nfunction cellHalfedgeAngle(cell, edge) {\n var site = cell.site,\n va = edge.left,\n vb = edge.right;\n if (site === vb) vb = va, va = site;\n if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);\n if (site === va) va = edge[1], vb = edge[0];\n else va = edge[0], vb = edge[1];\n return Math.atan2(va[0] - vb[0], vb[1] - va[1]);\n}\n\nexport function cellHalfedgeStart(cell, edge) {\n return edge[+(edge.left !== cell.site)];\n}\n\nexport function cellHalfedgeEnd(cell, edge) {\n return edge[+(edge.left === cell.site)];\n}\n\nexport function sortCellHalfedges() {\n for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {\n if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {\n var index = new Array(m),\n array = new Array(m);\n for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);\n index.sort(function(i, j) { return array[j] - array[i]; });\n for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];\n for (j = 0; j < m; ++j) halfedges[j] = array[j];\n }\n }\n}\n\nexport function clipCells(x0, y0, x1, y1) {\n var nCells = cells.length,\n iCell,\n cell,\n site,\n iHalfedge,\n halfedges,\n nHalfedges,\n start,\n startX,\n startY,\n end,\n endX,\n endY,\n cover = true;\n\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n halfedges = cell.halfedges;\n iHalfedge = halfedges.length;\n\n // Remove any dangling clipped edges.\n while (iHalfedge--) {\n if (!edges[halfedges[iHalfedge]]) {\n halfedges.splice(iHalfedge, 1);\n }\n }\n\n // Insert any border edges as necessary.\n iHalfedge = 0, nHalfedges = halfedges.length;\n while (iHalfedge < nHalfedges) {\n end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];\n start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];\n if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) {\n halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,\n Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1]\n : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1]\n : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0]\n : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0]\n : null)) - 1);\n ++nHalfedges;\n }\n }\n\n if (nHalfedges) cover = false;\n }\n }\n\n // If there weren’t any edges, have the closest site cover the extent.\n // It doesn’t matter which corner of the extent we measure!\n if (cover) {\n var dx, dy, d2, dc = Infinity;\n\n for (iCell = 0, cover = null; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n site = cell.site;\n dx = site[0] - x0;\n dy = site[1] - y0;\n d2 = dx * dx + dy * dy;\n if (d2 < dc) dc = d2, cover = cell;\n }\n }\n\n if (cover) {\n var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];\n cover.halfedges.push(\n edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,\n edges.push(createBorderEdge(site, v01, v11)) - 1,\n edges.push(createBorderEdge(site, v11, v10)) - 1,\n edges.push(createBorderEdge(site, v10, v00)) - 1\n );\n }\n }\n\n // Lastly delete any cells with no edges; these were entirely clipped.\n for (iCell = 0; iCell < nCells; ++iCell) {\n if (cell = cells[iCell]) {\n if (!cell.halfedges.length) {\n delete cells[iCell];\n }\n }\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {circles, epsilon2} from \"./Diagram\";\n\nvar circlePool = [];\n\nexport var firstCircle;\n\nfunction Circle() {\n RedBlackNode(this);\n this.x =\n this.y =\n this.arc =\n this.site =\n this.cy = null;\n}\n\nexport function attachCircle(arc) {\n var lArc = arc.P,\n rArc = arc.N;\n\n if (!lArc || !rArc) return;\n\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n if (lSite === rSite) return;\n\n var bx = cSite[0],\n by = cSite[1],\n ax = lSite[0] - bx,\n ay = lSite[1] - by,\n cx = rSite[0] - bx,\n cy = rSite[1] - by;\n\n var d = 2 * (ax * cy - ay * cx);\n if (d >= -epsilon2) return;\n\n var ha = ax * ax + ay * ay,\n hc = cx * cx + cy * cy,\n x = (cy * ha - ay * hc) / d,\n y = (ax * hc - cx * ha) / d;\n\n var circle = circlePool.pop() || new Circle;\n circle.arc = arc;\n circle.site = cSite;\n circle.x = x + bx;\n circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom\n\n arc.circle = circle;\n\n var before = null,\n node = circles._;\n\n while (node) {\n if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {\n if (node.L) node = node.L;\n else { before = node.P; break; }\n } else {\n if (node.R) node = node.R;\n else { before = node; break; }\n }\n }\n\n circles.insert(before, circle);\n if (!before) firstCircle = circle;\n}\n\nexport function detachCircle(arc) {\n var circle = arc.circle;\n if (circle) {\n if (!circle.P) firstCircle = circle.N;\n circles.remove(circle);\n circlePool.push(circle);\n RedBlackNode(circle);\n arc.circle = null;\n }\n}\n","import {RedBlackNode} from \"./RedBlackTree\";\nimport {createCell} from \"./Cell\";\nimport {attachCircle, detachCircle} from \"./Circle\";\nimport {createEdge, setEdgeEnd} from \"./Edge\";\nimport {beaches, epsilon} from \"./Diagram\";\n\nvar beachPool = [];\n\nfunction Beach() {\n RedBlackNode(this);\n this.edge =\n this.site =\n this.circle = null;\n}\n\nfunction createBeach(site) {\n var beach = beachPool.pop() || new Beach;\n beach.site = site;\n return beach;\n}\n\nfunction detachBeach(beach) {\n detachCircle(beach);\n beaches.remove(beach);\n beachPool.push(beach);\n RedBlackNode(beach);\n}\n\nexport function removeBeach(beach) {\n var circle = beach.circle,\n x = circle.x,\n y = circle.cy,\n vertex = [x, y],\n previous = beach.P,\n next = beach.N,\n disappearing = [beach];\n\n detachBeach(beach);\n\n var lArc = previous;\n while (lArc.circle\n && Math.abs(x - lArc.circle.x) < epsilon\n && Math.abs(y - lArc.circle.cy) < epsilon) {\n previous = lArc.P;\n disappearing.unshift(lArc);\n detachBeach(lArc);\n lArc = previous;\n }\n\n disappearing.unshift(lArc);\n detachCircle(lArc);\n\n var rArc = next;\n while (rArc.circle\n && Math.abs(x - rArc.circle.x) < epsilon\n && Math.abs(y - rArc.circle.cy) < epsilon) {\n next = rArc.N;\n disappearing.push(rArc);\n detachBeach(rArc);\n rArc = next;\n }\n\n disappearing.push(rArc);\n detachCircle(rArc);\n\n var nArcs = disappearing.length,\n iArc;\n for (iArc = 1; iArc < nArcs; ++iArc) {\n rArc = disappearing[iArc];\n lArc = disappearing[iArc - 1];\n setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);\n }\n\n lArc = disappearing[0];\n rArc = disappearing[nArcs - 1];\n rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);\n\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nexport function addBeach(site) {\n var x = site[0],\n directrix = site[1],\n lArc,\n rArc,\n dxl,\n dxr,\n node = beaches._;\n\n while (node) {\n dxl = leftBreakPoint(node, directrix) - x;\n if (dxl > epsilon) node = node.L; else {\n dxr = x - rightBreakPoint(node, directrix);\n if (dxr > epsilon) {\n if (!node.R) {\n lArc = node;\n break;\n }\n node = node.R;\n } else {\n if (dxl > -epsilon) {\n lArc = node.P;\n rArc = node;\n } else if (dxr > -epsilon) {\n lArc = node;\n rArc = node.N;\n } else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n\n createCell(site);\n var newArc = createBeach(site);\n beaches.insert(lArc, newArc);\n\n if (!lArc && !rArc) return;\n\n if (lArc === rArc) {\n detachCircle(lArc);\n rArc = createBeach(lArc.site);\n beaches.insert(newArc, rArc);\n newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);\n attachCircle(lArc);\n attachCircle(rArc);\n return;\n }\n\n if (!rArc) { // && lArc\n newArc.edge = createEdge(lArc.site, newArc.site);\n return;\n }\n\n // else lArc !== rArc\n detachCircle(lArc);\n detachCircle(rArc);\n\n var lSite = lArc.site,\n ax = lSite[0],\n ay = lSite[1],\n bx = site[0] - ax,\n by = site[1] - ay,\n rSite = rArc.site,\n cx = rSite[0] - ax,\n cy = rSite[1] - ay,\n d = 2 * (bx * cy - by * cx),\n hb = bx * bx + by * by,\n hc = cx * cx + cy * cy,\n vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];\n\n setEdgeEnd(rArc.edge, lSite, rSite, vertex);\n newArc.edge = createEdge(lSite, site, null, vertex);\n rArc.edge = createEdge(site, rSite, null, vertex);\n attachCircle(lArc);\n attachCircle(rArc);\n}\n\nfunction leftBreakPoint(arc, directrix) {\n var site = arc.site,\n rfocx = site[0],\n rfocy = site[1],\n pby2 = rfocy - directrix;\n\n if (!pby2) return rfocx;\n\n var lArc = arc.P;\n if (!lArc) return -Infinity;\n\n site = lArc.site;\n var lfocx = site[0],\n lfocy = site[1],\n plby2 = lfocy - directrix;\n\n if (!plby2) return lfocx;\n\n var hl = lfocx - rfocx,\n aby2 = 1 / pby2 - 1 / plby2,\n b = hl / plby2;\n\n if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;\n\n return (rfocx + lfocx) / 2;\n}\n\nfunction rightBreakPoint(arc, directrix) {\n var rArc = arc.N;\n if (rArc) return leftBreakPoint(rArc, directrix);\n var site = arc.site;\n return site[1] === directrix ? site[0] : Infinity;\n}\n","import {addBeach, removeBeach} from \"./Beach\";\nimport {sortCellHalfedges, cellHalfedgeStart, clipCells} from \"./Cell\";\nimport {firstCircle} from \"./Circle\";\nimport {clipEdges} from \"./Edge\";\nimport RedBlackTree from \"./RedBlackTree\";\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var beaches;\nexport var cells;\nexport var circles;\nexport var edges;\n\nfunction triangleArea(a, b, c) {\n return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);\n}\n\nfunction lexicographic(a, b) {\n return b[1] - a[1]\n || b[0] - a[0];\n}\n\nexport default function Diagram(sites, extent) {\n var site = sites.sort(lexicographic).pop(),\n x,\n y,\n circle;\n\n edges = [];\n cells = new Array(sites.length);\n beaches = new RedBlackTree;\n circles = new RedBlackTree;\n\n while (true) {\n circle = firstCircle;\n if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {\n if (site[0] !== x || site[1] !== y) {\n addBeach(site);\n x = site[0], y = site[1];\n }\n site = sites.pop();\n } else if (circle) {\n removeBeach(circle.arc);\n } else {\n break;\n }\n }\n\n sortCellHalfedges();\n\n if (extent) {\n var x0 = +extent[0][0],\n y0 = +extent[0][1],\n x1 = +extent[1][0],\n y1 = +extent[1][1];\n clipEdges(x0, y0, x1, y1);\n clipCells(x0, y0, x1, y1);\n }\n\n this.edges = edges;\n this.cells = cells;\n\n beaches =\n circles =\n edges =\n cells = null;\n}\n\nDiagram.prototype = {\n constructor: Diagram,\n\n polygons: function() {\n var edges = this.edges;\n\n return this.cells.map(function(cell) {\n var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });\n polygon.data = cell.site.data;\n return polygon;\n });\n },\n\n triangles: function() {\n var triangles = [],\n edges = this.edges;\n\n this.cells.forEach(function(cell, i) {\n if (!(m = (halfedges = cell.halfedges).length)) return;\n var site = cell.site,\n halfedges,\n j = -1,\n m,\n s0,\n e1 = edges[halfedges[m - 1]],\n s1 = e1.left === site ? e1.right : e1.left;\n\n while (++j < m) {\n s0 = s1;\n e1 = edges[halfedges[j]];\n s1 = e1.left === site ? e1.right : e1.left;\n if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {\n triangles.push([site.data, s0.data, s1.data]);\n }\n }\n });\n\n return triangles;\n },\n\n links: function() {\n return this.edges.filter(function(edge) {\n return edge.right;\n }).map(function(edge) {\n return {\n source: edge.left.data,\n target: edge.right.data\n };\n });\n },\n\n find: function(x, y, radius) {\n var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;\n\n // Use the previously-found cell, or start with an arbitrary one.\n while (!(cell = that.cells[i1])) if (++i1 >= n) return null;\n var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;\n\n // Traverse the half-edges to find a closer cell, if any.\n do {\n cell = that.cells[i0 = i1], i1 = null;\n cell.halfedges.forEach(function(e) {\n var edge = that.edges[e], v = edge.left;\n if ((v === cell.site || !v) && !(v = edge.right)) return;\n var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;\n if (v2 < d2) d2 = v2, i1 = v.index;\n });\n } while (i1 !== null);\n\n that._found = i0;\n\n return radius == null || d2 <= radius * radius ? cell.site : null;\n }\n}\n","import constant from \"./constant\";\nimport {x as pointX, y as pointY} from \"./point\";\nimport Diagram, {epsilon} from \"./Diagram\";\n\nexport default function() {\n var x = pointX,\n y = pointY,\n extent = null;\n\n function voronoi(data) {\n return new Diagram(data.map(function(d, i) {\n var s = [Math.round(x(d, i, data) / epsilon) * epsilon, Math.round(y(d, i, data) / epsilon) * epsilon];\n s.index = i;\n s.data = d;\n return s;\n }), extent);\n }\n\n voronoi.polygons = function(data) {\n return voronoi(data).polygons();\n };\n\n voronoi.links = function(data) {\n return voronoi(data).links();\n };\n\n voronoi.triangles = function(data) {\n return voronoi(data).triangles();\n };\n\n voronoi.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), voronoi) : x;\n };\n\n voronoi.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), voronoi) : y;\n };\n\n voronoi.extent = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];\n };\n\n voronoi.size = function(_) {\n return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];\n };\n\n return voronoi;\n}\n","import { defaultValue } from '../common-utils';\n\nconst sortSelection = (dataObjects, updateData, sortFn) =>\n (a, b) => {\n const kA = a[0];\n const kB = b[0];\n return sortFn([a[0], dataObjects.get(kA), updateData.get(kA)], [kB, dataObjects.get(kB), updateData.get(kB)]);\n };\n\n/**\n * This class represents a selection applied on a data array.\n *\n * @class Selection\n */\nclass Selection {\n /**\n * Creates an instance of Selection.\n * @param {Array} data Array of DataObjects.\n * @memberof Selection\n */\n constructor (idGetter) {\n this._dataObjects = new Map();\n this._updateData = new Map();\n this._enterData = new Map();\n this._exitData = new Map();\n this._idGetter = idGetter;\n }\n\n /**\n * This method is used to supply seed data to a selection.\n *\n * @param {Array} newData Seed data to create the enter selection.\n * @param {Functon | undefined } idGetter This function is used to uniqely identify a data entry.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n data (newData) {\n const entryData = new Map();\n const exitdata = new Map();\n const tempMap = new Map();\n const duplicateData = new Map();\n const updatedData = this._updateData;\n const idGetter = this._idGetter;\n\n newData.forEach((...params) => {\n const key = idGetter ? idGetter(...params) : params[1];\n if (!tempMap.has(key)) {\n tempMap.set(key, params[0]);\n } else {\n duplicateData.push(key, params[0]);\n }\n });\n\n let val;\n // prepare enter data\n let entries = tempMap.entries();\n while (val = entries.next().value) {\n if (!updatedData.has(val[0])) {\n entryData.set(val[0], val[1]);\n } else {\n updatedData.set(val[0], val[1]);\n }\n }\n // prepare exit data\n entries = updatedData.entries();\n while (val = entries.next().value) {\n if (!tempMap.has(val[0])) {\n exitdata.set(val[0], val[1]);\n }\n }\n\n // put duplicate data to exit list\n entries = duplicateData.entries();\n while (val = entries.next().value) {\n exitdata.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = updatedData;\n newSelection._dataObjects = this._dataObjects;\n newSelection._enterData = entryData;\n newSelection._exitData = exitdata;\n\n return newSelection;\n }\n\n /**\n * Applies the supplied callback to each data element\n * and returns a new selection.\n *\n * @param {Function} callback Callback to execute on each item.\n * @return {Selection} New selection with data created using callback.\n * @memberof Selection\n */\n append (callback) {\n let val;\n const dataObjects = new Map();\n const data = new Map();\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n dataObjects.set(val[0], callback(val[1]));\n data.set(val[0], val[1]);\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = data;\n newSelection._dataObjects = dataObjects;\n\n return newSelection;\n }\n\n /**\n * This method returns an enter selection that\n * allows or update operations.\n *\n * @return {Selection} Instance of enter selection.\n * @memberof Selection\n */\n enter () {\n this._mode = 'enter';\n return this;\n }\n\n /**\n * Returns a selection with exit data.\n *\n * @return {Selection} Instance of selection.\n * @memberof Selection\n */\n exit () {\n this._mode = 'exit';\n return this;\n }\n\n /**\n * This method merges the data of one selection with another.\n *\n * @param {Selection} selection Instance of selection.\n * @return {Selection} Modified selection.\n * @memberof Selection\n */\n merge (target) {\n const mergedObjects = new Map();\n const mergedData = new Map();\n let val;\n let entries;\n\n // merge Object and data present in this selection\n entries = this._updateData.entries();\n while (val = entries.next().value) {\n if (!this._exitData.has(val[0])) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], this._dataObjects.get(val[0]));\n }\n }\n\n // merge object from target selection\n entries = target._updateData.entries();\n while (val = entries.next().value) {\n if (!(mergedData.has(val[0]) || target._exitData.has(val[0]))) {\n mergedData.set(val[0], val[1]);\n mergedObjects.set(val[0], target._dataObjects.get(val[0]));\n }\n }\n\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = mergedData;\n newSelection._dataObjects = mergedObjects;\n\n return newSelection;\n }\n\n each (fn) {\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n fn(val[1], this._updateData.get(val[0]), val[0]);\n }\n }\n\n map (fn) {\n const newdata = new Map();\n let val;\n const entries = this._dataObjects.entries();\n\n while (val = entries.next().value) {\n newdata.set(val[0], fn(val[1], this._updateData.get(val[0]), val[0]));\n }\n const newSelection = new Selection(this._idGetter);\n newSelection._updateData = this._updateData;\n newSelection._dataObjects = newdata;\n\n return newSelection;\n }\n\n remove () {\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n\n currentData.clear();\n\n return this;\n }\n\n sort (sortFn) {\n const updateData = this._updateData;\n const dataObjects = this._dataObjects;\n const sortSel = sortSelection(dataObjects, updateData, sortFn);\n\n this._updateData = new Map([...updateData.entries()].sort(sortSel));\n this._dataObjects = new Map([...dataObjects.entries()].sort(sortSel));\n return this;\n }\n\n /**\n * Gets the object bound to a class\n *\n * @return {Object} current data set bound to the class\n * @memberof Selection\n */\n getObjects () {\n let val;\n const objects = [];\n const dataObjects = this._dataObjects;\n // select the data to create object\n const mode = defaultValue(this._mode, 'update');\n const currentData = this[`_${mode}Data`];\n const entries = currentData.entries();\n\n while (val = entries.next().value) {\n if (dataObjects.has(val[0])) {\n objects.push(dataObjects.get(val[0]));\n }\n }\n\n return objects;\n }\n}\n\nexport default Selection;\n","import Selection from './selection';\n/**\n * This function applies a selection operation on a data array.\n *\n * @export\n * @param {Array} [data=[]] The data array to be observed.\n * @return {Selection} Instance of a selection.\n */\nexport default function dataSelect (idFn) {\n return new Selection(idFn);\n}\n\n","export const ORDER_ASCENDING = 'ascending';\nexport const ORDER_DESCENDING = 'descending';\nexport const ORDER_NONE = 'none';\nexport const OFFSET_DIVERGING = 'diverging';\nexport const OFFSET_NONE = 'none';\nexport const OFFSET_EXPAND = 'expand';\nexport const OFFSET_WIGGLE = 'wiggle';\n","/* global window, requestAnimationFrame, cancelAnimationFrame */\nimport { FieldType, DimensionSubtype, DateTimeFormatter, DM_DERIVATIVES, default as DataModel } from 'datamodel';\n\nimport {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom\n} from 'd3-axis';\nimport {\n symbolCircle,\n symbolCross,\n symbolDiamond,\n symbolSquare,\n symbolStar,\n symbolWye,\n symbolTriangle,\n symbol,\n stack as d3Stack,\n stackOffsetDiverging,\n stackOrderNone,\n stackOrderAscending,\n stackOrderDescending,\n stackOffsetNone,\n stackOffsetExpand,\n stackOffsetWiggle,\n pie,\n arc,\n line,\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n area\n} from 'd3-shape';\nimport { scaleBand } from 'd3-scale';\nimport { nest } from 'd3-collection';\nimport {\n interpolate,\n interpolateRgb,\n piecewise,\n interpolateNumber,\n interpolateHslLong\n} from 'd3-interpolate';\nimport {\n easeCubic,\n easeBounce,\n easePoly,\n easeBack,\n easeCircle,\n easeLinear,\n easeElastic\n} from 'd3-ease';\nimport {\n color,\n rgb,\n hsl\n} from 'd3-color';\nimport { voronoi } from 'd3-voronoi';\nimport { dataSelect } from './DataSystem';\nimport * as scales from './scales';\nimport { DATA_TYPE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING, ReservedFields } from './enums';\nimport * as STACK_CONFIG from './enums/stack-config';\n\nconst { CATEGORICAL, TEMPORAL } = DimensionSubtype;\nconst { STRING, FUNCTION } = DATA_TYPE;\nconst { InvalidAwareTypes } = DataModel;\nconst HTMLElement = window.HTMLElement;\n\nconst isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n};\n\n/**\n * Returns unique id\n * @return {string} Unique id string\n */\nconst\n getUniqueId = () => `id-${new Date().getTime()}${Math.round(Math.random() * 10000)}`;\n\n/**\n * Deep copies an object and returns a new object.\n * @param {Object} o Object to clone\n * @return {Object} New Object.\n */\nconst clone = (o) => {\n const output = {};\n let v;\n for (const key in o) {\n if ({}.hasOwnProperty.call(o, key)) {\n v = o[key];\n output[key] = isSimpleObject(v) ? clone(v) : v;\n }\n }\n return output;\n};\n\n/**\n* Checks the existence of keys in an object\n* @param {Array} keys Set of keys which are to be checked\n* @param {Object} obj whose keys are checked from the set of keys provided\n* @return {Object} Error if the keys are absent, or the object itself\n*/\nconst checkExistence = (keys, obj) => {\n const nonExistentKeys = [];\n keys.forEach((key) => {\n if (key in obj) {\n return;\n }\n nonExistentKeys.push(key);\n });\n return nonExistentKeys;\n};\n\nconst sanitizeIP = {\n typeObj: (keys, obj) => {\n if (typeof obj !== 'object') {\n return Error('Argument type object expected');\n }\n\n const nonExistentKeys = checkExistence(keys, obj);\n if (nonExistentKeys.length) {\n return Error(`Missing keys from parameter ${nonExistentKeys.join(', ')}`);\n }\n return obj;\n },\n\n /* istanbul ignore next */ htmlElem: (elem) => {\n if (!(elem instanceof HTMLElement)) {\n return Error('HTMLElement required');\n }\n return elem;\n }\n};\n\n/**\n * Gets the maximum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Maximum value\n */\nconst getMax = (data, field) => Math.max(...data.map(d => d[field]));\n\n/**\n * Gets the minimum value from an array of objects for a given property name\n * @param {Array.} data Array of objects\n * @param {string} field Field name\n * @return {number} Minimum value\n */\nconst getMin = (data, field) => Math.min(...data.map(d => d[field]));\n\n/**\n * Gets the domain from the data based on the field name and type of field\n * @param {Array. | Array.} data Data Array\n * @param {Array.} fields Array of fields from where the domain will be calculated\n * @param {string} fieldType Type of field - nominal, quantitiative, temporal.\n * @return {Array} Usually contains a min and max value if field is quantitative or\n * an array of values if field type is nominal or ordinal\n */\nconst getDomainFromData = (data, fields, fieldType) => {\n let domain;\n const domArr = [];\n data = data[0] instanceof Array ? data : [data];\n\n switch (fieldType) {\n case CATEGORICAL:\n domain = [].concat(...data.map(arr => arr.map(d => d[fields[0]]).filter(d => d !== undefined)));\n break;\n default:\n for (let i = 0, len = data.length; i < len; i++) {\n const arr = data[i];\n const [field0, field1] = fields;\n const arr0 = arr.filter(d => !isNaN(d[field0]));\n const arr1 = arr.filter(d => !isNaN(d[field1]));\n if (arr0.length || arr1.length) {\n const firstMin = getMin(arr0, field0);\n const secondMin = getMin(arr1, field1);\n const firstMax = getMax(arr0, field0);\n const secondMax = getMax(arr1, field1);\n domArr.push([Math.min(firstMin, secondMin), Math.max(firstMax, secondMax)]);\n }\n }\n domain = domArr.length ? [Math.min(...domArr.map(d => d[0])), Math.max(...domArr.map(d => d[1]))] : [];\n break;\n }\n return domain;\n};\n\nconst sanitizeDomainWhenEqual = (domain) => {\n if (domain[0] === domain[1]) {\n domain[0] = domain[0] > 0 ? 0 : domain[0];\n domain[1] = domain[1] > 0 ? domain[1] : 0;\n }\n return domain;\n};\n\n/**\n * Union Domain values\n * @param {Array.} domains Array of domain values\n * @param {string} fieldType type of field - dimension,measure or datetime.\n * @return {Array} Unioned domain of all domain values.\n */\nconst unionDomain = (domains, fieldType) => {\n let domain = [];\n domains = domains.filter(dom => dom && dom.length);\n if (domains.length) {\n if (fieldType === CATEGORICAL) {\n domain = [].concat(...domains);\n } else {\n domain = [Math.min(...domains.map(d => d[0])), Math.max(...domains.map(d => d[1]))];\n }\n }\n\n return domain;\n};\n\nconst symbolFns = {\n circle: symbolCircle,\n cross: symbolCross,\n diamond: symbolDiamond,\n square: symbolSquare,\n star: symbolStar,\n wye: symbolWye,\n triangle: symbolTriangle\n};\n\nconst easeFns = {\n cubic: easeCubic,\n bounce: easeBounce,\n linear: easeLinear,\n elastic: easeElastic,\n back: easeBack,\n poly: easePoly,\n circle: easeCircle\n};\n\n/**\n * Returns the maximum or minimum points of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @param {string} minOrMax minimum or maximum.\n * @return {Object} Minimum or maximum point.\n */\nconst getExtremePoint = (points, compareValue, minOrMax) => {\n let extremePoint;\n let point;\n const len = points.length;\n let minOrMaxVal = minOrMax === 'max' ? -Infinity : Infinity;\n let val;\n\n for (let i = 0; i < len; i++) {\n point = points[i];\n val = point[compareValue];\n if (minOrMax === 'min' ? val < minOrMaxVal : val > minOrMaxVal) {\n minOrMaxVal = val;\n extremePoint = point;\n }\n }\n\n return extremePoint;\n};\n\n/**\n * Returns the minimum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Minimum point.\n */\nconst getMinPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'min');\n\n/**\n * Returns the maximum point of a compare value from an array of objects.\n * @param {Array} points Array of objects\n * @param {string} compareValue Key in the object on which the comparing will be done.\n * @return {Object} Maximum point.\n */\nconst getMaxPoint = (points, compareValue) => getExtremePoint(points, compareValue, 'max');\n\n/**\n * Gets the index of the closest value of the given value from the array.\n * @param {Array} arr Array of values\n * @param {number} value Value from which the nearest value will be calculated.\n * @param {string} side side property.\n * @return {number} index of the closest value\n */\n/* istanbul ignore next */const getClosestIndexOf = (arr, value, side) => {\n let low = 0;\n const arrLen = arr.length;\n let high = arrLen - 1;\n\n let mid;\n let d1;\n let d2;\n\n while (low < high) {\n mid = Math.floor((low + high) / 2);\n d1 = Math.abs(arr[mid] - value);\n d2 = Math.abs(arr[mid + 1] - value);\n\n if (d2 <= d1) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n if (!side) {\n return high;\n }\n\n const highVal = arr[high];\n if (highVal === value) {\n return high;\n } else if (highVal > value) {\n if (high === 0) { return high; }\n return side === 'left' ? high - 1 : high;\n }\n if (high === arr.length - 1) { return high; }\n return side === 'left' ? high : high + 1;\n};\n\nconst getNearestValue = (data, key) => {\n const filterData = data.filter(d => typeof d === 'number');\n return filterData[getClosestIndexOf(filterData, key)];\n};\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst getWindow = () => window;\n\n/**\n * Returns the browser window object\n * @return {Window} Window object\n*/\nconst reqAnimFrame = (() => requestAnimationFrame)();\n\nconst cancelAnimFrame = (() => cancelAnimationFrame)();\n\n/**\n * Capitalizes the first letter of the word\n * @param {string} text word\n * @return {string} Capitalized word\n */\nconst capitalizeFirst = (text) => {\n text = text.toLowerCase();\n\n return text.replace(/\\w\\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1));\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst unique = (arr, fn = d => d) => {\n const vals = arr.reduce((acc, v) => {\n acc[fn(v)] = v;\n return acc;\n }, {});\n return Object.values(vals);\n};\n\n/**\n * Gets the minimum difference between two consecutive numbers in an array.\n * @param {Array} arr Array of numbers\n * @param {number} index index of the value\n * @return {number} minimum difference between values\n */\n/* istanbul ignore next */ const getMinDiff = (arr, index) => {\n let diff;\n let uniqueVals;\n if (index !== undefined) {\n uniqueVals = unique(arr.map(d => d[index]));\n } else {\n uniqueVals = unique(arr);\n }\n if (uniqueVals.length > 1) {\n diff = Math.abs(uniqueVals[1] - uniqueVals[0]);\n for (let i = 2, len = uniqueVals.length; i < len; i++) {\n diff = Math.min(diff, Math.abs(uniqueVals[i] - uniqueVals[i - 1]));\n }\n } else {\n diff = uniqueVals[0];\n }\n\n return diff;\n};\n\n/**\n * Returns the class name appended with a given id.\n * @param {string} cls class name\n * @param {string} id unique identifier\n * @param {string} prefix string needed to add before the classname\n * @return {string} qualified class name\n */\n/* istanbul ignore next */const getQualifiedClassName = (cls, id, prefix) => {\n cls = cls.replace(/^\\.*/, '');\n return [`${prefix}-${cls}`, `${prefix}-${cls}-${id}`];\n};\n\n/**\n * This method is used to set the default value for variables\n * without sullying the code with conditional statements.\n *\n * @export\n * @param {any} param The parameter to test.\n * @param {any} value The default value to assign.\n * @return {any} The value.\n */\n/* istanbul ignore next */ const defaultValue = (param, value) => {\n if (typeof param === 'undefined' || (typeof param === 'object' && !param)) {\n return value;\n }\n return param;\n};\n\n/**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} graph graph whose dependency order has to be generated\n * @return {Object}\n */\nconst getDependencyOrder = (graph) => {\n const dependencyOrder = [];\n const visited = {};\n const keys = Object.keys(graph);\n /**\n * DESCRIPTION TODO\n *\n * @export\n * @param {Object} name\n * @return {Object}\n */\n const visit = (name) => {\n if (dependencyOrder.length === keys.length) {\n return true;\n }\n visited[name] = true;\n const edges = graph[name];\n for (let e = 0; e < edges.length; e++) {\n const dep = edges[e];\n if (!visited[dep]) {\n visit(dep);\n }\n }\n\n dependencyOrder.push(name);\n return false;\n };\n\n for (let i = 0; i < keys.length; i++) {\n if (visit(keys[i], i)) break;\n }\n\n return dependencyOrder;\n};\n\n/**\n * Iterates over the properties of an object and applies the function\n *\n * @param {any} obj object to be iterated upon\n * @param {any} fn function to be applied on it\n */\nconst objectIterator = (obj, fn) => {\n for (const key in obj) {\n if (Object.hasOwnProperty.call(obj, key)) {\n fn(key, obj);\n }\n }\n};\n\n/**\n * This class creates a d3 voronoi for retrieving the nearest neighbour of any point from a set of two\n * dimensional points\n * @class Voronoi\n */\n/* istanbul ignore next */ class Voronoi {\n /**\n * Initialize the voronoi with the data given.\n * @param {Array.} data Array of points.\n */\n constructor (data = []) {\n this._voronoi = voronoi().x(d => d.x).y(d => d.y);\n this.data(data);\n }\n\n /**\n * Sets the data to voronoi\n * @param {Array.} data Array of objects.\n * @return {Voronoi} Instance of voronoi.\n */\n data (data) {\n if (data) {\n this._voronoiFn = this._voronoi(data);\n }\n return this;\n }\n\n /**\n * Finds the closest point to the x and y position given.\n * @param {number} x x value\n * @param {number} y y value\n * @param {number} radius search radius.\n * @return {Object} Details of the nearest point.\n */\n find (x, y, radius) {\n return this._voronoiFn.find(x, y, radius);\n }\n}\n\nconst getObjProp = (obj, ...fields) => {\n if (obj === undefined || obj === null) {\n return obj;\n }\n let retObj = obj;\n for (let i = 0, len = fields.length; i < len; i++) {\n retObj = retObj[fields[i]];\n if (retObj === undefined || retObj === null) {\n break;\n }\n }\n return retObj;\n};\n\n/**\n * Sanitize an input number / string mixed number. Currently dot in the no is not supported.\n *\n * @param {number | string} val pure number or string mixed number\n * @return {number | null} Number if it can be extracted. Otherwise null\n */\nconst intSanitizer = (val) => {\n const arr = val.toString().match(/(\\d+)(px)*/g);\n if (!arr) {\n // If only characters are passed\n return null;\n }\n\n return parseInt(arr[0], 10);\n};\n\nconst generateGetterSetters = (context, props) => {\n Object.entries(props).forEach((propInfo) => {\n const prop = propInfo[0];\n const { sanitization, preset, onset, typeChecker, defaultValue: defVal } = propInfo[1];\n const prototype = context.constructor.prototype;\n if (!(Object.hasOwnProperty.call(prototype, prop))) {\n if (defVal) {\n context[`_${prop}`] = defVal;\n }\n context[prop] = (...params) => {\n if (params.length) {\n let value = params[0];\n if (sanitization) {\n value = sanitization(context, params[0], context[`_${prop}`]);\n }\n if (preset) {\n preset(context, value);\n }\n if (typeChecker && !typeChecker(value)) {\n return context[`_${prop}`];\n }\n context[`_${prop}`] = value;\n if (onset) {\n onset(context, value);\n }\n return context;\n } return context[`_${prop}`];\n };\n }\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} prop\n */\nconst getArraySum = (arr, prop) => arr.reduce((total, elem) => {\n total += prop ? elem[prop] : elem;\n return total;\n}, 0);\n\n/**\n *\n *\n * @param {*} arr1\n * @param {*} arr2\n *\n */\nconst arraysEqual = (arr1, arr2) => {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = arr1.length; i >= 0; i--) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n\n return true;\n};\n\n/* eslint valid-typeof:0 */\n/**\n * Returns a validation function which can be used to validate variables against a type and value\n *\n * @param {any} type type of value that the object should have\n * @return {Object} validation function\n */\nconst isEqual = type => (oldVal, newVal) => {\n if (type === 'Array') {\n if (!oldVal) {\n return false;\n }\n return arraysEqual(oldVal, newVal);\n } else if (type === 'Object') {\n return Object.is(oldVal, newVal);\n } return oldVal === newVal;\n};\n\n/**\n * Description @todo\n *\n * @param {any} transactionModel @todo\n * @param {any} transactionEndpoint @todo\n * @param {any} transactionItems @todo\n * @return {any} @todo\n */\nconst enableChainedTransaction = (transactionModel, transactionEndpoint, transactionItems) =>\n transactionItems.forEach(item => transactionModel\n .registerImmediateListener(item, ([, newVal]) => transactionEndpoint[item](newVal)));\n\n/**\n * Chceks if the element is istanceof HTMLElement\n *\n * @param {Object} elem any JS Object\n */\nconst isHTMLElem = elem => elem instanceof HTMLElement;\n\nconst ERROR_MSG = {\n INTERFACE_IMPL: 'Method not implemented'\n};\n\n/**\n * Merges the sink object in the source by recursively iterating through the object properties\n * @param {Object} source Source Object\n * @param {Object} sink Sink Object\n * @return {Object} Merged object\n */\nconst mergeRecursive = (source, sink) => {\n for (const prop in sink) {\n if (isSimpleObject(source[prop]) && isSimpleObject(sink[prop])) {\n mergeRecursive(source[prop], sink[prop]);\n } else if (sink[prop] instanceof Object && sink[prop].constructor === Object) {\n source[prop] = {};\n mergeRecursive(source[prop], sink[prop]);\n } else {\n source[prop] = sink[prop];\n }\n }\n return source;\n};\n\n/**\n * Creates a selection set from a data set with corresponding attributes\n *\n * @export\n * @param {Selection} sel contains previous selection\n * @param {Object} appendObj Object to be appended\n * @param {Array} data Data based on which the selection is entered/updated/removed\n * @param {Object} [attrs={}] Attributes to be set on the data\n * @return {Selection} Merged selection\n */\nconst createSelection = (sel, appendObj, data, idFn) => {\n let selection = sel || dataSelect(idFn);\n\n selection = selection.data(data);\n\n const enter = selection.enter().append(appendObj);\n const mergedSelection = enter.merge(selection);\n\n const exitSelection = selection.exit();\n exitSelection.getObjects().forEach(inst => inst.remove());\n exitSelection.remove();\n return mergedSelection;\n};\n\nconst interpolateArray = (data, fitCount) => {\n const linearInterpolate = function (before, after, atPoint) {\n return before + (after - before) * atPoint;\n };\n const newData = [];\n const springFactor = ((data.length - 1) / (fitCount - 1));\n newData[0] = data[0]; // for new allocation\n for (let i = 1; i < fitCount - 1; i++) {\n const tmp = i * springFactor;\n const before = (Math.floor(tmp)).toFixed();\n const after = (Math.ceil(tmp)).toFixed();\n const atPoint = tmp - before;\n newData[i] = linearInterpolate(data[before], data[after], atPoint);\n }\n newData[fitCount - 1] = data[data.length - 1]; // for new allocation\n return newData;\n};\n\n/**\n *\n *\n * @param {*} fn\n */\nconst nextFrame = (fn) => {\n setTimeout(() => {\n fn();\n }, 0);\n};\n\n/**\n *\n *\n * @param {*} angle\n */\nconst angleToRadian = angle => angle * Math.PI / 180;\n\n/**\n *\n *\n * @param {*} newName\n * @param {*} oldName\n */\nconst replaceCSSPrefix = () => {\n // @todo\n};\n\n/**\n * Gets the interpolator function from d3 color\n *\n */\nconst interpolator = () => interpolate;\n\n/**\n * Gets the number interpolator from d3 color\n *\n */\nconst numberInterpolator = () => interpolateNumber;\n\n/**\n * Gets the rgb interpolator from d3 color\n *\n */\nconst colorInterpolator = () => interpolateRgb;\n\n/**\n * Gets the hsl interpolator from d3 color\n *\n */\nconst hslInterpolator = () => interpolateHslLong;\n\nconst transformColors = () => ({\n color,\n rgb,\n hsl\n});\n\n/**\n * Gets the piecewise interpolator from d3 color\n *\n */\nconst piecewiseInterpolator = () => piecewise;\n\nfunction hue2rgb (p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\n\n/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number l The lightness\n * @return Array The RGB representation\n */\nconst hslToRgb = (h, s, l, a = 1) => {\n let r;\n let g;\n let b;\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\n/**\n * Converts an RGB color value to HSV. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h, s, and v in the set [0, 1].\n *\n * @param Number r The red color value\n * @param Number g The green color value\n * @param Number b The blue color value\n * @return Array The HSV representation\n */\nconst rgbToHsv = (r, g, b, a = 1) => {\n r = +r; g = +g; b = +b; a = +a;\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n default: break;\n }\n h /= 6;\n }\n return [h, s, l, a];\n};\n\n/**\n * Converts an HSV color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\n * Assumes h, s, and v are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param Number h The hue\n * @param Number s The saturation\n * @param Number v The value\n * @return Array The RGB representation\n */\nconst hsvToRgb = (h, s, v, a = 1) => {\n let r;\n let g;\n let b;\n\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0: r = v; g = t; b = p; break;\n case 1: r = q; g = v; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 3: r = p; g = q; b = v; break;\n case 4: r = t; g = p; b = v; break;\n case 5: r = v; g = p; b = q; break;\n default: break;\n }\n\n return [r * 255, g * 255, b * 255, a];\n};\n\nconst hexToHsv = (hex) => {\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => r + r + g + g + b + b);\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? rgbToHsv(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : '';\n};\n\nconst RGBAtoRGB = (r, g, b, a, r2 = 255, g2 = 255, b2 = 255) => {\n const r3 = Math.round(((1 - a) * r2) + (a * r));\n const g3 = Math.round(((1 - a) * g2) + (a * g));\n const b3 = Math.round(((1 - a) * b2) + (a * b));\n return `rgb(${r3},${g3},${b3})`;\n};\n\nconst hslaToRgb = (h, s, l, a) => {\n const [r, g, b, a1] = hslToRgb(h, s, l, a);\n return RGBAtoRGB(r, g, b, a1);\n};\n\nconst detectColor = (col) => {\n const matchRgb = /rgb\\((\\d{1,3}), (\\d{1,3}), (\\d{1,3})\\)/;\n const matchHsl = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\n\n // Source : https://gist.github.com/sethlopezme/d072b945969a3cc2cc11\n // eslint-disable-next-line\n const matchRgba = /rgba?\\(((25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,\\s*?){2}(25[0-5]|2[0-4]\\d|1\\d{1,2}|\\d\\d?)\\s*,?\\s*([01]\\.?\\d*?)?\\)/;\n // eslint-disable-next-line\n const matchHsla = /^hsla\\(([\\d.]+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n const matchHex = /^#([0-9a-f]{3}){1,2}$/i;\n\n if (matchRgb.test(col) || matchRgba.test(col)) {\n return 'rgb';\n } else if (matchHsl.test(col) || matchHsla.test(col)) {\n return 'hsl';\n } else if (matchHex.test(col)) {\n return 'hex';\n } return col;\n};\n\nfunction RGBAToHexA (rgba) {\n const sep = rgba.indexOf(',') > -1 ? ',' : ' ';\n rgba = rgba.substr(5).split(')')[0].split(sep);\n\n // Strip the slash if using space-separated syntax\n if (rgba.indexOf('/') > -1) { rgba.splice(3, 1); }\n\n for (const R in rgba) {\n const r = rgba[R];\n if (r.indexOf('%') > -1) {\n const p = r.substr(0, r.length - 1) / 100;\n\n if (R < 3) {\n rgba[R] = Math.round(p * 255);\n } else {\n rgba[R] = p;\n }\n }\n }\n\n let r = (+rgba[0]).toString(16);\n let g = (+rgba[1]).toString(16);\n let b = (+rgba[2]).toString(16);\n let a = Math.round(+rgba[3] * 255).toString(16);\n\n if (r.length === 1) { r = `0${r}`; }\n if (g.length === 1) { g = `0${g}`; }\n if (b.length === 1) { b = `0${b}`; }\n if (a.length === 1) { a = `0${a}`; }\n\n return `#${r}${g}${b}${a}`;\n}\n\nconst transformToHex = (datumStyle, colorType) => {\n if (colorType === 'rgb') {\n const [r, g, b, a] = datumStyle.replace(/[^\\d,]/g, '').split(',');\n const aa = a || 1;\n\n const rgbaString = `rgba(${r}, ${g}, ${b}, ${aa})`;\n return RGBAToHexA(rgbaString);\n }\n // Add methods to handle hsl and hex conversion\n return null;\n};\n\nconst assembleModelFromIdentifiers = (model, identifiers) => {\n let schema = [];\n let data;\n const fieldMap = model.getFieldsConfig();\n if (identifiers.length) {\n const fields = identifiers[0];\n const len = fields.length;\n for (let i = 0; i < len; i++) {\n const field = fields[i];\n const fieldObj = fieldMap[field] && Object.assign({}, fieldMap[field].def);\n if (fieldObj) {\n schema.push(Object.assign(fieldObj));\n }\n }\n\n data = [];\n const header = identifiers[0];\n for (let i = 1; i < identifiers.length; i += 1) {\n const vals = identifiers[i];\n const temp = {};\n vals.forEach((fieldVal, cIdx) => {\n temp[header[cIdx]] = fieldVal;\n });\n data.push(temp);\n }\n } else {\n data = [];\n schema = [];\n }\n\n return new model.constructor(data, schema);\n};\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} criteria\n *\n */\nconst getDataModelFromRange = (dataModel, criteria, mode, criteriaFields) => {\n if (criteria === null) return null;\n const fieldsConfig = dataModel.getFieldsConfig();\n const selFields = criteriaFields || Object.keys(criteria).filter(d => d in fieldsConfig);\n const selFn = fields => selFields.every((field) => {\n const fieldValue = fields[field].internalValue;\n const range = criteria[field][0] instanceof Array ? criteria[field][0] : criteria[field];\n\n if (typeof range[0] === STRING) {\n return range.find(d => d === fieldValue) !== undefined;\n }\n\n if (range) {\n // Check if the selected bar value lies insid e the selection box\n return fieldValue >= range[0] && fieldValue <= range[1];\n }\n\n return false;\n });\n\n return dataModel.select(selFn, {\n saveChild: false,\n mode\n });\n};\n\nconst getArrayIndexMap = arr => arr.reduce((acc, value, i) => {\n acc[value] = i;\n return acc;\n}, {});\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} identifiers\n *\n */\nconst getDataModelFromIdentifiers = (dataModel, identifiers, mode, hasBarLayer) => {\n let filteredDataModel;\n if (identifiers instanceof Array) {\n const fieldsConfig = dataModel.getFieldsConfig();\n\n const dataArr = identifiers.slice(1, identifiers.length);\n if (identifiers instanceof Function) {\n filteredDataModel = identifiers(dataModel, {}, false);\n } else if (identifiers instanceof Array && identifiers[0].length) {\n const filteredSchema = identifiers[0].filter(d => d in fieldsConfig || d === ReservedFields.ROW_ID);\n filteredDataModel = dataModel.select((fields, rowId) => {\n let include = true;\n filteredSchema.forEach((propField, idx) => {\n const value = propField === ReservedFields.ROW_ID ? rowId : fields[propField].internalValue;\n const index = dataArr.findIndex(d => d[idx] === value);\n include = include && index !== -1;\n });\n return include;\n }, {\n saveChild: false,\n mode\n });\n } else {\n filteredDataModel = dataModel.select(() => false, {\n saveChild: false,\n mode\n });\n }\n } else {\n filteredDataModel = getDataModelFromRange(dataModel, identifiers, mode, hasBarLayer);\n }\n return filteredDataModel;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} listenerMap\n */\nconst registerListeners = (context, listenerMap, ...params) => {\n const propListenerMap = listenerMap(context, ...params);\n for (const key in propListenerMap) {\n if ({}.hasOwnProperty.call(propListenerMap, key)) {\n const { namespace } = params[1];\n let ns = null;\n if (namespace) {\n ns = namespace;\n }\n const mapObj = propListenerMap[key];\n const propType = mapObj.type;\n const props = mapObj.props;\n const listenerFn = mapObj.listener;\n context.store()[propType](props, listenerFn, false, {\n namespace: ns\n });\n }\n }\n};\n\nconst isValidValue = value => !isNaN(value) && value !== -Infinity && value !== Infinity;\n/**\n *\n *\n * @param {*} str\n *\n */\nconst escapeHTML = (str) => {\n const htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n };\n const htmlEscaper = /[&<>\"'/]/g;\n return (`${str}`).replace(htmlEscaper, match => htmlEscapes[match]);\n};\n\n/**\n *\n *\n * @param {*} arr\n */\nconst transposeArray = arr => arr[0].map((col, i) => arr.map(row => row[i]));\nconst toArray = arr => (arr instanceof Array ? arr : [arr]);\nconst extendsClass = (cls, extendsFrom, found) => {\n if (!cls) {\n return false;\n }\n const prototype = cls.prototype;\n if (prototype instanceof extendsFrom) {\n found = true;\n } else {\n found = extendsClass(prototype, extendsFrom, found);\n }\n return found;\n};\n\n/**\n *\n * @param {*} dm1\n * @param {*} dm2\n */\nconst concatModels = (dm1, dm2) => {\n const dataObj1 = dm1.getData();\n const dataObj2 = dm2.getData();\n const data1 = dataObj1.data;\n const data2 = dataObj2.data;\n const schema1 = dataObj1.schema;\n const schema2 = dataObj2.schema;\n const tuples1 = {};\n const tuples2 = {};\n const commonTuples = {};\n for (let i = 0; i < data1.length; i++) {\n for (let ii = 0; ii < data2.length; ii++) {\n const row1 = data1[i];\n const row2 = data2[ii];\n const dim1Values = row1.filter((d, idx) => schema1[idx].type === FieldType.DIMENSION);\n const dim2Values = row2.filter((d, idx) => schema2[idx].type === FieldType.DIMENSION);\n const allDimSame = dim1Values.every(value => dim2Values.indexOf(value) !== -1);\n if (allDimSame) {\n const key = dim1Values.join();\n !commonTuples[key] && (commonTuples[key] = {});\n row1.forEach((value, idx) => {\n commonTuples[key][schema1[idx].name] = value;\n });\n row2.forEach((value, idx) => {\n commonTuples[key][schema2[idx].name] = value;\n });\n } else {\n const dm1Key = dim1Values.join();\n const dm2Key = dim2Values.join();\n if (!commonTuples[dm1Key]) {\n !commonTuples[dm1Key] && (commonTuples[dm1Key] = {});\n row1.forEach((value, idx) => {\n commonTuples[dm1Key][schema1[idx].name] = value;\n });\n }\n if (!commonTuples[dm2Key]) {\n !commonTuples[dm2Key] && (commonTuples[dm2Key] = {});\n row2.forEach((value, idx) => {\n commonTuples[dm2Key][schema2[idx].name] = value;\n });\n }\n }\n }\n }\n\n const commonSchema = [...schema1, ...schema2.filter(s2 => schema1.findIndex(s1 => s1.name === s2.name) === -1)];\n const data = [...Object.values(tuples1), ...Object.values(tuples2), ...Object.values(commonTuples)];\n return [data, commonSchema];\n};\n\nconst getSymbol = type => symbol().type(symbolFns[type]);\n\nconst stackOrders = {\n [STACK_CONFIG.ORDER_NONE]: stackOrderNone,\n [STACK_CONFIG.ORDER_ASCENDING]: stackOrderAscending,\n [STACK_CONFIG.ORDER_DESCENDING]: stackOrderDescending\n};\nconst stackOffsets = {\n [STACK_CONFIG.OFFSET_DIVERGING]: stackOffsetDiverging,\n [STACK_CONFIG.OFFSET_NONE]: stackOffsetNone,\n [STACK_CONFIG.OFFSET_EXPAND]: stackOffsetExpand,\n [STACK_CONFIG.OFFSET_WIGGLE]: stackOffsetWiggle\n};\n\n// eslint-disable-next-line require-jsdoc\nconst stack = params => d3Stack().keys(params.keys).offset(stackOffsets[params.offset])\n .order(stackOrders[params.order])(params.data);\n\n/**\n * Groups the data into a hierarchical tree structure based on one or more fields.\n * @param { Object } params Configuration properties for nesting data\n * @param { Array. } params.data Data which needs to be grouped\n * @param { Array. } params.keys Field indices by which the data will be grouped\n * @return { Array. } Grouped data array\n */\nconst nestCollection = (params) => {\n const nestFn = nest();\n params.keys.forEach(key => nestFn.key(d => d[key]));\n return nestFn.entries(params.data);\n};\n\n/**\n * Returns array difference, elements in array A, not in Array B\n * @param { Array. } arr Data which needs to be grouped\n * @param { Array. } arr1 Field indices by which the data will be grouped\n * @return { Array. } Returns the array difference (A - B)\n */\nconst getArrayDiff = (arr, arr1) => arr.filter(el => arr1.indexOf(el) < 0);\n\nconst pathInterpolators = {\n curveLinear,\n curveStepAfter,\n curveStepBefore,\n curveStep,\n curveCatmullRom,\n stepAfter: curveStepAfter,\n catmullRom: curveCatmullRom,\n step: curveStep,\n stepBefore: curveStepBefore,\n linear: curveLinear\n};\n\nconst Symbols = {\n axisLeft,\n axisRight,\n axisTop,\n axisBottom,\n line,\n area,\n pie,\n arc,\n nest\n};\n\nconst Scales = {\n band: scaleBand\n};\n\nconst getSmallestDiff = (points) => {\n points = points.sort((a, b) => a - b);\n let minDiff = points[1] - points[0];\n for (let i = 2; i < points.length; i++) {\n minDiff = Math.min(minDiff, points[i] - points[i - 1]);\n }\n\n return minDiff;\n};\n\nconst timeFormats = {\n millisecond: '%A, %b %e, %H:%M:%S.%L',\n second: '%A, %b %e, %H:%M:%S',\n minute: '%A, %b %e, %H:%M',\n hour: '%A, %b %e, %H:%M',\n day: '%A, %b %e, %Y',\n month: '%B %Y',\n year: '%Y'\n};\n\nconst timeDurations = [\n ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'],\n [1, 1000, 60000, 3600000, 86400000, 2592000000, 31536000000]\n];\n\nconst getNearestInterval = (interval) => {\n const index = getClosestIndexOf(timeDurations[1], interval);\n return timeDurations[0][index];\n};\n\nconst formatTemporal = (value, interval) => {\n const nearestInterval = getNearestInterval(interval);\n return DateTimeFormatter.formatAs(value, timeFormats[nearestInterval]);\n};\n\nconst temporalFields = (dataModel) => {\n const filteredFields = {};\n Object.entries(dataModel.getFieldspace().getDimension()).forEach(([fieldName, fieldObj]) => {\n if (fieldObj.subtype() === TEMPORAL) {\n filteredFields[fieldName] = fieldObj;\n }\n });\n return filteredFields;\n};\n\nconst require = (lookupWhat, lookupDetails) => ({\n resolvable: (store) => {\n const lookupTarget = store[lookupWhat];\n const depArr = lookupDetails.slice(0, lookupDetails.length - 1);\n const fn = lookupDetails[lookupDetails.length - 1]; // fn\n\n const deps = depArr.map(str => lookupTarget[str]);\n return {\n fn: fn(...deps),\n depArr\n };\n }\n});\n\nconst nextAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n };\n\nconst getValueParser = config => (val) => {\n if (InvalidAwareTypes.getInvalidType(val)) {\n return val in config ? config[val] : `${val}`;\n }\n return val;\n};\n\nconst retrieveNearestGroupByReducers = (dataModel, ...measureFieldNames) => {\n const filteredReducers = {};\n if (dataModel instanceof DataModel) {\n const derivations = [...dataModel.getDerivations().reverse(), ...dataModel.getAncestorDerivations().reverse()];\n const nearestReducers = defaultValue(\n getObjProp(derivations.find(derv => derv.op === DM_DERIVATIVES.GROUPBY), 'criteria'), {});\n\n const measures = dataModel.getFieldspace().getMeasure();\n measureFieldNames = measureFieldNames.length ? measureFieldNames : Object.keys(measures);\n measureFieldNames.forEach((measureName) => {\n if (nearestReducers[measureName]) {\n filteredReducers[measureName] = nearestReducers[measureName];\n } else {\n const measureField = measures[measureName];\n if (measureField) {\n filteredReducers[measureName] = measureField.defAggFn();\n }\n }\n });\n }\n return filteredReducers;\n};\n\nconst retrieveFieldDisplayName = (dm, fieldName) => dm.getFieldspace().fieldsObj()[fieldName].displayName();\n/**\n * Fetches the nearest sort operation details by traversing the chain of parent DataModels\n * @param {Object} dataModel Instance of DataModel\n *\n * @return {Array|null} sort criteria, null if no sort operation found\n */\nconst nearestSortingDetails = (dataModel) => {\n const allDerivations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n const nearestSortDerivation = allDerivations.reverse().find(derivation => derivation.op === DM_DERIVATIVES.SORT);\n\n return nearestSortDerivation ? nearestSortDerivation.criteria : null;\n};\n\nconst sortingOrder = (a, b) => {\n const sortOrder = !(a instanceof InvalidAwareTypes || a instanceof InvalidAwareTypes)\n ? a.localeCompare(b)\n : 1;\n return sortOrder;\n};\n\n/**\n * Map containing key, value sortingOrder pairs\n */\nconst sortOrderMap = {\n [SORT_ORDER_ASCENDING]: (firstVal, secondVal) => sortingOrder(firstVal, secondVal),\n [SORT_ORDER_DESCENDING]: (firstVal, secondVal) => sortingOrder(secondVal, firstVal)\n};\n\n/**\n * Sort categorical field based on it's sorting order\n * @param {string} sortOrder Order by which field is to be sorted (asc or desc or func)\n * @param {string} firstVal First sort parameter\n * @param {string} secondVal Second sort parameter\n * @return {number} position|null if sort order is invalid\n*/\nconst sortCategoricalField = (sortOrder, firstVal, secondVal) => {\n const sortOrderType = typeof sortOrder;\n\n if (sortOrderType === FUNCTION) {\n return sortOrder(firstVal, secondVal);\n } else if (sortOrderType === STRING) {\n if (!sortOrderMap[sortOrder]) return null;\n return sortOrderMap[sortOrder](firstVal, secondVal);\n }\n return null;\n};\n\nconst intersect = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => set.has(fn1(value)));\n};\n\nconst difference = (arr1, arr2, accessors = [v => v, v => v]) => {\n const [fn1, fn2] = accessors;\n const set = new Set(arr2.map(v => fn2(v)));\n return arr1.filter(value => !set.has(fn1(value)));\n};\n\nconst partition = (array, filterFn) => array.reduce((acc, v, i) => {\n const pass = filterFn(v, i, array);\n\n pass ? acc[0].push(v) : acc[1].push(v);\n return acc;\n}, [[], []]);\n\nconst mix = superclass => ({\n with: (...mixins) => mixins.reduce((cls, mixin) => mixin(cls), superclass)\n});\n\nconst componentRegistry = (comps) => {\n const reg = Object.assign({}, comps);\n const regObj = {\n register: (def, customKey) => {\n const key = customKey || def.formalName();\n\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n\n return regObj;\n};\n\nconst getReadableTicks = (domain, steps) => {\n // scaling the axis based on steps provided\n const orderedDomain = [Math.min(...domain), Math.max(...domain)];\n if (steps < 3) {\n return orderedDomain;\n }\n\n const tempScale = scales.scaleQuantize().domain(orderedDomain).nice();\n let tempAxis = null;\n let legendTicks = null;\n\n tempAxis = Symbols.axisBottom().scale(tempScale);\n\n legendTicks = tempAxis.scale().ticks(steps);\n\n if (Math.max(...legendTicks) < orderedDomain[1]) {\n // legendTicks.pop();\n legendTicks.push(orderedDomain[1]);\n }\n if (Math.min(...legendTicks) > orderedDomain[0]) {\n // legendTicks.shift();\n legendTicks.unshift(orderedDomain[0]);\n }\n return legendTicks;\n};\n\nconst RGBAToHSLA = (r, g, b, a = 1) => {\n // Make r, g, and b fractions of 1\n r /= 255;\n g /= 255;\n b /= 255;\n\n // Find greatest and smallest channel values\n const cmin = Math.min(r, g, b);\n const cmax = Math.max(r, g, b);\n const delta = cmax - cmin;\n let h = 0;\n let s = 0;\n let l = 0;\n\n // Calculate hue\n // No difference\n if (delta === 0) {\n h = 0;\n } else if (cmax === r) {\n // Red is max\n h = ((g - b) / delta) % 6;\n } else if (cmax === g) {\n // Green is max\n h = (b - r) / delta + 2;\n } else {\n // Blue is max\n h = (r - g) / delta + 4;\n }\n h = Math.round(h * 60);\n\n // Make negative hues positive behind 360°\n if (h < 0) { h += 360; }\n // Calculate lightness\n l = (cmax + cmin) / 2;\n // Calculate saturation\n s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\n // Multiply l and s by 100\n s = +(s * 100).toFixed(1);\n l = +(l * 100).toFixed(1);\n\n return {\n color: `hsla(${h},${s}%,${l}%,${a})`,\n code: [h, s, l, a]\n };\n};\n\nconst transformColor = (rgbaValues, { h = 0, s = 0, l = 0, a }, datum, apply) => {\n const [origH, origS, origL, origA] = RGBAToHSLA(...rgbaValues).code;\n const sanitizedA = parseFloat(a || origA, 10);\n const newH = origH + h;\n const newS = origS + s;\n const newL = origL + l;\n let newA = sanitizedA + 1;\n\n if (!apply) {\n newA = sanitizedA - 1;\n }\n\n const finalcolor = {\n color: `hsla(${newH},${newS}%,${newL}%,${newA})`,\n hsla: [newH, newS, newL, newA]\n };\n return finalcolor;\n};\n\nconst pointWithinCircle = (c, point) => {\n const { x: cx, y: cy, r } = c;\n const { x, y } = point;\n\n const dist = Math.sqrt((cx - x) ** 2 + (cy - y) ** 2);\n return dist <= r;\n};\n\n/**\n * Generates a function which performs an intersection (dataModel select)\n * operation for multiple fields\n * @param {Array} targetData - Nested array with field and values in the format:\n * [\n * [field1, field2]\n * [val1, val2]\n * ]\n * @param {Object} dm - The dataModel instance\n * @return {Function} filter function\n */\nconst dmMultipleSelection = (targetData, dm) => {\n const targetFields = targetData[0];\n const targetVals = targetData.slice(1, targetData.length);\n const payloadMap = targetVals.reduce((acc, v) => {\n acc[v] = v;\n return acc;\n }, {});\n const measures = Object.keys(dm.getFieldspace().getMeasure());\n\n const filterFn = (fields, i) => {\n const row = `${targetFields.map((field) => {\n let val;\n if (field === ReservedFields.MEASURE_NAMES) {\n val = measures;\n } else if (field === ReservedFields.ROW_ID) {\n val = i;\n } else {\n const currentField = fields[field];\n const isFieldInvalid = currentField instanceof InvalidAwareTypes;\n\n val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue;\n }\n return val;\n })}`;\n return row in payloadMap;\n };\n return filterFn;\n};\n\nexport {\n arraysEqual,\n componentRegistry,\n mix,\n partition,\n getArrayIndexMap,\n getValueParser,\n require,\n intersect,\n difference,\n Scales,\n Symbols,\n pathInterpolators,\n stack,\n nestCollection,\n getArrayDiff,\n getSymbol,\n transformColor,\n transformColors,\n detectColor,\n hexToHsv,\n hslToRgb,\n rgbToHsv,\n transformToHex,\n hsvToRgb,\n hslaToRgb,\n concatModels,\n toArray,\n angleToRadian,\n escapeHTML,\n generateGetterSetters,\n getArraySum,\n interpolator,\n piecewiseInterpolator,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n colorInterpolator,\n numberInterpolator,\n ERROR_MSG,\n reqAnimFrame,\n nextAnimFrame,\n transposeArray,\n cancelAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n symbolFns,\n easeFns,\n unique,\n clone,\n isEqual,\n interpolateArray,\n getMinPoint,\n defaultValue,\n getMaxPoint,\n getClosestIndexOf,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isSimpleObject,\n nextFrame,\n registerListeners,\n replaceCSSPrefix,\n getObjProp,\n extendsClass,\n assembleModelFromIdentifiers,\n isValidValue,\n hslInterpolator,\n getSmallestDiff,\n getNearestValue,\n retrieveNearestGroupByReducers,\n nearestSortingDetails,\n createSelection,\n formatTemporal,\n temporalFields,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n getReadableTicks,\n dmMultipleSelection,\n pointWithinCircle\n};\n","export function linear(t) {\n return +t;\n}\n","export function circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nexport function circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nexport function circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n","import {path} from \"d3-path\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport star from \"./symbol/star.js\";\nimport square from \"./symbol/square.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport wye from \"./symbol/wye.js\";\nimport constant from \"./constant.js\";\n\nexport var symbols = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\nexport default function() {\n var type = constant(circle),\n size = constant(64),\n context = null;\n\n function symbol() {\n var buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n","import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = data.length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_join from \"./join\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","import {event} from \"./selection/on\";\n\nexport default function() {\n var current = event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n}\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart(\"mouse\", container.apply(this, arguments), mouse, this, arguments);\n if (!gesture) return;\n select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\");\n }\n\n function mouseupped() {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent();\n gestures.mouse(\"end\");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, touch, this, arguments)) {\n nopropagation();\n gesture(\"start\");\n }\n }\n }\n\n function touchmoved() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture(\"drag\");\n }\n }\n }\n\n function touchended() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture(\"end\");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!customEvent(new DragEvent(drag, \"beforestart\", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[id] = gesture, n = active++; break;\n case \"end\": delete gestures[id], --active; // nobreak\n case \"drag\": p = point(container, id), n = active; break;\n }\n customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n end: transition_end\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n });\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import { select, event as d3event, selection, clientPoint } from 'd3-selection';\nimport { drag as d3drag } from 'd3-drag';\nimport 'd3-transition';\nimport { mergeRecursive } from './common-utils';\n/**\n * This function takes a raw DOM element or\n * a string and returns a d3 selection of that element.\n *\n * @param {HTMLElement | string} element The element to wrap in d3 selection.\n * @return {Selection} Instance of d3 selection.\n */\nconst selectElement = element => select(element);\n\n/**\n * It creates a new d3 element on the parent element\n * @param {Selection} parent Element to which the element is to be appended\n * @param {Object} elemType Type of the new element\n * @param {Array} data Data for the new element\n * @param {Object} selector classname/id/tagname for the element\n * @return {HTMLElement} Newly Created Element\n */\nconst makeElement = (parent, elemType, data, selector, callbacks = {}, keyFn) => {\n if ((parent instanceof HTMLElement || parent instanceof SVGElement)) {\n parent = selectElement(parent);\n }\n\n const selectorVal = selector ? selector[0] : null;\n let selectorType = null;\n let actualSelector = null;\n let element = null;\n let enterSel = null;\n let mergeSel = null;\n let filter;\n if (selectorVal) {\n if (selectorVal === '#') {\n selectorType = 'id';\n actualSelector = selector;\n } else {\n selectorType = 'class';\n actualSelector = selector[0] === '.' ? selector : `.${selector}`;\n }\n } else {\n actualSelector = elemType;\n filter = true;\n }\n element = parent.selectAll(actualSelector);\n\n filter && (element = element.filter(function () {\n return this.parentNode === parent.node();\n }));\n element = element.data(data, keyFn);\n\n enterSel = element.enter()\n .append(elemType || 'div');\n callbacks.enter && enterSel.each(function (...params) {\n callbacks.enter(selectElement(this), ...params);\n });\n\n mergeSel = enterSel.merge(element);\n callbacks.update && mergeSel.each(function (...params) {\n callbacks.update(selectElement(this), ...params);\n });\n if (selectorType === 'class') {\n mergeSel.classed(selectorVal === '.' ? selector.substring(1, selector.length) : selector, true);\n } else if (selectorType === 'id') {\n mergeSel.attr('id', selector.substring(1, selector.length));\n }\n const exitSel = element.exit();\n\n if (callbacks.exit) {\n exitSel.each(function (...params) {\n callbacks.exit(selectElement(this), ...params);\n });\n } else {\n exitSel.remove();\n }\n return mergeSel;\n};\n\n/**\n * This function applies styles to an element\n * @param {Object} elem Element Selection\n * @param {Object} styleObj Style Object to be applied\n * @return {Element} Newly Created Element\n*/\nconst applyStyle = (elem, styleObj) => {\n Object.entries(styleObj).forEach((d) => {\n elem.style(d[0], d[1]);\n }, this);\n return elem;\n};\n\n/**\n * This function appends a dom element in another element.\n * @param {HTMLElement | SVGElement} element1 The element in which to append the second element\n * @param {HTMLElement | SVGElement} element2 The element which will be appended.\n */\nconst appendElement = (element1, element2) => {\n element1.appendChild(element2);\n};\n\n/**\n * Sets the attributes to the element.\n * @param {HTMLElement | SVGElement} element Element on which attributes will be applied\n * @param {Object} attrs Attributes which need to be applied\n */\nconst setElementAttrs = (element, attrs) => {\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n element.attr(key, attrs[key]);\n }\n }\n};\n\n/**\n * Sets attributes in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which attrs will be applied\n * @param {Array.} attrs Array of attributes\n * @param {string} className className of elements to select.\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setAttrs = (element, attrs, className) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n className !== undefined ? element.selectAll(`.${className}`).each(function () {\n setElementAttrs(select(this), attrs);\n }) : setElementAttrs(element, attrs);\n return element;\n};\n\n/**\n * Adds a css class to elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst addClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, true) :\n elem.classed(className, true);\n });\n};\n\n/**\n * Removes the css class from elements which passes the filter function.If filter function is not given,\n * then all elements will be applied the class.\n * @param {HTMLElement | SVGElement} element element\n * @param {string} className css class\n * @param {string} selector css selector\n * @param {Function} filterFn filter method.\n */\nconst removeClass = (element, className, selector, filterFn) => {\n select(element).selectAll(selector).each(function (data) {\n const elem = select(this);\n filterFn ? filterFn(data) && elem.classed(className, false) :\n elem.classed(className, false);\n });\n};\n\n/**\n * Sets styles in the svg or html element\n * @param {SVGElement | HTMLElement} element The element on which styles will be applied\n * @param {Array.} styles Array of style attributes\n * @return {SVGElement | HTMLElement} SVGElement or html element.\n */\nconst setStyles = (element, styles) => {\n if (!(element instanceof selection)) {\n element = selectElement(element);\n }\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n element.style(key, styles[key]);\n }\n }\n return element;\n};\n\n/**\n * Creates svg or html elements by binding data to the selection.Removes extra elements\n * on exit.\n * @param {Object} params Parameter object\n * @param {SVGElement | HTMLElement} params.container Container element where all elements will be appended\n * @param {string} params.selector Selector by which elements will be selected from dom\n * @param {string} params.append Append tag\n * @param {Function} params.each Function which will be executed for each data point and element.\n */\nconst createElements = (params) => {\n const container = select(params.container);\n let data;\n\n data = params.data;\n if (typeof data === 'number') {\n data = Array(data).fill().map((d, i) => i);\n }\n const sel = container.selectAll(params.selector).filter(function () {\n return this.parentNode === container.node();\n }).data(data);\n\n const selectionMerge = sel.enter().append(params.append).merge(sel).each(function (d, i) {\n params.each(d, select(this), i);\n });\n\n selectionMerge.attr('class', params.className || '');\n sel.exit().remove();\n};\n\n/**\n * Clips an element with given measurement. Basically it is used to hide overflowing portions\n * of any element.\n * @param {SVGElement} container svg element which needs to be clipped.\n * @param {Object} measurement Dimensions of the clipped rectangle.\n * @param {string} id Unique id of the clip element\n */\nconst clipElement = (container, measurement, id) => {\n const clipPathElement = makeElement(select(container), 'clipPath', [1], `#${id}`);\n const clipPathRect = makeElement(clipPathElement, 'rect', [1]);\n clipPathRect.attr('x', measurement.x)\n .attr('y', measurement.x)\n .attr('width', measurement.width)\n .attr('height', measurement.height);\n clipPathElement.attr('clip-path', `url(#${id})`);\n};\n\n/**\n * Returns the element of the corresponding classname.\n * @param {HTMLElement | SVGElement} node html or svg node element.\n * @param {string} className css class to be applied.\n * @return {HTMLElement | SVGElement} html or svg element.\n */\nconst getElementsByClassName = (node, className) => select(node).selectAll(className).nodes();\n\n/**\n * Gets the mouse position relative to an svg type of element\n * @param {SVGElement} element Any svg element like rect, circle, etc.\n * @param {Event} event Event object.\n * @return {Object} x and y position relative to the container element passed.\n */\nconst getMousePos = (element, event) => {\n const boundingClientRect = element.getBoundingClientRect();\n return {\n x: event.x - boundingClientRect.x,\n y: event.y - boundingClientRect.y\n };\n};\n\nconst getClientPoint = (...params) => {\n const pos = clientPoint(...params);\n return {\n x: pos[0],\n y: pos[1]\n };\n};\n\n/** This function appends a dom element in another element.\n * @param {Object} tag The tag name of the element to append\n * @param {Object} mount Mount point fo the element\n * @return {Object} selection of the appended element\n */\nconst createElement = (tag, mount) => select(mount).append(tag).node();\n\n/**\n * Gets the d3 event function\n * @return {Object} d3 event\n */\nconst getEvent = () => d3event;\n\n/**\n * Gets the d3 drag function\n * @return {Object} d3 drag\n */\nconst getD3Drag = () => d3drag;\n\nconst getSmartComputedStyle = (group, css) => {\n let textEl;\n const testText = 'W';\n const mandatoryStyle = {\n 'fill-opacity': 0\n };\n const className = typeof css === 'string' ? css : (css instanceof Array ? css.join(' ') : undefined);\n\n if (group.node() instanceof HTMLElement) {\n textEl = group.append('div').html(testText);\n } else {\n textEl = group.append('text').text(testText);\n }\n\n if (className) {\n textEl.attr('class', className);\n } else if (typeof css === 'object') {\n delete css['fill-opacity'];\n mergeRecursive(mandatoryStyle, css);\n }\n\n textEl.style(mandatoryStyle);\n const computedStyle = window.getComputedStyle(textEl.node());\n const styleForSmartLabel = {\n fontSize: computedStyle.fontSize,\n fontFamily: computedStyle.fontFamily,\n fontWeight: computedStyle.fontWeight,\n fontStyle: computedStyle.fontStyle\n };\n\n textEl.remove();\n\n return styleForSmartLabel;\n};\n\nconst hasTouch = () => 'ontouchstart' in document.documentElement;\n\nexport {\n hasTouch,\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint\n};\n","import Model from 'hyperdis';\nimport { defaultValue, getObjProp, toArray } from './common-utils';\n\nconst initProp = (obj, props, val = () => ({})) => {\n props.forEach((prop) => {\n if (!obj[prop]) {\n obj[prop] = val();\n }\n obj = obj[prop];\n });\n return obj;\n};\n\nconst fetchPropValues = (propNames, params, deps) => params.map((param, i) => {\n const prop = propNames[i];\n\n return param.map(val => (val === undefined || val === null ? val : val[deps[prop]]));\n});\n\nconst addListenerToNamespace = (namespaceInf, fn, context) => {\n let key = namespaceInf.key;\n const namespace = namespaceInf.id;\n const listeners = context._listeners;\n\n if (namespace) {\n !listeners.get(namespace) && (listeners.set(namespace, new Map()));\n const namespaceListeners = listeners.get(namespace);\n\n if (!key) {\n key = namespaceListeners.size;\n }\n namespaceListeners.set(key, fn);\n } else {\n key = key || listeners.size;\n listeners.set(key, fn);\n }\n};\n\nconst setContexts = (contexts, propObj, contextMap) => {\n for (const key of propObj.keys()) {\n contexts[key] = {\n context: contextMap[key],\n deps: propObj.get(key).depProps\n };\n }\n return contexts;\n};\n\nconst registerPropInMaps = (store, props, namespaceInf, type) => {\n const {\n _registeredListeners: registeredListeners,\n _propListenerMap: propListenerMap\n } = store;\n const {\n subNamespace,\n namespace: ns\n } = namespaceInf;\n\n initProp(registeredListeners, [ns]);\n props.forEach((prop) => {\n const subNamespaces = defaultValue(getObjProp(registeredListeners, ns, prop, 'subNamespace'), []);\n let fns = defaultValue(getObjProp(propListenerMap, prop, type, 'fns'), 0);\n\n fns++;\n subNamespace && subNamespaces.push(subNamespace);\n registeredListeners[ns][prop] = {\n subNamespace: subNamespaces,\n allProps: props,\n subNamespaces: {}\n };\n initProp(propListenerMap, [prop, type]);\n propListenerMap[prop][type] = {\n fns,\n _fnCount: fns\n };\n });\n};\n\nconst registerListener = (context, type, ...options) => {\n const [propList, callBack, instantCall, namespaceInf = {}] = options;\n let props = propList;\n\n if (!Array.isArray(propList)) {\n props = [propList];\n }\n\n const { namespace: ns } = namespaceInf;\n const callbackFn = ((propNames, namespaceVal) => (...params) => {\n const { _savedCommits: commits, _propListenerMap: propListenerMap } = context;\n\n if (!propNames.some(prop => getObjProp(propListenerMap, prop, 'disabled'))) {\n if (namespaceVal) {\n const listenersObj = context._registeredListeners[namespaceVal];\n const contextMap = context._contextMap[namespaceVal];\n const contextsObj = {};\n\n propNames.forEach((prop) => {\n const commitsObj = defaultValue(getObjProp(commits, prop, type), {});\n const listeners = listenersObj[prop].subNamespaces;\n const propDeps = propListenerMap[prop][type];\n\n for (const nm in commitsObj) {\n const fnInf = defaultValue(propDeps[nm], { fns: 0 });\n let { fns } = fnInf;\n\n if (fns > 0) {\n setContexts(contextsObj, listeners[nm], contextMap);\n fns--;\n }\n\n if (fns <= 0) {\n delete commitsObj[nm];\n }\n fnInf.fns = fns;\n }\n });\n for (const key in contextsObj) {\n const obj = contextsObj[key];\n\n callBack(obj.context, ...fetchPropValues(propNames, params, obj.deps));\n }\n } else {\n callBack(...params);\n }\n }\n })(props, ns, type);\n\n const fn = context.model[type](props, callbackFn, instantCall);\n\n if (ns) {\n registerPropInMaps(context, props, namespaceInf, type);\n }\n addListenerToNamespace(namespaceInf, fn, context);\n};\n\nconst retrieveNamespaces = (names, key) => {\n if (names instanceof Object) {\n return [names[key]];\n } else if (names instanceof Array) {\n return names;\n }\n return [names];\n};\n\nconst createMap = () => new Map();\n\nconst listenerTypes = ['next', 'on'];\n\nconst removePropValue = (context, map, propInf) => {\n const { subNamespace: sns, prop, propListenerMap } = propInf;\n const propObj = propListenerMap[prop];\n\n listenerTypes.forEach((type) => {\n if (type in propObj) {\n delete propObj[type][sns];\n }\n });\n if (map.has(sns)) {\n const value = context.get(prop);\n\n if (value instanceof Object && sns in value) {\n delete value[sns];\n }\n map.delete(sns);\n }\n};\n\n/**\n * Methods to handle changes to table configuration and reactivity are handled by this\n * class.\n */\n/**\n * Common store class\n *\n * @class Store\n */\nexport class Store {\n /**\n * Creates an instance of Store.\n * @param {Object} config The object to create the state store with.\n * @memberof Store\n */\n constructor (config) {\n // create reactive model\n this.model = Model.create(config);\n this._listeners = new Map();\n this._registeredListeners = {};\n this._contextMap = {};\n this._commits = {};\n this._savedCommits = {};\n this._queuedProps = {};\n this._propListenerMap = {};\n this._locked = false;\n }\n\n lockModel () {\n this.model.lock();\n this._locked = true;\n return this;\n }\n\n unlockModel () {\n this._locked = false;\n this.model.unlock();\n return this;\n }\n\n /**\n * This method returns a plain JSON object\n * with all the fields in the state store.\n *\n * @return {Object} Serialized representation of state store.\n * @memberof Store\n */\n serialize () {\n return this.model.serialize();\n }\n\n lockCommits (props) {\n props.forEach((prop) => {\n this._commits[prop] = {\n locked: true,\n queue: []\n };\n });\n return this;\n }\n\n unlockCommits (props) {\n const commitsObj = this._commits;\n\n this.lockModel();\n props.forEach((prop) => {\n commitsObj[prop].locked = false;\n const queuedProps = {};\n const { queue } = commitsObj[prop];\n\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n if (namespace) {\n const propObj = initProp(queuedProps, [propName, namespace]);\n\n Object.assign(propObj, value);\n }\n });\n queue.forEach((params) => {\n const [propName, value, namespace] = params;\n\n this.commit(propName, propName in queuedProps ? queuedProps[propName][namespace] : value,\n namespace);\n });\n delete commitsObj[prop];\n });\n this.unlockModel();\n return this;\n }\n\n addSubNamespace (sns, namespace, context) {\n // Get all the listeners registered by the component\n const listeners = this._registeredListeners[namespace];\n const propListenerMap = this._propListenerMap;\n\n initProp(this._contextMap, [namespace]);\n this._contextMap[namespace][sns] = context;\n for (const key in listeners) {\n const obj = listeners[key];\n const propObj = propListenerMap[key];\n const propFns = listenerTypes.reduce((acc, type) => {\n const val = defaultValue(getObjProp(propObj, type, 'fns'), 0);\n val && (acc[type] = val);\n return acc;\n }, {});\n const { allProps, subNamespaces, subNamespace } = obj;\n const snsArr = subNamespace.length ? subNamespace : [sns];\n\n snsArr.forEach((ns) => {\n const nsObj = ns instanceof Function ? ns(context) : ns;\n const names = retrieveNamespaces(nsObj, key);\n const depProps = allProps.reduce((acc, prop) => {\n acc[prop] = ns instanceof Function ? nsObj[prop] : ns;\n return acc;\n }, {});\n\n names.forEach((nm) => {\n initProp(subNamespaces, [nm], createMap).set(sns, {\n depProps\n });\n\n for (const type in propFns) {\n initProp(propObj, [type, nm]);\n const fns = propFns[type];\n\n propObj[type][nm] = {\n fns,\n _fnCount: fns\n };\n }\n });\n });\n }\n return this;\n }\n\n /**\n * This method is used to update the value of a property in the state store.\n *\n * @param {string} propName The name of the property.\n * @param {number} value The new value of the property.\n * @memberof Store\n */\n commit (propName, value, namespace, disableListener = false) {\n let sanitizedVal = value;\n const commits = this._commits;\n const savedCommits = this._savedCommits;\n const locked = getObjProp(commits, propName, 'locked');\n const propListenerMap = this._propListenerMap[propName] || {};\n\n propListenerMap.disabled = disableListener;\n\n if (locked) {\n commits[propName].queue.push([propName, value, namespace]);\n return this;\n }\n\n if (namespace) {\n if (this._locked) {\n const queuedProps = initProp(this._queuedProps, [propName]);\n queuedProps[namespace] = value;\n sanitizedVal = queuedProps;\n } else {\n sanitizedVal = defaultValue(this.get(propName), {});\n sanitizedVal[namespace] = value;\n }\n\n listenerTypes.forEach((type) => {\n initProp(savedCommits, [propName, type]);\n savedCommits[propName][type][namespace] = true;\n if (getObjProp(propListenerMap, type, namespace)) {\n propListenerMap[type][namespace].fns = propListenerMap[type][namespace]._fnCount;\n }\n });\n }\n\n this.model.prop(propName, sanitizedVal);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */registerChangeListener (...params) {\n registerListener(this, 'next', ...params);\n return this;\n }\n\n /**\n * This method is used to register a callback that will execute\n * when one or more properties change.\n *\n * @param {string | Array} propNames name of property or array of props.\n * @param {Function} callBack The callback to execute.\n * @memberof Store\n */\n /* istanbul ignore next */ registerImmediateListener (...params) {\n registerListener(this, 'on', ...params);\n }\n\n /**\n * This method is used to get the name of the property\n * from the state store.\n *\n * @param {string} propName The name of the field in state store.\n * @return {any} The value of the field.\n * @memberof Store\n */\n get (propName, subNamespace) {\n const value = this.model.prop(propName);\n return subNamespace ? value && value[subNamespace] : value;\n }\n\n /**\n * This method is used to register a computed property that is computed every time\n * the store value changes.\n *\n * @param {string} propName The name of the property to create.\n * @param {Function} callBack The function to execute when depemdent props change.\n * @memberof Store\n */\n computed (propName, callBack) {\n return this.model.calculatedProp(propName, callBack);\n }\n\n append (...params) {\n this.model.append(...params);\n return this;\n }\n\n unsubscribeAll () {\n Object.values(this._listeners).forEach(fn => fn());\n return this;\n }\n\n unsubscribe (namespaceInf = {}) {\n const { id, key } = namespaceInf;\n const listenersMap = this._listeners;\n const listeners = listenersMap.get(id);\n\n if (key) {\n const fn = listenersMap.get(key);\n\n fn && fn();\n } else {\n for (const fn of listeners.values()) {\n fn();\n }\n listenersMap.set(id, []);\n }\n return this;\n }\n\n removeSubNamespace (subNamespace, namespace) {\n const {\n _registeredListeners: listenerMap,\n _contextMap: contextMap,\n _propListenerMap: propListenerMap\n } = this;\n const listenersObj = listenerMap[namespace];\n\n for (const prop in listenersObj) {\n const { subNamespaces } = listenersObj[prop];\n const propInf = {\n subNamespace,\n prop,\n propListenerMap\n };\n\n if (subNamespaces[subNamespace]) {\n removePropValue(this, subNamespaces[subNamespace], propInf);\n delete subNamespaces[subNamespace];\n } else {\n for (const ns in subNamespaces) {\n const snsMap = subNamespaces[ns];\n\n removePropValue(this, snsMap, propInf);\n if (!snsMap.size) {\n delete subNamespaces[ns];\n }\n }\n }\n }\n delete contextMap[namespace][subNamespace];\n return this;\n }\n}\n\n/**\n * Setter getter creator from config\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args. (Optional)\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitization: // Need for sanitization before type is checked\n * }\n * }\n *\n * @param {Object} holder an empty object on which the getters and setters will be mounted\n * @param {Object} options options config based on which the getters and setters are determined.\n * @param {Hyperdis} model optional model to attach the property. If not sent new moel is created.\n * @return {Array}\n */\nexport const transactor = (holder, options, model, namespaceInf = {}) => {\n let conf;\n const store = model instanceof Store ? model : new Store({});\n const stateProps = {};\n const { namespace, subNamespace } = namespaceInf;\n\n for (const prop in options) {\n if ({}.hasOwnProperty.call(options, prop)) {\n conf = options[prop];\n const nameSpaceProp = namespace ? `${namespace}.${prop}` : prop;\n\n if (subNamespace) {\n const value = defaultValue(store.get(nameSpaceProp), {});\n value[subNamespace] = conf.value;\n stateProps[nameSpaceProp] = value;\n } else {\n stateProps[prop] = conf.value;\n }\n\n holder[prop] = ((context, meta, nsProp) => (...params) => {\n const paramsLen = params.length;\n if (paramsLen) {\n const { takesMultipleParams = false } = meta || {};\n // If parameters are passed then it's a setter\n let val = takesMultipleParams ? params : params[0];\n\n if (meta) {\n let values;\n const prevVal = context.get(nsProp, subNamespace);\n const { sanitization, typeCheck, typeExpected } = meta;\n if (typeof sanitization === 'function') {\n // Sanitize if required\n val = sanitization(val, prevVal, holder);\n }\n\n // Checking if a setter is valid\n if (typeof typeCheck === 'function') {\n const typeCheckResult = typeCheck(val);\n\n if (typeCheckResult) {\n values = val;\n }\n } else if (typeof typeCheck === 'string' && typeCheck === 'constructor') {\n if (val && val.constructor.name === typeExpected) {\n values = val;\n }\n } else {\n values = val;\n }\n\n const preset = meta.preset;\n const oldValues = toArray(context.get(nsProp, subNamespace));\n preset && preset(values, holder);\n if (takesMultipleParams) {\n oldValues.forEach((value, i) => {\n if (values[i] === undefined) {\n values[i] = value;\n }\n });\n }\n values && context.commit(nsProp, values, subNamespace);\n } else {\n context.commit(nsProp, val, subNamespace);\n }\n return holder;\n }\n // No parameters are passed hence its a getter\n return context.get(nsProp, subNamespace);\n })(store, conf.meta, nameSpaceProp, Array.isArray(conf.value));\n }\n }\n\n if (subNamespace) {\n for (const key in stateProps) {\n store.commit(key, stateProps[key][subNamespace], subNamespace);\n }\n } else if (namespace === undefined) {\n store.append(stateProps);\n } else {\n store.append(namespace, stateProps);\n }\n\n return [holder, store];\n};\n","const events = [\n 'initialized',\n 'beforeupdate',\n 'updated',\n 'beforedraw',\n 'drawn',\n 'beforeremove',\n 'removed',\n 'animationend'\n];\n\nconst compositions = [\n 'canvas',\n 'unit',\n 'layer',\n 'axis',\n 'facet-headers',\n 'legend',\n 'caption'\n];\n\nconst EVENT_LIST = [];\n\ncompositions.forEach((composition) => {\n events.forEach((event) => {\n EVENT_LIST.push(`${composition}.${event}`);\n });\n});\n\nexport default EVENT_LIST;\n","import EVENT_LIST from './event-list';\nimport { createPromise } from './helper';\n\n/**\n * At first call it accepts one function\n * calling it second time accepts notification object.\n * notification object then called with first accepted function\n *\n * @param {Function} resolveFn a promise's resolve function\n * @return {Function} a function to accept notification object\n */\nconst resolver = resolveFn => notification => resolveFn(notification);\n\n/**\n * Checks if the property string is present in the source object\n *\n * @param {Object} source source object whom you want to check the property\n * @param {string} property key name that need to be checked\n * @return {boolean} returns true if the property found in the source object\n */\nconst hasOwn = (source, property) => Object.prototype.hasOwnProperty.call(source, property);\n\n/**\n * LifeCycleManager which goes as a dependendecy to a muze\n * it accepts notification from the entire library throughout\n * the exeecution life\n *\n * @export\n * @class LifeCycleManager\n */\nexport default class LifeCycleManager {\n\n /**\n * Creates an instance of LifeCycleManager.\n * @memberof LifeCycleManager\n */\n constructor () {\n this._eventList = EVENT_LIST;\n this._promises = new Map();\n this._notifiers = {};\n this._lifeCycles = {};\n this._unreleasedLifeCycles = {};\n this._boot();\n }\n\n /**\n * Fills all the notifiers with resolver callback\n *\n * @memberof LifeCycleManager\n */\n _boot () {\n this._notifiers = this._eventList.reduce((acc, name) => {\n acc[name] = resolver;\n return acc;\n }, {});\n this._preparePromises();\n }\n\n /**\n * Public method which gives the promise corresponding\n * to the event name\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} promise that is passed to the user\n * @memberof LifeCycleManager\n */\n retrieve (eventName) {\n return this._promises.get(eventName);\n }\n\n /**\n * Creates a promise that will be passed to user's callback\n *\n * @param {string} eventName name of the event like `canvas.drawn`\n * @return {promise} a pending promise waiting for resolve to be called\n * @memberof LifeCycleManager\n */\n _makeNotifierPromise (eventName) {\n return new Promise((resolve) => {\n this._notifiers[eventName] = resolver(resolve);\n });\n }\n\n /**\n * Prepares the promise map with pending promises\n * all the promises are in a pending state where their's\n * resolve function waiting to be called with notification object\n * @memberof LifeCycleManager\n */\n _preparePromises () {\n this._eventList.forEach((eventName) => {\n const promise = this._makeNotifierPromise(eventName);\n this._promises.set(eventName, promise);\n createPromise(promise, eventName, this);\n });\n }\n\n /**\n * Resolves the promise with notification object\n *\n * @param {string} eventName name of the event in the system\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n *\n * @memberof LifeCycleManager\n */\n _resolvePromise (eventName, notification) {\n this._notifiers[eventName](notification);\n }\n\n /**\n * Public method which is being called by different\n * subcompoents of the system at different execution atages\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n notify (notification) {\n // get the composition name from notification\n // or from static formalName() method\n const composition = notification.formalName || notification.client.constructor.formalName();\n notification.formalName = composition;\n this._releasePromisesFromCache();\n this._notify(composition, notification);\n }\n\n /**\n * Notify user the with promsie in a callback\n * if callback not found then cache it\n *\n * @param {string} composition\n * @param {Object} notification notification object\n * @param {string} notification.formalName name of the sender creating the notification\n * @param {Object} notification.client instance or array of instances sending the notification\n * @param {string} notification.action the stage name when the event happened like `beforedraw`\n * @memberof LifeCycleManager\n */\n _notify (composition, notification) {\n const stage = notification.action;\n const eventName = `${composition}.${stage}`;\n\n // resolves promise with the notification object\n this._resolvePromise(eventName, notification);\n\n // get the promise from the promise map\n const promise = this.retrieve(eventName);\n\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // if user given call back exists, then call with promise\n this._callLifeCycleCallback(composition, stage, promise);\n } else {\n // otherwise cache the promise\n this._cachePromise(composition, stage, promise);\n }\n } else {\n this._cachePromise(composition, stage, promise);\n }\n }\n\n /**\n * Calls the user's callback with callback\n *\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _callLifeCycleCallback (composition, stage, promise) {\n const eventName = `${composition}.${stage}`;\n this._lifeCycles[composition][stage](promise);\n this._resetTargetPromise(eventName);\n }\n\n /**\n * Try to clear the cached promsies once we have\n * macthed callbacks from the user\n *\n * @memberof LifeCycleManager\n */\n _releasePromisesFromCache () {\n const compositions = Object.keys(this._unreleasedLifeCycles);\n compositions.forEach((composition) => {\n const stages = Object.keys(this._unreleasedLifeCycles[composition]);\n stages.forEach((stage) => {\n if (this._lifeCycles[composition]) {\n if (this._lifeCycles[composition][stage]) {\n // take the promise from unreleased lifeCycles\n const promise = this._unreleasedLifeCycles[composition][stage];\n // call the user given callback with that promise\n this._callLifeCycleCallback(composition, stage, promise);\n // delete promise from unreleased lifeCycles\n delete this._unreleasedLifeCycles[composition][stage];\n }\n }\n });\n });\n }\n\n /**\n * Cache the promise in the map. This cache\n * then get consumed if we get user callbacks\n * @param {string} composition name of the compositon like `canvas`\n * @param {string} stage the stage name when the event happened like `beforedraw`\n * @param {promise} promise promise that is passed to the user\n * @memberof LifeCycleManager\n */\n _cachePromise (composition, stage, promise) {\n if (!hasOwn(this._unreleasedLifeCycles, composition)) {\n this._unreleasedLifeCycles[composition] = {};\n }\n\n if (!hasOwn(this._unreleasedLifeCycles[composition], stage)) {\n this._unreleasedLifeCycles[composition][stage] = {};\n }\n this._unreleasedLifeCycles[composition][stage] = promise;\n }\n\n /**\n * It register's the callbacks gievn the user\n *\n * @param {Object} [lifeCycles={}] a object with list of callbacks\n * @memberof LifeCycleManager\n */\n register (lifeCycles = {}) {\n this._lifeCycles = lifeCycles;\n // as we get all the callbacks, try to call them\n // from unreleased promise map\n this._releasePromisesFromCache();\n }\n\n /**\n * Reset the promise into pending state\n *\n * @param {string} eventName name of the event happening\n * @memberof LifeCycleManager\n */\n _resetTargetPromise (eventName) {\n setTimeout(() => {\n this._notifiers[eventName] = resolver;\n this._promises.set(eventName, this._makeNotifierPromise(eventName));\n }, 0);\n }\n}\n","import LifeCycleManager from './lifecycle-manager';\n\nexport default LifeCycleManager;\n","/**\n * Creates a new promise when the given promise is resolved. This needs to be done so that after the lifecycle event\n * is completed, then again when the event gets completed, then a new promise gets resolved.\n *\n * @param {Promise} promise Instance of promise\n * @param {string} eventName name of event\n * @param {LifeCycleManager} context Instance of lifecyclemanager\n */\nexport const createPromise = (promise, eventName, context) => {\n promise.then(() => {\n const prm = context._makeNotifierPromise(eventName);\n context._promises.set(eventName, prm);\n createPromise(prm, eventName, context);\n });\n};\n","import { default as DataModel } from 'datamodel';\nimport * as scales from './scales';\nimport * as colorSchemes from './color-schemes';\nimport * as STATE_NAMESPACES from './enums/namespace';\nimport RTree from './r-tree';\n\nconst InvalidAwareTypes = DataModel.InvalidAwareTypes;\n\nexport {\n InvalidAwareTypes,\n DataModel\n};\n\nexport {\n ReservedFields,\n CommonProps,\n COORD_TYPES\n} from './enums';\n\nexport { STATE_NAMESPACES };\n\nexport {\n scales,\n colorSchemes\n};\n\nexport {\n getNearestValue,\n getValueParser,\n transformColor,\n transformColors,\n detectColor,\n hslToRgb,\n rgbToHsv,\n hexToHsv,\n hsvToRgb,\n hslaToRgb,\n escapeHTML,\n angleToRadian,\n generateGetterSetters,\n getArraySum,\n ERROR_MSG,\n interpolator,\n colorInterpolator,\n numberInterpolator,\n piecewiseInterpolator,\n reqAnimFrame,\n cancelAnimFrame,\n nextAnimFrame,\n getMax,\n getMin,\n getDomainFromData,\n getUniqueId,\n mergeRecursive,\n unionDomain,\n replaceCSSPrefix,\n symbolFns,\n defaultValue,\n easeFns,\n clone,\n interpolateArray,\n getMinPoint,\n getMaxPoint,\n getClosestIndexOf,\n registerListeners,\n Voronoi,\n checkExistence,\n sanitizeIP,\n getMinDiff,\n capitalizeFirst,\n getWindow,\n getQualifiedClassName,\n getDependencyOrder,\n objectIterator,\n intSanitizer,\n enableChainedTransaction,\n isHTMLElem,\n isEqual,\n isSimpleObject,\n nextFrame,\n getObjProp,\n getDataModelFromIdentifiers,\n getDataModelFromRange,\n transposeArray,\n toArray,\n extendsClass,\n concatModels,\n assembleModelFromIdentifiers,\n isValidValue,\n nestCollection,\n stack,\n getSymbol,\n Scales,\n Symbols,\n pathInterpolators,\n hslInterpolator,\n getSmallestDiff,\n require,\n formatTemporal,\n nearestSortingDetails,\n createSelection,\n temporalFields,\n retrieveNearestGroupByReducers,\n retrieveFieldDisplayName,\n sanitizeDomainWhenEqual,\n sortCategoricalField,\n intersect,\n partition,\n mix,\n componentRegistry,\n getArrayDiff,\n difference,\n getArrayIndexMap,\n arraysEqual,\n getReadableTicks,\n unique,\n dmMultipleSelection,\n pointWithinCircle\n} from './common-utils';\n\nexport {\n selectElement,\n makeElement,\n applyStyle,\n addClass,\n removeClass,\n appendElement,\n setAttrs,\n setStyles,\n createElement,\n createElements,\n clipElement,\n getElementsByClassName,\n getMousePos,\n getEvent,\n getD3Drag,\n getSmartComputedStyle,\n getClientPoint,\n hasTouch\n} from './renderer-utils';\n\nexport {\n Store,\n transactor\n} from './store';\n\nexport {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'd3-time';\n\nexport { default as Smartlabel } from 'fusioncharts-smartlabel';\nexport { dataSelect } from './DataSystem';\n\nexport { default as LifeCycleManager } from './lifecycle-manager';\n\nexport {\n DimensionSubtype,\n FieldType,\n MeasureSubtype,\n DateTimeFormatter,\n DM_DERIVATIVES,\n GROUP_BY_FUNCTIONS\n} from 'datamodel';\n\nexport {\n RTree\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const STACK = 'stack';\nexport const GROUP = 'group';\nexport const IDENTITY = 'identity';\nexport const ANGLE = 'angle';\nexport const RADIUS = 'radius';\nexport const SIZE = 'size';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const TEXT = 'text';\nexport const OUTER_RADIUS_VALUE = 'outerRadiusValue';\nexport const TEXT_ANCHOR_MIDDLE = 'middle';\nexport const ENCODING = {\n X: 'x',\n Y: 'y',\n X0: 'x0',\n Y0: 'y0',\n RADIUS: 'radius',\n RADIUS0: 'radius0',\n ANGLE: 'angle',\n ANGLE0: 'angle0',\n COLOR: 'color',\n SHAPE: 'shape',\n SIZE: 'size',\n TEXT: 'text'\n};\n\nexport const STROKE_DASHARRAY = 'stroke-dasharray';\n\nexport const ASCENDING = 'asc';\n\nexport const AGG_FN_SUM = 'sum';\n\nexport const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * This is an interface class which any new layer class has to extend.\n *\n * @example\n * class BarLayer extends BaseLayer {\n * update (params) {\n * // super.update(params);\n * // Update the bar layer\n * }\n * }\n * @class\n */\nexport default class SimpleLayer {\n\n formalName () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets or gets the dependencies.\n * @param {Object} dependencies Dependencies needed by layer\n * @return {BaseLayer} Instance of base layer.\n */\n dependencies () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the config of the layer\n *\n * @param {Object} config Configuration of layer\n * @return {Object} configuration of layer\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Acts as a getter or setter function\n * When setter\n * Returns the datamodel of the layer\n * @param { DataModel } dataModel instance of DataModel\n * @return { DataModel } DataModel instance of the layer\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized schema of the layer\n * @return {Object} Serialized schema\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the unique identifier of this layer\n * @return {string} id of the layer\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n /*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldMap field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n * @private\n */\n normalizeTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of dataModel\n * @param {Object} config configuration for transforming data\n * @return {Array.} Transformed data.\n * @private\n */\n getTransformedData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a nominal field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @return {Array} Domain values array.\n */\n _calculateDomainFromData () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, color, etc.\n * @return {Object} Axis domains\n */\n getDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for getting nearest point\n * @return {BaseLayer} Instance of base layer\n */\n getNearestPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for highlighting points\n * @return {BaseLayer} Instance of base layer\n */\n highlightPoint () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Abstract method for deselecting points\n * @return {BaseLayer} Instance of base layer\n */\n dehighlightPoint () {\n return this;\n }\n\n linkLayerStore () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Sets the container element for the layer to be renderered.\n * @param {SVGElement} mountPoint SVG element or group element.\n */\n mount () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n","export const DATA = 'data';\nexport const CONFIG = 'config';\nexport const MEASUREMENT = 'measurement';\nexport const DOMAIN = 'domain';\nexport const MOUNT = 'mount';\n","import { COORD_TYPES, mergeRecursive } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nconst { CARTESIAN } = COORD_TYPES;\nexport const props = {\n axes: {},\n mount: {},\n measurement: {},\n metaInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {\n defaultValue: CARTESIAN\n },\n [PROPS.CONFIG]: {\n value: null,\n sanitization: (context, config) => {\n context._customConfig = config;\n const constructor = context.constructor;\n const newConf = mergeRecursive({}, constructor.defaultConfig());\n\n return constructor.defaultPolicy(newConf, config);\n }\n },\n encodingTransform: {},\n encodingFieldsInf: {},\n dependencies: {},\n dataProps: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { Symbols } from 'muze-utils';\nimport * as AxisOrientation from '../enums/axis-orientation';\n\n/**\n * @module Axis\n * This file exports constants that are used to reference axis orientations\n * in a consistent manner.\n */\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\n\n/**\n * This object is used to associate the axis orientation with the d3 class\n * used to represent that axis.\n */\nexport const axisOrientationMap = {\n [AxisOrientation.LEFT]: Symbols.axisLeft,\n [AxisOrientation.BOTTOM]: Symbols.axisBottom,\n [AxisOrientation.RIGHT]: Symbols.axisRight,\n [AxisOrientation.TOP]: Symbols.axisTop\n};\n","/**\n * @module axis\n * This file exports constants used to reference scale type\n * consistently throughout the project.\n */\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const TIME = 'temporal';\nexport const COLOR = 'color';\nexport const ORDINAL = 'ordinal';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\nexport const LOG = 'log';\nexport const POW = 'pow';\nexport const IDENTITY = 'identity';\nexport const SEQUENTIAL = 'sequential';\nexport const THRESHOLD = 'threshold';\n","export const CLASSPREFIX = 'muze';\n\nexport const CONTINOUS = 'continous';\nexport const DISCRETE = 'discrete';\nexport const SEQUENTIAL = 'sequential';\nexport const ORDINAL = 'ordinal';\nexport const LINEAR = 'linear';\nexport const BAND = 'band';\nexport const THRESHOLD = 'threshold';\nexport const QUANTIZE = 'quantize';\nexport const QUANTILE = 'quantile';\n\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\n\nexport const DOMAIN = 'domain';\nexport const HIDDEN = 'hidden';\nexport const NUMBER = 'number';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\n\nexport const RGB = 'rgb';\nexport const HEX = 'hex';\nexport const HSLA = 'hsla';\nexport const HSL = 'hsl';\n\nexport const DEFAULT_ANGLE_DOMAIN = [1];\nexport const MIN_NO_OF_TICKS = 2;\nexport const DEFAULT_NO_OF_TICKS = 10;\n\n","import { scales, colorSchemes } from 'muze-utils';\n\nimport {\n SEQUENTIAL,\n ORDINAL,\n LINEAR,\n CONTINOUS,\n THRESHOLD,\n QUANTIZE\n} from './enums/constants';\n\nimport * as ScaleType from './enums/scale-type';\n\nconst {\n scaleLinear,\n scaleThreshold,\n scaleLog,\n scalePow,\n scaleIdentity,\n scaleOrdinal,\n scaleSequential,\n scaleQuantize,\n scaleQuantile,\n schemeCategory10,\n schemeCategory20,\n schemeCategory20b,\n scaleBand,\n scaleTime\n} = scales;\nexport const scaleMap = {\n [ScaleType.LINEAR]: scaleLinear,\n [ScaleType.BAND]: scaleBand,\n [ScaleType.QUANTIZE]: scaleQuantize,\n [ScaleType.QUANTILE]: scaleQuantile,\n [ScaleType.THRESHOLD]: scaleThreshold,\n [ScaleType.SEQUENTIAL]: scaleSequential,\n [ScaleType.LOG]: scaleLog,\n [ScaleType.POW]: scalePow,\n [ScaleType.IDENTITY]: scaleIdentity,\n [ScaleType.TIME]: scaleTime,\n [ScaleType.COLOR]: scaleLinear,\n [ScaleType.ORDINAL]: scaleOrdinal\n};\nexport const SCHEMES = {\n SCHEME1: schemeCategory10,\n SCHEME2: schemeCategory20,\n SCHEME3: schemeCategory20b\n};\n\n/**\n * Accepts a scheme in a string format and returns the scale from d3-scale-chromatic\n *\n * @export\n * @param {string} scheme a string representing the kind of scheme for the color axis\n * @return {Object} The corresponding scale from a scheme type from d3 chromatic scale\n */\nexport function getScheme (scheme) {\n if (scheme[0] === 'i') {\n return scaleSequential(colorSchemes[scheme]);\n }\n return scaleOrdinal(colorSchemes[scheme]);\n}\n\n/**\n *\n *\n * @export\n * @param {*} scheme\n *\n */\nexport function getSchemeType (scheme) {\n let schemeType = '';\n if (scheme && typeof (scheme) === 'string') {\n schemeType = scheme[0] === 'i' ? SEQUENTIAL : ORDINAL;\n } else {\n schemeType = ORDINAL;\n }\n return schemeType;\n}\n\n/**\n * This function is used to create a scale that is assigned to\n * an instance of axis.\n *\n * @export\n * @param {Object} params the input parameters to create a Scale object\n * @param {string} params.type the type of scale\n * @param {Array} params.range the range of scale\n * @return {Object} instance of scale\n */\nexport function createScale (params) {\n if (!params.type || !scaleMap[params.type]) {\n throw new Error(`${params.type} is not a valid scale type`);\n }\n if (!Array.isArray(params.range)) {\n throw new Error('range parameter must be an array');\n }\n let scaleFactory = null;\n const range = params.range;\n // @todo: do it using scale decorator\n if (params.type === LINEAR && params.interpolator) {\n scaleFactory = scaleMap[params.interpolator];\n if (params.interpolator === ScaleType.POW) {\n return scaleFactory().range(range).exponent(params.exponent);\n } else if (params.interpolator === ScaleType.LOG) {\n return scaleFactory().range(range).base([params.base]);\n }\n } else {\n scaleFactory = scaleMap[params.type];\n }\n\n if (params.type === QUANTIZE) {\n scaleFactory().nice();\n }\n return scaleFactory().range(range);\n}\n\n/**\n * This method is used to update the range of a scale\n * so that the core module can remain agnostic of the d3\n * scale api.\n *\n * @export\n * @param {Scale} scale Instance of d3 Scale.\n * @param {Array} range new range of the scale.\n * @return {Scale} Updated scale.\n */\nexport function updateScaleRange (scale, range) {\n return scale.range(range);\n}\n\n/**\n *\n *\n * @export\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} steps\n *\n */\nexport function getScaleType (domainType, rangeType, steps) {\n if (rangeType === CONTINOUS) {\n return LINEAR;\n }\n if (domainType === CONTINOUS) {\n if (steps instanceof Array) {\n return THRESHOLD;\n }\n return QUANTIZE;\n }\n return ORDINAL;\n}\n","import { getUniqueId } from 'muze-utils';\nimport { CLASSPREFIX } from '../enums/constants';\n\n/**\n *\n *\n */\nexport const defaultConfig = {\n id: getUniqueId(),\n adjustRange: false,\n axisName: {\n defClassName: 'axis-name'\n },\n axisNamePadding: 7,\n base: 10,\n classPrefix: CLASSPREFIX,\n className: `${CLASSPREFIX}-axis`,\n exponent: 1,\n interpolator: 'linear',\n fixedBaseline: true,\n labels: {\n rotation: null,\n smartTicks: null\n },\n orientation: 'left',\n numberFormat: val => val,\n padding: 0.3,\n nice: true,\n numberOfTicks: null,\n rotate: false,\n show: true,\n showAxisName: true,\n showInnerTicks: true,\n showOuterTicks: true,\n style: {},\n type: 'linear',\n tickFormat: null,\n tickValues: null,\n xOffset: 0,\n yOffset: 0,\n defaultSort: 'asc'\n};\n\n","/**\n * This file exports functionality that is used to render axis.\n */\nimport { selectElement, makeElement, angleToRadian } from 'muze-utils';\nimport * as AxisOrientation from './enums/axis-orientation';\nimport { LINEAR, HIDDEN, BOTTOM, TOP } from './enums/constants';\n\n/**\n *\n *\n * @param {*} instance\n * @param {*} container\n * @param {*} labelManager\n * @param {*} config\n */\nconst rotateAxis = (instance, tickText, labelManager) => {\n let rotation;\n const axis = instance.axis();\n const config = instance.config();\n const renderConfig = instance.renderConfig();\n const smartTicks = instance.smartTicks();\n const scale = axis.scale();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n const ticks = labelFunc();\n const {\n orientation,\n fixedBaseline,\n type\n } = config;\n const {\n labels\n } = renderConfig;\n\n rotation = labels.rotation;\n\n const tickSize = instance.getTickSize();\n tickText.each(function (d, index) {\n let yShift;\n let xShift;\n let datum = smartTicks[index] ? smartTicks[index].text : d;\n\n datum = datum.toString();\n\n const tickLabelDim = labelManager.getOriSize(datum);\n\n const width = tickLabelDim.width * 0.5;\n const height = tickLabelDim.height * 0.5;\n\n if (rotation < 0) {\n rotation = 360 + rotation;\n }\n\n const quadrant = 4 - Math.floor(rotation / 90);\n const rotationNormalizer = ((quadrant % 2 === 0) ? rotation : 180 * Math.ceil(rotation / 180) - rotation) % 180;\n\n yShift = Math.sqrt(height ** 2 + width ** 2) * Math.sin(angleToRadian(rotationNormalizer));\n\n if ((quadrant === 3 || quadrant === 2) && !(rotationNormalizer > 67.5 && rotationNormalizer <= 90)) {\n yShift += height * 2;\n }\n xShift = width;\n\n if (rotation === 90) {\n xShift = height;\n } else if (rotation === 270) {\n xShift = -height;\n } else {\n xShift = 0;\n }\n\n if (orientation === AxisOrientation.TOP) {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift + xShift / 2 : xShift;\n selectElement(this)\n .attr('transform', `translate(${-xShift + tickSize}\n ${-yShift - tickSize}) rotate(${rotation})`);\n } else {\n xShift = (fixedBaseline && ticks[0] === d && type === LINEAR) ? xShift - xShift / 2 : xShift;\n\n selectElement(this)\n .attr('transform', `translate(${xShift - tickSize}\n ${yShift + tickSize}) rotate(${rotation})`);\n }\n // selectElement(this).transition()\n // .duration(1000).text(datum);\n });\n return tickText;\n};\n\n/**\n *\n *\n * @param {*} tickText\n * @param {*} axisInstance\n */\nconst changeTickOrientation = (selectContainer, axisInstance, tickSize) => {\n const {\n _smartTicks\n } = axisInstance;\n const config = axisInstance.config();\n const renderConfig = axisInstance.renderConfig();\n const labelManager = axisInstance.dependencies().labelManager;\n const {\n orientation,\n classPrefix\n } = config;\n const {\n labels\n } = renderConfig;\n const {\n rotation,\n smartTicks: isSmartTicks\n } = labels;\n\n const tickText = selectContainer.selectAll('.tick text');\n tickText.selectAll('tspan').remove();\n\n // rotate labels if not enough space is available\n if (rotation && (orientation === TOP || orientation === BOTTOM)) {\n rotateAxis(axisInstance, tickText, labelManager);\n } else if (!rotation && !isSmartTicks) {\n tickText.attr('transform', '');\n } else {\n tickText.text('');\n if (orientation === TOP || orientation === BOTTOM) {\n tickText.attr('y', 0)\n .attr('x', 0)\n .attr('transform', '')\n .text('');\n const tspan = makeElement(tickText, 'tspan', (d, i) => {\n if (_smartTicks[i]) {\n return _smartTicks[i].lines;\n } return [];\n }, `${classPrefix}-smart-text`);\n\n tspan.attr('dy', '0')\n .style('opacity', '0')\n\n .transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .attr('dy', (d, i) => {\n if (orientation === BOTTOM || i !== 0) {\n return _smartTicks[0].oriTextHeight;\n }\n return -_smartTicks[0].oriTextHeight * (_smartTicks[0].lines.length - 1) - tickSize;\n })\n .style('opacity', 1)\n .text(e => e)\n .attr('x', 0);\n } else {\n const tspan = makeElement(tickText, 'tspan', (d, i) => _smartTicks[i].lines, `${classPrefix}-smart-text`);\n tspan.text(e => e);\n }\n }\n\n return tickText;\n};\n\nconst setFixedBaseline = (axisInstance) => {\n const {\n fixedBaseline\n } = axisInstance.config();\n const {\n showInnerTicks\n } = axisInstance.renderConfig();\n const domain = axisInstance.domain();\n if (fixedBaseline && domain.length && showInnerTicks) {\n axisInstance.setFixedBaseline();\n }\n};\n\n/**\n *\n *\n * @param {*} textNode\n * @param {*} orientation\n * @param {*} measures\n */\nconst setAxisNamePos = (textNode, orientation, measures) => {\n const {\n axisNameHeight,\n availableSpace\n } = measures;\n\n switch (orientation) {\n case AxisOrientation.LEFT:\n textNode.attr('transform',\n `translate(${-(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(-90)`);\n break;\n case AxisOrientation.RIGHT:\n textNode.attr('transform',\n `translate(${(availableSpace.width - axisNameHeight)},${availableSpace.height / 2})rotate(90)`);\n break;\n case AxisOrientation.TOP:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${-availableSpace.height + axisNameHeight})`);\n break;\n case AxisOrientation.BOTTOM:\n textNode.attr('transform',\n `translate(${availableSpace.width / 2},${availableSpace.height - axisNameHeight / 2})`);\n break;\n default:\n }\n return textNode;\n};\n\n/**\n * This method is used to render the axis inside an\n * svg container.\n *\n * @export\n * @param {Object} axisInstance the nput object required to render axis\n * @param {string} axisInstance.orientation the orientation of axis\n * @param {Object} axisInstance.scale instance of d3 scale\n * @param {SVGElement} axisInstance.container the container in which to render\n */\nexport function renderAxis (axisInstance) {\n const renderConfig = axisInstance.renderConfig();\n const config = axisInstance.config();\n\n const {\n show,\n xOffset,\n yOffset,\n showAxisName,\n labels,\n smartAxisName\n } = renderConfig;\n const mount = axisInstance.mount();\n\n const {\n orientation,\n axisNamePadding,\n className,\n id,\n classPrefix\n } = config;\n\n if (!show) {\n return;\n }\n\n const selectContainer = makeElement(selectElement(mount), 'g', [axisInstance], `${className}`, {},\n key => key.config().id);\n selectContainer.attr('transform', `translate(${xOffset},${yOffset})`);\n\n let availableSpace;\n let labelProps;\n let tickSize;\n if (axisInstance.domain().length > 0) {\n const labelManager = axisInstance.dependencies().labelManager;\n const range = axisInstance.range();\n const axis = axisInstance.axis();\n const scale = axisInstance.scale();\n\n const {\n _tickLabelStyle: tickLabelStyle,\n _tickFormatter: axisTickFormatter\n } = axisInstance;\n\n tickSize = axisInstance.getTickSize();\n\n // Set style for tick labels\n labelManager.setStyle(tickLabelStyle);\n\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n const ticks = axis.tickValues() || labelFunc();\n\n axis.tickFormat(axisTickFormatter(ticks));\n\n // Get range(length of range)\n availableSpace = Math.abs(range[0] - range[1]);\n\n // Get width and height taken by axis labels\n labelProps = axisInstance.axisComponentDimensions().largestTickDimensions;\n\n // Draw axis ticks\n setFixedBaseline(axisInstance);\n if (!labels.rotation && labels.smartTicks === false) {\n selectContainer.transition()\n .duration(1000)\n .on('end', axisInstance.registerAnimationDoneHook())\n .call(axis);\n } else {\n selectContainer.call(axis);\n changeTickOrientation(selectContainer, axisInstance, tickSize);\n }\n\n selectContainer.selectAll('.tick').classed(`${classPrefix}-ticks`, true);\n selectContainer.selectAll('.tick line').classed(`${classPrefix}-tick-lines`, true);\n\n // Set classes for ticks\n const tickText = selectContainer.selectAll('.tick text');\n tickText.classed(`${classPrefix}-ticks`, true)\n .classed(`${classPrefix}-ticks-${id}`, true);\n }\n // Create axis name\n const textNode = makeElement(selectContainer, 'text', [smartAxisName], `${classPrefix}-axis-name`)\n .attr('text-anchor', 'middle')\n .classed(`${classPrefix}-axis-name-${id}`, true)\n .text(d => d.text);\n\n // Hide axis name if show is off\n textNode.classed(HIDDEN, !showAxisName);\n\n // render labels based on orientation of axis\n const labelOffset = availableSpace / 2;\n\n const measures = {\n labelProps,\n tickSize,\n axisNamePadding,\n axisNameHeight: smartAxisName.height,\n yOffset,\n xOffset,\n labelOffset,\n availableSpace: axisInstance.availableSpace()\n };\n // Set position for axis name\n setAxisNamePos(textNode, orientation, measures);\n}\n","import {\n timeMillisecond,\n timeSecond,\n timeMinute,\n timeHour,\n timeDay,\n timeWeek,\n timeMonth,\n timeYear\n} from 'muze-utils';\n\nconst durationSecond = 1000;\nconst durationMinute = durationSecond * 60;\nconst durationHour = durationMinute * 60;\nconst durationDay = durationHour * 24;\nconst durationWeek = durationDay * 7;\nconst durationMonth = durationDay * 30;\nconst durationYear = durationDay * 365;\n\n// Longest Word for each level based on which tick skipping is decided\nconst longestWord = {\n month: 'September',\n quarter: 'October',\n halfYearly: 'July',\n year: 9999,\n day: 'September',\n hour: '24 AM',\n mintues: '60:60',\n seconds: ':60',\n week: 'Wed 31'\n};\n\n// These are the various levels of ticks that can be shown by Muze.\n// Each level is described as how frequently the ticks appear\n// The format is as follows:\n// [Frequency, Milliseconds, Name of Seconds, Tick Generator, Level Type]\nconst tickIntervals = [\n [1, 1, 'milliseconds', timeMillisecond.every(1), 'seconds'],\n [1, durationSecond, 'seconds', timeSecond.every(1), 'seconds'],\n [5, 5 * durationSecond, 'five seconds', timeSecond.every(5), 'seconds'],\n [10, 10 * durationSecond, 'ten seconds', timeSecond.every(10), 'seconds'],\n [15, 15 * durationSecond, 'fifteen seconds', timeSecond.every(15), 'seconds'],\n [30, 30 * durationSecond, 'thirty seconds', timeSecond.every(30), 'seconds'],\n [1, durationMinute, 'minute', timeMinute.every(1), 'minutes'],\n [5, 5 * durationMinute, 'five minutes', timeMinute.every(5), 'minutes'],\n [10, 10 * durationMinute, 'ten minutes', timeMinute.every(10), 'minutes'],\n [15, 15 * durationMinute, 'fifteen minutes', timeMinute.every(15), 'minutes'],\n [30, 30 * durationMinute, 'thirty minutes', timeMinute.every(30), 'minutes'],\n [1, durationHour, 'hour', timeHour.every(1), 'hour'],\n [3, 3 * durationHour, 'three hours', timeHour.every(3), 'hour'],\n [6, 6 * durationHour, 'six hours', timeHour.every(6), 'hour'],\n [12, 12 * durationHour, 'twelve hours', timeHour.every(12), 'hour'],\n [1, durationDay, 'daily', timeDay.every(1), 'day'],\n [1, durationWeek, 'weekly', timeWeek.every(1), 'week'],\n [1, durationMonth, 'monthly', timeMonth.every(1), 'week'],\n [3, 3 * durationMonth, 'quaterly', timeMonth.every(3), 'quarter'],\n [6, 6 * durationMonth, 'half yearly', timeMonth.every(6), 'halfYearly'],\n [1, durationYear, 'yearly', timeYear.every(1), 'year'],\n [2, 2 * durationYear, '2 year', timeYear.every(2), 'year'],\n [3, 3 * durationYear, '3 year', timeYear.every(3), 'year'],\n [5, 5 * durationYear, '5 year', timeYear.every(5), 'year'],\n [10, 10 * durationYear, 'decade', timeYear.every(10), 'year'],\n [100, 100 * durationYear, 'century', timeYear.every(100), 'year'],\n [1000, 1000 * durationYear, 'millenium', timeYear.every(1000), 'year']\n];\n/**\n * Get the actual tick interval based on the available width, number of ticks\n * and the distance between two ticks\n *\n * @param {Object} context Axis Context\n * @param {number} noOfTicks Number of Ticks based on which interval is calculated\n * @return {number} The width for the tick interval\n */\nconst getActualTickInterval = (context, noOfTicks) => {\n const minTickDistance = context._minTickDistance;\n const minWidthBetweenTicks = minTickDistance.width;\n\n const { width } = context.availableSpace();\n const actualTickInterval = Math.floor(((width - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks));\n\n return actualTickInterval;\n};\n\n/**\n * Get the tick interval based on the current level of ticks. Levels are decided on\n * the number of ticks that are possible to show\n *\n * @param {Object} context Axis Context\n * @param {string} type Type of level (yearly, monthly, etc)\n * @return {number} The width for the tick interval\n */\nconst getTickIntervalBasedOnCurrentLevel = (context, type) => {\n const labelManager = context._dependencies.labelManager;\n const longestWordType = longestWord[type];\n const measure = labelManager.getOriSize(longestWordType);\n\n return measure.width;\n};\n\nconst getTickIntervalFnBasedOnNumberOfTicks = (interval, count, context) => {\n let possibleTickLevelIndex = tickIntervals.length - 1;\n let maxPossibleTicks = 1;\n let tickIntervalLevelInfo = null;\n\n // Decide possible tick level based on min tick width (with ellipses)\n for (let i = tickIntervals.length - 1; i >= 0; i--) {\n const tickIntervalInfo = tickIntervals[i];\n const numOfPossibleTicks = Math.floor(interval / tickIntervalInfo[1]);\n if (numOfPossibleTicks <= count) {\n possibleTickLevelIndex = i;\n maxPossibleTicks = numOfPossibleTicks;\n }\n }\n\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex];\n\n // Get actual tick interval based on the level of ticks generated\n const actualTickInterval = getActualTickInterval(context, maxPossibleTicks);\n\n // Maximum Possible tick Interval for a particular level based on a pre decided set of values\n const maxTickInterval = getTickIntervalBasedOnCurrentLevel(context, tickIntervalLevelInfo[4]);\n\n // Display the next level involving tick skipping if current level does not meet the requirement\n // for displaying max tick\n if (actualTickInterval < maxTickInterval && possibleTickLevelIndex < tickIntervals.length - 1) {\n tickIntervalLevelInfo = tickIntervals[possibleTickLevelIndex + 1];\n }\n return tickIntervalLevelInfo[3];\n};\n\nexport const getSkippedTicks = (context, maxPossibleTicks) => {\n let actualNumberOfTicks = maxPossibleTicks;\n const domain = context.domain();\n const minDiff = context._minDiff;\n // Get the interval in ms from the domain\n const millisecondInterval = domain[1] - domain[0];\n // Get number of ticks based on the minimum difference in the data\n const numOfTicksAccordingToMinDiff = Math.floor(millisecondInterval / minDiff);\n\n // Show ticks according to min diff if possible\n if (maxPossibleTicks >= numOfTicksAccordingToMinDiff) {\n actualNumberOfTicks = numOfTicksAccordingToMinDiff;\n }\n\n return getTickIntervalFnBasedOnNumberOfTicks(millisecondInterval, actualNumberOfTicks, context);\n};\n","import { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { getSkippedTicks } from './skip-ticks';\nimport { TIME, LINEAR, BAND } from '../enums/scale-type';\n\nexport const applyTickSkipping = (context) => {\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = minTickSpace.width;\n\n const { width } = context.availableSpace();\n\n const maxTicks = Math.floor((width + minWidthBetweenTicks) / (minTickWidth + minWidthBetweenTicks));\n\n const ticks = context.scale().ticks(getSkippedTicks(context, maxTicks));\n\n context.renderConfig({\n tickValues: ticks\n });\n};\n\nconst adjustHorizontalRange = (range, diff) => {\n range[0] += diff;\n range[1] -= diff;\n return range;\n};\n\nconst adjustVerticalRange = (range, diff) => {\n range[0] -= diff;\n range[1] += diff;\n return range;\n};\n\nconst rangeAdjustmentMap = {\n [TOP]: adjustHorizontalRange,\n [BOTTOM]: adjustHorizontalRange,\n [LEFT]: adjustVerticalRange,\n [RIGHT]: adjustVerticalRange\n};\n\nexport const setAxisRange = (context, type, rangeBounds, offset) => {\n context.range(rangeBounds);\n offset && context.renderConfig({ [`${type}Offset`]: offset });\n};\n\nconst getAxisOffset = (timeDiff, range, domain) => {\n const avWidth = Math.abs(range[1] - range[0]);\n const pvr = avWidth / (domain[1] - domain[0]);\n const width = (pvr * timeDiff);\n const bars = avWidth / width;\n const barWidth = avWidth / (bars + 1);\n const diff = avWidth - barWidth * bars;\n\n return diff / 2;\n};\n\nexport const getAdjustedRange = (minDiff, range, domain, config) => {\n const {\n orientation,\n adjustRange\n } = config;\n const diff = getAxisOffset(minDiff, range, domain);\n\n if (adjustRange) {\n return rangeAdjustmentMap[orientation](range, diff);\n }\n return range;\n};\n\nexport const spaceSetter = (context, spaceConfig) => {\n let tickInterval;\n let heightForTicks;\n const config = context.config();\n const {\n width: availWidth,\n height: availHeight,\n padding\n } = context.availableSpace();\n const {\n top,\n left,\n bottom,\n right\n } = padding;\n const {\n isOffset\n } = spaceConfig;\n const {\n showAxisName,\n labels\n } = context.renderConfig();\n const {\n rotation\n } = labels;\n const {\n fixedBaseline,\n axisNamePadding,\n tickValues\n } = config;\n\n const {\n tickDimensions,\n allTickDimensions,\n axisNameDimensions,\n tickSize\n } = context.getAxisDimensions();\n\n const {\n height: tickDimHeight,\n width: tickDimWidth\n } = tickDimensions;\n\n const namePadding = showAxisName ? axisNamePadding : 0;\n const labelConfig = { smartTicks: true, rotation: labels.rotation };\n const minTickDistance = context._minTickDistance;\n const minTickSpace = context._minTickSpace;\n const minDiff = context._minDiff;\n const domain = context.domain();\n const axisNameHeight = axisNameDimensions.height;\n const minWidthBetweenTicks = minTickDistance.width;\n const minTickWidth = Math.min(minTickSpace.width, tickDimWidth);\n const minTickHeight = Math.min(minTickSpace.height, tickDimHeight);\n\n return {\n [TIME]: {\n x: () => {\n !tickValues && context.applyTickSkipping();\n const noOfTicks = context.getTickValues().length;\n\n // Get the Tick Interval\n tickInterval = ((availWidth - (noOfTicks - 1) * (minWidthBetweenTicks)) / noOfTicks);\n\n // Get height for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation;\n // Remove ticks if not enough height\n if (tickInterval < minTickHeight) {\n heightForTicks = availHeight;\n tickInterval = minTickHeight;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n const tickShifter = Math.min(tickInterval, tickDimWidth);\n // set range for axis\n setAxisRange(context, 'y', getAdjustedRange(minDiff, [tickShifter / 2,\n availWidth - left - right - tickShifter / 2], domain, config),\n isOffset ? availHeight : null);\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n\n return labelConfig;\n },\n y: () => {\n let widthForTicks = availWidth;\n const tickShifter = tickDimHeight / 2;\n\n setAxisRange(context, 'x', getAdjustedRange(minDiff,\n [availHeight - top - bottom - tickShifter, tickShifter], domain, config),\n isOffset ? availWidth : null);\n\n if ((availWidth - axisNameHeight - namePadding) <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [BAND]: {\n x: () => {\n setAxisRange(context, 'y', [0, availWidth - left - right], isOffset ? availHeight : null);\n const range = context.range();\n\n // Get Tick Interval\n tickInterval = ((range[1] - range[0]) / (tickValues || domain).length) - minWidthBetweenTicks;\n\n // Get height available for ticks\n heightForTicks = availHeight - axisNameHeight - tickSize - namePadding;\n\n if (tickInterval < minTickWidth && rotation !== 0) {\n // set smart ticks and rotation config\n labelConfig.rotation = rotation === null ? -90 : rotation;\n labelConfig.smartTicks = false;\n\n tickInterval = Math.max(heightForTicks, minTickWidth);\n\n if (heightForTicks < minTickWidth) {\n context.renderConfig({ showAxisName: false });\n }\n } else if (tickValues) {\n const interval = (availWidth / domain.length) - minWidthBetweenTicks;\n if (interval < minTickWidth) {\n context.range([minTickHeight / 2, availWidth - minTickHeight / 2]);\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n\n context.maxTickSpaces({\n width: tickInterval,\n height: heightForTicks,\n noWrap: rotation !== null\n });\n return labelConfig;\n },\n y: () => {\n setAxisRange(context, 'x', [availHeight - bottom, top], isOffset ? availWidth : null);\n\n let widthForTicks = availWidth - axisNameHeight - tickSize - namePadding;\n if (widthForTicks <= minWidthBetweenTicks) {\n widthForTicks = 0;\n context.renderConfig({ showInnerTicks: false, showOuterTicks: false });\n }\n\n context.maxTickSpaces({\n width: widthForTicks,\n height: availHeight,\n noWrap: true\n });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n }\n },\n [LINEAR]: {\n x: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimWidth / 2;\n\n const baseline = fixedBaseline ? 0 : tickShifter;\n\n setAxisRange(context, 'y', [baseline + left, availWidth - right - tickShifter],\n isOffset ? availHeight : null);\n\n const range = context.range();\n\n // Get Tick widths and available space\n const totalTickWidth = allTickDimensions.length * (tickDimWidth + minWidthBetweenTicks);\n const availableWidth = range[1] - range[0];\n\n // Rotate labels if not enough width\n if (availableWidth < totalTickWidth && labels.rotation !== null) {\n if (availHeight - tickDimWidth - namePadding - tickSize > axisNameHeight) {\n labelConfig.rotation = null;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: true\n });\n } else {\n labelConfig.rotation = -90;\n context.renderConfig({\n showInnerTicks: true,\n showAxisName: false\n });\n }\n }\n if (availHeight < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n return labelConfig;\n },\n y: () => {\n labelConfig.smartTicks = false;\n const tickShifter = tickDimHeight / 2;\n const baseline = fixedBaseline ? 1 : tickShifter;\n\n setAxisRange(context, 'x', [availHeight - bottom - baseline, tickShifter + top],\n isOffset ? availWidth : null);\n\n // Remove display of ticks if no space is left\n if (availWidth < tickDimWidth + axisNameHeight + namePadding) {\n context.renderConfig({ showInnerTicks: false });\n if (availWidth < axisNameHeight) {\n context.renderConfig({ show: false });\n }\n }\n return labelConfig;\n }\n }\n };\n};\n","import { defaultValue } from 'muze-utils';\nimport { TOP, LEFT, BOTTOM } from '../enums/axis-orientation';\nimport { MIN_NO_OF_TICKS, DEFAULT_NO_OF_TICKS } from '../enums/constants';\nimport { setAxisRange, getAdjustedRange } from './space-setter';\n\nexport const getRotatedSpaces = (rotation = 0, width, height) => {\n let rotatedHeight = height;\n let rotatedWidth = width;\n if (rotation) {\n const angle = ((rotation || 0) * Math.PI) / 180;\n rotatedWidth = Math.abs(height * Math.sin(angle)) + Math.abs(width * Math.cos(angle));\n rotatedHeight = Math.abs(width * Math.sin(angle)) + Math.abs(height * Math.cos(angle));\n }\n return { width: rotatedWidth, height: rotatedHeight };\n};\n\nexport const setOffset = (context) => {\n let x = 0;\n let y = 0;\n const logicalSpace = context.logicalSpace();\n const config = context.config();\n const {\n orientation,\n xOffset,\n yOffset\n } = config;\n if (orientation === LEFT) {\n x = xOffset === undefined ? logicalSpace.width : xOffset;\n }\n if (orientation === TOP) {\n y = yOffset === undefined ? logicalSpace.height : yOffset;\n }\n\n context.renderConfig({ xOffset: x, yOffset: y });\n};\n\nexport const getNumberOfTicks = (availableSpace, labelDim, axis, axisInstance) => {\n let numberOfValues = 0;\n let tickValues = [];\n let { numberOfTicks } = axisInstance.config();\n const ticks = axis.scale().ticks();\n const tickLength = ticks.length;\n const minTickDistance = axisInstance._minTickDistance.width;\n\n numberOfValues = tickLength;\n\n if (tickLength * (labelDim + minTickDistance) > availableSpace) {\n numberOfValues = Math.floor(availableSpace / (labelDim + minTickDistance));\n }\n\n numberOfTicks = numberOfTicks || numberOfValues;\n numberOfValues = Math.min(numberOfTicks, Math.max(MIN_NO_OF_TICKS, numberOfValues));\n\n tickValues = axis.scale().ticks(numberOfValues);\n\n if (tickValues.length > numberOfValues) {\n tickValues = tickValues.filter((e, i) => i % 2 === 0);\n }\n\n if (numberOfValues === MIN_NO_OF_TICKS) {\n tickValues = axis.scale().ticks(DEFAULT_NO_OF_TICKS);\n tickValues = [tickValues[0], tickValues[tickValues.length - 1]];\n }\n return tickValues;\n};\n\nexport const getAxisComponentDimensions = (context) => {\n let largestTick = '';\n let largestTickDimensions = { width: 0, height: 0 };\n let smartTick = {};\n let axisTicks;\n const allTickDimensions = [];\n const scale = context.scale();\n const { tickValues, showAxisName } = context.renderConfig();\n const { name } = context.config();\n const { labelManager } = context.dependencies();\n const labelFunc = scale.ticks || scale.quantile || scale.domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(context._tickLabelStyle);\n\n // get the values along the domain\n axisTicks = tickValues || labelFunc();\n\n // Get the tick labels\n axisTicks = axisTicks.map((originalLabel, i) => {\n const label = context.getFormattedText(originalLabel, i, axisTicks);\n\n // convert to string for quant values\n const tickDimensions = labelManager.getOriSize(label);\n\n // Get spaces for all labels\n allTickDimensions.push(tickDimensions);\n\n // Getting largest label\n if (tickDimensions.width > largestTickDimensions.width) {\n largestTick = label;\n smartTick = context.smartTicks() ? context.smartTicks()[i] : {};\n\n largestTickDimensions = tickDimensions;\n smartTick = smartTick || tickDimensions;\n }\n return label;\n });\n\n labelManager.setStyle(context._axisNameStyle);\n const axisNameDimensions = showAxisName ? labelManager.getOriSize(name) : { width: 0, height: 0 };\n\n return {\n axisNameDimensions,\n largestTick,\n largestTickDimensions,\n allTickDimensions,\n axisTicks,\n smartTick,\n tickSize: context.getTickSize()\n };\n};\n\nexport const computeAxisDimensions = (context) => {\n let tickDimensions = {};\n const { labels } = context.renderConfig();\n const { smartTicks, rotation } = labels;\n\n const {\n largestTickDimensions,\n axisTicks,\n smartTick,\n axisNameDimensions,\n allTickDimensions,\n tickSize\n } = getAxisComponentDimensions(context);\n const { height: labelHeight, width: labelWidth } = largestTickDimensions;\n\n // get the domain of axis\n const domain = context.domain();\n // const angle = ((rotation || 0) * Math.PI) / 180;\n\n if (domain.length === 0) {\n return {\n allTickDimensions,\n tickSize: 0,\n tickDimensions: { height: 0, width: 0 },\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n }\n\n if (smartTicks) {\n tickDimensions = smartTick;\n } else {\n tickDimensions = { width: labelWidth, height: labelHeight };\n }\n tickDimensions = getRotatedSpaces(rotation, tickDimensions.width, tickDimensions.height);\n\n if (tickSize === 0) {\n tickDimensions = { width: 0, height: 0 };\n }\n\n return {\n allTickDimensions,\n tickSize,\n tickDimensions,\n axisNameDimensions,\n largestTickDimensions,\n axisTicks\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getHorizontalAxisSpace = (context, axisDimensions, range) => {\n let width;\n let height;\n const domain = context.domain();\n const minTickDistance = context._minTickDistance.width;\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n width = range && range.length ? range[1] - range[0] : ((tickDimWidth + minTickDistance) * 3);\n\n height = 0;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n width = ((max - min) / Math.abs(minTickDiff)) * (tickDimWidth + context._minTickDistance.width);\n }\n if (!range || !range.length) {\n height = Math.max(tickDimWidth, tickDimHeight);\n } else {\n height = tickDimHeight;\n }\n\n height += (showAxisName ? axisDimHeight + axisNamePadding : 0) + tickSize;\n\n return {\n width,\n height\n };\n};\n\n/**\n *\n *\n * @param {*} axisDimensions\n * @param {*} config\n * @param {*} range\n *\n */\nexport const getVerticalAxisSpace = (context, axisDimensions) => {\n let height;\n let width;\n const domain = context.domain();\n const { tickSize, tickDimensions, axisNameDimensions } = axisDimensions;\n const { axisNamePadding, tickValues } = context.config();\n const { showAxisName } = context.renderConfig();\n const { height: axisDimHeight } = axisNameDimensions;\n const { height: tickDimHeight, width: tickDimWidth } = tickDimensions;\n\n height = 0;\n width = tickDimWidth;\n if (tickValues) {\n const minTickDiff = context.getMinTickDifference();\n const [min, max] = [\n Math.min(...tickValues, ...domain),\n Math.max(...tickValues, ...domain)\n ];\n\n height = ((max - min) / Math.abs(minTickDiff)) * tickDimHeight;\n }\n width += (showAxisName ? axisDimHeight : 0) + tickSize + (tickValues ? axisNamePadding : 0);\n\n return {\n height,\n width\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateBandSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n\n const { orientation } = context.config();\n const { show } = context.renderConfig();\n const { largestTickDimensions, axisTicks, allTickDimensions } = axisDimensions;\n const { height: largestDimHeight } = largestTickDimensions;\n const minTickWidth = context._minTickDistance.width;\n if (orientation === TOP || orientation === BOTTOM) {\n let {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n\n if (!range || !range.length) {\n width = allTickDimensions.reduce((t, n) =>\n t + Math.min(n.width, n.height) + minTickWidth, 0);\n }\n\n if (show === false) {\n height = 0;\n width = 0;\n }\n return {\n width,\n height\n };\n }\n\n let {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n if (!height || height === 0) {\n height = axisTicks.length * (largestDimHeight + context._minTickDistance.height);\n }\n if (show === false) {\n width = 0;\n }\n return {\n width,\n height\n };\n};\n\n/**\n * Calculates the logical space of the axis\n * @return {Object} Width and height occupied by the axis.\n */\nexport const calculateContinousSpace = (context) => {\n const range = context.range();\n const axisDimensions = context.getAxisDimensions();\n const { orientation } = context.config();\n const { show, showAxisName } = context.renderConfig();\n const { axisNameDimensions } = axisDimensions;\n\n if (show === false) {\n return {\n width: 0,\n height: 0\n };\n }\n\n const { width: axisNameWidth } = axisNameDimensions;\n\n if (orientation === TOP || orientation === BOTTOM) {\n const {\n width,\n height\n } = getHorizontalAxisSpace(context, axisDimensions, range);\n const axisWidth = Math.max(width, axisNameWidth);\n\n return {\n width: axisWidth,\n height\n };\n }\n const {\n width,\n height\n } = getVerticalAxisSpace(context, axisDimensions, range);\n\n const effHeight = Math.max(height, showAxisName ? axisNameWidth : 0);\n\n return {\n width,\n height: effHeight\n };\n};\n\n/**\n * Overwrites domain with user defined domain (if present)\n * @param {Object} context reference to current axes\n * @param {Array} domain default domain\n *\n * @return {Array} domain\n */\nexport const getValidDomain = (context, domain) => {\n const { domain: userDom } = context.config();\n\n if (userDom) {\n domain = userDom;\n }\n\n return defaultValue(domain, []);\n};\n\nexport const setContinousAxisDomain = (context, domain) => {\n const { nice } = context.config();\n const scale = context.scale.bind(context);\n\n scale().domain(domain);\n nice && scale().nice();\n context._domain = scale().domain();\n};\n\n/**\n * Checks if any of the properties have changed between two objects\n * @param {Object} obj first object\n * @param {Object} obj1 second object\n * @param {Array} properties properties to be compared between two objects\n *\n * @return {Boolean} boolean value\n */\nexport const hasAxesConfigChanged = (obj = {}, obj1 = {}, properties) => {\n if (!Object.keys(obj).length || !Object.keys(obj1).length) {\n return false;\n }\n return properties.some(key => obj[key] !== obj1[key]);\n};\n\nexport const resetTickInterval = (context, domain) => {\n const {\n orientation,\n isOffset\n } = context.config();\n\n const minDiff = context._minDiff;\n // Set available space on interaction\n if (context.range().length && (orientation === TOP || orientation === BOTTOM)) {\n context.applyTickSkipping();\n const {\n largestTickDimensions\n } = context.getAxisDimensions();\n\n const noOfTicks = context.getTickValues().length;\n\n const { width, height, padding } = context.availableSpace();\n const {\n left,\n right\n } = padding;\n // Get the Tick Interval\n const tickInterval = Math.min(largestTickDimensions.width,\n ((width - (noOfTicks - 1) * (context._minTickDistance.width)) / noOfTicks));\n\n context.maxTickSpaces({\n width: tickInterval\n });\n\n const adjustedRange = getAdjustedRange(minDiff, [tickInterval / 2,\n width - left - right - tickInterval / 2], domain, context.config());\n\n // set range for axis\n setAxisRange(context, 'y', adjustedRange, isOffset ? height : null);\n\n context.setTickConfig();\n }\n};\n\nexport const getSmartAxisName = (name, width, labelManager) => {\n const oriSize = labelManager.getOriSize(name);\n\n labelManager.useEllipsesOnOverflow(true);\n\n return labelManager.getSmartText(name, width, oriSize.height, true);\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { hasAxesConfigChanged } from './helper';\n\nexport const PROPS = {\n availableSpace: {},\n axisDimensions: {},\n axisComponentDimensions: {},\n config: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._config || {});\n const mockedOldConfig = mergeRecursive({}, oldConfig);\n value = mergeRecursive(mockedOldConfig, value);\n\n value.axisNamePadding = Math.max(value.axisNamePadding, 0);\n const shouldAxesScaleUpdate = hasAxesConfigChanged(\n value, oldConfig, ['interpolator', 'exponent', 'base', 'orientation']\n );\n const tickFormatter = context.sanitizeTickFormatter(value);\n\n if (shouldAxesScaleUpdate) {\n context._scale = context.createScale(value);\n context._axis = context.createAxis(value);\n }\n\n context._tickFormatter = ticks => tickFormatter(ticks);\n\n context.resetRenderConfig(value);\n return value;\n }\n },\n renderConfig: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._renderConfig || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n logicalSpace: {},\n mount: {\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.logicalSpace(null);\n return value;\n }\n },\n\n smartTicks: {},\n tickSize: {},\n maxTickSpaces: {\n sanitization: (context, value) => {\n const oldConfig = Object.assign({}, context._maxTickSpaces || {});\n value = mergeRecursive(oldConfig, value);\n return value;\n }\n },\n valueParser: {\n defaultValue: val => val\n }\n};\n","import {\n mergeRecursive,\n getSmartComputedStyle,\n selectElement,\n generateGetterSetters,\n getUniqueId\n} from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { axisOrientationMap, BOTTOM, TOP } from '../enums/axis-orientation';\nimport { defaultConfig } from './default-config';\nimport { renderAxis } from '../axis-renderer';\nimport { spaceSetter } from './space-setter';\nimport {\n getAxisComponentDimensions,\n computeAxisDimensions,\n calculateContinousSpace,\n setOffset,\n getValidDomain,\n getSmartAxisName\n} from './helper';\nimport { PROPS } from './props';\n\nexport default class SimpleAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @memberof SimpleAxis\n */\n constructor (config, dependencies) {\n this._id = getUniqueId();\n\n this._dependencies = dependencies;\n this._mount = null;\n this._range = [];\n this._domain = [];\n this._domainLock = false;\n this._axisDimensions = {};\n this._smartTicks = [];\n\n const defCon = mergeRecursive({}, this.constructor.defaultConfig());\n const simpleConfig = mergeRecursive(defCon, config);\n\n const bodyElem = selectElement('body');\n const classPrefix = simpleConfig.classPrefix;\n this._tickLabelStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-ticks`);\n this._axisNameStyle = getSmartComputedStyle(bodyElem, `${classPrefix}-axis-name`);\n\n dependencies.labelManager.setStyle(this._tickLabelStyle);\n const dist = dependencies.labelManager.getOriSize('w');\n\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n this._minTickSpace = dependencies.labelManager.getOriSize('www...');\n\n generateGetterSetters(this, PROPS);\n this.config(simpleConfig);\n\n this._scale = this.createScale(this._config);\n this._axis = this.createAxis(this._config);\n this._animationDonePromises = [];\n }\n\n /**\n * Returns the default configuration of simple axis\n * @return {Object} default configurations\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline () {\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n scale (...params) {\n if (params.length) {\n this._scale = params[0];\n return this;\n }\n return this._scale;\n }\n\n resetDomain () {\n this._domain = [];\n return this;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleAxis\n */\n axis (...params) {\n if (params.length) {\n this._axis = params[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n this.scale().domain(domainValue);\n this._domain = this.scale().domain();\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n setAxisComponentDimensions () {\n this.axisComponentDimensions(getAxisComponentDimensions(this));\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const scale = createScale({\n padding,\n interpolator,\n exponent,\n base,\n range,\n type: this.constructor.type()\n });\n\n return scale;\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat, numberFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(numberFormat(val), val, i, ticks);\n }\n\n return () => val => numberFormat(val);\n }\n\n resetRenderConfig (config) {\n const {\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n } = config;\n this.renderConfig({\n labels,\n show,\n showInnerTicks,\n showOuterTicks,\n showAxisName,\n xOffset,\n yOffset,\n tickValues,\n smartAxisName\n });\n return this;\n }\n\n resetLogicalSpace () {\n this.logicalSpace(null);\n this.range([]);\n\n this.resetRenderConfig(this.config());\n }\n\n getFormattedText (text, index, axisTicks) {\n const formatter = this._tickFormatter;\n\n return formatter(axisTicks)(text, index);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createAxis (config) {\n const { orientation } = config;\n const axisClass = axisOrientationMap[orientation];\n\n if (axisClass) {\n const axis = axisClass(this.scale());\n return axis;\n }\n return null;\n }\n\n setTickValues (tickValues) {\n const renderConfig = this.renderConfig();\n this.config({ ...renderConfig, tickValues });\n this.tickValues = tickValues;\n this.axis().tickValues(tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (width = 0, height, padding, isOffset) {\n let labelConfig = {};\n const {\n orientation\n } = this.config();\n\n this.availableSpace({ width, height, padding });\n const type = this.constructor.type();\n\n if (orientation === TOP || orientation === BOTTOM) {\n labelConfig = spaceSetter(this, { isOffset })[type].x();\n } else {\n labelConfig = spaceSetter(this, { isOffset })[type].y();\n }\n\n // Set config\n this.renderConfig({\n labels: labelConfig\n });\n this.setTickConfig();\n this.setSmartAxisName();\n return this;\n }\n\n setSmartAxisName () {\n const { orientation, name } = this.config();\n const dimType = (orientation === TOP || orientation === BOTTOM) ? 'width' : 'height';\n const widthDim = this.availableSpace()[dimType];\n const labelManager = this.dependencies().labelManager;\n labelManager.setStyle(this._axisNameStyle);\n this.renderConfig({\n smartAxisName: getSmartAxisName(name, widthDim, labelManager)\n });\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n return this;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this.scale()(domainVal);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n return this.axis().tickSize();\n }\n\n /**\n * Gets the space occupied by the parts of an axis\n *\n * @return {Object} object with details about sizes of the axis.\n * @memberof SimpleAxis\n */\n getAxisDimensions (...params) {\n this.axisDimensions(computeAxisDimensions(this, ...params));\n return this.axisDimensions();\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateContinousSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n * Returns the value from the domain when given a value from the range.\n * @param {number} value Value from the range.\n * @return {number} Value\n */\n invert (value) {\n return this.scale().invert(value);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n *\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n return [v1, v2];\n }\n\n invertExtent (v1, v2) {\n return [this.invert(v1), this.invert(v2)];\n }\n\n getMinTickDifference () {\n return this.domain();\n }\n\n getFormattedTickValues (tickValues) {\n return tickValues;\n }\n\n /**\n * This method returns the width in pixels for one\n * unit along the axis. It is only applicable to band scale\n * and returns undefined for other scale type.\n *\n * @return {number} the width of one band along band scale axis\n * @memberof SimpleAxis\n */\n getUnitWidth () {\n return 0;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof SimpleAxis\n */\n serialize () {\n return {\n name: this.name,\n type: this.type,\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n get id () {\n return this._id;\n }\n\n /**\n * This method is used to render the axis inside\n * the supplied svg container.\n *\n * @param {SVGElement} svg the svg element in which to render the path\n * @memberof SimpleAxis\n */\n /* istanbul ignore next */render () {\n if (this.mount()) {\n this.setTickConfig();\n renderAxis(this);\n }\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n remove () {\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n *\n *\n * @memberof SimpleAxis\n */\n unsubscribe () {\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n isReverse () {\n const range = this.range();\n return range[0] > range[1];\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getPixelToValueRatio () {\n const scale = this.scale();\n const range = scale.range();\n const domain = scale.domain();\n\n return Math.abs(range[1] - range[0]) / (domain[1] - domain[0]);\n }\n\n /**\n * Notifies when all animations/transitions of the axis are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n _getRawTickValue (data) {\n return data;\n }\n\n getTicksBasedOnData (tickData) {\n const allTicks = selectElement(this.mount()).selectAll('.tick');\n let elementToBeModified = null;\n let elementNotToBeModified = null;\n if (tickData) {\n elementToBeModified = allTicks.filter(tickValue => tickData === this._getRawTickValue(tickValue));\n elementNotToBeModified = allTicks.filter(tickValue => !(tickData === this._getRawTickValue(tickValue)));\n }\n return {\n selectionSet: elementToBeModified,\n rejectionSet: elementNotToBeModified || allTicks\n };\n }\n}\n","import { sanitizeDomainWhenEqual } from 'muze-utils';\nimport { scaleMap } from '../../scale-creator';\n\nexport default class LinearInterpolator {\n\n createScale (config) {\n const {\n range\n } = config;\n const scaleFactory = scaleMap.linear;\n this._scale = scaleFactory().range(range);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain.length) {\n domain = sanitizeDomainWhenEqual(domain);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class LogInterpolator {\n\n createScale (config) {\n const {\n range,\n base\n } = config;\n const scaleFactory = scaleMap.log;\n this._scale = scaleFactory().range(range).base(base);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n const scale = this._scale;\n if (domainVal <= 0) {\n return scale(scale.domain()[0]);\n }\n\n return scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n if (domain[0] <= 0) {\n domain[0] = Math.max(1, domain[0]);\n }\n if (domain[1] <= 0) {\n domain[1] = Math.max(1, domain[1]);\n }\n return domain;\n }\n}\n","import { scaleMap } from '../../scale-creator';\n\nexport default class PowInterpolator {\n\n createScale (config) {\n const {\n range,\n exponent\n } = config;\n const scaleFactory = scaleMap.pow;\n this._scale = scaleFactory().range(range).exponent(exponent);\n return this._scale;\n }\n\n getScaleValue (domainVal) {\n return this._scale(domainVal) + 0.5;\n }\n\n sanitizeDomain (domain) {\n return domain;\n }\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { BOTTOM, TOP, LEFT, RIGHT } from '../enums/axis-orientation';\nimport { LINEAR, LOG, POW } from '../enums/scale-type';\nimport { LogInterpolator, PowInterpolator, LinearInterpolator } from './interpolators';\nimport {\n getNumberOfTicks,\n getValidDomain,\n setContinousAxisDomain\n} from './helper';\n\nexport const interpolatorMap = {\n [LOG]: LogInterpolator,\n [POW]: PowInterpolator,\n [LINEAR]: LinearInterpolator\n};\n\nexport default class ContinousAxis extends SimpleAxis {\n constructor (config, dependencies) {\n config.tickFormat = config.tickFormat || (val => val);\n super(config, dependencies);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n createScale (config) {\n const {\n base,\n padding,\n interpolator,\n exponent\n } = config;\n const range = this.range();\n const InterpolatorCls = interpolatorMap[interpolator];\n\n this._interpolator = new InterpolatorCls();\n let scale = this._interpolator.createScale({\n padding,\n exponent,\n base,\n range\n });\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ContinousAxis\n */\n static type () {\n return LINEAR;\n }\n\n getScaleValue (domainVal) {\n if (domainVal === null || domainVal === undefined) {\n return undefined;\n }\n return this._interpolator.getScaleValue(domainVal);\n }\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n\n return axis.tickSize();\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainVal = this._interpolator.sanitizeDomain(getValidDomain(this, domain[0]));\n setContinousAxisDomain(this, domainVal);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n return this;\n }\n return this._domain;\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @param {*} tickValues\n *\n * @memberof SimpleAxis\n */\n setTickConfig () {\n const {\n tickValues,\n showInnerTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n if (!showInnerTicks) {\n axis.tickValues([]);\n return this;\n }\n\n if (tickValues) {\n tickValues instanceof Array && this.axis().tickValues(tickValues);\n }\n const newTickValues = this.getTickValues();\n\n axis.tickValues(newTickValues);\n const smartLabel = this.dependencies().labelManager;\n smartLabel.setStyle(this._tickLabelStyle);\n const formatter = this._tickFormatter(newTickValues);\n const smartTicks = newTickValues.map((val, i) => {\n const text = formatter(val, i);\n const tickSpace = smartLabel.getOriSize(text);\n\n tickSpace.text = text;\n return tickSpace;\n });\n\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickValues () {\n let labelDim = 0;\n const {\n orientation\n\n } = this.config();\n const {\n tickValues\n } = this.renderConfig();\n const range = this.range();\n const axis = this.axis();\n\n const availableSpace = Math.abs(range[0] - range[1]);\n\n const labelProps = this.axisComponentDimensions().largestTickDimensions;\n\n if (tickValues) {\n return tickValues;\n }\n labelDim = labelProps[orientation === BOTTOM || orientation === TOP ? 'width' : 'height'];\n\n return getNumberOfTicks(availableSpace, labelDim, axis, this);\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.renderConfig().tickValues);\n }\n\n /**\n * Sets a fixed baseline for the first ticks so that they can render effectively within\n * the given area\n *\n * @param {*} tickText\n * @param {*} config\n * @param {*} labelManager\n */\n setFixedBaseline (tickText) {\n const {\n orientation\n } = this.config();\n const {\n labels\n } = this.renderConfig();\n\n const {\n rotation\n } = labels;\n const axis = this.axis();\n const ticks = axis.tickValues();\n const smartTicks = this.smartTicks();\n\n if (smartTicks && smartTicks.length) {\n const { width, height } = this.smartTicks()[0];\n\n axis.tickTransform((d) => {\n if (d === ticks[0]) {\n if ((orientation === LEFT || orientation === RIGHT)) {\n return `translate(0, -${(height) / 3}px)`;\n }\n\n if ((orientation === TOP || orientation === BOTTOM) && !rotation) {\n return `translate(${width / 2}px, ${0}px)`;\n }\n } return '';\n });\n }\n return tickText;\n }\n\n}\n","import SimpleAxis from './simple-axis';\nimport { BAND } from '../enums/scale-type';\nimport { calculateBandSpace, setOffset, getRotatedSpaces } from './helper';\n\nexport default class BandAxis extends SimpleAxis {\n /**\n *\n *\n * @static\n *\n * @memberof BandAxis\n */\n static type () {\n return BAND;\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks = '';\n let smartlabel;\n const domain = this.domain();\n const { labelManager } = this._dependencies;\n const { padding } = this.config();\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n tickValues && this.axis().tickValues(tickValues);\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n // Update padding between plots\n if (typeof padding === 'number') {\n const paddingNormalized = Math.min(1, Math.max(0, padding));\n this.scale().padding(paddingNormalized);\n }\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n this.smartTicks(smartTicks);\n return this;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n /**\n *\n *\n * @memberof BandAxis\n */\n getTickValues () {\n return this.axis().scale().domain();\n }\n\n formatTickValue (val) {\n return this.valueParser()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return ticks => (val, i) => tickFormat(this.formatTickValue(val), val, i, ticks);\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof BandAxis\n */\n getUnitWidth () {\n return this.scale().bandwidth();\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n\n axis.tickSizeInner(showInnerTicks ? 6 : 0);\n axis.tickSizeOuter(showOuterTicks ? 6 : 0);\n return axis.tickSize();\n }\n\n invertExtent (v1, v2) {\n return this.scale().invertExtent(v1, v2);\n }\n\n /**\n * Gets the nearest range value from the given range values.\n * @param {number} v1 Start range value\n * @param {number} v2 End range value\n * @return {Array} range values\n */\n getNearestRange (v1, v2) {\n const scale = this.scale();\n const range = scale.range();\n const reverse = range[0] > range[1];\n\n const extent = this.invertExtent(v1, v2);\n const p1 = scale(reverse ? extent[extent.length - 1] : extent[0]);\n const p2 = scale(reverse ? extent[0] : extent[extent.length - 1]) + scale.bandwidth();\n return [p1, p2];\n }\n\n}\n","import { getSmallestDiff } from 'muze-utils';\nimport SimpleAxis from './simple-axis';\nimport { TIME } from '../enums/scale-type';\nimport { calculateBandSpace, getRotatedSpaces, getValidDomain, setContinousAxisDomain, setOffset,\n resetTickInterval } from './helper';\nimport { applyTickSkipping } from './space-setter';\n\n/**\n *\n *\n * @export\n * @class TimeAxis\n * @extends {SimpleAxis}\n */\nexport default class TimeAxis extends SimpleAxis {\n\n constructor (...params) {\n super(...params);\n this._minDiff = Infinity;\n }\n\n /**\n *\n *\n * @param {*} range\n *\n * @memberof TimeAxis\n */\n createScale (range) {\n let scale = super.createScale(range);\n\n scale = scale.nice();\n return scale;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof TimeAxis\n */\n static type () {\n return TIME;\n }\n\n formatTickValue (val) {\n return this.scale().tickFormat()(val);\n }\n\n sanitizeTickFormatter (value) {\n const { tickFormat } = value;\n\n if (tickFormat) {\n return (ticks) => {\n const rawTicks = ticks.map(t => t.getTime());\n return (val, i) => tickFormat(this.formatTickValue(val), val.getTime(), i, rawTicks);\n };\n }\n return () => val => this.formatTickValue(val);\n }\n\n /**\n *\n *\n *\n * @memberof SimpleAxis\n */\n getTickSize () {\n const {\n showInnerTicks,\n showOuterTicks\n } = this.renderConfig();\n const axis = this.axis();\n axis.tickSizeInner(showInnerTicks === false ? 0 : 6);\n axis.tickSizeOuter(showOuterTicks === false ? 0 : 6);\n return super.getTickSize();\n }\n\n /**\n *\n *\n *\n * @memberof TimeAxis\n */\n getTickValues () {\n return this.renderConfig().tickValues || this.scale().ticks();\n }\n\n /**\n *\n *\n * @param {*} diff\n *\n * @memberof TimeAxis\n */\n minDiff (diff) {\n this._minDiff = Math.min(this._minDiff, diff);\n return this;\n }\n\n applyTickSkipping () {\n applyTickSkipping(this);\n }\n\n /**\n *\n *\n * @param {*} d\n *\n * @memberof SimpleAxis\n */\n domain (...domain) {\n if (domain.length) {\n const domainValue = getValidDomain(this, domain[0]);\n setContinousAxisDomain(this, domainValue);\n this.setAxisComponentDimensions();\n this.logicalSpace(null);\n\n resetTickInterval(this, domainValue);\n return this;\n }\n return this._domain;\n }\n\n /**\n * Gets the space occupied by the axis\n *\n * @return {Object} object with details about size of the axis.\n * @memberof SimpleAxis\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(calculateBandSpace(this));\n }\n setOffset(this);\n\n return this.logicalSpace();\n }\n\n getMinTickDifference () {\n return getSmallestDiff(this.config().tickValues);\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @memberof AxisCell\n */\n setAvailableSpace (...params) {\n super.setAvailableSpace(...params);\n this.getTickSize();\n return this;\n }\n\n /**\n *\n *\n * @returns\n * @memberof BandAxis\n */\n setTickConfig () {\n let smartTicks;\n let smartlabel;\n\n const { labels, tickValues } = this.renderConfig();\n const { height: availHeight, width: availWidth, noWrap } = this.maxTickSpaces();\n const { labelManager } = this._dependencies;\n const domain = this.getTickValues();\n\n tickValues && this.axis().tickValues(tickValues);\n\n const { width, height } = getRotatedSpaces(labels.rotation, availWidth, availHeight);\n\n smartTicks = tickValues || domain;\n\n // set the style on the shared label manager instance\n labelManager.setStyle(this._tickLabelStyle);\n\n if (domain && domain.length) {\n const values = tickValues || domain;\n const tickFormatter = this._tickFormatter(values);\n smartTicks = values.map((d, i) => {\n labelManager.useEllipsesOnOverflow(true);\n\n smartlabel = labelManager.getSmartText(tickFormatter(d, i), width, height, noWrap);\n return labelManager.constructor.textToLines(smartlabel);\n });\n }\n\n this.smartTicks(smartTicks);\n return this;\n }\n _getRawTickValue (data) {\n return (new Date(data)).getTime();\n }\n}\n","export const x11Colors = {\n Pink: { hex: 'ffc0cb', rgb: '255,192,203' },\n LightPink: { hex: 'ffb6c1', rgb: '255,182,193' },\n HotPink: { hex: 'ff69b4', rgb: '255,105,180' },\n DeepPink: { hex: 'ff1493', rgb: '255,20,147' },\n PaleVioletRed: { hex: 'db7093', rgb: '219,112,147' },\n MediumVioletRed: { hex: 'c71585', rgb: '199,21,133' },\n LightSalmon: { hex: 'ffa07a', rgb: '255,160,122' },\n Salmon: { hex: 'fa8072', rgb: '250,128,114' },\n DarkSalmon: { hex: 'e9967a', rgb: '233,150,122' },\n LightCoral: { hex: 'f08080', rgb: '240,128,128' },\n IndianRed: { hex: 'cd5c5c', rgb: '205,92,92' },\n Crimson: { hex: 'dc143c', rgb: '220,20,60' },\n FireBrick: { hex: 'b22222', rgb: '178,34,34' },\n DarkRed: { hex: '8b0000', rgb: '139,0,0' },\n Red: { hex: 'ff0000', rgb: '255,0,0' },\n OrangeRed: { hex: 'ff4500', rgb: '255,69,0' },\n Tomato: { hex: 'ff6347', rgb: '255,99,71' },\n Coral: { hex: 'ff7f50', rgb: '255,127,80' },\n DarkOrange: { hex: 'ff8c00', rgb: '255,140,0' },\n Orange: { hex: 'ffa500', rgb: '255,165,0' },\n Gold: { hex: 'ffd700', rgb: '255,215,0' },\n Yellow: { hex: 'ffff00', rgb: '255,255,0' },\n LightYellow: { hex: 'ffffe0', rgb: '255,255,224' },\n LemonChiffon: { hex: 'fffacd', rgb: '255,250,205' },\n LightGoldenrodYellow: { hex: 'fafad2', rgb: '250,250,210' },\n PapayaWhip: { hex: 'ffefd5', rgb: '255,239,213' },\n Moccasin: { hex: 'ffe4b5', rgb: '255,228,181' },\n PeachPuff: { hex: 'ffdab9', rgb: '255,218,185' },\n PaleGoldenrod: { hex: 'eee8aa', rgb: '238,232,170' },\n Khaki: { hex: 'f0e68c', rgb: '240,230,140' },\n DarkKhaki: { hex: 'bdb76b', rgb: '189,183,107' },\n Cornsilk: { hex: 'fff8dc', rgb: '255,248,220' },\n BlanchedAlmond: { hex: 'ffebcd', rgb: '255,235,205' },\n Bisque: { hex: 'ffe4c4', rgb: '255,228,196' },\n NavajoWhite: { hex: 'ffdead', rgb: '255,222,173' },\n Wheat: { hex: 'f5deb3', rgb: '245,222,179' },\n BurlyWood: { hex: 'deb887', rgb: '222,184,135' },\n Tan: { hex: 'd2b48c', rgb: '210,180,140' },\n RosyBrown: { hex: 'bc8f8f', rgb: '188,143,143' },\n SandyBrown: { hex: 'f4a460', rgb: '244,164,96' },\n Goldenrod: { hex: 'daa520', rgb: '218,165,32' },\n DarkGoldenrod: { hex: 'b8860b', rgb: '184,134,11' },\n Peru: { hex: 'cd853f', rgb: '205,133,63' },\n Chocolate: { hex: 'd2691e', rgb: '210,105,30' },\n SaddleBrown: { hex: '8b4513', rgb: '139,69,19' },\n Sienna: { hex: 'a0522d', rgb: '160,82,45' },\n Brown: { hex: 'a52a2a', rgb: '165,42,42' },\n Maroon: { hex: '800000', rgb: '128,0,0' },\n DarkOliveGreen: { hex: '556b2f', rgb: '85,107,47' },\n Olive: { hex: '808000', rgb: '128,128,0' },\n OliveDrab: { hex: '6b8e23', rgb: '107,142,35' },\n YellowGreen: { hex: '9acd32', rgb: '154,205,50' },\n LimeGreen: { hex: '32cd32', rgb: '50,205,50' },\n Lime: { hex: '00ff00', rgb: '0,255,0' },\n LawnGreen: { hex: '7cfc00', rgb: '124,252,0' },\n Chartreuse: { hex: '7fff00', rgb: '127,255,0' },\n GreenYellow: { hex: 'adff2f', rgb: '173,255,47' },\n SpringGreen: { hex: '00ff7f', rgb: '0,255,127' },\n MediumSpringGreen: { hex: '00fa9a', rgb: '0,250,154' },\n LightGreen: { hex: '90ee90', rgb: '144,238,144' },\n PaleGreen: { hex: '98fb98', rgb: '152,251,152' },\n DarkSeaGreen: { hex: '8fbc8f', rgb: '143,188,143' },\n MediumSeaGreen: { hex: '3cb371', rgb: '60,179,113' },\n SeaGreen: { hex: '2e8b57', rgb: '46,139,87' },\n ForestGreen: { hex: '228b22', rgb: '34,139,34' },\n Green: { hex: '008000', rgb: '0,128,0' },\n DarkGreen: { hex: '006400', rgb: '0,100,0' },\n MediumAquamarine: { hex: '66cdaa', rgb: '102,205,170' },\n Aqua: { hex: '00ffff', rgb: '0,255,255' },\n Cyan: { hex: '00ffff', rgb: '0,255,255' },\n LightCyan: { hex: 'e0ffff', rgb: '224,255,255' },\n PaleTurquoise: { hex: 'afeeee', rgb: '175,238,238' },\n Aquamarine: { hex: '7fffd4', rgb: '127,255,212' },\n Turquoise: { hex: '40e0d0', rgb: '64,224,208' },\n MediumTurquoise: { hex: '48d1cc', rgb: '72,209,204' },\n DarkTurquoise: { hex: '00ced1', rgb: '0,206,209' },\n LightSeaGreen: { hex: '20b2aa', rgb: '32,178,170' },\n CadetBlue: { hex: '5f9ea0', rgb: '95,158,160' },\n DarkCyan: { hex: '008b8b', rgb: '0,139,139' },\n Teal: { hex: '008080', rgb: '0,128,128' },\n LightSteelBlue: { hex: 'b0c4de', rgb: '176,196,222' },\n PowderBlue: { hex: 'b0e0e6', rgb: '176,224,230' },\n LightBlue: { hex: 'add8e6', rgb: '173,216,230' },\n SkyBlue: { hex: '87ceeb', rgb: '135,206,235' },\n LightSkyBlue: { hex: '87cefa', rgb: '135,206,250' },\n DeepSkyBlue: { hex: '00bfff', rgb: '0,191,255' },\n DodgerBlue: { hex: '1e90ff', rgb: '30,144,255' },\n CornflowerBlue: { hex: '6495ed', rgb: '100,149,237' },\n SteelBlue: { hex: '4682b4', rgb: '70,130,180' },\n RoyalBlue: { hex: '4169e1', rgb: '65,105,225' },\n Blue: { hex: '0000ff', rgb: '0,0,255' },\n MediumBlue: { hex: '0000cd', rgb: '0,0,205' },\n DarkBlue: { hex: '00008b', rgb: '0,0,139' },\n Navy: { hex: '000080', rgb: '0,0,128' },\n MidnightBlue: { hex: '191970', rgb: '25,25,112' },\n Lavender: { hex: 'e6e6fa', rgb: '230,230,250' },\n Thistle: { hex: 'd8bfd8', rgb: '216,191,216' },\n Plum: { hex: 'dda0dd', rgb: '221,160,221' },\n Violet: { hex: 'ee82ee', rgb: '238,130,238' },\n Orchid: { hex: 'da70d6', rgb: '218,112,214' },\n Fuchsia: { hex: 'ff00ff', rgb: '255,0,255' },\n Magenta: { hex: 'ff00ff', rgb: '255,0,255' },\n MediumOrchid: { hex: 'ba55d3', rgb: '186,85,211' },\n MediumPurple: { hex: '9370db', rgb: '147,112,219' },\n BlueViolet: { hex: '8a2be2', rgb: '138,43,226' },\n DarkViolet: { hex: '9400d3', rgb: '148,0,211' },\n DarkOrchid: { hex: '9932cc', rgb: '153,50,204' },\n DarkMagenta: { hex: '8b008b', rgb: '139,0,139' },\n Purple: { hex: '800080', rgb: '128,0,128' },\n Indigo: { hex: '4b0082', rgb: '75,0,130' },\n DarkSlateBlue: { hex: '483d8b', rgb: '72,61,139' },\n SlateBlue: { hex: '6a5acd', rgb: '106,90,205' },\n MediumSlateBlue: { hex: '7b68ee', rgb: '123,104,238' },\n White: { hex: 'ffffff', rgb: '255,255,255' },\n Snow: { hex: 'fffafa', rgb: '255,250,250' },\n Honeydew: { hex: 'f0fff0', rgb: '240,255,240' },\n MintCream: { hex: 'f5fffa', rgb: '245,255,250' },\n Azure: { hex: 'f0ffff', rgb: '240,255,255' },\n AliceBlue: { hex: 'f0f8ff', rgb: '240,248,255' },\n GhostWhite: { hex: 'f8f8ff', rgb: '248,248,255' },\n WhiteSmoke: { hex: 'f5f5f5', rgb: '245,245,245' },\n Seashell: { hex: 'fff5ee', rgb: '255,245,238' },\n Beige: { hex: 'f5f5dc', rgb: '245,245,220' },\n OldLace: { hex: 'fdf5e6', rgb: '253,245,230' },\n FloralWhite: { hex: 'fffaf0', rgb: '255,250,240' },\n Ivory: { hex: 'fffff0', rgb: '255,255,240' },\n AntiqueWhite: { hex: 'faebd7', rgb: '250,235,215' },\n Linen: { hex: 'faf0e6', rgb: '250,240,230' },\n LavenderBlush: { hex: 'fff0f5', rgb: '255,240,245' },\n MistyRose: { hex: 'ffe4e1', rgb: '255,228,225' },\n Gainsboro: { hex: 'dcdcdc', rgb: '220,220,220' },\n LightGray: { hex: 'd3d3d3', rgb: '211,211,211' },\n Silver: { hex: 'c0c0c0', rgb: '192,192,192' },\n DarkGrey: { hex: 'a9a9a9', rgb: '169,169,169' },\n Grey: { hex: '808080', rgb: '128,128,128' },\n DimGrey: { hex: '696969', rgb: '105,105,105' },\n LightSlateGrey: { hex: '778899', rgb: '119,136,153' },\n SlateGrey: { hex: '708090', rgb: '112,128,144' },\n DarkSlateGrey: { hex: '2f4f4f', rgb: '47,79,79' },\n Black: { hex: '000000', rgb: '0,0,0' }\n};\n","import {\n LINEAR\n} from '../enums/constants';\n/**\n * Set of default colors\n */\nexport const palette = [\n '#1f77b4',\n '#ff7f0e',\n '#2ca02c',\n '#d62728',\n '#9467bd',\n '#8c564b',\n '#e377c2',\n '#7f7f7f',\n '#bcbd22',\n '#17becf'\n];\n\nexport const DEFAULT_GRADIENT_COLOR = '#eaeaea';\n\nexport const DEFAULT_CONFIG = {\n range: palette,\n value: palette[0],\n step: false,\n stops: 5,\n type: LINEAR\n};\n","import { mergeRecursive, detectColor, hexToHsv, rgbToHsv, defaultValue } from 'muze-utils';\nimport { x11Colors } from './color-maps';\nimport { palette, DEFAULT_GRADIENT_COLOR, DEFAULT_CONFIG } from './defaults';\nimport { LINEAR, RGB, HEX, HSL, HSLA } from '../enums/constants';\n\nexport const getHslString = hslArr => `hsla(${hslArr[0] * 360},${hslArr[1] * 100}%,${hslArr[2] * 100}%,\\\n${hslArr[3] || 1})`;\n\nexport const convertToXllString = baseString => (baseString.split(' ') || [])\n .reduce((x, e) => `${x}${e.charAt(0).toUpperCase()}${e.slice(1)}`, '');\n\nexport const getActualHslColor = (e, paletteColor) => {\n let color = '';\n if (typeof e === 'string') {\n e = e.replace(/ /g, '');\n e = e.toLowerCase();\n if (detectColor(e) === HSL || detectColor(e) === HSLA) {\n color = e.match(/(\\d+(\\.\\d+)?)/g);\n color = [color[0] / 360, color[1] / 100, color[2] / 100, defaultValue(Number(color[3]), 1)];\n } else if (detectColor(e) === HEX) {\n color = hexToHsv(e);\n } else if (detectColor(e) === RGB) {\n const col = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')')).split(/,\\s*/);\n color = rgbToHsv(...col);\n } else if (x11Colors[convertToXllString(e)]) {\n color = rgbToHsv(...x11Colors[convertToXllString(e)].rgb.split(','));\n }\n } else if (!(e instanceof Array)) {\n color = rgbToHsv(paletteColor);\n } else {\n color = e;\n }\n return color;\n};\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => {\n const defCon = mergeRecursive({}, context.constructor.defaultConfig());\n if (config.type === LINEAR) {\n config.range = config.range || [defCon.range[0]];\n config.range = config.range.length > 1 ? config.range : [DEFAULT_GRADIENT_COLOR, ...config.range];\n }\n const oldConfig = mergeRecursive(defCon, context.config());\n const newConfig = mergeRecursive(oldConfig, config);\n\n if (newConfig.range instanceof Array) {\n newConfig.range = newConfig.range.map((e, i) => getActualHslColor(e, palette[i]));\n newConfig.stops = config.stops ?\n config.stops :\n config.range && config.range.length > 2 ?\n config.range.length :\n DEFAULT_CONFIG.stops;\n }\n newConfig.value = getActualHslColor(newConfig.value, newConfig.value);\n return newConfig;\n }\n },\n domain: {},\n scale: {},\n uniqueValues: {}\n};\n","import { InvalidAwareTypes, getObjProp } from 'muze-utils';\n\nexport const treatNullMeasures = (domainVal, scaledVal, minDomainScaledVal) => {\n if (domainVal instanceof InvalidAwareTypes) {\n return minDomainScaledVal;\n }\n return scaledVal;\n};\n\nexport const resolveAxisConfig = (propVal, defaultVal, context) => {\n const constructor = getObjProp(propVal, 'constructor');\n switch (constructor) {\n case Function:\n return propVal(defaultVal, context);\n case Array:\n return propVal;\n default:\n return defaultVal;\n }\n};\n\nexport const sanitiseConfigIntervals = (intervals) => {\n if (intervals) {\n return intervals;\n }\n return 5;\n};\n","import { piecewiseInterpolator,\n hslInterpolator,\n sanitizeDomainWhenEqual, getReadableTicks } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, SEQUENTIAL, ORDINAL, QUANTILE } from '../enums/scale-type';\nimport { getHslString } from './props';\nimport { treatNullMeasures } from '../helper';\n\nconst getStops = (domain, stops) => {\n let newStops = [];\n\n if (stops instanceof Array) {\n newStops = stops.slice().sort();\n newStops = [...new Set([domain[0], ...stops, domain[1]])].sort();\n } else {\n newStops = getReadableTicks(domain, stops);\n }\n return { domain, newStops };\n};\n\nconst rangeStops = (newStopsLength, range) => {\n let newRange = [];\n const maxRangeLength = Math.min(range.length, 18);\n\n if (newStopsLength > maxRangeLength) {\n const interpolator = piecewiseInterpolator()(hslInterpolator(), range.map(e => getHslString(e)));\n for (let i = 0; i < newStopsLength; i++) {\n newRange[i] = interpolator(i / (newStopsLength - 1));\n }\n } else {\n newRange = range.slice(0, newStopsLength);\n }\n return { newRange };\n};\n\n/**\n*\n*\n* @param {*} domain\n*\n*/\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomainMeasure = (domain, stops, range) => {\n const uniqueVals = domain;\n return { domain, uniqueVals, scaleDomain: [0, 1], range };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain, stops, range) => {\n const uniqueVals = domain;\n return { uniqueVals, domain, nice: true, range };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} stops\n *\n */\nconst steppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(domain, stops);\n const { newRange } = rangeStops(newStops.length - 1, range);\n\n return { uniqueVals, domain: newStops, nice: true, range: newRange };\n};\n\nconst continousSteppedDomain = (domain, stops, range) => {\n const { domain: uniqueVals, newStops } = getStops(sanitizeDomainWhenEqual(domain), range.length - 1);\n const hslRange = range.map(e => getHslString(e));\n return { uniqueVals, domain: newStops, nice: true, range: hslRange };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst uniqueRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n return scale(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst indexedRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n\n return treatNullMeasures(domainValue, scale(numVal), scale(0));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) => treatNullMeasures(domainValue, scale(domainValue),\n scale(domain[0]));\n\n/**\n *\n *\n * @param {*} stops\n */\nconst strategies = () => ({\n [`${CONTINOUS}-${CONTINOUS}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${CONTINOUS}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomainMeasure,\n value: () => indexedRange\n },\n [`${DISCRETE}-${DISCRETE}-${SEQUENTIAL}`]: {\n scale: SEQUENTIAL,\n domainRange: () => indexedDomain,\n value: () => uniqueRange\n },\n [`${DISCRETE}-${DISCRETE}-${ORDINAL}`]: {\n scale: ORDINAL,\n domainRange: () => normalDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${CONTINOUS}-${ORDINAL}`]: {\n scale: LINEAR,\n domainRange: () => continousSteppedDomain,\n value: () => normalRange\n },\n [`${CONTINOUS}-${DISCRETE}-${ORDINAL}`]: {\n scale: QUANTILE,\n domainRange: () => steppedDomain,\n value: () => normalRange\n\n }\n});\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} stops\n */\nexport const strategyGetter = (domainType, rangeType, schemeType) =>\n strategies()[`${domainType}-${rangeType}-${schemeType || ''}`];\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters, rgbToHsv, defaultValue } from 'muze-utils';\nimport { createScale, getScheme, getSchemeType } from '../scale-creator';\nimport { CONTINOUS, DISCRETE, COLOR } from '../enums/constants';\nimport { strategyGetter } from './color-strategy';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { PROPS, getHslString, getActualHslColor } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ColorAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @param {Object | undefined} params.range Type of color range.\n * @param {string} params.name the label to show on axis.\n * @param {string} params.type The type of scale to handle.\n * @memberof ColorAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n this.config(config);\n\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n this._rangeType = (this._config.type === 'linear' && !this._config.step) ? CONTINOUS : DISCRETE;\n\n this._schemeType = getSchemeType(this._config.range);\n\n this._colorStrategy = this.setColorStrategy(this._domainType, this._rangeType, this._schemeType);\n this._scale = this.createScale(this._colorStrategy);\n\n this._id = getUniqueId();\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return COLOR;\n }\n\n /**\n *\n *\n * @param {*} colorStrategy\n *\n * @memberof ColorAxis\n */\n createScale (colorStrategy) {\n const { range } = this.config();\n if (range && typeof (range) === 'string') {\n return getScheme(range);\n }\n return createScale({\n type: colorStrategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setColorStrategy (domainType, rangeType, schemeType) {\n return strategyGetter(domainType, rangeType, schemeType);\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getHslString (hslColorArray) {\n return getHslString(hslColorArray);\n }\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getColor (domainVal) {\n return this.getHslString(this.getRawColor(domainVal));\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof ColorAxis\n */\n getRawColor (domainVal) {\n if (this.domain() && domainVal !== undefined) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const color = this._colorStrategy.value(range)(domainVal, scale, this.domain(), this.uniqueValues());\n if (color) {\n if (typeof color === 'string') {\n const col = color.substring(color.indexOf('(') + 1, color.lastIndexOf(')')).split(/,\\s*/);\n return rgbToHsv(...col);\n }\n return [...color];\n }\n }\n return [...this.config().value];\n }\n\n /**\n *\n *\n * @param {*} [domain=[]]\n *\n * @memberof ColorAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n const scale = this.scale();\n const range = scale.range ? scale.range() : null;\n const domainRangeFn = this._colorStrategy.domainRange();\n const scaleInfo = domainRangeFn(domain, this.config().stops, range);\n\n this.domain(scaleInfo.domain);\n scaleInfo.range && this.scale().range(scaleInfo.range);\n this.uniqueValues(scaleInfo.uniqueVals);\n this.scale().domain(scaleInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n config: this.config()\n };\n }\n\n transformColor (color, transformationArr) {\n const h = color[0] * 360;\n const s = color[1] * 100;\n const l = color[2] * 100;\n const a = Math.min(defaultValue(color[3], 0), 1);\n const newH = h + transformationArr[0];\n const newS = s + transformationArr[1];\n const newL = l + transformationArr[2];\n const newA = Math.min(a + transformationArr[3] || 0, 1);\n\n return { color: `hsla(${newH},${newS}%,${newL}%,${newA})`, hsla: [newH / 360, newS / 100, newL / 100, newA] };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n\n getHslArray (color) {\n return getActualHslColor(color);\n }\n\n}\n","export const DEFAULT_CONFIG = {\n value: 51,\n range: [51, 1000]\n};\n","import { numberInterpolator, piecewiseInterpolator, getReadableTicks } from 'muze-utils';\nimport { CONTINOUS, DISCRETE } from '../enums/constants';\nimport { LINEAR, THRESHOLD } from '../enums/scale-type';\nimport { treatNullMeasures } from '../helper';\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst indexedDomain = (domain) => {\n const uniqueVals = domain;\n const retDomain = domain.map((d, i) => (i) / (domain.length - 1));\n return { domain: retDomain, uniqueVals, scaleDomain: [0, 1] };\n};\n\n/**\n *\n *\n * @param {*} domain\n *\n */\nconst normalDomain = (domain) => {\n const uniqueVals = domain;\n return { uniqueVals, domain };\n};\n\n/**\n *\n *\n * @param {*} domain\n * @param {*} intervals\n *\n */\nconst steppedDomain = (domain, intervals) => {\n let newIntervals = [];\n if (intervals instanceof Array) {\n newIntervals = intervals.slice().sort();\n } else {\n // const interpolator = numberInterpolator()(...domain);\n // for (let i = 0; i < intervals; i++) {\n // newIntervals[i] = interpolator(i / (intervals - 1));\n // }\n newIntervals = getReadableTicks(domain, intervals);\n }\n // if (newIntervals[0] < domain[0]) {\n // newIntervals.shift();\n // }\n const retDomain = newIntervals;\n return { uniqueVals: newIntervals, domain: retDomain, nice: true };\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n * @param {*} uniqueVals\n *\n */\nconst discreteRange = (domainValue, scale, domain) => {\n const numVal = (domainValue - domain[0]) / (domain[domain.length - 1] - domain[0]);\n const interpolator = numberInterpolator()(...scale.range());\n return treatNullMeasures(domainValue, interpolator(numVal), interpolator(domain[0]));\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n * @param {*} domain\n *\n */\nconst pieceWiseRange = (domainValue, scale, domain, uniqueVals) => {\n const index = uniqueVals.indexOf(domainValue);\n const numVal = domain[index];\n const fn = piecewiseInterpolator()(numberInterpolator(), [...scale.range()]);\n return fn(numVal);\n};\n\n/**\n *\n *\n * @param {*} domainValue\n * @param {*} scale\n */\nconst normalRange = (domainValue, scale, domain) =>\n treatNullMeasures(domainValue, scale(domainValue), scale(domain[0]));\n\n/**\n *\n *\n * @param {*} intervals\n */\nconst strategies = {\n [`${DISCRETE}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: indexedDomain,\n range: pieceWiseRange\n },\n [`${CONTINOUS}-${CONTINOUS}`]: {\n scale: LINEAR,\n domain: normalDomain,\n range: normalRange\n },\n [`${CONTINOUS}-${DISCRETE}`]: {\n scale: THRESHOLD,\n domain: steppedDomain,\n range: discreteRange\n }\n};\n\n/**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n * @param {*} intervals\n */\nexport const strategyGetter = (domainType, rangeType) =>\n strategies[`${domainType}-${rangeType}`];\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => {\n context._userRange = value.range;\n return mergeRecursive(context._config || {}, value);\n }\n },\n domain: {\n sanitization: (context, value) => {\n context.scale().domain(value);\n return value;\n }\n },\n range: {},\n scale: {},\n uniqueValues: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SIZE, CONTINOUS, DISCRETE } from '../enums/constants';\nimport { strategyGetter } from './size-strategy';\nimport { PROPS } from './props';\nimport { sanitiseConfigIntervals } from '../helper';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class SizeAxis {\n\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} config input parameters.\n * @memberof SizeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this.config(this.constructor.defaultConfig());\n this.config(config);\n // @todo: Will use configuration override using scale decorator\n this._domainType = this._config.type === 'linear' ? CONTINOUS : DISCRETE;\n\n this._config.range = this._userRange ? this._userRange : this._config.range;\n\n this._config.stops = sanitiseConfigIntervals(this._config.stops);\n this._rangeType = this._config.type === 'linear' && !!this._config.stops ? DISCRETE : CONTINOUS;\n\n this._sizeStrategy = this.setStrategy(this._domainType, this._rangeType);\n this._scale = this.createScale(this._sizeStrategy);\n this._range = this._config.range;\n\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @param {*} domainType\n * @param {*} rangeType\n * @param {*} schemeType\n *\n * @memberof ColorAxis\n */\n setStrategy (domainType, rangeType) {\n return strategyGetter(domainType, rangeType);\n }\n\n /**\n *\n *\n *\n * @memberof SizeAxis\n */\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SIZE;\n }\n\n /**\n *\n *\n * @param {*} domainVal\n *\n * @memberof SizeAxis\n */\n getSize (domainVal = 0) {\n let sizeVal = 1;\n const {\n value\n } = this.config();\n const scale = this.scale();\n const domain = this.domain() || [1, 1];\n\n if (!scale || domain[0] === domain[1]) {\n sizeVal = value;\n } else {\n return this._sizeStrategy.range(domainVal, scale, this.domain(), this.uniqueValues());\n }\n return sizeVal;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof SizeAxis\n */\n updateDomain (domain) {\n if (domain) {\n const domainFn = this._sizeStrategy.domain;\n\n const domainInfo = domainFn(domain, this.config().stops);\n\n this.domain(domainInfo.domain);\n this.uniqueValues(domainInfo.uniqueVals);\n\n this.scale().domain(domainInfo.scaleDomain || this.domain());\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.range(),\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","export const DEFAULT_CONFIG = {\n generator: null,\n value: 'circle',\n range: ['circle', 'diamond', 'star', 'cross', 'square', 'wye', 'triangle']\n};\n","export const PROPS = {\n config: {},\n domain: {},\n scale: {},\n uniqueValues: {},\n generator: {}\n};\n\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, getSymbol, generateGetterSetters, mergeRecursive, InvalidAwareTypes } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_CONFIG } from './defaults';\nimport { SHAPE } from '../enums/constants';\nimport { shapeGenerator } from './helper';\nimport { PROPS } from './props';\n\n/**\n* This class is used to instantiate a SimpleAxis.\n* @class SimpleAxis\n*/\nexport default class ShapeAxis {\n /**\n * Creates an instance of SimpleAxis.\n * @param {Object} params input parameters.\n * @param {Object | undefined} params.range Type of color scheme.\n * @memberof ShapeAxis\n */\n constructor (config) {\n generateGetterSetters(this, PROPS);\n\n this._id = getUniqueId();\n this._config = Object.assign({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(this._config, config);\n\n this._scale = createScale({\n type: 'ordinal',\n range: this._config.range\n });\n this.updateDomain(config.domain);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof ColorAxis\n */\n static type () {\n return SHAPE;\n }\n\n /**\n *\n *\n * @param {*} value\n *\n * @memberof ShapeAxis\n */\n getShape (value) {\n if (!this.scale() || !this.domain() || !value || value instanceof InvalidAwareTypes) {\n return this.config().value;\n }\n\n if (this._generatedShapes) {\n return this._generatedShapes[value];\n }\n\n const shapeType = this.scale()(value);\n if (shapeType === 'string') {\n return getSymbol(shapeType);\n }\n\n return shapeType;\n }\n\n /**\n * This method is used to assign a domain to the axis.\n *\n * @param {Array} domain the domain of the scale\n * @memberof ShapeAxis\n */\n updateDomain (domain = []) {\n if (domain.length) {\n this.uniqueValues(domain);\n this.domain(domain);\n this.scale().domain(domain);\n\n if (this.config().generator) {\n this._generatedShapes = shapeGenerator(domain, this.config().generator);\n }\n }\n return this;\n }\n\n /**\n * This method returns an object that can be used to\n * reconstruct this instance.\n *\n * @return {Object} the serializable props of axis\n * @memberof ShapeAxis\n */\n serialize () {\n return {\n type: this.constructor.type(),\n scale: this.scale(),\n domain: this.domain(),\n range: this.config().range,\n config: this.config()\n };\n }\n\n /**\n * Returns the id of the axis.\n * @return {string} Unique identifier of the axis.\n */\n id () {\n return this._id;\n }\n}\n","/**\n *\n *\n * @param {*} domain\n * @param {*} generatorFn\n *\n */\nexport const shapeGenerator = (domain, generatorFn) => {\n const generatedShapes = {};\n domain.forEach((value) => {\n generatedShapes[value] = generatorFn(value);\n });\n return generatedShapes;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, config) => mergeRecursive(context.config(), config),\n preset: (context, config) => {\n const { range, domain } = config;\n range && context.range(range);\n domain && context.domain(domain);\n }\n },\n domain: {},\n range: {}\n};\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, Symbols, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { DEFAULT_ANGLE_DOMAIN } from '../enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst { pie } = Symbols;\n\nconst createAngleValues = (context) => {\n const angleData = context._angleFn(context._domain);\n angleData.forEach((v) => {\n v.startAngle -= Math.PI / 2;\n v.endAngle -= Math.PI / 2;\n });\n context._angleValues = angleData.reduce((values, d) => {\n const key = d.data;\n !values[key] && (values[key] = []);\n values[key].push(d);\n return values;\n }, {});\n};\n\n/**\n* This class is used to instantiate a AngleAxis.\n* @class AngleAxis\n*/\nexport default class AngleAxis {\n\n /**\n * Creates an instance of AngleAxis.\n * @param {Object} config input parameters.\n * @memberof AngleAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._range = [0, 360];\n this._angleFn = pie()\n .value(d => (typeof d === 'string' ? 1 : d))\n .sortValues(null);\n this._angleValues = {};\n }\n\n static defaultConfig () {\n return {};\n }\n\n createScale (strategy) {\n const {\n range\n } = this.config();\n return createScale({\n type: strategy.scale,\n range\n });\n }\n\n getScaleValue (domainVal) {\n return this._angleValues[domainVal];\n }\n\n padAngle (angle) {\n this._angleFn = this._angleFn.padAngle(angle);\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n const domain = domainVal[0].length ? domainVal[0] : DEFAULT_ANGLE_DOMAIN;\n this._domain = resolveAxisConfig(customDomain, domain, this);\n createAngleValues(this);\n return this;\n }\n return this._domain;\n }\n\n range (...range) {\n if (range.length) {\n const { range: customRange } = this.config();\n this._range = resolveAxisConfig(customRange, range[0], this);\n const domain = this.domain();\n const [startAngle, endAngle] = this._range;\n this._angleFn\n .startAngle((startAngle / 180) * Math.PI)\n .endAngle(Math.PI * endAngle / 180);\n if (domain && domain.length) {\n createAngleValues(this);\n }\n return this;\n }\n return this._range;\n }\n}\n","/**\n * This file exports constants that are used as enums in the\n * crosstab group implementation.\n */\n/**\n * Width of the crosstab.\n */\nexport const X = 'x';\n/**\n * Width of the crosstab.\n */\nexport const Y = 'y';\n/**\n * Width of the crosstab.\n */\nexport const WIDTH = 'width';\n\n/**\n * Height of the crosstab.\n */\nexport const HEIGHT = 'height';\n\n/**\n * Field referring to object storing measurement configuration.\n */\nexport const MEASUREMENT = 'measurement';\n\n/**\n * Field referring to object storing configuration properties.\n */\nexport const CONFIG = 'config';\n\n/**\n * Width of visual unit in crosstab.\n */\nexport const MIN_UNIT_WIDTH = 'minUnitWidth';\n\n/**\n * Height of visual unit.\n */\nexport const MIN_UNIT_HEIGHT = 'minUnitHeight';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSIONS = 'dimensions';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURES = 'measures';\n\n/**\n * Field to store the array of dimensions to facet by.\n */\nexport const DIMENSION = 'dimension';\n\n/**\n * Field to store array of measures to use as x axis.\n */\nexport const MEASURE = 'measure';\n\n/**\n * Flag to specify if model should be pivoted.\n */\nexport const PIVOT = 'pivot';\n\n/**\n * Flag to specify format\n */\nexport const FORMAT = 'format';\n\n/**\n * Mount point where the variable will be hosted\n */\nexport const MOUNT = 'mount';\n\n/**\n * Data update flag\n */\nexport const HAS_DATA_UPDATED = 'hasDataUpdated';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROWS = 'rows';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMNS = 'columns';\n\n/**\n * Field referring to object storing data\n */\nexport const DATA = 'data';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COL = 'col';\n\n/**\n * Field referring to object storing set of rows\n */\nexport const ROW = 'row';\n\n/**\n * Field referring to object storing set of columns\n */\nexport const COLUMN = 'column';\n\n/**\n * Field referring to object storing color field\n */\nexport const COLOR = 'color';\n\n/**\n * Field referring to object storing shape field\n */\nexport const SHAPE = 'shape';\n\n/**\n * Field referring to object storing size field\n */\nexport const SIZE = 'size';\n\n/**\n * Field referring to object storing detail field\n */\nexport const DETAIL = 'detail';\n\n/**\n * Field referring to object storing set of layers\n */\nexport const LAYERS = 'layers';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const TRANSFORM = 'transform';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const ORDINAL = 'ordinal';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const LINEAR = 'linear';\n/**\n * Field referring to object storing the transforms\n */\nexport const LEFT = 'left';\n/**\n * Field referring to object storing the transforms\n */\nexport const RIGHT = 'right';\n/**\n * Field referring to object storing the transforms\n */\nexport const TOP = 'top';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTTOM = 'bottom';\n\n/**\n * Field referring to object storing the transforms\n */\nexport const RETINAL = 'retinal';\n/**\n * Field referring to object storing the transforms\n */\nexport const CELL = 'cell';\n/**\n * Field referring to object storing the transforms\n */\nexport const X_AXES = 'xAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const Y_AXES = 'yAxes';\n/**\n * Field referring to object storing the transforms\n */\nexport const ENTRY_CELLS = 'entryCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const INITIALIZED = 'initialized';\n/**\n * Field referring to object storing the transforms\n */\nexport const EXIT_CELLS = 'exitCell';\n/**\n * Field referring to object storing the transforms\n */\nexport const AXIS = 'axis';\n/**\n * Field referring to object storing the transforms\n */\nexport const UNIT = 'unit';\n/**\n * Field referring to object storing the transforms\n */\nexport const UPDATED = 'updated';\n/**\n * Field referring to object storing the transforms\n */\nexport const BEFORE_UPDATE = 'beforeupdate';\n/**\n * Field referring to object storing the transforms\n */\nexport const VALUE_MATRIX = 'valueMatrix';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET_HEADERS = 'facet-headers';\n/**\n * Field referring to object storing the transforms\n */\nexport const RADIUS = 'radius';\n/**\n * Field referring to object storing the transforms\n */\nexport const ANGLE = 'angle';\n\nexport const ANGLE0 = 'angle0';\n/**\n * Field referring to object storing the transforms\n */\nexport const ARC = 'arc';\n/**\n * Field referring to object storing the transforms\n */\nexport const CATEGORICAL = 'categorical';\n/**\n * Field referring to object storing the transforms\n */\nexport const TEMPORAL = 'temporal';\n/**\n * Field referring to object storing the transforms\n */\nexport const BAR = 'bar';\n/**\n * Field referring to object storing the transforms\n */\nexport const LINE = 'line';\n/**\n * Field referring to object storing the transforms\n */\nexport const POINT = 'point';\n/**\n * Field referring to object storing the transforms\n */\nexport const PRIMARY = 'Primary';\n/**\n * Field referring to object storing the transforms\n */\nexport const SECONDARY = 'Secondary';\n/**\n * Field referring to object storing the transforms\n */\nexport const BOTH = 'both';\n/**\n * Field referring to object storing the transforms\n */\nexport const INTERACTION = 'interaction';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_LINES = 'gridLines';\n/**\n * Field referring to object storing the transforms\n */\nexport const GRID_BANDS = 'gridBands';\n/**\n * Field referring to object storing the transforms\n */\nexport const HEADER = 'header';\n/**\n * Field referring to object storing the transforms\n */\nexport const FACET = 'facet';\nexport const DEFAULT = 'default';\n/**\n * Ordering type\n */\nexport const ASCENDING = 'asc';\n/**\n * Ordering type\n */\nexport const DESCENDING = 'desc';\n\nexport const DARK = 'dark';\nexport const NONE = 'none';\nexport const NORMAL = 'normal';\nexport const DARKER = 'darker';\n","/**\n * @module Axis\n * This file declares a class that is used to render an axis to add meaning to\n * plots.\n */\nimport { getUniqueId, mergeRecursive, generateGetterSetters, sanitizeDomainWhenEqual } from 'muze-utils';\nimport { createScale } from '../scale-creator';\nimport { LINEAR } from '../../../visual-group/src/enums/constants';\nimport { PROPS } from './props';\nimport { resolveAxisConfig } from '../helper';\n\nconst adjustDomain = (context) => {\n const minOuterRadius = context.config().minOuterRadius;\n const domain = context._domain;\n if (context._range.length) {\n const scale = context._scale;\n const value = scale.invert(minOuterRadius) - scale.invert(0);\n context._domain = [domain[0] - value, domain[1]];\n scale.domain(context._domain);\n }\n};\n\n/**\n* This class is used to instantiate a RadiusAxis.\n* @class RadiusAxis\n*/\nexport default class RadiusAxis {\n\n /**\n * Creates an instance of RadiusAxis.\n * @param {Object} config input parameters.\n * @memberof RadiusAxis\n */\n constructor (config = {}) {\n this._id = getUniqueId();\n generateGetterSetters(this, PROPS);\n this._range = [];\n this._radiusFactor = 1;\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n this.config(config);\n this._scale = this.createScale({\n scale: LINEAR\n });\n }\n\n static defaultConfig () {\n return {\n padding: [0, 1],\n minOuterRadius: 10\n };\n }\n\n config (...params) {\n if (params.length) {\n const config = mergeRecursive(this.config(), params[0]);\n this._config = config;\n return this;\n }\n return this._config;\n }\n\n createScale (strategy) {\n return createScale({\n type: strategy.scale,\n range: this.range()\n });\n }\n\n domain (...domainVal) {\n if (domainVal.length) {\n const { domain: customDomain } = this.config();\n let domain = resolveAxisConfig(customDomain, domainVal[0], this);\n domain = sanitizeDomainWhenEqual(domain);\n this._scale.domain(domain);\n this._domain = domain;\n adjustDomain(this);\n }\n return this._domain;\n }\n\n getInnerRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[0];\n }\n return this._scale(domainVal);\n }\n\n getOuterRadius (domainVal) {\n if (domainVal === undefined) {\n return this.range()[1];\n }\n const radius = this._scale(domainVal) * this._radiusFactor;\n return radius;\n }\n\n range (...range) {\n if (range.length) {\n const { padding, range: customRange } = this.config();\n const sanitizedRange = range[0].map((v, i) => v + (i ? -padding[i] : padding[i]));\n const rangeVal = resolveAxisConfig(customRange, sanitizedRange, this);\n this._range = rangeVal;\n this._scale.range(rangeVal);\n adjustDomain(this);\n }\n return this._range;\n }\n\n setRadiusFactor (val) {\n this._radiusFactor = val;\n return this;\n }\n}\n","import * as ScaleType from './enums/scale-type';\n\nconst DATA_TYPES = {\n DIMENSION: 'dimension',\n CATEGORICAL: 'categorical',\n MEASURE: 'measure',\n TEMPORAL: 'temporal'\n};\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [DATA_TYPES.DIMENSION]: ScaleType.BAND,\n [DATA_TYPES.MEASURE]: ScaleType.LINEAR,\n [DATA_TYPES.TEMPORAL]: ScaleType.TIME\n};\n\n","import { nestCollection, InvalidAwareTypes } from 'muze-utils';\n\n/**\n * Create multiple datasets from a single dataset by grouping the data using\n * a dimensional field.\n * @param {Array} schema Name and type of fields are stored in schema\n * @param {Array} data Data array\n * @param {Object} config Configuration object\n * @return {Array} Grouped data array\n */\nexport default (schema, data, config) => {\n const groupBy = config.groupBy instanceof Array ? config.groupBy : [config.groupBy];\n const groupByIndices = groupBy.map(fieldName => schema.findIndex(d => d.name === fieldName));\n\n if (groupByIndices.find(d => d === -1) !== undefined) {\n throw new Error(`Groupby field ${groupBy} not found in schema`);\n }\n\n const groupedData = nestCollection({\n keys: groupByIndices,\n data\n });\n\n groupedData.forEach((d) => {\n const key = d.key;\n if (InvalidAwareTypes.isInvalid(key)) {\n d.key = InvalidAwareTypes.getInvalidType(key);\n }\n });\n return groupedData;\n};\n","/**\n * @module Transform\n * This file exports a function that is used to implement\n * the identity transform\n */\n /* eslint no-unused-vars: 0 */\n /**\n * This function accepts data and returns the data unchanged.\n * @param {Object} schema The schema.\n * @param {Array} data The data array.\n * @param {Object} config The config object.\n * @return {Array} The unchanged data.\n */\n function identityTransform (schema, data, config) {\n return data;\n }\n\n export default identityTransform;\n","/**\n * @module Transform\n * This file exports the transform factory.\n */\nimport * as TransformType from '../enums/transform-type';\nimport identity from '../identity-transform';\nimport group from '../group-transform';\nimport stack from '../stack-transform';\n\n/* istanbul ignore next */\nconst transformMap = {\n [TransformType.IDENTITY]: identity,\n [TransformType.GROUP]: group,\n [TransformType.STACK]: stack\n};\n\n/**\n * This function is used to retirn a transform associated\n * with the given type.\n *\n * @param {string} type The type of the transform.\n * @return {Function} The transform function.\n */\nfunction transformFactory (type) {\n const transform = transformMap[type];\n if (typeof transform !== 'function') {\n throw new Error('Invalid transform type supplied.');\n }\n return transform;\n}\n\nexport default transformFactory;\n","/**\n * @module Transform\n * This module exports constants that are used to reference transforms in\n * a consistent manner throughout the project.\n */\n/* eslint one-var: 0 */\n export const IDENTITY = 'identity';\n export const GROUP = 'group';\n export const STACK = 'stack';\n export const FRACTURE = 'fracture';\n","import { stack, InvalidAwareTypes } from 'muze-utils';\n\nimport group from '../group-transform';\n/*\n Normalize the data to a form which can be given to d3 stack for stacking the data\n ['Product', 'Sales', 'Region'],\n 0 ['A', 2000, 'North'],\n 1 ['A', 3000, 'South'],\n 2 ['B', 3000, 'South'],\n 3 ['B', 2000, 'North'],\n 4 ['C', 3000, 'South'],\n 5 ['C', 2000, 'North']\n |\n |\n ['Product', 'North', 'South'],\n ['A', 2000, 3000],\n ['B', 2000, 3000],\n ['C', 2000, 3000]\n*/\n// eslint-disable-next-line require-jsdoc\nconst normalizeData = (data, schema, valueField, uniqueField, groupBy) => {\n const groupedData = group(schema, data, {\n groupBy: uniqueField\n });\n const uniqueFieldIndex = schema.findIndex(d => d.name === uniqueField);\n const valueFieldIndex = schema.findIndex(d => d.name === valueField);\n const seriesKeyIndex = schema.findIndex(d => d.name === groupBy);\n const seriesKeys = data.map(d => d[seriesKeyIndex]).filter((item, pos, arr) => arr.indexOf(item) === pos).sort();\n\n const fieldNames = schema.reduce((acc, obj, i) => {\n acc[i] = obj.name;\n return acc;\n }, {});\n const dataArr = groupedData.map((arr) => {\n const tuples = {};\n const rowObj = arr.values.reduce((acc, row) => {\n acc = row.reduce((obj, value, i) => {\n if (i === seriesKeyIndex) {\n if (row[valueFieldIndex] instanceof InvalidAwareTypes) {\n row[valueFieldIndex] = null;\n }\n obj[value] = row[valueFieldIndex];\n tuples[value] = row;\n } else if (i !== valueFieldIndex) {\n obj[fieldNames[i]] = value;\n }\n return obj;\n }, acc);\n return acc;\n }, {});\n rowObj._tuple = tuples;\n // Set missing values field to zero value\n seriesKeys.forEach((seriesKey) => {\n if (rowObj[seriesKey] === undefined) {\n rowObj[seriesKey] = 0;\n const newArr = new Array(arr.values[0].length);\n newArr[uniqueFieldIndex] = arr.key;\n newArr[seriesKeyIndex] = seriesKey;\n rowObj._tuple[seriesKey] = newArr;\n }\n });\n return rowObj;\n });\n\n return {\n data: dataArr,\n keys: seriesKeys\n };\n};\n\n/**\n * Generate a stacked representation of data\n * @param {Array} schema schema Array\n * @param {Array} data data array\n * @param {Object} config Configuration object\n * @return {Array} stacked data\n */\nexport default (schema, data, config) => {\n const { uniqueField, value: valueField, groupBy } = config;\n const sort = config.sort || 'descending';\n const normalizedData = normalizeData(data, schema, valueField, uniqueField, groupBy);\n const keys = normalizedData.keys;\n const map = {};\n const orderBy = config.orderBy;\n const orderIndex = schema.findIndex(d => d.name === orderBy);\n const groupByIndex = schema.findIndex(d => d.name === groupBy);\n\n if (orderIndex !== -1) {\n keys.forEach((key) => {\n const name = data.find(d => d[groupByIndex] === key);\n map[key] = name[orderIndex];\n });\n normalizedData.keys.sort((a, b) => map[a].localeCompare(map[b]));\n }\n\n const stackData = stack({\n keys: normalizedData.keys,\n offset: config.offset || 'diverging',\n order: sort,\n data: normalizedData.data\n });\n\n stackData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n dataObj.data = dataObj.data._tuple[seriesData.key];\n });\n });\n\n return stackData;\n};\n\n","import {\n FieldType,\n getDomainFromData,\n setStyles,\n easeFns,\n selectElement,\n DimensionSubtype,\n retrieveNearestGroupByReducers,\n getObjProp,\n COORD_TYPES,\n CommonProps,\n defaultValue,\n InvalidAwareTypes,\n isSimpleObject\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { transformFactory } from '@chartshq/transform';\nimport { IDENTITY, STACK, GROUP, COLOR, SHAPE, SIZE, ENCODING, AGG_FN_SUM, ASCENDING, TEXT } from '../enums/constants';\n\nconst BAND = ScaleType.BAND;\nconst { POLAR, CARTESIAN } = COORD_TYPES;\n\nexport const transformColor = (colorAxis, datum, styleType, intensity, interactionType) => {\n const meta = datum.meta;\n const stateColor = defaultValue(meta.currentState[interactionType][styleType], meta.originalState[styleType]);\n const colorInfo = colorAxis.transformColor(stateColor, intensity);\n\n // meta.stateColor[styleType] = colorInfo.hsla;\n meta.currentState[interactionType][styleType] = colorInfo.hsla;\n return colorInfo;\n};\n\nexport const applyInteractionStyle = (context, selectionSet, interactionStyles, config) => {\n const elements = context.getPlotElementsFromSet(selectionSet);\n const { apply, interactionType, reset } = config;\n const mountPoint = selectElement(context.mount()).select('.muze-overlay-paths').node();\n\n elements.forEach((elem) => {\n const options = { mountPoint, apply, reset };\n context.applyLayerStyle(elem, interactionType, interactionStyles, options);\n\n // const interactionStylesEntries = Object.entries(interactionStyles.style);\n\n // for (const [type, value] of interactionStylesEntries) {\n // const style = { type, value };\n // const options = { mountPoint, apply, reset };\n // context.applyLayerStyle(elem, interactionType, style, options);\n // }\n });\n};\n\nexport const retrieveEncodingInf = (encoding, fieldsConfig, encodingNames) => {\n const encodingInf = {};\n\n encodingNames\n .forEach((e) => {\n const field = getObjProp(encoding, e, 'field');\n encodingInf[`${e}Field`] = field;\n encodingInf[`${e}FieldIndex`] = getObjProp(fieldsConfig, field, 'index');\n encodingInf[`${e}FieldType`] = getObjProp(fieldsConfig, field, 'def', 'type');\n encodingInf[`${e}FieldSubType`] = getObjProp(fieldsConfig, field, 'def', 'subtype');\n });\n return encodingInf;\n};\n\nexport const encodingFieldInfRetriever = {\n [POLAR]: (encoding, fieldsConfig) => {\n const fields = [ENCODING.RADIUS, ENCODING.RADIUS0, ENCODING.ANGLE, ENCODING.ANGLE0, COLOR, SHAPE, SIZE, TEXT];\n return retrieveEncodingInf(encoding, fieldsConfig, fields);\n },\n [CARTESIAN]: (encoding, fieldsConfig) => {\n const fields = [ENCODING.X, ENCODING.Y, ENCODING.X0, ENCODING.Y0, COLOR, SHAPE, SIZE, TEXT];\n return retrieveEncodingInf(encoding, fieldsConfig, fields);\n }\n};\n\nexport const setNullsInStack = (transformedData, schema, value, setNulls) => {\n const uniqueFieldIndex = schema.findIndex(d => d.name === value);\n transformedData.forEach((seriesData) => {\n seriesData.forEach((dataObj) => {\n if (dataObj.data[uniqueFieldIndex] === null && !setNulls) {\n dataObj[0] = null;\n dataObj[1] = null;\n }\n });\n });\n return transformedData;\n};\nexport const setNulls = (transformedData, val) => transformedData.map((seriesData) => {\n if (val && (seriesData[val.index] instanceof InvalidAwareTypes)) {\n seriesData[val.index] = null;\n }\n return seriesData;\n});\n\n/**\n *\n *\n * @param {*} dataModel\n * @param {*} config\n * @param {*} transformType\n *\n */\nexport const transformData = (dataModel, config, transformType, encodingFieldInf) => {\n const data = dataModel.getData({ withUid: true });\n const schema = data.schema;\n const { transform, connectNullData: setNullData } = config;\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = encodingFieldInf;\n const uniqueField = xFieldType === FieldType.MEASURE ? yField : xField;\n const value = yFieldType === FieldType.MEASURE ? yField : xField;\n let transformedData = transformFactory(transformType)(schema, data.data, {\n groupBy: transform.groupBy,\n uniqueField,\n sort: transform.sort || 'none',\n offset: transform.offset,\n orderBy: transform.orderBy,\n value\n }, data.uids);\n\n if (transformType === STACK) {\n transformedData = setNullsInStack(transformedData, schema, value, setNullData);\n } else {\n transformedData = setNulls(transformedData, dataModel.getFieldsConfig()[value]);\n }\n return transformedData;\n};\n\nexport const getIndividualClassName = (d, i, data, context) => {\n const className = context.config().individualClassName;\n let classNameStr = '';\n if (className instanceof Function) {\n classNameStr = className(d, i, data, context);\n }\n return classNameStr;\n};\n\nexport const dataNormalizers = {\n [POLAR]: (transformedData, encodingFieldInf, fieldsConfig) => {\n const {\n radiusFieldIndex,\n angleFieldIndex,\n radius0FieldIndex,\n angle0FieldIndex\n } = encodingFieldInf;\n const fieldsLen = Object.keys(fieldsConfig).length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map(data => data.map((d) => {\n const pointObj = {\n radius: d[radiusFieldIndex],\n angle: angleFieldIndex !== undefined ? d[angleFieldIndex] : 1,\n radius0: d[radius0FieldIndex],\n angle0: d[angle0FieldIndex]\n };\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n return pointObj;\n })).filter(d => d.length);\n },\n [CARTESIAN]: (transformedData, encodingFieldInf, fieldsConfig, transformType) => {\n const {\n xFieldType,\n xFieldIndex,\n yFieldIndex,\n x0FieldIndex,\n y0FieldIndex\n } = encodingFieldInf;\n const fieldsArr = Object.keys(fieldsConfig);\n const fieldsLen = fieldsArr.length;\n\n /**\n * Returns normalized data from transformed data. It recursively traverses through\n * the transformed data if there it is nested.\n */\n return transformedData.map((data) => {\n const values = transformType === GROUP ? data.values : data;\n return values.map((d) => {\n let pointObj = {};\n let tuple;\n if (transformType === STACK) {\n tuple = d.data || [];\n let y;\n let y0;\n let x;\n let x0;\n if (d[1] >= d[0]) {\n y = x0 = d[1];\n x = y0 = d[0];\n } else {\n y = x0 = d[0];\n x = y0 = d[1];\n }\n\n pointObj = xFieldType === FieldType.MEASURE ? {\n x,\n x0,\n y: tuple[yFieldIndex],\n y0: tuple[yFieldIndex]\n } : {\n x: tuple[xFieldIndex],\n x0: tuple[xFieldIndex],\n y,\n y0\n };\n pointObj.source = tuple;\n pointObj.rowId = tuple[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = tuple[encodingFieldInf[`${enc}FieldIndex`]];\n });\n } else {\n pointObj = {\n x: d[xFieldIndex],\n y: d[yFieldIndex],\n x0: d[x0FieldIndex],\n y0: d[y0FieldIndex]\n };\n pointObj.source = d;\n pointObj.rowId = d[fieldsLen];\n [COLOR, SHAPE, SIZE, TEXT].forEach((enc) => {\n pointObj[enc] = d[encodingFieldInf[`${enc}FieldIndex`]];\n });\n }\n const source = pointObj.source;\n pointObj.dataObj = fieldsArr.reduce((acc, name) => {\n acc[name] = source[fieldsConfig[name].index];\n return acc;\n }, {});\n return pointObj;\n });\n }).filter(d => d.length);\n }\n};\n/*\n * This method resolves the x, y, x0 and y0 values from the transformed data.\n * It also checks the type of transformed data for example, if it is a stacked data\n * then it fetches the y and y0 values from the stacked data.\n * @param {Array.} transformedData transformed data\n * @param {Object} fieldsConfig field definitions\n * @param {string} transformType type of transformed data - stack, group or identity.\n * @return {Array.} Normalized data\n*/\nexport const getNormalizedData = (transformedData, context) => {\n const transformType = context.transformType();\n const transformedDataArr = transformType === IDENTITY ? [transformedData] : transformedData;\n const encodingFieldInf = context.encodingFieldsInf();\n const fieldsConfig = context.data().getFieldsConfig();\n return dataNormalizers[context.coord()](transformedDataArr, encodingFieldInf, fieldsConfig, transformType);\n};\n\nexport const domainCalculator = {\n [POLAR]: (data, layerInst) => {\n const config = layerInst.config();\n const { sort } = config;\n let angleValues = data[0];\n const radius0Field = getObjProp(config.encoding.radius0, 'field');\n if (sort) {\n angleValues = angleValues.sort((a, b) => (sort === ASCENDING ? a.radius - b.radius : b.radius - a.radius));\n }\n const radiusDomain = getDomainFromData(data, [ENCODING.RADIUS, radius0Field ?\n ENCODING.RADIUS0 : ENCODING.RADIUS]);\n return {\n radius: radiusDomain,\n angle: angleValues.map(d => d.angle),\n angle0: angleValues.map(d => d.angle0)\n };\n },\n [CARTESIAN]: (data, layerInst) => {\n const transformType = layerInst.transformType();\n const encodingFieldInf = layerInst.encodingFieldsInf();\n const {\n xFieldSubType,\n yFieldSubType,\n xField,\n yField,\n x0Field,\n y0Field\n } = encodingFieldInf;\n const domains = {};\n const yEnc = ENCODING.Y;\n const xEnc = ENCODING.X;\n if (xField) {\n domains.x = getDomainFromData(data, x0Field || transformType === STACK ? [xEnc, ENCODING.X0] : [xEnc, xEnc],\n xFieldSubType);\n }\n if (yField) {\n domains.y = getDomainFromData(data, y0Field || transformType === STACK ? [ENCODING.Y0, ENCODING.Y] :\n [yEnc, yEnc], yFieldSubType);\n }\n\n return domains;\n }\n};\n\nconst defFn = (d) => {\n const { x, y } = d.update;\n return {\n x,\n y\n };\n};\n\nexport const attachDataToVoronoi = (voronoi, points, accessor = defFn) => {\n voronoi.data([].concat(...points).filter(d => d.rowId !== undefined).map((d) => {\n const { x, y } = accessor(d);\n return {\n x,\n y,\n data: d\n };\n }));\n};\n\n/**\n *\n *\n * @param {*} target\n * @param {*} styles\n * @param {*} remove\n */\nexport const updateStyle = (target, styles, remove) => {\n for (const key in styles) {\n if ({}.hasOwnProperty.call(styles, key)) {\n target.style(key, remove ? null : styles[key]);\n }\n }\n};\n\n/**\n *\n *\n * @param {*} mount\n * @param {*} context\n */\nexport const animateGroup = (mount, context) => {\n let groupTransition;\n let update;\n const { transition, groupAnimateStyle } = context;\n const { duration, effect, disabled } = transition;\n if (groupAnimateStyle) {\n setStyles(mount.node(), groupAnimateStyle.enter);\n update = groupAnimateStyle.update;\n if (!disabled) {\n groupTransition = mount.transition()\n .ease(easeFns[effect])\n .duration(duration)\n .on('end', function () {\n updateStyle(selectElement(this), update, true);\n });\n } else {\n groupTransition = mount;\n }\n updateStyle(groupTransition, update);\n }\n};\n\nexport const positionPoints = (context, points) => {\n const positioner = context.encodingTransform();\n if (positioner) {\n return positioner(points, context, { smartLabel: context._dependencies.smartLabel });\n }\n return points;\n};\n\n/**\n * Gets the width of each group. It gets the width from axis if it is available for\n * example when the scale is nominal else it calculates the width from the\n * range of the axis and number of data points.\n *\n * @param {SimpleAxis} axis instance of axis\n * @param {number} minDiff Minimum difference between data points\n * @return {number} width of each bar\n * @private\n*/\nexport const getGroupSpan = (axis, minDiff) => {\n let groupSpan;\n const width = axis.getUnitWidth();\n const scale = axis.scale();\n const range = scale.range();\n const domain = scale.domain();\n !width ? groupSpan = (Math.abs(range[1] - range[0]) / Math.abs(domain[1] - domain[0])) * minDiff :\n (groupSpan = width);\n\n return groupSpan;\n};\n\nexport const getPlotMeasurement = (context, dimensionalValues) => {\n const fieldInfo = context.encodingFieldsInf();\n const axes = context.axes();\n const transformType = context.transformType();\n const config = context.config();\n const bandScale = context._bandScale;\n\n return ['x', 'y'].map((type) => {\n let span = 0;\n let groupSpan = 0;\n let padding = 0;\n let offsetValues = [];\n if (fieldInfo[`${type}FieldType`] === FieldType.DIMENSION) {\n let actualGroupWidth;\n const isTemporal = fieldInfo[`${type}FieldSubType`] === DimensionSubtype.TEMPORAL;\n const timeDiff = isTemporal ? context.dataProps().timeDiffs[type] : 0;\n const axis = axes[type];\n const pad = config[`pad${type.toUpperCase()}`];\n const innerPadding = config.innerPadding;\n const keys = dimensionalValues;\n const scale = axis.scale();\n groupSpan = getGroupSpan(axis, timeDiff);\n const isAxisBandScale = axis.constructor.type() === BAND;\n const axisPadding = axis.config().padding;\n // If it is a grouped bar then the width of each bar in a grouping is retrieved from\n // a band scale. The band scale will have range equal to width of one group of bars and\n // the domain is set to series keys.\n if (transformType === 'group') {\n const groupPadding = isAxisBandScale ? 0 : axisPadding * groupSpan / 2;\n bandScale.range([groupPadding, groupSpan - groupPadding]).domain(keys).paddingInner(innerPadding);\n span = bandScale.bandwidth();\n actualGroupWidth = groupSpan - (isAxisBandScale ? 0 : axisPadding * groupSpan);\n offsetValues = keys.map(key => bandScale(key) - (isAxisBandScale ? 0 : (groupSpan / 2)));\n } else if (pad !== undefined) {\n let offset;\n if (isAxisBandScale) {\n const step = scale.step();\n offset = scale.padding() * step;\n span = scale.bandwidth() + offset;\n } else {\n span = groupSpan;\n }\n offsetValues = keys.map(() => (isAxisBandScale ? -(offset / 2) : -(span / 2)));\n } else {\n padding = isAxisBandScale ? 0 : axisPadding * groupSpan;\n span = groupSpan - padding;\n actualGroupWidth = span;\n offsetValues = keys.map(() => (isAxisBandScale ? 0 : -(span / 2)));\n }\n\n groupSpan = actualGroupWidth;\n padding = isAxisBandScale ? axisPadding * axis.scale().step() : axisPadding * groupSpan;\n }\n\n return {\n span,\n offsetValues,\n groupSpan,\n padding\n };\n });\n};\n\nexport const renderLayer = (context) => {\n const mount = context.mount();\n if (mount) {\n context.render(mount);\n context.dependencies().throwback.commit(CommonProps.ON_LAYER_DRAW, true, context.metaInf().parentNamespace);\n }\n};\n\nconst transformResolverPredicates = (encodingFieldInf, context, groupByField) => {\n const fieldsConfig = context.data().getFieldsConfig();\n const { xField, yField, xFieldType, yFieldType } = encodingFieldInf;\n const dimensionField = ['xField', 'yField'].find(type =>\n encodingFieldInf[`${type}Type`] === FieldType.DIMENSION);\n\n return [\n !xField,\n !yField,\n !groupByField,\n getObjProp(fieldsConfig[groupByField], 'def', 'type') === FieldType.MEASURE,\n xFieldType === FieldType.DIMENSION && yFieldType === FieldType.DIMENSION,\n dimensionField && encodingFieldInf[dimensionField] === groupByField\n ];\n};\n\nexport const resolveInvalidTransformType = (context) => {\n const encodingFieldInf = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n\n if (transformResolverPredicates(encodingFieldInf, context, groupByField).some(value => value)) {\n return IDENTITY;\n }\n return null;\n};\n\nexport const getValidTransform = context => resolveInvalidTransformType(context) || context.config().transform.type;\n\nexport const getValidTransformForAggFn = (context) => {\n const resolvedInvalidTransformType = resolveInvalidTransformType(context);\n if (resolvedInvalidTransformType) {\n return resolvedInvalidTransformType;\n }\n\n const {\n xField,\n yField,\n xFieldType,\n yFieldType\n } = context.encodingFieldsInf();\n const groupByField = context.config().transform.groupBy;\n const isCustomTransformTypeProvided = !!getObjProp(context._customConfig, 'transform', 'type');\n let transformType = context.config().transform.type;\n\n if (!isCustomTransformTypeProvided && groupByField && xFieldType !== yFieldType) {\n const measureField = xFieldType === FieldType.MEASURE ? xField : yField;\n const { [measureField]: aggFn } = retrieveNearestGroupByReducers(context.data(), measureField);\n transformType = aggFn === AGG_FN_SUM ? STACK : GROUP;\n }\n\n return transformType;\n};\n\nexport const getMarkId = (source, schema) => source.filter((val, i) => schema[i] &&\n schema[i].type === FieldType.DIMENSION).join();\n\nexport const resolveEncodingValues = (data, i, dataArr, layerInst) => {\n const transformedValues = {};\n const values = data.values;\n const encoding = layerInst.config().encoding;\n for (const key in values) {\n const value = getObjProp(encoding[key], 'value');\n if (value instanceof Function) {\n transformedValues[key] = value(values, i, dataArr, layerInst);\n } else {\n transformedValues[key] = values[key];\n }\n }\n return transformedValues;\n};\n\nexport const getColorMetaInf = (initialStyle, conf = {}) => ({\n originalStyle: Object.assign({}, {\n styles: initialStyle\n }, conf),\n currentState: new Map()\n});\n\nconst getCoordValue = (radius, trig, angle, offset) => radius * Math[trig](angle) + offset;\n\nconst coordValueGetter = (radius, angle, xOffset, yOffset) => ({\n x: getCoordValue(radius, 'cos', angle, xOffset),\n y: getCoordValue(radius, 'sin', angle, yOffset)\n});\n\nexport const toCartesianCoordinates = (points, measurement, rangePlot = false) => {\n const xOffset = measurement.width / 2;\n const yOffset = measurement.height / 2;\n for (let i = 0, len = points.length; i < len; i++) {\n const point = points[i];\n const { angle, radius, radius0, angle0 } = point.update;\n point.update = coordValueGetter(radius, angle, xOffset, yOffset);\n if (rangePlot) {\n const update = point.update = coordValueGetter(radius0, angle0, xOffset, yOffset);\n const { x: x0, y: y0 } = coordValueGetter(radius, angle, xOffset, yOffset);\n update.x0 = x0;\n update.y0 = y0;\n }\n }\n return points;\n};\n\nexport const sortData = (data, axes) => {\n const { x: xAxis, y: yAxis } = axes;\n const axisArr = [xAxis, yAxis];\n for (let i = 0, len = axisArr.length; i < len; i++) {\n const axis = axisArr[i];\n if (axis.constructor.type() === BAND) {\n const key = i ? 'y' : 'x';\n const dom = axis.domain();\n const indices = dom.reduce((acc, v, idx) => {\n acc[v] = idx;\n return acc;\n }, {});\n data.sort((a, b) => indices[a[key]] - indices[b[key]]);\n break;\n }\n }\n return data;\n};\n\nexport const getBoundBoxes = points => points.map((point) => {\n const { x, y } = point.update;\n const data = point.data;\n return {\n minX: x,\n maxX: x,\n minY: y,\n maxY: y,\n data\n };\n});\n\nexport const getDataFromEvent = (context, event) => {\n const dataPoint = selectElement(event.target).data()[0];\n if (isSimpleObject(dataPoint) && getObjProp(dataPoint, 'meta', 'layerId') === context.id()) {\n const values = dataPoint && dataPoint.source;\n let identifiers = null;\n if (values) {\n identifiers = context.getIdentifiersFromData(values, dataPoint.rowId);\n }\n return {\n dimensions: [dataPoint],\n id: identifiers,\n layerId: context.id()\n };\n }\n return null;\n};\n","import * as PROPS from '../enums/props';\n\nexport const localOptions = {\n [PROPS.DATA]: {\n value: null\n }\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\nimport * as PROPS from '../enums/props';\n\nexport const listenerMap = [\n {\n props: [`${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}.${PROPS.DATA}`],\n type: 'registerImmediateListener',\n listener: (context, [prevData, data]) => {\n context.dataDidSet([prevData, data]);\n },\n namespace: context => context.metaInf().namespace\n }\n];\n","import { partition } from 'muze-utils';\n\nconst getLastItemInMap = map => Array.from(map)[map.size - 1];\n\nconst getPreviousStyle = (meta, interactionType) => {\n const { originalStyle, currentState } = meta;\n let stylesForCurrentLevel = Object.assign({}, originalStyle);\n\n if (currentState.size > 0) {\n interactionType = getLastItemInMap(currentState)[0];\n stylesForCurrentLevel = currentState.get(interactionType) || {};\n // const elemFill = elem.style('fill');\n // const newStyle = Object.assign({}, stylesForCurrentLevel, { fill: elemFill });\n }\n return stylesForCurrentLevel;\n};\n\nconst strokeProps = {\n 'stroke-width': 1,\n stroke: 1,\n 'stroke-opacity': 1\n};\n\nconst parseStyle = (value, { datum, datumStyle }, apply) => {\n if (typeof value === 'function') {\n if (isNaN(datumStyle)) {\n // const colorType = detectColor(datumStyle);\n const rgbaValues = datumStyle.replace(/[^\\d,.]/g, '').split(',').map(s => Number(s));\n value = value(rgbaValues, datum, apply);\n } else {\n const numValue = parseFloat(datumStyle, 10);\n value = value(numValue, datum, apply);\n }\n return value;\n }\n return value;\n};\n\nexport const applyStylesOnInteraction = (context, elem, interactionType, conf, options) => {\n const { mountPoint, apply, reset } = options;\n\n const d = elem.data()[0];\n let datum;\n\n if (Array.isArray(d)) {\n datum = d[0];\n } else {\n datum = Array.isArray(d.data) ? d.data[0] : d;\n }\n const { currentState, originalStyle } = datum.meta;\n\n let applicableStyles = {};\n\n const { style: styles, strokePosition } = conf;\n let applicableStrokePos = strokePosition;\n\n if (reset) {\n currentState.clear();\n }\n\n let applyStyle = true;\n\n if (apply) {\n const sanitizedStyles = {\n styles: {},\n strokePosition\n };\n for (const type in styles) {\n const parsedStyleVal = parseStyle(styles[type], {\n datum,\n datumStyle: elem.style(type)\n }, apply);\n\n sanitizedStyles.styles[type] = parsedStyleVal;\n }\n currentState.set(interactionType, sanitizedStyles);\n applicableStyles = sanitizedStyles.styles;\n } else if (!currentState.has(interactionType) && !reset) {\n applyStyle = false;\n } else {\n currentState.delete(interactionType);\n const currentStyle = getPreviousStyle(datum.meta, interactionType);\n applicableStyles = Object.assign({}, originalStyle.styles, currentStyle.styles);\n applicableStrokePos = currentStyle.strokePosition || originalStyle.strokePosition;\n }\n\n const styleKeys = Object.keys(applicableStyles);\n const [strokeStyles, otherStyles] = partition(styleKeys, v => v in strokeProps);\n\n applyStyle && context.applyStyles({\n strokeStyles,\n otherStyles,\n styleObj: applicableStyles,\n elem,\n datum,\n applicableStrokePos,\n mountPoint\n });\n};\n","import {\n getUniqueId,\n mergeRecursive,\n FieldType,\n selectElement,\n ReservedFields,\n DataModel,\n clone,\n generateGetterSetters,\n STATE_NAMESPACES,\n transactor,\n defaultValue,\n getObjProp,\n InvalidAwareTypes\n} from 'muze-utils';\nimport * as PROPS from '../enums/props';\nimport { props } from './props';\nimport {\n transformData,\n getNormalizedData,\n applyInteractionStyle,\n getValidTransform,\n domainCalculator,\n renderLayer,\n encodingFieldInfRetriever\n} from '../helpers';\nimport { localOptions } from './local-options';\nimport { listenerMap } from './listener-map';\nimport { BASE_LAYER, AREA_LAYER } from '../enums/constants';\nimport { applyStylesOnInteraction } from './helper';\n\nconst layerNs = [STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\nexport const BaseLayerMixin = superclass => class extends superclass {\n /**\n * Creates a layer using a configuration and data.\n *\n * @public\n * @constructor\n * @param {DataModel} data Instance of DataModel to be used. This DataModel instance serves as the data for a\n * layer.\n * @param {Object} axes Axes instances to be used for rendering the layer. Axes are used for mapping data from\n * value to px.\n * @param {SimpleAxis} axes.x X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {SimpleAxis} axes.y X axis of the layer. Based on the type of variable it gets instance of BandAxis,\n * TimeAxis, ContinuousAxis\n * @param {ColorAxis} axes.color Axis for coloring a layer using color interpolators\n * @param {ShapeAxis} axes.shape Axis for providing a shape\n * @param {SizeAxis} axes.size Axis for determining size of a mark using size interpolator\n * @param {LayerConfig} config Configuration of the layer\n * @param {Object} dependencies Dependencies of the layer\n * @param {SmartLabel} dependencies.smartLabel Smartlabel singleton instance\n */\n constructor () {\n super();\n\n generateGetterSetters(this, this.constructor.getterSetters());\n this.axes({});\n this.alias(this.constructor.formalName() + getUniqueId());\n this._points = [];\n this._cachedData = [];\n this._id = getUniqueId();\n this._measurement = {};\n this._animationDonePromises = [];\n this._graphicElems = {};\n this._customConfig = null;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys(this.localOptions()).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getListeners () {\n return {\n store: [...listenerMap, {\n type: 'registerChangeListener',\n props: this.getRenderProps(),\n listener: (context) => {\n renderLayer(context);\n },\n subNamespace: (context) => {\n const { unitRowIndex, unitColIndex, namespace } = context.metaInf();\n return {\n [`${layerNs[1]}.${PROPS.DATA}`]: namespace,\n [`${groupNs}.domain.x`]: `${unitColIndex}0`,\n [`${groupNs}.domain.y`]: `${unitRowIndex}0`,\n [`${groupNs}.domain.radius`]: `${unitRowIndex}-${unitColIndex}`\n };\n }\n }],\n throwback: []\n };\n }\n\n static getQualifiedStateProps () {\n const layerState = this.getState();\n return layerState.map((state, i) => Object.keys(state).map(prop => `${layerNs[i]}.${prop}`));\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { namespace } = this.metaInf();\n store.addSubNamespace(namespace, BASE_LAYER, this);\n\n transactor(this, this.constructor.localOptions(), store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE}`\n });\n return this;\n }\n return this._store;\n }\n\n domain (...dom) {\n const prop = `${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`;\n const store = this.store();\n if (dom.length) {\n const { parentNamespace, namespace } = this.metaInf();\n const domain = defaultValue(store.get(prop, parentNamespace), {});\n domain[namespace] = dom[0];\n this.store().commit(prop, domain, parentNamespace);\n return this;\n }\n return this.store().get(prop, this.metaInf().namespace);\n }\n\n /**\n * Creates a layer instance\n * @return {BaseLayer} Instance of a layer\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Default configuration of the layer. This configuration gets merged to the user passed configuration using a\n * plolicy. Base layer only returns part of configuraion, any layer overridding base layer should return its own\n * configuration.\n *\n * @public\n * @static\n *\n * @return {Object} Default configuration\n */\n static defaultConfig () {\n return {\n transform: {\n type: 'identity'\n }\n };\n }\n\n static getterSetters () {\n return props;\n }\n\n static localOptions () {\n return localOptions;\n }\n /**\n * Policy defines how user config gets merged to default config. The default policy here does a deep copy\n * operation.\n * Any policy which does more than deep copying should define the policy as a static member.\n *\n * @static\n * @public\n *\n * @param {LayerConfig} conf Configuration with which the user config will be merged\n * @param {LayerConfig} userConf Configuration given by the user\n *\n * @return {LayerConfig} Merged layer configuration\n */\n static defaultPolicy (conf, userConf) {\n return mergeRecursive(conf, userConf);\n }\n\n /**\n * Provides a alias for a layer. Like it's possible to have same layer (like bar) multiple times, but among\n * multiple layers of same type if one layer has to be referred, alias is used. If no alias is given then\n * `formalName` is set as the alias name.\n *\n *\n * If used as setter\n * @param {string} alias Name of the alias\n * @return {BaseLayer} Instance of current base layer\n *\n * If used as getter\n * @return {string} Alias of the current layer\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n this._alias = params[0];\n return this;\n }\n return this._alias || this.constructor.formalName();\n }\n\n enableCaching () {\n this._cacheEnabled = true;\n return this;\n }\n\n clearCaching () {\n this._cacheEnabled = false;\n return this.data(this._cachedData[0]);\n }\n\n /**\n * Serialize the schema. Merge config is used for serialization.\n *\n * @public\n *\n * @return {LayerConfig} Serialized schema\n */\n serialize () {\n return this.config();\n }\n\n /**\n * Returns the unique identifier of this layer. Id is auto generated during the creation proceess of a schema.\n *\n * @public\n *\n * @return {string} id of the layer\n */\n id () {\n return this._id;\n }\n\n /**\n * Returns the transformed data based on given transform type.\n * It first gets the transform method from transform factory based on type of transform. It then calls the\n * transform method with the data and passes the configuration parameters of transform such as\n * groupBy, value field, etc.\n *\n * @param {DataModel} dataModel Instance of DataModel\n * @param {Object} config Configuration for transforming data\n * @return {Array.} Transformed data.\n */\n getTransformedData (dataModel, config, transformType, encodingFieldsInf) {\n return transformData(dataModel, config, transformType, encodingFieldsInf);\n }\n\n /**\n * Calculates the domain from the data.\n * It checks the type of field and calculates the domain based on that. For example, if it\n * is a quantitative or temporal field, then it calculates the min and max from the data or\n * if it is a categorical field then it gets all the values from the data of that field.\n * @param {Array} data DataArray\n * @param {Object} fieldsConfig Configuration of fields\n * @return {Array} Domain values array.\n */\n calculateDomainFromData (data) {\n let domains = {};\n const isEmpty = this.data().isEmpty();\n\n if (!isEmpty) {\n domains = domainCalculator[this.coord()](data, this);\n }\n return domains;\n }\n\n static shouldDrawAnchors () {\n return false;\n }\n\n /**\n * Returns the domain for the axis.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getDataDomain (encodingType) {\n const { parentNamespace, namespace } = this.metaInf();\n const domains = getObjProp(this.store()\n .get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.${PROPS.DOMAIN}`, parentNamespace), namespace);\n return encodingType !== undefined ? domains[encodingType] || [] : domains;\n }\n\n getUidsFromPayload ({ model, uids }, targetData) {\n const targetFields = targetData[0];\n const targetVals = targetData.slice(1, targetData.length);\n const payloadMap = targetVals.reduce((acc, v) => {\n acc[v] = v;\n return acc;\n }, {});\n const measures = Object.keys(this.data().getFieldspace().getMeasure());\n\n const filterFn = (fields, i) => {\n const row = `${targetFields.map((field) => {\n let val;\n if (field === ReservedFields.MEASURE_NAMES) {\n val = measures;\n } else if (field === ReservedFields.ROW_ID) {\n val = i;\n } else {\n const currentField = fields[field];\n const isFieldInvalid = currentField instanceof InvalidAwareTypes;\n\n val = isFieldInvalid ? currentField.value() : (currentField || {}).internalValue;\n }\n return val;\n })}`;\n return row in payloadMap;\n };\n\n const dm = model.select(filterFn, {});\n\n // Need to find a better way to do this instead of iterating the full data\n const currentSetIds = this.data().select(filterFn, {\n saveChild: false\n }).getUids();\n\n const uidMap = currentSetIds.reduce((acc, v) => {\n acc[v] = true;\n return acc;\n }, {});\n\n return {\n model: dm,\n uids: uids.filter(d => uidMap[d[0]]),\n length: currentSetIds.length\n };\n }\n\n /**\n * Normalizes the transformed data and returns it.\n *\n * @param {string} encodingType type of encoding x, y, etc.\n * @return {Object} Axis domains\n */\n getNormalizedData (transformedData) {\n return getNormalizedData(transformedData, this);\n }\n\n /**\n * Gets the nearest point closest to the given x and y coordinate. If no nearest point is found, then it returns\n * null.\n *\n * @public\n *\n * @param {number} x X Coordinate.\n * @param {number} y Y Coordinate.\n *\n * @return {Object} Information of the nearest point.\n * ```\n * {\n * // id property contains the field names and their corresponding values in a 2d array. This is the\n * data // associated with the nearest point.\n * id: // Example data: [['Origin'], ['USA']],\n * dimensions: // Physical dimensions of the point.\n * layerId: // Id of the layer instance.\n * }\n * ```\n */\n getNearestPoint () {\n return null;\n }\n\n applyInteractionStyle (interactionType, selectionSet, options) {\n const interactionConfig = this.config().interaction || {};\n const { apply, styles, reset } = options;\n\n let interactionStyles = interactionConfig[interactionType];\n interactionStyles = styles || interactionStyles;\n if (interactionStyles) {\n applyInteractionStyle(this, selectionSet, interactionStyles, {\n apply,\n interactionType,\n reset\n });\n }\n }\n\n resolveTransformType () {\n this._transformType = getValidTransform(this);\n }\n\n transformType () {\n return this._transformType;\n }\n\n /**\n * Renders the layer\n * @return {BaseLayer} Instance of the layer.\n */\n render () {\n return this;\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Disposes the entire layer.\n *\n * @return {BaseLayer} Instance of layer.\n */\n remove () {\n const { namespace, parentNamespace } = this.metaInf();\n const store = this.store();\n store.removeSubNamespace(namespace, BASE_LAYER);\n const layersDomain = store.get(`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`);\n const unitDom = layersDomain[parentNamespace];\n unitDom && (delete unitDom[namespace]);\n selectElement(this.mount()).remove();\n return this;\n }\n\n /**\n * Stores point in an object with key as the categorical value or temporal value\n *\n * @param {string} key categorical value or temporal value\n * @param {Object} data Information of the data point\n * @return {BarLayer} Instance of bar layer\n */\n cachePoint (key, data) {\n if (key === null) {\n return this;\n }\n const pointMap = this._pointMap;\n !pointMap[key] && (pointMap[key] = []);\n pointMap[key].push(data);\n return this;\n }\n\n getInteractionStyles () {\n return applyStylesOnInteraction;\n }\n\n addOverlayPath () {\n return null;\n }\n\n removeOverlayPath () {\n return null;\n }\n\n applyLayerStyle (elem, interactionType, style, options) {\n const interactionFn = this.getInteractionStyles();\n return interactionFn(this, elem, interactionType, style, options);\n }\n\n getIdentifiersFromData (data, rowId) {\n const schema = this.data().getSchema();\n const fieldsConfig = this.data().getFieldsConfig();\n const identifiers = [[], []];\n\n const allMeasures = schema.every(field => field.type === FieldType.MEASURE);\n schema.forEach((d, i) => {\n const name = d.name;\n const { type } = fieldsConfig[name].def;\n if (type === FieldType.DIMENSION) {\n identifiers[0].push(name);\n identifiers[1].push(data[i]);\n }\n });\n\n const measures = schema.filter(d => d.type === FieldType.MEASURE).map(d => d.name);\n if (measures.length) {\n identifiers[0].push(ReservedFields.MEASURE_NAMES);\n identifiers[1].push(measures.join());\n }\n\n if (allMeasures) {\n identifiers[0].push(...[ReservedFields.ROW_ID]);\n identifiers[1].push(...[rowId]);\n }\n\n return identifiers;\n }\n\n hasPlotSpan () {\n return false;\n }\n\n getPlotSpan () {\n return {\n x: 0,\n y: 0\n };\n }\n\n getPlotPadding () {\n return {\n x: 0,\n y: 0\n };\n }\n\n /**\n * Returns the information of the marks corresponding to the supplied identifiers.\n * Identifiers are a set of field names and their corresponding values in an array.\n * It can also be an instance of datamodel.\n *\n * For example,\n * ```\n * const identifiers = [\n * ['Origin', 'Cylinders'],\n * ['USA', '8']\n * ];\n * const points = barLayer.getPointsFromIdentifiers(identifiers);\n * ```\n * @public\n * @param {Array|DataModel} identifiers Identifiers of the marks.\n * @param {Object} config Optional configuration which describes how to get the information.\n * @param {boolean} config.getAllAttrs If true, then returns all the information of the points, else returns only\n * the positions of the points.\n * @param {boolean} config.getBBox If true, then returns the bounding box of all the marks.\n *\n * @return {Array} Array of points contains\n */\n getPointsFromIdentifiers (identifiers, config = {}) {\n const getAllAttrs = config.getAllAttrs;\n const getBBox = config.getBBox;\n if (!this.data()) {\n return [];\n }\n let fieldNames;\n let values;\n if (identifiers instanceof DataModel) {\n const dataObj = identifiers.getData();\n fieldNames = dataObj.schema.map(d => d.name);\n values = dataObj.data;\n } else {\n fieldNames = identifiers[0];\n values = identifiers.slice(1, identifiers.length);\n }\n\n const points = this._points;\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPoints = [].concat(...points).filter((point) => {\n const { source, rowId } = point;\n\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n return getAllAttrs ? filteredPoints : filteredPoints.map((d) => {\n const obj = clone(d);\n if (getBBox) {\n const update = obj.update || obj;\n if (obj.size !== undefined) {\n const sizeVal = Math.sqrt(obj.size / Math.PI) * 2;\n update.width = sizeVal;\n update.height = sizeVal;\n update.x -= sizeVal / 2;\n update.y -= sizeVal / 2;\n } else {\n if (update.width === undefined) {\n update.width = 2;\n }\n if (update.height === undefined) {\n update.height = 2;\n }\n }\n }\n\n return obj.update || obj;\n }).sort((a, b) => a.y - b.y);\n }\n\n getTransformedDataFromIdentifiers (identifiers, idx = 0) {\n const { data: identifierData, schema: identifierSchema } = identifiers.getData();\n const normalizedData = this._normalizedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const {\n yField,\n xField,\n yFieldType,\n xFieldType\n } = this.encodingFieldsInf();\n let measureIndex;\n let enc;\n if (xFieldType === FieldType.MEASURE) {\n measureIndex = fieldsConfig[xField].index;\n enc = 'x';\n } else if (yFieldType === FieldType.MEASURE) {\n const layerName = this.constructor.formalName();\n measureIndex = fieldsConfig[yField].index;\n enc = 'y';\n if (layerName === AREA_LAYER) {\n enc = (idx % 2 === 0) ? 'y' : 'y0';\n }\n }\n\n const transformedData = [];\n normalizedData.forEach((dataArr) => {\n dataArr.forEach((dataObj) => {\n const tupleArr = dataObj.source;\n const exist = identifierSchema.every((obj, i) =>\n identifierData.findIndex(d => tupleArr[fieldsConfig[obj.name].index] === d[i]) !== -1);\n if (exist) {\n const transformedVal = dataObj[enc] || 0;\n const row = dataObj.source;\n const tuple = {};\n for (const key in fieldsConfig) {\n const index = fieldsConfig[key].index;\n tuple[key] = row[index];\n if (index === measureIndex) {\n tuple[key] = transformedVal;\n }\n }\n transformedData.push(tuple);\n }\n });\n });\n\n return [transformedData, this.data().getSchema()];\n }\n\n /**\n * Returns the dom elements associated with the supplied set of row ids.\n * Each element in the layer is mapped with a row of the datamodel. When given an array of row ids,\n * it returns all the elements which is mapped with those row ids.\n *\n * @public\n * @param {Array} set Array of row ids\n *\n * @return {Selection} D3 Selection of dom elements.\n */\n getPlotElementsFromSet (set) {\n const graphicElems = this._graphicElems;\n const elems = [];\n for (let i = 0, len = set.length; i < len; i++) {\n const elem = graphicElems[set[i]];\n if (elem) {\n elems.push(elem);\n }\n }\n return elems;\n }\n\n /**\n * Notifies when all animations/transitions of the layer are completed.\n *\n * @public\n * @return {Promise} Returns a promise to notify the animation completion.\n */\n animationDone () {\n return Promise.all(this._animationDonePromises);\n }\n\n registerAnimationDoneHook () {\n let resolveFn;\n const promise = new Promise((resolve) => {\n resolveFn = resolve;\n });\n this._animationDonePromises.push(promise);\n\n return () => {\n resolveFn();\n };\n }\n\n /**\n * Called when the layer datamodel is set.\n *\n * @param {Array} arr Old and new datamodel instance.\n * @param {DataModel} arr[0] Previous datamodel instance.\n * @param {DataModel} arr[1] Current datamodel instance.\n *\n * @return {BaseLayer} Instance of layer.\n */\n dataDidSet ([, data]) {\n const config = this.config();\n\n if (data && config) {\n if (this._cacheEnabled) {\n this._cachedData.push(data);\n } else {\n this._cachedData = [data];\n }\n const encodingValue = config.encoding;\n if (encodingValue) {\n const fieldsConfig = data.getFieldsConfig();\n const encodingFieldsInf = this.retrieveEncodingFields(encodingValue, this.coord(), data);\n this.encodingFieldsInf(encodingFieldsInf);\n this.resolveTransformType();\n this._transformedData = this.getTransformedData(data, config,\n this.transformType(), encodingFieldsInf);\n this._normalizedData = this.getNormalizedData(this._transformedData, fieldsConfig);\n if (config.calculateDomain !== false) {\n const domain = this.calculateDomainFromData(this._normalizedData,\n this.encodingFieldsInf(), this.data().getFieldsConfig());\n this.domain(domain);\n }\n }\n }\n return this;\n }\n\n retrieveEncodingFields (encoding, coord, data) {\n const fieldsConfig = data.getFieldsConfig();\n\n return encodingFieldInfRetriever[coord](encoding, fieldsConfig);\n }\n\n static getRenderProps () {\n return [`${layerNs[1]}.${PROPS.DATA}`, ...['x', 'y', 'radius'].map(type =>\n `${groupNs}.domain.${type}`)];\n }\n\n applyStyles ({ strokeStyles, otherStyles, styleObj, elem, mountPoint, applicableStrokePos, datum }) {\n strokeStyles.forEach((type) => {\n this.addOverlayPath(\n elem.node(),\n datum,\n { type, value: styleObj[type] },\n applicableStrokePos,\n mountPoint\n );\n });\n\n this.applyElementStyles(elem, otherStyles, styleObj);\n }\n\n applyElementStyles (elem, styles, styleObj) {\n styles.forEach((type) => {\n elem.style(type, styleObj[type]);\n });\n }\n\n getBoundBoxes () {\n return null;\n }\n};\n","import {\n mix\n} from 'muze-utils';\nimport { SimpleLayer } from '../simple-layer';\nimport { BaseLayerMixin } from './base-mixin';\nimport { BASE_LAYER } from '../enums/constants';\n\n/**\n * An abstract class which gives definition of common layer functionality like\n * - transforming data for various modes. Supported modes: identity, group and stack.\n * - calculating data domain\n * - linking dependent layers\n * - merging policy of configuration\n * - interaction sideffect helpers\n * - retrieving dom elements from data using id\n * - retrieving the physical dimensions of marks\n * - disposing layer\n *\n * Every layer has to extend base layer and give concrete definition.\n * This layer does not have any default visual. A new layer has to define the logic of `render` for rendering the\n * visuals\n *\n * @public\n * @class\n * @module BaseLayer\n */\nexport default class BaseLayer extends mix(SimpleLayer).with(BaseLayerMixin) {\n /**\n * Determines a name for a layer. This name of the layer is used in the input data to refer to this layer.\n * ```\n * .layers([\n * mark: 'bar',\n * encoding: { ... }\n * ])\n * ```\n *\n * @static\n * @public\n *\n * @return {string} name of layer\n */\n static formalName () {\n return BASE_LAYER;\n }\n}\n","import {\n selectElement,\n makeElement,\n pathInterpolators,\n Symbols,\n setStyles\n} from 'muze-utils';\nimport { updateStyle } from '../../helpers';\n\nconst line = Symbols.line;\n\nconst filterFn = (d) => {\n const { update } = d;\n return update.y !== null && update.x !== null;\n};\n\nconst containsNull = (elem) => {\n const { x, y } = elem ? elem.update : {};\n if (x === null || y === null) {\n return true;\n }\n return false;\n};\n\nconst settIndexPrevOrNext = (arr, index, indexesObj) => {\n const prevContainsNull = containsNull(arr[index - 1], index - 1);\n const nextContainsNull = containsNull(arr[index + 1], index + 1);\n\n !prevContainsNull && indexesObj.prevOfNull.push(index - 1);\n !nextContainsNull && indexesObj.nextOfNull.push(index + 1);\n};\n\nconst getborderIndexes = (arr) => {\n const indexes = {\n prevOfNull: [],\n nextOfNull: []\n };\n arr.forEach((value, index) => {\n const { update } = value;\n if (update.y === null || update.x === null) {\n settIndexPrevOrNext(arr, index, indexes);\n }\n });\n return indexes;\n};\n\nconst makeStartEndPair = (arr, borderIndexes) => {\n const pairArray = [];\n const { prevOfNull, nextOfNull } = borderIndexes;\n const length = prevOfNull.length;\n if (!length) {\n return pairArray;\n }\n\n for (let i = 0; i < length; i++) {\n const pair = [];\n const prevValue = arr[prevOfNull[i]];\n const nextValue = arr[nextOfNull[i]];\n if (prevValue) {\n pair.push(prevValue);\n }\n if (nextValue) {\n pair.push(nextValue);\n }\n pairArray.push(pair);\n }\n return pairArray;\n};\n\nconst sanitizeNullConfig = (arr) => {\n const borderIndexes = getborderIndexes(arr);\n return makeStartEndPair(arr, borderIndexes);\n};\n\nconst getElementsForLine = (params) => {\n const { mount, data, className, layer, strokeStyle, linepath, transition, updateFns } = params;\n let element = makeElement(mount, 'path', data.length ? [data] : [], className, updateFns);\n element.attr('class', (d, i) => d[i].className);\n setStyles(element, strokeStyle);\n if (!transition.disabled) {\n element = element.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n element.attr('d', linepath(data))\n .style('fill-opacity', 0);\n return element;\n};\n\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nexport const drawLine = (context) => {\n const { layer, container, points, interpolate, connectNullData, className, style, transition } = context;\n const containerSelection = selectElement(container);\n const strokeStyle = layer.config().nullDataLineStyle;\n const nullDataLineClass = layer.config().nullDataLineClass;\n const mount = containerSelection.attr('class', className);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(d => d.update.x)\n .y(d => d.update.y)\n .defined(filterFn);\n\n const graphicElems = layer._graphicElems;\n const updateFns = {\n update: (group, d) => {\n d.forEach((dd) => {\n graphicElems[dd.rowId] = containerSelection;\n });\n }\n };\n\n updateStyle(mount, style);\n\n const elementWithNullData = getElementsForLine({\n mount,\n data: points,\n strokeStyle: undefined,\n layer,\n linepath,\n transition,\n updateFns\n });\n const sanitizedPoints = sanitizeNullConfig(points);\n\n sanitizedPoints.map((d) => {\n if (connectNullData && d.length > 1) {\n getElementsForLine({\n mount,\n data: d,\n strokeStyle,\n className: `.${className}-${nullDataLineClass}`,\n layer,\n linepath,\n transition,\n updateFns\n });\n }\n return null;\n });\n return elementWithNullData;\n};\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-line',\n className: '',\n interpolate: 'linear',\n transform: {\n type: 'group'\n },\n interaction: {\n fade: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n focus: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n brushStroke: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n crossline: true,\n nearestPointThreshold: 20,\n encoding: {\n color: {},\n x: {},\n y: {},\n strokeOpacity: {\n value: 1\n },\n fillOpacity: {\n value: 0\n },\n strokeWidth: {\n value: '2px'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false,\n nullDataLineStyle: {},\n nullDataLineClass: 'null'\n};\n","import {\n Voronoi,\n getQualifiedClassName,\n selectElement,\n makeElement,\n FieldType,\n InvalidAwareTypes,\n getObjProp\n} from 'muze-utils';\nimport { drawLine } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport {\n attachDataToVoronoi,\n animateGroup,\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues,\n sortData,\n getBoundBoxes\n} from '../../helpers';\nimport './styles.scss';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport const LineLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of LineLayer.\n *\n * @param {*} args\n * @memberof LineLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n }\n\n static formalName () {\n return 'line';\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Default configuration of line layer\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = super.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField && !transform.groupBy) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n /**\n * Returns the draw method for line\n * @return {Function} Draw method of line layer\n */\n getDrawFn () {\n return drawLine;\n }\n\n static shouldDrawAnchors () {\n return true;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @param {number} seriesIndex index of series\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const axes = this.axes();\n const encoding = this.config().encoding;\n const xAxis = axes.x;\n const yAxis = axes.y;\n const colorAxis = axes.color;\n const { xFieldType, yFieldType } = this.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n sortData(data, axes);\n points = data.map((d, i) => {\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y) + yAxis.getUnitWidth() / 2;\n const color = colorAxis.getColor(d.color);\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color\n },\n data: d\n }, i, data, this);\n\n const style = {\n stroke: resolvedEncodings.color,\n 'fill-opacity': encoding.fillOpacity.value,\n 'stroke-width': encoding.strokeWidth.value\n };\n\n const point = {\n enter: {},\n update: {\n x: d.x instanceof InvalidAwareTypes ? null : resolvedEncodings.x,\n y: d.y instanceof InvalidAwareTypes ? null : resolvedEncodings.y\n },\n style,\n rowId: d.rowId,\n source: d.source,\n data: d.dataObj,\n meta: getColorMetaInf(style)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n\n points = points.filter((point) => {\n const { update } = point;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n\n getTranslatedData (normalizedData, colorValFn, colorFieldIndex, axes) {\n return normalizedData.map((data, i) => {\n let color;\n const colorVal = data.find(d => d.source[colorFieldIndex] !== null &&\n d.source[colorFieldIndex] !== undefined);\n\n if (colorValFn) {\n color = colorValFn(data, i, normalizedData);\n } else {\n color = axes.color.getColor(colorVal && colorVal.source[colorFieldIndex]);\n }\n\n return {\n data: this.translatePoints(data),\n style: this.getPathStyle(color)\n };\n });\n }\n\n /**\n * Renders the line plot\n * @param {SVGElement} container svg element\n * @return {LineLayer} instance of line layer\n */\n render (container) {\n const config = this.config();\n const {\n encoding,\n interpolate,\n className,\n defClassName,\n transition\n } = config;\n const normalizedData = this._normalizedData;\n const transformedData = this._transformedData;\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const keys = transformedData.map(d => d.key);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n const colorField = encoding.color.field;\n const colorFieldIndex = fieldsConfig[colorField] && fieldsConfig[colorField].index;\n\n this._points = [];\n this._pointMap = {};\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n\n const colorValFn = encoding.color.value;\n const translatedPoints = this.getTranslatedData(normalizedData, colorValFn, colorFieldIndex, axes);\n\n makeElement(container, 'g', translatedPoints, null, {\n enter: (group) => {\n animateGroup(group, {\n transition,\n groupAnimateStyle: {\n enter: {\n 'stroke-opacity': 0,\n 'fill-opacity': this.getPathStyle()['fill-opacity']\n },\n update: {\n 'stroke-opacity': encoding.strokeOpacity.value\n }\n }\n });\n },\n update: (group, dataArr, i) => {\n const points = dataArr.data;\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n const style = dataArr.style;\n\n this._points.push(points);\n this.getDrawFn()({\n layer: this,\n container: group.node(),\n interpolate,\n points,\n className: seriesClassName,\n transition,\n style: style || {},\n connectNullData: config.connectNullData\n });\n }\n }, d => d.data[0].source[colorFieldIndex] || d.data[0].rowId);\n\n attachDataToVoronoi(this._voronoi, this._points);\n return this;\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n stroke: color,\n 'fill-opacity': '0'\n };\n }\n\n /**\n * Gets the nearest point closest to the given position\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point information\n */\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n const point = this._voronoi.find(x, y, searchRadius);\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n\n applyStyles ({ strokeStyles, otherStyles, styleObj, elem }) {\n [...otherStyles, ...strokeStyles].forEach((type) => {\n elem.style(type, styleObj[type]);\n });\n }\n\n getBoundBoxes () {\n return getBoundBoxes(this._points.flat());\n }\n};\n","import { CLASSPREFIX, STACK } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-area',\n className: '',\n interpolate: 'linear',\n transform: {\n type: STACK\n },\n interaction: {\n fade: {\n style: {\n 'fill-opacity': 0.7\n }\n },\n focus: {\n style: {\n 'fill-opacity': 0.7\n }\n },\n brushStroke: {\n style: {\n 'fill-opacity': 0.7\n }\n }\n },\n crossline: true,\n nearestPointThreshold: 10,\n encoding: {\n color: {},\n x: {},\n y: {},\n y0: {},\n strokeOpacity: {\n value: 1\n },\n fillOpacity: {\n value: 0.3\n }\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n connectNullData: false\n};\n","import {\n easeFns,\n selectElement,\n pathInterpolators,\n Symbols\n} from 'muze-utils';\n\nconst area = Symbols.area;\n/**\n * Draws a line from the points\n * Generates a svg path string\n * @param {Object} params Contains container, points and interpolate attribute.\n */\nconst /* istanbul ignore next */ drawArea = (params) => {\n const { layer, container, points, style, transition, className, interpolate, connectNullData } = params;\n\n const graphicElems = layer._graphicElems;\n const { effect: easeEffect, duration } = transition;\n const mount = selectElement(container);\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const selection = mount.selectAll('path').data(points.length ? [points] : []);\n const [enterAreaPath, updateAreaPath] = ['enter', 'update'].map(e => area().curve(curveInterpolatorFn)\n .x(d => d[e].x)\n .y1(d => d[e].y)\n .y0(d => d[e].y0)\n .defined(d => d[e].y !== undefined));\n\n mount.attr('class', className);\n\n let filteredPoints = points;\n if (connectNullData) {\n filteredPoints = filteredPoints.filter(d => d.update.y !== undefined);\n }\n const selectionEnter = selection\n .enter()\n .append('path')\n .attr('d', enterAreaPath(filteredPoints))\n .each((d) => {\n d.forEach((dd) => {\n if (dd.rowId) {\n graphicElems[dd.rowId] = mount.select('path');\n }\n });\n });\n\n selection.merge(selectionEnter).transition().ease(easeFns[easeEffect])\n .duration(duration)\n .on('end', layer.registerAnimationDoneHook())\n .attr('d', updateAreaPath(filteredPoints))\n .each(function () {\n const element = selectElement(this);\n Object.keys(style).forEach(key => element.style(key, style[key]));\n });\n};\n\nexport default drawArea;\n","import { FieldType, InvalidAwareTypes, getObjProp } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport drawArea from './renderer';\nimport './styles.scss';\nimport { STACK, ENCODING } from '../../enums/constants';\nimport {\n positionPoints,\n getIndividualClassName,\n getValidTransformForAggFn,\n getColorMetaInf,\n resolveEncodingValues,\n sortData\n} from '../../helpers';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport const AreaLayerMixin = superclass => class extends superclass {\n\n /** Default configuration of area layer\n *\n * @return {Object} Default configuration of layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n /**\n * Calculates the domain from data. It calls its parent class's method which is line layer\n * to get the domain and overwrites the domain according to its need.\n * @return {Array} Domain values\n */\n calculateDomainFromData (data, encodingFieldsInf, fieldsConfig) {\n const domains = super.calculateDomainFromData(data, fieldsConfig);\n [ENCODING.X, ENCODING.Y].forEach((type) => {\n const { [`${type}FieldType`]: fieldType } = encodingFieldsInf;\n if (fieldType === FieldType.MEASURE && getObjProp(domains[type], 'length')) {\n domains[type][0] = Math.min(domains[type][0], 0);\n domains[type][1] = Math.max(0, domains[type][1]);\n }\n });\n return domains;\n }\n\n /**\n * Returns the drawing method of this layer\n * @return {Function} Draw method\n */\n getDrawFn () {\n return drawArea;\n }\n\n getNearestPoint (x, y, config) {\n let searchRadius = config.searchRadius;\n const data = this.data();\n\n if (!data || (data && data.isEmpty())) {\n return null;\n }\n\n searchRadius = searchRadius !== undefined ? searchRadius : this.config().nearestPointThreshold;\n let point = this._voronoi.find(x, y, searchRadius);\n let index;\n let nearestPoint = null;\n\n if (!point && config.dimValue && this._pointMap) {\n const pointArr = this._pointMap[config.dimValue[1][0]] || [];\n\n for (let i = 0, len = pointArr.length; i < len; i++) {\n const { y: pointY, y0: pointY0 } = pointArr[i].update;\n if (pointY < y && y < pointY0) {\n index = i;\n nearestPoint = pointArr[i];\n break;\n }\n }\n\n // Index is a number(0 or more)\n if (index !== undefined) {\n point = {\n index,\n data: {\n x,\n y,\n data: nearestPoint\n }\n };\n }\n }\n\n const dimensions = getObjProp(point, 'data', 'data', 'update');\n\n if (point) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y0: dimensions.y0,\n y: dimensions.y,\n width: 2,\n height: 2\n }],\n layerId: this.id()\n };\n }\n return null;\n }\n\n /**\n * Generates the x and y positions for each point\n * @param {Array} data Data Array\n * @param {Object} encoding Visual Encodings of the layer\n * @param {Object} axes Contains the axis\n * @return {Array} Array of points\n */\n translatePoints (data) {\n let points = [];\n const transformType = this.transformType();\n const axes = this.axes();\n const colorAxis = axes.color;\n const config = this.config();\n const encoding = config.encoding;\n const fieldsConfig = this.data().getFieldsConfig();\n const { xField, yField, y0Field } = this.encodingFieldsInf();\n const { x: xAxis, y: yAxis } = axes;\n const classNameFn = config.individualClassName;\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const minYVal = yAxis.domain()[0];\n const basePos = minYVal < 0 ? yAxis.getScaleValue(0) : yAxis.getScaleValue(minYVal);\n sortData(data, axes);\n points = data.map((d, i) => {\n let color;\n const xPx = xAxis.getScaleValue(d.x) + xAxis.getUnitWidth() / 2;\n const yPx = yAxis.getScaleValue(d.y);\n const y0Px = (y0Field || transformType === STACK) ? yAxis.getScaleValue(d.y0) : basePos;\n color = colorAxis.getColor(d.color);\n const invalidY = d.y instanceof InvalidAwareTypes;\n const invalidY0 = d.y0 instanceof InvalidAwareTypes;\n const resolvedValues = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, this);\n color = resolvedValues.color;\n const style = {\n fill: color,\n 'fill-opacity': encoding.fillOpacity.value\n };\n\n const point = {\n enter: {\n x: xPx,\n y: invalidY ? null : basePos,\n y0: invalidY0 ? null : basePos\n },\n update: {\n x: xPx,\n y: invalidY ? null : resolvedValues.y,\n y0: invalidY0 ? null : resolvedValues.y0\n },\n source: d.source,\n rowId: d.rowId,\n data: d.dataObj,\n className: classNameFn ? classNameFn(d, i, data, this) : '',\n style,\n meta: getColorMetaInf(style)\n };\n point.className = getIndividualClassName(d, i, data, this);\n this.cachePoint(d[key], point);\n return point;\n });\n points = positionPoints(this, points);\n points = points.filter((point) => {\n const update = point.update;\n return !isNaN(update.x);\n });\n return points;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Get the css styles need to be applied on the line path\n * @param {string} color Color value\n * @return {Object} Path styles\n */\n getPathStyle (color) {\n return {\n fill: color,\n 'fill-opacity': 0.30\n };\n }\n};\n","import { mix } from 'muze-utils';\nimport { AREA_LAYER } from '../../enums/constants';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { LineLayerMixin } from '../line/line-mixin';\nimport { AreaLayerMixin } from './area-mixin';\n\n/**\n * Area layer renders a closed path. The mark type of this layer is ```area```. This layer can be used\n * to create stacked or multi-series areas and vertical range area plots by using the encoding properties.\n *\n * To create this layer using layer configuration from canvas,\n * ```\n * canvas.layers([{\n * mark: 'area',\n * transform: {\n * type: 'stack' // Produces a stacked area.\n * }\n * }]);\n * ```\n *\n * @public\n *\n * @class\n * @module AreaLayer\n * @extends LineLayer\n */\nexport default class AreaLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin, AreaLayerMixin) {\n static formalName () {\n return AREA_LAYER;\n }\n}\n\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-arc',\n padding: { top: 1, bottom: 1, left: 1, right: 1 },\n className: '',\n interaction: {\n highlight: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.1\n }, data, apply).color\n }\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n height: 100,\n width: 100,\n sort: '',\n colors: ['#F44336', 'blue', 'green', 'yellow', 'orange', 'purple'],\n transform: {\n type: 'identity'\n },\n encoding: {\n 'stroke-width': {\n value: '2px'\n },\n 'stroke-linejoin': {\n value: 'round'\n },\n angle: {\n value: '1'\n },\n radius: {\n value: '1'\n },\n opacity: {\n value: '1'\n },\n color: {\n value: '1'\n },\n shape: {\n value: '1'\n },\n size: {\n value: '1'\n }\n },\n transition: {\n effect: 'cubic',\n duration: 500\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-arc-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-arc-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-arc-selected`\n }\n }\n};\n\n","import {\n makeElement,\n selectElement,\n getQualifiedClassName,\n isSimpleObject,\n Symbols,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { getIndividualClassName, resolveEncodingValues, getColorMetaInf } from '../../helpers';\nimport { tweenPie, tweenExitPie, getPreviousPoint } from './arc-helper';\nimport './styles.scss';\n\nconst arc = Symbols.arc;\n\nexport const ArcLayerMixin = superclass => class extends superclass {\n constructor (data, axes, config, dependencies) {\n super(data, axes, config, dependencies);\n this._prevPieData = {};\n }\n\n /**\n * returns the default configuration of the layer\n *\n * @static\n * @return {Object} Default configuration for arc layer\n * @memberof ArcLayer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'arc';\n }\n\n elemType () {\n return 'path';\n }\n\n getNearestPoint (x, y, config = {}) {\n return this.getDataFromEvent(config.event);\n }\n\n getDataFromEvent (event) {\n const dataPoint = selectElement(event.target).data()[0];\n if (isSimpleObject(dataPoint)) {\n const { source, rowId } = dataPoint;\n return {\n id: this.getIdentifiersFromData(source, rowId),\n layerId: this.id()\n };\n }\n return null;\n }\n\n translatePoints (data) {\n const { angle, color: colorAxis, radius: radiusAxis } = this.axes();\n const pieIndex = {};\n const prevData = this._points[0] || [];\n const points = [];\n const angleV = {};\n\n this._prevPieData = {};\n prevData.forEach((e, index) => {\n this._prevPieData[e.rowId] = [e, index];\n pieIndex[e.index] = e;\n });\n data.forEach((d, i) => {\n const angles = angle.getScaleValue(d.angle);\n if (angles) {\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const uid = d.rowId;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n radius: radiusAxis.getOuterRadius(d.radius),\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color: colorAxis.getColor(d.color),\n angle0: startAngle,\n angle: endAngle,\n startAngle,\n endAngle,\n startAngle0: startAngle,\n endAngle0: endAngle\n },\n data: d\n }, i, data, this);\n const color = resolvedEncodings.color;\n points.push({\n source: d.source,\n index: i,\n enter: {},\n update: {\n angle0: resolvedEncodings.angle0,\n angle: resolvedEncodings.angle,\n radius0: resolvedEncodings.radius0,\n radius: resolvedEncodings.radius\n },\n color,\n meta: getColorMetaInf({\n fill: color\n }),\n rowId: uid,\n _previousInfo: this._prevPieData[uid] ? this._prevPieData[uid][0] :\n getPreviousPoint(pieIndex, i, this)\n });\n }\n });\n return points;\n }\n\n render (container) {\n const measurement = this.measurement();\n const {\n classPrefix,\n defClassName,\n cornerRadius,\n padAngle,\n padRadius,\n transition\n } = this.config();\n const qualClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n // This returns a function that generates the arc path based on the datum provided\n const path = this._arcFn = arc()\n .cornerRadius(cornerRadius)\n .startAngle(d => d.update.angle0 + Math.PI / 2)\n .endAngle(d => d.update.angle + Math.PI / 2)\n .padAngle(padAngle)\n .padRadius(padRadius)\n .outerRadius(d => d.update.radius)\n .innerRadius(d => d.update.radius0);\n\n this._points = this._normalizedData.map(arr => this.translatePoints(arr));\n const graphicElems = this._graphicElems = {};\n // Creating the group that holds all the arcs\n const g = makeElement(selectElement(container), 'g', this._points, `${qualClassName[0]}-group`)\n .classed(`${qualClassName[1]}-group`, true)\n .attr('transform', `translate(${measurement.width / 2},\n ${measurement.height / 2})`);\n const tween = (elem) => {\n makeElement(elem, 'path', d => [d], `${qualClassName[0]}-path`)\n .style('fill', d => d.color)\n .each(function (d) {\n graphicElems[d.rowId] = selectElement(this);\n })\n .transition()\n .duration(transition.duration)\n .on('end', this.registerAnimationDoneHook())\n .attrTween('d', (...params) => tweenPie(path, params))\n .attr('class', (d, i) => {\n const individualClass = getIndividualClassName(d, i, this._points, this);\n return `${qualClassName[0]}-path ${qualClassName[1]}-path-${d.index}\n ${individualClass}`;\n });\n };\n const consecutiveExits = [];\n let exitCounter = 0;\n const tweenExit = (elem, d) => {\n let exitArr = consecutiveExits[exitCounter];\n const oldExitCounter = exitCounter;\n if (!exitArr) {\n exitArr = [{ elem, datum: d }];\n } else if (exitArr[exitArr.length - 1].datum.index === d.index - 1) {\n exitArr.push({ elem, datum: d });\n } else {\n exitCounter++;\n }\n consecutiveExits[oldExitCounter] = exitArr;\n };\n // Creating groups for all the arcs present individually\n makeElement(g, 'g', d => d, `${qualClassName[0]}`,\n {\n update: tween,\n exit: tweenExit\n })\n .attr('class', (d, i) => `${qualClassName[0]} ${qualClassName[1]}-${i}`);\n tweenExitPie(consecutiveExits, transition, path);\n return this;\n }\n\n getPointsFromIdentifiers (identifiers) {\n if (!this.data()) {\n return [];\n }\n const fieldNames = identifiers[0];\n const values = identifiers.slice(1, identifiers.length);\n const pieSlices = selectElement(this.mount()).selectAll('path').data();\n const fieldsConfig = this.data().getFieldsConfig();\n\n const filteredPies = pieSlices.filter((tData) => {\n const { source, rowId } = tData;\n return fieldNames.every((field, idx) => {\n if (field in fieldsConfig && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n return values.findIndex(d => d[idx] === source[fieldsConfig[field].index]) !== -1;\n } else if (field === ReservedFields.ROW_ID) {\n return values.findIndex(d => d[idx] === rowId) !== -1;\n } return true;\n });\n });\n\n const pieSliceInf = filteredPies[0];\n if (pieSliceInf) {\n const measurement = this.measurement();\n const centroid = this._arcFn.centroid(pieSliceInf);\n return [{\n x: centroid[0] + measurement.width / 2,\n y: centroid[1] + measurement.height / 2,\n width: 2,\n height: 2\n }];\n }\n return [];\n }\n};\n\n","import { getObjProp, interpolator, FieldType, selectElement } from 'muze-utils';\nimport { ANGLE, RADIUS, SIZE, COLOR } from '../../enums/constants';\n\nexport const getPreviousPoint = (prevData, currIndex, context) => {\n const prevArc = prevData[currIndex - 1];\n const nextArc = prevData[currIndex];\n const [startAngle, endAngle] = context.axes().angle.range();\n if (prevArc && nextArc) {\n return {\n update: {\n angle0: getObjProp(prevArc, 'update', 'angle'),\n angle: getObjProp(nextArc, 'update', 'angle0')\n }\n };\n } else if (!nextArc) {\n return {\n update: {\n angle0: (endAngle - 90) * Math.PI * 2 / 360,\n angle: (endAngle - 90) * Math.PI * 2 / 360\n }\n };\n }\n return {\n update: {\n angle0: (startAngle - 90) * Math.PI * 2 / 360,\n angle: (startAngle - 90) * Math.PI * 2 / 360\n }\n };\n};\n\nexport const tweenPie = (path, b) => {\n const datum = b[0];\n return function (t) {\n return path(interpolator()(datum._previousInfo, datum)(t));\n };\n};\n\nexport const tweenExitPie = (consecutiveExits, transition, path) => {\n if (consecutiveExits.length > 0) {\n consecutiveExits.forEach((consecutiveExitArr) => {\n const startAngle = consecutiveExitArr[0].datum.update.angle0;\n const endAngle = consecutiveExitArr[consecutiveExitArr.length - 1].datum.update.angle;\n const mid = (Math.PI * 2 * startAngle) / ((Math.PI * 2) + startAngle - endAngle);\n\n consecutiveExitArr.forEach((e) => {\n const { elem, datum } = e;\n\n elem.each(function () {\n const gElem = selectElement(this);\n gElem.selectAll('path')\n .transition()\n .duration(transition.duration)\n .attrTween('d', () => function (t) {\n return path(interpolator()(datum, {\n update: {\n angle0: mid,\n angle: mid,\n radius: datum.radius,\n radius0: datum.radius0\n }\n })(t));\n })\n .remove();\n gElem.remove();\n });\n });\n });\n }\n};\n\nexport const getFieldIndices = (encoding, fieldsConfig) => {\n const [angleField, radiusField, colorField, sizeField] = [ANGLE, RADIUS, COLOR, SIZE]\n .map(e => encoding[e].field);\n const [angleIndex, sizeIndex, radiusIndex] = [angleField, sizeField, radiusField]\n .map((e) => {\n const conf = fieldsConfig[e];\n if (conf && conf.def.type === FieldType.MEASURE) {\n return conf.index;\n }\n return null;\n });\n const colorIndex = getObjProp(fieldsConfig, colorField, 'index');\n return {\n angleIndex,\n sizeIndex,\n radiusIndex,\n colorIndex\n };\n};\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayerMixin, BaseLayer } from '../../base-layer';\nimport { ArcLayerMixin } from './arc-mixin';\n\n/**\n * Arc Layer creates a plot with polar coordinates.\n *\n * @public\n *\n * @class\n * @module ArcLayer\n * @extends BaseLayer\n */\nexport default class ArcLayer extends mix(BaseLayer).with(BaseLayerMixin, ArcLayerMixin) {\n static formalName () {\n return 'arc';\n }\n}\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { LineLayerMixin } from './line-mixin';\nimport { LINE_LAYER } from '../../enums/constants';\n\n/**\n * This layer is used to render straight or smoothed line paths. The mark type of this layer is ```line```.\n *\n * @public\n *\n * @class\n * @module LineLayer\n * @extends BaseLayer\n */\nexport default class LineLayer extends mix(BaseLayer).with(BaseLayerMixin, LineLayerMixin) {\n static formalName () {\n return LINE_LAYER;\n }\n}\n","import {\n setAttrs,\n setStyles,\n selectElement,\n makeElement,\n getSmartComputedStyle\n} from 'muze-utils';\n\n/**\n * Draws svg text in the specified container.\n * @param {SVGElement} container Container where labels will be appended.\n * @param {Array.} data Data of the elements.\n * @return {Selection} d3 selection of the elements.\n */\nconst drawText = (container, data, config, layerInst) => {\n const selection = selectElement(container).selectAll('g').data(data);\n const { smartLabel } = layerInst._dependencies;\n const graphicElems = layerInst._graphicElems;\n\n const selectionMerge = selection.enter().append('g')\n .each(function (dataObj) {\n setAttrs(this, dataObj.enter);\n })\n .merge(selection);\n const style = getSmartComputedStyle(selectElement(container), config.className);\n const fontSize = parseInt(style.fontSize, 10);\n\n smartLabel.setStyle(style);\n selectionMerge.each(function (dataObj) {\n const element = selectElement(this);\n graphicElems[dataObj.rowId] = element;\n const { update, text, color, textanchor, style: textStyle } = dataObj;\n const background = dataObj.background;\n let backgroundVal;\n if (backgroundVal = background.value) {\n const backgroundPadding = background.padding;\n let diff;\n const { width, height } = smartLabel.getOriSize(dataObj.text);\n const backgroundEl = makeElement(element, 'rect', [1]);\n\n if (textanchor === 'end') {\n diff = width;\n } else if (textanchor === 'start') {\n diff = 0;\n } else {\n diff = width / 2;\n }\n\n setAttrs(backgroundEl.node(), {\n x: update.x - diff - backgroundPadding / 2,\n y: update.y - fontSize - backgroundPadding / 2,\n width: width + backgroundPadding,\n height: height + backgroundPadding\n });\n background && setStyles(backgroundEl, {\n background: backgroundVal\n });\n }\n const textEl = makeElement(element, 'text', d => [d]).text(text);\n const textNode = textEl.node();\n textStyle && setStyles(textNode, textStyle);\n color && setStyles(textNode, {\n fill: color\n });\n dataObj.className && textEl.classed(dataObj.className, true);\n setAttrs(textNode, update);\n textEl.attr('text-anchor', textanchor);\n textEl.attr('alignment-baseline', dataObj['alignment-baseline']);\n textEl.attr('transform', `rotate(${dataObj.rotation} ${update.x} ${update.y})`);\n });\n selection.exit().remove();\n return selection;\n};\n\nexport default drawText;\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-text',\n classPrefix: CLASSPREFIX,\n className: '',\n transform: {\n type: 'identity'\n },\n interaction: {\n highlight: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: -15\n }, data, apply).color\n }\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n }\n },\n crossline: false,\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n color: {},\n size: {},\n radius: {},\n angle: {},\n text: {\n value: '',\n formatter: (val, i, data, context) => {\n const valueParser = context.valueParser();\n return valueParser(val);\n },\n background: {\n padding: 10\n }\n },\n rotation: {\n value: 0\n },\n 'alignment-baseline': {\n value: 'middle'\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-text-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-text-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-text-selected`\n }\n }\n};\n","import {\n getQualifiedClassName,\n selectElement,\n setStyles,\n createElements\n} from 'muze-utils';\nimport drawText from './renderer';\nimport { defaultConfig } from './default-config';\nimport {\n positionPoints,\n getIndividualClassName,\n resolveEncodingValues,\n getColorMetaInf,\n toCartesianCoordinates,\n getDataFromEvent\n} from '../../helpers';\nimport { TEXT_ANCHOR_MIDDLE, ENCODING } from '../../enums/constants';\n\nimport './styles.scss';\n\nconst defaultEncoding = defaultConfig.encoding;\nconst alignmentBaseLine = defaultEncoding['alignment-baseline'].value;\nconst defRotation = defaultEncoding.rotation.value;\n\nconst pointTranslators = {\n polar: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { radius: radiusAxis, color: colorAxis, angle: angleAxis } = axes;\n const { formatter: textFormatter } = textEncoding;\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const angleV = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const source = d.source;\n const text = d.text;\n\n const color = colorAxis.getColor(d.color);\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n\n const angle = (startAngle + endAngle) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n angle,\n radius,\n color,\n text,\n startAngle,\n endAngle,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n angle: resolvedVal.angle,\n radius: resolvedVal.radius\n },\n text: textFormatter ? textFormatter(text, i, data, layerInst) : resolvedVal.text,\n color: resolvedVal.color,\n rotation: resolvedVal.rotation,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedVal['alignment-baseline'],\n meta: { ...{ layerId: layerInst.id() },\n ...getColorMetaInf({\n fill: resolvedVal.color\n }) },\n style: {},\n source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = toCartesianCoordinates(positionPoints(layerInst, points), layerInst.measurement());\n\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n },\n cartesian: (data, config, layerInst) => {\n let points = [];\n const axes = layerInst.axes();\n const colorAxis = axes.color;\n const encoding = layerInst.config().encoding;\n const textEncoding = encoding.text;\n const { field: textField, value, formatter: textFormatter } = textEncoding;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n\n const backgroundEncoding = encoding.text.background;\n const backgroundPadding = backgroundEncoding.padding;\n const backgroundValue = backgroundEncoding.value;\n const textFieldIndex = textField ? fieldsConfig[textField] && fieldsConfig[textField].index : -1;\n const xEnc = ENCODING.X;\n const yEnc = ENCODING.Y;\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const row = d.source;\n const textValue = textField ? row[textFieldIndex] : value;\n\n const [xPx, yPx] = [xEnc, yEnc].map(type => (axes[type] ? axes[type].getScaleValue(d[type]) +\n axes[type].getUnitWidth() / 2 : 0));\n\n const color = colorAxis.getColor(d.color, colorAxis);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n text: textValue,\n color,\n rotation: defRotation,\n 'alignment-baseline': alignmentBaseLine\n },\n data: d\n }, i, data, layerInst);\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y\n },\n text: textFormatter(resolvedEncodings.text, i, data, layerInst),\n color: resolvedEncodings.color,\n background: {\n value: backgroundValue instanceof Function ? backgroundValue(d, i, data, layerInst) : null,\n padding: backgroundPadding\n },\n 'alignment-baseline': resolvedEncodings['alignment-baseline'],\n rotation: resolvedEncodings.rotation,\n meta: { ...{ layerId: layerInst.id() },\n ...getColorMetaInf({\n fill: resolvedEncodings.color\n }) },\n style: {},\n source: d.source,\n rowId: d.rowId\n };\n\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n\n points = positionPoints(layerInst, points);\n points = points.filter((d) => {\n const update = d.update;\n return !isNaN(update.x) && !isNaN(update.y);\n });\n return points;\n }\n};\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport const TextLayerMixin = superclass => class extends superclass {\n /**\n * Returns the default configuration of the text layer\n * @return {Object} Default configuration of the text layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'text';\n }\n\n elemType () {\n return 'text';\n }\n\n getPointTranslator (val) {\n return pointTranslators[val];\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {textLayer} Instance of text layer\n */\n render (container) {\n const config = this.config();\n const normalizedData = this._normalizedData;\n const className = config.className;\n const qualifiedClassName = getQualifiedClassName(config.defClassName, this.id(), config.classPrefix);\n const containerSelection = selectElement(container);\n\n containerSelection.classed(`${qualifiedClassName.join(' ')} ${className}`, true);\n this._graphicElems = {};\n\n createElements({\n data: normalizedData,\n append: 'g',\n selector: 'g',\n container,\n each: (dataArr, group) => {\n const node = group.node();\n const points = this.translatePoints(dataArr, {}, this);\n setStyles(node, {\n 'text-anchor': TEXT_ANCHOR_MIDDLE\n });\n drawText(node, points, {\n className: qualifiedClassName[0]\n }, this);\n }\n });\n return this;\n }\n\n getNearestPoint (x, y, { event }) {\n if (!this.data()) {\n return null;\n }\n return this.getDataFromEvent(event);\n }\n\n getDataFromEvent (event) {\n return getDataFromEvent(this, event);\n }\n};\n\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer, BaseLayerMixin } from '../../base-layer';\nimport { TextLayerMixin } from './text-mixin';\n\n/**\n * This layer is used to create labels for each data point. It has an encoding property ```text```\n * which determines from which field's data the value of the label will be taken. The text encoding\n * property is necessary for the layer to render the text.The mark type of this layer is ```text```.\n *\n * @public\n *\n * @class\n * @module TextLayer\n * @extends BaseLayer\n */\nexport default class TextLayer extends mix(BaseLayer).with(BaseLayerMixin, TextLayerMixin) {\n static formalName () {\n return 'text';\n }\n}\n","/* global Element, document */\nimport {\n makeElement,\n selectElement,\n easeFns,\n objectIterator,\n getSymbol,\n setStyles\n} from 'muze-utils';\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, groupElement) {\n const { shape, size, update, style } = d;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n createShape(d, groupElement);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n if (newShape.nodeName === 'path' || newShape.nodeName === 'image') {\n shapeElement.attr('transform', `scale(${size / 100})`);\n } else {\n shapeElement.attr('height', size);\n shapeElement.attr('width', size);\n }\n shapeElement.attr('x', -size / 2);\n shapeElement.attr('y', -size / 2);\n makeElement(groupElement, () => newShape, [1]);\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = getSymbol(shape).size(size)(update);\n }\n const pathEl = makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n setStyles(pathEl, style);\n } else {\n d.shape = 'circle';\n createShape(d, groupElement);\n }\n};\n\n/**\n * Draws symbols using d3 symbol api\n * @param {Object} params Contains the svg container, points and other symbol related attributes.\n */\n/* istanbul ignore next */ const drawSymbols = (params) => {\n const { layer, container, points, transition, className } = params;\n const { duration, effect, disabled } = transition;\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const { enter } = d;\n group.attr('transform', `translate(${enter.x},${enter.y})`);\n },\n update: (group, d) => {\n createShape(d, group);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n objectIterator(style, key => group.style(key, style[key]));\n group.attr('class', className);\n group.classed(d.className, true);\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n group.attr('transform', `translate(${update.x},${update.y})`);\n },\n exit: (exitGroup) => {\n if (!disabled) {\n exitGroup.transition().ease(easeFns[effect])\n .duration(duration)\n .on('end', () => exitGroup.remove())\n .style('fill-opacity', 0)\n .style('stroke-opacity', 0);\n } else {\n exitGroup.remove();\n }\n }\n }, params.keyFn);\n};\n\nexport default drawSymbols;\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-point',\n className: '',\n classPrefix: CLASSPREFIX,\n defColorStyle: 'stroke',\n interaction: {\n highlight: {\n className: 'highlight-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n // fill: 'red'\n },\n strokePosition: 'center'\n },\n focusStroke: {\n className: 'focus-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n commonDoubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n brushStroke: {\n className: 'brush-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n // fill: 'blue'\n },\n strokePosition: 'outside'\n },\n doubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n innerPadding: 0.1,\n nearestPointThreshold: 5,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n encoding: {\n size: {\n value: 30\n },\n color: {},\n stroke: {\n value: '#000'\n },\n 'stroke-width': {\n value: 0\n },\n fill: {},\n shape: {\n value: 'circle'\n },\n x: {},\n y: {},\n 'stroke-opacity': {\n value: 1\n },\n 'fill-opacity': {\n value: 0.5\n },\n strokePosition: {\n value: 'center'\n },\n interaction: {\n anchors: 'highlight',\n 'persistent-anchors': 'focusStroke',\n 'brush-anchors': 'brushStroke'\n }\n },\n shapes: ['circle', 'cross', 'diamond', 'square', 'star', 'wye', 'triangle'],\n sizes: [20, 30, 40, 50, 60, 70]\n};\n","import { FieldType, COORD_TYPES } from 'muze-utils';\nimport { ENCODING } from '../../enums/constants';\nimport {\n getIndividualClassName,\n resolveEncodingValues,\n getColorMetaInf,\n positionPoints\n} from '../../helpers';\n\nexport const prepareDrawingInf = ({ data, datum, i, layerInst, xPx, yPx }) => {\n const axes = layerInst.axes();\n const { shape: shapeAxis, color: colorAxis, size: sizeAxis } = axes;\n let shape = shapeAxis.getShape(datum.shape);\n let size = sizeAxis.getSize(datum.size);\n let color = colorAxis.getColor(datum.color);\n const layerEncoding = layerInst.config().encoding;\n const stroke = layerEncoding.stroke.value;\n const strokeWidth = layerEncoding['stroke-width'].value;\n\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n color,\n stroke,\n 'stroke-width': strokeWidth,\n size,\n shape,\n data: datum\n },\n data: datum\n }, i, data, layerInst);\n const { rowId, source } = datum;\n ({ shape, size, color } = resolvedEncodings);\n const style = {\n fill: color,\n stroke: resolvedEncodings.stroke,\n 'stroke-width': resolvedEncodings['stroke-width']\n };\n const { x, y } = resolvedEncodings;\n const pos = { x, y };\n return {\n enter: pos,\n update: pos,\n shape,\n source,\n rowId,\n style,\n data: datum.dataObj,\n meta: Object.assign({\n layerId: layerInst.id()\n }, getColorMetaInf(style, {\n strokePosition: layerEncoding.strokePosition.value\n })),\n size\n };\n};\n\nexport const pointTranslators = {\n [COORD_TYPES.CARTESIAN]: (data, config, layerInst) => {\n let points = [];\n const encoding = layerInst.config().encoding;\n const axes = layerInst.axes();\n const { x, y } = encoding;\n const xField = x.field;\n const yField = y.field;\n const fieldsConfig = layerInst.data().getFieldsConfig();\n const isXDim = fieldsConfig[xField] && fieldsConfig[xField].def.type === FieldType.DIMENSION;\n const isYDim = fieldsConfig[yField] && fieldsConfig[yField].def.type === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const { x: offsetX, y: offsetY } = config.offset;\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n\n let [xPx, yPx] = [ENCODING.X, ENCODING.Y].map((type) => {\n const value = d[type] === null ? undefined : d[type];\n const measure = type === ENCODING.X ? measurement.width : measurement.height;\n return !encoding[type].field ? measure / 2 : axes[type].getScaleValue(value);\n });\n\n xPx += offsetX;\n yPx += offsetY;\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = prepareDrawingInf({\n data,\n datum: d,\n i,\n layerInst,\n xPx,\n yPx\n });\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\nexport const getStrokeWidthByPosition = (position, radius) => {\n const strokeWidthWithOffsetMap = {\n center: -radius,\n inside: -(radius * Math.PI),\n outside: +(radius * Math.PI)\n };\n return strokeWidthWithOffsetMap[position];\n};\n","import {\n Voronoi,\n Scales,\n makeElement,\n getQualifiedClassName,\n selectElement,\n appendElement,\n getSymbol,\n pointWithinCircle\n} from 'muze-utils';\nimport drawSymbols from './renderer';\nimport { defaultConfig } from './default-config';\nimport {\n attachDataToVoronoi,\n getPlotMeasurement,\n getMarkId,\n getBoundBoxes\n} from '../../helpers';\nimport './styles.scss';\nimport { pointTranslators, getStrokeWidthByPosition } from './helper';\n\nexport const PointLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of PointLayer.\n * @param {*} args\n * @memberof PointLayer\n */\n constructor (...args) {\n super(...args);\n this._voronoi = new Voronoi();\n this._bandScale = Scales.band();\n this._overlayPath = {};\n this.formattedUids = [];\n }\n\n elemType () {\n return 'g';\n }\n\n /**\n * Returns the default configuration of the point layer\n * @return {Object} Default configuration of the point layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = super.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const transform = config.transform;\n const colorField = encoding.color && encoding.color.field;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n static drawFn () {\n return drawSymbols;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config = {}) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n /**\n * Renders the plot in the given container.\n *\n * @param {SVGElement} container SVGElement which will hold the plot\n * @return {BarLayer} Instance of bar layer\n */\n render (container) {\n let maxSize = 0;\n let seriesClassName;\n const config = this.config();\n const keys = this._transformedData.map(d => d.key);\n const { transition, className, defClassName, classPrefix } = config;\n const normalizedData = this._normalizedData;\n const containerSelection = selectElement(container);\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), classPrefix);\n this._points = [];\n this._pointMap = {};\n\n containerSelection.classed(qualifiedClassName.join(' '), true).classed(className, true);\n\n this._points = this.generateDataPoints(normalizedData, keys);\n this._graphicElems = {};\n\n const schema = this.data().getSchema();\n makeElement(container, 'g', this._points, null, {\n update: (group, points) => {\n maxSize = Math.max(maxSize, ...points.map(d => d.size || 0));\n seriesClassName = `${qualifiedClassName[0]}`;\n this.constructor.drawFn()({\n layer: this,\n container: group.node(),\n points,\n interpolate: config.interpolate,\n className: seriesClassName,\n transition,\n keyFn: v => getMarkId(v.source, schema)\n });\n }\n }, data => data[0].rowId);\n this._maxSize = Math.sqrt(maxSize / Math.PI) * 2;\n this.attachDataToVoronoi(this._points);\n return this;\n }\n\n attachDataToVoronoi (points) {\n attachDataToVoronoi(this._voronoi, points);\n }\n\n generateDataPoints (normalizedData, keys) {\n const [widthMetrics, heightMetrics] = getPlotMeasurement(this, keys);\n const offsetXValues = widthMetrics.offsetValues || [];\n const offsetYValues = heightMetrics.offsetValues || [];\n return normalizedData.map((dataArr, i) => {\n const measurementConf = this.getMeasurementConfig(offsetXValues[i], offsetYValues[i], widthMetrics.span,\n heightMetrics.span);\n return this.translatePoints(dataArr, measurementConf);\n }).filter(d => d.length);\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0) + widthSpan / 2,\n y: (offsetY || 0) + heightSpan / 2\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n /**\n * Gets the nearest point from a position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Point details\n */\n getNearestPoint (x, y) {\n const nearestPointThreshold = this.config().nearestPointThreshold;\n const distanceLimit = Math.max(this._maxSize, nearestPointThreshold);\n\n if (!this.data()) {\n return null;\n }\n\n const point = this._voronoi.find(x, y, distanceLimit);\n const dimensions = point && point.data.data.update;\n const radius = point ? Math.sqrt(point.data.data.size / Math.PI) : 0;\n\n if (point) {\n const insideShape = pointWithinCircle({\n x: dimensions.x,\n y: dimensions.y,\n r: radius + nearestPointThreshold\n }, { x, y });\n if (insideShape) {\n const { source, rowId } = point.data.data;\n const identifiers = this.getIdentifiersFromData(source, rowId);\n return {\n id: identifiers,\n dimensions: [{\n x: dimensions.x,\n y: dimensions.y,\n width: radius,\n height: radius\n }],\n layerId: this.id()\n };\n }\n }\n return null;\n }\n\n addOverlayPath (refElement, data, style, strokePosition) {\n const container = refElement.parentElement;\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n pathElement = makeElement(container, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n if (style.type === 'stroke-width') {\n const position = strokePosition;\n // get radius as per stroke position\n let radius = Math.sqrt(data.size / Math.PI);\n radius = getStrokeWidthByPosition(position, radius);\n\n const size = data.size + radius;\n if (typeof data.shape === 'string') {\n const path = getSymbol(data.shape).size(size);\n pathElement.attr('d', path);\n }\n }\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(refElement, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n }\n }\n\n getBoundBoxes () {\n return getBoundBoxes(this._points.flat());\n }\n\n applyElementStyles (elem, styles, styleObj) {\n styles.forEach((type) => {\n elem.select('path').style(type, styleObj[type]);\n });\n }\n};\n","import {\n mix\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { POINT_LAYER } from '../../enums/constants';\nimport { PointLayerMixin } from './point-mixin';\n\n/**\n * This layer is used to create various symbols for each data point. This is commonly used in\n * scatterplot visualizations. The mark type of this layer is ```point```.\n *\n * @public\n *\n * @class\n * @module PointLayer\n * @extends BaseLayer\n */\nexport default class PointLayer extends mix(BaseLayer).with(PointLayerMixin) {\n static formalName () {\n return POINT_LAYER;\n }\n}\n","import { makeElement, easeFns } from 'muze-utils';\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} datum\n * @param {*} index\n * @param {*} context\n */\nconst transitionBars = (layer, elem, datum, index, context) => {\n const { transition } = context;\n const { duration, disabled, effect } = transition;\n const selection = elem;\n\n const selTransition = disabled ? selection :\n selection.transition()\n .duration(duration)\n .ease(easeFns[effect])\n .on('end', layer.registerAnimationDoneHook());\n const update = datum.update || datum;\n const updateStyle = datum.style || {};\n datum.className && selection.classed(datum.className, true);\n Object.entries(update).forEach(attr => (!isNaN(attr[1]) && selTransition.attr(attr[0], attr[1])));\n Object.entries(updateStyle).forEach(styleObj => selection.style(styleObj[0], styleObj[1]));\n};\n\n/**\n *\n *\n * @param {*} elem\n * @param {*} d\n */\nconst barEnterFn = (elem, d) => {\n const selection = elem;\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && selection.attr(attr[0], attr[1])));\n};\n\n/**\n * Draws rectangles by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Bar Selection\n */\n/* istanbul ignore next */ export const drawRects = (params) => {\n const { layer, points, container, keyFn, className } = params;\n const graphicElems = layer._graphicElems;\n const updateFns = {\n enter (elem, d) {\n barEnterFn(elem, d);\n },\n update (elem, d, i) {\n graphicElems[d.rowId] = elem;\n transitionBars(layer, elem, d, i, params);\n }\n };\n\n return makeElement(container, 'g', points, null, {\n update: (group, d) => {\n makeElement(group.node(), 'rect', data => [data], null, updateFns, keyFn);\n group.attr('class', `${className}-${d.rowId}`);\n group.classed(d.className, true);\n }\n }, keyFn);\n};\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'layer-bar',\n className: '',\n interaction: {\n highlight: {\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'center'\n },\n focusStroke: {\n className: 'focus-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n brushStroke: {\n className: 'brush-stroke-class',\n style: {\n stroke: 'black',\n 'stroke-width': '1px'\n },\n strokePosition: 'outside'\n },\n doubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n commonDoubleStroke: {\n style: {\n stroke: 'black',\n 'stroke-width': '2px'\n },\n strokePosition: 'outside'\n },\n fade: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.3\n }, data, apply).color\n }\n },\n focus: {\n style: {\n fill: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n a: -0.5\n }, data, apply).color\n }\n }\n },\n transform: {\n type: 'stack'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n innerPadding: 0.1,\n encoding: {\n color: {},\n x: {},\n y: {},\n x0: {},\n y0: {},\n stroke: {\n value: '#000'\n },\n strokeWidth: {\n value: '0px'\n },\n strokePosition: {\n value: 'center'\n }\n }\n};\n","import { MeasureSubtype, DimensionSubtype } from 'muze-utils';\nimport { STACK } from '../../enums/constants';\nimport {\n positionPoints,\n getIndividualClassName,\n getColorMetaInf,\n resolveEncodingValues\n} from '../../helpers';\n\nconst positionRetriever = {\n x: (xPx, isNegativeVal, barBasePos) => (isNegativeVal ? [xPx, barBasePos] : [barBasePos, xPx]),\n y: (yPx, isNegativeVal, barBasePos) => (isNegativeVal ? [barBasePos, yPx] : [yPx, barBasePos])\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fieldInfo\n * @param {*} config\n * @param {*} data\n *\n */\nconst resolveDimByField = (type, axesInfo, config, data) => {\n const spaceType = type === 'x' ? 'width' : 'height';\n const [fieldType, axis] = [config[`${type}FieldType`], axesInfo[`${type}Axis`]];\n const {\n transformType,\n sizeEncoding,\n sizeConfig,\n measurement\n } = config;\n\n const sizeValue = sizeEncoding.value;\n let enter = 0;\n let pos;\n let space = 0;\n let enterSpace = 0;\n if (fieldType !== undefined) {\n if (config[`${type}0Field`]) {\n const minVal = data[type];\n const maxVal = data[`${type}0`];\n let min;\n let max;\n if (minVal === null || maxVal === null) {\n return {\n enterSpace: undefined,\n enter: undefined,\n pos: undefined,\n space: undefined\n };\n } else if (fieldType === MeasureSubtype.CONTINUOUS || fieldType === DimensionSubtype.TEMPORAL) {\n min = Math.min(minVal, maxVal);\n max = Math.max(minVal, maxVal);\n } else {\n min = minVal;\n max = maxVal;\n }\n const scales = type === 'x' ? [min, max] : [max, min];\n pos = axis.getScaleValue(scales[0]) + axis.getUnitWidth() / 2;\n space = Math.abs(axis.getScaleValue(scales[1]) - pos) + axis.getUnitWidth() / 2;\n\n enter = pos;\n enterSpace = 0;\n } else if (fieldType === DimensionSubtype.CATEGORICAL || fieldType === DimensionSubtype.TEMPORAL) {\n pos = axis.getScaleValue(data[type]) +\n (sizeConfig[type === 'x' ? 'barWidthOffset' : 'barHeightOffset'] || 0);\n\n space = sizeConfig[type === 'x' ? 'barWidth' : 'barHeight'];\n if (sizeValue !== undefined) {\n const diffPx = sizeValue * space;\n space -= diffPx;\n pos += diffPx / 2;\n }\n enter = pos;\n enterSpace = space;\n } else {\n const minDomVal = axis.domain()[0];\n const barBasePos = minDomVal < 0 ? axis.getScaleValue(0) : axis.getScaleValue(minDomVal);\n pos = axis.getScaleValue(data[type]);\n let endPos = axis.getScaleValue(data[`${type}0`]);\n\n enterSpace = 0;\n const isNegativeVal = data[type] < 0;\n if (transformType !== STACK) {\n [pos, endPos] = positionRetriever[type](pos, isNegativeVal, barBasePos);\n }\n space = Math.abs(pos - endPos);\n enter = barBasePos;\n }\n } else {\n pos = 0;\n space = measurement[spaceType];\n }\n\n return {\n enterSpace,\n enter,\n pos,\n space\n };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} config\n * @param {*} axes\n *\n */\nconst resolveDimensions = (data, config, axes) => {\n const axesInfo = {\n xAxis: axes.x,\n yAxis: axes.y\n };\n const {\n enterSpace: enterWidth,\n enter: enterX,\n pos: xPos,\n space: width\n } = resolveDimByField('x', axesInfo, config, data);\n\n const {\n enterSpace: enterHeight,\n enter: enterY,\n pos: yPos,\n space: height\n } = resolveDimByField('y', axesInfo, config, data);\n return {\n enter: {\n x: enterX,\n y: enterY,\n width: enterWidth,\n height: enterHeight\n },\n update: {\n x: xPos,\n y: yPos,\n width,\n height\n }\n };\n};\n\nexport const strokeWidthPositionMap = ({ width, position }) => {\n const offset = width / 2;\n const strokeWidthWithOffsetMap = {\n center: {\n M: { x: 0, y: 0 },\n L1: { x: 0, y: 0 },\n L2: { x: 0, y: 0 },\n L3: { x: 0, y: 0 }\n },\n inside: {\n M: { x: +offset, y: +offset },\n L1: { x: -offset, y: +offset },\n L2: { x: -offset, y: -offset },\n L3: { x: +offset, y: -offset }\n },\n outside: {\n M: { x: -offset, y: -offset },\n L1: { x: +offset, y: -offset },\n L2: { x: +offset, y: +offset },\n L3: { x: -offset, y: +offset }\n }\n };\n return strokeWidthWithOffsetMap[position];\n};\n\n/**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\nexport const getTranslatedPoints = (context, data, sizeConfig) => {\n let points = [];\n const encoding = context.config().encoding;\n const axes = context.axes();\n const colorAxis = axes.color;\n const sizeEncoding = encoding.size || {};\n const {\n x0Field,\n y0Field,\n xFieldSubType,\n yFieldSubType\n } = context.encodingFieldsInf();\n const measurement = context.measurement();\n const isXDim = xFieldSubType === DimensionSubtype.CATEGORICAL || xFieldSubType === DimensionSubtype.TEMPORAL;\n const isYDim = yFieldSubType === DimensionSubtype.CATEGORICAL || yFieldSubType === DimensionSubtype.TEMPORAL;\n const key = isXDim ? 'x' : (isYDim ? 'y' : null);\n const transformType = context.transformType();\n\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const dimensions = resolveDimensions(d, {\n xFieldType: xFieldSubType,\n yFieldType: yFieldSubType,\n x0Field,\n y0Field,\n transformType,\n measurement,\n sizeConfig,\n sizeEncoding\n }, axes);\n\n let color = colorAxis.getColor(d.color);\n\n const update = dimensions.update;\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: update.x,\n y: update.y,\n width: update.width,\n height: update.height,\n color\n },\n data: d\n }, i, data, context);\n // const layerEncoding = layerInst.config().encoding;\n\n color = resolvedEncodings.color;\n const { x, y, width, height } = resolvedEncodings;\n const style = {\n fill: color,\n stroke: encoding.stroke.value,\n 'stroke-width': encoding.strokeWidth.value\n };\n const conf = {\n strokePosition: encoding.strokePosition.value\n };\n\n if (!isNaN(x) && !isNaN(y) && d.rowId !== undefined) {\n let point = null;\n point = {\n enter: dimensions.enter,\n update: {\n x,\n y,\n width,\n height\n },\n source: d.source,\n rowId: d.rowId,\n data: d.dataObj,\n style,\n meta: Object.assign({\n layerId: context.id()\n }, getColorMetaInf(style, conf))\n };\n point.className = getIndividualClassName(d, i, data, context);\n points.push(point);\n // Store each point in a hashmap with key as the dimensional or temporal field value\n context.cachePoint(d[key], point);\n }\n }\n\n points = positionPoints(context, points);\n return points;\n};\n","import {\n getQualifiedClassName,\n selectElement,\n createElements,\n clipElement,\n FieldType,\n Scales,\n getObjProp,\n makeElement,\n appendElement\n} from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { drawRects } from './renderer';\nimport { defaultConfig } from './default-config';\nimport { getPlotMeasurement, getValidTransformForAggFn, getDataFromEvent } from '../../helpers';\nimport './styles.scss';\nimport { getTranslatedPoints, strokeWidthPositionMap } from './bar-helper';\n\nconst { MEASURE } = FieldType;\n\nexport const BarLayerMixin = superclass => class extends superclass {\n /**\n * Creates an instance of bar layer\n */\n constructor (...params) {\n super(...params);\n this._bandScale = Scales.band();\n this._plotPadding = {\n x: 0,\n y: 0\n };\n this._plotSpan = {\n x: 0,\n y: 0\n };\n this._pointMap = {};\n this._overlayPath = {};\n }\n\n elemType () {\n return 'rect';\n }\n\n /**\n * Returns the default configuration of the bar layer\n * @return {Object} Default configuration of the bar layer\n */\n static defaultConfig () {\n return defaultConfig;\n }\n\n static defaultPolicy (conf, userConf) {\n const config = BaseLayer.defaultPolicy(conf, userConf);\n const encoding = config.encoding;\n const colorField = encoding.color.field;\n const transform = config.transform;\n\n if (colorField) {\n transform.groupBy = colorField;\n }\n return config;\n }\n\n calculateDomainFromData (data, encodingFieldInf, fieldsConfig) {\n const domain = super.calculateDomainFromData(data, encodingFieldInf, fieldsConfig);\n ['x', 'y'].forEach((d) => {\n if (encodingFieldInf[`${d}FieldType`] === MEASURE && getObjProp(domain[d], 'length')) {\n if (encodingFieldInf[`${d}0Field`]) {\n domain[d] = domain[d].sort((a, b) => a - b);\n } else {\n domain[d][0] = Math.min(domain[d][0], 0);\n domain[d][1] = Math.max(0, domain[d][1]);\n }\n }\n });\n return domain;\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the bars from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @param {Object} conf config object for point generation\n * @return {Array.} Array of points\n */\n translatePoints (data, sizeConfig) {\n return getTranslatedPoints(this, data, sizeConfig);\n }\n\n /**\n * Renders the plot in the given container\n * @param {SVGGroup} container SVGGroup where plot will be rendered.\n * @return {BarLayer} Instance of bar layer.\n */\n render (container) {\n const config = this.config();\n const transition = config.transition;\n const normalizedDataArr = this._normalizedData;\n const transformedData = this._transformedData;\n const keys = transformedData.map(d => d.key);\n const fieldsConfig = this.data().getFieldsConfig();\n const axes = this.axes();\n const height = axes.y && axes.y.scale().range()[0];\n const width = axes.x && axes.x.scale().range()[1];\n const defClassName = config.defClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const className = config.className;\n const containerSelection = selectElement(container);\n const dimensions = Object.values(fieldsConfig).filter(e => e.def.type === FieldType.DIMENSION)\n .map(e => e.index);\n containerSelection.classed(qualifiedClassName.join(' '), true);\n containerSelection.classed(className, true);\n clipElement(container, {\n x: 0,\n y: 0,\n width,\n height\n }, `id-${this.id()}`);\n\n this._points = this.generateDataPoints(normalizedDataArr, keys);\n this._graphicElems = {};\n const paths = Object.keys(this._overlayPath);\n paths.forEach(path => this._overlayPath[path].remove());\n this._overlayPath = {};\n\n const barContainer = makeElement(containerSelection, 'g', [1], 'muze-layer-bars', {}, null);\n makeElement(containerSelection, 'g', [1], 'muze-overlay-paths', {}, null);\n createElements({\n data: this._points,\n container: barContainer.node(),\n selector: 'g',\n append: 'g',\n each: (points, group, i) => {\n const seriesClassName = `${qualifiedClassName[0]}-${keys[i] || i}`.toLowerCase();\n group.style('display', 'block');\n drawRects({\n layer: this,\n container: group.node(),\n points,\n className: seriesClassName,\n transition,\n style: {},\n keyFn: d => dimensions.map(key => d.source[key]).join('-')\n });\n }\n });\n\n return this;\n }\n\n generateDataPoints (normalizedData, keys) {\n const [barWidthMetrics, barHeightMetrics] = getPlotMeasurement(this, keys);\n const barWidthOffsets = barWidthMetrics.offsetValues || [];\n const barHeightOffsets = barHeightMetrics.offsetValues || [];\n this._plotSpan = {\n x: barWidthMetrics.groupSpan || 0,\n y: barHeightMetrics.groupSpan || 0\n };\n this._plotPadding = {\n x: barWidthMetrics.padding || 0,\n y: barHeightMetrics.padding || 0\n };\n\n this._pointMap = {};\n return normalizedData.map((data, i) => this.translatePoints(data,\n {\n barWidth: barWidthMetrics.span,\n barWidthOffset: barWidthOffsets[i] || 0,\n barHeight: barHeightMetrics.span,\n barHeightOffset: barHeightOffsets[i] || 0\n }));\n }\n\n getPlotPadding () {\n return this._plotPadding;\n }\n\n resolveTransformType () {\n this._transformType = getValidTransformForAggFn(this);\n }\n\n /**\n * Gets the nearest point of the position passed.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Object} Nearest point.\n */\n getNearestPoint (x, y, { event }) {\n if (!this.data()) {\n return null;\n }\n return this.getDataFromEvent(event);\n }\n\n getDataFromEvent (event) {\n return getDataFromEvent(this, event);\n }\n\n getPlotSpan () {\n return this._plotSpan;\n }\n\n hasPlotSpan () {\n return true;\n }\n\n addOverlayPath (refElement, data, style, strokePosition, mountPoint) {\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n const pathGroup = makeElement(mountPoint, 'g', [1], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement = makeElement(pathGroup, 'path', [data], null, {}, d => `${d.update.x} ${data.rowId}`);\n\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n if (style.type === 'stroke-width') {\n const { L1, L2, L3, M } = strokeWidthPositionMap({\n width: parseInt(style.value, 10),\n position: strokePosition\n });\n\n pathElement.attr('d', d => `M ${d.update.x + M.x} ${d.update.y + M.y}\n L ${d.update.x + d.update.width + L1.x} ${d.update.y + L1.y}\n L ${d.update.x + d.update.width + L2.x} ${d.update.y + d.update.height + L2.y}\n L${d.update.x + L3.x} ${d.update.y + d.update.height + L3.y} Z`);\n }\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(mountPoint, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n\n // Apply the path shape get the correct path position\n currentPath.attr('d', d => `M ${d.update.x} ${d.update.y}\n L ${d.update.x + d.update.width} ${d.update.y}\n L ${d.update.x + d.update.width} ${d.update.y + d.update.height}\n L${d.update.x} ${d.update.y + d.update.height} Z`);\n }\n }\n\n getBoundBoxes () {\n const points = this._points.flat();\n\n return points.map((point) => {\n const { x, y, width, height } = point.update;\n const data = point.data;\n return {\n minX: x,\n maxX: x + width,\n minY: y,\n maxY: y + height,\n data\n };\n });\n }\n};\n\n","import { mix } from 'muze-utils';\nimport { BaseLayer } from '../../base-layer';\nimport { BAR_LAYER } from '../../enums/constants';\nimport { BarLayerMixin } from './bar-mixin';\nimport { BaseLayerMixin } from '../../base-layer/base-mixin';\nimport './styles.scss';\n\n/**\n * Bar layer creates rectangle marks. The mark type of this layer is ```bar```. This layer can be used\n * to create stacked or grouped bars, range bars, heatmap plots and also reference bands by using\n * the encoding properties.\n *\n * @public\n *\n * @class\n * @module BarLayer\n * @extends BaseLayer\n */\nexport default class BarLayer extends mix(BaseLayer).with(BaseLayerMixin, BarLayerMixin) {\n static formalName () {\n return BAR_LAYER;\n }\n}\n","import { transformColor } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\n\nexport const defaultConfig = {\n defClassName: 'layer-tick',\n className: '',\n classPrefix: CLASSPREFIX,\n nearestPointThreshold: 10,\n interaction: {\n fade: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n },\n focus: {\n style: {\n stroke: (rgbaValues, data, apply) => transformColor(rgbaValues, {\n l: +15\n }, data, apply).color\n }\n }\n },\n innerPadding: 0.1,\n transform: {\n type: 'identity'\n },\n transition: {\n effect: 'cubic',\n duration: 1000\n },\n interpolate: 'linear',\n encoding: {\n color: { },\n x: {},\n y: {},\n x0: {},\n y0: {},\n radius: {},\n radius0: {},\n angle: {},\n angle0: {},\n strokeOpacity: {\n value: 0.5\n },\n fillOpacity: {\n value: 0.5\n }\n },\n states: {\n highlight: {\n className: `${CLASSPREFIX}-layer-tick-highlight`\n },\n fadeout: {\n className: `${CLASSPREFIX}-layer-tick-fadeout`\n },\n selected: {\n className: `${CLASSPREFIX}-layer-tick-selected`\n }\n }\n};\n\n","import {\n selectElement,\n Symbols,\n pathInterpolators,\n makeElement\n} from 'muze-utils';\n\nconst line = Symbols.line;\n\n/**\n * Draws ticks by using d3 selection\n * @param {Object} params Contains container element and points\n * @return {Selection} Ticks Selection\n */\nexport default /* istanbul ignore next */ (params) => {\n const { points, container, keyFn, className, interpolate, layer, transition } = params;\n const { disabled } = transition;\n\n const mount = selectElement(container);\n const graphicElems = layer._graphicElems;\n mount.attr('class', className);\n\n return makeElement(mount, 'g', points, null, {\n enter: (group, d) => {\n const enter = d.enter || {};\n Object.entries(enter).forEach(attr => (!isNaN(attr[1]) && group.attr(attr[0], attr[1])));\n },\n update: (group, d) => {\n const pathElem = makeElement(group, 'path', [1]);\n graphicElems[d.rowId] = group;\n const { update, style } = d;\n group.attr('class', className);\n group.classed(d.className, true);\n\n const x0 = update.x0 !== undefined ? update.x0 : update.x;\n const y0 = update.y0 !== undefined ? update.y0 : update.y;\n const curveInterpolatorFn = pathInterpolators[interpolate];\n const linepath = line()\n .curve(curveInterpolatorFn)\n .x(e => e[0])\n .y(e => e[1]);\n\n d.className && group.classed(d.className, true);\n pathElem.attr('d', linepath([[update.x, update.y], [x0, y0]]));\n if (!disabled) {\n group = group.transition()\n .duration(transition.duration)\n .on('end', layer.registerAnimationDoneHook());\n }\n Object.entries(style).forEach(styleObj => group.style(styleObj[0], styleObj[1]));\n },\n exit: (exitGroup) => {\n exitGroup.remove();\n }\n }, keyFn);\n};\n","import { FieldType, makeElement, appendElement } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { ENCODING } from '../../enums/constants';\nimport drawTicks from './renderer';\nimport './styles.scss';\nimport { positionPoints, getIndividualClassName,\n getColorMetaInf, resolveEncodingValues, toCartesianCoordinates, attachDataToVoronoi } from '../../helpers';\nimport { strokeWidthPositionMap } from './helper';\n\nconst pointTranslators = {\n polar: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { radius: radiusAxis, angle: angleAxis, angle0: angle0Axis } = axes;\n const measurement = layerInst.measurement();\n\n const colorAxis = axes.color;\n const angleV = {};\n const angle0V = {};\n for (let i = 0, len = data.length; i < len; i++) {\n const d = data[i];\n const color = colorAxis.getColor(d.color);\n const angles = angleAxis.getScaleValue(d.angle);\n !angleV[d.angle] && (angleV[d.angle] = 0);\n const { startAngle, endAngle } = angles[angleV[d.angle]++];\n const angles0 = angle0Axis.getScaleValue(d.angle0);\n !angle0V[d.angle0] && (angle0V[d.angle0] = 0);\n const { startAngle: startAngle0, endAngle: endAngle0 } = angles0[angle0V[d.angle0]++];\n const radius = radiusAxis.getOuterRadius(d.radius);\n const angle = (startAngle + endAngle) / 2;\n const angle0 = (startAngle0 + endAngle0) / 2;\n const resolvedVal = resolveEncodingValues({\n values: {\n radius,\n radius0: radiusAxis.getInnerRadius(d.radius0),\n color,\n angle,\n angle0,\n startAngle,\n endAngle,\n startAngle0,\n endAngle0\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedVal.color\n };\n\n const point = {\n enter: {},\n update: {\n radius: resolvedVal.radius,\n radius0: resolvedVal.radius0,\n angle: resolvedVal.angle,\n angle0: resolvedVal.angle0\n },\n style,\n source: d.source,\n rowId: d.rowId,\n data: d,\n meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) }\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n }\n points = toCartesianCoordinates(positionPoints(layerInst, points), measurement, true);\n return points;\n },\n cartesian: (data, config = {}, layerInst) => {\n const axes = layerInst.axes();\n let points = [];\n const { x: xAxis, y: yAxis } = axes;\n const {\n xField,\n yField,\n x0Field,\n y0Field,\n xFieldType,\n yFieldType\n } = layerInst.encodingFieldsInf();\n const isXDim = xFieldType === FieldType.DIMENSION;\n const isYDim = yFieldType === FieldType.DIMENSION;\n const key = isXDim ? ENCODING.X : (isYDim ? ENCODING.Y : null);\n const measurement = layerInst.measurement();\n const colorAxis = axes.color;\n const { x: offsetX, y: offsetY } = config.offset;\n const { x: xSpan, y: ySpan } = config.span;\n for (let i = 0, len = data.length; i < len; i++) {\n let xPx;\n let x0Px;\n let y0Px;\n let yPx;\n const d = data[i];\n const row = d.source;\n if (xField) {\n xPx = xAxis.getScaleValue(d.x) + offsetX;\n x0Px = xPx + xSpan;\n }\n\n if (yField) {\n yPx = yAxis.getScaleValue(d.y) + offsetY;\n y0Px = yPx !== null ? yPx + ySpan : null;\n }\n\n if (!xField) {\n xPx = 0;\n x0Px = measurement.width;\n if (!isNaN(yPx)) {\n yPx += ySpan / 2;\n y0Px = yPx;\n }\n }\n\n if (!yField) {\n yPx = 0;\n y0Px = measurement.height;\n x0Px = xPx += xSpan / 2;\n }\n\n if (x0Field) {\n x0Px = xAxis.getScaleValue(d.x0) + xSpan;\n yPx += ySpan / 2;\n y0Px -= ySpan / 2;\n }\n\n if (y0Field) {\n y0Px = yAxis.getScaleValue(d.y0) + ySpan;\n xPx += xSpan / 2;\n x0Px -= xSpan / 2;\n }\n const color = colorAxis.getColor(d.color);\n const resolvedEncodings = resolveEncodingValues({\n values: {\n x: xPx,\n y: yPx,\n x0: x0Px,\n y0: y0Px,\n color\n },\n data: d\n }, i, data, layerInst);\n const style = {\n stroke: resolvedEncodings.color\n };\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n const point = {\n enter: {},\n update: {\n x: resolvedEncodings.x,\n y: resolvedEncodings.y,\n x0: resolvedEncodings.x0,\n y0: resolvedEncodings.y0\n },\n style,\n source: row,\n rowId: d.rowId,\n data: d.dataObj,\n meta: { ...{ layerId: layerInst.id() }, ...getColorMetaInf(style) }\n };\n point.className = getIndividualClassName(d, i, data, layerInst);\n points.push(point);\n layerInst.cachePoint(d[key], point);\n }\n }\n points = positionPoints(layerInst, points);\n return points;\n }\n};\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport const TickLayerMixin = superclass => class extends superclass {\n static defaultConfig () {\n return defaultConfig;\n }\n\n static formalName () {\n return 'tick';\n }\n\n static drawFn () {\n return drawTicks;\n }\n\n elemType () {\n return 'path';\n }\n\n /**\n * Generates an array of objects containing x, y, width and height of the points from the data\n * @param {Array.} data Data Array\n * @param {Object} encoding Config\n * @param {Object} axes Axes object\n * @return {Array.} Array of points\n */\n translatePoints (data, config) {\n return pointTranslators[this.coord()](data, config, this);\n }\n\n attachDataToVoronoi (points) {\n attachDataToVoronoi(this._voronoi, points, (d) => {\n const { x, x0, y, y0 } = d.update;\n\n return {\n x: x + (x0 - x) / 2,\n y: y + (y0 - y) / 2\n };\n });\n }\n\n getMeasurementConfig (offsetX, offsetY, widthSpan, heightSpan) {\n return {\n offset: {\n x: (offsetX || 0),\n y: (offsetY || 0)\n },\n span: {\n x: widthSpan,\n y: heightSpan\n }\n };\n }\n\n addOverlayPath (refElement, data, style, strokePosition) {\n let pathElement;\n\n if (this._overlayPath[data.rowId]) {\n pathElement = this._overlayPath[data.rowId];\n } else {\n pathElement = makeElement(refElement, 'path', [data.update], null, {}, d => `${d.x} ${data.rowId}`);\n pathElement.style('fill', 'none');\n pathElement.style('fill-opacity', 0);\n pathElement.attr('id', data.rowId);\n this._overlayPath[data.rowId] = pathElement;\n }\n\n let offsetM = { x: 0, y: 0 };\n let offsetL = { x: 0, y: 0 };\n\n if (style.type === 'stroke-width') {\n const { L, M } = strokeWidthPositionMap({\n width: parseInt(style.value, 10),\n position: strokePosition\n });\n offsetM = M;\n offsetL = L;\n }\n\n pathElement.attr('d', (d) => {\n if (d.update) {\n return `M ${d.update.x + offsetM.x} ${d.update.y + offsetM.y}\n L ${d.update.x0 + offsetL.x} ${d.update.y0 + offsetL.y}`;\n }\n return `M ${d.x + offsetM.x} ${d.y + offsetM.y}\n L ${d.x0 + offsetL.x} ${d.y0 + offsetL.y}`;\n });\n\n let styleVal = style.value;\n if (typeof styleVal === 'function') {\n const currentStyle = pathElement.style(style.type);\n styleVal = styleVal(currentStyle);\n }\n pathElement.style(style.type, styleVal);\n appendElement(refElement, pathElement.node());\n }\n\n removeOverlayPath (data, style) {\n const currentPath = this._overlayPath[data.rowId];\n if (currentPath) {\n currentPath.node().removeAttribute('style');\n Object.keys(style).forEach(s => currentPath.style(s, style[s]));\n currentPath.style('fill-opacity', 0);\n }\n }\n};\n","export const strokeWidthPositionMap = ({ width, position = 'center' }) => {\n const offset = width ? width / 2 : 1;\n const strokeWidthWithOffsetMap = {\n center: {\n M: { x: 0, y: 0 },\n L: { x: 0, y: 0 }\n },\n inside: {\n M: { x: +offset, y: +offset },\n L: { x: -offset, y: +offset }\n },\n outside: {\n M: { x: -offset, y: -offset },\n L: { x: +offset, y: -offset }\n }\n };\n return strokeWidthWithOffsetMap[position];\n};\n","import { mix } from 'muze-utils';\nimport { PointLayerMixin } from '../point';\nimport { BaseLayerMixin, BaseLayer } from '../../base-layer';\nimport { TickLayerMixin } from './tick-mixin';\n\n/**\n * This layer is used to create small lines. The orientation of the line is determined by the positional\n * encoding properties x0 and y0. The mark type of the layer is ```tick```.\n *\n * @public\n *\n * @class\n * @module TickLayer\n * @extends BaseLayer\n */\nexport default class TickLayer extends mix(BaseLayer).with(BaseLayerMixin, PointLayerMixin, TickLayerMixin) {\n static formalName () {\n return 'tick';\n }\n}\n","export const AREA_LAYER = 'area';\nexport const ARC_LAYER = 'arc';\nexport const LINE_LAYER = 'line';\nexport const TEXT_LAYER = 'text';\nexport const POINT_LAYER = 'point';\nexport const BAR_LAYER = 'bar';\nexport const TICK_LAYER = 'tick';\nexport const SIMPLE_LAYER = 'simple';\nexport const BASE_LAYER = 'base';\n","import { isSimpleObject, mergeRecursive, getObjProp } from 'muze-utils';\n\nconst parseLayerDefinition = (sink, definition, layerDef, layerType) => {\n for (const key in definition) {\n if (Object.hasOwnProperty.call(definition, key)) {\n let strs;\n let propValue;\n const def = definition[key];\n if (isSimpleObject(def)) {\n sink[key] = {};\n parseLayerDefinition(sink[key], def, layerDef, layerType);\n } else if (typeof def === 'string' && (strs = def.split('.')) && strs[0] === layerType) {\n propValue = getObjProp(layerDef, ...strs.slice(1, strs.length));\n if (propValue !== undefined) {\n sink[key] = propValue;\n }\n } else {\n sink[key] = def;\n }\n }\n }\n};\n\nconst sanitizeEncoding = (encoding) => {\n // Create object for each encoding value if encoding value is a string\n for (const key in encoding) {\n if (typeof encoding[key] === 'string') {\n encoding[key] = {\n field: encoding[key]\n };\n }\n }\n};\n\n/**\n * Layer Factory creates layers based on the layer type. All types of layers needs to register in\n * the layer factory. For getting a layer instance, getLayer method needs to invoked with the\n * layerType and other arguments. It also registers the definition of composite layers.\n *\n * @public\n *\n * @module LayerFactory\n */\nconst layerFactory = (() => {\n const compositeLayers = {};\n const factoryObj = {\n setLayerRegistry: (reg) => {\n factoryObj._layerRegistry = reg;\n },\n getSerializedConf: (mark, layerDef) => {\n let serializedDefs;\n const defs = compositeLayers[mark];\n const newConf = mergeRecursive({}, layerDef);\n\n // If it is a composite layer then resolve all the definitions of each unit layer\n if (defs) {\n serializedDefs = defs.map((unitLayerDef) => {\n const sDef = {};\n parseLayerDefinition(sDef, unitLayerDef, newConf, mark);\n sanitizeEncoding(sDef.encoding);\n return sDef;\n });\n } else {\n const encoding = newConf.encoding;\n // Create object for each encoding value if encoding value is a string\n sanitizeEncoding(encoding);\n serializedDefs = newConf;\n }\n\n return serializedDefs;\n },\n getLayerInstance: (layerDef, ...params) => {\n const layerRegistry = factoryObj._layerRegistry;\n layerDef = !(layerDef instanceof Array) ? [layerDef] : layerDef;\n const instances = layerDef.map((layerObj) => {\n const layerConstructor = layerRegistry[layerObj.mark];\n return layerConstructor.create(...params);\n });\n return instances.length === 1 ? instances[0] : instances;\n },\n getLayerClass: mark => factoryObj._layerRegistry[mark],\n /**\n * Registers a new composite layer definition in the layer factory.\n *\n * @public\n *\n * @param {string} layerType Mark type of the new composite layer.\n * @param {Array} layerDefs Layer definitions of the composite layer.\n */\n composeLayers: (layerType, layerDefs) => {\n compositeLayers[layerType] = layerDefs;\n },\n sanitizeLayerConfig: (layerDef) => {\n const newConf = mergeRecursive({}, layerDef);\n sanitizeEncoding(newConf.encoding);\n return newConf;\n }\n };\n return factoryObj;\n})();\n\nexport default layerFactory;\n","import layerFactory from './layer-factory';\n\nexport default layerFactory;\n","import { AreaLayer } from './layers/area';\nimport { ArcLayer } from './layers/arc';\nimport { LineLayer } from './layers/line';\nimport { TextLayer } from './layers/text';\nimport { PointLayer } from './layers/point';\nimport { BarLayer } from './layers/bar';\nimport { BaseLayer } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport { TickLayer } from './layers/tick';\n\nexport const DEFAULT_LAYERS = {\n [LAYER_TYPES.AREA_LAYER]: AreaLayer,\n [LAYER_TYPES.ARC_LAYER]: ArcLayer,\n [LAYER_TYPES.LINE_LAYER]: LineLayer,\n [LAYER_TYPES.TEXT_LAYER]: TextLayer,\n [LAYER_TYPES.POINT_LAYER]: PointLayer,\n [LAYER_TYPES.TICK_LAYER]: TickLayer,\n [LAYER_TYPES.BAR_LAYER]: BarLayer,\n [LAYER_TYPES.BASE_LAYER]: BaseLayer\n};\n","import { DEFAULT_LAYERS } from './defaults';\n\nexport default (layers = DEFAULT_LAYERS) => {\n const reg = Object.assign({}, layers);\n const regObj = {\n register: (def) => {\n const key = def.formalName();\n\n reg[key] = def;\n return regObj;\n },\n get: () => reg\n };\n return regObj;\n};\n","import { AreaLayer, AreaLayerMixin } from './layers/area';\nimport { ArcLayer, ArcLayerMixin } from './layers/arc';\nimport { LineLayer, LineLayerMixin } from './layers/line';\nimport { TextLayer, TextLayerMixin } from './layers/text';\nimport { PointLayer, PointLayerMixin } from './layers/point';\nimport { BarLayer, BarLayerMixin } from './layers/bar';\nimport { TickLayer, TickLayerMixin } from './layers/tick';\nimport { SimpleLayer } from './simple-layer';\nimport { BaseLayer, BaseLayerMixin } from './base-layer';\nimport * as LAYER_TYPES from './enums/layer-types';\nimport layerFactory from './layer-factory';\nimport layerRegistry from './layer-registry';\nimport { ENCODING } from './enums/constants';\nimport * as pointLayerHelpers from './layers/point/helper';\nimport * as commonHelpers from './helpers';\nimport * as enums from './enums';\n\nconst helpers = Object.assign(commonHelpers, {\n pointLayerHelpers\n});\n\nconst layerMixins = {\n BarLayerMixin,\n BaseLayerMixin,\n LineLayerMixin,\n AreaLayerMixin,\n PointLayerMixin,\n TextLayerMixin,\n TickLayerMixin,\n ArcLayerMixin\n};\n\nexport {\n BaseLayer,\n BarLayer,\n LineLayer,\n AreaLayer,\n PointLayer,\n ArcLayer,\n TextLayer,\n TickLayer,\n layerFactory,\n SimpleLayer,\n layerRegistry,\n LAYER_TYPES,\n ENCODING,\n helpers,\n enums,\n layerMixins\n};\n","import {\n FieldType,\n getDependencyOrder,\n getObjProp,\n defaultValue,\n objectIterator,\n unionDomain,\n makeElement,\n DimensionSubtype,\n toArray,\n MeasureSubtype,\n getNearestValue,\n RTree\n} from 'muze-utils';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\n\nexport const getDimensionMeasureMap = (layers, fieldsConfig) => {\n const retinalEncodingsAndMeasures = {};\n\n layers.forEach((layer) => {\n const {\n colorField,\n sizeField,\n shapeField,\n xField,\n yField\n } = layer.encodingFieldsInf();\n const measures = [xField, yField].filter(field => fieldsConfig[field] && fieldsConfig[field].def.type ===\n FieldType.MEASURE);\n [colorField, sizeField, shapeField].forEach((field) => {\n if (getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION && measures.length) {\n !retinalEncodingsAndMeasures[field] && (retinalEncodingsAndMeasures[field] = []);\n retinalEncodingsAndMeasures[field].push(...measures);\n }\n });\n });\n\n for (const key in retinalEncodingsAndMeasures) {\n if ({}.hasOwnProperty.call(retinalEncodingsAndMeasures, key)) {\n retinalEncodingsAndMeasures[key] = [...new Set(retinalEncodingsAndMeasures[key])];\n }\n }\n return retinalEncodingsAndMeasures;\n};\n\nexport const transformDataModels = (transform, dataModel) => {\n const dataModels = {};\n for (const key in transform) {\n if ({}.hasOwnProperty.call(transform, key)) {\n const transformVal = transform[key];\n dataModels[key] = transformVal(dataModel);\n }\n }\n\n return dataModels;\n};\n\nexport const getLayerFromDef = (context, definition, existingLayer, namespaces) => {\n let instances = existingLayer;\n const dependencies = context._dependencies;\n const metaInf = context.metaInf();\n if (!existingLayer) {\n instances = layerFactory.getLayerInstance(definition);\n toArray(instances).forEach((inst, i) => {\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: namespaces[i],\n parentNamespace: metaInf.namespace\n })\n .dependencies(dependencies)\n .store(context.store());\n });\n }\n const layers = {};\n const instanceArr = toArray(instances);\n definition = toArray(definition);\n definition.reduce((acc, def, idx) => {\n const instance = instanceArr[idx];\n instance.coord(context.coord());\n instance.config(def);\n instance.valueParser(context.valueParser());\n instance.dataProps({\n timeDiffs: context._timeDiffs\n });\n if (def.name) {\n instance.alias(def.name);\n }\n layers[instance.alias()] = instance;\n return acc;\n }, {});\n return layers;\n};\n\nexport const resolveEncodingTransform = (layerInst, store) => {\n const encodingTransform = layerInst.config().encodingTransform || {};\n const resolvable = encodingTransform.resolvable;\n let depArr = [];\n if (resolvable) {\n const resolved = resolvable(store);\n depArr = resolved.depArr;\n layerInst.encodingTransform(resolved.fn);\n } else if (encodingTransform instanceof Function) {\n layerInst.encodingTransform(encodingTransform);\n }\n return depArr;\n};\n\nexport const sanitizeLayerDef = (layerDefs) => {\n const sanitizedDefs = [];\n layerDefs.forEach((layerDef, i) => {\n const def = layerDef.def;\n const mark = layerDef.mark;\n if (!def) {\n const sConf = layerFactory.getSerializedConf(layerDef.mark, layerDef);\n if (!sConf.name) {\n sConf.name = `${mark}-${i}`;\n }\n sanitizedDefs.push({\n mark: layerDef.mark,\n def: sConf\n });\n } else {\n if (!def.name) {\n def.name = `${mark}-${i}`;\n }\n sanitizedDefs.push(layerDef);\n }\n });\n return sanitizedDefs;\n};\n\nexport const attachDataToLayers = (layers, dm, transformedDataModels) => {\n layers.forEach((layer) => {\n const dataSource = layer.config().source;\n const dataModel = dataSource instanceof Function ? dataSource(dm) :\n (transformedDataModels[dataSource] || dm);\n layer.data(dataModel);\n });\n};\n\nexport const attachAxisToLayers = (axes, layers, layerAxisIndex) => {\n layers.forEach((layer) => {\n const layerId = layer.id();\n const axesObj = {};\n\n objectIterator(axes, (key) => {\n const axisInf = layerAxisIndex[layerId];\n if (axisInf) {\n const axisArr = axes[key] || [];\n const axisIndex = axisInf[key] >= 0 ? axisInf[key] : axisArr.length - 1;\n axes[key] && (axesObj[key] = defaultValue(axes[key][axisIndex]));\n }\n });\n Object.keys(axesObj).length && layer.axes(axesObj);\n });\n};\n\nconst { X, Y, RADIUS, ANGLE, ANGLE0, RADIUS0 } = ENCODING;\n\nexport const getLayerAxisIndex = (layers, fields) => {\n const layerAxisIndex = {};\n layers.forEach((layer) => {\n const { axis, encoding } = layer.config();\n const id = layer.id();\n [X, Y, ANGLE, ANGLE0, RADIUS].forEach((type) => {\n let index;\n const specificField = getObjProp(encoding, type, 'field');\n const encodingField = type === RADIUS ? defaultValue(specificField, getObjProp(encoding, RADIUS0, 'field'))\n : getObjProp(encoding, type, 'field');\n const field = defaultValue(getObjProp(axis, type), encodingField);\n if (fields[type] && fields[type].length) {\n index = fields[type].findIndex(fieldInst => fieldInst.getMembers().indexOf(field) !== -1);\n } else {\n index = 0;\n }\n !layerAxisIndex[id] && (layerAxisIndex[id] = {});\n layerAxisIndex[id][type] = index;\n });\n });\n return layerAxisIndex;\n};\n\nconst getValidDomain = (domain, domain1, encodingType, fieldType) => {\n if (encodingType === ANGLE || encodingType === ANGLE0) {\n return domain.concat(domain1.filter(d => domain.indexOf(d) === -1));\n }\n return unionDomain([domain, domain1], fieldType);\n};\n\nexport const unionDomainFromLayers = (layers, axisFields, layerAxisIndex, fieldsConfig) => {\n let domains = {};\n layers = layers.filter(layer => layer.getDataDomain() !== null);\n layers.forEach((layer) => {\n let domainValues = {};\n const config = layer.config();\n // const encoding = config.encoding;\n const layerDomain = layer.getDataDomain();\n const layerId = layer.id();\n\n if (layerDomain !== null && config.calculateDomain !== false) {\n domainValues = Object.entries(layerDomain);\n domains = domainValues.reduce((fieldDomain, domain) => {\n const encodingType = domain[0];\n const axisIndex = layerAxisIndex[layerId][encodingType];\n const field = getObjProp(axisFields, encodingType, axisIndex);\n !fieldDomain[encodingType] && (fieldDomain[encodingType] = {});\n const encodingDomain = fieldDomain[encodingType];\n if (field) {\n const fieldStr = `${field}`;\n encodingDomain[fieldStr] = encodingDomain[fieldStr] || [];\n encodingDomain[fieldStr] = getValidDomain(encodingDomain[fieldStr],\n domain[1], encodingType, fieldsConfig[field.getMembers()[0]].def.subtype);\n }\n return fieldDomain;\n }, domains);\n }\n });\n return domains;\n};\n\nexport const renderLayers = (context, container, layers, measurement) => {\n context._lifeCycleManager.notify({ client: layers, action: 'beforedraw', formalName: 'layer' });\n const config = context.config();\n const classPrefix = config.classPrefix;\n const orderedLayers = layers.sort((a, b) => a.config().order - b.config().order);\n const layerParentGroup = makeElement(container, 'g', [1], `${classPrefix}-layer-group`);\n const layerDepOrder = getDependencyOrder(context._layerDepOrder);\n const groups = {};\n makeElement(layerParentGroup, 'g', orderedLayers, null, {\n update: (group, layer) => {\n groups[layer.alias()] = {\n group,\n layer\n };\n }\n });\n\n const layerSeq = layerDepOrder.map(name => groups[name]).filter(d => d !== undefined);\n layerSeq.forEach((o) => {\n const layer = o.layer;\n const group = o.group;\n layer.measurement(measurement);\n layer.dataProps({\n timeDiffs: context._timeDiffs\n });\n layer.config().render !== false && layer.mount(group.node());\n });\n return this;\n};\n\nexport const getNearestDimensionalValue = (context, position) => {\n const fields = context.fields();\n if (!fields.x.length || !fields.y.length) {\n return null;\n }\n const data = context.data();\n const axes = context.axes();\n const fieldsConfig = data.getFieldsConfig();\n const xField = getObjProp(fields, 'x', 0).getMembers()[0];\n const yField = getObjProp(fields, 'y', 0).getMembers()[0];\n const xFieldType = fieldsConfig[xField].def.subtype;\n const yFieldType = fieldsConfig[yField].def.subtype;\n\n const entryVal = [['x', xFieldType, xField], ['y', yFieldType, yField]].find(entry =>\n entry[1] === DimensionSubtype.CATEGORICAL || entry[1] === DimensionSubtype.TEMPORAL);\n\n if (!entryVal || (xFieldType !== MeasureSubtype.CONTINUOUS && yFieldType !== MeasureSubtype.CONTINUOUS)) {\n return null;\n }\n const field = entryVal[2];\n const index = fieldsConfig[field].index;\n let key = axes[entryVal[0]][0].invert(position[entryVal[0]]);\n if (entryVal[1] === DimensionSubtype.TEMPORAL) {\n const filterData = [...new Set(data.getData().data.map(d => d[index]))];\n key = getNearestValue(filterData, key);\n }\n\n return key !== undefined ? [[field], [key]] : null;\n};\n\nexport const getLayersBy = (layers, searchBy, value) => layers.filter((layer) => {\n const name = searchBy === 'type' ? layer.constructor.formalName() : layer.alias();\n return name === value;\n});\n\nexport const removeLayersBy = (layers, searchBy, value) => {\n layers.filter((inst) => {\n const name = searchBy === 'type' ? inst.config().mark : inst.alias();\n if (name === value) {\n inst.remove();\n return false;\n }\n return true;\n });\n};\n\nexport const createSideEffectGroup = (container, className) => makeElement(container, 'g', [1], className).node();\n\nexport const createRenderPromise = (unit) => {\n const renderedPromise = unit._renderedPromise;\n renderedPromise.then(() => {\n unit._renderedPromise = new Promise((resolve) => {\n unit._renderedResolve = resolve;\n });\n createRenderPromise(unit);\n });\n};\n\nexport const getRadiusRange = (width, height, config = {}) => {\n const {\n innerRadius,\n outerRadius\n } = config;\n\n return [innerRadius || 0, outerRadius || Math.min(height,\n width) / 2];\n};\n\nexport const setAxisRange = (context) => {\n const axes = context.axes();\n const { radius: radiusAxes } = axes;\n if (radiusAxes) {\n radiusAxes.forEach((axis) => {\n axis.range(getRadiusRange(context.width(), context.height()));\n });\n }\n};\n\nexport const isXandYMeasures = (context) => {\n const { x: xFields, y: yFields } = context.fields();\n const [xMeasures, yMeasures] = [xFields, yFields].map(fields => fields\n .every(field => field.type() === FieldType.MEASURE));\n return xMeasures && yMeasures;\n};\n\nconst getKey = (arr, row) => {\n let key = row[arr[0]];\n for (let i = 1, len = arr.length; i < len; i++) {\n key = `${key},${row[arr[i]]}`;\n }\n return key;\n};\n\nexport const getValuesMap = (model, context) => {\n const idValuesMap = {};\n const valuesIdMap = {};\n const { data: dataArr, schema, uids } = model.getData();\n const fieldsConfig = model.getFieldsConfig();\n const fieldIndices = isXandYMeasures(context) ? schema.map((d, i) => i) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldsConfig[d].index);\n dataArr.forEach((row, i) => {\n const key = getKey(fieldIndices, row);\n valuesIdMap[key] = uids[i];\n idValuesMap[uids[i]] = row;\n });\n return { valuesIdMap, idValuesMap, fieldsConfig };\n};\n\nexport const getSelectionRejectionModel = (model, propModel, measures, propValuesMap) => {\n let rejectionModel;\n const { data, schema } = propModel.getData();\n const entryRowIds = [];\n const exitRowIds = [];\n\n if (schema.length) {\n const fieldMap = model.getFieldsConfig();\n const { valuesIdMap } = propValuesMap;\n\n const rowIdsObj = {};\n const filteredSchema = measures ? schema.map((d, idx) => idx) :\n Object.keys(model.getFieldspace().getDimension()).map(d => fieldMap[d].index);\n data.forEach((row) => {\n const key = getKey(filteredSchema, row);\n const id = valuesIdMap[key];\n if (key in valuesIdMap) {\n entryRowIds.push(id);\n rowIdsObj[id] = 1;\n }\n });\n rejectionModel = model.select((fields, i) => {\n if (!rowIdsObj[i]) {\n exitRowIds.push(i);\n return true;\n }\n return false;\n }, {\n saveChild: false\n });\n } else {\n rejectionModel = propModel;\n }\n\n return {\n model: [propModel, rejectionModel],\n entryRowIds,\n exitRowIds\n };\n};\n\nexport const createRTree = (context) => {\n const elements = [].concat(...context.layers().filter(layer => layer.config().interactive !== false)\n .map((layer) => {\n const points = layer.getBoundBoxes();\n return points;\n })).flat().filter(d => d !== null);\n\n const rtree = new RTree();\n rtree.load(elements);\n return rtree;\n};\n","export const CONFIG = 'config';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const MOUNT = 'mount';\nexport const TRANSFORM = 'transform';\nexport const TRANSFORMEDDATA = 'transformedData';\nexport const DATADOMAIN = 'dataDomain';\nexport const FIELDS = 'fields';\nexport const LAYERAXISINDEX = 'layerAxisIndex';\nexport const LAYERS = 'layers';\nexport const DOMAIN = 'domain';\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const GRID_LINE_PARENT_GROUP_CLASS = 'grid-lines';\nexport const GRID_BAND_PARENT_GROUP_CLASS = 'grid-bands';\nexport const GRID_PARENT_GROUP = 'grid-parent-group';\nexport const BAND = 'band';\nexport const TICK = 'tick';\nexport const GRID_BAND = 'gridBands';\nexport const GRID_LINE = 'gridLines';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const RETINAL_FIELDS = 'retinalFields';\nexport const PARENT_ALIAS = 'parentAlias';\nexport const LAYERS = 'layers';\nexport const CACHED_DATA = 'cachedData';\nexport const STORE = 'store';\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\nexport const LONGTOUCH = 'longtouch';\nexport const TOUCHDRAG = 'touchdrag';\nexport const ALL_ACTIONS = '*';\n","const SELECTION_NEW_ENTRY = 1;\nconst SELECTION_NEW_EXIT = -1;\nconst SELECTION_NULL = 0;\nconst SELECTION_OLD_ENTRY = 2;\nconst SELECTION_OLD_EXIT = -2;\n\nexport {\n SELECTION_NEW_ENTRY,\n SELECTION_NEW_EXIT,\n SELECTION_NULL,\n SELECTION_OLD_ENTRY,\n SELECTION_OLD_EXIT\n};\n","import SelectionSet from './selection-set';\n\nexport default SelectionSet;\n","import {\n SELECTION_NEW_ENTRY, SELECTION_NEW_EXIT, SELECTION_NULL, SELECTION_OLD_ENTRY, SELECTION_OLD_EXIT\n} from '../enums/selection';\n/* eslint-disable guard-for-in */\n\n/**\n * This component is used to keep track of the row tuples of the data which gets added and removed. This keeps\n * information of which rows are in previous and new entry set and previous and new exit set. This is initialized by\n * {@link Firebolt}.\n *\n * @public\n *\n * @class SelectionSet\n */\nclass SelectionSet {\n /**\n * Creates an instance of selection set\n *\n * @param {Array.} completeSet Set of unique ids.\n */\n constructor ({ keys, fields }, _volatile) {\n this.completeSet = keys;\n this._set = {};\n this._uidMap = {};\n this._measureNames = {};\n this._dimVals = {};\n\n for (const key in keys) {\n this._set[key] = SELECTION_NULL;\n this._uidMap[key] = keys[key].uid;\n this._measureNames[key] = keys[key].measureNames;\n this._dimVals[key] = keys[key].dims;\n }\n\n this._volatile = _volatile;\n this._completeSetCount = Object.keys(keys).length;\n this._lockedSelection = {};\n this._fieldIndices = fields.reduce((acc, v, i) => {\n acc[v] = i;\n return acc;\n }, {});\n this._fields = fields;\n this._resetted = true;\n }\n\n /**\n * Adds a set of ids to the selection set. This also moves the other rows to exit set.\n *\n * @public\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n add (ids) {\n this._resetted = false;\n\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n if (i in set) {\n set[i] = SELECTION_NEW_ENTRY;\n }\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_ENTRY && set[key] !== SELECTION_OLD_ENTRY) {\n set[key] = set[key] < 0 ? SELECTION_OLD_EXIT : SELECTION_NEW_EXIT;\n }\n }\n return this;\n }\n\n /**\n * Adds an array of ids to the old entry set.\n *\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n update (ids) {\n const set = this._set;\n // from exitset to entryset\n ids.forEach((i) => {\n if (i in set) {\n set[i] = SELECTION_OLD_ENTRY;\n }\n });\n\n return this;\n }\n\n /**\n * Moves all ids which in new entry set to old entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateEntry () {\n const set = this._set;\n\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_ENTRY ? SELECTION_OLD_ENTRY : set[key];\n }\n return this;\n }\n\n /**\n * Moves an array of ids which are in new exit set to old exit set.\n *\n * @public\n *\n * @param {Array.} ids Array of unique ids.\n *\n * @return {SelectionSet} Instance of selection set.\n */\n updateExit () {\n const set = this._set;\n // from exitset to entryset\n for (const key in set) {\n set[key] = set[key] === SELECTION_NEW_EXIT ? SELECTION_OLD_EXIT : set[key];\n }\n return this;\n }\n\n /**\n * Removes an array of ids from the selection set. It also moves the remaining row ids to entry set.\n *\n * @public\n * @param {Array.} ids Array of unique ids\n *\n * @return {SelectionSet} Instance of selection set\n */\n remove (ids) {\n this._resetted = false;\n\n const set = this._set;\n ids.forEach((i) => {\n i in set && (set[i] = SELECTION_NEW_EXIT);\n });\n\n for (const key in set) {\n if (set[key] !== SELECTION_NEW_EXIT && set[key] !== SELECTION_OLD_EXIT) {\n set[key] = set[key] === 0 ? SELECTION_NEW_ENTRY : SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getSets (config = {}) {\n const set = this._set;\n const uidMap = this._uidMap;\n const retObj = {\n entrySet: [[], []],\n exitSet: [[], []],\n mergedEnter: [],\n mergedExit: [],\n completeSet: []\n };\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n const { keepDims = false, dimensions = this._fields } = config;\n const fieldIndices = this._fieldIndices;\n\n for (const key in set) {\n let val;\n const measureNamesArr = measureNames[key] || [];\n let dims = dimVals[key];\n\n if (keepDims) {\n if (measureNamesArr.length) {\n dims = dimensions.map(d => dims[fieldIndices[d]]);\n val = dims.length ? [...dims, `${measureNamesArr}`] : [uidMap[key], `${measureNamesArr}`];\n } else {\n val = dims.length ? [...dims] : [uidMap[key]];\n }\n } else {\n val = measureNamesArr.length ? [uidMap[key], measureNames[key], dims] : [uidMap[key]];\n }\n\n if (set[key] > 0) {\n [SELECTION_OLD_ENTRY, SELECTION_NEW_ENTRY].forEach((v, i) => {\n if (set[key] === v) {\n retObj.entrySet[i].push(val);\n }\n });\n if (set[key] === SELECTION_OLD_ENTRY || set[key] === SELECTION_NEW_ENTRY) {\n retObj.mergedEnter.push(val);\n }\n } else if (set[key] < 0) {\n [SELECTION_OLD_EXIT, SELECTION_NEW_EXIT].forEach((v, i) => {\n if (set[key] === v) {\n retObj.exitSet[i].push(val);\n }\n });\n if (set[key] === SELECTION_OLD_EXIT || set[key] === SELECTION_NEW_EXIT) {\n retObj.mergedExit.push(val);\n }\n }\n retObj.completeSet.push(val);\n }\n\n return retObj;\n }\n\n /**\n * Resets an array of ids in the selection set to initial state. It sets the value of every unique id value to\n * null in the selection set which means they are neither in entry set nor in exit set. If no ids are passed,\n * then it resets all the ids to null.\n *\n * @public\n *\n * @param {Array} ids Array of unique ids.\n * @return {SelectionSet} Instance of selection set.\n */\n reset (ids) {\n const set = this._set;\n if (ids) {\n ids.forEach((i) => {\n i in set && (set[i] = SELECTION_NULL);\n });\n } else {\n for (const key in set) {\n set[key] = SELECTION_NULL;\n }\n }\n this._resetted = true;\n return this;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n *\n * @public\n *\n * @return {Array.} Array of unique ids\n */\n getEntrySet () {\n const set = this._set;\n const addSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_ENTRY && addSet.push(key);\n }\n\n return addSet;\n }\n\n /**\n * Returns a set of unique ids which are already present in entry set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old entry set or new entry set\n */\n getExistingEntrySet (addSet) {\n const set = this._set;\n return addSet.filter(d => set[d] === SELECTION_NEW_ENTRY || set[d] === SELECTION_OLD_ENTRY);\n }\n\n /**\n * Returns a set of unique ids which are already present in exit set.\n *\n * @public\n * @param {Array} addSet Array of unique ids which are added\n *\n * @return {Array} Array of unique ids which are already in old exit set or new exit set\n */\n getExistingExitSet (removeSet) {\n const set = this._set;\n return removeSet.filter(d => set[d] === SELECTION_NEW_EXIT || set[d] === SELECTION_OLD_EXIT);\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldEntry () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_ENTRY && updateSet.push(key);\n }\n return updateSet;\n }\n\n /**\n * Gets the set of ids which are added in the selection set.\n * @return {Array.} Array of unique ids\n */\n getOldExit () {\n const set = this._set;\n const updateSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_OLD_EXIT && updateSet.push(key);\n }\n\n return updateSet;\n }\n\n /**\n * Gets the array of ids which are in the exit set.\n *\n * @public\n * @return {Array.} Array of unique ids\n */\n getExitSet () {\n const set = this._set;\n const removeSet = [];\n\n for (const key in set) {\n set[key] === SELECTION_NEW_EXIT && removeSet.push(key);\n }\n return removeSet;\n }\n\n /**\n * Gets all the ids which are either in exit or entry set.\n *\n * @public\n * @return {Array} Array of unique ids\n */\n getCompleteSet () {\n const set = this._set;\n const completeSet = [];\n\n for (const key in set) {\n completeSet.push(key);\n }\n\n return completeSet;\n }\n\n getCompleteSetCount () {\n return this._completeSetCount;\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Swaps the add set and remove set in the selection set.\n * @return {SelectionSet} Instance of selection set.\n */\n toggle () {\n const set = this._set;\n\n for (const key in set) {\n if (set[key] === SELECTION_NEW_ENTRY) {\n set[key] = SELECTION_NEW_EXIT;\n } else if (set[key] === SELECTION_NEW_EXIT) {\n set[key] = SELECTION_NEW_ENTRY;\n } else if (set[key] === SELECTION_OLD_ENTRY) {\n set[key] = SELECTION_OLD_EXIT;\n } else {\n set[key] = SELECTION_OLD_ENTRY;\n }\n }\n\n return this;\n }\n\n getMergedEntrySet (raw) {\n const set = this._set;\n const mergedEnter = [];\n const uidMap = this._uidMap;\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n\n for (const key in set) {\n const val = raw ? [...dimVals[key], `${measureNames[key]}`] :\n [uidMap[key], measureNames[key]];\n if (set[key] === SELECTION_NEW_ENTRY || set[key] === SELECTION_OLD_ENTRY) {\n mergedEnter.push(val);\n }\n }\n return mergedEnter;\n }\n\n getMergedExitSet (raw) {\n const set = this._set;\n const mergedExit = [];\n const uidMap = this._uidMap;\n const measureNames = this._measureNames;\n const dimVals = this._dimVals;\n\n for (const key in set) {\n const val = raw ? [...dimVals[key], `${measureNames[key]}`] :\n [uidMap[key], measureNames[key]];\n if (set[key] === SELECTION_NEW_EXIT || set[key] === SELECTION_OLD_EXIT) {\n mergedExit.push(val);\n }\n }\n return mergedExit;\n }\n}\n\nexport default SelectionSet;\n","import { clone, unique, intersect } from 'muze-utils';\n\nexport const initializeSideEffects = (context, sideEffects) => {\n const sideEffectsMap = context._sideEffects;\n sideEffects = sideEffects instanceof Array ? sideEffects : Object.values(sideEffects);\n sideEffects.forEach((SideEffect) => {\n const formalName = SideEffect.formalName();\n const target = SideEffect.target();\n if (target === context.target() || target === 'all') {\n const sideEffectInstance = sideEffectsMap[formalName];\n sideEffectsMap[formalName] = sideEffectInstance || new SideEffect(context);\n }\n });\n return sideEffectsMap;\n};\n\nexport const setSideEffectConfig = (sideEffects, config) => {\n for (const key in sideEffects) {\n const sideEffect = sideEffects[key];\n const formalName = sideEffect.constructor.formalName();\n const sideEffectConf = config[formalName];\n\n sideEffectConf && sideEffect.config(sideEffectConf);\n }\n};\n\nexport const initializeBehaviouralActions = (context, actions) => {\n const dispatchableBehaviours = {};\n\n actions = actions instanceof Array ? actions : Object.values(actions);\n actions.forEach((Action) => {\n dispatchableBehaviours[Action.formalName()] = new Action(context);\n });\n return dispatchableBehaviours;\n};\n\nexport const initializePhysicalActions = (context, actions) => {\n const physicalActions = {};\n\n for (const name in actions) {\n if (!({}).hasOwnProperty.call(name, actions)) {\n physicalActions[name] = actions[name](context);\n }\n }\n return physicalActions;\n};\n\nexport const changeSideEffectAvailability = (context, fn, toEnable) => {\n const sideEffects = context.sideEffects();\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n let change = true;\n if (fn && fn(key) === false) {\n change = false;\n }\n if (change) {\n toEnable ? sideEffects[key].enable() : sideEffects[key].disable();\n }\n }\n }\n};\n\nexport const getMergedSet = set => [...new Set([...set[0], ...set[1]])];\n\nexport const getSourceFields = (propagationInf, criteria = {}) => {\n const sourceIdentifiers = propagationInf.sourceIdentifiers;\n let sourceFields;\n if (sourceIdentifiers) {\n sourceFields = sourceIdentifiers.fields.map(d => d.name);\n } else if (criteria instanceof Array) {\n sourceFields = criteria[0];\n } else {\n sourceFields = Object.keys(criteria || {});\n }\n return sourceFields;\n};\n\nexport const getSideEffects = (behaviour, behaviourEffectMap) => {\n const sideEffects = [];\n for (const key in behaviourEffectMap) {\n const behaviours = key.split(',');\n const found = behaviours.some(d => d === behaviour);\n if (found) {\n sideEffects.push({\n effects: behaviourEffectMap[key],\n behaviours\n });\n }\n }\n return sideEffects;\n};\n\nexport const unionSets = (firebolt, behaviours) => {\n let combinedSet = null;\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n const uidSet = {\n mergedEnter: [],\n mergedExit: []\n };\n\n behaviours.forEach((behaviour) => {\n const entryExitSet = firebolt._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const { model, uids } = entryExitSet[type];\n let existingModel = models[type];\n\n if (!existingModel) {\n existingModel = models[type] = model;\n uidSet[type] = uids;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n uidSet[type] = unique([...uidSet[type], ...uids]);\n models[type] = model.isEmpty() ? existingModel : existingModel.union(model);\n } else {\n existingModel = model;\n uidSet[type] = uids;\n }\n combinedSet[type].uids = uidSet[type];\n combinedSet[type].model = models[type];\n });\n }\n });\n\n return combinedSet;\n};\n\nexport const intersectSets = (firebolt, behaviours) => {\n let combinedSet = null;\n const models = {\n mergedEnter: null,\n mergedExit: null\n };\n const uidSet = {\n mergedEnter: [],\n mergedExit: []\n };\n\n behaviours.forEach((behaviour) => {\n const entryExitSet = firebolt._entryExitSet[behaviour];\n if (entryExitSet) {\n combinedSet = Object.assign(combinedSet || {}, clone(entryExitSet));\n ['mergedEnter', 'mergedExit'].forEach((type) => {\n const { model, uids } = entryExitSet[type];\n let existingModel = models[type];\n\n if (!existingModel) {\n existingModel = models[type] = model;\n uidSet[type] = uids;\n } else if (`${model.getSchema().map(d => d.name).sort()}` ===\n `${existingModel.getSchema().map(d => d.name).sort()}`) {\n const commonSet = intersect(uidSet[type], uids, [id => id[0], id => id[0]]);\n uidSet[type] = [...commonSet];\n models[type] = model.isEmpty() ? existingModel : existingModel.union(model);\n }\n combinedSet[type].uids = unique(uidSet[type]);\n combinedSet[type].model = models[type];\n });\n }\n });\n\n return combinedSet;\n};\n","import {\n mergeRecursive,\n hasTouch,\n selectElement,\n isSimpleObject,\n getDataModelFromRange,\n ReservedFields,\n FieldType,\n defaultValue\n} from 'muze-utils';\nimport { ALL_ACTIONS } from './enums/actions';\nimport SelectionSet from './selection-set';\nimport {\n initializeBehaviouralActions,\n initializeSideEffects,\n changeSideEffectAvailability,\n initializePhysicalActions,\n unionSets,\n getSideEffects,\n setSideEffectConfig\n} from './helper';\n\nconst cloneObj = (behaviourEffectMap) => {\n const keys = Object.keys(behaviourEffectMap);\n\n return keys.reduce((acc, key) => {\n const value = behaviourEffectMap[key];\n const cloned = value.map((d) => {\n let clonedVal = d;\n if (isSimpleObject(d)) {\n clonedVal = mergeRecursive({}, d);\n }\n return clonedVal;\n });\n acc[key] = cloned;\n return acc;\n }, {});\n};\n\nconst getKeysFromCriteria = (criteria, firebolt) => {\n if (criteria) {\n const data = firebolt.data();\n const { dimensionsMap, dimensions: dimArr } = firebolt._metaData;\n\n let values = [];\n if (isSimpleObject(criteria)) {\n const dm = getDataModelFromRange(data, criteria);\n const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(dm.getFieldsConfig()).length,\n def: {\n name: ReservedFields.ROW_ID,\n type: FieldType.DIMENSION\n }\n }\n });\n dm.getData({ withUid: true }).data.forEach((row) => {\n const dimKey = `${dimArr.map(d => row[fieldsConfig[d].index])}`;\n const measures = criteria[ReservedFields.MEASURE_NAMES] || dimensionsMap[dimKey] || [[]];\n measures.forEach((measureArr) => {\n values.push(`${[dimKey, ...measureArr]}`);\n });\n });\n } else {\n values = criteria.slice(1, criteria.length).map(d => `${d}`);\n }\n return values;\n }\n return null;\n};\n\n/**\n * This class is responsible for dispatching behavioural actions and side effects. It also keeps the information of\n * registered physical actions, behavioural actions and side effects. Also, it keeps the map of physical and behavioural\n * actions and behavioural actions and side effects. Whenever any behavioural action is dispatched, it also propagates\n * the rows which got affected to the other datamodels. This class is initialized by {@link VisualUnit} and legend to\n * manage it's interaction.\n *\n * @public\n * @class Firebolt\n * @module Firebolt\n */\nexport default class Firebolt {\n constructor (context, actions, sideEffects, behaviourEffectMap) {\n this.context = context;\n this._sideEffectDefinitions = {};\n this._sideEffects = {};\n this._propagationInf = {};\n this._sourceSelectionSet = {};\n this._actions = {\n behavioural: {},\n physical: {}\n };\n this._selectionSet = {};\n this._volatileSelectionSet = {};\n this._propagationFields = {};\n this._sideEffectPolicies = {};\n this._propagationBehaviourMap = {};\n this._behaviourPolicies = {};\n this._actionBehaviourMap = {};\n this._config = {};\n this._behaviourEffectMap = {};\n this._entryExitSet = {};\n this._actionHistory = {};\n this._queuedSideEffects = {};\n this._handlers = {};\n this._payloadGenerators = {};\n this._payloads = {};\n\n this.mapSideEffects(cloneObj(behaviourEffectMap));\n this.registerBehaviouralActions(actions.behavioural);\n this.registerSideEffects(sideEffects);\n this.registerPhysicalBehaviouralMap(actions.physicalBehaviouralMap);\n this.registerPhysicalActions(actions.physical);\n }\n\n config (...config) {\n if (config.length) {\n this._config = mergeRecursive(this._config, config[0]);\n setSideEffectConfig(this.sideEffects(), this._config);\n return this;\n }\n return this._config;\n }\n\n mapSideEffects (behEffectMap) {\n const behaviourEffectMap = this._behaviourEffectMap;\n for (const key in behEffectMap) {\n if ({}.hasOwnProperty.call(behEffectMap, key)) {\n const sideEffects = behEffectMap[key] || [];\n let preventDefaultActions = false;\n let effectNames;\n if (isSimpleObject(sideEffects)) {\n effectNames = sideEffects.effects;\n preventDefaultActions = sideEffects.preventDefaultActions;\n } else {\n effectNames = sideEffects;\n }\n effectNames = effectNames.map((effect) => {\n if (!isSimpleObject(effect)) {\n return {\n name: effect\n };\n }\n return effect;\n });\n !behaviourEffectMap[key] && (behaviourEffectMap[key] = []);\n this._behaviourEffectMap[key] = [...new Set(preventDefaultActions ? effectNames :\n [...behaviourEffectMap[key], ...effectNames])];\n }\n }\n return this;\n }\n\n registerBehaviouralActions (actions) {\n const behaviours = initializeBehaviouralActions(this, actions);\n this.prepareSelectionSets(behaviours);\n Object.assign(this._actions.behavioural, behaviours);\n return this;\n }\n\n prepareSelectionSets () {\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n return this;\n }\n\n applySideEffects (sideEffects, selectionSet, payload) {\n const sideEffectStore = this.sideEffects();\n const actionHistory = this._actionHistory;\n const queuedSideEffects = this._queuedSideEffects;\n sideEffects.forEach((sideEffect) => {\n const effects = sideEffect.effects;\n const behaviours = sideEffect.behaviours;\n let combinedSet = this.mergeSelectionSets(behaviours);\n effects.forEach((effect) => {\n let options = {};\n let name;\n if (typeof effect === 'object') {\n name = effect.name;\n options = effect.options || {};\n } else {\n name = effect;\n }\n const set = options.set;\n if (set) {\n combinedSet = this.mergeSelectionSets(set);\n }\n const sideEffectInstance = sideEffectStore[name];\n if (sideEffectInstance && sideEffectInstance.isEnabled()) {\n if (!sideEffectInstance.constructor.mutates() &&\n Object.values(actionHistory).some(d => d.isMutableAction)) {\n queuedSideEffects[`${name}-${behaviours.join()}`] = {\n name,\n params: [combinedSet, payload, options]\n };\n } else {\n this.dispatchSideEffect(name, combinedSet, payload, options);\n }\n }\n });\n });\n return this;\n }\n\n dispatchSideEffect (name, selectionSet, payload, options = {}) {\n const sideEffectStore = this.sideEffects();\n const sideEffect = sideEffectStore[name];\n const { setTransform } = options;\n selectionSet = setTransform ? setTransform(selectionSet, payload, sideEffect) : selectionSet;\n sideEffect.apply(selectionSet, payload, options);\n }\n\n registerPropagationBehaviourMap (map) {\n this._propagationBehaviourMap = Object.assign(this._propagationBehaviourMap, map || {});\n return this;\n }\n\n dispatchBehaviour (behaviour, payload, propagationInfo = {}) {\n payload = this.sanitizePayload(payload);\n const propagate = propagationInfo.propagate !== undefined ? propagationInfo.propagate : true;\n const behaviouralActions = this._actions.behavioural;\n const action = behaviouralActions[behaviour];\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(behaviour, behaviourEffectMap);\n this._propagationInf = propagationInfo;\n this._payloads[behaviour] = payload;\n\n if (action) {\n action.dispatch(payload);\n this._entryExitSet[behaviour] = action.entryExitSet();\n const shouldApplySideEffects = this.shouldApplySideEffects(propagationInfo);\n\n if (propagate) {\n this.propagate(behaviour, payload, action.propagationIdentifiers(), { sideEffects });\n }\n\n if (shouldApplySideEffects) {\n const applicableSideEffects = this.getApplicableSideEffects(sideEffects, payload, propagationInfo);\n this.applySideEffects(applicableSideEffects, this.getEntryExitSet(behaviour), payload);\n }\n }\n\n return this;\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet.find(d => !d.sourceSelectionSet);\n }\n\n shouldApplySideEffects () {\n return true;\n }\n\n changeBehaviourStateOnPropagation (behaviour, value, key = 'default') {\n const behaviourConditions = this._behaviourPolicies[behaviour] || (this._behaviourPolicies[behaviour] = {});\n if (value instanceof Function) {\n behaviourConditions[key] = value;\n } else {\n behaviourConditions[key] = () => value;\n }\n return this;\n }\n\n changeSideEffectStateOnPropagation (sideEffect, value, key = 'default') {\n const sideEffectConditions = this._sideEffectPolicies[sideEffect] ||\n (this._sideEffectPolicies[sideEffect] = {});\n if (value instanceof Function) {\n sideEffectConditions[key] = value;\n } else {\n sideEffectConditions[key] = () => value;\n }\n }\n\n removeSideEffectPolicy (sideEffect, key) {\n delete this._sideEffectPolicies[sideEffect][key];\n return this;\n }\n\n removeBehaviourPolicy (behaviour, key) {\n delete this._behaviourPolicies[behaviour][key];\n return this;\n }\n\n propagate () {\n return this;\n }\n\n sideEffects (...sideEffects) {\n if (sideEffects.length) {\n this._sideEffects = sideEffects[0];\n return this;\n }\n return this._sideEffects;\n }\n\n enableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, true);\n return this;\n }\n\n disableSideEffects (fn) {\n changeSideEffectAvailability(this, fn, false);\n return this;\n }\n\n dissociateBehaviour (behaviour, physicalAction) {\n const actionBehaviourMap = this._actionBehaviourMap;\n for (const key in actionBehaviourMap) {\n if (key === physicalAction) {\n const behaviourMap = actionBehaviourMap[key];\n behaviourMap.behaviours = behaviourMap.behaviours.filter(d => d !== behaviour);\n this.mapActionsAndBehaviour(key);\n }\n }\n\n return this;\n }\n\n dissociateSideEffect (sideEffect, behaviour) {\n const behaviourEffectMap = this._behaviourEffectMap;\n behaviourEffectMap[behaviour] = behaviourEffectMap[behaviour].filter(d => (d.name || d) !== sideEffect);\n return this;\n }\n\n getApplicableSideEffects (sideEffects) {\n return sideEffects;\n }\n\n attachPropagationListener (dataModel, handler = this.onDataModelPropagation()) {\n dataModel.unsubscribe('propagation');\n dataModel.on('propagation', handler);\n return this;\n }\n\n onDataModelPropagation () {\n return (propValue) => {\n const payload = propValue.payload;\n const action = payload.action;\n\n this.dispatchBehaviour(action, payload, {\n propagate: false\n });\n };\n }\n\n createSelectionSet (uniqueIds, behaviouralActions) {\n const behaviours = behaviouralActions || this._actions.behavioural;\n const selectionSet = this._selectionSet;\n const volatileSelectionSet = this._volatileSelectionSet;\n\n for (const key in behaviours) {\n if ({}.hasOwnProperty.call(behaviours, key)) {\n selectionSet[key] = new SelectionSet(uniqueIds);\n volatileSelectionSet[key] = new SelectionSet(uniqueIds, true);\n this._entryExitSet[key] = null;\n }\n }\n\n this._volatileSelectionSet = volatileSelectionSet;\n this.selectionSet(selectionSet);\n return this;\n }\n\n selectionSet (...selectionSet) {\n if (selectionSet.length) {\n this._selectionSet = selectionSet[0];\n return this;\n }\n return this._selectionSet;\n }\n\n initializeSideEffects () {\n const sideEffectDefinitions = this._sideEffectDefinitions;\n this.sideEffects(initializeSideEffects(this, sideEffectDefinitions));\n return this;\n }\n\n target () {\n return 'all';\n }\n\n registerPhysicalActions (actions, context = this) {\n const initedActions = initializePhysicalActions(context, actions);\n Object.assign(this._actions.physical, initedActions);\n return this;\n }\n\n /**\n * Allows to propagate the datamodel with only the supplied fields. When propagation is done, then the fields\n * which are supplied for the specified behavioural action is propagated.\n *\n * @public\n *\n * @param {string} action Name of behavioural action. If '*' is specified, then for all behavioural actions it is\n * applied.\n * @param {Array} fields Array of field names which will be propagated.\n * @param {boolean} append If true, then it is appended to the existing propagation data model fields else only\n * those fields are projected from propagation data model and propagated.\n *\n * @return {Firebolt} Instance of firebolt\n */\n propagateWith (action, fields, append = false) {\n const behaviouralActions = this._actions.behavioural;\n if (action === ALL_ACTIONS) {\n for (const key in behaviouralActions) {\n this._propagationFields[key] = {\n fields,\n append\n };\n }\n } else {\n this._propagationFields[action] = {\n fields,\n append\n };\n }\n return this;\n }\n\n /**\n * Map actions and behaviours\n * @return {Firebolt} Firebolt instance\n */\n mapActionsAndBehaviour (phyAction) {\n const initedPhysicalActions = this._actions.physical;\n const map = this._actionBehaviourMap;\n\n for (const action in map) {\n if (!({}).hasOwnProperty.call(action, map) && action === (phyAction || action)) {\n let target;\n const mapObj = map[action];\n target = mapObj.target;\n const touch = mapObj.touch;\n if (!target) {\n target = this.context.getDefaultTargetContainer();\n }\n const bind = hasTouch() ? touch === true || touch === undefined : !touch;\n bind && this.bindActionWithBehaviour(initedPhysicalActions[action],\n target, mapObj.behaviours);\n }\n }\n this.registerPhysicalActionHandlers();\n return this;\n }\n\n registerPhysicalBehaviouralMap (map) {\n this._actionBehaviourMap = mergeRecursive(this._actionBehaviourMap, map);\n return this;\n }\n\n /**\n * Binds a target element with an action.\n *\n * @param {Function} action Action method\n * @param {string} target Class name of element\n * @param {Array} behaviourList Array of behaviours\n * @return {FireBolt} Instance of firebolt\n */\n bindActionWithBehaviour (action, targets, behaviourList) {\n if (typeof (targets) === 'string') {\n targets = [targets];\n }\n targets.forEach((target) => {\n const mount = this.context.mount();\n const nodes = target.node instanceof Function ? target : selectElement(mount).selectAll(target);\n if (!nodes.empty()) {\n if (nodes instanceof Array) {\n nodes.forEach((node) => {\n action(selectElement(node), behaviourList);\n });\n } else {\n action(nodes, behaviourList);\n }\n }\n });\n return this;\n }\n\n getPropagationInf () {\n return this._propagationInf;\n }\n\n getAddSetFromCriteria (criteria, propagationInf = {}) {\n return {\n model: propagationInf.data ? propagationInf.data : null,\n uids: criteria ? getKeysFromCriteria(criteria, this) : null\n };\n }\n\n getSelectionSets (action) {\n const sourceId = this.id();\n const propagationInf = this._propagationInf || {};\n const propagationSource = propagationInf.sourceId;\n let applicableSelectionSets = [];\n if (propagationSource !== sourceId) {\n applicableSelectionSets = [this._volatileSelectionSet[action]];\n }\n\n if (propagationSource) {\n applicableSelectionSets.push(this.selectionSet()[action]);\n }\n return applicableSelectionSets;\n }\n\n getFullData () {\n return this.context.data();\n }\n\n resetted () {\n return this._resetted;\n }\n\n /**\n * Returns the entry and exit set information of the specified behavioural action.\n *\n * @public\n *\n * @param {string} behaviour Name of behavioural action.\n *\n * @return {Object} Entry exit set information.\n */\n getEntryExitSet (behaviour) {\n return this._entryExitSet[behaviour];\n }\n\n mergeSelectionSets (behaviours) {\n return unionSets(this, behaviours);\n }\n\n data () {\n return this.context.data();\n }\n\n triggerPhysicalAction (event, payload) {\n const handlers = this._handlers[event] || [];\n const genericHandlers = this._handlers['*'];\n\n const allHandlers = [...Object.values(handlers), ...Object.values(genericHandlers)];\n allHandlers.forEach((fn) => {\n fn(event, payload);\n });\n\n return this;\n }\n\n onPhysicalAction (event, fn, namespace) {\n !this._handlers[event] && (this._handlers[event] = {});\n this._handlers[event][namespace] = fn;\n\n return this;\n }\n\n registerPhysicalActionHandlers () {\n this.onPhysicalAction('*', (event, payload) => {\n const { behaviours } = this._actionBehaviourMap[event];\n behaviours.forEach(beh => this.dispatchBehaviour(beh, payload));\n });\n }\n\n id () {\n return this.context.id();\n }\n\n getRangeFromIdentifiers (...params) {\n return this.context.getRangeFromIdentifiers(...params);\n }\n\n sanitizePayload (payload) {\n return payload;\n }\n\n payloadGenerators (...params) {\n if (params.length) {\n Object.assign(this._payloadGenerators, params[0]);\n }\n return this._payloadGenerators;\n }\n\n getPayloadGeneratorFor (action) {\n const defaultFn = this._payloadGenerators.__default;\n const fn = this._payloadGenerators[action];\n\n return defaultValue(fn, defaultFn);\n }\n\n getPayload (action) {\n return this._payloads[action];\n }\n\n actions () {\n return this._actions;\n }\n}\n","import {\n isSimpleObject,\n DimensionSubtype,\n partition,\n ReservedFields,\n retrieveNearestGroupByReducers\n} from 'muze-utils';\nimport { getMergedSet, getSourceFields } from '../../helper';\n\nexport const getIdentifiersFromSet = (set, context, { fields }) => {\n const data = [[]];\n\n if (fields.length) {\n data[0] = fields;\n set.forEach(id => data.push(id));\n }\n return data;\n};\n\n/**\n * This is the base class has all the common functionalities needed for all behavioural actions. Any other behavioural\n * action needs to extend this class.\n *\n * @public\n * @class GenericBehaviour\n * @module GenericBehaviour\n */\nexport default class GenericBehaviour {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n }\n\n /**\n * Returns entry and exit set information. This method is called by firebolt when ```dispatchBehaviour``` is called\n * dynamically or when any physical action is triggered on the chart.\n *\n * @param {Object} payload Payload information.\n * @param {Object|Array} payload.criteria Identifiers of data interacted with.\n *\n * @return {Array} Entry and exit set information.\n */\n dispatch (payload) {\n const criteria = payload.criteria;\n const firebolt = this.firebolt;\n const formalName = this.constructor.formalName();\n const selectionSets = firebolt.getSelectionSets(formalName);\n const {\n model: filteredDataModel,\n uids\n } = this.getAddSetFromCriteria(criteria, this.firebolt.getPropagationInf());\n this._payload = payload;\n\n selectionSets.forEach((selectionSet) => {\n this.setSelectionSet(uids, selectionSet, {\n filteredDataModel,\n payload\n });\n\n selectionSet._volatile && this.propagationIdentifiers(selectionSet, payload);\n this.entryExitSet(selectionSet, filteredDataModel, payload);\n });\n }\n\n getAddSetFromCriteria (...params) {\n return this.firebolt.getAddSetFromCriteria(...params);\n }\n\n /**\n * Updates the selection set by adding uids to the instance of {@link SelectionSet} or removing them.\n * {@link SelectionSet} keeps the information of which rows are in the entry set and exit set.\n *\n * @public\n * @param {Array} addSet Array of row ids which got affected during interaction.\n * @param {SelectionSet} selectionSet Instance of selection set.\n *\n * @return {GenericBehaviour} Instance of behaviour.\n */\n setSelectionSet () {\n return this;\n }\n\n entryExitSet (...params) {\n if (params.length) {\n const [selectionSet, filteredDataModel, payload] = params;\n const {\n entrySet,\n exitSet,\n completeSet\n } = selectionSet.getSets();\n const propagationInf = this.firebolt.getPropagationInf();\n\n this._entryExitSet = {\n entrySet: [this.getSetInfo('oldEntry', entrySet[0], filteredDataModel),\n this.getSetInfo('newEntry', entrySet[1], filteredDataModel)],\n exitSet: [this.getSetInfo('oldEntry', exitSet[0], filteredDataModel),\n this.getSetInfo('newExit', exitSet[1], filteredDataModel)],\n mergedEnter: this.getSetInfo('mergedEnter', getMergedSet(entrySet), filteredDataModel,\n selectionSet._fields),\n mergedExit: this.getSetInfo('mergedExit', getMergedSet(exitSet), filteredDataModel,\n selectionSet._fields),\n completeSet: this.getSetInfo('complete', completeSet, filteredDataModel, selectionSet._fields),\n fields: getSourceFields(propagationInf, payload.criteria)\n };\n\n return this;\n }\n return this._entryExitSet;\n }\n\n getSetInfo (type, set, filteredDataModel, setFields) {\n let model = null;\n const data = this.firebolt.data();\n\n if (type === 'mergedEnter') {\n model = filteredDataModel || null;\n } else if (type === 'mergedExit') {\n if (filteredDataModel) {\n const setKeys = new Set(set.map(d => d[0]));\n model = data.select((fields, i) => setKeys.has(setFields.map(field =>\n (field === ReservedFields.ROW_ID ? i : fields[field].value))), {\n saveChild: false\n });\n }\n model = filteredDataModel || null;\n }\n const aggFns = retrieveNearestGroupByReducers(model);\n\n return {\n uids: set,\n length: set.length,\n model,\n fields: setFields,\n aggFns\n };\n }\n\n propagationIdentifiers (...params) {\n if (params.length) {\n let propData = null;\n const [selectionSet, payload] = params;\n const fieldsConfig = this.firebolt.data().getFieldsConfig();\n const { criteria } = payload;\n const propagationFields = this._propagationFields;\n\n if (selectionSet.resetted() || criteria === null) {\n propData = null;\n } else if (isSimpleObject(criteria)) {\n const fields = Object.keys(criteria);\n const [, otherFields] =\n partition(fields, (d => (fieldsConfig[d] ? fieldsConfig[d].def.subtype ===\n DimensionSubtype.CATEGORICAL : d === ReservedFields.MEASURE_NAMES)));\n const allFields = selectionSet._fields.filter(d => d === ReservedFields.ROW_ID ||\n fieldsConfig[d].def.subtype ===\n DimensionSubtype.CATEGORICAL\n );\n const { mergedEnter } = selectionSet.getSets({ keepDims: true, dimensions: allFields });\n propData = {\n fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : {\n name: d\n })),\n range: this.firebolt.getRangeFromIdentifiers({\n criteria,\n entrySet: mergedEnter,\n fields: otherFields\n }),\n identifiers: [[...allFields, ReservedFields.MEASURE_NAMES], ...mergedEnter]\n };\n } else {\n const { mergedEnter } = selectionSet.getSets({ keepDims: true,\n dimensions: propagationFields });\n const fields = propagationFields ? [...propagationFields, ReservedFields.MEASURE_NAMES] :\n criteria[0];\n\n propData = {\n fields: fields.map(d => (fieldsConfig[d] ? fieldsConfig[d].def : {\n name: d\n })),\n identifiers: [fields, ...mergedEnter]\n };\n }\n this._propagationIdentifiers = propData;\n return this;\n }\n return this._propagationIdentifiers;\n }\n\n static mutates () {\n return false;\n }\n\n enable () {\n this._enabled = true;\n }\n\n disable () {\n this._enabled = false;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n propagateWith (...params) {\n this._propagationFields = params[0];\n\n return this;\n }\n}\n\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class VolatileBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n","import VolatileBehaviour from './volatile';\nimport { HIGHLIGHT } from '../../enums/behaviours';\n\nexport default class HighlightBehaviour extends VolatileBehaviour {\n static formalName () {\n return HIGHLIGHT;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport * as BEHAVIOURNAMES from '../../enums/behaviours';\n\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class BrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BEHAVIOURNAMES.BRUSH;\n }\n}\n","import VolatileBehaviour from './volatile';\nimport { FILTER } from '../../enums/behaviours';\n\nexport default class FilterBehaviour extends VolatileBehaviour {\n static formalName () {\n return FILTER;\n }\n\n static mutates () {\n return true;\n }\n}\n","import GenericBehaviour from './generic';\nimport { getMergedSet } from '../../helper';\nimport * as SELECTION from '../../enums/selection';\n\nexport default class PersistentBehaviour extends GenericBehaviour {\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.sourceId) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n }\n\n return this;\n }\n}\n","import PersistentBehaviour from './persistent';\nimport { SELECT } from '../../enums/behaviours';\nimport { SELECTION } from '../..';\nimport { getMergedSet } from '../../helper';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return SELECT;\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt.getPropagationInf();\n // new add set\n const existingAddSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_NEW_ENTRY\n || selectionSet._set[d] === SELECTION.SELECTION_OLD_ENTRY);\n if (propagationInf.sourceId) {\n selectionSet.updateExit();\n const { entrySet } = selectionSet.getSets({ keepDims: true });\n selectionSet.reset(getMergedSet(entrySet));\n selectionSet.add(addSet);\n selectionSet.update(existingAddSet);\n } else {\n // existing add set\n if (existingAddSet.length) {\n selectionSet.updateExit();\n selectionSet.remove(existingAddSet);\n } else {\n selectionSet.updateEntry();\n selectionSet.add(addSet);\n }\n const { exitSet } = selectionSet.getSets({ keepDims: true });\n const mergedExitSet = getMergedSet(exitSet);\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n\n return this;\n }\n}\n\n","import { COORD_TYPES } from 'muze-utils';\n\nconst dragCriteriaRetriever = {\n [COORD_TYPES.CARTESIAN]: (firebolt, sourceInfo, { startPos, endPos }) => {\n if (startPos.x === endPos.x && startPos.y === endPos.y) {\n return {\n criteria: null\n };\n }\n const ranges = firebolt.context.getRangeFromPositions({\n startPos,\n endPos\n });\n const dimensions = {};\n dimensions.x = [startPos.x, endPos.x];\n dimensions.y = [startPos.y, endPos.y];\n return {\n criteria: ranges,\n dimensions\n };\n },\n [COORD_TYPES.POLAR]: () => ({\n criteria: null\n })\n};\n\n/**\n * Gets the drag action configuration\n * @param {VisualUnit} instance instance of visual unit\n * @param {Object} config x y positions\n * @return {Object} Payload of behaviour\n*/\n/* istanbul ignore next */ const getDragActionConfig = (firebolt, config) => {\n const context = firebolt.context;\n const sourceInfo = context.getSourceInfo();\n const coordType = context.coord();\n return dragCriteriaRetriever[coordType](firebolt, sourceInfo, config);\n};\n\nexport default getDragActionConfig;\n","import {\n getEvent,\n getD3Drag\n} from 'muze-utils';\nimport getDragActionConfig from './drag-action-config';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const attachDragEvent = (targetEl, action, firebolt, touch) => {\n let startPos = {};\n let endPos = {};\n let drawingInf;\n\n const d3Drag = getD3Drag();\n let touchStart;\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n drawingInf = firebolt.context.getDrawingContext();\n touchStart = new Date().getTime();\n }).on('drag', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n\n if (touch && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n const newStartPos = Object.assign({}, startPos);\n const newEndPos = Object.assign({}, endPos);\n if (startPos.x > endPos.x) {\n newStartPos.x = endPos.x;\n newEndPos.x = startPos.x;\n }\n\n if (startPos.y > endPos.y) {\n const y = startPos.y;\n newStartPos.y = endPos.y;\n newEndPos.y = y;\n }\n const payload = getDragActionConfig(firebolt, {\n startPos: newStartPos,\n endPos: newEndPos\n });\n payload.dragging = true;\n payload.dragDiff = Math.abs(startPos.x - endPos.x) + Math.abs(startPos.y - endPos.y);\n firebolt.triggerPhysicalAction(action, payload);\n }).on('end', () => {\n const event = getEvent();\n endPos = {\n x: event.x,\n y: event.y\n };\n const duration = new Date().getTime() - touchStart;\n\n if (touch && duration > 100 && Math.abs(startPos.x - endPos.x) <= 5) {\n return;\n }\n endPos.x = Math.max(0, Math.min(endPos.x, drawingInf.width));\n endPos.y = Math.max(0, Math.min(endPos.y, drawingInf.height));\n if (startPos.x > endPos.x) {\n const x = startPos.x;\n startPos.x = endPos.x;\n endPos.x = x;\n }\n\n if (startPos.y > endPos.y) {\n const y = startPos.y;\n startPos.y = endPos.y;\n endPos.y = y;\n }\n\n const payload = getDragActionConfig(firebolt, {\n startPos,\n endPos\n });\n payload.dragEnd = true;\n firebolt.triggerPhysicalAction(action, payload);\n }));\n};\n\n","import { getClientPoint, getEvent } from 'muze-utils';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} instance instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const context = firebolt.context;\n const tooltipConf = context.config().interaction.tooltip;\n const mode = tooltipConf.mode;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n getAllPoints: true,\n data: args,\n event\n });\n const payload = {\n criteria: nearestPoint ? nearestPoint.id : null,\n getAllPoints: false,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos,\n mode\n };\n\n firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, payload);\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n firebolt.triggerPhysicalAction(ACTION_NAMES.HOVER, {\n criteria: null\n });\n });\n};\n\nexport default hover;\n","import { getClientPoint } from 'muze-utils';\n\nexport const generatePayloadFromEvent = function (args, event, firebolt) {\n const context = firebolt.context;\n const pos = getClientPoint(context.getDrawingContext().svgContainer, event.touches ? event.touches[0] : event);\n const nearestPoint = context.getNearestPoint(pos.x, pos.y, {\n data: args,\n event\n });\n return {\n criteria: nearestPoint ? nearestPoint.id : null,\n showInPosition: nearestPoint.showInPosition,\n target: nearestPoint.target,\n position: pos\n };\n};\n","import { getEvent } from 'muze-utils';\nimport { generatePayloadFromEvent } from './helpers';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const click = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = generatePayloadFromEvent(args, event, firebolt);\n firebolt.triggerPhysicalAction(ACTION_NAMES.CLICK, payload);\n event.stopPropagation();\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport { longtouch } from './longtouch';\nimport { touchdrag } from './touch-drag';\nimport * as ACTION_NAMES from '../../enums/actions';\nimport click from './click';\n\nexport const physicalActions = {\n [ACTION_NAMES.DRAG]: drag,\n [ACTION_NAMES.HOVER]: hover,\n [ACTION_NAMES.CLICK]: click,\n [ACTION_NAMES.LONGTOUCH]: longtouch,\n [ACTION_NAMES.TOUCHDRAG]: touchdrag\n};\n\n","import { attachDragEvent } from './helpers/drag-event';\nimport * as ACTION_NAMES from '../../enums/actions';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl) => {\n attachDragEvent(targetEl, ACTION_NAMES.DRAG, firebolt);\n};\n\nexport default drag;\n","/* global setTimeout */\nimport { getEvent } from 'muze-utils';\nimport * as ACTION_NAMES from '../../enums/actions';\nimport { generatePayloadFromEvent } from './helpers';\n\n/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nexport const longtouch = firebolt => (targetEl) => {\n let event;\n let touchEnd;\n const dispatchBehaviour = function (args) {\n const payload = generatePayloadFromEvent(args, event, firebolt);\n firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, payload);\n event.stopPropagation();\n };\n\n touchEnd = false;\n event = getEvent();\n targetEl.on('touchstart', (args) => {\n event = getEvent();\n touchEnd = false;\n setTimeout(() => {\n if (!touchEnd) {\n dispatchBehaviour(args);\n } else {\n firebolt.triggerPhysicalAction(ACTION_NAMES.LONGTOUCH, {\n criteria: null\n });\n }\n }, 100);\n }).on('touchend', () => {\n touchEnd = true;\n });\n};\n","import { attachDragEvent } from './helpers/drag-event';\n\n/**\n * Adds dragging action to the target element.\n * @param {VisualUnit} instance Instance of visual unit.\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\nexport const touchdrag = firebolt => (targetEl, behaviours) => {\n attachDragEvent(targetEl, behaviours, firebolt, true);\n};\n\n","const ANCHORS = 'anchors';\nconst TOOLTIP = 'tooltip';\nconst BRUSH_ANCHORS = 'brush-anchors';\nconst PERSISTENT_ANCHORS = 'persistent-anchors';\nconst FILTER = 'filter';\nconst HIGHLIGHTER = 'highlighter';\nconst CROSSLINE = 'crossline';\nconst FRAGMENTED_TOOLTIP = 'fragmented-tooltip';\nconst AXIS_LABEL_HIGHLIGHTER = 'axis-label-highlighter';\n\nexport {\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS,\n FILTER,\n HIGHLIGHTER,\n CROSSLINE,\n TOOLTIP,\n FRAGMENTED_TOOLTIP,\n AXIS_LABEL_HIGHLIGHTER\n};\n","export const PROPS = {\n valueParser: {\n defaultValue: val => val\n }\n};\n","import GenericSideEffect from './generic-sideeffect';\n\nexport default GenericSideEffect;\n","import { mergeRecursive, getUniqueId, generateGetterSetters } from 'muze-utils';\nimport { PROPS } from './props';\n\n/**\n * This is the base class of all side effects. It contains all common methods like setting configuration, disabling,\n * enabling side effect, etc. Every new side effect has to inherit this class or {@link SpawnableSideEffect} or\n * {@link SurrogateSideEffect} class. All side effects are initialized by firebolt. The instance of firebolt is\n * passed on initialization. The firebolt instance contains ```context``` which is the instance of visual unit with\n * which the firebolt is attached.\n *\n * @public\n * @class\n * @module GenericSideEffect\n */\nexport default class GenericSideEffect {\n constructor (firebolt) {\n this.firebolt = firebolt;\n this._enabled = true;\n this._strategy = 'default';\n this._config = {};\n this._id = getUniqueId();\n this._strategies = {};\n generateGetterSetters(this, PROPS);\n this.config(this.constructor.defaultConfig());\n this.sourceInfo(() => this.firebolt.context.getSourceInfo());\n this.layers(() => this.firebolt.context.layers());\n this.plotPointsFromIdentifiers((...args) => this.firebolt.context.getPlotPointsFromIdentifiers(...args));\n }\n\n /**\n * Returns the default configuration of the side effect.\n *\n * @public\n * @return {Object} Default configuration of side effect.\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the formal name of a side effect. This method must be implemented by all side effects which changes\n * or adds any element in the visualization.\n *\n * @return {string} Formal name of side effect.\n */\n static formalName () {\n return 'generic';\n }\n\n static target () {\n return 'all';\n }\n\n /**\n * Returns true if the side effects mutates the data of chart.\n *\n * @public\n *\n * @return {boolean} If the side effect mutates the data of chart.\n */\n static mutates () {\n return false;\n }\n\n /**\n * Sets or gets the configuration of side effect.\n *\n * When setter,\n * @param {Object} config Configuration of side effect.\n * @return {GenericSideEffect} Side effect instance.\n *\n * When getter,\n * @return {Object} Side effect configuration.\n */\n config (...params) {\n if (params.length) {\n this._config = mergeRecursive(this._config, params[0]);\n return this;\n }\n return this._config;\n }\n\n disable () {\n this._enabled = false;\n return this;\n }\n\n enable () {\n this._enabled = true;\n return this;\n }\n\n isEnabled () {\n return this._enabled;\n }\n\n /**\n * Applies the interaction effect on the chart. This is where the implemntation of the side effect is defined.\n *\n * @param {Object} selectionSet Contains the entry and exit set of data which got affected during interaction.\n * @param {Object} selectionSet.mergedEnter Combined previous entry and new entry set.\n * @param {DataModel} selectionSet.mergedEnter.model Instance of data model containing all rows which got\n * affected during interaction.\n * @param {Array} selectionSet.mergedEnter.uids Ids of all rows which were affected during interaction.\n * @param {Object} selectionSet.mergedExit Combined previous exit and new exit set.\n * @param {DataModel} selectionSet.mergedExit.model Instance of data model containing rows which were not affected\n * during interaction.\n * @param {Array} selectionSet.mergedExit.uids Ids of all rows which were not affected during interaction.\n * @param {Object} selectionSet.entrySet Entry set information.\n * @param {Array} selectionSet.entrySet[0].uids All row ids which got affected during previous interaction.\n * @param {Array} selectionSet.entrySet[1].uids All row ids which got affected during current interaction.\n * @param {Array} selectionSet.exitSet[0].uids All row ids which were not affected during previous interaction.\n * @param {Array} selectionSet.exitSet[1].uids All row ids which were not affected during current interaction.\n * @param {Object} payload Payload information of the behavioural action on trigger of which this side effect\n * is applied.\n * @param {Object} options Optional information for side effect like strategy, etc.\n */\n apply () {\n return this;\n }\n\n /**\n * Adds a new strategy method for this side effect. The strategy method is implemented by side effect class.\n *\n * @param {string} name Name of the strategy.\n * @param {Function} fn Strategy method.\n *\n * @return {GenericSideEffect} Instance of side effect.\n */\n setStrategy (name, fn) {\n if (fn) {\n this._strategies[name] = fn;\n }\n return this;\n }\n\n sourceInfo (...sourceInfo) {\n if (sourceInfo.length) {\n this._sourceInfo = sourceInfo[0];\n return this;\n }\n return this._sourceInfo();\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers();\n }\n\n plotPointsFromIdentifiers (...params) {\n if (params.length && params[0] instanceof Function) {\n this._plotPointsFromIdentifiers = params[0];\n return this;\n }\n return this._plotPointsFromIdentifiers(...params);\n }\n}\n","import GenericSideEffect from './generic';\n\n/**\n * This class is inherited by all side effects which changes the look of any existing elements in the visualization.\n * For example, if a side effect wants to change the color of bar plots, then it is a surrogate side effect.\n *\n * To use this,\n * ```\n * const SurrogateSideEffect = muze.SideEffects.standards.SurrogateSideEffect;\n *\n * class BarColorChanger extends SurrogateSideEffect {\n * static formalName () {\n * return 'colorChanger';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n *\n * @module SurrogateSideEffect\n * @class\n * @extends GenericSideEffect\n */\nexport default class SurrogateSideEffect extends GenericSideEffect {\n /**\n * Applies or removes interaction styles from plot elements. An array of row ids needs to be passed\n * which identifies the plot elements and applies styles to them.\n *\n * To apply the interaction style,\n * ```\n * const entryRowIds = entrySet[0].uids;\n * const interactionStyle = [{\n * type: 'fill',\n * intensity: [0, 0, 15, 0] // hsla configuration\n * }];\n *\n * this.applyInteractionStyle(entryRowIds, interactionStyle, 'brighten', true);\n * ```\n * @public\n * @param {Array} set Array of row ids.\n * @param {Array} config Style configuration.\n * @param {Object} config[0] fill or stroke configuration.\n * @param {string} config[0].type Type of style - fill or stroke.\n * @param {Array} config[0].intensity hsla configuration.\n * @param {string} interactionType Type of interaction. This is needed for storing the styles for\n * each type of interaction in the plot elements.\n * @param {boolean} apply Whether to apply or remove the interaction style.\n *\n * @return {SurrogateSideEffect} Instance of surrogate side effect.\n */\n applyInteractionStyle (set, config = {}, layers) {\n const { interactionType, apply, reset = false } = config;\n const allLayers = layers || this.firebolt.context.layers();\n allLayers.forEach((layer) => {\n const { interactive } = layer.config();\n if (interactive !== false) {\n const layerFields = layer.data().getFieldsConfig();\n const filteredUids = set.uids.filter(([, measures = []]) => measures.every(m => m in layerFields))\n .map(d => d[0]);\n const options = { apply, reset, styles: null };\n layer.applyInteractionStyle(interactionType, filteredUids, options);\n }\n });\n return this;\n }\n}\n","import { makeElement } from 'muze-utils';\n\nimport GenericSideEffect from './generic';\n\n/**\n * Any side effect which will add any new element to the chart like drawing a rectangular box or any annotation over\n * the chart needs to inherit this class. This class has methods which returns the container where the dom elements\n * needs to be created.\n *\n * To use this,\n * ```\n * const SpawnableSideEffect = muze.SideEffects.standards.SpawnableSideEffect;\n *\n * class SelectionBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'selectionBox';\n * }\n *\n * // Implement the logic of applying the style here.\n * apply () {\n * }\n * }\n * ```\n * @public\n * @class\n * @extends GenericSideEffect\n * @module SpawnableSideEffect\n */\nexport default class SpawnableSideEffect extends GenericSideEffect {\n /**\n * Creates a html or svg element in the container.\n *\n * @public\n * @param {SVGElement|HTMLElement} container Container where the dom element will be rendered.\n * @param {string} elemType Type of dom element.\n * @param {Array} data Array of objects with which the dom elements will be binded.\n * @param {string} className class name of the element.\n *\n * @return {Selection} D3 Selection of the element.\n */\n createElement (container, elemType, data, className, callbacks) {\n return makeElement(container, elemType, data, className, callbacks);\n }\n\n /**\n * Returns the drawing information for side effect like svg container, dimensions of the visual unit.\n *\n * @public\n * @return {Object} Drawing information for side effect.\n * ```\n * sideEffectGroup: // svg container where the side effect needs to be appended.\n * svgContainer: // svg container of the {@link VisualUnit}.\n * htmlContainer: // html div container of the {@link VisualUnit}.\n * width: // Width of the {@link VisualUnit}\n * height: // Height of the {@link VisualUnit}\n * ```\n */\n drawingContext (...drawingContext) {\n if (drawingContext.length) {\n this._drawingContext = drawingContext[0];\n return this;\n }\n return this._drawingContext();\n }\n\n show () {\n return this;\n }\n\n hide () {\n return this;\n }\n}\n","import { selectElement } from 'muze-utils';\n\nexport const getBoxDimensionsFromPayload = (payload, axes, axisFields) => {\n let x1;\n let x2;\n let y1;\n let y2;\n let xRange;\n let yRange;\n const criteria = payload.criteria;\n const dimensions = payload.dimensions || {};\n const { x: xDim, y: yDim } = dimensions;\n\n if (!criteria) return null;\n\n if (axes.x && axes.y) {\n const xAxis = axes.x[0];\n const yAxis = axes.y[0];\n const xLinear = xAxis.constructor.type() === 'linear';\n const yLinear = yAxis.constructor.type() === 'linear';\n const xField = `${axisFields.x[0]}`;\n const yField = `${axisFields.y[0]}`;\n const xCriteria = criteria[xField];\n const yCriteria = criteria[yField];\n\n if (xCriteria && xCriteria[0] instanceof Array) {\n xRange = xCriteria[0];\n yRange = xCriteria[1];\n } else {\n xRange = xCriteria || [];\n yRange = yCriteria || [];\n }\n\n if (xRange && xRange.length) {\n const domain = xAxis.domain();\n const bandScale = xAxis.constructor.type() === 'band';\n let x1Val = xRange[0];\n let x2Val = xRange[xRange.length - 1];\n\n if (bandScale) {\n let x1DomainIndex = domain.indexOf(xRange[0]);\n let x2DomainIndex = domain.indexOf(xRange[xRange.length - 1]);\n [x1DomainIndex, x2DomainIndex] = [x1DomainIndex, x2DomainIndex].sort((a, b) => a - b);\n x1Val = domain[x1DomainIndex];\n x2Val = domain[x2DomainIndex];\n }\n\n x1 = xAxis.getScaleValue(x1Val);\n x2 = xAxis.getScaleValue(x2Val);\n x2 += bandScale ? xAxis.getUnitWidth() : 0;\n }\n\n if (yRange && yRange.length) {\n const domain = yAxis.domain();\n const bandScale = yAxis.constructor.type() === 'band';\n let y1Val = yRange[0];\n let y2Val = yRange[yRange.length - 1];\n\n if (bandScale) {\n let y1DomainIndex = domain.indexOf(yRange[0]);\n let y2DomainIndex = domain.indexOf(yRange[yRange.length - 1]);\n [y1DomainIndex, y2DomainIndex] = [y1DomainIndex, y2DomainIndex].sort(((a, b) => b - a));\n y1Val = domain[y1DomainIndex];\n y2Val = domain[y2DomainIndex];\n }\n\n y1 = yAxis.getScaleValue(y1Val);\n y2 = yAxis.getScaleValue(y2Val);\n y2 += yAxis.constructor.type() === 'band' ? yAxis.getUnitWidth() : 0;\n }\n\n if ((yLinear && xLinear) || !payload.dragEnd) {\n if (xDim) {\n [x1, x2] = xDim;\n }\n if (yDim) {\n [y1, y2] = yDim;\n }\n }\n }\n\n return {\n dimension: {\n x1,\n x2,\n y1,\n y2\n },\n direction: 'both'\n };\n};\n\nexport const changeVisibility = (context, sideEffectGroup, visible) => {\n const config = context.config();\n const className = config.defClassName;\n const classPrefix = config.classPrefix;\n selectElement(sideEffectGroup).selectAll(`.${classPrefix}-${className}`)\n .style('display', visible ? 'block' : 'none');\n};\n","import {\n getQualifiedClassName,\n selectElement,\n makeElement,\n isValidValue\n} from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport './styles.scss';\nimport SpawnableSideEffect from '../spawnable';\nimport { selectionBoxDrag } from '../../actions/physical/selection-box-drag';\nimport { getBoxDimensionsFromPayload, changeVisibility } from './helper';\nimport { BEHAVIOURS } from '../..';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\nclass SelectionBox extends SpawnableSideEffect {\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n defClassName: 'selection-box-group',\n className: '',\n classPrefix: CLASSPREFIX,\n box: {\n defClassName: 'selection-box',\n className: ''\n },\n transition: {\n duration: 200\n },\n persistent: false\n };\n }\n\n static formalName () {\n return 'selectionBox';\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n * @param {Object} dimension Dimensions of the selection box.\n * @param {number} dimension.x1 Starting x position\n * @param {number} dimension.x2 Ending x position\n * @param {number} dimension.y1 Starting y position\n * @param {number} dimension.y2 Ending y position\n * @param {Object} conf Configuration needed to draw the selection box\n * @param {number} unitWidth Width of the visual unit.\n * @param {number} unitHeight Height of the visual unit.\n */\n apply (selectionSet, payload) {\n let x = 0;\n let y = 0;\n let width;\n let height;\n const config = this._config;\n const boxConf = config.box;\n const firebolt = this.firebolt;\n const drawingInf = this.drawingContext();\n const mountPoint = drawingInf.sideEffectGroup;\n const unitWidth = drawingInf.width;\n const unitHeight = drawingInf.height;\n const classPrefix = config.classPrefix;\n const selectionGroupClassName = config.defClassName;\n\n width = unitWidth;\n height = unitHeight;\n\n // Hide selection-box on dragEnd or when criteria is empty\n if (!payload.criteria || (payload.dragEnd && !config.persistent)) {\n this.hide(drawingInf);\n return this;\n }\n\n const sourceInf = this.sourceInfo();\n const { dimension, direction } =\n getBoxDimensionsFromPayload(payload, sourceInf.axes, sourceInf.fields);\n const transition = payload.dragEnd && config.transition;\n\n if (direction === 'both') {\n x = Math.min(dimension.x1, dimension.x2);\n y = Math.min(dimension.y1, dimension.y2);\n width = Math.abs(dimension.x2 - dimension.x1);\n height = Math.abs(dimension.y2 - dimension.y1);\n }\n\n this.show(drawingInf);\n // Create the data array for drawing the rectangle\n const points = [\n {\n x,\n y,\n width,\n height\n }\n ];\n // Create the container group for selection box.\n const selectionGroup = makeElement(selectElement(mountPoint), 'g', [1],\n `.${classPrefix}-${selectionGroupClassName}`);\n const sideEffect = this;\n const selection = selectionGroup.selectAll('rect').data(points);\n const selectionBox = selection.enter().append('rect')\n .each(function () {\n firebolt.registerPhysicalBehaviouralMap({\n selectiondrag: {\n behaviours: [BEHAVIOURS.BRUSH]\n }\n });\n selectionBoxDrag(firebolt)(selectElement(this), ['brush'], sideEffect);\n })\n .merge(selection)\n .each(function (attrs) {\n let element = selectElement(this);\n transition && (element = element.transition().duration(transition.duration));\n for (const key in attrs) {\n if ({}.hasOwnProperty.call(attrs, key)) {\n isValidValue(attrs[key]) && element.attr(key, attrs[key]);\n }\n }\n });\n // Get the qualified class name for selection box rectangle\n const boxClassName = getQualifiedClassName(boxConf.defClassName, this._id, classPrefix);\n selectionBox.classed(boxClassName.join(' '), true);\n selectionBox.classed(boxConf.className, true);\n\n return this;\n }\n\n hide (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, false);\n }\n\n show (drawingInf) {\n changeVisibility(this, drawingInf.sideEffectGroup, true);\n }\n}\n\nexport default SelectionBox;\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\nimport getDragActionConfig from './helpers/drag-action-config';\nimport { ACTIONS } from '../..';\n\nexport const selectionBoxDrag = firebolt => (targetEl) => {\n let subject;\n let drawingInf;\n const context = firebolt.context;\n const onDrag = (payload) => {\n firebolt.triggerPhysicalAction(ACTIONS.SELECTIONDRAG, payload);\n };\n const d3Drag = getD3Drag();\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n drawingInf = context.getDrawingContext();\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n subject.x += event.dx;\n subject.y += event.dy;\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(firebolt, {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n });\n onDrag(payload);\n }\n }).on('end', () => {\n const width = drawingInf.width;\n const height = drawingInf.height;\n const x = Math.min(width - subject.width, Math.max(subject.x, 0));\n const y = Math.min(height - subject.height, Math.max(subject.y, 0));\n const y2 = y + subject.height;\n const x2 = x + subject.width;\n\n if (x >= 0 && x2 <= width && y >= 0 && y2 <= height) {\n const payload = getDragActionConfig(firebolt, {\n startPos: {\n x,\n y\n },\n endPos: {\n x: x2,\n y: y2\n }\n });\n payload.dragEnd = true;\n onDrag(payload);\n }\n }));\n};\n","export const CLASSPREFIX = 'muze';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const NULL = 'null';\nexport const UNDEFINED = 'undefined';\n","import { CLASSPREFIX } from './constants';\n\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'tooltip-box',\n parentClassName: 'tooltip-parent-container',\n connectorClassName: 'tooltip-connectors',\n className: '',\n row: {\n margin: 0\n },\n spacing: 5,\n content: {\n spacing: 5,\n iconContainerSize: 10,\n iconScale: 1,\n iconShape: 'circle',\n iconColor: '#ff0000',\n rowMargin: '4px 0 4px 0',\n margin: 10,\n separator: ':',\n className: 'tooltip-content-container',\n parentClassName: 'tooltip-content-parent-container'\n },\n arrow: {\n size: 10,\n disabled: false,\n defClassName: 'tooltip-arrow',\n className: '',\n color: 'rgba(195,195,195,0.85)'\n }\n};\n","export const CLASSPREFIX = 'muze';\nexport const ARROW_RIGHT = 'right';\nexport const ARROW_TOP = 'top';\nexport const ARROW_BOTTOM = 'bottom';\nexport const ARROW_LEFT = 'left';\nexport const TOOLTIP_LEFT = 'left';\nexport const TOOLTIP_RIGHT = 'right';\nexport const TOOLTIP_BOTTOM = 'bottom';\nexport const TOOLTIP_TOP = 'top';\nexport const INITIAL_STYLE = {\n position: 'absolute',\n width: 0,\n height: 0\n};\nexport const TABLE_FORMAT = 'table';\n","import {\n selectElement,\n mergeRecursive,\n makeElement,\n setAttrs,\n setStyles,\n getSymbol,\n isSimpleObject\n} from 'muze-utils';\nimport { TABLE_FORMAT } from './constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class is used to manage the content of tooltip.\n */\nexport default class Content {\n /**\n * Creates an instance of content.\n */\n constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n const config = defaultConfig.content;\n config.classPrefix = defaultConfig.classPrefix;\n return config;\n }\n\n config (...c) {\n if (c.length > 0) {\n this._config = mergeRecursive(this._config, c[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Update model. The format contains presentation strategy which determines how to show the content.\n * If no strategy is mentioned then default is to show key value pair\n */\n update (item) {\n this._model = item.model;\n this._formatter = item.formatter;\n return this;\n }\n\n context (ctx) {\n this._context = ctx;\n return this;\n }\n\n render (mount) {\n let data;\n const config = this._config;\n const iconContainerSize = config.iconContainerSize;\n const formatter = this._formatter;\n const rowMargin = config.rowMargin;\n const model = this._model;\n const { classPrefix } = config;\n\n this._mount = mount;\n if (model instanceof Array) {\n data = model;\n } else {\n data = formatter(this._model, this.config(), this._context);\n }\n\n if (data instanceof Function) {\n const mountHtmlTooltip = makeElement(mount, 'div', [1], `${classPrefix}-tooltip-html-container`);\n mountHtmlTooltip.html(data());\n } else {\n let content = data;\n let displayFormat = 'default';\n\n if (isSimpleObject(data)) {\n content = data.content;\n displayFormat = data.displayFormat;\n }\n\n const body = makeElement(mount, 'div', [displayFormat], `${classPrefix}-tooltip-content`, {},\n d => d);\n\n if (displayFormat === TABLE_FORMAT) {\n const table = makeElement(body, 'table', [1], `${classPrefix}-tooltip-table`);\n const tbody = makeElement(table, 'tbody', [1], `${classPrefix}-tooltip-table-tbody`);\n const rows = makeElement(tbody, 'tr', content, `${classPrefix}-tooltip-table-row`);\n rows.each(function (d, i) {\n selectElement(this).classed(`${classPrefix}-tooltip-table-row-${i}`, true);\n });\n const cells = makeElement(rows, 'td', d => d, `${classPrefix}-tooltip-table-cell`);\n cells.each(function (d) {\n selectElement(this).html(d);\n });\n } else {\n const rows = makeElement(body, 'div', content, '', {\n update: (elem, elemData) => elem.attr('class', elemData.className)\n });\n const cells = makeElement(rows, 'span', d => d.data, `${classPrefix}-tooltip-content`);\n cells.attr('class', `${classPrefix}-tooltip-content`);\n setStyles(rows, {\n margin: rowMargin\n });\n setStyles(cells, {\n display: 'inline-block' // 'margin-right': `${config.spacing}px`\n });\n\n cells.each(function (d) {\n const el = selectElement(this);\n el.html('');\n if (d instanceof Object) {\n if (d.type === 'icon') {\n const svg = makeElement(el, 'svg', [1]);\n const path = makeElement(svg, 'path', [1]);\n const shape = d.shape instanceof Function ? d.shape : getSymbol(d.shape);\n\n setAttrs(svg, {\n x: 0,\n y: 0,\n width: iconContainerSize,\n height: iconContainerSize\n });\n setAttrs(path, {\n d: shape.size(d.size)(),\n transform: `translate(${iconContainerSize / 2}, ${iconContainerSize / 2})`\n });\n setStyles(path, {\n fill: d.color\n });\n setStyles(svg, {\n width: `${iconContainerSize}px`,\n height: `${iconContainerSize}px`\n });\n } else {\n el.html(d.value);\n d.className && el.classed(d.className, true);\n setStyles(el, d.style);\n }\n } else {\n el.html(d);\n }\n });\n }\n }\n return this;\n }\n\n clear () {\n this._model = null;\n return this;\n }\n}\n","import {\n mergeRecursive,\n getQualifiedClassName,\n getUniqueId,\n selectElement,\n makeElement,\n getMaxPoint\n} from 'muze-utils';\nimport { ARROW_BOTTOM, ARROW_LEFT, ARROW_RIGHT, TOOLTIP_LEFT, TOOLTIP_RIGHT, TOOLTIP_BOTTOM,\n TOOLTIP_TOP } from './constants';\nimport { defaultConfig } from './default-config';\nimport { reorderContainers } from './helper';\nimport './styles.scss';\nimport Content from './content';\n\n/**\n * This component is responsible for creating a tooltip element. It appends the tooltip\n * in the body element.\n * @class Tooltip\n */\nexport default class Tooltip {\n /**\n * Initializes the tooltip with the container element and configuration\n * @param {HTMLElement} container container where the tooltip will be mounted.\n * @param {string} className Class name of the tooltip.\n */\n constructor (htmlContainer, svgContainer) {\n let connectorContainer = svgContainer;\n this._id = getUniqueId();\n this._config = {};\n this.config({});\n const tooltipConf = this._config;\n const classPrefix = tooltipConf.classPrefix;\n const contentClass = tooltipConf.content.parentClassName;\n const container = makeElement(htmlContainer, 'div', [1], `${classPrefix}-tooltip-container`);\n this._container = container;\n this._tooltipContainer = container.append('div').style('position', 'absolute');\n this._contentContainer = this._tooltipContainer.append('div').attr('class',\n `${classPrefix}-${tooltipConf.defClassName} ${classPrefix}-${contentClass}\n ${tooltipConf.className}`);\n\n if (!svgContainer) {\n connectorContainer = htmlContainer.append('svg').style('pointer-events', 'none');\n }\n\n this._contents = {};\n this._tooltipConnectorContainer = selectElement(connectorContainer)\n .append('g')\n .attr('class', `${tooltipConf.classPrefix}-${tooltipConf.connectorClassName}`);\n const id = this._id;\n const defClassName = tooltipConf.parentClassName;\n const qualifiedClassName = getQualifiedClassName(defClassName, id, tooltipConf.classPrefix);\n\n this.addClass(qualifiedClassName.join(' '));\n this.hide();\n }\n\n /**\n * Sets the configuration of tooltip.\n * @param {Object} config Configuration of tooltip\n * @return {Tooltip} Instance of tooltip\n */\n config (...config) {\n if (config.length > 0) {\n const defConf = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConf, config[0]);\n return this;\n }\n return this._config;\n }\n\n /**\n * Returns the default configuration of tooltip\n * @return {Object} Configuration of tooltip.\n */\n static defaultConfig () {\n return defaultConfig;\n }\n /**\n * Sets the class name of tooltip\n * @param {string} className tooltip class name\n * @return {Tooltip} Instance of tooltip.\n */\n addClass (className) {\n this._tooltipContainer.classed(className, true);\n return this;\n }\n\n context (...ctx) {\n if (ctx.length) {\n this._context = ctx[0];\n return this;\n }\n return this._context;\n }\n\n content (name, data, contentConfig = {}) {\n const config = this.config();\n const { classPrefix } = config;\n const contentClass = config.content.className;\n const formatter = config.formatter;\n const className = `${classPrefix}-${contentClass}-${name}`;\n const specificClass = `${classPrefix}-${contentConfig.className}`;\n const content = this._contents[name] = this._contents[name] || new Content();\n const container = makeElement(this._contentContainer, 'div', [contentConfig.order], className);\n container.attr('class', `${classPrefix}-${contentClass} ${className} ${specificClass}`);\n reorderContainers(this._contentContainer, `.${classPrefix}-${contentClass}`);\n const contentConf = config.content;\n contentConfig.classPrefix = this._config.classPrefix;\n content.config(contentConf);\n\n if (data === null) {\n content.clear();\n container.remove();\n delete this._contents[name];\n } else {\n content.update({\n model: data,\n formatter: contentConfig.formatter || formatter\n });\n content.context(this._context);\n content.render(container);\n }\n\n if (!Object.keys(this._contents).length) {\n this.hide();\n }\n return this;\n }\n\n getContents () {\n return Object.values(this._contents);\n }\n\n /**\n * Positions the tooltip at the given x and y position.\n * @param {number} x x position\n * @param {number} y y position\n * @return {Tooltip} Instance of tooltip.\n */\n position (x, y) {\n if (!Object.keys(this._contents).length) {\n this.hide();\n return this;\n }\n this.show();\n const target = this._target;\n\n if (target) {\n const node = this._tooltipContainer.node();\n const tooltipPos = this._orientation;\n const outsidePlot = tooltipPos === TOOLTIP_LEFT || tooltipPos === TOOLTIP_RIGHT ?\n (y + node.offsetHeight) < target.y || y > (target.y + target.height) :\n (x + node.offsetWidth) < target.x || x > (target.x + target.width);\n\n if (outsidePlot) {\n let path;\n this._tooltipConnectorContainer.style('display', 'block');\n const connector = this._tooltipConnectorContainer.selectAll('path').data([1]);\n const enter = connector.enter().append('path');\n if (tooltipPos === ARROW_LEFT) {\n path = `M ${x} ${y + node.offsetHeight / 2} L ${target.x + target.width}`\n + ` ${target.y + target.height / 2}`;\n } else if (tooltipPos === ARROW_RIGHT) {\n path = `M ${x + node.offsetWidth} ${y + node.offsetHeight / 2}`\n + ` L ${target.x} ${target.y + target.height / 2}`;\n } else if (tooltipPos === ARROW_BOTTOM) {\n path = `M ${x + node.offsetWidth / 2} ${y + node.offsetHeight}`\n + ` L ${target.x + target.width / 2} ${target.y}`;\n }\n enter.merge(connector).attr('d', path).style('display', 'block');\n } else {\n this._tooltipConnectorContainer.style('display', 'none');\n }\n }\n\n const offset = this._offset || {\n x: 0,\n y: 0\n };\n this._tooltipContainer.style('left', `${offset.x + x}px`).style('top',\n `${offset.y + y}px`);\n\n return this;\n }\n\n /**\n * Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the\n * boundaries.\n * @param {Object} dim Dimensions of the plot.\n */\n positionRelativeTo (dim, tooltipConf = {}) {\n let obj;\n const orientation = tooltipConf.orientation;\n this.show();\n if (!dim) {\n this.hide();\n return this;\n }\n\n const extent = this._extent;\n const contentContainer = this._contentContainer.node();\n this._tooltipContainer.style('top', '0px')\n .style('left', '0px')\n .style('width', '2000px')\n .style('height', '2000px');\n\n const offsetWidth = contentContainer.offsetWidth + 4;\n const offsetHeight = contentContainer.offsetHeight + 4;\n const config = this._config;\n const offset = this._offset;\n const spacing = config.spacing;\n const draw = tooltipConf.draw !== undefined ? tooltipConf.draw : true;\n const topSpace = dim.y;\n // When there is no space in right\n const dimX = dim.x + dim.width + offset.x;\n const rightSpace = extent.width - dimX;\n const leftSpace = dim.x + offset.x - extent.x;\n const bottomSpace = extent.height - (dim.y + dim.height + offset.y);\n const arrowSize = spacing;\n const tooltipHeight = offsetHeight + arrowSize;\n const tooltipWidth = offsetWidth + arrowSize;\n\n const spaces = [{\n position: 'top',\n value: topSpace - tooltipHeight\n }, {\n position: 'right',\n value: rightSpace - tooltipWidth\n }, {\n position: 'left',\n value: leftSpace - tooltipWidth\n }, {\n position: 'bottom',\n value: bottomSpace - tooltipHeight\n }];\n\n const positionHorizontal = (positionVal) => {\n let position;\n let x = dim.x + dim.width;\n let y = dim.y;\n\n if (positionVal === 'right') {\n position = TOOLTIP_LEFT;\n x += arrowSize;\n } else if (positionVal === 'left') {\n x = dim.x - offsetWidth;\n position = TOOLTIP_RIGHT;\n x -= arrowSize;\n }\n\n if (dim.height < offsetHeight) {\n y = Math.max(0, dim.y + dim.height / 2 - offsetHeight / 2);\n }\n\n return {\n position,\n x,\n y\n };\n };\n\n const positionVertical = (positionVal) => {\n let position;\n let y;\n // Position tooltip at the center of plot\n let x = dim.x - offsetWidth / 2 + dim.width / 2;\n\n // Overflows to the right\n if ((extent.width - (dim.x + offset.x)) < offsetWidth) {\n x = extent.width - offsetWidth - offset.x;\n } else if ((x + offset.x) < extent.x) { // Overflows to the left\n x = extent.x;\n }\n\n if (positionVal === 'top') {\n y = dim.y - offsetHeight - arrowSize;\n position = TOOLTIP_BOTTOM;\n } else {\n y = dim.y + dim.height + arrowSize;\n position = TOOLTIP_TOP;\n }\n\n return {\n position,\n x,\n y\n };\n };\n\n this._target = dim;\n\n const hMax = getMaxPoint(spaces.filter(d => d.position === 'left' || d.position === 'right'),\n 'value');\n const vMax = getMaxPoint(spaces.filter(d => d.position === 'top' || d.position === 'bottom'),\n 'value');\n if (!orientation) {\n if (hMax.value > 0) {\n const position = hMax.position;\n obj = positionHorizontal(position);\n } else {\n const position = vMax.position;\n obj = positionVertical(position);\n }\n } else if (orientation === 'horizontal') {\n const position = hMax.position;\n obj = positionHorizontal(position);\n } else {\n const position = vMax.position;\n obj = positionVertical(position);\n }\n\n this._position = {\n x: obj.x,\n y: obj.y\n };\n\n this._tooltipContainer.style('height', `${offsetHeight}px`)\n .style('width', `${offsetWidth}px`);\n this._orientation = obj.position;\n draw && this.position(obj.x, obj.y);\n return this;\n }\n\n /**\n * Hides the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n hide () {\n this._tooltipContainer.style('display', 'none');\n this._tooltipConnectorContainer.style('display', 'none');\n return this;\n }\n\n /**\n * Shows the tooltip element.\n * @return {Tooltip} Instance of tooltip.\n */\n show () {\n this._tooltipContainer.style('display', 'block');\n return this;\n }\n\n extent (extent) {\n this._extent = extent;\n return this;\n }\n\n offset (offset) {\n this._offset = offset;\n return this;\n }\n\n remove () {\n this._tooltipContainer.remove();\n this._tooltipConnectorContainer.remove();\n return this;\n }\n}\n","export const reorderContainers = (parentContainer, className) => {\n parentContainer.selectAll(className).sort((a, b) => a - b);\n};\n","export const SELECTION_SUMMARY = 'selectionSummary';\nexport const HIGHLIGHT_SUMMARY = 'highlightSummary';\n","import {\n FieldType,\n GROUP_BY_FUNCTIONS,\n formatTemporal,\n DimensionSubtype,\n MeasureSubtype,\n DataModel,\n defaultValue,\n retrieveFieldDisplayName,\n nestCollection,\n getObjProp,\n intersect,\n ReservedFields\n} from 'muze-utils';\nimport { TABLE_FORMAT } from '@chartshq/muze-tooltip';\nimport { SELECTION_SUMMARY, HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\nimport { BAR } from '../../../../visual-group/src/enums/constants';\nimport { NULL, UNDEFINED } from '../../enums/constants';\n\nconst { SUM, COUNT } = GROUP_BY_FUNCTIONS;\nconst { InvalidAwareTypes } = DataModel;\nconst FIRST_VALUE_MARGIN = '10px';\nconst STACK = 'stack';\nconst SINGLE_DATA_MARGIN = 10;\nconst defNumberFormat = value => `${value % value.toFixed(0) === 0 ? value : value.toFixed(2)}`;\n\nconst formatters = (formatter, interval, valueParser) => ({\n [DimensionSubtype.TEMPORAL]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatTemporal(Number(value), interval)),\n [MeasureSubtype.CONTINUOUS]: value => (value instanceof InvalidAwareTypes ? valueParser(value) :\n formatter(defNumberFormat(value))),\n [DimensionSubtype.CATEGORICAL]: value => valueParser(value)\n});\n\nconst getTabularData = (dataObj, fieldInf) => {\n const rows = [];\n const { data, schema } = dataObj;\n rows.push(schema.map(d => fieldInf[d.name].displayName));\n\n data.forEach((d) => {\n const row = [];\n schema.forEach((fieldObj, i) => {\n const value = fieldInf[fieldObj.name].fn(d[i]);\n row.push(value);\n });\n rows.push(row);\n });\n return rows;\n};\n\nconst isSingleValue = (dataLen, stackedSum) => dataLen === 1 && !stackedSum;\n\nconst getStackedKeyValue = (params) => {\n const { field, value, classPrefix } = params;\n return ({\n className: `${classPrefix}-tooltip-stacked-row`,\n data: [{\n value: field,\n className: `${classPrefix}-tooltip-stacked-row-key`\n }, {\n value: `${value}`,\n className: `${classPrefix}-tooltip-stacked-row-value`\n }]\n });\n};\n\nconst getKeyValue = (params) => {\n const { field, value, classPrefix, margin, isSelected, removeKey, stackedSum, isStackedBar } = params;\n let { stackedValue } = params;\n\n if (!removeKey) {\n const keyObj = {\n value: field,\n className: `${classPrefix}-tooltip-key`\n };\n const valueObj = {\n value,\n className: `${classPrefix}-tooltip-value`\n };\n\n if (stackedValue === NULL || stackedValue === UNDEFINED) {\n stackedValue = 0;\n }\n\n const stackedValueObj = {\n value: stackedSum ? `(${(stackedValue * 100 / stackedSum).toFixed(2)} %)` : undefined,\n className: `${classPrefix}-tooltip-stacked-percentage`\n };\n\n if (margin !== undefined) {\n keyObj.style = {\n 'margin-left': `${margin}px`\n };\n valueObj.style = {\n 'margin-left': `${margin}px`\n };\n stackedValueObj.style = {\n 'margin-left': `${margin}px`\n };\n }\n\n return ({\n className: isSelected ? `${classPrefix}-tooltip-row ${classPrefix}-tooltip-selected-row`\n : `${classPrefix}-tooltip-row`,\n data: stackedSum && isStackedBar ? [keyObj, stackedValueObj, valueObj] : [keyObj, valueObj]\n });\n }\n return ({\n data: [{\n className: '',\n value,\n style: {\n 'margin-left': FIRST_VALUE_MARGIN\n }\n }],\n className: `${classPrefix}-tooltip-first`\n });\n};\n\nexport const getStackedSum = (values, index) => values.reduce((a, b) => {\n if (b[index] instanceof InvalidAwareTypes) {\n return a + 0;\n }\n return a + b[index];\n}, 0);\n\nexport const isStackedChart = layers => layers.some(d => d.transformType() === STACK);\nexport const isStackedBarChart = layers => layers.some(d => d.transformType() === STACK && d.config().mark === BAR);\n\nconst generateRetinalFieldsValues = (valueArr, retinalFields, content, context) => {\n const {\n fieldsConfig,\n dimensionMeasureMap,\n axes,\n config,\n fieldInf,\n dataLen,\n target,\n stackedSum,\n isStackedBar\n } = context;\n const { classPrefix, margin, separator } = config;\n const colorAxis = axes.color[0];\n const shapeAxis = axes.shape[0];\n const sizeAxis = axes.size[0];\n const REF_VALUES_INDEX = 1;\n const REF_KEYS_INDEX = 0;\n\n for (const retField in retinalFields) {\n const retIndex = fieldsConfig[retField].index;\n const retinalFieldValue = valueArr[retIndex];\n const measuresArr = dimensionMeasureMap[retField];\n const icon = {\n type: 'icon',\n color: colorAxis.getColor(retinalFieldValue),\n size: sizeAxis.config().value,\n shape: shapeAxis.getShape(retinalFieldValue)\n };\n const { displayName, fn } = fieldInf[retField];\n const formattedRetinalValue = fn(retinalFieldValue);\n\n if (isSingleValue(dataLen, stackedSum)) {\n content.push(getKeyValue({\n field: displayName,\n value: formattedRetinalValue,\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n } else {\n const hasMultipleMeasures = measuresArr.length > 1;\n hasMultipleMeasures && (content.push({ data: [icon, formattedRetinalValue] }));\n const selectedContext = target && target[REF_VALUES_INDEX][target[REF_KEYS_INDEX].indexOf(retField)];\n const isSelected = selectedContext === retinalFieldValue;\n\n measuresArr.forEach((measure) => {\n const measureIndex = fieldsConfig[measure].index;\n const { displayName: dName, fn: formatterFn } = fieldInf[measure];\n const currentMeasureValue = valueArr[measureIndex];\n const value = formatterFn(currentMeasureValue);\n const keyValue = getKeyValue({\n field: hasMultipleMeasures ? `${dName}${separator}` : formattedRetinalValue,\n value,\n classPrefix,\n margin: hasMultipleMeasures ? margin : undefined,\n isSelected,\n stackedSum,\n stackedValue: currentMeasureValue instanceof InvalidAwareTypes\n ? currentMeasureValue.value()\n : currentMeasureValue.toFixed(2),\n isStackedBar\n });\n\n if (!hasMultipleMeasures) {\n keyValue.data = [icon, ...keyValue.data];\n }\n content.push(keyValue);\n });\n }\n }\n};\n\nconst getFieldInf = (schema, dataModel, context) => {\n const { valueParser, timeDiffs } = context;\n const fieldsObj = dataModel.getFieldspace().fieldsObj();\n const defFormatter = formatters(null, null, valueParser)[DimensionSubtype.CATEGORICAL];\n\n return schema.reduce((inf, field) => {\n const { subtype, name, type } = field;\n const interval = subtype === DimensionSubtype.TEMPORAL ? timeDiffs[name] : 0;\n const nf = type === FieldType.MEASURE ? fieldsObj[name].numberFormat() : val => val;\n inf[name] = {\n fn: defaultValue(formatters(nf, interval, valueParser)[subtype], defFormatter),\n displayName: `${retrieveFieldDisplayName(dataModel, name)}`\n };\n return inf;\n }, {});\n};\n\nexport const buildTooltipData = (dataModel, config = {}, context) => {\n let nestedDataObj;\n let fieldValues = [];\n const { data, schema } = dataModel.getData();\n const fieldspace = dataModel.getFieldspace();\n const fieldsConfig = dataModel.getFieldsConfig();\n const { color, shape, size } = context.retinalFields;\n const detailFields = context.detailFields || [];\n const { showStackSum = true } = context.config || {};\n const { selectedMeasures = [] } = context.payload;\n const dimensions = schema.filter(d => d.type === FieldType.DIMENSION);\n const measures = schema.filter(d => d.type === FieldType.MEASURE);\n const containsDetailField = !!intersect(schema, detailFields).length;\n const dataLen = data.length;\n const {\n dimensionMeasureMap,\n axes\n } = context;\n const fieldInf = getFieldInf(schema, dataModel, context);\n\n let displayFormat;\n if (dataLen > 1 && containsDetailField) {\n fieldValues = getTabularData({\n data,\n schema,\n fieldspace\n }, fieldInf);\n displayFormat = TABLE_FORMAT;\n } else {\n const retinalFields = [color.field, shape.field, size.field].reduce((acc, field) => {\n field && fieldsConfig[field].def.type === FieldType.DIMENSION && (acc[field] = 1);\n return acc;\n }, {});\n const filteredDimensions = dimensions.filter(field => !retinalFields[field.name]);\n const indices = filteredDimensions.map(dim => fieldsConfig[dim.name].index);\n const allMeasures = [...new Set(...Object.values(dimensionMeasureMap))];\n const isStacked = isStackedChart(context.layers);\n const isStackedBar = isStackedBarChart(context.layers);\n const filteredMeasures = !isSingleValue(dataLen, isStacked)\n ? measures.filter(d => allMeasures.indexOf(d.name) === -1)\n : measures;\n\n nestedDataObj = nestCollection({\n data,\n keys: indices\n });\n\n nestedDataObj = !('key' in nestedDataObj[0]) ? [{\n values: nestedDataObj\n }] : nestedDataObj;\n\n const generateTooltipContent = (nestedData, index = 0, content = []) => {\n const { classPrefix, separator } = config;\n for (let i = 0, len = nestedData.length; i < len; i++) {\n const { values, key } = nestedData[i];\n const field = getObjProp(schema, indices[index], 'name');\n const margin = dataLen === 1 || Object.keys(retinalFields).length === 0\n ? SINGLE_DATA_MARGIN : undefined;\n if (field) {\n const { displayName, fn } = fieldInf[field];\n const formattedValue = fn(key);\n const removeKey = !isSingleValue(dataLen, isStacked);\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n value: formattedValue,\n classPrefix,\n margin,\n isSelected: undefined,\n removeKey\n }));\n }\n\n if (values[0] && values[0].key) {\n generateTooltipContent(values, index + 1, content);\n } else {\n let stackedSum = 0;\n if (isStacked && showStackSum) {\n stackedSum = getStackedSum(\n values,\n fieldsConfig[measures[0].name].index\n );\n const nf = measures[0].numberFormat;\n content.push(getStackedKeyValue({\n field: `${'Total'}${separator}`,\n value: nf ? nf(stackedSum.toFixed(2)) : stackedSum.toFixed(2),\n classPrefix\n }));\n }\n for (let j = 0, len2 = values.length; j < len2; j++) {\n const valueArr = values[j];\n generateRetinalFieldsValues(valueArr, retinalFields, content, {\n fieldInf,\n axes,\n config,\n fieldsConfig,\n dimensionMeasureMap,\n dataLen,\n target: context.payload.target,\n stackedSum,\n isStackedBar\n });\n filteredMeasures.forEach((measure) => {\n const { name } = measure;\n const { displayName, fn } = fieldInf[name];\n content.push(getKeyValue({\n field: `${displayName}${separator}`,\n isSelected: selectedMeasures.indexOf(name) !== -1,\n value: fn(valueArr[fieldsConfig[name].index]),\n classPrefix,\n margin: SINGLE_DATA_MARGIN\n }));\n });\n }\n }\n }\n };\n generateTooltipContent(nestedDataObj, 0, fieldValues);\n }\n\n return {\n content: fieldValues,\n displayFormat\n };\n};\n\n/**\n * Calculate aggregated values of measures from entry set and datamodel.\n *\n * @param {DataModel} dm DataModel instance\n * @param {EntrySet} entrySet Entry set\n */\nconst getAggregatedValues = (dm, entrySet) => {\n const fields = entrySet.fields;\n const aggFns = entrySet.aggFns;\n // Create a map of all the dimensions and the measures\n const dimsMap = entrySet.uids.reduce((acc, v) => {\n const dims = v[2];\n\n !acc[dims] && (acc[dims] = []);\n acc[dims].push(v[1]);\n return acc;\n }, {});\n const aggMeasures = Object.keys(dm.getFieldspace().getMeasure());\n const aggregatedValues = {};\n aggMeasures.forEach((measure) => {\n // Filter all the rows which has this measure and dimensions and apply aggregation.\n const groupedDm = dm.select((dmFields, id) => {\n const row = `${fields.map(field => (field === ReservedFields.ROW_ID ? id :\n dmFields[field].internalValue))}`;\n const measures = dimsMap[row];\n if (measures) {\n return measures.find(arr => arr.indexOf(measure) !== -1);\n }\n return false;\n }, {\n saveChild: false\n }).groupBy([''], {\n [measure]: aggFns[measure] === COUNT ? SUM : aggFns[measure]\n }, {\n saveChild: false\n });\n const fieldsConfig = groupedDm.getFieldsConfig();\n if (!groupedDm.isEmpty()) {\n aggregatedValues[measure] = groupedDm.getData().data[0][fieldsConfig[measure].index];\n }\n });\n return aggregatedValues;\n};\n\nexport const strategies = {\n [SELECTION_SUMMARY]: (dm, config, context) => {\n const { selectionSet } = context;\n const { classPrefix } = config;\n const tooltipConf = context.config;\n const { showMultipleMeasures } = tooltipConf;\n const aggFns = selectionSet.mergedEnter.aggFns;\n const entryUids = selectionSet.mergedEnter.uids;\n const fieldsConf = dm.getFieldsConfig();\n const aggregatedValues = getAggregatedValues(dm, selectionSet.mergedEnter);\n const values = [{\n className: `${classPrefix}-tooltip-row`,\n data: [{\n value: `${entryUids.length}`,\n style: {\n 'font-weight': 'bold'\n }\n }, 'Items Selected']\n }];\n let measures = Object.keys(aggregatedValues);\n if (!showMultipleMeasures) {\n measures = measures.slice(0, 1);\n }\n // Prepare the tooltip content\n measures.forEach((measure) => {\n const { numberFormat = defNumberFormat } = fieldsConf[measure].def;\n const value = aggregatedValues[measure];\n const rowValues = value instanceof InvalidAwareTypes ? [] : [`(${aggFns[measure].toUpperCase()})`,\n `${retrieveFieldDisplayName(dm, measure)}:`,\n {\n value: numberFormat(value),\n style: {\n 'font-weight': 'bold'\n },\n className: `${classPrefix}-tooltip-value`\n }];\n if (showMultipleMeasures) {\n values.push({\n className: `${classPrefix}-tooltip-row`,\n data: rowValues\n });\n } else {\n values[0].data.push(...rowValues);\n }\n });\n\n return values;\n },\n [HIGHLIGHT_SUMMARY]: (data, config, context) => buildTooltipData(data, config, context)\n};\n","import { Tooltip as TooltipRenderer } from '@chartshq/muze-tooltip';\nimport { mergeRecursive, defaultValue } from 'muze-utils';\nimport { strategies } from './strategies';\nimport { TOOLTIP } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nimport './styles.scss';\nimport { HIGHLIGHT_SUMMARY } from '../../enums/tooltip-strategies';\n\nconst configResolvers = {\n [HIGHLIGHT_SUMMARY]: (specificConf, config) => defaultValue(specificConf, config),\n default: specificConf => defaultValue(specificConf, {})\n};\n\nconst sanitizeConfig = (config, context) => {\n const strategyObj = context._strategies;\n const sanitizedConf = Object.assign({}, config);\n for (const key in strategyObj) {\n sanitizedConf[key] = defaultValue(configResolvers[key], configResolvers.default)(config[key], config);\n }\n return sanitizedConf;\n};\n\nexport default class Tooltip extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._tooltips = {};\n this._strategies = mergeRecursive({}, strategies);\n this._strategy = HIGHLIGHT_SUMMARY;\n }\n\n static defaultConfig () {\n return {\n padding: 5,\n offset: {\n x: 0,\n y: 0\n },\n highlightSummary: {\n order: 1,\n dataTransform: (dm, fields) => (fields ? dm.project(fields, { saveChild: false }) : dm)\n },\n selectionSummary: {\n order: 0,\n dataTransform: dm => dm\n }\n };\n }\n\n static formalName () {\n return TOOLTIP;\n }\n\n config (...params) {\n if (params.length) {\n const config = this._config = mergeRecursive(this._config, sanitizeConfig(params[0], this));\n const strategyObj = this._strategies;\n for (const key in strategyObj) {\n const formatter = config[key].formatter;\n this.setStrategy(key, formatter);\n }\n return this;\n }\n return this._config;\n }\n\n apply (selectionSet, payload, options = {}) {\n const dataModel = selectionSet && selectionSet.mergedEnter.model;\n\n if ((payload.criteria === null || (dataModel && dataModel.isEmpty())) || selectionSet === null) {\n this.hide(options, null);\n return this;\n }\n\n const strategy = defaultValue(options.strategy, this._strategy);\n\n this.createTooltip(dataModel, Object.assign({}, {\n payload,\n selectionSet,\n strategy,\n options\n }), null, 0);\n\n return this;\n }\n\n static target () {\n return 'all';\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n const { orientation } = this.config();\n\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const tooltip = tooltips[key];\n const strategy = options.strategy || this._strategy;\n tooltip.content(strategy, null);\n if (!Object.keys(tooltip._contents).length) {\n tooltip.hide();\n } else {\n tooltip.positionRelativeTo(tooltip._target, {\n orientation\n });\n }\n }\n }\n }\n\n getPlotPointsFromIdentifiers (payload) {\n let target = payload.target;\n let targetFields = [];\n\n if (target) {\n targetFields = target[0] || [];\n const sourceFields = payload.sourceFields;\n const indices = [];\n for (let i = 0, len = targetFields.length; i < len; i++) {\n if (sourceFields.indexOf(targetFields[i]) !== -1) {\n indices.push(i);\n }\n }\n target = target.map(d => d.filter((v, i) => indices.indexOf(i) !== -1));\n }\n\n return super.plotPointsFromIdentifiers(target || payload.criteria, {\n getBBox: true\n });\n }\n\n createTooltip (dataModel, props = {}, plotDim, key) {\n const drawingInf = this.drawingContext();\n const sourceInf = this.sourceInfo();\n const config = this.config();\n const {\n strategy,\n payload,\n selectionSet\n } = props;\n plotDim = defaultValue(plotDim, this.getPlotPointsFromIdentifiers(payload));\n plotDim = plotDim && plotDim[0];\n const pad = config.padding;\n const { showInPosition, position: tooltipPos } = payload;\n const { fields: projectFields, dataTransform } = config[strategy];\n\n const strategyFn = this._strategies[strategy];\n const dt = dataTransform(dataModel, projectFields, this);\n const { parentContainer: layoutContainer, parentContainerDimensions } = drawingInf;\n const layoutBoundBox = layoutContainer.getBoundingClientRect();\n const unitBoundBox = drawingInf.htmlContainer.getBoundingClientRect();\n\n const offsetLeft = unitBoundBox.left - layoutBoundBox.left;\n const offsetTop = unitBoundBox.top - layoutBoundBox.top;\n const tooltipInst = this._tooltips[key] = this._tooltips[key] || new TooltipRenderer(layoutContainer,\n drawingInf.svgContainer);\n\n Object.assign(sourceInf, {\n payload,\n firebolt: this.firebolt,\n detailFields: [],\n timeDiffs: sourceInf.timeDiffs,\n valueParser: this.valueParser(),\n selectionSet,\n config: config[strategy]\n });\n\n tooltipInst.context(sourceInf);\n tooltipInst.content(strategy, dt, {\n formatter: strategyFn,\n order: config[strategy].order,\n className: config[strategy].className\n })\n .config(this.config())\n .extent({\n x: 0,\n y: 0,\n width: parentContainerDimensions.width,\n height: parentContainerDimensions.height\n })\n .offset({\n x: offsetLeft + (config.offset.x || 0),\n y: offsetTop + (config.offset.y || 0)\n });\n\n if (showInPosition) {\n tooltipInst.position(tooltipPos.x + pad, tooltipPos.y + pad);\n } else if (plotDim) {\n tooltipInst.positionRelativeTo({\n x: plotDim.x,\n y: plotDim.y,\n width: plotDim.width || 0,\n height: plotDim.height || 0\n }, {\n orientation: config.orientation\n }\n );\n } else {\n tooltipInst.hide();\n }\n }\n}\n","import { FieldType } from 'muze-utils';\nimport { spaceOutBoxes } from '../helper';\nimport { FRAGMENTED_TOOLTIP } from '../../enums/side-effects';\nimport Tooltip from '../tooltip';\n\nexport default class FragmentedTooltip extends Tooltip {\n static formalName () {\n return FRAGMENTED_TOOLTIP;\n }\n\n createTooltip (dataModel, props) {\n let totalHeight = 0;\n let totalWidth = 0;\n const config = this.config();\n const { strategy } = props;\n const context = this.firebolt.context;\n const drawingInf = this.drawingContext();\n\n const tooltips = this._tooltips;\n const boundBox = {\n width: drawingInf.width,\n height: drawingInf.height\n };\n const pad = config.padding;\n const dataModels = [];\n const sourceInf = context.getSourceInfo();\n const fields = sourceInf.fields;\n const xFieldDim = fields.x[0] ? fields.x[0].type() === FieldType.DIMENSION : false;\n const showVertically = !!xFieldDim;\n const boxes = [];\n const uids = dataModel.getUids();\n\n dataModels.push(...uids.map(d => dataModel.select((fieldsArr, i) => i === d, {\n saveChild: false\n })));\n\n const enter = {};\n for (let i = 0, len = dataModels.length; i < len; i++) {\n const dm = dataModels[i];\n const dimensions = dm.getData().schema.filter(d => d.type === FieldType.DIMENSION).map(d => d.name);\n const plotDim = context.getPlotPointsFromIdentifiers(dm.project(dimensions), { getBBox: true });\n\n super.createTooltip(dm, props, plotDim, i);\n const tooltipInst = this._tooltips[i];\n enter[i] = this._tooltips[i];\n\n const position = tooltipInst._position;\n const tooltipBoundBox = tooltipInst._tooltipContainer.node().getBoundingClientRect();\n\n totalHeight += tooltipBoundBox.height + pad;\n totalWidth += tooltipBoundBox.width + pad;\n\n if (showVertically ? totalHeight > drawingInf.height : totalWidth > drawingInf.width) {\n break;\n }\n\n position && boxes.push({\n x: position.x,\n y: position.y,\n width: tooltipBoundBox.width,\n height: tooltipBoundBox.height,\n tooltip: tooltipInst\n });\n }\n\n for (const key in tooltips) {\n if (!enter[key]) {\n const tooltip = tooltips[key];\n tooltip.content(strategy, null);\n if (!tooltip.getContents().length) {\n tooltip.remove();\n delete tooltips[key];\n }\n }\n }\n\n boxes.length && spaceOutBoxes(boxes, boundBox, showVertically);\n boxes.forEach(box => box.tooltip.position(box.x, box.y, {\n repositionArrow: true\n }));\n\n return this;\n }\n\n hide (options) {\n const tooltips = this._tooltips;\n for (const key in tooltips) {\n if ({}.hasOwnProperty.call(tooltips, key)) {\n const strategy = options.strategy || this._strategy;\n tooltips[key].content(strategy, null);\n tooltips[key].hide();\n }\n }\n }\n}\n","export const spaceOutBoxes = (boxes, extent, showVertically) => {\n let y;\n let height;\n let x;\n let width;\n let i;\n const pad = 5;\n const len = boxes.length;\n const spaceOutIfOverlap = (firstBox, secondBox, opposite) => {\n x = firstBox.x;\n width = firstBox.width;\n y = firstBox.y;\n height = firstBox.height;\n const bottom = y + height;\n const right = x + width;\n\n if (showVertically) {\n if (opposite ? y < (secondBox.y + secondBox.height) : bottom > secondBox.y) {\n secondBox.y = opposite ? firstBox.y - secondBox.height - pad :\n bottom + pad;\n }\n } else if (opposite ? x < (secondBox.x + secondBox.width) : right > secondBox.x) {\n secondBox.x = opposite ? firstBox.x - secondBox.width - pad :\n right + pad;\n }\n };\n\n boxes.sort((a, b) => (showVertically ? a.y - b.y : a.x - b.x));\n i = 0;\n\n for (i = 0; i < len - 1; i++) {\n spaceOutIfOverlap(boxes[i], boxes[i + 1]);\n }\n\n if ((boxes[i].y + boxes[i].height) > extent.height ||\n (boxes[i].x + boxes[i].width) > extent.width) {\n if (showVertically) {\n boxes[i].y -= (boxes[i].height + boxes[i].y) - extent.height;\n } else {\n boxes[i].x -= (boxes[i].width + boxes[i].x) - extent.width;\n }\n for (i = len - 1; i > 0; i--) {\n spaceOutIfOverlap(boxes[i], boxes[i - 1], true);\n }\n }\n return boxes;\n};\n","import { selectElement, FieldType } from 'muze-utils';\n\nimport './styles.scss';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { CROSSLINE } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\n\nexport default class Crossline extends SpawnableSideEffect {\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-crossline-group`,\n bandClass: `${CLASSPREFIX}-crossband`,\n lineClass: `${CLASSPREFIX}-crossline`\n };\n }\n\n static formalName () {\n return CROSSLINE;\n }\n\n apply (selectionSet, payload) {\n let height;\n let bandWidth;\n let px;\n let width;\n const {\n className,\n bandClass,\n lineClass\n } = this.config();\n const dataModel = selectionSet.mergedEnter.model;\n const drawingInf = this.drawingContext();\n const isEmptyDataModel = dataModel && dataModel.isEmpty();\n if (payload.criteria && isEmptyDataModel) {\n this.hide();\n return this;\n }\n if (payload.criteria === null || !dataModel) {\n this.hide();\n return this;\n }\n\n const dataObj = dataModel.getData();\n const sourceInf = this.firebolt.context.getSourceInfo();\n const axes = sourceInf.axes;\n const axisFields = sourceInf.fields;\n const fields = selectionSet.fields;\n const data = dataObj.data;\n const fieldsConfig = dataModel.getFieldsConfig();\n const svgContainer = drawingInf.sideEffectGroup;\n\n const elemData = [];\n fields.forEach((field) => {\n const fieldIndex = fieldsConfig[field] && fieldsConfig[field].index;\n const dataArr = data.map(d => d[fieldIndex]);\n const axisIndex = [['x', 0], ['x', 1], ['y', 0], ['y', 1]].find((arr) => {\n const fieldInst = axisFields[arr[0]][arr[1]];\n return fieldInst && fieldInst.type() === FieldType.DIMENSION &&\n fieldInst.getMembers().indexOf(field) !== -1;\n });\n if (axisIndex !== undefined && data.length) {\n const type = axisIndex[0];\n const axis = axes[type][axisIndex[1]];\n const value = dataArr[0];\n bandWidth = axis.getUnitWidth() || 0;\n px = axis.getScaleValue(value) + bandWidth / 2 + drawingInf.xOffset;\n\n let layers = this.firebolt.context.layers();\n layers = layers.filter(layer => !!layer.config().crossline);\n\n if (layers.length) {\n const plotWidth = Math.max(...layers.map(layer => layer.getPlotSpan()[type]));\n const pad = Math.max(...layers.map(layer => layer.getPlotPadding()[type]));\n height = drawingInf.height;\n width = drawingInf.width;\n const startPx = px - plotWidth / 2 - pad / 2;\n const endPx = px + plotWidth / 2 + pad / 2;\n const dataPoint = {};\n if (type === 'y') {\n dataPoint.d = `M 0 ${startPx} L 0 ${endPx} L ${width} ${endPx} L ${width} ${startPx} Z`;\n } else {\n dataPoint.d = `M ${startPx} 0 L ${endPx} 0 L ${endPx} ${height} L ${startPx} ${height} Z`;\n }\n dataPoint.className = plotWidth ? bandClass : lineClass;\n !isNaN(px) && elemData.push(dataPoint);\n }\n }\n });\n if (elemData.length) {\n const parentGroup = this.createElement(svgContainer, 'g', [1], className);\n const elem = this.createElement(parentGroup, 'path', elemData);\n elem.attr('d', d => d.d).style('pointer-events', 'none')\n .attr('class', d => d.className);\n }\n return this;\n }\n\n hide () {\n const className = this.config().className;\n const drawingInf = this.drawingContext();\n selectElement(drawingInf.sideEffectGroup).selectAll(`.${className}`).remove();\n }\n\n static target () {\n return 'visual-unit';\n }\n}\n","import { difference, intersect } from 'muze-utils';\nimport { intersectSets } from '../../helper';\n\n/**\n * @private\n * @param {Object} set Points set\n * @param {Array.} selectedPointsId array of id of selected points\n * @return {Object} Returns the set with the selected points removed\n */\nexport const getFormattedSet = (set, selectedPointsId, intersection = false) => {\n const fn = intersection ? intersect : difference;\n const formattedSet = fn(set.uids, selectedPointsId,\n [d => d[0], d => d[0]]);\n return {\n ...set,\n ...{\n uids: formattedSet,\n length: formattedSet.length\n }\n };\n};\n\nexport const highlightSelectIntersection = (firebolt) => {\n const selectEntrySet = firebolt.getEntryExitSet('select');\n const highlightEntrySet = firebolt.getEntryExitSet('highlight');\n\n if (selectEntrySet && highlightEntrySet) {\n const intersectSet = intersectSets(firebolt, ['select', 'highlight']);\n return intersectSet;\n }\n\n return null;\n};\n","import { intersect, difference } from 'muze-utils';\nimport { getFormattedSet } from './helper';\nimport { BEHAVIOURS } from '../..';\n\nconst fadeFn = (set, context) => {\n const { formattedSet } = set;\n const {\n mergedEnter,\n mergedExit,\n exitSet,\n completeSet\n } = formattedSet;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType: 'fade', apply: false });\n } else {\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n // Apply style only on the hovered layer\n if (layerName === 'area') {\n context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: true }, [layer]);\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);\n } else {\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: true }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: false }, [layer]);\n }\n });\n }\n};\n\nconst fadeOnBrushFn = (set, context, payload) => {\n const { formattedSet } = set;\n const {\n exitSet,\n mergedEnter,\n mergedExit,\n completeSet\n } = formattedSet;\n\n const { dragEnd } = payload;\n let interactionType = 'brushStroke';\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType, apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'doubleStroke', apply: false });\n } else {\n if (dragEnd) {\n interactionType = 'doubleStroke';\n // onDrag style\n context.applyInteractionStyle(completeSet, { interactionType: 'brushStroke', apply: false });\n }\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n // Apply style only on the hovered layer\n if (layerName === 'area') {\n if (dragEnd) {\n context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);\n mergedEnter.length &&\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]);\n }\n } else {\n // dragEnd style\n context.applyInteractionStyle(mergedExit, { interactionType, apply: false }, [layer]);\n if (!payload.dragEnd) {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]);\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]);\n }\n\n interactionType !== 'doubleStroke' &&\n context.applyInteractionStyle(mergedExit, { interactionType: 'doubleStroke', apply: false });\n context.applyInteractionStyle(mergedEnter, { interactionType, apply: true }, [layer]);\n }\n });\n }\n};\n\nexport const strategies = {\n fade: fadeFn,\n fadeOnBrush: fadeOnBrushFn,\n focus: (set, context) => {\n const { formattedSet } = set;\n const {\n entrySet,\n mergedEnter,\n mergedExit,\n completeSet\n } = formattedSet;\n const { firebolt } = context;\n\n if (!mergedEnter.length && !mergedExit.length) {\n context.applyInteractionStyle(completeSet, { interactionType: 'focus', apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'focusStroke', apply: false });\n context.applyInteractionStyle(completeSet, { interactionType: 'commonDoubleStroke', apply: false });\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focusStroke', apply: false });\n context.applyInteractionStyle(entrySet, { interactionType: 'focusStroke', apply: true });\n\n const payload = firebolt.getPayload(BEHAVIOURS.HIGHLIGHT);\n const entryExitSet = firebolt.getEntryExitSet(BEHAVIOURS.HIGHLIGHT);\n const layers = firebolt.context.layers();\n\n if (payload.target && entryExitSet) {\n layers.forEach((layer) => {\n const layerName = layer.constructor.formalName();\n\n if (layerName === 'area') {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: false }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]);\n } else {\n context.applyInteractionStyle(mergedExit, { interactionType: 'focus', apply: true }, [layer]);\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false }, [layer]);\n }\n\n // get uids of only the currently highlighted point\n const actualPoint = layer.getUidsFromPayload(entryExitSet.mergedEnter, payload.target);\n\n const commonSet = intersect(mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n\n if (commonSet.length) {\n context.applyInteractionStyle({ uids: commonSet },\n { interactionType: 'commonDoubleStroke', apply: true },\n [layer]\n );\n } else {\n context.applyInteractionStyle({ uids: mergedExit.uids },\n { interactionType: 'commonDoubleStroke', apply: false },\n [layer]\n );\n }\n });\n }\n }\n },\n highlight: (set, context, payload, excludeSetIds) => {\n const { selectionSet } = set;\n\n if (!selectionSet.mergedEnter.length && !selectionSet.mergedExit.length) {\n // Remove focusStroke on selected but currently non-highlighted set\n context.applyInteractionStyle(selectionSet.completeSet, { interactionType: 'highlight', apply: false });\n context.applyInteractionStyle(selectionSet.completeSet,\n { interactionType: 'commonDoubleStroke', apply: false }\n );\n } else {\n const layers = context.firebolt.context.layers();\n\n layers.forEach((layer) => {\n if (payload.target) {\n // get uids of only the currently highlighted point\n const actualPoint = layer.getUidsFromPayload(selectionSet.mergedEnter, payload.target);\n // get uids of only the currently highlighted point excluding the excludeSet ids\n const currentHighlightedSet = getFormattedSet(actualPoint, excludeSetIds);\n\n // Apply highlight on the currently hovered point\n context.applyInteractionStyle(currentHighlightedSet,\n { interactionType: 'highlight', apply: true },\n [layer]\n );\n\n context.applyInteractionStyle(selectionSet.mergedExit,\n { interactionType: 'highlight', apply: false },\n [layer]\n );\n\n const selectEntrySet = context.firebolt.getEntryExitSet('select');\n if (selectEntrySet) {\n const commonSet = intersect(selectEntrySet.mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n const diffSet = difference(selectEntrySet.mergedEnter.uids, actualPoint.uids,\n [v => v[0], v => v[0]]);\n\n if (commonSet.length) {\n context.applyInteractionStyle({ uids: commonSet },\n { interactionType: 'commonDoubleStroke', apply: true },\n [layer]\n );\n }\n context.applyInteractionStyle({ uids: diffSet },\n { interactionType: 'commonDoubleStroke', apply: false },\n [layer]\n );\n }\n }\n });\n }\n },\n pseudoFocus: (set, context) => {\n const { formattedSet } = set;\n const {\n mergedEnter\n } = formattedSet;\n\n context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false });\n }\n};\n","import SurrogateSideEffect from '../surrogate';\nimport { strategies } from './strategy';\nimport { HIGHLIGHTER } from '../../enums/side-effects';\nimport { getFormattedSet } from './helper';\n\nexport default class PlotHighlighter extends SurrogateSideEffect {\n constructor (...params) {\n super(...params);\n this._strategy = 'highlight';\n this._strategies = strategies;\n }\n\n static formalName () {\n return HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n getExcludeSetIds (excludeSet = []) {\n // Get excludeSetIds if excludeSet is a function\n if (excludeSet instanceof Function) {\n return excludeSet(this.firebolt.getEntryExitSet);\n }\n // Get excludeSetIds if excludeSet is not a function\n return excludeSet.reduce((acc, behaviour) => {\n const selectedPoints = this.firebolt.getEntryExitSet(behaviour) || {};\n const selectedPointsIds = (selectedPoints.mergedEnter || {}).uids;\n if (selectedPointsIds) acc.push(...selectedPointsIds);\n return acc;\n }, []);\n }\n\n apply (selectionSet, payload, options = {}) {\n const currentStrategy = this._strategies[options.strategy || this._strategy];\n const excludeSetIds = this.getExcludeSetIds(options.excludeSet);\n\n // Get all sets except the excludeSet points\n const formattedSet = {\n ...selectionSet,\n completeSet: getFormattedSet(selectionSet.completeSet, excludeSetIds),\n entrySet: getFormattedSet(selectionSet.entrySet[1], excludeSetIds),\n exitSet: getFormattedSet(selectionSet.exitSet[1], excludeSetIds),\n mergedEnter: getFormattedSet(selectionSet.mergedEnter, excludeSetIds),\n mergedExit: getFormattedSet(selectionSet.mergedExit, excludeSetIds)\n };\n\n const totalSet = { selectionSet, formattedSet };\n\n currentStrategy(totalSet, this, payload, excludeSetIds);\n\n return this;\n }\n}\n","import SurrogateSideEffect from '../surrogate';\n\nexport default class FilterEffect extends SurrogateSideEffect {\n static formalName () {\n return 'filter';\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static mutates () {\n return true;\n }\n\n apply (selectionSet, payload) {\n const context = this.firebolt.context;\n const entryModel = selectionSet.mergedEnter.model;\n if (payload.criteria === null) {\n context.clearCaching().resetData();\n } else {\n context.enableCaching().data(entryModel);\n }\n return this;\n }\n}\n","import { DataModel, getObjProp, mergeRecursive, ReservedFields, dmMultipleSelection } from 'muze-utils';\nimport { CLASSPREFIX } from '../../enums/constants';\nimport { ANCHORS } from '../../enums/side-effects';\nimport SpawnableSideEffect from '../spawnable';\nimport './styles.scss';\n\nconst addLayer = (layerRegistry, context, sideEffect) => {\n context.addLayer((layerDefs) => {\n const layers = [];\n\n if (layerDefs) {\n layerDefs.forEach((layerDef) => {\n const mark = layerDef.mark;\n const layerCls = layerRegistry[mark];\n\n if (layerCls && layerCls.shouldDrawAnchors()) {\n const depLayerEncoding = layerDef.def.encoding;\n const encoding = {\n x: getObjProp(depLayerEncoding, 'x', 'field'),\n y: getObjProp(depLayerEncoding, 'y', 'field'),\n color: {\n field: getObjProp(depLayerEncoding, 'color', 'field'),\n value: getObjProp(depLayerEncoding, 'color', 'value')\n },\n size: {\n field: getObjProp(depLayerEncoding, 'size', 'field'),\n value: () => sideEffect.defaultSizeValue()\n }\n };\n const commonName = sideEffect.constructor.formalName();\n const layerOwner = layerDef.def.name;\n const name = `${layerOwner}-${commonName}`;\n const defaultClassName = `${sideEffect.constructor.defaultConfig().className}`;\n\n layers.push({\n name: `${name}-upper`,\n mark: 'point',\n groupId: `${commonName}-upper`,\n className: `${defaultClassName}-upper`,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n\n if (mark === 'area') {\n layers.push({\n name: `${name}-lower`,\n mark: 'point',\n groupId: `${commonName}-lower`,\n className: `${defaultClassName}-lower`,\n encoding,\n transform: {\n type: 'identity'\n },\n calculateDomain: false,\n transition: sideEffect.getTransitionConfig(),\n source: dm => dm.select(() => false, {\n saveChild: false\n }),\n interactive: false,\n owner: layerDef.def.name\n });\n }\n }\n });\n }\n return layers;\n });\n};\n\nexport default class AnchorEffect extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._layersMap = {};\n this.addAnchorLayers();\n }\n\n static target () {\n return 'visual-unit';\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-anchors-group`\n };\n }\n\n static formalName () {\n return ANCHORS;\n }\n\n addAnchorLayers () {\n const context = this.firebolt.context;\n const layerRegistry = context.registry().layerRegistry;\n\n addLayer(layerRegistry, context, this);\n return this;\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n /**\n * Returns the default area value of the anchor point.\n * @return { number } Default area value of anchor.\n */\n defaultSizeValue () {\n return 70;\n }\n\n // Default offset by which anchor size is changed\n getAnchorSizeOnInteraction ({ dragEnd }) {\n if (dragEnd) {\n return 40;\n }\n return 0;\n }\n\n apply (selectionSet, payload) {\n const dataModel = selectionSet.mergedEnter.model;\n const formalName = this.constructor.formalName();\n const context = this.firebolt.context;\n const upperAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-upper`);\n const lowerAnchors = context.layers().filter(layer => layer.config().groupId === `${formalName}-lower`);\n\n const { target, action } = payload;\n let targetObj = null;\n if (target) {\n targetObj = target[1].reduce((acc, v, i) => {\n const field = target[0][i];\n if (field !== ReservedFields.MEASURE_NAMES) {\n acc[field] = v;\n }\n return acc;\n }, {});\n }\n\n [...upperAnchors, ...lowerAnchors].forEach((layer, index) => {\n const layerConfig = layer.config();\n const linkedLayer = context.getLayerByName(layerConfig.owner);\n const linkedLayerName = linkedLayer.constructor.formalName();\n const groupId = layerConfig.groupId;\n const isUpperAnchor = groupId === `${formalName}-upper`;\n let transformedData = [];\n let schema = [];\n\n [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dataModel, index);\n\n // Render both upper and lower anchors for area plot if hovered over an anchor\n if (linkedLayerName === 'area' && target && action === 'highlight') {\n const filterFn = dmMultipleSelection(target, dataModel);\n const dmFromPayload = dataModel.select(filterFn, {});\n\n if (!isUpperAnchor) {\n [transformedData, schema] = linkedLayer.getTransformedDataFromIdentifiers(dmFromPayload, index);\n }\n }\n\n const transformedDataModel = new DataModel(transformedData, schema);\n const anchorSizeConfig = {\n encoding: {\n size: {\n value: () => this.defaultSizeValue() + this.getAnchorSizeOnInteraction(payload)\n },\n 'stroke-width': {\n value: this.getAnchorStroke(payload, targetObj)\n }\n }\n };\n const newConfig = mergeRecursive(layerConfig, anchorSizeConfig);\n\n layer\n .data(transformedDataModel)\n .config(newConfig);\n\n return this;\n });\n }\n\n getAnchorStroke (payload, targetObj) {\n return (d) => {\n const dataObj = d.data.dataObj;\n const matchingData = targetObj ? Object.keys(targetObj).every((key) => {\n const val = dataObj[key];\n return val === targetObj[key];\n }) : false;\n return matchingData ? '1px' : '0px';\n };\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { PERSISTENT_ANCHORS } from '../enums/side-effects';\n\nexport default class PersistentAnchors extends AnchorEffect {\n static formalName () {\n return PERSISTENT_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-persistent-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n setAnchorLayerStyle (layers) {\n const anchorLayers = layers.filter(l => l.config().groupId === PERSISTENT_ANCHORS);\n anchorLayers.forEach((anchor) => {\n // Execute focusStroke interaction of anchor point layer\n const ids = anchor.data().getUids();\n const layerName = this.constructor.formalName();\n const defaultInteractionLayerEncoding = anchor.config().encoding.interaction;\n anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true });\n });\n }\n\n // offset value by which anchor size is changed\n // Applied only on select interaction\n getAnchorSizeonInteraction () {\n return 50;\n }\n\n getAnchorStroke () {\n return '2px';\n }\n}\n","import AnchorEffect from './anchors';\nimport { CLASSPREFIX } from '../enums/constants';\nimport { BRUSH_ANCHORS } from '../enums/side-effects';\n\nexport default class BrushAnchors extends AnchorEffect {\n static formalName () {\n return BRUSH_ANCHORS;\n }\n\n static defaultConfig () {\n return {\n className: `${CLASSPREFIX}-brush-anchors`\n };\n }\n\n getTransitionConfig () {\n return {\n disabled: true\n };\n }\n\n setAnchorLayerStyle (layers) {\n const anchorLayers = layers.filter(l => l.config().groupId === BRUSH_ANCHORS);\n anchorLayers.forEach((anchor) => {\n // Execute focusStroke interaction of anchor point layer\n const ids = anchor.data().getUids();\n const layerName = this.constructor.formalName();\n const defaultInteractionLayerEncoding = anchor.config().encoding.interaction;\n anchor.applyInteractionStyle(defaultInteractionLayerEncoding[layerName], ids, { apply: true });\n });\n }\n\n getAnchorStroke (payload) {\n return payload.dragEnd ? '2px' : '1px';\n }\n}\n","import SurrogateSideEffect from '../surrogate';\nimport { AXIS_LABEL_HIGHLIGHTER } from '../../enums/side-effects';\nimport './styles.scss';\n\nexport default class AxisLabelHighLighter extends SurrogateSideEffect {\n static formalName () {\n return AXIS_LABEL_HIGHLIGHTER;\n }\n\n static target () {\n return 'visual-unit';\n }\n\n apply (selectionSet) {\n const context = this.firebolt.context;\n const dataModel = selectionSet && selectionSet.mergedEnter.model;\n const selectedData = dataModel && dataModel.getData().data;\n const selectedDataValues = selectedData && selectedData.length ? selectedData[0] : [];\n const { x = [], y = [] } = context.axes();\n [...x, ...y].forEach((axis) => {\n const fieldMeta = dataModel ? dataModel.getFieldsConfig()[axis.config().field] : undefined;\n const selData = selectedDataValues[fieldMeta && fieldMeta.index !== undefined\n ? fieldMeta.index : undefined];\n const { selectionSet: selectedElements, rejectionSet } = axis.getTicksBasedOnData(selData);\n selectedElements && selectedElements.selectAll('text').classed('muze-axis-ticks-highlight', true);\n rejectionSet.selectAll('text').classed('muze-axis-ticks-highlight', false);\n });\n }\n}\n","import { intersect } from 'muze-utils';\nimport * as BEHAVIOURS from './enums/behaviours';\nimport * as SIDE_EFFECTS from './enums/side-effects';\nimport { unionSets } from './helper';\n\nconst nullDataTooltipMap = {\n area: true,\n arc: false,\n line: true,\n text: false,\n point: false,\n bar: false,\n tick: false\n};\n\nconst applySideEffectOnEmptyTarget = (sideEffect, { target }) => {\n const layers = sideEffect.layers();\n const showTooltipOnEmptyTarget = layers.some((l) => {\n const layerName = l.constructor.formalName();\n return nullDataTooltipMap[layerName];\n });\n return showTooltipOnEmptyTarget || target;\n};\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: ['selectionBox', {\n name: 'highlighter',\n options: {\n strategy: 'fadeOnBrush'\n }\n }, 'brush-anchors'],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: 'highlighter',\n options: {\n strategy: 'highlight'\n }\n }, 'crossline', {\n name: 'tooltip',\n options: {\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active) {\n return null;\n }\n if (applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return selectionSet;\n }\n return null;\n }\n }\n }, 'anchors', {\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary',\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active === true ||\n !applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return null;\n }\n const selectEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.SELECT);\n const brushEntrySet = sideEffect.firebolt.getEntryExitSet(BEHAVIOURS.BRUSH);\n if (selectEntrySet || brushEntrySet) {\n const unionedSet = unionSets(sideEffect.firebolt, [BEHAVIOURS.SELECT, BEHAVIOURS.BRUSH]);\n const { uids } = unionedSet.mergedEnter;\n const { uids: highlightUids } = selectionSet.mergedEnter;\n\n if (intersect(uids, highlightUids, [id => id[0], id => id[0]]).length) {\n return unionedSet;\n }\n }\n\n return null;\n }\n }\n }, {\n name: SIDE_EFFECTS.AXIS_LABEL_HIGHLIGHTER,\n options: {\n setTransform: (selectionSet, payload, sideEffect) => {\n if (sideEffect.firebolt._actions.behavioural.brush.active) {\n return null;\n }\n if (applySideEffectOnEmptyTarget(sideEffect, payload)) {\n return selectionSet;\n }\n return null;\n }\n }\n }],\n [BEHAVIOURS.FILTER]: ['filter'],\n [BEHAVIOURS.SELECT]: [{\n name: 'highlighter',\n options: {\n strategy: 'focus'\n }\n }, 'persistent-anchors', {\n name: 'tooltip',\n options: {\n strategy: 'selectionSummary'\n }\n }],\n pseudoSelect: [{\n name: 'highlighter',\n options: {\n strategy: 'pseudoFocus'\n }\n }]\n};\n","import { componentRegistry } from 'muze-utils';\nimport * as behaviours from './actions/behavioural';\nimport { physicalActions } from './actions/physical';\nimport * as sideEffects from './side-effects';\n\nconst convertToObj = (comps) => {\n const obj = {};\n\n for (const key in comps) {\n const val = comps[key];\n\n obj[val.formalName()] = val;\n }\n return obj;\n};\n\nexport const registry = {\n behaviours: componentRegistry(convertToObj(behaviours)),\n physicalActions: componentRegistry(physicalActions),\n sideEffects: componentRegistry(convertToObj(sideEffects))\n};\n","import { ReservedFields, FieldType, difference, isSimpleObject } from 'muze-utils';\n\nconst getRangeFromData = (instance, selectionDataModel, propConfig) => {\n const dataObj = selectionDataModel.getData();\n const { includeMeasures = true, sourceIdentifiers } = propConfig;\n const schema = dataObj.schema;\n const fieldMap = instance.data().getFieldsConfig();\n const selectionDataFields = selectionDataModel.getFieldspace().fieldsObj();\n let criteria = null;\n if (sourceIdentifiers !== null) {\n criteria = schema.reduce((ranges, obj) => {\n const field = obj.name;\n const fieldObj = fieldMap[field];\n\n if (!fieldObj) {\n return ranges;\n }\n\n ranges[field] = selectionDataFields[field].domain();\n return ranges;\n }, {});\n const measureNamesIdx = sourceIdentifiers.identifiers[0]\n .findIndex(field => field === ReservedFields.MEASURE_NAMES);\n if (measureNamesIdx !== undefined && includeMeasures) {\n const measureNames = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length)\n .map(d => d[measureNamesIdx]);\n criteria[ReservedFields.MEASURE_NAMES] = measureNames.map(d => [d]);\n }\n }\n return criteria;\n};\n\nexport const payloadGenerator = {\n brush: (instance, selectionDataModel, propConfig, facetByFields) => {\n const propPayload = propConfig.payload;\n let payload;\n if (isSimpleObject(propPayload.criteria)) {\n const criteria = getRangeFromData(instance, selectionDataModel, propConfig);\n payload = Object.assign({}, propPayload);\n payload.criteria = criteria;\n } else {\n payload = payloadGenerator.__default(instance, selectionDataModel, propConfig, facetByFields);\n }\n\n return payload;\n },\n\n __default: (instance, selectionDataModel, propConfig, facetByFields = []) => {\n const { payload: propPayload, sourceIdentifiers, excludeSelectedMeasures } = propConfig;\n const dataObj = selectionDataModel.getData({ withUid: true });\n const payload = Object.assign({}, propPayload);\n const data = dataObj.data;\n const fieldsConfig = Object.assign({}, selectionDataModel.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(selectionDataModel.getFieldsConfig()).length,\n def: {\n type: FieldType.DIMENSION\n }\n }\n });\n const selectionSet = instance._selectionSet[propConfig.action];\n const selectionSetFields = selectionSet._fields;\n if (sourceIdentifiers) {\n const [facetFields = [], facetValues = []] = facetByFields;\n const facetIndices = facetFields.reduce((acc, v, i) => {\n acc[v] = i;\n return acc;\n }, {});\n const identifierIdxMap = sourceIdentifiers.fields.reduce((acc, v, i) => {\n acc[v.name] = i;\n return acc;\n }, {});\n const identifiers = sourceIdentifiers.identifiers.slice(1, sourceIdentifiers.identifiers.length);\n const sourceIdentifierFields = sourceIdentifiers.fields.filter(d => d.name in fieldsConfig ||\n d.name in facetIndices || d.name === ReservedFields.ROW_ID);\n\n const identifierMap = identifiers.reduce((acc, v) => {\n const key = sourceIdentifierFields.map(d => v[identifierIdxMap[d.name]]);\n const measureNamesIdx = identifierIdxMap[ReservedFields.MEASURE_NAMES];\n if (measureNamesIdx) {\n !acc[key] && (acc[key] = []);\n acc[key].push([v[measureNamesIdx]]);\n }\n return acc;\n }, {});\n\n const dataArr = [];\n for (let i = 0, len = data.length; i < len; i++) {\n const row = data[i];\n const dims = [];\n selectionSetFields.forEach((field) => {\n if (fieldsConfig[field] && fieldsConfig[field].def.type === FieldType.DIMENSION) {\n const idx = fieldsConfig[field].index;\n dims.push(row[idx]);\n }\n });\n\n const vals = `${sourceIdentifierFields.map((d) => {\n if (d.name in fieldsConfig) {\n return row[fieldsConfig[d.name].index];\n } else if (d.name in facetIndices) {\n return facetValues[facetIndices[d.name]];\n }\n return null;\n }).filter(d => d !== null)}`;\n\n if (vals in identifierMap) {\n const measures = identifierMap[vals];\n const allMeasures = instance._metaData.dimensionsMap[dims];\n\n if (excludeSelectedMeasures) {\n const fn = v => `${v}`;\n const diffMeasures = difference(allMeasures, measures, [fn, fn]);\n diffMeasures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n } else {\n measures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n }\n } else {\n let measures = instance._metaData.dimensionsMap[dims];\n measures = measures && measures.length ? measures : [[]];\n measures.forEach((measureArr) => {\n dataArr.push([...dims, measureArr]);\n });\n }\n }\n\n payload.criteria = [[...selectionSetFields, ReservedFields.MEASURE_NAMES], ...dataArr];\n } else {\n payload.criteria = null;\n }\n\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : [];\n return payload;\n },\n pseudoSelect: (instance, selectionDataModel, propConfig, facetByFields = []) =>\n payloadGenerator.__default(instance, selectionDataModel, Object.assign({}, {\n excludeSelectedMeasures: true\n }, propConfig), facetByFields)\n};\n\nexport const getPayloadGenerator = (action, criteria) => {\n if (criteria instanceof Array || !payloadGenerator[action]) {\n return payloadGenerator.__default;\n }\n\n return payloadGenerator[action];\n};\n","import { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { FieldType, ReservedFields, defaultValue, isSimpleObject, getObjProp } from 'muze-utils';\n\nexport const initSideEffects = (sideEffects, firebolt) => {\n for (const key in sideEffects) {\n if ({}.hasOwnProperty.call(sideEffects, key)) {\n sideEffects[key] instanceof SpawnableSideEffect && sideEffects[key].drawingContext(() => {\n const context = firebolt.context;\n return context.getDrawingContext();\n });\n sideEffects[key].valueParser(firebolt.context.valueParser());\n }\n }\n};\n\nexport const clearActionHistory = (context) => {\n const actionHistory = context._actionHistory;\n for (const key in actionHistory) {\n if (actionHistory[key].isMutableAction) {\n delete context._actionHistory[key];\n }\n }\n};\n\nexport const dispatchQueuedSideEffects = (context) => {\n const queuedSideEffects = context._queuedSideEffects;\n Object.entries(queuedSideEffects).forEach((entry) => {\n const sideEffect = entry[1];\n context.dispatchSideEffect(sideEffect.name, ...sideEffect.params);\n });\n context._queuedSideEffects = {};\n};\n\nexport const isSideEffectEnabled = (firebolt, { se, propagationInf }) => {\n const sideEffectPolicies = firebolt._sideEffectPolicies;\n const sideEffectCheckers = Object.values(sideEffectPolicies[se.name || se] || {});\n const { sourceIdentifiers, data: propagationData } = propagationInf;\n return sideEffectCheckers.length ? sideEffectCheckers.every(checker =>\n checker(propagationInf.propPayload, firebolt, {\n sourceIdentifiers,\n propagationData\n })) : true;\n};\n\nconst getUniqueKeys = (data, dimensions, { layers, uids, keys = {}, dimensionsMap = {} }) => {\n data.forEach((row, i) => {\n const key = dimensions.length ? dimensions.map(d => row[d.index]) : [uids[i]];\n\n layers.forEach((layer) => {\n const measureNames = Object.keys(layer.data().getFieldspace().getMeasure());\n const mKey = `${[key, ...measureNames]}`;\n keys[mKey] = defaultValue(keys[mKey], {});\n keys[mKey] = {\n dims: key,\n measureNames,\n uid: uids[i]\n };\n dimensionsMap[key] = defaultValue(dimensionsMap[key], []);\n dimensionsMap[key].push(measureNames);\n });\n });\n\n return {\n keys,\n dimensionsMap\n };\n};\n\nexport const prepareSelectionSetMap = ({ data, uids, dimensions }, layers, maps = {}) => {\n const obj = getUniqueKeys(data, dimensions, {\n layers,\n uids,\n keys: maps.keys,\n dimensionsMap: maps.dimensionsMap\n });\n\n return {\n keys: obj.keys,\n dimensionsMap: obj.dimensionsMap\n };\n};\n\nexport const prepareSelectionSetData = (dataModel, unit) => {\n const { data, uids } = dataModel.getData();\n const dimensions = Object.values(dataModel.getFieldsConfig()).filter(d => d.def.type === FieldType.DIMENSION);\n const layers = unit.layers();\n const { keys, dimensionsMap } = prepareSelectionSetMap({ data, uids, dimensions }, layers);\n const dimensionFields = dimensions.length ? dimensions.map(d => d.def.name) : [ReservedFields.ROW_ID];\n const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length;\n const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : [];\n\n return {\n keys,\n dimensions: dimensionFields,\n dimensionsMap,\n allFields: [...dimensionFields, ...measureName]\n };\n};\n\nexport const sanitizePayloadCriteria = (data, propFields, { dm, dimensionsMap, dimsMapGetter }) => {\n const fieldsConfig = Object.assign({}, dm.getFieldsConfig(), {\n [ReservedFields.ROW_ID]: {\n index: Object.keys(dm.getFieldsConfig()).length,\n def: {\n name: ReservedFields.ROW_ID,\n type: FieldType.DIMENSION\n }\n }\n });\n if (data === null) {\n return null;\n }\n\n if (isSimpleObject(data)) {\n return Object.keys(data).reduce((acc, v) => {\n if (v in fieldsConfig || v === ReservedFields.MEASURE_NAMES) {\n acc[v] = data[v];\n }\n return acc;\n }, {});\n }\n\n const criteriaFields = data[0];\n const fields = criteriaFields.length ? criteriaFields.map((d, i) => ({\n name: d,\n index: i\n })) : [];\n\n const fieldIndexMap = fields.reduce((acc, v, i) => {\n acc[v.name] = i;\n return acc;\n }, {});\n\n propFields = propFields || fields.map(d => d.name);\n const dataWithFacets = [\n propFields\n ];\n\n const measureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES);\n const propDims = fields.filter(d => d.name in fieldsConfig).map(d => d.name);\n\n const dimsMap = dimsMapGetter(propDims, fieldsConfig);\n\n for (let i = 1, len = data.length; i < len; i++) {\n const row = data[i];\n const dimKey = propDims.map(field => row[fieldIndexMap[field]]);\n const origRow = dimsMap[dimKey];\n if (origRow) {\n origRow.forEach((rowVal) => {\n const newRowVal = [];\n propFields.forEach((field) => {\n if (field in fieldIndexMap) {\n const idx = fieldIndexMap[field];\n newRowVal.push(row[idx]);\n } else {\n const idx = getObjProp(fieldsConfig[field], 'index');\n idx !== undefined && newRowVal.push(rowVal[idx]);\n }\n });\n if (!measureNameField) {\n const measuresArr = dimensionsMap[newRowVal].length ? dimensionsMap[newRowVal] : [[]];\n measuresArr.forEach((measures) => {\n dataWithFacets.push([...newRowVal, ...measures]);\n });\n } else {\n dataWithFacets.push(newRowVal);\n }\n });\n }\n }\n return dataWithFacets;\n};\n\nexport const dispatchSecondaryActions = (firebolt, { action, propagationData, config, propagationInf }) => {\n const context = firebolt.context;\n\n const secondaryActions = firebolt._connectedBehaviours[action] || [];\n\n secondaryActions.forEach((secAction) => {\n const payloadGeneratorFn = firebolt.getPayloadGeneratorFor(secAction);\n const generatedPayload = payloadGeneratorFn(firebolt, propagationData, config,\n context.facetByFields());\n firebolt.dispatchBehaviour(secAction, generatedPayload, propagationInf);\n });\n};\n\nexport const createMapByDimensions = (context, dm) => {\n let cacheMap = context._cacheMap = {};\n return (propDims, fieldsConfig) => {\n cacheMap = context._cacheMap;\n if (!cacheMap[propDims]) {\n cacheMap[propDims] = dm.getData({ withUid: true }).data.reduce((acc, row) => {\n const key = propDims.map(d => row[fieldsConfig[d].index]);\n acc[key] || (acc[key] = []);\n acc[key].push(row);\n return acc;\n }, {});\n }\n return cacheMap[propDims];\n };\n};\n","import { FieldType, intersect } from 'muze-utils';\nimport { Firebolt, SIDE_EFFECTS } from '@chartshq/muze-firebolt';\nimport { payloadGenerator } from './payload-generator';\nimport {\n isSideEffectEnabled,\n sanitizePayloadCriteria,\n dispatchSecondaryActions,\n createMapByDimensions\n} from './helper';\n\nconst sideEffectPolicy = (propPayload, firebolt, propagationInf) => {\n const { sourceIdentifiers, propagationData } = propagationInf;\n const fields = sourceIdentifiers.fields;\n const sourceIdentifierFields = Object.keys(fields).filter(field =>\n field.type !== FieldType.MEASURE);\n const propFields = Object.keys(propagationData.getFieldsConfig());\n const hasCommonCanvas = propPayload.sourceCanvas === firebolt.sourceCanvas();\n return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas;\n};\n\n/**\n * This class manages the interactions of visual unit. It associates physical actions with\n * behavioural actions. It also propagates the behavioural actions to other datamodels.\n */\nexport default class UnitFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n const {\n TOOLTIP,\n HIGHLIGHTER,\n ANCHORS,\n BRUSH_ANCHORS,\n PERSISTENT_ANCHORS\n } = SIDE_EFFECTS;\n this._handlers = {};\n this._propagationIdentifiers = {};\n this._connectedBehaviours = {};\n this.payloadGenerators(payloadGenerator);\n this.sideEffects().tooltip.disable();\n const disabledSideEffects = [TOOLTIP, HIGHLIGHTER, ANCHORS, BRUSH_ANCHORS, PERSISTENT_ANCHORS];\n disabledSideEffects.forEach((sideEffect) => {\n this.changeSideEffectStateOnPropagation(sideEffect, sideEffectPolicy, 'sourceTargetPolicy');\n });\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n const context = this.context;\n const unitId = context.id();\n const aliasName = context.parentAlias();\n const propagationSourceCanvas = propagationInf.propPayload && propagationInf.propPayload.sourceCanvas;\n const sourceUnitId = propagationInf.propPayload && propagationInf.propPayload.sourceUnit;\n const sideEffectInstances = this.sideEffects();\n const actionOnSource = sourceUnitId ? sourceUnitId === unitId : true;\n\n const applicableSideEffects = payload.sideEffects ? [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }] : sideEffects;\n applicableSideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n const mutates = sideEffectInstances[se.name || se].constructor.mutates();\n if (mutates && propagationInf.isMutableAction === false) {\n return false;\n }\n if (!actionOnSource && payload.criteria !== null) {\n return isSideEffectEnabled(this, { se, propagationInf });\n }\n if (propagationSourceCanvas === aliasName || actionOnSource) {\n return se.applyOnSource !== false;\n }\n\n return true;\n });\n d.effects = mappedEffects;\n });\n return applicableSideEffects;\n }\n\n shouldApplySideEffects (propInf) {\n return propInf.propagate === false && propInf.applySideEffect !== false;\n }\n\n sanitizePayload (payload) {\n const { criteria } = payload;\n const { allFields: fields, dimensionsMap } = this._metaData;\n\n return Object.assign({}, payload,\n {\n criteria: sanitizePayloadCriteria(criteria, fields, {\n dm: this.data(),\n dimensionsMap,\n dimsMapGetter: this._dimsMapGetter\n })\n });\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n let isMutableAction = false;\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const propagationData = data;\n\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n\n const payloadFn = this.getPayloadGeneratorFor(action);\n const payload = payloadFn(this, propagationData, config, context.facetByFields());\n const behaviourPolicies = this._behaviourPolicies;\n const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, this, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled !== false;\n }\n\n if (enabled) {\n const effects = this._behaviourEffectMap[action];\n const sideEffectInstances = this.sideEffects();\n isMutableAction = config.groupId ?\n effects.some(d => sideEffectInstances[d.name || d].constructor.mutates()) : config.isMutableAction;\n\n const propagationInf = {\n propagate: false,\n data: propagationData,\n propPayload,\n sourceIdentifiers,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n this._actionHistory[action] = {\n payload,\n propagationInf,\n isMutableAction\n };\n\n this.dispatchBehaviour(action, payload, propagationInf);\n\n dispatchSecondaryActions(this, {\n action,\n propagationInf,\n propagationData,\n config\n });\n }\n };\n }\n\n target () {\n return 'visual-unit';\n }\n\n createSelectionSet (...params) {\n super.createSelectionSet(...params);\n\n this._dimsMapGetter = createMapByDimensions(this, this.data());\n\n return this;\n }\n\n remove () {\n this.context.cachedData()[0].unsubscribe('propagation');\n return this;\n }\n\n propagationIdentifiers (action, identifiers) {\n if (identifiers) {\n this._propagationIdentifiers = identifiers;\n }\n return this._propagationIdentifiers[action];\n }\n\n registerPhysicalActionHandlers () {\n return this;\n }\n\n id () {\n return this.context.id();\n }\n\n getPropagationSource () {\n return this.context.cachedData()[0];\n }\n\n sourceCanvas () {\n return this.context.parentAlias();\n }\n}\n\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: false\n },\n [ACTIONS.HOVER]: {\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.LONGTOUCH]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: true\n },\n [ACTIONS.TOUCHDRAG]: {\n behaviours: [BEHAVIOURS.BRUSH],\n touch: true\n },\n [ACTIONS.CLICK]: {\n behaviours: [BEHAVIOURS.SELECT],\n touch: false\n }\n};\n","import { VolatileBehaviour } from '@chartshq/muze-firebolt';\nimport { BRUSH } from '../../enums/behaviours';\n/**\n * This is the behaviour for brushing a region on the chart. It accepts a payload\n * which contains the x and y range of the data and other configuration. It will then\n * create a selection box from the range and select the points which fall within the range.\n */\nexport default class UnitBrushBehaviour extends VolatileBehaviour {\n static formalName () {\n return BRUSH;\n }\n\n dispatch (...params) {\n this.active = params[0].dragging;\n this.start = params[0].dragStart;\n return super.dispatch(...params);\n }\n}\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const PSEUDO_SELECT = 'pseudoSelect';\n\n","import { getObjProp, defaultValue, makeElement, DimensionSubtype, DataModel, createSelection } from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport { layerFactory, LAYER_TYPES } from '@chartshq/visual-layer';\nimport {\n GRID_BAND,\n GRID_LINE,\n GRID_BAND_PARENT_GROUP_CLASS,\n GRID_LINE_PARENT_GROUP_CLASS,\n GRID_PARENT_GROUP\n} from '../enums/constants';\n\nconst { BAR_LAYER, TICK_LAYER } = LAYER_TYPES;\n\nconst LINEAR = ScaleType.LINEAR;\n\nconst getLayerDefinition = (context, axes, type, orientation) => {\n let encoding;\n const config = context.config();\n const { classPrefix, gridLines, gridBands } = config;\n const gridLineColor = gridLines.color;\n const zeroLineColor = gridLines.zeroLineColor;\n const defClassName = type === GRID_BAND ? gridBands.defClassName : gridLines.defClassName;\n const gridBandColor = gridBands[orientation].color;\n const axis = axes[orientation][0];\n const isLinearScale = axis.constructor.type() === LINEAR;\n\n if (type === GRID_BAND && isLinearScale) {\n encoding = {\n [orientation]: `${orientation}value`,\n [`${orientation}0`]: `${orientation}value0`\n };\n } else {\n encoding = {\n [orientation]: isLinearScale ? `${orientation}value` : `${orientation}dim`\n };\n }\n encoding.color = {\n value: (data, i) => {\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (type === GRID_BAND) {\n return gridBandColor[i % 2];\n }\n return isNegativeDomain && data[orientation] === 0 ? zeroLineColor : gridLineColor;\n }\n };\n const { color, shape, size } = context.axes();\n return {\n definition: {\n defClassName: `${defClassName}-${orientation}`,\n className: config.className,\n name: orientation,\n calculateDomain: false,\n individualClassName: (data, i) => {\n let className;\n const isNegativeDomain = isLinearScale && axis.domain()[0] < 0;\n if (isNegativeDomain && data.y === 0 && type !== GRID_BAND) {\n className = `${classPrefix}-axis-zero-line`;\n } else {\n className = `${classPrefix}-grid-${type}-${orientation}-${i % 2}`;\n }\n return className;\n },\n [`pad${orientation.toUpperCase()}`]: type === GRID_BAND ? 0 : undefined,\n encoding\n },\n axes: {\n [orientation]: axis,\n color: color[0],\n shape: shape[0],\n size: size[0]\n },\n interactive: false\n };\n};\n\nconst getDefaultVisibilty = (show, axis) => {\n if (axis.constructor.type() === LINEAR) {\n return show;\n }\n return false;\n};\n\nexport const getGridLayerDefinitions = (context, config, type) => ['x', 'y'].map((axisType) => {\n const axes = context.axes();\n if (!axes[axisType]) {\n return null;\n }\n const show = defaultValue(config[axisType] && config[axisType].show,\n getDefaultVisibilty(config.show, axes[axisType][0]));\n\n return show ? getLayerDefinition(context, axes, type, axisType) : null;\n}).filter(d => d !== null);\n\nconst dimensionSubTypes = Object.values(DimensionSubtype).reduce((acc, v) => {\n acc[v] = 1;\n return acc;\n}, {});\n\nconst getValidSubtype = subtype => (!dimensionSubTypes[subtype] ? DimensionSubtype.CATEGORICAL : subtype);\n\nexport const getGridLayerData = (axes, fields, fieldsConfig) => {\n const gridData = {};\n\n ['x', 'y'].forEach((type) => {\n let ticks = axes[type][0].getTickValues();\n const subtype = getObjProp(fieldsConfig, getObjProp(fields, type, 0).getMembers()[0], 'def', 'subtype');\n const jsonData = [];\n const schema = [\n {\n name: 'yvalue',\n type: 'measure'\n }, {\n name: 'xvalue',\n type: 'measure'\n },\n {\n name: 'yvalue0',\n type: 'measure'\n }, {\n name: 'xvalue0',\n type: 'measure'\n }, {\n name: 'xdim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }, {\n name: 'ydim',\n type: 'dimension',\n subtype: getValidSubtype(subtype)\n }\n ];\n const len = Math.max(ticks.length);\n ticks = subtype === DimensionSubtype.TEMPORAL ? ticks.map(d => d.getTime()) : ticks;\n for (let i = 0; i < len; i += 1) {\n jsonData.push({\n [`${type}value`]: ticks[i],\n [`${type}value0`]: ticks[i + 1],\n [`${type}dim`]: ticks[i],\n [`${type}dim`]: ticks[i]\n });\n }\n gridData[type] = new DataModel(jsonData, schema);\n });\n return gridData;\n};\n\nexport const createGridLineLayer = (context) => {\n const vuConf = context.config();\n const metaInf = context.metaInf();\n const store = context.store();\n const timeDiffs = context._timeDiffs;\n [GRID_BAND, GRID_LINE].forEach((type) => {\n let mark;\n let config;\n if (type === GRID_BAND) {\n mark = BAR_LAYER;\n config = vuConf.gridBands;\n } else {\n mark = TICK_LAYER;\n config = vuConf.gridLines;\n }\n const definitions = getGridLayerDefinitions(context, config, type);\n\n const sel = `_${type}Selection`;\n context[sel] = createSelection(context[sel], (atomicDef) => {\n const inst = layerFactory.getLayerInstance({ mark });\n inst.dependencies(context._dependencies);\n const name = atomicDef.definition.name;\n inst.metaInf({\n unitRowIndex: metaInf.rowIndex,\n unitColIndex: metaInf.colIndex,\n namespace: `${metaInf.namespace}${type}${name}`,\n parentNamespace: metaInf.namespace\n })\n .store(store);\n return inst;\n }, definitions, atomicDef => atomicDef.definition.name);\n\n context[sel].each((layer, atomicDef) => {\n const definition = atomicDef.definition;\n const sConf = layerFactory.getSerializedConf(mark, definition);\n const axesObj = atomicDef.axes;\n layer.config(sConf)\n .dataProps({\n timeDiffs\n })\n .axes(axesObj);\n });\n context[`_${type}`] = context[sel].getObjects();\n });\n};\n\nexport const attachDataToGridLineLayers = (context) => {\n const axes = context.axes();\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n if (gridLines.length || gridBands.length) {\n const gridLayerData = getGridLayerData(axes, context.fields(), context.data().getFieldsConfig());\n [].concat(...gridBands, ...gridLines).forEach((inst) => {\n inst.data(inst.axes().x ? gridLayerData.x : gridLayerData.y);\n });\n }\n};\n\nexport const renderGridLineLayers = (context, container) => {\n const config = context.config();\n const classPrefix = config.classPrefix;\n const gridLines = context._gridLines;\n const gridBands = context._gridBands;\n const measurement = {\n width: context.width(),\n height: context.height()\n };\n const gridLineParentGroup = makeElement(container, 'g', [1], `${classPrefix}-${GRID_PARENT_GROUP}`);\n\n [[gridLines, `${classPrefix}-${GRID_LINE_PARENT_GROUP_CLASS}`],\n [gridBands, `${classPrefix}-${GRID_BAND_PARENT_GROUP_CLASS}`]].forEach((entry) => {\n const [instances, parentGroupClass] = entry;\n const mountPoint = makeElement(gridLineParentGroup, 'g', [1], `.${parentGroupClass}`);\n const className = `${parentGroupClass}-group`;\n makeElement(mountPoint, 'g', instances, `.${className}`, {\n update: (group, instance) => {\n instance.dataProps({ timeDiffs: context._timeDiffs })\n .measurement(measurement)\n .mount(group.node());\n }\n });\n });\n};\n","import {\n STATE_NAMESPACES,\n temporalFields,\n getObjProp,\n defaultValue,\n isSimpleObject\n} from 'muze-utils';\nimport { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants';\nimport { TOOLTIP, FRAGMENTED_TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects';\nimport * as PROPS from './enums/reactive-props';\nimport {\n transformDataModels,\n getDimensionMeasureMap,\n attachDataToLayers,\n attachAxisToLayers\n} from './helper';\n\nimport { createGridLineLayer } from './helper/grid-lines';\nimport { prepareSelectionSetData } from './firebolt/helper';\n\nconst removeExitLayers = (layerDefs, context) => {\n const layersMap = context._layersMap;\n const markSet = {};\n layerDefs.forEach((layerDef, i) => {\n const id = defaultValue(layerDef.name, `${layerDef.mark}-${i}`);\n markSet[id] = true;\n });\n\n for (const key in layersMap) {\n if (!(key in markSet)) {\n layersMap[key].forEach(layer => layer.remove());\n delete layersMap[key];\n }\n }\n};\n\nexport const listenerMap = [\n {\n type: 'registerImmediateListener',\n props: [PROPS.LAYERDEFS],\n listener: (context, [, layerDefs]) => {\n const fieldsVal = context.fields();\n\n if (layerDefs && fieldsVal) {\n removeExitLayers(layerDefs, context);\n const queuedLayerDefs = context._queuedLayerDefs;\n let layerDefArr = layerDefs;\n queuedLayerDefs.forEach((defFn) => {\n layerDefArr = [...layerDefArr, ...defFn(layerDefs)];\n });\n context.addLayer(layerDefArr);\n\n const adjustRange = context.layers().some(inst => inst.hasPlotSpan());\n ['x', 'y'].forEach((type) => {\n const axisArr = defaultValue(getObjProp(context.axes(), type), []);\n axisArr.forEach((axis) => {\n axis.config({\n adjustRange\n });\n });\n });\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'initialized',\n formalName: 'layer'\n });\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA],\n listener: (context, [, dataModel]) => {\n if (dataModel) {\n const axesObj = context.axes();\n const timeDiffs = {};\n const timeDiffsByField = {};\n\n Object.entries(temporalFields(dataModel)).forEach(([fieldName, fieldObj]) => {\n timeDiffsByField[fieldName] = fieldObj.minimumConsecutiveDifference();\n });\n\n Object.entries(context.fields()).forEach(([type, [field]]) => {\n if (field) {\n const timeDiff = timeDiffsByField[`${field}`];\n if (timeDiff) {\n timeDiffs[type] = timeDiff;\n axesObj[type].forEach(axis => axis.minDiff(timeDiff));\n }\n }\n });\n\n context._timeDiffsByField = timeDiffsByField;\n context._timeDiffs = timeDiffs;\n const firebolt = context.firebolt();\n const originalData = context.cachedData()[0];\n const { keys, dimensionsMap, dimensions, allFields } = prepareSelectionSetData(context.data(), context);\n firebolt._metaData = {\n dimensionsMap,\n dimensions,\n allFields\n };\n firebolt.createSelectionSet({ keys, fields: dimensions });\n firebolt.attachPropagationListener(originalData);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.CONFIG],\n listener: (context, [, config]) => {\n if (config) {\n const firebolt = context.firebolt();\n const { interaction } = config;\n firebolt.config(interaction);\n const { mode } = interaction.tooltip;\n if (mode === FRAGMENTED) {\n const map = firebolt._behaviourEffectMap;\n for (const key in map) {\n const sideEffects = map[key];\n\n map[key] = sideEffects.map((val) => {\n let name = val;\n if (isSimpleObject(val)) {\n name = val.name;\n }\n if (name === TOOLTIP) {\n return FRAGMENTED_TOOLTIP;\n }\n return val;\n });\n }\n }\n createGridLineLayer(context);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.DATA, PROPS.TRANSFORM],\n listener: (context, [, dataModel], [, transform]) => {\n if (dataModel) {\n const dataModels = transformDataModels(transform, dataModel);\n const metaInf = context.metaInf();\n context.store().commit(`${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}.${PROPS.TRANSFORMEDDATA}`,\n dataModels, metaInf.namespace);\n }\n }\n },\n {\n type: 'registerImmediateListener',\n props: [PROPS.TRANSFORMEDDATA, PROPS.LAYERS],\n listener: (context, [, transformedData], [, layers]) => {\n const layerAxisIndexVal = context._layerAxisIndex;\n const axesVal = context.axes();\n const dataModel = context.data();\n if (transformedData && layers && axesVal && layerAxisIndexVal) {\n context._lifeCycleManager.notify({ client: layers, action: 'beforeupdate', formalName: 'layer' });\n attachDataToLayers(layers, dataModel, transformedData);\n context._dimensionMeasureMap = getDimensionMeasureMap(layers,\n dataModel.getFieldsConfig(), context.retinalFields());\n attachAxisToLayers(axesVal, layers, layerAxisIndexVal);\n context._lifeCycleManager.notify({ client: layers, action: 'updated', formalName: 'layer' });\n }\n }\n }\n];\n","import { mergeRecursive } from 'muze-utils';\nimport { FACET_BY_FIELDS, RETINAL_FIELDS, PARENT_ALIAS, CACHED_DATA } from './enums/constants';\n\nexport const PROPS = {\n [FACET_BY_FIELDS]: {\n onset: (context, facets) => {\n const facetKeys = facets[0].reduce((acc, v, i) => {\n acc[`${v}`] = facets[1][i];\n return acc;\n }, {});\n context.facetFieldsMap(facetKeys);\n }\n },\n facetFieldsMap: {},\n [RETINAL_FIELDS]: {},\n [PARENT_ALIAS]: {},\n [CACHED_DATA]: {},\n detailFields: {},\n axes: {\n defaultValue: {\n x: [],\n y: []\n }\n },\n fields: {\n defaultValue: {\n x: [],\n y: []\n },\n sanitization: (context, value) => mergeRecursive({\n x: [],\n y: []\n }, value)\n },\n metaInf: {},\n registry: {},\n parentContainerInf: {},\n valueParser: {\n defaultValue: val => val\n },\n coord: {}\n};\n","import { CLASSPREFIX, CONSOLIDATED } from './enums/constants';\n\n/**\n * Returns the default configuration of the visual unit\n * @return {Object} Default configuration of visual unit\n */\nexport const defaultConfig = {\n classPrefix: CLASSPREFIX,\n defClassName: 'visual-unit',\n className: '',\n trackerClassName: 'visual-unit-tracker',\n minOuterRadius: 10,\n gridLines: {\n defClassName: 'axis-grid-lines',\n className: '',\n show: true,\n color: '#efefef',\n zeroLineColor: '#b6b6b6'\n },\n gridBands: {\n defClassName: 'axis-grid-bands',\n className: '',\n show: false,\n y: {\n color: ['#fff', '#fbfbfb']\n },\n x: {\n color: ['#fff', '#f9f9f9']\n }\n },\n arcLayerClassName: 'layer-arc',\n interaction: {\n tooltip: {\n mode: CONSOLIDATED\n }\n },\n sideEffectClassName: 'side-effect-container'\n};\n","import { mergeRecursive, DataModel } from 'muze-utils';\nimport { defaultConfig } from './default-config';\nimport { CONFIG, LAYERDEFS, TRANSFORM, DATA, LAYERS, TRANSFORMEDDATA } from './enums/reactive-props';\nimport { sanitizeLayerDef, getValuesMap } from './helper';\n\nexport default {\n [CONFIG]: {\n value: null,\n meta: {\n sanitization: (config, oldConfig) => (\n mergeRecursive(oldConfig || mergeRecursive({}, defaultConfig), config)\n )\n }\n },\n [LAYERDEFS]: {\n value: null,\n meta: {\n preset: layerDef => sanitizeLayerDef(layerDef)\n }\n },\n [TRANSFORM]: {\n value: null\n },\n [LAYERS]: {\n value: null\n },\n [DATA]: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel,\n preset: (data, context) => {\n context._cachedValuesMap = ((model) => {\n let valuesMap = null;\n return () => {\n if (valuesMap) {\n return valuesMap;\n }\n valuesMap = getValuesMap(model, context);\n return valuesMap;\n };\n })(data);\n if (context._cache) {\n const cachedData = context.cachedData();\n context.cachedData([...cachedData, data]);\n } else {\n const oldData = context.cachedData()[0];\n oldData && oldData.unsubscribe('propagation');\n context.cachedData([data]);\n }\n }\n }\n },\n [TRANSFORMEDDATA]: {\n value: null\n },\n width: {\n value: null\n },\n height: {\n value: null\n }\n};\n","import { VolatileBehaviour } from '@chartshq/muze-firebolt';\nimport { PSEUDO_SELECT } from '../../enums/behaviours';\n\nexport default class PseudoSelectBehaviour extends VolatileBehaviour {\n static formalName () {\n return PSEUDO_SELECT;\n }\n}\n\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n setAttrs,\n getUniqueId,\n getQualifiedClassName,\n selectElement,\n transactor,\n makeElement,\n generateGetterSetters,\n getDataModelFromIdentifiers,\n isSimpleObject,\n transposeArray,\n CommonProps,\n toArray,\n STATE_NAMESPACES,\n FieldType,\n ReservedFields\n} from 'muze-utils';\nimport { behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { actionBehaviourMap } from './firebolt/action-behaviour-map';\nimport UnitBrushBehaviour from './firebolt/behaviours/brush';\nimport {\n renderLayers,\n getNearestDimensionalValue,\n removeLayersBy,\n getLayersBy,\n getLayerFromDef,\n getLayerAxisIndex,\n sanitizeLayerDef,\n createSideEffectGroup,\n resolveEncodingTransform,\n createRenderPromise,\n setAxisRange,\n unionDomainFromLayers,\n createRTree\n} from './helper';\nimport { renderGridLineLayers, attachDataToGridLineLayers } from './helper/grid-lines';\nimport { listenerMap } from './listener-map';\nimport { PROPS } from './props';\nimport UnitFireBolt from './firebolt';\nimport { initSideEffects, dispatchQueuedSideEffects, clearActionHistory } from './firebolt/helper';\nimport './styles.scss';\nimport localOptions from './local-options';\nimport { WIDTH, HEIGHT } from './enums/reactive-props';\nimport { REACTIVE_PROPS } from './enums';\nimport { PSEUDO_SELECT } from './enums/behaviours';\nimport PseudoSelectBehaviour from './firebolt/behaviours/pseudo-select';\n\nconst FORMAL_NAME = 'VisualUnit';\nconst unitNs = [STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE];\nconst groupNs = STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE;\n\n/**\n * Visual Unit is hierarchical component created by {@link VisualGroup}. This component accepts layer definitions\n * and creates concrete layer instances from them, binds data and attaches axis to them. It also retreives the domain\n * from the layers and unions them and sets them on corresponding axis instances. This also creates the parent svg\n * groups for all the layers and delegates the rendering to all the layers.\n *\n * @public\n * @module VisualUnit\n * @class\n */\nexport default class VisualUnit {\n\n /**\n * Creates instance of visualization unit.\n *\n * @param {Object} registry Component registry\n * @param {Object} dependencies Dependencies required by visual unit.\n */\n constructor (registry, dependencies) {\n this._id = getUniqueId();\n this._dependencies = dependencies;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n createRenderPromise(this);\n this._lifeCycleManager = dependencies.lifeCycleManager;\n this._layersMap = {};\n this._gridLinesSelection = null;\n this._gridBandsSelection = null;\n this._gridLines = [];\n this._gridBands = [];\n this._layerAxisIndex = {};\n this._queuedLayerDefs = [];\n layerFactory.setLayerRegistry(registry.layerRegistry);\n generateGetterSetters(this, this.constructor.getterSetters());\n this.registry(registry);\n this.cachedData([]);\n }\n\n static formalName () {\n return FORMAL_NAME;\n }\n\n static getState () {\n return [\n {\n domain: null\n },\n Object.keys((this.localOptions())).reduce((acc, v) => {\n acc[v] = localOptions[v].value;\n return acc;\n }, {})\n ];\n }\n\n static getterSetters () {\n return PROPS;\n }\n\n static localOptions () {\n return localOptions;\n }\n\n static getQualifiedStateProps () {\n const unitState = VisualUnit.getState();\n return unitState.map((state, i) => Object.keys(state).map(prop => `${unitNs[i]}.${prop}`));\n }\n\n static getListeners () {\n return {\n store: [...listenerMap.map((d) => {\n const o = Object.assign({}, d);\n const localNs = unitNs[1];\n o.props = o.props.map(prop => `${localNs}.${prop}`);\n return o;\n }), {\n type: 'registerImmediateListener',\n props: [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`],\n listener: (context) => {\n const domain = context.calculateDomainFromData();\n context.dataDomain(domain);\n }\n }, {\n type: 'registerImmediateListener',\n props: [`${unitNs[1]}.${WIDTH}`,\n `${unitNs[1]}.${HEIGHT}`,\n ...['x', 'y'].map(type => `${groupNs}.domain.${type}`)],\n listener: (context, [, width], [, height]) => {\n if (width && height) {\n attachDataToGridLineLayers(context);\n }\n },\n subNamespace: (context) => {\n const { rowIndex, colIndex, namespace } = context.metaInf();\n return {\n [`${unitNs[1]}.${WIDTH}`]: namespace,\n [`${unitNs[1]}.${HEIGHT}`]: namespace,\n [`${groupNs}.domain.x`]: `${colIndex}0`,\n [`${groupNs}.domain.y`]: `${rowIndex}0`\n };\n }\n }],\n throwback: [\n {\n type: 'registerChangeListener',\n props: [CommonProps.ON_LAYER_DRAW],\n listener: (context, [, drawn]) => {\n if (drawn) {\n context._rtree = createRTree(context);\n\n const firebolt = context.firebolt();\n dispatchQueuedSideEffects(firebolt);\n clearActionHistory(firebolt);\n }\n context._renderedResolve();\n context._lifeCycleManager.notify({\n client: context.layers(),\n action: 'drawn',\n formalName: 'layer'\n });\n }\n }\n ]\n };\n }\n\n store (...params) {\n if (params.length) {\n const store = this._store = params[0];\n const { throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n\n store.addSubNamespace(namespace, FORMAL_NAME, this);\n throwback.addSubNamespace(namespace, FORMAL_NAME, this);\n transactor(this, this.constructor.localOptions(), store, {\n subNamespace: namespace,\n namespace: `${STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE}`\n });\n this.createFireboltInstance();\n\n return this;\n }\n return this._store;\n }\n\n createFireboltInstance () {\n const { interactions } = this.registry();\n const { fireboltDeps } = this._dependencies;\n const Cls = this.getFireboltCls();\n\n this.firebolt(new Cls(this, {\n physical: Object.assign({}, interactions.physicalActions.get(), fireboltDeps.physicalActions),\n behavioural: Object.assign({}, interactions.behaviours.get(), {\n [UnitBrushBehaviour.formalName()]: UnitBrushBehaviour,\n [PSEUDO_SELECT]: PseudoSelectBehaviour\n }, fireboltDeps.behaviouralActions),\n physicalBehaviouralMap: this.getActionBehaviourMap()\n }, Object.assign({}, interactions.sideEffects.get(), fireboltDeps.sideEffects), this.getBehaviourEffectMap()));\n\n return this;\n }\n\n getFireboltCls () {\n return UnitFireBolt;\n }\n\n getBehaviourEffectMap () {\n return behaviourEffectMap;\n }\n\n getActionBehaviourMap () {\n return actionBehaviourMap;\n }\n\n /**\n * Static helper for creates a unit instance\n *\n * @param {Object} [id] optional unique identifier for a unit; , id is calculated internally\n * @param {DataModel} data instance of datamodel\n * @param {Array.} layers layer configuration\n * @param {Object} config configurtion for the visual unit\n * @return {VisualUnit} Instance of a unit\n */\n static create (...params) {\n return new this(...params);\n }\n\n /**\n * Returns the instance of firebolt associated with this visual unit. Firebolt dispatches the behavioural actions\n * when any physical action happens on the elements of visual unit.\n *\n * @public\n *\n * @return {Firebolt} Instance of firebolt.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Returns the unique id of this visual unit.\n *\n * @public\n * @return {string} Unique identifier.\n */\n id () {\n return this._id;\n }\n\n lockModel () {\n this.store().lockModel();\n return this;\n }\n\n unlockModel () {\n this.store().unlockModel();\n return this;\n }\n\n timeDiffsByField (...params) {\n if (params.length) {\n return this;\n }\n return this._timeDiffsByField;\n }\n\n /**\n * Renders the visual unit. It creates the layout and renders the axes and layers.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n render (container) {\n this.createRootContainers(container);\n\n setAxisRange(this);\n this.renderLayers();\n const node = this._rootSvg.node();\n const { sideEffectClassName, classPrefix } = this.config();\n this._sideEffectGroup = createSideEffectGroup(node, `${classPrefix}-${sideEffectClassName}`);\n const firebolt = this.firebolt();\n initSideEffects(firebolt.sideEffects(), firebolt);\n return this;\n }\n\n createRootContainers (container) {\n const config = this.config();\n const { className, defClassName } = config;\n const qualifiedClassName = getQualifiedClassName(defClassName, this.id(), config.classPrefix);\n const width = this.width();\n const height = this.height();\n const containerSelection = selectElement(container).style('position', 'relative');\n this._rootSvg = makeElement(containerSelection, 'svg', [null], className)\n .style('width', `${width}px`).style('height', `${height}px`);\n\n const node = this._rootSvg.node();\n\n setAttrs(node, {\n width,\n height,\n class: qualifiedClassName.join(' ')\n });\n return this;\n }\n\n renderLayers () {\n const width = this.width();\n const height = this.height();\n const node = this._rootSvg.node();\n\n renderGridLineLayers(this, node);\n renderLayers(this, node, this.layers(), {\n width,\n height\n });\n return this;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Caches all the datamodels in an array from the next `data()` call on visual unit until `clearCaching()` or\n * `resetData()` is called on it.\n *\n * @public\n * @return {VisualUnit} Instance of visual unit.\n */\n\n enableCaching () {\n this._cache = true;\n return this;\n }\n\n /**\n * Clears all the previous cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n clearCaching () {\n this._cache = false;\n this.cachedData([this.cachedData()[0]]);\n return this;\n }\n\n /**\n * Returns the drawing information from visual unit.Drawing context contains the dimensions of unit and the svg\n * container of the visual unit.\n *\n * @public\n *\n * @return {Object} Drawing information.\n * ```\n * {\n * htmlContainer: // Html container of svg container of the visual unit\n * svgContainer: // Root svg container\n * width: // Width of the visual unit\n * height: // Height of the visual unit\n * sideEffectGroup: // Svg group for drawing side effect elements.\n * parentContainer: // Parent html container of the visual unit.\n * xOffset: // x offset space from the starting x position of the container,\n * yOffset: // y offset space from the starting y position of the container\n * }\n * ```\n */\n getDrawingContext () {\n const rootSvg = this._rootSvg && this._rootSvg.node();\n const width = this.width();\n const height = this.height();\n const { el, dimensions } = this.parentContainerInf();\n return {\n htmlContainer: this.mount(),\n svgContainer: rootSvg,\n width,\n height,\n sideEffectGroup: this._sideEffectGroup,\n parentContainer: el,\n parentContainerDimensions: dimensions,\n xOffset: 0,\n yOffset: 0\n };\n }\n\n /**\n * Returns the serialized configuration of visual unit.\n *\n * @return {Object} serialized configuration\n */\n serialize () {\n return {\n layers: this.layers().map(layer => layer.serialize()),\n config: this.config(),\n axes: this.axes().map(axis => axis.serialize())\n };\n }\n\n mount (...mount) {\n if (mount.length) {\n this._mount = mount[0];\n this.render(mount[0]);\n return this;\n }\n return this._mount;\n }\n\n /**\n * Adds a new layer to the visual unit. It takes a layer definition and creates layer instances from them. It does\n * not render the layers. It returns the layer instances in an array. If the layer definition is a composite layer,\n * then multiple layer instances will be returned in the array.\n *\n * To add a layer in the unit,\n * ```\n * unit.addLayer({\n * name: 'bullet',\n * mark: 'bar',\n * encoding: {\n * x: 'Year',\n * y: 'Acceleration',\n * color: 'Origin'\n * }\n * });\n * ```\n * @public\n * @param {Object} layerDef Definition of new layer.\n *\n * @return {Array} Array of layer instances.\n */\n addLayer (layerDefinition) {\n if (layerDefinition instanceof Function) {\n this._queuedLayerDefs.push(layerDefinition);\n return this;\n }\n const layerDefinitions = sanitizeLayerDef(toArray(layerDefinition));\n\n const layersMap = this._layersMap;\n const markSet = {};\n const store = {\n layers: {},\n components: {\n unit: this\n }\n };\n let layerIndex = 0;\n const metaInf = this.metaInf();\n const layers = layerDefinitions.sort((a, b) => a.order - b.order).reduce((layersArr, layerDef) => {\n const definition = layerDef.def;\n const markId = definition.name;\n const defArr = toArray(definition);\n const namespaces = [];\n defArr.forEach((def) => {\n def.order = layerDef.order + layerIndex;\n const namespace = `${metaInf.namespace}-${def.mark}-${getUniqueId()}`;\n namespaces.push(namespace);\n });\n layerIndex += defArr.length;\n const instances = getLayerFromDef(this, definition, layersMap[markId], namespaces);\n store.layers = Object.assign(store.layers, instances);\n const instanceValues = Object.values(instances);\n layersArr = layersArr.concat(...instanceValues);\n layersMap[markId] = instanceValues;\n markSet[markId] = markId;\n return layersArr;\n }, []);\n\n store.unit = this;\n const layerdeps = {};\n const layersArr = [].concat(...Object.values(this._layersMap));\n layersArr.forEach((layer) => {\n const alias = layer.alias();\n store.layers[alias] = layer;\n layerdeps[alias] = [];\n });\n layers.forEach((layer) => {\n const depArr = resolveEncodingTransform(layer, store);\n layerdeps[layer.alias()] = depArr;\n });\n\n this._layerDepOrder = layerdeps;\n this._layerAxisIndex = Object.assign(this._layerAxisIndex, getLayerAxisIndex(layers, this.fields()));\n this.layers(layersArr);\n return layers;\n }\n\n remove () {\n const formalName = this.constructor.formalName();\n const { lifeCycleManager, throwback } = this._dependencies;\n const { namespace } = this.metaInf();\n lifeCycleManager.notify({ client: this, action: 'beforeremove', formalName: 'unit' });\n const layers = this.layers();\n this.store().removeSubNamespace(namespace, formalName);\n throwback.removeSubNamespace(namespace, FORMAL_NAME);\n selectElement(this.mount()).remove();\n this.firebolt().remove();\n // Remove layers\n lifeCycleManager.notify({ client: layers, action: 'beforeremove', formalName: 'layer' });\n [...layers, ...this._gridLines, ...this._gridBands].forEach(layer => layer.remove());\n lifeCycleManager.notify({ client: layers, action: 'removed', formalName: 'layer' });\n lifeCycleManager.notify({ client: this, action: 'removed', formalName: 'unit' });\n return this;\n }\n\n /**\n *\n *\n * @param {*} identifiers\n *\n * @memberof VisualUnit\n */\n getDataModelFromIdentifiers (identifiers, mode, parentModel, hasBarLayer) {\n if (!identifiers) return null;\n const dataModel = parentModel || this.data();\n return getDataModelFromIdentifiers(dataModel, identifiers, mode, hasBarLayer);\n }\n\n /**\n * Resets the data of visual unit to original data model. It also clears the cached data.\n *\n * @public\n * @segment VisualUnit\n * @return {VisualUnit} Instance of visual unit.\n */\n resetData () {\n this.data(this.cachedData()[0]);\n return this;\n }\n\n getSourceInfo () {\n return {\n dimensionMeasureMap: this._dimensionMeasureMap,\n fields: this.fields(),\n data: this.data(),\n axes: this.axes(),\n retinalFields: this.retinalFields(),\n layers: this.layers(),\n timeDiffs: this.timeDiffsByField()\n };\n }\n\n dataDomain (...params) {\n const { namespace } = this.metaInf();\n const store = this.store();\n const prop = `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.${REACTIVE_PROPS.DOMAIN}`;\n if (params.length) {\n const domain = params[0];\n store.commit(prop, domain, namespace);\n }\n return store.get(prop, namespace);\n }\n\n getDefaultTargetContainer () {\n const { classPrefix, defClassName } = this.config();\n return [`.${classPrefix}-${defClassName}`];\n }\n\n /**\n * Returns an array of layer instances which matches the supplied mark type.\n *\n * @public\n *\n * @param {string} type Mark type of layer.\n *\n * @return {Array} Array of layer instances.\n */\n getLayersByType (type) {\n const layers = getLayersBy(this.layers(), 'type', type);\n return layers;\n }\n\n /**\n * Returns the layer instance which matches the supplied layer name. If no layer is found, then it returns\n * undefined.\n *\n * @public\n * @param {string} name Name of layer.\n *\n * @return {VisualUnit} Layer instance.\n */\n getLayerByName (name) {\n const layers = getLayersBy(this.layers(), 'name', name);\n return layers[0];\n }\n\n /**\n * Returns the point located nearest to the supplied x and y position. It returns the unique identifiers of the\n * point. This function also accepts an additional configuration `getAllPoints` inside `config` object in the third\n * argument which if set to true, then it returns the identifiers of all the points which falls on the nearest\n * x value or y value if any one of the field is a dimension. Additionally, a target property is also returned\n * which contains the identifier of the nearest point. If no nearest point is found, then it returns identifier\n * as null.\n *\n * @public\n *\n * @param {number} x X Position of the point from where nearest point is to be found.\n * @param {number} y Y Position of the point from where nearest point is to be found.\n * @param {Object} config Additional configuration options.\n * @param {boolean} config.getAllPoints If true, then returns all the points nearest to the x value or y value if\n * it is dimension.\n * @param {Object} config.data Data associated with the nearest point.\n * @return {Object} Nearest point information\n * ```\n * {\n * id: [['Origin'], ['USA'], ['Japan']], // Identifiers of all the points closest to the x value.\n * target: [['Origin'], ['Japan']] // Identifier of the nearest point.\n * }\n * ```\n */\n getNearestPoint (x, y, config) {\n let pointObj = {\n id: null\n };\n const dimValue = getNearestDimensionalValue(this, {\n x,\n y\n });\n\n if (dimValue !== null && config.getAllPoints) {\n dimValue[0].push(ReservedFields.MEASURE_NAMES);\n pointObj.id = dimValue;\n const layers = this.layers();\n const pointInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue });\n layers.forEach((layer) => {\n const measures = layer.data().getSchema()\n .filter(d => d.type === FieldType.MEASURE).map(d => d.name);\n for (let i = 1, len = dimValue.length; i < len; i++) {\n dimValue[i].push(measures.join());\n }\n });\n pointObj.target = pointInf && pointInf.id ? pointInf.id : null;\n return pointObj;\n }\n\n const markInf = this.getMarkInfFromLayers(x, y, { ...config, dimValue }) || { id: null };\n pointObj = Object.assign({}, markInf);\n\n pointObj.target = markInf.id;\n return pointObj;\n }\n\n getMarkInfFromLayers (x, y, args) {\n const layers = this.layers();\n const len = layers.length;\n let point = null;\n // Iterate through the layers array and fetch the nearest point from each layer. If a valid\n // nearest point is found from any layer, then return that point.\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n const config = layer.config();\n if (config.interactive !== false) {\n point = layer.getNearestPoint(x, y, args);\n }\n if (point) {\n return point;\n }\n }\n return point;\n }\n\n /**\n * Get the information of all the marks such as x, y position and size from supplied identifiers. It\n * returns an array of points whose data matches the given identifiers.\n *\n * @public\n *\n * @param {Array|Object} identifiers Field names and their corresponding values.\n * ```\n * identifiers can be given in an array of array,\n * ['Origin', 'Name'], // Names of the fields supplied in first array\n * ['USA', 'ford'], // Data values of each field supplied in rest of the arrays.\n * ['Japan', 'ford']\n * or in an object,\n * {\n * Origin: ['USA']\n * }\n * ```\n * @param {Object} config Optional configurations which decides which information of the mark will\n * be retrieved.\n * @param {boolean} [config.getAllAttrs = false] If true, then returns all the information of each mark.\n * @param {boolean} [config.getBBox = false] If true, then returns the bounding box of each mark.\n *\n * @return {Array} Array of objects containing the information of each point.\n * ```\n * By default, the method returns the array of points in this structure,\n * [\n * {\n * x: 20,\n * y: 100,\n * width: 200,\n * height: 100\n * }\n * ]\n * If 'config.getAllAttrs' is true, then it returns all the information of each mark,\n * [\n * // Positions of mark on initial state of transition.\n * enter: {\n * x: 0,\n * y: 0\n * },\n * // Final positions of the mark\n * update: {\n * x: 20,\n * y: 10\n * },\n * style: // css styles of each mark\n * source: [200, 'USA'] // Row information of each mark\n * id: 20 // Row id of each mark\n * ]\n * ```\n */\n getPlotPointsFromIdentifiers (identifiers, config = {}) {\n let points = [];\n let parsedIdentifiers = identifiers;\n if (identifiers === null) {\n return [];\n }\n const layers = this.layers();\n const len = layers.length;\n if (isSimpleObject(identifiers)) {\n parsedIdentifiers = [Object.keys(identifiers)];\n parsedIdentifiers = [...parsedIdentifiers, ...transposeArray(Object.values(identifiers))];\n }\n for (let i = 0; i < len; i++) {\n const layer = layers[i];\n if (layer.config().interactive !== false) {\n points = [...points, ...layer.getPointsFromIdentifiers(parsedIdentifiers, config)];\n }\n }\n return points;\n }\n\n /**\n * Removes the layer instance which matches the supplied layer name.\n *\n * @public\n * @param {string} name Name of layer\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayerByName (name) {\n removeLayersBy('name', name);\n return this;\n }\n\n /**\n * Removes all the layer instances which matches the supplied mark type.\n *\n * @public\n * @param {string} type Mark type of layer.\n *\n * @return {VisualUnit} Instance of visual unit.\n */\n removeLayersByType (type) {\n removeLayersBy('type', type);\n return this;\n }\n\n calculateDomainFromData () {\n const domain = unionDomainFromLayers(this.layers(), this.fields(), this._layerAxisIndex,\n this.data().getFieldsConfig());\n return domain;\n }\n\n getValueFromId (id, fields, fieldsConfig) {\n const { idValuesMap } = this._cachedValuesMap();\n const row = idValuesMap[id];\n const filteredRow = fields.map(d => (d === ReservedFields.ROW_ID ? id : row[fieldsConfig[d].index]));\n\n return filteredRow;\n }\n\n getRangeFromIdentifiers ({ criteria, fields }) {\n return fields.reduce((acc, v) => {\n acc[v] = criteria[v];\n return acc;\n }, {});\n }\n\n getRangeFromPositions ({ startPos, endPos }) {\n const { x, y } = this.fields();\n const axes = this.axes();\n const xField = x[0];\n const yField = y[0];\n const xFieldType = x[0].type();\n const yFieldType = y[0].type();\n const dimensions = Object.keys(this.data().getFieldspace().getDimension());\n\n if (xFieldType === FieldType.MEASURE && yFieldType === FieldType.MEASURE) {\n const dom = {\n x: axes.x[0].invertExtent(startPos.x, endPos.x).sort((a, b) => a - b),\n y: axes.y[0].invertExtent(startPos.y, endPos.y).sort((a, b) => a - b)\n };\n const range = {};\n if (`${xField}` === `${yField}`) {\n const xdom = dom.x;\n const ydom = dom.y;\n const min = xdom[0] > ydom[0] ? ydom : xdom;\n const max = min === ydom ? xdom : ydom;\n if (min[1] < max[0]) {\n range[xField] = [];\n } else {\n range[xField] = [max[0], min[1] < max[1] ? min[1] : max[1]];\n }\n } else {\n range[xField] = dom.x;\n range[yField] = dom.y;\n }\n return range;\n } else if (xFieldType === FieldType.DIMENSION || yFieldType === FieldType.DIMENSION) {\n const points = this._rtree.search({\n minX: startPos.x,\n minY: startPos.y,\n maxX: endPos.x,\n maxY: endPos.y\n });\n\n const criteria = [[]];\n dimensions.forEach((field) => {\n criteria[0].push(`${field}`);\n });\n\n points.forEach((point) => {\n const data = point.data;\n const vals = [];\n dimensions.forEach((field) => {\n vals.push(data[field]);\n });\n criteria.push(vals);\n });\n return criteria;\n }\n return null;\n }\n}\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n *\n *\n * @export\n * @class Variable\n */\nexport default class Variable {\n\n /**\n *\n *\n * @memberof Variable\n */\n type () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof Variable\n */\n toString () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n}\n","import Variable from './variable';\n\n/**\n * This is a wrapper on top of multiple variables which are of same type but they are shown in the same axis.This is\n * required in case of range plots or ohlc plots where one plot is mapped to multiple measure fields. At that time,\n * we need to create a composed variable from multiple variables. This class just wraps them into one variable instance\n * and provides methods to get the type and other common functionalities which can be performed on a simple variable\n * instance.\n *\n * @public\n * @class ComposeVars\n */\nclass ComposedVars extends Variable {\n\n /**\n * Creates an instance of ComposeVars.\n *\n * @param {Array} vars Array of SimpleVars.\n */\n constructor (...vars) {\n super();\n this.vars(vars);\n }\n\n vars (...params) {\n if (params.length) {\n this._vars = params[0];\n return this;\n }\n return this._vars;\n }\n\n data (...dm) {\n if (dm.length) {\n this.vars().forEach(d => d.data(dm[0]));\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n /**\n * Get all the field names from composed variable instance.\n *\n * @public\n * @return {Array} Array of field names.\n */\n getMembers () {\n const vars = this.vars();\n return vars.map(member => member.getMembers()[0]);\n }\n\n /**\n * Type of field associated with this composed variable.\n *\n * @return {string} Type of variable (Measure/Dimension).\n */\n type () {\n return this.vars()[0].type();\n }\n\n toString () {\n return this.vars().map(d => d.toString()).join(',');\n }\n\n /**\n * Returns the number formatter function of the variable.\n *\n * @return {Function} Number formatter function of the variable.\n */\n numberFormat () {\n return this.vars()[0].numberFormat();\n }\n\n format (values) {\n return this.vars()[0].format(values);\n }\n\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.vars()[0]].def;\n }\n\n /**\n * Returns the subtype of the fields associated with this variable instance.\n *\n * @public\n * @return {string} Subtype of the variable.\n */\n subtype () {\n return this.vars()[0].subtype();\n }\n\n /**\n * Returns the consecutive minimum difference of the field values.\n *\n * @public\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n return this.vars()[0].getMinDiff();\n }\n\n /**\n * Returns the display name of the fields.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return this.vars().map(d => d.displayName()).join(',');\n }\n}\n\nexport default ComposedVars;\n","import { DateTimeFormatter, retrieveFieldDisplayName, DimensionSubtype } from 'muze-utils';\nimport Variable from './variable';\n\n/**\n * This is a wrapper on top of fields passed in rows or columns in canvas. This is used to get the type of field or\n * get min difference from the field values.\n *\n * @public\n * @class SimpleVariable\n */\nexport default class SimpleVariable extends Variable {\n\n /**\n * Creates an instance of simple variable instance.\n *\n * @param {string} name Field name.\n */\n constructor (name) {\n super();\n this.oneVar(name);\n }\n\n /**\n * Gets the field name associated with this variable instance.\n *\n * @public\n * @return {string} Name of the field.\n */\n oneVar (...oneV) {\n if (oneV.length) {\n this._oneVar = oneV[0];\n return this;\n }\n return this._oneVar;\n }\n\n data (...dm) {\n if (dm.length) {\n this._data = dm[0];\n return this;\n }\n return this._data;\n }\n\n toString () {\n return this.oneVar();\n }\n\n /**\n * Gets the number formatter function of this variable.\n *\n * @public\n * @return {Function} Number formatter function.\n */\n numberFormat () {\n if (this.type() === 'measure') {\n const formatter = this.data().getFieldspace().getMeasure()[this.oneVar()];\n return formatter.numberFormat();\n } return val => val;\n }\n\n format (values) {\n if (values && this.subtype() === 'temporal') {\n const formatter = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n const dtFormat = new DateTimeFormatter(formatter);\n values = values.map(e => dtFormat.getNativeDate(e));\n }\n return values;\n }\n\n /**\n * Returns a formatter function which transforms the input value to its original form.\n *\n * @public\n * @return {Function} Returns raw formatter function.\n */\n rawFormat () {\n if (this.subtype() === DimensionSubtype.TEMPORAL) {\n const dateFormat = this.data().getFieldspace().getDimension()[this.oneVar()].schema().format;\n return val => DateTimeFormatter.formatAs(val, dateFormat);\n }\n return val => val;\n }\n\n /**\n * Return the field names associated with this variable instance.\n *\n * @public\n * @return {Array} Array of fields.\n */\n getMembers () {\n return [this.oneVar()];\n }\n\n /**\n * Returns the type of the variable. Whether it is measure or dimension.\n *\n * @public\n * @return {string} Type of variable.\n */\n type () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.type;\n }\n\n /**\n * Returns the subtype of the variable. Subtype can be categorical or temporal. If no subtype is found, then it\n * returns the type of the variable.\n *\n * @public\n * @return {string} Subtype of variable.\n */\n subtype () {\n const fieldDef = this.data().getFieldsConfig()[this.oneVar()].def;\n return fieldDef.subtype || fieldDef.type;\n }\n\n /**\n * Returns the minimum consecutive difference between the data values of this variable.\n *\n * @return {number} Minimum consecutive difference.\n */\n getMinDiff () {\n const fieldSpace = this.data().getFieldspace();\n return fieldSpace.fieldsObj()[this.oneVar()].minimumConsecutiveDifference();\n }\n\n /**\n * Returns true if two variable instances are same.If both variable has the same field names, they are equal.\n *\n * @return {Boolean} Whether two variable instances are same.\n */\n equals (varInst) {\n return this.oneVar() === varInst.oneVar();\n }\n\n /**\n * Returns the display name of the field.\n *\n * @return {string} returns the display name.\n */\n displayName () {\n return retrieveFieldDisplayName(this.data(), this.oneVar());\n }\n\n /**\n * Returns the schema defination of the field.\n *\n * @return {Object} schema def\n */\n getSchemaDef () {\n return this.data().getFieldsConfig()[this.oneVar()].def;\n }\n}\n","import { ComposedVars, SimpleVariable } from '../variable';\nimport { DIMENSION, COLUMNS, ROWS, TEMPORAL } from '../enums/constants';\n\n/**\n * Gets the list of fields in a sorted order by measurement and dimension\n *\n * @param {Array} fieldList List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields sorted by measurement and dimensions\n */\nconst orderFields = (fieldArray, type) => {\n const dimensionArr = [[], []];\n const measureArr = [[], []];\n const temporalArr = [[], []];\n const categoricalArr = [[], []];\n\n fieldArray.forEach((fieldList, index) => {\n fieldList.forEach((field) => {\n if (field.type() === DIMENSION) {\n dimensionArr[index].push(field);\n field.subtype() === TEMPORAL ? temporalArr[index].push(field) : categoricalArr[index].push(field);\n } else {\n measureArr[index].push(field);\n }\n });\n });\n\n const numOfMeasures = measureArr[0].length + (measureArr[1] ? measureArr[1].length : 0);\n\n // Single array of fields\n if (!fieldArray[1]) {\n // Push measures to bottom\n measureArr[1] = type === COLUMNS ? measureArr[0] : [];\n // Push measures to left\n measureArr[0] = type !== COLUMNS ? measureArr[0] : [];\n // Bottom and right dimensions empty\n dimensionArr[1] = [];\n // Left and top filled with dimensions\n dimensionArr[0] = dimensionArr[0];\n if (numOfMeasures === 0) {\n const allDimensions = [...dimensionArr[0], ...dimensionArr[1]];\n if (type === COLUMNS) {\n dimensionArr[1] = allDimensions[allDimensions.length - 1] ? [allDimensions[allDimensions.length - 1]]\n : [];\n allDimensions.splice(-1, 1);\n } else {\n dimensionArr[1] = [];\n }\n dimensionArr[0] = [...allDimensions];\n }\n }\n\n if (dimensionArr[0].length && dimensionArr[1].length && numOfMeasures > 0) {\n dimensionArr[0] = [...dimensionArr[0], ...dimensionArr[1]];\n dimensionArr[1] = [];\n }\n return {\n fields: dimensionArr.map((list, i) => (i === 1 ?\n measureArr[i].concat(dimensionArr[i]) : dimensionArr[i].concat(measureArr[i]))),\n dimensions: [...dimensionArr[0], ...dimensionArr[1]],\n measures: [...measureArr[0], ...measureArr[1]],\n temporal: [...temporalArr[0], ...temporalArr[1]],\n categorical: [...categoricalArr[0], ...categoricalArr[1]]\n };\n};\n\n/**\n * Gets the list of normalized fields\n *\n * @param {Array} fields List of fields in the view\n * @param {Object} fieldMap Mapping of fields in the datamodel\n * @return {Array} fields normalized by measurement and dimensions\n */\nconst normalizeFields = (config, type) => {\n const fieldsArr = [];\n const fields = config[type];\n\n if (!(fields[0] instanceof Array)) {\n fieldsArr[0] = fields;\n } else {\n fieldsArr[0] = fields[0] || [];\n fieldsArr[1] = fields[1] || [];\n }\n return fieldsArr;\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} datamodel\n *\n */\nconst convertToVar = (datamodel, fields) => {\n const vars = [];\n\n fields && fields.forEach((field) => {\n if (field instanceof ComposedVars) {\n vars.push(field);\n field.data(datamodel);\n } else {\n vars.push(new SimpleVariable(field).data(datamodel));\n }\n });\n return vars;\n};\n\n/**\n *\n *\n * @param {*} rows\n * @param {*} columns\n * @param {*} datamodel\n *\n */\nexport const transformFields = (datamodel, config) => {\n const [rowsInfo, columnsInfo] = [ROWS, COLUMNS].map((fields) => {\n const normalizedFields = normalizeFields(config, fields);\n const norFields = [convertToVar(datamodel, normalizedFields[0])];\n\n if (normalizedFields[1]) {\n norFields[1] = convertToVar(datamodel, normalizedFields[1]);\n }\n return orderFields(norFields, fields);\n });\n const {\n fields: rows,\n dimensions: rowDimensions,\n measures: rowMeasures,\n temporal: rowTemporalFields,\n categorical: rowCategoricalFields\n } = rowsInfo;\n const {\n fields: columns,\n dimensions: columnDimensions,\n measures: columnMeasures,\n temporal: columnTemporalFields,\n categorical: columnCategoricalFields\n } = columnsInfo;\n return {\n rows,\n rowDimensions,\n rowMeasures,\n rowTemporalFields,\n rowCategoricalFields,\n columns,\n columnTemporalFields,\n columnCategoricalFields,\n columnDimensions,\n columnMeasures\n };\n};\n","/**\n * This file exports variables that are used as defaults for the crosstab group.\n */\nexport const DATA_UPDATE_COUNTER = 0;\n\nexport const DEFAULT_LAYER_TYPE = 'cartesian';\n\nexport const BORDER_WIDTH = {\n default: 2,\n facet: 1\n};\n","import {\n DARK,\n NONE,\n LEFT,\n RIGHT,\n NORMAL,\n TOP,\n DARKER,\n BOTTOM\n} from '../enums/constants';\n\nconst handleBlankCell = (data) => {\n data.config().externalClassname.push(`${NONE}-${LEFT}`);\n data.config().externalClassname.push(`${NONE}-${RIGHT}`);\n};\n\nexport const sanitiseHeaderMatrix = (matrices, header) => {\n if (header) {\n for (let i = 0; i < matrices.length; i++) {\n if (i !== 0) {\n matrices[i].config({\n externalClassname: [`${DARK}`]\n });\n } else {\n matrices[i].config({\n externalClassname: [`${NONE}-${LEFT}`, `${DARK}`]\n });\n }\n }\n } else {\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [`${DARK}`]\n });\n }\n }\n }\n};\n\nexport const sanitiseGeomMatrix = (matrices, arr = {}) => {\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [`${NORMAL}`]\n });\n\n if (i === 0) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${TOP}`);\n } else if (i === matrices.length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n }\n\n if (j === matrices[i].length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARK}-${RIGHT}`);\n }\n\n if (arr[i]) {\n matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n }\n }\n};\n\nexport const sanitiseFacetValues = (matrices, type, blankCell) => {\n const normal = type === `${RIGHT}` ? `${DARK}` : `${NORMAL}`;\n const length = matrices.length;\n let latestSource = matrices[0][0].source();\n const lastSource = matrices[matrices.length - 1][0].source();\n const arr = {};\n\n // initialise the classname\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n matrices[i][j].config({\n externalClassname: [normal]\n });\n }\n\n // seperate wrt the corner most facet\n if (matrices[i][0].source() !== latestSource) {\n arr[i] = i;\n latestSource = matrices[i][0].source();\n }\n }\n\n // add custom classname\n for (let i = 0; i < matrices.length; i++) {\n for (let j = 0; j < matrices[0].length; j++) {\n if (j === 0) {\n matrices[i][0].config().externalClassname.push(`${NONE}-${type}`);\n if (matrices[i][j].source() === lastSource) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n } else {\n matrices[i][0].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n if (matrices[i][j] instanceof blankCell) {\n matrices[i][j].config().externalClassname.push(`${NONE}-${TOP}`);\n matrices[i][j].config().externalClassname.push(`${NONE}-${BOTTOM}`);\n }\n } else if (j !== matrices[i].length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARK}-${type}`);\n }\n\n if (i === 0) {\n matrices[0][j].config().externalClassname.push(`${DARKER}-${TOP}`);\n } else if (i === length - 1) {\n matrices[i][j].config().externalClassname.push(`${DARKER}-${BOTTOM}`);\n }\n\n if (arr[i]) {\n matrices[i - 1][j].config().externalClassname.push(`${DARK}-${BOTTOM}`);\n }\n\n if (matrices[i][j] instanceof blankCell) {\n handleBlankCell(matrices[i][j], blankCell);\n }\n }\n }\n return arr;\n};\n\nexport const sanitiseBorderMatrix = (matrices, blankCell) => {\n const { leftMatrix, rightMatrix, topMatrix, bottomMatrix } = matrices;\n let bottomBorderObj = {};\n if (rightMatrix.length) {\n bottomBorderObj = sanitiseFacetValues(rightMatrix, `${RIGHT}`, blankCell);\n }\n if (leftMatrix.length) {\n bottomBorderObj = sanitiseFacetValues(leftMatrix, `${LEFT}`, blankCell);\n }\n topMatrix.length && sanitiseHeaderMatrix(topMatrix);\n bottomMatrix.length && sanitiseHeaderMatrix(bottomMatrix);\n return bottomBorderObj;\n};\n","import { Store, COORD_TYPES, getObjProp, DataModel } from 'muze-utils';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { DATA_UPDATE_COUNTER } from '../enums/defaults';\nimport { Variable } from '../variable';\nimport { PolarEncoder, CartesianEncoder } from '../encoder';\nimport { sanitiseHeaderMatrix } from './cell-border-applier';\nimport {\n DIMENSION,\n MEASURE,\n ORDINAL,\n LINEAR,\n ROW,\n COLUMN,\n COL,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n COLOR,\n SIZE,\n TEMPORAL,\n SHAPE,\n INTERACTION,\n GRID_LINES,\n GRID_BANDS,\n HEADER,\n FACET,\n X,\n Y,\n ARC,\n RADIUS,\n ANGLE\n} from '../enums/constants';\n\nconst POLAR = COORD_TYPES.POLAR;\n\n/**\n * Creates an instance of a store which contains the arguments to make the class reactive\n *\n * @return {Object} instance of store\n * @memberof VisualGroup\n */\nexport const initStore = () => new Store({\n [DATA_UPDATE_COUNTER]: DATA_UPDATE_COUNTER\n});\n\n/**\n *\n *\n * @param {*} arr\n */\nexport const isDistributionEqual = arr => [...arr[0], ...arr[1]].reduce((isEqual, row) => {\n const rowType = row.type();\n\n if (rowType === MEASURE || rowType === TEMPORAL) {\n isEqual = true;\n }\n return isEqual;\n}, false);\n\n/**\n *\n *\n */\nexport const initializeCacheMaps = () => ({\n cellMap: new Map(),\n xAxesMap: new Map(),\n yAxesMap: new Map(),\n entryCellMap: new Map(),\n exitCellMap: new Map()\n});\n\n/**\n *\n *\n * @param {*} axisName\n * @param {*} id\n */\nexport const getAxisKey = (axisName, ...params) => `${axisName}-axis-${params.join('-')}`;\n\n/**\n *\n *\n * @param {*} rowId\n * @param {*} columnId\n */\nexport const getCellKey = (rowId, columnId) => `cell-${rowId}-${columnId}`;\n\n/**\n *\n *\n * @param {*} config\n *\n */\nexport const extractUnitConfig = (config) => {\n const unitConfig = {};\n const attrNames = [INTERACTION, GRID_LINES, GRID_BANDS];\n\n attrNames.forEach((attr) => {\n if (config[attr] !== undefined) {\n unitConfig[attr] = config[attr];\n }\n });\n return unitConfig;\n};\n\nexport const hasOneField = (fields) => {\n let hasField = false;\n const keys = Object.keys(fields);\n hasField = keys.some(d => fields[d].length > 0);\n return hasField;\n};\n\n/**\n *\n *\n * @param {*} headers\n * @param {*} index\n * @param {*} rowLength\n *\n * @memberof MatrixResolver\n */\nexport const getHeaderText = (headers, index, rowLength) => {\n let header = '';\n\n if (index === rowLength - 1 && headers.length > rowLength) {\n for (let i = index; i < headers.length - 1; i++) {\n header += `${headers[i].toString()} / `;\n }\n header += headers[headers.length - 1].toString();\n return header;\n } else if (headers[index]) {\n return headers[index].toString();\n }\n return '';\n};\n\n/**\n *\n *\n * @param {*} fields\n * @param {*} fieldHeaders\n * @param {*} TextCell\n * @param {*} labelManager\n *\n */\nexport const headerCreator = (fields, fieldHeaders, TextCell, { classPrefix, labelManager }) => {\n const headers = fields.length > 0 ? fields[0].map((cell, i) => new TextCell({\n type: HEADER,\n className: `${classPrefix}-grid-headers`\n }, {\n labelManager\n }).source(getHeaderText(fieldHeaders, i, fields[0].length))\n .config({ show: cell.config().show })) : [];\n sanitiseHeaderMatrix(headers, true);\n return headers;\n};\n\n/**\n *\n *\n * @param {*} variable\n * @param {*} allFields\n *\n */\nexport const findInGroup = (variable, allFields) => {\n let channel = null;\n\n [COLOR, SIZE, SHAPE].forEach((e) => {\n if (this.store.get(e) && variable === this.store.get(e)[0]) {\n channel = e;\n }\n });\n\n if (channel) {\n return { channel };\n }\n [ROW, COL].forEach((facetType) => {\n allFields[`${facetType}Facets`].forEach((e) => {\n if (e.toString() === variable) {\n channel = { channel: FACET, type: facetType === COL ? COLUMN : ROW };\n }\n });\n });\n\n if (channel) {\n return channel;\n }\n\n [ROW, COL].forEach((projType) => {\n allFields[`${projType}Projections`].forEach((e) => {\n e.forEach((m) => {\n if (m.toString() === variable) {\n channel = projType === COL ? X : Y;\n }\n });\n });\n });\n\n if (channel) {\n return { channel };\n }\n return null;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} field\n */\nexport const getAxisType = (fieldsConfig, field) => {\n let fieldType = ORDINAL;\n\n if (field && fieldsConfig[field].def.type !== DIMENSION) {\n fieldType = LINEAR;\n }\n return fieldType;\n};\n\n/**\n *\n *\n * @param {*} datamodel\n * @param {*} fieldName\n *\n */\nexport const retriveDomainFromData = (datamodel, fieldName) => {\n const field = datamodel.getFieldspace().fields.find(d => d.name() === fieldName.toString());\n return field.domain();\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n let xAxes = null;\n let yAxes = null;\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n\n xAxisSet && xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes = xAxes || [];\n xAxes.push(xAxis);\n });\n\n yAxisSet && yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes = yAxes || [];\n yAxes.push(yAxis);\n });\n\n return {\n xAxes, yAxes\n };\n};\n\nconst hasPolarEncodings = layerConf => layerConf.mark === ARC || [RADIUS, ANGLE].some(field =>\n getObjProp(layerConf.encoding, field));\n\n/**\n *\n *\n * @param {*} layers\n *\n */\nexport const getEncoder = (layers) => {\n let encoder = new CartesianEncoder();\n\n if (layers.length) {\n // Figuring out the kind of layers the group will have\n encoder = layers.some(layerConf => hasPolarEncodings(layerConf)) ? new PolarEncoder() : encoder;\n }\n return encoder;\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} userAxisFromConfig\n *\n */\nexport const getHeaderAxisFrom = (type, fields, userAxisFromConfig) => {\n let axisFrom = userAxisFromConfig[type];\n let headerFrom = '';\n const options = type === ROW ? [LEFT, RIGHT] : [BOTTOM, TOP];\n const [firstField, secondField] = fields;\n const firstFieldType = i => (firstField.length ? firstField[i].type() : null);\n const secondFieldType = i => (secondField.length ? secondField[i].type() : null);\n\n if (firstFieldType(firstField.length - 1) === DIMENSION && secondFieldType(0) === DIMENSION) {\n headerFrom = axisFrom ? options[1 - options.indexOf(axisFrom)] : options[1];\n\n if (type === COLUMN && (firstField[firstField.length - 1].toString() === secondField[0].toString())) {\n axisFrom = TOP;\n } else {\n axisFrom = axisFrom || options[0];\n }\n } else if (secondFieldType(secondField.length - 1) === DIMENSION) {\n headerFrom = type === ROW ? RIGHT : BOTTOM;\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else {\n headerFrom = type === ROW ? LEFT : TOP;\n axisFrom = type === ROW ? LEFT : TOP;\n }\n if (firstFieldType(firstField.length - 1) === MEASURE && secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n } else if (secondFieldType(0) === MEASURE) {\n axisFrom = type === ROW ? RIGHT : BOTTOM;\n } else if (firstFieldType(firstField.length - 1) === MEASURE) {\n axisFrom = type === ROW ? LEFT : TOP;\n }\n return [headerFrom, axisFrom];\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} fields\n * @param {*} layers\n *\n * @memberof MatrixResolver\n */\nexport const setFacetsAndProjections = (context, fieldInfo, encoder) => {\n const {\n fields,\n type\n } = fieldInfo;\n const { facets, projections } = encoder.simpleEncoder.getFacetsAndProjections(fields, type);\n\n context.facets({ [`${type}Facets`]: facets });\n context.projections({ [`${type}Projections`]: projections });\n\n return { facets, projections, fields };\n};\n\nconst getRowBorders = (left, right) => {\n const borders = {};\n borders.top = false;\n borders.bottom = false;\n if (left.length > 1 || right.length > 1) {\n borders.top = true;\n borders.bottom = true;\n }\n return borders;\n};\n\nconst getColumnsBorders = (top, bottom) => {\n const borders = {};\n borders.left = false;\n borders.right = false;\n if (top.length || bottom.length) {\n if ((top[0] && top[0].length > 1) || (bottom[0] && bottom[0].length > 1)) {\n borders.left = true;\n borders.right = true;\n }\n }\n return borders;\n};\n\nconst getValueBorders = (rows, columns) => {\n const borders = { top: true, left: true, bottom: true, right: true };\n const borderTypeRow = [LEFT, RIGHT];\n const borderTypeCol = [TOP, BOTTOM];\n rows.forEach((e, i) => {\n if (e[0] && e[0].length) {\n borders[borderTypeRow[i]] = true;\n } else {\n borders[borderTypeRow[i]] = false;\n }\n });\n columns.forEach((e, i) => {\n if (e.length) {\n borders[borderTypeCol[i]] = true;\n } else {\n borders[borderTypeCol[i]] = false;\n }\n });\n\n return borders;\n};\n\nexport const getBorders = (matrices, encoder) => {\n let showRowBorders = { top: false, bottom: false };\n let showColBorders = { left: false, right: false };\n let showValueBorders = { top: false, bottom: false, left: false, right: false };\n const {\n rows,\n columns,\n values: valueMatrix\n } = matrices;\n const [leftRows, rightRows] = rows;\n const [topColumns, bottomColumns] = columns;\n const {\n rowDimensions,\n columnDimensions,\n rowTemporalFields,\n columnTemporalFields,\n columnMeasures,\n rowMeasures\n } = encoder.fieldInfo();\n const allDimensionLength = rowDimensions.length + columnDimensions.length;\n const allMeasuresLength = rowMeasures.length + columnMeasures.length;\n const allTemporalFieldsLength = rowTemporalFields.length + columnTemporalFields.length;\n\n if (encoder.constructor.type() === POLAR) {\n if (!allDimensionLength) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n } else if (!allMeasuresLength && !allTemporalFieldsLength && allDimensionLength <= 2) {\n return { showRowBorders, showColBorders, showValueBorders };\n }\n\n showRowBorders = getRowBorders(leftRows, rightRows);\n showColBorders = getColumnsBorders(topColumns, bottomColumns);\n showValueBorders = getValueBorders([leftRows, rightRows], [topColumns, bottomColumns]);\n\n if (valueMatrix.length > 1) {\n showValueBorders.top = true;\n showValueBorders.bottom = true;\n }\n if (valueMatrix.length && valueMatrix[0].length > 1) {\n showValueBorders.left = true;\n showValueBorders.right = true;\n }\n return { showRowBorders, showColBorders, showValueBorders };\n};\n\nexport const getFieldsFromSuppliedLayers = (suppliedLayerConfig) => {\n const encodingArr = suppliedLayerConfig.map(conf => (conf.encoding || {}));\n const fields = [].concat(...encodingArr.map(enc => Object.values(enc).map(d => (typeof d === 'object' ?\n d.field : d))));\n return [...new Set(fields.filter(d => d))];\n};\n\nexport const extractFields = (facetsAndProjections, layerFields) => {\n const fields = Object.values(facetsAndProjections).map((arr) => {\n const flattenArray = [].concat(...arr);\n return [].concat(...flattenArray.map((field) => {\n if (field instanceof Variable) {\n return field.getMembers();\n }\n return field;\n }));\n });\n return [].concat(...fields, ...layerFields);\n};\n\n/**\n * This method sorts the facets fields inplace if field is of categorical type\n * @param {Object} facets Array of facets\n * @param {Array} keys Array of the facet field values\n * @param {Object} config configuration object\n * @return {Array} Returns sorted facets\n */\nexport const sortFacetFields = (facets, keys, config) => {\n /**\n * Check if the facet sorted by the user is plotted\n * If an incorrect field is sorted, return the keys as is\n */\n const schema = [];\n const facetNames = [];\n const sortInfo = [];\n const sortConfig = config.sort;\n\n facets.forEach((facet) => {\n const name = `${facet}`;\n facetNames.push(name);\n\n const facetSortConfig = sortConfig[name];\n\n if (facetSortConfig) {\n sortInfo.push([name, facetSortConfig]);\n } else {\n sortInfo.push([name, null]);\n }\n schema.push(facet.getSchemaDef());\n });\n\n return new DataModel([facetNames, ...keys], schema).getData({ sort: sortInfo }).data;\n};\n\nexport const removeExitCells = (resolver) => {\n const exitCells = resolver.cacheMaps().exitCellMap;\n const store = resolver.store();\n const qualifiedStateProps = [].concat(...VisualUnit.getQualifiedStateProps(),\n ...BaseLayer.getQualifiedStateProps());\n store.lockCommits(qualifiedStateProps);\n exitCells.forEach((placeholder) => {\n placeholder.remove();\n });\n store.unlockCommits(qualifiedStateProps);\n};\n","export const PROPS = {\n layers: {},\n data: {},\n globalConfig: {}\n};\n","import { ERROR_MSG, mergeRecursive, generateGetterSetters } from 'muze-utils';\nimport { transformFields } from './field-sanitizer';\nimport { getHeaderAxisFrom, getFieldsFromSuppliedLayers, hasOneField } from '../group-helper/group-utils';\nimport { ROW, COLUMN } from '../enums/constants';\nimport { PROPS } from './props';\n\n/**\n *\n *\n * @export\n * @class VisualEncoder\n */\nexport default class VisualEncoder {\n\n constructor () {\n generateGetterSetters(this, PROPS);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n createAxis () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n setCommonDomain () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @memberof VisualEncoder\n */\n getLayerConfig () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n fieldInfo (...info) {\n if (info.length) {\n this._fieldInfo = mergeRecursive(this._fieldInfo || {}, info[0]);\n return this;\n }\n return this._fieldInfo;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof VisualEncoder\n */\n fieldSanitizer (datamodel, config) {\n this.fieldInfo(transformFields(datamodel, config));\n return this.fieldInfo();\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n axisFrom (...params) {\n if (params.length) {\n this._axisFrom = params[0];\n return this;\n }\n return this._axisFrom;\n }\n\n /**\n *\n *\n * @param {*} params\n *\n * @memberof VisualEncoder\n */\n headerFrom (...params) {\n if (params.length) {\n this._headerFrom = params[0];\n return this;\n }\n return this.__headerFrom;\n }\n\n /**\n *\n *\n * @param {*} axisFrom\n *\n * @memberof CartesianEncoder\n */\n setAxisAndHeaders (axisFrom = {}, fields) {\n const [rowHeader, rowAxis] = getHeaderAxisFrom(ROW, fields.rows, axisFrom);\n const [colHeader, colAxis] = getHeaderAxisFrom(COLUMN, fields.columns, axisFrom);\n\n this.axisFrom({\n row: rowAxis,\n column: colAxis\n });\n this.headerFrom({\n row: rowHeader,\n column: colHeader\n });\n return this;\n }\n\n getProjectionFields (layers) {\n return getFieldsFromSuppliedLayers(layers);\n }\n\n hasMandatoryFields (fields) {\n return hasOneField(fields);\n }\n}\n","import { ContinousAxis, BandAxis, TimeAxis, ColorAxis, SizeAxis, ShapeAxis } from '@chartshq/muze-axis';\n\nexport const scaleMaps = {\n linear: ContinousAxis,\n band: BandAxis,\n temporal: TimeAxis,\n size: SizeAxis,\n color: ColorAxis,\n shape: ShapeAxis\n};\n","import { DataModel, mergeRecursive } from 'muze-utils';\nimport { sortFacetFields } from './group-utils';\nimport { BORDER_WIDTH } from '../enums/defaults';\nimport { FACET } from '../enums/constants';\n\n/**\n* Gets name of fields form the variables\n*\n* @param {*} fields1\n* @param {*} [fields2=[]]\n*\n*/\nconst getFieldNames = fieldVar => fieldVar.reduce((acc, d) => {\n acc = [...acc, ...d.getMembers()];\n return acc;\n}, []);\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareProjectionInfo = (fieldInfo) => {\n const {\n colProjections,\n rowProjections\n } = fieldInfo;\n const uniqueFields = [];\n let indices = [];\n let projections = [];\n\n rowProjections.forEach((rowProj, rIndex) => {\n const newRIndex = rIndex;\n colProjections.forEach((colProj, cIndex) => {\n const newCIndex = cIndex;\n const newRowProj = getFieldNames(rowProj);\n const newColProj = getFieldNames(colProj);\n\n uniqueFields.push([...newRowProj, ...newColProj]);\n indices.push({ rowIndex: newRIndex, colIndex: newCIndex });\n projections.push({ rowFields: rowProj, columnFields: colProj });\n });\n });\n indices = indices.length ? indices : [{ rowIndex: 0, colIndex: 0 }];\n projections = projections.length ? projections : [{ rowFields: [], columnFields: [] }];\n return { uniqueFields, indices, projections };\n};\n\n/**\n*\n*\n* @param {*} fieldInfo\n* @returns\n*/\nconst prepareFacetInfo = (fieldInfo) => {\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const rowFacetNames = getFieldNames(rowFacets);\n const colFacetNames = getFieldNames(colFacets);\n const allFacets = [...rowFacetNames, ...colFacetNames];\n\n return { rowFacetNames, colFacetNames, allFacets, rowFacets, colFacets };\n};\n\n/**\n*\n*\n* @param {*} context\n* @param {*} facetNames\n* @param {*} hashMap\n* @param {*} keys\n* @param {*} index\n* @returns\n*/\nconst prepareHashMaps = (context, facetNames, hashMap, keys, index) => {\n const rowKey = [];\n facetNames.forEach((name) => {\n const key = context._derivation[context._derivation.length - 1].meta.keys[name];\n\n rowKey.push(key);\n });\n\n const joinedRowKey = rowKey.join(',');\n\n if (hashMap[joinedRowKey] === undefined) {\n hashMap[joinedRowKey] = index++;\n keys.push(rowKey);\n }\n return rowKey;\n};\n\nconst createJoinedKeys = keys => keys.map(e => ({\n keyArr: e,\n joinedKey: e.join(',')\n}));\n\nconst setDefaultConfigForFacet = (facetInfo, projectionInfo, config) => {\n let conf = {};\n\n if (facetInfo.allFacets.length || projectionInfo.indices.length > 1) {\n const { facetsUserConfig, border } = config;\n const { isBorderPresent, isGridLinePresent } = facetsUserConfig;\n const gridLinesShowLength = Object.keys(isGridLinePresent).length;\n let borderWidth = border.width;\n let gridLines = {};\n\n if (!isBorderPresent) {\n borderWidth = BORDER_WIDTH[FACET];\n }\n if (gridLinesShowLength <= 0) {\n gridLines = {\n x: {\n show: false\n }\n };\n }\n conf = {\n border: {\n width: borderWidth\n },\n gridLines\n };\n }\n return conf;\n};\n\n/**\n*\n*\n* @param {*} splitModels\n* @param {*} facetInfo\n* @returns\n*/\nconst getSplitModelHashMap = (splitModels, facetInfo, config) => {\n const {\n rowFacetNames,\n colFacetNames,\n rowFacets,\n colFacets\n } = facetInfo;\n\n const rowKeyHashMap = {};\n const colKeyHashMap = {};\n\n const rowKeys = [];\n const colKeys = [];\n const rowIndex = 0;\n\n const splitModelsHashMap = {};\n\n splitModels.forEach((splitContext) => {\n const rowKey = prepareHashMaps(splitContext, rowFacetNames, rowKeyHashMap, rowKeys, rowIndex);\n const colKey = prepareHashMaps(splitContext, colFacetNames, colKeyHashMap, colKeys, 1);\n\n splitModelsHashMap[`${rowKey}-${colKey}`] = splitContext;\n });\n\n return {\n splitModelsHashMap,\n rowKeys: createJoinedKeys(sortFacetFields(rowFacets, rowKeys, config)),\n colKeys: createJoinedKeys(sortFacetFields(colFacets, colKeys, config))\n };\n};\n\n/**\n * Formats row or columns keys with the provided formatter.\n *\n * @param {Array} keys - The collection of row or column keys.\n * @param {Array} formatterList - The list of corresponding formatter.\n */\nconst formatKeys = (keys, formatterList) => {\n const formattedKeys = [];\n keys.forEach((rKeys, rIdx) => {\n formattedKeys[rIdx] = [];\n rKeys.forEach((key, idx) => {\n formattedKeys[rIdx][idx] = formatterList[idx](key);\n });\n });\n return formattedKeys;\n};\n\n/**\n*\n*\n* @param {Object} context\n* @param {Object} fieldInfo\n* @returns\n*/\nconst splitByColumn = (context, optionalProjections) => {\n const {\n matrix,\n dataModel,\n rowIndex,\n colIndex,\n facetInfo,\n projectionInfo,\n geomCellCreator\n } = context;\n const {\n indices,\n uniqueFields,\n projections\n } = projectionInfo;\n\n const commonFields = optionalProjections;\n\n dataModel.splitByColumn(uniqueFields, commonFields).forEach((model, i) => {\n let { rowIndex: row, colIndex: col } = indices[i];\n row += rowIndex;\n col += colIndex;\n\n matrix[row] = matrix[row] || [];\n\n const projectionIndexObject = {\n indices: {\n rowIndex: row,\n columnIndex: col\n },\n projections: projections[i]\n };\n\n matrix[row][col] = geomCellCreator(model, projectionIndexObject, facetInfo);\n });\n const lastIndex = indices[indices.length - 1];\n\n return {\n rowIndex: lastIndex.rowIndex + rowIndex,\n colIndex: lastIndex.colIndex + colIndex\n };\n};\n\nconst createColumnDataModels = (colContext, fieldInfo, sourceDM) => {\n let context = {};\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n const {\n rowKeyArr,\n rowKey,\n colKeyObj,\n newRowIndex,\n splitModelsHashMap,\n currentColumnIndex\n } = colContext;\n\n const { keyArr: colKeyArr, joinedKey: colKey } = colKeyObj;\n const hashMapKey = splitModelsHashMap[`${rowKey}-${colKey}`];\n\n if (hashMapKey) {\n context = { dataModel: hashMapKey };\n } else {\n const emptyDm = new DataModel([], sourceDM.getData().schema);\n context = { dataModel: emptyDm };\n }\n\n context = {\n ...context,\n ...colContext,\n facetInfo: {\n rowFacets: [rowFacets, rowKeyArr],\n colFacets: [colFacets, colKeyArr]\n },\n rowIndex: newRowIndex,\n colIndex: currentColumnIndex\n };\n const dataModels = splitByColumn(context, fieldInfo.optionalProjections);\n\n return {\n columnIndex: dataModels.colIndex + 1,\n rowIndex: dataModels.rowIndex\n };\n};\n\nconst createRowDataModels = (rowContext, fieldInfo, sourceDM) => {\n let currentColumnIndex = 0;\n let rowIndexForCurrentKey = 0;\n const {\n colKeys,\n rowKeyObj,\n currentRowIndex\n } = rowContext;\n const newRowIndex = currentRowIndex;\n const { keyArr: rowKeyArr, joinedKey: rowKey } = rowKeyObj;\n const colContext = {\n ...rowContext,\n rowKeyArr,\n rowKey,\n newRowIndex\n };\n rowIndexForCurrentKey = currentRowIndex;\n if (colKeys.length) {\n colKeys.forEach((colKeyObj) => {\n colContext.colKeyObj = colKeyObj;\n colContext.currentColumnIndex = currentColumnIndex;\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n });\n } else {\n colContext.colKeyObj = { keyArr: [], joinedKey: '' };\n colContext.currentColumnIndex = currentColumnIndex;\n\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, sourceDM);\n\n currentColumnIndex = columnIndex;\n rowIndexForCurrentKey = rowIndex;\n }\n return {\n rowIndex: ++rowIndexForCurrentKey\n };\n};\n\n/**\n* Gets Matrixes for corresponding datamodel, facets and projections\n*\n* @param {Object} dataModel input datamodel\n* @param {Object} fieldInfo Information about the fields\n* @param {Function} geomCellCreator Callback executed after datamodels are prepared after sel/proj\n* @return {Object} set of matrices with the corresponding row and column keys\n*/\nexport const getMatrixModel = (dataModel, fieldInfo, geomCellCreator, globalConfig) => {\n let currentRowIndex = 0;\n const matrix = [];\n const {\n rowFacets,\n colFacets\n } = fieldInfo;\n\n const projectionInfo = prepareProjectionInfo(fieldInfo);\n const facetInfo = prepareFacetInfo(fieldInfo);\n const allSplitModels = dataModel.splitByRow(facetInfo.allFacets);\n\n const {\n splitModelsHashMap,\n rowKeys,\n colKeys\n } = getSplitModelHashMap(allSplitModels, facetInfo, globalConfig);\n\n const defaultConfig = setDefaultConfigForFacet(facetInfo, projectionInfo, globalConfig);\n globalConfig = mergeRecursive(globalConfig, defaultConfig);\n\n const generalContext = {\n matrix,\n geomCellCreator,\n projectionInfo,\n splitModelsHashMap,\n colKeys\n };\n if (rowKeys.length) {\n rowKeys.forEach((rowKeyObj) => {\n const rowContext = {\n ...generalContext,\n rowKeyObj,\n currentRowIndex\n };\n const { rowIndex } = createRowDataModels(rowContext, fieldInfo, dataModel);\n\n currentRowIndex = rowIndex;\n });\n } else if (colKeys.length) {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n\n colKeys.forEach((colKeyObj) => {\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj,\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n });\n } else {\n let currentColumnIndex = 0;\n const newRowIndex = currentRowIndex;\n const colContext = {\n ...generalContext,\n rowKeyArr: [],\n rowKey: '',\n colKeyObj: { keyArr: [], joinedKey: '' },\n newRowIndex,\n currentColumnIndex\n };\n const { columnIndex, rowIndex } = createColumnDataModels(colContext, fieldInfo, dataModel);\n currentRowIndex = rowIndex;\n currentColumnIndex = columnIndex;\n }\n\n const formattedColKeys = formatKeys(colKeys.map(e => e.keyArr),\n colFacets.map(facetField => facetField.rawFormat()));\n const formattedRowKeys = formatKeys(rowKeys.map(e => e.keyArr),\n rowFacets.map(facetField => facetField.rawFormat()));\n\n // Getting column keys\n const transposedColKeys = formattedColKeys.length > 0 ? formattedColKeys[0].map((col, i) =>\n formattedColKeys.map(row => row[i])) : formattedColKeys;\n\n return { matrix, rowKeys: formattedRowKeys, columnKeys: transposedColKeys };\n};\n","import { AxisOrientation } from '@chartshq/muze-axis';\nimport {\n getObjProp,\n FieldType,\n retrieveNearestGroupByReducers,\n mergeRecursive,\n createSelection,\n DataModel\n} from 'muze-utils';\nimport { getMatrixModel } from './matrix-model';\nimport {\n getCellKey,\n isDistributionEqual,\n mutateAxesFromMap,\n getFieldsFromSuppliedLayers,\n extractFields,\n removeExitCells\n} from './group-utils';\nimport { ROW, ROWS, COLUMNS, COL, LEFT, RIGHT, TOP,\n BOTTOM, PRIMARY, SECONDARY, X, Y, TEMPORAL } from '../enums/constants';\nimport { SimpleVariable } from '../variable';\nimport { sanitiseBorderMatrix, sanitiseGeomMatrix } from './cell-border-applier';\n\n/**\n * Updates row and column cells with the geom cell corresponding to the facet keys\n *\n * @param {*} resolver\n * @param {*} facets\n */\nconst updateCells = (resolver, facets, geomCell) => {\n [ROW, COL].forEach((field) => {\n const cells = resolver[`${field}Cells`]();\n const facetKey = facets[`${field}Facets`][1].join();\n\n !cells[facetKey] && (cells[facetKey] = []);\n cells[facetKey].push(geomCell);\n resolver[`${field}Cells`](cells);\n });\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} datamodel\n * @param {*} fieldInfo\n * @param {*} facets\n *\n */\nexport const createValueCells = (context, datamodel, fieldInfo, facets) => {\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const {\n suppliedLayers,\n cell: GeomCell,\n resolver,\n config,\n encoder,\n detailFields\n } = context;\n const axes = resolver.axes();\n const cacheMaps = resolver.cacheMaps();\n const matrixLayers = resolver.matrixLayers();\n const labelManager = resolver.dependencies().smartlabel;\n const horizontalAxis = resolver.horizontalAxis();\n const verticalAxis = resolver.verticalAxis();\n const datamodelTransform = resolver.datamodelTransform();\n const sortedFields = config.sort;\n const {\n entryCellMap,\n exitCellMap\n } = cacheMaps;\n const layerConfigArr = encoder.getLayerConfig({ columnFields, rowFields }, suppliedLayers || [],\n context.retinalConfig);\n const axesCreators = { config, labelManager, axes, cacheMaps };\n\n fieldInfo.normalizedColumns = verticalAxis.fields;\n fieldInfo.normalizedRows = horizontalAxis.fields;\n\n const allFacets = [\n [...facets.rowFacets[0], ...facets.colFacets[0]],\n [...facets.rowFacets[1], ...facets.colFacets[1]]\n ];\n const facetFields = allFacets.slice();\n facetFields[0] = facetFields[0].map(facetField => facetField.oneVar());\n\n matrixLayers[rowIndex] = matrixLayers[rowIndex] ? matrixLayers[rowIndex] : [];\n matrixLayers[rowIndex][columnIndex] = layerConfigArr;\n\n // return from map if already there otherwise create and put in map\n const geomCellKey = getCellKey(rowIndex, columnIndex);\n const fields = {\n y: rowFields,\n x: columnFields\n };\n\n const geomCell = !exitCellMap.has(geomCellKey) ? new GeomCell() : exitCellMap.get(geomCellKey);\n\n // Sort datamodel if user has sorted a field\n const sortConfig = Object.keys(sortedFields).map(field => [field, sortedFields[field]]);\n if (sortConfig.length) {\n datamodel = datamodel.sort(sortConfig, { saveChild: true });\n }\n\n geomCell.data(datamodel)\n .fields(fields)\n .transform(datamodelTransform)\n .detailFields(detailFields)\n .facetByFields(allFacets);\n\n encoder.createAxis(axesCreators, fieldInfo, Object.assign({}, context, { geomCell, facetFields }));\n entryCellMap.set(geomCellKey, geomCell);\n exitCellMap.delete(geomCellKey);\n\n updateCells(resolver, facets, geomCell);\n\n return entryCellMap.get(geomCellKey);\n};\n\nconst extractAxisIndex = id => getObjProp(id.match(/^[0-9]*?(?=-)/g), 0);\n\n/**\n * Creates axis cells based on the set of axes\n *\n * @param {Selection} selection Contains a selection of the axis units\n * @param {Array} axes Actual axis units\n * @param {number} axisIndex 0-> primary axis, 1-> secondary axis(when dual axis is made)\n * @param {Object} cells Contains a collection of the cells\n * @return {Object} return either set of axis/blank cells depending on the config\n */\nconst createAxisCells = (selection, axes, axisIndex, cells) =>\n createSelection(selection, axis => axis, axes, (item, i) => i + item.reduce((e, n) => {\n const id = n.id + axisIndex;\n return `${e}-${id}`;\n }, '')).map((currObj, axis) => {\n if (axis && axis[axisIndex]) {\n const axisInst = axis[axisIndex];\n const { orientation, show } = axisInst.config();\n\n return new cells.AxisCell().source(axisInst).config({\n isOffset: orientation === AxisOrientation.LEFT || orientation === AxisOrientation.TOP,\n show\n });\n }\n return new cells.BlankCell().config({ show: false });\n }).sort((a, b) => extractAxisIndex(a[0]) - extractAxisIndex(b[0]));\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @retur\n */\nconst axisPlaceholderGn = (context, selObj, cells) => {\n const {\n matrices\n } = context;\n const {\n axesMatrix\n } = matrices;\n\n return (type, axisFrom) => {\n const axes = axesMatrix[`${type}`];\n\n if (axes && axes.length) {\n if (type === X || type === Y) {\n const fieldNames = type === Y ? ROWS : COLUMNS;\n\n [PRIMARY, SECONDARY].forEach((fieldType, index) => {\n const selObjProp = `${fieldNames}${fieldType}`;\n let axisIndex = index;\n let axesForDraw = axes;\n if (axisFrom === RIGHT || axisFrom === BOTTOM) {\n axisIndex = 1 - axisIndex;\n }\n if (!getObjProp(axes, 0, axisIndex)) {\n axesForDraw = [];\n }\n selObj[selObjProp] = createAxisCells(selObj[selObjProp], axesForDraw, axisIndex, cells);\n });\n } else {\n selObj.rowsPrimary = createAxisCells(selObj.rowPrime, axes.map(() => []), 0, cells);\n selObj.rowsSecondary = createAxisCells(selObj.rowSec, axes.map(() => []), 0, cells);\n selObj.columnsPrimary = createAxisCells(selObj.colPrime, axes[0], 0, cells);\n selObj.columnsSecondary = createAxisCells(selObj.colSec, axes[0], 0, cells);\n }\n }\n return selObj;\n };\n};\n\n/**\n * Creates header cells based on the set of headers\n *\n * @param {Object} selection Contains a selection of the header units\n * @param {string} headers Contains a list of the headers\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} return either set of header cells depending on the config\n */\nconst createTextCells = (selection, headers, cells, labelManager) => createSelection(selection,\n (label) => {\n const textCell = new cells.TextCell({}, { labelManager });\n textCell.source(label);\n return textCell;\n }, headers, (key, i) => key + i);\n\nconst extractFacetIndex = id => id.split('-').pop();\n\n/**\n *\n *\n * @param {*} context\n * @param {*} selectionObj\n * @param {*} cells\n * @param {*} labelManager\n *\n */\nconst headerPlaceholderGn = (context, selectionObj, cells, labelManager) => {\n const {\n axis,\n keys,\n type,\n facet\n } = context;\n const counter = axis.length / keys.length;\n const selectionKeys = keys.length ? axis.map((d, i) => keys[Math.floor(i / counter)]) : [];\n\n const selObjUpdater = createSelection(selectionObj[`${type}Headers`], keySet => keySet, selectionKeys,\n (keySet, i) => `${keySet.join(',')}-${i}`)\n .sort((a, b) => extractFacetIndex(a[0]) - extractFacetIndex(b[0]));\n\n return selObjUpdater.map((keySet, data) => {\n let textCells = createTextCells(null, data, cells, labelManager);\n textCells = textCells.map((cell, k) => cell.source(k).config(facet));\n return textCells;\n });\n};\n\n/**\n * Creates a set of placeholders as a part of selection object\n *\n * @param {Array} normalizedOptions contains normalized rows and columns\n * @param {Array} matrices contains axis and value matrices\n * @param {aArrayny} projections contains set of row and column projections\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} Creates a set of placeholders as a part of selections\n */\nconst generatePlaceholders = (context, cells, labelManager) => {\n let selectionObj;\n const {\n matrices,\n fields,\n facetsAndProjections,\n selection,\n facet,\n encoders,\n resolver\n } = context;\n const {\n rows,\n columns\n } = fields;\n const {\n valuesMatrix\n } = matrices;\n const {\n rowProjections,\n colProjections\n } = facetsAndProjections;\n const {\n rowKeys,\n columnKeys\n } = valuesMatrix;\n const takeAxisFrom = encoders.simpleEncoder._axisFrom;\n const takeHeaderFrom = encoders.simpleEncoder._headerFrom;\n\n selectionObj = selection || {};\n\n ['pie', X, Y].forEach((axis) => {\n const axisFrom = axis === X ? takeAxisFrom.column : takeAxisFrom.row;\n selectionObj = axisPlaceholderGn(context, selectionObj, cells)(axis, axisFrom);\n });\n\n const {\n rowsPrimary,\n rowsSecondary,\n columnsPrimary,\n columnsSecondary\n } = selectionObj;\n\n const rowAxis = rowsPrimary && rowsPrimary.getObjects().length ? rowsPrimary.getObjects() :\n (rowsSecondary && rowsSecondary.getObjects().length ? rowsSecondary.getObjects() : []);\n const colAxis = columnsPrimary && columnsPrimary.getObjects().length ? columnsPrimary.getObjects() :\n (columnsSecondary && columnsSecondary.getObjects().length ? columnsSecondary.getObjects() : []);\n\n const headerConfig = [\n { type: LEFT, section: rows[0], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: RIGHT, section: rows[1], axis: rowAxis, headerFrom: takeHeaderFrom.row },\n { type: TOP, section: columns[0], axis: colAxis, headerFrom: takeHeaderFrom.column },\n { type: BOTTOM, section: columns[1], axis: colAxis, headerFrom: takeHeaderFrom.column }\n ];\n\n headerConfig.forEach((config, index) => {\n let keys;\n let length;\n const {\n type,\n section,\n axis,\n headerFrom\n } = config;\n\n if (index < 2) {\n keys = rowKeys;\n length = rowProjections.length > 0 ? rowProjections.length : 1;\n } else {\n keys = columnKeys;\n length = colProjections.length > 0 ? colProjections.length : 1;\n }\n keys = keys.map(arr => arr.map(val => resolver.valueParser()(val)));\n if (section.length && headerFrom === type && axis && keys.length) {\n const hContext = { axis, length, type };\n let headers = [];\n if (index < 2) {\n hContext.keys = keys;\n hContext.facet = facet.rows;\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n } else {\n hContext.facet = facet.columns;\n hContext.keys = keys[0].map((key, i) => keys.map(e => e[i]));\n\n headers = headerPlaceholderGn(hContext, selectionObj, cells, labelManager);\n }\n selectionObj[`${type}Headers`] = headers;\n } else {\n selectionObj[`${type}Headers`] = null;\n }\n });\n return selectionObj;\n};\n\n/**\n * Generates matrices\n *\n * @param {Object} config Configuration to generate matrices\n * @param {Array} matrices Matrices containing the set of visual units and axes units\n * @param {Object} cells Contains a collection of the cells\n * @param {Object} labelManager smart label instance\n * @return {Object} contains a collection of matrices\n */\nexport const generateMatrices = (context, matrices, cells, labelManager) => {\n const {\n unitHeight,\n unitWidth,\n facetsAndProjections,\n normalizedRows,\n normalizedColumns,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n } = context;\n const placeholderContext = {\n fields: {\n rows: normalizedRows,\n columns: normalizedColumns\n },\n matrices,\n facetsAndProjections,\n selection,\n axisFrom,\n facet,\n encoders,\n resolver\n };\n // Generate placeholders for all matrices\n const selectionObj = generatePlaceholders(placeholderContext, cells, labelManager);\n const {\n columnsPrimary,\n columnsSecondary,\n rowsPrimary,\n rowsSecondary,\n leftHeaders,\n topHeaders,\n bottomHeaders,\n rightHeaders\n } = selectionObj;\n const [rowPrime, rowSec, colPrime, colSec] = [rowsPrimary, rowsSecondary, columnsPrimary, columnsSecondary]\n .map(d => (d ? d.getObjects() : []));\n const [leftFacets, rightFacets] = [leftHeaders, rightHeaders]\n .map(e => (e ? e.getObjects()\n .map(f => f.getObjects()) : []));\n let rowPriority = rowSec.length ? 1 : -1;\n rowPrime.length && rowPriority++;\n let colPriority = colSec.length ? 1 : -1;\n colPrime.length && colPriority++;\n\n // Compute left matrix using left headers and the axes on the rows\n let leftMatrix = leftFacets.length ? leftFacets.map((d, i) => {\n rowPrime[i] = rowPrime[i] ? [rowPrime[i]] : [];\n return [...d, ...rowPrime[i]];\n }) : (rowPrime ? rowPrime.map(d => [d]) : []);\n\n // Compute right matrix using right headers and the axes on the rows\n const rightMatrix = rowSec.length ? rowSec.map((d, i) => [d, ...(rightFacets[i] || [])]) : (rightFacets.length ?\n rightFacets.map(d => [...d]) : []);\n\n const topMatrix = [];\n if (topHeaders) {\n const headers = topHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n topMatrix[i] = topMatrix[i] || [];\n topMatrix[i].push(x);\n });\n });\n }\n // Compute top matrix using the top headers and axes on the columns\n if (colPrime.length) {\n topMatrix.push(colPrime);\n }\n\n // Bottom and right matrices are prepared using the user config.\n let bottomMatrix = [];\n if (colSec.length) {\n bottomMatrix.push(colSec);\n }\n const currentBottomLength = bottomMatrix.length;\n if (bottomHeaders) {\n const headers = bottomHeaders.getObjects();\n headers.forEach((e) => {\n const innerHeaders = e.getObjects();\n innerHeaders.forEach((x, i) => {\n bottomMatrix[i + currentBottomLength] = bottomMatrix[i + currentBottomLength] || [];\n bottomMatrix[i + currentBottomLength].push(x);\n });\n });\n }\n\n if (!leftMatrix.length && !rightMatrix.length) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n leftMatrix = [[cell]];\n }\n\n if (!topMatrix.length && (!bottomMatrix.length || !bottomMatrix[0].length)) {\n const cell = new cells.BlankCell();\n cell.setAvailableSpace(unitWidth, unitHeight);\n bottomMatrix = [[cell]];\n }\n\n return {\n rows: [leftMatrix, rightMatrix],\n columns: [topMatrix, bottomMatrix],\n selectionObj,\n colPriority,\n rowPriority\n };\n};\n\nconst getAxisFields = (projections, fieldHolder = []) =>\n projections.reduce((acc, item) =>\n [...acc, ...item.reduce((ac, field) =>\n (field instanceof SimpleVariable ? [...ac, field.oneVar()] : ac), [])], fieldHolder);\n\nconst sortDmTemporalFields = (resolver, datamodel) => {\n let axisFields = [];\n const projections = resolver.projections();\n axisFields = getAxisFields(projections.rowProjections, getAxisFields(projections.colProjections));\n\n const fieldConfig = datamodel.getFieldsConfig();\n const temporalFields = axisFields.reduce((acc, field) =>\n ((fieldConfig[field].def.subtype === TEMPORAL) ? [...acc, [field]] : acc), []);\n return temporalFields.length ? datamodel.sort(temporalFields, { saveChild: true }) : datamodel;\n};\n\nconst transformDataModel = (dataModel, config, resolver) => {\n let groupedModel;\n\n const fieldsConfig = dataModel.getFieldsConfig();\n const resolvedData = resolver.data();\n const { groupBy, suppliedLayers, facetsAndProjections } = config;\n\n if (resolvedData instanceof DataModel) {\n resolvedData.dispose();\n }\n\n const fields = getFieldsFromSuppliedLayers(suppliedLayers).filter(field =>\n getObjProp(fieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const allFields = extractFields(facetsAndProjections, fields);\n\n groupedModel = dataModel.project(allFields);\n resolver.data(groupedModel);\n if (!groupBy.disabled) {\n const newFieldsConfig = groupedModel.getFieldsConfig();\n const dimensions = allFields.filter(field =>\n getObjProp(newFieldsConfig, field, 'def', 'type') === FieldType.DIMENSION);\n const aggregationFns = groupBy.measures;\n const measureNames = Object.keys(groupedModel.getFieldspace().getMeasure());\n const nearestAggFns = retrieveNearestGroupByReducers(groupedModel, ...measureNames);\n const resolvedAggFns = mergeRecursive(nearestAggFns, aggregationFns);\n\n groupedModel = groupedModel.groupBy(dimensions.length ? dimensions : [''], resolvedAggFns);\n }\n // sort temporal fields if any in the given rows and columns\n groupedModel = sortDmTemporalFields(resolver, groupedModel);\n resolver.transformedData(groupedModel);\n return groupedModel;\n};\n\n/**\n * Computes matrices for a group\n *\n * @param {Object} datamodel on which the matrices are to be computed\n * @param {Object} config configuration of the matrices\n * @param {Object} layerRegistry contains the registered layers\n * @return {Object} conputed matrices\n * @memberof MatrixResolver\n */\nexport const computeMatrices = (resolverConfig) => {\n let placeholderInfo = {};\n const {\n datamodel,\n encoders,\n resolver,\n globalConfig,\n selection,\n transform,\n componentRegistry,\n groupBy,\n labelManager,\n fieldMap,\n layerConfig,\n registry,\n normalizedRows,\n normalizedColumns,\n otherEncodings,\n facetsAndProjections,\n simpleEncoder,\n config\n } = resolverConfig;\n\n const { rowFacets, colFacets, colProjections, rowProjections } = facetsAndProjections;\n const isProjection = rowProjections.length > 0 || colProjections.length > 0;\n const isFacet = rowFacets.length > 0 || colFacets.length > 0;\n\n if (isFacet) {\n globalConfig.isFacet = true;\n }\n const matrixGnContext = {\n // Configuration to be passed to generate the different matrices.\n // A common config is used for both value matrices and other matrices\n normalizedColumns,\n normalizedRows,\n facetsAndProjections,\n layers: layerConfig,\n fieldMap,\n otherEncodings,\n encoders,\n facet: globalConfig.facet || {},\n axisFrom: globalConfig.axisFrom || {},\n selection,\n resolver\n };\n const cells = {\n GeomCell: resolver.getCellDef(registry.cells.GeomCell),\n AxisCell: resolver.getCellDef(registry.cells.AxisCell),\n BlankCell: resolver.getCellDef(registry.cells.BlankCell),\n TextCell: resolver.getCellDef(registry.cells.TextCell)\n };\n const isRowSizeEqual = isDistributionEqual(normalizedRows);\n const isColumnSizeEqual = isDistributionEqual(normalizedColumns);\n\n resolver.colCells({});\n resolver.rowCells({});\n resolver.datamodelTransform(transform || {});\n\n // Cell creation begins here\n resolver.resetSimpleAxes();\n\n const {\n entryCellMap\n } = resolver.cacheMaps();\n const newCacheMap = {\n exitCellMap: entryCellMap,\n entryCellMap: new Map()\n };\n\n resolver.cacheMaps(newCacheMap);\n const valueCellContext = {\n config: globalConfig,\n suppliedLayers: simpleEncoder.serializeLayerConfig(resolver.layerConfig()),\n resolver,\n cell: cells.GeomCell,\n encoder: simpleEncoder,\n newCacheMap,\n detailFields: config.detail,\n retinalConfig: {\n color: config.color,\n size: config.size,\n shape: config.shape\n }\n };\n\n const groupedModel = transformDataModel(datamodel, {\n facetsAndProjections,\n suppliedLayers: valueCellContext.suppliedLayers,\n groupBy\n }, resolver);\n simpleEncoder.data(groupedModel);\n // return a callback function to create the cells from the matrix\n const cellCreator = resolver.valueCellsCreator(valueCellContext);\n // Creates value matrices from the datamodel and configs\n const valueMatrixInfo = getMatrixModel(groupedModel, facetsAndProjections, cellCreator, globalConfig);\n\n removeExitCells(resolver);\n resolver.cacheMaps().exitCellMap.clear();\n resolver.valueMatrix(valueMatrixInfo.matrix);\n\n const { xAxes, yAxes } = mutateAxesFromMap(resolver.cacheMaps(), resolver.axes());\n\n resolver.axes({\n x: xAxes,\n y: yAxes\n });\n\n resolver.createUnits(componentRegistry, config);\n\n const matrices = {\n valuesMatrix: valueMatrixInfo,\n axesMatrix: resolver.axes()\n };\n // Create all matrices\n const {\n rows,\n columns,\n selectionObj,\n rowPriority,\n colPriority\n } = generateMatrices(matrixGnContext, matrices, cells, labelManager);\n\n resolver.rowMatrix(rows);\n resolver.columnMatrix(columns);\n if (isFacet || isProjection) {\n const arr = sanitiseBorderMatrix({\n leftMatrix: rows[0],\n rightMatrix: rows[1],\n topMatrix: columns[0],\n bottomMatrix: columns[1]\n }, registry.cells.BlankCell);\n valueMatrixInfo.matrix = sanitiseGeomMatrix(valueMatrixInfo.matrix, arr);\n }\n\n placeholderInfo = {\n rows: resolver.rowMatrix(),\n columns: resolver.columnMatrix(),\n values: resolver.valueMatrix(),\n isColumnSizeEqual,\n isRowSizeEqual,\n priority: {\n row: rowPriority,\n col: colPriority\n },\n selection: selectionObj,\n dataModels: {\n groupedModel,\n parentModel: datamodel\n }\n };\n return placeholderInfo;\n};\n","export const RESOLVER_PROPS = {\n dependencies: {},\n units: {},\n datamodelTransform: {},\n layerConfig: {},\n matrixLayers: {},\n colCells: {},\n rowCells: {},\n rowMatrix: {},\n columnMatrix: {},\n valueMatrix: {},\n encoder: {},\n valueParser: {},\n data: {},\n transformedData: {},\n store: {}\n};\n","import { generateGetterSetters, STATE_NAMESPACES, getUniqueId } from 'muze-utils';\nimport {\n initializeCacheMaps,\n headerCreator,\n extractUnitConfig,\n setFacetsAndProjections\n} from './group-utils';\nimport {\n ROW, COL, LEFT, RIGHT, COLOR, SIZE, SHAPE, DETAIL, CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS, INITIALIZED,\n AXIS, UNIT, BEFORE_UPDATE, UPDATED, VALUE_MATRIX, FACET_HEADERS\n} from '../enums/constants';\nimport { createValueCells, computeMatrices } from './cell-creator';\nimport { RESOLVER_PROPS } from './resolver-props';\n\n/**\n * Resolves the matrices from configuration provided\n *\n * @export\n * @class MatrixResolver\n */\nexport default class MatrixResolver {\n\n /**\n * Creates an instance of MatrixResolver.\n * @param {Object} dependencies needed to run the resolver\n * @memberof MatrixResolver\n */\n constructor (dependencies) {\n this._registry = {};\n this._layerConfig = [];\n this._matrixLayers = [];\n this._dependencies = dependencies;\n this._rowMatrix = [];\n this._columnMatrix = [];\n this._valueMatrix = [];\n this._facets = { rowFacets: [], colFacets: [] };\n this._projections = { rowProjections: [], colProjections: [] };\n this._datamodelTransform = {};\n this._units = [];\n this._cacheMaps = {};\n this._fireboltDeps = {};\n this._axes = {\n x: {},\n y: {},\n color: [],\n size: [],\n shape: [],\n radius: [],\n angle: [],\n angle0: []\n };\n this._placeholderInfo = {};\n generateGetterSetters(this, this.constructor.getterSetters());\n\n this.cacheMaps(initializeCacheMaps());\n }\n\n static getterSetters () {\n return RESOLVER_PROPS;\n }\n /**\n * Set: Registers placeholders, Get: return {Object} those placeholders\n *\n * @param {Object} placeholders cells that will construct the group\n * @return {Object} Either current instance or the set of placeholders\n * @memberof MatrixResolver\n */\n registry (...placeholders) {\n if (placeholders.length) {\n Object.entries(placeholders[0]).forEach((val) => {\n this._registry[val[0]] = val[1];\n });\n return this;\n }\n return this._registry;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n cacheMaps (...maps) {\n if (maps.length) {\n [CELL, X_AXES, Y_AXES, ENTRY_CELLS, EXIT_CELLS].forEach((e) => {\n this._cacheMaps[`${e}Map`] = maps[0][`${e}Map`] || this._cacheMaps[`${e}Map`];\n });\n return this;\n }\n return this._cacheMaps;\n }\n\n /**\n * Used to set the layer config from outside or get current layer info\n *\n * @param {Object} type configuration of layer provided externally\n * @return {Object} either the layer or current instance\n * @memberof MatrixResolver\n */\n axes (...axes) {\n if (axes.length) {\n this._axes = Object.assign({}, this._axes, axes[0]);\n return this;\n }\n return this._axes;\n }\n\n facets (...facets) {\n if (facets.length) {\n Object.entries(facets[0]).forEach((e) => {\n this._facets[e[0]] = e[1];\n });\n return this;\n }\n return this._facets;\n }\n\n projections (...projections) {\n if (projections.length) {\n Object.entries(projections[0]).forEach((e) => {\n this._projections[e[0]] = e[1];\n });\n return this;\n }\n return this._projections;\n }\n\n optionalProjections (config, layerConfig, schema) {\n const otherEncodings = {};\n const optionalProjections = [];\n const otherEncodingTypes = [SIZE, COLOR, SHAPE];\n\n otherEncodingTypes.forEach((type) => {\n if (config[type] && config[type].field) {\n const enc = config[type];\n otherEncodings[type] = enc.field;\n optionalProjections.push(enc.field);\n }\n });\n\n if (config[DETAIL]) {\n optionalProjections.push(...config.detail);\n }\n\n const encoder = this.encoder();\n optionalProjections.push(...encoder.getProjectionFields(layerConfig, schema));\n this.projections({ optionalProjections });\n return otherEncodings;\n }\n\n /**\n * return the normalized set of rows and facets and projections\n *\n * @param {Object} rows parameters needed to set horizontal axis consisiting of rows\n * @return {Object} facets, projections and normalized rows\n * @memberof MatrixResolver\n */\n horizontalAxis (rows, encoder) {\n if (rows) {\n this._horizontalAxis = setFacetsAndProjections(this, { type: ROW, fields: rows }, encoder);\n return this;\n }\n return this._horizontalAxis;\n }\n\n /**\n * return the normalized set of columns and facets and projections\n *\n * @param {Object} columns parameters needed to set vertical axis consisiting of columns\n * @return {Object} facets, projections and normalized columns\n * @memberof MatrixResolver\n */\n verticalAxis (columns, encoder) {\n if (columns) {\n this._verticalAxis = setFacetsAndProjections(this, { type: COL, fields: columns }, encoder);\n return this;\n }\n return this._verticalAxis;\n }\n\n /**\n * Gets the class definition of a particular cell type(if the particular type has been extended, that particular\n * definition is returned)\n *\n * @param {Object} cell cell whose class definition is to be retrieved\n * @return {Object} cell definition\n * @memberof MatrixResolver\n */\n getCellDef (cell) {\n const registry = this.registry().cells;\n\n Object.values(registry).forEach((e) => {\n if (e.prototype instanceof cell) {\n cell = e;\n }\n });\n return cell;\n }\n\n /**\n * return a visual cell creator along with its axis information to be injected to the datamodel creation\n * function\n *\n * @param {Object} GeomCell Type of cell to be created\n * @return {Object} Created cell\n * @memberof MatrixResolver\n */\n valueCellsCreator (context) {\n // reset matrix layers\n this.matrixLayers([]);\n\n return (datamodel, fieldInfo, facets) => createValueCells(context, datamodel, fieldInfo, facets);\n }\n\n /**\n * Callback to be applied on each cell of a matrix of a particular type\n *\n * @param {string} matrixType type of matrix on which callback is to be applied\n * @param {Function} callback function to be applied to each cell\n * @memberof MatrixResolver\n */\n forEach (matrixType, callback) {\n this[matrixType]().forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n callback(rIndex, cIndex, col);\n });\n });\n }\n\n getAllFields () {\n const retObj = this.projections();\n\n Object.entries(this.facets()).forEach((e) => {\n retObj[e[0]] = e[1];\n });\n return retObj;\n }\n\n resetSimpleAxes () {\n return this.axes({\n x: new Set(),\n y: new Set(),\n radius: [],\n angle: [],\n angle0: [],\n pie: []\n });\n }\n\n setFireboltDependencies (prop, deps) {\n Object.assign(this._fireboltDeps, {\n [prop]: deps\n });\n return this;\n }\n\n /**\n *\n *\n * @param {*} componentRegistry\n * @param {*} config\n * @memberof MatrixResolver\n */\n createUnits (componentRegistry, config) {\n const {\n globalConfig,\n alias,\n coord\n } = config;\n const {\n layerRegistry,\n interactions\n } = componentRegistry;\n const {\n smartlabel: smartLabel,\n lifeCycleManager,\n throwback\n } = this.dependencies();\n const fireboltDeps = this._fireboltDeps;\n\n // Provide the source for the matrix\n const units = [[]];\n // Setting unit configuration\n const unitConfig = extractUnitConfig(globalConfig || {});\n const store = this.store();\n store.lockModel();\n const { VisualUnit } = this.registry();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n let unit = el.source();\n if (!unit) {\n const namespace = `unit${i}-${j}-${getUniqueId()}`;\n\n unit = VisualUnit.create({\n layerRegistry,\n interactions\n }, {\n smartLabel,\n lifeCycleManager,\n throwback,\n fireboltDeps\n });\n unit.metaInf({\n rowIndex: i,\n colIndex: j,\n namespace\n });\n unit.store(store);\n unit.coord(coord);\n el.source(unit);\n }\n !units[i] && (units[i] = []);\n units[i][j] = unit;\n unit.parentAlias(alias)\n .valueParser(this.valueParser())\n .coord(coord);\n el.config(unitConfig);\n });\n store.unlockModel();\n lifeCycleManager.notify({ client: units, action: INITIALIZED, formalName: UNIT });\n return this.units(units);\n }\n\n /**\n *\n *\n * @param {*} config\n * @memberof MatrixResolver\n */\n setRetinalAxisDomain (config, datamodel, encoders) {\n const {\n color,\n shape,\n size,\n globalConfig\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const {\n rowFacets,\n colFacets\n } = this.getAllFields();\n const encoding = {\n color,\n shape,\n size\n };\n const facetFields = [...rowFacets.map(e => e.toString()), ...colFacets.map(e => e.toString())];\n const retContext = {\n domains: encoders.simpleEncoder.getRetinalFieldsDomain(datamodel, encoding, facetFields, groupBy),\n axes: this.getRetinalAxes(),\n encoding\n };\n encoders.retinalEncoder.setCommonDomain(retContext);\n return this;\n }\n\n resetFacetsAndProjections () {\n this._facets = {};\n this._projections = {};\n return this;\n }\n\n getRetinalAxes () {\n const {\n color,\n shape,\n size\n } = this.axes();\n\n return {\n color: [...color],\n shape: [...shape],\n size: [...size]\n };\n }\n\n getSimpleAxes (type) {\n return this.axes()[`${type}`];\n }\n\n createRetinalAxes (fieldsConfig, config, encoders) {\n const retinalAxes = encoders.retinalEncoder.createAxis({\n fieldsConfig,\n config,\n axes: this.axes()\n });\n\n this.axes(retinalAxes);\n\n this.updateVisualUnit(config);\n\n return this;\n }\n\n createHeaders (placeholders, fieldNames, config) {\n let bottomLeft = [];\n let bottomRight = [];\n const {\n rows,\n columns\n } = placeholders;\n const {\n smartlabel: labelManager,\n lifeCycleManager\n } = this.dependencies();\n const {\n showHeaders,\n classPrefix\n } = config;\n const { TextCell, BlankCell } = this.registry().cells;\n const [leftRows, rightRows] = rows;\n const [topCols, bottomCols] = columns;\n const rowHeaders = fieldNames.rows;\n const blankCellCreator = cell => new BlankCell().config({ show: cell.config().show });\n\n // Headers and footers are created based on the rows. Thereafter, using the column information\n // they are tabularized into the current structure\n const headers = {\n left: headerCreator(leftRows, rowHeaders[0], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager }),\n right: headerCreator(rightRows, rowHeaders[1], showHeaders ? TextCell : BlankCell,\n { classPrefix, labelManager })\n };\n const footers = {\n left: leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : [],\n right: rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []\n };\n const [topLeft, topRight] = [LEFT, RIGHT].map(type => topCols.map((col, i) => {\n if (i === topCols.length - 1) {\n return headers[type];\n }\n return footers[type];\n }));\n\n // Creating only bottom matrices if there is no information on the top\n if (topCols.length === 0) {\n [bottomLeft, bottomRight] = [LEFT, RIGHT].map(type => bottomCols.map((col, i) => {\n if (i === 0) {\n return headers[type];\n }\n return footers[type];\n }));\n } else {\n bottomLeft = bottomCols.map(() => (leftRows.length > 0 ? leftRows[0].map(blankCellCreator) : []));\n bottomRight = bottomCols.map(() => (rightRows.length > 0 ? rightRows[0].map(blankCellCreator) : []));\n }\n\n lifeCycleManager.notify({\n client: [topLeft, topRight, bottomLeft, bottomRight],\n action: INITIALIZED,\n formalName: FACET_HEADERS\n });\n\n return { topLeft, topRight, bottomLeft, bottomRight };\n }\n\n updateVisualUnit (retinalConfig) {\n const retinalAxes = this.getRetinalAxes();\n\n const { lifeCycleManager } = this.dependencies();\n lifeCycleManager.notify({ client: this.axes(), action: INITIALIZED, formalName: AXIS });\n lifeCycleManager.notify({ client: this.units(), action: BEFORE_UPDATE, formalName: UNIT });\n\n const units = [];\n const matrixLayers = this.matrixLayers();\n\n const props = [`${STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE}.domain`,\n `${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`];\n const store = this.store();\n store.lockCommits(props);\n store.lockModel();\n\n this.forEach(VALUE_MATRIX, (i, j, el) => {\n el.axes(Object.assign(el.axes(), retinalAxes));\n el.source() && el.source().retinalFields(retinalConfig);\n el.layerDef(matrixLayers[i][j]);\n el.updateModel();\n\n units.push(el.source());\n });\n\n store.unlockModel()\n .unlockCommits([props[0]])\n .unlockCommits([props[1]]);\n lifeCycleManager.notify({ client: units, action: UPDATED, formalName: UNIT });\n return this;\n }\n\n getMatrices (resolverConfig) {\n this._placeholderInfo = computeMatrices(resolverConfig);\n\n return this._placeholderInfo;\n }\n\n clear () {\n const cacheMaps = this._cacheMaps;\n\n for (const key in cacheMaps) {\n cacheMaps[key].clear();\n }\n }\n\n}\n","import { MeasureSubtype, DimensionSubtype, FieldType } from 'muze-utils';\n\nimport { ScaleType } from '@chartshq/muze-axis';\n\n/**\n * Map of DataModel types to associated field types.\n */\nexport const dataTypeScaleMap = {\n [FieldType.DIMENSION]: ScaleType.BAND,\n [DimensionSubtype.CATEGORICAL]: ScaleType.BAND,\n [DimensionSubtype.TEMPORAL]: ScaleType.TIME,\n [FieldType.MEASURE]: ScaleType.LINEAR,\n [MeasureSubtype.CONTINUOUS]: ScaleType.LINEAR,\n [DimensionSubtype.BINNED]: ScaleType.BAND\n};\n","import { mergeRecursive, getObjProp } from 'muze-utils';\nimport { AxisOrientation } from '@chartshq/muze-axis';\nimport { ENCODING } from '@chartshq/visual-layer';\nimport { scaleMaps } from '../enums/scale-maps';\nimport { getAxisType, getAxisKey } from '../group-helper';\nimport { dataTypeScaleMap } from '../data-type-scale-map';\nimport { CATEGORICAL, TEMPORAL, BAR, LINE, POINT, BOTH, Y, COLOR, SHAPE, SIZE, ANGLE0 } from '../enums/constants';\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst getAxisConfig = (axisInfo, field, axesCreators, indices, facetFields) => {\n let axisOrientation;\n const { index, axisIndex, axisType } = axisInfo;\n const { config, position } = axesCreators;\n const { rowIndex, columnIndex } = indices;\n const rawUserAxisConfig = config.axes ? (config.axes[axisType] || {}) : {};\n\n // Change config object to a function if not already one\n const userAxisConfigFn = typeof rawUserAxisConfig !== 'function' ?\n () => rawUserAxisConfig : rawUserAxisConfig;\n const userAxisConfig = userAxisConfigFn(rowIndex, columnIndex, {\n axisFields: field.getMembers(),\n facetFields\n });\n\n // If current config does not specifes config for an axis, retain old config\n if (!userAxisConfig) {\n return {};\n }\n\n const {\n LEFT,\n RIGHT,\n TOP,\n BOTTOM\n } = AxisOrientation;\n const allOrientations = axisType === Y ? [LEFT, RIGHT] : [TOP, BOTTOM];\n\n if (position === BOTH) {\n axisOrientation = allOrientations[axisIndex];\n } else {\n axisOrientation = position;\n }\n const axisConfig = {\n id: `${axisType}-${index}-${axisIndex}`,\n name: field.displayName(),\n field: field.toString(),\n numberFormat: field.numberFormat(),\n orientation: axisOrientation,\n showAxisName: true,\n show: true,\n type: dataTypeScaleMap[field.subtype()]\n };\n userAxisConfig.tickValues = field.format(userAxisConfig.tickValues);\n userAxisConfig.domain = field.format(userAxisConfig.domain);\n\n return mergeRecursive(axisConfig, userAxisConfig);\n};\n\n/**\n *\n *\n * @param {*} axisInfo\n * @param {*} field\n * @param {*} axesCreators\n *\n */\nconst createSimpleAxis = (axisConfig, field, axesCreators) => {\n const { labelManager } = axesCreators;\n const Cls = scaleMaps[dataTypeScaleMap[field.subtype()]];\n const simpleAxis = new Cls(axisConfig, { labelManager });\n return simpleAxis;\n};\n\nexport const getAdjustedDomain = (max, min) => {\n const y1ratio = max[0] / (max[0] - min[0]);\n const y2ratio = max[1] / (max[1] - min[1]);\n\n // adjust min/max values for positive negative values zero line etc\n let allSameSign = false;\n\n // if all numbers are positive set floor to zero\n if (min[0] > 0 && min[1] > 0 && min[1] > 0 && max[1] > 0) {\n allSameSign = true;\n min[0] = 0;\n min[1] = 0;\n }\n\n // if all numbers are negative set ceiling to zero\n if (min[0] < 0 && min[1] < 0 && min[1] < 0 && max[1] < 0) {\n allSameSign = true;\n max[0] = 0;\n max[1] = 0;\n }\n\n // align zero line if necessary\n if (!allSameSign && y1ratio !== y2ratio) {\n if (y1ratio < y2ratio) {\n // adjust min[1]\n min[1] = min[0] / max[0] * max[1];\n } else {\n // adjust min[0]\n min[0] = min[1] / max[1] * max[0];\n }\n }\n return [\n [min[0], max[0]],\n [min[1], max[1]]\n ];\n};\n\n/**\n *\n *\n * @param {*} axisType\n * @param {*} fieldInfo\n * @param {*} axesCreators\n * @param {*} groupAxes\n *\n */\nexport const generateAxisFromMap = (axisType, fieldInfo, axesCreators, axesInfo, indices, facetFields) => {\n let axisKey;\n const { groupAxes, valueParser } = axesInfo;\n const currentAxes = [];\n const { fields, index } = fieldInfo;\n const { cacheMaps } = axesCreators;\n const map = cacheMaps[`${axisType}AxesMap`];\n\n const commonAxisKey = getAxisKey(axisType, index);\n fields.forEach((field, axisIndex) => {\n axisKey = getAxisKey(axisType, index, axisIndex, dataTypeScaleMap[field.subtype()]);\n const axisConfig = getAxisConfig({ index, axisIndex, axisType }, field, axesCreators, indices, facetFields);\n\n let axis;\n if (!map.has(axisKey)) {\n axis = createSimpleAxis(axisConfig, field, axesCreators);\n } else {\n axis = map.get(axisKey);\n axis._rotationLock = false;\n axis.config(axisConfig);\n }\n axis.valueParser(valueParser);\n currentAxes.push(axis);\n map.set(axisKey, axis);\n });\n\n if (currentAxes.length) {\n map.set(commonAxisKey, currentAxes);\n groupAxes.add(commonAxisKey);\n }\n\n return currentAxes;\n};\n\nexport const sanitizeIndividualLayerConfig = (encodingConfigs, def) => {\n [COLOR, SHAPE, SIZE].forEach((axis) => {\n if (encodingConfigs[axis] && encodingConfigs[axis].field) {\n def.forEach((conf) => {\n conf.encoding = conf.encoding || {};\n !conf.encoding[axis] && (conf.encoding[axis] = {});\n conf.encoding[axis].field = encodingConfigs[axis].field;\n });\n }\n });\n};\n\n/**\n *\n *\n * @memberof MatrixResolver\n */\nexport const mutateAxesFromMap = (cacheMaps, axes) => {\n const {\n xAxesMap,\n yAxesMap\n } = cacheMaps;\n const {\n x: xAxisSet,\n y: yAxisSet\n } = axes;\n const xAxes = [];\n const yAxes = [];\n\n xAxisSet.forEach((axisId) => {\n const xAxis = xAxesMap.get(axisId);\n xAxes.push(xAxis);\n });\n yAxisSet.forEach((axisId) => {\n const yAxis = yAxesMap.get(axisId);\n yAxes.push(yAxis);\n });\n return {\n xAxes, yAxes\n };\n};\n\n/**\n * return a default mark based on predefined set of rules of type and subtype of the fields\n *\n * @param {string} colFieldType dimension/measure - temporal/ordinal/nominal\n * @param {string} rowFieldType dimension/measure - temporal/ordinal/nominal\n * @return {Object} return mark type\n */\nexport const getDefaultMark = (colFieldType, rowFieldType) => {\n let mark;\n\n if (colFieldType === CATEGORICAL || rowFieldType === CATEGORICAL) {\n mark = BAR;\n } else if (colFieldType === TEMPORAL || rowFieldType === TEMPORAL) {\n mark = LINE;\n } else {\n mark = POINT;\n }\n\n return mark;\n};\n\n/**\n *\n *\n * @param {*} axesCreators\n * @param {*} [fieldInfo=[]]\n *\n */\nexport const createRetinalAxis = (axesCreators, fieldProps = {}) => {\n const { axisType, fieldsConfig } = axesCreators;\n const field = fieldProps.field;\n const axis = [];\n const Cls = scaleMaps[axisType];\n\n fieldProps.type = fieldProps.type ? fieldProps.type : getAxisType(fieldsConfig, field || null);\n axis.push(new Cls(fieldProps));\n return axis;\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} val\n *\n */\nexport const getIndex = (arr, val) => {\n let i = 0;\n let arrIndex = -1;\n\n while (arrIndex === -1 && i < arr.length) {\n if (arr[i].toString() === val.toString()) {\n arrIndex = i;\n }\n i++;\n }\n return arrIndex;\n};\n\n/**\n *\n *\n * @param {*} colFields\n * @param {*} rowFields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\nexport const getLayerConfFromFields = (colFields, rowFields, userLayerConfig) => userLayerConfig.filter((conf) => {\n const userConf = conf instanceof Array ? conf : [conf];\n const encodingArr = [].concat(...userConf.map(d => d.encoding).filter(d => d !== undefined));\n\n if (!encodingArr.length) {\n return true;\n }\n\n const xFields = [].concat(...encodingArr.map(d => [d.x && d.x.field, d.x0 && d.x0.field]))\n .filter(d => d !== undefined && d !== null);\n const yFields = [].concat(...encodingArr.map(d => [d.y && d.y.field, d.y0 && d.y0.field]))\n .filter(d => d !== undefined && d !== null);\n\n if (!xFields.length && !yFields.length) {\n return true;\n }\n\n const colFieldExist = xFields.length ? xFields.every(d => colFields.indexOf(d) !== -1) : false;\n const rowFieldExist = yFields.length ? yFields.every(d => rowFields.indexOf(d) !== -1) : false;\n if (xFields.length && yFields.length) {\n return colFieldExist && rowFieldExist;\n }\n return colFieldExist || rowFieldExist;\n});\n\nexport const resolveAxisConfig = (context, fieldInf, axisInfo) => {\n const { rowIndex, columnIndex, axesObj } = axisInfo;\n const { config, facetFields, resolver } = context;\n const resolverAxes = resolver.axes();\n const { RADIUS, ANGLE } = ENCODING;\n [RADIUS, ANGLE, ANGLE0].forEach((enc) => {\n const axesArr = resolverAxes[enc];\n if (!axesArr[rowIndex]) {\n axesArr[rowIndex] = [];\n }\n axesArr[rowIndex][columnIndex] = axesObj[enc];\n const axisConfig = getObjProp(config.axes, enc) || {};\n\n axesObj[enc].forEach((axis, i) => {\n let userConfig = axisConfig;\n if (axisConfig instanceof Function) {\n userConfig = axisConfig(rowIndex, columnIndex, {\n axisFields: [fieldInf[enc][i]],\n facetFields\n });\n }\n axis.config(userConfig);\n });\n });\n};\n\nexport const getSortingConfig = (context, currentFieldName, axesConfig) => {\n const config = context.config();\n const dataModel = context.data();\n\n let lastSortConfig = null;\n if (Object.keys(config.sort).length !== 0) {\n return config.sort[currentFieldName];\n }\n\n const operations = [...dataModel.getAncestorDerivations(), ...dataModel.getDerivations()];\n\n while (lastSortConfig = operations.pop()) {\n if (lastSortConfig.op === 'sort') break;\n }\n if (lastSortConfig &&\n lastSortConfig.criteria.length &&\n lastSortConfig.criteria[0][0] === currentFieldName) {\n return lastSortConfig.criteria[0][1];\n }\n return axesConfig().defaultSort;\n};\n","import { layerFactory } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n unionDomain,\n COORD_TYPES,\n toArray,\n sortCategoricalField\n} from 'muze-utils';\nimport { ScaleType } from '@chartshq/muze-axis';\nimport {\n generateAxisFromMap,\n getDefaultMark,\n getIndex,\n getLayerConfFromFields,\n getAdjustedDomain,\n sanitizeIndividualLayerConfig,\n getSortingConfig\n} from './encoder-helper';\nimport { retriveDomainFromData } from '../group-helper';\n\nimport { ROW, COLUMN, COL, LEFT, TOP, MEASURE, BOTH, X, Y } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\nconst CARTESIAN = COORD_TYPES.CARTESIAN;\n\n/**\n *\n *\n * @export\n * @class CartesianEncoder\n * @extends {VisualEncoder}\n */\nexport default class CartesianEncoder extends VisualEncoder {\n\n /**\n *\n *\n *\n * @memberof CartesianEncoder\n */\n static type () {\n return CARTESIAN;\n }\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof CartesianEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const geomCellAxes = {};\n const {\n axes\n } = axesCreators;\n const {\n projections,\n indices\n } = fieldInfo;\n const {\n rowFields,\n columnFields\n } = projections;\n const {\n rowIndex,\n columnIndex\n } = indices;\n const axisFields = [{\n fields: rowFields,\n index: rowIndex\n }, {\n fields: columnFields,\n index: columnIndex\n }];\n const { resolver, facetFields, geomCell } = context;\n const xAxes = axes.x || [];\n const yAxes = axes.y || [];\n\n [rowFields, columnFields].forEach((fields, i) => {\n const type = i === 0 ? ROW : COLUMN;\n const axis = i === 0 ? Y : X;\n\n if (fields.length > 1) {\n axesCreators.position = BOTH;\n } else {\n axesCreators.position = this.axisFrom()[type];\n }\n geomCellAxes[axis] = generateAxisFromMap(axis, axisFields[i], axesCreators, {\n groupAxes: axis === X ? xAxes : yAxes,\n valueParser: resolver.valueParser()\n }, indices, facetFields);\n });\n geomCell.axes(geomCellAxes);\n return geomCellAxes;\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n const resolver = context.resolver();\n const units = resolver.units();\n const domains = {\n 0: {},\n 1: {}\n };\n const fieldsObj = {\n 0: {},\n 1: {}\n };\n\n for (let rIdx = 0, len = units.length; rIdx < len; rIdx++) {\n const unitsArr = units[rIdx];\n for (let cIdx = 0, len2 = unitsArr.length; cIdx < len2; cIdx++) {\n const unit = unitsArr[cIdx];\n const axisFields = unit.fields();\n const encodingDomains = unit.dataDomain();\n ['x', 'y'].forEach((axisType, axisTypeIndex) => {\n const fieldArr = axisFields[axisType];\n fieldArr.forEach((field, axisIndex) => {\n const key = !axisTypeIndex ? `0${cIdx}${axisIndex}` : `${rIdx}0${axisIndex}`;\n const dom = encodingDomains[axisType];\n const typeOfField = field.subtype();\n fieldsObj[axisTypeIndex][key] = field;\n\n if (dom && Object.keys(dom).length !== 0) {\n domains[axisTypeIndex][key] = unionDomain([(domains[axisTypeIndex] &&\n domains[axisTypeIndex][key]) || [], dom[`${field}`]], typeOfField);\n }\n });\n });\n }\n }\n\n const { x: xAxes, y: yAxes } = resolver.axes();\n store.lockModel();\n [xAxes, yAxes].forEach((axesArr, axisType) => {\n axesArr.forEach((axes, idx) => {\n let key;\n let domain = [];\n let adjustedDomain = [];\n const min = [];\n const max = [];\n const typeOfAxis = axes[0].constructor.type();\n\n if (axes.length > 1 && typeOfAxis === ScaleType.LINEAR && axes[0].config().alignZeroLine) {\n axes.forEach((axis, i) => {\n key = !axisType ? `0${idx}${i}` : `${idx}0${i}`;\n domain = domains[axisType][key];\n min[i] = domain[0];\n max[i] = domain[1];\n });\n adjustedDomain = getAdjustedDomain(max, min);\n } else if (typeOfAxis === ScaleType.BAND) {\n /* Sort categorical fields to ensure consistency across all rows\n only if sorted by user */\n key = !axisType ? `0${idx}0` : `${idx}00`;\n const currentFieldName = fieldsObj[axisType][key].oneVar();\n const sortingOrder = getSortingConfig(context, currentFieldName, axes[0].config);\n if (sortingOrder && domains[axisType][key] instanceof Array) {\n domains[axisType][key].sort((a, b) => sortCategoricalField(sortingOrder, a, b));\n }\n }\n\n axes.forEach((axis, index) => {\n key = !axisType ? `0${idx}${index}` : `${idx}0${index}`;\n domain = adjustedDomain[index] || domains[axisType][key];\n\n domain && axis.domain(domain);\n const type = !axisType ? 'x' : 'y';\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${type}`, domain, `${idx}${index}`);\n });\n });\n });\n store.unlockModel();\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields, type) {\n let facets = [];\n let projections = [];\n let counter = 0;\n const primaryFacets = [];\n const secondaryFacets = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n const axisFrom = this.axisFrom();\n\n for (let i = 0; i < primaryLen; i++) {\n let projArr = [primaryFields[i]];\n const primaryField = primaryFields[i];\n\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter];\n if (secondaryField && secondaryField.type() === MEASURE) {\n counter++;\n projArr = [primaryField, secondaryField];\n }\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n primaryFacets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n secondaryFacets.push(secondaryField);\n }\n }\n }\n if ((primaryFacets.length || secondaryFacets.length) && !projections.length) {\n type = type === COL ? COLUMN : type;\n if ((axisFrom[type] === LEFT || axisFrom[type] === TOP) && primaryFacets.length) {\n const axisFromIndex = primaryFacets.length - 1;\n const facet = primaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(secondaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n secondaryFacets.splice(existIndex, 1);\n }\n primaryFacets.splice(axisFromIndex, 1);\n } else {\n const axisFromIndex = 0;\n const facet = secondaryFacets[axisFromIndex];\n projections = [[facet]];\n const existIndex = getIndex(primaryFacets, facet);\n if (existIndex > -1) {\n projections = [[facet, facet]];\n primaryFacets.splice(existIndex, 1);\n }\n secondaryFacets.splice(axisFromIndex, 1);\n }\n }\n\n facets = [...primaryFacets, ...secondaryFacets];\n facets = facets.filter((el, index, self) => index === self.findIndex(t => (t.toString() === el.toString())));\n return {\n facets,\n projections\n };\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n *\n * @memberof CartesianEncoder\n */\n fieldSanitizer (datamodel, config) {\n return super.fieldSanitizer(datamodel, config);\n }\n\n /**\n *\n *\n * @param {*} datamodel\n *\n * @memberof CartesianEncoder\n */\n getRetinalFieldsDomain (dataModels, encoding) {\n const groupedModel = dataModels.groupedModel;\n const domains = {};\n for (const key in encoding) {\n if ({}.hasOwnProperty.call(encoding, key)) {\n const encodingObj = encoding[key];\n const field = encodingObj.field;\n if (!encodingObj.domain && field) {\n const domain = retriveDomainFromData(groupedModel, field);\n domains[field] = domain;\n }\n }\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n * @memberof CartesianEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n // let currentLayerIndex = 0;\n layerArray.length && layerArray.forEach((layer, i) => {\n const def = layerFactory.sanitizeLayerConfig(layer);\n def.order = i;\n serializedLayers.push(def);\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof CartesianEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n const layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n\n // let currentLayerIndex = 0;\n columnFields.forEach((colField) => {\n const colFieldName = colField.toString();\n rowFields.forEach((rowField) => {\n let configs = [];\n const rowFieldName = rowField.toString();\n const encoding = {\n x: {\n field: colFieldName\n },\n y: {\n field: rowFieldName\n }\n };\n const rowFieldType = rowField.subtype();\n const colFieldType = colField.subtype();\n const mark = getDefaultMark(colFieldType, rowFieldType);\n\n const defConfigs = [{\n mark,\n def: {\n mark,\n encoding\n }\n }];\n\n const layerConfigs = getLayerConfFromFields(colField.getMembers(),\n rowField.getMembers(), userLayerConfig || []);\n if (layerConfigs.length) {\n configs = layerConfigs.map((layerConf) => {\n const mergedLayerConf = mergeRecursive(mergeRecursive({}, defConfigs[0].def), layerConf);\n const serializedLayerConfig = layerFactory.getSerializedConf(mergedLayerConf.mark,\n mergedLayerConf);\n return {\n mark: mergedLayerConf.mark,\n order: mergedLayerConf.order,\n def: serializedLayerConfig\n };\n });\n } else {\n configs = defConfigs;\n }\n\n layerConfig.push(...configs);\n });\n });\n return this.sanitizeLayerConfig(retinalConfig, layerConfig);\n }\n\n hasMandatoryFields (fields) {\n const { colProjections, rowProjections } = fields;\n const colFields = super.hasMandatoryFields({ colProjections });\n const rowFields = super.hasMandatoryFields({ rowProjections });\n return colFields && rowFields;\n }\n}\n","import { AngleAxis, RadiusAxis } from '@chartshq/muze-axis';\nimport { layerFactory, ENCODING } from '@chartshq/visual-layer';\nimport {\n mergeRecursive,\n STATE_NAMESPACES,\n GROUP_BY_FUNCTIONS,\n COORD_TYPES,\n toArray,\n getObjProp,\n defaultValue\n} from 'muze-utils';\nimport VisualEncoder from './visual-encoder';\nimport { SIZE, MEASURE, ARC, COLOR } from '../enums/constants';\nimport { sanitizeIndividualLayerConfig, resolveAxisConfig } from './encoder-helper';\nimport { SimpleVariable } from '../variable';\n\nconst POLAR = COORD_TYPES.POLAR;\nconst { RADIUS, ANGLE, ANGLE0 } = ENCODING;\n\nconst axesCls = {\n [RADIUS]: RadiusAxis,\n [ANGLE]: AngleAxis,\n [ANGLE0]: AngleAxis\n};\n\nconst getSizeMultiplier = (sizeVal, sizeAxis) => {\n const sizeAxisDomain = sizeAxis.domain();\n const sizeMultiplier = sizeAxis.getSize(sizeVal) / (sizeAxisDomain ? sizeAxis.range()[1] : sizeAxis.config().value);\n return sizeMultiplier;\n};\n\nconst setRadiusFactor = (context) => {\n const data = context.data();\n const sizeField = context.retinalFields().size.field;\n const { radius, size } = context.axes();\n\n if (sizeField && radius && radius.length) {\n const sizeFieldIndex = data.getFieldsConfig()[sizeField].index;\n const sizeVal = data.getData().data.reduce((acc, val) => acc + val[sizeFieldIndex], 1);\n const sizeMultiplier = getSizeMultiplier(sizeVal, size[0]);\n radius.forEach(axis => axis.setRadiusFactor(sizeMultiplier));\n }\n};\n\n/**\n *\n *\n * @export\n * @class PolarEncoder\n * @extends {VisualEncoder}\n */\nexport default class PolarEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n * @param {*} fieldInfo\n *\n * @memberof PolarEncoder\n */\n createAxis (axesCreators, fieldInfo, context) {\n const {\n axes\n } = axesCreators;\n const geomCellAxes = axes;\n const {\n indices\n } = fieldInfo;\n const {\n rowIndex,\n columnIndex\n } = indices;\n // Dummy axes for polar, to create blank cells\n const pieAxes = geomCellAxes.pie || [];\n\n pieAxes[rowIndex] = pieAxes[rowIndex] || [];\n pieAxes[rowIndex][columnIndex] = [];\n\n const axesObj = {};\n const { geomCell, resolver } = context;\n const layers = resolver.matrixLayers();\n const resolverAxes = resolver.axes();\n const cellLayers = layers[rowIndex][columnIndex];\n const fields = {\n radius: {},\n angle: {},\n angle0: {}\n };\n\n cellLayers.forEach((layerConf) => {\n const def = layerConf.def;\n [ANGLE, ANGLE0, RADIUS].forEach((enc) => {\n const field = getObjProp(def.encoding, enc, 'field');\n field && (fields[enc][field] = 0);\n });\n });\n const fieldInf = {};\n const varInstances = {};\n\n for (const encType in fields) {\n fieldInf[encType] = Object.keys(fields[encType]);\n axesObj[encType] = [];\n varInstances[encType] = [];\n fieldInf[encType].forEach((field, i) => {\n varInstances[encType][i] = new SimpleVariable(field);\n axesObj[encType][i] = new axesCls[encType]();\n });\n axesObj[encType][axesObj[encType].length] = new axesCls[encType]();\n }\n resolveAxisConfig(context, fieldInf, {\n axesObj,\n rowIndex,\n columnIndex\n });\n geomCell.axes(axesObj)\n .fields(Object.assign({}, varInstances, geomCell.fields()));\n resolverAxes.pie = pieAxes;\n return geomCellAxes;\n }\n\n /**\n *\n *\n * @param {*} fields\n *\n * @memberof CartesianEncoder\n */\n getFacetsAndProjections (fields) {\n let counter = 0;\n const facets = [];\n const projections = [];\n const primaryFields = fields[0];\n const secondaryFields = fields[1];\n const primaryLen = primaryFields.length;\n const secondaryLen = secondaryFields.length;\n\n for (let i = 0; i < primaryLen; i++) {\n const primaryField = primaryFields[i];\n if (primaryField.type() === MEASURE) {\n const secondaryField = secondaryFields[counter++];\n const projArr = secondaryField ? [primaryField, secondaryField] : [primaryField];\n projections.push(projArr);\n } else {\n facets.push(primaryField);\n }\n }\n if (secondaryLen > counter) {\n for (let i = counter; i < secondaryLen; i++) {\n const secondaryField = secondaryFields[i];\n const projArr = [secondaryField];\n if (secondaryField.type() === MEASURE) {\n projections.push(projArr);\n } else {\n facets.push(secondaryField);\n }\n }\n }\n return {\n facets,\n projections\n };\n }\n\n unionUnitDomains (context) {\n const store = context.store();\n store.lockModel();\n const domainProps = {\n radius: [],\n angle: [],\n angle0: []\n };\n const axes = context.resolver().axes();\n context.matrixInstance().value.each((cell, rIdx, cIdx) => {\n const unit = cell.valueOf();\n const unitDomains = unit.dataDomain();\n const fields = unit.fields();\n setRadiusFactor(unit);\n [RADIUS, ANGLE, ANGLE0].forEach((encType) => {\n const encodingFields = fields[encType];\n const domains = unitDomains[encType] || {};\n encodingFields.forEach((field, i) => {\n !domainProps[encType][rIdx] && (domainProps[encType][rIdx] = []);\n !domainProps[encType][rIdx][cIdx] && (domainProps[encType][rIdx][cIdx] = []);\n domainProps[encType][rIdx][cIdx][i] = domains[`${field}`] || [];\n });\n });\n });\n\n for (const key in domainProps) {\n const specificAxes = axes[key];\n specificAxes.forEach((axesArr, rIdx) => {\n axesArr.forEach((axisArr, cIdx) => {\n axisArr.forEach((axis, i) => {\n axis.domain(defaultValue(getObjProp(domainProps[key], rIdx, cIdx, i), []));\n\n store.commit(`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${key}`, domainProps[key],\n `${rIdx}-${cIdx}`);\n });\n });\n });\n }\n store.unlockModel();\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n setCommonDomain () {\n // No domain to be set\n return this;\n }\n\n /**\n *\n *\n *\n * @memberof PolarEncoder\n */\n static type () {\n return POLAR;\n }\n\n layers (...layers) {\n if (layers.length) {\n this._layers = layers[0];\n return this;\n }\n return this._layers;\n }\n\n /**\n *\n *\n * @param {*} datamodel\n * @param {*} config\n * @memberof PolarEncoder\n */\n fieldSanitizer (datamodel, config) {\n let sanitizedRows = [[], []];\n let sanitizedColumns = [[], []];\n const fields = super.fieldSanitizer(datamodel, config);\n const {\n layers\n } = config;\n const {\n rows,\n columns\n } = fields;\n const layer = layers[0];\n const encoding = layer.encoding;\n const radius = encoding && encoding.radius ? encoding.radius.field : null;\n const angle = encoding && encoding.angle ? encoding.angle.field : null;\n const sanitizedFields = [sanitizedRows, sanitizedColumns];\n\n [rows, columns].forEach((fieldType, typeIndex) => {\n fieldType.forEach((fieldSet, i) => fieldSet.forEach((field) => {\n if (field.toString() !== radius && field.toString() !== angle && field.type() !== MEASURE) {\n sanitizedFields[typeIndex][i].push(field);\n }\n }));\n });\n sanitizedColumns = [...new Set(sanitizedColumns)];\n sanitizedRows = [...new Set(sanitizedRows)];\n this.fieldInfo({ rows: sanitizedRows, columns: sanitizedColumns });\n return this.fieldInfo();\n }\n\n getRetinalFieldsDomain (dataModels, encoding, facetFields, groupBy) {\n let sizeField;\n let colorField;\n const fields = [];\n const layers = this.layers();\n const dataModel = dataModels.groupedModel;\n const fieldsConfig = dataModel.getFieldsConfig();\n const domains = {};\n if (layers && layers[0]) {\n const layer = layers[0];\n const layerEncoding = layer.def.encoding || {};\n\n [RADIUS, ANGLE, SIZE, COLOR].forEach((encType) => {\n const field = layerEncoding[encType] ? layerEncoding[encType].field : '';\n const measureField = fieldsConfig[field] && fieldsConfig[field].def.type === MEASURE;\n if (encType === SIZE && measureField) {\n sizeField = field;\n }\n if (encType === COLOR) {\n colorField = field;\n }\n fieldsConfig[field] && !measureField && fields.push(field);\n });\n }\n\n if (sizeField) {\n domains[sizeField] = dataModel.groupBy(facetFields, {\n [sizeField]: GROUP_BY_FUNCTIONS.SUM\n }).getFieldspace().fieldsObj()[sizeField].domain();\n }\n\n if (colorField) {\n const dm = dataModel.groupBy([...facetFields, ...fields], groupBy.measures);\n domains[colorField] = dm.getFieldspace().fieldsObj()[colorField].domain();\n }\n return domains;\n }\n\n /**\n *\n *\n * @param {*} fields\n * @param {*} userLayerConfig\n *\n * @memberof PolarEncoder\n */\n getLayerConfig (fields, userLayerConfig, retinalConfig) {\n let layerConfig = [];\n const {\n columnFields,\n rowFields\n } = fields;\n const allFields = [...columnFields, ...rowFields];\n\n allFields.forEach(() => {\n const encoding = {};\n let config = {\n mark: ARC,\n def: {\n encoding\n }\n };\n if (userLayerConfig && userLayerConfig.length > 0) {\n config = mergeRecursive(config, userLayerConfig[0]);\n }\n layerConfig.push(config);\n });\n if (layerConfig.length === 0) {\n layerConfig = userLayerConfig;\n }\n const sanitizedConfig = this.sanitizeLayerConfig(retinalConfig, layerConfig);\n this.layers(sanitizedConfig);\n return sanitizedConfig;\n }\n\n /**\n *\n *\n * @param {*} layerArray\n *\n * @memberof PolarEncoder\n */\n serializeLayerConfig (layerArray) {\n const serializedLayers = [];\n\n layerArray.length && layerArray.forEach((layer) => {\n const def = layerFactory.getSerializedConf(layer.mark, layer);\n serializedLayers.push({\n mark: layer.mark,\n def\n });\n });\n return serializedLayers;\n }\n\n sanitizeLayerConfig (encodingConfigs, userLayerConfig) {\n const layerConfig = [];\n\n userLayerConfig.forEach((config) => {\n const def = toArray(config.def);\n sanitizeIndividualLayerConfig(encodingConfigs, def);\n def.forEach((conf) => {\n const encoding = conf.encoding || (conf.encoding = {});\n !encoding.angle && (encoding.angle = {});\n const angleField = getObjProp(encoding.angle, 'field');\n const angle0Field = getObjProp(encoding.angle0, 'field');\n\n if (!angleField) {\n Object.assign(encoding.angle, {\n field: encodingConfigs.color && encodingConfigs.color.field\n });\n }\n if (!angle0Field) {\n !encoding.angle0 && (encoding.angle0 = {});\n Object.assign(encoding.angle0, {\n field: encoding.angle.field\n });\n }\n });\n\n layerConfig.push(config);\n });\n return layerConfig;\n }\n\n hasMandatoryFields (fields) {\n const { optionalProjections } = fields;\n return super.hasMandatoryFields({ optionalProjections });\n }\n}\n","import { createRetinalAxis } from './encoder-helper';\nimport { COLOR, SHAPE, SIZE } from '../enums/constants';\nimport VisualEncoder from './visual-encoder';\n\n/**\n *\n *\n * @export\n * @class RetinalEncoder\n * @extends {VisualEncoder}\n */\nexport default class RetinalEncoder extends VisualEncoder {\n\n /**\n *\n *\n * @param {*} axesCreators\n *\n * @memberof RetinalEncoder\n */\n createAxis (axesCreators) {\n const { fieldsConfig, config } = axesCreators;\n const newAxes = {};\n\n [COLOR, SHAPE, SIZE].forEach((axisType) => {\n newAxes[`${axisType}`] = createRetinalAxis({ axisType, fieldsConfig }, config[axisType]);\n });\n return newAxes;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof RetinalEncoder\n */\n static type () {\n return 'retinal';\n }\n\n /**\n *\n *\n * @param {*} context\n *\n * @memberof RetinalEncoder\n */\n setCommonDomain (context) {\n const { domains, axes, encoding } = context;\n\n Object.entries(encoding).forEach((enc) => {\n if (enc[1] && enc[1].field) {\n const encType = enc[0];\n const field = enc[1].field;\n\n if (field) {\n axes[encType].forEach((axis) => {\n const domain = domains[field];\n !enc[1].domain && axis.updateDomain(domain);\n });\n }\n }\n });\n\n return axes;\n }\n}\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Artboard.\n * Artboard merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module\n */\n\nexport default {\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { ERROR_MSG } from 'muze-utils';\n\n/**\n * Interfaces for VisualGroup. Any new VisualGroup has to implement this class.\n * @class SimpleGroup\n */\nclass SimpleGroup {\n\n /**\n * This method is used to set or get the DataModel instance.\n *\n * @param {DataModel | undefined} dataModel Instance of datamodel.\n\n * @memberof SimpleGroup\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to set or get the group specific configuration\n * properties\n *\n * @param {Object | undefined} configObj The input configuration.\n * or instance of visual group.\n * @memberof SimpleGroup\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to return a serialized representation of the\n * instance's properties.\n *\n * @memberof SimpleGroup\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * This method is used to get or set the measurement object which houses\n * layout properties like width and height.\n *\n * @param {Object | undefined} mObj The measurement properties.\n * @memberof SimpleGroup\n */\n measurement () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n}\n\nexport default SimpleGroup;\n","/**\n * This is a wrapper class over the matrix of cells which gets created in visual group. Visual Group creates left,\n * right, bottom and top and center matrices and wraps them using this class.\n *\n * @public\n * @class ValueMatrix\n */\nclass ValueMatrix {\n\n /**\n * Creates an instance of ValueMatrix.\n *\n * @param {Array} matrixArr Matrix array.\n */\n constructor (matrixArr) {\n const instancesById = {};\n\n this.matrix(matrixArr || []);\n this.filter(() => true);\n\n this.each((el, rIdx, cIdx) => {\n const cellValue = el.valueOf();\n if (cellValue && cellValue.id) {\n const id = cellValue.id();\n instancesById[id] = {\n instance: cellValue,\n rowIndex: rIdx,\n colIndex: cIdx\n };\n }\n });\n\n this.instancesById(instancesById);\n }\n\n instancesById (...id) {\n if (id.length) {\n this._instancesById = id[0];\n return this;\n }\n return this._instancesById;\n }\n\n /**\n * Returns the array of matrices contained in this instance.\n *\n * @public\n * @return {Array} Array of matrices.\n */\n matrix (...matrix) {\n if (matrix.length) {\n this._matrix = matrix[0];\n return this;\n }\n return this._matrix;\n }\n\n /**\n * Sets a filter criteria. This filter criteria gets applied when each function is called.\n *\n * @public\n * @param {Function} fn Filter function.\n *\n * @return {ValueMatrix} Instance of value matrix.\n */\n filter (...fn) {\n if (fn.length) {\n this._filterFn = fn[0];\n return this;\n }\n return this._filterFn;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n width () {\n let rowWidth = 0;\n\n this.matrix().forEach((row) => {\n let currentRowWidth = 0;\n row.forEach((cell) => {\n currentRowWidth += cell.getLogicalSpace().width;\n });\n rowWidth = Math.max(rowWidth, currentRowWidth);\n });\n return rowWidth;\n }\n\n /**\n * Returns the total width occupied by all the cells of the matrix.\n *\n * @return {Number} Width of the matrix.\n */\n height () {\n let rowHeight = 0;\n\n this.matrix().forEach((row) => {\n let currentRowHeight = 0;\n row.forEach((cell) => {\n currentRowHeight = Math.max(currentRowHeight, cell.getLogicalSpace().height);\n });\n rowHeight += currentRowHeight;\n });\n return rowHeight;\n }\n\n /**\n * Iterates through the two dimensional matrix array and calls the given callback function with the cell instance,\n * row index, column index and the matrix array.\n *\n * @param {Function} fn Callback function which will get called for every cell.\n * @return {ValueMatrix} Instance of the value matrix.\n */\n each (fn) {\n const matrix = this.matrix();\n const filterFn = this.filter();\n\n matrix.forEach((row, rIndex) => {\n row.forEach((col, cIndex) => {\n if (filterFn(col)) {\n fn(col, rIndex, cIndex, matrix);\n }\n });\n });\n return this;\n }\n\n findPlaceHolderById (id) {\n return this.instancesById()[id];\n }\n\n clear () {\n this.each(cell => cell.remove());\n this.matrix([]);\n }\n\n data () {\n\n }\n}\n\nexport default ValueMatrix;\n","import { VisualUnit } from '@chartshq/visual-unit';\nimport { STATE_NAMESPACES, CommonProps, InvalidAwareTypes } from 'muze-utils';\nimport { BaseLayer } from '@chartshq/visual-layer';\nimport { getBorders } from '../group-helper';\nimport { RetinalEncoder } from '../encoder';\nimport { registerDomainChangeListener, unsubscribeChangeListeners } from './change-listener';\nimport ValueMatrix from './value-matrix';\nimport { ROWS, COLUMNS, DATA } from '../enums/constants';\n\nexport const createUnitState = (context) => {\n const [globalState, localState] = VisualUnit.getState();\n const store = context.store();\n store.append(STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.UNIT_LOCAL_NAMESPACE, localState);\n};\n\nexport const initializeGlobalState = (context) => {\n const globalState = context.constructor.getState()[0];\n const store = context.store();\n store.append(STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE, globalState);\n};\n\nexport const createLayerState = (context) => {\n const [globalState, localState] = BaseLayer.getState();\n context.store().append(STATE_NAMESPACES.LAYER_GLOBAL_NAMESPACE, globalState)\n .append(STATE_NAMESPACES.LAYER_LOCAL_NAMESPACE, localState);\n};\n\nconst sanitizeRetinalConfig = (retinalConf) => {\n const conf = {};\n for (const key in retinalConf) {\n const confValue = retinalConf[key];\n if (typeof confValue === 'string' || !confValue) {\n conf[key] = {\n field: retinalConf[key]\n };\n } else {\n conf[key] = confValue;\n }\n }\n return conf;\n};\n\nexport const setMatrixInstances = (context, placeholder) => {\n let {\n values,\n rows,\n columns\n } = placeholder;\n values = values || [];\n rows = rows || [];\n columns = columns || [];\n context._composition.matrices = {\n value: new ValueMatrix(values),\n left: new ValueMatrix(rows[0]),\n right: new ValueMatrix(rows[1]),\n top: new ValueMatrix(columns[0]),\n bottom: new ValueMatrix(columns[1])\n };\n\n context._dependencies.throwback.commit(CommonProps.MATRIX_CREATED, true);\n return context;\n};\n\nconst hasValue = (val) => {\n let hasOneValue = false;\n for (let i = 0; i < val.length && !hasOneValue; i++) {\n for (let j = 0; j < val[i].length; j++) {\n if (!(val[i][j] instanceof InvalidAwareTypes)) {\n hasOneValue = true;\n break;\n }\n }\n }\n return hasOneValue;\n};\n\nexport const updateChecker = (context, props) => props.every((option) => {\n const val = context[option]();\n switch (option) {\n case ROWS:\n case COLUMNS:\n return val !== null;\n case DATA:\n return val && !val.isEmpty() && hasValue(val.getData().data);\n\n default:\n return true;\n }\n});\n\nexport const initializeFields = (context) => {\n const rows = context.rows();\n const columns = context.columns();\n const color = context.color();\n const datamodel = context.data();\n const size = context.size();\n const detail = context.detail();\n const layers = context.layers();\n const transform = context.transform();\n const config = context.config();\n const shape = context.shape();\n // Get the resolver for the matrices\n const resolver = context.resolver();\n\n resolver.store(context.store());\n resolver.valueParser(context.valueParser());\n\n // Prepare configuration for matrix preparation\n let matrixConfig = {\n selection: context.selection(),\n alias: context.alias(),\n globalConfig: config || {},\n rows,\n columns,\n detail,\n layers,\n transform\n };\n\n unsubscribeChangeListeners(context);\n\n const retinalConfig = sanitizeRetinalConfig({\n color,\n shape,\n size\n });\n\n matrixConfig = Object.assign(matrixConfig, retinalConfig);\n // Create the encoders for the group\n const encoders = {};\n encoders.retinalEncoder = new RetinalEncoder();\n encoders.simpleEncoder = context.createEncoderInstance();\n matrixConfig.coord = encoders.simpleEncoder.constructor.type();\n resolver.encoder(encoders.simpleEncoder);\n\n // Set the group type\n context.groupType(encoders.simpleEncoder.constructor.type());\n\n // Get sanitized fields as instances of the Vars Class\n const fields = encoders.simpleEncoder.fieldSanitizer(datamodel, matrixConfig);\n encoders.simpleEncoder.setAxisAndHeaders(config ? config.axisFrom : {}, fields);\n // Setting layers for the code\n layers && resolver.layerConfig(layers);\n // Set the row and column axes\n resolver.horizontalAxis(fields.rows, encoders).verticalAxis(fields.columns, encoders);\n\n return {\n rows,\n columns,\n color,\n datamodel,\n size,\n detail,\n layers,\n transform,\n config,\n shape,\n resolver,\n matrixConfig,\n retinalConfig,\n encoders,\n fields\n };\n};\n\nexport const createMatrices = (context, sanitizedConfig) => {\n const { groupConfig, resolverConfig } = sanitizedConfig;\n const {\n config,\n resolver,\n matrixConfig,\n encoders,\n retinalConfig,\n fields\n } = groupConfig;\n\n const placeholderInfo = resolver.getMatrices(resolverConfig);\n\n context._groupedDataModel = placeholderInfo.dataModels.groupedModel;\n // Set the selection object\n context.selection(placeholderInfo.selection);\n\n // Create retinal axes\n resolver.createRetinalAxes(placeholderInfo.dataModels.parentModel.getFieldsConfig(), retinalConfig,\n encoders);\n\n // Domains are evaluated for each of the axes for commonality\n resolver.setRetinalAxisDomain(matrixConfig, placeholderInfo.dataModels, encoders);\n\n // Create matrix instances\n setMatrixInstances(context, placeholderInfo);\n\n // Prepare corner matrices\n context.cornerMatrices(resolver.createHeaders(placeholderInfo, fields, config));\n\n // Set placeholder information\n context.placeholderInfo(placeholderInfo);\n\n context._composition.axes = resolver.axes();\n context.metaData({\n border: getBorders(placeholderInfo, encoders.simpleEncoder)\n });\n\n resolver.encoder().unionUnitDomains(context);\n\n registerDomainChangeListener(context);\n return context;\n};\n\nexport const initializeResolverFields = (context, config) => {\n const {\n datamodel,\n encoders,\n resolver,\n componentRegistry\n } = context;\n const {\n globalConfig,\n selection,\n transform\n } = config;\n const groupBy = globalConfig.autoGroupBy;\n const { smartlabel: labelManager } = resolver.dependencies();\n const fieldMap = datamodel.getFieldsConfig();\n const layerConfig = resolver.layerConfig();\n const registry = resolver.registry();\n const { fields: normalizedRows } = resolver.horizontalAxis();\n const { fields: normalizedColumns } = resolver.verticalAxis();\n const otherEncodings = resolver.optionalProjections(config, layerConfig, datamodel.getSchema());\n const facetsAndProjections = resolver.getAllFields();\n const { simpleEncoder } = encoders;\n const shouldRender = simpleEncoder.hasMandatoryFields(facetsAndProjections);\n return {\n datamodel,\n encoders,\n resolver,\n globalConfig,\n selection,\n transform,\n componentRegistry,\n groupBy,\n labelManager,\n fieldMap,\n layerConfig,\n registry,\n normalizedRows,\n normalizedColumns,\n otherEncodings,\n facetsAndProjections,\n simpleEncoder,\n shouldRender,\n config\n };\n};\n","import { STATE_NAMESPACES } from 'muze-utils';\n\nexport const setupChangeListeners = (context) => {\n const store = context.store();\n const stores = {\n throwback: context._dependencies.throwback,\n store\n };\n\n ['x', 'y'].forEach((axisType) => {\n store.registerChangeListener([`${STATE_NAMESPACES.GROUP_GLOBAL_NAMESPACE}.domain.${axisType}`], () => {\n const groupAxes = context.resolver().axes();\n groupAxes[axisType].forEach(axes => axes.forEach((axis) => {\n axis.render();\n }));\n });\n });\n const { VisualUnit, layerRegistry } = context.registry();\n const { base: BaseLayer } = layerRegistry;\n [VisualUnit, BaseLayer].forEach((comp) => {\n const formalName = comp.formalName();\n ['store', 'throwback'].forEach((type) => {\n const listeners = comp.getListeners()[type];\n const storeInst = stores[type];\n listeners.forEach((listenerInf) => {\n storeInst[listenerInf.type](listenerInf.props, listenerInf.listener, false, {\n namespace: formalName,\n subNamespace: listenerInf.subNamespace\n });\n });\n });\n });\n};\n\nexport const registerDomainChangeListener = (context) => {\n const store = context.store();\n store.registerChangeListener([`${STATE_NAMESPACES.UNIT_GLOBAL_NAMESPACE}.domain`], () => {\n context.resolver().encoder().unionUnitDomains(context);\n }, false, {\n key: 'unionDomain'\n });\n};\n\nexport const unsubscribeChangeListeners = (context) => {\n context.store().unsubscribe({\n key: 'unionDomain'\n });\n};\n","import { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, LAYERS, TRANSFORM, CONFIG } from '../enums/constants';\n\nexport const PROPS = {\n alias: {},\n data: {},\n cornerMatrices: {\n defaultValue: {\n topLeft: [],\n topRight: [],\n bottomLeft: [],\n bottomRight: []\n }\n },\n groupType: {},\n\n metaData: {\n defaultValue: {\n border: {}\n }\n },\n placeholderInfo: {\n defaultValue: {}\n },\n resolver: {},\n valueParser: {\n defaultValue: val => val\n },\n registry: {\n sanitization: (context, value) => {\n if (context.resolver) {\n context.resolver().registry({\n cells: value.cellRegistry,\n VisualUnit: value.VisualUnit\n });\n }\n return value;\n }\n },\n selection: {},\n [CONFIG]: {},\n [ROWS]: {},\n [COLUMNS]: {},\n [COLOR]: {},\n [SHAPE]: {},\n [SIZE]: {},\n [DETAIL]: {},\n [LAYERS]: {},\n [TRANSFORM]: {}\n};\n","import { generateGetterSetters } from 'muze-utils';\nimport localOptions from './local-options';\nimport { SimpleGroup } from '../simple-group';\nimport {\n MatrixResolver,\n findInGroup,\n getEncoder\n} from '../group-helper';\nimport {\n createUnitState,\n initializeGlobalState,\n setMatrixInstances,\n createMatrices,\n createLayerState,\n initializeResolverFields,\n initializeFields,\n updateChecker\n} from './helper';\nimport { setupChangeListeners } from './change-listener';\nimport { PROPS } from './props';\nimport {\n CONFIG,\n MOUNT,\n RETINAL,\n Y,\n ROWS,\n COLUMNS,\n DATA\n} from '../enums/constants';\n\n/**\n * VisualGroup is instantiated by canvas for creating {@link VisualUnit} and axes instances.It creates the\n * the matrix of visual units and axes. It also creates the layout instance which manages the allocation\n * of space of matrices.\n *\n * To get instance of visual group,\n * ```\n * const visualGroup = canvas.composition().visualGroup;\n * ```\n * @public\n *\n * @class VisualGroup\n */\nclass VisualGroup extends SimpleGroup {\n\n /**\n * Creates an instance of VisualGroup. Requires dependencies and other registry options for placeholders\n * and layers that create individual units.\n *\n * @param {Object} registry Key value pair of compostions for the group\n * @param {Object} dependencies Dependencies needed to run the group\n * @memberof VisualGroup\n */\n constructor (registry, dependencies) {\n super();\n\n const {\n components,\n componentSubRegistry,\n interactions\n } = registry;\n\n this._dependencies = dependencies;\n // Generate getter/setter methods for all properties of the class\n // One can get each property by calling the method and can set it\n // by passing paramaters for the same. Thus, one can chain setter\n // getter methods.\n generateGetterSetters(this, this.constructor.getterSetters());\n generateGetterSetters(this, this.constructor.localOptions());\n // Populate the store with default values\n // initialize group compositions\n this._composition = {};\n // store reference to data\n this._data = [];\n // store reference to mountpoint\n this._mount = null;\n // selection object that takes care of updating of components\n this._selection = {};\n // Create instance of matrix resolver\n this.createMatrixResolver();\n // matrix instance store each of the matrices\n setMatrixInstances(this, {});\n // Getting indiviual registered items\n this.registry({\n layerRegistry: componentSubRegistry.layers.get(),\n cellRegistry: componentSubRegistry.cells.get(),\n VisualUnit: components.VisualUnit,\n interactions\n });\n }\n\n static getState () {\n return [{\n domain: {\n x: null,\n y: null,\n radius: null,\n angle: null,\n angle0: null\n }\n }, {}];\n }\n\n store (...params) {\n if (params.length) {\n this._store = params[0];\n initializeGlobalState(this);\n createUnitState(this);\n createLayerState(this);\n // Register listeners\n setupChangeListeners(this);\n return this;\n }\n return this._store;\n }\n\n static formalName () {\n return 'VisualGroup';\n }\n\n static localOptions () {\n return localOptions;\n }\n static getterSetters () {\n return PROPS;\n }\n\n /**\n * Return the instances of matrices created by the visual group.\n *\n * @return {Object} Instance of matrices.\n */\n matrixInstance (...matrices) {\n if (matrices.length) {\n return this;\n }\n return this.composition().matrices;\n }\n\n /**\n * Returns the composition of visual group.\n *\n * @public\n *\n * @return {Object} Composition of visual group. It contains instance of matrices {@link ValueMatrix}\n * and instances of axis.\n * ```\n * {\n * matrices: {\n * value: // Instance of center value matrix.\n * left: // Instance of left value matrix\n * right: // Instance of right value matrix\n * bottom: // Instance of bottom value matrix\n * top: // Instance of top value matrix.\n * },\n * axes: {\n * x: // Array of x axis.\n * y: // Array of y axis\n * color: // Array of color axis\n * shape: // Array of shape axis\n * size: // Array of size axis.\n * }\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n /**\n * Locks the model to prevent change listeners to be triggered until unlocked\n *\n * @return {Object} Instance of class VisualGroup\n * @memberof VisualGroup\n */\n lockModel () {\n this.store().model.lock();\n return this;\n }\n\n /**\n * Unlocks the model so that all change listeners can be triggered\n *\n * @return {Object} Instance of class VisualGroup\n */\n unlockModel () {\n this.store().model.unlock();\n return this;\n }\n\n /**\n * Returns the channel name of the variable. Channels are rows, columns, color, shape and size.\n *\n * @public\n * @param {string} variable Name of the variable.\n *\n * @return {string} Name of the channel.\n */\n where (variable) {\n return findInGroup(variable, this.resolver().getAllFields());\n }\n\n /**\n * Gets the axis instances of the visual group based on the given axis type.\n *\n * @public\n * @param {string} type Type of axis. X,Y or retinal axes.\n *\n * @return {Array} Array of axis instances.\n */\n getAxes (type) {\n if (type === RETINAL) {\n return this.resolver().getRetinalAxes();\n }\n return this.resolver().getSimpleAxes(type);\n }\n\n /**\n * Returns the instances of cells based on the given type. Type can be given as `row' or `col`.\n *\n * @public\n * @return {Array} Two dimensional array of cells.\n */\n getCells (type) {\n return this.resolver()[`${type}Cells`]();\n }\n\n getFieldsFromChannel (channel) {\n const {\n rowProjections,\n colProjections\n } = this.resolver().getAllFields();\n return channel === Y ? rowProjections : colProjections;\n }\n\n getCellsByFacetKey (facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey] || [];\n return cells;\n }\n\n getAxesByFacetKey (axisType, facetKey) {\n const resolver = this.resolver();\n const cells = resolver.rowCells()[facetKey] || resolver.colCells()[facetKey];\n const axes = cells[0].valueOf().axes()[axisType] || [];\n\n return axes;\n }\n\n /**\n * This method is used to return a serialized representation of the instance's properties.\n *\n * @return {Object} Object with config proprties.\n * @memberof VisualGroup\n */\n serialize () {\n const store = this.store();\n\n return {\n [CONFIG]: store.get(CONFIG),\n [MOUNT]: store.get(MOUNT)\n };\n }\n\n /**\n * Returns the grouped datamodel prepared by visual group. If there is no group by performed, then it returns the\n * original data model passed to visual group.\n *\n * @return {DataModel} Grouped data model.\n */\n getGroupByData () {\n return this._groupedDataModel;\n }\n\n createMatrices (sanitizedConfig) {\n createMatrices(this, sanitizedConfig);\n }\n\n getMandatoryFields () {\n const updateProps = updateChecker(this, [ROWS, COLUMNS, DATA]);\n let sanitizedValue = {\n groupConfig: {},\n resolverConfig: {},\n shouldRender: false\n };\n if (updateProps) {\n const localFields = initializeFields(this);\n const {\n datamodel,\n encoders,\n resolver,\n matrixConfig\n } = localFields;\n const context = {\n datamodel,\n componentRegistry: this.registry(),\n encoders,\n resolver\n };\n const resolverFields = initializeResolverFields(context, matrixConfig);\n sanitizedValue = {\n groupConfig: localFields,\n resolverConfig: resolverFields,\n shouldRender: resolverFields.shouldRender\n };\n }\n return sanitizedValue;\n }\n\n remove () {\n this.matrixInstance().value.clear();\n this.resolver().clear();\n const info = this.placeholderInfo();\n info.rows = null;\n info.columns = null;\n info.values = null;\n }\n\n createEncoderInstance () {\n const layers = this.layers();\n\n return getEncoder(layers);\n }\n\n createMatrixResolver () {\n this.resolver(new MatrixResolver(this._dependencies));\n\n return this;\n }\n}\n\nexport default VisualGroup;\n","import { PersistentBehaviour, SELECTION } from '@chartshq/muze-firebolt';\n\nexport default class SelectBehaviour extends PersistentBehaviour {\n static formalName () {\n return 'select';\n }\n\n setSelectionSet (addSet, selectionSet) {\n if (addSet === null) {\n selectionSet.reset();\n } else if (addSet.length) {\n const propagationInf = this.firebolt._propagationInf;\n // new add set\n const existingRemoveSet = addSet.filter(d => selectionSet._set[d] === SELECTION.SELECTION_OLD_EXIT\n || selectionSet._set[d] === SELECTION.SELECTION_NEW_EXIT);\n\n if (propagationInf.sourceId) {\n selectionSet.reset();\n selectionSet.add(addSet);\n } else {\n // existing add set\n if (existingRemoveSet.length) {\n selectionSet.updateEntry();\n selectionSet.add(existingRemoveSet);\n } else {\n selectionSet.updateExit();\n selectionSet.remove(addSet);\n }\n const { exitSet } = selectionSet.getSets(true);\n const mergedExitSet = [...new Set(exitSet[1]), ...new Set(exitSet[0])];\n const completeSetCount = selectionSet.getCompleteSet().length;\n if (exitSet[1].length !== completeSetCount && mergedExitSet.length === completeSetCount) {\n selectionSet.reset();\n }\n }\n } else {\n selectionSet.remove(selectionSet.getCompleteSet());\n }\n return this;\n }\n}\n","import { BEHAVIOURS, ACTIONS } from '@chartshq/muze-firebolt';\n\nconst CLASSPREFIX = 'muze';\n\nexport const actionBehaviourMap = {\n [ACTIONS.DRAG]: {\n target: `.${CLASSPREFIX}-gradient-rect`,\n behaviours: [BEHAVIOURS.BRUSH]\n },\n [ACTIONS.HOVER]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.HIGHLIGHT]\n },\n [ACTIONS.CLICK]: {\n target: [`.${CLASSPREFIX}-legend-columns`],\n behaviours: [BEHAVIOURS.SELECT]\n }\n};\n\nexport const propagationBehaviourMap = {\n [BEHAVIOURS.SELECT]: BEHAVIOURS.FILTER,\n [BEHAVIOURS.BRUSH]: BEHAVIOURS.HIGHLIGHT\n};\n","import * as BEHAVIOURS from '../enums/behaviours';\nimport * as sideEffects from '../enums/side-effects';\n\nexport const behaviourEffectMap = {\n [BEHAVIOURS.BRUSH]: [sideEffects.SELECTIONBOX, {\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }]\n};\n\nexport const propagationSideEffects = {\n [BEHAVIOURS.BRUSH]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.HIGHLIGHT]: [{\n name: sideEffects.Highlighter,\n options: {\n strategy: 'fade'\n }\n }],\n [BEHAVIOURS.SELECT]: ['filter']\n};\n\n","export const BRUSH = 'brush';\nexport const HIGHLIGHT = 'highlight';\nexport const TOOLTIP = 'tooltip';\nexport const FILTER = 'filter';\nexport const SELECT = 'select';\n\n","export const SELECTIONBOX = 'selectionBox';\nexport const Highlighter = 'highlighter';\nexport const Marker = 'marker';\n\n","import { propagationBehaviourMap } from './action-behaviour-map';\nimport { propagationSideEffects } from './behaviour-effect-map';\n\nexport const propagate = (firebolt, action, identifiers) => {\n const context = firebolt.context;\n const data = context.metaData();\n\n const propPayload = {};\n propPayload.action = propagationBehaviourMap[action] || action;\n // @TODO: Change fade propagationSideEffect for area layer\n propPayload.sideEffects = propagationSideEffects[action];\n propPayload.sourceCanvas = context.canvasAlias();\n const isMutableAction = firebolt._actions.behavioural[propPayload.action].constructor.mutates();\n\n const propConfig = {\n sourceId: firebolt.id(),\n payload: propPayload,\n criteria: propPayload.criteria === null ? null : identifiers,\n isMutableAction,\n action: propPayload.action\n };\n\n data.propagate(identifiers, propConfig, true);\n};\n\nexport const payloadGenerator = {\n __default: (selectionDataModel, propConfig) => {\n const propPayload = propConfig.payload;\n const sourceIdentifiers = propConfig.sourceIdentifiers;\n const dataObj = selectionDataModel.getData();\n let schema = dataObj.schema;\n const payload = Object.assign({}, propPayload);\n schema = dataObj.schema;\n const data = dataObj.data;\n const sourceFields = schema.map(d => d.name);\n payload.criteria = !sourceIdentifiers && selectionDataModel.isEmpty() ? null :\n [sourceFields, ...data];\n payload.sourceFields = sourceIdentifiers ? sourceIdentifiers.fields.map(d => d.name) : [];\n return payload;\n },\n brush: (dm, propConfig) => {\n const { criteria } = propConfig;\n return {\n criteria: criteria ? criteria.range : criteria\n };\n }\n};\n\n","export const CLASSPREFIX = 'muze';\nexport const IDFIELD = '__id__';\nexport const CONFIG = 'config';\nexport const DATAMODEL = 'dataModel';\nexport const AXES = 'axes';\nexport const LAYERDEFS = 'layerDef';\nexport const WIDTH = 'width';\nexport const MAXWIDTH = 'max-width';\nexport const HEIGHT = 'height';\nexport const MOUNTPOINT = 'mountPoint';\nexport const GRIDLINEPARENTGROUPCLASS = 'grid-lines';\nexport const TRANSFORM = 'transform';\nexport const CONSOLIDATED = 'consolidated';\nexport const FRAGMENTED = 'fragmented';\nexport const DEFAULTCOLOR = '#F44336';\nexport const DEFAULTSIZE = 50;\nexport const VERTICAL_BUFFER = 10;\nexport const HORIZONTAL_BUFFER = 2;\nexport const DEFAULTICONSIZE = { // approximately the (size needed) * Math.PI value\n circle: 64,\n square: 45.8,\n default: 42.8\n};\nexport const DEFAULTSHAPE = 'circle';\nexport const STEP = 'step';\nexport const GRADIENT = 'gradient';\nexport const ORDINAL = 'ordinal';\nexport const SCALE_FUNCTIONS = {\n size: 'getSize',\n shape: 'getShape',\n color: 'getColor'\n};\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const HORIZONTAL = 'horizontal';\nexport const VERTICAL = 'vertical';\nexport const CENTER = 'center';\nexport const VALUE = 'value';\nexport const PATH = 'path';\nexport const SHAPE = 'shape';\nexport const ICON = 'icon';\nexport const RECT = 'rect';\nexport const START = 'start';\nexport const UPPER = 'upper';\nexport const LOWER = 'lower';\nexport const END = 'end';\nexport const SIZE = 'size';\nexport const DISCRETE = 'discrete';\nexport const MEASURE = 'measure';\nexport const DEFAULT = 'default';\n\nexport const POSITION_ALIGNMENT_MAP = {\n [LEFT]: VERTICAL,\n [RIGHT]: VERTICAL,\n [TOP]: HORIZONTAL,\n [BOTTOM]: HORIZONTAL\n};\n\nexport const OPPOSITE_POSITION = {\n [LEFT]: RIGHT,\n [RIGHT]: LEFT\n};\n\n","import { Firebolt } from '@chartshq/muze-firebolt';\nimport { propagate, payloadGenerator } from './helper';\nimport { STEP, GRADIENT } from '../enums/constants';\nimport { HIGHLIGHT } from '../enums/behaviours';\n/**\n * This class manages the interactions of legend.\n * @export\n * @class LegendFireBolt\n * @extends {Firebolt}\n */\nexport class LegendFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.initializeSideEffects();\n }\n\n getPropagationSelectionSet (selectionSet) {\n return selectionSet[0];\n }\n\n propagate (behaviourName, payload, selectionSet) {\n propagate(this, behaviourName, selectionSet, {\n payload\n });\n }\n\n getAddSetFromCriteria (criteria) {\n let values;\n let uniqueIds;\n const type = this.context.constructor.type();\n\n if (criteria === null) {\n uniqueIds = null;\n } else if (type === STEP) {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n } else if (type === GRADIENT) {\n uniqueIds = [];\n } else {\n values = criteria;\n if (values instanceof Array) {\n values = values.slice(1, criteria.length);\n uniqueIds = [...new Set([].concat(...values))];\n } else {\n values = Object.values(criteria);\n uniqueIds = this.context.data().filter(d => values.indexOf(d.range) !== -1).map(d => d.id);\n }\n }\n return {\n uids: uniqueIds,\n model: null\n };\n }\n\n getFullData () {\n return null;\n }\n\n onDataModelPropagation () {\n return (data, config) => {\n const context = this.context;\n if (!context.mount()) {\n return;\n }\n const payloadFn = payloadGenerator[config.action] || payloadGenerator.__default;\n const payload = payloadFn(data, config);\n const { propagationSourceId } = config;\n const propagationInf = {\n propagate: false,\n data,\n sourceId: propagationSourceId\n };\n const isActionSourceSame = config.sourceId === this.id();\n if (!isActionSourceSame && config.action === HIGHLIGHT) {\n // @todo make it configurable\n this.dispatchBehaviour(HIGHLIGHT, payload, propagationInf);\n }\n };\n }\n\n data () {\n return this.context.metaData();\n }\n\n id () {\n return `legend-${this.context._id}`;\n }\n\n sourceCanvas () {\n return this.context.canvasAlias();\n }\n\n shouldApplySideEffects () {\n return true;\n }\n}\n","import {\n getEvent,\n getD3Drag\n } from 'muze-utils';\n\n/**\n * Adds dragging action to the target element.\n * @param {firebolt} firebolt firebolt\n * @param {SVGElement} targetEl Element on which brushing action is needed.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const drag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let endPos = {};\n let payload;\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const boundingBox = context.measurement().gradientDimensions;\n const axisType = context.config().align === 'horizontal' ? 'x' : 'y';\n const axisScale = context.axis().source().scale();\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n\n targetEl.call(d3Drag().on('start', () => {\n const event = getEvent();\n startPos = {\n x: event.x,\n y: event.y\n };\n }).on('drag', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }).on('end', () => {\n const event = getEvent();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n endPos.x = Math.max(0, Math.min(endPos.x, boundingBox.width));\n endPos.y = Math.max(0, Math.min(endPos.y, boundingBox.height));\n if (startPos[axisType] === endPos[axisType]) {\n payload = {\n criteria: null\n };\n } else {\n payload = {\n criteria: {\n [context.fieldName()]: [axisScale.invert(startPos[axisType] + rangeShifter * 2),\n axisScale.invert(endPos[axisType] + rangeShifter * 2)].sort((a, b) => a - b)\n }\n };\n }\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n }));\n};\n\nexport default drag;\n","import { getEvent } from 'muze-utils';\n\n/**\n * Adds mouse interactions to target element.\n * @param {Firebolt} Firebolt instance of firebolt.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\n/* istanbul ignore next */ const hover = firebolt => (targetEl) => {\n const dispatchBehaviour = function (args) {\n const event = getEvent();\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n firebolt.triggerPhysicalAction('hover', payload);\n event.stopPropagation();\n };\n\n targetEl.on('mouseover', dispatchBehaviour)\n .on('mousemove', dispatchBehaviour)\n .on('mouseout', () => {\n const event = getEvent();\n firebolt.triggerPhysicalAction('hover', {\n criteria: null\n });\n event.stopPropagation();\n });\n};\n\nexport default hover;\n","/**\n * Adds mouse interactions to target element.\n * @param {VisualUnit} instance instance of visual unit.\n * @param {SVGElement} targetEl Element on which the event listeners will be attached.\n * @param {Array} behaviours Array of behaviours\n */\nconst click = firebolt => (targetEl, behaviours) => {\n const dispatchBehaviour = function (args) {\n const payload = {\n criteria: firebolt.context.getCriteriaFromData(args)\n };\n behaviours.forEach(behaviour => firebolt.dispatchBehaviour(behaviour, payload));\n };\n\n targetEl.on('click', dispatchBehaviour);\n};\n\nexport default click;\n","import drag from './drag';\nimport hover from './hover';\nimport click from './click';\nimport * as ACTIONNAMES from '../../enums/actions';\n\nexport const physicalActions = {\n [ACTIONNAMES.DRAG]: drag,\n [ACTIONNAMES.HOVER]: hover,\n [ACTIONNAMES.CLICK]: click\n};\n\n","export const DRAG = 'drag';\nexport const HOVER = 'hover';\nexport const SELECTIONDRAG = 'selectiondrag';\nexport const CLICK = 'click';\n","import {\n getMousePos,\n getEvent,\n getD3Drag\n } from 'muze-utils';\nimport { HEIGHT, WIDTH, HORIZONTAL } from '../../enums/constants';\n\nconst getSelectionCriteria = (subject, axis, measures) => {\n let criteria = [];\n const {\n axisScale,\n axisType\n } = axis;\n const {\n startPos,\n endPos,\n selectionBoxMeasure,\n drawingInfMeasure,\n offset\n } = measures;\n const subjectStartPoint = subject[axisType];\n\n if (startPos[axisType] === endPos[axisType]) {\n criteria = [];\n } else if (subjectStartPoint + selectionBoxMeasure >= drawingInfMeasure + offset) {\n criteria = [axisScale.invert(drawingInfMeasure + offset - selectionBoxMeasure),\n axisScale.invert(drawingInfMeasure + offset)];\n } else if (subjectStartPoint - offset < offset) {\n criteria = [axisScale.invert(offset * 2), axisScale.invert(selectionBoxMeasure + offset * 2)];\n } else {\n criteria = [axisScale.invert(subjectStartPoint), axisScale.invert(subjectStartPoint + selectionBoxMeasure)];\n }\n axisType === 'x' ? criteria : criteria.reverse();\n return criteria;\n};\n\nexport const selectionBoxDrag = firebolt => (targetEl, behaviours) => {\n let startPos = {};\n let payload;\n const endPos = {};\n const d3Drag = getD3Drag();\n const context = firebolt.context;\n const axisScale = context.axis().source().scale();\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n const drawingInfMeasure = context.measurement().gradientDimensions[axisType === 'x' ?\n WIDTH : HEIGHT];\n const offset = axisScale.range()[axisType === 'x' ? 0 : 1];\n const measures = {\n drawingInfMeasure,\n offset\n };\n let subject = {};\n\n targetEl.call(d3Drag().on('start', function () {\n const event = getEvent();\n startPos = getMousePos(this, event.sourceEvent);\n subject = event.subject;\n }).on('drag', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n\n subject.x += event.dx;\n subject.y += event.dy;\n\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(subject, { axisScale, axisType }, measures);\n\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }).on('end', () => {\n const event = getEvent();\n const selectionBoxMeasure = subject[axisType === 'x' ? WIDTH : HEIGHT];\n measures.selectionBoxMeasure = selectionBoxMeasure;\n measures.startPos = startPos;\n measures.endPos = endPos;\n const criteria = getSelectionCriteria(event, { axisScale, axisType }, measures);\n payload = {\n criteria: {\n [context.fieldName()]: criteria\n },\n fadeOut: true,\n config: {\n transition: {\n duration: 200\n }\n }\n };\n firebolt.dispatchBehaviour(behaviours[0], payload);\n }));\n};\n\n","import { getSymbol, mergeRecursive } from 'muze-utils';\nimport {\n CENTER,\n LEFT,\n RIGHT\n} from '../enums/constants';\n\nexport const ALIGN = {\n HORIZONTAL: 'horizontal',\n VERTICAL: 'vertical'\n};\n\nexport const DEFAULT_MEASUREMENT = {\n height: 30,\n width: 30,\n maxWidth: Infinity,\n maxHeight: Infinity,\n padding: 2,\n margin: 2,\n marginHorizontal: 3,\n paddingRight: 4,\n border: 1\n};\n\nexport const LEGEND_TITLE = {\n text: '',\n orientation: (pos) => {\n if (pos === LEFT || pos === RIGHT) {\n return LEFT;\n } return CENTER;\n }\n};\n\nexport const DEFAULT_CONFIG = {\n buffer: {\n [ALIGN.HORIZONTAL]: 10,\n [ALIGN.VERTICAL]: 10\n },\n classPrefix: 'muze',\n borderStyle: 'solid',\n borderColor: 'rgba(0,0,0,0)',\n formatter: {\n bounds: {\n lower: 'less than',\n upper: 'more than'\n }\n },\n item: {\n text: {\n orientation: 'right',\n width: 10,\n formatter: (val, i, data, context) => context.valueParser()(val)\n },\n icon: {\n className: 'legend-icon',\n height: 20,\n width: 20,\n color: 'rgba(192,192,192,0.6)',\n type: 'square'\n }\n }\n // stops: 5\n};\n\nconst tempConfig = mergeRecursive({}, DEFAULT_CONFIG);\n\nconst ITEM_FORMATTER = {\n item: {\n text: {\n formatter: val => `${val[0]} - ${val[1]}`\n }\n }\n};\n\nexport const STEP_DEFAULT_CONFIG = mergeRecursive(tempConfig, ITEM_FORMATTER);\n\n/**\n * Creates a map of pre defined icons\n *\n * @param {string} icon Accepts a icon name like 'square', 'cross', 'diamond' etc\n * @return {Object} icon object which can be used to draw the icons\n */\nexport const ICON_MAP = (icon) => {\n if (icon && typeof (icon) === 'string') {\n return getSymbol(icon);\n } return icon;\n};\n\nexport const LEGEND_MARKER_PROPS = {\n size: 8,\n ROTATE_HORIZONTAL: 180,\n ROTATE_VERTICAL: 90,\n shape: 'triangle'\n};\n","import { makeElement } from 'muze-utils';\nimport { SpawnableSideEffect } from '@chartshq/muze-firebolt';\nimport { CLASSPREFIX, HEIGHT, WIDTH, HORIZONTAL, RECT } from '../../../enums/constants';\nimport { SELECTIONBOX } from '../../../enums/side-effects';\nimport { selectionBoxDrag } from '../../physical/selection-box-drag';\nimport { LEGEND_MARKER_PROPS } from '../../../legend/defaults';\nimport './styles.scss';\n\n/**\n * This class is used to create a selection box which is used by visual unit for brushing and\n * selection in the canvas.\n * @class SelectionBox\n */\n/* istanbul ignore next */ class SelectionBox extends SpawnableSideEffect {\n constructor (...params) {\n super(...params);\n this._graphicElems = {\n rect: null\n };\n }\n\n static formalName () {\n return SELECTIONBOX;\n }\n\n /**\n * It returns the default configuration needed by selectionbox.\n * @return {Object} Default configuration of the selection box.\n */\n static defaultConfig () {\n return {\n className: 'legend-selection-box',\n classPrefix: CLASSPREFIX\n };\n }\n\n /**\n * Draws the selectionbox with the specified dimensions.\n */\n /* istanbul ignore next */ apply (selectionSet, payload) {\n let x;\n let y;\n let width;\n let height;\n const firebolt = this.firebolt;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n const className = `${config.classPrefix}-${config.className}`;\n const { criteria } = payload;\n const { rect } = this._graphicElems;\n\n if (criteria === null) {\n rect && rect.remove();\n return this;\n }\n\n const domain = criteria[firebolt.context.fieldName()];\n const axisScale = axis.scale();\n const range = domain ? [axis.getScaleValue(domain[0]), axis.getScaleValue(domain[1])] : [];\n\n const axisType = context.config().align === HORIZONTAL ? 'x' : 'y';\n\n const gradientDimension = firebolt.context.measurement().gradientDimensions[axisType === 'x' ?\n HEIGHT : WIDTH];\n\n const rangeShifter = axisScale.range()[axisType === 'x' ? 0 : 1];\n const legendGradContainer = context.getDrawingContext().svgContainer;\n const legendSelGroup = makeElement(legendGradContainer, 'g', [1],\n `${config.classPrefix}-selection-box-group`);\n\n if (firebolt.context.config().align === HORIZONTAL) {\n x = range[0] - rangeShifter || 0;\n y = LEGEND_MARKER_PROPS.size + 4;\n width = range[1] - range[0] || 0;\n height = gradientDimension;\n } else {\n x = LEGEND_MARKER_PROPS.size + 4;\n y = range[1] - rangeShifter || 0;\n height = range[0] - range[1] || 0;\n width = gradientDimension;\n }\n const enterFn = function (el) {\n selectionBoxDrag(firebolt)(el, ['brush']);\n };\n\n const selBox = makeElement(legendSelGroup, RECT, [{ domain, x, y, width, height }], className,\n { enter: enterFn });\n selBox.attr('y', y)\n .attr('x', x)\n .attr(WIDTH, width)\n .attr(HEIGHT, height);\n this._graphicElems.rect = selBox;\n return this;\n }\n}\n\nexport default SelectionBox;\n\n","import { selectElement } from 'muze-utils';\n\nexport const strategies = (firebolt) => {\n const context = firebolt.context;\n const classed = (set, className, change) => {\n const classPrefix = context.config().classPrefix;\n const uids = set.uids.map(d => d[0]);\n selectElement(context.mount())\n .selectAll(`.${classPrefix}-legend-columns`)\n .filter(d => uids.indexOf(d.id) !== -1)\n .selectAll('div')\n .classed(className, change);\n };\n\n return {\n fade: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-fadeout`, false);\n } else {\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-fadeout`, true);\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-fadeout`, false);\n }\n },\n brighten: (set, config = {}) => {\n const classPrefix = context.config().classPrefix;\n if (!set.mergedEnter.length && !set.mergedExit.length) {\n classed(set.completeSet, config.className || `${classPrefix}-legend-brighten`, false);\n } else {\n classed(set.mergedEnter, config.className || `${classPrefix}-legend-brighten`, true);\n classed(set.mergedExit, config.className || `${classPrefix}-legend-brighten`, false);\n }\n }\n };\n};\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { strategies } from './strategies';\nimport { Highlighter } from '../../../enums/side-effects';\n\nexport default class LegendHighlighter extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._strategies = strategies(this.firebolt);\n this._strategy = 'brighten';\n }\n\n static formalName () {\n return Highlighter;\n }\n\n apply (selectionSet, payload, options = {}) {\n const strategy = this._strategies[options.strategy || this._strategy];\n\n strategy(selectionSet, this);\n }\n}\n","import { GenericSideEffect } from '@chartshq/muze-firebolt';\nimport { makeElement, getSymbol } from 'muze-utils';\nimport { Marker } from '../../../enums/side-effects';\nimport { CLASSPREFIX, HORIZONTAL } from '../../../enums/constants';\nimport { LEGEND_MARKER_PROPS } from '../../../legend/defaults';\nimport './styles.scss';\n\nconst SYMBOL_PADDING = (Math.sqrt(3) * 3);\nconst AXIS_STROKE = 1;\nconst MARKER_BUFFER = 10;\n\nconst createTextCell = (className, labelManagerRef, cells) => {\n const { TextCell } = cells;\n const cell = new TextCell(\n {\n type: 'text',\n className: `${className}-text`\n }, {\n labelManager: labelManagerRef()\n }).config({ maxLines: 1 });\n cell._minTickDiff = { height: 0, width: 0 };\n\n return cell;\n};\n\nconst getRelativePosition = (canvas, legendContainer) => ({\n top: legendContainer.getBoundingClientRect().top - canvas.getBoundingClientRect().top,\n left: legendContainer.getBoundingClientRect().left - canvas.getBoundingClientRect().left\n});\nexport default class LegendMarker extends GenericSideEffect {\n constructor (...params) {\n super(...params);\n this._graphicElements = {\n markerElement: null,\n legendmarkerTextContainer: null,\n legendmarkerText: null\n };\n }\n\n static formalName () {\n return Marker;\n }\n\n /**\n * It returns the default configuration needed by legend-marker.\n * @return {Object} Default configuration of the legend-marker.\n */\n static defaultConfig () {\n return {\n className: 'legend-marker',\n classPrefix: CLASSPREFIX,\n size: LEGEND_MARKER_PROPS.size,\n shape: LEGEND_MARKER_PROPS.shape\n };\n }\n\n apply (selectionSet, payload) {\n const className = `${this.config().classPrefix}-${this.config().className}`;\n if (payload.criteria && payload.criteria.length === 2) {\n const physicalAction = function () {\n // Register physical action on marker gere\n };\n const firebolt = this.firebolt;\n const labelManager = firebolt.context.labelManager;\n const context = firebolt.context;\n const config = this.config();\n const axis = context.axis().source();\n\n const range = payload.criteria[0] ? axis.getScaleValue(payload.criteria[1]) : 0;\n\n const legendGradContainer = context.getDrawingContext().svgContainer;\n\n const isFractional = payload.criteria[1][0] % 1 !== 0;\n\n const lableConfig = {\n top: 0,\n left: 0,\n labelText: isFractional ? payload.criteria[1][0].toFixed(2) : payload.criteria[1][0]\n };\n\n const { top, left } = getRelativePosition(context._canvasMount, legendGradContainer.node());\n const { oriTextHeight, oriTextWidth } = labelManager().getSmartText(lableConfig.labelText);\n let x;\n let y;\n let rotateAngle;\n\n const { size, shape } = config;\n if (context.config().align === HORIZONTAL) {\n x = range - (Math.sqrt(size / SYMBOL_PADDING)) + AXIS_STROKE;\n y = 5;\n rotateAngle = LEGEND_MARKER_PROPS.ROTATE_HORIZONTAL;\n lableConfig.top = top + y - 3 * MARKER_BUFFER;\n lableConfig.left = x + left - (oriTextWidth / 2) - (MARKER_BUFFER / 2);\n } else {\n y = range + Math.sqrt(size / (2 * SYMBOL_PADDING)) - AXIS_STROKE;\n x = 5;\n rotateAngle = LEGEND_MARKER_PROPS.ROTATE_VERTICAL;\n lableConfig.top = top + y - (3 * MARKER_BUFFER - 2) + (oriTextHeight / 2);\n lableConfig.left = x + left - oriTextWidth - MARKER_BUFFER;\n }\n\n const legendmarkerGroup = makeElement(legendGradContainer,\n 'g',\n [1],\n `${config.classPrefix}-${config.className}-group`);\n\n if (!this._graphicElements.markerElement) {\n this._graphicElements.markerElement = makeElement(legendmarkerGroup,\n 'path', [{ value: null }], className, { enter: physicalAction });\n }\n\n if (!this._graphicElements.legendmarkerTextContainer) {\n this._graphicElements.legendmarkerTextContainer = makeElement(\n context._canvasMount,\n 'div',\n [1],\n `${className}-text-container`);\n this._graphicElements.legendmarkerText = makeElement(\n this._graphicElements.legendmarkerTextContainer,\n 'div',\n [1],\n `${className}-text`);\n }\n const textElement = createTextCell(className, labelManager, context._cells);\n this._graphicElements.markerElement\n .data([{ value: payload.criteria }])\n .attr('transform', `translate(${x},${y}) rotate(${rotateAngle})`)\n .attr('d', getSymbol(shape).size(size * size)())\n .classed(`${className}-show`, true)\n .classed(`${className}-hide`, false);\n textElement.source(lableConfig.labelText);\n textElement.render(this._graphicElements.legendmarkerText.node());\n this._graphicElements.legendmarkerText\n .attr('style', `top: ${lableConfig.top}px; left:${lableConfig.left}px`)\n .classed(`${className}-show`, true)\n .classed(`${className}-hide`, false);\n } else if (this._graphicElements.markerElement && this._graphicElements.legendmarkerText) {\n this._graphicElements.markerElement\n .data([{ value: null }])\n .classed(`${className}-show`, false)\n .classed(`${className}-hide`, true);\n this._graphicElements.legendmarkerText\n .classed(`${className}-show`, false)\n .classed(`${className}-hide`, true);\n }\n }\n\n}\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n data: {},\n fieldName: {},\n legendContainer: {},\n measurement: {\n sanitization: (context, value) => {\n const measurement = mergeRecursive(context._measurement, value);\n ['padding', 'border', 'margin'].forEach((space) => {\n measurement[space] = Math.min(measurement[space] > 0 ? measurement[space] : 0,\n measurement.maxWidth * 0.1, measurement.maxHeight * 0.1);\n });\n return measurement;\n }\n },\n logicalSpace: {},\n metaData: {\n onset: (context, value) => context.firebolt().attachPropagationListener(value)\n },\n range: {\n sanitization: (context, value) => {\n context.scale().range(value);\n context.resetLogicalSpace();\n context.store().commit('range', value);\n return value;\n }\n },\n scale: {},\n smartTicks: {},\n store: {},\n title: {\n sanitization: (context, value) => mergeRecursive(context._title || {}, value)\n },\n labelManager: {},\n minTickDistance: {},\n valueParser: {\n defaultValue: val => val\n }\n};\n","import { makeElement, FieldType, getReadableTicks } from 'muze-utils';\n\nimport {\n SCALE_FUNCTIONS,\n WIDTH,\n HEIGHT,\n LEFT,\n RIGHT,\n TOP,\n BOTTOM,\n MAXWIDTH,\n CENTER,\n HORIZONTAL,\n POSITION_ALIGNMENT_MAP\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} scale\n *\n */\nexport const getScaleInfo = (scale) => {\n const scaleType = scale.constructor.type();\n const domain = scale.uniqueValues();\n const steps = scale.config().stops || 1;\n const scaleFn = SCALE_FUNCTIONS[scaleType];\n\n return { scaleType, domain, steps, scaleFn };\n};\n\n/**\n * Function to recompute the stops in array in case to left and right alignment of legend.\n *\n * @param {string} param - parameter to measure\n * @param {Object} requiredMeasure - required measure parameters\n * @param {Object} availableMeasure - available meassure parameters\n * @param {Array} domainForLegend - array\n * @param {Object} smartLabelCalc - smartLabel Manager\n * @return {Array} - Array\n */\nconst getcomputedArray = (computationhelper, requiredMeasure, availableMeasure, domainForLegend) => {\n // declaring Current and Next Tick Value variable\n let currentTickValue;\n let nextTickValue;\n const upperBound = domainForLegend[domainForLegend.length - 1];\n const param = computationhelper.measureParam;\n const smartLabelCalc = computationhelper.smartLabelCalc;\n\n // calculating pixel required per Tick Values\n const pixelPerTick = (availableMeasure[param] / upperBound);\n\n // checking if available max width is smaller than required width for legend.\n if (availableMeasure[param] >= requiredMeasure[param]) {\n return domainForLegend;\n }\n\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[0]))[param]);\n for (let i = 1; i < domainForLegend.length - 1; i++) {\n nextTickValue = Math.floor((currentTickValue / pixelPerTick) + domainForLegend[i - 1]);\n if (domainForLegend[i] < nextTickValue) {\n domainForLegend.splice(i, 1);\n i -= 1;\n }\n currentTickValue = (smartLabelCalc.getOriSize((domainForLegend[i]))[param]);\n }\n return domainForLegend;\n};\n\n/**\n * function to recompute the Stops Array provided to prevent the Overlapping of values\n * @param {Array} domainForLegend - Stops Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - modified Stops Array\n */\nexport const getInterpolatedArrayData = (domainForLegend, scaleParams) => {\n // defining param for height/width selector\n let measureParam;\n\n // declaring variable for required Width\n let requiredWidth;\n\n // declaring variable for required height\n let requiredHeight;\n\n // declaring the variable for upperbound\n let upperBound = domainForLegend[domainForLegend.length - 1];\n\n // Initializing Minimum Tick Difference Variable and checking if it's less than 1 or not\n let minTickDiff = Math.ceil(domainForLegend[1] - domainForLegend[0]);\n\n // calculating max tick difference\n const maxTickDiff = Math.ceil(upperBound - domainForLegend[0]);\n\n // gradient Alignment\n const { alignment } = scaleParams;\n\n // getting SmartLabel Manager to calculate tick Params\n const smartLabelCalc = scaleParams.smartLabel;\n\n // scale Measurements (i.e MaxWidth and MaxHeight available)\n const availableSpace = scaleParams.measures;\n\n // getting minimum Tick size (i.e height and width)\n const minimumTickSize = scaleParams.minTickDistance;\n\n // getting domain upperbound dimensions\n const { height: tickDimHeight, width: tickDimWidth } = smartLabelCalc.getOriSize((upperBound));\n\n /* Checking if UpperBound of Domain is Floating or Not.\n In case of floating constricting it to 2 decimals after point. */\n if (!Number.isInteger(upperBound)) {\n upperBound = ((upperBound).toFixed(2));\n }\n\n // Calculating minimum tick difference\n minTickDiff = minTickDiff < 1 ? 1 : minTickDiff;\n\n // required width to render legend\n requiredWidth = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * (tickDimWidth + (minimumTickSize.width));\n\n requiredWidth -= Math.abs(maxTickDiff);\n\n // require height to render legend\n requiredHeight = (Math.abs(maxTickDiff) / Math.abs(minTickDiff)) * tickDimHeight;\n\n requiredHeight -= Math.abs(maxTickDiff);\n\n // checking the alignment of legend\n if (alignment === TOP || alignment === BOTTOM) {\n measureParam = WIDTH;\n } else {\n measureParam = HEIGHT;\n }\n\n // calculating computed array\n domainForLegend = getcomputedArray({\n smartLabelCalc,\n measureParam\n }, {\n height: requiredHeight,\n width: requiredWidth\n }, {\n height: availableSpace.maxHeight,\n width: availableSpace.maxWidth\n }, domainForLegend);\n\n return domainForLegend;\n};\n\n/**\n * function to recalculate steps on providing more number of stops than canvas can accomodate.\n * @param {Array} domain - Array\n * @param {Array} steps - Array\n * @param {Object} scaleParams - Scale Parameters\n * @return {Array} - recalculated Step Array\n */\nexport const getInterpolatedData = (domain, steps, scaleParams) => {\n // declaring recomputeSteps Variable\n let recomputeSteps = 0;\n\n const getTickMeasure = scaleParams.smartLabel;\n const { maxWidth, maxHeight } = scaleParams.measures;\n const { alignment } = scaleParams;\n // getting tick measure(i.e height and width)\n const tickValue = getTickMeasure.getOriSize(domain[1].toFixed(2));\n\n // To round the floating values to Integer and checking if value is 1.\n steps = Math.round(steps);\n steps = steps < 1 ? (steps + 1) : steps;\n\n // checking alignment of the Axis\n if (alignment === TOP || alignment === BOTTOM) {\n recomputeSteps = Math.floor(maxWidth / (tickValue.width));\n } else {\n recomputeSteps = Math.floor(maxHeight / (tickValue.height));\n }\n steps = Math.min(steps, recomputeSteps);\n\n return getReadableTicks(domain, steps);\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} text\n * @param {*} measurement\n * @param {*} classPrefix\n */\nexport const titleCreator = (container, title, measurement, config) => {\n const { orientation } = config.item.text;\n let textAlign = LEFT;\n const { alignment, maxWidth, width, height, border, padding } = measurement;\n\n if (orientation === TOP || orientation === BOTTOM || alignment === HORIZONTAL) {\n textAlign = CENTER;\n }\n const titleWidth = Math.min(maxWidth, width);\n\n const titleContainer = makeElement(container, 'table', [1], `${config.classPrefix}-legend-title`)\n .style(WIDTH, `${titleWidth}px`)\n .style(HEIGHT, `${height}px`)\n .style('border-bottom', `${border}px ${config.borderStyle} ${config.borderColor}`)\n .style('text-align', title.orientation instanceof Function ?\n title.orientation(config.position) : title.orientation);\n return makeElement(titleContainer, 'td', [1], `${config.classPrefix}-legend-title-text`)\n .style(WIDTH, `${titleWidth}px`)\n .style(MAXWIDTH, `${maxWidth}px`)\n .style(HEIGHT, '100%')\n .style('line-height', 1)\n .style('padding', `${padding}px`)\n .text(title.text)\n .style('text-align', textAlign)\n .style('overflow-x', 'scroll')\n .node();\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getMaxMeasures = (data, prop, labelManager) => {\n let maxHeight = -Infinity;\n let maxWidth = -Infinity;\n\n data.forEach((item) => {\n const value = prop ? item[prop] : item;\n const space = labelManager.getOriSize(value);\n maxHeight = Math.max(space.height + 2, maxHeight);\n maxWidth = Math.max(space.width + 2, maxWidth);\n });\n\n return { height: maxHeight, width: maxWidth };\n};\n\n/**\n *\n *\n * @param {*} data\n * @param {*} prop\n * @param {*} labelManager\n *\n */\nexport const getItemMeasures = (context, prop, formatter) => {\n const space = [];\n const data = context.data();\n const labelManager = context._labelManager;\n\n data.forEach((item, index) => {\n const value = prop ? item[prop] : item;\n const formattedData = formatter(value, index, context.metaData(), context);\n const { height, width } = labelManager.getOriSize(formattedData);\n space[index] = { height, width };\n });\n return space;\n};\n\n/**\n *\n *\n * @param {*} textOrientation\n * @param {*} effPadding\n * @param {*} titleSpace\n *\n * @memberof Legend\n */\nexport const computeItemSpaces = (config, measures, data) => {\n let totalHeight = 0;\n let totalWidth = 0;\n let maxItemSpaces = {\n width: 0, height: 0\n };\n const {\n effPadding,\n titleWidth,\n labelSpaces,\n titleHeight,\n maxWidth\n } = measures;\n const {\n item,\n align\n } = config;\n const {\n icon,\n text\n } = item;\n const textOrientation = text.orientation;\n const itemSpaces = [];\n const iconSpaces = [];\n let maxIconWidth = 0;\n labelSpaces.forEach((labelSpace, i) => {\n const itemSpace = { width: 0, height: 0 };\n const iconSpace = { width: 0, height: 0 };\n const datum = data[i] || {};\n // Compute each legend item height/width\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n // Get label, icon and item widths\n labelSpace.width += effPadding;\n iconSpace.width = (datum.size ? 2 * Math.sqrt(datum.size / Math.PI) : icon.width) + effPadding;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n itemSpace.width = labelSpace.width + maxIconWidth;\n\n // Get label, icon and item heights\n labelSpace.height = Math.max(labelSpace.height, icon.height) + effPadding;\n iconSpace.height = labelSpace.height;\n itemSpace.height = labelSpace.height;\n } else {\n // Get label, icon and item widths\n labelSpace.width = Math.max(labelSpace.width, datum.size ? 2 * Math.sqrt(datum.size / Math.PI)\n : icon.width) + effPadding;\n iconSpace.width = labelSpace.width;\n itemSpace.width = labelSpace.width;\n maxIconWidth = Math.max(iconSpace.width, maxIconWidth);\n\n // Get label, icon and item heights\n labelSpace.height += effPadding;\n iconSpace.height = icon.height + effPadding;\n itemSpace.height = labelSpace.height + iconSpace.height;\n }\n // Compute height and width of legend for each alignment\n if (align === 'horizontal') {\n totalHeight = Math.max(totalHeight, itemSpace.height);\n } else {\n totalHeight += itemSpace.height;\n totalWidth = Math.max(totalWidth, itemSpace.width, titleWidth);\n }\n maxItemSpaces = {\n width: Math.max(itemSpace.width, maxItemSpaces.width),\n height: Math.max(itemSpace.height, maxItemSpaces.height)\n };\n itemSpaces.push(itemSpace);\n iconSpaces.push(iconSpace);\n });\n\n itemSpaces.forEach((itemSpace, i) => {\n if (align === 'horizontal') {\n itemSpace.height = totalHeight;\n // iconSpaces[i].width = maxIconWidth;\n if (textOrientation === LEFT || textOrientation === RIGHT) {\n labelSpaces[i].height = totalHeight;\n iconSpaces[i].height = totalHeight;\n itemSpaces[i].width = labelSpaces[i].width + iconSpaces[i].width + 2 * effPadding;\n } else {\n labelSpaces[i].width = iconSpaces[i].width;\n itemSpaces[i].width = iconSpaces[i].width;\n labelSpaces[i].width = iconSpaces[i].width;\n }\n totalWidth += itemSpaces[i].width;\n } else {\n itemSpace.width = Math.max(totalWidth, maxWidth);\n if (textOrientation === TOP || textOrientation === BOTTOM) {\n labelSpaces[i].width = totalWidth;\n iconSpaces[i].width = totalWidth;\n maxIconWidth = totalWidth;\n } else {\n const labelWidth = labelSpaces[i].width;\n const newLabelWidth = (maxItemSpaces.width - maxIconWidth);\n iconSpaces[i].width = maxIconWidth;\n itemSpaces[i].width = labelWidth + maxIconWidth;\n labelSpaces[i].width = Math.max(labelWidth, newLabelWidth);\n totalWidth = Math.max(totalWidth, itemSpace.width);\n }\n }\n });\n totalWidth = Math.ceil(Math.max(totalWidth, titleWidth)) + effPadding;\n totalHeight += titleHeight + effPadding;\n totalHeight = Math.ceil(totalHeight);\n return { totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth };\n};\n\n/**\n *\n *\n * @param {*} type\n * @param {*} scaleInfo\n * @param {*} domainInfo\n *\n */\nexport const getDomainBounds = (type, scaleInfo, domainInfo) => {\n const {\n scaleFn,\n scaleType,\n scale\n } = scaleInfo;\n const {\n domain,\n domainBounds,\n domainLeg,\n steps\n } = domainInfo;\n const ele = domain[type === 'lower' ? 0 : domain.length - 1];\n const step = steps[type === 'lower' ? 0 : steps.length - 1];\n\n return {\n [scaleType]: scaleType === 'size' ? scale[scaleFn](ele) * scale.getScaleFactor() : scale[scaleFn](ele),\n value: domainBounds[type],\n id: type === 'lower' ? 0 : domainLeg.length + 2,\n range: [ele, step]\n };\n};\n\nexport const prepareSelectionSetData = (data, fieldName, dm) => {\n const fieldType = dm.getFieldsConfig()[fieldName].def.type;\n if (fieldType === FieldType.DIMENSION) {\n return {\n keys: data.reduce((acc, d) => {\n acc[d.rawVal] = {\n uid: d.id,\n dims: [d.rawVal]\n\n };\n return acc;\n }, {}),\n fields: [fieldName]\n };\n }\n return {\n keys: data.reduce((acc, d) => {\n acc[d.id] = {\n uid: d.id,\n dims: [d.id]\n };\n return acc;\n }, {}),\n fields: [fieldName]\n };\n};\n\nexport const calculateTitleWidth = (measures, titleWidth, config) => {\n const { maxItemSpaces, margin, itemSpaces } = measures;\n const { position, buffer } = config;\n const alignment = POSITION_ALIGNMENT_MAP[position];\n let width = 0;\n\n if (alignment === HORIZONTAL) {\n const localBuffer = buffer[alignment];\n width = itemSpaces.reduce((acc, cur) => acc + cur.width + localBuffer, 0);\n } else if (maxItemSpaces.width < titleWidth) {\n width = titleWidth + 2 * margin;\n } else {\n width = maxItemSpaces.width;\n }\n return width;\n};\n","import {\n makeElement,\n selectElement,\n getUniqueId,\n getSmartComputedStyle,\n generateGetterSetters,\n mergeRecursive\n} from 'muze-utils';\nimport * as legendBehaviours from '../firebolt/behavioural';\n\nimport { LegendFireBolt } from '../firebolt/legend-firebolt';\nimport { actionBehaviourMap } from '../firebolt/action-behaviour-map';\nimport { physicalActions } from '../firebolt/physical';\nimport * as sideEffects from '../firebolt/side-effects';\nimport { behaviourEffectMap } from '../firebolt/behaviour-effect-map';\nimport { VALUE, PATH, RIGHT, LEFT, TOP, BOTTOM, POSITION_ALIGNMENT_MAP } from '../enums/constants';\nimport { PROPS } from './props';\nimport { DEFAULT_MEASUREMENT, DEFAULT_CONFIG, LEGEND_TITLE } from './defaults';\nimport {\n getItemMeasures,\n titleCreator,\n computeItemSpaces,\n prepareSelectionSetData,\n calculateTitleWidth\n} from './legend-helper';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class SimpleLegend\n */\nexport default class SimpleLegend {\n\n /**\n * Creates an instance of Legend.\n * @param {Object} dependencies Set of dependencies required by the legend\n * @memberof Legend\n */\n constructor (dependencies) {\n const { interactions } = dependencies.registry;\n this._data = [];\n this._metaData = [];\n this._mount = null;\n this._fieldName = null;\n this._title = Object.assign({}, LEGEND_TITLE);\n this._metaData = null;\n this._labelManager = dependencies.labelManager;\n this._cells = dependencies.cells;\n this._id = getUniqueId();\n this._measurement = Object.assign({}, this.constructor.defaultMeasurement());\n this._config = mergeRecursive({}, this.constructor.defaultConfig());\n\n const dist = dependencies.labelManager.getOriSize('w');\n this._minTickDistance = { width: dist.width * 3 / 4, height: dist.height / 2 };\n\n generateGetterSetters(this, PROPS);\n this._computedStyle = getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-item-info`);\n\n this._firebolt = new LegendFireBolt(this, {\n behavioural: Object.assign({}, interactions.behaviours.get(), legendBehaviours),\n physical: physicalActions,\n physicalBehaviouralMap: actionBehaviourMap\n }, sideEffects, behaviourEffectMap);\n }\n\n id () {\n return this._id;\n }\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new SimpleLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof SimpleLegend\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENT;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof SimpleLegend\n */\n firebolt (...params) {\n if (params.length) {\n return this;\n }\n return this._firebolt;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return PATH;\n }\n\n canvasAlias (...alias) {\n if (alias.length) {\n this._canvasAlias = alias[0];\n return this;\n }\n return this._canvasAlias;\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n mount (...params) {\n if (params.length) {\n this._mount = params[0];\n this.render();\n return this;\n }\n return this._mount;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n const {\n item,\n classPrefix\n } = this.config();\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${classPrefix}-legend-item-info`));\n return getItemMeasures(this, VALUE, item.text.formatter);\n }\n\n /**\n * Sets the height and width of a legend based on provided max\n * height and width and based on its contents\n *\n * @return {Instance} Current instance\n * @memberof Legend\n */\n setLegendMeasures () {\n const {\n width,\n height,\n maxWidth,\n maxHeight,\n padding,\n margin,\n border\n } = this.measurement();\n const {\n align\n } = this.config();\n\n // Effective padding, margin and padding\n const effPadding = padding * 2;\n const effBorder = border * 2;\n const effMargin = margin * 2;\n\n this.data(this.dataFromScale());\n // Get space occupied by title\n const titleSpace = this.getTitleSpace();\n const titleHeight = titleSpace.height > 0 ? titleSpace.height + effPadding : 0;\n const titleWidth = titleSpace.width + effPadding;\n\n // Get space occupied by labels\n const labelSpaces = this.getLabelSpaces(effPadding, align);\n const {\n totalHeight, totalWidth, itemSpaces, iconSpaces, maxItemSpaces, maxIconWidth\n } = computeItemSpaces(this.config(),\n { effPadding, titleWidth, labelSpaces, titleHeight, maxWidth, maxHeight }, this.data());\n\n this.measurement({\n width: Math.max(totalWidth, width) + effMargin + effBorder,\n height: Math.max(totalHeight, height) + effMargin + effBorder,\n labelSpaces,\n iconSpaces,\n itemSpaces,\n maxItemSpaces,\n maxIconWidth,\n titleSpaces: {\n width: Math.min(maxWidth, this.measurement().width) - effMargin - effBorder,\n height: titleHeight\n }\n });\n return this;\n }\n\n /**\n * Returns the space occupied by the legend title\n *\n * @return {Object} Space occupied by title\n * @memberof Legend\n */\n getTitleSpace () {\n this._labelManager.setStyle(getSmartComputedStyle(selectElement('body'),\n `${this.config().classPrefix}-legend-title`));\n return this._labelManager.getOriSize(this.title().text ? this.title().text : '');\n }\n\n /**\n * Creates the title for the legend\n *\n * @param {DOM} container Container made for the title\n * @return {Selection} Title and it's node\n * @memberof Legend\n */\n renderTitle (container) {\n const { titleSpaces, border, padding, maxWidth } = this.measurement();\n\n const width = calculateTitleWidth(\n this.measurement(),\n this._labelManager.getOriSize(this._title.text).width,\n this.config()\n );\n const { borderStyle, borderColor } = this.config();\n return titleCreator(container, this.title(), {\n height: titleSpaces.height,\n width,\n maxWidth,\n border,\n padding,\n borderStyle,\n borderColor,\n alignment: POSITION_ALIGNMENT_MAP[this.config().position]\n }, this.config());\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const {\n classPrefix,\n borderStyle,\n borderColor,\n position\n } = this.config();\n const {\n border,\n marginHorizontal,\n maxHeight,\n height,\n width,\n maxWidth\n } = this.measurement();\n let {\n margin\n } = this.measurement();\n const legendContainer = makeElement(selectElement(this.mount()), 'div', [1], `${classPrefix}-legend-box`);\n let marginPosition;\n switch (position) {\n case TOP:\n marginPosition = `margin-${BOTTOM}`;\n margin = marginHorizontal;\n break;\n case LEFT:\n marginPosition = `margin-${RIGHT}`;\n break;\n case BOTTOM:\n marginPosition = `margin-${TOP}`;\n margin = marginHorizontal;\n break;\n default:\n marginPosition = `margin-${LEFT}`;\n }\n legendContainer.classed(`${classPrefix}-legend-box-${this._id}`, true);\n legendContainer.style('float', 'left');\n\n const widthBox = calculateTitleWidth(\n this.measurement(),\n this._labelManager.getOriSize(this._title.text).width,\n this.config()\n );\n\n const titleWidth = Math.min(maxWidth, widthBox);\n width < titleWidth ? selectElement(this.mount()).style('width', `${titleWidth}px`) : null;\n // set height and width\n legendContainer.style('width', `${titleWidth}px`)\n .style('height', `${Math.min(maxHeight, height)}px`)\n .style(`${marginPosition}`, `${margin}px`)\n .style('border', `${border}px ${borderStyle} ${borderColor}`);\n this.legendContainer(legendContainer.node());\n\n // create title\n this.renderTitle(legendContainer);\n firebolt.createSelectionSet(prepareSelectionSetData(this.data(), this.fieldName(), this.metaData()));\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n const type = this.metaData().getData().schema[0].type;\n if (type === 'measure') {\n return {\n [fieldName]: data.range\n };\n }\n return [[fieldName], [data.rawVal]];\n }\n\n getValueFromId (id, fields = []) {\n const data = this.data();\n if (fields.length) {\n id = Number(id);\n return [data.find(d => id === d.id).rawVal];\n }\n\n return [];\n }\n\n getRangeFromIdentifiers ({ fields, entrySet }) {\n const data = this.data();\n const idRangeMap = data.reduce((acc, v) => {\n acc[v.id] = v;\n return acc;\n }, {});\n\n return fields.reduce((acc, v) => {\n acc[v] = entrySet.reduce((ranges, id) => {\n if (id in idRangeMap) {\n ranges.push(idRangeMap[id].range);\n }\n return ranges;\n }, []);\n return acc;\n }, {});\n }\n\n setParentInfo (info) {\n this._canvasMount = info.canvasRoot;\n }\n}\n","import {\n LEFT,\n RIGHT,\n START,\n END,\n TOP,\n BOTTOM,\n HORIZONTAL,\n VERTICAL,\n CENTER,\n SHAPE,\n VALUE\n} from '../enums/constants';\n\nconst legendOrientation = {\n [HORIZONTAL]: {\n datasets: data => ({\n row: [1],\n column: data\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n itemSpaces,\n width\n } = measurement;\n const {\n buffer\n } = config;\n return {\n row: {\n width: `${width + itemSpaces.length * buffer[HORIZONTAL] || 1}px`,\n padding: `${0}px`\n },\n column: {\n width: (d, i) => `${itemSpaces[i].width + buffer[HORIZONTAL]}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, height } = measurement;\n return {\n iconHeight: height,\n iconWidth: maxItemSpaces.width,\n stepPadding: {\n horizontal: true,\n vertical: false\n }\n };\n }\n },\n [VERTICAL]: {\n datasets: data => ({\n row: data,\n column: d => [d]\n }),\n itemContainerMeasures: (measurement, config) => {\n const {\n width\n } = measurement;\n const { padding } = config;\n\n return {\n row: {\n width: `${width}px`,\n padding: `${padding}px`\n },\n column: {\n width: `${width}px`,\n padding: `${0}px`\n }\n };\n },\n getStepSpacesInfo: (measurement) => {\n const { maxItemSpaces, width } = measurement;\n return {\n iconHeight: maxItemSpaces.height,\n iconWidth: width,\n stepPadding: {\n horizontal: false,\n vertical: true\n }\n };\n }\n }\n};\n\nexport const positionConfig = {\n [LEFT]: legendOrientation[VERTICAL],\n [RIGHT]: legendOrientation[VERTICAL],\n [TOP]: legendOrientation[HORIZONTAL],\n [BOTTOM]: legendOrientation[HORIZONTAL]\n};\n\nexport const alignmentMap = {\n [LEFT]: END,\n [RIGHT]: START,\n [TOP]: CENTER,\n [BOTTOM]: CENTER\n};\n\n// Reverses data for step legend\nexport const stepData = data => ({\n [LEFT]: data.reverse(),\n [RIGHT]: data.reverse(),\n [TOP]: data,\n [BOTTOM]: data\n});\n\n// Changes the item layout based on the position of the text\nexport const itemStack = {\n [LEFT]: [VALUE, SHAPE],\n [RIGHT]: [SHAPE, VALUE],\n [TOP]: [VALUE, SHAPE],\n [BOTTOM]: [SHAPE, VALUE]\n};\n","import { makeElement, selectElement, applyStyle } from 'muze-utils';\nimport { ICON_MAP } from './defaults';\nimport { positionConfig, alignmentMap, itemStack } from './position-config';\nimport {\n WIDTH,\n HEIGHT,\n CENTER,\n VALUE,\n RECT,\n LEFT,\n DEFAULTICONSIZE,\n VERTICAL_BUFFER,\n HORIZONTAL_BUFFER,\n HORIZONTAL,\n VERTICAL,\n DEFAULT,\n TOP,\n BOTTOM,\n OPPOSITE_POSITION\n} from '../enums/constants';\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} legendInstance\n * @param {*} align\n *\n */\nexport const getItemContainers = (container, data, legendInstance) => {\n const measurement = legendInstance.measurement();\n const config = legendInstance.config();\n const {\n itemSpaces\n } = measurement;\n const {\n classPrefix,\n position\n } = config;\n const positionObj = positionConfig[position];\n const datasets = positionObj.datasets(data);\n const measures = positionObj.itemContainerMeasures(measurement, config);\n\n const rows = makeElement(container, 'div', datasets.row, `${classPrefix}-legend-row`);\n rows.style(HEIGHT, (d, i) => `${itemSpaces[i].height}px`);\n rows.style(WIDTH, measures.row.width);\n rows.style('padding', measures.row.padding);\n\n const columns = makeElement(rows, 'div', datasets.column, `${classPrefix}-legend-columns`);\n columns.style(WIDTH, measures.column.width);\n columns.style('padding', measures.column.padding);\n\n return columns;\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} classPrefix\n * @param {*} data\n *\n * @memberof DiscreteLegend\n */\nexport const createLegendSkeleton = (context, container, classPrefix, data) => {\n let gradWidth = 0;\n let gradHeight = 0;\n let maxGradHeight = 0;\n let maxGradWidth = 0;\n const measurement = context.measurement();\n const {\n margin,\n border,\n titleSpaces,\n width,\n height,\n maxWidth,\n maxHeight\n } = measurement;\n\n gradHeight = height - (titleSpaces.height + 2 * margin + 2 * border);\n gradWidth = width - (margin * 2 + border * 2);\n\n maxGradHeight = maxHeight - (titleSpaces.height + margin * 2 + border * 2);\n maxGradWidth = maxWidth - (margin * 2 + border * 2);\n\n let legendBody = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n\n legendBody.style(WIDTH, `${gradWidth}px`);\n\n legendBody.style(HEIGHT, `${gradHeight}px`);\n\n legendBody.select(`.${classPrefix}-legend-overflow`).remove();\n // Create a div with scroll when overflow\n if (maxGradWidth && maxGradWidth < gradWidth) {\n legendBody = legendBody.style(WIDTH, `${maxGradWidth}px`).style('overflow-x', 'scroll');\n }\n // Create a div with scroll when overflow\n if (maxGradHeight && maxGradHeight < gradHeight) {\n legendBody.style(HEIGHT, `${maxGradHeight}px`).style('overflow-y', 'scroll');\n }\n\n legendBody = makeElement(legendBody, 'div', [1], `${classPrefix}-legend-overflow`);\n\n const legendItem = getItemContainers(legendBody, data, context);\n return { legendItem };\n};\n\n/**\n * Creates legend item based on alignment and text orientation\n *\n * @param {Selection} container Point where items are to be mounted\n * @return {Instance} Current instance\n * @memberof Legend\n */\nexport const createItemSkeleton = (context, container) => {\n const {\n classPrefix,\n item\n } = context.config();\n const textOrientation = item.text.orientation;\n const stack = itemStack[textOrientation];\n const itemSkeleton = makeElement(container, 'div', (d, i) => stack.map(e => [e, d[e], d.color, d.size,\n d.value, context.fieldName(), i]), `${classPrefix}-legend-item-info`);\n\n const alignClass = alignmentMap[textOrientation];\n\n itemSkeleton.classed(alignClass, true);\n return { itemSkeleton };\n};\n\n/**\n *\n *\n * @param {*} measureType\n * @param {*} stepColorCheck\n */\nexport const applyItemStyle = (item, measureType, stepColorCheck, context) => {\n const {\n padding,\n labelSpaces,\n iconSpaces,\n maxIconWidth\n } = context.measurement();\n\n const { align } = context.config().align;\n\n const diff = stepColorCheck ? -padding * 2 : 0;\n\n if (item[0] === VALUE) {\n return `${labelSpaces[item[6]][measureType]}px`;\n }\n\n if (measureType === 'width' && !stepColorCheck && align === VERTICAL) {\n return `${maxIconWidth}px`;\n } else if (align === HORIZONTAL) {\n return `${maxIconWidth}px`;\n }\n return `${iconSpaces[item[6]][measureType] - diff}px`;\n};\n\n/**\n *\n *\n * @param {*} str\n *\n */\nconst checkPath = (str) => {\n if (/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\\dz]$/i.test(str) && str.length > 4) {\n return true;\n }\n return false;\n};\n\n/**\n *\n *\n * @param {*} d\n * @param {*} elem\n */\nconst createShape = function (d, elem, defaultIcon) {\n const groupElement = elem;\n // const { shape, size, update } = d;\n const shape = d[1] || defaultIcon;\n const defaultIconSize = DEFAULTICONSIZE[shape] || DEFAULTICONSIZE[DEFAULT];\n const size = d[3] || defaultIconSize * Math.PI;\n\n if (shape instanceof Promise) {\n shape.then((res) => {\n d.shape = res;\n return createShape(d, elem);\n });\n } else if (shape instanceof Element) {\n let newShape = shape.cloneNode(true);\n\n if (newShape.nodeName.toLowerCase() === 'img') {\n const src = newShape.src || newShape.href;\n newShape = document.createElementNS('http://www.w3.org/2000/svg', 'image');\n newShape.setAttribute('href', src);\n }\n const shapeElement = selectElement(newShape);\n shapeElement.attr('transform', `scale(${size / 100})`);\n return selectElement(groupElement.node().appendChild(newShape));\n } else if (typeof shape === 'string') {\n let pathStr;\n if (checkPath(shape)) {\n pathStr = shape;\n } else {\n pathStr = ICON_MAP(shape).size(size)();\n }\n return makeElement(groupElement, 'path', data => [data]).attr('d', pathStr);\n }\n d[1] = 'circle';\n return createShape(d, elem, 'circle');\n};\n\n/**\n * Returns the icon of the legend item\n *\n * @param {Object} datum Data property attached to the item\n * @param {number} width width of the item\n * @param {number} height height of the item\n * @return {Object|string} returns the path string or the string name of the icon\n * @memberof Legend\n */\nexport const getLegendIcon = (datum, width, height, defaultIcon) => {\n const icon = ICON_MAP(datum[1]);\n\n if (icon) {\n return icon.size(datum[3] || Math.min(width, height) * Math.PI);\n }\n return ICON_MAP(datum[3] ? 'circle' : defaultIcon).size(datum[3] || Math.min(width, height) * Math.PI);\n};\n\n/**\n *\n *\n */\nexport const renderIcon = (icon, container, datum, context) => {\n const {\n classPrefix,\n iconHeight,\n padding,\n color,\n iconWidth,\n align\n } = context;\n\n let { maxIconWidth } = context;\n\n if (align === HORIZONTAL) {\n maxIconWidth = iconWidth + 2 * padding;\n }\n const svg = makeElement(container, 'svg', f => [f], `${classPrefix}-legend-icon-svg`)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .style(WIDTH, `${Math.ceil(maxIconWidth)}px`)\n .style(HEIGHT, `${iconHeight}px`);\n\n const transalate = maxIconWidth / 2 - padding;\n\n if (icon !== RECT) {\n const group = makeElement(svg, 'g', [datum[1]], `${classPrefix}-legend-icon`);\n createShape(datum, group, icon)\n .attr('transform', `translate(${transalate} ${iconHeight / 2})`)\n .attr('fill', datum[2] || color)\n .attr('stroke', datum[2] || color);\n } else {\n makeElement(svg, RECT, [datum[1]], `${classPrefix}-legend-icon`)\n .attr('x', 0)\n .attr('y', 0)\n .attr(WIDTH, maxIconWidth)\n .attr(HEIGHT, iconHeight)\n .attr('fill', datum[2] || color);\n }\n};\n\n/**\n * Renders the items in the legend i.e, icon and text\n *\n * @param {DOM} container Point where item is to be mounted\n * @memberof Legend\n */\nexport const renderDiscreteItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n classPrefix,\n shape,\n align\n } = context.config();\n const {\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width: iconWidth,\n height: iconHeight,\n color,\n className\n } = item.icon;\n const textOrientation = item.text.orientation;\n const formatter = item.text.formatter;\n\n labelManager.useEllipsesOnOverflow(true);\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, false, context),\n height: d => applyItemStyle(d, HEIGHT, false, context),\n 'text-align': CENTER,\n padding: `${padding}px`\n });\n\n const marginHorizontalBuffer = HORIZONTAL_BUFFER;\n const marginVerticalBuffer = textOrientation === TOP || textOrientation === BOTTOM ? 0 : VERTICAL_BUFFER;\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = context.metaData();\n const position = OPPOSITE_POSITION[textOrientation] || LEFT;\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n selectElement(this).text(formatter(d[1], i, dataArr, context))\n .style(`padding-${position}`, '0px')\n .style(`margin-${position}`, `${align === HORIZONTAL ? marginHorizontalBuffer : marginVerticalBuffer}px`);\n } else {\n // const icon = getLegendIcon(d, iconWidth, iconHeight, type);\n selectElement(this).classed(`${classPrefix}-${className}`, true);\n selectElement(this).classed(`${classPrefix}-${className}-${i}`, true);\n renderIcon(shape, selectElement(this), d, {\n classPrefix,\n // iconWidth,\n iconWidth: 2 * Math.sqrt(d[3] / Math.PI) || iconWidth,\n iconHeight,\n maxIconWidth,\n padding,\n color,\n align\n });\n }\n });\n};\n\n/**\n* Renders the items in the legend i.e, icon and text\n*\n* @param {DOM} container Point where item is to be mounted\n* @memberof Legend\n*/\nexport const renderStepItem = (context, container) => {\n const labelManager = context._labelManager;\n const {\n item,\n position,\n classPrefix\n } = context.config();\n const {\n maxItemSpaces,\n maxIconWidth,\n padding\n } = context.measurement();\n const {\n width,\n height,\n color\n } = item.icon;\n const {\n formatter\n } = item.text;\n\n labelManager.useEllipsesOnOverflow(true);\n const { iconHeight, iconWidth, stepPadding } = positionConfig[position].getStepSpacesInfo({\n maxItemSpaces, height, width\n });\n\n applyStyle(container, {\n width: d => applyItemStyle(d, WIDTH, stepPadding.horizontal, context),\n height: d => applyItemStyle(d, HEIGHT, stepPadding.vertical, context),\n 'text-align': 'center',\n padding: `${padding}px`\n });\n\n labelManager.setStyle(context._computedStyle);\n const dataArr = context.metaData();\n const data = context.data();\n container.each(function (d, i) {\n if (d[0] === VALUE) {\n const formattedData = formatter([data[d[6]].range[0], data[d[6]].range[1]], i, dataArr, context);\n selectElement(this).text(formattedData);\n } else {\n renderIcon(RECT, selectElement(this), d, {\n classPrefix,\n iconWidth,\n iconHeight,\n maxIconWidth,\n color\n });\n }\n });\n};\n","import {\n FieldType,\n DimensionSubtype,\n formatTemporal,\n getReadableTicks,\n InvalidAwareTypes\n} from 'muze-utils';\nimport SimpleLegend from './simple-legend';\nimport { DISCRETE, LEFT, SIZE } from '../enums/constants';\nimport { getScaleInfo } from './legend-helper';\nimport { createLegendSkeleton, createItemSkeleton, renderDiscreteItem } from './renderer';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class DiscreteLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new DiscreteLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof DiscreteLegend\n */\n static type () {\n return DISCRETE;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof DiscreteLegend\n */\n dataFromScale () {\n const scale = this.scale();\n const { scaleType, domain, scaleFn, steps } = getScaleInfo(scale);\n const field = this.metaData().getFieldspace().fields[0];\n const { type, subtype } = field.schema();\n let domainForLegend = [];\n if (scaleType === SIZE && type === FieldType.MEASURE) {\n domainForLegend = steps instanceof Array ? steps : getReadableTicks(domain, domain.length);\n } else if (subtype === DimensionSubtype.TEMPORAL) {\n domainForLegend = [...new Set(field.data())];\n } else {\n domainForLegend = [...new Set(domain)];\n }\n\n const len = domainForLegend.length;\n domainForLegend = domainForLegend.map((ele, i) => {\n let value = 0;\n let range = 0;\n const rawVal = domainForLegend[i];\n if (type === FieldType.MEASURE) {\n value = (+domainForLegend[i]).toFixed(0);\n const nextVal = domainForLegend[i + 1] ? +domainForLegend[i + 1] : +value;\n range = [value, i === len - 1 ? nextVal.toFixed(0) : nextVal.toFixed(0) - 1];\n } else {\n let domainVal = rawVal;\n if (subtype === DimensionSubtype.TEMPORAL) {\n domainVal = formatTemporal(domainForLegend[i], field.minimumConsecutiveDifference());\n }\n value = domainVal;\n range = [domainVal];\n }\n return {\n [scaleType]: scale[scaleFn](ele),\n value,\n id: i,\n range,\n rawVal\n };\n }).filter(d => d.value !== null);\n\n domainForLegend = scaleType === SIZE ? domainForLegend.sort((a, b) => a[scaleType] - b[scaleType])\n : domainForLegend.sort((a, b) => {\n const domainValue =\n !(a.value instanceof InvalidAwareTypes || a.value instanceof InvalidAwareTypes)\n ? a.value.localeCompare(b.value)\n : 1;\n return domainValue;\n });\n return domainForLegend;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const data = this.data();\n\n const { classPrefix } = this.config();\n const legendContainer = super.render(this.mount());\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n renderDiscreteItem(this, itemSkeleton);\n\n legendContainer.selectAll('div')\n .filter((datum, i, allSelections) => !allSelections[i].classList.contains(`${classPrefix}-legend-body`))\n .style('float', LEFT);\n\n firebolt.mapActionsAndBehaviour();\n return legendContainer;\n }\n}\n","import { makeElement, applyStyle } from 'muze-utils';\nimport { ContinousAxis } from '@chartshq/muze-axis';\nimport { BOTTOM, RIGHT } from '../enums/constants';\nimport { ALIGN, LEGEND_MARKER_PROPS } from './defaults';\nimport '../styles.scss';\n\n/**\n *\n *\n * @param {*} data\n *\n */\nexport const getGradientDomain = (data) => {\n if (typeof data[0].value === 'number') {\n return data.reduce((accumulator, currentValue) =>\n [Math.min(currentValue.value, accumulator[0]), Math.max(currentValue.value, accumulator[1])],\n [Number.MAX_VALUE, Number.MIN_VALUE]);\n }\n return data.map(e => e.value);\n};\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} domain\n *\n */\nexport const makeLinearGradient = (container, data, domain, id) => {\n const defs = makeElement(container, 'defs', [1]);\n const linearGradient = makeElement(defs, 'linearGradient', [1])\n .attr('id', `linear-gradient-${id}`)\n .attr('x1', '0%')\n .attr('y2', '0%');\n\n makeElement(linearGradient, 'stop', data, 'stop-gradient')\n .attr('offset', d => `${(d.value - domain[0]) * 100 / (domain[1] - domain[0]) || 1}%`)\n .attr('stop-color', d => d.color);\n return linearGradient;\n};\n\n/**\n * Creates an axis cell with a linear axis for computing space and\n * creating gradient legend\n *\n * @return {AxisCell} Instance of Axis Cell for the gradient axis\n * @memberof Legend\n */\nexport const createAxis = (context) => {\n const data = context.data();\n const { align } = context.config();\n const AxisCell = context._cells.AxisCell;\n const newAxis = new ContinousAxis({\n id: `legend-${context._id}`,\n orientation: align === ALIGN.VERTICAL ? RIGHT : BOTTOM,\n style: context._computedStyle,\n nice: false,\n showAxisName: false,\n tickValues: data.map(d => d.value),\n fixedBaseline: false,\n labels: {\n rotation: null\n }\n }, { labelManager: context._labelManager });\n\n newAxis.domain(getGradientDomain(data));\n newAxis.range([1, 1]);\n return new AxisCell().source(newAxis).config({\n margin: { left: 0, bottom: 0, top: 0, right: 0 }\n });\n};\n\n/**\n *\n *\n * @param {*} container\n * @param {*} data\n * @param {*} classPrefix\n *\n * @memberof GradientLegend\n */\nconst createLegendSkeleton = (container, classPrefix, data, id) => {\n const domain = getGradientDomain(data);\n const legendContainer = makeElement(container, 'div', [1], `${classPrefix}-legend-body`);\n const legendGradSvg = makeElement(legendContainer, 'svg', [1], `${classPrefix}-gradient`);\n const legendGradCont = makeElement(legendGradSvg, 'g', [1], `${classPrefix}-gradient-group`);\n const linearGradient = makeLinearGradient(legendGradSvg, data, domain, id);\n const legendRect = makeElement(legendGradCont, 'rect', [1], `${classPrefix}-gradient-rect`);\n\n return {\n legendContainer,\n legendGradCont,\n legendGradSvg,\n linearGradient,\n legendRect\n };\n};\n\n/**\n * Renders the axis for the gradient\n *\n * @param {Selection} container Point where axis is to be mounted\n * @param {number} height Height for axis\n * @param {number} width Width for axis\n * @memberof Legend\n */\nexport const renderAxis = (context, container, height, width) => {\n const axis = context.axis();\n\n axis.source().config({\n tickFormat: (val, i) => context.config().item.text.formatter(val, i, context.metaData(), context)\n });\n axis.setAvailableSpace(width, height);\n axis.render(container.node());\n axis.source().render();\n};\n\n/**\n * Renders gradient legends\n *\n * @param {Selection} container Point where the legend is to be appended\n * @memberof GradientLegend\n */\nexport const renderGradient = (context, container) => {\n let gradHeight = 0;\n let gradWidth = 0;\n const {\n align,\n classPrefix,\n item\n } = context.config();\n const data = context.data();\n // Create the skeleton for the legend\n const {\n legendContainer,\n legendGradSvg,\n legendGradCont,\n linearGradient,\n legendRect\n } = createLegendSkeleton(container, classPrefix, data, context._id);\n const labelDim = context.axis().source().getAxisDimensions().tickDimensions;\n const {\n padding,\n margin,\n border,\n titleSpaces,\n maxItemSpaces,\n maxHeight,\n maxWidth,\n height,\n width\n } = context.measurement();\n const gradientDimensions = {};\n\n gradHeight = Math.floor(Math.min(height, maxHeight) - (titleSpaces.height + 2 * margin + 2 * border));\n gradWidth = Math.floor(Math.min(width, maxWidth) - (margin * 2 + border * 2));\n\n if (align === ALIGN.HORIZONTAL) {\n gradientDimensions.height = item.icon.height;\n gradientDimensions.width = gradWidth - 2 * padding - labelDim.width / 2;\n linearGradient.attr('x2', '100%').attr('y1', '0%');\n legendGradCont.attr('transform', `translate( ${labelDim.width / 2} ${LEGEND_MARKER_PROPS.size + 4})`);\n renderAxis(context, legendContainer, gradHeight - item.icon.height - padding, gradWidth - 2 * padding - 1);\n\n applyStyle(legendContainer, {\n height: `${maxItemSpaces.height + border + padding}px`,\n width: `${Math.min(width, maxWidth)}px`,\n padding: `${padding}px`\n });\n\n legendRect.attr('height', gradientDimensions.height);\n legendRect.attr('width', gradientDimensions.width - labelDim.width / 2);\n } else {\n gradientDimensions.height = gradHeight - 2 * padding - labelDim.height / 2;\n gradientDimensions.width = item.icon.width;\n linearGradient.attr('x2', '0%').attr('y1', '100%');\n legendGradCont.attr('transform', `translate(${LEGEND_MARKER_PROPS.size + 4} ${labelDim.height / 2})`);\n renderAxis(context, legendContainer, gradHeight - 2 * padding - 1, gradWidth - item.icon.width - padding * 2);\n\n applyStyle(legendContainer, {\n height: `${Math.min(height, maxHeight)}px`,\n width: `${maxWidth}px`,\n padding: `${padding}px`\n });\n legendRect.attr('height', gradientDimensions.height - labelDim.height / 2);\n legendRect.attr('width', gradientDimensions.width);\n }\n\n // Apply Styles to the legend plot area\n applyStyle(legendGradSvg, {\n height: `${gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4}px`,\n width: `${gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4}px`\n });\n\n // Apply styles to the legend rect\n applyStyle(legendRect, {\n fill: `url(#linear-gradient-${context._id})`\n });\n legendGradSvg.attr('height', gradientDimensions.height + LEGEND_MARKER_PROPS.size + 4);\n legendGradSvg.attr('width', gradientDimensions.width + LEGEND_MARKER_PROPS.size + 4);\n\n context.measurement({\n gradientDimensions\n });\n context._legendGradientSvg = legendGradSvg;\n return context;\n};\n","import SimpleLegend from './simple-legend';\nimport { getScaleInfo, getInterpolatedData, getInterpolatedArrayData } from './legend-helper';\nimport { GRADIENT, LEFT, SIZE } from '../enums/constants';\nimport { HIGHLIGHT } from '../enums/behaviours';\nimport { Marker } from '../enums/side-effects';\nimport { renderGradient, createAxis } from './gradient-helper';\nimport '../styles.scss';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class GradientLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new GradientLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof GradientLegend\n */\n static type () {\n return GRADIENT;\n }\n\n /**\n *\n *\n * @param {*} axis\n *\n * @memberof GradientLegend\n */\n axis (...axis) {\n if (axis.length) {\n this._axis = axis[0];\n return this;\n }\n return this._axis;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof GradientLegend\n */\n dataFromScale () {\n let domainForLegend = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainForLegend[0] = domain[0];\n }\n domainForLegend = [...domainForLegend, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainForLegend.push(domain[1]);\n }\n // Sorting the domain Array\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n domainForLegend = getInterpolatedArrayData(domainForLegend, scaleParams);\n } else {\n domainForLegend = getInterpolatedData(domain, steps - 1, scaleParams);\n }\n domainForLegend = [...new Set(domainForLegend)].sort((a, b) => a - b);\n\n return domainForLegend.map((ele, i) => {\n const value = domainForLegend[i];\n return {\n [scaleType]: scaleType === SIZE ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](ele),\n value: +value.toFixed(1),\n id: i\n };\n }).filter(d => d.value !== null);\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces (effPadding) {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const axis = createAxis(this);\n const axisSpace = axis.getLogicalSpace();\n const space = { width: axisSpace.width - effPadding, height: axisSpace.height - effPadding };\n const axisDomainLength = axis.source().domain().length;\n const labelSpaces = new Array(axisDomainLength).fill(space);\n\n this.axis(axis);\n return labelSpaces;\n }\n\n /**\n *\n *\n *\n * @memberof GradientLegend\n */\n getDrawingContext () {\n return {\n svgContainer: this._legendGradientSvg\n };\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const legendContainer = super.render(this.mount());\n // create Legend\n renderGradient(this, legendContainer);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n firebolt.mapSideEffects({\n [HIGHLIGHT]: [Marker]\n });\n return legendContainer;\n }\n\n /**\n *\n *\n * @param {*} data\n *\n * @memberof SimpleLegend\n */\n getCriteriaFromData (data) {\n return [[this.fieldName()], [data.value]];\n }\n\n getRangeFromIdentifiers ({ fields, criteria }) {\n return fields.reduce((range, v) => {\n range[v] = criteria[v];\n return range;\n }, {});\n }\n}\n","import SimpleLegend from './simple-legend';\nimport {\n getScaleInfo,\n getInterpolatedData,\n getItemMeasures\n} from './legend-helper';\nimport {\n createLegendSkeleton,\n createItemSkeleton,\n renderStepItem\n} from './renderer';\nimport { STEP, RECT, LEFT, SIZE, HORIZONTAL } from '../enums/constants';\nimport { stepData } from './position-config';\nimport '../styles.scss';\nimport { STEP_DEFAULT_CONFIG, DEFAULT_MEASUREMENT } from './defaults';\n\n/**\n * Creates a Legend from the axes of a canvas\n *\n * @param {Object} dependencies : legend data\n * @class Legend\n */\nexport default class StepLegend extends SimpleLegend {\n\n /**\n * Initializes an instance of the class\n *\n * @static\n * @param {Object} dependencies Set of dependencies required by the legend\n * @return {Instance} returns a new instance of Legend\n * @memberof Legend\n */\n static create (dependencies) {\n return new StepLegend(dependencies);\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static type () {\n return STEP;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof StepLegend\n */\n static defaultConfig () {\n STEP_DEFAULT_CONFIG.buffer[HORIZONTAL] = 0;\n return STEP_DEFAULT_CONFIG;\n }\n\n /**\n *\n *\n * @param {*} scale\n *\n * @memberof StepLegend\n */\n dataFromScale () {\n let domainLeg = [];\n const scale = this.scale();\n const { scaleType, domain, steps, scaleFn } = getScaleInfo(scale);\n const isFraction = ele => ele % 1 !== 0;\n\n // defining scaleParams\n const scaleParams = {\n smartLabel: this.labelManager(),\n measures: this.measurement(),\n alignment: this.config().position,\n minTickDistance: this.minTickDistance()\n };\n\n if (steps instanceof Array) {\n if (domain[0] < steps[0]) {\n domainLeg[0] = domain[0];\n }\n domainLeg = [...domainLeg, ...steps];\n if (domain[domain.length - 1] > steps[steps.length - 1]) {\n domainLeg.push(domain[1]);\n }\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n } else {\n domainLeg = getInterpolatedData(domain, steps, scaleParams);\n }\n\n domainLeg = [...new Set(domainLeg)].sort((a, b) => a - b);\n domainLeg = domainLeg.map((ele, i) => {\n let value = null;\n let range;\n if (i < domainLeg.length - 1) {\n const left = isFraction(ele) ? ele.toFixed(1) : ele;\n\n const numRight = +domainLeg[i + 1];\n const right = isFraction(numRight) ? numRight.toFixed(1) : numRight;\n\n value = `${left} - ${right}`;\n range = [left, right];\n } else if (domainLeg.length === 1) {\n value = isFraction(ele) ? ele.toFixed(1) : ele;\n\n const numRight = +domainLeg[i + 1];\n const right = isFraction(numRight) ? numRight.toFixed(1) : numRight;\n range = [value, right];\n }\n\n return {\n [scaleType]: scaleType === SIZE\n ? scale[scaleFn](ele) * scale.getScaleFactor()\n : scale[scaleFn](ele),\n value,\n id: i + 1,\n range\n };\n }).filter(d => d.value !== null);\n\n return domainLeg;\n }\n\n /**\n *\n *\n * @param {*} effPadding\n * @param {*} align\n *\n * @memberof Legend\n */\n getLabelSpaces () {\n this.config({\n item: {\n text: {\n orientation: this.config().position\n }\n }\n });\n const {\n item\n } = this.config();\n const stepItemBuffer = DEFAULT_MEASUREMENT.padding * 2;\n return getItemMeasures(this, 'range', item.text.formatter, stepItemBuffer);\n }\n\n /**\n *\n *\n *\n * @memberof Legend\n */\n elemType () {\n return RECT;\n }\n\n /**\n * Render the legend with its title\n *\n * @param {DOM} mountPoint Point where the legend and title are to be appended\n * @return {Instance} Current instance of legend\n * @memberof Legend\n */\n render () {\n const firebolt = this.firebolt();\n const { classPrefix, position } = this.config();\n const data = stepData(this.data())[position];\n\n const legendContainer = super.render(this.mount());\n\n // create Legend\n const { legendItem } = createLegendSkeleton(this, legendContainer, classPrefix, data);\n const { itemSkeleton } = createItemSkeleton(this, legendItem);\n\n renderStepItem(this, itemSkeleton);\n legendContainer.selectAll('div').style('float', LEFT);\n firebolt.mapActionsAndBehaviour();\n return legendContainer;\n }\n\n getCriteriaFromData (data) {\n const fieldName = this.fieldName();\n return {\n [fieldName]: data.range\n };\n }\n}\n","import { GradientLegend, DiscreteLegend, StepLegend } from '@chartshq/muze-legend';\n\n/**\n * Contants to be used as attr\n */\nexport const ROWS = 'rows';\nexport const COLUMNS = 'columns';\nexport const DATA = 'data';\nexport const COLOR = 'color';\nexport const SHAPE = 'shape';\nexport const SIZE = 'size';\nexport const DETAIL = 'detail';\nexport const LAYERS = 'layers';\nexport const TRANSFORM = 'transform';\nexport const INITIALIZED = 'isInitialized';\nexport const SOURCE = 'source';\nexport const WIDTH = 'width';\nexport const HEIGHT = 'height';\nexport const PADDING = 'padding';\nexport const BORDER = 'border';\nexport const MARGIN = 'margin';\nexport const CONFIG = 'config';\nexport const MOUNT = 'mount';\nexport const CANVAS_UPDATED = 'canvasUpdated';\nexport const CLASSPREFIX = 'classPrefix';\nexport const POLICIES = '_policies';\nexport const LEGEND = 'legend';\nexport const TITLE = 'title';\nexport const SUB_TITLE = 'subtitle';\nexport const RESOLVE = 'resolve';\nexport const DISCRETE = 'discrete';\nexport const STEP_COLOR = 'step-color';\nexport const GRADIENT = 'gradient';\nexport const LINEAR = 'linear';\nexport const ORDINAL = 'ordinal';\nexport const MUZE_PREFIX = 'muze';\n\nexport const TITLE_TEMPLATE_NOT_ALLOWED_TAGS = [\n 'script',\n 'style'\n];\n\nexport const ICON_SHAPES = {\n SQUARE: 'square',\n CIRCLE: 'circle'\n};\n\nexport const IS_POINT_MAP = {\n true: ICON_SHAPES.CIRCLE,\n false: ICON_SHAPES.SQUARE\n};\n\nexport const LEGEND_TYPE_MAP = {\n [`${ORDINAL}-${true}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SIZE}`]: DiscreteLegend,\n [`${ORDINAL}-${true}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${COLOR}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${ORDINAL}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${SIZE}`]: DiscreteLegend,\n [`${LINEAR}-${false}-${SHAPE}`]: DiscreteLegend,\n [`${LINEAR}-${true}-${COLOR}`]: StepLegend,\n [`${LINEAR}-${false}-${COLOR}`]: GradientLegend\n};\n\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const GROUP = 'group';\nexport const LAYOUT = 'layout';\nexport const RETINAL = 'retinal';\nexport const DIMENSION = 'dimension';\nexport const MEASURE = 'measure';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const HORIZONTAL_CENTER = 'h-center';\nexport const VERTICAL_CENTER = 'v-center';\nexport const HIDDEN = 'hidden';\nexport const OVERFLOW = 'overflow';\nexport const OVERFLOW_X = 'overflow-x';\nexport const OVERFLOW_Y = 'overflow-y';\nexport const AUTO = 'auto';\nexport const VISIBLE = 'visible';\nexport const VERTICAL_SCROLL_BAR = 'verticalScrollBar';\nexport const HORIZONTAL_SCROLL_BAR = 'horizontalScrollBar';\nexport const GRID = 'grid';\nexport const POINT = 'point';\nexport const MESSAGE = 'message';\nexport const ERROR_MESSAGE = 'Insufficient data or incorrect configurations';\nexport const COMMON_INTERACTION = 'common';\nexport const INDIVIDUAL_INTERACTION = 'individual';\n","import { ComposedVars, SimpleVariable } from '@chartshq/visual-group';\nimport { TITLE_TEMPLATE_NOT_ALLOWED_TAGS } from './constants';\n\n/**\n * This method creates a new composed variable instance from multiple variables. This is required when we have multiple\n * variables on a single axis and the union of domain of all the variables needs to be set on the axis.\n *\n * To create a new composed variable from multiple fields,\n * ```\n * const sharedVar = share('open', 'high', 'low', 'close');\n * canvas.rows([sharedVar])\n * .columns(['date']);\n * ```\n *\n * @module Operators\n * @public\n * @function share\n * @param {Array} vars Variable names.\n *\n * @return {ComposedVars} Instance of composed variable\n */\nexport const share = (...vars) => new ComposedVars(...vars.map(variable => new SimpleVariable(variable)));\n\n/**\n *\n *\n * @param {*} node\n *\n */\nfunction treeShakeNode (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) { return; }\n\n if (TITLE_TEMPLATE_NOT_ALLOWED_TAGS.indexOf(node.tagName.toLowerCase()) !== -1) {\n node.parentNode.removeChild(node);\n } else {\n for (const childNode of node.childNodes) {\n treeShakeNode(childNode);\n }\n }\n}\n\n/**\n * A string template tagged function which sanitizes input html formatted string according to the allowed html tags.\n * This is used to render html in canvas components like title and tooltip.\n *\n * To render html in canvas components,\n * ```\n * canvas.title(html`TITLE`);\n * ```\n *\n * @public\n * @module Operators\n * @function html\n * @param {Array.} strings - The string parts of the template.\n * @param {Array} exps - The list of evaluated expression values.\n *\n * @return {Function} Returns a function which returns the sanitized html string.\n */\nexport function html (strings, ...exps) {\n let htmlCode = '';\n const expLn = exps.length;\n let i = 0;\n\n for (; i < expLn; ++i) {\n htmlCode += strings[i] + exps[i];\n }\n htmlCode += strings[i];\n\n const frag = document.createDocumentFragment();\n const wrapper = document.createElement('div');\n\n frag.appendChild(wrapper);\n wrapper.innerHTML = htmlCode;\n\n treeShakeNode(wrapper);\n const { innerHTML } = wrapper;\n\n return () => innerHTML;\n}\n","import { mergeRecursive, CommonProps } from 'muze-utils';\n\nconst defaultPolicy = (registrableComponents) => {\n const aliases = registrableComponents.map(comp => comp.alias());\n return {\n behaviours: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n },\n sideEffects: {\n '*': (propagationPayload) => {\n const propagationCanvas = propagationPayload.sourceCanvas;\n return propagationCanvas ? aliases.indexOf(propagationCanvas) !== -1 : true;\n }\n }\n };\n};\n\nconst listenerFn = (canvas, fn) => () => {\n const valueMatrix = canvas.composition().visualGroup.matrixInstance().value;\n valueMatrix.each(cell => fn(cell.valueOf().firebolt()));\n};\n\nconst canvasIterator = (canvases, iteratorFn, cFn) => {\n canvases.forEach((canvas) => {\n const matrix = canvas.composition().visualGroup.matrixInstance().value;\n matrix.each(cell => iteratorFn(cell.valueOf().firebolt()));\n cFn && cFn(canvas);\n // Also register actions on canvas update\n const throwback = canvas._throwback;\n\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED],\n listenerFn(canvas, iteratorFn));\n });\n};\n\nconst registerActions = (context, type, fnName, deps) => {\n const canvases = context._registrableComponents;\n\n canvases.forEach((canvas) => {\n const vGroup = canvas.composition().visualGroup;\n\n vGroup.resolver().setFireboltDependencies(type, deps);\n canvas.firebolt()[fnName](deps);\n });\n};\n\n/**\n * This class is initiated only once in lifecycle and is reponsible for regisration of physical and behavioural\n * actions and side effects and the mapping between them.\n *\n * To get the instance of action model\n * ```\n * const ActionModel = muze.ActionModel;\n * ```\n *\n * @public\n * @module ActionModel\n */\nclass ActionModel {\n constructor () {\n this._registrableComponents = [];\n }\n\n /**\n * Takes an array of canvases on which the physical and behavioural actions will get registered.\n *\n * @public\n * @param {Canvas} components Array of canvases\n *\n * @return {ActionModel} Instance of action model.\n */\n for (...components) {\n this._registrableComponents = components;\n return this;\n }\n\n /**\n * Registers physical actions on the canvases. It takes an object with key as the name of action and value having\n * the definition of the action.\n *\n * To register a {@link PhysicalAction},\n * ```\n * const ActionModel = muze.ActionModel;\n * ActionModel\n * // Physical actions will be registered on these canvases.\n * .for(canvas)\n * .registerPhysicalActions({\n * // Key is the name of physical action.\n * ctrlClick: (firebolt) => (targetEl, behaviours) => {\n * targetEl.on('click', function (data) {\n * const event = utils.getEvent();\n * const pos = utils.getClientPoint(event, this);\n * // Get the data point nearest to the mouse position.\n * const nearestPoint = firebolt.context.getNearestPoint(pos, {\n * data\n * });\n * // Prepare the payload\n * const payload = {\n * criteria: nearestPoint.id\n * };\n * behaviours.forEach((behaviour) => firebolt.dispatchBehaviour(behaviour, payload));\n * });\n * }\n * });\n * ```\n * @public\n *\n * @param {Object} action Names of physical actions and their definitions.\n *\n * @return {ActionModel} Instance of the action model.\n */\n registerPhysicalActions (action) {\n registerActions(this, 'physicalActions', 'registerPhysicalActions', action);\n\n return this;\n }\n\n /**\n * Registers behavioural actions on the canvases. It takes definitions of the behavioural actions and registers\n * them on the canvases. Every behavioural action must inherit the {@link GenericBehaviour} class.\n *\n * To register a behavioural action\n * ```\n * // Define a new behavioural action\n * class SingleSelectBehaviour extends GenericBehaviour {\n * static formalName () {\n * return 'singleSelect';\n * }\n *\n * setSelectionSet (addSet, selectionSet) {\n * if (addSet === null) {\n * selectionSet.reset();\n * } else if (addSet.length) {\n * const existingAddSet = selectionSet.getExistingEntrySet(addSet);\n * if (existingAddSet.length){\n * selectionSet.reset();\n * } else {\n * selectionSet.add(addSet);\n * }\n * } else {\n * selectionSet.reset();\n * }\n * }\n * }\n * muze.ActionModel.registerBehaviouralActions(SingleSelectBehaviour);\n * ```\n *\n * @public\n *\n * @param {GenericBehaviour} actions Definition of behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerBehaviouralActions (...actions) {\n registerActions(this, 'behaviouralActions', 'registerBehaviouralActions', actions);\n return this;\n }\n\n /**\n * Registers the mapping of physical and behavioural actions. This mapping is used to establish which behavioural\n * actions should be dispatched on any triggering of physical actions.\n *\n * To map physical actions with behavioural actions,\n * ```\n * muze.ActionModel.registerPhysicalBehaviouralMap({\n * ctrlClick: {\n * behaviours: ['select'] // This array must be the formal names of the behavioural actions.\n * }\n * });\n * ```\n *\n * @public\n * @param {Object} map Contains the physical and behavioural action map.\n * ```\n * {\n * // Name of the physical action\n * click: {\n * // Target element selector. This is an optional field. If not passed, then by default takes the\n * // container element of visual unit.\n * target: '.muze-layers-area path',\n * // Behaviours which should be dispatched on triggering of the mapped physical action.\n * behaviours: ['select']\n * }\n * }\n * ```\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPhysicalBehaviouralMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPhysicalBehaviouralMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPhysicalBehaviouralMap(map);\n });\n return this;\n }\n\n /**\n * Registers what behaviour to propagate on dispatch of a certain behavioural action. By default, when any\n * behavioural action is dispatched, then the same behavioural action gets propagated to all the other canvases.\n * This can be changed using this api.\n *\n * To register what behaviour should be propagated on dispatch of any behavioural action,\n * ```\n * ActionModel.for(canvas1, canvas2).registerPropagationBehaviourMap({\n * select: 'filter',\n * brush: 'filter'\n * });\n * ```\n *\n * @public\n * @param {Object} map Propagation behaviour map.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerPropagationBehaviourMap (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.registerPropagationBehaviourMap(map);\n }, (canvas) => {\n canvas.firebolt().registerPropagationBehaviourMap(map);\n });\n\n return this;\n }\n\n /**\n * Registers the mapping of side effects and behavioural actions. It takes an object which contains key as the\n * name of behavioural action and the side effects which will be linked to it.\n *\n * To map side effects to select behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: ['infoBox'] // This array must be the formal names of the side effects\n * });\n * ```\n *\n * To map side effects to select behaviour, but disable all the default side effects attached with this behaviour,\n * ```\n * muze.ActionModel.mapSideEffects({\n * select: {\n * effects: ['infoBox'],\n * preventDefaultActions: true\n * }\n * });\n * @public\n * @param {Object} map Mapping of behavioural actions and side effects.\n * ```\n * {\n * select: ['infoBox']\n * }\n * ```\n * @return {ActionModel} Instance of action model.\n */\n mapSideEffects (map) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n firebolt.mapSideEffects(map);\n }, (canvas) => {\n canvas.firebolt().mapSideEffects(map);\n });\n return this;\n }\n\n /**\n * Registers the side effects on the registered canvases. It takes definitions of side effects and registers them\n * on the canvases. Every side effect must inherit the base class {@link GenericSideEffect} or\n * {@link SpawnableSideEffect} or {@link SurrogateSideEffect} class.\n *\n * ```\n * // Define a custom side effect\n * class InfoBox extends SpawnableSideEffect {\n * static formalName () {\n * return 'infoBox';\n * }\n *\n * apply (selectionSet) {\n * }\n * }\n * muze.ActionModel.registerSideEffects(InfoBox);\n * ```\n * @public\n * @param {GenericSideEffect} sideEffects Definition of side effects.\n *\n * @return {ActionModel} Instance of action model.\n */\n registerSideEffects (...sideEffects) {\n registerActions(this, 'sideEffects', 'registerSideEffects', sideEffects);\n return this;\n }\n\n /**\n * Breaks the link between behavioural actions and physical actions. It takes an array of behavioural action\n * and it's physical action.\n *\n * To dissociate behavioural actions from physical actions\n * ```\n * muze.ActionModel.dissociateBehaviour(['select', 'click'], ['highlight', 'hover']);\n * ```\n * @public\n * @param {Array} maps Array of behavioural action and physical action.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateBehaviour (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateBehaviour(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateBehaviour(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * Breaks the link between side effects and behavioural actions. It takes an array of formal names of the side\n * effects and it's linked behavioural action.\n *\n * To dissociate side effects from behavioural actions\n * ```\n * muze.ActionModel.dissociateSideEffect(['crossline', 'highlight'], ['selectionBox', 'brush']);\n * ```\n * @public\n * @param {Array} maps Array of side effects and behavioural actions.\n *\n * @return {ActionModel} Instance of action model.\n */\n dissociateSideEffect (...maps) {\n canvasIterator(this._registrableComponents, (firebolt) => {\n maps.forEach(val => firebolt.dissociateSideEffect(val[0], val[1]));\n }, (canvas) => {\n maps.forEach(val => canvas.firebolt().dissociateSideEffect(val[0], val[1]));\n });\n return this;\n }\n\n /**\n * By default cross interactivity is disabled between canvases. This enables cross interaction between the canvases\n * so that any action happening in one canvas gets dispatched on other canvases as well. An optional policy can also\n * be passed in this method. The policy can be used to control on which canvases the behavioural actions and\n * side effects gets dispatched.\n *\n * To just enable cross interactivity between two canvases,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity();\n * ```\n *\n * To enable cross interactivity but enable any behavioural action only when it is triggered from canvas1.\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * behaviours: {\n * // Here * stands for any behavioural action name. We can also give any name of behavioural action\n * // in place of this.\n * '*': (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n *\n * To enable cross interactivity but enable tooltip effect if the action is propagated from canvas1,\n * ```\n * ActionModel.for(canvas1, canvas2)\n * .enableCrossInteractivity({\n * sideEffects: {\n * tooltip: (propPayload, context) => {\n * return propPayload.sourceCanvas === canvas1.alias();\n * }\n * }\n * });\n * ```\n * @public\n * @param {Object} policy Policy definition.\n *\n * @return {ActionModel} Instance of action model.\n */\n enableCrossInteractivity (policy = {}) {\n const registrableComponents = this._registrableComponents;\n const mergedPolicy = mergeRecursive(mergeRecursive({}, defaultPolicy(registrableComponents)), policy);\n\n registrableComponents.forEach((canvas) => {\n canvas.firebolt().crossInteractionPolicy(mergedPolicy);\n });\n\n return this;\n }\n}\n\nexport const actionModel = (() => new ActionModel())();\n","import { MUZE_PREFIX } from '../constants';\n\nexport const TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 4,\n className: `${MUZE_PREFIX}-title-container`\n};\n\nexport const SUB_TITLE_CONFIG = {\n position: 'top',\n align: 'left',\n padding: 16,\n maxLines: 2,\n className: `${MUZE_PREFIX}-subtitle-container`\n};\n\nexport const MESSAGE_CONFIG = {\n className: `${MUZE_PREFIX}-message-container`,\n baseFontLimit: 16,\n upperFontLimit: 24,\n baseSizeLimit: 100,\n upperSizeLimit: 300,\n fractionImage: 0.8,\n fractionChild: 0.7\n};\n\nexport const CANVAS = 'canvas';\n","import { mergeRecursive } from 'muze-utils';\nimport {\n ROWS,\n COLUMNS,\n COLOR,\n SHAPE,\n SIZE,\n DETAIL,\n LAYERS,\n TRANSFORM,\n TITLE,\n SUB_TITLE\n} from '../constants';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG } from './defaults';\n/**\n * This is the local options semantics based on which setters getters are created and reactivity is initiated.\n * This local object is only valid for Canvas.\n * Canvas merges global and local object both to the model\n *\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n *\n * @module LocalOptions\n */\n\nexport const localOptions = {\n [ROWS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLUMNS]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [COLOR]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SHAPE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [SIZE]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n sanitization: (config) => {\n if (typeof config === 'string' || !config) {\n return {\n field: config\n };\n }\n return config;\n }\n }\n },\n [DETAIL]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n\n [LAYERS]: {\n value: [],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Array'\n }\n },\n [TRANSFORM]: {\n value: null,\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object'\n }\n }\n};\n\nexport const canvasOptions = {\n [TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([title, titleConfig]) => {\n let t = title;\n if (typeof title === 'string' || !title) {\n t = () => title;\n }\n const defConfig = mergeRecursive({}, TITLE_CONFIG);\n return [t, mergeRecursive(defConfig, titleConfig)];\n }\n }\n },\n [SUB_TITLE]: {\n value: [null, null],\n meta: {\n takesMultipleParams: true,\n typeCheck: ([arg1, arg2]) => typeof arg1 === 'function' && typeof arg2 === 'object',\n sanitization: ([subtitle, subtitleConfig]) => {\n let sub = subtitle;\n if (typeof subtitle === 'string' || !subtitle) {\n sub = () => subtitle;\n }\n const defConfig = mergeRecursive({}, SUB_TITLE_CONFIG);\n return [sub, mergeRecursive(defConfig, subtitleConfig)];\n }\n }\n }\n};\n","export default class LayoutComponent {\n constructor (name, dimensions, seed) {\n this._seed = seed;\n this._boundBox = {\n height: dimensions.height,\n width: dimensions.width,\n top: null,\n left: null\n };\n this._renderAt = null;\n this._alignWith = null;\n this._alignment = null;\n this._target = null;\n this._position = null;\n this._componentName = name;\n this._className = null;\n }\n\n getLogicalSpace () {\n throw new Error('getLogicalSpace is not defined');\n }\n\n setSpatialConfig () {\n throw new Error('setSpatialSpace is not defined');\n }\n\n name (param) {\n if (param) {\n this._componentName = param;\n }\n return this._componentName;\n }\n\n target (param) {\n if (param) {\n this._target = param;\n }\n return this._target;\n }\n\n position (param) {\n if (param) {\n this._position = param;\n }\n return this._position;\n }\n\n alignment (param) {\n if (param) {\n this._alignment = param;\n }\n return this._alignment;\n }\n\n alignWith (param) {\n if (param) {\n this._alignWith = param;\n }\n return this._alignWith;\n }\n\n renderAt (param) {\n if (param) {\n this._renderAt = param;\n }\n return this._renderAt;\n }\n\n boundBox (param) {\n if (param) {\n Object.assign(this._boundBox, param);\n }\n return this._boundBox;\n }\n\n className (param) {\n if (param) {\n this._className = param;\n }\n return this._className;\n }\n\n draw () {\n throw new Error('draw is not defined');\n }\n\n attachListener () {\n return this;\n }\n }\n\n","import LayoutComponent from './layoutComponent';\n\nclass DummyComponent extends LayoutComponent {\n getLogicalSpace () {\n return {\n width: this.boundBox().width,\n height: this.boundBox().height\n };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n return this;\n }\n\n draw () {\n if (!this.component) {\n throw new Error(`Component not set for ${this.componentName}`);\n }\n this.component.mount(document.getElementById(this.renderAt)); // Change the draw method to component draw\n return this;\n }\n}\n\nexport default DummyComponent;\n","import { COMMON_INTERACTION } from './constants';\n\nexport const DEFAULT_CONFIG = {\n classPrefix: 'muze',\n interaction: {\n sideEffects: {\n tooltip: COMMON_INTERACTION\n },\n behaviours: {\n highlight: COMMON_INTERACTION,\n select: COMMON_INTERACTION,\n brush: COMMON_INTERACTION\n },\n tooltip: {\n\n }\n },\n pagination: 'scroll',\n scrollBar: {\n thickness: 10,\n speed: 2,\n vertical: {\n align: 'right'\n },\n horizontal: {\n align: 'bottom'\n }\n },\n legend: {\n position: 'right',\n color: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n shape: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n },\n size: {\n show: true,\n padding: 1,\n margin: 3,\n border: 1,\n height: 20,\n width: 20\n }\n },\n showHeaders: false,\n minWidth: 100,\n minHeight: 100,\n facet: {\n rows: {\n minCharacters: 3\n },\n columns: {\n maxLines: 2,\n verticalAlign: 'middle',\n minCharacters: 1\n }\n },\n border: {\n style: 'solid',\n color: '#d6d6d6',\n width: 2,\n collapse: true,\n spacing: 0\n },\n autoGroupBy: {\n disabled: false\n },\n invalidValues: {},\n sort: {}\n};\n","import { DEFAULT_CONFIG } from '../../../../muze/src/defaults';\n\nconst DEFAULT_WIDTH = 600;\nconst DEFAULT_HEIGHT = 400;\nconst DEFAULT_CLASS_NAME = `${DEFAULT_CONFIG.classPrefix}-layout-container-component`;\nconst NODE_PREFIX = `${DEFAULT_CONFIG.classPrefix}-layout-container`;\n\nexport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT,\n DEFAULT_CLASS_NAME,\n NODE_PREFIX\n};\n","export default class DefinitionModel {\n constructor (config) {\n this._host = config.host || null;\n this._cut = config.cut || null;\n this._ratioWeight = config.ratioWeight === 0 ? 0 : config.ratioWeight || 1;\n this._preferred = config.preferred || false;\n this._lanes = config.lanes || [];\n this._remainingHeight = 0;\n this._remainingWidth = 0;\n }\n\n host (host) {\n if (host) {\n this._host = host;\n }\n return this._host;\n }\n\n preferred (preferred) {\n if (preferred) {\n this._preferred = preferred;\n }\n return this._preferred;\n }\n\n cut (cut) {\n if (cut) {\n this._cut = cut;\n }\n return this._cut;\n }\n\n ratioWeight (ratioWeight) {\n if (ratioWeight) {\n this._ratioWeight = ratioWeight;\n }\n return this._ratioWeight;\n }\n\n lanes (lanes) {\n if (lanes) {\n this._lanes = lanes;\n }\n return this._lanes;\n }\n\n remainingHeight (remainingHeight) {\n if (remainingHeight) {\n this._remainingHeight = remainingHeight;\n }\n return this._remainingHeight;\n }\n\n remainingWidth (remainingWidth) {\n if (remainingWidth) {\n this._remainingWidth = remainingWidth;\n }\n return this._remainingWidth;\n }\n}\n","import { NODE_PREFIX } from '../../constants/defaults';\nimport DefinitionModel from '../definition-manager/definitionModel';\nimport DummyComponent from '../../layout-component/dummy-component';\n/**\n * Compares two strings in lowercase\n *\n * @export\n * @param {string} value the value to be compared\n * @param {string} compareTo whom the value would be compared\n * @return {boolean} true if values are equal\n */\nexport function isEqual (value, compareTo) {\n if (typeof value !== 'string' || typeof compareTo !== 'string') {\n throw new TypeError('value and compareTo must be string');\n }\n return value.toLowerCase() === compareTo.toLowerCase();\n}\n\nexport const getNodeId = (() => {\n let _uid = 0;\n return () => `${NODE_PREFIX}-${++_uid}`;\n})();\n\nexport function yExtraSpace (node) {\n let smallestHeight = 0;\n if (node.getCutType() === 'v') {\n smallestHeight = smallestExtraHeightHorizontally(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'h') {\n node.children().forEach((child) => {\n smallestHeight += yExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerHeight = node.boundBox().height;\n const hostHeight = node.model().host().getLogicalSpace().height;\n\n smallestHeight = containerHeight - hostHeight;\n if (smallestHeight < 0) {\n smallestHeight = 0;\n }\n } else {\n smallestHeight = 0;\n }\n return smallestHeight;\n}\n\nexport function smallestExtraHeightHorizontally (node) {\n let smallestHeight = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const h = yExtraSpace(child);\n if (h < smallestHeight) {\n smallestHeight = h;\n }\n });\n return smallestHeight;\n}\n\nexport function xExtraSpace (node) {\n let smallestWidth = 0;\n if (node.getCutType() === 'h') {\n smallestWidth = smallestExtraWidthVertically(node); // eslint-disable-line no-use-before-define\n } else if (node.getCutType() === 'v') {\n node.children().forEach((child) => {\n smallestWidth += xExtraSpace(child);\n });\n } else if (node.model().host() && node.model().host().getLogicalSpace) {\n const containerWidth = node.boundBox().width;\n const hostWidth = node.model().host().getLogicalSpace().width;\n smallestWidth = containerWidth - hostWidth;\n if (smallestWidth < 0) {\n smallestWidth = 0;\n }\n } else {\n smallestWidth = 0;\n }\n return smallestWidth;\n}\n\nexport function smallestExtraWidthVertically (node) {\n let smallestWidth = Number.MAX_SAFE_INTEGER;\n node.children().forEach((child) => {\n const w = xExtraSpace(child);\n if (w < smallestWidth) {\n smallestWidth = w;\n }\n });\n return smallestWidth;\n}\n\nexport function determineBoundBox (bb, i, arr, instance) {\n if (i) {\n // if not first sibling, take boundbox from previous sibling\n const lastSibling = arr[i - 1];\n const { top: _top, left: _left, height: _height, width: _width } = lastSibling.boundBox();\n return {\n width: bb.width,\n height: bb.height,\n\n top: instance.parentCut() === 'h'\n ? _top + _height : _top,\n\n left: instance.parentCut() === 'h'\n ? _left : _left + _width\n };\n }\n // if first sibling, take boundbox from parent\n const { top: _top, left: _left } = instance.parent().boundBox();\n return {\n width: bb.width,\n height: bb.height,\n top: _top,\n left: _left\n };\n}\n\n// prepares the targetComponent Map for target Mapping ie. where a component should lie\nexport function prepareTargetComponentMap (context) {\n context.targetComponentMap(new Map());\n context.componentMap().forEach((value) => {\n if (context.targetComponentMap().has(value.target())) {\n context.targetComponentMap().get(value.target()).push(value);\n } else {\n const temp = [];\n temp.push(value);\n context.targetComponentMap().set(value.target(), temp);\n }\n });\n}\n\nexport function getComponent (canvasComponent, componentName) {\n const comp = canvasComponent.find(component => component.name() === componentName);\n return (comp && comp !== -1) ? comp : null;\n}\nexport function createPlaceHolderComponent (height, width, position) {\n const comp = new DummyComponent(0, { height, width });\n comp.name('placeHolder');\n comp.position(position);\n return comp;\n}\n\nexport function placeComponent (definitionModel, component, isPreferred = false, isGridComponent = false) {\n let cut = '';\n let componentRatioWidth = 1;\n let leftOvercomponentRationWidth = 1;\n let leftHeight = 0;\n let leftWidth = 0;\n\n if (!component) {\n return { first: definitionModel, second: definitionModel };\n }\n\n const { height: componentHeight, width: componentWidth } = component.getLogicalSpace();\n const position = component.position();\n if (position === 'top' || position === 'bottom') {\n cut = 'h';\n componentRatioWidth = componentHeight / definitionModel.remainingHeight();\n leftHeight = definitionModel.remainingHeight() - componentHeight;\n leftWidth = definitionModel.remainingWidth();\n } else {\n cut = 'v';\n componentRatioWidth = componentWidth / definitionModel.remainingWidth();\n leftWidth = definitionModel.remainingWidth() - componentWidth;\n leftHeight = definitionModel.remainingHeight();\n }\n leftOvercomponentRationWidth = 1 - componentRatioWidth;\n\n// update parentModel\n definitionModel.cut(cut);\n const firstLaneConfig = {\n host: component.name(),\n cut: null,\n ratioWeight: componentRatioWidth,\n preferred: isGridComponent ? false : isPreferred,\n lanes: []\n };\n const firstLane = new DefinitionModel(firstLaneConfig);\n firstLane.remainingHeight(componentHeight);\n firstLane.remainingWidth(componentWidth);\n\n const secondLaneConfig = {\n host: null,\n cut: null,\n ratioWeight: leftOvercomponentRationWidth,\n preferred: isGridComponent ? false : !isPreferred,\n lanes: []\n };\n const secondLane = new DefinitionModel(secondLaneConfig);\n secondLane.remainingHeight(leftHeight);\n secondLane.remainingWidth(leftWidth);\n if (isPreferred) {\n definitionModel.lanes([firstLane]);\n } else if (position === 'top' || position === 'left') {\n definitionModel.lanes([firstLane, secondLane]);\n } else {\n definitionModel.lanes([secondLane, firstLane]);\n }\n return { first: firstLane, second: secondLane };\n}\n\nexport function placeGridComponent (definitionModel, gridComponents) {\n let tempDefModel = definitionModel;\n const rows = gridComponents.length;\n const column = rows ? gridComponents[0].length : 0;\n const height = gridComponents.reduce((acc, val) => (acc + val[0].getLogicalSpace().height), 0);\n\n for (let i = 0; i < column; i++) {\n const iscolumnPreffered = i === column - 1;\n const columnPlaceHolderComponent = createPlaceHolderComponent(height,\n gridComponents[0][i].getLogicalSpace().width, 'left');\n const { first, second } = placeComponent(tempDefModel, columnPlaceHolderComponent, iscolumnPreffered);\n tempDefModel = first;\n for (let j = 0; j < rows; j++) {\n const rowpreffred = j === (rows - 1);\n tempDefModel = placeComponent(tempDefModel, gridComponents[j][i], rowpreffred, true).second;\n }\n tempDefModel = second;\n }\n return tempDefModel;\n}\n\nexport function negotiateDimension (node) {\n let preferred;\n let cumultiveExtraSpaceAmt = 0;\n let alteredDim;\n let nonAlteredDim;\n\n const childrenLength = node.children().length;\n\n for (let index = 0; index < childrenLength; index++) {\n let fn;\n let extraSpaceAmt;\n const child = node.children()[index];\n\n if (child.parentCut() === 'h') {\n fn = yExtraSpace;\n alteredDim = 'height';\n nonAlteredDim = 'width';\n } else {\n fn = xExtraSpace;\n alteredDim = 'width';\n nonAlteredDim = 'height';\n }\n // if vertical then get extra height from other node and push it to the preferred node.\n // for horizontal cut the same thing is to be done with width\n if (child.isPreferred()) {\n // push extra space in sink. Execute it when all non preferred space are computed.\n preferred = child;\n\n continue; // eslint-disable-line no-continue\n }\n // reduce own height and save it in a var\n cumultiveExtraSpaceAmt += (extraSpaceAmt = fn(child));\n child.boundBox()[alteredDim] -= extraSpaceAmt;\n // update nonaltered dim from parent for any change which happened during negotiation\n child.boundBox()[nonAlteredDim] = child.parent().boundBox()[nonAlteredDim];\n\n negotiateDimension(child);\n }\n\n if (preferred) {\n preferred.boundBox()[alteredDim] += cumultiveExtraSpaceAmt;\n preferred.boundBox()[nonAlteredDim] = preferred.parent().boundBox()[nonAlteredDim];\n negotiateDimension(preferred);\n }\n}\n\nexport function computePosition (node) {\n node.children().forEach((child, i, children) => {\n const boundBox = determineBoundBox(child.boundBox(), i, children, child);\n child.boundBox(boundBox);\n computePosition(child);\n });\n}\n\nexport function allocateBoundingBox (node) {\n const totalWeight = node.children()\n .map(child => child.model().ratioWeight())\n .reduce((carry, val) => carry + val, 0);\n\n node.children().forEach((child, i, children) => {\n const lastSibling = children[i - 1];\n const ratio = child.model().ratioWeight() / totalWeight;\n\n if (child.parentCut() === 'h') {\n child.boundBox({\n top: i ? lastSibling.boundBox().top + lastSibling.boundBox().height : 0,\n left: child.parent().boundBox().left,\n height: child.parent().boundBox().height * ratio,\n width: child.parent().boundBox().width\n });\n } else {\n child.boundBox({\n top: child.parent().boundBox().top,\n left: i ? lastSibling.boundBox().left + lastSibling.boundBox().width : 0,\n height: child.parent().boundBox().height,\n width: child.parent().boundBox().width * ratio\n });\n }\n allocateBoundingBox(child);\n });\n}\n\n","import { getNodeId } from '../helper';\nimport { LayoutComponent } from '../../layout-component';\n\nclass Node {\n constructor (data) {\n this._model = data;\n this._parent = null;\n this._children = [];\n this._parentCut = null;\n this._boundBox = {\n top: null,\n left: null,\n height: null,\n width: null\n };\n\n this._id = this._model.host() instanceof LayoutComponent && this._model.host().renderAt() ?\n this._model.host().renderAt() :\n getNodeId();\n }\n\n addChildren (entries) {\n this._children.push(...entries);\n entries.forEach((e) => { e.parent(this); });\n }\n\n isRoot () {\n return this._parent === null;\n }\n\n isLeaf () {\n return !this._children.length;\n }\n\n getCutType () {\n return this._model.cut();\n }\n\n isPreferred () {\n return !!this._model.preferred();\n }\n\n children (children) {\n if (children) {\n this._children = children;\n }\n return this._children;\n }\n\n parent (parent) {\n if (parent) {\n this._parent = parent;\n }\n return this._parent;\n }\n\n parentCut (parentCut) {\n if (parentCut) {\n this._parentCut = parentCut;\n }\n return this._parentCut;\n }\n\n id (id) {\n if (id) {\n this._id = id;\n }\n return this._id;\n }\n\n model (model) {\n if (model) {\n this._model = model;\n }\n return this._model;\n }\n\n boundBox (bound) {\n if (bound) {\n this._boundBox = {\n top: bound.top,\n left: bound.left,\n height: bound.height,\n width: bound.width\n };\n }\n return this._boundBox;\n }\n /**\n * function to search a node and update it with the config provided.\n * @param {Object} nodeconfig\n */\n updateNode (nodeconfig) {\n if (this._id === nodeconfig._id) {\n this._model.cut(nodeconfig.cut);\n this._model.ratioWeight(nodeconfig.ratioWeight);\n } else {\n this._children.forEach((node) => {\n if (node._id === nodeconfig._id) {\n node.model.cut(nodeconfig.cut);\n node.model.ratioWeight(nodeconfig.ratioWeight);\n return;\n }\n this.searchNode(node, nodeconfig);\n });\n }\n }\n\n // Recursive function to search a node\n searchNode (node, nodeconfig) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeconfig._id) {\n childNode.model().cut(nodeconfig.cut);\n childNode.model().ratioWeight(nodeconfig.ratioWeight);\n } else {\n this.searchNode(childNode, nodeconfig);\n }\n });\n }\n\n /**\n * function to delete a node from tree Structure.\n * @param {String} nodeId - node Id of the Node\n */\n delete (nodeId) {\n this._children.forEach((node) => {\n if (node.id() === nodeId) {\n const index = this._children.indexOf(node);\n this._model.lanes().splice(index, 1);\n }\n this.deleteSearchNode(node, nodeId);\n });\n }\n\n // Recursive function to search a node\n deleteSearchNode (node, nodeId) {\n node.children().forEach((childNode) => {\n if (childNode.id() === nodeId) {\n const index = node.children().indexOf(childNode);\n node.model().lanes().splice(index, 1);\n } else {\n this.deleteSearchNode(childNode, nodeId);\n }\n });\n }\n}\n\nexport default Node;\n","import Node from '../tree';\nimport {\n allocateBoundingBox,\n negotiateDimension,\n computePosition\n} from '../helper';\n\nexport default class LayoutModel {\n constructor (measurements, config) {\n this._measurements = measurements;\n this._config = config;\n this._root = this.createTree(this._config, null);\n this.setBoundBox();\n }\n\n createTree (config, parent) {\n const node = new Node(config);\n if (parent) {\n node.parentCut(parent.getCutType());\n parent.addChildren([node]);\n } else {\n this._root = node;\n }\n for (const lane of config.lanes()) {\n this.createTree(lane, node);\n }\n\n return this._root;\n }\n\n setBoundBox () {\n this._root.boundBox({\n top: 0,\n left: 0,\n width: this._measurements.width,\n height: this._measurements.height\n });\n allocateBoundingBox(this._root);\n }\n\n setHostPosition (node) {\n node.children().forEach((child) => {\n LayoutModel.setHostSpatialConfig(child);\n this.setHostPosition(child);\n });\n }\n\n static setHostSpatialConfig (node) {\n const bb = node.boundBox();\n const host = node.model().host();\n if (host && host.setSpatialConfig) {\n const conf = {\n x: bb.left,\n y: bb.top,\n width: bb.width,\n height: bb.height,\n renderAt: node.id()\n };\n host.setSpatialConfig(conf);\n }\n }\n\n negotiate () {\n negotiateDimension(this._root);\n computePosition(this._root);\n return this;\n }\n\n broadcast () {\n this.setHostPosition(this._root);\n return this;\n }\n\n tree () {\n return this._root;\n }\n}\n","/**\n * This file exports constants that will be used to\n * create the state store of the table layout.\n */\n/**\n * The index of top, bottom and center in the matrix\n */\nexport const VIEW_INDEX = {\n top: 0,\n center: 1,\n bottom: 2\n};\n\nexport const ROW_MATRIX_INDEX = {\n 0: 'top',\n 1: 'center',\n 2: 'bottom'\n};\n\nexport const COLUMN_MATRIX_INDEX = {\n 0: 'left',\n 1: 'middle',\n 2: 'right'\n};\n\n/**\n * The width of the grid suppied by the user.\n */\nexport const GRID_WIDTH = 'width';\n\n/**\n * The height of the grid supplied by the user.\n */\nexport const GRID_HEIGHT = 'height';\n\n/**\n * The border for the grid\n */\nexport const BORDER = 'border';\n\n /**\n * The index of the first visible row in view matrix.\n */\nexport const ROW_POINTER = 'rowPointer';\n\n/**\n * The index of the first visible column in the view matrix.\n */\nexport const COLUMN_POINTER = 'columnPointer';\n\n/**\n * Flag to specify whether row sizes should be equal.\n */\nexport const ROW_SIZE_IS_EQUAL = 'isRowSizeEqual';\n\n/**\n * Flag to specify whether column sizes are equal.\n */\nexport const COLUMN_SIZE_IS_EQUAL = 'isColumnSizeEqual';\n\n/**\n * Field to store an array an of the widths of visible columns.\n * @computed\n */\nexport const COLUMN_WIDTHS = 'visibleColumnWidths';\n\n/**\n * Field to store an array of heights of visible rows.\n * @computed\n */\nexport const ROW_HEIGHTS = 'visibleRowHeights';\n\n/**\n * Field to store the width of the left matrix.\n * @computed\n */\nexport const LEFT_MATRIX_WIDTH = 'leftMatrixWidth';\n\n/**\n * Field to store the width of the right matrix.\n * @computed\n */\nexport const RIGHT_MATRIX_WIDTH = 'rightMatrixWidth';\n\n/**\n * Field to store the height of the top matrix.\n * @computed\n */\nexport const TOP_MATRIX_HEIGHT = 'topMatrixHeight';\n\n/**\n * Field to store the height of the bottom matrix.\n * @computed\n */\nexport const BOTTOM_MATRIX_HEIGHT = 'bottomMatrixHeight';\n\n/**\n * The dom element to render the layout inside.\n */\nexport const MOUNT_POINT = 'mount';\n\n/**\n * The id attribute of the left table element.\n */\nexport const LEFT_TABLE_ID = 'grid-left';\n\n/**\n * The id attribute of the right table element.\n */\nexport const RIGHT_TABLE_ID = 'grid-right';\n\n/**\n * The id attribute of the top table.\n */\nexport const TOP_TABLE_ID = 'grid-top';\n\n/**\n * The id attribute of the bottom table.\n */\nexport const BOTTOM_TABLE_ID = 'grid-bottom';\n\n/**\n * The id attribute of the center table.\n */\nexport const CENTER_TABLE_ID = 'grid-center';\n\n/**\n * The id attribute of the top div.\n */\nexport const TOP_DIV_ID = 'muze-div-top';\n\n/**\n * The id attribute of the bottom div.\n */\nexport const BOTTOM_DIV_ID = 'muze-div-bottom';\n\n/**\n * The id attribute of the center div.\n */\nexport const CENTER_DIV_ID = 'muze-div-center';\n\n/**\n * Field that indicates if the row configuration has changed\n */\nexport const HAVE_ROWS_CHANGED = 'haveRowsChanged';\n\n/**\n * Field that indicates if the column configuration has changed\n */\nexport const HAVE_COLUMNS_CHANGED = 'haveColumnsChanged';\n\n/**\n * Field that indicates if the values configuration for the center matrix has changed\n */\nexport const HAVE_VALUES_CHANGED = 'haveValuesChanged';\n\n/**\n * Field that indicates the width of row matrix\n */\nexport const ROW_MATRIX_WIDTH = 'rowMatrixWidth';\n\n/**\n * Field that indicates the height of row matrix\n */\nexport const COLUMN_MATRIX_HEIGHT = 'columnMatrixHeight';\n\n/**\n * Field that indicates the unit width of layout\n */\nexport const UNIT_WIDTH = 'unitWidth';\n\n/**\n * Field that indicates the unit height of layout\n */\nexport const UNIT_HEIGHT = 'unitHeight';\n\n/**\n * Field that indicates the style object\n */\nexport const STYLE = 'style';\n\n/**\n * Field that indicates the color configuration\n */\nexport const COLOR = 'color';\n\n/**\n * Field that indicates width\n */\nexport const WIDTH = 'width';\n\n/**\n * Field that indicates collpase property for border\n */\nexport const COLLAPSE = 'collapse';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SPACING = 'spacing';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const DISTRIBUTION = 'distribution';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const GUTTERSPACE = 'gutterSpace';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const BREAK_PAGE = 'breakPage';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_ROW_BORDERS = 'showRowBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_COL_BORDERS = 'showColBorders';\n\n/**\n * Field that indicates spacing property for border\n */\nexport const SHOW_VALUE_BORDERS = 'showValueBorders';\n\nexport const HEIGHT = 'height';\nexport const COLUMN = 'column';\nexport const ROW = 'row';\nexport const TOP = 'top';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const CENTER = 'center';\nexport const CLICK = 'click';\nexport const ROW_LEFT = 'rowLeft';\nexport const ROW_RIGHT = 'rowRight';\nexport const COLUMN_BOTTOM = 'colBottom';\nexport const COLUMN_TOP = 'colTop';\nexport const AUTO = 'auto';\nexport const ROW_SPAN = 'rowSpan';\nexport const COL_SPAN = 'colSpan';\nexport const ROW_ROOT = 'rowRoot';\nexport const COLUMN_ROOT = 'columnRoot';\nexport const PRIMARY = 'primary';\nexport const SECONDARY = 'secondary';\nexport const VERTICAL = 'vertical';\nexport const HORIZONTAL = 'horizontal';\nexport const GRID = 'grid';\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n\nexport const PAGINATION = 'pagination';\nexport const BUFFER = 'buffer';\nexport const HOLISTIC = 'holistic';\nexport const SCROLL = 'scroll';\nexport const MIDDLE = 'middle';\nexport const NO_BORDERS = null;\n\nexport const MAX_WIDTH_AVAIL_FOR_COL_MATRIX = 'maxWidthAvailableForColumnMatrix';\nexport const COLUMN_MATRIX = 'columnMatrix';\nexport const MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX = 'maxHeightAvailableForRowMatrix';\nexport const ROW_MATRIX = 'rowMatrix';\n","/* eslint no-undef: \"off\" */\n/* eslint default-case: \"off\" */\nexport class Utils {\n static isDOMElement (element) {\n return element instanceof Element;\n }\n\n static getID (element) {\n return element.id;\n }\n\n static getElement (id) {\n return document.getElementById(id);\n }\n\n static findContainer (data) {\n return data.filter(coordinate => coordinate.parent == null)[0];\n }\n /**\n * static method to remove the div\n * @param {} divId - div ID to be removed.\n */\n static removeDiv (divId) {\n if (document.getElementById(divId) !== null) { document.getElementById(divId).remove(); }\n }\n}\n","import { DEFAULT_CLASS_NAME } from '../constants/defaults';\nimport { LayoutComponent } from '../layout-component';\n\nexport default class DataPoint {\n constructor (node) {\n this._node = node;\n this._className = node.model().host() instanceof LayoutComponent ?\n node.model().host().className() : DEFAULT_CLASS_NAME;\n }\n\n node () {\n return this._node;\n }\n\n hasHost () {\n return this._node.model().host() instanceof LayoutComponent;\n }\n\n className () {\n return this._className || DEFAULT_CLASS_NAME;\n }\n}\n","import { getnodePoints } from './helper';\n\nexport class DataParser {\n constructor (data) {\n this._data = data;\n }\n\n defaultDataPointLogic () {\n const nodepoints = [];\n getnodePoints(this._data, nodepoints);\n return nodepoints;\n }\n\n}\n","import DataPoint from './data-point';\n\nexport const getnodePoints = (node, nodepoints) => {\n const datapoint = new DataPoint(node);\n nodepoints.push(datapoint);\n node.children().forEach((child) => {\n getnodePoints(child, nodepoints);\n });\n};\n","import { DataParser } from './data-parser';\n\nexport class HTMLDataAdapter extends DataParser {\n getCoordinates () {\n return super.defaultDataPointLogic();\n }\n}\n","export class Renderer {\n\n initRenderer (node, tree) {\n node.__logicalTree = tree;\n }\n}\n","import { HTMLDataAdapter } from '../data-adapters/html-data';\nimport { Utils } from '../utils';\nimport { Renderer } from './renderer';\n\nexport class HTMLRenderer extends Renderer {\n constructor (data) {\n super();\n this._data = data;\n this._coordinates = new HTMLDataAdapter(this._data).getCoordinates();\n }\n\n createhtml (mount, className) {\n const mainDiv = mount;\n super.initRenderer(mainDiv, this._data); // Initialise node with layout id\n this.parentDiv = this.createAndCustomiseParent(className);\n this._coordinates.forEach((node) => {\n if (node.hasHost()) {\n const host = node.node();\n this.parentDiv.appendChild(this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: node.className() }));\n }\n });\n mainDiv.appendChild(this.parentDiv);\n }\n\n createAndPositionDiv (config) {\n const { top, left, height, width, className, id } = config;\n const existingDiv = document.getElementById(id);\n const div = existingDiv || document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = `${left}px`;\n div.style.top = `${top}px`;\n div.style.height = `${height}px`;\n div.style.width = `${width}px`;\n div.id = id;\n div.className = className;\n return div;\n }\n\n createAndCustomiseParent (className) {\n const container = Utils.findContainer(this._coordinates);\n const host = container.node();\n const parentDiv = this.createAndPositionDiv({ ...host.boundBox(),\n id: host.id(),\n className: container.className() });\n parentDiv.className = className;\n parentDiv.style.position = 'relative';\n return parentDiv;\n }\n\n coordinates () {\n return this._coordinates;\n }\n}\n","import { selectElement } from 'muze-utils';\nimport { HTMLRenderer } from '../renderers/html-renderer';\nimport { LayoutComponent } from '../layout-component';\n\nexport const getChildNode = (context, config) =>\n context.renderer().createAndPositionDiv(config);\n\nexport const findNode = (context, nodeID) =>\n context.renderer().coordinates().find(point => point.node().id() === nodeID);\n\nexport const renderHTML = (context) => {\n context.renderer(new HTMLRenderer(context.data()));\n context.renderer().createhtml(context.mount(), context.className());\n};\n\nexport const drawLayout = context => renderHTML(context);\n\nexport const drawComponent = (componentData) => {\n componentData.children().forEach((node) => {\n const host = node.model().host();\n if (host instanceof LayoutComponent) {\n host.draw();\n }\n drawComponent(node);\n });\n};\n\nexport const removeElement = (elemID) => {\n if (elemID) {\n selectElement(`#${elemID}`).remove();\n }\n};\n\nconst setAlignConfig = (alignment, params) => {\n let newNodeConfig = {};\n const { node, refNode } = params;\n switch (alignment) {\n case 'left':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(refNode.left - node.left))\n };\n break;\n\n case 'right':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: node.height,\n width: Math.abs(node.width - Math.abs(node.left + node.width - (refNode.left + refNode.width)))\n };\n break;\n\n case 'top':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: Math.abs(node.height - Math.abs(refNode.top - node.top)),\n width: node.width\n };\n break;\n\n case 'bottom':\n newNodeConfig = {\n top: node.top,\n left: node.left,\n height: Math.abs(node.top - refNode.top + refNode.height),\n width: node.width\n };\n break;\n\n case 'h-center':\n newNodeConfig = {\n top: node.top,\n left: refNode.left,\n height: node.height,\n width: refNode.width\n };\n break;\n\n case 'v-center':\n newNodeConfig = {\n top: refNode.top,\n left: node.left,\n height: refNode.top,\n width: node.width\n };\n break;\n default:\n break;\n }\n return newNodeConfig;\n};\n\nexport const resolveAligment = (context, componentData) => {\n componentData.children().forEach((component) => {\n const host = component.model().host();\n\n if (host instanceof LayoutComponent && host.alignWith()) {\n const componentToAlign = context.componentMap().get(host.alignWith());\n\n if (componentToAlign) {\n const point = findNode(context, component.id()).node();\n const node = point.boundBox();\n const refNode = findNode(context, componentToAlign.renderAt())\n .node()\n .boundBox();\n const newNodeConfig = setAlignConfig(host.alignment(), { node, refNode });\n\n // check if model in parent component\n Object.assign(newNodeConfig, { id: point.id(), className: host.className() });\n context.renderer().createAndPositionDiv(newNodeConfig);\n context.componentMap().get(host.name()).setSpatialConfig({\n x: newNodeConfig.left,\n y: newNodeConfig.top,\n height: newNodeConfig.height,\n width: newNodeConfig.width\n\n });\n }\n }\n\n resolveAligment(context, component);\n });\n};\n","import { Utils } from '../utils';\nimport { drawLayout, resolveAligment, drawComponent } from './helper';\n\nexport class DrawingManager {\n constructor (data, renderer, container) {\n this._data = data.tree;\n this._componentMap = data.componentMap;\n this._layoutClassName = data.layoutClassName;\n this._renderer = renderer;\n this._mount = Utils.isDOMElement(container) ? container : Utils.getElement(container);\n }\n\n draw () {\n drawLayout(this);\n resolveAligment(this, this._data);\n drawComponent(this._data);\n return this;\n }\n\n data (data) {\n if (data) {\n this._data = data;\n }\n return this._data;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n className (param) {\n if (param) {\n this._layoutClassName = param;\n }\n return this._layoutClassName;\n }\n\n renderer (param) {\n if (param) {\n this._renderer = param;\n }\n return this._renderer;\n }\n\n mount (param) {\n if (param) {\n this._mount = param;\n }\n return this._mount;\n }\n}\n","import DefinitionModel from './definitionModel';\nimport { prepareTargetComponentMap, getComponent, placeComponent, placeGridComponent } from '../helper';\n\nexport default class DefinitionManager {\n constructor (componentMap, sequence, totalHeight, totalWidth) {\n this._componentMap = componentMap;\n this._prioritySequence = sequence;\n this._totalHeight = totalHeight;\n this._totalWidth = totalWidth;\n this._targetComponentMap = null;\n }\n\n // create the config model\n generateConfigModel () {\n prepareTargetComponentMap(this);\n const canvasComponent = this._targetComponentMap.get('canvas');\n const definitionModel = new DefinitionModel({});\n let tempDefModel = definitionModel;\n definitionModel.remainingHeight(this._totalHeight);\n definitionModel.remainingWidth(this._totalWidth);\n\n let componentRef = null;\n\n this._prioritySequence.forEach((name) => {\n componentRef = getComponent(canvasComponent, name);\n if (name !== 'grid') {\n tempDefModel = placeComponent(tempDefModel, componentRef).second;\n } else {\n tempDefModel = placeGridComponent(tempDefModel, componentRef.component);\n }\n });\n return definitionModel;\n }\n\n componentMap (param) {\n if (param) {\n this._componentMap = param;\n }\n return this._componentMap;\n }\n\n targetComponentMap (param) {\n if (param) {\n this._targetComponentMap = param;\n }\n return this._targetComponentMap;\n }\n}\n","import { sanitizeConfig } from './helper';\n\nexport class LayoutDef {\n constructor () {\n this._componentMap = new Map();\n this._layoutDefinition = null;\n }\n\n addComponent (component) {\n this._componentMap.set(component.name(), component);\n }\n\n layoutDefinition (def) {\n if (def) {\n this._layoutDefinition = def;\n }\n return this._layoutDefinition;\n }\n\n addMultipleComponent (componentArray) {\n componentArray.forEach((comp) => {\n this.addComponent(comp);\n });\n }\n\n sanitizedDefinition () {\n sanitizeConfig(this, this._layoutDefinition);\n return this.layoutDefinition();\n }\n\n componentMap () {\n return this._componentMap;\n }\n resetComponentMap () {\n this._componentMap.clear();\n }\n}\n","import DefinitionManager from '../layout-definition/definition-manager';\n\nexport function sanitizeConfig (context, hostObj) {\n const hostID = hostObj.host();\n if (hostObj.lanes() && hostObj.lanes().length) {\n hostObj.lanes().forEach(childHost => sanitizeConfig(context, childHost));\n }\n if (hostID != null && typeof (hostID) === 'string') {\n if (context.componentMap().get(hostID) !== undefined) {\n hostObj.host(context.componentMap().get(hostID));\n }\n }\n}\n\nexport function calLayOutDef (context) {\n const { height, width } = context.dimension();\n const defManager = new DefinitionManager(context.layoutDef().componentMap(),\n context.prioritySequence(),\n height,\n width);\n const genLayoutdef = defManager.generateConfigModel();\n return genLayoutdef;\n}\n","import {\n LayoutModel\n} from '../layout-definition';\n\nimport {\n DEFAULT_WIDTH,\n DEFAULT_HEIGHT\n} from '../constants/defaults';\n\nimport {\n GRID\n} from '../../enums/constants';\n\nimport { DrawingManager } from '../drawing-manager';\nimport { removeElement } from '../drawing-manager/helper';\nimport { Utils } from '../utils';\nimport { LayoutDef } from './layout-def';\nimport { calLayOutDef } from './helper';\n\nexport default class LayoutManager {\n constructor (conf) {\n this._renderAt = conf.renderAt;\n this._layoutClassName = conf.className;\n this._dimension = {\n width: conf.width || DEFAULT_WIDTH,\n height: conf.height || DEFAULT_HEIGHT\n };\n\n this._skeletonType = conf.skeletonType || 'html';\n this._layoutDefinition = null;\n this._layoutDef = new LayoutDef();\n this._drawingManager = null;\n this._prioritySequence = [];\n this.tree = null;\n this._rootNodeID = null;\n }\n\n layoutDef (param) {\n if (param) {\n this._layoutDef = param;\n }\n return this._layoutDef;\n }\n\n prioritySequence (param) {\n if (param) {\n this._prioritySequence = param;\n }\n return this._prioritySequence;\n }\n\n dimension (param) {\n if (param) {\n Object.assign(this._dimension, param);\n }\n return this._dimension;\n }\n\n addComponent (component) {\n this._layoutDef.addComponent(component);\n }\n\n addMultipleComponent (componentArray) {\n this._layoutDef.addMultipleComponent(componentArray);\n }\n\n resetNode (node) {\n if (this.con) {\n this.con.resetNode(node);\n }\n }\n\n /**\n * function to update the node and rerender the layout.\n * @param {} config - node configuration to change.\n */\n updateNode (config) {\n this.tree.updateNode(config);\n this._layoutDefinition = this.tree.model;\n this.compute();\n }\n\n compute () {\n //----\n if (Utils.isDOMElement(this._renderAt)) {\n this._renderAt._layout = this;\n } else {\n document.getElementById(this._renderAt)._layout = this;\n }\n //-----\n this._layoutDefinition = calLayOutDef(this);\n this._layoutDef.layoutDefinition(this._layoutDefinition);\n this._layoutDefinition = this._layoutDef.sanitizedDefinition();\n this._layout = new LayoutModel({\n width: this._dimension.width,\n height: this._dimension.height\n },\n this._layoutDefinition);\n this.tree = this._layout.negotiate().tree();\n this._layout.broadcast();\n this._drawingManager = new DrawingManager({\n tree: this.tree,\n componentMap: this._layoutDef.componentMap(),\n layoutClassName: this._layoutClassName\n }, this._skeletonType, this._renderAt);\n\n if (this._rootNodeID) {\n this.tree.id(this._rootNodeID);\n } else {\n this._rootNodeID = this.tree.id();\n }\n // this will draw all the components by calling their draw method\n this._drawingManager.draw();\n }\n\n getRootNodeId () {\n return this._rootNodeID;\n }\n\n /**\n * This function takes the LayoutComponents and Register them in component store\n * @param {Array} layoutComponents\n */\n registerComponents (layoutComponents) {\n this._prioritySequence.length = 0;\n this._layoutDef.resetComponentMap();\n layoutComponents.forEach((container) => {\n if (container) {\n this._prioritySequence.push(container.name());\n this.addComponent(container);\n if (container.name() === 'grid') {\n container.component.forEach((componentArr) => {\n componentArr.forEach((compo) => {\n this.addComponent(compo);\n });\n });\n }\n }\n });\n return this;\n }\n\n getComponent (componentName) {\n return this._layoutDef.componentMap().get(componentName);\n }\n\n deleteElement (component, elementName) {\n this._layoutDef.componentMap().delete(elementName);\n const deleteElementId = component.renderAt();\n return removeElement(deleteElementId);\n }\n\n removeComponent (name) {\n const component = this.getComponent(name);\n if (component) {\n if (name === GRID) {\n return component.component.map(comp => comp.map(\n co => this.deleteElement(co, co.name())\n ));\n }\n return this.deleteElement(component, name);\n }\n return this;\n }\n\n renderAt (mount) {\n if (mount) {\n this._renderAt = mount;\n }\n return this._renderAt;\n }\n}\n","import { isEqual, STATE_NAMESPACES, selectElement, getValueParser, FieldType } from 'muze-utils';\nimport { VisualGroup } from '@chartshq/visual-group';\nimport { BEHAVIOURS } from '@chartshq/muze-firebolt';\nimport { payloadGenerator } from '@chartshq/visual-unit';\nimport { ROWS, COLUMNS, COLOR, SHAPE, SIZE, DETAIL, DATA, CONFIG, GRID, LEGEND }\n from '../constants';\nimport { canvasOptions } from './local-options';\nimport { LayoutManager } from '../../../layout/src/tree-layout';\n\n/**\n * Instantiate high level components. Canvas knows what all high level component it has.\n * @nice-to-have dynamic high level components.\n * - Is it even required ?\n * - Reactive to source (canvas) streaming ?\n * @param {*} context Canvas instance\n * @return {Object.} Arrays of Title, visualGroup, Legend\n */\nexport const initCanvas = (context) => {\n const reg = context._registry.components;\n\n return [new reg.VisualGroup(context._registry, Object.assign({\n throwback: context._throwback\n }, context.dependencies()))];\n};\n\nexport const fixFacetConfig = (config) => {\n if (config) {\n let isBorderPresent = false;\n const isGridLinePresent = {};\n\n if (config.border && config.border.width) {\n isBorderPresent = true;\n }\n if (config.gridLines) {\n isGridLinePresent.x = !!config.gridLines.x;\n isGridLinePresent.y = !!config.gridLines.y;\n }\n const facetsUserConfig = {\n isBorderPresent,\n isGridLinePresent\n };\n return {\n facetsUserConfig,\n isFacet: false\n };\n }\n return {};\n};\n\nexport const fixScrollBarConfig = (config) => {\n config.scrollBar.thickness = Math.min(50, Math.max(10, config.scrollBar.thickness));\n return config;\n};\n\nexport const setLayoutInfForUnits = (context) => {\n const layoutManager = context._layoutManager;\n const gridLayout = layoutManager.getComponent(GRID);\n const legend = layoutManager.getComponent(LEGEND);\n const boundBox = gridLayout && gridLayout.getBoundBox();\n const valueMatrix = context.composition().visualGroup.matrixInstance().value;\n const parentContainer = selectElement(`#${layoutManager.getRootNodeId()}`).node();\n if (legend) {\n legend.setComponentInfo({ rootNode: parentContainer });\n }\n valueMatrix.each((cell) => {\n cell.valueOf().parentContainerInf({\n el: parentContainer,\n dimensions: boundBox\n });\n });\n};\n\n/**\n *\n *\n * @memberof Canvas\n */\nexport const dispatchProps = (context) => {\n const lifeCycleManager = context.dependencies().lifeCycleManager;\n lifeCycleManager.notify({ client: context, action: 'beforeupdate' });\n const visualGroup = context.composition().visualGroup;\n\n const allOptions = context._allOptions;\n for (const key in allOptions) {\n const value = context[key]();\n if (value !== null) {\n visualGroup[key] && visualGroup[key](value);\n }\n }\n const { invalidValues } = context.config();\n\n visualGroup.valueParser(getValueParser(invalidValues));\n\n const sanitizedData = visualGroup.getMandatoryFields();\n if (sanitizedData.shouldRender) {\n visualGroup.createMatrices(sanitizedData);\n } else {\n visualGroup.remove();\n }\n context._cachedProps = {};\n lifeCycleManager.notify({ client: context, action: 'initialized' });\n lifeCycleManager.notify({ client: context, action: 'updated' });\n};\n\nconst equalityChecker = (props, params) => {\n let checker = () => false;\n return !props.every((option, i) => {\n switch (option) {\n case ROWS:\n case COLUMNS:\n case DETAIL:\n checker = isEqual('Array');\n break;\n\n case SHAPE:\n case SIZE:\n case COLOR:\n case DATA:\n case CONFIG:\n checker = isEqual('Object');\n break;\n default:\n checker = () => true;\n break;\n }\n const oldVal = params[i][0];\n const newVal = params[i][1];\n\n return checker(oldVal, newVal);\n });\n};\n\nexport const notifyAnimationEnd = (context) => {\n const viewInfo = context.layout().viewInfo();\n const centerMatrix = viewInfo && viewInfo.viewMatricesInfo.matrices.center[1] || [];\n const promises = [];\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n promises.push(cell.valueOf().done());\n });\n });\n const lifeCycleManager = context.lifeCycle();\n if (promises.length) {\n Promise.all(promises).then(() => {\n // Update life cycle\n lifeCycleManager.notify({ client: context, action: 'drawn' });\n const animDonePromises = [];\n\n centerMatrix.forEach((cellArr) => {\n cellArr.forEach((cell) => {\n cell.valueOf().layers().forEach((layer) => {\n animDonePromises.push(layer.animationDone());\n });\n });\n });\n\n [context.xAxes(), context.yAxes()].forEach((axisArr) => {\n axisArr = axisArr || [];\n axisArr.forEach((axes) => {\n axes.forEach((axisInst) => {\n animDonePromises.push(axisInst.animationDone());\n });\n });\n });\n\n Promise.all(animDonePromises).then(() => {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n });\n });\n } else {\n lifeCycleManager.notify({ client: context, action: 'animationend' });\n }\n};\n\nexport const setupChangeListener = (context) => {\n const store = context._store;\n\n const allOptions = Object.keys(context._allOptions);\n const props = [...allOptions, ...Object.keys(canvasOptions)];\n const nameSpaceProps = [...allOptions, ...Object.keys(canvasOptions)].map(prop =>\n `${STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE}.${prop}`);\n store.registerChangeListener(nameSpaceProps, (...params) => {\n const equalityProps = equalityChecker(props, params);\n // inform attached board to rerender\n if (equalityProps && context.mount()) {\n dispatchProps(context);\n context.render();\n }\n notifyAnimationEnd(context);\n }, true);\n};\n\nconst applyPropagationPolicy = (firebolt, { behaviours, sideEffects }) => {\n for (const key in behaviours) {\n firebolt.changeBehaviourStateOnPropagation(key, behaviours[key]);\n }\n for (const key in sideEffects) {\n firebolt.changeSideEffectStateOnPropagation(key, sideEffects[key]);\n }\n};\n\nconst isMeasure = fields => fields.every(field => field.type() === FieldType.MEASURE);\n\nconst isSplom = (fields) => {\n const { rowProjections, colProjections } = fields;\n const colProj = colProjections.flat();\n const rowProj = rowProjections.flat();\n\n if (isMeasure(colProj) && isMeasure(rowProj)) {\n return true;\n }\n return false;\n};\n\nexport const applyInteractionPolicy = (firebolt) => {\n const canvas = firebolt.context;\n const visualGroup = canvas.composition().visualGroup;\n if (visualGroup) {\n const splom = isSplom(visualGroup.resolver().getAllFields());\n const valueMatrix = visualGroup.matrixInstance().value;\n const interactionPolicy = firebolt._interactionPolicy;\n interactionPolicy(valueMatrix, firebolt);\n const crossInteractionPolicy = firebolt._crossInteractionPolicy;\n const behaviours = crossInteractionPolicy.behaviours;\n const sideEffects = crossInteractionPolicy.sideEffects;\n valueMatrix.each((cell) => {\n const unitFireBolt = cell.valueOf().firebolt();\n applyPropagationPolicy(unitFireBolt, { behaviours, sideEffects });\n if (splom) {\n unitFireBolt.payloadGenerators({\n [BEHAVIOURS.BRUSH]: (inst, dm, propConfig, facetFields) => payloadGenerator.brush(inst, dm,\n { ...propConfig, ...{ includeMeasures: false } }, facetFields)\n });\n unitFireBolt.sideEffects().selectionBox.config({\n persistent: true\n });\n } else {\n unitFireBolt.payloadGenerators({\n [BEHAVIOURS.BRUSH]: payloadGenerator.brush\n });\n unitFireBolt.sideEffects().selectionBox.config({\n persistent: false\n });\n }\n });\n applyPropagationPolicy(firebolt, { behaviours, sideEffects });\n }\n};\n\n/**\n * Sets the rotation for all x axes if any axis has the rotation config set in the\n * entire view\n *\n * @param {Array} columns Column cells that contain the axes cells\n */\nexport const setLabelRotationForAxes = (context) => {\n let rotation = 0;\n\n const xAxes = context.xAxes() || [];\n\n (() => {\n for (let i = 0; i < xAxes.length; i++) {\n for (let j = 0; j < xAxes[i].length; j++) {\n const rotationVal = xAxes[i][j].renderConfig().labels.rotation;\n if (rotationVal && rotationVal !== 0) {\n rotation = rotationVal;\n return;\n }\n }\n }\n })();\n\n if (rotation) {\n xAxes.forEach((axes) => {\n axes.forEach((axis) => {\n axis.renderConfig({ labels: { rotation } });\n axis.smartTicks(axis.setTickConfig());\n });\n });\n }\n};\n\nexport const createGroupState = (context) => {\n const [globalState, localState] = VisualGroup.getState();\n const store = context._store;\n store.append('app.group', globalState);\n store.append('local.group', localState);\n};\n\nexport const removeChild = (mount) => {\n while (mount.firstChild) {\n mount.removeChild(mount.firstChild);\n }\n};\n\nexport const createLayoutManager = () => {\n const layoutManager = new LayoutManager({\n className: 'muze-group-container'\n });\n return layoutManager;\n};\n","/**\n * This is the global options semantics based on which setters getters are created and reactivity is initiated.\n * Format\n * PROPERTRY_NAME: {\n * value: // default value of the property,\n * meta: {\n * typeCheck: // The setter value will be checked using this. If the value is function then the setter value\n * // is passed as args.\n * typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the\n * // value to the setter\n * sanitizaiton: // Need for sanitization before type is checked\n * }\n * }\n * @module GlobalOptions\n */\n\nimport { intSanitizer, mergeRecursive, DataModel } from 'muze-utils';\nimport { fixScrollBarConfig, fixFacetConfig } from './canvas/helper';\nimport { DEFAULT_CONFIG } from './defaults';\n\nexport default {\n data: {\n value: null,\n meta: {\n typeCheck: d => d instanceof DataModel\n }\n },\n width: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n height: {\n value: 0,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitWidth: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n minUnitHeight: {\n value: 50,\n meta: {\n sanitization: intSanitizer,\n typeCheck: Number.isInteger\n }\n },\n config: {\n value: [null, null],\n meta: {\n typeCheck: 'constructor',\n typeExpected: 'Object',\n takesMultipleParams: true,\n sanitization: ([config, auxConfig = {}], oldConfig) => {\n // Stores additional config, if passed\n const { reset = false } = auxConfig;\n let oldConf = {};\n\n // handle the default cases for facet, as it is different to other charts\n const facetDefaultConfig = fixFacetConfig(config);\n config = mergeRecursive(config, facetDefaultConfig);\n\n if (!reset) {\n oldConf = mergeRecursive({}, config === null ? {} : oldConfig);\n }\n\n const defConfig = mergeRecursive(oldConf, DEFAULT_CONFIG);\n const newConf = mergeRecursive(defConfig, config);\n\n return fixScrollBarConfig(newConf);\n }\n\n }\n }\n};\n","import { sanitizeIP, mergeRecursive } from 'muze-utils';\nimport { TOP, CENTER, BOTTOM } from '../enums/constants';\n\n/*\n * This is the abstract implementation of the root layout. This takes care of common work which all the layouts\n * has to handle. The common work includes sanitizaion of inputs, update, rerender, dispose etc. This class can't be\n * used directly (as ofcourse this is an abstract implementaiton), the class which is implementing it has to implement\n * the necessary methods and gives its on visual.\n */\n\n/**\n * This class is used to create a generic layout. It can be extended to create layouts\n * of different types\n * @class GenericLayout\n */\nexport default class GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config configuration to be given for the layout\n * @param {Object} dependencies external dependencies.\n *\n * @memberof GenericLayout\n *\n */\n constructor (mountPoint, measurement, config, dependencies) {\n this._config = {};\n this._measurement = {};\n this._matrices = [];\n // External dependencies to be included for the layout. This includes the ext global dependencies like\n // smartlabel which has one single implementation of throughout the page or per isntance\n this._dependencies = dependencies;\n\n this.measurement(measurement);\n this.mountPoint(mountPoint);\n this.config(config);\n }\n\n /**\n * Returns an object which is used to recreate the layout.\n * @return {Object} the serialized components\n */\n serialize () {\n return {\n measurement: this.measurement(),\n config: this.config(),\n matrices: this.matrices()\n };\n }\n\n /**\n * Sets/Gets the config for the layout\n * @param {Object} config configuration for the layout\n * @return {Layout|Object} Gets the Config/ Returns this instance when set\n */\n config (config) {\n if (config) {\n this._config = mergeRecursive(this._config || {}, config);\n this._config.border.width = Math.max(0, this._config.border.width);\n return this;\n }\n return this._config;\n }\n\n /**\n * Sets/Gets the measurement for the layout\n * @param {Object} measurement measurement for the layout\n * @return {Layout|Object} Gets the measurement/ Returns this instance when set\n */\n measurement (measurement) {\n if (measurement) {\n this._measurement = mergeRecursive(this._measurement || {}, measurement);\n\n return this;\n }\n return this._measurement;\n }\n\n /**\n * Sets/Gets the matrices for the layout\n * @param {Object} matrices matrices for the layout\n * @return {Layout|Object} Gets the matrices/ Returns this instance when set\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = sanitizeIP.typeObj([TOP, CENTER, BOTTOM], matrices);\n\n return this;\n }\n return this._matrices;\n }\n\n /**\n * Sets/Gets the matrix for row\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n rowMatrix (matrix) {\n if (matrix) {\n this._rowMatrix = matrix;\n return this;\n }\n return this._rowMatrix;\n }\n\n /**\n * Sets/Gets the matrix for columns\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n columnMatrix (matrix) {\n if (matrix) {\n this._columnMatrix = matrix;\n return this;\n }\n return this._columnMatrix;\n }\n\n /**\n * Sets/Gets the matrix for value\n * @param {Object} matrix matrices for the layout\n * @return {Layout|Object} Gets the matrix/ Returns this instance when set\n */\n centerMatrix (matrix) {\n if (matrix) {\n this._centerMatrix = matrix;\n return this;\n }\n return this._centerMatrix;\n }\n\n /**\n * Sets/Gets the mountPoint for the layout\n * @param {Object} mountPoint mountPoint for the layout\n * @return {Layout|Object} Gets the mountPoint/ Returns this instance when set\n */\n mountPoint (mountPoint) {\n if (mountPoint) {\n this._mountPoint = mountPoint;\n\n return this;\n }\n return this._mountPoint;\n }\n}\n","import * as FieldNames from '../enums/constants';\n\n/**\n * Default configuration of the layout\n * @return {Object} returns the default configuration\n */\nexport const DEFAULT_CONFIGURATION = {\n [FieldNames.BORDER]: {\n [FieldNames.STYLE]: 'solid',\n [FieldNames.COLOR]: '#d6d6d6',\n [FieldNames.WIDTH]: 2,\n [FieldNames.COLLAPSE]: true,\n [FieldNames.SPACING]: 0\n },\n [FieldNames.PAGINATION]: 'scroll',\n [FieldNames.BUFFER]: 20,\n [FieldNames.GUTTERSPACE]: { rows: [], columns: [] },\n [FieldNames.DISTRIBUTION]: { rows: [], columns: [] },\n [FieldNames.BREAK_PAGE]: { rows: [], columns: [] },\n [FieldNames.ROW_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_SIZE_IS_EQUAL]: false,\n [FieldNames.COLUMN_POINTER]: 0,\n [FieldNames.ROW_POINTER]: 0\n};\n\n/**\n * Default measurements for the layout\n * @return {Object} returns the default measurements\n */\nexport const DEFAULT_MEASUREMENTS = {\n [FieldNames.GRID_WIDTH]: 100,\n [FieldNames.GRID_HEIGHT]: 100,\n [FieldNames.UNIT_WIDTH]: 100,\n [FieldNames.UNIT_HEIGHT]: 100\n};\n\nexport const BLANK_BORDERS = 'rgba(0,0,0,0)';\n","/**\n * This file exports utility functions that are used across the layout module\n */\nimport { Symbols } from 'muze-utils';\nimport { PRIMARY, SECONDARY, HEIGHT, WIDTH } from '../enums/constants';\n\nconst nest = Symbols.nest;\n/**\n *\n *\n * @param {*} isTransposed\n *\n */\nconst getMeasureInfo = (isTransposed) => {\n if (isTransposed) {\n return {\n firstMeasure: HEIGHT,\n secondMeasure: WIDTH\n };\n }\n return {\n firstMeasure: WIDTH,\n secondMeasure: HEIGHT\n };\n};\n\n/**\n *\n *\n * @param {*} i\n * @param {*} page\n *\n */\nconst findInPage = (i, page) => {\n let count = 0;\n for (const x in page) {\n if (i < page[x]) {\n count = x;\n break;\n }\n }\n return count;\n};\n\n/**\n * Creates a single matrix from two matrices\n *\n * @param {Array} matrix Input matrix\n * @return {Array} Joined matrix\n * @memberof VisualMatrix\n */\nexport const combineMatrices = (matrix, config) => {\n const { isTransposed } = config;\n let joinedMatrix = matrix[0].length > 0 ? matrix[0] : matrix[1];\n if (isTransposed) {\n joinedMatrix = matrix[0].length > 0 ? [...matrix[0]] : [];\n joinedMatrix = matrix[1].length > 0 ? [...joinedMatrix, ...matrix[1]] : joinedMatrix;\n } else {\n joinedMatrix = joinedMatrix.map((row, rowIndex) => {\n let rowData = [];\n if (matrix[0].length > 0) {\n rowData = [...matrix[0][rowIndex]];\n }\n if (matrix[1].length > 0) {\n rowData = [...rowData, ...matrix[1][rowIndex]];\n }\n return rowData;\n });\n }\n return joinedMatrix;\n};\n\n/**\n * Creates a hirachical tree from the context\n *\n * @param {Object} context context for creating tree\n * @return {Object} nested tree\n */\nexport const createTree = (context) => {\n let matrixTree = {};\n let lastLevelKey = 0;\n let facet = PRIMARY;\n const nestFn = nest();\n const keys = [];\n const layoutMatrix = context._layoutMatrix;\n const primaryMatrix = context.primaryMatrix();\n const secondaryMatrix = context.secondaryMatrix();\n const { isTransposed, breakPage } = context.config();\n\n if (!isTransposed) {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix[0].length - 1; i++) {\n keys.push(i);\n }\n keys.push(primaryMatrix[0].length - 1);\n if (facet === SECONDARY || secondaryMatrix.length === 0) {\n lastLevelKey = primaryMatrix[0].length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const keyLength = primaryMatrix.length > 0 ? primaryMatrix[0].length : 0;\n for (let i = secondaryMatrix[0].length - 1; i > 0; i--) {\n keys.push(i + keyLength);\n }\n keys.push(keyLength);\n\n if (facet === PRIMARY) {\n lastLevelKey = keyLength;\n }\n } else {\n lastLevelKey = primaryMatrix.length > 0 ? primaryMatrix[0].length - 1 : 0;\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n matrixTree = nestFn.entries(layoutMatrix);\n } else {\n if (primaryMatrix.length === 0) {\n facet = PRIMARY;\n } else if (secondaryMatrix.length === 0) {\n facet = SECONDARY;\n } else {\n facet = primaryMatrix.length >= secondaryMatrix.length ? PRIMARY : SECONDARY;\n }\n if (primaryMatrix.length > 0) {\n for (let i = 0; i < primaryMatrix.length - 1; i++) {\n keys.push(i);\n }\n // if (facet === PRIMARY) {\n keys.push(primaryMatrix.length - 1);\n // } else {\n if (facet === SECONDARY) {\n lastLevelKey = primaryMatrix.length - 1;\n }\n }\n if (secondaryMatrix.length > 0) {\n const primaryMatrixLength = primaryMatrix.length;\n for (let i = secondaryMatrix.length - 1; i > 0; i--) {\n keys.push(i + primaryMatrixLength);\n }\n // if (facet === SECONDARY) {\n keys.push(primaryMatrixLength);\n // }\n if (facet === PRIMARY) {\n lastLevelKey = primaryMatrixLength;\n }\n }\n keys.forEach((key) => {\n let counter = -1;\n return nestFn.key((d) => {\n counter++;\n return `${d[key].valueOf()}-${findInPage(counter, breakPage)}`;\n });\n });\n let newMatrix = [];\n newMatrix = layoutMatrix[0].map((col, colIndex) => layoutMatrix.map(row => row[colIndex]));\n matrixTree = nestFn.entries(newMatrix);\n }\n return { tree: matrixTree, lastLevelKey };\n};\n\n/**\n * Gives the min measues\n *\n * @param {boolean} isTransposed is column matrix\n * @param {Object} unitMeasures min measures to be given to cells\n * @return {Object} dimension min cell\n */\nexport const getMinMeasures = (isTransposed, unitMeasures) => {\n if (!isTransposed) {\n return {\n height: unitMeasures.height,\n width: 0\n };\n }\n return {\n height: 0,\n width: unitMeasures.width\n };\n};\n\n/**\n * Get the logical space from the tree\n *\n * @param {Node} item tree to be calculated\n * @param {number} measures width and height\n * @param {Array} minMeasures min measures for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} dimension\n */\nexport const getLogicalSpace = (item, measures, minMeasures, maxMeasure = []) => {\n const { firstMeasure, secondMeasure } = measures;\n let firstMeasureValue = 0;\n let secondMeasureValue = 0;\n item.values.forEach((valueArray) => {\n let fMeasure = 0;\n let sMeasure = 0;\n valueArray.forEach((placeholder, colIndex) => {\n placeholder.setAvailableSpace();\n const space = placeholder.getLogicalSpace();\n const minSecondMeasure = placeholder.getMinMeasures(minMeasures[secondMeasure]);\n\n sMeasure = Math.max(sMeasure, +space[secondMeasure], minSecondMeasure);\n maxMeasure[colIndex] = Math.max(maxMeasure[colIndex] || 0, space[firstMeasure]);\n fMeasure += +maxMeasure[colIndex];\n });\n secondMeasureValue += sMeasure;\n firstMeasureValue = Math.max(firstMeasureValue, fMeasure);\n item.space = {\n [secondMeasure]: Math.ceil(secondMeasureValue),\n [firstMeasure]: Math.ceil(firstMeasureValue)\n };\n });\n return {\n [secondMeasure]: secondMeasureValue,\n [firstMeasure]: firstMeasureValue\n };\n};\n\n/**\n * Computes the logical spcae taken by the matrix tree\n *\n * @param {*} [item={}] tree to be viewed\n * @param {boolean} [isTransposed=false] is column matrix\n * @param {*} unitMeasures min measues for a cell\n * @param {Array} maxMeasure max measures for a col/row\n * @return {Object} logical space taken\n */\nexport const computeLogicalSpace = (item = {}, config, maxMeasures) => {\n const { isTransposed = false, unitMeasures } = config;\n const { firstMeasure, secondMeasure } = getMeasureInfo(isTransposed);\n const { values } = item;\n const minMeasures = getMinMeasures(isTransposed, unitMeasures);\n\n if (values[0].key) {\n const logicalSpace = { [firstMeasure]: 0, [secondMeasure]: 0 };\n\n values.forEach((valueItem) => {\n // Compute logical space for lowest level\n const space = computeLogicalSpace(valueItem, config, maxMeasures);\n // Set logical space for first measure\n logicalSpace[firstMeasure] = Math.max(logicalSpace[firstMeasure], space[firstMeasure],\n minMeasures[firstMeasure]);\n\n // Set logical space for second measure\n logicalSpace[secondMeasure] += +space[secondMeasure];\n });\n item.space = logicalSpace;\n return logicalSpace;\n }\n\n return getLogicalSpace(item, { firstMeasure, secondMeasure }, minMeasures, maxMeasures);\n};\n\n/**\n * Gives the space taken by a row\n *\n * @param {Array} row matrix array of rows\n * @return {Object} dimension of the row\n */\nexport const spaceTakenByRow = (row) => {\n let height = 0;\n let width = 0;\n row.forEach((col) => {\n const spaces = col.getLogicalSpace();\n height = Math.max(height, spaces.height);\n width += spaces.width;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Gives the space taken by a column\n *\n * @param {Array} matrix column matrix\n * @param {number} colIndex column index\n * @return {Object} dimension of the column\n */\nexport const spaceTakenByColumn = (matrix, colIndex) => {\n let height = 0;\n let width = 0;\n matrix.forEach((row) => {\n const col = row[colIndex];\n const spaces = col.getLogicalSpace();\n width = Math.max(width, spaces.width);\n height += spaces.height;\n });\n return {\n width,\n height\n };\n};\n\n/**\n * Creates different level matrices\n *\n * @param {Object} item matrix tree\n * @param {boolean} isTransposed is column matrix\n * @return {Object} matrix of each level\n */\nexport const createMatrixEachLevel = (item, isTransposed) => {\n if (item.values[0].key) {\n const arr = [];\n item.values.forEach((child) => {\n if (!isTransposed) {\n arr.push(...createMatrixEachLevel(child, isTransposed));\n } else {\n const eachLevel = createMatrixEachLevel(child, isTransposed);\n eachLevel.forEach((e, i) => {\n arr[i] = arr[i] || [];\n arr[i].push(...e);\n });\n }\n });\n item.matrix = arr;\n return arr;\n }\n if (!isTransposed) {\n item.matrix = item.values;\n } else {\n item.matrix = item.values[0].map((col, colIndex) => item.values.map(row => row[colIndex]));\n }\n return item.matrix;\n};\n\n/**\n * Breaks the matrix into two part\n *\n * @param {Array} matrix input matrix\n * @param {boolean} isTransposed is column matrix\n * @param {number} breakPointer point in matrix where it is to be broken\n * @return {Array} two broken matrix\n */\nexport const breakMatrix = (matrix, isTransposed, breakPointer) => {\n const primaryMatrix = [];\n const secondaryMatrix = [];\n if (isTransposed) {\n matrix.forEach((row, rowIndex) => {\n if (rowIndex >= breakPointer) {\n secondaryMatrix.push(row);\n } else {\n primaryMatrix.push(row);\n }\n });\n } else {\n matrix.forEach((row, rowIndex) => {\n row.forEach((column, columnIndex) => {\n if (columnIndex >= breakPointer) {\n secondaryMatrix[rowIndex] = secondaryMatrix[rowIndex] || [];\n secondaryMatrix[rowIndex].push(column);\n } else {\n primaryMatrix[rowIndex] = primaryMatrix[rowIndex] || [];\n primaryMatrix[rowIndex].push(column);\n }\n });\n });\n }\n return [primaryMatrix, secondaryMatrix];\n};\n\n/**\n * Distributed width returned\n *\n * @param {Object} context context for the width distibution\n * @return {number} distributed widths\n */\nexport const getDistributedWidth = (context, layoutConfig) => {\n const {\n availableWidth,\n width,\n row\n } = context;\n const {\n isDistributionEqual,\n isTransposed,\n distribution\n } = layoutConfig;\n let distSum = 0;\n if (distribution && distribution[0]) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n return row.map((col, colIndex) => {\n const space = col.getLogicalSpace().width;\n let distWidth = (space + (availableWidth - width) * (space / width));\n if (isTransposed) {\n if (distribution.length > 0) {\n distWidth = (availableWidth * distribution[colIndex] / distSum);\n } else if (isDistributionEqual || width === 0) {\n const rowLen = row.length;\n distWidth = (availableWidth / rowLen);\n }\n }\n return Math.floor(distWidth);\n });\n};\n\n/**\n * Distributeed heights returned\n *\n * @param {Object} context input for the height distribution\n * @return {Object} distribured heights\n */\nexport const getDistributedHeight = (context) => {\n let distSum = 0;\n let gutterSum = 0;\n let heightWithoutGutter = 0;\n const {\n isTransposed,\n distribution,\n availableHeight,\n height,\n isDistributionEqual,\n gutter,\n matrix,\n cIdx\n } = context;\n\n if (distribution && distribution[0] !== undefined) {\n distSum = distribution.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n if (gutter && gutter[0] !== undefined) {\n gutterSum = gutter.reduce((t, n) => {\n t += n;\n return t;\n });\n }\n heightWithoutGutter = availableHeight - Math.floor(availableHeight * gutterSum);\n\n const colLen = matrix.length;\n return matrix.map((row, rIdx) => {\n const col = row[cIdx];\n const space = col.getLogicalSpace().height;\n let distHeight = (space + (heightWithoutGutter - height) * (space / height));\n\n if (!isTransposed) {\n if (distribution.length > 0 && colLen === distribution.length) {\n distHeight = (heightWithoutGutter * distribution[rIdx] / distSum);\n } else if (isDistributionEqual || context.height === 0) {\n distHeight = (heightWithoutGutter / colLen);\n }\n }\n return Math.floor(distHeight);\n });\n};\n\n/**\n *\n *\n * @param {*} arr\n * @param {*} beg\n * @param {*} end\n */\nexport const extraCellsRemover = (arr, beg, end) => arr.slice(beg, -end);\n\n/**\n * Creates matrix instancess\n *\n * @param {Array} [arr=[]] mutated arry\n * @param {number} depth depth of the tree\n * @param {Array} matrixInfo Details about the matrix(tree, etc) to be inserted\n * @param {boolean} layout Instance of layout\n */\nexport const createMatrixInstances = (arr = [], depth, matrixInfo, layout) => {\n const breakPointer = layout._breakPointer;\n const config = layout.config();\n const {\n isTransposed\n } = config;\n const {\n tree,\n layoutMatrix\n } = matrixInfo;\n\n if (depth === 0) {\n const brokenMatrix = breakMatrix(tree.matrix, isTransposed, breakPointer);\n arr.push({\n matrix: tree.matrix,\n primaryMatrix: brokenMatrix[0],\n secondaryMatrix: brokenMatrix[1],\n space: tree.space\n });\n return arr;\n }\n const nextLevel = depth - 1;\n tree.values.forEach((e) => {\n createMatrixInstances(arr, nextLevel, {\n tree: e,\n layoutMatrix\n }, layout);\n });\n return arr;\n};\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n config: {\n sanitization: (context, value) => mergeRecursive(context._config || {}, value)\n },\n maxMeasures: {},\n availableSpace: {},\n logicalSpace: {}\n};\n","import { PRIMARY } from '../enums/constants';\n/**\n *\n *\n */\nexport const defaultConfig = {\n distribution: [],\n classPrefix: 'muze',\n isDistributionEqual: true,\n unitMeasures: {\n height: 100,\n width: 100,\n border: 1\n },\n isTransposed: false,\n facet: PRIMARY,\n extraCellLengths: []\n};\n","import { mergeRecursive, generateGetterSetters, ERROR_MSG } from 'muze-utils';\nimport {\n createTree,\n combineMatrices,\n createMatrixInstances\n } from '../utils';\nimport { PROPS } from './props';\nimport { HEIGHT, WIDTH } from '../enums/constants';\nimport { defaultConfig } from './default-config';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n // Prepare matrices\n this._lastLevelKey = 0;\n this._primaryMatrix = matrix[0] || [];\n this._secondaryMatrix = matrix[1] || [];\n this._maxMeasures = [];\n this._availableSpace = {};\n\n // Store the config\n generateGetterSetters(this, PROPS);\n const defCon = Object.assign({}, this.constructor.defaultConfig());\n this.config(mergeRecursive(defCon, config));\n\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n computeViewableSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getPriorityDistribution () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n *\n *\n * @param {*} params\n * @returns\n * @memberof VisualMatrix\n */\n primaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._primaryMatrix;\n }\n\n secondaryMatrix (...params) {\n if (params.length) {\n return this;\n }\n return this._secondaryMatrix;\n }\n\n tree (...params) {\n if (params.length) {\n return this;\n }\n return this._tree;\n }\n\n static defaultConfig () {\n return defaultConfig;\n }\n\n createTree () {\n const { tree, lastLevelKey } = createTree(this);\n this._lastLevelKey = lastLevelKey;\n return tree;\n }\n\n /**\n * Returns the space taken by visual matrix\n *\n * @return {Object} space taken by the matrix\n * @memberof VisualMatrix\n */\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n /**\n * Sets the provied space to the visual matrix\n *\n * @param {number} width width provided\n * @param {number} height height provided\n * @memberof VisualMatrix\n */\n setAvailableSpace (width, height) {\n this.availableSpace({ width, height });\n const tree = this.tree();\n const heightMeasures = this.populateMaxMeasures(HEIGHT, tree);\n const widthMeasures = this.populateMaxMeasures(WIDTH, tree);\n const depth = this.calculateDepth(widthMeasures, heightMeasures);\n\n this.viewableMatrix = this.createViewPortMatrix(depth);\n this.viewableMeasures = this.redistributeSpaces(width, height);\n return this;\n }\n\n /**\n * Populate the max measures in the array\n *\n * @param {Array} measures array to be filled with max measures\n * @param {Object} matrixTree matrix tree of visual matrix\n * @param {number} measure width or height\n * @param {number} [depth=0] depth of the tree that to be calculated\n * @memberof VisualMatrix\n */\n populateMaxMeasures (type, matrixTree, depth = 0, measures = []) {\n measures[depth] = Math.max(measures[depth] || 0, matrixTree.space[type]);\n if (matrixTree.values) {\n const childDepth = depth + 1;\n matrixTree.values.forEach((child) => {\n if (child.space) {\n measures = this.populateMaxMeasures(type, child, childDepth, measures);\n }\n });\n }\n return measures;\n }\n\n /**\n * Gets the viewable measures for the current viewable matrix\n *\n * @return {Object} Set of viewable measures\n * @memberof VisualMatrix\n */\n getViewableSpaces () {\n return this.viewableMeasures;\n }\n\n /**\n * Returns the matrix that can be viewed in the current viewport\n *\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n getViewableMatrices () {\n return this.viewableMatrix;\n }\n\n /**\n * Creates the viewport that can be viewed together\n *\n * @param {number} depth maxDepth that can be viewed in the viewport\n * @return {Array} Set of matrices that can be viewed\n * @memberof VisualMatrix\n */\n createViewPortMatrix (depth) {\n const arr = [];\n createMatrixInstances(arr, depth, this.removeExtraCells(), this);\n return arr;\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n combineMatrices,\n spaceTakenByColumn,\n getDistributedHeight,\n computeLogicalSpace,\n createMatrixEachLevel\n } from '../utils';\nimport { ROW_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class RowVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = (matrix[0].length > 0 ? matrix[0][0].length : 0);\n this._layoutMatrix = combineMatrices([matrix[0] || [], matrix[1] || []], this.config());\n\n // Create Tree\n this._tree = {\n key: ROW_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, false);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height\n } = measures;\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i };\n const { widths, rowHeights, columnWidths } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = [height, height];\n const columnMeasures = widths;\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n tree.matrix = extraCellsRemover(tree.matrix, begCellLen, endCellLen);\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n let remainingAvailWidth;\n let remainingWidth;\n let cWidths = [];\n let conditions = [];\n let maxPrioritySpace = 0;\n const {\n matrix,\n width: availableWidth,\n maxMeasures: maxWidths,\n maxWidth: currentWidth,\n height\n } = measures;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length ? this.primaryMatrix()[0].length : 0;\n\n const dist = [];\n\n remainingAvailWidth = availableWidth;\n remainingWidth = currentWidth;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n // divider = Math.min(2, matrixLen);\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n // divider = Math.min(1, matrixLen);\n }\n conditions.forEach((i) => {\n dist[i] = maxWidths[i];\n maxPrioritySpace += maxWidths[i];\n remainingAvailWidth -= dist[i];\n remainingWidth -= dist[i];\n });\n matrix[0].forEach((e, i) => {\n if (conditions.indexOf(i) === -1) {\n dist[i] = remainingAvailWidth * (maxWidths[i] / remainingWidth);\n }\n });\n matrix.forEach(row => row.forEach((col, cIdx) => {\n if (conditions.indexOf(cIdx) === -1) {\n col.setAvailableSpace(dist[cIdx], height);\n\n cWidths[cIdx] = Math.max(cWidths[cIdx] || 0, Math.floor(col.getLogicalSpace().width));\n } else {\n cWidths[cIdx] = 0;\n }\n }));\n\n const prioritySpace = availableWidth - cWidths.reduce((t, n) => t + n);\n if (prioritySpace < 0) {\n cWidths = cWidths.map(() => 0);\n } else {\n conditions.forEach((i) => {\n cWidths[i] = Math.floor(prioritySpace * (dist[i] / maxPrioritySpace || 1));\n });\n }\n return cWidths;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures, heightMeasures) {\n let i;\n const { height } = this.availableSpace();\n\n for (i = 0; i < heightMeasures.length; i++) {\n if (heightMeasures[i] <= height) break;\n }\n\n return Math.min(widthMeasures.length - 1, i);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n const maxMeasures = this.maxMeasures();\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n const logicalWidths = this.getPriorityDistribution({\n matrix: this._layoutMatrix,\n maxWidth,\n maxMeasures,\n width,\n height\n });\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths, logicalWidths };\n const measures = this.redistributeViewSpaces(options);\n maxWidths = measures.maxWidths;\n maxHeights = measures.maxHeights;\n });\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space row wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let cWidths = [];\n let rHeights = [];\n let mHeight = 0;\n const maxMeasures = this.maxMeasures();\n\n const {\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n } = this.config();\n const { matrix, height, maxHeights, maxWidths, logicalWidths } = measures;\n mHeight = spaceTakenByColumn(matrix, this._lastLevelKey).height;\n\n const maxWidth = maxMeasures.reduce((t, n) => {\n t += n;\n return t;\n });\n measures.maxMeasures = maxMeasures;\n measures.maxWidth = maxWidth;\n if (maxWidth > 0) {\n cWidths = logicalWidths;\n } else {\n cWidths = maxMeasures.map(() => 0);\n }\n rHeights = getDistributedHeight({\n matrix,\n cIdx: this._lastLevelKey,\n height: mHeight,\n availableHeight: height,\n isDistributionEqual,\n distribution,\n isTransposed,\n gutter\n });\n if (maxWidths.length > 0) {\n cWidths = cWidths.map((e, i) => Math.max(e, maxWidths[0][i] || 0));\n }\n maxWidths.push(cWidths);\n for (let x = 0; x < maxWidths.length; x++) {\n maxWidths[x] = cWidths;\n }\n maxHeights.push(rHeights);\n return { maxWidths, maxHeights };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = maxHeights[matrixIndex][rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth, colHeight - borderWidth);\n\n if (rIdx === 0 && cIdx < breakPointer) {\n columnWidths[0][cIdx] = colWidth;\n widths[0] = (widths[0] || 0) + colWidth;\n } else if (rIdx === 0 && cIdx >= breakPointer) {\n columnWidths[1][cIdx - breakPointer] = colWidth;\n widths[1] = (widths[1] || 0) + colWidth;\n }\n if (cIdx === this._lastLevelKey) {\n rowHeights[0][rIdx] = colHeight;\n rowHeights[1][rIdx] = colHeight;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import { mergeRecursive } from 'muze-utils';\nimport {\n extraCellsRemover,\n getDistributedWidth,\n spaceTakenByRow,\n createMatrixEachLevel,\n computeLogicalSpace\n } from '../utils';\nimport { COLUMN_ROOT } from '../enums/constants';\nimport VisualMatrix from './visual-matrix';\n\n/**\n * This class used to create column / row matrix for GridLayout\n *\n * @class VisualMatrix\n */\nexport default class ColumnVisualMatrix extends VisualMatrix {\n\n /**\n *Creates an instance of VisualMatrix.\n * @param {any} matrix Two set of matrices\n * @param {any} [config={}] Configuration for VisualMatrix\n * @memberof VisualMatrix\n */\n constructor (matrix, config = {}) {\n super(matrix, config);\n\n this._breakPointer = matrix[0].length;\n\n // Create Tree\n this._tree = {\n key: COLUMN_ROOT,\n values: this.createTree()\n };\n this._logicalSpace = this.computeLogicalSpace();\n }\n\n /**\n * Computes the logical space taken by the entire matrixTree\n *\n * @return {Object} Logical space taken\n * @memberof VisualMatrix\n */\n computeLogicalSpace () {\n const matrixTree = this.tree();\n createMatrixEachLevel(matrixTree, true);\n return computeLogicalSpace(matrixTree, this.config(), this.maxMeasures());\n }\n\n computeViewableSpaces (measures) {\n const {\n maxHeights,\n maxWidths,\n height,\n width\n } = measures;\n\n return this.viewableMatrix.map((matrixInst, i) => {\n const cellDimOptions = { matrixInst, maxWidths, maxHeights, matrixIndex: i, height };\n const {\n heights,\n rowHeights,\n columnWidths\n } = this.getCellDimensions(cellDimOptions);\n const heightMeasures = heights;\n const columnMeasures = [width, width];\n\n return {\n rowHeights: {\n primary: rowHeights[0],\n secondary: rowHeights[1]\n },\n columnWidths: {\n primary: columnWidths[0],\n secondary: columnWidths[1]\n },\n height: {\n primary: heightMeasures[0],\n secondary: heightMeasures[1]\n },\n width: {\n primary: columnMeasures[0],\n secondary: columnMeasures[1]\n }\n };\n });\n }\n\n /**\n *\n *\n * @return\n * @memberof VisualMatrix\n */\n removeExtraCells () {\n const {\n isTransposed,\n extraCellLengths\n } = this.config();\n const matrix = this._layoutMatrix;\n const tree = mergeRecursive({}, this.tree());\n const begCellLen = extraCellLengths[0];\n const endCellLen = extraCellLengths[1] || Number.NEGATIVE_INFINITY;\n const layoutMatrix = !isTransposed ? extraCellsRemover(matrix, begCellLen, endCellLen) :\n matrix.slice(0).map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n tree.values = extraCellsRemover(tree.values, begCellLen, endCellLen);\n\n tree.matrix = tree.matrix.map(e => extraCellsRemover(e, begCellLen, endCellLen));\n\n return {\n tree,\n layoutMatrix\n };\n }\n\n getPriorityDistribution (measures) {\n const {\n height,\n maxHeights\n } = measures;\n let remainingHeight = height;\n let heightDist = [];\n let conditions = [];\n let divider = 2;\n const priority = this.config().priority;\n const primaryMatrixLength = this.primaryMatrix().length;\n\n if (priority === 2) {\n conditions = [primaryMatrixLength - 1, primaryMatrixLength];\n divider = 2;\n } else {\n conditions = priority === 0 ? [primaryMatrixLength - 1] : [primaryMatrixLength];\n divider = 1;\n }\n maxHeights.forEach((heights, index) => {\n if (conditions.indexOf(index) === -1) {\n heightDist[index] = heights;\n remainingHeight -= heights;\n }\n });\n if (remainingHeight < 0) {\n heightDist = heightDist.map(() => 0);\n } else {\n conditions.forEach((condition) => {\n heightDist[condition] = Math.min(maxHeights[condition], (remainingHeight) / divider);\n });\n }\n return heightDist;\n }\n\n /**\n * Calculates the depth of the tree that can be viewed\n *\n * @param {Array} widthMeasures array of widths\n * @param {Array} heightMeasures array of heights\n * @return {number} depth of the tree\n * @memberof VisualMatrix\n */\n calculateDepth (widthMeasures) {\n let j;\n const { width } = this.availableSpace();\n\n for (j = 0; j < widthMeasures.length; j++) {\n if (widthMeasures[j] <= width) break;\n }\n return Math.min(widthMeasures.length - 1, j);\n }\n\n /**\n * Redistributes the provied space to all cells\n *\n * @param {*} viewableMatrix current viewport matrix\n * @param {*} width provied width\n * @param {*} height provied height\n * @return {Object} current viewports matrixes with measures\n * @memberof VisualMatrix\n */\n redistributeSpaces (width, height) {\n let maxHeights = [];\n let maxWidths = [];\n\n this.viewableMatrix.forEach((matrixInst) => {\n const matrix = matrixInst.matrix;\n const mWidth = 0;\n const mHeight = 0;\n const options = { mWidth, mHeight, matrix, width, height, maxHeights, maxWidths };\n const maxMeasures = this.redistributeViewSpaces(options);\n maxWidths = maxMeasures.maxWidths;\n maxHeights = maxMeasures.maxHeights;\n });\n\n return this.computeViewableSpaces({ height, width, maxHeights, maxWidths });\n }\n\n /**\n * Distibutes the given space column wisely\n *\n * @param {Object} measures Redistribution information\n * @memberof VisualMatrix\n */\n redistributeViewSpaces (measures) {\n let rHeights = [];\n const {\n matrix,\n width,\n maxHeights,\n maxWidths\n } = measures;\n const borderWidth = this.config().unitMeasures.border;\n\n const mWidth = spaceTakenByRow(matrix[this._lastLevelKey]).width;\n const cWidths = getDistributedWidth({\n row: matrix[this._lastLevelKey],\n width: mWidth,\n availableWidth: width\n }, this.config());\n\n matrix.forEach((row, rIdx) => row.forEach((col, cIdx) => {\n const oldLogicalSpace = col.getLogicalSpace();\n\n col.setAvailableSpace(cWidths[cIdx] - borderWidth, oldLogicalSpace.height);\n\n rHeights[rIdx] = Math.max(rHeights[rIdx] || 0, Math.floor(col.getLogicalSpace().height));\n }));\n if (maxHeights.length > 0) {\n rHeights = rHeights.map((e, i) => Math.max(e, maxHeights[0][i]));\n }\n maxHeights.push(rHeights);\n for (let x = 0; x < maxHeights.length; x++) {\n maxHeights[x] = rHeights;\n }\n maxWidths.push(cWidths);\n return { maxHeights, maxWidths };\n }\n\n /**\n * Dispatch the calculated cell dimensions to all the cells\n *\n * @param {Object} measures cell dimension information\n * @return {Object} row and column heights / widths\n * @memberof VisualMatrix\n */\n getCellDimensions (measures) {\n const {\n unitMeasures\n } = this.config();\n const borderWidth = unitMeasures.border;\n const { matrixInst, height, maxWidths, maxHeights, matrixIndex } = measures;\n const matrix = matrixInst.matrix;\n const rowHeights = [[0], [0]];\n const columnWidths = [[0], [0]];\n const heights = [0, 0];\n const widths = [0, 0];\n const breakPointer = this._breakPointer;\n\n const heightDistribution = this.getPriorityDistribution({ height, maxHeights: maxHeights[0] || [] });\n\n matrix.forEach((row, rIdx) => {\n row.forEach((cell, cIdx) => {\n const colHeight = heightDistribution[rIdx] || 0;\n const colWidth = maxWidths[matrixIndex][cIdx];\n\n cell.setAvailableSpace(colWidth - borderWidth, colHeight);\n\n if (cIdx === 0 && rIdx < breakPointer) {\n rowHeights[0][rIdx] = colHeight;\n heights[0] = (heights[0] || 0) + colHeight;\n } else if (cIdx === 0 && rIdx >= breakPointer) {\n rowHeights[1][rIdx - breakPointer] = colHeight;\n heights[1] = (heights[1] || 0) + colHeight;\n }\n if (rIdx === this._lastLevelKey) {\n columnWidths[0][cIdx] = colWidth;\n columnWidths[1][cIdx] = colWidth;\n }\n });\n });\n return {\n heights,\n widths,\n rowHeights,\n columnWidths\n };\n }\n}\n\n","import {\n HEIGHT, WIDTH, COLUMN, ROW, HORIZONTAL, VERTICAL, HOLISTIC,\n MAX_WIDTH_AVAIL_FOR_COL_MATRIX, COLUMN_MATRIX, MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX, ROW_MATRIX, SCROLL\n} from '../enums/constants';\n\n/**\n * Gets measurement for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @return {Object} Logical height/width of the matrix\n */\nexport function getMatrixMeasurement (matrix, type) {\n if (matrix) {\n return matrix.getLogicalSpace()[type];\n }\n return 0;\n}\n\n/**\n * Sets available space for an instance of visual matrix\n *\n * @param {Array} matrix instance of visual matrix\n * @param {string} type height/width\n * @param {number} value Value of measurement\n */\nexport function setMatrixMeasurement (matrix, type, value) {\n if (matrix) {\n const spaces = matrix.getLogicalSpace();\n if (value && spaces[type] !== value) {\n type === HEIGHT ? matrix.setAvailableSpace(spaces.width, value) :\n matrix.setAvailableSpace(value, spaces.height);\n }\n }\n}\n\nconst setAvailableSpace = (matrix, widths, heights) => {\n matrix.forEach((row, rIdx) => {\n row.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(widths[cIdx], heights[rIdx]);\n });\n });\n};\n\nconst setViewSpaces = (layout, pointerType, viewSpaces) => {\n let pointer = layout.config()[`${pointerType}Pointer`];\n if (viewSpaces.length - 1 < pointer) {\n pointer = 0;\n layout.config({ [`${pointerType}Pointer`]: pointer });\n }\n return pointer;\n};\n\nconst paginationDetailsMap = {\n column: {\n maxMeasure: MAX_WIDTH_AVAIL_FOR_COL_MATRIX,\n matrix: COLUMN_MATRIX,\n measureType: WIDTH,\n scrollType: HORIZONTAL\n },\n row: {\n maxMeasure: MAX_HEIGHT_AVAIL_FOR_ROW_MATRIX,\n matrix: ROW_MATRIX,\n measureType: HEIGHT,\n scrollType: VERTICAL\n }\n};\n\n/**\n * This method provides the required width/height in the different pagination stages.\n * If the pagination is holistic, then only the max width/height will be provided for layouting\n * If scroll is enabled, then the entire width/height shall be provided for layouting\n * Note: width is required for scrolling the columns while height is required for scrolling rows\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {Object} measureDetails different measure details for row/column\n * @param {number} maxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst getMatrixMeasureForPagination = (layout, measureDetails, maxMeasure, buffer) => {\n const {\n pagination\n } = layout.config();\n const {\n matrix,\n measureType,\n scrollType\n } = measureDetails;\n\n switch (pagination) {\n case HOLISTIC:\n return maxMeasure;\n default: {\n const actualMeasure = getMatrixMeasurement(layout[matrix](), measureType) + buffer;\n\n if (actualMeasure > maxMeasure) {\n layout.scrollInfo({ [scrollType]: true });\n }\n return Math.max(maxMeasure, actualMeasure);\n }\n }\n};\n\n/**\n * This method uses the getMatrixMeasureForPagination function to calculate maximum measure\n * depending on the layouting algorithm used\n *\n *\n * @param {Layout} layout Layout instance required for configuration details\n * @param {string} matrixType row/column\n * @param {number} relatedMaxMeasure maximum width/height present for column/row respectively\n * @return {number} Provides the width/height based on which further calculation can occur\n */\nconst paginationMeasureGetter = (layout, matrixType, relatedMaxMeasure, buffer) =>\n getMatrixMeasureForPagination(layout, paginationDetailsMap[matrixType], relatedMaxMeasure, buffer);\n\nconst getMatrixWidthDetails = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const {\n width\n } = layout.measurement();\n const {\n border,\n buffer\n } = layout.config();\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get width of row matrix\n const rowMatrixWidth = getMatrixMeasurement(rowMatrix, WIDTH);\n\n // Get maximum width allowed for the row matrix\n const maxRowMatrixWidth = Math.min(rowMatrixWidth + buffer, width / 2);\n\n // Get maximum width available for the column matrix\n const maxWidthAvailableForColumnMatrix = width - maxRowMatrixWidth - borderWidth;\n\n // Set width for column matrix\n const columnMatrixWidth = paginationMeasureGetter(layout, COLUMN, maxWidthAvailableForColumnMatrix, 0);\n\n return {\n rowMatrixWidth,\n maxRowMatrixWidth,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n\nconst getHeightRequiredByColMatrix = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const columnMatrix = layout.columnMatrix();\n\n // Get maximum allowed height for colum matrix\n const maxColumnMatrixHeight = Math.min(columnMatrix.getLogicalSpace().height, height / 2);\n\n // Set the computed width and max height to column matrix to determine the actual height\n // that will be taken by the column matrix\n columnMatrix.setAvailableSpace(columnMatrixWidth, maxColumnMatrixHeight);\n\n // Get the set of pages column view\n const columnViewPages = columnMatrix.getViewableSpaces();\n\n // Figuring out total space needed by current view space\n const columnViewSpace = columnViewPages[layout.config().columnPointer];\n\n // Getting height of column matrix\n const columnMatrixHeight = columnViewSpace.height.primary + columnViewSpace.height.secondary;\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight\n };\n};\n\nconst getMatrixHeightDetails = (layout, columnMatrixWidth) => {\n const {\n height\n } = layout.measurement();\n const {\n buffer\n } = layout.config();\n\n // Get actual height required by column matrix\n const { columnMatrixHeight, maxColumnMatrixHeight } = getHeightRequiredByColMatrix(layout, columnMatrixWidth);\n\n // Based on column height, compute max height available for row matrix\n const maxHeightAvailableForRowMatrix = height - Math.min(maxColumnMatrixHeight, columnMatrixHeight);\n\n // Get height for row matrix\n const rowMatrixHeight = paginationMeasureGetter(layout, ROW, maxHeightAvailableForRowMatrix, buffer);\n\n return {\n columnMatrixHeight,\n maxColumnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n };\n};\n\nconst setValueMatrixMeasurements = (layout, rowViewableSpaces, columnViewableSpaces) => {\n const centerMatrix = layout.centerMatrix();\n\n const {\n border\n } = layout.config();\n const matrices = layout.matrices();\n const {\n top,\n bottom\n } = matrices;\n\n // Border adjustment for each cell in the central matrix\n const borderWidth = border.width;\n\n // Get the heights for each cell in the row matrix\n const rowHeights = [].concat(...rowViewableSpaces.map(e => e.rowHeights.primary));\n\n // Get the widths for each of the row matrix cells(primary and secondary)\n const rowWidthsPrimary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.primary));\n const rowWidthsSecondary = [].concat(...rowViewableSpaces.map(e => e.columnWidths.secondary));\n\n // Get the widths for each cell in the column matrix\n const columnWidths = [].concat(...columnViewableSpaces.map(e => e.columnWidths.primary));\n\n // Get the widths for each of the column matrix cells(primary and secondary)\n const columnHeightsPrimary = columnViewableSpaces[0].rowHeights.primary;\n const columnHeightsSecondary = [].concat(...columnViewableSpaces.map(e => e.rowHeights.secondary));\n\n // Setting the available space for each cell in the centre matrix computed throught the row and\n // column matrices\n centerMatrix.forEach((matrix, rIdx) => {\n matrix.forEach((placeholder, cIdx) => {\n placeholder.setAvailableSpace(columnWidths[cIdx] - borderWidth, rowHeights[rIdx] - borderWidth);\n });\n });\n\n // Set the heights and widths for the corner matrices namely:\n // TOP_LEFT\n setAvailableSpace(top[0], rowWidthsPrimary, columnHeightsPrimary);\n // TOP_RIGHT\n setAvailableSpace(top[2], rowWidthsSecondary, columnHeightsPrimary);\n // BOTTOM_LEFT\n setAvailableSpace(bottom[0], rowWidthsPrimary, columnHeightsSecondary);\n // BOTTOM_RIGHT\n setAvailableSpace(bottom[2], rowWidthsSecondary, columnHeightsSecondary);\n};\n\nconst bufferCondition = {\n isScroll: true,\n pagination: SCROLL\n};\n\nconst getBufferFromCondition = (layout, type) => {\n const scrollInfo = layout.scrollInfo();\n const {\n pagination\n } = layout.config();\n\n const currentBufferType = {\n pagination,\n isScroll: scrollInfo[type]\n };\n\n return Object.keys(bufferCondition).every(e => bufferCondition[e] === currentBufferType[e]);\n};\n\nconst getActualBufferFromConfig = (layout) => {\n const {\n buffer\n } = layout.config();\n const [horizontalBuffer, verticalBuffer] = [HORIZONTAL, VERTICAL].map((type) => {\n if (getBufferFromCondition(layout, type)) {\n return buffer;\n }\n return 0;\n });\n\n return {\n horizontalBuffer,\n verticalBuffer\n };\n};\n/**\n * Computes the measurements of space for all matrices in the\n * layout\n *\n * @param {Object} layout Instance of grid layout\n * @return {Object} set of measurements for the layout\n */\nexport const computeLayoutMeasurements = (layout) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n\n // Compute the widths of the row and column matrices\n const {\n rowMatrixWidth,\n maxRowMatrixWidth,\n maxWidthAvailableForColumnMatrix,\n columnMatrixWidth\n } = getMatrixWidthDetails(layout);\n\n // Compute the heights of the row and column matrices\n const {\n columnMatrixHeight,\n rowMatrixHeight,\n maxHeightAvailableForRowMatrix\n } = getMatrixHeightDetails(layout, columnMatrixWidth);\n\n const {\n horizontalBuffer,\n verticalBuffer\n } = getActualBufferFromConfig(layout);\n rowMatrix.setAvailableSpace(maxRowMatrixWidth - verticalBuffer, rowMatrixHeight - horizontalBuffer);\n\n // Get row and columns viewable spaces\n const rowViewableSpaces = rowMatrix.getViewableSpaces();\n const columnViewableSpaces = columnMatrix.getViewableSpaces();\n\n // Set view spaces for row and columns\n setViewSpaces(layout, ROW, rowViewableSpaces);\n setViewSpaces(layout, COLUMN, columnViewableSpaces);\n\n // Set measures for each cell of the value matrix\n setValueMatrixMeasurements(layout, rowViewableSpaces, columnViewableSpaces);\n\n return {\n rowMatrixHeight: rowMatrixHeight - horizontalBuffer,\n rowMatrixWidth: rowMatrixWidth - verticalBuffer,\n maxHeightAvailableForRowMatrix: maxHeightAvailableForRowMatrix - horizontalBuffer,\n\n columnMatrixHeight,\n columnMatrixWidth,\n maxWidthAvailableForColumnMatrix\n };\n};\n","/**\n * Gets view matrices based on current pointers for row and column\n *\n * @param {Object} layout instance of layout\n * @param {number} rowPointer current row pointer\n * @param {number} columnPointer current column pointer\n * @return {Object} returns the view matrix and its relevant information\n */\nexport const getViewMatrices = (layout, rowPointer, columnPointer) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const centerMatrix = layout.centerMatrix();\n const matrices = layout.matrices();\n const rowMatrices = rowMatrix.getViewableMatrices();\n const columnMatrices = columnMatrix.getViewableMatrices();\n const centralMatrixPointer = {\n row: 0,\n column: 0\n };\n\n for (let i = rowPointer - 1; i >= 0; i--) {\n const length = Math.max(rowMatrices[i].primaryMatrix.length,\n rowMatrices[i].secondaryMatrix.length);\n centralMatrixPointer.row += length;\n }\n /* istanbul ignore next */\n for (let i = columnPointer - 1; i >= 0; i--) {\n const matrix = columnMatrices[i];\n const { primaryMatrix, secondaryMatrix } = matrix;\n const length = Math.max(primaryMatrix[0] ? primaryMatrix[0].length : 0,\n secondaryMatrix[0] ? secondaryMatrix[0].length : 0);\n centralMatrixPointer.column += length;\n }\n\n matrices.top[1] = columnMatrices[columnPointer].primaryMatrix;\n matrices.bottom[1] = columnMatrices[columnPointer].secondaryMatrix;\n\n matrices.center[0] = rowMatrices[rowPointer].primaryMatrix;\n matrices.center[2] = rowMatrices[rowPointer].secondaryMatrix;\n\n const rowMatrixLen = Math.max(matrices.center[0].length, matrices.center[2].length);\n /* istanbul ignore next */\n const columnMatrixLen = Math.max(matrices.top[1][0] ? matrices.top[1][0].length : 0, matrices.bottom[1][0] ?\n matrices.bottom[1][0].length : 0);\n matrices.center[1] = centerMatrix.slice(centralMatrixPointer.row, centralMatrixPointer.row + rowMatrixLen)\n .map(matrix => matrix.slice(centralMatrixPointer.column, centralMatrixPointer.column + columnMatrixLen));\n\n return {\n matrices,\n rowPages: rowMatrices.length,\n columnPages: columnMatrices.length\n };\n};\n\nconst measureSum = measureArr => measureArr.reduce((total, measure) => total + measure, 0);\n/**\n * Returns measurements of the cells of the current matrix\n *\n * @param {Object} layout instance of layout\n * @return {Object} returns the measurements for current view matrix\n */\nexport const getViewMeasurements = (layout, maxRowHeight, maxColWidth) => {\n const rowMatrix = layout.rowMatrix();\n const columnMatrix = layout.columnMatrix();\n const {\n columnPointer,\n rowPointer\n } = layout.config();\n\n const rowSpaces = rowMatrix.getViewableSpaces()[rowPointer];\n const colSpaces = columnMatrix.getViewableSpaces()[columnPointer];\n\n const {\n rowHeights,\n width: rowMatrixWidth\n } = rowSpaces;\n const {\n columnWidths,\n height: columnMatrixHeight\n } = colSpaces;\n\n const { primary: leftWidth, secondary: rightWidth } = rowMatrixWidth;\n const { primary: topHeight, secondary: bottomHeight } = columnMatrixHeight;\n\n const centerHeight = measureSum(rowHeights.primary);\n const centerWidth = measureSum(columnWidths.primary);\n const viewWidth = [leftWidth, Math.min(centerWidth, maxColWidth), rightWidth];\n const viewHeight = [topHeight, Math.min(centerHeight, maxRowHeight), bottomHeight];\n\n return {\n viewWidth,\n viewHeight,\n actualCenterMeasures: {\n height: centerHeight,\n width: centerWidth\n },\n totalMeasures: {\n width: measureSum(viewWidth),\n height: measureSum(viewHeight)\n },\n unitHeights: rowHeights,\n unitWidths: columnWidths\n };\n};\n","/**\n * This file declares a table that can be extended to create a Datagrid, crosstab\n * and man other visualzations that require a tabular structure.\n */\n\nimport { getUniqueId, mergeRecursive } from 'muze-utils';\nimport GenericLayout from '../generic-layout';\nimport { DEFAULT_CONFIGURATION, DEFAULT_MEASUREMENTS } from './defaults';\nimport { generateVisualMatrices } from './layout-helper';\nimport { computeLayoutMeasurements } from './computations';\nimport { getViewMeasurements, getViewMatrices } from './view-info-getter';\n/**\n * This class is used to create a tabular structure that\n * can house charts and values.\n *\n * @class GridLayout\n */\nexport default class GridLayout extends GenericLayout {\n\n /**\n * Creates an instance of TableLayout.\n * @param {HTMLElement} matrices Set of upto 9 matrices containing the cells to be rendered\n * @param {HTMLElement} mountPoint DOM element/d3 selection where the layout is to be mounted\n * @param {Object} measurement The dimensions of the layout\n * @param {Object} config external configurations.\n * @memberof GenericLayout\n */\n constructor (matrices, mountPoint, measurement, config) {\n super(mountPoint, measurement, config);\n this.matrices(matrices);\n this.config(this.constructor.defaultConfig());\n this._layoutId = getUniqueId();\n this._scrollInfo = { horizontal: false, vertical: false };\n }\n\n static defaultViewInfo () {\n return Object.assign({}, {\n layoutDimensions: {\n border: this.defaultConfig().border,\n viewHeight: [0, 0, 0],\n viewWidth: [0, 0, 0]\n },\n viewMatricesInfo: {\n columnPages: 0,\n rowPages: 0,\n matrices: { top: [], center: [], bottom: [] }\n }\n });\n }\n\n /**\n * Returns initial set of measurements for the grid layout\n *\n * @static\n * @return {Object} Returns initial set of measurements\n * @memberof GridLayout\n */\n static defaultMeasurement () {\n return DEFAULT_MEASUREMENTS;\n }\n\n /**\n * Returns initialconfiguration for grid layout\n *\n * @static\n * @return {Object} Returns initial configuration for grid layout\n * @memberof GridLayout\n */\n static defaultConfig () {\n return DEFAULT_CONFIGURATION;\n }\n\n /**\n * This function is used to return an instance of GridLayout\n *\n * @return {GridLayout} Instance of grid layout.\n * @static\n * @memberof GridLayout\n */\n static create () {\n return new GridLayout(null, null, this.defaultMeasurement(), this.defaultConfig());\n }\n\n /**\n * Sets/Gets the matrices for the layout\n *\n * @param {Array} matrices Set of matrices\n * @return {Object} Getter/Setter\n * @memberof GridLayout\n */\n matrices (matrices) {\n if (matrices) {\n this._matrices = generateVisualMatrices(this, matrices);\n return this;\n }\n return super.matrices(matrices);\n }\n\n /**\n * Triggers the computations for the layout based on the matrices available\n * This causes a reflow in the entire layout system.\n *\n * @return {Object} Layout instance\n * @memberof GridLayout\n */\n triggerReflow () {\n this.scrollInfo({ horizontal: false, vertical: false });\n const {\n maxHeightAvailableForRowMatrix,\n maxWidthAvailableForColumnMatrix\n } = computeLayoutMeasurements(this);\n\n this.setViewInformation(maxHeightAvailableForRowMatrix, maxWidthAvailableForColumnMatrix);\n return this;\n }\n\n gotoPage (type, pageNumber) {\n const pageType = type.toLowerCase();\n const { viewMatricesInfo } = this.viewInfo();\n const totalPages = viewMatricesInfo[`${pageType}Pages`];\n const pointer = Math.min(Math.max(1, pageNumber), totalPages);\n this.config({\n [`${pageType}Pointer`]: pointer - 1\n });\n this.setViewInformation();\n this.renderGrid();\n return this;\n }\n\n pages (type) {\n const { viewMatricesInfo } = this.viewInfo();\n const pageType = type.toLowerCase();\n return {\n totalPages: viewMatricesInfo[`${pageType}Pages`],\n currentPage: this.config()[`${pageType}Pointer`] + 1\n };\n }\n\n viewInfo (...viewInfo) {\n if (viewInfo.length) {\n this._viewInfo = viewInfo[0];\n return this;\n }\n return this._viewInfo;\n }\n\n scrollInfo (...scrollInfo) {\n if (scrollInfo.length) {\n this._scrollInfo = mergeRecursive(this._scrollInfo, scrollInfo[0]);\n return this;\n }\n return this._scrollInfo;\n }\n\n /**\n *\n *\n * @returns\n * @memberof GridLayout\n */\n setViewInformation (maxRowHeight, maxColWidth) {\n const {\n rowPointer,\n columnPointer,\n border\n } = this.config();\n const viewMatricesInfo = getViewMatrices(this, rowPointer, columnPointer);\n const layoutDimensions = getViewMeasurements(this, maxRowHeight, maxColWidth);\n layoutDimensions.border = border;\n this.viewInfo({\n viewMatricesInfo,\n layoutDimensions\n });\n return this;\n }\n}\n","import RowMatrix from '../visual-matrix/row-matrix';\nimport ColumnMatrix from '../visual-matrix/column-matrix';\n\nexport const generateVisualMatrices = (context, matrices) => {\n // Set of matrices for layout is generated starting with the left matrix\n let leftMatrix = [];\n let rightMatrix = [];\n let topMatrix = [];\n let bottomMatrix = [];\n let begColCells;\n let endColCells;\n const {\n isRowSizeEqual,\n isColumnSizeEqual,\n gutterSpace,\n distribution,\n border,\n breakPage,\n priority\n } = context.config();\n const {\n minUnitHeight,\n minUnitWidth\n } = context.measurement();\n const { top, center, bottom } = matrices;\n const [topLeft, topColumns, topRight] = top;\n const [leftRows, valueMatrix, rightRows] = center;\n const [bottomLeft, bottomColumns, bottomRight] = bottom;\n\n if (leftRows.length > 0) {\n // If no left matrix is present, context will be empty\n leftMatrix = [...topLeft, ...leftRows, ...bottomLeft];\n }\n if (rightRows.length > 0) {\n // If no right matrix is present, context will be empty\n rightMatrix = [...topRight, ...rightRows, ...bottomRight];\n }\n if (topColumns.length > 0 && topColumns[0].length > 0) {\n // If no top matrix is present, context will be empty\n topMatrix = topColumns.map((d, i) => [...topLeft[i], ...d, ...topRight[i]]);\n }\n if (bottomColumns.length > 0 && bottomColumns[0].length > 0) {\n // If no bottom matrix is present, context will be empty\n bottomMatrix = bottomColumns.map((d, i) => [...bottomLeft[i], ...d, ...bottomRight[i]]);\n }\n\n context.rowMatrix(new RowMatrix([leftMatrix, rightMatrix], {\n isDistributionEqual: isRowSizeEqual,\n distribution: distribution.rows,\n gutter: gutterSpace.rows,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.row,\n breakPage: breakPage.rows.map(e => e + Math.max(topLeft.length, topRight.length)),\n extraCellLengths: [topLeft.length, bottomLeft.length]\n }));\n\n if (topLeft.length > 0) {\n begColCells = topLeft[0].length;\n } else {\n begColCells = bottomLeft.length > 0 ? bottomLeft[0].length : 0;\n }\n\n if (topRight.length > 0) {\n endColCells = topRight[0].length;\n } else {\n endColCells = bottomRight.length > 0 ? bottomRight[0].length : 0;\n }\n\n context.columnMatrix(new ColumnMatrix([topMatrix, bottomMatrix], {\n isDistributionEqual: isColumnSizeEqual,\n distribution: distribution.columns,\n gutter: gutterSpace.columns,\n isTransposed: true,\n unitMeasures: {\n width: minUnitWidth,\n height: minUnitHeight,\n border: border.width\n },\n priority: priority.col,\n breakPage: breakPage.columns,\n extraCellLengths: [begColCells, endColCells]\n }));\n context.centerMatrix(valueMatrix);\n\n return matrices;\n};\n","import {\n TOP, BOTTOM, LEFT, RIGHT, CENTER, BLANK_BORDERS, COLUMN, ROW,\n VIEW_INDEX, ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, MIDDLE, NO_BORDERS\n} from '../enums/constants';\n\nconst borderMap = (isFacet, showHeaders) => ({\n [`${TOP}-${LEFT}`]: isFacet && showHeaders ? LEFT : NO_BORDERS,\n [`${TOP}-${MIDDLE}`]: COLUMN,\n [`${TOP}-${RIGHT}`]: isFacet && showHeaders ? RIGHT : NO_BORDERS,\n [`${CENTER}-${LEFT}`]: isFacet ? `${CENTER}${LEFT}` : ROW,\n [`${CENTER}-${MIDDLE}`]: CENTER,\n [`${CENTER}-${RIGHT}`]: isFacet ? `${CENTER}${RIGHT}` : ROW,\n [`${BOTTOM}-${LEFT}`]: NO_BORDERS,\n [`${BOTTOM}-${MIDDLE}`]: COLUMN,\n [`${BOTTOM}-${RIGHT}`]: NO_BORDERS\n});\n\nconst applySpecificBorder = (params) => {\n const { type, borderWidth, borderStyle, cells, isFacet, color } = params;\n if (!isFacet) {\n cells.style(`border-${type}`, `${borderWidth}px ${borderStyle} ${color}`);\n } else {\n cells.style(`border-${type}-width`, `${borderWidth}px`);\n cells.style(`border-${type}-style`, `${borderStyle}`);\n }\n};\n\nconst specificBorderApplier = (params) => {\n const { borderTypes, showBorders, cells, borderInfo, name, isFacet } = params;\n const {\n color,\n style,\n width\n } = borderInfo;\n borderTypes.forEach((borderType) => {\n applySpecificBorder({\n cells,\n color: showBorders[borderType] ? color : BLANK_BORDERS,\n type: borderType,\n borderWidth: width,\n borderStyle: style,\n name,\n isFacet\n });\n });\n};\n\nconst borderApplier = (cells, borderInfo, name, isFacet) => {\n const {\n showRowBorders,\n showColBorders,\n showValueBorders\n } = borderInfo;\n return {\n [ROW]: () => specificBorderApplier({\n borderTypes: [TOP, BOTTOM],\n showBorders: showRowBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [COLUMN]: () => specificBorderApplier({\n borderTypes: [LEFT, RIGHT],\n showBorders: showColBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [CENTER]: () => specificBorderApplier({\n borderTypes: [LEFT, RIGHT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [LEFT]: () => specificBorderApplier({\n borderTypes: [LEFT],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [RIGHT]: () => specificBorderApplier({\n borderTypes: [RIGHT],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [`${CENTER}${LEFT}`]: () => specificBorderApplier({\n borderTypes: [LEFT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n }),\n [`${CENTER}${RIGHT}`]: () => specificBorderApplier({\n borderTypes: [RIGHT, TOP, BOTTOM],\n showBorders: showValueBorders,\n cells,\n borderInfo,\n name,\n isFacet\n })\n };\n};\n\nexport const applyBorders = (params) => {\n const { cells, border, row, column, isFacet, showHeaders } = params;\n const name = `${ROW_MATRIX_INDEX[VIEW_INDEX[row]]}-${COLUMN_MATRIX_INDEX[column]}`;\n const borderApplierFn = borderApplier(cells, border, name, isFacet);\n const borderMapVal = borderMap(isFacet, showHeaders)[name];\n if (borderMapVal) {\n borderApplierFn[borderMapVal]();\n }\n};\n","import { selectElement } from 'muze-utils';\nimport {\n TOP, BOTTOM, ROW_SPAN, COL_SPAN, CENTER, ROW, COLUMN\n} from '../enums/constants';\n\nconst orderMaker = arr => Array.from(Array(arr.length).keys());\n\nconst nestByStack = (stack, updateArr, optionalParams = {}) => {\n let {\n order,\n keyFn\n } = optionalParams;\n const arr = updateArr.slice();\n const currStack = stack.slice();\n const prevStack = currStack.slice();\n // Order in which element are to be checked for nesting, default normal looping\n // Order is always in the order of nest, i.e., left to right\n order = order || Array.from(Array(arr.length).keys());\n\n // Key function, if array of objects\n keyFn = keyFn || (v => v);\n\n // Return same array if stack is empty\n if (currStack.length === 0) {\n const newArr = [];\n order.forEach((e) => {\n newArr.push(arr[e]);\n });\n return { prevStack, currStack: arr, arr: newArr };\n }\n\n let arrVal = '';\n let stackVal = '';\n const newArr = [];\n\n // Loop in order\n for (let i = order.length - 1; i >= 0; i--) {\n // Get current element index from the order given\n const currElemIndex = order[i];\n\n // Crete a hashmap for the hierarchy by joining strings of the array for both stack and input array\n arrVal += keyFn(arr[currElemIndex]);\n stackVal += keyFn(currStack[currElemIndex]);\n\n // If the current value and value in stack is same, convert it to null\n if (arrVal === stackVal) {\n newArr[currElemIndex] = null;\n } else {\n stackVal = '';\n // Loop from the current index in order to the last element in order to change the\n // whole hierarchy\n for (let j = i; j < order.length; j++) {\n const newElem = order[j];\n const arrElem = arr[newElem];\n\n newArr[newElem] = arrElem;\n\n // Reset stack to new stack\n currStack[newElem] = arrElem;\n stackVal = arrVal;\n }\n }\n }\n const returnArr = [];\n order.forEach((e) => {\n returnArr.push(newArr[e]);\n });\n return { prevStack, currStack, arr: returnArr };\n};\n\nconst spanCalculator = (colData, colIdx, matrix, rIdx) => {\n // if data is not header cell then rowspan\n // has to be 1\n if (!colData) {\n return () => null;\n }\n\n const conditions = {\n row: count => matrix[rIdx + count] && matrix[rIdx + count][colIdx],\n column: count => matrix[rIdx][colIdx + count]\n };\n\n return (type) => {\n let count = 1;\n let isNull = false;\n\n while (!isNull) {\n if (conditions[type](count) === null) {\n count += 1;\n } else {\n isNull = true;\n }\n }\n return count;\n };\n};\n\nconst maskCreator = (matrix, order) => ({\n row: () => {\n let stack = [];\n return matrix.map((e) => {\n const {\n currStack,\n arr\n } = nestByStack(stack, e, { keyFn: val => val.valueOf(), order });\n\n stack = currStack;\n return arr;\n });\n },\n column: () => {\n let stack = [];\n const viewMatrix = [];\n matrix.length && matrix[0].forEach((cell, colIndex) => {\n const hierarchy = [];\n matrix.forEach((row) => {\n hierarchy.push(row[colIndex]);\n });\n const {\n currStack,\n arr\n } = nestByStack(stack, hierarchy, { keyFn: val => val.valueOf(), order });\n stack = currStack;\n\n matrix.forEach((row, rowIndex) => {\n viewMatrix[rowIndex] = viewMatrix[rowIndex] || [];\n viewMatrix[rowIndex][colIndex] = arr[rowIndex];\n });\n });\n return viewMatrix;\n }\n});\n\nconst spanGenerator = viewMatrix => ({\n row: () => {\n const spans = [];\n viewMatrix.forEach((row, ridx) => {\n spans[ridx] = spans[ridx] || [];\n row.forEach((col, i) => {\n if (viewMatrix[ridx][i]) {\n const currSpan = spanCalculator(col, i, viewMatrix, ridx)('row');\n currSpan && spans[ridx].push(currSpan);\n }\n });\n });\n return spans;\n },\n column: () => viewMatrix.map((row, ridx) => row.map((col, i) => spanCalculator(col, i, viewMatrix, ridx)('column'))\n .filter(col => col !== null))\n});\n\nconst getOrder = () => ({\n row: matrix => orderMaker(matrix[0]),\n column: matrix => orderMaker(matrix)\n});\n\nconst matrixSpanGeneratorMap = {\n [`${TOP}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${BOTTOM}-1`]: {\n orderGetter: getOrder()[COLUMN],\n viewMatrixMaker: (...params) => maskCreator(...params)[COLUMN],\n spanMaker: (...params) => spanGenerator(...params)[COLUMN]\n },\n [`${CENTER}-0`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n },\n [`${CENTER}-2`]: {\n orderGetter: getOrder()[ROW],\n viewMatrixMaker: (...params) => maskCreator(...params)[ROW],\n spanMaker: (...params) => spanGenerator(...params)[ROW]\n }\n};\n\nconst matrixSpanGenerator = (type) => {\n const generator = matrixSpanGeneratorMap[type];\n if (generator) {\n return generator;\n }\n return {\n orderGetter: () => null,\n viewMatrixMaker: matrix => () => matrix,\n spanMaker: () => () => null\n };\n};\n\n/**\n * This function is used to set the col and row spans\n * for the matrices based on repeated/hierarchichal data\n *\n * @export\n * @param {Array} matrix The 2d array for which filtering is to be done\n * @param {string} type Type of array (center, top, bottom)\n * @param {number} index Index of array in the row\n * @return {Object} containing the view matrix and their spans\n */\nexport function cellSpanMaker (matrix, type, index) {\n let spans = null;\n let viewMatrix = matrix;\n const {\n orderGetter,\n viewMatrixMaker,\n spanMaker\n } = matrixSpanGenerator(`${type}-${index}`);\n\n if (matrix.length) {\n const order = orderGetter(matrix);\n viewMatrix = viewMatrixMaker(matrix, order)();\n spans = spanMaker(viewMatrix)();\n }\n return { viewMatrix, spans };\n}\n\nconst spaceAllocationDueToSpan = (span = 1, placeholder, config, index) => {\n const height = placeholder.availHeight();\n const width = placeholder.availWidth();\n const borderWidth = config.border.width;\n const { unitWidths } = config.dimensions;\n const { col } = index;\n\n return {\n [ROW_SPAN] () {\n placeholder.setAvailableSpace(width, height * span);\n if (span === 1) {\n selectElement(this).style('height', `${height * span + borderWidth}px`);\n }\n },\n [COL_SPAN] () {\n const primaryUnitWidth = unitWidths.primary[col];\n if (span > 1) {\n let cumulativeWidth = 0;\n for (let i = col; i < col + span; i++) {\n cumulativeWidth += unitWidths.primary[i] - borderWidth;\n }\n placeholder.setAvailableSpace(cumulativeWidth + borderWidth, height);\n } else if (primaryUnitWidth) {\n placeholder.setAvailableSpace(primaryUnitWidth - borderWidth, height);\n }\n selectElement(this).style('height', `${height}px`);\n }\n };\n};\n\nconst spanApplier = (cells, spans, config, type) => {\n let cellCounter = 0;\n cells.attr(type, function (cell, colIndex) {\n if (colIndex === 0) {\n cellCounter = 0;\n }\n const span = spans[cell.rowIndex][colIndex];\n const placeholder = cell.placeholder;\n const index = {\n row: cell.rowIndex,\n col: cellCounter\n };\n\n spaceAllocationDueToSpan(span, placeholder, config, index)[type].bind(this)();\n cellCounter += span;\n return span;\n });\n};\n\nconst spanApplierMap = {\n [`${TOP}-0`]: null,\n [`${TOP}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${TOP}-2`]: null,\n [`${CENTER}-0`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${CENTER}-1`]: null,\n [`${CENTER}-2`]: (...params) => spanApplier(...params, ROW_SPAN),\n [`${BOTTOM}-0`]: null,\n [`${BOTTOM}-1`]: (...params) => spanApplier(...params, COL_SPAN),\n [`${BOTTOM}-2`]: null\n};\n\nexport const applySpans = (cells, spans, config, type) => {\n const applier = spanApplierMap[type];\n if (applier) {\n applier(cells, spans, config);\n }\n};\n","import { ERROR_MSG } from 'muze-utils';\n/**\n * An Interface to be implemented if the transaction support is necessary. This class ensures reactivity to\n * global properties.\n */\nexport default class TransactionSupport {\n /**\n * Property accessor for data member of the class. Data is passed to the system by calling this method.\n */\n data () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for width of the class. Width is passed as an integer.\n */\n width () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for height of the class. Height is passed as an integer.\n */\n height () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n\n /**\n * Property accessor for config of the class. Config is passed as an object.\n */\n config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }\n}\n","import { TOP, BOTTOM, LEFT, TITLE, SUB_TITLE, GROUP, LAYOUT, LEGEND } from '../constants';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const arrangeComponents = (context) => {\n const legendConfig = context.config().legend;\n const titleConfig = context.title()[1];\n const subtitleConfig = context.subtitle()[1];\n const titleLayouts = {\n [`${TOP}-${TOP}`]: [TITLE, SUB_TITLE, GROUP],\n [`${BOTTOM}-${BOTTOM}`]: [GROUP, SUB_TITLE, TITLE],\n [`${TOP}-${BOTTOM}`]: [TITLE, GROUP, SUB_TITLE],\n [`${BOTTOM}-${TOP}`]: [SUB_TITLE, GROUP, TITLE]\n };\n const legendLayouts = [\n [LEGEND, LAYOUT],\n [LAYOUT, LEGEND]\n ];\n const titlePosition = titleConfig.position || TOP;\n const subtitlePosition = subtitleConfig.position || TOP;\n\n return {\n headers: titleLayouts[`${titlePosition}-${subtitlePosition}`],\n legends: legendConfig.position === LEFT || legendConfig.position === TOP ?\n legendLayouts[0] : legendLayouts[1]\n };\n};\n","/**\n * Flag to specify whether direction is vertical.\n */\nexport const MARGIN = 'margin';\nexport const LEFT = 'left';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const TOP = 'top';\nexport const SPACE_FIXER = 'spaceFixer';\nexport const CLASSPREFIX = 'muze';\nexport const VERTICAL_ALIGN = 'verticalAlign';\nexport const TEXT_ALIGN = 'textAlign';\nexport const IS_OFFSET = 'isOffset';\nexport const MIDDLE = 'middle';\nexport const BASELINE = 'baseline';\nexport const SHOW = 'show';\nexport const CENTER = 'center';\nexport const TEXT = 'text';\nexport const HEADER = 'header';\nexport const HEIGHT = 'height';\nexport const WIDTH = 'width';\nexport const DATA = 'data';\nexport const AXES = 'axes';\nexport const FACET_BY_FIELDS = 'facetByFields';\nexport const FIELDS = 'fields';\nexport const TRANSFORM = 'transform';\nexport const LAYER_DEF = 'layerDef';\nexport const CONFIG = 'config';\nexport const DETAIL_FIELDS = 'detailFields';\nexport const MAX_LINES = 'maxLines';\nexport const MIN_CHARS = 'minCharacters';\nexport const ROTATION = 'rotation';\n\nexport const TEXT_CELL = 'text-cell';\nexport const AXIS_CELL = 'axis-cell';\nexport const GEOM_CELL = 'geom-cell';\nexport const BLANK_CELL = 'blank-cell';\n\nexport const PADDING = 'padding';\nexport const HEADER_PADDING = 'headerPadding';\nexport const TITLE_PADDING = 'titlePadding';\n\nexport const TITLE = 'title';\nexport const SUBTITLE = 'subtitle';\n","// eneum to refer to simple cell\nexport const SIMPLE = 'simple';\n// eneum to refer to header cell\nexport const TEXT = 'text';\n// enum to refer to axis cell\nexport const AXIS = 'axis';\n// enum to refer to visual cell\nexport const GEOM = 'geom';\n// enum to refer blank cell\nexport const BLANK = 'blank';\n","import {\n ERROR_MSG,\n getUniqueId,\n mergeRecursive\n} from 'muze-utils';\nimport { SIMPLE } from './enums/cell-type';\nimport { SIMPLE_CELL } from './constants';\n\n/**\n * This file declares a class that is used as an interface to create new\n * SimpleCell elements.\n * @module SimpleCell\n */\n/**\n * Base class for all table cells.\n *\n * @interface\n * @class SimpleCell\n */\nclass SimpleCell {\n\n /**\n * Creates an instance of SimpleCell.\n *\n * @param {*} config The input configuration.\n * @memberof SimpleCell\n */\n constructor (config) {\n this._id = getUniqueId();\n\n const defConfig = mergeRecursive({}, this.constructor.defaultConfig());\n this._config = mergeRecursive(defConfig, config || {});\n\n this._mount = null;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n */\n get type () {\n return SIMPLE;\n }\n\n static formalName () {\n return SIMPLE_CELL;\n }\n\n /**\n * Returns the type of the placehlder.\n *\n * @readonly\n * @memberof SimpleCell\n * @return {Object} Default config for the placeholder\n */\n static defaultConfig () {\n return {};\n }\n\n /**\n * Returns the value contained by the SimpleCell.\n *\n * @memberof SimpleCell\n */\n valueOf () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a unique identifier for the instance used\n * to control selective rendering.\n *\n * @memberof SimpleCell\n */\n id () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns a serialized representation of the instance.\n *\n * @memberof SimpleCell\n */\n serialize () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Returns an object with width and height fields\n * specifying the space taken up by this metod.\n *\n * @memberof SimpleCell\n */\n getLogicalSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Method used to set the space available to render the SimpleCell\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @memberof SimpleCell\n */\n setAvailableSpace () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n render () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n /**\n * Render the SimpleCell inthe supplied mount point.\n *\n * @param {HTMLElement} mount The mount point to render in.\n * @memberof SimpleCell\n */\n remove () {\n throw new Error(ERROR_MSG.INTERFACE_IMPL);\n }\n\n getMinMeasures (providedMinMeasure = 0) {\n return providedMinMeasure;\n }\n\n}\n\nexport default SimpleCell;\n","export const SIMPLE_CELL = 'SimpleCell';\nexport const TEXT_CELL = 'TextCell';\nexport const AXIS_CELL = 'AxisCell';\nexport const BLANK_CELL = 'BlankCell';\nexport const GEOM_CELL = 'GeomCell';\n\n","/**\n * This file exports variables that are used as defaults for\n * the placeholders\n */\nimport * as CONSTANTS from './constants';\n\n /**\n * Default Configuration for the cells\n * @return {Object} Default configuration\n */\nexport const DEFAULT_CONFIG = {\n [CONSTANTS.MARGIN]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.SPACE_FIXER]: 2,\n [CONSTANTS.IS_OFFSET]: false,\n [CONSTANTS.VERTICAL_ALIGN]: null,\n [CONSTANTS.TEXT_ALIGN]: CONSTANTS.CENTER,\n [CONSTANTS.SHOW]: true,\n [CONSTANTS.MAX_LINES]: 0,\n [CONSTANTS.MIN_CHARS]: 0,\n [CONSTANTS.ROTATION]: null,\n [CONSTANTS.PADDING]: {\n [CONSTANTS.LEFT]: 8,\n [CONSTANTS.RIGHT]: 8,\n [CONSTANTS.TOP]: 10,\n [CONSTANTS.BOTTOM]: 0\n },\n [CONSTANTS.HEADER_PADDING]: {\n [CONSTANTS.LEFT]: 8,\n [CONSTANTS.RIGHT]: 5,\n [CONSTANTS.TOP]: 2,\n [CONSTANTS.BOTTOM]: 5\n },\n [CONSTANTS.TITLE_PADDING]: {\n [CONSTANTS.LEFT]: 0,\n [CONSTANTS.RIGHT]: 0,\n [CONSTANTS.TOP]: 0,\n [CONSTANTS.BOTTOM]: 0\n }\n};\n","import { mergeRecursive } from 'muze-utils';\nimport { GEOM, TEXT, AXIS, BLANK } from './enums/cell-type';\n\nconst DEFAULT_PROPS = {\n mount: {},\n availHeight: {},\n availWidth: {},\n config: {\n sanitization: (context, value) => mergeRecursive(context._config, value)\n },\n logicalSpace: {},\n minSpacing: {},\n source: {}\n};\n\nconst geomProps = {\n data: {},\n caption: {},\n config: {},\n axes: {},\n facetByFields: {},\n fields: {},\n transform: {},\n layerDef: {},\n detailFields: {}\n};\n\nconst textProps = {\n smartText: {}\n};\nexport const PROPS = {\n [GEOM]: mergeRecursive(geomProps, DEFAULT_PROPS),\n [TEXT]: mergeRecursive(textProps, DEFAULT_PROPS),\n [AXIS]: DEFAULT_PROPS,\n [BLANK]: DEFAULT_PROPS\n};\n","/**\n * This file declares a class that represents a table cell\n * used to house an axis.\n * @module VisualCell\n */\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport { CLASSPREFIX, HEIGHT, WIDTH, AXIS_CELL, BOTTOM, TOP } from './enums/constants';\nimport SimpleCell from './simple-cell';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { AXIS } from './enums/cell-type';\nimport { PROPS } from './props';\nimport * as CONSTANTS from './constants';\n\n/**\n * Computes the logical space of the an axis instance within an axis cell\n *\n * @param {Object} context Required to get the needed parameters to compute axis space\n * @return {Object} Returns the logical space for axis\n */\nconst computeAxisSpace = (context) => {\n let logicalWidth;\n let logicalHeight;\n const axis = context.source();\n const {\n spaceFixer,\n margin\n } = context.config();\n const {\n width,\n height\n } = axis.getLogicalSpace();\n const {\n show\n } = axis.config();\n if (show === true) {\n logicalHeight = Math.floor(height + margin.top + margin.bottom + spaceFixer);\n logicalWidth = Math.floor(width + margin.left + margin.right + spaceFixer);\n } else {\n [logicalWidth, logicalHeight] = [width, height];\n }\n return {\n width: logicalWidth,\n height: logicalHeight\n };\n};\n\n/**\n * Represents an axis cell.\n *\n * @class Axis\n */\nclass AxisCell extends SimpleCell {\n\n /**\n * Creates an instance of AxisCell.\n *\n * @param {Object} config The input config.\n * @memberof AxisCell\n */\n constructor (config) {\n super(config);\n\n this._axis = null;\n this._availHeight = null;\n this._availWidth = null;\n this._logicalSpace = null;\n\n generateGetterSetters(this, PROPS[AXIS]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof AxisCell\n */\n get type () {\n return AXIS;\n }\n\n /**\n * This method return the value conatined by this SimpleCell.\n *\n * @return {SimpleAxis | ColorAxis} Instance of SimpleAxis or ColorAxis.\n * @memberof AxisCell\n */\n valueOf () {\n return this.source().id;\n }\n\n /**\n * This method return the unique identififer of the axis\n *\n * @return {string} Id of the axis.\n * @memberof AxisCell\n */\n get id () {\n return this._id;\n }\n\n static formalName () {\n return CONSTANTS.AXIS_CELL;\n }\n\n /**\n * Retrns the serialized representation of this cell.\n *\n * @return {Object}Object with serializable props.\n * @memberof AxisCell\n */\n serialize () {\n return {\n type: AXIS,\n axis: this.source().serialize()\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof AxisCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * return the space taken up by an axis element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof AxisCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeAxisSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space availiable to render\n * the SimpleCell.\n *\n * @param {number} width The width of SimpleCell.\n * @param {number} height The height of SimpleCell.\n * @return {Instance} Returns current Instance\n * @memberof AxisCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n const {\n margin,\n isOffset\n } = this.config();\n\n if (width || height) {\n this.source().setAvailableSpace(width, height, margin, isOffset);\n this.source().logicalSpace(null);\n } else {\n this.source().resetLogicalSpace();\n }\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the axis inside the axis cell.\n *\n * @param {HTMLElement} mount The mount point.\n * @return {Selection} node where axis mounted\n * @memberof AxisCell\n */\n /* istanbul ignore next */render (mount) {\n if (!mount) {\n return this;\n }\n let actualWidth = 0;\n let actualHeight = 0;\n const axis = this.source();\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const {\n margin\n } = this.config();\n const {\n top,\n bottom,\n left,\n right\n } = margin;\n const {\n show,\n orientation\n } = axis.config();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [this], `${CLASSPREFIX}-${AXIS_CELL}`);\n const selection = makeElement(wrapperDiv, 'svg', [1], `${CLASSPREFIX}-axis-container`);\n selection.classed(`${CLASSPREFIX}-axis-container-${orientation}`, true);\n\n this.mount(mount);\n if (!availWidth) {\n selection.attr(WIDTH, `${0}px`);\n }\n if (!availHeight) {\n selection.attr(HEIGHT, `${0}px`);\n }\n actualWidth = availWidth;\n actualHeight = availHeight;\n if (!show) {\n actualWidth = (orientation === TOP || orientation === BOTTOM) ? availWidth : 0;\n actualHeight = (orientation === TOP || orientation === BOTTOM) ? 0 : availHeight;\n }\n wrapperDiv.style(WIDTH, `${actualWidth}px`)\n .style(HEIGHT, `${actualHeight}px`)\n .style('margin-top', top)\n .style('margin-bottom', bottom)\n .style('margin-left', left)\n .style('margin-right', right);\n\n axis.mount(selection.node());\n return selection;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Current instance of AxisCell\n * @memberof AxisCell\n */\n remove () {\n this.source() && this.source().remove();\n this.mount() && this.mount().remove();\n return this;\n }\n}\n\nexport default AxisCell;\n\n","/**\n * This file declares a class that represents a BLANK element in a table.\n * @module VisualCell\n */\nimport {\n selectElement,\n makeElement,\n applyStyle,\n generateGetterSetters\n } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { CLASSPREFIX, BLANK_CELL } from './enums/constants';\nimport { BLANK } from './enums/cell-type';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { PROPS } from './props';\nimport * as CONSTANTS from './constants';\n\n/**\n * Represents a table haeder.\n *\n * @class BLANK\n */\nclass BlankCell extends SimpleCell {\n\n /**\n * Creates an instance of BLANK.\n * @param {Object} config The input configuration.\n * @memberof BLANK\n */\n constructor (config) {\n super(config);\n\n generateGetterSetters(this, PROPS[BLANK]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof BlankCell\n */\n get type () {\n return BLANK;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof BlankCell\n */\n valueOf () {\n return this.id;\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof BlankCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * This method is used to return a unique identifier for\n * the BLANK cell.\n *\n * @return {string} The unique identifier for the BLANK.\n * @memberof BlankCell\n */\n get id () {\n return this._id;\n }\n\n static formalName () {\n return CONSTANTS.BLANK_CELL;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof BLANK\n */\n serialize () {\n return {\n type: BLANK\n };\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof BLANK\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n return {\n width: this.width || 0,\n height: this.height || 0\n };\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the BLANK cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof BLANK\n */\n /* istanbul ignore next */render (mount) {\n if (mount) {\n const { style } = this.config();\n // append span element to mount point\n this.mount(mount);\n const container = selectElement(mount);\n const elem = makeElement(container, 'div', [this.id]);\n elem.classed(`${CLASSPREFIX}-${BLANK_CELL}`, true);\n elem.style('width', `${this.availWidth()}px`);\n elem.style('height', `${this.availHeight()}px`);\n elem.html('');\n // apply style on the returned element\n if (style) {\n applyStyle(elem, style);\n }\n } return this;\n }\n\n /**\n * Removes the cell(Disposal)\n *\n * @return {Instance} Returns current Instance\n * @memberof BlankCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n\n getMinMeasures () {\n return 0;\n }\n }\nexport default BlankCell;\n","import {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n HEADER,\n TITLE,\n SUBTITLE\n} from './enums/constants';\n\nexport const setSmartText = (context) => {\n const source = context.source();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n rotation\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const labelManager = context.dependencies().labelManager;\n\n labelManager.setStyle(context._computedStyle);\n\n !rotation && context.smartText(labelManager.getSmartText(source, availWidth, availHeight, false));\n rotation && context.smartText(labelManager.getSmartText(source, availHeight, availWidth, true));\n\n return context;\n};\n\nexport const isTitleSubtitle = (subType) => {\n let returnVal = false;\n if (subType === `${TITLE}` || subType === `${SUBTITLE}`) {\n returnVal = true;\n }\n return returnVal;\n};\n\n/**\n* Computes the Logical Space for the text\n*\n* @param {Object} context Required to get the needed parameters to compute text space\n* @return {Object} Logical space taken up by text\n* @memberof TextCell\n*/\nexport const computeTextSpace = (context) => {\n const { labelManager } = context.dependencies();\n const {\n height: minHeightSpace,\n width: minWidthSpace\n } = context.minSpacing();\n const {\n margin,\n show,\n maxLines,\n minCharacters\n } = context.config();\n const {\n left,\n right,\n top,\n bottom\n } = margin;\n const paddedHeight = top + bottom + minHeightSpace;\n const paddedWidth = left + right + minWidthSpace;\n const availHeight = context.availHeight() - paddedHeight;\n const availWidth = context.availWidth() - paddedWidth;\n const source = context.source();\n const space = context.smartText();\n const minText = new Array(minCharacters).fill('W').join('');\n const _minTextSpace = labelManager.getOriSize(minText);\n\n context.config({ rotation: false });\n if (space.width > (availWidth || 0) && maxLines) {\n space.height = space.oriTextHeight * maxLines;\n }\n if (availWidth && availWidth < space.width) {\n space.width = _minTextSpace.width;\n }\n if (availWidth && availWidth < Math.min(_minTextSpace.width, space.oriTextWidth)) {\n const smartSpace = labelManager.getSmartText(source, availHeight, _minTextSpace.height, true);\n const { height: smHeight, width: smWidth } = smartSpace;\n space.width = smWidth;\n space.height = smHeight;\n context.config({ rotation: true });\n context.smartText(smartSpace);\n }\n\n const { subType, headerPadding } = context.config();\n if (!isTitleSubtitle(subType)) {\n space.width += headerPadding[LEFT] + headerPadding[RIGHT];\n }\n\n if (show) {\n return {\n width: Math.ceil(space.width) + paddedWidth,\n height: Math.ceil(space.height) + paddedHeight\n };\n } return {\n width: 0,\n height: 0\n };\n};\n\nexport const setPadding = (measures) => {\n const { elem, className, headerPadding, padding, type, titlePadding } = measures;\n let localPadding;\n if (isTitleSubtitle(className)) {\n localPadding = titlePadding;\n } else if (type === HEADER) {\n localPadding = headerPadding;\n } else {\n localPadding = padding;\n }\n [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => {\n elem.style(`padding-${position}`, `${localPadding[position]}px`);\n });\n return elem;\n};\n","/**\n * This file declares a class that represents a Text element in a table.\n * @module VisualCell\n */\n\nimport {\n selectElement,\n makeElement,\n getSmartComputedStyle,\n generateGetterSetters\n} from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { TEXT } from './enums/cell-type';\nimport { PROPS } from './props';\nimport { DEFAULT_CONFIG } from './enums/defaults';\nimport { CLASSPREFIX, TOP, BOTTOM, LEFT, RIGHT, HEADER, WIDTH, TEXT_CELL } from './enums/constants';\nimport './text-cell.scss';\nimport * as CONSTANTS from './constants';\nimport {\n setSmartText,\n computeTextSpace,\n setPadding\n} from './text-cell-helper';\n\n/**\n * Represents a table haeder.\n *\n * @class Text\n */\nclass TextCell extends SimpleCell {\n\n /**\n * Creates an instance of Text.\n * @param {Object} config The input configuration.\n * @param {string} dependencies Dependencies for the class(labelManager)\n * @memberof Text\n */\n constructor (config, dependencies) {\n super(config);\n\n this._dependencies = dependencies;\n this._className = this._config.className ||\n (this._config.type === HEADER ? `${CLASSPREFIX}-${HEADER}-cell` : `${CLASSPREFIX}-${TEXT}-cell`);\n this._computedStyle = getSmartComputedStyle(selectElement('body'), this._className);\n this._dependencies.labelManager.setStyle(this._computedStyle);\n generateGetterSetters(this, PROPS[TEXT]);\n const space = this._dependencies.labelManager.getOriSize('w');\n this.minSpacing({ width: Math.floor(space.width * 3 / 4), height: Math.floor(space.height / 2) });\n setSmartText(this);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof TextCell\n */\n get type () {\n return TEXT;\n }\n\n /**\n * This method return the value contained by this SimpleCell.\n *\n * @return {string} The text value contained by this cell.\n * @memberof TextCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return a unique identifier for\n * the Text cell.\n *\n * @return {string} The unique identifier for the Text.\n * @memberof TextCell\n */\n get id () {\n return this._id;\n }\n\n /**\n * Returns the dependencies of the instance\n *\n * @return {Object} Dependencies needed by the class\n * @memberof TextCell\n */\n dependencies () {\n return this._dependencies;\n }\n\n /**\n * This method is used to obtain a serialized representation of this instance.\n *\n * @return {Object} Object with serilizable props.\n * @memberof TextCell\n */\n serialize () {\n return {\n text: this.source(),\n type: TEXT\n };\n }\n\n /**\n * return the default configuration for the text cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof TextCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n static formalName () {\n return CONSTANTS.TEXT_CELL;\n }\n\n /**\n * This method return the space taken up\n * by the text with the style applied.\n *\n * @return {Object} width and height taken up by the text.\n * @memberof Text\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeTextSpace(this));\n }\n const space = computeTextSpace(this);\n this.logicalSpace(space);\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the available space.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n setAvailableSpace (width, height) {\n this.availWidth(width);\n this.availHeight(height);\n setSmartText(this);\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * This method is used to render the Text cell inside\n * the provided mount point.\n *\n * @param {HTMLElement} mount The mount point for this cell.\n * @return {Instance} Returns current Instance\n * @memberof Text\n */\n render (mount) {\n const availWidth = this.availWidth();\n const availHeight = this.availHeight();\n const {\n margin,\n show,\n verticalAlign,\n textAlign,\n rotation,\n padding,\n type,\n headerPadding,\n className,\n titlePadding\n } = this.config();\n\n this.mount(mount);\n if (show) {\n const container = selectElement(mount);\n let elem = makeElement(container, 'div', [this.id], `${CLASSPREFIX}-${TEXT_CELL}`);\n const vAlign = verticalAlign || rotation ? 'middle' : 'top';\n const {\n width,\n height\n } = this.smartText();\n const {\n height: minHeightSpace\n } = this.minSpacing();\n const translation = {\n top: width + minHeightSpace / 2,\n middle: width / 2 + minHeightSpace,\n bottom: minHeightSpace\n };\n\n container.style('vertical-align', vAlign);\n\n // Set class name\n elem.classed(this._className, true);\n\n // Apply styles\n elem.style('display', 'inline');\n elem.style('transform', rotation ? `translate(${height / 2}px,\n ${translation[vAlign]}px) rotate(-90deg)` : '');\n elem.style(WIDTH, availWidth ? `${availWidth}px` : '100%');\n\n [TOP, BOTTOM, LEFT, RIGHT].forEach((position) => {\n container.style(`margin-${position}`, `${margin[position]}px`);\n });\n\n elem = setPadding({ elem, className, headerPadding, padding, type, titlePadding });\n if (this._className === 'muze-grid-headers') {\n elem.style('text-align', textAlign);\n }\n elem.style('display', 'inline');\n // set the text as the innerHTML\n this._dependencies.labelManager.setStyle(this._computedStyle);\n elem.html(this._dependencies.labelManager.getSmartText(this.source(), availWidth, availHeight, true).text);\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Instance} Returns current Instance\n * @memberof TextCell\n */\n remove () {\n this.mount() && this.mount().remove();\n return this;\n }\n }\n\nexport default TextCell;\n","/**\n * This file declares a class that is used to represent a table cell\n * that houses a visual unit.\n * @module VisualCell\n */\n\nimport { selectElement, makeElement, generateGetterSetters } from 'muze-utils';\nimport SimpleCell from './simple-cell';\nimport { GEOM } from './enums/cell-type';\nimport { PROPS } from './props';\nimport {\n CLASSPREFIX, HEIGHT, WIDTH, DATA, AXES, FACET_BY_FIELDS, FIELDS, TRANSFORM, LAYER_DEF, CONFIG, GEOM_CELL,\n DETAIL_FIELDS\n} from './enums/constants';\nimport * as CONSTANTS from './constants';\nimport { DEFAULT_CONFIG } from './enums/defaults';\n\n/**\n * Calculates the logical space of the cell\n *\n * @param {Object} context Required to get the needed parameters to compute unit space\n * @return {Object} Logical space taken up by the unit\n * @memberof GeomCell\n */\nconst computeGeomSpace = (context) => {\n const config = context.source().config();\n const { width, height } = config;\n return {\n width: Math.ceil(width),\n height: Math.ceil(height + context.getCaptionSpace().height)\n };\n};\n\n /**\n * This class represents a SimpleCell for visual unit.\n *\n * @class GeomCell\n */\nclass GeomCell extends SimpleCell {\n\n /**\n * Creates an instance of GeomCell.\n * @param {Object} config The input configuration.\n * @memberof GeomCell\n */\n constructor (config) {\n super(config);\n\n this._unit = null;\n this._layers = null;\n this._axes = {};\n this._datamodel = {};\n this._facetByFields = {};\n this._fields = null;\n this._transform = null;\n this._caption = null;\n\n generateGetterSetters(this, PROPS[GEOM]);\n }\n\n /**\n * return the type pf SimpleCell cell.\n *\n * @readonly\n * @memberof GeomCell\n */\n get type () {\n return GEOM;\n }\n\n /**\n * This method return the value contained by this cell.\n *\n * @return {VisualUnit} Instance of visual unit contained by visual unit.\n * @memberof GeomCell\n */\n valueOf () {\n return this.source();\n }\n\n /**\n * This method is used to return the id of the\n * visual unit housed by this cell.\n *\n * @return {string} The unique id of the visual unit.\n * @memberof GeomCell\n */\n get id () {\n return this.source().id();\n }\n\n static formalName () {\n return CONSTANTS.GEOM_CELL;\n }\n\n /**\n * This method return a serialized representation of\n * this instance.\n *\n * @return {Object} Object with serializable props.\n * @memberof GeomCell\n */\n serialize () {\n return {\n type: GEOM,\n unit: this.source().serialize(),\n caption: this.caption()\n };\n }\n\n /**\n * return the default configuration for the geom cell\n *\n * @static\n * @return {Object} Default configuration of the cell\n * @memberof GeomCell\n */\n static defaultConfig () {\n return DEFAULT_CONFIG;\n }\n\n /**\n * Updates the model based on the changed parameters\n *\n * @return {Instance} return instance\n * @memberof GeomCell\n */\n updateModel () {\n const unit = this.source();\n unit.clearCaching();\n [LAYER_DEF, TRANSFORM, AXES, FIELDS, CONFIG, DATA, AXES, FACET_BY_FIELDS, DETAIL_FIELDS].forEach((prop) => {\n this[prop]() && unit[prop](this[prop]());\n });\n return this;\n }\n\n /**\n * It gives the space taken by the caption of the unit\n *\n * @return {Object} return the space taken by caption\n * @memberof GeomCell\n */\n getCaptionSpace () {\n const caption = this.caption();\n\n let captionSpace = { width: 0, height: 0 };\n if (caption) {\n captionSpace = caption.getLogicalSpace();\n }\n return captionSpace;\n }\n\n /**\n * return the space taken up by the element in the dom.\n *\n * @return {Object} Object with width and height fields.\n * @memberof GeomCell\n */\n getLogicalSpace () {\n if (!this.logicalSpace()) {\n this.logicalSpace(computeGeomSpace(this));\n }\n return this.logicalSpace();\n }\n\n /**\n * This method is used to set the space available to\n * render the SimpleCell.\n *\n * @param {number} width The available width.\n * @param {number} height The available height.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n setAvailableSpace (width, height) {\n const unit = this.source();\n\n this.availWidth(width);\n this.availHeight(height);\n unit.lockModel()\n .width(width).height(height - this.getCaptionSpace().height)\n .unlockModel();\n this.logicalSpace(null);\n return this;\n }\n\n /**\n * his method is used to render the visual unit inside the provided cell.\n *\n * @param {HTMLElement} mount The mountpoint in the table.\n * @return {Instance} Returns current Instance\n * @memberof GeomCell\n */\n render (mount) {\n if (mount) {\n this.mount(mount);\n const availHeight = this.availHeight();\n const availWidth = this.availWidth();\n const caption = this.caption();\n const wrapperDiv = makeElement(selectElement(mount), 'div', [1], `${CLASSPREFIX}-${GEOM_CELL}`);\n\n if (caption) {\n const captionDom = makeElement(wrapperDiv, 'div', [caption], `${CLASSPREFIX}-unit-caption`).node();\n caption.render(captionDom);\n }\n const selection = makeElement(wrapperDiv, 'div', [1], `${CLASSPREFIX}-unit`);\n wrapperDiv.style(WIDTH, `${availWidth}px`).style(HEIGHT, `${availHeight}px`);\n selection.style(WIDTH, `${availWidth}px`)\n .style(HEIGHT, `${availHeight - this.getCaptionSpace().height}px`);\n this.source().mount(selection.node());\n }\n return this;\n }\n\n /**\n * Disposes the cell\n *\n * @return {Object} Current instance\n * @memberof GeomCell\n */\n remove () {\n this.mount() && this.mount().remove();\n this.source().remove();\n return this;\n }\n}\n\nexport default GeomCell;\n","import AxisCell from './axis-cell';\nimport BlankCell from './blank-cell';\nimport TextCell from './text-cell';\nimport GeomCell from './geom-cell';\nimport SimpleCell from './simple-cell';\n\nimport * as CONSTANTS from './constants';\n\nexport const DEFAULT_PLACEHOLDERS = {\n [CONSTANTS.SIMPLE_CELL]: SimpleCell,\n [CONSTANTS.TEXT_CELL]: TextCell,\n [CONSTANTS.AXIS_CELL]: AxisCell,\n [CONSTANTS.GEOM_CELL]: GeomCell,\n [CONSTANTS.BLANK_CELL]: BlankCell\n};\n","import { DEFAULT_PLACEHOLDERS } from './defaults';\n\n/**\n * Creates a registry for the cells, which can be used for\n * setting a new cell or getting the registered cells\n *\n * @return {Object} Setters and getters for registered cells\n */\nconst cellRegistry = () => {\n const reg = DEFAULT_PLACEHOLDERS;\n return {\n register: (def) => {\n const key = def.formalName();\n if (key in reg) {\n reg[key] = def;\n }\n return cellRegistry;\n },\n get: () => reg\n };\n};\nexport default cellRegistry;\n","import { TextCell } from '@chartshq/visual-cell';\nimport { escapeHTML } from 'muze-utils';\nimport { TOP } from '../constants';\n\n/**\n *\n *\n * @param {*} rawContent\n *\n */\nconst resolveTitleSubTitleContent = (rawContent) => {\n if (typeof rawContent === 'function' && !rawContent._sanitize) {\n return rawContent();\n }\n return escapeHTML(rawContent());\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} cellType\n * @param {*} labelManager\n * @param {*} prevCell\n *\n */\nconst headerCreator = (config, cellType, labelManager, prevCell) => {\n let margin = {};\n const {\n content,\n classPrefix,\n maxLines\n } = config;\n const cell = prevCell || new TextCell(\n {\n type: cellType === 'title' ? 'header' : 'text',\n className: `${classPrefix}-${cellType}-cell`,\n subType: cellType\n }, {\n labelManager\n })\n .config({ maxLines }).minSpacing({ width: 0, height: 0 });\n\n cell.source(content);\n cell._minTickDiff = { height: 0, width: 0 };\n\n if (config.position === TOP) {\n margin = { top: 0, bottom: config.padding };\n } else {\n margin = { top: config.padding, bottom: 0 };\n }\n cell.config({ margin });\n\n return {\n height: cell.getLogicalSpace().height,\n cell\n };\n};\n\n/**\n *\n *\n * @param {*} config\n * @param {*} type\n * @param {*} labelManager\n * @param {*} cell\n *\n */\nconst createHeading = (config, type, labelManager, prevCell) => {\n if (!config) { return ''; }\n\n return headerCreator(\n config,\n type,\n labelManager,\n prevCell\n );\n};\n\n/**\n *\n *\n * @param {*} context\n */\nexport const createHeaders = (context, canvasHeight, canvasWidth) => {\n let headerHeight = 0;\n const headers = {};\n const subtitle = context.subtitle();\n const isSubtitle = resolveTitleSubTitleContent(subtitle[0]);\n\n canvasHeight >= 200 && canvasWidth >= 200 && ['title', 'subtitle'].forEach((type) => {\n const headerOptions = context[type]();\n const content = resolveTitleSubTitleContent(headerOptions[0]);\n if (content) {\n const config = headerOptions[1];\n\n config.width = context.width();\n config.height = context.height();\n config.classPrefix = context.config().classPrefix;\n config.content = content;\n config.padding = (type === 'title' && !isSubtitle.length) ? subtitle[1].padding : config.padding;\n\n const { height, cell } = createHeading(config, type, context.dependencies().smartlabel,\n context[`${type}Cell`]);\n\n headers[`${type}Cell`] = cell;\n context._composition[type] = cell;\n headerHeight += height;\n }\n });\n return { headerHeight, headers };\n};\n\n","import { TextCell, AxisCell } from '@chartshq/visual-cell';\nimport { getValueParser, retrieveFieldDisplayName, DataModel, getObjProp } from 'muze-utils';\nimport {\n VERTICAL, HORIZONTAL, LEFT, RIGHT, LEGEND_TYPE_MAP, PADDING,\n BORDER, MARGIN, SIZE, COLOR, IS_POINT_MAP, POINT\n} from '../constants';\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n *\n */\nexport const legendCreator = (canvas) => {\n let LegendCls;\n const dataset = [];\n const axes = canvas.getRetinalAxes();\n\n Object.entries(axes).forEach((axisInfo) => {\n const scale = axisInfo[1][0];\n const scaleType = axisInfo[0];\n const scaleProps = canvas[scaleType]();\n\n if (scaleProps.field && scale) {\n const {\n type,\n step\n } = scale.config();\n\n const stepMapper = typeof step === 'boolean' ? step : false;\n LegendCls = LEGEND_TYPE_MAP[`${type}-${stepMapper}-${scaleType}`];\n dataset.push({\n scale,\n canvas,\n fieldName: scaleProps.field,\n title: retrieveFieldDisplayName(canvas.data(), scaleProps.field),\n LegendCls,\n scaleType\n });\n }\n });\n\n return dataset;\n};\n\n/**\n * @param {*} mark mark of the layers in the canvas\n * @param {*} scaleType type of the scale to draw the legend ie shape, size or color\n *\n */\nexport const legendIconShapeMapper = (layers, scaleType) => {\n const layerMarks = layers.map(el => el.mark);\n const shape = IS_POINT_MAP[(scaleType === COLOR || scaleType === SIZE)\n && layerMarks.includes(POINT)];\n return shape;\n};\n\n/**\n *\n *\n * @param {*} legendConfig\n * @param {*} canvases\n * @param {*} measurement\n * @param {*} prevLegends\n *\n */\nexport const legendInitializer = (legendConfig, canvas, measurement, prevLegends) => {\n const legends = [];\n const {\n height,\n width,\n headerHeight\n } = measurement;\n const {\n position,\n align\n } = legendConfig;\n\n const legendInfo = legendCreator(canvas);\n const { invalidValues } = canvas.config();\n const interactionRegistry = canvas.registry().interactions;\n const parser = getValueParser(invalidValues);\n\n legendInfo.forEach((dataInfo, index) => {\n const legendMeasures = {};\n const {\n LegendCls,\n scale,\n fieldName,\n title: titleText,\n scaleType\n } = dataInfo;\n const config = legendConfig[scaleType] || {};\n const title = config.title || {};\n title.text = title.text || titleText;\n if (config.show) {\n config.position = position;\n config.align = align;\n let legend = getObjProp(prevLegends[scaleType], index);\n if (!legend) {\n legend = LegendCls.create({\n labelManager: canvas._dependencies.smartlabel,\n cells: {\n AxisCell, TextCell\n },\n registry: {\n interactions: interactionRegistry\n }\n });\n }\n legendMeasures.maxHeight = align === VERTICAL ? (height - headerHeight) : height * 0.2;\n legendMeasures.maxWidth = align === HORIZONTAL ? width : width * 0.2;\n legendMeasures.width = Math.min(legendMeasures.maxWidth, config.width);\n legendMeasures.height = Math.min(legendMeasures.maxHeight, config.height);\n\n [PADDING, BORDER, MARGIN].forEach((e) => {\n legendMeasures[e] = config[e];\n });\n const metaData = legend.metaData();\n if (metaData instanceof DataModel) {\n metaData.dispose();\n }\n\n const mark = canvas.composition().visualGroup.resolver().matrixLayers()[0][0];\n config.shape = legendIconShapeMapper(mark, scaleType);\n\n legend.scale(scale)\n .valueParser(parser)\n .title(title)\n .fieldName(fieldName)\n .config(config)\n .metaData(canvas.composition().visualGroup.getGroupByData().project([fieldName]))\n .measurement(legendMeasures)\n .canvasAlias(canvas.alias())\n .setLegendMeasures();\n\n legends.push({ canvas, legend, scaleType });\n }\n });\n return legends;\n};\n\n/**\n *\n *\n * @param {*} legends\n * @param {*} legendConfig\n * @param {*} availableHeight\n * @param {*} availableWidth\n *\n */\nexport const getLegendSpace = (legends, legendConfig, availableHeight, availableWidth) => {\n const legendMeasures = legends.map(legendInfo => legendInfo.legend.measurement());\n const legendSpace = { width: 0, height: 0 };\n\n legendMeasures.forEach((space) => {\n let height = 0;\n let width = 0;\n width = Math.min(space.width, space.maxWidth);\n height = Math.min(space.height, space.maxHeight);\n\n if (legendConfig.align === HORIZONTAL) {\n if (legendSpace.width + width > availableWidth) {\n legendSpace.width = availableWidth;\n legendSpace.height += height;\n } else {\n legendSpace.width += width;\n legendSpace.height = Math.max(legendSpace.height, height);\n }\n } else if (legendSpace.height + height > availableHeight) {\n legendSpace.height = height;\n legendSpace.width += width;\n } else {\n legendSpace.height += height;\n legendSpace.width = Math.max(legendSpace.width, width);\n }\n });\n if (legendConfig.align === HORIZONTAL) {\n legendSpace.width = availableWidth;\n }\n return legendSpace;\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} headerHeight\n *\n */\nexport const createLegend = (context, headerHeight, height, width) => {\n const measurement = {\n height,\n width,\n headerHeight\n };\n const { legend } = context.config();\n const { show, position } = legend;\n\n legend.classPrefix = context.config().classPrefix;\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n\n legend.show = show ? ((align === VERTICAL && width > 200) || (align === HORIZONTAL && height > 200)) : show;\n legend.align = align;\n return legendInitializer(legend, context, measurement, context.composition().legend || {});\n};\n","import { LayoutComponent } from '../../../../layout/src/tree-layout';\n\nexport default class MuzeComponent extends LayoutComponent {\n getLogicalSpace () {\n const { width, height } = this.boundBox();\n return { width, height };\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y, left: conf.x });\n this.newDimensions = {\n width: conf.width,\n height: conf.height\n };\n this.renderAt(conf.renderAt);\n }\n\n getBoundBox () {\n return this.boundBox();\n }\n\n updateWrapper () {\n throw Error('Update is not implemented');\n }\n\n setParams () {\n throw Error('set params is not implemented');\n }\n\n setComponentInfo () {\n throw Error('setComponentInfo is not implemented');\n }\n}\n","import { selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { LEFT } from '../../constants';\n\nexport default class HeaderComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n renderHeader (container) {\n const layoutConfig = this.params.config;\n container = selectElement(container);\n const { align } = layoutConfig;\n const sel = container\n .selectAll(`.${layoutConfig.classPrefix}-inner-container`)\n .data([this.name]);\n sel.exit().remove();\n const selEnter = sel.enter().append('div');\n\n const cont = selEnter.merge(sel);\n cont.classed(`${layoutConfig.classPrefix}-inner-container`, true);\n const { height, width } = this.boundBox();\n this.component.setAvailableSpace(width, height);\n\n this.component && this.component.render(cont.node());\n\n cont.selectAll('div').classed(`${layoutConfig.classPrefix}-inner-content`, true);\n cont.style('width', `${100}%`);\n\n if (layoutConfig && this.component) {\n cont.style('float', LEFT)\n .style('text-align', align);\n // .style(`padding-${position === TOP ? BOTTOM : TOP}`, `${padding}px`);\n }\n }\n\n draw (container) {\n this.renderHeader(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.setParams(params);\n this.name(params.name);\n this.boundBox(params.component.getLogicalSpace());\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n setSpatialConfig (conf) {\n this.boundBox({ top: conf.y,\n left: conf.x,\n width: conf.width,\n height: conf.height });\n this.renderAt(conf.renderAt);\n }\n}\n","import { makeElement, selectElement } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport {\n LEFT, RIGHT, VERTICAL, HORIZONTAL, TOP, BOTTOM, HORIZONTAL_CENTER, VERTICAL_CENTER\n} from '../../constants';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\n\nfunction defaultAlignmentHelper (position) {\n let alignment = null;\n const alignWith = `${ROW_MATRIX_INDEX[1]}-${COLUMN_MATRIX_INDEX[1]}`;\n switch (position) {\n case TOP:\n case BOTTOM:\n alignment = HORIZONTAL_CENTER;\n break;\n case LEFT:\n case RIGHT:\n alignment = VERTICAL_CENTER;\n break;\n default:\n alignment = VERTICAL_CENTER;\n }\n return { alignment, alignWith };\n}\nexport default class LegendComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.measurement.legendSpace, 0);\n this.setParams(params);\n }\n\n renderLegend (container) {\n container = selectElement(container);\n const sectionComponents = [];\n const { position, classPrefix } = this.params.config;\n const legendMount = makeElement(container, 'div', [this.components],\n `${classPrefix}-inner-content`, {}, d => d);\n legendMount.classed(`${classPrefix}-legend`, true);\n const align = (position === LEFT || position === RIGHT) ? VERTICAL : HORIZONTAL;\n const legWidth = this.newDimensions.width;\n const legHeight = this.newDimensions.height;\n\n [container, legendMount].forEach((elem) => {\n elem.style('width', `${Math.floor(legWidth)}px`)\n .style('height', `${legHeight}px`)\n .style('float', LEFT);\n });\n\n if (align === VERTICAL) {\n let sections = -1;\n let currHeight = legHeight;\n let currWidth = 0;\n\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n if (leg.measurement().height > currHeight) {\n sections++;\n currWidth = 0;\n currHeight = legHeight;\n } else {\n sections < 0 && sections++;\n }\n sectionComponents[sections] = sectionComponents[sections] || [];\n currHeight -= Math.min(leg.measurement().height, currHeight);\n currWidth = Math.max(Math.min(leg.measurement().width, leg.measurement().maxWidth), currWidth);\n sectionComponents[sections].push({\n legend: leg,\n legendHeight: legHeight,\n legendWidth: currWidth\n });\n });\n\n const mount = makeElement(legendMount, ['div'], sectionComponents, `${classPrefix}-legend-section`);\n // mount.each((d, i) => selectElement(this).classed(`${classPrefix}-legend-section-${i}`, true));\n mount.classed(`${classPrefix}-legend-vertical-section`, true)\n .style('width', d => `${d[0].legendWidth}px`);\n makeElement(mount, ['div'], d => d, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .each(function (d) {\n d.legend.mount(this);\n })\n .style('width', d => `${d.legendWidth}px`);\n } else {\n const mount = makeElement(legendMount, 'div', [1], `${classPrefix}-legend-section`);\n mount.classed(`${classPrefix}-legend-horizontal-section`, true);\n mount.classed(`${classPrefix}-legend-section-${0}`, true)\n .style('width', `${legWidth}px`);\n\n makeElement(mount, 'div', this.components, `${classPrefix}-legend-components`, {}, d => d.legend.id())\n .style('width', d => `${d.legend.measurement().width}px`)\n .each(function (d) { d.legend.mount(this); });\n }\n }\n\n draw (container) {\n this.renderLegend(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.measurement.legendSpace);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.components = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n const { alignWith, alignment } = defaultAlignmentHelper(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith || alignWith);\n this.alignment(params.config.alignment || alignment);\n }\n\n setComponentInfo (params) {\n const { rootNode } = params;\n this.components.forEach((legendInfo) => {\n const leg = legendInfo.legend;\n leg.setParentInfo({ canvasRoot: rootNode });\n });\n }\n\n}\n","import {\n selectElement,\n makeElement,\n getD3Drag,\n getEvent,\n getWindow,\n hasTouch\n} from 'muze-utils';\nimport './scroll-bar.scss';\nimport { WIDTH, HEIGHT } from '../../../constants';\n\nconst d3Drag = getD3Drag();\n\nconst arrowSizeMap = {\n left: WIDTH,\n right: WIDTH,\n top: HEIGHT,\n bottom: HEIGHT\n};\n\nexport const getUnitPositions = (unitMeasures, totalLength, viewLength) => {\n let currentLen = 0;\n const measures = unitMeasures.primary && unitMeasures.primary.length ?\n unitMeasures.primary : unitMeasures.secondary;\n\n return measures.map((e) => {\n const unitPosition = currentLen * 100 / (totalLength - viewLength);\n currentLen += e;\n return unitPosition;\n });\n};\n\nexport const createScrollBarArrow = (mount, type, config) => {\n const {\n classPrefix,\n thickness\n } = config;\n const arrow = makeElement(mount, 'div', [type], `${classPrefix}-scroll-arrow-${type}`);\n\n arrow.classed(`${classPrefix}-scroll-arrow`, true);\n arrow.style(arrowSizeMap[type], `${thickness}px`);\n\n const chevron = makeElement(arrow, 'div', [1], `${classPrefix}-scroll-arrow-chevron`);\n\n chevron.attr('id', `${classPrefix}-scroll-arrow-chevron-${type}`);\n\n return arrow;\n};\n\nexport const createScrollBarRect = (mount, config) => {\n const {\n classPrefix\n } = config;\n const rect = makeElement(mount, 'div', [1], `${classPrefix}-scroll-rect`);\n const mover = makeElement(rect, 'div', [1], `${classPrefix}-scroll-mover`);\n\n return { rect, mover };\n};\n\nexport const applyRectClick = (scrollMaker, moverRect) => {\n const {\n rect\n } = moverRect;\n\n rect.on('click', () => {\n const event = getEvent();\n scrollMaker.emptyScrollAreaClick(event);\n });\n};\n\nconst applyMoverDrag = (scrollMaker, moverRect) => {\n let startPos = {};\n let moverStartPos = 0;\n let rectStartPos = 0;\n let endPos = {};\n const {\n mover,\n rect\n } = moverRect;\n\n mover.call(d3Drag()\n .on('start', () => {\n const event = getEvent();\n\n moverStartPos = mover.node().getBoundingClientRect();\n rectStartPos = rect.node().getBoundingClientRect();\n startPos = {\n x: event.x,\n y: event.y\n };\n })\n .on('drag', () => {\n const event = getEvent();\n const window = getWindow();\n\n endPos = {\n x: event.x,\n y: event.y\n };\n const distanceMoved = {\n x: endPos.x - startPos.x,\n y: endPos.y - startPos.y\n };\n const actualPosition = {\n x: moverStartPos.x + distanceMoved.x - rectStartPos.x + window.pageXOffset,\n y: moverStartPos.y + distanceMoved.y - rectStartPos.y + window.pageYOffset\n };\n\n scrollMaker.changeMoverPosition(actualPosition);\n }));\n};\n\nconst applyScrollMouseDownAction = (moverRect, scrollMaker, speed) => {\n const {\n mover,\n rect\n } = moverRect;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n scrollMaker.changeMoverPosition({ x: x - rectX + speed, y: y - rectY + speed });\n};\n\nconst registerListenerOnArrow = (scrollMaker, moverRect, arrowType, speed) => {\n let timer = '';\n const arrow = scrollMaker._components[arrowType];\n const isTouchDevice = hasTouch();\n\n arrow.on(isTouchDevice ? 'touchstart' : 'mousedown', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n timer = setInterval(() => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n }, 100);\n }).on(isTouchDevice ? 'touchend' : 'mouseup', () => {\n const event = getEvent();\n\n event.preventDefault();\n\n clearInterval(timer);\n }).on('click', () => {\n applyScrollMouseDownAction(moverRect, scrollMaker, speed);\n });\n};\n\nexport const registerListeners = (scrollMaker) => {\n const {\n moverRect\n } = scrollMaker._components;\n\n const speed = scrollMaker.config().speed;\n\n registerListenerOnArrow(scrollMaker, moverRect, 'prevArrow', -speed);\n applyMoverDrag(scrollMaker, moverRect);\n applyRectClick(scrollMaker, moverRect);\n registerListenerOnArrow(scrollMaker, moverRect, 'nextArrow', speed);\n};\n\nexport const scrollContainerHelper = (mountPoint, config, dimensions, type) => {\n const {\n classPrefix\n } = config;\n const scrollBarContainer = makeElement(selectElement(mountPoint), 'div', [1], `#${classPrefix}-scroll-bar-${type}`);\n\n scrollBarContainer.classed(`${classPrefix}-scroll-bar`, true);\n scrollBarContainer.style(WIDTH, `${dimensions.width}px`);\n scrollBarContainer.style(HEIGHT, `${dimensions.height}px`);\n return scrollBarContainer;\n};\n\n","import { mergeRecursive } from 'muze-utils';\n\nexport const PROPS = {\n\n config: {\n sanitization: (context, value) => {\n value = mergeRecursive(context._config, value);\n return value;\n }\n },\n manager: {},\n unitPositions: {},\n logicalSpace: {}\n};\n\n","import { ERROR_MSG, generateGetterSetters } from 'muze-utils';\nimport {\n scrollContainerHelper,\n registerListeners\n} from './helper';\nimport { PROPS } from './props';\n\nexport class ScrollMaker {\n\n constructor () {\n this._components = {};\n this._logicalSpace = {};\n this._attachedScrollAction = () => {};\n this._config = {\n thickness: 10,\n speed: 2\n };\n this._unitPositions = null;\n\n generateGetterSetters(this, PROPS);\n }\n\n static type () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n emptyScrollAreaClick () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n changeMoverPosition () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n scrollDeltaTo () {\n throw new ERROR_MSG('Method not implemented');\n }\n\n createScroll (mountPoint) {\n const config = this.config();\n\n return {\n scrollBarContainer: scrollContainerHelper(mountPoint, config, this.logicalSpace(), this.constructor.type())\n };\n }\n\n attachScrollAction (externalScrollAction) {\n this._attachedScrollAction = externalScrollAction;\n return this;\n }\n\n detachScrollAction () {\n this._attachedScrollAction = () => {};\n return this;\n }\n\n getLogicalSpace () {\n return this.logicalSpace();\n }\n\n registerListeners () {\n registerListeners(this);\n return this;\n }\n\n remove () {\n this._components.scrollBarContainer.remove();\n return this;\n }\n}\n\n","import MuzeComponent from './muze-chart-component';\nimport { HorizontalScrollMaker } from './scroll-bar-maker/horizontal-scroll-maker';\nimport { VerticalScrollMaker } from './scroll-bar-maker/vertical-scroll-maker';\n\nconst scrollMakerMap = {\n horizontal: HorizontalScrollMaker,\n vertical: VerticalScrollMaker\n};\n\n/**\n * Scroll Component acts as a wrapper over the scoll bars created using the respective Scroll Makers\n * This provides a consistent API for layouting using the tree layout system.\n *\n *\n * @class\n * @public\n * @module ScrollComponent\n */\nexport default class ScrollComponent extends MuzeComponent {\n\n constructor (params) {\n const ScrollMaker = scrollMakerMap[params.config.type];\n\n params.component = new ScrollMaker();\n params.component.config(params.config.scrollBarComponentConfig);\n params.component.logicalSpace(params.dimensions);\n super(params.name, params.component.getLogicalSpace(), 0);\n this.setParams(params);\n }\n\n manager (...manager) {\n if (manager.length) {\n this.component.manager(manager[0]);\n return this;\n }\n return this.component.manager();\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollDeltaTo (delta) {\n this.component.scrollDeltaTo(delta);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollTo (scrollPercentage) {\n this.component.scrollTo(scrollPercentage);\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page based on the unit index.\n * The input is provided as a number represting the index for the unit.\n * For vertical scroll, it's the row index that will be required.\n * For horizontal scroll, it's the column index that will be required\n *\n * @public\n *\n * @param {number} unitIndex Index of the unit appearing in the grid\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n scrollToUnitIndex (unitIndex) {\n const unitPositions = this.component.unitPositions();\n const sanitizedUnitIndex = Math.min(Math.max(0, unitIndex), unitPositions.length - 1);\n this.component.scrollTo(unitPositions[sanitizedUnitIndex]);\n return this;\n }\n\n /**\n * Provides the positions of the units(either horizontal or vertical based on the type\n * of scroll bar it wraps) relative to it's container. The position of the first unit starts at 0\n *\n *\n * @public\n *\n * @return {Array} Positions of units either horizontal or vertical\n */\n getScrollPositionsForUnits () {\n return this.component.unitPositions();\n }\n\n draw (container) {\n this.component.createScroll(container || document.getElementById(this.renderAt()));\n return this;\n }\n\n /**\n * Can be used to attach a scroll action whenever scrolling occurs in the canvas\n *\n * @public\n * @param {number} externalAction Action to be attached during scroll\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n attachScrollAction (externalAction) {\n this.component.attachScrollAction(externalAction);\n return this;\n }\n\n /**\n * Can be used to detach the scroll action already bound to the scroll bar\n *\n * @public\n * @return {ScrollComponent} Instance of the ScrollComponent\n */\n detachScrollAction () {\n this.component.detachScrollAction();\n return this;\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.component.config(params.config.scrollBarComponentConfig);\n this.component.logicalSpace(params.dimensions);\n this.boundBox(this.component.getLogicalSpace());\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component || this.component;\n this.params = params;\n this.target(params.config.target);\n this.position(params.config.position);\n this.className(params.config.className);\n this.alignWith(params.config.alignWith);\n this.alignment(params.config.alignment);\n }\n\n remove () {\n this.component.remove();\n }\n}\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { HORIZONTAL, HEIGHT, WIDTH, LEFT } from '../../../constants';\n\nexport class HorizontalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: horizontal\n */\n static type () {\n return HORIZONTAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, config, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'left', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'right', config);\n const {\n mover,\n rect\n } = moverRect;\n\n const { height, width, totalLength, viewLength, unitWidths } = this.logicalSpace();\n const scrollBarWithouArrowLength = width - height * 2;\n\n rect.style(WIDTH, `${dimensions.width - height * 2}px`);\n rect.style(HEIGHT, `${100}%`);\n mover.style(WIDTH, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(HEIGHT, `${100}%`);\n mover.style(LEFT, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n this.unitPositions(getUnitPositions(unitWidths, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n let positionAdjuster = speed * 10;\n if (event.x < x) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n const {\n totalLength\n } = this.logicalSpace();\n\n if (newPosition.x < 0) {\n currentPos = 0;\n } else if (newPosition.x + moverPos.width > rectStartPos.width) {\n currentPos = rectStartPos.width - moverPos.width;\n } else {\n currentPos = newPosition.x;\n }\n\n mover.style(LEFT, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: 0, x: moverPos.x - rectStartPos.x - delta });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {HorizontalScrollMaker} Instance of the HorizontalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.width)) / 100;\n\n this.changeMoverPosition({ y: 0, x: movement });\n return this;\n }\n\n}\n\n","import { ScrollMaker } from './scroll-maker';\nimport { createScrollBarRect, createScrollBarArrow, getUnitPositions } from './helper';\nimport { VERTICAL, TOP, HEIGHT, WIDTH } from '../../../constants';\n\nexport class VerticalScrollMaker extends ScrollMaker {\n\n /**\n * Describes the type of the ScrollMaker\n *\n * @public\n *\n * @return {String} Returns the type of scroll maker: vertical\n */\n static type () {\n return VERTICAL;\n }\n\n createScroll (mountPoint, dimensions = this.logicalSpace()) {\n const config = this.config();\n const { scrollBarContainer } = super.createScroll(mountPoint, dimensions);\n const prevArrow = createScrollBarArrow(scrollBarContainer, 'top', config);\n const moverRect = createScrollBarRect(scrollBarContainer, config);\n const nextArrow = createScrollBarArrow(scrollBarContainer, 'bottom', config);\n const {\n mover,\n rect\n } = moverRect;\n const { height, width, totalLength, viewLength, unitHeights } = this.logicalSpace();\n const scrollBarWithouArrowLength = height - width * 2;\n\n rect.style(HEIGHT, `${scrollBarWithouArrowLength}px`);\n rect.style(WIDTH, `${100}%`);\n mover.style(WIDTH, `${100}%`);\n mover.style(HEIGHT, `${(viewLength * scrollBarWithouArrowLength) / totalLength}px`);\n mover.style(TOP, `${0}px`);\n\n this._components = {\n prevArrow,\n nextArrow,\n moverRect,\n scrollBarContainer\n };\n this._scrollBarWithouArrowLength = scrollBarWithouArrowLength;\n\n this.unitPositions(getUnitPositions(unitHeights, totalLength, viewLength));\n this.registerListeners();\n }\n\n emptyScrollAreaClick (event) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const speed = this.config().speed;\n const { x, y } = mover.node().getBoundingClientRect();\n const { x: rectX, y: rectY } = rect.node().getBoundingClientRect();\n\n let positionAdjuster = speed * 10;\n if (event.y < y) {\n positionAdjuster = -speed * 10;\n }\n this.changeMoverPosition({ x: x - rectX + positionAdjuster, y: y - rectY + positionAdjuster });\n }\n\n changeMoverPosition (newPosition) {\n let currentPos;\n const {\n mover,\n rect\n } = this._components.moverRect;\n const {\n totalLength\n } = this.logicalSpace();\n const rectStartPos = rect.node().getBoundingClientRect();\n const moverPos = mover.node().getBoundingClientRect();\n\n if (newPosition.y < 0) {\n currentPos = 0;\n } else if (newPosition.y + moverPos.height > rectStartPos.height) {\n currentPos = rectStartPos.height - moverPos.height;\n } else {\n currentPos = newPosition.y;\n }\n mover.style(TOP, `${currentPos}px`);\n const totalDistance = this._scrollBarWithouArrowLength;\n const movedViewLength = (currentPos * totalLength) / totalDistance;\n\n this.manager().performAttachedScrollFunction(this.constructor.type(), movedViewLength);\n }\n\n /**\n * Scrolls based on the actual pixel value provided. Since it's a delta change, the input will be\n * a delta between (-Infinity, Infinity), based on which the scroll will occur. Only a delta movement in\n * scroll occurs\n *\n * @public\n *\n * @param {number} delta Based on which the scroll will have a delta change in position\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollDeltaTo (delta) {\n const {\n mover,\n rect\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const rectStartPos = rect.node().getBoundingClientRect();\n\n this.changeMoverPosition({ y: moverPos.y - rectStartPos.y - delta, x: 0 });\n return this;\n }\n\n /**\n * Scrolls to the specific point in the page. The input is provided as a percentage (0 - 100)\n *\n * @public\n *\n * @param {number} scrollPercentage Its the percentage based on which the scroll action will occur\n * @return {VerticalScrollMaker} Instance of the VerticalScrollMaker\n */\n scrollTo (scrollPercentage) {\n const {\n mover\n } = this._components.moverRect;\n const moverPos = mover.node().getBoundingClientRect();\n const movement = (scrollPercentage * (this._scrollBarWithouArrowLength - moverPos.height)) / 100;\n\n this.changeMoverPosition({ x: 0, y: movement });\n return this;\n }\n\n}\n","import { makeElement } from 'muze-utils';\nimport { cellSpanMaker, applySpans } from '../../../../layout/src/grid-layout/span-maker';\nimport { applyBorders } from '../../../../layout/src/grid-layout/border-helper';\nimport '../../border-applier.scss';\nimport {\n TOP, CENTER\n} from '../../../../layout/src/enums/constants';\nimport MuzeComponent from './muze-chart-component';\nimport { WIDTH, HEIGHT, HIDDEN, OVERFLOW, AUTO, VISIBLE } from '../../constants';\n\nconst renderPlaceholders = (cells) => {\n // Rendering content within placeholders\n cells.each(function (cell) {\n cell.placeholder.render(this);\n });\n};\n\nexport default class MatrixComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n this.className(params.config.className);\n }\n\n applyScroll (container) {\n const row = this.params.config.row;\n const column = this.params.config.column;\n const { horizontal, vertical } = this.params.config.scrollInfo;\n container.style(OVERFLOW, VISIBLE);\n container.style(WIDTH, AUTO);\n container.style(HEIGHT, AUTO);\n\n if (horizontal && column === 1) {\n container.style(OVERFLOW, HIDDEN);\n container.style(WIDTH, '100%');\n }\n\n if (vertical && row === CENTER) {\n container.style(OVERFLOW, HIDDEN);\n container.style(HEIGHT, '100%');\n }\n }\n\n renderMatrix (mountPoint) {\n const { classPrefix, row, column, dimensions, border, isFacet, showHeaders } = this.params.config;\n\n // Creating containers for each matrix individually\n const containerForMatrix = makeElement(mountPoint, 'div', [1], `${classPrefix}-grid-${row}-${column + 1}`)\n .classed(`${classPrefix}-grid-${row}`, true)\n .classed(`${classPrefix}-grid`, true);\n\n this.applyScroll(containerForMatrix);\n\n const {\n viewMatrix,\n spans\n } = cellSpanMaker(this.component, row, column);\n\n // Rendering the table components\n const { cells } = this.renderTable(containerForMatrix, `${classPrefix}-grid`, viewMatrix);\n\n applySpans(cells, spans, { dimensions, border }, `${row}-${column}`);\n renderPlaceholders(cells);\n\n cells.exit().each((cell) => {\n cell.placeholder.remove();\n });\n\n applyBorders({ cells, border, row, column, isFacet, showHeaders });\n }\n\n renderTable (mount, className, rowData) {\n const table = makeElement(mount, 'table', ['layout'], `${className}-table`);\n const body = makeElement(table, 'tbody', ['layout'], `${className}-body`);\n const rows = makeElement(body, 'tr', rowData, `${className}-tr`);\n const cells = makeElement(rows, 'td',\n (d, i) => d.filter(e => e !== null).map(e =>\n ({ placeholder: e, rowIndex: i })), `${className}-td`, {\n update: (elem, cell) => {\n const { externalClassname } = cell.placeholder.config();\n externalClassname && externalClassname.map(d => elem.classed(`${className}-${d}`, true));\n }\n }, key => key.placeholder.id);\n\n return { table, body, rows, cells };\n }\n\n draw (container) {\n this.renderMatrix(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.position(TOP);\n this.className(params.config.className);\n }\n}\n","import { selectElement, getEvent } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport MatrixComponent from './matrix-component';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX } from '../../../../layout/src/enums/constants';\nimport { WHEEL_DELTA_MODIFIER } from '../../enums/constants';\n\n/**\n * Based on the type of scroll, it changes the scrollLeft/scrollTop property of the specific\n * elements based on the scroll distance provided\n *\n *\n */\nconst applyScrollAction = (elem, classPrefix, scollDistance, type) => {\n selectElement(elem)\n .selectAll(`.${classPrefix}-grid`)\n .property(type, scollDistance);\n};\n\n/**\n * Applies the action of the scroll by actually scrolling the respective matrices based on the\n * type of scroll. It returns a function which has both the scroll methods available\n *\n * @return {Object} contains the horizontal and vertical scroll actions on the grid component\n */\nconst scrollActionApplier = (movement, context) => {\n const classPrefix = context.params.config.classPrefix;\n\n return {\n horizontal: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[e][1].renderAt()}`, classPrefix, movement, 'scrollLeft'));\n },\n vertical: () => {\n [0, 1, 2].forEach(e =>\n applyScrollAction(`#${context.component[1][e].renderAt()}`, classPrefix, movement, 'scrollTop'));\n }\n };\n};\n\nexport default class GridComponent extends MuzeComponent {\n\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.gridComponents = [];\n this.setParams(params);\n }\n\n sanitizeGrid () {\n let height = 0;\n let width = 0;\n const { viewMatricesInfo, layoutDimensions } = this.component.viewInfo();\n const scrollInfo = this.component.scrollInfo();\n const {\n viewHeight,\n viewWidth,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n\n for (let i = 0; i < 3; i++) {\n if (!(this.gridComponents.length && this.gridComponents[i] instanceof Array)) {\n this.gridComponents[i] = [];\n }\n for (let j = 0; j < 3; j++) {\n const matrixDim = {\n height: viewHeight[i],\n width: viewWidth[j],\n unitHeights,\n unitWidths\n };\n const matrix = viewMatricesInfo.matrices[`${ROW_MATRIX_INDEX[i]}`][j];\n const matrixName = `${ROW_MATRIX_INDEX[i]}-${COLUMN_MATRIX_INDEX[j]}`;\n const matrixConfig = {\n dimensions: matrixDim,\n border: layoutDimensions.border,\n classPrefix: this.params.config.classPrefix,\n scrollInfo,\n row: ROW_MATRIX_INDEX[i],\n column: j\n };\n if (this.gridComponents[i][j] instanceof MuzeComponent) {\n const { isFacet, showHeaders } = this.params.component.config();\n matrixConfig.isFacet = isFacet;\n matrixConfig.showHeaders = showHeaders;\n this.gridComponents[i][j].updateWrapper({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n } else {\n const { isFacet, showHeaders } = this.params.component.config();\n matrixConfig.isFacet = isFacet;\n matrixConfig.showHeaders = showHeaders;\n const matrixWrapper = new MatrixComponent({\n name: matrixName,\n component: matrix,\n config: matrixConfig\n });\n this.gridComponents[i].push(matrixWrapper);\n }\n if (i === 0) {\n width += matrixDim.width;\n }\n if (j === 0) {\n height += matrixDim.height;\n }\n }\n }\n this.boundBox({ height, width });\n\n this.component = this.gridComponents;\n this.allComponents = this.gridComponents;\n }\n\n scrollBarManager (...manager) {\n if (manager.length) {\n this._scrollBarManager = manager[0];\n return this;\n }\n return this._scrollBarManager;\n }\n\n /**\n * Attaches a mousewheel listener to the center matrix, based on which the scrolling can occur.\n * It uses the scroll component to change the position of the scroller, which ultimately scrolls the center matrix\n *\n *\n * @return {GridComponent} Instance of the GridComponent\n */\n attachScrollListener () {\n const scrollBarManager = this.scrollBarManager();\n selectElement(`#${this.component[1][1].renderAt()}`)\n .on('wheel', () => {\n const event = getEvent();\n const {\n wheelDeltaX,\n wheelDeltaY\n } = event;\n\n // Scrolling horizontally\n if (wheelDeltaX !== 0 && Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('horizontal', event)\n .triggerScrollBarAction('horizontal', wheelDeltaX / WHEEL_DELTA_MODIFIER);\n }\n\n // Scrolling Vertically\n if (wheelDeltaY !== 0 && Math.abs(wheelDeltaX) < Math.abs(wheelDeltaY)) {\n scrollBarManager.preventBrowserScroll('vertical', event)\n .triggerScrollBarAction('vertical', wheelDeltaY / WHEEL_DELTA_MODIFIER);\n }\n });\n return this;\n }\n\n performScrollAction (direction, movedView) {\n scrollActionApplier(movedView, this)[direction]();\n return this;\n }\n\n getBoundBox () {\n const { top, left } = this.component[0][0].boundBox();\n const { height, width } = this.boundBox();\n\n return {\n top,\n left,\n height,\n width\n };\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n this.component = params.component;\n this.params = params;\n this.target(params.config.target);\n this.className(params.config.className);\n this.sanitizeGrid();\n return this;\n }\n\n attachListener () {\n this.attachScrollListener();\n return this;\n }\n}\n","export const SIDE_EFFECT_COMMON = 'common';\nexport const SIDE_EFFECT_INDIVIDUAL = 'individual';\nexport const TOOLTIP_CONSOLIDATED = 'consolidated';\nexport const TOOLTIP_FRAGMENTED = 'fragmented';\nexport const WHEEL_DELTA_MODIFIER = 30;\n","import { selectElement, makeElement, applyStyle } from 'muze-utils';\nimport MuzeComponent from './muze-chart-component';\nimport { incorrectMessageIcon } from './message-icon';\nimport { MESSAGE_CONFIG } from '../defaults';\n\nconst formatFontSize = (width, height) => {\n const { baseFontLimit, upperFontLimit, baseSizeLimit, upperSizeLimit } = MESSAGE_CONFIG;\n const fractionFont = (upperSizeLimit - baseSizeLimit) / (upperFontLimit - baseFontLimit);\n let fontSize = upperFontLimit;\n const dim = width < height && width !== 0 ? width : height;\n\n if (dim === 0) {\n fontSize = 0;\n } else if (dim <= baseSizeLimit) {\n fontSize = baseFontLimit;\n } else if (dim > baseSizeLimit && dim < upperSizeLimit) {\n fontSize = baseFontLimit + (upperSizeLimit - dim) / fractionFont;\n }\n return fontSize;\n};\n\nexport default class MessageComponent extends MuzeComponent {\n constructor (params) {\n super(params.name, params.config.dimensions, 0);\n this.setParams(params);\n }\n\n render (container) {\n const parent = selectElement(container);\n\n const { config } = this.params;\n const { className } = config.classPrefix;\n\n const node = makeElement(parent, 'div', [1], className);\n const { height, width } = config.dimensions;\n const childHeight = height > MESSAGE_CONFIG.baseSizeLimit ? MESSAGE_CONFIG.fractionChild * height : 0;\n const { message } = config;\n\n applyStyle(node, { width: `${width}px`, height: `${height}px` });\n\n const childNode = makeElement(node, 'div', [1], `${className}-child`);\n const imageNode = makeElement(childNode, 'div', [1], `${className}-child-img`);\n const messageNode = makeElement(childNode, 'div', [1], `${className}-child-message`);\n\n applyStyle(childNode, { width, height: `${childHeight}px` });\n applyStyle(imageNode, { width, height: `${childHeight * MESSAGE_CONFIG.fractionImage}px` });\n\n imageNode.html(incorrectMessageIcon);\n\n const textElement = makeElement(messageNode, 'text', [1]);\n applyStyle(messageNode, { 'font-size': `${formatFontSize(width, height)}px` });\n\n textElement.html(message);\n }\n\n draw (container) {\n this.render(container || document.getElementById(this.renderAt()));\n }\n\n updateWrapper (params) {\n this.name(params.name);\n this.boundBox(params.config.dimensions);\n this.setParams(params);\n return this;\n }\n\n setParams (params) {\n const { target, className } = params.config;\n this.component = params.component;\n this.params = params;\n this.target(target);\n this.className(className);\n this.position(params.config.position);\n return this;\n }\n}\n","export const incorrectMessageIcon = `\n\n\nGroup 23\n Created with Sketch.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n","import {\n TITLE,\n SUB_TITLE,\n LEGEND, VERTICAL,\n HORIZONTAL,\n WIDTH,\n HEIGHT,\n TOP,\n LEFT,\n RIGHT,\n MESSAGE,\n GRID,\n ERROR_MESSAGE,\n HORIZONTAL_CENTER\n} from '../constants';\nimport HeaderComponent from './components/headerComponent';\nimport LegendComponent from './components/legendComponent';\nimport ScrollComponent from './components/scroll-component';\nimport GridComponent from './components/grid-component';\nimport MessageComponent from './components/message-component';\nimport { TITLE_CONFIG, SUB_TITLE_CONFIG, CANVAS, MESSAGE_CONFIG } from './defaults';\nimport { ROW_MATRIX_INDEX, COLUMN_MATRIX_INDEX, CENTER } from '../../../layout/src/enums/constants';\n\n// Mapping between types of headers and their required configs for wrapper creation\nconst headerMap = {\n title: {\n headerCell: 'titleCell',\n configType: TITLE_CONFIG\n },\n subtitle: {\n headerCell: 'subtitleCell',\n configType: SUB_TITLE_CONFIG\n }\n};\n\n// Mapping of header alignment values\nconst headerAlignmentMap = {\n [LEFT]: LEFT,\n [RIGHT]: RIGHT,\n [CENTER]: HORIZONTAL_CENTER\n};\n\n/**\n * returns if data is Valid\n *\n *\n * @param {Object} params object where data has to be checked for validity\n * @return {Boolean} Returns true if all of the params are valid\n */\nconst checkParamsValidation = params => Object.keys(params).every((param => params[param]));\n\n/**\n * returns if message Component is needed or not\n *\n *\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Boolean} Returns if grid is present\n */\nconst isGridPresent = (renderDetails) => {\n const { rows, columns, values } = renderDetails.components;\n return checkParamsValidation({ rows, columns, values });\n};\n\n/**\n * Creates the wrapper for the header, i.e., title and subtitle to be used in the tree layout\n *\n *\n * @param {string} headerType type of header: title/subtite\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createHeaderWrapper = (headerType, layoutManager, renderDetails) => {\n let wrapper = null;\n\n const { components, layoutConfig } = renderDetails;\n const { headerCell, configType } = headerMap[headerType];\n const target = { target: CANVAS };\n\n if (components.headers && components.headers[headerCell]) {\n let headerConfig = layoutConfig[headerType];\n const header = components.headers[headerCell];\n\n headerConfig = Object.assign({}, headerConfig, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n alignWith: `${ROW_MATRIX_INDEX[0]}-${COLUMN_MATRIX_INDEX[1]}`,\n alignment: headerAlignmentMap[headerConfig.align],\n className: configType.className\n });\n\n const wrapperParams = {\n name: headerType,\n component: header,\n config: headerConfig\n };\n\n const existingComponent = layoutManager.getComponent(headerType);\n if (existingComponent) {\n wrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n wrapper = new HeaderComponent(wrapperParams);\n }\n }\n return wrapper;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} canvas canvas instance\n * @return {Instance} Returns the respective wrappers\n */\nconst createMessageWrapper = (layoutManager, renderDetails, renderGrid) => {\n const { components, measurement } = renderDetails;\n const headerValues = Object.values(components.headers);\n let sum = 0;\n let messageWrapper = null;\n\n for (const val of headerValues) {\n sum += val.logicalSpace().height;\n }\n\n if (!renderGrid) {\n const defaultDimensions = { height: measurement.canvasHeight - sum, width: measurement.canvasWidth };\n const gridComponent = layoutManager.getComponent(GRID);\n const { height, width } = (gridComponent && gridComponent.getBoundBox()) || defaultDimensions;\n const target = { target: CANVAS };\n const config = {\n ...target,\n dimensions: { height, width },\n message: ERROR_MESSAGE,\n classPrefix: MESSAGE_CONFIG,\n position: TOP\n };\n const wrapperParams = {\n name: MESSAGE,\n component: null,\n config\n };\n const existingComponent = layoutManager.getComponent(MESSAGE);\n\n if (existingComponent) {\n messageWrapper = existingComponent.updateWrapper(wrapperParams);\n } else {\n messageWrapper = new MessageComponent(wrapperParams);\n }\n return messageWrapper;\n }\n return null;\n};\n\n// Mapping between types of scrollBars and their required configs for wrapper creation\nconst scrollBarMap = config => ({\n vertical: {\n componentName: 'verticalScrollBar',\n width: 'thickness',\n height: 'layoutBasedMeasure',\n layoutBasedMeasure: HEIGHT,\n viewMeasure: 'viewHeight',\n rowAlign: 1,\n colAlign: config.align === 'right' ? 2 : 0,\n position: config.align,\n alignment: TOP\n },\n horizontal: {\n componentName: 'horizontalScrollBar',\n width: 'layoutBasedMeasure',\n layoutBasedMeasure: WIDTH,\n viewMeasure: 'viewWidth',\n height: 'thickness',\n rowAlign: config.align === 'top' ? 0 : 2,\n colAlign: 1,\n position: config.align,\n alignment: LEFT\n }\n});\n\n/**\n * Creates the wrapper for the scroller, i.e., horizontal and vertical to be used in the tree layout\n *\n *\n * @param {string} scrollBarType type of scrollbar: horizontal/vertical\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst createScrollBarWrapper = (scrollBarType, layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let scrollBarWrapper = null;\n const { layoutConfig } = renderDetails;\n const target = { target: CANVAS };\n const { scrollBar } = layoutConfig;\n const { layoutDimensions } = grid.viewInfo();\n const {\n actualCenterMeasures,\n unitHeights,\n unitWidths\n } = layoutDimensions;\n const {\n componentName, layoutBasedMeasure, width, height, rowAlign, colAlign,\n viewMeasure, position, alignment\n } = scrollBarMap(scrollBar[scrollBarType])[scrollBarType];\n const dimensions = {\n thickness: scrollBar.thickness,\n layoutBasedMeasure: layoutDimensions[viewMeasure][1]\n };\n const isScroll = grid.scrollInfo()[scrollBarType];\n const totalLength = actualCenterMeasures[layoutBasedMeasure];\n const viewLength = layoutDimensions[viewMeasure][1];\n\n const scrollConfig = Object.assign({}, {\n classPrefix: layoutConfig.classPrefix,\n ...target,\n scrollBarComponentConfig: {\n ...scrollBar,\n classPrefix: layoutConfig.classPrefix\n },\n\n type: scrollBarType,\n alignWith: `${ROW_MATRIX_INDEX[rowAlign]}-${COLUMN_MATRIX_INDEX[colAlign]}`,\n alignment,\n position\n });\n\n const wrapperParams = {\n name: componentName,\n config: scrollConfig,\n dimensions: {\n width: dimensions[width],\n height: dimensions[height],\n totalLength,\n viewLength,\n unitHeights,\n unitWidths\n }\n };\n\n const existingComponent = layoutManager.getComponent(componentName);\n\n if (!isScroll) {\n existingComponent && existingComponent.remove();\n return null;\n }\n\n if (existingComponent) {\n scrollBarWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n scrollBarWrapper = new ScrollComponent(wrapperParams);\n }\n\n return scrollBarWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the legend to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers\n */\nconst createLegendWrapper = (layoutManager, renderDetails, renderGrid) => {\n if (renderGrid) {\n let legendWrapper = null;\n const { components, layoutConfig, measurement } = renderDetails;\n const target = { target: CANVAS };\n\n if (components.legends && components.legends.length) {\n const legendConfig = { ...layoutConfig.legend, ...target, measurement };\n const wrapperParams = {\n name: LEGEND,\n component: components.legends,\n config: legendConfig\n };\n\n const existingComponent = layoutManager.getComponent(LEGEND);\n\n if (existingComponent) {\n legendWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n legendWrapper = new LegendComponent(wrapperParams);\n }\n }\n return legendWrapper;\n }\n return null;\n};\n\n/**\n * Creates the wrapper for the grid layout to be used in the tree layout\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @param {GridLayout} grid Instance of the grid layout\n * @return {Instance} Returns the respective wrappers\n */\nconst gridLayoutWrapper = (layoutManager, renderDetails, grid, renderGrid) => {\n if (renderGrid) {\n let gridWrapper = null;\n const target = { target: CANVAS };\n const { layoutConfig } = renderDetails;\n\n const config = {\n ...target,\n pagination: layoutConfig.pagination,\n classPrefix: layoutConfig.classPrefix,\n dimensions: { height: 0, width: 0 }\n };\n const wrapperParams = {\n name: GRID,\n component: grid,\n config\n };\n const existingComponent = layoutManager.getComponent(GRID);\n if (existingComponent) {\n gridWrapper = existingComponent\n .updateWrapper(wrapperParams);\n } else {\n gridWrapper = new GridComponent(wrapperParams);\n }\n return gridWrapper;\n }\n return null;\n};\n/**\n * Responsible for providing the wrapper creators for every component in Muze.\n * This function, when called, returns the set of components and their respective wrappers.\n *\n *\n *\n * @param {LayoutManager} layoutManager instance of Layout Manager which manages the layouting of the components\n * @param {GridLayout} grid Instance of the grid layout\n * @param {Object} renderDetails Extra details required for rendering the headers\n * @return {Instance} Returns the respective wrappers for each component\n */\nexport const componentWrapperMaker = (canvas, grid, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const renderGrid = isGridPresent(renderDetails);\n return {\n title: createHeaderWrapper(TITLE, layoutManager, renderDetails),\n subtitle: createHeaderWrapper(SUB_TITLE, layoutManager, renderDetails),\n message: createMessageWrapper(layoutManager, renderDetails, renderGrid),\n legend: createLegendWrapper(layoutManager, renderDetails, renderGrid),\n grid: gridLayoutWrapper(layoutManager, renderDetails, grid, renderGrid),\n verticalScrollBar: createScrollBarWrapper(VERTICAL, layoutManager, renderDetails, grid, renderGrid),\n horizontalScrollBar: createScrollBarWrapper(HORIZONTAL, layoutManager, renderDetails, grid, renderGrid)\n };\n};\n","export class ScrollManager {\n\n constructor () {\n this._scrollBarComponents = {};\n this._attachedComponents = {};\n }\n\n scrollBarComponents (...sbc) {\n if (sbc.length) {\n this._scrollBarComponents = sbc[0];\n return this;\n }\n return this._scrollBarComponents;\n }\n\n attachedComponents (...abc) {\n if (abc.length) {\n this._attachedComponents = abc[0];\n return this;\n }\n return this._attachedComponents;\n }\n\n preventBrowserScroll (type, event) {\n if (this.scrollBarComponents()[type]) {\n // Prevent default behaviour and stop propagating\n event.preventDefault();\n event.stopPropagation();\n }\n return this;\n }\n\n performAttachedScrollFunction (type, movedViewLength) {\n Object.values(this.attachedComponents()).forEach((e) => {\n e.performScrollAction(type, movedViewLength);\n });\n return this;\n }\n\n triggerScrollBarAction (type, delta) {\n this.scrollBarComponents()[type] && this.scrollBarComponents()[type].scrollDeltaTo(delta);\n return this;\n }\n}\n","import { mergeRecursive } from 'muze-utils';\nimport { arrangeComponents } from './component-resolver';\nimport { createHeaders } from './title-maker';\nimport { createLegend, getLegendSpace } from './legend-maker';\nimport { componentWrapperMaker } from './component-wrapper-maker';\nimport {\n TOP,\n BOTTOM,\n LEFT,\n RIGHT,\n TITLE,\n SUB_TITLE,\n LEGEND,\n VERTICAL_SCROLL_BAR,\n HORIZONTAL_SCROLL_BAR,\n GRID,\n MESSAGE\n} from '../constants';\nimport { ScrollManager } from './scroll-manager';\n\n/**\n *\n *\n * @param {*} context\n *\n */\nexport const prepareLayout = (layout, renderDetails) => {\n const { components, layoutConfig, measurement } = renderDetails;\n const {\n rows,\n columns,\n values,\n cornerMatrices\n } = components;\n const {\n topLeft,\n topRight,\n bottomLeft,\n bottomRight\n } = cornerMatrices;\n if (rows && columns) {\n layout.measurement(measurement)\n .config(layoutConfig)\n .matrices({\n top: [topLeft, columns[0], topRight],\n center: [rows[0], values, rows[1]],\n bottom: [bottomLeft, columns[1], bottomRight]\n })\n .triggerReflow();\n }\n};\n\n/**\n *\n *\n * @param {*} context\n * @param {*} mount\n *\n */\nexport const getRenderDetails = (context, mount) => {\n let layoutConfig = mergeRecursive({}, context.config());\n // Get height width of the mount point\n let { height, width } = mount.getBoundingClientRect();\n const heightAttr = context.height();\n const widthAttr = context.width();\n const visGroup = context.composition().visualGroup;\n const {\n isColumnSizeEqual,\n isRowSizeEqual,\n priority,\n rows,\n columns,\n values\n } = visGroup.placeholderInfo();\n const {\n minWidth,\n minHeight,\n classPrefix,\n showHeaders,\n legend,\n pagination,\n scrollBar\n } = context.config();\n\n // Get title configuration\n const titleConfig = context.title()[1];\n // Get subtitle configuration\n const subtitleConfig = context.subtitle()[1];\n // Get legend position\n const legendPosition = legend.position;\n // Arrange components according to config\n const layoutArrangement = arrangeComponents(context);\n\n height = Math.floor(height);\n width = Math.floor(width);\n\n const availableHeightForCanvas = Math.max(heightAttr > 0 ? heightAttr : height, minHeight);\n const availableWidthForCanvas = Math.max(widthAttr > 0 ? widthAttr : width, minWidth);\n\n // Create headers and determine header height\n const { headers, headerHeight } = createHeaders(context, availableHeightForCanvas, availableWidthForCanvas);\n\n // Create legends and determine legend space\n const legends = createLegend(context, headerHeight, availableHeightForCanvas, availableWidthForCanvas);\n context._composition.legend = {};\n legends.forEach((e) => {\n context._composition.legend[e.scaleType] = e.legend;\n });\n\n const legendSpace = getLegendSpace(legends, legend, availableHeightForCanvas, availableWidthForCanvas);\n const legendWidth = (legendPosition === LEFT || legendPosition === RIGHT) ? legendSpace.width : 0;\n const legendHeight = (legendPosition === TOP || legendPosition === BOTTOM) ? legendSpace.height : 0;\n\n // Set components for layouting\n const components = {\n headers,\n legends,\n canvases: [context],\n rows,\n columns,\n values,\n cornerMatrices: visGroup.cornerMatrices()\n };\n\n const measurement = {\n mountSpace: {\n height,\n width\n },\n headerHeight,\n legendSpace,\n canvasWidth: availableWidthForCanvas,\n canvasHeight: availableHeightForCanvas,\n width: availableWidthForCanvas - legendWidth,\n height: availableHeightForCanvas - headerHeight - legendHeight,\n minUnitHeight: context.minUnitHeight(),\n minUnitWidth: context.minUnitWidth()\n };\n layoutConfig = mergeRecursive(layoutConfig, {\n classPrefix,\n showHeaders,\n border: mergeRecursive(visGroup.metaData().border, context.config().border),\n layoutArrangement,\n legend,\n buffer: scrollBar.thickness,\n pagination,\n title: titleConfig,\n subtitle: subtitleConfig,\n isColumnSizeEqual,\n isRowSizeEqual,\n mount,\n priority\n });\n return {\n layoutConfig,\n components,\n measurement\n };\n};\n\nconst componentIndexes = {\n title: 0,\n subtitle: 1,\n legend: 2,\n verticalScrollBar: 3,\n horizontalScrollBar: 4,\n grid: 5,\n message: 6\n};\n\nconst componentNames = {\n 0: TITLE,\n 1: SUB_TITLE,\n 2: LEGEND,\n 3: VERTICAL_SCROLL_BAR,\n 4: HORIZONTAL_SCROLL_BAR,\n 5: GRID,\n 6: MESSAGE\n};\n\nconst attachListeners = (componentWrappers) => {\n componentWrappers.forEach((componentWrapper) => {\n if (componentWrapper) {\n componentWrapper.attachListener();\n }\n });\n};\n\n/**\n * Responsible for creating a scroll manager that manages interactions between the grid\n * component and the scroll bar components\n *\n * @param {Array} componentWrappers Contains the wrappers for all the components\n * @param {Canvas} canvas Instance of the current canvas\n * @return {Array} Positions of units either horizontal or vertical\n */\nconst createScrollManager = (componentWrappers, canvas) => {\n const {\n horizontalScrollBar,\n verticalScrollBar,\n grid\n } = componentIndexes;\n\n const horizontalScrollWrapper = componentWrappers[horizontalScrollBar];\n const verticalScrollWrapper = componentWrappers[verticalScrollBar];\n const gridWrapper = componentWrappers[grid];\n const scrollBarManager = new ScrollManager();\n const scrollBarComponents = {};\n\n verticalScrollWrapper && (scrollBarComponents.vertical = verticalScrollWrapper);\n horizontalScrollWrapper && (scrollBarComponents.horizontal = horizontalScrollWrapper);\n\n scrollBarManager\n .scrollBarComponents(scrollBarComponents)\n .attachedComponents({\n grid: gridWrapper\n });\n canvas.composition().hScrollBar = horizontalScrollWrapper;\n canvas.composition().vScrollBar = verticalScrollWrapper;\n\n [horizontalScrollWrapper, verticalScrollWrapper].forEach((wrapper) => {\n wrapper && wrapper.manager(scrollBarManager);\n });\n\n gridWrapper.scrollBarManager(scrollBarManager);\n};\n\nexport const renderLayout = (canvas, renderDetails) => {\n const layoutManager = canvas._layoutManager;\n const gridLayout = canvas.layout();\n const {\n\n grid\n } = componentIndexes;\n\n // Get the component wrappers\n const compWrappers = componentWrapperMaker(canvas, gridLayout, renderDetails);\n const componentWrappers = Object.keys(componentIndexes).map(e => compWrappers[e]);\n const gridWrapper = componentWrappers[grid];\n if (gridWrapper) {\n createScrollManager(componentWrappers, canvas);\n }\n\n componentWrappers.forEach((componentWrapper, index) => {\n if (!componentWrapper) {\n const deleteElementName = componentNames[index];\n layoutManager.removeComponent(deleteElementName);\n }\n });\n layoutManager.registerComponents(componentWrappers).compute();\n attachListeners(componentWrappers);\n};\n","import { isSimpleObject, ReservedFields, FieldType } from 'muze-utils';\nimport { getSideEffects, BEHAVIOURS } from '@chartshq/muze-firebolt';\nimport { PSEUDO_SELECT } from '@chartshq/visual-unit/src/enums/behaviours';\nimport { COMMON_INTERACTION } from '../../constants';\n\nexport const addFacetDataAndMeasureNames = (data, facetData, measureNames) => {\n if (data === null) {\n return data;\n }\n\n const facets = Object.keys(facetData);\n const facetVals = Object.values(facetData);\n\n if (isSimpleObject(data)) {\n return Object.assign({}, Object.keys(facetData).reduce((acc, v) => {\n acc[v] = [facetData[v]];\n return acc;\n }, {}), data, {\n [ReservedFields.MEASURE_NAMES]: measureNames\n });\n }\n const criteriaFields = data[0];\n const hasMeasureNameField = criteriaFields.find(field => field === ReservedFields.MEASURE_NAMES);\n const fieldsWithFacets = [...facets, ...criteriaFields,\n ...(hasMeasureNameField ? [] : [ReservedFields.MEASURE_NAMES])];\n\n const dataWithFacets = [\n fieldsWithFacets\n ];\n\n for (let i = 1, len = data.length; i < len; i++) {\n let measureNameArr = [];\n if (!hasMeasureNameField && measureNames) {\n measureNameArr = measureNames;\n }\n const row = [...facetVals, ...data[i], ...measureNameArr];\n dataWithFacets.push(row);\n }\n return dataWithFacets;\n};\n\nexport const propagateValues = (instance, action, config = {}) => {\n const { payload, identifiers, sourceUnitId, sourceCanvasId, propagationDataSource } = config;\n const dataModel = propagationDataSource;\n const sideEfffects = instance._sideEffectDefinitions;\n const behaviourEffectMap = instance._behaviourEffectMap;\n const propagationBehaviourMap = instance._propagationBehaviourMap;\n const propagationBehaviour = propagationBehaviourMap[action] || action;\n\n payload.sourceUnit = sourceUnitId;\n payload.action = action;\n payload.sourceCanvas = sourceCanvasId;\n\n const groupId = sourceCanvasId;\n\n const filterFn = (entry, propagationConf) => {\n const effects = behaviourEffectMap[entry.config.action];\n const mutates = entry.config.groupId ?\n (effects ? effects.some(d => sideEfffects[d.name || d].mutates()) : false) : true;\n return entry.config.groupId !== propagationConf.groupId && mutates;\n };\n\n const sourceBehaviour = instance._actions.behavioural[action];\n let isMutableAction = sourceBehaviour ? sourceBehaviour.constructor.mutates() : false;\n const propConfig = {\n payload,\n action,\n criteria: identifiers,\n isMutableAction,\n groupId,\n sourceId: config.sourceId,\n filterFn,\n enabled: (propConf, firebolt) => (action !== propagationBehaviour ?\n propConf.payload.sourceCanvas === firebolt.sourceCanvas() : true)\n };\n\n dataModel.propagate(identifiers, propConfig, true);\n\n if (action !== propagationBehaviour) {\n const behaviourInstance = instance._actions.behavioural[propagationBehaviour];\n isMutableAction = behaviourInstance ? behaviourInstance.constructor.mutates() : false;\n\n dataModel.propagate(identifiers, Object.assign({}, propConfig, {\n isMutableAction,\n applyOnSource: false,\n action: propagationBehaviour,\n sourceId: isMutableAction ? groupId : sourceUnitId,\n enabled: (propConf, firebolt) => propConf.payload.sourceCanvas !== firebolt.sourceCanvas()\n }), true, {\n filterImmutableAction: (actionInf, propInf) => actionInf.groupId !== propInf.groupId\n });\n }\n};\n\nconst isDimension = fields => fields.some(field => field.type() === FieldType.DIMENSION);\n\nexport const isCrosstab = (fields) => {\n const { rowFacets, colFacets, rowProjections, colProjections } = fields;\n if (rowFacets.length || colFacets.length) {\n return true;\n }\n const colProj = colProjections.flat();\n const rowProj = rowProjections.flat();\n\n if ((isDimension(colProj) || isDimension(rowProj)) && (colProj.length > 1 || rowProj.length > 1)) {\n return true;\n }\n return false;\n};\n\nexport const addSelectedMeasuresInPayload = (firebolt, unit, payload) => {\n const groupFields = firebolt.context.composition().visualGroup.resolver().getAllFields();\n if (isCrosstab(groupFields)) {\n const { x, y } = unit.fields();\n let measureFields;\n\n if (x.length && y.length) {\n if (x[0].type() === FieldType.MEASURE) {\n measureFields = [`${x[0]}`];\n } else if (y[0].type() === FieldType.MEASURE) {\n measureFields = [`${y[0]}`];\n }\n payload.selectedMeasures = measureFields;\n }\n }\n};\n\nexport const dispatchBehaviours = (firebolt, { payload, unit, behaviours }) => {\n const { interaction: { behaviours: behaviourConfs = {} } } = firebolt.context.config();\n const unitFirebolt = unit.firebolt();\n\n behaviours.forEach((action) => {\n const mode = behaviourConfs[action];\n let targetFirebolt = unitFirebolt;\n if (mode === COMMON_INTERACTION) {\n targetFirebolt = firebolt;\n }\n\n const actions = targetFirebolt._actions.behavioural;\n payload.criteria = addFacetDataAndMeasureNames(payload.criteria, unit.facetFieldsMap(),\n unit.layers().map(layer => Object.keys(layer.data().getFieldspace().getMeasure())));\n\n targetFirebolt.dispatchBehaviour(action, payload, {\n propagate: false,\n applySideEffect: false\n });\n\n const identifiers = actions[action].propagationIdentifiers();\n\n firebolt.propagate(action, payload, identifiers, {\n sideEffects: getSideEffects(action, targetFirebolt._behaviourEffectMap),\n sourceUnitId: unit.id(),\n sourceId: targetFirebolt.id(),\n propagationDataSource: targetFirebolt.getPropagationSource()\n });\n });\n};\n\nexport const resetSelectAction = (firebolt, { unit, payload, behaviours }) => {\n if (behaviours[0] === BEHAVIOURS.BRUSH && payload.dragging && payload.dragDiff < 5) {\n dispatchBehaviours(firebolt, {\n behaviours: [BEHAVIOURS.SELECT],\n payload: {\n criteria: null\n },\n unit\n });\n }\n};\n\nexport const attachBehaviours = (group) => {\n const allFields = group.resolver().getAllFields();\n const valueMatrix = group.matrixInstance().value;\n const crosstab = isCrosstab(allFields);\n\n valueMatrix.each((cell) => {\n const unit = cell.valueOf();\n const firebolt = unit.firebolt();\n const behaviours = crosstab ? [PSEUDO_SELECT] : [];\n firebolt._connectedBehaviours[BEHAVIOURS.SELECT] = behaviours;\n });\n};\n","import {\n FieldType,\n mergeRecursive,\n CommonProps,\n ReservedFields\n} from 'muze-utils';\nimport { Firebolt, getSideEffects } from '@chartshq/muze-firebolt';\nimport { createMapByDimensions } from '@chartshq/visual-unit/src/firebolt/helper';\nimport {\n payloadGenerator,\n isSideEffectEnabled,\n sanitizePayloadCriteria,\n prepareSelectionSetMap\n} from '@chartshq/visual-unit';\nimport { TOOLTIP } from '@chartshq/muze-firebolt/src/enums/side-effects';\nimport { FRAGMENTED } from '@chartshq/muze-firebolt/src/enums/constants';\nimport { applyInteractionPolicy } from '../helper';\nimport {\n propagateValues,\n isCrosstab,\n addSelectedMeasuresInPayload,\n resetSelectAction,\n dispatchBehaviours,\n attachBehaviours\n} from './helper';\nimport { COMMON_INTERACTION } from '../../constants';\n\nconst setSideEffectConfig = (firebolt) => {\n const tooltipSideEffect = firebolt.sideEffects().tooltip;\n const allFields = firebolt.context.composition().visualGroup.resolver().getAllFields();\n\n if (isCrosstab(allFields)) {\n tooltipSideEffect.config({\n selectionSummary: {\n order: 1,\n className: 'tooltip-content-container-selectionSummary-crosstab',\n showMultipleMeasures: true\n },\n highlightSummary: {\n order: 0,\n className: 'tooltip-content-container-highlightSummary-crosstab'\n }\n });\n } else {\n tooltipSideEffect.config({\n selectionSummary: {\n order: 0,\n className: 'tooltip-content-container-selectionSummary-default',\n showMultipleMeasures: false\n },\n highlightSummary: {\n order: 1,\n className: 'tooltip-content-container-highlightSummary-default'\n }\n });\n }\n};\n\nconst prepareSelectionSetData = (group, dataModel) => {\n const valueMatrix = group.matrixInstance().value;\n const fieldsConfig = dataModel.getFieldsConfig();\n const dimensions = Object.values(fieldsConfig).filter(d => d.def.type === FieldType.DIMENSION);\n const hasMeasures = Object.keys(dataModel.getFieldspace().getMeasure()).length;\n const measureName = hasMeasures ? [ReservedFields.MEASURE_NAMES] : [];\n const keys = {};\n const dimensionsMap = {};\n const unitDimsMap = {};\n\n valueMatrix.each((cell) => {\n const unit = cell.source();\n const dm = unit.data();\n const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name);\n const facetFields = Object.keys(unit.facetFieldsMap());\n\n unitDimsMap[unitDims] = {\n inst: unit,\n dims: [...facetFields, ...unitDims]\n };\n });\n\n const groupDataMap = {};\n\n dataModel.getData().data.forEach((row) => {\n for (const key in unitDimsMap) {\n const { dims } = unitDimsMap[key];\n const dimKey = dims.map(dim => row[fieldsConfig[dim].index]);\n groupDataMap[dimKey] = row;\n }\n });\n\n valueMatrix.each((cell) => {\n const unit = cell.source();\n const dm = unit.data();\n const layers = unit.layers();\n const unitDims = dm.getSchema().filter(field => field.type === FieldType.DIMENSION).map(field => field.name);\n const facetMap = unit.facetFieldsMap();\n const facetFields = Object.keys(facetMap);\n const unitFieldsConfig = dm.getFieldsConfig();\n const linkedRows = [];\n\n dm.getData().data.forEach((row) => {\n const dimKey = [...facetFields.map(field => facetMap[field]), ...unitDims.map(d =>\n row[unitFieldsConfig[d].index])];\n const linkedRow = groupDataMap[dimKey];\n\n if (linkedRow) {\n linkedRows.push(linkedRow);\n }\n });\n\n prepareSelectionSetMap({\n data: linkedRows,\n uids: dm.getUids(),\n dimensions\n }, layers, {\n keys,\n dimensionsMap\n });\n });\n\n const dimensionFields = dimensions.length ? [...dimensions.map(d => d.def.name)] :\n [ReservedFields.ROW_ID];\n\n return {\n keys,\n dimensionsMap,\n dimensions: dimensionFields,\n allFields: [...dimensionFields, ...measureName]\n };\n};\n\nconst defaultCrossInteractionPolicy = {\n behaviours: {\n '*': (propagationPayload, firebolt) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = firebolt.sourceCanvas();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n }\n },\n sideEffects: {\n '*': (propagationPayload, firebolt) => {\n const propagationCanvasAlias = propagationPayload.sourceCanvas;\n const canvasAlias = firebolt.sourceCanvas();\n return propagationCanvasAlias ? canvasAlias === propagationCanvasAlias : true;\n },\n selectionBox: () => false\n }\n};\n\n/**\n * This class is responsible for dispatching any behavioural action to all the visual units housed by the canvas.\n * It is created by {@link Canvas}. This class does not handle any physical actions. Physical actions get triggered\n * in {@link VisualUnit} which is managed by it's own firebolt instance. The firebolt instance of canvas only\n * propagates the action to all the visual units in it's composition.\n *\n * To get the firebolt instance of {@link Canvas}\n * ```\n * const firebolt = canvas.firebolt();\n * ```\n *\n * @class GroupFireBolt\n * @public\n */\nexport default class GroupFireBolt extends Firebolt {\n constructor (...params) {\n super(...params);\n this.payloadGenerators(payloadGenerator);\n this._interactionPolicy = this.constructor.defaultInteractionPolicy();\n this.crossInteractionPolicy(this.constructor.defaultCrossInteractionPolicy());\n }\n\n static defaultInteractionPolicy () {\n return () => {};\n }\n\n static defaultCrossInteractionPolicy () {\n return defaultCrossInteractionPolicy;\n }\n\n interactionPolicy (...policy) {\n if (policy.length) {\n this._interactionPolicy = policy[0] || this.constructor.defaultInteractionPolicy();\n return this;\n }\n return this._interactionPolicy;\n }\n\n crossInteractionPolicy (...policy) {\n if (policy.length) {\n const context = this.context;\n this._crossInteractionPolicy = mergeRecursive(mergeRecursive({},\n this.constructor.defaultCrossInteractionPolicy()), policy[0] || {});\n\n applyInteractionPolicy(this);\n const throwback = context._throwback;\n throwback.registerImmediateListener([CommonProps.MATRIX_CREATED], () => {\n this.config(this.context.config().interaction);\n applyInteractionPolicy(this);\n const group = this.context.composition().visualGroup;\n if (group) {\n setSideEffectConfig(this);\n\n const { keys, dimensions, dimensionsMap, allFields } = prepareSelectionSetData(group,\n group.getGroupByData());\n this._metaData = {\n dimensionsMap,\n dimensions,\n allFields\n };\n this.createSelectionSet({ keys, fields: dimensions });\n group.getGroupByData().on('propagation', (data, config) => {\n this.handleDataModelPropagation(data, config);\n });\n // Dispatch pseudo select behaviour for highlighting measures with common dimensions in crosstab\n attachBehaviours(group);\n }\n });\n return this;\n }\n return this._crossInteractionPolicy;\n }\n\n handleDataModelPropagation (data, config) {\n const group = this.context.composition().visualGroup;\n const valueMatrix = group.matrixInstance().value;\n const units = group.resolver().units();\n const propagationData = data;\n // @todo refactor this code\n const {\n enabled: enabledFn,\n sourceIdentifiers,\n action,\n payload: propPayload\n } = config;\n const { interaction: { behaviours: behaviourConfs = {} } } = this.context.config();\n const mode = behaviourConfs[action];\n if (mode !== COMMON_INTERACTION) {\n return this;\n }\n\n const payloadFn = this.getPayloadGeneratorFor(action);\n const payload = payloadFn(this, propagationData, config);\n\n const behaviourPolicies = this._behaviourPolicies;\n const filterFns = Object.values(behaviourPolicies[action] || behaviourPolicies['*'] || {});\n let enabled = filterFns.every(fn => fn(propPayload || {}, this, {\n sourceIdentifiers,\n propagationData\n }));\n\n if (enabledFn) {\n enabled = enabledFn(config, this) && enabled;\n }\n\n if (enabled) {\n const propagationInf = {\n propagate: false,\n data: propagationData,\n propPayload,\n sourceIdentifiers,\n sourceId: config.propagationSourceId,\n isMutableAction: config.isMutableAction\n };\n\n const behaviourEffectMap = this._behaviourEffectMap;\n const sideEffects = getSideEffects(action, behaviourEffectMap);\n const sideEffectInstances = this.sideEffects();\n const { instance: unit = units[0][0] } =\n valueMatrix.findPlaceHolderById(propPayload.sourceUnit) || {};\n\n sideEffects.forEach(({ effects }) => {\n effects.forEach((effect) => {\n const name = effect.name;\n const inst = sideEffectInstances[name];\n\n if (inst) {\n inst.sourceInfo(() => unit.getSourceInfo());\n inst.layers(() => unit.layers());\n inst.plotPointsFromIdentifiers((...params) =>\n unit.getPlotPointsFromIdentifiers(...params));\n inst.drawingContext(() => unit.getDrawingContext());\n inst.valueParser(unit.valueParser());\n }\n });\n });\n\n if (propPayload.sourceUnit) {\n addSelectedMeasuresInPayload(this, unit, payload);\n }\n\n this.dispatchBehaviour(action, payload, propagationInf);\n }\n\n return this;\n }\n\n registerSideEffects (sideEffects) {\n for (const key in sideEffects) {\n this._sideEffectDefinitions[sideEffects[key].formalName()] = sideEffects[key];\n }\n this.initializeSideEffects();\n\n return this;\n }\n\n target () {\n return 'visual-group';\n }\n\n mapActionsAndBehaviour () {\n const unitMatrix = this.context.composition().visualGroup.matrixInstance().value;\n\n unitMatrix.each((unit) => {\n const firebolt = unit.source().firebolt();\n firebolt.mapActionsAndBehaviour();\n });\n\n this.registerPhysicalActionHandlers();\n }\n\n registerPhysicalActionHandlers () {\n const unitMatrix = this.context.composition().visualGroup.matrixInstance().value;\n\n unitMatrix.each((cell) => {\n const unit = cell.source();\n const firebolt = unit.firebolt();\n\n firebolt.onPhysicalAction('*', (event, payload) => {\n this.handlePhysicalAction(event, payload, unit);\n }, this.context.constructor.formalName());\n });\n\n return this;\n }\n\n handlePhysicalAction (event, payload, unit) {\n const firebolt = unit.firebolt();\n const { behaviours } = firebolt._actionBehaviourMap[event];\n dispatchBehaviours(this, { behaviours, payload, unit });\n // Reset select action when dragging is done. Remove this when brush and select will be unioned\n resetSelectAction(this, { behaviours, payload, unit });\n }\n\n sanitizePayload (payload) {\n const { criteria } = payload;\n const { allFields: fields, dimensionsMap } = this._metaData;\n\n return Object.assign({}, payload,\n {\n criteria: sanitizePayloadCriteria(criteria, fields, {\n dm: this.data(),\n dimensionsMap,\n dimsMapGetter: this._dimsMapGetter\n })\n });\n }\n\n createSelectionSet (...params) {\n super.createSelectionSet(...params);\n\n this._dimsMapGetter = createMapByDimensions(this, this.data());\n\n return this;\n }\n\n id () {\n return this.context.alias();\n }\n\n shouldApplySideEffects (propInf) {\n return propInf.applySideEffect !== false;\n }\n\n data () {\n return this.context.composition().visualGroup.getGroupByData();\n }\n\n getRangeFromIdentifiers ({ criteria, fields }) {\n return fields.reduce((acc, v) => {\n acc[v] = criteria[v];\n return acc;\n }, {});\n }\n\n propagate (behaviour, payload, identifiers, auxConfig = {}) {\n propagateValues(this, behaviour, Object.assign({\n payload,\n identifiers,\n propagationFields: this._propagationFields,\n sourceId: this.id(),\n sourceCanvasId: this.id(),\n propagationDataSource: this.data()\n }, auxConfig));\n }\n\n getPropagationSource () {\n return this.data();\n }\n\n sourceCanvas () {\n return this.context.alias();\n }\n\n getApplicableSideEffects (sideEffects, payload, propagationInf) {\n if (payload.sideEffects) {\n return [{\n effects: payload.sideEffects,\n behaviours: [payload.action]\n }];\n }\n const { mode } = this.context.config().interaction.tooltip;\n propagationInf.propPayload = propagationInf.propPayload || payload;\n sideEffects.forEach((d) => {\n let mappedEffects = d.effects;\n mappedEffects = mappedEffects.filter((se) => {\n if (se.name === TOOLTIP && mode === FRAGMENTED) {\n return false;\n }\n return isSideEffectEnabled(this, { se, propagationInf });\n });\n d.effects = mappedEffects;\n });\n return sideEffects;\n }\n}\n","import GroupFireBolt from './group-firebolt';\n\nexport default GroupFireBolt;\n","export const APP_INITIAL_STATE = {\n app: {\n group: {},\n units: {},\n layers: {},\n canvas: {}\n },\n local: {\n canvas: {},\n group: {},\n units: {},\n layers: {}\n }\n};\n\n","import { GridLayout } from '@chartshq/layout';\nimport { transactor, Store, getUniqueId, selectElement, STATE_NAMESPACES, CommonProps } from 'muze-utils';\nimport UnitBrushBehaviour from '@chartshq/visual-unit/src/firebolt/behaviours/brush';\nimport { physicalActions, sideEffects, behaviouralActions, behaviourEffectMap } from '@chartshq/muze-firebolt';\nimport { RETINAL } from '../constants';\nimport TransactionSupport from '../transaction-support';\nimport { getRenderDetails, prepareLayout, renderLayout } from './layout-maker';\nimport { localOptions, canvasOptions } from './local-options';\nimport GroupFireBolt from './firebolt';\nimport options from '../options';\nimport { APP_INITIAL_STATE } from './app-state';\nimport { initCanvas,\n setupChangeListener,\n setLabelRotationForAxes,\n createGroupState,\n createLayoutManager,\n setLayoutInfForUnits\n} from './helper';\n/**\n * Canvas is a logical component which houses a visualization by taking multiple variable in different encoding channel.\n * Canvas manages lifecycle of many other logical component and exposes one consistent interface for creation of chart.\n * Canvas is intialized from environment with settings from environment and singleton dependencies.\n *\n * To create an instance of canvas\n * ```\n * const env = Muze();\n * const canvas = env.canvas()\n * ```\n *\n *\n * @class\n * @public\n * @module Canvas\n */\nexport default class Canvas extends TransactionSupport {\n\n /**\n * Creates reactive property accessors.\n * - data\n * - height\n * - width\n * - config\n * This configs are retrieved from options.\n */\n constructor (globalDependencies) {\n super();\n\n this._allOptions = Object.assign({}, options, localOptions);\n this._registry = {};\n this._composition = {};\n this._cachedProps = {};\n this._alias = null;\n this._renderedResolve = null;\n this._renderedPromise = new Promise((resolve) => {\n this._renderedResolve = resolve;\n });\n this._composition.layout = new GridLayout();\n this._store = new Store(APP_INITIAL_STATE);\n\n this._throwback = new Store({\n [CommonProps.MATRIX_CREATED]: false,\n [CommonProps.ON_LAYER_DRAW]: null,\n propagationInfo: null\n });\n\n // Setters and getters will be mounted on this. The object will be mutated.\n const namespace = STATE_NAMESPACES.CANVAS_LOCAL_NAMESPACE;\n const allOptions = Object.assign({}, options, localOptions, canvasOptions);\n\n transactor(this, allOptions, this._store, {\n namespace\n });\n\n this.dependencies(Object.assign({}, globalDependencies, this._dependencies));\n this.firebolt(new GroupFireBolt(this, {\n behavioural: Object.assign({}, behaviouralActions, {\n brush: UnitBrushBehaviour\n }),\n physical: physicalActions,\n physicalBehaviouralMap: {}\n }, sideEffects, behaviourEffectMap));\n this.alias(`canvas-${getUniqueId()}`);\n this.title('', {});\n this.subtitle('', {});\n this.legend({});\n this.color({});\n this.shape({});\n this.size({});\n setupChangeListener(this);\n // init layoutManager\n this._layoutManager = createLayoutManager();\n }\n\n /**\n * Retrieves an instance of layout which is responsible for layouting. Layout is responsible for creating faceted\n * presentation using table layout.\n *\n * @public\n *\n * @return {GridLayout} Instance of layout attached to canvas.\n */\n layout (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().layout;\n }\n\n /**\n * Retrieves the composition for a canvas\n *\n * @public\n *\n * @return {object} Instances of the components which canvas requires to draw the full visualization.\n * ```\n * {\n * layout: // Instance of {@link GridLayout}\n * legend: // Instance of {@link Legend}\n * subtitle: // Instance of {@link TextCell} using which the title is rendered\n * title: // Instance of {@link TextCell} using which the title is rendered\n * visualGroup: // Instance of {@link visualGroup}\n * }\n * ```\n */\n composition (...params) {\n if (params.length) {\n return this;\n }\n return this._composition;\n }\n\n done () {\n return this._renderedPromise;\n }\n\n /**\n * Sets or gets the alias of the canvas. Alias is a name by which the canvas can be referred.\n *\n * When setter\n * @param {string} alias Name of the alias.\n *\n * @return {Canvas} Instance of the canvas.\n *\n * When getter\n *\n * @return {string} Alias of canvas.\n *\n * @public\n */\n alias (...params) {\n if (params.length) {\n const visualGroup = this.composition().visualGroup;\n this._alias = params[0];\n visualGroup && visualGroup.alias(this.alias());\n return this;\n }\n return this._alias;\n }\n\n /**\n * Creates an instance initiated with given settings.\n *\n * @param {Object} initialSettings Initial settings to be populated in the model\n * @param {Object} regEntry newly created instance with the initial settings\n * @param {Object} globalDependencies dependencies which will be created only once in the page\n *\n * @return {Object} newly created instance with the initial settings\n */\n static withSettings (initialSettings, regEntry, globalDependencies) {\n const instance = new Canvas(globalDependencies);\n\n for (const key in initialSettings) {\n instance[key](initialSettings[key]);\n }\n // set registry for instance\n instance.registry(regEntry);\n return instance;\n }\n\n /**\n *\n *\n * @static\n *\n * @memberof Canvas\n */\n static formalName () {\n return 'canvas';\n }\n\n /**\n * Returns the instance of firebolt associated with this canvas. The firebolt instance can be used to dispatch a\n * behaviour dynamically on the canvas. This firebolt does not handle any physical actions. It is just used to\n * propagate the action to all the visual units in it's composition.\n *\n * @public\n *\n * @return {GroupFireBolt} Instance of firebolt associated with canvas.\n */\n firebolt (...firebolt) {\n if (firebolt.length) {\n this._firebolt = firebolt[0];\n return this;\n }\n return this._firebolt;\n }\n\n /**\n * Registry peoperty accessor\n *\n * @param {Object} reg plain old javascript object keyvalue pairs. Key containing module name and value contains\n * module definition class. The reg object has to be flat object of level 1.\n */\n registry (...params) {\n if (params.length) {\n const param = params[0];\n const components = Object.assign({}, param.components);\n const componentSubRegistry = Object.assign({}, param.componentSubRegistry);\n const interactionRegistry = Object.assign({}, param.interactions);\n\n this._registry = { components, componentSubRegistry, interactions: interactionRegistry };\n const initedComponents = initCanvas(this);\n // @todo is it okay to continue this tight behaviour? If not use a resolver to resolve diff component type.\n this._composition.visualGroup = initedComponents[0];\n createGroupState(this);\n this.composition().visualGroup.alias(this.alias()).store(this._store);\n return this;\n }\n return this._registry;\n }\n\n /*\n * Prepare dependencies for top level elements\n */\n dependencies (...param) {\n if (param.length) {\n this._dependencies = param[0];\n return this;\n }\n // @todo prepare dependencies here.\n return this._dependencies;\n }\n\n /**\n *\n *\n * @param {*} lifeCycles\n *\n * @memberof Canvas\n */\n lifeCycle (lifeCycles) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n if (lifeCycles) {\n lifeCycleManager.register(lifeCycles);\n return this;\n }\n return lifeCycleManager;\n }\n\n /**\n *\n *\n * @readonly\n * @memberof Canvas\n */\n legend (...params) {\n if (params.length) {\n return this;\n }\n return this.composition().legend;\n }\n\n /**\n * Returns a promise for various {@link LifecycleEvents} of the various components of canvas. The promise gets\n * resolved once the particular event gets completed.\n *\n * To use this,\n * ```\n * canvas.once('layer.drawn').then(() => {\n * // Do any post drawing work here.\n * });\n * ```\n * @public\n *\n * @param {string} eventName Name of the lifecycle event.\n *\n * @return {Promise} A pending promise waiting for resolve to be called.\n */\n once (eventName) {\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n return lifeCycleManager.retrieve(eventName);\n }\n\n /**\n * Internal function to trigger render, this method is cognizant of all the properties of the core modules and\n * establish a passive reactivity. Passive reactivity is not always a bad thing :)\n * @internal\n */\n render () {\n const mount = this.mount();\n // removeChild(mount);\n const lifeCycleManager = this.dependencies().lifeCycleManager;\n // Get render details including arrangement and measurement\n const renderDetails = getRenderDetails(this, mount);\n lifeCycleManager.notify({ client: this, action: 'beforedraw' });\n // Prepare the layout by triggering the matrix calculation\n prepareLayout(this.layout(), renderDetails);\n\n this._layoutManager.dimension({\n height: renderDetails.measurement.canvasHeight,\n width: renderDetails.measurement.canvasWidth\n });\n\n this._layoutManager.renderAt(mount);\n\n // Render each component\n renderLayout(this, renderDetails);\n\n setLayoutInfForUnits(this);\n\n // setLabelRotation\n setLabelRotationForAxes(this);\n\n this.firebolt().mapActionsAndBehaviour();\n }\n\n /**\n * Returns the instances of x axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the top axis and the second element represents the bottom\n * // axis.\n * [\n * [X1, X2],\n * [X3, X4]\n * ]\n * ```\n * @public\n *\n * @return {Array.} Instances of x axis.\n */\n xAxes () {\n return this.composition().visualGroup.getAxes('x');\n }\n\n /**\n * Returns the instances of y axis of the canvas. It returns the instances in a two dimensional array form.\n *\n * ```\n * // The first element in the sub array represents the left axis and the second element represents the right\n * // axis.\n * [\n * [Y1, Y2],\n * [Y3, Y4]\n * ]\n * ```\n * @public\n * @return {Array.} Instances of y axis.\n */\n yAxes () {\n return this.composition().visualGroup.getAxes('y');\n }\n\n /**\n * Returns all the retinal axis of the canvas. Color, shape and size axis are combinedly called retinal axis.\n *\n * @public\n * @return {Object} Instances of retinal axis.\n * ```\n * {\n * color: [ColorAxis], // Array of color axis.\n * shape: [ShapeAxis], // Array of shape axis.\n * size: [SizeAxis] // Array of size axis.\n * }\n * ```\n */\n getRetinalAxes () {\n const visualGroup = this.composition().visualGroup;\n return visualGroup.getAxes(RETINAL);\n }\n\n mount (...params) {\n if (params.length) {\n let value = params[0];\n if (typeof params[0] === 'string') {\n value = selectElement(params[0]).node();\n }\n this._mount = value;\n return this;\n }\n return this._mount;\n }\n}\n","import { cellRegistry, SimpleCell } from '@chartshq/visual-cell';\nimport { VisualUnit } from '@chartshq/visual-unit';\nimport { layerRegistry } from '@chartshq/visual-layer';\nimport { SimpleGroup, VisualGroup } from '@chartshq/visual-group';\nimport { registry as interactionRegistry } from '@chartshq/muze-firebolt';\n\nexport const COMPONENTS = {\n [VisualGroup.formalName()]: VisualGroup,\n [VisualUnit.formalName()]: VisualUnit\n};\n\nexport const SUBREGISTRIES = {\n cells: cellRegistry,\n layers: layerRegistry\n};\nexport const INTERFACES = {\n SimpleGroup,\n SimpleCell\n};\n\nconst componentRegistry = (components = COMPONENTS) => {\n const reg = Object.assign({}, components);\n\n return {\n register: (cls) => {\n const key = cls.formalName();\n reg[key] = cls;\n return componentRegistry;\n },\n get: () => reg\n };\n};\n\nexport const registry = {\n components: componentRegistry(COMPONENTS),\n cells: cellRegistry(),\n layers: layerRegistry(),\n interactions: interactionRegistry\n};\n","import * as utils from 'muze-utils';\n\nimport { VisualUnit, helpers as unitHelpers, enums as unitEnums, UnitFireBolt } from '@chartshq/visual-unit';\nimport { VisualGroup, Encoders, encoderHelpers, groupUtils, enums as groupEnums } from '@chartshq/visual-group';\nimport {\n SurrogateSideEffect,\n SpawnableSideEffect,\n sideEffects,\n PersistentBehaviour,\n GenericBehaviour,\n VolatileBehaviour,\n behaviouralActions,\n GenericSideEffect,\n Firebolt\n} from '@chartshq/muze-firebolt';\nimport {\n layerFactory,\n BaseLayer,\n LineLayer,\n TextLayer,\n TickLayer,\n PointLayer,\n helpers,\n enums,\n SimpleLayer,\n AreaLayer,\n ArcLayer,\n layerMixins\n} from '@chartshq/visual-layer';\nimport pkg from '../package.json';\nimport * as operators from './operators';\nimport { actionModel as ActionModel } from './action-model';\nimport options from './options';\nimport { Canvas } from './canvas';\nimport { registry as globalRegistry, SUBREGISTRIES } from './default-registry';\nimport './muze.scss';\n\nconst {\n transactor,\n Smartlabel,\n enableChainedTransaction,\n LifeCycleManager,\n DataModel,\n Store\n} = utils;\n\n// Cache singleton instances which should be included only once in a page\nconst globalCache = {};\nconst defaultRegistry = globalRegistry.components;\n\nconst overrideRegistryDefinitions = (overrideRegistry, registry) => {\n overrideRegistry.forEach((def) => {\n registry.register(def);\n });\n};\n\n/**\n * Entry point to renderer. Initializes an environment with settings and registries for canvas. This is a simple wrapper\n * over {@link Canvas} which enables common configuration passing to multiple such canvases.\n *\n * Everytime `muze()` is called it creates an environment. These environment supports subset of APIs of Canvas. If\n * common configuration is used to render multiple canvases then it can be set directly in the env. Like if data is\n * common across all the visulization then its better to set the data in env. When a canvas is created it receives all\n * those configuration from env.\n *\n * ```\n * // Creates an environment\n * const env = muze()\n * // Set data property in environment, so that all the canvas created from the same environment gets this data\n * // automatically\n * env.data(dm);\n * // Creates canvas, by default env pushes data to canvas instance\n * const canvas = env.canvas();\n * ```\n *\n * If a property is set on both environment and canvas instance, property set on canvas instance gets more priority.\n *\n * @public\n * @module muze\n * @namespace Muze\n *\n * @return {Env} Instance of an environment\n */\nconst muze = () => {\n // Setters and getters will be mounted on this. Object will be mutated.\n const [env, globalStore] = transactor({}, options);\n const components = Object.assign({}, globalRegistry.components.get());\n const componentSubRegistryDef = Object.assign({}, SUBREGISTRIES);\n\n const componentSubRegistry = {};\n\n for (const prop in componentSubRegistryDef) {\n componentSubRegistry[prop] = componentSubRegistryDef[prop](globalRegistry[prop].get());\n }\n\n // Apart form the setter getter, an instance method is injected to create real renderer instances\n env.canvas = () => {\n // Create a canvas instance with this settings\n const settings = globalStore.serialize();\n const canvas = Canvas.withSettings(settings, { /* registry */\n components,\n componentSubRegistry,\n interactions: globalRegistry.interactions\n }, env.globalDependencies());\n\n // Whenever settings is changed canvas is updated\n enableChainedTransaction(globalStore, canvas, Object.keys(settings));\n\n return canvas;\n };\n\n // Global dependencies for for compositions. Only one copy of the same should be in the page\n env.globalDependencies = () => {\n if (!globalCache.smartlabel) {\n globalCache.smartlabel = new Smartlabel(1, 'body');\n }\n return {\n smartlabel: globalCache.smartlabel,\n lifeCycleManager: new LifeCycleManager()\n };\n };\n\n // Retrieves global settings. This getter is readonly so that user can't change this as change should happen\n // only from setter to avoid unwanted sync issues.\n env.settings = () => globalStore.serialize();\n\n env.registry = (...overrideRegistry) => {\n // Selectively copy the properties from COMPONENTS\n if (overrideRegistry.length) {\n overrideRegistry.forEach((def) => {\n const prop = def.formalName();\n if (prop in defaultRegistry) {\n components[prop] = def;\n }\n });\n return env;\n }\n return components;\n };\n\n env.cellRegistry = (...overrideRegistry) => {\n const cellRegistry = componentSubRegistry.cellRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry, cellRegistry);\n return env;\n }\n return cellRegistry.get();\n };\n\n env.layerRegistry = (...overrideRegistry) => {\n const layerRegistry = componentSubRegistry.layerRegistry;\n if (overrideRegistry.length) {\n overrideRegistryDefinitions(overrideRegistry, layerRegistry);\n return env;\n }\n return layerRegistry.get();\n };\n\n return env;\n};\n\nmuze.registry = globalRegistry;\n\nmuze.Components = {\n VisualLayer: {\n layers: {\n BaseLayer,\n LineLayer,\n TextLayer,\n TickLayer,\n PointLayer,\n SimpleLayer,\n AreaLayer,\n ArcLayer\n },\n helpers,\n enums,\n layerMixins\n },\n VisualUnit: {\n constructor: VisualUnit,\n helpers: unitHelpers,\n enums: unitEnums,\n UnitFireBolt\n },\n VisualGroup: {\n constructor: VisualGroup,\n Encoders,\n encoderHelpers,\n groupUtils,\n enums: groupEnums\n },\n Canvas: {\n constructor: Canvas\n },\n Firebolt: {\n constructor: Firebolt\n }\n};\n\nconst SideEffects = {\n sideEffects,\n standards: {\n SurrogateSideEffect,\n SpawnableSideEffect,\n GenericSideEffect\n }\n};\n\nconst Behaviours = {\n behaviouralActions,\n standards: {\n GenericBehaviour,\n PersistentBehaviour,\n VolatileBehaviour\n }\n};\n\nmuze.DataModel = DataModel;\nmuze.version = pkg.version;\nmuze.SideEffects = SideEffects;\nmuze.ActionModel = ActionModel;\nmuze.layerFactory = layerFactory;\nmuze.Operators = operators;\nmuze.Behaviours = Behaviours;\nmuze.utils = utils;\nmuze.Model = new Store().model.constructor;\n\nexport default muze;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/release/package.json b/release/package.json new file mode 100644 index 00000000..8ba33580 --- /dev/null +++ b/release/package.json @@ -0,0 +1,67 @@ +{ + "name": "muze", + "version": "1.3.0", + "description": "Composable visualisation library for web with a data-first approach", + "homepage": "https://muzejs.org", + "license": "MIT", + "author": "Muzejs.org (https://muzejs.org/)", + "contributors": [ + { + "name": "Akash Goswami", + "email": "akashgoswami90s@gmail.com" + }, + { + "name": "Ranajit Banerjee", + "email": "ranajit.113124@gmail.com", + "url": "https://github.com/ranajitbanerjee" + }, + { + "name": "Mridul Meharia", + "email": "mehariamridul@gmail.com", + "url": "https://github.com/mridulmeh" + }, + { + "name": "Subhash Haldar" + }, + { + "name": "Sandeep Acharya" + }, + { + "name": "Rousan Ali", + "email": "hello@rousan.io", + "url": "https://rousan.io" + }, + { + "name": "Ujjal Kumar Dutta", + "email": "duttaujjal143@gmail.com" + }, + { + "name": "Adarsh Lilha", + "email": "adarshlilha@gmail.com", + "url": "https://adarshlilha.com" + }, + { + "name": "Swati Mukherjee", + "email": "swati@charts.com" + } + ], + "main": "dist/muze.js", + "keywords": [ + "muze", + "svg", + "vector", + "graphics", + "data-visualization", + "visualization", + "renderer", + "fusioncharts", + "relational", + "algebra", + "relation" + ], + "repository": { + "type": "git", + "url": "https://github.com/chartshq/muze" + }, + "dependencies": {} +} diff --git a/scripts/make-release-build.js b/scripts/make-release-build.js new file mode 100644 index 00000000..81187a55 --- /dev/null +++ b/scripts/make-release-build.js @@ -0,0 +1,121 @@ +const fs = require('fs-extra'); +const path = require('path'); +const prompts = require('prompts'); +const semver = require('semver'); +const chalk = require('chalk'); +const ora = require('ora'); +const shell = require('shelljs'); +const axios = require('axios'); + +/* eslint-disable no-console, require-jsdoc */ + +const askVersion = async (currentVersion) => { + const response = await prompts({ + type: 'text', + name: 'version', + message: chalk.grey('What\'s the new release version?'), + validate: (value) => { + if (!semver.valid(value)) { + return 'Value should be a semver value'; + } else if (semver.lte(value, currentVersion)) { + return `New version should be greater than current version ${currentVersion}`; + } + return true; + } + }); + + return semver.parse(response.version).format(); +}; + +const confirmReadChecklist = async () => { + const response = await prompts({ + type: 'text', + name: 'readChecklist', + message: chalk.grey('Have you read the checklist before being here? [Y/N]'), + validate: value => (value.toUpperCase() === 'Y' || value.toUpperCase() === 'N' ? true : 'Enter \'Y\' or \'N\'') + }); + + return response.readChecklist; +}; + +const makeReleaseBuild = () => new Promise((res, rej) => { + shell.exec('npm run build', { silent: true }, (code, stdout, stderr) => { + if (code === 0) { + res(); + } else { + rej(new Error(stderr)); + } + }); +}); + +const run = async () => { + const rootPath = path.resolve(__dirname, '..'); + const muzePkgFilePath = path.resolve(rootPath, 'packages/muze/package.json'); + const distPath = path.resolve(rootPath, 'dist'); + const releasePath = path.resolve(rootPath, 'release'); + const releaseDistPath = path.resolve(releasePath, 'dist'); + + await fs.ensureDir(releasePath); + await fs.ensureDir(releaseDistPath); + + process.stdout.write('\n'); + + const readChecklist = await confirmReadChecklist(); + if (readChecklist.toUpperCase() === 'N') { + process.stdout.write('\n'); + process.stdout.write('How dare you come here without reading checklist?'); + process.stdout.write('\n'); + return; + } + + const currentMuzePkg = await fs.readJSON(muzePkgFilePath); + const newVersion = await askVersion(currentMuzePkg.version); + + let spinner = ora('Creating a release-ready build').start(); + + currentMuzePkg.version = newVersion; + await fs.writeJSON(muzePkgFilePath, currentMuzePkg, { spaces: 2 }); + + try { + await makeReleaseBuild(); + spinner.succeed('Created a release-ready build'); + } catch (error) { + spinner.fail('Failed to create release-ready build'); + } + + spinner = ora('Deleting previous distributable files').start(); + await fs.remove(releaseDistPath); + spinner.succeed('Deleted previous distributable files'); + + spinner = ora('Copying current distributable files').start(); + await fs.copy(distPath, releaseDistPath, { overwrite: true }); + spinner.succeed('Copied current distributable files'); + + spinner = ora('Copying README.md and LICENSE').start(); + await fs.copy(path.resolve(rootPath, 'README.md'), path.resolve(releasePath, 'README.md'), { overwrite: true }); + await fs.copy(path.resolve(rootPath, 'LICENSE'), path.resolve(releasePath, 'LICENSE'), { overwrite: true }); + spinner.succeed('Copied README.md and LICENSE'); + + spinner = ora('Preparing packages.json for release').start(); + const releasePkgPath = path.resolve(releasePath, 'package.json'); + let releasePkg; + + if (fs.existsSync(releasePkgPath)) { + releasePkg = await fs.readJSON(releasePkgPath); + } else { + const downloadSpinner = ora('Downloading release package file from unpkg.com').start(); + const { data } = await axios.get('https://unpkg.com/muze/package.json'); + releasePkg = data; + downloadSpinner.succeed('Downloaded release package file from unpkg.com'); + } + + releasePkg.version = newVersion; + await fs.writeJSON(releasePkgPath, releasePkg, { spaces: 2 }); + + spinner.succeed('Prepared packages.json for release'); + ora('').start().succeed('Ready to release'); +}; + +run() + // eslint-disable-next-line + .catch(console.error.bind(console)); diff --git a/scripts/run-autotest.js b/scripts/run-autotest.js index 154cf512..f81f2f88 100644 --- a/scripts/run-autotest.js +++ b/scripts/run-autotest.js @@ -15,6 +15,9 @@ const FormData = require('form-data'); const axios = require('axios'); const prompt = require('prompt'); +/* eslint-disable no-console, max-len */ + +const isCI = process.env.CI; const mycroftProtocol = process.env.MYCROFT_PROTOCOL; const mycroftHost = process.env.MYCROFT_HOST; const mycroftPort = process.env.MYCROFT_PORT; @@ -25,12 +28,16 @@ const currentPrintStream = process.stdout; const initiateStatusInterval = 1000; let cursorRelYPos = 0; +if (isCI) { + console.log(JSON.stringify({ mycroftHost, mycroftPort, mycroftProtocol, mollyHost, mollyPort, mollyProtocol }, null, 2)); +} + program .option('-m, --mode ', 'The muze build mode') .option('-l, --lib ', 'The library name to be uploaded to sherlock') .parse(process.argv); -let { mode, lib } = program; +let { mode } = program; if (!mode) { mode = 'production'; } @@ -45,7 +52,7 @@ const log = (text) => { }; const makeBuild = buildMode => new Promise((res, rej) => { - shell.exec(`./scripts/make-build.sh "${buildMode}"`, { async: true, silent: true }, (code, stdout, stderr) => { + shell.exec(`./scripts/make-build.sh "${buildMode}"`, { async: true, silent: !isCI }, (code, stdout, stderr) => { if (code) { const err = new Error(); err.stdout = stdout; @@ -58,7 +65,7 @@ const makeBuild = buildMode => new Promise((res, rej) => { }); const currBranch = () => new Promise((res, rej) => { - shell.exec('git branch | grep \\* | cut -d \' \' -f2', { async: true, silent: true }, (code, stdout, stderr) => { + shell.exec('git branch | grep \\* | cut -d \' \' -f2', { async: true, silent: !isCI }, (code, stdout, stderr) => { if (code) { const err = new Error(); err.stdout = stdout; @@ -73,13 +80,14 @@ const currBranch = () => new Promise((res, rej) => { const generateBuildTag = async (v) => { let tag; const muzeVersion = `v${v}`; - const currentBranch = await currBranch(); - const m = currentBranch.match(/^(.+)\/#(\d+)-(.+)$/); + let currentBranch = await currBranch(); - if (m) { - tag = semver.valid(`${muzeVersion}-${m[1]}-${m[2]}-${m[3].slice(0, 30)}`); + if (isCI) { + console.log(JSON.stringify({ currentBranch }, null, 2)); } + currentBranch = currentBranch.replace(/[^\w]+/g, '-'); + tag = semver.valid(`${muzeVersion}-${currentBranch}`); tag = tag || semver.valid(`${muzeVersion}-${uuid().replace(/-/g, '')}`); return `v${tag}`; @@ -99,14 +107,28 @@ const uploadBuild = async (tag) => { return uploadRes; }; -const initiateAutoTest = async (tag) => { - const reqId = uuid(); - const testcaseInitiateURL = `${mycroftProtocol}://${mycroftHost}:${mycroftPort}/api/v1/autotest/initiate`; - const payload = { +const createAutoTestPayload = (reqId, tag) => { + const testsPath = path.resolve(__dirname, '..', 'sherlock-test.json'); + if (fs.existsSync(testsPath)) { + const { groups } = fs.readJsonSync(testsPath); + return { + requestId: reqId, + libVersion: tag, + groups + }; + } + + return { requestId: reqId, libVersion: tag, all: true }; +}; + +const initiateAutoTest = async (tag) => { + const reqId = uuid(); + const testcaseInitiateURL = `${mycroftProtocol}://${mycroftHost}:${mycroftPort}/api/v1/autotest/initiate`; + const payload = createAutoTestPayload(reqId, tag); await axios.post(testcaseInitiateURL, payload); return reqId; }; @@ -204,21 +226,26 @@ const printAutotestSummery = async (tag) => { }; const run = async () => { - prompt.message = ''; - prompt.start(); - - let { tag } = await promisify(prompt.get.bind(prompt))({ - properties: { - tag: { - conform: value => !!semver.valid(value), - message: 'Should be semver value', - description: 'Enter tag name[current branch]', - type: 'string', - required: false, - before: value => (value ? `v${semver.valid(value)}` : '') + let tag = null; + + if (!isCI) { + prompt.message = ''; + prompt.start(); + + const resp = await promisify(prompt.get.bind(prompt))({ + properties: { + tag: { + conform: value => !!semver.valid(value), + message: 'Should be semver value', + description: 'Enter tag name[current branch]', + type: 'string', + required: false, + before: value => (value ? `v${semver.valid(value)}` : '') + } } - } - }); + }); + tag = resp.tag; + } const muzePkg = await fs.readJSON(path.resolve('packages/muze/package.json')); tag = tag || await generateBuildTag(muzePkg.version); diff --git a/sherlock-test.json b/sherlock-test.json new file mode 100644 index 00000000..8b87e993 --- /dev/null +++ b/sherlock-test.json @@ -0,0 +1,6 @@ +{ + "groups": { + "groupNames":["color"] , + "subGroups":["arc","area"] + } +}